@enablo/swirlcn-ui 0.0.0-stage → 0.5.1

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.
Files changed (103) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +30 -2
  3. package/dist/chunk-3DJWDNQL.js +77 -0
  4. package/dist/chunk-7XUCETA6.js +447 -0
  5. package/dist/chunk-KZESIYUN.js +18 -0
  6. package/dist/flip.d.ts +98 -0
  7. package/dist/flip.js +158 -0
  8. package/dist/fonts/Inter-italic.var.woff2 +0 -0
  9. package/dist/fonts/Inter.var.woff2 +0 -0
  10. package/dist/fonts/OFL.txt +96 -0
  11. package/dist/index.d.ts +2459 -0
  12. package/dist/index.js +8439 -0
  13. package/dist/server.d.ts +144 -0
  14. package/dist/server.js +88 -0
  15. package/dist/spacing-BQaEPbUv.d.ts +59 -0
  16. package/dist/theme.css +146 -0
  17. package/package.json +84 -3
  18. package/src/components/accordion.tsx +102 -0
  19. package/src/components/action-list.tsx +294 -0
  20. package/src/components/alert-dialog.tsx +155 -0
  21. package/src/components/autocomplete.tsx +313 -0
  22. package/src/components/avatar.tsx +258 -0
  23. package/src/components/badge.tsx +100 -0
  24. package/src/components/banner.tsx +112 -0
  25. package/src/components/button-group.tsx +87 -0
  26. package/src/components/button.tsx +362 -0
  27. package/src/components/card.tsx +186 -0
  28. package/src/components/carousel.tsx +245 -0
  29. package/src/components/checkbox.tsx +125 -0
  30. package/src/components/chip.tsx +153 -0
  31. package/src/components/color-input.tsx +98 -0
  32. package/src/components/data-cell.tsx +230 -0
  33. package/src/components/date-input.tsx +223 -0
  34. package/src/components/date-picker.tsx +276 -0
  35. package/src/components/description-list.tsx +97 -0
  36. package/src/components/dialog.tsx +405 -0
  37. package/src/components/empty-state.tsx +63 -0
  38. package/src/components/file-chip.tsx +206 -0
  39. package/src/components/file-uploader.tsx +148 -0
  40. package/src/components/flip-app-header.tsx +104 -0
  41. package/src/components/flip-brand.tsx +77 -0
  42. package/src/components/flip-theme.tsx +95 -0
  43. package/src/components/form-control.tsx +397 -0
  44. package/src/components/form-group.tsx +26 -0
  45. package/src/components/heading.tsx +70 -0
  46. package/src/components/icon.tsx +119 -0
  47. package/src/components/image-grid.tsx +285 -0
  48. package/src/components/inline-notification.tsx +167 -0
  49. package/src/components/inline-status.tsx +100 -0
  50. package/src/components/input.tsx +390 -0
  51. package/src/components/label.tsx +28 -0
  52. package/src/components/lightbox.tsx +314 -0
  53. package/src/components/link.tsx +46 -0
  54. package/src/components/list.tsx +40 -0
  55. package/src/components/menu.tsx +530 -0
  56. package/src/components/option-list.tsx +582 -0
  57. package/src/components/pagination.tsx +336 -0
  58. package/src/components/popover.tsx +194 -0
  59. package/src/components/progress.tsx +158 -0
  60. package/src/components/radio-group.tsx +136 -0
  61. package/src/components/resource-list.tsx +686 -0
  62. package/src/components/search.tsx +127 -0
  63. package/src/components/select.tsx +456 -0
  64. package/src/components/separator.tsx +93 -0
  65. package/src/components/skeleton-box.tsx +63 -0
  66. package/src/components/skeleton-text.tsx +66 -0
  67. package/src/components/spinner.tsx +83 -0
  68. package/src/components/stack.tsx +86 -0
  69. package/src/components/status-indicator.tsx +31 -0
  70. package/src/components/switch.tsx +90 -0
  71. package/src/components/table.tsx +242 -0
  72. package/src/components/tabs.tsx +147 -0
  73. package/src/components/tag.tsx +169 -0
  74. package/src/components/text.tsx +126 -0
  75. package/src/components/textarea.tsx +130 -0
  76. package/src/components/theme-provider.tsx +115 -0
  77. package/src/components/thumbnail.tsx +250 -0
  78. package/src/components/time-input.tsx +123 -0
  79. package/src/components/toast.tsx +217 -0
  80. package/src/components/toggle-group.tsx +124 -0
  81. package/src/components/toolbar.tsx +105 -0
  82. package/src/components/tooltip.tsx +97 -0
  83. package/src/components/tree-navigation.tsx +194 -0
  84. package/src/components/tree-view.tsx +292 -0
  85. package/src/flip.ts +12 -0
  86. package/src/index.ts +317 -0
  87. package/src/lib/date-mask.ts +176 -0
  88. package/src/lib/field-context.ts +86 -0
  89. package/src/lib/flip-app-script.ts +38 -0
  90. package/src/lib/flip-host.ts +84 -0
  91. package/src/lib/flip-theme-css.ts +90 -0
  92. package/src/lib/focus.ts +18 -0
  93. package/src/lib/glyphs.ts +137 -0
  94. package/src/lib/spacing.ts +93 -0
  95. package/src/lib/theme-context.ts +27 -0
  96. package/src/lib/theme-script.ts +49 -0
  97. package/src/lib/use-mobile.ts +17 -0
  98. package/src/lib/utils.ts +28 -0
  99. package/src/server.ts +20 -0
  100. package/src/styles/fonts/Inter-italic.var.woff2 +0 -0
  101. package/src/styles/fonts/Inter.var.woff2 +0 -0
  102. package/src/styles/fonts/OFL.txt +96 -0
  103. package/src/styles/theme.css +146 -0
@@ -0,0 +1,2459 @@
1
+ import { S as SwirlSpacing } from './spacing-BQaEPbUv.js';
2
+ export { c as cn, f as focusRing, a as focusRingInset, g as gap, b as gapX, d as gapY, p as padding, r as resolveAlias, s as spacingScale } from './spacing-BQaEPbUv.js';
3
+ import * as React$1 from 'react';
4
+ import * as class_variance_authority_types from 'class-variance-authority/types';
5
+ import { VariantProps } from 'class-variance-authority';
6
+ import { Progress as Progress$1, Label as Label$1, Checkbox as Checkbox$1, RadioGroup as RadioGroup$1, Switch as Switch$1, ToggleGroup as ToggleGroup$1, Dialog as Dialog$1, Popover as Popover$1, Tooltip as Tooltip$1, AlertDialog as AlertDialog$1, Tabs as Tabs$1, Accordion as Accordion$1 } from 'radix-ui';
7
+ import 'clsx';
8
+
9
+ /**
10
+ * Swirl models a button as `variant` (how it is drawn) x `intent` (what it
11
+ * means) x `size`, rather than shadcn's single flattened `variant`. Both APIs
12
+ * are accepted: see `shadcnVariants` below.
13
+ */
14
+ type ButtonVariant = "ghost" | "flat" | "outline" | "plain" | "floating" | "on-image" | "translucent";
15
+ type ButtonIntent = "default" | "primary" | "critical" | "strong";
16
+ type ButtonSize = "s" | "m" | "l";
17
+ /** shadcn's `variant` values, mapped onto Swirl's variant + intent pair. */
18
+ declare const shadcnVariants: {
19
+ readonly default: {
20
+ readonly variant: "flat";
21
+ readonly intent: "primary";
22
+ };
23
+ readonly destructive: {
24
+ readonly variant: "flat";
25
+ readonly intent: "critical";
26
+ };
27
+ readonly secondary: {
28
+ readonly variant: "flat";
29
+ readonly intent: "default";
30
+ };
31
+ readonly link: {
32
+ readonly variant: "plain";
33
+ readonly intent: "primary";
34
+ };
35
+ readonly ghost: {
36
+ readonly variant: "ghost";
37
+ readonly intent: "default";
38
+ };
39
+ readonly outline: {
40
+ readonly variant: "outline";
41
+ readonly intent: "default";
42
+ };
43
+ };
44
+ type ShadcnButtonVariant = keyof typeof shadcnVariants;
45
+ /** shadcn's `size` values, mapped onto Swirl's scale. */
46
+ declare const shadcnSizes$1: {
47
+ readonly sm: "s";
48
+ readonly default: "m";
49
+ readonly lg: "l";
50
+ readonly icon: "m";
51
+ };
52
+ type ShadcnButtonSize = keyof typeof shadcnSizes$1;
53
+ declare const buttonVariants: (props?: ({
54
+ variant?: "flat" | "ghost" | "outline" | "plain" | "floating" | "on-image" | "translucent" | null | undefined;
55
+ intent?: "strong" | "default" | "primary" | "critical" | null | undefined;
56
+ size?: "s" | "m" | "l" | null | undefined;
57
+ iconOnly?: boolean | null | undefined;
58
+ pill?: boolean | null | undefined;
59
+ pressed?: boolean | null | undefined;
60
+ elevated?: boolean | null | undefined;
61
+ block?: boolean | null | undefined;
62
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
63
+ type ButtonVariantProps = Omit<VariantProps<typeof buttonVariants>, "variant" | "intent" | "size" | "iconOnly">;
64
+ interface ButtonProps extends Omit<React.ComponentProps<"button">, "children">, ButtonVariantProps {
65
+ /**
66
+ * How the button is drawn. Accepts Swirl's variants (`ghost`, `flat`,
67
+ * `outline`, `plain`, `floating`, `on-image`, `translucent`) and shadcn's
68
+ * (`default`, `destructive`, `secondary`, `link`, `ghost`, `outline`).
69
+ */
70
+ variant?: ButtonVariant | ShadcnButtonVariant;
71
+ /** What the button means. Overrides any intent implied by a shadcn `variant`. */
72
+ intent?: ButtonIntent;
73
+ /** Swirl's `s`/`m`/`l`, or shadcn's `sm`/`default`/`lg`/`icon`. */
74
+ size?: ButtonSize | ShadcnButtonSize;
75
+ /** The button's text. Also used as the accessible name when `hideLabel` is set. */
76
+ label?: string;
77
+ /** Render icon-only while keeping `label` as the accessible name. */
78
+ hideLabel?: boolean;
79
+ /** Icon element, rendered at `iconPosition`. */
80
+ icon?: React.ReactNode;
81
+ iconPosition?: "start" | "end";
82
+ /** Swap the icon for a spinner and block interaction. */
83
+ loading?: boolean;
84
+ /** Render as an `<a>` instead of a `<button>`. */
85
+ href?: string;
86
+ target?: string;
87
+ download?: string;
88
+ /** Stretch to the width of the container. */
89
+ block?: boolean;
90
+ /** Merge props onto the single child instead of rendering an element. */
91
+ asChild?: boolean;
92
+ children?: React.ReactNode;
93
+ }
94
+ /**
95
+ * Swirl's button.
96
+ *
97
+ * `label` and `children` are interchangeable - `label` matches the Swirl API,
98
+ * `children` matches shadcn. Pass `hideLabel` for an icon button and the label
99
+ * becomes the accessible name.
100
+ */
101
+ declare function Button({ className, variant, intent, size, label, hideLabel, icon, iconPosition, loading, pill, pressed, elevated, block, href, target, download, asChild, disabled, children, type, ...props }: ButtonProps): React$1.JSX.Element;
102
+
103
+ interface ButtonGroupProps extends React.ComponentProps<"div"> {
104
+ orientation?: "horizontal" | "vertical";
105
+ /** Join the buttons into one control, with a divider between each. */
106
+ segmented?: boolean;
107
+ /** Gap between buttons, in Swirl's px steps. Ignored when `segmented`. */
108
+ spacing?: SwirlSpacing;
109
+ /** Make the buttons share the full width (horizontal) or fill it (vertical). */
110
+ stretch?: boolean;
111
+ /** Let a horizontal group wrap onto further lines. */
112
+ wrap?: boolean;
113
+ }
114
+ /**
115
+ * Swirl's button group: lays out related `Button`s, optionally joined into one
116
+ * segmented control.
117
+ *
118
+ * Unlike shadcn's `ButtonGroup`, which is always joined, this follows Swirl
119
+ * and spaces the buttons apart unless `segmented` is set. For buttons that
120
+ * hold a selected state, use `ToggleGroup` instead.
121
+ */
122
+ declare function ButtonGroup({ className, orientation, segmented, spacing, stretch, wrap, ...props }: ButtonGroupProps): React$1.JSX.Element;
123
+
124
+ interface LinkProps extends Omit<React.ComponentProps<"a">, "color"> {
125
+ /** The link text. Interchangeable with `children`. */
126
+ label?: React.ReactNode;
127
+ /** `subdued` is a grey, medium-weight link with no underline. */
128
+ color?: "default" | "subdued";
129
+ /** Merge the styling onto the single child, such as a router's own link. */
130
+ asChild?: boolean;
131
+ }
132
+ /**
133
+ * Swirl's link: underlined, in the primary interactive colour.
134
+ *
135
+ * Pass `asChild` to style a framework link instead of rendering an `<a>`:
136
+ *
137
+ * <Link asChild><NextLink href="/settings">Settings</NextLink></Link>
138
+ */
139
+ declare function Link({ className, label, children, color, asChild, ...props }: LinkProps): React$1.JSX.Element;
140
+
141
+ declare const textVariants: (props?: ({
142
+ size?: "base" | "xs" | "sm" | "lg" | "xl" | "2xl" | null | undefined;
143
+ color?: "on-image" | "default" | "critical" | "disabled" | "subdued" | "success" | "warning" | "highlight" | "on-action-primary" | "on-status" | "on-surface-highlight" | "on-surface-highlight-subdued" | null | undefined;
144
+ weight?: "bold" | "normal" | "medium" | "semibold" | null | undefined;
145
+ align?: "center" | "start" | "end" | null | undefined;
146
+ fontFamily?: "code" | "text" | null | undefined;
147
+ fontStyle?: "normal" | "italic" | null | undefined;
148
+ balance?: boolean | null | undefined;
149
+ responsive?: boolean | null | undefined;
150
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
151
+ type TextSize = NonNullable<VariantProps<typeof textVariants>["size"]>;
152
+ type TextColor = NonNullable<VariantProps<typeof textVariants>["color"]>;
153
+ type TextWeight = NonNullable<VariantProps<typeof textVariants>["weight"]>;
154
+ interface TextProps extends Omit<React.ComponentProps<"span">, "color">, VariantProps<typeof textVariants> {
155
+ /** Element to render. Defaults to `span`. */
156
+ as?: React.ElementType;
157
+ /** Truncate to a single line with an ellipsis. */
158
+ truncate?: boolean;
159
+ /**
160
+ * Which end `truncate` cuts. `start` keeps the end visible, for file paths
161
+ * and the like. Like Swirl it reverses the line's direction, but it keeps
162
+ * the text itself left-to-right, so a leading "/" stays at the front.
163
+ */
164
+ truncateDirection?: "start" | "end";
165
+ /** Clamp to N lines. Takes precedence over `truncate`. */
166
+ lines?: number;
167
+ whiteSpace?: React.CSSProperties["whiteSpace"];
168
+ }
169
+ /** Swirl's text primitive: the type scale and semantic text colours as props. */
170
+ declare function Text({ as: Component, className, size, color, weight, align, fontFamily, fontStyle, balance, responsive, truncate, truncateDirection, lines, whiteSpace, style, children, ...props }: TextProps): React$1.JSX.Element;
171
+
172
+ interface ListProps extends React.ComponentProps<"div"> {
173
+ }
174
+ /**
175
+ * Swirl's list: styles the `<ul>` and `<ol>` you put inside it, including
176
+ * nested ones. Use it for running text such as instructions or terms, not for
177
+ * interactive rows.
178
+ *
179
+ * <List>
180
+ * <ul>
181
+ * <li>First</li>
182
+ * <li>Second</li>
183
+ * </ul>
184
+ * </List>
185
+ */
186
+ declare function List({ className, ...props }: ListProps): React$1.JSX.Element;
187
+
188
+ type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
189
+ interface HeadingProps extends React.ComponentProps<"h2"> {
190
+ /** Visual size *and* default element (`level={2}` renders `<h2>`). */
191
+ level?: HeadingLevel;
192
+ /** Override the element without changing the visual size. */
193
+ as?: React.ElementType;
194
+ /** Heading text. Interchangeable with `children`. */
195
+ text?: string;
196
+ align?: "start" | "center" | "end";
197
+ /** Even out the line lengths when the heading wraps. On by default, as in Swirl. */
198
+ balance?: boolean;
199
+ truncate?: boolean;
200
+ lines?: number;
201
+ }
202
+ declare function Heading({ level, as, text, align, balance, truncate, lines, className, children, style, ...props }: HeadingProps): React$1.JSX.Element;
203
+
204
+ declare const sizes$2: {
205
+ readonly 16: "size-4";
206
+ readonly 20: "size-5";
207
+ readonly 24: "size-6";
208
+ readonly 28: "size-7";
209
+ readonly 32: "size-8";
210
+ };
211
+ declare const colors$1: {
212
+ readonly default: "text-icon-default";
213
+ readonly strong: "text-icon-strong";
214
+ readonly subdued: "text-subdued";
215
+ readonly disabled: "text-disabled";
216
+ readonly highlight: "text-highlight";
217
+ readonly critical: "text-critical";
218
+ readonly success: "text-success";
219
+ readonly warning: "text-warning";
220
+ readonly info: "text-info";
221
+ readonly "on-action-primary": "text-on-primary";
222
+ readonly "on-image": "text-on-image";
223
+ readonly "on-status": "text-on-status";
224
+ readonly "on-surface-highlight": "text-on-highlight";
225
+ readonly "on-surface-highlight-subdued": "text-on-highlight-subdued";
226
+ readonly inherit: "";
227
+ };
228
+ declare const wrapperColors: {
229
+ readonly neutral: "bg-surface-raised text-icon-default";
230
+ readonly default: "bg-background text-icon-default";
231
+ readonly banana: "bg-banana-subdued text-banana-text";
232
+ readonly blueberry: "bg-blueberry-subdued text-blueberry-text";
233
+ readonly chilli: "bg-chilli-subdued text-chilli-text";
234
+ readonly grape: "bg-grape-subdued text-grape-text";
235
+ readonly kiwi: "bg-kiwi-subdued text-kiwi-text";
236
+ readonly pumpkin: "bg-pumpkin-subdued text-pumpkin-text";
237
+ readonly radish: "bg-radish-subdued text-radish-text";
238
+ };
239
+ declare const wrapperSizes: {
240
+ readonly xs: "size-4";
241
+ readonly s: "size-5";
242
+ readonly m: "size-6";
243
+ readonly l: "size-7";
244
+ readonly xl: "size-8";
245
+ readonly "2xl": "size-10";
246
+ };
247
+ interface IconProps extends Omit<React.ComponentProps<"span">, "color"> {
248
+ /** Box size in px. */
249
+ size?: keyof typeof sizes$2;
250
+ /**
251
+ * Semantic icon colour. `inherit` takes the parent's colour. Defaults to
252
+ * `default`, or to the wrapper's own icon colour when `wrapperColor` is set.
253
+ */
254
+ color?: keyof typeof colors$1;
255
+ /** Sit the icon on a round background in this colour, as Swirl's icon wrapper. */
256
+ wrapperColor?: keyof typeof wrapperColors;
257
+ /** Diameter of the wrapper: 16 / 20 / 24 / 28 / 32 / 40px. */
258
+ wrapperSize?: keyof typeof wrapperSizes;
259
+ /** Accessible name. Omit for a decorative icon beside visible text. */
260
+ label?: string;
261
+ children: React.ReactNode;
262
+ }
263
+ /**
264
+ * Sizes and colours any SVG icon with Swirl's icon tokens.
265
+ *
266
+ * Works with `@enablo/swirlcn-icons`, lucide-react, or a hand-written SVG - the child
267
+ * is scaled to the box rather than being expected to size itself.
268
+ */
269
+ declare function Icon({ className, size, color, wrapperColor, wrapperSize, label, children, ...props }: IconProps): React$1.JSX.Element;
270
+
271
+ declare const sizes$1: {
272
+ readonly xs: {
273
+ readonly box: "size-5";
274
+ readonly stroke: 3;
275
+ };
276
+ readonly s: {
277
+ readonly box: "size-6";
278
+ readonly stroke: 3;
279
+ };
280
+ readonly m: {
281
+ readonly box: "size-9";
282
+ readonly stroke: 4;
283
+ };
284
+ readonly 20: {
285
+ readonly box: "size-5";
286
+ readonly stroke: 3;
287
+ };
288
+ readonly 24: {
289
+ readonly box: "size-6";
290
+ readonly stroke: 3;
291
+ };
292
+ readonly 36: {
293
+ readonly box: "size-9";
294
+ readonly stroke: 4;
295
+ };
296
+ };
297
+ interface SpinnerProps extends React.ComponentProps<"div"> {
298
+ /** 20, 24 or 36px wide (`xs`, `s`, `m`). Defaults to `m`, as in Swirl. */
299
+ size?: keyof typeof sizes$1;
300
+ /** Announced to screen readers while busy. Pass `null` to stay silent. */
301
+ label?: string | null;
302
+ /**
303
+ * Draw the arc in the current text colour instead of Swirl's primary blue,
304
+ * for use on coloured surfaces such as a primary button.
305
+ */
306
+ inheritColor?: boolean;
307
+ }
308
+ /**
309
+ * Swirl's spinner: an arc that grows and shrinks as it turns, over a faint
310
+ * track.
311
+ *
312
+ * Renders as a `status` live region so assistive tech announces the wait, which
313
+ * is why `label` defaults to real text rather than being decorative.
314
+ */
315
+ declare function Spinner({ className, size, label, inheritColor, ...props }: SpinnerProps): React$1.JSX.Element;
316
+
317
+ type SkeletonTextSize = "sm" | "base" | "lg" | "xl" | "2xl";
318
+ interface SkeletonTextProps extends React.ComponentProps<"div"> {
319
+ /** How many lines to draw. The last of several is a quarter wide, as in Swirl. */
320
+ lines?: number;
321
+ /** The text size the lines stand in for. */
322
+ size?: SkeletonTextSize;
323
+ /** Sweep a shimmer across the lines. Defaults to true. */
324
+ animated?: boolean;
325
+ }
326
+ /**
327
+ * Swirl's skeleton text: placeholder lines for text that is still loading.
328
+ *
329
+ * Hidden from assistive tech; announce the wait once on the container (a
330
+ * `Spinner`, or `aria-busy`) rather than once per placeholder.
331
+ */
332
+ declare function SkeletonText({ className, lines, size, animated, ...props }: SkeletonTextProps): React$1.JSX.Element;
333
+
334
+ declare const radii$1: {
335
+ readonly none: "rounded-none";
336
+ readonly s: "rounded-(--radius-s)";
337
+ readonly sm: "rounded-sm";
338
+ readonly base: "rounded-base";
339
+ readonly pill: "rounded-full";
340
+ };
341
+ interface SkeletonBoxProps extends React.ComponentProps<"div"> {
342
+ /** CSS width, such as `"50%"` or `"12rem"`. Full width when neither this nor `aspectRatio` is set. */
343
+ width?: string;
344
+ /** CSS height. At least 0.875rem. */
345
+ height?: string;
346
+ /** CSS aspect ratio, such as `"1/0.5"`, to size the box from its width. */
347
+ aspectRatio?: string;
348
+ borderRadius?: keyof typeof radii$1;
349
+ /** Sweep a shimmer across the box. Defaults to true. */
350
+ animated?: boolean;
351
+ }
352
+ /**
353
+ * Swirl's skeleton box: a placeholder for an image, avatar, card or other
354
+ * block that is still loading. Use `borderRadius="pill"` with a square
355
+ * `aspectRatio` for a circle.
356
+ *
357
+ * Hidden from assistive tech; announce the wait once on the container (a
358
+ * `Spinner`, or `aria-busy`) rather than once per placeholder.
359
+ */
360
+ declare function SkeletonBox({ className, style, width, height, aspectRatio, borderRadius, animated, ...props }: SkeletonBoxProps): React$1.JSX.Element;
361
+
362
+ type SeparatorSpacing = "0" | "2" | "4" | "8" | "12" | "16" | "24" | "32";
363
+ declare const colors: {
364
+ readonly default: {
365
+ readonly line: "bg-[var(--s-border-on-translucent)]";
366
+ readonly label: "text-disabled";
367
+ };
368
+ readonly strong: {
369
+ readonly line: "bg-border-strong";
370
+ readonly label: "text-subdued";
371
+ };
372
+ readonly highlight: {
373
+ readonly line: "bg-border-highlight";
374
+ readonly label: "text-highlight";
375
+ };
376
+ readonly critical: {
377
+ readonly line: "bg-border-critical";
378
+ readonly label: "text-critical";
379
+ };
380
+ };
381
+ interface SeparatorProps extends React.ComponentProps<"div"> {
382
+ orientation?: "horizontal" | "vertical";
383
+ /** Space on both sides of the line, in Swirl's px steps. Defaults to 8. */
384
+ spacing?: SeparatorSpacing;
385
+ color?: keyof typeof colors;
386
+ /** Text in the middle of a horizontal line, such as "or". */
387
+ label?: React.ReactNode;
388
+ /**
389
+ * Hide the separator from screen readers. Defaults to false: as in Swirl,
390
+ * it is announced as a separator.
391
+ */
392
+ decorative?: boolean;
393
+ }
394
+ /**
395
+ * Swirl's separator: a hairline with space on both sides, optionally split
396
+ * by a label.
397
+ */
398
+ declare function Separator({ className, orientation, spacing, color, label, decorative, ...props }: SeparatorProps): React$1.JSX.Element;
399
+
400
+ type StackOrientation = "horizontal" | "horizontal-reverse" | "vertical" | "vertical-reverse";
401
+ declare const aligns: {
402
+ readonly start: "items-start";
403
+ readonly center: "items-center";
404
+ readonly end: "items-end";
405
+ readonly stretch: "items-stretch";
406
+ };
407
+ declare const justifies: {
408
+ readonly start: "justify-start";
409
+ readonly center: "justify-center";
410
+ readonly end: "justify-end";
411
+ readonly "space-between": "justify-between";
412
+ readonly "space-around": "justify-around";
413
+ readonly "space-evenly": "justify-evenly";
414
+ readonly stretch: "justify-stretch";
415
+ };
416
+ interface StackProps extends React.ComponentProps<"div"> {
417
+ as?: React.ElementType;
418
+ orientation?: StackOrientation;
419
+ align?: keyof typeof aligns;
420
+ justify?: keyof typeof justifies;
421
+ /** Swirl spacing step in px, e.g. `"16"`. Sets both axes. */
422
+ spacing?: SwirlSpacing;
423
+ columnSpacing?: SwirlSpacing;
424
+ rowSpacing?: SwirlSpacing;
425
+ wrap?: boolean;
426
+ /** CSS height, such as `"100%"`. */
427
+ height?: string;
428
+ }
429
+ /**
430
+ * Swirl's flex layout primitive, with spacing named in Swirl's px steps.
431
+ *
432
+ * As in Swirl, it is full width, children align to the start, and they may
433
+ * shrink but not grow or overflow; `justify="stretch"` lets them grow.
434
+ */
435
+ declare function Stack({ as: Component, className, style, orientation, align, justify, spacing, columnSpacing, rowSpacing, wrap, height, ...props }: StackProps): React$1.JSX.Element;
436
+
437
+ declare const cardVariants: (props?: ({
438
+ intent?: "default" | "highlight" | "default-subdued" | "info-subdued" | "success-subdued" | "warning-subdued" | "critical-subdued" | null | undefined;
439
+ borderRadius?: "base" | "xs" | "l" | "sm" | "xl" | null | undefined;
440
+ elevationLevel?: 3 | 1 | 2 | null | undefined;
441
+ borderless?: boolean | null | undefined;
442
+ interactive?: boolean | null | undefined;
443
+ highlighted?: boolean | null | undefined;
444
+ overflow?: "hidden" | "auto" | "visible" | null | undefined;
445
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
446
+ interface CardProps extends Omit<React.ComponentProps<"div">, "children">, Omit<VariantProps<typeof cardVariants>, "borderless" | "interactive"> {
447
+ as?: React.ElementType;
448
+ /** Uniform padding, in Swirl's px spacing steps. */
449
+ padding?: SwirlSpacing;
450
+ /** Drop the border. Swirl calls this `isBorderless`. */
451
+ borderless?: boolean;
452
+ /** Add a shadow. Pair with `elevationLevel` to choose which. */
453
+ elevated?: boolean;
454
+ /** Make the whole card a clickable control. */
455
+ interactive?: boolean;
456
+ /** Render as a link. Implies `interactive`. */
457
+ href?: string;
458
+ /** An image across the top, such as an `<img>`. The content then sits in a padded body under it. */
459
+ image?: React.ReactNode;
460
+ /** The image's aspect ratio, such as "16/9". */
461
+ imageAspectRatio?: string;
462
+ /** Controls in the top-right corner, shown while the card is hovered or has focus. */
463
+ floatingControls?: React.ReactNode;
464
+ /**
465
+ * Show the pressed background, to draw the eye to the card. Swirl's
466
+ * `flash()` shows it for five seconds; set this and clear it the same way.
467
+ */
468
+ flashing?: boolean;
469
+ children?: React.ReactNode;
470
+ }
471
+ /**
472
+ * A surface container.
473
+ *
474
+ * Composes like shadcn's card (`CardHeader`, `CardTitle`, ...) while keeping
475
+ * Swirl's `intent`, `padding`, `elevationLevel` and `borderRadius` props.
476
+ */
477
+ declare function Card({ as, className, intent, borderRadius, elevated, elevationLevel, padding, borderless, interactive, highlighted, overflow, href, image, imageAspectRatio, floatingControls, flashing, children, ...props }: CardProps): React$1.JSX.Element;
478
+ declare function CardHeader({ className, ...props }: React.ComponentProps<"div">): React$1.JSX.Element;
479
+ declare function CardTitle({ className, ...props }: React.ComponentProps<"h3">): React$1.JSX.Element;
480
+ declare function CardDescription({ className, ...props }: React.ComponentProps<"p">): React$1.JSX.Element;
481
+ declare function CardContent({ className, ...props }: React.ComponentProps<"div">): React$1.JSX.Element;
482
+ declare function CardFooter({ className, ...props }: React.ComponentProps<"div">): React$1.JSX.Element;
483
+
484
+ /**
485
+ * Swirl's badge intents: five status colours, `strong`/`neutral`, and the seven
486
+ * decorative fruit hues used for categorisation.
487
+ */
488
+ declare const badgeVariants: (props?: ({
489
+ intent?: "strong" | "critical" | "success" | "warning" | "info" | "neutral" | "banana" | "blueberry" | "chilli" | "grape" | "kiwi" | "pumpkin" | "radish" | null | undefined;
490
+ size?: "s" | "xs" | "m" | null | undefined;
491
+ variant?: "default" | "dot" | null | undefined;
492
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
493
+ /** shadcn's badge variants, mapped onto Swirl intents. */
494
+ declare const shadcnIntents$1: {
495
+ readonly default: "strong";
496
+ readonly secondary: "neutral";
497
+ readonly destructive: "critical";
498
+ readonly outline: "neutral";
499
+ };
500
+ type BadgeIntent = NonNullable<VariantProps<typeof badgeVariants>["intent"]>;
501
+ interface BadgeProps extends React.ComponentProps<"span">, Omit<VariantProps<typeof badgeVariants>, "intent"> {
502
+ /** Swirl intent, or one of shadcn's `default`/`secondary`/`destructive`/`outline`. */
503
+ intent?: BadgeIntent | keyof typeof shadcnIntents$1;
504
+ /** Badge text. Interchangeable with `children`. */
505
+ label?: string;
506
+ icon?: React.ReactNode;
507
+ }
508
+ /** A small count or status marker. Use `variant="dot"` for a bare indicator. */
509
+ declare function Badge({ className, intent, size, variant, label, icon, children, ...props }: BadgeProps): React$1.JSX.Element;
510
+
511
+ declare const tagVariants: (props?: ({
512
+ intent?: "translucent" | "default" | "critical" | "success" | "warning" | "info" | "special" | null | undefined;
513
+ variant?: "strong" | "outline" | "default" | null | undefined;
514
+ size?: "s" | "m" | null | undefined;
515
+ interactive?: boolean | null | undefined;
516
+ bordered?: boolean | null | undefined;
517
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
518
+ interface TagProps extends Omit<React.ComponentProps<"span">, "onClick">, VariantProps<typeof tagVariants> {
519
+ /** Tag text. Interchangeable with `children`. */
520
+ label?: string;
521
+ /** Render icon-only, keeping `label` as the accessible name. */
522
+ hideLabel?: boolean;
523
+ icon?: React.ReactNode;
524
+ iconPosition?: "start" | "end";
525
+ /** Show a remove button and call `onRemove` when it is pressed. */
526
+ removable?: boolean;
527
+ removalButtonLabel?: string;
528
+ onRemove?: (event: React.MouseEvent<HTMLButtonElement>) => void;
529
+ onClick?: (event: React.MouseEvent<HTMLElement>) => void;
530
+ }
531
+ /**
532
+ * A labelled descriptor, optionally removable.
533
+ *
534
+ * When `removable` is set the tag renders its own nested button, so an
535
+ * `interactive` tag stays a `<button>` only for its own activation - the remove
536
+ * control stops propagation rather than triggering both.
537
+ */
538
+ declare function Tag({ className, intent, variant, size, interactive, bordered, label, hideLabel, icon, iconPosition, removable, removalButtonLabel, onRemove, onClick, children, ...props }: TagProps): React$1.JSX.Element;
539
+
540
+ interface ChipProps extends Omit<React.HTMLAttributes<HTMLElement>, "children" | "onClick"> {
541
+ /** The chip's text. Interchangeable with `children`. */
542
+ label?: React.ReactNode;
543
+ children?: React.ReactNode;
544
+ /** Leading icon, 20px. Ignored when `avatar` is given, as in Swirl. */
545
+ icon?: React.ReactNode;
546
+ /** Leading avatar, in place of an icon. Pass a 24px (`2xs`) `Avatar`. */
547
+ avatar?: React.ReactNode;
548
+ /** Trailing icon, 20px. */
549
+ trailingIcon?: React.ReactNode;
550
+ /** Anything else after the label, such as a `Badge`. */
551
+ trailingContent?: React.ReactNode;
552
+ /** Border and text colour. `pressed` overrides it. */
553
+ intent?: "default" | "critical" | "highlight";
554
+ /** Colour the leading icon with the highlight colour. */
555
+ iconColor?: "default" | "highlight";
556
+ /** Render as a button and fire `onClick`. Implied by `pressed`. */
557
+ interactive?: boolean;
558
+ /**
559
+ * Make the chip a toggle button. `true` fills it with the primary colour.
560
+ * Leave undefined for a chip that is not a toggle.
561
+ */
562
+ pressed?: boolean;
563
+ disabled?: boolean;
564
+ onClick?: React.MouseEventHandler<HTMLElement>;
565
+ /** Show a remove button after the label, which fires `onRemove`. */
566
+ removable?: boolean;
567
+ onRemove?: () => void;
568
+ removeButtonLabel?: string;
569
+ }
570
+ /**
571
+ * Swirl's chip: a compact, rounded label for a filter, a selection or an
572
+ * attribute. Static by default; `interactive` makes it a button, `pressed` a
573
+ * toggle, and `removable` adds a remove button beside it.
574
+ */
575
+ declare function Chip({ className, label, children, icon, avatar, trailingIcon, trailingContent, intent, iconColor, interactive, pressed, disabled, onClick, removable, onRemove, removeButtonLabel, ...props }: ChipProps): React$1.JSX.Element;
576
+
577
+ declare const avatarVariants: (props?: ({
578
+ size?: "s" | "xs" | "m" | "l" | "xl" | "2xl" | "3xs" | "2xs" | null | undefined;
579
+ variant?: "round" | "square" | null | undefined;
580
+ color?: "neutral" | "banana" | "blueberry" | "chilli" | "grape" | "kiwi" | "pumpkin" | "radish" | null | undefined;
581
+ interactive?: boolean | null | undefined;
582
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
583
+ type AvatarColor = NonNullable<VariantProps<typeof avatarVariants>["color"]>;
584
+ type AvatarSize = NonNullable<VariantProps<typeof avatarVariants>["size"]>;
585
+ /**
586
+ * Picks a stable decorative colour from a name, so the same person always gets
587
+ * the same avatar colour without that colour having to be stored anywhere.
588
+ */
589
+ declare function avatarColorFor(seed: string): AvatarColor;
590
+ /** Derives up to two initials from a display name. */
591
+ declare function initialsFor(name: string): string;
592
+ interface AvatarProps extends Omit<React$1.ComponentProps<"span">, "color">, Omit<VariantProps<typeof avatarVariants>, "color"> {
593
+ /**
594
+ * Decorative hue. Defaults to `kiwi`, matching Swirl.
595
+ * `"auto"` derives a stable hue from `label`, so the same person always gets
596
+ * the same colour without it having to be stored anywhere.
597
+ */
598
+ color?: AvatarColor | "auto";
599
+ /**
600
+ * Accessible name for the person or entity. Required.
601
+ * Also the seed for `color="auto"`.
602
+ */
603
+ label: string;
604
+ src?: string;
605
+ /** Initials to show when there is no image. Derived from `label` if omitted. */
606
+ initials?: string;
607
+ /** Icon fallback, used in place of initials. */
608
+ icon?: React$1.ReactNode;
609
+ /** Status dot or small badge, positioned over the avatar. */
610
+ badge?: React$1.ReactNode;
611
+ badgePosition?: "top" | "bottom";
612
+ /** Show `label` as text beside the avatar. */
613
+ showLabel?: boolean;
614
+ loading?: "eager" | "lazy";
615
+ }
616
+ /**
617
+ * A person or entity marker.
618
+ *
619
+ * Falls back from image to initials to icon. `color` defaults to `kiwi` as it
620
+ * does in Swirl; pass `color="auto"` to derive a stable hue from `label`.
621
+ */
622
+ declare function Avatar({ className, size, variant, color, interactive, label, src, initials, icon, badge, badgePosition, showLabel, loading, ...props }: AvatarProps): React$1.JSX.Element;
623
+ interface AvatarGroupProps extends React$1.ComponentProps<"div"> {
624
+ /** Show at most N avatars, then a `+n` overflow marker. */
625
+ max?: number;
626
+ size?: AvatarSize;
627
+ }
628
+ /** Overlapping avatars with an optional overflow count. */
629
+ declare function AvatarGroup({ className, max, size, children, ...props }: AvatarGroupProps): React$1.JSX.Element;
630
+
631
+ type ProgressSize = "xs" | "s" | "m" | "l";
632
+ type ProgressIntent = "primary" | "critical" | "success" | "warning";
633
+ interface ProgressProps extends Omit<React.ComponentProps<typeof Progress$1.Root>, "value"> {
634
+ /** 0-100, or `null`/undefined for an indeterminate indicator. */
635
+ value?: number | null;
636
+ /** Swirl's `bar`, or a `circle` ring. */
637
+ variant?: "bar" | "circle";
638
+ /**
639
+ * Bars are 1, 2, 4 or 8px thick; circles 20, 24, 48 or 96px wide. `m` is
640
+ * Swirl's default.
641
+ */
642
+ size?: ProgressSize;
643
+ /** Colour of the filled part. Swirl has only `primary`. */
644
+ intent?: ProgressIntent;
645
+ /** Show the percentage beside a bar. */
646
+ showValue?: boolean;
647
+ label?: string;
648
+ }
649
+ /**
650
+ * Swirl's progress indicator: a thin bar, or a ring with `variant="circle"`.
651
+ *
652
+ * With no `value` it animates indefinitely and omits `aria-valuenow`, so
653
+ * assistive tech announces "busy" rather than a misleading 0%.
654
+ */
655
+ declare function Progress({ className, value, variant, size, intent, showValue, label, ...props }: ProgressProps): React$1.JSX.Element;
656
+
657
+ interface LabelProps extends React.ComponentProps<typeof Label$1.Root> {
658
+ /** Append Swirl's required marker. */
659
+ required?: boolean;
660
+ }
661
+ declare function Label({ className, required, children, ...props }: LabelProps): React$1.JSX.Element;
662
+
663
+ type FieldLabelPosition = "inside" | "outside";
664
+ type FieldFontSize = "default" | "base" | "sm";
665
+ interface FieldContextValue {
666
+ /** The control's id; the label points at it. */
667
+ id: string;
668
+ /** The description or error, whichever is shown. */
669
+ describedBy: string | undefined;
670
+ invalid: boolean;
671
+ disabled: boolean;
672
+ readOnly: boolean;
673
+ required: boolean;
674
+ labelPosition: FieldLabelPosition;
675
+ inline: boolean;
676
+ fontSize: FieldFontSize;
677
+ /**
678
+ * True while the label stands in for the placeholder: the field is empty
679
+ * and unfocused. The control hides its own placeholder meanwhile.
680
+ */
681
+ labelAsPlaceholder: boolean;
682
+ /** The control reports whether it holds a value, so the label can float. */
683
+ setFilled: (filled: boolean) => void;
684
+ /** The control reports whether it shows a placeholder of its own. */
685
+ setHasPlaceholder: (hasPlaceholder: boolean) => void;
686
+ /** The control reports that it shows a character counter. */
687
+ setHasCounter: (hasCounter: boolean) => void;
688
+ }
689
+ /** The surrounding FormControl's field, or `null` when the control stands alone. */
690
+ declare function useField(): FieldContextValue | null;
691
+
692
+ /** What a render-function child receives: the ids and state to spread onto a custom control. */
693
+ interface FormControlField {
694
+ id: string;
695
+ "aria-describedby": string | undefined;
696
+ "aria-invalid": boolean | undefined;
697
+ "aria-required": boolean | undefined;
698
+ disabled: boolean | undefined;
699
+ }
700
+ interface FormControlProps extends Omit<React$1.ComponentProps<"div">, "children" | "prefix"> {
701
+ /** The field's label. */
702
+ label?: React$1.ReactNode;
703
+ /** Helper text under the field. Hidden while an error is shown. */
704
+ description?: React$1.ReactNode;
705
+ /** The error, shown under the field. It marks the field invalid. */
706
+ errorMessage?: React$1.ReactNode;
707
+ /** @deprecated Use `errorMessage`. */
708
+ error?: React$1.ReactNode;
709
+ /** Mark the field invalid without a message. */
710
+ invalid?: boolean;
711
+ disabled?: boolean;
712
+ readOnly?: boolean;
713
+ /** Mark the field required: adds an asterisk and `aria-required`. */
714
+ required?: boolean;
715
+ /**
716
+ * `inside` (Swirl's default) floats the label inside the field box: it sits
717
+ * in the box like a placeholder and moves to the top on focus or once there
718
+ * is a value. `outside` puts the label above a compact box.
719
+ */
720
+ labelPosition?: FieldLabelPosition;
721
+ /** A compact box whose label disappears once there is a value. */
722
+ inline?: boolean;
723
+ /** Keep the label for screen readers only. */
724
+ hideLabel?: boolean;
725
+ /** Leading 20px icon inside the box. */
726
+ icon?: React$1.ReactNode;
727
+ /** Help text in a tooltip on an icon beside the label. Shown on desktop only, as in Swirl. */
728
+ tooltip?: React$1.ReactNode;
729
+ /** Quieter text after the label, shown with `labelPosition="outside"`. */
730
+ secondaryLabel?: React$1.ReactNode;
731
+ /** `base` keeps 16px text on desktop; `sm` uses 14px everywhere. */
732
+ fontSize?: FieldFontSize;
733
+ /** A joined box before the field, such as a country `<select>`. */
734
+ prefix?: React$1.ReactNode;
735
+ /** Content under the control, inside the box. */
736
+ bottom?: React$1.ReactNode;
737
+ /**
738
+ * The control: an `Input`, `Textarea` or other swirlcn field, which picks up
739
+ * the label, ids and state on its own. A render function receives them
740
+ * instead, for a custom control, and is laid out with the label above.
741
+ */
742
+ children: React$1.ReactNode | ((field: FormControlField) => React$1.ReactNode);
743
+ }
744
+ /**
745
+ * Swirl's form control: the field box, label, description and error around a
746
+ * control. By default the label floats inside the box. Errors use
747
+ * `InlineError` and are announced.
748
+ *
749
+ * <FormControl label="Email" description="We'll never share it.">
750
+ * <Input type="email" />
751
+ * </FormControl>
752
+ */
753
+ declare function FormControl(props: FormControlProps): React$1.JSX.Element;
754
+
755
+ interface FormGroupProps extends React.ComponentProps<"div"> {
756
+ /** `horizontal` puts the fields side by side from 768px up. */
757
+ orientation?: "vertical" | "horizontal";
758
+ }
759
+ /**
760
+ * Swirl's form group: spaces a set of fields, 16px apart on small screens and
761
+ * 24px from 768px up. Nest a horizontal group for fields that share a row,
762
+ * such as first and last name.
763
+ */
764
+ declare function FormGroup({ className, orientation, ...props }: FormGroupProps): React$1.JSX.Element;
765
+
766
+ declare const inputVariants: (props?: ({
767
+ size?: "s" | "m" | "l" | null | undefined;
768
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
769
+ /** shadcn's `size` spellings, mapped onto Swirl's scale. */
770
+ declare const shadcnSizes: {
771
+ readonly sm: "s";
772
+ readonly default: "m";
773
+ readonly lg: "l";
774
+ };
775
+ interface InputProps extends Omit<React$1.ComponentProps<"input">, "size" | "prefix">, Omit<VariantProps<typeof inputVariants>, "size"> {
776
+ /** Standalone size. Inside a `FormControl` the field sets the size. */
777
+ size?: "s" | "m" | "l" | keyof typeof shadcnSizes;
778
+ /** An element before the text, such as an icon. */
779
+ prefix?: React$1.ReactNode;
780
+ /** An element after the text. */
781
+ suffix?: React$1.ReactNode;
782
+ /** Quiet text before the value, such as a currency sign. */
783
+ prefixLabel?: string;
784
+ /** Quiet text after the value, such as a unit. It sits right after the text. */
785
+ suffixLabel?: string;
786
+ /** Show a button that clears the value. Not for password or number fields. */
787
+ clearable?: boolean;
788
+ clearButtonLabel?: string;
789
+ /** Called after the clear button empties the field. */
790
+ onClear?: () => void;
791
+ /** Accessible name of the show/hide button on a password field. */
792
+ passwordToggleLabel?: string;
793
+ /** Show "used / max" characters. Use with `maxLength`. */
794
+ showCharacterCounter?: boolean;
795
+ /** Only show the counter from 80% of `maxLength`. */
796
+ showCharacterCounterNearLimit?: boolean;
797
+ characterCounterLabel?: string;
798
+ /** Select the whole value on focus. */
799
+ autoSelect?: boolean;
800
+ /** Wrapper class, used when the input has a box around extras. */
801
+ wrapperClassName?: string;
802
+ }
803
+ /**
804
+ * Swirl's text input. Inside a `FormControl` it renders bare, and the field
805
+ * draws the box and label; on its own it has a box of its own.
806
+ *
807
+ * It covers Swirl's text-input extras: `clearable`, a show/hide toggle on
808
+ * password fields, a stepper on number fields, a character counter, and
809
+ * prefix and suffix labels.
810
+ */
811
+ declare function Input({ className, wrapperClassName, size, type, prefix, suffix, prefixLabel, suffixLabel, clearable, clearButtonLabel, onClear, passwordToggleLabel, showCharacterCounter, showCharacterCounterNearLimit, characterCounterLabel, autoSelect, value, defaultValue, onChange, onFocus, onKeyDown, placeholder, maxLength, disabled, readOnly, ref, id, ...props }: InputProps): React$1.JSX.Element;
812
+
813
+ interface TextareaProps extends React$1.ComponentProps<"textarea"> {
814
+ /** Grow with the content without limit, instead of stopping at 13.75rem. */
815
+ autoResize?: boolean;
816
+ /** Show "used / max" characters. Use with `maxLength`. */
817
+ showCharacterCounter?: boolean;
818
+ /** Only show the counter from 80% of `maxLength`. */
819
+ showCharacterCounterNearLimit?: boolean;
820
+ characterCounterLabel?: string;
821
+ }
822
+ /**
823
+ * A multi-line text field.
824
+ *
825
+ * Inside a `FormControl` it renders bare and grows with its text, as Swirl's
826
+ * does: at least `rows` lines, up to 13.75rem (unlimited with `autoResize`).
827
+ * On its own it has the Input's box and a resize handle. Growing uses
828
+ * `field-sizing: content`, so nothing is measured on each keystroke; browsers
829
+ * without it keep the fixed height and scroll.
830
+ */
831
+ declare function Textarea({ className, autoResize, rows, showCharacterCounter, showCharacterCounterNearLimit, characterCounterLabel, value, defaultValue, onChange, placeholder, maxLength, disabled, readOnly, id, style, ...props }: TextareaProps): React$1.JSX.Element;
832
+
833
+ interface CheckboxProps extends React.ComponentProps<typeof Checkbox$1.Root> {
834
+ /** Visible label rendered beside the box. */
835
+ label?: React.ReactNode;
836
+ /** Helper text below the label. */
837
+ description?: React.ReactNode;
838
+ /** `card` puts the checkbox and its text in a bordered, full-width box. */
839
+ variant?: "default" | "card";
840
+ /** `regular` sets the label in the normal weight instead of medium. */
841
+ labelWeight?: "medium" | "regular";
842
+ /** Draw the checkbox in the critical colour. */
843
+ invalid?: boolean;
844
+ }
845
+ /**
846
+ * A checkbox, drawn as Swirl draws it: a 2px outlined box that fills with the
847
+ * highlight colour when checked.
848
+ *
849
+ * Pass `checked="indeterminate"` for the mixed state. When `label` is given the
850
+ * whole row is wrapped in a `<label>`, so clicking the text toggles the box.
851
+ */
852
+ declare function Checkbox({ className, label, description, variant, labelWeight, invalid, id, ...props }: CheckboxProps): React$1.JSX.Element;
853
+
854
+ interface RadioGroupProps extends React.ComponentProps<typeof RadioGroup$1.Root> {
855
+ }
856
+ /** Swirl's radio group: its radios stacked 12px apart. */
857
+ declare function RadioGroup({ className, ...props }: RadioGroupProps): React$1.JSX.Element;
858
+ interface RadioProps extends React.ComponentProps<typeof RadioGroup$1.Item> {
859
+ label?: React.ReactNode;
860
+ description?: React.ReactNode;
861
+ /** Help text in a tooltip on an icon beside the label. */
862
+ tooltip?: React.ReactNode;
863
+ /** `card` puts the radio and its text in a bordered, full-width box. */
864
+ variant?: "default" | "card";
865
+ /** Draw the radio in the critical colour. */
866
+ invalid?: boolean;
867
+ }
868
+ /**
869
+ * A single radio, drawn as Swirl draws it: a 2px ring that fills with the
870
+ * highlight colour and a centre dot when checked. Must sit inside a
871
+ * `RadioGroup`. With a `label` the whole row is a `<label>`, so clicking the
872
+ * text chooses the radio.
873
+ */
874
+ declare function Radio({ className, label, description, tooltip, variant, invalid, id, ...props }: RadioProps): React$1.JSX.Element;
875
+
876
+ interface SwitchProps extends React.ComponentProps<typeof Switch$1.Root> {
877
+ label?: React.ReactNode;
878
+ description?: React.ReactNode;
879
+ /** Put the label before the switch instead of after it. */
880
+ labelPosition?: "start" | "end";
881
+ /** Keep the label for screen readers only. */
882
+ hideLabel?: boolean;
883
+ /** Keep the description for screen readers only. */
884
+ hideDescription?: boolean;
885
+ }
886
+ /**
887
+ * Swirl's switch: an immediate on/off toggle, 44x24px on touch screens and
888
+ * 30x18px with the desktop layout. Use a Checkbox when the change needs
889
+ * submitting.
890
+ */
891
+ declare function Switch({ className, label, description, labelPosition, hideLabel, hideDescription, id, ...props }: SwitchProps): React$1.JSX.Element;
892
+
893
+ interface SelectOptionProps {
894
+ value: string;
895
+ /** The option's text, shown in the list and as the selected value. */
896
+ label: string;
897
+ description?: React$1.ReactNode;
898
+ /** Leading icon, shown in single-select lists. */
899
+ icon?: React$1.ReactNode;
900
+ avatar?: React$1.ReactNode;
901
+ disabled?: boolean;
902
+ }
903
+ /** One option of a `Select`. Describes the option; the Select renders it. */
904
+ declare function SelectOption(_props: SelectOptionProps): React$1.ReactNode;
905
+ interface SelectSectionProps {
906
+ label: string;
907
+ children?: React$1.ReactNode;
908
+ }
909
+ /** A labelled group of `SelectOption`s. */
910
+ declare function SelectSection(_props: SelectSectionProps): React$1.ReactNode;
911
+ interface SelectBaseProps {
912
+ /** Accessible name of the list of options. Swirl requires one. */
913
+ label: string;
914
+ /** `SelectOption`s, optionally grouped in `SelectSection`s. */
915
+ children: React$1.ReactNode;
916
+ /** Text shown while nothing is selected. Inside a `FormControl` the label usually does this. */
917
+ placeholder?: string;
918
+ /** Whether choosing the selected option again clears it. Defaults to true, as in Swirl. */
919
+ allowDeselect?: boolean;
920
+ disabled?: boolean;
921
+ /** Add a search box above the options. */
922
+ withSearch?: boolean;
923
+ searchPlaceholder?: string;
924
+ searchInputLabel?: string;
925
+ /** Called with the search term as it changes. */
926
+ onSearchChange?: (term: string) => void;
927
+ /** Show a spinner in the search box, while you load matching options. */
928
+ searchLoading?: boolean;
929
+ /**
930
+ * Filter the options by label as the user searches. Defaults to true; set
931
+ * false when you filter the options yourself in `onSearchChange`, as Swirl does.
932
+ */
933
+ filter?: boolean;
934
+ emptyListLabel?: string;
935
+ /**
936
+ * A compact trigger that fits its value, for use outside a form, as in
937
+ * Swirl. Outside a `FormControl` the select is always standalone.
938
+ */
939
+ standalone?: boolean;
940
+ /** Submits the value with a form: one hidden input per selected value. */
941
+ name?: string;
942
+ className?: string;
943
+ id?: string;
944
+ }
945
+ interface SingleSelectProps extends SelectBaseProps {
946
+ multiSelect?: false;
947
+ value?: string;
948
+ defaultValue?: string;
949
+ onValueChange?: (value: string) => void;
950
+ }
951
+ interface MultiSelectProps extends SelectBaseProps {
952
+ /** Let several options be chosen; they show as tags. */
953
+ multiSelect: true;
954
+ value?: string[];
955
+ defaultValue?: string[];
956
+ onValueChange?: (value: string[]) => void;
957
+ }
958
+ type SelectProps = SingleSelectProps | MultiSelectProps;
959
+ /**
960
+ * Swirl's select: picks one option, or several with `multiSelect`, from a
961
+ * list that opens under the field (a bottom sheet on phones). Inside a
962
+ * `FormControl` it fills the field box; on its own it is a compact trigger.
963
+ *
964
+ * <FormControl label="Fruit">
965
+ * <Select label="Fruit" withSearch>
966
+ * <SelectOption value="apple" label="Apple" />
967
+ * <SelectOption value="pear" label="Pear" />
968
+ * </Select>
969
+ * </FormControl>
970
+ *
971
+ * Space, Enter or Arrow Down opens it. In the list, typing jumps to the next
972
+ * option starting with those letters.
973
+ */
974
+ declare function Select(props: SelectProps): React$1.JSX.Element;
975
+
976
+ interface AutocompleteSuggestion {
977
+ id: string;
978
+ label: string;
979
+ disabled?: boolean;
980
+ }
981
+ interface AutocompleteBaseProps extends Omit<React$1.ComponentProps<typeof Input>, "value" | "defaultValue" | "onChange" | "onValueChange" | "type" | "prefix" | "suffix"> {
982
+ /**
983
+ * Returns the suggestions for a term; "" when the field is focused while
984
+ * empty. Called 250ms after the user stops typing.
985
+ */
986
+ generateSuggestions: (term: string) => Promise<AutocompleteSuggestion[]>;
987
+ /** Accessible name of the list of suggestions. */
988
+ menuLabel?: string;
989
+ }
990
+ interface SingleAutocompleteProps extends AutocompleteBaseProps {
991
+ multiSelect?: false;
992
+ value?: AutocompleteSuggestion;
993
+ defaultValue?: AutocompleteSuggestion;
994
+ /** Called with the chosen suggestion, or `undefined` when the field is emptied. */
995
+ onValueChange?: (value: AutocompleteSuggestion | undefined) => void;
996
+ }
997
+ interface MultiAutocompleteProps extends AutocompleteBaseProps {
998
+ /** Let several suggestions be chosen; they show as tags above the input. */
999
+ multiSelect: true;
1000
+ value?: AutocompleteSuggestion[];
1001
+ defaultValue?: AutocompleteSuggestion[];
1002
+ onValueChange?: (value: AutocompleteSuggestion[]) => void;
1003
+ }
1004
+ type AutocompleteProps = SingleAutocompleteProps | MultiAutocompleteProps;
1005
+ /**
1006
+ * Swirl's autocomplete: a text field that suggests values as you type. Put it
1007
+ * in a `FormControl`, and return the suggestions for a term from
1008
+ * `generateSuggestions`.
1009
+ *
1010
+ * <FormControl label="Assignee">
1011
+ * <Autocomplete generateSuggestions={async (term) => search(term)} />
1012
+ * </FormControl>
1013
+ *
1014
+ * Arrow Down moves into the suggestions and Escape closes them. A single
1015
+ * choice fills the field with its label; with `multiSelect` the choices show
1016
+ * as removable tags above it.
1017
+ */
1018
+ declare function Autocomplete(props: AutocompleteProps): React$1.JSX.Element;
1019
+
1020
+ interface DatePickerLabels {
1021
+ nextMonthButton: string;
1022
+ previousMonthButton: string;
1023
+ monthSelect: string;
1024
+ yearSelect: string;
1025
+ picker: string;
1026
+ }
1027
+ interface DatePickerBaseProps {
1028
+ /** The month shown first, when no date is chosen. Defaults to today. */
1029
+ startDate?: Date;
1030
+ /** Return true for dates that can't be chosen. */
1031
+ disableDate?: (date: Date) => boolean;
1032
+ /** 0 is Sunday, as in Swirl's default; 1 is Monday. */
1033
+ firstDayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
1034
+ /** A BCP 47 locale for the month and weekday names. Defaults to "en-US". */
1035
+ locale?: string;
1036
+ labels?: Partial<DatePickerLabels>;
1037
+ /** Cap the width at 17.5rem from 768px up. Defaults to true. */
1038
+ fixedMaxWidth?: boolean;
1039
+ className?: string;
1040
+ }
1041
+ interface SingleDatePickerProps extends DatePickerBaseProps {
1042
+ range?: false;
1043
+ value?: Date;
1044
+ defaultValue?: Date;
1045
+ onValueChange?: (date: Date) => void;
1046
+ }
1047
+ interface RangeDatePickerProps extends DatePickerBaseProps {
1048
+ /** Choose a start and an end date. `onValueChange` fires once both are chosen. */
1049
+ range: true;
1050
+ value?: [Date, Date];
1051
+ defaultValue?: [Date, Date];
1052
+ onValueChange?: (range: [Date, Date]) => void;
1053
+ }
1054
+ type DatePickerProps = SingleDatePickerProps | RangeDatePickerProps;
1055
+ /**
1056
+ * Swirl's date picker: a month calendar with month and year pickers. It
1057
+ * selects one date, or a start and end with `range`. Arrow keys move between
1058
+ * days, Page Up and Page Down between months.
1059
+ *
1060
+ * Built on react-day-picker, styled to Swirl's picker.
1061
+ */
1062
+ declare function DatePicker(props: DatePickerProps): React$1.JSX.Element;
1063
+
1064
+ interface DateInputProps extends Omit<InputProps, "value" | "defaultValue" | "onChange" | "type" | "prefix" | "suffix" | "clearable"> {
1065
+ /** The date as ISO `yyyy-MM-dd`, or "" for none. */
1066
+ value?: string;
1067
+ defaultValue?: string;
1068
+ /** Called with the ISO date once a whole valid date is typed or picked, and with "" when cleared. */
1069
+ onValueChange?: (value: string) => void;
1070
+ /** Called with the typed text when it is a whole date that doesn't exist, such as 2026-02-31. */
1071
+ onInvalidInput?: (text: string) => void;
1072
+ /** How the date is shown and typed, as a date-fns pattern. Defaults to "yyyy-MM-dd". */
1073
+ format?: string;
1074
+ /** Defaults to "yyyy-mm-dd". */
1075
+ placeholder?: string;
1076
+ /**
1077
+ * "pick" makes the field read-only on phones, so tapping it opens the
1078
+ * picker instead of the keyboard, as in Swirl.
1079
+ */
1080
+ preferredInputMode?: "input" | "pick";
1081
+ datePickerDisableDate?: (date: Date) => boolean;
1082
+ datePickerLabel?: string;
1083
+ datePickerTriggerLabel?: string;
1084
+ firstDayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
1085
+ locale?: string;
1086
+ labels?: Partial<DatePickerLabels>;
1087
+ }
1088
+ /**
1089
+ * Swirl's date input: a masked date field with a button that opens the
1090
+ * `DatePicker`. Put it in a `FormControl`.
1091
+ *
1092
+ * <FormControl label="Due date">
1093
+ * <DateInput format="dd.MM.yyyy" placeholder="dd.mm.yyyy" />
1094
+ * </FormControl>
1095
+ *
1096
+ * Typing fills in the separators and pads single digits ("4" in a day field
1097
+ * becomes "04"), and digits that can't make a date are ignored. The value is
1098
+ * always ISO `yyyy-MM-dd`, whatever the display `format`.
1099
+ */
1100
+ declare function DateInput({ value: valueProp, defaultValue, onValueChange, onInvalidInput, format, placeholder, preferredInputMode, datePickerDisableDate, datePickerLabel, datePickerTriggerLabel, firstDayOfWeek, locale, labels, id, disabled: disabledProp, readOnly: readOnlyProp, className, onClick, ...props }: DateInputProps): React$1.JSX.Element;
1101
+
1102
+ interface TimeInputProps extends Omit<InputProps, "value" | "defaultValue" | "onChange" | "type" | "prefix" | "suffix" | "clearable"> {
1103
+ /** The time as `HH:mm:ss`, or "" for none. */
1104
+ value?: string;
1105
+ defaultValue?: string;
1106
+ /** Called with `HH:mm:ss` once a whole time is typed, and with "" when cleared. */
1107
+ onValueChange?: (value: string) => void;
1108
+ /** How the time is shown and typed, as a date-fns pattern: "HH:mm", "hh:mm aa", "HH:mm:ss". Defaults to "HH:mm". */
1109
+ format?: string;
1110
+ /** Defaults to "hh:mm". */
1111
+ placeholder?: string;
1112
+ }
1113
+ /**
1114
+ * Swirl's time input: a masked time field with a clock icon. Put it in a
1115
+ * `FormControl`. Typing fills in the colons, pads single digits and ignores
1116
+ * digits out of range; with an `aa` format, "a" or "p" fills in AM or PM.
1117
+ * The value is always `HH:mm:ss`, whatever the display `format`.
1118
+ */
1119
+ declare function TimeInput({ value: valueProp, defaultValue, onValueChange, format, placeholder, id, className, ...props }: TimeInputProps): React$1.JSX.Element;
1120
+
1121
+ interface ColorInputProps extends Omit<InputProps, "value" | "defaultValue" | "onChange" | "type" | "prefix" | "suffix" | "maxLength"> {
1122
+ /** A hex colour such as "#0037af". */
1123
+ value?: string;
1124
+ defaultValue?: string;
1125
+ /** Called with the text as it is typed, and with each colour picked. */
1126
+ onValueChange?: (value: string) => void;
1127
+ /** Accessible name of the swatch that opens the picker. */
1128
+ pickerButtonLabel?: string;
1129
+ /** Accessible name of the picker popover. */
1130
+ pickerLabel?: string;
1131
+ }
1132
+ /**
1133
+ * Swirl's colour input: a hex field with a swatch that opens a colour
1134
+ * picker. Put it in a `FormControl`.
1135
+ *
1136
+ * <FormControl label="Brand colour">
1137
+ * <ColorInput defaultValue="#0037af" />
1138
+ * </FormControl>
1139
+ *
1140
+ * The picker is react-colorful's, from the author of the vanilla-colorful
1141
+ * picker Swirl uses.
1142
+ */
1143
+ declare function ColorInput({ value: valueProp, defaultValue, onValueChange, pickerButtonLabel, pickerLabel, disabled: disabledProp, readOnly: readOnlyProp, className, ...props }: ColorInputProps): React$1.JSX.Element;
1144
+
1145
+ interface FileUploaderHandle {
1146
+ /** Clears the chosen files. */
1147
+ reset: () => void;
1148
+ }
1149
+ interface FileUploaderProps extends Omit<React$1.ComponentProps<"input">, "type" | "ref" | "onChange" | "value" | "defaultValue"> {
1150
+ label: string;
1151
+ description?: React$1.ReactNode;
1152
+ hideLabel?: boolean;
1153
+ /** Called with the chosen files, whether picked or dropped. */
1154
+ onValueChange?: (files: FileList) => void;
1155
+ /** Show a drop zone. Defaults to true; false shows a button instead. */
1156
+ showDropzone?: boolean;
1157
+ ctaLabel?: string;
1158
+ dragDropLabel?: string;
1159
+ uploadButtonLabel?: string;
1160
+ uploadButtonVariant?: ButtonProps["variant"];
1161
+ uploadButtonIcon?: React$1.ReactNode;
1162
+ /** Gives access to `reset()`, which clears the chosen files. */
1163
+ ref?: React$1.Ref<FileUploaderHandle>;
1164
+ }
1165
+ /**
1166
+ * Swirl's file uploader: a label, a description and a drop zone to click or
1167
+ * drop files on, or a button with `showDropzone={false}`. The drop zone is a
1168
+ * native file input stretched over it, so picking and dropping both go
1169
+ * through the browser's own file handling.
1170
+ */
1171
+ declare function FileUploader({ label, description, hideLabel, onValueChange, showDropzone, ctaLabel, dragDropLabel, uploadButtonLabel, uploadButtonVariant, uploadButtonIcon, id, disabled, className, ref, ...props }: FileUploaderProps): React$1.JSX.Element;
1172
+
1173
+ interface SearchProps extends Omit<React$1.ComponentProps<"input">, "type" | "size"> {
1174
+ /** Accessible name of the field. */
1175
+ label?: string;
1176
+ /** `filled` (default) sits on a raised surface; `outline` has a border; `ghost` has neither. */
1177
+ variant?: "filled" | "outline" | "ghost";
1178
+ /** Show a button that clears the term. Defaults to true. */
1179
+ clearable?: boolean;
1180
+ clearButtonLabel?: string;
1181
+ /** Called with the term on every change, and with "" when cleared. */
1182
+ onValueChange?: (value: string) => void;
1183
+ onClear?: () => void;
1184
+ /** Focus the field with Cmd/Ctrl+K or Cmd/Ctrl+/. Defaults to true, as in Swirl. */
1185
+ shortcut?: boolean;
1186
+ /** Class for the wrapper around the input, icon and clear button. */
1187
+ wrapperClassName?: string;
1188
+ }
1189
+ /**
1190
+ * Swirl's search field: a rounded input with a search icon and a clear
1191
+ * button. It stands alone rather than in a `FormControl`, so give it a
1192
+ * `label`. Cmd/Ctrl+K or Cmd/Ctrl+/ focuses it from anywhere on the page.
1193
+ */
1194
+ declare function Search({ className, wrapperClassName, label, variant, clearable, clearButtonLabel, placeholder, shortcut, value, defaultValue, onChange, onValueChange, onClear, disabled, id, ...props }: SearchProps): React$1.JSX.Element;
1195
+
1196
+ interface ToolbarProps extends React$1.ComponentProps<"div"> {
1197
+ /** Accessible name of the toolbar. */
1198
+ label?: string;
1199
+ orientation?: "horizontal" | "vertical";
1200
+ /** Gap between controls, in Swirl's px steps. Defaults to 8. */
1201
+ spacing?: SwirlSpacing;
1202
+ }
1203
+ /**
1204
+ * Swirl's toolbar: a row of buttons and chips that is one tab stop. Arrow
1205
+ * keys move between the controls and wrap at the ends. Controls wrap onto
1206
+ * more lines when the row runs out of room.
1207
+ */
1208
+ declare function Toolbar({ className, label, orientation, spacing, onKeyDown, onFocus, children, ...props }: ToolbarProps): React$1.JSX.Element;
1209
+
1210
+ type ToggleGroupProps = React$1.ComponentProps<typeof ToggleGroup$1.Root> & {
1211
+ /**
1212
+ * Swirl's track: `flat` is sunken, `outline` adds a strong border, and
1213
+ * `translucent` uses the raised surface for use over images or colour.
1214
+ */
1215
+ variant?: "flat" | "outline" | "translucent";
1216
+ /** Lift the group off the page with a shadow. */
1217
+ elevated?: boolean;
1218
+ /**
1219
+ * With `type="single"`, let a click on the selected option clear the
1220
+ * choice. Off by default: as in Swirl, an option stays selected until
1221
+ * another is chosen.
1222
+ */
1223
+ allowDeselect?: boolean;
1224
+ };
1225
+ /**
1226
+ * Swirl's toggle group: a segmented control whose chosen option lifts onto
1227
+ * a white surface. Pass `type="single"` for Swirl's one-of-many behaviour,
1228
+ * or `type="multiple"` to allow several. Arrow keys move between options.
1229
+ */
1230
+ declare function ToggleGroup({ className, variant, elevated, allowDeselect, ...props }: ToggleGroupProps): React$1.JSX.Element;
1231
+ interface ToggleGroupItemProps extends React$1.ComponentProps<typeof ToggleGroup$1.Item> {
1232
+ /** Leading icon, 24px or 20px with the desktop layout. */
1233
+ icon?: React$1.ReactNode;
1234
+ /** The option's name. Interchangeable with `children`. */
1235
+ label?: string;
1236
+ /** Show only the icon, keeping `label` as the accessible name. */
1237
+ hideLabel?: boolean;
1238
+ }
1239
+ declare function ToggleGroupItem({ className, icon, label, hideLabel, children, ...props }: ToggleGroupItemProps): React$1.JSX.Element;
1240
+
1241
+ declare const Dialog: React$1.FC<Dialog$1.DialogProps>;
1242
+ declare const DialogTrigger: React$1.ForwardRefExoticComponent<Dialog$1.DialogTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
1243
+ declare const DialogClose: React$1.ForwardRefExoticComponent<Dialog$1.DialogCloseProps & React$1.RefAttributes<HTMLButtonElement>>;
1244
+ declare const DialogPortal: React$1.FC<Dialog$1.DialogPortalProps>;
1245
+ /** Swirl's backdrop: a 20% black wash that fades in. */
1246
+ declare function DialogOverlay({ className, ...props }: React$1.ComponentProps<typeof Dialog$1.Overlay>): React$1.JSX.Element;
1247
+ declare const contentVariants: (props?: ({
1248
+ variant?: "default" | "sheet" | "drawer" | null | undefined;
1249
+ size?: "s" | "m" | "l" | "xl" | "full" | null | undefined;
1250
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
1251
+ interface DialogContentProps extends Omit<React$1.ComponentProps<typeof Dialog$1.Content>, "title">, VariantProps<typeof contentVariants> {
1252
+ /** The dialog's heading, in its header bar. Without it, put a `DialogTitle` in the content. */
1253
+ label?: string;
1254
+ /** Keep `label` as the accessible name but don't show it. */
1255
+ hideLabel?: boolean;
1256
+ /** Hide the close button. */
1257
+ hideCloseButton?: boolean;
1258
+ /** @deprecated Use `hideCloseButton`. */
1259
+ showClose?: boolean;
1260
+ closeButtonLabel?: string;
1261
+ /** @deprecated Use `closeButtonLabel`. */
1262
+ closeLabel?: string;
1263
+ /** Pad the content, as Swirl does by default. */
1264
+ padded?: boolean;
1265
+ /** Footer buttons: a primary flat button, and a secondary one before it. */
1266
+ primaryActionLabel?: string;
1267
+ secondaryActionLabel?: string;
1268
+ onPrimaryAction?: () => void;
1269
+ onSecondaryAction?: () => void;
1270
+ /** Tools under the header, such as a search field. */
1271
+ headerTools?: React$1.ReactNode;
1272
+ /** A second column beside the content from 992px (Swirl's breakpoint, not Tailwind's `lg`), and under it below. */
1273
+ secondaryContent?: React$1.ReactNode;
1274
+ /** Drop the rules Swirl draws around secondary content. */
1275
+ hideSecondaryContentBorders?: boolean;
1276
+ /** A sidebar on the left, from 768px, with its own heading, content and footer. */
1277
+ sidebarLabel?: string;
1278
+ sidebarContent?: React$1.ReactNode;
1279
+ sidebarFooter?: React$1.ReactNode;
1280
+ sidebarPadded?: boolean;
1281
+ sidebarFooterPadded?: boolean;
1282
+ /** CSS max width, overriding Swirl's 40rem. */
1283
+ maxWidth?: string;
1284
+ }
1285
+ /**
1286
+ * Swirl's modal. Full screen on phones and centred from 768px, with a header
1287
+ * bar holding the close button and the `label`. Content scrolls under it,
1288
+ * and rules appear above and below as it does. `headerTools`,
1289
+ * `secondaryContent`, a sidebar and footer actions are all optional.
1290
+ *
1291
+ * <DialogContent label="Rename" primaryActionLabel="Save" onPrimaryAction={save}>
1292
+ * <Input defaultValue="acme" />
1293
+ * </DialogContent>
1294
+ *
1295
+ * The shadcn parts (`DialogHeader`, `DialogTitle`, `DialogFooter`, ...) still
1296
+ * work inside it, for a dialog without a `label`.
1297
+ */
1298
+ declare function DialogContent({ className, children, variant, size, label, hideLabel, hideCloseButton, showClose, closeButtonLabel, closeLabel, padded, primaryActionLabel, secondaryActionLabel, onPrimaryAction, onSecondaryAction, headerTools, secondaryContent, hideSecondaryContentBorders, sidebarLabel, sidebarContent, sidebarFooter, sidebarPadded, sidebarFooterPadded, maxWidth, style, ...props }: DialogContentProps): React$1.JSX.Element;
1299
+ declare function DialogHeader({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
1300
+ declare function DialogTitle({ className, ...props }: React$1.ComponentProps<typeof Dialog$1.Title>): React$1.JSX.Element;
1301
+ declare function DialogDescription({ className, ...props }: React$1.ComponentProps<typeof Dialog$1.Description>): React$1.JSX.Element;
1302
+ declare function DialogBody({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
1303
+ declare function DialogFooter({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
1304
+
1305
+ interface PopoverProps extends React$1.ComponentProps<typeof Popover$1.Root> {
1306
+ /** Below 768px, open as a bottom sheet over a backdrop, as Swirl does. Defaults to true. */
1307
+ mobileBottomSheet?: boolean;
1308
+ }
1309
+ declare function Popover({ mobileBottomSheet, ...props }: PopoverProps): React$1.JSX.Element;
1310
+ declare function PopoverTrigger(props: React$1.ComponentProps<typeof Popover$1.Trigger>): React$1.JSX.Element;
1311
+ declare function PopoverClose(props: React$1.ComponentProps<typeof Popover$1.Close>): React$1.JSX.Element;
1312
+ /** Positions the popover against this element instead of the trigger. A plain wrapper in the sheet. */
1313
+ declare function PopoverAnchor({ asChild, children, ...props }: React$1.ComponentProps<typeof Popover$1.Anchor>): string | number | bigint | boolean | React$1.JSX.Element | Iterable<React$1.ReactNode> | Promise<string | number | bigint | boolean | React$1.ReactPortal | React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | Iterable<React$1.ReactNode> | null | undefined> | null | undefined;
1314
+ interface PopoverContentProps extends React$1.ComponentProps<typeof Popover$1.Content> {
1315
+ /** Accessible name of the popover. Swirl requires one. */
1316
+ label?: string;
1317
+ /** Pad the content by 4px, as Swirl does for menus and lists. Defaults to true. */
1318
+ padded?: boolean;
1319
+ /** The frosted, see-through surface. Defaults to true, as in Swirl; false draws the solid overlay colour. */
1320
+ translucent?: boolean;
1321
+ /** Draw the small arrow pointing at the trigger. Desktop only; Swirl has no arrow. */
1322
+ arrow?: boolean;
1323
+ }
1324
+ /**
1325
+ * The popover's panel. `className` styles the scrolling body inside it, so
1326
+ * padding, layout and width set there apply to the content.
1327
+ *
1328
+ * On desktop it opens under the trigger's start edge, up to 22.5rem wide and
1329
+ * 22rem tall before it scrolls. Below 768px it slides up from the bottom.
1330
+ */
1331
+ declare function PopoverContent({ className, label, padded, translucent, arrow, align, side, sideOffset, alignOffset, avoidCollisions, collisionBoundary, collisionPadding, arrowPadding, sticky, hideWhenDetached, updatePositionStrategy, children, ...props }: PopoverContentProps): React$1.JSX.Element;
1332
+
1333
+ /**
1334
+ * Wrap the app (or a subtree) once so tooltips share hover timing.
1335
+ * Radix requires a provider above any `Tooltip`.
1336
+ */
1337
+ declare const TooltipProvider: React$1.FC<Tooltip$1.TooltipProviderProps>;
1338
+ declare const TooltipTrigger: React$1.ForwardRefExoticComponent<Tooltip$1.TooltipTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
1339
+ interface TooltipProps extends Omit<React.ComponentProps<typeof Tooltip$1.Root>, "children"> {
1340
+ /** Tooltip text. */
1341
+ content: React.ReactNode;
1342
+ side?: React.ComponentProps<typeof Tooltip$1.Content>["side"];
1343
+ align?: React.ComponentProps<typeof Tooltip$1.Content>["align"];
1344
+ sideOffset?: number;
1345
+ /** Swirl's colours: neutral `default`, `info`, or `primary`. */
1346
+ intent?: keyof typeof intents;
1347
+ /** CSS max-width of the bubble. Swirl's default is 17.5rem. */
1348
+ maxWidth?: string;
1349
+ /** The element the tooltip describes. */
1350
+ children: React.ReactNode;
1351
+ className?: string;
1352
+ }
1353
+ declare const intents: {
1354
+ readonly default: "bg-surface-neutral text-on-status";
1355
+ readonly info: "bg-surface-info text-on-status";
1356
+ readonly primary: "bg-primary text-on-primary";
1357
+ };
1358
+ /**
1359
+ * Swirl's tooltip: a short hint on hover or keyboard focus, in a dark bubble
1360
+ * 12px from its trigger with a rounded arrow.
1361
+ *
1362
+ * Collapses Radix's Root/Trigger/Content trio into one component, since a
1363
+ * tooltip is almost always "this element, that text". The trigger uses
1364
+ * `asChild`, so the child must accept a ref and forward DOM props.
1365
+ */
1366
+ declare function Tooltip({ content, children, side, align, sideOffset, intent, maxWidth, className, ...props }: TooltipProps): React$1.JSX.Element;
1367
+ /** The raw primitives, for cases the simple wrapper cannot express. */
1368
+ declare const TooltipRoot: React$1.FC<Tooltip$1.TooltipProps>;
1369
+ declare const TooltipContent: React$1.ForwardRefExoticComponent<Tooltip$1.TooltipContentProps & React$1.RefAttributes<HTMLDivElement>>;
1370
+
1371
+ type Side = "top" | "right" | "bottom" | "left";
1372
+ type MenuPlacement = Side | `${Side}-start` | `${Side}-end`;
1373
+ interface MenuProps {
1374
+ /** Names the menu for assistive tech, and titles it on mobile. */
1375
+ label: string;
1376
+ /**
1377
+ * The element that opens the menu, such as a `Button`. Only the top-level
1378
+ * menu takes one; a `Menu` nested in a `MenuItem` is that item's submenu.
1379
+ */
1380
+ trigger?: React$1.ReactElement;
1381
+ /**
1382
+ * `action` items run something. `selection` items pick one value, shown
1383
+ * with a check, and the parent item shows the chosen label.
1384
+ */
1385
+ variant?: "action" | "selection";
1386
+ /** The chosen value, for a `selection` menu. */
1387
+ value?: string;
1388
+ defaultValue?: string;
1389
+ onValueChange?: (value: string) => void;
1390
+ /** Where the menu opens relative to its trigger, on desktop. */
1391
+ placement?: MenuPlacement;
1392
+ open?: boolean;
1393
+ defaultOpen?: boolean;
1394
+ onOpenChange?: (open: boolean) => void;
1395
+ /** Called when the mobile sheet's Done button is pressed. */
1396
+ onDone?: () => void;
1397
+ mobileBackButtonLabel?: string;
1398
+ mobileCloseMenuButtonLabel?: string;
1399
+ mobileDoneButtonLabel?: string;
1400
+ children?: React$1.ReactNode;
1401
+ }
1402
+ interface MenuItemProps {
1403
+ label: string;
1404
+ description?: string;
1405
+ icon?: React$1.ReactNode;
1406
+ /** Small marker over the icon's corner, such as a dot `Badge`. */
1407
+ iconBadge?: React$1.ReactNode;
1408
+ avatar?: React$1.ReactNode;
1409
+ /** Trailing icon or `Tag`. */
1410
+ suffix?: React$1.ReactNode;
1411
+ intent?: "default" | "critical";
1412
+ disabled?: boolean;
1413
+ truncateLabel?: boolean;
1414
+ /** This item's value, in a `selection` menu. */
1415
+ value?: string;
1416
+ /** Runs when the item is chosen, in an `action` menu. The menu then closes. */
1417
+ onSelect?: () => void;
1418
+ /** A nested `Menu`, making this item open a submenu. */
1419
+ children?: React$1.ReactNode;
1420
+ }
1421
+ /**
1422
+ * Swirl's menu (`swirl-menu` in a `swirl-popover`): actions and choices that
1423
+ * open from a trigger, with nested submenus.
1424
+ *
1425
+ * On desktop it is a popover; a submenu opens beside its item on click or
1426
+ * ArrowRight and closes with ArrowLeft. Below 768px it fills the screen and
1427
+ * submenus slide in, with Back, the menu's title and Done in a header.
1428
+ *
1429
+ * <Menu label="Actions" trigger={<Button label="Open menu" />}>
1430
+ * <MenuItem icon={<Copy />} label="Duplicate" onSelect={duplicate} />
1431
+ * <MenuItem label="Text color">
1432
+ * <Menu label="Text color" variant="selection" value={color} onValueChange={setColor}>
1433
+ * <MenuItem label="Red" value="red" />
1434
+ * <MenuItem label="Blue" value="blue" />
1435
+ * </Menu>
1436
+ * </MenuItem>
1437
+ * </Menu>
1438
+ */
1439
+ declare function Menu(props: MenuProps): React$1.JSX.Element;
1440
+ /**
1441
+ * One entry in a `Menu`. Nest a `Menu` inside to give it a submenu. It renders
1442
+ * nothing on its own: the enclosing `Menu` reads its props.
1443
+ */
1444
+ declare function MenuItem(_props: MenuItemProps): React$1.ReactNode;
1445
+
1446
+ /**
1447
+ * Swirl's dialog (`swirl-dialog`): a small, focused confirmation such as "Leave
1448
+ * this chat?". It uses the `alertdialog` role, so it has no close button and
1449
+ * an outside click does not dismiss it; the user answers with an action, or
1450
+ * Escape. For forms and other content, use `Dialog` (Swirl's modal).
1451
+ */
1452
+ declare const AlertDialog: React$1.FC<AlertDialog$1.AlertDialogProps>;
1453
+ declare const AlertDialogTrigger: React$1.ForwardRefExoticComponent<AlertDialog$1.AlertDialogTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
1454
+ declare const AlertDialogPortal: React$1.FC<AlertDialog$1.AlertDialogPortalProps>;
1455
+ declare function AlertDialogOverlay({ className, ...props }: React.ComponentProps<typeof AlertDialog$1.Overlay>): React$1.JSX.Element;
1456
+ interface AlertDialogContentProps extends React.ComponentProps<typeof AlertDialog$1.Content> {
1457
+ /** `large` widens the dialog to 35rem with the desktop layout. */
1458
+ size?: "default" | "large";
1459
+ /** A frosted, see-through surface instead of the solid overlay colour. */
1460
+ translucent?: boolean;
1461
+ }
1462
+ declare function AlertDialogContent({ className, children, size, translucent, ...props }: AlertDialogContentProps): React$1.JSX.Element;
1463
+ /** Groups the title and description. Present for shadcn parity; adds no styling. */
1464
+ declare function AlertDialogHeader({ className, ...props }: React.ComponentProps<"div">): React$1.JSX.Element;
1465
+ declare function AlertDialogTitle({ className, ...props }: React.ComponentProps<typeof AlertDialog$1.Title>): React$1.JSX.Element;
1466
+ /** The dialog's message. Swirl gives it the body text colour, not a subdued one. */
1467
+ declare function AlertDialogDescription({ className, ...props }: React.ComponentProps<typeof AlertDialog$1.Description>): React$1.JSX.Element;
1468
+ interface AlertDialogFooterProps extends React.ComponentProps<"div"> {
1469
+ /** `vertical` stacks the actions full width, as Swirl's `actionsOrientation`. */
1470
+ orientation?: "horizontal" | "vertical";
1471
+ }
1472
+ /**
1473
+ * The actions. On touch screens they share the full width; from 992px they
1474
+ * sit at their natural width on the right.
1475
+ */
1476
+ declare function AlertDialogFooter({ className, orientation, ...props }: AlertDialogFooterProps): React$1.JSX.Element;
1477
+ /** The confirming action: a flat button, primary unless `intent` says otherwise. */
1478
+ declare function AlertDialogAction({ variant, intent, ...props }: ButtonProps): React$1.JSX.Element;
1479
+ /** The dismissing action: a ghost button, as Swirl's secondary action. */
1480
+ declare function AlertDialogCancel({ variant, ...props }: ButtonProps): React$1.JSX.Element;
1481
+
1482
+ interface ActionListProps extends React$1.ComponentProps<"div"> {
1483
+ }
1484
+ /**
1485
+ * Swirl's action list: a vertical menu of actions, standalone or inside a
1486
+ * popover. For a menu that opens from a trigger, use `Menu`.
1487
+ *
1488
+ * It is one tab stop. Arrow keys move between items and wrap at the ends;
1489
+ * Home and End jump to the first and last. Tabbing back in returns to the
1490
+ * item that last had focus.
1491
+ */
1492
+ declare function ActionList({ className, onKeyDown, onFocus, onBlur, ...props }: ActionListProps): React$1.JSX.Element;
1493
+ interface ActionListItemProps extends Omit<React$1.ComponentProps<"button">, "children"> {
1494
+ /** The action's name. Interchangeable with `children`. */
1495
+ label?: React$1.ReactNode;
1496
+ children?: React$1.ReactNode;
1497
+ /** Secondary text under the label. */
1498
+ description?: React$1.ReactNode;
1499
+ /** Leading icon. Sized 24px, or 20px with the desktop layout. */
1500
+ icon?: React$1.ReactNode;
1501
+ /** Small marker over the icon's corner, such as a dot `Badge`. */
1502
+ iconBadge?: React$1.ReactNode;
1503
+ /** Leading avatar, in place of or as well as an icon. */
1504
+ avatar?: React$1.ReactNode;
1505
+ /** Right-aligned meta text: a shortcut, a count. */
1506
+ badge?: React$1.ReactNode;
1507
+ /** Trailing icon or `Tag`. Hidden while the item is disabled, as in Swirl. */
1508
+ suffix?: React$1.ReactNode;
1509
+ intent?: "default" | "critical";
1510
+ /** `l` pads the item evenly by 16px. */
1511
+ size?: "m" | "l";
1512
+ /** Let a long label wrap instead of truncating. */
1513
+ truncateLabel?: boolean;
1514
+ /**
1515
+ * Mark the item as the chosen option: label, icon and suffix take the
1516
+ * highlight colour, as Swirl's option items do.
1517
+ */
1518
+ selected?: boolean;
1519
+ }
1520
+ /**
1521
+ * One action. Renders a button with `role="menuitem"`; disable it with
1522
+ * `disabled`, or with `aria-disabled` to keep it focusable for screen readers.
1523
+ */
1524
+ declare function ActionListItem({ className, label, children, description, icon, iconBadge, avatar, badge, suffix, intent, size, truncateLabel, selected, disabled, onClick, type, ...props }: ActionListItemProps): React$1.JSX.Element;
1525
+ interface ActionListSectionProps extends React$1.ComponentProps<"div"> {
1526
+ /** Heading for the group of items. Required, as in Swirl: it names the group. */
1527
+ label: React$1.ReactNode;
1528
+ /** Gap between the section's items, in Swirl's px steps. */
1529
+ spacing?: SwirlSpacing;
1530
+ /**
1531
+ * Draw a separator above the section. Ignored on a section that opens the
1532
+ * list, where there is nothing above to separate it from.
1533
+ */
1534
+ hasSeparator?: boolean;
1535
+ /** Space above and below the separator line, in Swirl's px steps. */
1536
+ separatorSpacing?: SwirlSpacing;
1537
+ }
1538
+ /** A labelled group of items. */
1539
+ declare function ActionListSection({ className, label, spacing, hasSeparator, separatorSpacing, children, ...props }: ActionListSectionProps): React$1.JSX.Element;
1540
+
1541
+ interface OptionListItemDrop {
1542
+ /** The moved item's value. */
1543
+ value: string;
1544
+ oldIndex: number;
1545
+ newIndex: number;
1546
+ }
1547
+ interface OptionListProps extends Omit<React$1.ComponentProps<"div">, "defaultValue" | "onChange"> {
1548
+ /** Accessible name of the listbox. */
1549
+ label?: string;
1550
+ /** Let several options be chosen; each shows a checkbox instead of its icon. */
1551
+ multiSelect?: boolean;
1552
+ /** The chosen values, controlled. Swirl's value is always an array. */
1553
+ value?: string[];
1554
+ defaultValue?: string[];
1555
+ onValueChange?: (value: string[]) => void;
1556
+ /** Whether choosing a selected option again deselects it. Defaults to true. */
1557
+ allowDeselect?: boolean;
1558
+ disabled?: boolean;
1559
+ /** Add a "Select all" option above the others. Multi-select only. */
1560
+ showSelectAll?: boolean;
1561
+ selectAllLabel?: string;
1562
+ /**
1563
+ * Show a drag handle on each item, to reorder by pointer or keyboard
1564
+ * (Space to grab, arrows to move, Space to drop, Escape to cancel). Only for
1565
+ * multi-select lists without sections, as in Swirl. The list does not
1566
+ * reorder its children itself: apply `onItemDrop` to your data.
1567
+ */
1568
+ allowDrag?: boolean;
1569
+ onItemDrop?: (drop: OptionListItemDrop) => void;
1570
+ dragHandleLabel?: string;
1571
+ dragHandleDescription?: string;
1572
+ assistiveTextItemGrabbed?: string;
1573
+ assistiveTextItemMoving?: string;
1574
+ assistiveTextItemMoved?: string;
1575
+ }
1576
+ /**
1577
+ * Swirl's option list: a listbox for choosing one or several options, used
1578
+ * on its own, in a popover or as the menu of a select.
1579
+ *
1580
+ * One tab stop; arrow keys move between options, Home and End jump to the
1581
+ * ends, and Space or Enter chooses. Cmd/Ctrl+A selects all in a multi-select
1582
+ * list.
1583
+ */
1584
+ declare function OptionList({ className, label, multiSelect, value: valueProp, defaultValue, onValueChange, allowDeselect, disabled, showSelectAll, selectAllLabel, allowDrag, onItemDrop, dragHandleLabel, dragHandleDescription, assistiveTextItemGrabbed, assistiveTextItemMoving, assistiveTextItemMoved, onKeyDown, children, ...props }: OptionListProps): React$1.JSX.Element;
1585
+ interface OptionListItemProps extends Omit<React$1.ComponentProps<"div">, "children" | "onSelect"> {
1586
+ /** The option's name. Interchangeable with `children`. */
1587
+ label?: React$1.ReactNode;
1588
+ children?: React$1.ReactNode;
1589
+ value: string;
1590
+ /** Secondary text under the label. */
1591
+ description?: React$1.ReactNode;
1592
+ /** Leading icon, shown in single-select lists. 24px, or 20px with the desktop layout. */
1593
+ icon?: React$1.ReactNode;
1594
+ /** Small marker over the icon's corner. */
1595
+ iconBadge?: React$1.ReactNode;
1596
+ /** Leading avatar. */
1597
+ avatar?: React$1.ReactNode;
1598
+ disabled?: boolean;
1599
+ /** Let a long label wrap instead of truncating. */
1600
+ truncateLabel?: boolean;
1601
+ /** Defaults to 15rem, as in Swirl. */
1602
+ minWidth?: string;
1603
+ }
1604
+ /** One option. Selected options take the highlight colour and a check. */
1605
+ declare function OptionListItem({ value, ...props }: OptionListItemProps): React$1.JSX.Element;
1606
+ interface OptionListSectionProps extends ActionListSectionProps {
1607
+ }
1608
+ /**
1609
+ * A labelled group of options. `hasSeparator` draws a line above it, except
1610
+ * when it opens the list.
1611
+ */
1612
+ declare function OptionListSection(props: OptionListSectionProps): React$1.JSX.Element;
1613
+
1614
+ declare const Tabs: React$1.ForwardRefExoticComponent<Tabs$1.TabsProps & React$1.RefAttributes<HTMLDivElement>>;
1615
+ type TabsVariant = "underline" | "pill" | "segmented";
1616
+ interface TabsListProps extends React$1.ComponentProps<typeof Tabs$1.List> {
1617
+ /**
1618
+ * `underline` is Swirl's default tab bar and `pill` its pill bar.
1619
+ * `segmented`, a filled control, is not in Swirl.
1620
+ */
1621
+ variant?: TabsVariant;
1622
+ /** Share the row evenly between the tabs. Swirl's `justify="evenly"`. */
1623
+ stretch?: boolean;
1624
+ }
1625
+ /** The row of tabs. It scrolls sideways, without a scrollbar, when the tabs overflow. */
1626
+ declare function TabsList({ className, variant, stretch, ...props }: TabsListProps): React$1.JSX.Element;
1627
+ interface TabsTriggerProps extends React$1.ComponentProps<typeof Tabs$1.Trigger> {
1628
+ /** Leading icon, 20px. */
1629
+ icon?: React$1.ReactNode;
1630
+ /** Quiet text after the label, such as a count. */
1631
+ suffix?: React$1.ReactNode;
1632
+ /** A status dot after the label. `label` names it for screen readers. */
1633
+ badge?: {
1634
+ label: string;
1635
+ intent?: BadgeIntent;
1636
+ };
1637
+ /** Help text shown in a tooltip on hover and focus. */
1638
+ tooltip?: React$1.ReactNode;
1639
+ }
1640
+ declare function TabsTrigger({ className, icon, suffix, badge, tooltip, children, ...props }: TabsTriggerProps): React$1.JSX.Element;
1641
+ /** A tab's panel, padded 8px as in Swirl. */
1642
+ declare function TabsContent({ className, ...props }: React$1.ComponentProps<typeof Tabs$1.Content>): React$1.JSX.Element;
1643
+
1644
+ /**
1645
+ * Swirl's accordion: a stack of sections, each opened by its heading.
1646
+ * `type="single" collapsible` keeps one open at a time, as Swirl does by
1647
+ * default; `type="multiple"` is Swirl's `multiExpand`.
1648
+ */
1649
+ declare const Accordion: React$1.ForwardRefExoticComponent<(Accordion$1.AccordionSingleProps | Accordion$1.AccordionMultipleProps) & React$1.RefAttributes<HTMLDivElement>>;
1650
+ /** One section. Items are ruled off above, and the last one below too. */
1651
+ declare function AccordionItem({ className, ...props }: React$1.ComponentProps<typeof Accordion$1.Item>): React$1.JSX.Element;
1652
+ interface AccordionTriggerProps extends React$1.ComponentProps<typeof Accordion$1.Trigger> {
1653
+ /** A quieter line under the heading. */
1654
+ description?: React$1.ReactNode;
1655
+ /** Shown before the heading, such as an avatar. */
1656
+ media?: React$1.ReactNode;
1657
+ /** Shown after the heading, before the expand icon. */
1658
+ trailing?: React$1.ReactNode;
1659
+ /** The heading element's level. Defaults to 2, as in Swirl. */
1660
+ headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
1661
+ }
1662
+ /** The section's heading: a button that opens and closes it. */
1663
+ declare function AccordionTrigger({ className, children, description, media, trailing, headingLevel, ...props }: AccordionTriggerProps): React$1.JSX.Element;
1664
+ /** The section's content, which slides open under its heading. */
1665
+ declare function AccordionContent({ className, children, ...props }: React$1.ComponentProps<typeof Accordion$1.Content>): React$1.JSX.Element;
1666
+
1667
+ interface TreeViewProps extends Omit<React$1.ComponentProps<"ul">, "onChange"> {
1668
+ /** Accessible name of the tree. */
1669
+ label?: string;
1670
+ /** Items expanded at first. Swirl's `initiallyExpandedItemIds`. */
1671
+ defaultExpandedItemIds?: string[];
1672
+ /** Expanded items, controlled. */
1673
+ expandedItemIds?: string[];
1674
+ onExpandedItemIdsChange?: (itemIds: string[]) => void;
1675
+ /**
1676
+ * `tree` is an interactive tree. `list` drops the tree roles and the
1677
+ * toggles and shows every item, for a static outline.
1678
+ */
1679
+ semantics?: "tree" | "list";
1680
+ /** Replace the toggle shown on expanded items. */
1681
+ expandedIcon?: React$1.ReactNode;
1682
+ /** Replace the toggle shown on collapsed items. */
1683
+ collapsedIcon?: React$1.ReactNode;
1684
+ }
1685
+ /**
1686
+ * Swirl's tree view: nested items with toggles and guide lines. It is one tab
1687
+ * stop: arrow keys move through the visible items, Right expands or steps
1688
+ * into an item, Left collapses or steps out to its parent, and Home and End
1689
+ * jump to the ends.
1690
+ */
1691
+ declare function TreeView({ className, label, defaultExpandedItemIds, expandedItemIds, onExpandedItemIdsChange, semantics, expandedIcon, collapsedIcon, onKeyDown, children, ...props }: TreeViewProps): React$1.JSX.Element;
1692
+ interface TreeViewItemProps extends Omit<React$1.ComponentProps<"a">, "children"> {
1693
+ /** Unique id, used for expansion and focus. */
1694
+ itemId: string;
1695
+ label: React$1.ReactNode;
1696
+ /** Leading icon, or an emoji. */
1697
+ icon?: React$1.ReactNode;
1698
+ /** Marks the item as the current page. */
1699
+ active?: boolean;
1700
+ /** Small tags after the label, such as a draft `Tag`. */
1701
+ tags?: React$1.ReactNode;
1702
+ /** Show a toggle for an item with children. Defaults to true. */
1703
+ expandable?: boolean;
1704
+ /** Nested `TreeViewItem`s. */
1705
+ children?: React$1.ReactNode;
1706
+ }
1707
+ declare function TreeViewItem({ className, itemId, label, icon, active, tags, expandable, children, onFocus, ...props }: TreeViewItemProps): React$1.JSX.Element;
1708
+
1709
+ interface TreeNavigationProps extends React$1.ComponentProps<"ul"> {
1710
+ /** Accessible name of the navigation. */
1711
+ label?: string;
1712
+ }
1713
+ /**
1714
+ * Swirl's tree navigation: a sidebar menu of pages, where an item with
1715
+ * children opens and closes its section. Every item is in the tab order;
1716
+ * Space toggles a section and Right and Left open and close it.
1717
+ */
1718
+ declare function TreeNavigation({ className, label, ...props }: TreeNavigationProps): React$1.JSX.Element;
1719
+ interface TreeNavigationItemProps extends Omit<React$1.ComponentProps<"a">, "children"> {
1720
+ label: React$1.ReactNode;
1721
+ /** Leading 20px icon. */
1722
+ icon?: React$1.ReactNode;
1723
+ /** Marks the item as the current page. */
1724
+ active?: boolean;
1725
+ /** Links to another site: shows an external-link icon on hover and focus. */
1726
+ external?: boolean;
1727
+ /** Show a "New" tag after the label. */
1728
+ markAsNew?: boolean;
1729
+ markAsNewLabel?: string;
1730
+ /** Let an item with children open and close. Defaults to true. */
1731
+ expandable?: boolean;
1732
+ /** Open the section at first. */
1733
+ defaultExpanded?: boolean;
1734
+ /** Nested `TreeNavigationItem`s, shown in the item's section. */
1735
+ children?: React$1.ReactNode;
1736
+ }
1737
+ declare function TreeNavigationItem({ className, label, icon, active, external, markAsNew, markAsNewLabel, expandable, defaultExpanded, href, children, onClick, onKeyDown, ...props }: TreeNavigationItemProps): React$1.JSX.Element;
1738
+
1739
+ interface PaginationProps extends Omit<React$1.ComponentProps<"nav">, "onChange"> {
1740
+ /** Current page, 1-based. */
1741
+ page: number;
1742
+ /** Total number of pages. */
1743
+ pageCount: number;
1744
+ onPageChange: (page: number) => void;
1745
+ /**
1746
+ * Swirl's variants: `default` shows "3 out of 20" between the buttons,
1747
+ * `simple` only the buttons, and `advanced` a field to type a page into.
1748
+ * `numbered` is a row of page buttons, which Swirl does not have.
1749
+ */
1750
+ variant?: "default" | "simple" | "advanced" | "numbered";
1751
+ /** Show the "Items per page" select before the buttons. */
1752
+ showPageSizeSelect?: boolean;
1753
+ pageSize?: number;
1754
+ pageSizeOptions?: number[];
1755
+ onPageSizeChange?: (pageSize: number) => void;
1756
+ /** How many page buttons to show around the current page, with `numbered`. */
1757
+ siblingCount?: number;
1758
+ label?: string;
1759
+ firstPageLabel?: string;
1760
+ previousLabel?: string;
1761
+ nextLabel?: string;
1762
+ lastPageLabel?: string;
1763
+ /** The word between the page and the page count: "3 out of 20". */
1764
+ pageLabel?: string;
1765
+ /** Accessible name of the page field in the `advanced` variant. */
1766
+ pageSelectLabel?: string;
1767
+ pageSizeSelectLabel?: string;
1768
+ }
1769
+ /**
1770
+ * Swirl's pagination: first, previous, next and last page buttons around the
1771
+ * current page. It renders even with one page, with every button disabled.
1772
+ */
1773
+ declare function Pagination({ className, page, pageCount, onPageChange, variant, showPageSizeSelect, pageSize, pageSizeOptions, onPageSizeChange, siblingCount, label, firstPageLabel, previousLabel, nextLabel, lastPageLabel, pageLabel, pageSelectLabel, pageSizeSelectLabel, ...props }: PaginationProps): React$1.JSX.Element;
1774
+
1775
+ declare const notificationVariants: (props?: ({
1776
+ intent?: "default" | "critical" | "success" | "warning" | "info" | null | undefined;
1777
+ variant?: "outline" | "default" | null | undefined;
1778
+ borderRadius?: "xs" | "sm" | null | undefined;
1779
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
1780
+ type NotificationIntent = NonNullable<VariantProps<typeof notificationVariants>["intent"]>;
1781
+ /** shadcn's Alert variants, mapped onto Swirl intents. */
1782
+ declare const shadcnIntents: {
1783
+ readonly default: "default";
1784
+ readonly destructive: "critical";
1785
+ };
1786
+ interface InlineNotificationProps extends Omit<React.ComponentProps<"div">, "title">, Omit<VariantProps<typeof notificationVariants>, "intent"> {
1787
+ intent?: NotificationIntent | keyof typeof shadcnIntents;
1788
+ /** Bold first line. `heading` is Swirl's name for the same thing. */
1789
+ title?: React.ReactNode;
1790
+ heading?: React.ReactNode;
1791
+ /** Keep the heading for screen readers but don't show it. */
1792
+ hideHeading?: boolean;
1793
+ /** Pass `null` to drop the icon entirely. */
1794
+ icon?: React.ReactNode | null;
1795
+ /** Show a dismiss button and call this when pressed. */
1796
+ onDismiss?: () => void;
1797
+ dismissLabel?: string;
1798
+ /** Trailing actions, e.g. a retry button. */
1799
+ action?: React.ReactNode;
1800
+ }
1801
+ /**
1802
+ * A persistent, in-flow message. shadcn calls this an Alert.
1803
+ *
1804
+ * Critical and warning messages render as `role="alert"` so they interrupt;
1805
+ * informational ones use `role="status"` and wait their turn.
1806
+ */
1807
+ declare function InlineNotification({ className, intent, variant, borderRadius, title, heading, hideHeading, icon, onDismiss, dismissLabel, action, children, ...props }: InlineNotificationProps): React$1.JSX.Element;
1808
+ /** shadcn-compatible aliases. */
1809
+ declare const Alert: typeof InlineNotification;
1810
+ type AlertProps = InlineNotificationProps;
1811
+ declare function AlertTitle({ className, ...props }: React.ComponentProps<"p">): React$1.JSX.Element;
1812
+ declare function AlertDescription({ className, ...props }: React.ComponentProps<"div">): React$1.JSX.Element;
1813
+
1814
+ declare const dotColors: {
1815
+ readonly critical: "bg-critical";
1816
+ readonly info: "bg-info";
1817
+ readonly success: "bg-success";
1818
+ readonly warning: "bg-warning";
1819
+ };
1820
+ interface StatusIndicatorProps extends Omit<React.ComponentProps<"div">, "children"> {
1821
+ /** The status, such as "Active" or "Offline". */
1822
+ label: React.ReactNode;
1823
+ intent: keyof typeof dotColors;
1824
+ }
1825
+ /**
1826
+ * Swirl's status indicator: a coloured dot and a short label, such as a
1827
+ * person's or a system's state in a table cell. The label truncates rather
1828
+ * than wrapping. The colour only reinforces the label, so the label must
1829
+ * say the status on its own.
1830
+ */
1831
+ declare function StatusIndicator({ className, label, intent, ...props }: StatusIndicatorProps): React$1.JSX.Element;
1832
+
1833
+ declare const statusColors: {
1834
+ readonly critical: "text-critical";
1835
+ readonly info: "text-info";
1836
+ readonly neutral: "text-subdued";
1837
+ readonly success: "text-success";
1838
+ readonly warning: "text-warning";
1839
+ };
1840
+ interface InlineStatusProps extends Omit<React.ComponentProps<"span">, "children"> {
1841
+ /** The status text. Interchangeable with `children`. */
1842
+ message?: React.ReactNode;
1843
+ children?: React.ReactNode;
1844
+ /** Leading icon, such as one from `@enablo/swirlcn-icons`. */
1845
+ icon?: React.ReactNode;
1846
+ /** Colours the text and icon. Without one, the text is the default colour. */
1847
+ intent?: keyof typeof statusColors;
1848
+ size?: "m" | "s";
1849
+ }
1850
+ /** A short status message with an optional icon, such as "Saved" or "Syncing". */
1851
+ declare function InlineStatus({ className, message, children, icon, intent, size, ...props }: InlineStatusProps): React$1.JSX.Element;
1852
+ interface InlineErrorProps extends Omit<React.ComponentProps<"span">, "children"> {
1853
+ /** The error text. Line breaks in it are kept. Interchangeable with `children`. */
1854
+ message?: React.ReactNode;
1855
+ children?: React.ReactNode;
1856
+ size?: "m" | "s";
1857
+ }
1858
+ /** An error message beside a control, with Swirl's error icon. */
1859
+ declare function InlineError({ className, message, children, size, ...props }: InlineErrorProps): React$1.JSX.Element;
1860
+
1861
+ declare const bannerVariants: (props?: ({
1862
+ intent?: "critical" | "success" | "warning" | "info" | "neutral" | null | undefined;
1863
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
1864
+ interface BannerProps extends React.ComponentProps<"div">, VariantProps<typeof bannerVariants> {
1865
+ /** Leading icon. Hidden below 375px, as in Swirl. */
1866
+ icon?: React.ReactNode;
1867
+ /** Swirl's action: a text button with this label, calling `onAction`. */
1868
+ actionLabel?: string;
1869
+ onAction?: () => void;
1870
+ /** A custom action element, in place of `actionLabel`. */
1871
+ action?: React.ReactNode;
1872
+ /** Shows a dismiss button that calls this. */
1873
+ onDismiss?: () => void;
1874
+ dismissLabel?: string;
1875
+ }
1876
+ /**
1877
+ * A full-width, filled message pinned to the top of a region.
1878
+ *
1879
+ * Use this for system-wide state (maintenance, connectivity); use
1880
+ * `InlineNotification` for a message about the content it sits beside.
1881
+ */
1882
+ declare function Banner({ className, intent, icon, actionLabel, onAction, action, onDismiss, dismissLabel, children, ...props }: BannerProps): React$1.JSX.Element;
1883
+
1884
+ declare const toastVariants: (props?: ({
1885
+ intent?: "default" | "critical" | "success" | "warning" | "info" | null | undefined;
1886
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
1887
+ type ToastIntent = NonNullable<VariantProps<typeof toastVariants>["intent"]>;
1888
+ interface ToastOptions {
1889
+ /** A bold first line. Swirl's toasts usually have only `description`. */
1890
+ title?: React$1.ReactNode;
1891
+ description?: React$1.ReactNode;
1892
+ /** Leading icon, 24px or 20px with the desktop layout. */
1893
+ icon?: React$1.ReactNode;
1894
+ /** Swirl has `default`, `critical` and `success`; `warning` and `info` are extras. */
1895
+ intent?: ToastIntent;
1896
+ /** Milliseconds before auto-dismiss. `Infinity` keeps it until dismissed. */
1897
+ duration?: number;
1898
+ /** A single action, rendered as a plain text button inside the toast. */
1899
+ action?: {
1900
+ label: string;
1901
+ onClick: () => void;
1902
+ };
1903
+ /** Put the action beside the text (`inline`) or under it (`bottom`). */
1904
+ actionPosition?: "inline" | "bottom";
1905
+ /** Text for the dismiss button in place of the close icon, such as "OK". */
1906
+ dismissLabel?: string;
1907
+ }
1908
+ interface ToastContextValue {
1909
+ toast: (options: ToastOptions) => number;
1910
+ dismiss: (id: number) => void;
1911
+ /** Dismiss every open toast. */
1912
+ clearAll: () => void;
1913
+ }
1914
+ /**
1915
+ * Imperative handle for showing toasts.
1916
+ *
1917
+ * Throws when used outside `ToastProvider` rather than silently doing nothing,
1918
+ * since a missing provider is always a wiring mistake.
1919
+ */
1920
+ declare function useToast(): ToastContextValue;
1921
+ interface ToastProviderProps {
1922
+ children: React$1.ReactNode;
1923
+ /** Default auto-dismiss delay, in milliseconds. */
1924
+ duration?: number;
1925
+ /** Where the stack is anchored. Swirl centres it at the bottom. */
1926
+ position?: "bottom-right" | "bottom-center" | "bottom-left" | "top-right" | "top-center";
1927
+ /** Accessible label for the toast region's hotkey hint. */
1928
+ label?: string;
1929
+ }
1930
+ /** Wrap the app once, then call `useToast().toast(...)` from anywhere below. */
1931
+ declare function ToastProvider({ children, duration, position, label, }: ToastProviderProps): React$1.JSX.Element;
1932
+
1933
+ interface EmptyStateProps extends React.ComponentProps<"div"> {
1934
+ /**
1935
+ * An image URL, as in Swirl, or any element such as an `Icon`. Capped at
1936
+ * 16rem wide.
1937
+ */
1938
+ illustration?: React.ReactNode;
1939
+ heading?: React.ReactNode;
1940
+ /** The heading's element. It is always drawn at level 4's size, as in Swirl. */
1941
+ headingLevel?: HeadingLevel;
1942
+ /** The message under the heading. Interchangeable with `children`. */
1943
+ description?: React.ReactNode;
1944
+ /** Buttons under the message, such as a `ButtonGroup`. */
1945
+ action?: React.ReactNode;
1946
+ }
1947
+ /**
1948
+ * Swirl's empty state: the placeholder shown when a list, search or view has
1949
+ * nothing to display. A centred column up to 28rem wide; place it where it
1950
+ * should sit, for example inside a centred container.
1951
+ */
1952
+ declare function EmptyState({ className, illustration, heading, headingLevel, description, action, children, ...props }: EmptyStateProps): React$1.JSX.Element;
1953
+
1954
+ interface TableProps extends React$1.ComponentProps<"table"> {
1955
+ /** Describes the table's contents to screen readers. Hidden on screen, as in Swirl. */
1956
+ caption?: React$1.ReactNode;
1957
+ /** Keep the header visible while the body scrolls. */
1958
+ stickyHeader?: boolean;
1959
+ /** Wrapper class for the scroll container. */
1960
+ wrapperClassName?: string;
1961
+ }
1962
+ /**
1963
+ * Swirl's table: at least as wide as its container, and wider when its
1964
+ * columns need it, inside its own scroll container so a wide table never
1965
+ * scrolls the page sideways. Columns marked `sticky` stay pinned while it
1966
+ * scrolls, with a shadow along the edge content passes under.
1967
+ */
1968
+ declare function Table({ className, wrapperClassName, caption, stickyHeader, children, ...props }: TableProps): React$1.JSX.Element;
1969
+ declare function TableHeader({ className, ...props }: React$1.ComponentProps<"thead">): React$1.JSX.Element;
1970
+ declare function TableBody(props: React$1.ComponentProps<"tbody">): React$1.JSX.Element;
1971
+ declare function TableFooter({ className, ...props }: React$1.ComponentProps<"tfoot">): React$1.JSX.Element;
1972
+ interface TableRowProps extends React$1.ComponentProps<"tr"> {
1973
+ /** Highlight the row, such as the current selection. Swirl's `highlighted`. */
1974
+ selected?: boolean;
1975
+ /** Add hover feedback for clickable rows. */
1976
+ interactive?: boolean;
1977
+ }
1978
+ /** A row. Its colour fills the cells, so pinned cells cover what scrolls under them. */
1979
+ declare function TableRow({ className, selected, interactive, ...props }: TableRowProps): React$1.JSX.Element;
1980
+ interface TableHeadProps extends Omit<React$1.ComponentProps<"th">, "align"> {
1981
+ align?: "start" | "center" | "end";
1982
+ /** Show a sort arrow slot, as Swirl's `sortable` columns do. */
1983
+ sortable?: boolean;
1984
+ /** The current sort: shows an arrow and sets `aria-sort`. */
1985
+ sorted?: "ascending" | "descending";
1986
+ /**
1987
+ * Pin the column while the table scrolls. Give later pinned columns a
1988
+ * `style={{ left }}` (or `right`) offset past the ones before them.
1989
+ */
1990
+ sticky?: "start" | "end";
1991
+ }
1992
+ /** A column header: 14px medium, subdued, on one line. */
1993
+ declare function TableHead({ className, align, sortable, sorted, sticky, children, ...props }: TableHeadProps): React$1.JSX.Element;
1994
+ interface TableCellProps extends Omit<React$1.ComponentProps<"td">, "align"> {
1995
+ align?: "start" | "center" | "end";
1996
+ /** Pin the cell while the table scrolls; match its column's `sticky`. */
1997
+ sticky?: "start" | "end";
1998
+ }
1999
+ declare function TableCell({ className, align, sticky, ...props }: TableCellProps): React$1.JSX.Element;
2000
+ interface TableEmptyProps extends React$1.ComponentProps<"td"> {
2001
+ /** How many columns the message spans. */
2002
+ colSpan: number;
2003
+ }
2004
+ /** Swirl's empty state: one row across every column, "No results found." unless you pass content. */
2005
+ declare function TableEmpty({ className, colSpan, children, ...props }: TableEmptyProps): React$1.JSX.Element;
2006
+
2007
+ interface DescriptionListProps extends React.ComponentProps<"div"> {
2008
+ }
2009
+ /**
2010
+ * Swirl's description list: term/description pairs, one per row.
2011
+ *
2012
+ * Built from ARIA roles (list, listitem, term, definition) rather than `<dl>`,
2013
+ * as Swirl is, because a row can also hold tools and extra content, which a
2014
+ * `<dl>` does not allow.
2015
+ */
2016
+ declare function DescriptionList({ className, ...props }: DescriptionListProps): React$1.JSX.Element;
2017
+ interface DescriptionListItemProps extends Omit<React.ComponentProps<"div">, "children"> {
2018
+ /** The term being described. */
2019
+ term: React.ReactNode;
2020
+ /** The description. */
2021
+ children?: React.ReactNode;
2022
+ /** Shown from an info icon after the term. */
2023
+ tooltip?: React.ReactNode;
2024
+ /** Draw a divider under the row and pad it. On by default, as in Swirl. */
2025
+ bordered?: boolean;
2026
+ /** Overrides the description's 40rem maximum width. */
2027
+ maxWidth?: React.CSSProperties["maxWidth"];
2028
+ /** Controls at the end of the row, such as a `Button`. */
2029
+ tools?: React.ReactNode;
2030
+ /** Full-width content under the row, such as an `InlineNotification`. */
2031
+ additionalContent?: React.ReactNode;
2032
+ }
2033
+ declare function DescriptionListItem({ className, term, children, tooltip, bordered, maxWidth, tools, additionalContent, ...props }: DescriptionListItemProps): React$1.JSX.Element;
2034
+
2035
+ interface DataCellProps extends Omit<React$1.ComponentProps<"div">, "content"> {
2036
+ label?: React$1.ReactNode;
2037
+ value?: React$1.ReactNode;
2038
+ /** An info icon after the label, with this tooltip. */
2039
+ tooltip?: React$1.ReactNode;
2040
+ /** Before the label, such as a small avatar. */
2041
+ media?: React$1.ReactNode;
2042
+ /** After the value, such as a tag or buttons. */
2043
+ suffix?: React$1.ReactNode;
2044
+ /** A control in place of the value, such as an input. */
2045
+ content?: React$1.ReactNode;
2046
+ intent?: "default" | "subdued" | "info" | "critical" | "warning" | "success" | "special" | "translucent";
2047
+ size?: "s" | "m";
2048
+ /** Stack the label over the value at every width, not only on phones. */
2049
+ vertical?: boolean;
2050
+ /** Makes the cell a button. */
2051
+ interactive?: boolean;
2052
+ /** Makes the cell a link. */
2053
+ href?: string;
2054
+ linkTarget?: string;
2055
+ onClick?: React$1.MouseEventHandler<HTMLElement>;
2056
+ }
2057
+ /**
2058
+ * Swirl's data cell: a label and its value on one tinted row, which stacks
2059
+ * on phones. Group cells in a `DataCellStack`.
2060
+ *
2061
+ * <DataCell label="Email" value="ada@example.com" />
2062
+ */
2063
+ declare function DataCell({ label, value, tooltip, media, suffix, content, intent, size, vertical, interactive, href, linkTarget, onClick, className, ...props }: DataCellProps): React$1.JSX.Element;
2064
+ interface DataCellStackProps extends React$1.ComponentProps<"div"> {
2065
+ label?: React$1.ReactNode;
2066
+ hideLabel?: boolean;
2067
+ description?: React$1.ReactNode;
2068
+ /** Actions in the header, such as Edit. */
2069
+ cta?: React$1.ReactNode;
2070
+ }
2071
+ /**
2072
+ * Swirl's data cell stack: `DataCell`s under a heading, joined into one
2073
+ * block with large outer corners and small inner ones.
2074
+ */
2075
+ declare function DataCellStack({ label, hideLabel, description, cta, className, children, ...props }: DataCellStackProps): React$1.JSX.Element;
2076
+
2077
+ interface FileChipProps extends Omit<React$1.ComponentProps<"span">, "onClick"> {
2078
+ /** The file's name. */
2079
+ name: string;
2080
+ /** Its MIME type, which picks the icon and colour. */
2081
+ type: string;
2082
+ /** Where to download it from. */
2083
+ url?: string;
2084
+ /** Such as the file's size. */
2085
+ description?: React$1.ReactNode;
2086
+ loading?: boolean;
2087
+ hasError?: boolean;
2088
+ showPreviewButton?: boolean;
2089
+ showDownloadButton?: boolean;
2090
+ showDeleteButton?: boolean;
2091
+ /** Only call `onDownload`; don't download `url` too. */
2092
+ skipNativeDownload?: boolean;
2093
+ onPreview?: () => void;
2094
+ onDownload?: () => void;
2095
+ onDelete?: () => void;
2096
+ previewButtonLabel?: string;
2097
+ downloadButtonLabel?: string;
2098
+ deleteButtonLabel?: string;
2099
+ errorLabel?: string;
2100
+ loadingLabel?: string;
2101
+ }
2102
+ /**
2103
+ * Swirl's file chip: an attached file, with an icon coloured by its type,
2104
+ * its name and size, and preview, download and delete buttons. On devices
2105
+ * that can hover, the buttons replace the size on hover or focus, and a
2106
+ * click anywhere previews or downloads the file.
2107
+ */
2108
+ declare function FileChip({ name, type, url, description, loading, hasError, showPreviewButton, showDownloadButton, showDeleteButton, skipNativeDownload, onPreview, onDownload, onDelete, previewButtonLabel, downloadButtonLabel, deleteButtonLabel, errorLabel, loadingLabel, className, ...props }: FileChipProps): React$1.JSX.Element;
2109
+
2110
+ declare const sizes: {
2111
+ s: {
2112
+ box: string;
2113
+ compact: boolean;
2114
+ };
2115
+ m: {
2116
+ box: string;
2117
+ compact: boolean;
2118
+ };
2119
+ l: {
2120
+ box: string;
2121
+ compact: boolean;
2122
+ };
2123
+ xl: {
2124
+ box: string;
2125
+ compact: boolean;
2126
+ };
2127
+ "2xl": {
2128
+ box: string;
2129
+ compact: boolean;
2130
+ };
2131
+ };
2132
+ declare const formats: {
2133
+ landscape: string;
2134
+ portrait: string;
2135
+ square: string;
2136
+ };
2137
+ interface ThumbnailProps extends Omit<React$1.ComponentProps<"span">, "onClick"> {
2138
+ src: string;
2139
+ alt: string;
2140
+ size?: keyof typeof sizes;
2141
+ format?: keyof typeof formats;
2142
+ /** Makes the image a button; it calls `onClick`. */
2143
+ interactive?: boolean;
2144
+ onClick?: () => void;
2145
+ /** Upload progress, 0 to 100. Shows a bar, or a ring on small sizes. */
2146
+ progress?: number;
2147
+ progressLabel?: string;
2148
+ /** Show an error over the image. */
2149
+ error?: boolean;
2150
+ /** Text in the bottom corner, such as a video's length. Hidden at size `s`. */
2151
+ timestamp?: React$1.ReactNode;
2152
+ showEditButton?: boolean;
2153
+ showRemoveButton?: boolean;
2154
+ onEdit?: () => void;
2155
+ onRemove?: () => void;
2156
+ editButtonIcon?: React$1.ReactNode;
2157
+ editButtonLabel?: string;
2158
+ removeButtonIcon?: React$1.ReactNode;
2159
+ removeButtonLabel?: string;
2160
+ openButtonIcon?: React$1.ReactNode;
2161
+ openButtonLabel?: string;
2162
+ menuButtonLabel?: string;
2163
+ /** The cursor over an interactive image. */
2164
+ cursor?: React$1.CSSProperties["cursor"];
2165
+ }
2166
+ /**
2167
+ * Swirl's thumbnail: a small image with optional upload progress, an error,
2168
+ * a timestamp, and edit and remove actions. With a mouse the actions appear
2169
+ * on hover; on touch screens tapping the image opens them in a menu.
2170
+ */
2171
+ declare function Thumbnail({ src, alt, size, format, interactive, onClick, progress, progressLabel, error, timestamp, showEditButton, showRemoveButton, onEdit, onRemove, editButtonIcon, editButtonLabel, removeButtonIcon, removeButtonLabel, openButtonIcon, openButtonLabel, menuButtonLabel, cursor, className, ...props }: ThumbnailProps): React$1.JSX.Element;
2172
+
2173
+ declare const radii: {
2174
+ xs: string;
2175
+ sm: string;
2176
+ base: string;
2177
+ l: string;
2178
+ xl: string;
2179
+ };
2180
+ interface ImageGridProps extends React$1.ComponentProps<"div"> {
2181
+ /** Accessible name of the grid. */
2182
+ label?: string;
2183
+ /** Defaults to one that suits the number of images. */
2184
+ aspectRatio?: string;
2185
+ borderRadius?: keyof typeof radii | (string & {});
2186
+ }
2187
+ /**
2188
+ * Swirl's image grid: one to four `ImageGridItem`s laid out to fill a box.
2189
+ * With more than four, the fourth shows "+N" for the rest.
2190
+ */
2191
+ declare function ImageGrid({ label, aspectRatio, borderRadius, className, style, children, ...props }: ImageGridProps): React$1.JSX.Element;
2192
+ interface ImageGridItemProps extends Omit<React$1.ComponentProps<"div">, "onError" | "onLoad"> {
2193
+ src: string;
2194
+ alt: string;
2195
+ /** `intersecting` loads the image only while it's on screen, as Swirl does. */
2196
+ loading?: "lazy" | "eager" | "intersecting";
2197
+ /** Makes the image a button. */
2198
+ interactive?: boolean;
2199
+ onClick?: React$1.MouseEventHandler<HTMLElement>;
2200
+ /** An icon in a dark circle over the middle, such as a play button. */
2201
+ icon?: React$1.ReactNode;
2202
+ /** Text over the image, such as "+3". The grid sets it on the fourth image when there are more. */
2203
+ overlay?: string;
2204
+ /** A small image in the top corner, such as a watermark. */
2205
+ watermark?: React$1.ReactNode;
2206
+ /** Show a button that pauses and resumes a GIF. */
2207
+ showGifControls?: boolean;
2208
+ gifPauseLabel?: string;
2209
+ gifPlayLabel?: string;
2210
+ onImageLoad?: () => void;
2211
+ onImageError?: () => void;
2212
+ }
2213
+ /** One image in an `ImageGrid`. Shown alone, it's letterboxed over a blurred copy of itself. */
2214
+ declare function ImageGridItem({ src, alt, loading, interactive, onClick, icon, overlay: overlayProp, watermark, showGifControls, gifPauseLabel, gifPlayLabel, onImageLoad, onImageError, className, ...props }: ImageGridItemProps): React$1.JSX.Element | null;
2215
+
2216
+ interface LightboxSlideProps {
2217
+ /** The file's URL. */
2218
+ file: string;
2219
+ /** Its MIME type: images and videos are shown; anything else gets a download button. */
2220
+ type: string;
2221
+ /** Describes an image, as its alt text. */
2222
+ description?: string;
2223
+ /** Shown for files that can't be previewed, and used when downloading. */
2224
+ fileName?: string;
2225
+ /** A small image in the top corner of an image, such as a watermark. */
2226
+ watermark?: React$1.ReactNode;
2227
+ downloadButtonLabel?: string;
2228
+ }
2229
+ /** One file in a `Lightbox`: an image, a video, or a download for anything else. */
2230
+ declare function LightboxSlide({ file, type, description, fileName, watermark, downloadButtonLabel, }: LightboxSlideProps): React$1.JSX.Element | null;
2231
+ interface LightboxProps {
2232
+ /** Accessible name of the lightbox. */
2233
+ label: string;
2234
+ open?: boolean;
2235
+ defaultOpen?: boolean;
2236
+ onOpenChange?: (open: boolean) => void;
2237
+ /** `LightboxSlide`s. */
2238
+ children: React$1.ReactNode;
2239
+ /** The slide shown when it opens. */
2240
+ defaultSlide?: number;
2241
+ onActiveSlideChange?: (index: number) => void;
2242
+ /** More buttons in the header, such as an `on-image` crop button. */
2243
+ toolbar?: React$1.ReactNode;
2244
+ /** Show a download button, and allow the browser's context menu. Defaults to true. */
2245
+ downloadButtonEnabled?: boolean;
2246
+ closeButtonLabel?: string;
2247
+ downloadButtonLabel?: string;
2248
+ nextSlideButtonLabel?: string;
2249
+ previousSlideButtonLabel?: string;
2250
+ }
2251
+ /**
2252
+ * Swirl's lightbox: files shown full screen, one at a time. Swipe, the
2253
+ * arrow keys or the side buttons move between them; Escape, the close
2254
+ * button or a click beside the file closes it.
2255
+ *
2256
+ * <Lightbox label="Photos" open={open} onOpenChange={setOpen}>
2257
+ * <LightboxSlide file="/a.jpg" type="image/jpeg" description="A dog" />
2258
+ * </Lightbox>
2259
+ */
2260
+ declare function Lightbox({ label, open, defaultOpen, onOpenChange, children, defaultSlide, onActiveSlideChange, toolbar, downloadButtonEnabled, closeButtonLabel, downloadButtonLabel, nextSlideButtonLabel, previousSlideButtonLabel, }: LightboxProps): React$1.JSX.Element;
2261
+
2262
+ interface CarouselHandle {
2263
+ /** Scrolls the slide with this `id` into view. */
2264
+ scrollToSlide: (id: string) => void;
2265
+ }
2266
+ interface CarouselProps extends Omit<React$1.ComponentProps<"div">, "ref"> {
2267
+ /** Accessible name of the carousel. */
2268
+ label?: string;
2269
+ /** Fade the edges where more slides are hidden. */
2270
+ fade?: boolean;
2271
+ /** What the edges fade to: the page, or an overlay such as a dialog. */
2272
+ fadeColor?: "default" | "on-surface-overlay";
2273
+ /** Go from the last slide back to the first, and the other way. */
2274
+ loopAround?: boolean;
2275
+ /** Pixels between slides. Defaults to 16. */
2276
+ spacing?: number | string;
2277
+ /** Defaults to 16. */
2278
+ padding?: SwirlSpacing;
2279
+ paddingBlockStart?: SwirlSpacing;
2280
+ paddingBlockEnd?: SwirlSpacing;
2281
+ paddingInlineStart?: SwirlSpacing;
2282
+ paddingInlineEnd?: SwirlSpacing;
2283
+ /** Called with the ids of the slides fully in view. */
2284
+ onActiveSlidesChange?: (ids: string[]) => void;
2285
+ nextSlideButtonLabel?: string;
2286
+ previousSlideButtonLabel?: string;
2287
+ ref?: React$1.Ref<CarouselHandle>;
2288
+ }
2289
+ /**
2290
+ * Swirl's carousel: a row of `CarouselSlide`s that scrolls sideways and
2291
+ * snaps to each slide, with buttons to page through on devices that can
2292
+ * hover.
2293
+ */
2294
+ declare function Carousel({ label, fade, fadeColor, loopAround, spacing, padding, paddingBlockStart, paddingBlockEnd, paddingInlineStart, paddingInlineEnd, onActiveSlidesChange, nextSlideButtonLabel, previousSlideButtonLabel, ref, className, style, children, ...props }: CarouselProps): React$1.JSX.Element;
2295
+ interface CarouselSlideProps extends React$1.ComponentProps<"div"> {
2296
+ /** Accessible name of the slide. */
2297
+ label?: string;
2298
+ /** Defaults to 15.5rem. */
2299
+ width?: string;
2300
+ minHeight?: string;
2301
+ aspectRatio?: string;
2302
+ }
2303
+ /** One slide in a `Carousel`. Its content fills it. */
2304
+ declare function CarouselSlide({ label, width, minHeight, aspectRatio, className, style, ...props }: CarouselSlideProps): React$1.JSX.Element;
2305
+
2306
+ interface ResourceListItemDrop {
2307
+ value: string;
2308
+ oldIndex: number;
2309
+ newIndex: number;
2310
+ }
2311
+ interface ResourceListProps extends React$1.ComponentProps<"div"> {
2312
+ /** Accessible name of the list. */
2313
+ label?: string;
2314
+ /**
2315
+ * `grid` (default) makes the list one tab stop, with the arrow keys, Home
2316
+ * and End moving between items, as Swirl's does. `list` is a plain list in
2317
+ * which every item is its own tab stop.
2318
+ */
2319
+ semantics?: "grid" | "list";
2320
+ /** Space between items. */
2321
+ spacing?: SwirlSpacing;
2322
+ padding?: SwirlSpacing;
2323
+ paddingBlockStart?: SwirlSpacing;
2324
+ paddingBlockEnd?: SwirlSpacing;
2325
+ /** Defaults to 8. */
2326
+ paddingInlineStart?: SwirlSpacing;
2327
+ /** Defaults to 8. */
2328
+ paddingInlineEnd?: SwirlSpacing;
2329
+ /**
2330
+ * Show a drag handle on each item, to reorder by pointer or keyboard
2331
+ * (Space to grab, arrows to move, Space to drop, Escape to cancel). Items
2332
+ * need a `value`. The list doesn't reorder its children: apply
2333
+ * `onItemDrop` to your data.
2334
+ */
2335
+ allowDrag?: boolean;
2336
+ onItemDrop?: (drop: ResourceListItemDrop) => void;
2337
+ assistiveTextItemGrabbed?: string;
2338
+ assistiveTextItemMoving?: string;
2339
+ assistiveTextItemMoved?: string;
2340
+ }
2341
+ /**
2342
+ * Swirl's resource list: rows for people, files and other things, each with
2343
+ * media, a label, a description, meta text, badges and a control.
2344
+ *
2345
+ * <ResourceList label="Members">
2346
+ * <ResourceListItem label="Ada Lovelace" description="Admin"
2347
+ * media={<Avatar label="Ada Lovelace" size="l" />} />
2348
+ * </ResourceList>
2349
+ */
2350
+ declare function ResourceList({ label, semantics, spacing, padding, paddingBlockStart, paddingBlockEnd, paddingInlineStart, paddingInlineEnd, allowDrag, onItemDrop, assistiveTextItemGrabbed, assistiveTextItemMoving, assistiveTextItemMoved, className, style, onKeyDown, onFocus, children, ...props }: ResourceListProps): React$1.JSX.Element;
2351
+ interface ResourceListItemProps extends Omit<React$1.ComponentProps<"div">, "children" | "onChange"> {
2352
+ label: React$1.ReactNode;
2353
+ description?: React$1.ReactNode;
2354
+ /** Shown before the label, such as an avatar or a thumbnail. */
2355
+ media?: React$1.ReactNode;
2356
+ /** Short text on the right, such as a date. */
2357
+ meta?: React$1.ReactNode;
2358
+ /** Badges on the right, under `meta`. */
2359
+ badges?: React$1.ReactNode;
2360
+ /**
2361
+ * A control on the right, such as a menu button. With `meta` or `badges`
2362
+ * it shows on hover or focus, on devices that can hover.
2363
+ */
2364
+ control?: React$1.ReactNode;
2365
+ /** Makes the row a link. */
2366
+ href?: string;
2367
+ target?: string;
2368
+ rel?: string;
2369
+ onClick?: React$1.MouseEventHandler<HTMLElement>;
2370
+ /** Whether the row is a button or link. Defaults to true. */
2371
+ interactive?: boolean;
2372
+ /** Show a checkbox and make the row toggle it. */
2373
+ selectable?: boolean;
2374
+ checked?: boolean;
2375
+ onCheckedChange?: (checked: boolean) => void;
2376
+ disabled?: boolean;
2377
+ /** Highlight the row, as for the current page. */
2378
+ active?: boolean;
2379
+ compact?: boolean;
2380
+ labelWeight?: "medium" | "semibold" | "bold";
2381
+ /** Let the label wrap instead of truncating; `labelWrapMaxLines` clamps it. */
2382
+ labelWrap?: boolean;
2383
+ labelWrapMaxLines?: number;
2384
+ descriptionWrap?: boolean;
2385
+ alignItems?: React$1.CSSProperties["alignItems"];
2386
+ /** Identifies the item, for dragging. */
2387
+ value?: string;
2388
+ /** Accessible name, when the label alone isn't enough. */
2389
+ "aria-label"?: string;
2390
+ "aria-current"?: React$1.AriaAttributes["aria-current"];
2391
+ dragHandleLabel?: string;
2392
+ dragHandleDescription?: string;
2393
+ }
2394
+ /** A row in a `ResourceList`. */
2395
+ declare function ResourceListItem({ label, description, media, meta, badges, control, href, target, rel, onClick, interactive, selectable, checked, onCheckedChange, disabled, active, compact, labelWeight, labelWrap, labelWrapMaxLines, descriptionWrap, alignItems, value: valueProp, "aria-label": ariaLabel, "aria-current": ariaCurrent, dragHandleLabel, dragHandleDescription, className, style, ...props }: ResourceListItemProps): React$1.JSX.Element;
2396
+ interface ResourceListSectionProps extends React$1.ComponentProps<"div"> {
2397
+ label: React$1.ReactNode;
2398
+ /** Draw a rule above the section. */
2399
+ hasSeparator?: boolean;
2400
+ separatorSpacing?: React$1.ComponentProps<typeof Separator>["spacing"];
2401
+ /** Space between the section's items. */
2402
+ spacing?: SwirlSpacing;
2403
+ }
2404
+ /** A labelled group of items in a `ResourceList`. */
2405
+ declare function ResourceListSection({ label, hasSeparator, separatorSpacing, spacing, className, children, ...props }: ResourceListSectionProps): React$1.JSX.Element;
2406
+ interface ResourceListFileItemProps extends React$1.ComponentProps<"div"> {
2407
+ label: React$1.ReactNode;
2408
+ /** Such as the file's size. Hidden while there's an error. */
2409
+ description?: React$1.ReactNode;
2410
+ errorMessage?: React$1.ReactNode;
2411
+ /** Defaults to a file icon. */
2412
+ icon?: React$1.ReactNode;
2413
+ /** Show a spinner, as while uploading. */
2414
+ loading?: boolean;
2415
+ /** Show a button that removes the file; it calls `onRemove`. */
2416
+ removable?: boolean;
2417
+ onRemove?: () => void;
2418
+ removeButtonLabel?: string;
2419
+ }
2420
+ /** A file in a `ResourceList`, such as an upload, with an error, a spinner or a remove button. */
2421
+ declare function ResourceListFileItem({ label, description, errorMessage, icon, loading, removable, onRemove, removeButtonLabel, className, ...props }: ResourceListFileItemProps): React$1.JSX.Element;
2422
+
2423
+ type Theme = "light" | "dark" | "system";
2424
+ interface ThemeContextValue {
2425
+ /** What the user chose. */
2426
+ theme: Theme;
2427
+ /** What is actually rendered right now - `system` resolved against the OS. */
2428
+ resolvedTheme: "light" | "dark";
2429
+ /**
2430
+ * Switch the theme. Pass `{ persist: false }` to apply it without saving it
2431
+ * as the user's choice, as `FlipThemeSync` does for a theme Flip decides.
2432
+ */
2433
+ setTheme: (theme: Theme, options?: {
2434
+ persist?: boolean;
2435
+ }) => void;
2436
+ }
2437
+ /** The surrounding `ThemeProvider`'s value, or `null` outside one. */
2438
+ declare function useOptionalTheme(): ThemeContextValue | null;
2439
+
2440
+ declare function useTheme(): ThemeContextValue;
2441
+ interface ThemeProviderProps {
2442
+ children: React$1.ReactNode;
2443
+ /** Initial theme when nothing is stored. */
2444
+ defaultTheme?: Theme;
2445
+ /** localStorage key. Pass `null` to skip persistence entirely. */
2446
+ storageKey?: string | null;
2447
+ /** Element the theme class is applied to. Defaults to `<html>`. */
2448
+ target?: () => HTMLElement;
2449
+ }
2450
+ /**
2451
+ * Applies Swirl's `theme-light` / `theme-dark` class to the document root.
2452
+ *
2453
+ * With `theme="system"` neither class is set, which is what lets the generated
2454
+ * token stylesheet fall through to its `prefers-color-scheme` block - so the OS
2455
+ * is followed with no JavaScript involved in the common case.
2456
+ */
2457
+ declare function ThemeProvider({ children, defaultTheme, storageKey, target, }: ThemeProviderProps): React$1.JSX.Element;
2458
+
2459
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, type AccordionTriggerProps, ActionList, ActionListItem, type ActionListItemProps, type ActionListProps, ActionListSection, type ActionListSectionProps, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, type AlertDialogContentProps, AlertDialogDescription, AlertDialogFooter, type AlertDialogFooterProps, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, type AlertProps, AlertTitle, Autocomplete, type AutocompleteProps, type AutocompleteSuggestion, Avatar, type AvatarColor, AvatarGroup, type AvatarGroupProps, type AvatarProps, type AvatarSize, Badge, type BadgeIntent, type BadgeProps, Banner, type BannerProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonIntent, type ButtonProps, type ButtonSize, type ButtonVariant, Card, CardContent, CardDescription, CardFooter, CardHeader, type CardProps, CardTitle, Carousel, type CarouselHandle, type CarouselProps, CarouselSlide, type CarouselSlideProps, Checkbox, type CheckboxProps, Chip, type ChipProps, ColorInput, type ColorInputProps, DataCell, type DataCellProps, DataCellStack, type DataCellStackProps, DateInput, type DateInputProps, DatePicker, type DatePickerLabels, type DatePickerProps, DescriptionList, DescriptionListItem, type DescriptionListItemProps, type DescriptionListProps, Dialog, DialogBody, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, EmptyState, type EmptyStateProps, type FieldContextValue, type FieldFontSize, type FieldLabelPosition, FileChip, type FileChipProps, FileUploader, type FileUploaderHandle, type FileUploaderProps, FormControl, type FormControlField, type FormControlProps, FormGroup, type FormGroupProps, Heading, type HeadingLevel, type HeadingProps, Icon, type IconProps, ImageGrid, ImageGridItem, type ImageGridItemProps, type ImageGridProps, InlineError, type InlineErrorProps, InlineNotification, type InlineNotificationProps, InlineStatus, type InlineStatusProps, Input, type InputProps, Label, type LabelProps, Lightbox, type LightboxProps, LightboxSlide, type LightboxSlideProps, Link, type LinkProps, List, type ListProps, Menu, MenuItem, type MenuItemProps, type MenuPlacement, type MenuProps, type MultiAutocompleteProps, type MultiSelectProps, type NotificationIntent, OptionList, OptionListItem, type OptionListItemDrop, type OptionListItemProps, type OptionListProps, OptionListSection, type OptionListSectionProps, Pagination, type PaginationProps, Popover, PopoverAnchor, PopoverClose, PopoverContent, type PopoverContentProps, type PopoverProps, PopoverTrigger, Progress, type ProgressIntent, type ProgressProps, type ProgressSize, Radio, RadioGroup, type RadioGroupProps, type RadioProps, type RangeDatePickerProps, ResourceList, ResourceListFileItem, type ResourceListFileItemProps, ResourceListItem, type ResourceListItemDrop, type ResourceListItemProps, type ResourceListProps, ResourceListSection, type ResourceListSectionProps, Search, type SearchProps, Select, SelectOption, type SelectOptionProps, type SelectProps, SelectSection, type SelectSectionProps, Separator, type SeparatorProps, type SeparatorSpacing, type ShadcnButtonSize, type ShadcnButtonVariant, type SingleAutocompleteProps, type SingleDatePickerProps, type SingleSelectProps, SkeletonBox, type SkeletonBoxProps, SkeletonText, type SkeletonTextProps, type SkeletonTextSize, Spinner, type SpinnerProps, Stack, type StackOrientation, type StackProps, StatusIndicator, type StatusIndicatorProps, SwirlSpacing, Switch, type SwitchProps, Table, TableBody, TableCell, type TableCellProps, TableEmpty, type TableEmptyProps, TableFooter, TableHead, type TableHeadProps, TableHeader, type TableProps, TableRow, type TableRowProps, Tabs, TabsContent, TabsList, type TabsListProps, TabsTrigger, Tag, type TagProps, Text, type TextColor, type TextProps, type TextSize, type TextWeight, Textarea, type TextareaProps, type Theme, ThemeProvider, type ThemeProviderProps, Thumbnail, type ThumbnailProps, TimeInput, type TimeInputProps, type ToastIntent, type ToastOptions, ToastProvider, type ToastProviderProps, ToggleGroup, ToggleGroupItem, type ToggleGroupItemProps, type ToggleGroupProps, Toolbar, type ToolbarProps, Tooltip, TooltipContent, type TooltipProps, TooltipProvider, TooltipRoot, TooltipTrigger, TreeNavigation, TreeNavigationItem, type TreeNavigationItemProps, type TreeNavigationProps, TreeView, TreeViewItem, type TreeViewItemProps, type TreeViewProps, avatarColorFor, badgeVariants, bannerVariants, buttonVariants, cardVariants, contentVariants as dialogContentVariants, initialsFor, inputVariants, notificationVariants, tagVariants, textVariants, toastVariants, useField, useOptionalTheme, useTheme, useToast };