Skip to content

Commit d774254

Browse files
committed
Update registry components to latest versions
1 parent 9c1488c commit d774254

15 files changed

Lines changed: 719 additions & 343 deletions

frontend/bun.lock

Lines changed: 121 additions & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
"@a2a-js/sdk": "^0.3.13",
7575
"@autoform/react": "^4.0.0",
7676
"@autoform/zod": "^5.0.0",
77-
"@base-ui/react": "^1.4.0",
77+
"@base-ui/react": "^1.5.0",
7878
"@buf/redpandadata_cloud.connectrpc_query-es": "^2.2.0-20251128173054-b9f9fc6e5a70.1",
7979
"@buf/redpandadata_common.bufbuild_es": "^2.11.0-20260316210807-5d899910f714.1",
8080
"@bufbuild/cel": "^0.4.0",
@@ -102,7 +102,7 @@
102102
"@tailwindcss/postcss": "^4.2.4",
103103
"@tanstack/react-form": "^1.12.3",
104104
"@tanstack/react-query": "^5.90.7",
105-
"@tanstack/react-router": "^1.168.10",
105+
"@tanstack/react-router": "^1.170.7",
106106
"@tanstack/react-table": "^8.21.3",
107107
"@tanstack/react-virtual": "^3.13.12",
108108
"@tanstack/zod-adapter": "^1.158.0",
@@ -126,12 +126,12 @@
126126
"json-bigint": "^1.0.0",
127127
"jwt-decode": "^4.0.0",
128128
"lottie-react": "^2.4.1",
129-
"lucide-react": "^1.14.0",
129+
"lucide-react": "^1.16.0",
130130
"moment": "^2.30.1",
131131
"monaco-editor": "^0.54.0",
132132
"monaco-editor-webpack-plugin": "^7.1.1",
133133
"monaco-yaml": "^5.5.0",
134-
"motion": "^12.38.0",
134+
"motion": "^12.40.0",
135135
"nanoid": "^5.1.6",
136136
"nuqs": "^2.6.0",
137137
"pretty-bytes": "^5.6.0",

frontend/src/components/redpanda-ui/components/button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const buttonVariants = cva(
5151
'disabled:bg-background-disabled disabled:text-disabled',
5252
],
5353
destructive: [
54-
'bg-destructive text-inverse shadow-xs',
54+
'bg-surface-error text-inverse shadow-xs',
5555
'hover:bg-surface-error-hover',
5656
'active:bg-surface-error-pressed',
5757
'focus-visible:ring-destructive',

frontend/src/components/redpanda-ui/components/code-block-dynamic.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import { buttonVariants } from './button';
2929
import { useShiki } from '../lib/use-shiki';
3030
import { cn, type SharedProps } from '../lib/utils';
3131

32-
export function useEffectEvent<F extends (...params: never[]) => unknown>(callback: F): F {
32+
export function useStableCallback<F extends (...params: never[]) => unknown>(callback: F): F {
3333
const ref = useRef(callback);
3434
ref.current = callback;
3535

@@ -40,7 +40,7 @@ export function useCopyButton(onCopy: () => void | Promise<void>): [checked: boo
4040
const [checked, setChecked] = useState(false);
4141
const timeoutRef = useRef<number | null>(null);
4242

43-
const onClick: MouseEventHandler = useEffectEvent(() => {
43+
const onClick: MouseEventHandler = useStableCallback(() => {
4444
if (timeoutRef.current) {
4545
window.clearTimeout(timeoutRef.current);
4646
}
@@ -293,8 +293,6 @@ export function DynamicCodeBlock({
293293

294294
return (
295295
<>
296-
{/* React 19 stylesheet hoisting props (href, precedence) — not yet typed in @types/react@18. */}
297-
{/* @ts-expect-error remove once React types are upgraded to 19 */}
298296
<style href="shiki-dual-theme" precedence="medium">
299297
{shikiDualThemeStyles}
300298
</style>

frontend/src/components/redpanda-ui/components/dialog.tsx

Lines changed: 76 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ import { X } from 'lucide-react';
44
import React from 'react';
55

66
import { Button } from './button';
7+
import { useAnimatedAutoHeight } from '../lib/use-animated-auto-height';
78
import { usePortalContainer } from '../lib/use-portal-container';
9+
import { useScrollShadow } from '../lib/use-scroll-shadow';
810
import {
911
asChildTrigger,
1012
narrowOpenChange,
@@ -59,10 +61,9 @@ function DialogClose({ ...props }: DialogCloseProps) {
5961
function DialogOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Backdrop>) {
6062
return (
6163
<DialogPrimitive.Backdrop
62-
// fill-mode-forwards holds the exit keyframe until Base UI unmounts;
63-
// without it the backdrop flashes back to its natural opacity for one frame.
6464
className={cn(
65-
'data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/40 fill-mode-forwards backdrop-blur-xs data-[state=closed]:animate-out data-[state=open]:animate-in',
65+
'fixed inset-0 z-50 bg-black/40 backdrop-blur-xs transition-opacity duration-200 ease-out',
66+
'data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 motion-reduce:transition-none',
6667
className
6768
)}
6869
data-slot="dialog-overlay"
@@ -72,8 +73,9 @@ function DialogOverlay({ className, ...props }: React.ComponentProps<typeof Dial
7273
);
7374
}
7475

76+
// `height` is intentionally omitted from the transition list — useAnimatedAutoHeight drives it.
7577
const dialogContentVariants = cva(
76-
'data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 flex max-h-[85vh] w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] flex-col overflow-hidden rounded-xl border bg-background fill-mode-forwards shadow-lg duration-200 data-[state=closed]:animate-out data-[state=open]:animate-in',
78+
'fixed top-[50%] left-[50%] z-50 flex w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] flex-col overflow-hidden rounded-xl border bg-background shadow-lg transition-[opacity,transform,max-height,min-height] duration-200 ease-out data-[ending-style]:scale-95 data-[starting-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 motion-reduce:transition-none',
7779
{
7880
variants: {
7981
size: {
@@ -88,10 +90,18 @@ const dialogContentVariants = cva(
8890
centered: 'text-center',
8991
destructive: 'border-destructive/50',
9092
},
93+
height: {
94+
auto: 'max-h-[85vh]',
95+
sm: 'h-[min(85vh,400px)]',
96+
md: 'h-[min(85vh,560px)]',
97+
lg: 'h-[min(85vh,720px)]',
98+
xl: 'h-[min(85vh,880px)]',
99+
},
91100
},
92101
defaultVariants: {
93102
size: 'md',
94103
variant: 'standard',
104+
height: 'auto',
95105
},
96106
}
97107
);
@@ -111,6 +121,7 @@ function DialogContent({
111121
showOverlay = true,
112122
size,
113123
variant,
124+
height,
114125
testId,
115126
container,
116127
onOpenAutoFocus,
@@ -123,13 +134,16 @@ function DialogContent({
123134
'Use `initialFocus` on Base UI `Dialog.Popup` instead.'
124135
);
125136
const portalContainer = usePortalContainer();
137+
const isAutoHeight = !height || height === 'auto';
138+
const setPopupRef = useAnimatedAutoHeight<HTMLDivElement>(isAutoHeight);
126139
return (
127140
<DialogPortal container={container ?? portalContainer}>
128141
{showOverlay ? <DialogOverlay /> : null}
129142
<DialogPrimitive.Popup
130-
className={cn(dialogContentVariants({ size, variant }), className)}
143+
className={cn(dialogContentVariants({ size, variant, height }), className)}
131144
data-slot="dialog-content"
132145
data-testid={testId}
146+
ref={setPopupRef}
133147
render={renderWithDataState('div')}
134148
{...props}
135149
>
@@ -249,9 +263,17 @@ function DialogDescription({
249263
);
250264
}
251265

252-
// min-h-0 lets the body shrink below its natural height so overflow-y-auto scrolls.
253-
const dialogBodyVariants = cva('min-h-0 flex-1 overflow-y-auto p-4', {
266+
// Padding lives on the inner wrapper so scroll shadows can sit flush against the body edges.
267+
const dialogBodyContainerVariants = cva('relative min-h-0 flex-1 overflow-y-auto');
268+
269+
const dialogBodyContentVariants = cva('', {
254270
variants: {
271+
padding: {
272+
none: '',
273+
sm: 'p-2',
274+
md: 'p-4',
275+
lg: 'p-6',
276+
},
255277
spacing: {
256278
none: '',
257279
sm: 'space-y-2',
@@ -260,14 +282,58 @@ const dialogBodyVariants = cva('min-h-0 flex-1 overflow-y-auto p-4', {
260282
},
261283
},
262284
defaultVariants: {
285+
padding: 'md',
263286
spacing: 'md',
264287
},
265288
});
266289

267-
interface DialogBodyProps extends React.ComponentProps<'div'>, VariantProps<typeof dialogBodyVariants> {}
290+
interface DialogBodyProps extends React.ComponentProps<'div'>, VariantProps<typeof dialogBodyContentVariants> {
291+
/** Show fading top/bottom shadows when the body overflows. Defaults to `true`. */
292+
scrollShadow?: boolean;
293+
}
294+
295+
function DialogBody({ className, padding, spacing, scrollShadow = true, children, style, ...props }: DialogBodyProps) {
296+
const { containerRef, topRef, bottomRef, edges } = useScrollShadow<HTMLDivElement>(scrollShadow);
268297

269-
function DialogBody({ className, spacing, ...props }: DialogBodyProps) {
270-
return <div className={cn(dialogBodyVariants({ spacing }), className)} data-slot="dialog-body" {...props} />;
298+
return (
299+
<div
300+
className={cn(dialogBodyContainerVariants(), className)}
301+
data-slot="dialog-body"
302+
ref={containerRef}
303+
style={style}
304+
{...props}
305+
>
306+
{scrollShadow ? (
307+
<>
308+
<div aria-hidden className="h-px shrink-0" ref={topRef} />
309+
<div
310+
aria-hidden
311+
className={cn(
312+
'pointer-events-none sticky top-0 z-10 h-0 transition-opacity duration-150',
313+
edges.top ? 'opacity-100' : 'opacity-0'
314+
)}
315+
>
316+
<div className="absolute inset-x-0 top-0 h-3 bg-gradient-to-b from-black/[0.10] to-transparent" />
317+
</div>
318+
</>
319+
) : null}
320+
<div className={cn(dialogBodyContentVariants({ padding, spacing }))}>{children}</div>
321+
{scrollShadow ? (
322+
<>
323+
<div
324+
aria-hidden
325+
className={cn(
326+
'pointer-events-none sticky bottom-0 z-10 h-0 transition-opacity duration-150',
327+
edges.bottom ? 'opacity-100' : 'opacity-0'
328+
)}
329+
>
330+
<div className="absolute inset-x-0 bottom-0 h-3 bg-gradient-to-t from-black/[0.10] to-transparent" />
331+
</div>
332+
<div aria-hidden className="h-px shrink-0" ref={bottomRef} />
333+
</>
334+
) : null}
335+
</div>
336+
);
271337
}
272338

273339
const dialogFieldVariants = cva('flex flex-col', {

frontend/src/components/redpanda-ui/components/icons.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,3 +1025,16 @@ export function PythonIcon(props: React.SVGProps<SVGSVGElement>) {
10251025
</svg>
10261026
);
10271027
}
1028+
1029+
/** Official Prometheus logo in canonical orange (#e6522c). */
1030+
export function PrometheusIcon(props: React.SVGProps<SVGSVGElement>) {
1031+
return (
1032+
<svg aria-label="Prometheus" role="img" viewBox="0 0 256 256" xmlns="http://www.w3.org/2000/svg" {...props}>
1033+
<title>Prometheus</title>
1034+
<path
1035+
d="M128 0C57.317 0 0 57.317 0 128c0 70.683 57.317 128 128 128s128-57.317 128-128C256 57.317 198.683 0 128 0zm0 239.46c-15.097 0-27.337-10.27-27.337-22.94h54.673c0 12.67-12.24 22.94-27.336 22.94zm45.144-30.55H82.855v-15.7h90.29v15.7zm-.323-23.97H83.142c-.3-.345-.605-.687-.892-1.04-9.187-11.155-11.35-16.98-13.448-22.916-.036-.197 10.69 2.193 18.297 3.91 0 0 3.917.907 9.645 1.954-5.5-6.45-8.762-14.654-8.762-23.034 0-18.405 14.107-34.49 9.018-47.498 4.95.403 10.25 10.453 10.609 26.166 5.272-7.286 7.469-20.595 7.469-28.762 0-8.45 5.564-18.272 11.13-18.621-4.964 8.18.13 15.198 5.564 32.62 2.04 6.54 1.78 17.55 3.355 24.539.524-14.508 3.011-35.69 12.155-42.998-4.035 9.146 1.196 20.586 4.794 26.108 5.808 8.92 9.327 15.682 9.327 28.476 0 8.575-3.165 16.628-8.515 22.93 6.058-1.137 10.244-2.16 10.244-2.16l19.6-3.826c.001 0-2.847 11.7-13.788 24.142z"
1036+
fill="#e6522c"
1037+
/>
1038+
</svg>
1039+
);
1040+
}

frontend/src/components/redpanda-ui/components/input.tsx

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,14 +168,23 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
168168
layout = 'password';
169169
}
170170

171+
let inputValueProps: { defaultValue?: InputProps['defaultValue']; value?: InputProps['value'] };
172+
if (isNumberInput) {
173+
inputValueProps = { value };
174+
} else if (props.value !== undefined) {
175+
inputValueProps = { value: props.value };
176+
} else {
177+
inputValueProps = { defaultValue };
178+
}
179+
171180
const inputElement = (
172181
<input
173182
{...props}
174183
aria-describedby={props['aria-describedby'] ?? fieldCtx.errorId}
175184
aria-invalid={props['aria-invalid'] ?? (fieldCtx.invalid || undefined)}
176185
className={cn(inputVariants({ size, variant: inputVariant }), positionClasses, className)}
177186
data-slot="input"
178-
data-testid={testId}
187+
{...(testId !== undefined && { 'data-testid': testId })}
179188
onChange={isNumberInput ? handleInputChange : props.onChange}
180189
readOnly={readOnly}
181190
ref={ref}
@@ -185,7 +194,7 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
185194
paddingRight: endWidth ? endWidth + 16 : undefined,
186195
}}
187196
type={inputType}
188-
{...(isNumberInput ? { value } : props.value !== undefined ? { value: props.value } : { defaultValue })}
197+
{...inputValueProps}
189198
/>
190199
);
191200

@@ -211,6 +220,8 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
211220
{isPasswordInput ? (
212221
<InputEnd className="pointer-events-auto">
213222
<Button
223+
aria-label={showPassword ? 'Hide password' : 'Show password'}
224+
aria-pressed={showPassword}
214225
disabled={props.disabled || readOnly}
215226
onClick={() => setShowPassword(!showPassword)}
216227
size={passwordToggleSize}
@@ -224,6 +235,7 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
224235
{shouldShowControls ? (
225236
<div className="flex flex-row gap-1">
226237
<Button
238+
aria-label="Increment value"
227239
className={stepControlVariants({ size })}
228240
disabled={props.disabled || readOnly}
229241
onClick={increment}
@@ -233,6 +245,7 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
233245
<Plus />
234246
</Button>
235247
<Button
248+
aria-label="Decrement value"
236249
className={stepControlVariants({ size })}
237250
disabled={props.disabled || readOnly}
238251
onClick={decrement}

0 commit comments

Comments
 (0)