@dev-dga/react 0.4.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +106 -0
- package/README.md +9 -1
- package/dist/index.cjs +3797 -797
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +990 -13
- package/dist/index.d.ts +990 -13
- package/dist/index.js +3727 -803
- package/dist/index.js.map +1 -1
- package/package.json +8 -4
package/dist/index.d.cts
CHANGED
|
@@ -2,15 +2,17 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
3
3
|
import { ReactNode } from 'react';
|
|
4
4
|
import { VariantProps } from 'class-variance-authority';
|
|
5
|
-
import { Checkbox as Checkbox$1, RadioGroup as RadioGroup$1, Switch as Switch$1, Select as Select$1 } from 'radix-ui';
|
|
5
|
+
import { Checkbox as Checkbox$1, RadioGroup as RadioGroup$1, Switch as Switch$1, Select as Select$1, Avatar as Avatar$1, Tooltip as Tooltip$1, Dialog, Tabs as Tabs$1, Accordion as Accordion$1, Progress as Progress$1, DropdownMenu as DropdownMenu$1, Slider as Slider$1, Toggle as Toggle$1, ToggleGroup as ToggleGroup$1 } from 'radix-ui';
|
|
6
|
+
import { Command } from 'cmdk';
|
|
6
7
|
import { DgaTheme } from '@dev-dga/tokens';
|
|
7
8
|
export { DgaTheme, PaletteName, ThemeColor } from '@dev-dga/tokens';
|
|
8
9
|
import { ClassValue } from 'clsx';
|
|
9
10
|
|
|
10
11
|
declare const buttonVariants: (props?: ({
|
|
11
|
-
variant?: "primary" | "secondary" | "outline" | "ghost" | "destructive" | null | undefined;
|
|
12
|
+
variant?: "primary" | "secondary" | "outline" | "ghost" | "destructive" | "destructive-outline" | "destructive-subtle" | "destructive-ghost" | null | undefined;
|
|
12
13
|
size?: "sm" | "md" | "lg" | "icon" | "icon-sm" | null | undefined;
|
|
13
14
|
fullWidth?: boolean | null | undefined;
|
|
15
|
+
inverted?: boolean | null | undefined;
|
|
14
16
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
15
17
|
interface ButtonProps extends React.ComponentProps<'button'>, VariantProps<typeof buttonVariants> {
|
|
16
18
|
loading?: boolean;
|
|
@@ -35,7 +37,7 @@ interface ButtonProps extends React.ComponentProps<'button'>, VariantProps<typeo
|
|
|
35
37
|
*/
|
|
36
38
|
asChild?: boolean;
|
|
37
39
|
}
|
|
38
|
-
declare function Button({ variant, size, fullWidth, loading, disabled, startIcon, endIcon, iconFlip, asChild, className, children, type, ...props }: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
40
|
+
declare function Button({ variant, size, fullWidth, inverted, loading, disabled, startIcon, endIcon, iconFlip, asChild, className, children, type, ...props }: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
39
41
|
|
|
40
42
|
declare const inputVariants: (props?: ({
|
|
41
43
|
size?: "sm" | "md" | "lg" | null | undefined;
|
|
@@ -170,6 +172,959 @@ interface SelectItemProps extends React.ComponentProps<typeof Select$1.Item> {
|
|
|
170
172
|
declare function Select({ id: externalId, label, helperText, errorMessage, error, size, required, placeholder, className, children, ...rootProps }: SelectProps): react_jsx_runtime.JSX.Element;
|
|
171
173
|
declare function SelectItem({ className, children, ...props }: SelectItemProps): react_jsx_runtime.JSX.Element;
|
|
172
174
|
|
|
175
|
+
declare const cardVariants: (props?: ({
|
|
176
|
+
variant?: "outline" | "ghost" | "default" | "elevated" | "filled" | "gradient" | null | undefined;
|
|
177
|
+
padding?: "sm" | "md" | "lg" | null | undefined;
|
|
178
|
+
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
179
|
+
interactive?: boolean | null | undefined;
|
|
180
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
181
|
+
interface CardProps extends React.ComponentProps<'div'>, VariantProps<typeof cardVariants> {
|
|
182
|
+
/** Render as the single child element instead of a `<div>` (see Button). */
|
|
183
|
+
asChild?: boolean;
|
|
184
|
+
}
|
|
185
|
+
type CardSectionProps = React.ComponentProps<'div'> & {
|
|
186
|
+
asChild?: boolean;
|
|
187
|
+
};
|
|
188
|
+
interface CardTitleProps extends React.ComponentProps<'h3'> {
|
|
189
|
+
/** Override the heading element (e.g. render an `<h2>` or `<a>`). */
|
|
190
|
+
asChild?: boolean;
|
|
191
|
+
}
|
|
192
|
+
type CardDescriptionProps = React.ComponentProps<'p'> & {
|
|
193
|
+
asChild?: boolean;
|
|
194
|
+
};
|
|
195
|
+
interface CardImageProps extends React.ComponentProps<'img'> {
|
|
196
|
+
/**
|
|
197
|
+
* Aspect ratio of the image in vertical orientation (e.g. `'16/9'`, `'4/3'`,
|
|
198
|
+
* `'1/1'`). Default `'16/9'`. Ignored in horizontal orientation — the image
|
|
199
|
+
* fills the card's full height there.
|
|
200
|
+
*/
|
|
201
|
+
aspectRatio?: string;
|
|
202
|
+
}
|
|
203
|
+
declare function Card({ variant, padding, orientation, interactive, asChild, className, ...props }: CardProps): react_jsx_runtime.JSX.Element;
|
|
204
|
+
declare function CardImage({ aspectRatio, className, style, ...props }: CardImageProps): react_jsx_runtime.JSX.Element;
|
|
205
|
+
declare function CardHeader({ asChild, className, ...props }: CardSectionProps): react_jsx_runtime.JSX.Element;
|
|
206
|
+
declare function CardTitle({ asChild, className, ...props }: CardTitleProps): react_jsx_runtime.JSX.Element;
|
|
207
|
+
declare function CardDescription({ asChild, className, ...props }: CardDescriptionProps): react_jsx_runtime.JSX.Element;
|
|
208
|
+
declare function CardContent({ asChild, className, ...props }: CardSectionProps): react_jsx_runtime.JSX.Element;
|
|
209
|
+
declare function CardFooter({ asChild, className, ...props }: CardSectionProps): react_jsx_runtime.JSX.Element;
|
|
210
|
+
|
|
211
|
+
declare const badgeVariants: (props?: ({
|
|
212
|
+
variant?: "primary" | "secondary" | "outline" | "destructive" | "destructive-subtle" | "default" | "success" | "warning" | "info" | "primary-subtle" | "secondary-subtle" | "success-subtle" | "warning-subtle" | "info-subtle" | null | undefined;
|
|
213
|
+
size?: "sm" | "md" | null | undefined;
|
|
214
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
215
|
+
interface BadgeProps extends React.ComponentProps<'span'>, VariantProps<typeof badgeVariants> {
|
|
216
|
+
/** Render as the single child element instead of a `<span>` (see Button). */
|
|
217
|
+
asChild?: boolean;
|
|
218
|
+
/**
|
|
219
|
+
* Render a leading status dot. The dot inherits its color from `currentColor`
|
|
220
|
+
* so it tracks the badge's tone (subtle variants get a dark dot, solid get a
|
|
221
|
+
* white dot). Pair with `*-subtle` variants for the classic status pill.
|
|
222
|
+
* Coexists with `startIcon` — the dot lands first.
|
|
223
|
+
*/
|
|
224
|
+
dot?: boolean;
|
|
225
|
+
/** Icon rendered before the badge text. Sized to the badge font (0.875em). */
|
|
226
|
+
startIcon?: ReactNode;
|
|
227
|
+
/** Icon rendered after the badge text. Sized to the badge font (0.875em). */
|
|
228
|
+
endIcon?: ReactNode;
|
|
229
|
+
/**
|
|
230
|
+
* Render a trailing close button — turns the badge into the DGA "tag/chip"
|
|
231
|
+
* pattern. Uncontrolled by default: the badge hides itself when the close
|
|
232
|
+
* button is clicked. Pass `open` to control visibility yourself.
|
|
233
|
+
*
|
|
234
|
+
* Not combinable with `asChild` — the consumer's slotted element (usually an
|
|
235
|
+
* `<a>`) would end up with an interactive `<button>` inside it, which is
|
|
236
|
+
* invalid HTML. In that combo the close button is suppressed and a dev
|
|
237
|
+
* warning is logged.
|
|
238
|
+
*/
|
|
239
|
+
dismissible?: boolean;
|
|
240
|
+
/** Controlled visibility. When provided, `onDismiss` becomes the only signal. */
|
|
241
|
+
open?: boolean;
|
|
242
|
+
/** Fires when the close button is clicked, in both controlled and uncontrolled mode. */
|
|
243
|
+
onDismiss?: () => void;
|
|
244
|
+
/** Accessible label on the close button. Defaults to `"Dismiss"`. Override for i18n. */
|
|
245
|
+
closeLabel?: string;
|
|
246
|
+
}
|
|
247
|
+
declare function Badge({ variant, size, asChild, dot, startIcon, endIcon, dismissible, open, onDismiss, closeLabel, className, children, ...props }: BadgeProps): react_jsx_runtime.JSX.Element | null;
|
|
248
|
+
|
|
249
|
+
declare const dividerVariants: (props?: ({
|
|
250
|
+
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
251
|
+
variant?: "dashed" | "solid" | null | undefined;
|
|
252
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
253
|
+
interface DividerProps extends Omit<React.ComponentProps<'div'>, 'role'>, VariantProps<typeof dividerVariants> {
|
|
254
|
+
/**
|
|
255
|
+
* Optional label rendered inside a horizontal divider. Ignored when
|
|
256
|
+
* `orientation="vertical"`. When set, the divider renders as a three-part
|
|
257
|
+
* flex (line — label — line) instead of a single bar.
|
|
258
|
+
*/
|
|
259
|
+
children?: React.ReactNode;
|
|
260
|
+
/**
|
|
261
|
+
* Where to place the label along the divider. Defaults to `center`. Ignored
|
|
262
|
+
* when no label is provided. `start` and `end` are logical (LTR/RTL aware).
|
|
263
|
+
*/
|
|
264
|
+
labelPosition?: 'start' | 'center' | 'end';
|
|
265
|
+
/**
|
|
266
|
+
* If `true`, the divider is treated as purely decorative and removed from
|
|
267
|
+
* the accessibility tree (`role="none"`). Defaults to `false`.
|
|
268
|
+
*/
|
|
269
|
+
decorative?: boolean;
|
|
270
|
+
}
|
|
271
|
+
declare function Divider({ orientation, variant, labelPosition, decorative, className, children, ...props }: DividerProps): react_jsx_runtime.JSX.Element;
|
|
272
|
+
|
|
273
|
+
declare const avatarVariants: (props?: ({
|
|
274
|
+
size?: "sm" | "md" | "lg" | "xs" | "xl" | null | undefined;
|
|
275
|
+
shape?: "square" | "circle" | null | undefined;
|
|
276
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
277
|
+
declare const fallbackVariants: (props?: ({
|
|
278
|
+
colorScheme?: "primary" | "secondary" | "destructive" | "default" | "success" | "warning" | "info" | null | undefined;
|
|
279
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
280
|
+
type AvatarStatus = 'online' | 'offline' | 'busy' | 'away';
|
|
281
|
+
interface AvatarProps extends React.ComponentProps<typeof Avatar$1.Root>, VariantProps<typeof avatarVariants> {
|
|
282
|
+
/**
|
|
283
|
+
* Presence indicator rendered in the bottom-{end} corner. The color tracks
|
|
284
|
+
* the status (online → success, busy → destructive, away → warning,
|
|
285
|
+
* offline → muted). Position flips in RTL automatically via logical props.
|
|
286
|
+
*/
|
|
287
|
+
status?: AvatarStatus;
|
|
288
|
+
/**
|
|
289
|
+
* Accessible label for the status indicator. Defaults to the status value
|
|
290
|
+
* (e.g. "online"). Pass a localized string for non-English UIs.
|
|
291
|
+
*/
|
|
292
|
+
statusLabel?: string;
|
|
293
|
+
}
|
|
294
|
+
type AvatarImageProps = React.ComponentProps<typeof Avatar$1.Image>;
|
|
295
|
+
interface AvatarFallbackProps extends React.ComponentProps<typeof Avatar$1.Fallback>, VariantProps<typeof fallbackVariants> {
|
|
296
|
+
}
|
|
297
|
+
interface AvatarGroupProps extends React.ComponentProps<'div'> {
|
|
298
|
+
/**
|
|
299
|
+
* Cap the number of visible Avatars. Excess children are collapsed into a
|
|
300
|
+
* trailing "+N" chip. When unset, every child is rendered.
|
|
301
|
+
*/
|
|
302
|
+
max?: number;
|
|
303
|
+
/** Size cascaded to each child Avatar that doesn't already set its own size. */
|
|
304
|
+
size?: VariantProps<typeof avatarVariants>['size'];
|
|
305
|
+
/** Shape cascaded to each child Avatar that doesn't already set its own shape. */
|
|
306
|
+
shape?: VariantProps<typeof avatarVariants>['shape'];
|
|
307
|
+
}
|
|
308
|
+
declare function Avatar({ size, shape, status, statusLabel, className, children, ...props }: AvatarProps): react_jsx_runtime.JSX.Element;
|
|
309
|
+
declare function AvatarImage({ className, ...props }: AvatarImageProps): react_jsx_runtime.JSX.Element;
|
|
310
|
+
declare function AvatarFallback({ colorScheme, className, ...props }: AvatarFallbackProps): react_jsx_runtime.JSX.Element;
|
|
311
|
+
declare function AvatarGroup({ max, size, shape, className, children, ...props }: AvatarGroupProps): react_jsx_runtime.JSX.Element;
|
|
312
|
+
|
|
313
|
+
declare const tooltipContentVariants: (props?: ({
|
|
314
|
+
size?: "sm" | "md" | null | undefined;
|
|
315
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
316
|
+
type TooltipProps = React.ComponentProps<typeof Tooltip$1.Root>;
|
|
317
|
+
type TooltipTriggerProps = React.ComponentProps<typeof Tooltip$1.Trigger>;
|
|
318
|
+
interface TooltipContentProps extends Omit<React.ComponentProps<typeof Tooltip$1.Content>, 'asChild'>, VariantProps<typeof tooltipContentVariants> {
|
|
319
|
+
/** Show a small arrow pointing at the trigger. Defaults to true. */
|
|
320
|
+
arrow?: boolean;
|
|
321
|
+
}
|
|
322
|
+
declare function Tooltip(props: TooltipProps): react_jsx_runtime.JSX.Element;
|
|
323
|
+
declare function TooltipTrigger({ className, ...props }: TooltipTriggerProps): react_jsx_runtime.JSX.Element;
|
|
324
|
+
declare function TooltipContent({ size, arrow, sideOffset, className, children, ...props }: TooltipContentProps): react_jsx_runtime.JSX.Element;
|
|
325
|
+
|
|
326
|
+
declare const alertVariants: (props?: ({
|
|
327
|
+
variant?: "destructive" | "success" | "warning" | "info" | null | undefined;
|
|
328
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
329
|
+
interface AlertProps extends Omit<React.ComponentProps<'div'>, 'role'>, VariantProps<typeof alertVariants> {
|
|
330
|
+
/** Render as the single child element instead of a `<div>`. */
|
|
331
|
+
asChild?: boolean;
|
|
332
|
+
/**
|
|
333
|
+
* Custom leading icon. Pass `false` to hide the icon entirely. Defaults to
|
|
334
|
+
* a variant-appropriate icon (Info / Check / AlertTriangle / AlertCircle).
|
|
335
|
+
*/
|
|
336
|
+
icon?: ReactNode | false;
|
|
337
|
+
/**
|
|
338
|
+
* Show a trailing close button. The alert manages its own visibility — pass
|
|
339
|
+
* `onDismiss` to be notified, or set `open` to control visibility yourself.
|
|
340
|
+
*/
|
|
341
|
+
dismissible?: boolean;
|
|
342
|
+
/** Controlled visibility. Pair with `onDismiss` to react. */
|
|
343
|
+
open?: boolean;
|
|
344
|
+
/** Fires when the user clicks the close button. */
|
|
345
|
+
onDismiss?: () => void;
|
|
346
|
+
/**
|
|
347
|
+
* Wire the alert into the a11y tree as a live region. `polite` announces on
|
|
348
|
+
* the next graceful opportunity (use for success/info banners). `assertive`
|
|
349
|
+
* interrupts the user (reserve for destructive/error states that block the
|
|
350
|
+
* task). Omit for static / decorative banners.
|
|
351
|
+
*/
|
|
352
|
+
live?: 'polite' | 'assertive';
|
|
353
|
+
/** Localized label for the close button. Defaults to `"Dismiss"`. */
|
|
354
|
+
closeLabel?: string;
|
|
355
|
+
}
|
|
356
|
+
type AlertSectionProps = React.ComponentProps<'div'> & {
|
|
357
|
+
asChild?: boolean;
|
|
358
|
+
};
|
|
359
|
+
interface AlertTitleProps extends React.ComponentProps<'h5'> {
|
|
360
|
+
/** Override the heading element (e.g. render an `<h3>`). */
|
|
361
|
+
asChild?: boolean;
|
|
362
|
+
}
|
|
363
|
+
type AlertDescriptionProps = React.ComponentProps<'p'> & {
|
|
364
|
+
asChild?: boolean;
|
|
365
|
+
};
|
|
366
|
+
declare function Alert({ variant, asChild, icon, dismissible, open: controlledOpen, onDismiss, live, closeLabel, className, children, ...props }: AlertProps): react_jsx_runtime.JSX.Element | null;
|
|
367
|
+
declare function AlertTitle({ asChild, className, ...props }: AlertTitleProps): react_jsx_runtime.JSX.Element;
|
|
368
|
+
declare function AlertDescription({ asChild, className, ...props }: AlertDescriptionProps): react_jsx_runtime.JSX.Element;
|
|
369
|
+
|
|
370
|
+
declare const modalContentVariants: (props?: ({
|
|
371
|
+
size?: "sm" | "md" | "lg" | "xl" | "full" | null | undefined;
|
|
372
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
373
|
+
type ModalProps = React.ComponentProps<typeof Dialog.Root>;
|
|
374
|
+
type ModalTriggerProps = React.ComponentProps<typeof Dialog.Trigger>;
|
|
375
|
+
type ModalCloseProps = React.ComponentProps<typeof Dialog.Close>;
|
|
376
|
+
interface ModalContentProps extends React.ComponentProps<typeof Dialog.Content>, VariantProps<typeof modalContentVariants> {
|
|
377
|
+
/**
|
|
378
|
+
* Render a corner X close button. Defaults to `true`. Set `false` for
|
|
379
|
+
* action-forcing dialogs (e.g. "Are you sure?") where the user must pick
|
|
380
|
+
* one of the explicit footer buttons.
|
|
381
|
+
*/
|
|
382
|
+
showCloseButton?: boolean;
|
|
383
|
+
/** Localized label for the close button. Defaults to `"Close"`. */
|
|
384
|
+
closeLabel?: string;
|
|
385
|
+
}
|
|
386
|
+
type ModalSectionProps = React.ComponentProps<'div'> & {
|
|
387
|
+
asChild?: boolean;
|
|
388
|
+
};
|
|
389
|
+
interface ModalTitleProps extends React.ComponentProps<typeof Dialog.Title> {
|
|
390
|
+
/** Override the heading element (e.g. render an `<h3>` instead of the default `<h2>`). */
|
|
391
|
+
asChild?: boolean;
|
|
392
|
+
}
|
|
393
|
+
interface ModalDescriptionProps extends React.ComponentProps<typeof Dialog.Description> {
|
|
394
|
+
/** Override the element (e.g. render a `<div>` for richer markup). */
|
|
395
|
+
asChild?: boolean;
|
|
396
|
+
}
|
|
397
|
+
declare function Modal(props: ModalProps): react_jsx_runtime.JSX.Element;
|
|
398
|
+
declare function ModalTrigger({ className, ...props }: ModalTriggerProps): react_jsx_runtime.JSX.Element;
|
|
399
|
+
declare function ModalContent({ size, showCloseButton, closeLabel, className, children, ...props }: ModalContentProps): react_jsx_runtime.JSX.Element;
|
|
400
|
+
declare function ModalHeader({ asChild, className, ...props }: ModalSectionProps): react_jsx_runtime.JSX.Element;
|
|
401
|
+
declare function ModalTitle({ asChild, className, ...props }: ModalTitleProps): react_jsx_runtime.JSX.Element;
|
|
402
|
+
declare function ModalDescription({ asChild, className, ...props }: ModalDescriptionProps): react_jsx_runtime.JSX.Element;
|
|
403
|
+
declare function ModalFooter({ asChild, className, ...props }: ModalSectionProps): react_jsx_runtime.JSX.Element;
|
|
404
|
+
declare function ModalClose({ className, ...props }: ModalCloseProps): react_jsx_runtime.JSX.Element;
|
|
405
|
+
|
|
406
|
+
type ToastVariant = 'default' | 'info' | 'success' | 'warning' | 'destructive';
|
|
407
|
+
interface ToastAction {
|
|
408
|
+
/** Visible label on the action button. */
|
|
409
|
+
label: ReactNode;
|
|
410
|
+
/** Required by Radix Toast for screen-reader announcement when the action
|
|
411
|
+
* isn't a simple string label. Falls back to `label` when it's a string. */
|
|
412
|
+
altText?: string;
|
|
413
|
+
/** Fired when the action button is pressed. Toast auto-dismisses after. */
|
|
414
|
+
onClick: () => void;
|
|
415
|
+
}
|
|
416
|
+
interface ToastData {
|
|
417
|
+
/** Auto-generated unless caller provides one (useful for de-dup / updates). */
|
|
418
|
+
id: string;
|
|
419
|
+
title?: ReactNode;
|
|
420
|
+
description?: ReactNode;
|
|
421
|
+
variant: ToastVariant;
|
|
422
|
+
/** ms; `0` (or `Infinity`) means no auto-dismiss. Defaults handled by Toaster. */
|
|
423
|
+
duration?: number;
|
|
424
|
+
action?: ToastAction;
|
|
425
|
+
/** Controlled by Radix Toast (true while visible; false plays exit anim). */
|
|
426
|
+
open: boolean;
|
|
427
|
+
/** Fires when the toast leaves the DOM (after exit anim). */
|
|
428
|
+
onDismiss?: () => void;
|
|
429
|
+
}
|
|
430
|
+
interface ToastOptions {
|
|
431
|
+
id?: string;
|
|
432
|
+
title?: ReactNode;
|
|
433
|
+
description?: ReactNode;
|
|
434
|
+
duration?: number;
|
|
435
|
+
action?: ToastAction;
|
|
436
|
+
onDismiss?: () => void;
|
|
437
|
+
}
|
|
438
|
+
type Listener = () => void;
|
|
439
|
+
/** Public store shape. `<Toaster store={…} />` accepts this, and
|
|
440
|
+
* `createToast(store)` returns a scoped `toast()` bound to it. */
|
|
441
|
+
interface ToastStore {
|
|
442
|
+
subscribe(listener: Listener): () => void;
|
|
443
|
+
getSnapshot(): ToastData[];
|
|
444
|
+
add(variant: ToastVariant, message: ReactNode, options?: ToastOptions): string;
|
|
445
|
+
dismiss(id?: string): void;
|
|
446
|
+
remove(id: string): void;
|
|
447
|
+
/** Test-only / story-only: hard reset. */
|
|
448
|
+
__reset(): void;
|
|
449
|
+
}
|
|
450
|
+
declare function createToastStore(): ToastStore;
|
|
451
|
+
declare const toastStore: ToastStore;
|
|
452
|
+
interface ToastFn {
|
|
453
|
+
(message: ReactNode, options?: ToastOptions): string;
|
|
454
|
+
default: (message: ReactNode, options?: ToastOptions) => string;
|
|
455
|
+
info: (message: ReactNode, options?: ToastOptions) => string;
|
|
456
|
+
success: (message: ReactNode, options?: ToastOptions) => string;
|
|
457
|
+
warning: (message: ReactNode, options?: ToastOptions) => string;
|
|
458
|
+
error: (message: ReactNode, options?: ToastOptions) => string;
|
|
459
|
+
/** Alias for `error` — matches the variant name used everywhere else in the library. */
|
|
460
|
+
destructive: (message: ReactNode, options?: ToastOptions) => string;
|
|
461
|
+
/** Dismiss a specific toast by id, or all when called with no args. */
|
|
462
|
+
dismiss: (id?: string) => void;
|
|
463
|
+
}
|
|
464
|
+
/** Bind an imperative `toast()` callable to a specific store. */
|
|
465
|
+
declare function createToast(store: ToastStore): ToastFn;
|
|
466
|
+
/** Default singleton `toast()` — bound to the module-level `toastStore`. */
|
|
467
|
+
declare const toast: ToastFn;
|
|
468
|
+
|
|
469
|
+
declare const toastVariants: (props?: ({
|
|
470
|
+
variant?: "destructive" | "default" | "success" | "warning" | "info" | null | undefined;
|
|
471
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
472
|
+
declare const toastViewportVariants: (props?: ({
|
|
473
|
+
position?: "top-start" | "top-center" | "top-end" | "bottom-start" | "bottom-center" | "bottom-end" | null | undefined;
|
|
474
|
+
containerized?: boolean | null | undefined;
|
|
475
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
476
|
+
type ToastPosition = NonNullable<VariantProps<typeof toastViewportVariants>['position']>;
|
|
477
|
+
interface ToasterProps {
|
|
478
|
+
/** Where toasts stack. Logical: start/end flip in RTL. Default `bottom-end`. */
|
|
479
|
+
position?: ToastPosition;
|
|
480
|
+
/**
|
|
481
|
+
* Pin the viewport to a positioned ancestor (via `position: absolute`)
|
|
482
|
+
* instead of the browser viewport (`position: fixed`). Set this for
|
|
483
|
+
* Storybook stories, embedded widgets, and any layout where the Toaster
|
|
484
|
+
* should stay within a parent box. Caller is responsible for placing the
|
|
485
|
+
* Toaster inside an element with `position: relative` (or other positioned
|
|
486
|
+
* containing block).
|
|
487
|
+
*/
|
|
488
|
+
containerized?: boolean;
|
|
489
|
+
/** ms; default 4000. Set 0 (or Infinity) to disable auto-dismiss globally. */
|
|
490
|
+
duration?: number;
|
|
491
|
+
/** Show a close (X) button on each toast. Defaults to true. */
|
|
492
|
+
closeButton?: boolean;
|
|
493
|
+
/** Localized label for the close button. Default `"Dismiss"`. */
|
|
494
|
+
closeLabel?: string;
|
|
495
|
+
/** Hide the default leading icon per variant. */
|
|
496
|
+
hideIcon?: boolean;
|
|
497
|
+
/** Extra class on the Radix Viewport. */
|
|
498
|
+
className?: string;
|
|
499
|
+
/** Override swipe direction. Defaults based on `position`. */
|
|
500
|
+
swipeDirection?: 'up' | 'down' | 'left' | 'right';
|
|
501
|
+
/**
|
|
502
|
+
* The toast store this Toaster subscribes to. Defaults to the module-level
|
|
503
|
+
* singleton so the bare `toast()` API works without setup. Pass an isolated
|
|
504
|
+
* store (created via `createToastStore()` + `createToast(store)`) when you
|
|
505
|
+
* need multiple independent Toasters on the same page — common in
|
|
506
|
+
* Storybook, docs sites, and embedded widgets.
|
|
507
|
+
*/
|
|
508
|
+
store?: ToastStore;
|
|
509
|
+
}
|
|
510
|
+
declare function Toaster({ position, containerized, duration, closeButton, closeLabel, hideIcon, className, swipeDirection, store, }: ToasterProps): react_jsx_runtime.JSX.Element;
|
|
511
|
+
|
|
512
|
+
declare const tabsVariants: (props?: ({
|
|
513
|
+
variant?: "line" | "pill" | null | undefined;
|
|
514
|
+
size?: "sm" | "md" | null | undefined;
|
|
515
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
516
|
+
declare const tabsListVariants: (props?: ({
|
|
517
|
+
fullWidth?: boolean | null | undefined;
|
|
518
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
519
|
+
interface TabsProps extends React.ComponentProps<typeof Tabs$1.Root>, VariantProps<typeof tabsVariants> {
|
|
520
|
+
}
|
|
521
|
+
interface TabsListProps extends React.ComponentProps<typeof Tabs$1.List>, VariantProps<typeof tabsListVariants> {
|
|
522
|
+
}
|
|
523
|
+
type TabsTriggerProps = React.ComponentProps<typeof Tabs$1.Trigger>;
|
|
524
|
+
type TabsContentProps = React.ComponentProps<typeof Tabs$1.Content>;
|
|
525
|
+
declare function Tabs({ variant, size, className, ...props }: TabsProps): react_jsx_runtime.JSX.Element;
|
|
526
|
+
declare function TabsList({ fullWidth, className, ...props }: TabsListProps): react_jsx_runtime.JSX.Element;
|
|
527
|
+
declare function TabsTrigger({ className, ...props }: TabsTriggerProps): react_jsx_runtime.JSX.Element;
|
|
528
|
+
declare function TabsContent({ className, ...props }: TabsContentProps): react_jsx_runtime.JSX.Element;
|
|
529
|
+
|
|
530
|
+
declare const breadcrumbVariants: (props?: ({
|
|
531
|
+
size?: "sm" | "md" | null | undefined;
|
|
532
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
533
|
+
interface BreadcrumbProps extends React.ComponentProps<'nav'>, VariantProps<typeof breadcrumbVariants> {
|
|
534
|
+
}
|
|
535
|
+
type BreadcrumbListProps = React.ComponentProps<'ol'>;
|
|
536
|
+
type BreadcrumbItemProps = React.ComponentProps<'li'>;
|
|
537
|
+
interface BreadcrumbLinkProps extends React.ComponentProps<'a'> {
|
|
538
|
+
/** Render as the consumer element (e.g., a router Link) via Radix Slot. */
|
|
539
|
+
asChild?: boolean;
|
|
540
|
+
}
|
|
541
|
+
interface BreadcrumbPageProps extends React.ComponentProps<'span'> {
|
|
542
|
+
/** Render as the consumer element (e.g., a heading) via Radix Slot. */
|
|
543
|
+
asChild?: boolean;
|
|
544
|
+
}
|
|
545
|
+
interface BreadcrumbSeparatorProps extends React.ComponentProps<'li'> {
|
|
546
|
+
/**
|
|
547
|
+
* Override the default ChevronRight icon with custom content (e.g., `/`, `·`,
|
|
548
|
+
* or your own SVG). The wrapper itself stays `aria-hidden` since separators
|
|
549
|
+
* are decorative — the visited-state structure is conveyed via the `<ol>`
|
|
550
|
+
* + `aria-current` semantics, not the separator glyph.
|
|
551
|
+
*/
|
|
552
|
+
children?: React.ReactNode;
|
|
553
|
+
}
|
|
554
|
+
type BreadcrumbEllipsisProps = React.ComponentProps<'span'>;
|
|
555
|
+
declare function Breadcrumb({ size, className, ...props }: BreadcrumbProps): react_jsx_runtime.JSX.Element;
|
|
556
|
+
declare function BreadcrumbList({ className, ...props }: BreadcrumbListProps): react_jsx_runtime.JSX.Element;
|
|
557
|
+
declare function BreadcrumbItem({ className, ...props }: BreadcrumbItemProps): react_jsx_runtime.JSX.Element;
|
|
558
|
+
declare function BreadcrumbLink({ asChild, className, ...props }: BreadcrumbLinkProps): react_jsx_runtime.JSX.Element;
|
|
559
|
+
declare function BreadcrumbPage({ asChild, className, ...props }: BreadcrumbPageProps): react_jsx_runtime.JSX.Element;
|
|
560
|
+
declare function BreadcrumbSeparator({ children, className, ...props }: BreadcrumbSeparatorProps): react_jsx_runtime.JSX.Element;
|
|
561
|
+
declare function BreadcrumbEllipsis({ className, ...props }: BreadcrumbEllipsisProps): react_jsx_runtime.JSX.Element;
|
|
562
|
+
|
|
563
|
+
declare const paginationVariants: (props?: ({
|
|
564
|
+
size?: "sm" | "md" | null | undefined;
|
|
565
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
566
|
+
declare const paginationLinkVariants: (props?: ({
|
|
567
|
+
isActive?: boolean | null | undefined;
|
|
568
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
569
|
+
interface PaginationProps extends React.ComponentProps<'nav'>, VariantProps<typeof paginationVariants> {
|
|
570
|
+
}
|
|
571
|
+
type PaginationContentProps = React.ComponentProps<'ul'>;
|
|
572
|
+
type PaginationItemProps = React.ComponentProps<'li'>;
|
|
573
|
+
interface PaginationLinkProps extends Omit<React.ComponentProps<'a'>, 'aria-current'>, VariantProps<typeof paginationLinkVariants> {
|
|
574
|
+
/** Render as the consumer element (e.g., router Link) via Radix Slot. */
|
|
575
|
+
asChild?: boolean;
|
|
576
|
+
}
|
|
577
|
+
type PaginationPreviousProps = Omit<PaginationLinkProps, 'isActive'> & {
|
|
578
|
+
/**
|
|
579
|
+
* Visible + accessible label for the previous-page link. Defaults to
|
|
580
|
+
* `"Previous"`. Pass a translated string for non-English UIs — the value is
|
|
581
|
+
* also used for `aria-label`, so a localized string is required for a11y.
|
|
582
|
+
* Ignored when `asChild` + consumer-provided `children` are used.
|
|
583
|
+
*/
|
|
584
|
+
label?: string;
|
|
585
|
+
};
|
|
586
|
+
type PaginationNextProps = Omit<PaginationLinkProps, 'isActive'> & {
|
|
587
|
+
/**
|
|
588
|
+
* Visible + accessible label for the next-page link. Defaults to `"Next"`.
|
|
589
|
+
* Pass a translated string for non-English UIs — the value is also used
|
|
590
|
+
* for `aria-label`, so a localized string is required for a11y. Ignored
|
|
591
|
+
* when `asChild` + consumer-provided `children` are used.
|
|
592
|
+
*/
|
|
593
|
+
label?: string;
|
|
594
|
+
};
|
|
595
|
+
type PaginationEllipsisProps = React.ComponentProps<'span'>;
|
|
596
|
+
declare function Pagination({ size, className, ...props }: PaginationProps): react_jsx_runtime.JSX.Element;
|
|
597
|
+
declare function PaginationContent({ className, ...props }: PaginationContentProps): react_jsx_runtime.JSX.Element;
|
|
598
|
+
declare function PaginationItem({ className, ...props }: PaginationItemProps): react_jsx_runtime.JSX.Element;
|
|
599
|
+
declare function PaginationLink({ asChild, isActive, className, ...props }: PaginationLinkProps): react_jsx_runtime.JSX.Element;
|
|
600
|
+
declare function PaginationPrevious({ label, className, children, asChild, ...props }: PaginationPreviousProps): react_jsx_runtime.JSX.Element;
|
|
601
|
+
declare function PaginationNext({ label, className, children, asChild, ...props }: PaginationNextProps): react_jsx_runtime.JSX.Element;
|
|
602
|
+
declare function PaginationEllipsis({ className, ...props }: PaginationEllipsisProps): react_jsx_runtime.JSX.Element;
|
|
603
|
+
|
|
604
|
+
declare const accordionVariants: (props?: ({
|
|
605
|
+
size?: "sm" | "md" | null | undefined;
|
|
606
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
607
|
+
type AccordionRootProps = React.ComponentProps<typeof Accordion$1.Root>;
|
|
608
|
+
type AccordionProps = AccordionRootProps & VariantProps<typeof accordionVariants>;
|
|
609
|
+
type AccordionItemProps = React.ComponentProps<typeof Accordion$1.Item>;
|
|
610
|
+
type AccordionTriggerProps = React.ComponentProps<typeof Accordion$1.Trigger>;
|
|
611
|
+
type AccordionContentProps = React.ComponentProps<typeof Accordion$1.Content>;
|
|
612
|
+
declare function Accordion({ size, className, ...props }: AccordionProps): react_jsx_runtime.JSX.Element;
|
|
613
|
+
declare function AccordionItem({ className, ...props }: AccordionItemProps): react_jsx_runtime.JSX.Element;
|
|
614
|
+
declare function AccordionTrigger({ className, children, ...props }: AccordionTriggerProps): react_jsx_runtime.JSX.Element;
|
|
615
|
+
declare function AccordionContent({ className, children, ...props }: AccordionContentProps): react_jsx_runtime.JSX.Element;
|
|
616
|
+
|
|
617
|
+
declare const stepsVariants: (props?: ({
|
|
618
|
+
size?: "sm" | "md" | null | undefined;
|
|
619
|
+
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
620
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
621
|
+
type StepState = 'completed' | 'current' | 'upcoming';
|
|
622
|
+
declare const stepVariants: (props?: ({
|
|
623
|
+
state?: "current" | "completed" | "upcoming" | null | undefined;
|
|
624
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
625
|
+
interface StepsProps extends React.ComponentProps<'ol'>, VariantProps<typeof stepsVariants> {
|
|
626
|
+
}
|
|
627
|
+
interface StepProps extends Omit<React.ComponentProps<'li'>, 'aria-current'>, VariantProps<typeof stepVariants> {
|
|
628
|
+
}
|
|
629
|
+
interface StepIndicatorProps extends React.ComponentProps<'span'> {
|
|
630
|
+
/**
|
|
631
|
+
* The 1-based step number to render when the step is `current` or
|
|
632
|
+
* `upcoming`. Ignored when the step is `completed` — the indicator shows
|
|
633
|
+
* a check icon instead.
|
|
634
|
+
*/
|
|
635
|
+
step?: number | string;
|
|
636
|
+
}
|
|
637
|
+
type StepTitleProps = React.ComponentProps<'span'>;
|
|
638
|
+
type StepDescriptionProps = React.ComponentProps<'span'>;
|
|
639
|
+
declare function Steps({ size, orientation, className, ...props }: StepsProps): react_jsx_runtime.JSX.Element;
|
|
640
|
+
declare function Step({ state, className, ...props }: StepProps): react_jsx_runtime.JSX.Element;
|
|
641
|
+
declare function StepIndicator({ step, className, ...props }: StepIndicatorProps): react_jsx_runtime.JSX.Element;
|
|
642
|
+
declare function StepTitle({ className, ...props }: StepTitleProps): react_jsx_runtime.JSX.Element;
|
|
643
|
+
declare function StepDescription({ className, ...props }: StepDescriptionProps): react_jsx_runtime.JSX.Element;
|
|
644
|
+
|
|
645
|
+
declare const spinnerVariants: (props?: ({
|
|
646
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
647
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
648
|
+
type SpinnerProps = Omit<React.SVGProps<SVGSVGElement>, 'children'> & VariantProps<typeof spinnerVariants> & {
|
|
649
|
+
/**
|
|
650
|
+
* Accessible label announced by screen readers. Defaults to "Loading".
|
|
651
|
+
* Pass `aria-hidden="true"` (e.g. inside a Button that already has its
|
|
652
|
+
* own label) to suppress.
|
|
653
|
+
*/
|
|
654
|
+
'aria-label'?: string;
|
|
655
|
+
};
|
|
656
|
+
declare function Spinner({ size, className, 'aria-label': ariaLabel, ...props }: SpinnerProps): react_jsx_runtime.JSX.Element;
|
|
657
|
+
|
|
658
|
+
declare const skeletonVariants: (props?: ({
|
|
659
|
+
shape?: "text" | "circle" | "rectangle" | null | undefined;
|
|
660
|
+
animation?: "none" | "pulse" | "wave" | null | undefined;
|
|
661
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
662
|
+
interface SkeletonProps extends React.ComponentProps<'div'>, VariantProps<typeof skeletonVariants> {
|
|
663
|
+
/**
|
|
664
|
+
* Inline width override (any valid CSS length, e.g. `"60%"`, `200`, `"4rem"`).
|
|
665
|
+
* Defaults: `text` → `100%`, `circle`/`rectangle` → `40px` (CSS-controlled).
|
|
666
|
+
*/
|
|
667
|
+
width?: number | string;
|
|
668
|
+
/**
|
|
669
|
+
* Inline height override. Defaults: `text` → `1em` so it tracks the surrounding
|
|
670
|
+
* line height; `rectangle` → `40px`; `circle` → matches `width` to stay round.
|
|
671
|
+
*/
|
|
672
|
+
height?: number | string;
|
|
673
|
+
}
|
|
674
|
+
declare function Skeleton({ shape, animation, width, height, className, style, ...props }: SkeletonProps): react_jsx_runtime.JSX.Element;
|
|
675
|
+
|
|
676
|
+
declare const progressVariants: (props?: ({
|
|
677
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
678
|
+
color?: "primary" | "destructive" | "success" | "warning" | null | undefined;
|
|
679
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
680
|
+
declare const circularProgressVariants: (props?: ({
|
|
681
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
682
|
+
color?: "primary" | "destructive" | "success" | "warning" | null | undefined;
|
|
683
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
684
|
+
type ProgressOwnProps = VariantProps<typeof progressVariants> & {
|
|
685
|
+
/**
|
|
686
|
+
* Current progress. `null` (or omitted) renders the indeterminate animation.
|
|
687
|
+
* Otherwise clamp yourself to `[0, max]` — Radix Progress assumes the value
|
|
688
|
+
* is in range.
|
|
689
|
+
*/
|
|
690
|
+
value?: number | null;
|
|
691
|
+
/** Maximum value. Defaults to 100. */
|
|
692
|
+
max?: number;
|
|
693
|
+
/**
|
|
694
|
+
* Accessible label for the progressbar. Required for assistive tech —
|
|
695
|
+
* Radix logs a warning if neither `aria-label` nor `aria-labelledby` is set.
|
|
696
|
+
*/
|
|
697
|
+
'aria-label'?: string;
|
|
698
|
+
'aria-labelledby'?: string;
|
|
699
|
+
};
|
|
700
|
+
type ProgressProps = ProgressOwnProps & Omit<React.ComponentProps<typeof Progress$1.Root>, keyof ProgressOwnProps>;
|
|
701
|
+
declare function Progress({ value, max, size, color, className, ...props }: ProgressProps): react_jsx_runtime.JSX.Element;
|
|
702
|
+
type CircularProgressOwnProps = VariantProps<typeof circularProgressVariants> & {
|
|
703
|
+
value?: number | null;
|
|
704
|
+
max?: number;
|
|
705
|
+
/** Stroke width in px. Defaults to 4 (sm) / 5 (md) / 6 (lg). */
|
|
706
|
+
thickness?: number;
|
|
707
|
+
/** Render the percentage label inside the ring. */
|
|
708
|
+
showLabel?: boolean;
|
|
709
|
+
'aria-label'?: string;
|
|
710
|
+
'aria-labelledby'?: string;
|
|
711
|
+
};
|
|
712
|
+
type CircularProgressProps = CircularProgressOwnProps & Omit<React.ComponentProps<'div'>, keyof CircularProgressOwnProps>;
|
|
713
|
+
declare function CircularProgress({ value, max, size, color, thickness, showLabel, className, ...props }: CircularProgressProps): react_jsx_runtime.JSX.Element;
|
|
714
|
+
|
|
715
|
+
declare const dropdownMenuVariants: (props?: ({
|
|
716
|
+
size?: "sm" | "md" | null | undefined;
|
|
717
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
718
|
+
type DropdownMenuProps = React.ComponentProps<typeof DropdownMenu$1.Root>;
|
|
719
|
+
declare function DropdownMenu(props: DropdownMenuProps): react_jsx_runtime.JSX.Element;
|
|
720
|
+
type DropdownMenuTriggerProps = React.ComponentProps<typeof DropdownMenu$1.Trigger>;
|
|
721
|
+
declare function DropdownMenuTrigger(props: DropdownMenuTriggerProps): react_jsx_runtime.JSX.Element;
|
|
722
|
+
type DropdownMenuContentProps = React.ComponentProps<typeof DropdownMenu$1.Content> & VariantProps<typeof dropdownMenuVariants>;
|
|
723
|
+
declare function DropdownMenuContent({ size, className, sideOffset, ...props }: DropdownMenuContentProps): react_jsx_runtime.JSX.Element;
|
|
724
|
+
type DropdownMenuItemProps = React.ComponentProps<typeof DropdownMenu$1.Item> & {
|
|
725
|
+
/** Style as a destructive action (red text, red hover). */
|
|
726
|
+
destructive?: boolean;
|
|
727
|
+
/** Icon rendered before the label. Sized to 1em. */
|
|
728
|
+
startIcon?: ReactNode;
|
|
729
|
+
/** Trailing text shown muted, e.g. a keyboard shortcut hint ("⌘K"). */
|
|
730
|
+
shortcut?: ReactNode;
|
|
731
|
+
};
|
|
732
|
+
declare function DropdownMenuItem({ className, destructive, startIcon, shortcut, children, ...props }: DropdownMenuItemProps): react_jsx_runtime.JSX.Element;
|
|
733
|
+
type DropdownMenuCheckboxItemProps = React.ComponentProps<typeof DropdownMenu$1.CheckboxItem>;
|
|
734
|
+
declare function DropdownMenuCheckboxItem({ className, children, onSelect, ...props }: DropdownMenuCheckboxItemProps): react_jsx_runtime.JSX.Element;
|
|
735
|
+
type DropdownMenuRadioGroupProps = React.ComponentProps<typeof DropdownMenu$1.RadioGroup>;
|
|
736
|
+
declare function DropdownMenuRadioGroup(props: DropdownMenuRadioGroupProps): react_jsx_runtime.JSX.Element;
|
|
737
|
+
type DropdownMenuRadioItemProps = React.ComponentProps<typeof DropdownMenu$1.RadioItem>;
|
|
738
|
+
declare function DropdownMenuRadioItem({ className, children, onSelect, ...props }: DropdownMenuRadioItemProps): react_jsx_runtime.JSX.Element;
|
|
739
|
+
type DropdownMenuLabelProps = React.ComponentProps<typeof DropdownMenu$1.Label>;
|
|
740
|
+
declare function DropdownMenuLabel({ className, ...props }: DropdownMenuLabelProps): react_jsx_runtime.JSX.Element;
|
|
741
|
+
type DropdownMenuSeparatorProps = React.ComponentProps<typeof DropdownMenu$1.Separator>;
|
|
742
|
+
declare function DropdownMenuSeparator({ className, ...props }: DropdownMenuSeparatorProps): react_jsx_runtime.JSX.Element;
|
|
743
|
+
type DropdownMenuGroupProps = React.ComponentProps<typeof DropdownMenu$1.Group>;
|
|
744
|
+
declare function DropdownMenuGroup(props: DropdownMenuGroupProps): react_jsx_runtime.JSX.Element;
|
|
745
|
+
type DropdownMenuSubProps = React.ComponentProps<typeof DropdownMenu$1.Sub>;
|
|
746
|
+
declare function DropdownMenuSub(props: DropdownMenuSubProps): react_jsx_runtime.JSX.Element;
|
|
747
|
+
type DropdownMenuSubTriggerProps = React.ComponentProps<typeof DropdownMenu$1.SubTrigger> & {
|
|
748
|
+
startIcon?: ReactNode;
|
|
749
|
+
};
|
|
750
|
+
declare function DropdownMenuSubTrigger({ className, startIcon, children, ...props }: DropdownMenuSubTriggerProps): react_jsx_runtime.JSX.Element;
|
|
751
|
+
type DropdownMenuSubContentProps = React.ComponentProps<typeof DropdownMenu$1.SubContent> & VariantProps<typeof dropdownMenuVariants>;
|
|
752
|
+
declare function DropdownMenuSubContent({ size, className, ...props }: DropdownMenuSubContentProps): react_jsx_runtime.JSX.Element;
|
|
753
|
+
|
|
754
|
+
declare const drawerVariants: (props?: ({
|
|
755
|
+
side?: "end" | "start" | "bottom" | "top" | null | undefined;
|
|
756
|
+
size?: "sm" | "md" | "lg" | "full" | null | undefined;
|
|
757
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
758
|
+
type DrawerProps = React.ComponentProps<typeof Dialog.Root>;
|
|
759
|
+
type DrawerTriggerProps = React.ComponentProps<typeof Dialog.Trigger>;
|
|
760
|
+
type DrawerCloseProps = React.ComponentProps<typeof Dialog.Close>;
|
|
761
|
+
interface DrawerContentProps extends React.ComponentProps<typeof Dialog.Content>, VariantProps<typeof drawerVariants> {
|
|
762
|
+
/** Show the corner X close button. Defaults to `true`. */
|
|
763
|
+
showCloseButton?: boolean;
|
|
764
|
+
/** Localized aria-label for the close button. Defaults to `"Close"`. */
|
|
765
|
+
closeLabel?: string;
|
|
766
|
+
}
|
|
767
|
+
type DrawerSectionProps = React.ComponentProps<'div'> & {
|
|
768
|
+
asChild?: boolean;
|
|
769
|
+
};
|
|
770
|
+
interface DrawerTitleProps extends React.ComponentProps<typeof Dialog.Title> {
|
|
771
|
+
asChild?: boolean;
|
|
772
|
+
}
|
|
773
|
+
interface DrawerDescriptionProps extends React.ComponentProps<typeof Dialog.Description> {
|
|
774
|
+
asChild?: boolean;
|
|
775
|
+
}
|
|
776
|
+
declare function Drawer(props: DrawerProps): react_jsx_runtime.JSX.Element;
|
|
777
|
+
declare function DrawerTrigger({ className, ...props }: DrawerTriggerProps): react_jsx_runtime.JSX.Element;
|
|
778
|
+
declare function DrawerContent({ side, size, showCloseButton, closeLabel, className, children, ...props }: DrawerContentProps): react_jsx_runtime.JSX.Element;
|
|
779
|
+
declare function DrawerHeader({ asChild, className, ...props }: DrawerSectionProps): react_jsx_runtime.JSX.Element;
|
|
780
|
+
declare function DrawerTitle({ asChild, className, ...props }: DrawerTitleProps): react_jsx_runtime.JSX.Element;
|
|
781
|
+
declare function DrawerDescription({ asChild, className, ...props }: DrawerDescriptionProps): react_jsx_runtime.JSX.Element;
|
|
782
|
+
declare function DrawerBody({ asChild, className, ...props }: DrawerSectionProps): react_jsx_runtime.JSX.Element;
|
|
783
|
+
declare function DrawerFooter({ asChild, className, ...props }: DrawerSectionProps): react_jsx_runtime.JSX.Element;
|
|
784
|
+
declare function DrawerClose({ className, ...props }: DrawerCloseProps): react_jsx_runtime.JSX.Element;
|
|
785
|
+
|
|
786
|
+
declare const comboboxTriggerVariants: (props?: ({
|
|
787
|
+
size?: "sm" | "md" | null | undefined;
|
|
788
|
+
error?: boolean | null | undefined;
|
|
789
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
790
|
+
declare const comboboxVariants: (props?: ({
|
|
791
|
+
size?: "sm" | "md" | null | undefined;
|
|
792
|
+
error?: boolean | null | undefined;
|
|
793
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
794
|
+
interface ComboboxProps extends VariantProps<typeof comboboxTriggerVariants> {
|
|
795
|
+
/** Currently selected option value (controlled). */
|
|
796
|
+
value?: string;
|
|
797
|
+
/** Initial value when uncontrolled. */
|
|
798
|
+
defaultValue?: string;
|
|
799
|
+
/** Fires whenever the selection changes (controlled or uncontrolled). */
|
|
800
|
+
onValueChange?: (value: string) => void;
|
|
801
|
+
/** Controlled popover open state. */
|
|
802
|
+
open?: boolean;
|
|
803
|
+
defaultOpen?: boolean;
|
|
804
|
+
onOpenChange?: (open: boolean) => void;
|
|
805
|
+
/** Visible label above the trigger. */
|
|
806
|
+
label?: ReactNode;
|
|
807
|
+
/** Hint shown below the trigger when there's no error. */
|
|
808
|
+
helperText?: ReactNode;
|
|
809
|
+
/** Message shown below the trigger when `error` is true. */
|
|
810
|
+
errorMessage?: ReactNode;
|
|
811
|
+
/** Marks the field invalid — sets `aria-invalid` and the error border. */
|
|
812
|
+
error?: boolean;
|
|
813
|
+
/** Marks the field required — adds the asterisk + `aria-required`. */
|
|
814
|
+
required?: boolean;
|
|
815
|
+
/** Disables the trigger entirely. */
|
|
816
|
+
disabled?: boolean;
|
|
817
|
+
/** Placeholder shown in the trigger when no value is selected. */
|
|
818
|
+
placeholder?: ReactNode;
|
|
819
|
+
/** Placeholder for the search input inside the panel. Defaults to `"Search…"`. */
|
|
820
|
+
searchPlaceholder?: string;
|
|
821
|
+
/** Shown when no item matches the search query. Defaults to `"No results."`. */
|
|
822
|
+
emptyMessage?: ReactNode;
|
|
823
|
+
/**
|
|
824
|
+
* Override the trigger label resolver — useful when items are loaded async
|
|
825
|
+
* after the value is set, or when the trigger should show a richer label
|
|
826
|
+
* than the item's rendered children. Receives the current value, returns
|
|
827
|
+
* the node to display. Falls back to the registered item's label.
|
|
828
|
+
*/
|
|
829
|
+
getLabel?: (value: string) => ReactNode;
|
|
830
|
+
/** Caller-supplied id for the trigger; falls back to a generated one. */
|
|
831
|
+
id?: string;
|
|
832
|
+
/** Forwarded to the trigger (the focusable button). */
|
|
833
|
+
className?: string;
|
|
834
|
+
'aria-label'?: string;
|
|
835
|
+
'aria-labelledby'?: string;
|
|
836
|
+
/** `<ComboboxItem>` (+ optional Group / Separator) children. */
|
|
837
|
+
children: ReactNode;
|
|
838
|
+
}
|
|
839
|
+
interface ComboboxItemProps extends Omit<React.ComponentProps<typeof Command.Item>, 'value' | 'onSelect'> {
|
|
840
|
+
/** Stable value for filtering + selection. */
|
|
841
|
+
value: string;
|
|
842
|
+
/** Extra search terms cmdk should match against the input. */
|
|
843
|
+
keywords?: string[];
|
|
844
|
+
/** Disable this item from selection. */
|
|
845
|
+
disabled?: boolean;
|
|
846
|
+
/** Optional select handler — fires alongside the root's `onValueChange`. */
|
|
847
|
+
onSelect?: (value: string) => void;
|
|
848
|
+
}
|
|
849
|
+
interface ComboboxGroupProps extends React.ComponentProps<typeof Command.Group> {
|
|
850
|
+
/** Group heading rendered above its items. */
|
|
851
|
+
heading?: ReactNode;
|
|
852
|
+
}
|
|
853
|
+
type ComboboxSeparatorProps = React.ComponentProps<typeof Command.Separator>;
|
|
854
|
+
declare function Combobox({ value: controlledValue, defaultValue, onValueChange, open: controlledOpen, defaultOpen, onOpenChange, label, helperText, errorMessage, error, required, disabled, size, placeholder, searchPlaceholder, emptyMessage, getLabel, id: externalId, className, children, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, }: ComboboxProps): react_jsx_runtime.JSX.Element;
|
|
855
|
+
declare function ComboboxItem({ value, keywords, disabled, onSelect, className, children, ...props }: ComboboxItemProps): react_jsx_runtime.JSX.Element;
|
|
856
|
+
declare function ComboboxGroup({ className, heading, ...props }: ComboboxGroupProps): react_jsx_runtime.JSX.Element;
|
|
857
|
+
declare function ComboboxSeparator({ className, ...props }: ComboboxSeparatorProps): react_jsx_runtime.JSX.Element;
|
|
858
|
+
|
|
859
|
+
declare const datePickerTriggerVariants: (props?: ({
|
|
860
|
+
size?: "sm" | "md" | null | undefined;
|
|
861
|
+
error?: boolean | null | undefined;
|
|
862
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
863
|
+
declare const datePickerVariants: (props?: ({
|
|
864
|
+
size?: "sm" | "md" | null | undefined;
|
|
865
|
+
error?: boolean | null | undefined;
|
|
866
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
867
|
+
type CalendarSystem = 'gregorian' | 'hijri';
|
|
868
|
+
interface CalendarLabels {
|
|
869
|
+
gregorian: string;
|
|
870
|
+
hijri: string;
|
|
871
|
+
}
|
|
872
|
+
interface DatePickerProps extends VariantProps<typeof datePickerTriggerVariants> {
|
|
873
|
+
/** Currently selected date (controlled). Local Y/M/D. */
|
|
874
|
+
value?: Date | null;
|
|
875
|
+
/** Initial value when uncontrolled. */
|
|
876
|
+
defaultValue?: Date | null;
|
|
877
|
+
/** Fires whenever the user picks a day. `null` when cleared. */
|
|
878
|
+
onChange?: (value: Date | null) => void;
|
|
879
|
+
/** Earliest pickable date (inclusive). */
|
|
880
|
+
minValue?: Date;
|
|
881
|
+
/** Latest pickable date (inclusive). */
|
|
882
|
+
maxValue?: Date;
|
|
883
|
+
/** Visible label above the trigger. */
|
|
884
|
+
label?: ReactNode;
|
|
885
|
+
/** Hint shown below the trigger. Hidden while an error message is showing. */
|
|
886
|
+
helperText?: ReactNode;
|
|
887
|
+
/** Message shown below the trigger when `error` is true. */
|
|
888
|
+
errorMessage?: ReactNode;
|
|
889
|
+
/** Marks the field invalid — sets `aria-invalid` and error styling. */
|
|
890
|
+
error?: boolean;
|
|
891
|
+
/** Marks the field required — adds the asterisk + `aria-required`. */
|
|
892
|
+
required?: boolean;
|
|
893
|
+
/** Disables the trigger entirely. */
|
|
894
|
+
disabled?: boolean;
|
|
895
|
+
/** Caller-supplied id for the field. */
|
|
896
|
+
id?: string;
|
|
897
|
+
/** Forwarded to the Group (the trigger row), matching Input/Select. */
|
|
898
|
+
className?: string;
|
|
899
|
+
'aria-label'?: string;
|
|
900
|
+
'aria-labelledby'?: string;
|
|
901
|
+
/**
|
|
902
|
+
* Calendar system (controlled). Omit to let the user toggle freely with
|
|
903
|
+
* the in-popover switch.
|
|
904
|
+
*/
|
|
905
|
+
calendar?: CalendarSystem;
|
|
906
|
+
/** Initial calendar system when uncontrolled. Defaults to `'gregorian'`. */
|
|
907
|
+
defaultCalendar?: CalendarSystem;
|
|
908
|
+
/** Fires whenever the calendar system toggles. */
|
|
909
|
+
onCalendarChange?: (calendar: CalendarSystem) => void;
|
|
910
|
+
/**
|
|
911
|
+
* Show the Gregorian↔Hijri toggle inside the popover. Defaults to `true`,
|
|
912
|
+
* but is forced off when `calendar` is controlled — a toggle that ignores
|
|
913
|
+
* its click is a worse footgun than no toggle.
|
|
914
|
+
*/
|
|
915
|
+
showCalendarToggle?: boolean;
|
|
916
|
+
/** Override the toggle labels. Defaults are locale-aware (English / Arabic). */
|
|
917
|
+
calendarLabels?: CalendarLabels;
|
|
918
|
+
/**
|
|
919
|
+
* When `true`, each day cell also shows the *other* calendar's day number
|
|
920
|
+
* as small secondary text (e.g., Hijri active → Gregorian day shown small
|
|
921
|
+
* underneath). Helps users cross-reference dates between calendar systems
|
|
922
|
+
* without round-tripping the toggle. Defaults to `false`.
|
|
923
|
+
*/
|
|
924
|
+
showSecondaryCalendar?: boolean;
|
|
925
|
+
}
|
|
926
|
+
declare function DatePicker({ value: controlledValue, defaultValue, onChange, minValue, maxValue, label, helperText, errorMessage, error, required, disabled, size, id, className, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, calendar: controlledCalendar, defaultCalendar, onCalendarChange, showCalendarToggle, calendarLabels, showSecondaryCalendar, }: DatePickerProps): react_jsx_runtime.JSX.Element;
|
|
927
|
+
|
|
928
|
+
type FileStatus = 'pending' | 'uploading' | 'success' | 'error';
|
|
929
|
+
/** Reason codes attached to a rejected file. */
|
|
930
|
+
type RejectionCode = 'file-too-large' | 'file-invalid-type' | 'too-many-files';
|
|
931
|
+
/**
|
|
932
|
+
* A controlled file entry. The consumer owns this array and is responsible for
|
|
933
|
+
* performing the actual upload, updating `status`/`progress`, and assigning a
|
|
934
|
+
* stable `id` (used as the React key and the `onRemove` target).
|
|
935
|
+
*/
|
|
936
|
+
interface UploadFile {
|
|
937
|
+
/** Stable, consumer-assigned id. Used as the React key and remove target. */
|
|
938
|
+
id: string;
|
|
939
|
+
/** The native File. */
|
|
940
|
+
file: File;
|
|
941
|
+
/** Defaults to `'pending'`. Drives the per-row affordance. */
|
|
942
|
+
status?: FileStatus;
|
|
943
|
+
/** 0–100. Rendered as a {@link Progress} bar while `status === 'uploading'`. */
|
|
944
|
+
progress?: number;
|
|
945
|
+
/** Shown inline (red) while `status === 'error'`. */
|
|
946
|
+
error?: string;
|
|
947
|
+
}
|
|
948
|
+
interface FileRejection {
|
|
949
|
+
file: File;
|
|
950
|
+
errors: RejectionCode[];
|
|
951
|
+
}
|
|
952
|
+
interface FileUploadProps {
|
|
953
|
+
/** Controlled list of files to render. The consumer is the source of truth. */
|
|
954
|
+
files: UploadFile[];
|
|
955
|
+
/** Called with the files that passed validation. The consumer wraps each in
|
|
956
|
+
* an {@link UploadFile} (assigning an `id`) and starts the upload. */
|
|
957
|
+
onFilesAdded: (accepted: File[]) => void;
|
|
958
|
+
/** Called with files that failed validation. Never enter `files`. */
|
|
959
|
+
onFilesRejected?: (rejections: FileRejection[]) => void;
|
|
960
|
+
/** Per-row remove handler. Omit to hide the remove button. */
|
|
961
|
+
onRemove?: (id: string) => void;
|
|
962
|
+
/** Native `accept` string (e.g. `'image/*,.pdf'`). Also drives validation. */
|
|
963
|
+
accept?: string;
|
|
964
|
+
/** Maximum size per file, in bytes. */
|
|
965
|
+
maxSize?: number;
|
|
966
|
+
/** Maximum total files (existing + incoming). When `multiple` is false this
|
|
967
|
+
* is forced to 1. */
|
|
968
|
+
maxFiles?: number;
|
|
969
|
+
/** Allow selecting/dropping more than one file. Defaults to true. */
|
|
970
|
+
multiple?: boolean;
|
|
971
|
+
/** Disables the drop zone and the picker. */
|
|
972
|
+
disabled?: boolean;
|
|
973
|
+
/** Marks the field required: renders the asterisk and sets the input's
|
|
974
|
+
* `required` attribute. */
|
|
975
|
+
required?: boolean;
|
|
976
|
+
/** Visible field label, auto-associated to the input. */
|
|
977
|
+
label?: ReactNode;
|
|
978
|
+
/** Hint shown below the field. Hidden while an error message is showing. */
|
|
979
|
+
helperText?: ReactNode;
|
|
980
|
+
/** Message shown below the field when `error` is true. */
|
|
981
|
+
errorMessage?: ReactNode;
|
|
982
|
+
/** Marks the field invalid: sets `aria-invalid` and error styling. */
|
|
983
|
+
error?: boolean;
|
|
984
|
+
/** Drop-zone instructional copy. Defaults to a bilingual-friendly EN string. */
|
|
985
|
+
hint?: ReactNode;
|
|
986
|
+
/** Accessible label for the per-row remove button. Defaults to `'Remove'`. */
|
|
987
|
+
removeLabel?: string;
|
|
988
|
+
id?: string;
|
|
989
|
+
className?: string;
|
|
990
|
+
'aria-label'?: string;
|
|
991
|
+
'aria-labelledby'?: string;
|
|
992
|
+
}
|
|
993
|
+
declare function FileUpload({ files, onFilesAdded, onFilesRejected, onRemove, accept, maxSize, maxFiles, multiple, disabled, required, label, helperText, errorMessage, error, hint, removeLabel, id: externalId, className, ...props }: FileUploadProps): react_jsx_runtime.JSX.Element;
|
|
994
|
+
|
|
995
|
+
declare const sliderVariants: (props?: ({
|
|
996
|
+
size?: "sm" | "md" | null | undefined;
|
|
997
|
+
error?: boolean | null | undefined;
|
|
998
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
999
|
+
type SliderValue = number | number[];
|
|
1000
|
+
interface SliderProps extends Omit<React.ComponentProps<typeof Slider$1.Root>, 'value' | 'defaultValue' | 'onValueChange' | 'onValueCommit' | 'asChild'>, VariantProps<typeof sliderVariants> {
|
|
1001
|
+
/** Controlled value. `number` → single thumb, `number[]` → one thumb each. */
|
|
1002
|
+
value?: SliderValue;
|
|
1003
|
+
/** Uncontrolled initial value. Defaults to a single thumb at `min`. */
|
|
1004
|
+
defaultValue?: SliderValue;
|
|
1005
|
+
/** Fires continuously while dragging. Shape mirrors `value`/`defaultValue`. */
|
|
1006
|
+
onValueChange?: (value: SliderValue) => void;
|
|
1007
|
+
/** Fires once on release (pointer up / keyboard commit). */
|
|
1008
|
+
onValueCommit?: (value: SliderValue) => void;
|
|
1009
|
+
/** Visible field label, associated to the thumb(s) via `aria-labelledby`. */
|
|
1010
|
+
label?: ReactNode;
|
|
1011
|
+
/** Hint shown below the field. Hidden while an error message is showing. */
|
|
1012
|
+
helperText?: ReactNode;
|
|
1013
|
+
/** Message shown below the field when `error` is true. */
|
|
1014
|
+
errorMessage?: ReactNode;
|
|
1015
|
+
/** Marks the field invalid: sets `aria-invalid` and error styling. */
|
|
1016
|
+
error?: boolean;
|
|
1017
|
+
/** Render the current value(s) as text beside the label. */
|
|
1018
|
+
showValue?: boolean;
|
|
1019
|
+
/** Formats each value for `showValue` and the thumb's `aria-valuetext`
|
|
1020
|
+
* (e.g. percentages or currency). */
|
|
1021
|
+
formatValue?: (value: number) => string;
|
|
1022
|
+
/** Accessible names for the two range thumbs. Ignored for single thumbs.
|
|
1023
|
+
* Defaults to `['Minimum', 'Maximum']`. */
|
|
1024
|
+
thumbLabels?: [string, string];
|
|
1025
|
+
}
|
|
1026
|
+
declare function Slider({ id: externalId, value, defaultValue, onValueChange, onValueCommit, min, max, size, label, helperText, errorMessage, error, showValue, formatValue, thumbLabels, className, ...props }: SliderProps): react_jsx_runtime.JSX.Element;
|
|
1027
|
+
|
|
1028
|
+
declare const numberInputVariants: (props?: ({
|
|
1029
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
1030
|
+
error?: boolean | null | undefined;
|
|
1031
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1032
|
+
interface NumberInputProps extends Omit<React.ComponentProps<'input'>, 'value' | 'defaultValue' | 'onChange' | 'size' | 'type' | 'min' | 'max' | 'step'>, VariantProps<typeof numberInputVariants> {
|
|
1033
|
+
/** Controlled value. `null` represents an empty field. */
|
|
1034
|
+
value?: number | null;
|
|
1035
|
+
/** Uncontrolled initial value. */
|
|
1036
|
+
defaultValue?: number | null;
|
|
1037
|
+
/** Fires with the parsed value, or `null` when the field is cleared. */
|
|
1038
|
+
onValueChange?: (value: number | null) => void;
|
|
1039
|
+
/** Lower bound. Clamped on blur and at the stepper buttons. */
|
|
1040
|
+
min?: number;
|
|
1041
|
+
/** Upper bound. Clamped on blur and at the stepper buttons. */
|
|
1042
|
+
max?: number;
|
|
1043
|
+
/** Stepper / ArrowUp-Down increment. Defaults to 1. */
|
|
1044
|
+
step?: number;
|
|
1045
|
+
/** Hide the − / + buttons (keyboard + typing only). */
|
|
1046
|
+
hideControls?: boolean;
|
|
1047
|
+
/** Accessible label for the decrement button. Defaults to `'Decrease'`. */
|
|
1048
|
+
decrementLabel?: string;
|
|
1049
|
+
/** Accessible label for the increment button. Defaults to `'Increase'`. */
|
|
1050
|
+
incrementLabel?: string;
|
|
1051
|
+
/** Visible field label, auto-associated to the input via `htmlFor`/`id`. */
|
|
1052
|
+
label?: ReactNode;
|
|
1053
|
+
/** Hint shown below the field. Hidden while an error message is showing. */
|
|
1054
|
+
helperText?: ReactNode;
|
|
1055
|
+
/** Message shown below the field when `error` is true. */
|
|
1056
|
+
errorMessage?: ReactNode;
|
|
1057
|
+
/** Marks the field invalid: sets `aria-invalid` and error styling. */
|
|
1058
|
+
error?: boolean;
|
|
1059
|
+
}
|
|
1060
|
+
declare function NumberInput({ id: externalId, value, defaultValue, onValueChange, min, max, step, size, hideControls, decrementLabel, incrementLabel, label, helperText, errorMessage, error, required, disabled, className, onBlur, onKeyDown, ...props }: NumberInputProps): react_jsx_runtime.JSX.Element;
|
|
1061
|
+
|
|
1062
|
+
declare const ratingVariants: (props?: ({
|
|
1063
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
1064
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1065
|
+
interface RatingProps extends VariantProps<typeof ratingVariants> {
|
|
1066
|
+
/** Controlled value (0…max). `.5` increments are allowed when `allowHalf`. */
|
|
1067
|
+
value?: number;
|
|
1068
|
+
/** Uncontrolled initial value. Defaults to 0. */
|
|
1069
|
+
defaultValue?: number;
|
|
1070
|
+
/** Fires with the chosen rating. */
|
|
1071
|
+
onValueChange?: (value: number) => void;
|
|
1072
|
+
/** Number of stars. Defaults to 5. */
|
|
1073
|
+
max?: number;
|
|
1074
|
+
/** Allow half-star (`.5`) precision. */
|
|
1075
|
+
allowHalf?: boolean;
|
|
1076
|
+
/** Display only — no interaction, exposed as `role="img"`. */
|
|
1077
|
+
readOnly?: boolean;
|
|
1078
|
+
/** Non-interactive and dimmed. */
|
|
1079
|
+
disabled?: boolean;
|
|
1080
|
+
/** Visible field label. */
|
|
1081
|
+
label?: ReactNode;
|
|
1082
|
+
/** Hint shown below the field. Hidden while an error message is showing. */
|
|
1083
|
+
helperText?: ReactNode;
|
|
1084
|
+
/** Message shown below the field when `error` is true. */
|
|
1085
|
+
errorMessage?: ReactNode;
|
|
1086
|
+
/** Marks the field invalid: sets `aria-invalid` and error styling. */
|
|
1087
|
+
error?: boolean;
|
|
1088
|
+
/** Builds the accessible value text / read-only label. Defaults to
|
|
1089
|
+
* `"{value} out of {max} stars"`. Override for localization. */
|
|
1090
|
+
formatValueText?: (value: number, max: number) => string;
|
|
1091
|
+
id?: string;
|
|
1092
|
+
className?: string;
|
|
1093
|
+
'aria-label'?: string;
|
|
1094
|
+
'aria-labelledby'?: string;
|
|
1095
|
+
}
|
|
1096
|
+
declare function Rating({ id: externalId, value, defaultValue, onValueChange, max, allowHalf, readOnly, disabled, size, label, helperText, errorMessage, error, formatValueText, className, ...props }: RatingProps): react_jsx_runtime.JSX.Element;
|
|
1097
|
+
|
|
1098
|
+
declare const toggleVariants: (props?: ({
|
|
1099
|
+
variant?: "outline" | "default" | null | undefined;
|
|
1100
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
1101
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1102
|
+
declare const toggleGroupVariants: (props?: ({
|
|
1103
|
+
variant?: "outline" | "default" | null | undefined;
|
|
1104
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
1105
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1106
|
+
type ToggleProps = React.ComponentProps<typeof Toggle$1.Root> & VariantProps<typeof toggleVariants>;
|
|
1107
|
+
type ToggleGroupRootProps = React.ComponentProps<typeof ToggleGroup$1.Root>;
|
|
1108
|
+
type ToggleGroupProps = ToggleGroupRootProps & VariantProps<typeof toggleGroupVariants>;
|
|
1109
|
+
type ToggleGroupItemProps = React.ComponentProps<typeof ToggleGroup$1.Item>;
|
|
1110
|
+
declare function Toggle({ variant, size, className, ...props }: ToggleProps): react_jsx_runtime.JSX.Element;
|
|
1111
|
+
declare function ToggleGroup({ variant, size, className, ...props }: ToggleGroupProps): react_jsx_runtime.JSX.Element;
|
|
1112
|
+
declare function ToggleGroupItem({ className, ...props }: ToggleGroupItemProps): react_jsx_runtime.JSX.Element;
|
|
1113
|
+
|
|
1114
|
+
declare const descriptionListVariants: (props?: ({
|
|
1115
|
+
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
1116
|
+
divided?: boolean | null | undefined;
|
|
1117
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1118
|
+
interface DescriptionListProps extends React.ComponentProps<'dl'>, VariantProps<typeof descriptionListVariants> {
|
|
1119
|
+
}
|
|
1120
|
+
type DescriptionItemProps = React.ComponentProps<'div'>;
|
|
1121
|
+
type DescriptionTermProps = React.ComponentProps<'dt'>;
|
|
1122
|
+
type DescriptionDetailsProps = React.ComponentProps<'dd'>;
|
|
1123
|
+
declare function DescriptionList({ orientation, divided, className, ...props }: DescriptionListProps): react_jsx_runtime.JSX.Element;
|
|
1124
|
+
declare function DescriptionItem({ className, ...props }: DescriptionItemProps): react_jsx_runtime.JSX.Element;
|
|
1125
|
+
declare function DescriptionTerm({ className, ...props }: DescriptionTermProps): react_jsx_runtime.JSX.Element;
|
|
1126
|
+
declare function DescriptionDetails({ className, ...props }: DescriptionDetailsProps): react_jsx_runtime.JSX.Element;
|
|
1127
|
+
|
|
173
1128
|
type DgaRootElement = 'div' | 'main' | 'nav' | 'section' | 'article' | 'aside' | 'header' | 'footer';
|
|
174
1129
|
interface DgaProviderProps {
|
|
175
1130
|
dir?: 'ltr' | 'rtl';
|
|
@@ -195,18 +1150,40 @@ interface DgaContextValue {
|
|
|
195
1150
|
locale: string;
|
|
196
1151
|
mode: 'light' | 'dark';
|
|
197
1152
|
/**
|
|
198
|
-
* The DgaProvider root element.
|
|
199
|
-
*
|
|
200
|
-
*
|
|
201
|
-
*
|
|
202
|
-
*
|
|
203
|
-
*
|
|
1153
|
+
* The DgaProvider's rendered root element. Exposed for non-portaled
|
|
1154
|
+
* descendants that need to read theme attributes (e.g., layout decorators).
|
|
1155
|
+
*
|
|
1156
|
+
* **For overlay portals, prefer `portalEl`** — `rootEl` lives inside the
|
|
1157
|
+
* consumer's normal DOM tree and inherits any `overflow: hidden` /
|
|
1158
|
+
* `transform` ancestors. Inside Storybook's autodocs preview block (or any
|
|
1159
|
+
* scoped wrapper a consumer might wrap us in), portaling into `rootEl`
|
|
1160
|
+
* makes the overlay get clipped by the wrapper and breaks `position: fixed`
|
|
1161
|
+
* positioning (a `transform` ancestor establishes a new containing block).
|
|
204
1162
|
*
|
|
205
|
-
*
|
|
206
|
-
*
|
|
207
|
-
* race to
|
|
1163
|
+
* State (not ref) so subscribers re-render when the element mounts; a
|
|
1164
|
+
* useRef update wouldn't fire a render and `defaultOpen` portals would
|
|
1165
|
+
* race to the wrong target on first commit.
|
|
208
1166
|
*/
|
|
209
1167
|
rootEl: HTMLElement | null;
|
|
1168
|
+
/**
|
|
1169
|
+
* Body-mounted portal container that mirrors this provider's theme
|
|
1170
|
+
* attributes (`data-theme`, `dir`) and CSS custom properties. Overlay
|
|
1171
|
+
* components (Modal / Drawer / DropdownMenu / Combobox / Select / Tooltip
|
|
1172
|
+
* / DatePicker) should portal into this so:
|
|
1173
|
+
*
|
|
1174
|
+
* 1. They escape any clipping (`overflow: hidden`) or transform ancestor
|
|
1175
|
+
* the consumer wraps the provider in.
|
|
1176
|
+
* 2. `position: fixed` semantics survive (no `transform` ancestor breaks
|
|
1177
|
+
* the viewport containing block).
|
|
1178
|
+
* 3. Theme inheritance still works — the container carries `data-theme`,
|
|
1179
|
+
* `dir`, and the same CSS variables as the provider's root, so
|
|
1180
|
+
* `var(--ddga-color-*)` lookups inside the portal resolve correctly.
|
|
1181
|
+
*
|
|
1182
|
+
* `null` until the DOM mount effect runs (e.g., during SSR or the very
|
|
1183
|
+
* first commit on the client). Components should fall back to `rootEl`
|
|
1184
|
+
* (and finally `document.body`) when this is null.
|
|
1185
|
+
*/
|
|
1186
|
+
portalEl: HTMLElement | null;
|
|
210
1187
|
}
|
|
211
1188
|
declare function useDga(): DgaContextValue;
|
|
212
1189
|
|
|
@@ -259,4 +1236,4 @@ declare function FieldMessage({ id, variant, children }: FieldMessageProps): rea
|
|
|
259
1236
|
|
|
260
1237
|
declare function cn(...inputs: ClassValue[]): string;
|
|
261
1238
|
|
|
262
|
-
export { Button, type ButtonProps, Checkbox, type CheckboxProps, DgaProvider, type DgaProviderProps, type FieldA11y, FieldMessage, type FieldMessageProps, Input, type InputProps, Radio, RadioGroup, type RadioGroupProps, type RadioProps, Select, SelectItem, type SelectItemProps, type SelectProps, Switch, type SwitchProps, Textarea, type TextareaProps, type UseFieldA11yOptions, buttonVariants, checkboxVariants, cn, inputVariants, radioGroupVariants, radioVariants, selectTriggerVariants, switchVariants, textareaVariants, useDga, useDir, useFieldA11y };
|
|
1239
|
+
export { Accordion, AccordionContent, type AccordionContentProps, AccordionItem, type AccordionItemProps, type AccordionProps, AccordionTrigger, type AccordionTriggerProps, Alert, AlertDescription, type AlertDescriptionProps, type AlertProps, type AlertSectionProps, AlertTitle, type AlertTitleProps, Avatar, AvatarFallback, type AvatarFallbackProps, AvatarGroup, type AvatarGroupProps, AvatarImage, type AvatarImageProps, type AvatarProps, type AvatarStatus, Badge, type BadgeProps, Breadcrumb, BreadcrumbEllipsis, type BreadcrumbEllipsisProps, BreadcrumbItem, type BreadcrumbItemProps, BreadcrumbLink, type BreadcrumbLinkProps, BreadcrumbList, type BreadcrumbListProps, BreadcrumbPage, type BreadcrumbPageProps, type BreadcrumbProps, BreadcrumbSeparator, type BreadcrumbSeparatorProps, Button, type ButtonProps, Card, CardContent, CardDescription, type CardDescriptionProps, CardFooter, CardHeader, CardImage, type CardImageProps, type CardProps, type CardSectionProps, CardTitle, type CardTitleProps, Checkbox, type CheckboxProps, CircularProgress, type CircularProgressProps, Combobox, ComboboxGroup, type ComboboxGroupProps, ComboboxItem, type ComboboxItemProps, type ComboboxProps, ComboboxSeparator, type ComboboxSeparatorProps, DatePicker, type DatePickerProps, DescriptionDetails, type DescriptionDetailsProps, DescriptionItem, type DescriptionItemProps, DescriptionList, type DescriptionListProps, DescriptionTerm, type DescriptionTermProps, DgaProvider, type DgaProviderProps, Divider, type DividerProps, Drawer, DrawerBody, DrawerClose, type DrawerCloseProps, DrawerContent, type DrawerContentProps, DrawerDescription, type DrawerDescriptionProps, DrawerFooter, DrawerHeader, type DrawerProps, type DrawerSectionProps, DrawerTitle, type DrawerTitleProps, DrawerTrigger, type DrawerTriggerProps, DropdownMenu, DropdownMenuCheckboxItem, type DropdownMenuCheckboxItemProps, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuGroup, type DropdownMenuGroupProps, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuLabel, type DropdownMenuLabelProps, type DropdownMenuProps, DropdownMenuRadioGroup, type DropdownMenuRadioGroupProps, DropdownMenuRadioItem, type DropdownMenuRadioItemProps, DropdownMenuSeparator, type DropdownMenuSeparatorProps, DropdownMenuSub, DropdownMenuSubContent, type DropdownMenuSubContentProps, type DropdownMenuSubProps, DropdownMenuSubTrigger, type DropdownMenuSubTriggerProps, DropdownMenuTrigger, type DropdownMenuTriggerProps, type FieldA11y, FieldMessage, type FieldMessageProps, type FileRejection, type FileStatus, FileUpload, type FileUploadProps, Input, type InputProps, Modal, ModalClose, type ModalCloseProps, ModalContent, type ModalContentProps, ModalDescription, type ModalDescriptionProps, ModalFooter, ModalHeader, type ModalProps, type ModalSectionProps, ModalTitle, type ModalTitleProps, ModalTrigger, type ModalTriggerProps, NumberInput, type NumberInputProps, Pagination, PaginationContent, type PaginationContentProps, PaginationEllipsis, type PaginationEllipsisProps, PaginationItem, type PaginationItemProps, PaginationLink, type PaginationLinkProps, PaginationNext, type PaginationNextProps, PaginationPrevious, type PaginationPreviousProps, type PaginationProps, Progress, type ProgressProps, Radio, RadioGroup, type RadioGroupProps, type RadioProps, Rating, type RatingProps, type RejectionCode, Select, SelectItem, type SelectItemProps, type SelectProps, Skeleton, type SkeletonProps, Slider, type SliderProps, type SliderValue, Spinner, type SpinnerProps, Step, StepDescription, type StepDescriptionProps, StepIndicator, type StepIndicatorProps, type StepProps, type StepState, StepTitle, type StepTitleProps, Steps, type StepsProps, Switch, type SwitchProps, Tabs, TabsContent, type TabsContentProps, TabsList, type TabsListProps, type TabsProps, TabsTrigger, type TabsTriggerProps, Textarea, type TextareaProps, type ToastAction, type ToastData, type ToastOptions, type ToastPosition, type ToastStore, type ToastVariant, Toaster, type ToasterProps, Toggle, ToggleGroup, ToggleGroupItem, type ToggleGroupItemProps, type ToggleGroupProps, type ToggleProps, Tooltip, TooltipContent, type TooltipContentProps, type TooltipProps, TooltipTrigger, type TooltipTriggerProps, type UploadFile, type UseFieldA11yOptions, accordionVariants, alertVariants, avatarVariants, badgeVariants, breadcrumbVariants, buttonVariants, cardVariants, checkboxVariants, circularProgressVariants, cn, comboboxTriggerVariants, comboboxVariants, createToast, createToastStore, datePickerVariants, descriptionListVariants, dividerVariants, drawerVariants, dropdownMenuVariants, inputVariants, modalContentVariants, numberInputVariants, paginationLinkVariants, paginationVariants, progressVariants, radioGroupVariants, radioVariants, ratingVariants, selectTriggerVariants, skeletonVariants, sliderVariants, spinnerVariants, stepVariants, stepsVariants, switchVariants, tabsListVariants, tabsVariants, textareaVariants, toast, toastStore, toastVariants, toastViewportVariants, toggleGroupVariants, toggleVariants, tooltipContentVariants, useDga, useDir, useFieldA11y };
|