@classic-homes/theme-react 0.6.4 → 0.8.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/README.md +318 -0
- package/dist/index.d.mts +729 -33
- package/dist/index.d.ts +729 -33
- package/dist/index.js +3906 -1007
- package/dist/index.mjs +3939 -1086
- package/package.json +8 -1
package/dist/index.d.ts
CHANGED
|
@@ -7,15 +7,29 @@ import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
|
7
7
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
8
8
|
import { PanelMode, PanelVariant, CardConfig, PanelEdge, DataPanelAction, PanelConstraints, Position, Size } from '@classic-homes/data-panel-core';
|
|
9
9
|
export { CardConfig, DataPanelAction, DataPanelState, PanelConstraints, PanelEdge, PanelMode, PanelVariant, Position, Size } from '@classic-homes/data-panel-core';
|
|
10
|
+
import { IconName } from '@classic-homes/theme-tokens/icons';
|
|
11
|
+
export { IconName } from '@classic-homes/theme-tokens/icons';
|
|
12
|
+
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
10
13
|
import { ClassValue } from 'clsx';
|
|
11
14
|
|
|
15
|
+
/** Button classes, from the shared recipe (same classes as theme-svelte) */
|
|
12
16
|
declare const buttonVariants: (props?: ({
|
|
13
|
-
variant?: "link" | "default" | "secondary" | "destructive" | "outline" | "ghost" | null | undefined;
|
|
14
|
-
size?: "default" | "sm" | "md" | "lg" | "icon" | null | undefined;
|
|
17
|
+
readonly variant?: "link" | "default" | "secondary" | "promo" | "destructive" | "outline" | "ghost" | null | undefined;
|
|
18
|
+
readonly size?: "default" | "sm" | "md" | "lg" | "icon" | null | undefined;
|
|
15
19
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
16
20
|
/** Base button props without size */
|
|
17
21
|
interface BaseButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement>, Omit<VariantProps<typeof buttonVariants>, 'size'> {
|
|
22
|
+
/** Render the single child element instead of a `<button>`, merging props onto it */
|
|
18
23
|
asChild?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Render an `<a href>` styled as a button. While disabled or loading the link
|
|
26
|
+
* loses its href, leaves the tab order and exposes `aria-disabled`.
|
|
27
|
+
*/
|
|
28
|
+
href?: string;
|
|
29
|
+
/** Show a spinner, disable the button and set `aria-busy` */
|
|
30
|
+
loading?: boolean;
|
|
31
|
+
/** Text shown instead of the children while loading */
|
|
32
|
+
loadingText?: string;
|
|
19
33
|
}
|
|
20
34
|
/**
|
|
21
35
|
* Icon-only buttons MUST have an aria-label for WCAG compliance.
|
|
@@ -36,7 +50,16 @@ interface NonIconButtonProps extends BaseButtonProps {
|
|
|
36
50
|
type ButtonProps = IconButtonProps | NonIconButtonProps;
|
|
37
51
|
declare const Button: React$1.ForwardRefExoticComponent<ButtonProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
38
52
|
|
|
39
|
-
|
|
53
|
+
/** Card classes, from the shared recipe (same classes as theme-svelte) */
|
|
54
|
+
declare const cardVariants: (props?: ({
|
|
55
|
+
readonly borderColor?: "default" | "primary" | "muted" | null | undefined;
|
|
56
|
+
readonly variant?: "default" | "featured" | "highlight" | "warning" | null | undefined;
|
|
57
|
+
readonly interactive?: boolean | null | undefined;
|
|
58
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
59
|
+
declare const cardHeaderVariants: (props?: ({
|
|
60
|
+
readonly variant?: "default" | "compact" | "bordered" | "shaded" | null | undefined;
|
|
61
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
62
|
+
interface CardProps extends React$1.HTMLAttributes<HTMLElement>, Omit<VariantProps<typeof cardVariants>, 'interactive'> {
|
|
40
63
|
/**
|
|
41
64
|
* The semantic HTML element to render.
|
|
42
65
|
* Use 'article' for standalone, self-contained content.
|
|
@@ -45,9 +68,33 @@ interface CardProps extends React$1.HTMLAttributes<HTMLElement> {
|
|
|
45
68
|
* @default 'div'
|
|
46
69
|
*/
|
|
47
70
|
as?: 'div' | 'article' | 'section' | 'aside';
|
|
71
|
+
/**
|
|
72
|
+
* Card variant
|
|
73
|
+
* - default: Standard 1px border
|
|
74
|
+
* - featured: Thicker 2px border
|
|
75
|
+
* - highlight: Teal border for positive/info callouts
|
|
76
|
+
* - warning: Red border for warnings/alerts
|
|
77
|
+
* @default 'default'
|
|
78
|
+
*/
|
|
79
|
+
variant?: 'default' | 'featured' | 'highlight' | 'warning';
|
|
80
|
+
/** Border colour override (ignored for the highlight/warning variants) */
|
|
81
|
+
borderColor?: 'default' | 'primary' | 'muted';
|
|
82
|
+
/** Hover shadow for clickable cards */
|
|
83
|
+
interactive?: boolean;
|
|
48
84
|
}
|
|
49
85
|
declare const Card: React$1.ForwardRefExoticComponent<CardProps & React$1.RefAttributes<HTMLElement>>;
|
|
50
|
-
|
|
86
|
+
interface CardHeaderProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantProps<typeof cardHeaderVariants> {
|
|
87
|
+
/**
|
|
88
|
+
* Visual variant
|
|
89
|
+
* - default: 1.5rem padding
|
|
90
|
+
* - compact: 1rem padding
|
|
91
|
+
* - bordered: bottom border
|
|
92
|
+
* - shaded: muted background
|
|
93
|
+
* @default 'default'
|
|
94
|
+
*/
|
|
95
|
+
variant?: 'default' | 'compact' | 'bordered' | 'shaded';
|
|
96
|
+
}
|
|
97
|
+
declare const CardHeader: React$1.ForwardRefExoticComponent<CardHeaderProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
51
98
|
interface CardTitleProps extends React$1.HTMLAttributes<HTMLHeadingElement> {
|
|
52
99
|
/** Heading level (h2 for page sections, h3 for nested, etc.) */
|
|
53
100
|
as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
@@ -93,13 +140,23 @@ interface PasswordInputProps extends Omit<React$1.InputHTMLAttributes<HTMLInputE
|
|
|
93
140
|
}
|
|
94
141
|
declare const PasswordInput: React$1.ForwardRefExoticComponent<PasswordInputProps & React$1.RefAttributes<HTMLInputElement>>;
|
|
95
142
|
|
|
96
|
-
|
|
97
|
-
|
|
143
|
+
/**
|
|
144
|
+
* Label classes, from the shared recipe (same classes as theme-svelte). The
|
|
145
|
+
* colour reads `--label-foreground`, falling back to `--foreground`.
|
|
146
|
+
*/
|
|
147
|
+
declare const labelVariants: (props?: ({
|
|
148
|
+
readonly disabled?: boolean | null | undefined;
|
|
149
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
150
|
+
interface LabelProps extends React$1.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> {
|
|
151
|
+
/** Dim the label for a disabled control that isn't its `peer` */
|
|
152
|
+
disabled?: boolean;
|
|
153
|
+
}
|
|
154
|
+
declare const Label: React$1.ForwardRefExoticComponent<LabelProps & React$1.RefAttributes<HTMLLabelElement>>;
|
|
98
155
|
|
|
99
156
|
declare const badgeVariants: (props?: ({
|
|
100
|
-
variant?: "default" | "secondary" | "destructive" | "outline" | "
|
|
101
|
-
size?: "default" | "sm" | "dot" | null | undefined;
|
|
102
|
-
clickable?: boolean | null | undefined;
|
|
157
|
+
readonly variant?: "default" | "secondary" | "promo" | "destructive" | "outline" | "off" | "warning" | "live" | "working" | "attention" | "critical" | "count" | "quantity" | "success" | "info" | null | undefined;
|
|
158
|
+
readonly size?: "default" | "sm" | "dot" | null | undefined;
|
|
159
|
+
readonly clickable?: boolean | null | undefined;
|
|
103
160
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
104
161
|
interface BadgeProps extends React$1.HTMLAttributes<HTMLElement>, Omit<VariantProps<typeof badgeVariants>, 'clickable'> {
|
|
105
162
|
/** When true, adds role="status" and aria-live="polite" for dynamic content announcements */
|
|
@@ -115,6 +172,10 @@ interface BadgeProps extends React$1.HTMLAttributes<HTMLElement>, Omit<VariantPr
|
|
|
115
172
|
}
|
|
116
173
|
declare const Badge: React$1.ForwardRefExoticComponent<BadgeProps & React$1.RefAttributes<HTMLElement>>;
|
|
117
174
|
|
|
175
|
+
/** Separator classes, from the shared recipe (same classes as theme-svelte) */
|
|
176
|
+
declare const separatorVariants: (props?: ({
|
|
177
|
+
readonly orientation?: "horizontal" | "vertical" | null | undefined;
|
|
178
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
118
179
|
interface SeparatorProps extends React$1.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root> {
|
|
119
180
|
}
|
|
120
181
|
declare const Separator: React$1.ForwardRefExoticComponent<SeparatorProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
@@ -146,7 +207,16 @@ interface SwitchProps extends React$1.ComponentPropsWithoutRef<'button'> {
|
|
|
146
207
|
}
|
|
147
208
|
declare const Switch: React$1.ForwardRefExoticComponent<SwitchProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
148
209
|
|
|
210
|
+
/** Avatar classes, from the shared recipe (same classes as theme-svelte) */
|
|
211
|
+
declare const avatarVariants: (props?: ({
|
|
212
|
+
readonly size?: "sm" | "md" | "lg" | "xs" | "xl" | null | undefined;
|
|
213
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
149
214
|
interface AvatarProps extends React$1.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root> {
|
|
215
|
+
/**
|
|
216
|
+
* Size: xs 24px, sm 32px, md 40px, lg 48px, xl 64px
|
|
217
|
+
* @default 'md'
|
|
218
|
+
*/
|
|
219
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
150
220
|
/**
|
|
151
221
|
* Name of the person or entity the avatar represents.
|
|
152
222
|
* When provided, auto-generates aria-label if not explicitly set.
|
|
@@ -169,36 +239,106 @@ interface AvatarImageProps extends Omit<React$1.ComponentPropsWithoutRef<typeof
|
|
|
169
239
|
declare const AvatarImage: React$1.ForwardRefExoticComponent<AvatarImageProps & React$1.RefAttributes<HTMLImageElement>>;
|
|
170
240
|
declare const AvatarFallback: React$1.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarFallbackProps & React$1.RefAttributes<HTMLSpanElement>, "ref"> & React$1.RefAttributes<HTMLSpanElement>>;
|
|
171
241
|
|
|
242
|
+
/** The Radix dialog root: compose it with DialogTrigger, DialogContent, … */
|
|
172
243
|
declare const Dialog: React$1.FC<DialogPrimitive.DialogProps>;
|
|
244
|
+
/** Alias of `Dialog` (the Radix root), named for clarity next to `SimpleDialog` */
|
|
245
|
+
declare const DialogRoot: React$1.FC<DialogPrimitive.DialogProps>;
|
|
173
246
|
declare const DialogTrigger: React$1.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
174
247
|
declare const DialogPortal: React$1.FC<DialogPrimitive.DialogPortalProps>;
|
|
175
248
|
declare const DialogClose: React$1.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
176
249
|
declare const dialogSizeClasses: {
|
|
177
|
-
readonly sm: "max-w-[
|
|
178
|
-
readonly md: "max-w-[
|
|
179
|
-
readonly lg: "max-w-[
|
|
180
|
-
readonly xl: "max-w-[
|
|
181
|
-
readonly '2xl': "max-w-[
|
|
250
|
+
readonly sm: "max-w-[calc(100vw-2rem)] sm:max-w-sm";
|
|
251
|
+
readonly md: "max-w-[calc(100vw-2rem)] sm:max-w-lg";
|
|
252
|
+
readonly lg: "max-w-[calc(100vw-2rem)] sm:max-w-xl";
|
|
253
|
+
readonly xl: "max-w-[calc(100vw-2rem)] sm:max-w-2xl";
|
|
254
|
+
readonly '2xl': "max-w-[calc(100vw-2rem)] sm:max-w-3xl";
|
|
182
255
|
readonly full: "max-w-[calc(100vw-2rem)]";
|
|
183
256
|
};
|
|
184
257
|
type DialogSize = keyof typeof dialogSizeClasses;
|
|
185
258
|
declare const DialogOverlay: React$1.ForwardRefExoticComponent<Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & DialogPrimitive.DialogOverlayProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
186
|
-
|
|
259
|
+
interface DialogContentProps extends React$1.ComponentPropsWithoutRef<'div'>, DialogPrimitive.DialogContentProps {
|
|
187
260
|
/** Dialog size - controls max-width (default: 'md') */
|
|
188
261
|
size?: DialogSize;
|
|
189
|
-
/**
|
|
262
|
+
/**
|
|
263
|
+
* Show the close button (default: true). It sits in DialogHeader's actions,
|
|
264
|
+
* or in the top-right corner when there is no DialogHeader.
|
|
265
|
+
*/
|
|
190
266
|
showClose?: boolean;
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
267
|
+
/**
|
|
268
|
+
* Unsaved work inside. When true, an overlay click, Escape or the close
|
|
269
|
+
* button asks "Discard unsaved changes?" instead of closing. Left unset,
|
|
270
|
+
* the dialog counts as dirty once anything inside is edited (typing, or a
|
|
271
|
+
* checkbox/switch/radio click; search inputs and `[data-dirty-ignore]`
|
|
272
|
+
* don't count). Pass `false` to turn the prompt off. Closing in code is
|
|
273
|
+
* never blocked.
|
|
274
|
+
*/
|
|
275
|
+
dirty?: boolean;
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* The dialog panel, laid out like theme-svelte's Dialog: put a DialogHeader,
|
|
279
|
+
* a DialogBody (scrolls when the viewport clamps the height) and a
|
|
280
|
+
* DialogFooter inside. Header and footer stay pinned.
|
|
281
|
+
*/
|
|
282
|
+
declare const DialogContent: React$1.ForwardRefExoticComponent<DialogContentProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
283
|
+
interface DialogHeaderProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
284
|
+
/** Buttons rendered before the close button */
|
|
285
|
+
actions?: React$1.ReactNode;
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Pinned header row (`border-b bg-muted/30`): title and description on the
|
|
289
|
+
* left, `actions` and the close button on the right.
|
|
290
|
+
*/
|
|
291
|
+
declare const DialogHeader: React$1.ForwardRefExoticComponent<DialogHeaderProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
292
|
+
/** The dialog's content area; scrolls when the viewport clamps the dialog's height */
|
|
293
|
+
declare const DialogBody: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLDivElement> & React$1.RefAttributes<HTMLDivElement>>;
|
|
294
|
+
/** Pinned footer row (`border-t bg-muted/30`); the discard prompt takes its place while it asks */
|
|
295
|
+
declare const DialogFooter: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLDivElement> & React$1.RefAttributes<HTMLDivElement>>;
|
|
200
296
|
declare const DialogTitle: React$1.ForwardRefExoticComponent<Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "ref"> & DialogPrimitive.DialogTitleProps & React$1.RefAttributes<HTMLHeadingElement>>;
|
|
201
297
|
declare const DialogDescription: React$1.ForwardRefExoticComponent<Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & DialogPrimitive.DialogDescriptionProps & React$1.RefAttributes<HTMLParagraphElement>>;
|
|
298
|
+
interface SimpleDialogProps {
|
|
299
|
+
/** Whether the dialog is open (controlled) */
|
|
300
|
+
open?: boolean;
|
|
301
|
+
/** Initial open state (uncontrolled) */
|
|
302
|
+
defaultOpen?: boolean;
|
|
303
|
+
/** Called when the open state changes */
|
|
304
|
+
onOpenChange?: (open: boolean) => void;
|
|
305
|
+
/** Dialog title, also its accessible name (ignored if `header` is given) */
|
|
306
|
+
title?: React$1.ReactNode;
|
|
307
|
+
/** Dialog description (ignored if `header` is given) */
|
|
308
|
+
description?: React$1.ReactNode;
|
|
309
|
+
/** Custom header content (replaces title/description) */
|
|
310
|
+
header?: React$1.ReactNode;
|
|
311
|
+
/** Header actions, rendered before the close button */
|
|
312
|
+
headerActions?: React$1.ReactNode;
|
|
313
|
+
/** Pinned footer, e.g. Cancel / Save buttons */
|
|
314
|
+
footer?: React$1.ReactNode;
|
|
315
|
+
/** Element that opens the dialog (rendered as the Radix trigger, so focus returns to it) */
|
|
316
|
+
trigger?: React$1.ReactElement;
|
|
317
|
+
/** Size - controls max-width (default: 'md') */
|
|
318
|
+
size?: DialogSize;
|
|
319
|
+
/** Show the close button (default: true) */
|
|
320
|
+
showClose?: boolean;
|
|
321
|
+
/** Unsaved-work guard; see `DialogContent`'s `dirty` */
|
|
322
|
+
dirty?: boolean;
|
|
323
|
+
/** Called before focus returns to the trigger on close; `preventDefault()` keeps it where it is */
|
|
324
|
+
onCloseAutoFocus?: (event: Event) => void;
|
|
325
|
+
/** Called as the dialog opens, before focus moves inside; `preventDefault()` to focus a field yourself */
|
|
326
|
+
onOpenAutoFocus?: (event: Event) => void;
|
|
327
|
+
/** Extra classes for the dialog panel */
|
|
328
|
+
className?: string;
|
|
329
|
+
children?: React$1.ReactNode;
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* A ready-made dialog with theme-svelte's `Dialog` props: title, description,
|
|
333
|
+
* footer, trigger, size, showClose and dirty. Use the Radix parts (`Dialog`,
|
|
334
|
+
* `DialogContent`, `DialogHeader`, …) when you need a custom layout.
|
|
335
|
+
*
|
|
336
|
+
* Named `SimpleDialog` because `Dialog` is the Radix root in this package.
|
|
337
|
+
*/
|
|
338
|
+
declare function SimpleDialog({ open, defaultOpen, onOpenChange, title, description, header, headerActions, footer, trigger, size, showClose, dirty, onCloseAutoFocus, onOpenAutoFocus, className, children, }: SimpleDialogProps): React$1.JSX.Element;
|
|
339
|
+
declare namespace SimpleDialog {
|
|
340
|
+
var displayName: string;
|
|
341
|
+
}
|
|
202
342
|
|
|
203
343
|
/**
|
|
204
344
|
* PageHeader - Hero/page header component
|
|
@@ -269,6 +409,15 @@ interface SheetProps {
|
|
|
269
409
|
footer?: React$1.ReactNode;
|
|
270
410
|
children: React$1.ReactNode;
|
|
271
411
|
className?: string;
|
|
412
|
+
/**
|
|
413
|
+
* Unsaved work inside. When true, an overlay click, Escape or the close
|
|
414
|
+
* button asks "Discard unsaved changes?" instead of closing. Left unset,
|
|
415
|
+
* the sheet counts as dirty once anything inside is edited (typing, or a
|
|
416
|
+
* checkbox/switch/radio click; search inputs and `[data-dirty-ignore]`
|
|
417
|
+
* don't count). Pass `false` to turn the prompt off. Closing in code is
|
|
418
|
+
* never blocked.
|
|
419
|
+
*/
|
|
420
|
+
dirty?: boolean;
|
|
272
421
|
}
|
|
273
422
|
/**
|
|
274
423
|
* Sheet - a modal panel that slides in from an edge of the screen. Same Radix
|
|
@@ -276,7 +425,7 @@ interface SheetProps {
|
|
|
276
425
|
* placement differs. Use it for version history, filters, or an editor's
|
|
277
426
|
* outline and inspector on small screens.
|
|
278
427
|
*/
|
|
279
|
-
declare function Sheet({ open, onOpenChange,
|
|
428
|
+
declare function Sheet({ open, onOpenChange, ...content }: SheetProps): React$1.JSX.Element;
|
|
280
429
|
|
|
281
430
|
/** Props to spread on the element that acts as an item's drag handle */
|
|
282
431
|
interface SortableHandleProps {
|
|
@@ -848,17 +997,20 @@ interface DataPanelTabProps {
|
|
|
848
997
|
declare const DataPanelTab: React$1.ForwardRefExoticComponent<DataPanelTabProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
849
998
|
declare const DataPanel: React$1.ForwardRefExoticComponent<DataPanelProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
850
999
|
|
|
1000
|
+
/** Skeleton classes, from the shared recipe (same classes as theme-svelte) */
|
|
851
1001
|
declare const skeletonVariants: (props?: ({
|
|
852
|
-
variant?: "text" | "default" | "title" | "button" | "card" | "avatar" | null | undefined;
|
|
1002
|
+
readonly variant?: "text" | "default" | "title" | "button" | "card" | "avatar" | null | undefined;
|
|
1003
|
+
readonly animation?: "none" | "pulse" | "shimmer" | null | undefined;
|
|
853
1004
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
854
|
-
interface SkeletonProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantProps<typeof skeletonVariants> {
|
|
1005
|
+
interface SkeletonProps extends React$1.HTMLAttributes<HTMLDivElement>, Omit<VariantProps<typeof skeletonVariants>, 'animation'> {
|
|
855
1006
|
/** Animation style for the skeleton */
|
|
856
1007
|
animation?: 'pulse' | 'shimmer' | 'none';
|
|
857
1008
|
}
|
|
858
1009
|
declare const Skeleton: React$1.ForwardRefExoticComponent<SkeletonProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
859
1010
|
|
|
1011
|
+
/** Spinner classes, from the shared recipe (same classes as theme-svelte) */
|
|
860
1012
|
declare const spinnerVariants: (props?: ({
|
|
861
|
-
size?: "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
1013
|
+
readonly size?: "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
862
1014
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
863
1015
|
interface SpinnerProps extends React$1.SVGAttributes<SVGSVGElement>, VariantProps<typeof spinnerVariants> {
|
|
864
1016
|
/** Accessible label for the spinner */
|
|
@@ -878,13 +1030,15 @@ interface LoadingLogoProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
|
878
1030
|
}
|
|
879
1031
|
declare const LoadingLogo: React$1.ForwardRefExoticComponent<LoadingLogoProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
880
1032
|
|
|
1033
|
+
/** Track and fill classes, from the shared recipes (same classes as theme-svelte) */
|
|
881
1034
|
declare const progressBarVariants: (props?: ({
|
|
882
|
-
size?: "sm" | "md" | "lg" | null | undefined;
|
|
1035
|
+
readonly size?: "sm" | "md" | "lg" | null | undefined;
|
|
883
1036
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
884
1037
|
declare const progressFillVariants: (props?: ({
|
|
885
|
-
variant?: "default" | "destructive" | "
|
|
1038
|
+
readonly variant?: "default" | "destructive" | "warning" | "success" | null | undefined;
|
|
1039
|
+
readonly indeterminate?: boolean | null | undefined;
|
|
886
1040
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
887
|
-
interface ProgressBarProps extends Omit<React$1.HTMLAttributes<HTMLDivElement>, 'role'>, VariantProps<typeof progressBarVariants>, VariantProps<typeof progressFillVariants> {
|
|
1041
|
+
interface ProgressBarProps extends Omit<React$1.HTMLAttributes<HTMLDivElement>, 'role'>, VariantProps<typeof progressBarVariants>, Omit<VariantProps<typeof progressFillVariants>, 'indeterminate'> {
|
|
888
1042
|
/** Progress value 0-100. Omit for indeterminate */
|
|
889
1043
|
value?: number;
|
|
890
1044
|
/** Maximum value */
|
|
@@ -952,6 +1106,548 @@ interface LoadingSectionProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
|
952
1106
|
}
|
|
953
1107
|
declare const LoadingSection: React$1.ForwardRefExoticComponent<LoadingSectionProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
954
1108
|
|
|
1109
|
+
declare const alertVariants: (props?: ({
|
|
1110
|
+
readonly variant?: "default" | "destructive" | "warning" | "success" | "info" | "error" | null | undefined;
|
|
1111
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1112
|
+
interface AlertProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantProps<typeof alertVariants> {
|
|
1113
|
+
}
|
|
1114
|
+
/**
|
|
1115
|
+
* A status message (`role="alert"`). Errors, destructive and warning alerts are
|
|
1116
|
+
* announced assertively, the others politely. Compose with `AlertTitle` and
|
|
1117
|
+
* `AlertDescription`; a leading `<svg>` icon is positioned for you.
|
|
1118
|
+
*/
|
|
1119
|
+
declare const Alert: React$1.ForwardRefExoticComponent<AlertProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
1120
|
+
declare const AlertTitle: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLHeadingElement> & React$1.RefAttributes<HTMLHeadingElement>>;
|
|
1121
|
+
declare const AlertDescription: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLDivElement> & React$1.RefAttributes<HTMLDivElement>>;
|
|
1122
|
+
|
|
1123
|
+
interface IconProps extends Omit<React$1.SVGProps<SVGSVGElement>, 'name' | 'ref'> {
|
|
1124
|
+
/** The name of the icon to display */
|
|
1125
|
+
name: IconName;
|
|
1126
|
+
/** Size of the icon in pixels (default: 24) */
|
|
1127
|
+
size?: number;
|
|
1128
|
+
/** Stroke width for stroke-based icons (default: 2) */
|
|
1129
|
+
strokeWidth?: number;
|
|
1130
|
+
/** Accessible label for the icon (renders as visually hidden text) */
|
|
1131
|
+
label?: string;
|
|
1132
|
+
}
|
|
1133
|
+
/**
|
|
1134
|
+
* An icon from `@classic-homes/theme-tokens/icons` (the same data theme-svelte's
|
|
1135
|
+
* Icon draws), on a 24x24 viewBox. Decorative (`aria-hidden`); pass `label` for
|
|
1136
|
+
* visually hidden text. `loading` spins.
|
|
1137
|
+
*/
|
|
1138
|
+
declare const Icon: React$1.ForwardRefExoticComponent<IconProps & React$1.RefAttributes<SVGSVGElement>>;
|
|
1139
|
+
|
|
1140
|
+
interface EmptyStateProps {
|
|
1141
|
+
title: string;
|
|
1142
|
+
description?: string;
|
|
1143
|
+
/** Icon shown above the title in a muted circle */
|
|
1144
|
+
icon?: IconName;
|
|
1145
|
+
/** `sm` for panels and lists, `md` for pages (default) */
|
|
1146
|
+
size?: 'sm' | 'md';
|
|
1147
|
+
/** Heading element for the title (default h3) */
|
|
1148
|
+
headingLevel?: 'h2' | 'h3' | 'h4' | 'p';
|
|
1149
|
+
className?: string;
|
|
1150
|
+
/** Buttons or links under the description */
|
|
1151
|
+
actions?: React$1.ReactNode;
|
|
1152
|
+
/** Extra content between the description and the actions */
|
|
1153
|
+
children?: React$1.ReactNode;
|
|
1154
|
+
}
|
|
1155
|
+
/** A centred placeholder for a view with nothing to show yet. */
|
|
1156
|
+
declare function EmptyState({ title, description, icon, size, headingLevel, className, actions, children, }: EmptyStateProps): React$1.JSX.Element;
|
|
1157
|
+
|
|
1158
|
+
interface SectionProps extends Omit<React$1.HTMLAttributes<HTMLElement>, 'title'> {
|
|
1159
|
+
/** Section title (rendered as h2) */
|
|
1160
|
+
title?: string;
|
|
1161
|
+
/** Optional description text below the title */
|
|
1162
|
+
description?: string;
|
|
1163
|
+
}
|
|
1164
|
+
/**
|
|
1165
|
+
* A page-level content container with an optional title and description
|
|
1166
|
+
* (Cards are for individual panels).
|
|
1167
|
+
*/
|
|
1168
|
+
declare const Section: React$1.ForwardRefExoticComponent<SectionProps & React$1.RefAttributes<HTMLElement>>;
|
|
1169
|
+
|
|
1170
|
+
declare const kbdVariants: (props?: ({
|
|
1171
|
+
readonly size?: "sm" | "md" | null | undefined;
|
|
1172
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1173
|
+
/** Whether shortcuts should use Apple modifier symbols (⌘, ⌥, ⇧). */
|
|
1174
|
+
declare function isApplePlatform(): boolean;
|
|
1175
|
+
/** The text shown for one key, and the name read out for it. */
|
|
1176
|
+
declare function formatKey(key: string, apple?: boolean): {
|
|
1177
|
+
label: string;
|
|
1178
|
+
name: string;
|
|
1179
|
+
};
|
|
1180
|
+
interface KbdProps {
|
|
1181
|
+
/** Keys of a combination, e.g. ['Mod', 'K'] ("Mod" is ⌘ on Apple devices, Ctrl elsewhere) */
|
|
1182
|
+
keys?: string[];
|
|
1183
|
+
size?: 'sm' | 'md';
|
|
1184
|
+
className?: string;
|
|
1185
|
+
/** A single key, when `keys` is not given */
|
|
1186
|
+
children?: React$1.ReactNode;
|
|
1187
|
+
}
|
|
1188
|
+
/** A keyboard key or shortcut. */
|
|
1189
|
+
declare function Kbd({ keys, size, className, children }: KbdProps): React$1.JSX.Element;
|
|
1190
|
+
|
|
1191
|
+
declare const tableRowVariants: (props?: ({
|
|
1192
|
+
readonly striped?: boolean | null | undefined;
|
|
1193
|
+
readonly interactive?: boolean | null | undefined;
|
|
1194
|
+
readonly selected?: boolean | null | undefined;
|
|
1195
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1196
|
+
declare const tableHeadVariants: (props?: ({
|
|
1197
|
+
readonly align?: "left" | "right" | "center" | null | undefined;
|
|
1198
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1199
|
+
declare const tableCellVariants: (props?: ({
|
|
1200
|
+
readonly align?: "left" | "right" | "center" | null | undefined;
|
|
1201
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1202
|
+
interface TableContainerProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
1203
|
+
/**
|
|
1204
|
+
* Accessible name for the scroll region. When set, the container is a
|
|
1205
|
+
* focusable `role="region"`, so keyboard users can scroll a wide table.
|
|
1206
|
+
*/
|
|
1207
|
+
label?: string;
|
|
1208
|
+
}
|
|
1209
|
+
/** Bordered, horizontally scrolling wrapper for a `Table`. */
|
|
1210
|
+
declare const TableContainer: React$1.ForwardRefExoticComponent<TableContainerProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
1211
|
+
/** Styled `<table>` (the DataTable look). Wrap it in `TableContainer` for the border and scrolling. */
|
|
1212
|
+
declare const Table: React$1.ForwardRefExoticComponent<React$1.TableHTMLAttributes<HTMLTableElement> & React$1.RefAttributes<HTMLTableElement>>;
|
|
1213
|
+
declare const TableHeader: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLTableSectionElement> & React$1.RefAttributes<HTMLTableSectionElement>>;
|
|
1214
|
+
declare const TableBody: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLTableSectionElement> & React$1.RefAttributes<HTMLTableSectionElement>>;
|
|
1215
|
+
interface TableRowProps extends React$1.HTMLAttributes<HTMLTableRowElement>, VariantProps<typeof tableRowVariants> {
|
|
1216
|
+
}
|
|
1217
|
+
declare const TableRow: React$1.ForwardRefExoticComponent<TableRowProps & React$1.RefAttributes<HTMLTableRowElement>>;
|
|
1218
|
+
interface TableHeadProps extends Omit<React$1.ThHTMLAttributes<HTMLTableCellElement>, 'align'>, VariantProps<typeof tableHeadVariants> {
|
|
1219
|
+
}
|
|
1220
|
+
declare const TableHead: React$1.ForwardRefExoticComponent<TableHeadProps & React$1.RefAttributes<HTMLTableCellElement>>;
|
|
1221
|
+
interface TableCellProps extends Omit<React$1.TdHTMLAttributes<HTMLTableCellElement>, 'align'>, VariantProps<typeof tableCellVariants> {
|
|
1222
|
+
}
|
|
1223
|
+
declare const TableCell: React$1.ForwardRefExoticComponent<TableCellProps & React$1.RefAttributes<HTMLTableCellElement>>;
|
|
1224
|
+
declare const TableCaption: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLTableCaptionElement> & React$1.RefAttributes<HTMLTableCaptionElement>>;
|
|
1225
|
+
|
|
1226
|
+
/** The status dot after a tab's label: `true` is `success`. */
|
|
1227
|
+
type TabIndicator = boolean | 'success' | 'destructive';
|
|
1228
|
+
interface Tab {
|
|
1229
|
+
id: string;
|
|
1230
|
+
label: string;
|
|
1231
|
+
disabled?: boolean;
|
|
1232
|
+
/**
|
|
1233
|
+
* Count shown as a small pill after the label (99+ above 99); whole numbers of
|
|
1234
|
+
* 1 or more only. The tab's accessible name carries the count in words.
|
|
1235
|
+
*/
|
|
1236
|
+
badge?: number;
|
|
1237
|
+
/** Small dot after the label: `success` (`true`) or `destructive`. */
|
|
1238
|
+
indicator?: TabIndicator;
|
|
1239
|
+
/** Words for the dot in the tab's accessible name, e.g. "new answer". */
|
|
1240
|
+
indicatorLabel?: string;
|
|
1241
|
+
}
|
|
1242
|
+
interface TabsProps {
|
|
1243
|
+
/** Tab definitions */
|
|
1244
|
+
tabs: Tab[];
|
|
1245
|
+
/** Active tab id (controlled) */
|
|
1246
|
+
value?: string;
|
|
1247
|
+
/** Initial tab id when uncontrolled (default: the first tab) */
|
|
1248
|
+
defaultValue?: string;
|
|
1249
|
+
onValueChange?: (value: string) => void;
|
|
1250
|
+
/** Base for the tab and panel ids (`{id}-tab-{tabId}`, `{id}-panel-{tabId}`) */
|
|
1251
|
+
id?: string;
|
|
1252
|
+
/** Accessible label for the tab list, e.g. "Account settings" */
|
|
1253
|
+
label: string;
|
|
1254
|
+
/** Additional classes for the container */
|
|
1255
|
+
className?: string;
|
|
1256
|
+
/**
|
|
1257
|
+
* Tab panels: compose with `TabPanel` so each gets `role="tabpanel"` and the
|
|
1258
|
+
* id / aria-labelledby wiring. aria-controls is only set while a panel exists.
|
|
1259
|
+
*/
|
|
1260
|
+
children?: React$1.ReactNode;
|
|
1261
|
+
/**
|
|
1262
|
+
* When the tabs are wider than their container: `auto` (default) shows a
|
|
1263
|
+
* full-width Select of the tabs instead; `never` wraps the tab row.
|
|
1264
|
+
*/
|
|
1265
|
+
collapse?: 'auto' | 'never';
|
|
1266
|
+
/** Stretch the tab row to the container's width, every tab the same width */
|
|
1267
|
+
fullWidth?: boolean;
|
|
1268
|
+
/** Accessible-name words for a tab's `badge` count (default: "N unread") */
|
|
1269
|
+
badgeLabel?: (count: number) => string;
|
|
1270
|
+
}
|
|
1271
|
+
/**
|
|
1272
|
+
* A row of tabs (`role="tablist"`) with arrow-key, Home and End navigation.
|
|
1273
|
+
* Render the panels as `TabPanel` children.
|
|
1274
|
+
*/
|
|
1275
|
+
declare function Tabs({ tabs, value: valueProp, defaultValue, onValueChange, id, label, className, children, collapse, fullWidth, badgeLabel, }: TabsProps): React$1.JSX.Element;
|
|
1276
|
+
interface TabPanelProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
1277
|
+
/** Id of the tab this panel belongs to */
|
|
1278
|
+
value: string;
|
|
1279
|
+
}
|
|
1280
|
+
/** The content of one tab; rendered only while its tab is active. */
|
|
1281
|
+
declare function TabPanel({ value, className, children, ...props }: TabPanelProps): React$1.JSX.Element | null;
|
|
1282
|
+
|
|
1283
|
+
declare const textareaVariants: (props?: ({
|
|
1284
|
+
readonly invalid?: boolean | null | undefined;
|
|
1285
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1286
|
+
interface TextareaProps extends React$1.TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
1287
|
+
/** Error styling (red border and ring); point `aria-describedby` at the message */
|
|
1288
|
+
'aria-invalid'?: boolean | 'true' | 'false';
|
|
1289
|
+
/** Called with the new text on every input */
|
|
1290
|
+
onValueChange?: (value: string) => void;
|
|
1291
|
+
/**
|
|
1292
|
+
* Grow with the content instead of showing a resize handle. `rows` is the
|
|
1293
|
+
* minimum height; past `maxRows` the textarea scrolls.
|
|
1294
|
+
*/
|
|
1295
|
+
autosize?: boolean;
|
|
1296
|
+
/** Upper bound for `autosize`, in rows (default 8) */
|
|
1297
|
+
maxRows?: number;
|
|
1298
|
+
/**
|
|
1299
|
+
* Saved value to offer a revert to. While the value differs from it, a small
|
|
1300
|
+
* revert button shows in the top-right corner; the revert goes onto the
|
|
1301
|
+
* browser's undo stack, so Ctrl/Cmd+Z brings the edit back.
|
|
1302
|
+
*/
|
|
1303
|
+
revertTo?: string;
|
|
1304
|
+
/** Accessible label / tooltip of the revert button (default "Revert to saved") */
|
|
1305
|
+
revertLabel?: string;
|
|
1306
|
+
}
|
|
1307
|
+
declare const Textarea: React$1.ForwardRefExoticComponent<TextareaProps & React$1.RefAttributes<HTMLTextAreaElement>>;
|
|
1308
|
+
|
|
1309
|
+
interface NumberInputProps {
|
|
1310
|
+
/** Current numeric value (controlled); `null` is empty */
|
|
1311
|
+
value?: number | null;
|
|
1312
|
+
/** Initial value when uncontrolled */
|
|
1313
|
+
defaultValue?: number | null;
|
|
1314
|
+
/** Callback when value changes */
|
|
1315
|
+
onValueChange?: (value: number | null) => void;
|
|
1316
|
+
/** Minimum allowed value */
|
|
1317
|
+
min?: number;
|
|
1318
|
+
/** Maximum allowed value */
|
|
1319
|
+
max?: number;
|
|
1320
|
+
/** Step increment for stepper buttons and arrow keys (default 1) */
|
|
1321
|
+
step?: number;
|
|
1322
|
+
disabled?: boolean;
|
|
1323
|
+
readOnly?: boolean;
|
|
1324
|
+
required?: boolean;
|
|
1325
|
+
placeholder?: string;
|
|
1326
|
+
/** Name attribute for form submission */
|
|
1327
|
+
name?: string;
|
|
1328
|
+
/** Element ID */
|
|
1329
|
+
id?: string;
|
|
1330
|
+
/** Whether to show the -/+ stepper buttons (default true) */
|
|
1331
|
+
showStepper?: boolean;
|
|
1332
|
+
/** Label text for the input */
|
|
1333
|
+
label?: string;
|
|
1334
|
+
/** Hint text displayed below the input */
|
|
1335
|
+
hint?: string;
|
|
1336
|
+
/** Error message (also sets aria-invalid) */
|
|
1337
|
+
error?: string;
|
|
1338
|
+
/** Accessible name when there is no visible label */
|
|
1339
|
+
'aria-label'?: string;
|
|
1340
|
+
/** Additional class for the input row */
|
|
1341
|
+
className?: string;
|
|
1342
|
+
}
|
|
1343
|
+
/**
|
|
1344
|
+
* A number field with -/+ stepper buttons. ArrowUp/ArrowDown step the value;
|
|
1345
|
+
* it is clamped to `min`/`max` on blur and when stepping.
|
|
1346
|
+
*/
|
|
1347
|
+
declare const NumberInput: React$1.ForwardRefExoticComponent<NumberInputProps & React$1.RefAttributes<HTMLInputElement>>;
|
|
1348
|
+
|
|
1349
|
+
declare const triggerVariants: (props?: ({
|
|
1350
|
+
readonly invalid?: boolean | null | undefined;
|
|
1351
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1352
|
+
interface SelectOption {
|
|
1353
|
+
value: string;
|
|
1354
|
+
label: string;
|
|
1355
|
+
disabled?: boolean;
|
|
1356
|
+
/** Secondary line under the label (e.g. a person's email) */
|
|
1357
|
+
description?: string;
|
|
1358
|
+
}
|
|
1359
|
+
interface SelectGroup {
|
|
1360
|
+
label: string;
|
|
1361
|
+
options: SelectOption[];
|
|
1362
|
+
}
|
|
1363
|
+
interface SelectProps {
|
|
1364
|
+
/** Selected value (controlled); '' shows the placeholder */
|
|
1365
|
+
value?: string;
|
|
1366
|
+
/** Initial value when uncontrolled */
|
|
1367
|
+
defaultValue?: string;
|
|
1368
|
+
onValueChange?: (value: string) => void;
|
|
1369
|
+
/** Placeholder text when no value is selected */
|
|
1370
|
+
placeholder?: string;
|
|
1371
|
+
/** Options, or groups of options */
|
|
1372
|
+
options: (SelectOption | SelectGroup)[];
|
|
1373
|
+
disabled?: boolean;
|
|
1374
|
+
/** Name attribute for form submission */
|
|
1375
|
+
name?: string;
|
|
1376
|
+
required?: boolean;
|
|
1377
|
+
/** Additional class for the trigger */
|
|
1378
|
+
className?: string;
|
|
1379
|
+
/** Visible label */
|
|
1380
|
+
label?: string;
|
|
1381
|
+
/** Trigger id (generated when not given), e.g. for an external `<label htmlFor>` */
|
|
1382
|
+
id?: string;
|
|
1383
|
+
/** Error message (also sets aria-invalid) */
|
|
1384
|
+
error?: string;
|
|
1385
|
+
/** Hint text displayed below the select */
|
|
1386
|
+
hint?: string;
|
|
1387
|
+
/** Accessible name for the trigger, when there is no visible label */
|
|
1388
|
+
'aria-label'?: string;
|
|
1389
|
+
/** ID of an element that labels the trigger */
|
|
1390
|
+
'aria-labelledby'?: string;
|
|
1391
|
+
}
|
|
1392
|
+
/**
|
|
1393
|
+
* A single-choice dropdown built from an `options` array (Radix Select), with
|
|
1394
|
+
* an optional label, hint and error.
|
|
1395
|
+
*/
|
|
1396
|
+
declare const Select: React$1.ForwardRefExoticComponent<SelectProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
1397
|
+
|
|
1398
|
+
declare const checkboxVariants: (props?: ({
|
|
1399
|
+
readonly invalid?: boolean | null | undefined;
|
|
1400
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1401
|
+
interface CheckboxProps extends Omit<React$1.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>, 'checked' | 'defaultChecked' | 'onCheckedChange' | 'children'> {
|
|
1402
|
+
checked?: boolean;
|
|
1403
|
+
defaultChecked?: boolean;
|
|
1404
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
1405
|
+
/** Error message shown under the checkbox (also sets aria-invalid) */
|
|
1406
|
+
error?: string;
|
|
1407
|
+
/** Label content, rendered in a `<label>` next to the box */
|
|
1408
|
+
children?: React$1.ReactNode;
|
|
1409
|
+
}
|
|
1410
|
+
/**
|
|
1411
|
+
* A checkbox with an optional label (`children`) and error message. The
|
|
1412
|
+
* clickable area extends to 44x44px around the box.
|
|
1413
|
+
*/
|
|
1414
|
+
declare const Checkbox: React$1.ForwardRefExoticComponent<CheckboxProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
1415
|
+
|
|
1416
|
+
interface RadioOption {
|
|
1417
|
+
value: string;
|
|
1418
|
+
label: string;
|
|
1419
|
+
disabled?: boolean;
|
|
1420
|
+
description?: string;
|
|
1421
|
+
}
|
|
1422
|
+
interface RadioGroupProps {
|
|
1423
|
+
/** Selected value (controlled) */
|
|
1424
|
+
value?: string;
|
|
1425
|
+
/** Initial value when uncontrolled */
|
|
1426
|
+
defaultValue?: string;
|
|
1427
|
+
onValueChange?: (value: string) => void;
|
|
1428
|
+
options: RadioOption[];
|
|
1429
|
+
/** Disables the whole group */
|
|
1430
|
+
disabled?: boolean;
|
|
1431
|
+
required?: boolean;
|
|
1432
|
+
/** Name attribute for form submission (also the base of the option ids) */
|
|
1433
|
+
name?: string;
|
|
1434
|
+
/** Layout orientation (default vertical; horizontal stacks below `sm`) */
|
|
1435
|
+
orientation?: 'horizontal' | 'vertical';
|
|
1436
|
+
/** Visible label for the group */
|
|
1437
|
+
label?: string;
|
|
1438
|
+
/** Accessible name when there is no visible label */
|
|
1439
|
+
'aria-label'?: string;
|
|
1440
|
+
hint?: string;
|
|
1441
|
+
/** Error message (also sets aria-invalid) */
|
|
1442
|
+
error?: string;
|
|
1443
|
+
className?: string;
|
|
1444
|
+
}
|
|
1445
|
+
/** A group of radio buttons built from an `options` array. */
|
|
1446
|
+
declare const RadioGroup: React$1.ForwardRefExoticComponent<RadioGroupProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
1447
|
+
|
|
1448
|
+
interface SliderProps {
|
|
1449
|
+
/** Current value(s), controlled; two values make a range slider */
|
|
1450
|
+
value?: number[];
|
|
1451
|
+
/** Initial value(s) when uncontrolled (default [50]) */
|
|
1452
|
+
defaultValue?: number[];
|
|
1453
|
+
min?: number;
|
|
1454
|
+
max?: number;
|
|
1455
|
+
step?: number;
|
|
1456
|
+
disabled?: boolean;
|
|
1457
|
+
orientation?: 'horizontal' | 'vertical';
|
|
1458
|
+
/** Called as the value changes (during a drag) */
|
|
1459
|
+
onValueChange?: (value: number[]) => void;
|
|
1460
|
+
/** Called when a change is committed (drag ends, key press) */
|
|
1461
|
+
onValueCommit?: (value: number[]) => void;
|
|
1462
|
+
size?: 'sm' | 'md' | 'lg';
|
|
1463
|
+
/** Label above the slider; also the thumbs' accessible name */
|
|
1464
|
+
label?: string;
|
|
1465
|
+
/** Show the current value next to the label */
|
|
1466
|
+
showValue?: boolean;
|
|
1467
|
+
/** Format for the shown value and each thumb's aria-valuetext */
|
|
1468
|
+
formatValue?: (value: number) => string;
|
|
1469
|
+
hint?: string;
|
|
1470
|
+
error?: string;
|
|
1471
|
+
/** Additional class for the container */
|
|
1472
|
+
className?: string;
|
|
1473
|
+
}
|
|
1474
|
+
/** A slider with one thumb, or a range with several. */
|
|
1475
|
+
declare const Slider: React$1.ForwardRefExoticComponent<SliderProps & React$1.RefAttributes<HTMLSpanElement>>;
|
|
1476
|
+
|
|
1477
|
+
interface SegmentedControlOption {
|
|
1478
|
+
value: string;
|
|
1479
|
+
label: string;
|
|
1480
|
+
/** Leading icon */
|
|
1481
|
+
icon?: IconName;
|
|
1482
|
+
disabled?: boolean;
|
|
1483
|
+
}
|
|
1484
|
+
interface SegmentedControlProps extends Omit<React$1.HTMLAttributes<HTMLDivElement>, 'defaultValue' | 'onChange' | 'dir' | 'children'> {
|
|
1485
|
+
options: SegmentedControlOption[];
|
|
1486
|
+
/** Selected value (controlled) */
|
|
1487
|
+
value?: string;
|
|
1488
|
+
/** Initial value when uncontrolled; defaults to the first enabled option */
|
|
1489
|
+
defaultValue?: string;
|
|
1490
|
+
onValueChange?: (value: string) => void;
|
|
1491
|
+
/** Accessible name of the group, e.g. "Group homes by" */
|
|
1492
|
+
label: string;
|
|
1493
|
+
size?: 'sm' | 'md';
|
|
1494
|
+
/** Disables every option */
|
|
1495
|
+
disabled?: boolean;
|
|
1496
|
+
}
|
|
1497
|
+
/**
|
|
1498
|
+
* Single-choice pill group (e.g. "Community | Collection | Floor Plan").
|
|
1499
|
+
*
|
|
1500
|
+
* A radio group under the hood: one option is always selected, arrow keys move
|
|
1501
|
+
* between options, Tab leaves the control. Too many options for the width and
|
|
1502
|
+
* it scrolls sideways (with edge fades), keeping the checked option in view.
|
|
1503
|
+
*/
|
|
1504
|
+
declare const SegmentedControl: React$1.ForwardRefExoticComponent<SegmentedControlProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
1505
|
+
|
|
1506
|
+
interface TooltipProps {
|
|
1507
|
+
/** Text shown in the tooltip */
|
|
1508
|
+
content: React$1.ReactNode;
|
|
1509
|
+
/** Side of the trigger to show the tooltip (default top) */
|
|
1510
|
+
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
1511
|
+
/** Alignment relative to the trigger (default center) */
|
|
1512
|
+
align?: 'start' | 'center' | 'end';
|
|
1513
|
+
/** Delay in ms before showing (default 200) */
|
|
1514
|
+
delayDuration?: number;
|
|
1515
|
+
/**
|
|
1516
|
+
* Touch behaviour. Tooltips open on hover and focus, which touch never gives.
|
|
1517
|
+
* `'tap'` makes a tap on the trigger toggle the tooltip and a tap elsewhere
|
|
1518
|
+
* close it: for info-only triggers (a definition behind an ⓘ), not for
|
|
1519
|
+
* action buttons, where a tap should only act.
|
|
1520
|
+
*/
|
|
1521
|
+
touch?: 'none' | 'tap';
|
|
1522
|
+
/** Additional class for the tooltip content */
|
|
1523
|
+
className?: string;
|
|
1524
|
+
/**
|
|
1525
|
+
* The trigger: one focusable element (a Button, a link). It receives the
|
|
1526
|
+
* trigger props and `aria-describedby`, like Radix `asChild`.
|
|
1527
|
+
*/
|
|
1528
|
+
children: React$1.ReactElement;
|
|
1529
|
+
}
|
|
1530
|
+
/** A short text label shown on hover and keyboard focus. */
|
|
1531
|
+
declare function Tooltip({ content, side, align, delayDuration, touch, className, children, }: TooltipProps): React$1.JSX.Element;
|
|
1532
|
+
|
|
1533
|
+
interface PopoverProps {
|
|
1534
|
+
/** Whether the popover is shown (controlled) */
|
|
1535
|
+
open?: boolean;
|
|
1536
|
+
/** Initial open state when uncontrolled */
|
|
1537
|
+
defaultOpen?: boolean;
|
|
1538
|
+
onOpenChange?: (open: boolean) => void;
|
|
1539
|
+
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
1540
|
+
align?: 'start' | 'center' | 'end';
|
|
1541
|
+
/** Distance from the trigger in px (default 6) */
|
|
1542
|
+
sideOffset?: number;
|
|
1543
|
+
/**
|
|
1544
|
+
* Element to position against instead of the trigger (with no `trigger`,
|
|
1545
|
+
* control the popover through `open`), e.g. a suggestion list under a text
|
|
1546
|
+
* field that must keep focus (`autoFocus={false}`).
|
|
1547
|
+
*/
|
|
1548
|
+
anchor?: React$1.RefObject<HTMLElement | null>;
|
|
1549
|
+
/** Move focus into the content when it opens (default true) */
|
|
1550
|
+
autoFocus?: boolean;
|
|
1551
|
+
/** Accessible name for the content when it has no visible heading */
|
|
1552
|
+
'aria-label'?: string;
|
|
1553
|
+
/** Additional class for the content */
|
|
1554
|
+
className?: string;
|
|
1555
|
+
/** The trigger: one focusable element (a Button), like Radix `asChild` */
|
|
1556
|
+
trigger?: React$1.ReactElement;
|
|
1557
|
+
/** Popover content */
|
|
1558
|
+
children: React$1.ReactNode;
|
|
1559
|
+
}
|
|
1560
|
+
/** Floating content anchored to a trigger (Radix Popover). */
|
|
1561
|
+
declare function Popover({ open, defaultOpen, onOpenChange, side, align, sideOffset, anchor, autoFocus, 'aria-label': ariaLabel, className, trigger, children, }: PopoverProps): React$1.JSX.Element;
|
|
1562
|
+
|
|
1563
|
+
interface DropdownMenuItem {
|
|
1564
|
+
type?: 'item' | 'separator' | 'label';
|
|
1565
|
+
label?: string;
|
|
1566
|
+
value?: string;
|
|
1567
|
+
disabled?: boolean;
|
|
1568
|
+
onSelect?: () => void;
|
|
1569
|
+
destructive?: boolean;
|
|
1570
|
+
/** Shortcut hint shown at the end (also `aria-keyshortcuts`) */
|
|
1571
|
+
shortcut?: string;
|
|
1572
|
+
/** Optional leading icon */
|
|
1573
|
+
icon?: IconName;
|
|
1574
|
+
/** Render the item as a link to this URL (selection still fires `onSelect`) */
|
|
1575
|
+
href?: string;
|
|
1576
|
+
/**
|
|
1577
|
+
* Make this a checkbox item (`menuitemcheckbox`) showing this state.
|
|
1578
|
+
* Selecting it fires `onSelect` and keeps the menu open.
|
|
1579
|
+
*/
|
|
1580
|
+
checked?: boolean;
|
|
1581
|
+
}
|
|
1582
|
+
interface DropdownMenuGroup {
|
|
1583
|
+
label?: string;
|
|
1584
|
+
items: DropdownMenuItem[];
|
|
1585
|
+
}
|
|
1586
|
+
type ButtonVariantProps = VariantProps<typeof buttonVariants>;
|
|
1587
|
+
interface DropdownMenuProps {
|
|
1588
|
+
/** Menu entries, or groups of them */
|
|
1589
|
+
items: (DropdownMenuItem | DropdownMenuGroup)[];
|
|
1590
|
+
/** Trigger content, rendered inside the trigger `<button>` */
|
|
1591
|
+
trigger: React$1.ReactNode;
|
|
1592
|
+
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
1593
|
+
align?: 'start' | 'center' | 'end';
|
|
1594
|
+
/** Whether the menu is open (controlled) */
|
|
1595
|
+
open?: boolean;
|
|
1596
|
+
onOpenChange?: (open: boolean) => void;
|
|
1597
|
+
/** Additional class for the menu content */
|
|
1598
|
+
className?: string;
|
|
1599
|
+
/** Classes for the trigger `<button>` (style it here rather than nesting a button in `trigger`) */
|
|
1600
|
+
triggerClassName?: string;
|
|
1601
|
+
/** Style the trigger as a Button variant (e.g. `ghost`); unset leaves it unstyled */
|
|
1602
|
+
triggerVariant?: ButtonVariantProps['variant'];
|
|
1603
|
+
/** Button size for the trigger when `triggerVariant` is set (default `sm`) */
|
|
1604
|
+
triggerSize?: ButtonVariantProps['size'];
|
|
1605
|
+
/** Accessible name for the trigger (for icon-only triggers) */
|
|
1606
|
+
triggerLabel?: string;
|
|
1607
|
+
/** Show a chevron after the trigger content, turned while the menu is open */
|
|
1608
|
+
showChevron?: boolean;
|
|
1609
|
+
/** Disable the trigger */
|
|
1610
|
+
triggerDisabled?: boolean;
|
|
1611
|
+
/**
|
|
1612
|
+
* Keep the trigger's pointer, mouse, click and opening-key events from
|
|
1613
|
+
* bubbling past it, so a menu inside a clickable row opens without also
|
|
1614
|
+
* activating the row.
|
|
1615
|
+
*/
|
|
1616
|
+
triggerStopPropagation?: boolean;
|
|
1617
|
+
/** Called on a click of the trigger */
|
|
1618
|
+
onTriggerClick?: (event: React$1.MouseEvent<HTMLButtonElement>) => void;
|
|
1619
|
+
/**
|
|
1620
|
+
* Called as the menu closes, before focus returns to the trigger;
|
|
1621
|
+
* `preventDefault()` keeps focus where a chosen item put it.
|
|
1622
|
+
*/
|
|
1623
|
+
onCloseAutoFocus?: (event: Event) => void;
|
|
1624
|
+
}
|
|
1625
|
+
/** A menu of actions opened from a trigger button, built from an `items` array. */
|
|
1626
|
+
declare function DropdownMenu({ items, trigger, side, align, open: openProp, onOpenChange, className, triggerClassName, triggerVariant, triggerSize, triggerLabel, showChevron, triggerDisabled, triggerStopPropagation, onTriggerClick, onCloseAutoFocus, }: DropdownMenuProps): React$1.JSX.Element;
|
|
1627
|
+
|
|
1628
|
+
interface CollapsibleProps {
|
|
1629
|
+
/** Whether the content is shown (controlled) */
|
|
1630
|
+
open?: boolean;
|
|
1631
|
+
/** Initial open state when uncontrolled */
|
|
1632
|
+
defaultOpen?: boolean;
|
|
1633
|
+
onOpenChange?: (open: boolean) => void;
|
|
1634
|
+
disabled?: boolean;
|
|
1635
|
+
/** Trigger text; ignored when `trigger` is given */
|
|
1636
|
+
label?: React$1.ReactNode;
|
|
1637
|
+
/** Custom trigger content, rendered inside the trigger button */
|
|
1638
|
+
trigger?: (state: {
|
|
1639
|
+
open: boolean;
|
|
1640
|
+
}) => React$1.ReactNode;
|
|
1641
|
+
/** Show the chevron before the trigger content (default true) */
|
|
1642
|
+
chevron?: boolean;
|
|
1643
|
+
className?: string;
|
|
1644
|
+
triggerClassName?: string;
|
|
1645
|
+
contentClassName?: string;
|
|
1646
|
+
children: React$1.ReactNode;
|
|
1647
|
+
}
|
|
1648
|
+
/** A region that opens and closes from a trigger button (Radix Collapsible). */
|
|
1649
|
+
declare function Collapsible({ open: openProp, defaultOpen, onOpenChange, disabled, label, trigger, chevron, className, triggerClassName, contentClassName, children, }: CollapsibleProps): React$1.JSX.Element;
|
|
1650
|
+
|
|
955
1651
|
interface LiveRegionProps {
|
|
956
1652
|
/** Text to announce to screen readers */
|
|
957
1653
|
message?: string;
|
|
@@ -1481,4 +2177,4 @@ interface SetTextOptions {
|
|
|
1481
2177
|
*/
|
|
1482
2178
|
declare function setTextUndoable(el: TextField, text: string, options?: SetTextOptions): boolean;
|
|
1483
2179
|
|
|
1484
|
-
export { type ArrowNavigationOrientation, Avatar, AvatarFallback, AvatarImage, type AvatarImageProps, type AvatarProps, Badge, type BadgeProps, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, type CardProps, CardTitle, type CardTitleProps, DataPanel, DataPanelContent, type DataPanelContentProps, DataPanelFooter, type DataPanelFooterProps, DataPanelHeader, type DataPanelHeaderProps, type DataPanelProps, DataPanelTab, type DataPanelTabProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, type DialogSize, DialogTitle, DialogTrigger, Input, type InputProps, InsertPalette, type InsertPaletteGroup, type InsertPaletteItem, type InsertPaletteProps, IssuesButton, type IssuesButtonProps, Label, LiveRegion, type LiveRegionProps, LoadingLogo, type LoadingLogoProps, LoadingOverlay, type LoadingOverlayProps, LoadingPage, type LoadingPageProps, LoadingSection, type LoadingSectionProps, PageHeader, type PageHeaderProps, PasswordInput, type PasswordInputProps, ProgressBar, type ProgressBarProps, type SaveState, SaveStatus, type SaveStatusProps, Separator, type SeparatorProps, type SetTextOptions, Sheet, type SheetProps, Skeleton, type SkeletonProps, SkipLink, type SkipLinkProps, type SortableHandleProps, type SortableItemContext, SortableList, type SortableListProps, Spinner, type SpinnerProps, Studio, StudioBar, type StudioBarProps, StudioCanvas, StudioCanvasItem, type StudioCanvasItemProps, type StudioCanvasProps, type StudioContextValue, StudioInspector, type StudioInspectorProps, StudioInspectorSection, type StudioInspectorSectionProps, type StudioInspectorTab, type StudioIssue, type StudioLayout, type StudioMenuItem, type StudioMode, StudioOutline, type StudioOutlineEntry, type StudioOutlineProps, StudioPage, type StudioPageProps, type StudioProps, Switch, type SwitchProps, type TextField, type UseAnnounceOptions, type UseAnnounceReturn, type UseArrowNavigationOptions, type UseClickOutsideOptions, type UseDataPanelOptions, type UseEscapeKeyOptions, type UseFocusRefOptions, type UseFocusTrapOptions, type UseRovingTabindexOptions, badgeVariants, buttonVariants, cn, labelVariants, pageHeaderActionsVariants, pageHeaderContainerVariants, pageHeaderSubtitleVariants, pageHeaderTitleVariants, progressBarVariants, setTextUndoable, skeletonVariants, spinnerVariants, useAnnounce, useArrowNavigation, useClickOutside, useDataPanel, useEscapeKey, useFocusRef, useFocusTrap, useReducedMotion, useRovingTabindex, useStudio };
|
|
2180
|
+
export { Alert, AlertDescription, type AlertProps, AlertTitle, type ArrowNavigationOrientation, Avatar, AvatarFallback, AvatarImage, type AvatarImageProps, type AvatarProps, Badge, type BadgeProps, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, type CardHeaderProps, type CardProps, CardTitle, type CardTitleProps, Checkbox, type CheckboxProps, Collapsible, type CollapsibleProps, DataPanel, DataPanelContent, type DataPanelContentProps, DataPanelFooter, type DataPanelFooterProps, DataPanelHeader, type DataPanelHeaderProps, type DataPanelProps, DataPanelTab, type DataPanelTabProps, Dialog, DialogBody, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, DialogHeader, type DialogHeaderProps, DialogOverlay, DialogPortal, DialogRoot, type DialogSize, DialogTitle, DialogTrigger, DropdownMenu, type DropdownMenuGroup, type DropdownMenuItem, type DropdownMenuProps, EmptyState, type EmptyStateProps, Icon, type IconProps, Input, type InputProps, InsertPalette, type InsertPaletteGroup, type InsertPaletteItem, type InsertPaletteProps, IssuesButton, type IssuesButtonProps, Kbd, type KbdProps, Label, type LabelProps, LiveRegion, type LiveRegionProps, LoadingLogo, type LoadingLogoProps, LoadingOverlay, type LoadingOverlayProps, LoadingPage, type LoadingPageProps, LoadingSection, type LoadingSectionProps, NumberInput, type NumberInputProps, PageHeader, type PageHeaderProps, PasswordInput, type PasswordInputProps, Popover, type PopoverProps, ProgressBar, type ProgressBarProps, RadioGroup, type RadioGroupProps, type RadioOption, type SaveState, SaveStatus, type SaveStatusProps, Section, type SectionProps, SegmentedControl, type SegmentedControlOption, type SegmentedControlProps, Select, type SelectGroup, type SelectOption, type SelectProps, Separator, type SeparatorProps, type SetTextOptions, Sheet, type SheetProps, SimpleDialog, type SimpleDialogProps, Skeleton, type SkeletonProps, SkipLink, type SkipLinkProps, Slider, type SliderProps, type SortableHandleProps, type SortableItemContext, SortableList, type SortableListProps, Spinner, type SpinnerProps, Studio, StudioBar, type StudioBarProps, StudioCanvas, StudioCanvasItem, type StudioCanvasItemProps, type StudioCanvasProps, type StudioContextValue, StudioInspector, type StudioInspectorProps, StudioInspectorSection, type StudioInspectorSectionProps, type StudioInspectorTab, type StudioIssue, type StudioLayout, type StudioMenuItem, type StudioMode, StudioOutline, type StudioOutlineEntry, type StudioOutlineProps, StudioPage, type StudioPageProps, type StudioProps, Switch, type SwitchProps, type Tab, type TabIndicator, TabPanel, type TabPanelProps, Table, TableBody, TableCaption, TableCell, type TableCellProps, TableContainer, type TableContainerProps, TableHead, type TableHeadProps, TableHeader, TableRow, type TableRowProps, Tabs, type TabsProps, type TextField, Textarea, type TextareaProps, Tooltip, type TooltipProps, type UseAnnounceOptions, type UseAnnounceReturn, type UseArrowNavigationOptions, type UseClickOutsideOptions, type UseDataPanelOptions, type UseEscapeKeyOptions, type UseFocusRefOptions, type UseFocusTrapOptions, type UseRovingTabindexOptions, alertVariants, avatarVariants, badgeVariants, buttonVariants, cardHeaderVariants, cardVariants, checkboxVariants, cn, formatKey, isApplePlatform, kbdVariants, labelVariants, pageHeaderActionsVariants, pageHeaderContainerVariants, pageHeaderSubtitleVariants, pageHeaderTitleVariants, progressBarVariants, progressFillVariants, triggerVariants as selectTriggerVariants, separatorVariants, setTextUndoable, skeletonVariants, spinnerVariants, tableCellVariants, tableHeadVariants, tableRowVariants, textareaVariants, useAnnounce, useArrowNavigation, useClickOutside, useDataPanel, useEscapeKey, useFocusRef, useFocusTrap, useReducedMotion, useRovingTabindex, useStudio };
|