twico-ui 1.5.0 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1,5 +1,141 @@
1
1
  import * as React from 'react';
2
2
 
3
+ interface TwicoProviderProps {
4
+ /** CSP nonce stamped on every injected `<style>` (for `style-src 'nonce-…'` without `unsafe-inline`). */
5
+ nonce?: string;
6
+ children?: React.ReactNode;
7
+ }
8
+
9
+ declare function TwicoProvider(props: TwicoProviderProps): React.JSX.Element;
10
+
11
+ /** A friendly, partial token surface. Each entry maps to a `--<group>-<key>` CSS variable. */
12
+ interface ThemeTokens {
13
+ /** `--color-*` (e.g. `{ primary: "#5b5bd6" }`). */
14
+ colors?: Record<string, string>;
15
+ /** `--space-*`. */
16
+ space?: Record<string, string>;
17
+ /** `--radius-*`. */
18
+ radius?: Record<string, string>;
19
+ /** `--font-*`. */
20
+ font?: Record<string, string>;
21
+ /** `--shadow-*`. */
22
+ shadow?: Record<string, string>;
23
+ /** Motion vars (e.g. `{ "ease-out": "…", "duration-base": "…" }`) — keyed by the full var suffix. */
24
+ motion?: Record<string, string>;
25
+ }
26
+
27
+ /** A CSS custom-property style object (`{ "--color-primary": "…" }`). */
28
+ type Theme = Record<`--${string}`, string>;
29
+
30
+ /** Map a partial token object onto a `--*` CSS-variable style object. */
31
+ declare function createTheme(partial: ThemeTokens): Theme;
32
+
33
+ interface ThemeProviderProps extends React.HTMLAttributes<HTMLDivElement> {
34
+ /** A `createTheme()` result, or a raw partial token object. */
35
+ theme?: Theme | ThemeTokens;
36
+ /** `"inline"` sets the vars inline (SSR-safe); `"stylesheet"` injects a scoped, nonce-aware rule. @default "inline" */
37
+ mode?: "inline" | "stylesheet";
38
+ }
39
+
40
+ declare function ThemeProvider(props: ThemeProviderProps): React.JSX.Element;
41
+
42
+ interface FormProps extends React.FormHTMLAttributes<HTMLFormElement> {
43
+ /** Submit handler — runs after `preventDefault()` (unless `preventDefault={false}`). */
44
+ onSubmit?: (e: React.FormEvent<HTMLFormElement>) => void;
45
+ /** Call `event.preventDefault()` before `onSubmit`. @default true */
46
+ preventDefault?: boolean;
47
+ /** Disable every control (via a `<fieldset disabled>`) and set `aria-busy`. @default false */
48
+ loading?: boolean;
49
+ /** Disable every control (via a `<fieldset disabled>`). @default false */
50
+ disabled?: boolean;
51
+ /** Vertical gap between children as a spacing-scale step (e.g. 4 → var(--space-4)). */
52
+ gap?: number;
53
+ }
54
+
55
+ declare const Form: React.ForwardRefExoticComponent<FormProps & React.RefAttributes<HTMLFormElement>>;
56
+
57
+ interface VisuallyHiddenProps extends React.HTMLAttributes<HTMLElement> {
58
+ /** Element to render. @default "span" */
59
+ as?: React.ElementType;
60
+ }
61
+
62
+ declare const VisuallyHidden: React.ForwardRefExoticComponent<
63
+ VisuallyHiddenProps & React.RefAttributes<HTMLElement>
64
+ >;
65
+
66
+ interface PortalProps {
67
+ children?: React.ReactNode;
68
+ }
69
+
70
+ declare function Portal(props: PortalProps): React.ReactPortal | React.ReactNode | null;
71
+
72
+ interface ColorSchemeScriptOptions {
73
+ /** localStorage key holding the theme (matches useColorScheme). @default "twico-theme" */
74
+ storageKey?: string;
75
+ /** How the scheme is applied: the `dark` class, or a `[data-…]` attribute value. @default "class" */
76
+ attribute?: string;
77
+ /** Scheme to use when nothing is stored (skips the prefers-color-scheme probe). */
78
+ defaultScheme?: "light" | "dark";
79
+ }
80
+
81
+ interface ColorSchemeScriptProps extends ColorSchemeScriptOptions {
82
+ /** CSP nonce for the inline `<script>`. */
83
+ nonce?: string;
84
+ }
85
+
86
+ /** The theme-init IIFE as a string, for consumers who inject the script themselves. */
87
+ declare function getColorSchemeScript(options?: ColorSchemeScriptOptions): string;
88
+
89
+ /** A `<script>` for the SSR `<head>` that applies the persisted color scheme before first paint. */
90
+ declare function ColorSchemeScript(props: ColorSchemeScriptProps): React.JSX.Element;
91
+
92
+ type KbdProps = React.HTMLAttributes<HTMLElement>;
93
+
94
+ declare const Kbd: React.ForwardRefExoticComponent<KbdProps & React.RefAttributes<HTMLElement>>;
95
+
96
+ type PreProps = React.HTMLAttributes<HTMLPreElement>;
97
+
98
+ declare const Pre: React.ForwardRefExoticComponent<PreProps & React.RefAttributes<HTMLPreElement>>;
99
+
100
+ interface AnchorProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
101
+ /** Element to render (e.g. a router Link). @default "a" */
102
+ as?: React.ElementType;
103
+ /** Open in a new tab with rel="noopener noreferrer" and a ↗ affix. @default false */
104
+ external?: boolean;
105
+ }
106
+
107
+ declare const Anchor: React.ForwardRefExoticComponent<AnchorProps & React.RefAttributes<HTMLAnchorElement>>;
108
+
109
+ interface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {
110
+ /** Id of the control this labels. */
111
+ htmlFor?: string;
112
+ /** Append a danger-colored asterisk. @default false */
113
+ required?: boolean;
114
+ /** @default "md" */
115
+ size?: "sm" | "md" | "lg";
116
+ }
117
+
118
+ declare const Label: React.ForwardRefExoticComponent<LabelProps & React.RefAttributes<HTMLLabelElement>>;
119
+
120
+ interface ImageProps extends Omit<React.ImgHTMLAttributes<HTMLImageElement>, "alt"> {
121
+ /** Image source URL. */
122
+ src?: string;
123
+ /** Alternative text (required for accessibility; pass "" for decorative images). */
124
+ alt: string;
125
+ /** object-fit value. */
126
+ fit?: "cover" | "contain" | "fill" | "none" | "scale-down";
127
+ /** Border radius token (e.g. "md", "lg", "full"). */
128
+ radius?: string;
129
+ /** CSS aspect-ratio (e.g. "16/9"). */
130
+ aspectRatio?: string;
131
+ /** Source swapped in if the image fails to load. */
132
+ fallback?: string;
133
+ /** @default "lazy" */
134
+ loading?: "lazy" | "eager";
135
+ }
136
+
137
+ declare const Image: React.ForwardRefExoticComponent<ImageProps & React.RefAttributes<HTMLImageElement>>;
138
+
3
139
  /**
4
140
  * Vertically stacked, expandable disclosure panels with smooth height animation.
5
141
  *
@@ -288,6 +424,8 @@ interface CardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title">
288
424
  title?: React.ReactNode;
289
425
  /** Muted subtitle under the title. */
290
426
  subtitle?: React.ReactNode;
427
+ /** Header actions rendered top-right, opposite the title/subtitle (e.g. a button or menu). */
428
+ actions?: React.ReactNode;
291
429
  /** Footer content (e.g. action buttons). */
292
430
  footer?: React.ReactNode;
293
431
  /** Visual style. @default "elevated" */
@@ -449,6 +587,8 @@ interface Option {
449
587
  label: string;
450
588
  /** Optional second line shown under the label. */
451
589
  description?: string;
590
+ /** Disable this option — not selectable, skipped by keyboard navigation. */
591
+ disabled?: boolean;
452
592
  }
453
593
 
454
594
  /** A labeled group of options (or bare string values). */
@@ -494,6 +634,16 @@ interface ComboboxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>
494
634
  portal?: boolean;
495
635
  /** Minimum popover width in px when portaled (useful when the control is narrow). @default 0 */
496
636
  minWidth?: number;
637
+ /** Called with the raw query on every keystroke — drive a debounced remote fetch (with `loading` + `filter={false}`). */
638
+ onInputChange?: (query: string) => void;
639
+ /** Client-side filtering: `false` shows options as-is (server-ranked); a function replaces the default label/description match. */
640
+ filter?: boolean | ((option: ComboboxOption, query: string) => boolean);
641
+ /** Show a loading row instead of the option list / empty state. @default false */
642
+ loading?: boolean;
643
+ /** Text shown when no options match. @default "No results found" */
644
+ emptyText?: string;
645
+ /** Name for a hidden form field so the selected value participates in native form submission. */
646
+ name?: string;
497
647
  /** Composed with the field's open-on-focus behavior — your handler runs first. */
498
648
  onFocus?: React.FocusEventHandler<HTMLInputElement>;
499
649
  /** Composed with the field's keyboard navigation (Arrows/Enter/Escape) — your handler runs first; call `event.preventDefault()` to suppress it. */
@@ -541,6 +691,8 @@ interface CommandPaletteProps extends React.HTMLAttributes<HTMLDivElement> {
541
691
  commands: Command[];
542
692
  placeholder?: string;
543
693
  emptyText?: string;
694
+ /** Accessible name for the search input. @default "Command palette search" */
695
+ searchLabel?: string;
544
696
  }
545
697
 
546
698
  declare function CommandPalette(props: CommandPaletteProps): React.JSX.Element | null;
@@ -702,6 +854,10 @@ interface DatatableProps<T = any> extends Omit<React.HTMLAttributes<HTMLDivEleme
702
854
  * rearrange only the movable, unpinned columns and leave pinned/actions columns in place.
703
855
  * @default false */
704
856
  disableColumnReorder?: boolean;
857
+ /** Message rendered when there are no rows (filter-aware default: "No rows match your filters" when a filter/quick-search is active, else "No rows"). */
858
+ emptyMessage?: React.ReactNode;
859
+ /** Render a custom empty state inside the table body (e.g. the shipped `<EmptyState/>`). Overrides `emptyMessage`. */
860
+ renderEmpty?: () => React.ReactNode;
705
861
  /** Disable column resizing. When enabled (the default off), drag a header's right edge to resize a
706
862
  * column, or **double-click** that edge to auto-fit the column to its widest visible content
707
863
  * (header + rendered cells), Excel-style. @default false */
@@ -825,6 +981,8 @@ interface DatatableColumn<T = any> {
825
981
  pinned?: "left" | "right";
826
982
  /** Allow drag-to-resize of this column. @default true */
827
983
  resizable?: boolean;
984
+ /** Allow drag / menu / keyboard reorder of this column (independent of the table-wide `disableColumnReorder`). @default true */
985
+ reorderable?: boolean;
828
986
  /** Summary-footer aggregation: a preset, or a function over the column's values. */
829
987
  aggregation?: "sum" | "avg" | "min" | "max" | "count" | ((values: any[], rows: T[]) => React.ReactNode);
830
988
  /** Format an aggregation result for the footer (falls back to valueFormatter). */
@@ -969,6 +1127,12 @@ interface DateRangePickerProps extends Omit<React.HTMLAttributes<HTMLDivElement>
969
1127
  locale?: string;
970
1128
  /** First day of week: 0 = Sunday … 6 = Saturday. @default 0 */
971
1129
  weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
1130
+ /** Earliest selectable date (inclusive); earlier days are disabled. */
1131
+ min?: Date;
1132
+ /** Latest selectable date (inclusive); later days are disabled. */
1133
+ max?: Date;
1134
+ /** Predicate to disable arbitrary dates (return true to disable). */
1135
+ disabledDate?: (date: Date) => boolean;
972
1136
  /** Disable all interaction (the popover cannot be opened). @default false */
973
1137
  disabled?: boolean;
974
1138
  /** Color intent for the focus/open accent. @default "primary" */
@@ -1068,15 +1232,16 @@ declare function EmptyState(props: EmptyStateProps): React.JSX.Element;
1068
1232
  /**
1069
1233
  * Shared form-field chrome (label, hint, error, required asterisk) that wraps ANY control.
1070
1234
  *
1071
- * `Field` is layout-only: it renders the label + your `children` + a single hint/error line,
1072
- * reusing the exact `.twc-field` markup Input/Select inline so every field looks identical.
1073
- * Wiring the control to the messages stays the consumer's job — point your control's
1074
- * `aria-describedby` at the exposed hint/error id (`` `${id}-desc` ``) and set `aria-invalid`
1075
- * when `error` is present. `error` replaces `hint` when both are given (error wins).
1235
+ * `Field` renders the label + your `children` + a single hint/error line, reusing the exact
1236
+ * `.twc-field` markup Input/Select inline so every field looks identical. When `children` is a
1237
+ * SINGLE element, Field auto-wires it: it sets `aria-describedby` (merged with any the child
1238
+ * already has) to the hint/error id (`` `${id}-desc` ``) and `aria-invalid` when `error` is
1239
+ * present (never clobbering a child's explicit `aria-invalid`). Multiple/fragment/string children
1240
+ * keep manual wiring. `error` replaces `hint` when both are given (error wins).
1076
1241
  *
1077
1242
  * @example
1078
1243
  * <Field label="Email" hint="We never share it." htmlFor="email" id="email-field">
1079
- * <input id="email" aria-describedby="email-field-desc" />
1244
+ * <input id="email" />
1080
1245
  * </Field>
1081
1246
  */
1082
1247
  interface FieldProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "id"> {
@@ -1129,6 +1294,12 @@ interface FileUploadProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "on
1129
1294
  value?: File[];
1130
1295
  /** Uncontrolled initial file list. @default [] */
1131
1296
  defaultValue?: File[];
1297
+ /** Max size per file in bytes; larger files are rejected (drag + browse). */
1298
+ maxSize?: number;
1299
+ /** Max number of files retained (multiple mode); extra files are rejected. */
1300
+ maxFiles?: number;
1301
+ /** Called with the files that failed validation: `{ file, reason }` where reason is "type" | "size" | "count". */
1302
+ onReject?: (rejections: Array<{ file: File; reason: "type" | "size" | "count" }>) => void;
1132
1303
  onChange?: (files: File[]) => void;
1133
1304
  }
1134
1305
 
@@ -1175,11 +1346,18 @@ interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "
1175
1346
  size?: "sm" | "md" | "lg";
1176
1347
  /** Color intent for the focus/open accent. @default "primary" */
1177
1348
  tone?: Tone;
1178
- /** Icon node inside the field, leading edge (prefix). */
1349
+ /** Icon-only node inside the field, leading edge — for a bordered text addon use `leftAddon`. */
1179
1350
  leftIcon?: React.ReactNode;
1180
1351
  /** Optional suffix icon/node inside the field, trailing edge. For `type="password"`, omitting this
1181
- * shows a built-in reveal/hide eye toggle; providing `rightIcon` replaces it. */
1352
+ * shows a built-in reveal/hide eye toggle; providing `rightIcon` replaces it. Icon-only — for a
1353
+ * bordered text addon use `rightAddon`. */
1182
1354
  rightIcon?: React.ReactNode;
1355
+ /** Bordered text addon flush against the leading edge (e.g. `https://`, `@`) — distinct from the inline `leftIcon`. */
1356
+ leftAddon?: React.ReactNode;
1357
+ /** Bordered text addon flush against the trailing edge (e.g. `.00`, `kg`, `%`). */
1358
+ rightAddon?: React.ReactNode;
1359
+ /** With `maxLength`, render a live `current / max` character counter on the hint/error line; danger-toned near the limit. @default false */
1360
+ showCount?: boolean;
1183
1361
  }
1184
1362
 
1185
1363
  declare function Input(props: InputProps): React.JSX.Element;
@@ -1248,7 +1426,7 @@ interface ListItemData {
1248
1426
  onClick?: (e: React.MouseEvent) => void;
1249
1427
  /** Makes the row a link. */
1250
1428
  href?: string;
1251
- /** Highlight as selected. */
1429
+ /** Highlight as selected — also sets `aria-current="page"` on link/button rows. */
1252
1430
  active?: boolean;
1253
1431
  }
1254
1432
 
@@ -1262,6 +1440,8 @@ interface ListProps extends React.HTMLAttributes<HTMLUListElement> {
1262
1440
  items: ListItemData[];
1263
1441
  /** Drop the card chrome (borderless, transparent). @default false */
1264
1442
  plain?: boolean;
1443
+ /** Shown as a centered zero-state row when `items` is empty. @default "Nothing here yet" */
1444
+ emptyMessage?: React.ReactNode;
1265
1445
  }
1266
1446
 
1267
1447
  declare function List(props: ListProps): React.JSX.Element;
@@ -1303,6 +1483,16 @@ interface MultiSelectProps extends Omit<React.InputHTMLAttributes<HTMLInputEleme
1303
1483
  portal?: boolean;
1304
1484
  /** Minimum popover width in px when portaled (useful when the control is narrow). @default 0 */
1305
1485
  minWidth?: number;
1486
+ /** Show a loading row instead of the option list / empty state. @default false */
1487
+ loading?: boolean;
1488
+ /** Text shown when no options match. @default "No results found" */
1489
+ emptyText?: string;
1490
+ /** Name for hidden form fields (one per selected value) for native form submission. */
1491
+ name?: string;
1492
+ /** Cap the number of selectable values; once reached, unselected options become disabled. */
1493
+ max?: number;
1494
+ /** Collapse chips after N into a "+K more" pill. */
1495
+ maxTagCount?: number;
1306
1496
  /** Composed with the field's open-on-focus behavior — your handler runs first. */
1307
1497
  onFocus?: React.FocusEventHandler<HTMLInputElement>;
1308
1498
  /** Composed with the field's keyboard navigation (Arrows/Enter/Escape/Backspace) — your handler runs first; call `event.preventDefault()` to suppress it. */
@@ -1381,6 +1571,8 @@ interface PaginationProps extends Omit<React.HTMLAttributes<HTMLElement>, "onCha
1381
1571
  showPageJumper?: boolean;
1382
1572
  /** Label before the jump input. @default "Go to" */
1383
1573
  jumperLabel?: React.ReactNode;
1574
+ /** Accessible label for each numbered page button (for i18n). @default (n) => `Page ${n}` */
1575
+ getPageLabel?: (page: number) => string;
1384
1576
  }
1385
1577
 
1386
1578
  declare function Pagination(props: PaginationProps): React.JSX.Element;
@@ -1456,15 +1648,68 @@ interface RadioProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "
1456
1648
 
1457
1649
  declare function Radio(props: RadioProps): React.JSX.Element;
1458
1650
 
1651
+ interface RadioGroupOption {
1652
+ /** Submitted value for this choice. */
1653
+ value: string;
1654
+ /** Visible label. */
1655
+ label?: React.ReactNode;
1656
+ /** Secondary text under the label. */
1657
+ description?: React.ReactNode;
1658
+ /** Disable just this option. */
1659
+ disabled?: boolean;
1660
+ }
1661
+
1662
+ /**
1663
+ * Grouped radios with one controlled value, a `role="radiogroup"` container, a hoisted
1664
+ * group label/hint/error, and a shared `name`. Provide choices via `options` or by passing
1665
+ * `<Radio>` children (their `name`/`checked`/`onChange` are injected). Native inputs give
1666
+ * roving tabindex + Arrow-key selection for free.
1667
+ *
1668
+ * @startingPoint section="Inputs" subtitle="Grouped radios with one value" viewport="700x220"
1669
+ */
1670
+ interface RadioGroupProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChange"> {
1671
+ /** Shared `name` for the radios (auto-generated when omitted). */
1672
+ name?: string;
1673
+ /** Controlled selected value. */
1674
+ value?: string;
1675
+ /** Uncontrolled initial value. */
1676
+ defaultValue?: string;
1677
+ /** Called with the newly-selected value. */
1678
+ onChange?: (value: string) => void;
1679
+ /** Choices (alternative to passing `<Radio>` children). */
1680
+ options?: RadioGroupOption[];
1681
+ /** `<Radio>` children (alternative to `options`); their group props are injected. */
1682
+ children?: React.ReactNode;
1683
+ /** Group label (rendered as the radiogroup's accessible name). */
1684
+ label?: React.ReactNode;
1685
+ /** Helper text below the group. */
1686
+ hint?: React.ReactNode;
1687
+ /** Error text below the group; sets `aria-invalid` and is announced once for the whole group. */
1688
+ error?: React.ReactNode;
1689
+ /** Lay the radios in a column or a wrapping row. @default "vertical" */
1690
+ orientation?: "vertical" | "horizontal";
1691
+ /** Disable every radio in the group. @default false */
1692
+ disabled?: boolean;
1693
+ /** Mark the group required (native `required` on the radios + `aria-required`). @default false */
1694
+ required?: boolean;
1695
+ /** Control size applied to each radio. @default "md" */
1696
+ size?: "sm" | "md" | "lg";
1697
+ /** Color intent applied to each radio. @default "primary" */
1698
+ tone?: Tone;
1699
+ }
1700
+
1701
+ declare function RadioGroup(props: RadioGroupProps): React.JSX.Element;
1702
+
1459
1703
  /**
1460
1704
  * Star rating — interactive (click/hover) or read-only display.
1461
1705
  *
1462
1706
  * @startingPoint section="Inputs" subtitle="Star rating" viewport="700x90"
1463
1707
  */
1464
1708
  interface RatingProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChange" | "defaultValue" | "color"> {
1465
- /** Controlled value (0…count). */
1709
+ /** Controlled value (0…count; 0 means "no rating"). A fractional value renders a partial
1710
+ * star fill (display) — interactive click/keyboard selection is integer-only. */
1466
1711
  value?: number;
1467
- /** Uncontrolled initial value. @default 0 */
1712
+ /** Uncontrolled initial value (0 means "no rating"). @default 0 */
1468
1713
  defaultValue?: number;
1469
1714
  /** Number of stars. @default 5 */
1470
1715
  count?: number;
@@ -1474,12 +1719,19 @@ interface RatingProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChan
1474
1719
  tone?: Tone;
1475
1720
  /** Explicit filled-star color; overrides `tone` when set. */
1476
1721
  color?: string;
1477
- /** Display only, no interaction. @default false */
1722
+ /** Display only — renders a single static value as `role="img"` named "<value> out of <count> stars"
1723
+ * (overridable via `aria-label`), not a radiogroup of radios. @default false */
1478
1724
  readOnly?: boolean;
1479
1725
  /** Disable all interaction and dim the control. @default false */
1480
1726
  disabled?: boolean;
1481
- /** Show the numeric value beside the stars. @default false */
1727
+ /** Show the numeric value beside the stars (clean integer, or one decimal for fractional). @default false */
1482
1728
  showValue?: boolean;
1729
+ /** Allow clearing back to 0 — clicking the selected star, or pressing Delete/Backspace, resets to "no rating". @default true */
1730
+ clearable?: boolean;
1731
+ /** Custom formatter for the `showValue` badge and the read-only accessible label. Defaults to a clean integer, or one decimal for fractional values. */
1732
+ format?: (value: number) => React.ReactNode;
1733
+ /** Name for a hidden form field so the value participates in native form submission. */
1734
+ name?: string;
1483
1735
  onChange?: (value: number) => void;
1484
1736
  }
1485
1737
 
@@ -1527,6 +1779,14 @@ interface SelectProps extends Omit<React.HTMLAttributes<HTMLButtonElement>, "onC
1527
1779
  portal?: boolean;
1528
1780
  /** Minimum popover width in px when portaled (useful when the trigger is narrow). @default 0 */
1529
1781
  minWidth?: number;
1782
+ /** Pin the popover to the trigger's width. Set false to size it to the widest option (clamped to the viewport). @default true */
1783
+ matchTriggerWidth?: boolean;
1784
+ /** Show a loading row instead of the option list / empty state (e.g. while fetching options). @default false */
1785
+ loading?: boolean;
1786
+ /** Text shown when no options match. @default "No results found" */
1787
+ emptyText?: string;
1788
+ /** Name for a hidden form field so the selected value participates in native form submission. */
1789
+ name?: string;
1530
1790
  }
1531
1791
 
1532
1792
  /** Alias of the shared {@link Option} type (kept for backward-compatible imports). */
@@ -1626,16 +1886,22 @@ interface SliderProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChan
1626
1886
  hint?: React.ReactNode;
1627
1887
  /** Error message shown below the track — turns it red (sets `aria-invalid`) and replaces the hint. */
1628
1888
  error?: React.ReactNode;
1629
- /** Controlled value. */
1630
- value?: number;
1631
- /** Uncontrolled initial value. @default 0 */
1632
- defaultValue?: number;
1889
+ /** Controlled value. A `[number, number]` tuple enables dual-thumb range mode. Clamped into [min, max]. */
1890
+ value?: number | [number, number];
1891
+ /** Uncontrolled initial value (a tuple enables range mode). Clamped into [min, max]. @default 0 */
1892
+ defaultValue?: number | [number, number];
1893
+ /** Force dual-thumb range mode even without a tuple value (defaults the range to [min, max]). @default false */
1894
+ range?: boolean;
1633
1895
  /** @default 0 */
1634
1896
  min?: number;
1635
1897
  /** @default 100 */
1636
1898
  max?: number;
1637
1899
  /** @default 1 */
1638
1900
  step?: number;
1901
+ /** Large-step increment for PageUp/PageDown. @default Math.max(step, (max - min) / 10) */
1902
+ pageStep?: number;
1903
+ /** Decimal places for the default display + aria value; derived from `step` when unset. */
1904
+ precision?: number;
1639
1905
  disabled?: boolean;
1640
1906
  /** Show the current value at the top-right. @default true */
1641
1907
  showValue?: boolean;
@@ -1643,9 +1909,13 @@ interface SliderProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChan
1643
1909
  showTicks?: boolean;
1644
1910
  /** Color intent. @default "primary" */
1645
1911
  tone?: Tone;
1646
- /** Format the displayed value (label + bubble). */
1912
+ /** Format the displayed value (label + bubble). If it returns a node, pair it with `getAriaValueText`. */
1647
1913
  formatValue?: (value: number) => React.ReactNode;
1648
- onChange?: (value: number) => void;
1914
+ /** Human-readable value for assistive tech (`aria-valuetext`) — use when `formatValue` returns a node. */
1915
+ getAriaValueText?: (value: number) => string;
1916
+ /** Name for hidden form field(s) so the value participates in native form submission. */
1917
+ name?: string;
1918
+ onChange?: (value: number | [number, number]) => void;
1649
1919
  }
1650
1920
 
1651
1921
  declare function Slider(props: SliderProps): React.JSX.Element;
@@ -1785,6 +2055,16 @@ interface TableProps<T = any> extends React.HTMLAttributes<HTMLDivElement> {
1785
2055
  stickyHeader?: boolean;
1786
2056
  /** Cap the table height and give it its own vertical scroll area (CSS length or number of px). */
1787
2057
  maxHeight?: number | string;
2058
+ /** Show shimmering skeleton rows instead of data (e.g. while fetching); sets `aria-busy`. @default false */
2059
+ loading?: boolean;
2060
+ /** Number of skeleton rows to render while `loading`. @default 8 */
2061
+ loadingRows?: number;
2062
+ /** Rendered as a single full-width row when `rows` is empty. @default "No data" */
2063
+ emptyMessage?: React.ReactNode;
2064
+ /** Accessible name applied to the `<table>` (not the wrapper). A raw `aria-label` prop takes precedence. */
2065
+ ariaLabel?: string;
2066
+ /** Renders a visually-hidden `<caption>` naming the table. */
2067
+ caption?: React.ReactNode;
1788
2068
  }
1789
2069
 
1790
2070
  interface TableColumn<T = any> {
@@ -1875,9 +2155,20 @@ interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement
1875
2155
  size?: "sm" | "md" | "lg";
1876
2156
  /** Color intent for the focus/open accent. @default "primary" */
1877
2157
  tone?: Tone;
2158
+ /** Grow to fit content between `minRows` and `maxRows` (resize handle hidden). @default false */
2159
+ autosize?: boolean;
2160
+ /** Minimum rows when `autosize` (falls back to `rows`). */
2161
+ minRows?: number;
2162
+ /** Maximum rows when `autosize`; taller content scrolls. */
2163
+ maxRows?: number;
2164
+ /** With `maxLength`, render a live `current / max` character counter; danger-toned near the limit. @default false */
2165
+ showCount?: boolean;
1878
2166
  }
1879
2167
 
1880
- declare function Textarea(props: TextareaProps): React.JSX.Element;
2168
+ /** Forwards `ref` to the inner `<textarea>`. */
2169
+ declare const Textarea: React.ForwardRefExoticComponent<
2170
+ TextareaProps & React.RefAttributes<HTMLTextAreaElement>
2171
+ >;
1881
2172
 
1882
2173
  interface TimelineItem {
1883
2174
  /** Event title. */
@@ -1915,9 +2206,11 @@ interface ToastProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title">
1915
2206
  title?: React.ReactNode;
1916
2207
  /** Override the tone icon. */
1917
2208
  icon?: React.ReactNode;
1918
- /** Show close button + handle dismissal. */
2209
+ /** Renders the close button AND is the dismissal handler. The Toast is controlled — it never
2210
+ * removes itself, so BOTH the close button and `duration` auto-dismiss require this. */
1919
2211
  onClose?: () => void;
1920
- /** Auto-dismiss after this many ms (paused on hover/focus). `0`/`Infinity` keeps it open. @default 4500 */
2212
+ /** Auto-dismiss after this many ms (paused on hover/focus). **No-op unless `onClose` is provided** —
2213
+ * the timer's only action is to call `onClose`. `0`/`Infinity` keeps it open. @default 4500 */
1921
2214
  duration?: number;
1922
2215
  children?: React.ReactNode;
1923
2216
  }
@@ -2108,7 +2401,7 @@ interface BoxProps extends React.HTMLAttributes<HTMLElement> {
2108
2401
  shadow?: string;
2109
2402
  }
2110
2403
 
2111
- declare function Box(props: BoxProps): React.JSX.Element;
2404
+ declare const Box: React.ForwardRefExoticComponent<BoxProps & React.RefAttributes<HTMLElement>>;
2112
2405
 
2113
2406
  /** Centered, max-width content wrapper with responsive horizontal padding. */
2114
2407
  interface ContainerProps extends React.HTMLAttributes<HTMLElement> {
@@ -2126,7 +2419,7 @@ interface ContainerProps extends React.HTMLAttributes<HTMLElement> {
2126
2419
  padded?: boolean;
2127
2420
  }
2128
2421
 
2129
- declare function Container(props: ContainerProps): React.JSX.Element;
2422
+ declare const Container: React.ForwardRefExoticComponent<ContainerProps & React.RefAttributes<HTMLElement>>;
2130
2423
 
2131
2424
  /** Responsive column counts per breakpoint (base + sm/md/lg/xl at 640/768/1024/1280px). */
2132
2425
  type ResponsiveColumns = { base?: number; sm?: number; md?: number; lg?: number; xl?: number };
@@ -2159,7 +2452,7 @@ interface GridProps extends React.HTMLAttributes<HTMLElement> {
2159
2452
  justifyContent?: React.CSSProperties["justifyContent"];
2160
2453
  }
2161
2454
 
2162
- declare function Grid(props: GridProps): React.JSX.Element;
2455
+ declare const Grid: React.ForwardRefExoticComponent<GridProps & React.RefAttributes<HTMLElement>>;
2163
2456
 
2164
2457
  /** Flex layout primitive — rows or columns with token-based gaps. */
2165
2458
  interface StackProps extends React.HTMLAttributes<HTMLElement> {
@@ -2199,7 +2492,7 @@ interface StackProps extends React.HTMLAttributes<HTMLElement> {
2199
2492
  divider?: React.ReactNode;
2200
2493
  }
2201
2494
 
2202
- declare function Stack(props: StackProps): React.JSX.Element;
2495
+ declare const Stack: React.ForwardRefExoticComponent<StackProps & React.RefAttributes<HTMLElement>>;
2203
2496
 
2204
2497
  /** Inline code, or a scrollable multi-line block with an optional copy button. */
2205
2498
  interface CodeProps extends React.HTMLAttributes<HTMLElement> {
@@ -2253,7 +2546,7 @@ interface HeadingProps extends React.HTMLAttributes<HTMLElement> {
2253
2546
  lineClamp?: number;
2254
2547
  }
2255
2548
 
2256
- declare function Heading(props: HeadingProps): React.JSX.Element;
2549
+ declare const Heading: React.ForwardRefExoticComponent<HeadingProps & React.RefAttributes<HTMLElement>>;
2257
2550
 
2258
2551
  /** Body text with token sizes and semantic color tones. Renders <p> by default. */
2259
2552
  interface TextProps extends React.HTMLAttributes<HTMLElement> {
@@ -2278,7 +2571,7 @@ interface TextProps extends React.HTMLAttributes<HTMLElement> {
2278
2571
  lineClamp?: number;
2279
2572
  }
2280
2573
 
2281
- declare function Text(props: TextProps): React.JSX.Element;
2574
+ declare const Text: React.ForwardRefExoticComponent<TextProps & React.RefAttributes<HTMLElement>>;
2282
2575
 
2283
2576
  /** SSR-safe `useLayoutEffect` (falls back to `useEffect` on the server). */
2284
2577
  declare const useIsomorphicLayoutEffect: typeof React.useLayoutEffect;
@@ -2429,6 +2722,8 @@ declare function useId(prefix?: string): string;
2429
2722
  interface UseFocusTrapOptions {
2430
2723
  /** Restore focus to the previously-focused element when the trap deactivates. @default true */
2431
2724
  restoreFocus?: boolean;
2725
+ /** Element to focus on activate instead of the first focusable — a ref or a `() => Element | null`. */
2726
+ initialFocus?: React.RefObject<HTMLElement | null> | (() => HTMLElement | null | undefined);
2432
2727
  }
2433
2728
 
2434
2729
  /**
@@ -2449,4 +2744,4 @@ declare function useFocusTrap<T extends HTMLElement = HTMLElement>(
2449
2744
  */
2450
2745
  declare function usePortal(): (node: React.ReactNode) => React.ReactPortal | React.ReactNode | null;
2451
2746
 
2452
- export { Accordion, type AccordionItem, type AccordionProps, type ActionTone, Alert, type AlertProps, AppShell, type AppShellProps, Avatar, AvatarMenu, type AvatarMenuProps, type AvatarProps, Badge, type BadgeProps, type BarTone, Box, type BoxProps, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, type ButtonProps, Card, type CardProps, Carousel, type CarouselProps, Chart, type ChartDatum, type ChartProps, Checkbox, type CheckboxProps, Code, type CodeProps, ColorPicker, type ColorPickerProps, Combobox, type ComboboxGroup, type ComboboxOption, type ComboboxProps, type Command, CommandPalette, type CommandPaletteProps, Container, type ContainerProps, Currency, CurrencyField, type CurrencyFieldProps, type CurrencyOption, type CurrencyProps, Datatable, type DatatableBatchAction, type DatatableColumn, type DatatableFilter, type DatatableFilterOp, type DatatableNumberOp, type DatatableProps, type DatatableQuery, type DatatableRowAction, type DatatableStringOp, DatePicker, type DatePickerProps, type DateRange, DateRangePicker, type DateRangePickerProps, Dialog, type DialogProps, Divider, type DividerProps, Drawer, type DrawerProps, EmptyState, type EmptyStateProps, Field, type FieldProps, FileUpload, type FileUploadProps, Grid, type GridProps, Heading, type HeadingProps, type HeadingSize, IconButton, type IconButtonProps, Input, type InputProps, Kanban, type KanbanCard, type KanbanColumn, type KanbanProps, List, type ListItemData, type ListProps, Menu, type MenuItemDef, type MenuProps, MultiSelect, type MultiSelectGroup, type MultiSelectOption, type MultiSelectProps, Navbar, type NavbarLink, type NavbarProps, type Option, type OptionGroup, Pagination, type PaginationProps, type PolymorphicAs, Popover, type PopoverProps, Progress, type ProgressProps, Radio, type RadioProps, Rating, type RatingProps, type ResponsiveColumns, Select, type SelectGroup, type SelectOption, type SelectProps, Sidebar, type SidebarItem, type SidebarProps, Skeleton, type SkeletonProps, Slider, type SliderProps, Spinner, type SpinnerProps, Stack, type StackProps, Stat, type StatProps, type Step, Stepper, type StepperProps, Switch, type SwitchProps, type TabItem, Table, type TableColumn, type TableProps, Tabs, type TabsProps, Tag, type TagProps, Text, type TextProps, type TextTone, Textarea, type TextareaProps, Timeline, type TimelineItem, type TimelineProps, Toast, type ToastApi, type ToastOptions, type ToastProps, ToastProvider, type ToastProviderProps, type ToastTone, ToastViewport, type ToastViewportProps, type Tone, Tooltip, type TooltipProps, type TreeNode, TreeView, type TreeViewProps, type UseColorSchemeOptions, type UseFocusTrapOptions, type UseKeyPressOptions, type UseMediaQueryOptions, runDatatableQuery, useClickOutside, useColorScheme, useControllableState, useCopyToClipboard, useDebouncedCallback, useDebouncedValue, useDisclosure, useEventListener, useFocusTrap, useHover, useId, useIntersectionObserver, useInterval, useIsomorphicLayoutEffect, useKeyPress, useLocalStorage, useMediaQuery, useMounted, usePortal, usePrefersReducedMotion, usePrevious, useScrollLock, useTimeout, useToast, useToggle, useWindowSize };
2747
+ export { Accordion, type AccordionItem, type AccordionProps, type ActionTone, Alert, type AlertProps, Anchor, type AnchorProps, AppShell, type AppShellProps, Avatar, AvatarMenu, type AvatarMenuProps, type AvatarProps, Badge, type BadgeProps, type BarTone, Box, type BoxProps, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, type ButtonProps, Card, type CardProps, Carousel, type CarouselProps, Chart, type ChartDatum, type ChartProps, Checkbox, type CheckboxProps, Code, type CodeProps, ColorPicker, type ColorPickerProps, ColorSchemeScript, type ColorSchemeScriptOptions, type ColorSchemeScriptProps, Combobox, type ComboboxGroup, type ComboboxOption, type ComboboxProps, type Command, CommandPalette, type CommandPaletteProps, Container, type ContainerProps, Currency, CurrencyField, type CurrencyFieldProps, type CurrencyOption, type CurrencyProps, Datatable, type DatatableBatchAction, type DatatableColumn, type DatatableFilter, type DatatableFilterOp, type DatatableNumberOp, type DatatableProps, type DatatableQuery, type DatatableRowAction, type DatatableStringOp, DatePicker, type DatePickerProps, type DateRange, DateRangePicker, type DateRangePickerProps, Dialog, type DialogProps, Divider, type DividerProps, Drawer, type DrawerProps, EmptyState, type EmptyStateProps, Field, type FieldProps, FileUpload, type FileUploadProps, Form, type FormProps, Grid, type GridProps, Heading, type HeadingProps, type HeadingSize, IconButton, type IconButtonProps, Image, type ImageProps, Input, type InputProps, Kanban, type KanbanCard, type KanbanColumn, type KanbanProps, Kbd, type KbdProps, Label, type LabelProps, List, type ListItemData, type ListProps, Menu, type MenuItemDef, type MenuProps, MultiSelect, type MultiSelectGroup, type MultiSelectOption, type MultiSelectProps, Navbar, type NavbarLink, type NavbarProps, type Option, type OptionGroup, Pagination, type PaginationProps, type PolymorphicAs, Popover, type PopoverProps, Portal, type PortalProps, Pre, type PreProps, Progress, type ProgressProps, Radio, RadioGroup, type RadioGroupOption, type RadioGroupProps, type RadioProps, Rating, type RatingProps, type ResponsiveColumns, Select, type SelectGroup, type SelectOption, type SelectProps, Sidebar, type SidebarItem, type SidebarProps, Skeleton, type SkeletonProps, Slider, type SliderProps, Spinner, type SpinnerProps, Stack, type StackProps, Stat, type StatProps, type Step, Stepper, type StepperProps, Switch, type SwitchProps, type TabItem, Table, type TableColumn, type TableProps, Tabs, type TabsProps, Tag, type TagProps, Text, type TextProps, type TextTone, Textarea, type TextareaProps, type Theme, ThemeProvider, type ThemeProviderProps, type ThemeTokens, Timeline, type TimelineItem, type TimelineProps, Toast, type ToastApi, type ToastOptions, type ToastProps, ToastProvider, type ToastProviderProps, type ToastTone, ToastViewport, type ToastViewportProps, type Tone, Tooltip, type TooltipProps, type TreeNode, TreeView, type TreeViewProps, TwicoProvider, type TwicoProviderProps, type UseColorSchemeOptions, type UseFocusTrapOptions, type UseKeyPressOptions, type UseMediaQueryOptions, VisuallyHidden, type VisuallyHiddenProps, createTheme, getColorSchemeScript, runDatatableQuery, useClickOutside, useColorScheme, useControllableState, useCopyToClipboard, useDebouncedCallback, useDebouncedValue, useDisclosure, useEventListener, useFocusTrap, useHover, useId, useIntersectionObserver, useInterval, useIsomorphicLayoutEffect, useKeyPress, useLocalStorage, useMediaQuery, useMounted, usePortal, usePrefersReducedMotion, usePrevious, useScrollLock, useTimeout, useToast, useToggle, useWindowSize };