twico-ui 1.3.2 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/index.cjs +1110 -695
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +397 -152
- package/dist/index.d.ts +397 -152
- package/dist/index.mjs +1109 -696
- package/dist/index.mjs.map +1 -1
- package/llms.txt +39 -12
- package/package.json +3 -1
- package/styles/twico-ui.css +15 -5
package/dist/index.d.cts
CHANGED
|
@@ -15,6 +15,8 @@ interface AccordionProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
15
15
|
open?: string[];
|
|
16
16
|
/** Called with the next open values whenever a panel is toggled. */
|
|
17
17
|
onOpenChange?: (values: string[]) => void;
|
|
18
|
+
/** Heading level wrapping each trigger button (document-outline semantics). @default 3 */
|
|
19
|
+
headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
18
20
|
}
|
|
19
21
|
|
|
20
22
|
interface AccordionItem {
|
|
@@ -22,16 +24,45 @@ interface AccordionItem {
|
|
|
22
24
|
label: React.ReactNode;
|
|
23
25
|
content: React.ReactNode;
|
|
24
26
|
icon?: React.ReactNode;
|
|
27
|
+
/** Disable this section — its trigger can't be opened, activated, or focused. @default false */
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
/** Override the accordion's `headingLevel` for this item. */
|
|
30
|
+
headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
25
31
|
}
|
|
26
32
|
|
|
27
33
|
declare function Accordion(props: AccordionProps): React.JSX.Element;
|
|
28
34
|
|
|
35
|
+
// Shared, library-wide type vocabulary. Types only — no runtime. Re-exported from
|
|
36
|
+
// the package root so consumers can name the same unions the components use, instead
|
|
37
|
+
// of re-deriving them. See docs/tone-variant-system.md and docs/prop-conventions.md.
|
|
38
|
+
|
|
39
|
+
/** The canonical six-value color/intent scale used by status & control components. */
|
|
40
|
+
type Tone = "primary" | "success" | "warning" | "danger" | "info" | "neutral";
|
|
41
|
+
|
|
42
|
+
/** Action controls (Button, IconButton) — brand or destructive only. */
|
|
43
|
+
type ActionTone = "primary" | "danger";
|
|
44
|
+
|
|
45
|
+
/** Text roles, the full color scale, and `"inherit"` (adopt the parent color) — Text. */
|
|
46
|
+
type TextTone = "default" | "muted" | "subtle" | "inherit" | Tone;
|
|
47
|
+
|
|
48
|
+
/** Toast tone vocabulary — `"neutral"` is an alias of `"default"`. */
|
|
49
|
+
type ToastTone = "default" | "neutral" | "success" | "warning" | "danger" | "info";
|
|
50
|
+
|
|
51
|
+
/** Progress / Timeline bar tones — the scale minus `"neutral"` (no neutral bar state). */
|
|
52
|
+
type BarTone = Exclude<Tone, "neutral">;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* The `as` prop of the polymorphic primitives — any intrinsic tag name (`"div"`)
|
|
56
|
+
* OR a React component (`as={Link}`), whose props then flow through `{...rest}`.
|
|
57
|
+
*/
|
|
58
|
+
type PolymorphicAs = React.ElementType;
|
|
59
|
+
|
|
29
60
|
/**
|
|
30
61
|
* Inline message banner with semantic tones, optional title, icon, and dismiss.
|
|
31
62
|
*/
|
|
32
63
|
interface AlertProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {
|
|
33
64
|
/** Color intent. @default "info" */
|
|
34
|
-
tone?:
|
|
65
|
+
tone?: Tone;
|
|
35
66
|
/** Fill style. @default "soft" */
|
|
36
67
|
variant?: "soft" | "solid" | "outline";
|
|
37
68
|
/** Bold heading line. */
|
|
@@ -40,6 +71,14 @@ interface AlertProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title">
|
|
|
40
71
|
icon?: React.ReactNode;
|
|
41
72
|
/** Show a close button and handle dismissal. */
|
|
42
73
|
onClose?: () => void;
|
|
74
|
+
/**
|
|
75
|
+
* Live-region politeness. Tone-aware default: danger/warning → `"assertive"` (role="alert"),
|
|
76
|
+
* success/info → `"polite"` (role="status"), primary/neutral → `"off"` (no live region, for
|
|
77
|
+
* static banners). Set explicitly to override. @default tone-aware
|
|
78
|
+
*/
|
|
79
|
+
live?: "assertive" | "polite" | "off";
|
|
80
|
+
/** Accessible label for the dismiss button (shown only when `onClose` is set). @default "Dismiss" */
|
|
81
|
+
closeLabel?: string;
|
|
43
82
|
children?: React.ReactNode;
|
|
44
83
|
}
|
|
45
84
|
|
|
@@ -59,6 +98,10 @@ interface AvatarProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
|
59
98
|
square?: boolean;
|
|
60
99
|
/** Presence indicator. */
|
|
61
100
|
status?: "online" | "busy" | "away" | "offline";
|
|
101
|
+
/** Accessible text for the presence dot, folded into the avatar's spoken name (e.g. "Jane Doe, Online"). Defaults to a capitalized `status`. */
|
|
102
|
+
statusLabel?: string;
|
|
103
|
+
/** Localized presence labels keyed by status value. */
|
|
104
|
+
statusLabels?: Partial<Record<"online" | "busy" | "away" | "offline", string>>;
|
|
62
105
|
/** Adds a brand ring around the avatar. */
|
|
63
106
|
ring?: boolean;
|
|
64
107
|
}
|
|
@@ -77,6 +120,12 @@ interface MenuItemDef {
|
|
|
77
120
|
/** Render in danger color. */
|
|
78
121
|
danger?: boolean;
|
|
79
122
|
disabled?: boolean;
|
|
123
|
+
/** Turns the item into a link: renders `<a role="menuitem" href>`. Sanitized against javascript:/data:/vbscript:. `onClick` (if also set) still fires, then the menu closes. */
|
|
124
|
+
href?: string;
|
|
125
|
+
/** Anchor target when `href` is set (e.g. "_blank"). */
|
|
126
|
+
target?: string;
|
|
127
|
+
/** Anchor rel when `href` is set — pair "_blank" with "noopener noreferrer". */
|
|
128
|
+
rel?: string;
|
|
80
129
|
/** Render a divider line (ignores other fields). */
|
|
81
130
|
separator?: boolean;
|
|
82
131
|
/** Render as an uppercase section heading. */
|
|
@@ -107,6 +156,10 @@ interface MenuProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
|
107
156
|
open?: boolean;
|
|
108
157
|
/** Called with the requested open state on trigger click, item select, Esc, or outside click. */
|
|
109
158
|
onOpenChange?: (open: boolean) => void;
|
|
159
|
+
/** Accessible name for the `role="menu"` popup. When omitted and a `header` is set, the header labels the popup. */
|
|
160
|
+
"aria-label"?: string;
|
|
161
|
+
/** Id(s) of element(s) that label the popup; overrides the header fallback. */
|
|
162
|
+
"aria-labelledby"?: string;
|
|
110
163
|
}
|
|
111
164
|
|
|
112
165
|
declare function Menu(props: MenuProps): React.JSX.Element;
|
|
@@ -148,7 +201,7 @@ declare function AvatarMenu(props: AvatarMenuProps): React.JSX.Element;
|
|
|
148
201
|
*/
|
|
149
202
|
interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
150
203
|
/** Semantic color. @default "primary" */
|
|
151
|
-
tone?:
|
|
204
|
+
tone?: Tone;
|
|
152
205
|
/** Fill style. @default "soft" */
|
|
153
206
|
variant?: "soft" | "solid" | "outline";
|
|
154
207
|
/** Size scale. @default "md" */
|
|
@@ -200,7 +253,7 @@ interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
|
200
253
|
/** Fill style. @default "solid" */
|
|
201
254
|
variant?: "solid" | "soft" | "outline" | "ghost";
|
|
202
255
|
/** Color/intent, orthogonal to `variant`. @default "primary" */
|
|
203
|
-
tone?:
|
|
256
|
+
tone?: ActionTone;
|
|
204
257
|
/** Control size; "xs" (~26px) is smaller than "sm". @default "md" */
|
|
205
258
|
size?: "xs" | "sm" | "md" | "lg";
|
|
206
259
|
/** Icon node rendered before the label. */
|
|
@@ -252,8 +305,14 @@ declare function Card(props: CardProps): React.JSX.Element;
|
|
|
252
305
|
|
|
253
306
|
/**
|
|
254
307
|
* Sliding carousel — one slide per view, prev/next arrows, dot indicators,
|
|
255
|
-
* optional looping and autoplay
|
|
256
|
-
*
|
|
308
|
+
* optional looping and autoplay. Each child is a slide. Controlled via `index` +
|
|
309
|
+
* `onIndexChange`, or uncontrolled via `defaultIndex`.
|
|
310
|
+
*
|
|
311
|
+
* Accessibility: the region is focusable and keyboard-navigable — ArrowLeft/ArrowRight
|
|
312
|
+
* step slides and Home/End jump to first/last. Autoplay pauses on hover/focus, via the
|
|
313
|
+
* pause button, and when `prefers-reduced-motion` is set (WCAG 2.2.2); a polite live
|
|
314
|
+
* region announces the active slide (silenced while auto-rotating). Give the region an
|
|
315
|
+
* accessible name with `label` (or `aria-label`/`aria-labelledby`).
|
|
257
316
|
*
|
|
258
317
|
* @startingPoint section="Data display" subtitle="Sliding carousel" viewport="700x320"
|
|
259
318
|
*/
|
|
@@ -262,44 +321,53 @@ interface CarouselProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
262
321
|
index?: number;
|
|
263
322
|
/** Initial slide index when uncontrolled. @default 0 */
|
|
264
323
|
defaultIndex?: number;
|
|
265
|
-
/** Fired when the active slide changes (arrows, dots, or autoplay): (index). */
|
|
324
|
+
/** Fired when the active slide changes (arrows, dots, keyboard, or autoplay): (index). */
|
|
266
325
|
onIndexChange?: (index: number) => void;
|
|
267
326
|
/** Show prev/next arrows. @default true */
|
|
268
327
|
showArrows?: boolean;
|
|
269
328
|
/** Show dot indicators. @default true */
|
|
270
329
|
showDots?: boolean;
|
|
330
|
+
/** Show the pause/play toggle when `autoPlay` is on. @default true */
|
|
331
|
+
showPauseButton?: boolean;
|
|
271
332
|
/** Wrap around at the ends. @default true */
|
|
272
333
|
loop?: boolean;
|
|
273
|
-
/** Auto-advance slides. @default false */
|
|
334
|
+
/** Auto-advance slides. Suppressed under `prefers-reduced-motion`. @default false */
|
|
274
335
|
autoPlay?: boolean;
|
|
275
336
|
/** Autoplay interval in ms. @default 4000 */
|
|
276
337
|
interval?: number;
|
|
338
|
+
/** Accessible name for the carousel region. Falls back to `aria-label`, then `"Carousel"`. */
|
|
339
|
+
label?: string;
|
|
340
|
+
/** Accessible label for the pause button (paused → shows the play label). @default "Pause" */
|
|
341
|
+
pauseLabel?: string;
|
|
342
|
+
/** Accessible label for the play button. @default "Play" */
|
|
343
|
+
playLabel?: string;
|
|
277
344
|
/** Slides (each child is one slide). */
|
|
278
345
|
children?: React.ReactNode;
|
|
279
346
|
}
|
|
280
347
|
|
|
281
348
|
declare function Carousel(props: CarouselProps): React.JSX.Element;
|
|
282
349
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
}
|
|
350
|
+
/**
|
|
351
|
+
* A chart data point: a `label` plus one numeric field per series key `K`
|
|
352
|
+
* (default key `"value"`). `K` is normally inferred from the `series` prop.
|
|
353
|
+
*/
|
|
354
|
+
type ChartDatum<K extends string = "value"> = { label: React.ReactNode } & { [P in K]: number };
|
|
289
355
|
|
|
290
356
|
/**
|
|
291
357
|
* Lightweight, dependency-free SVG chart — bar or line, single or multi-series,
|
|
292
|
-
* with grid, axes, animated entrance, tooltips, and optional legend.
|
|
358
|
+
* with grid, axes, animated entrance, tooltips, and optional legend. Generic over
|
|
359
|
+
* the series keys `K` so the data rows are type-checked (e.g.
|
|
360
|
+
* `<Chart series={["sales"]} data={[{ label, sales: 12 }]} />`).
|
|
293
361
|
*
|
|
294
362
|
* @startingPoint section="Data display" subtitle="Bar / line chart (no deps)" viewport="700x280"
|
|
295
363
|
*/
|
|
296
|
-
interface ChartProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
364
|
+
interface ChartProps<K extends string = "value"> extends React.HTMLAttributes<HTMLDivElement> {
|
|
297
365
|
/** @default "bar" */
|
|
298
366
|
type?: "bar" | "line";
|
|
299
|
-
/** Data points. Each has a `label` + one numeric field per series. */
|
|
300
|
-
data: ChartDatum[];
|
|
301
|
-
/** Series field names (defaults to ["value"]). Multiple = grouped bars / multi-line. */
|
|
302
|
-
series?:
|
|
367
|
+
/** Data points. Each has a `label` + one numeric field per series key. (`K` is inferred from `series`, not from `data`.) */
|
|
368
|
+
data: ChartDatum<NoInfer<K>>[];
|
|
369
|
+
/** Series field names (defaults to `["value"]`). Multiple = grouped bars / multi-line. */
|
|
370
|
+
series?: K[];
|
|
303
371
|
/** Pixel height. @default 220 */
|
|
304
372
|
height?: number;
|
|
305
373
|
/** Horizontal grid lines. @default true */
|
|
@@ -310,13 +378,17 @@ interface ChartProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
310
378
|
showLegend?: boolean;
|
|
311
379
|
/** Per-series colors (any CSS color), cycled when shorter than `series`. Defaults to the built-in token palette. */
|
|
312
380
|
colors?: string[];
|
|
313
|
-
/** Tooltip value formatter. */
|
|
381
|
+
/** Tooltip value formatter (also formats the hidden data-table cells). */
|
|
314
382
|
valueFormat?: (value: number) => string;
|
|
315
|
-
/** Accessible name for the chart's `<svg role="img">`. Defaults to `"<type> chart"
|
|
383
|
+
/** Accessible name for the chart's `<svg role="img">`. Per-point values are exposed via the hidden data table, not this label. Defaults to `"<type> chart"`; also accepts `aria-label`. */
|
|
316
384
|
ariaLabel?: string;
|
|
385
|
+
/** Render a visually-hidden data table as an accessible text alternative (WCAG 1.1.1). @default true */
|
|
386
|
+
tableFallback?: boolean;
|
|
387
|
+
/** Caption for the hidden data table; defaults to the chart's accessible label. */
|
|
388
|
+
caption?: React.ReactNode;
|
|
317
389
|
}
|
|
318
390
|
|
|
319
|
-
declare function Chart(props: ChartProps): React.JSX.Element;
|
|
391
|
+
declare function Chart<K extends string = "value">(props: ChartProps<K>): React.JSX.Element;
|
|
320
392
|
|
|
321
393
|
/**
|
|
322
394
|
* Checkbox with animated checkmark, label, description, and indeterminate state.
|
|
@@ -330,7 +402,7 @@ interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>
|
|
|
330
402
|
indeterminate?: boolean;
|
|
331
403
|
size?: "sm" | "md" | "lg";
|
|
332
404
|
/** Color intent. @default "primary" */
|
|
333
|
-
tone?:
|
|
405
|
+
tone?: Tone;
|
|
334
406
|
}
|
|
335
407
|
|
|
336
408
|
declare function Checkbox(props: CheckboxProps): React.JSX.Element;
|
|
@@ -359,12 +431,32 @@ interface ColorPickerProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "o
|
|
|
359
431
|
/** Disable all interaction (the popover cannot be opened). @default false */
|
|
360
432
|
disabled?: boolean;
|
|
361
433
|
/** Color intent for the focus/open accent. @default "primary" */
|
|
362
|
-
tone?:
|
|
434
|
+
tone?: Tone;
|
|
363
435
|
onChange?: (hex: string) => void;
|
|
364
436
|
}
|
|
365
437
|
|
|
366
438
|
declare function ColorPicker(props: ColorPickerProps): React.JSX.Element;
|
|
367
439
|
|
|
440
|
+
// Shared option shape for the Select family (Select, Combobox, MultiSelect). One
|
|
441
|
+
// canonical pair instead of three byte-identical duplicates; the per-component names
|
|
442
|
+
// (SelectOption, ComboboxOption, …) stay as structural aliases so existing imports
|
|
443
|
+
// keep resolving. Types only — no runtime. CurrencyField's CurrencyOption is a
|
|
444
|
+
// deliberately separate, narrower shape and is NOT unified here.
|
|
445
|
+
|
|
446
|
+
/** A single selectable option. */
|
|
447
|
+
interface Option {
|
|
448
|
+
value: string;
|
|
449
|
+
label: string;
|
|
450
|
+
/** Optional second line shown under the label. */
|
|
451
|
+
description?: string;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
/** A labeled group of options (or bare string values). */
|
|
455
|
+
interface OptionGroup {
|
|
456
|
+
group: string;
|
|
457
|
+
options: Array<string | Option>;
|
|
458
|
+
}
|
|
459
|
+
|
|
368
460
|
/**
|
|
369
461
|
* Searchable single-select (MUI-Autocomplete style) — type directly in the
|
|
370
462
|
* field to filter; the overlay shows only options. Supports grouped options
|
|
@@ -380,7 +472,7 @@ interface ComboboxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>
|
|
|
380
472
|
required?: boolean;
|
|
381
473
|
size?: "sm" | "md" | "lg";
|
|
382
474
|
/** Color intent for the focus/open accent. @default "primary" */
|
|
383
|
-
tone?:
|
|
475
|
+
tone?: Tone;
|
|
384
476
|
/** Field placeholder. */
|
|
385
477
|
placeholder?: string;
|
|
386
478
|
/** Options — strings, {value,label,description}, or {group,options} groups. */
|
|
@@ -389,6 +481,7 @@ interface ComboboxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>
|
|
|
389
481
|
value?: string | null;
|
|
390
482
|
/** Uncontrolled initial value. */
|
|
391
483
|
defaultValue?: string | null;
|
|
484
|
+
/** Called with the chosen option's value, or `null` when cleared via `clearable`. */
|
|
392
485
|
onChange?: (value: string | null) => void;
|
|
393
486
|
/** Show a clear (×) affix when a value is selected. */
|
|
394
487
|
clearable?: boolean;
|
|
@@ -407,18 +500,11 @@ interface ComboboxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>
|
|
|
407
500
|
onKeyDown?: React.KeyboardEventHandler<HTMLInputElement>;
|
|
408
501
|
}
|
|
409
502
|
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
label: string;
|
|
413
|
-
/** Optional second line shown under the label. */
|
|
414
|
-
description?: string;
|
|
415
|
-
}
|
|
503
|
+
/** Alias of the shared {@link Option} type (kept for backward-compatible imports). */
|
|
504
|
+
type ComboboxOption = Option;
|
|
416
505
|
|
|
417
|
-
/**
|
|
418
|
-
|
|
419
|
-
group: string;
|
|
420
|
-
options: Array<string | ComboboxOption>;
|
|
421
|
-
}
|
|
506
|
+
/** Alias of the shared {@link OptionGroup} type (kept for backward-compatible imports). */
|
|
507
|
+
type ComboboxGroup = OptionGroup;
|
|
422
508
|
|
|
423
509
|
declare function Combobox(props: ComboboxProps): React.JSX.Element;
|
|
424
510
|
|
|
@@ -476,7 +562,7 @@ interface CurrencyProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>
|
|
|
476
562
|
required?: boolean;
|
|
477
563
|
size?: "sm" | "md" | "lg";
|
|
478
564
|
/** Color intent for the focus/open accent. @default "primary" */
|
|
479
|
-
tone?:
|
|
565
|
+
tone?: Tone;
|
|
480
566
|
/** Currency code (key in the built-in table), e.g. "USD", "EUR", "IDR", "JPY". @default "USD" */
|
|
481
567
|
currency?: string;
|
|
482
568
|
/** Override the currency's decimal precision (number of digits after the decimal). */
|
|
@@ -485,13 +571,13 @@ interface CurrencyProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>
|
|
|
485
571
|
symbol?: string;
|
|
486
572
|
/** Override the displayed suffix code. */
|
|
487
573
|
code?: string;
|
|
488
|
-
/** Controlled string value. */
|
|
574
|
+
/** Controlled value (string or number). For numeric state, read the parsed value back from `onValueChange` — NOT from the `onChange` event, whose `e.target.value` is a string. */
|
|
489
575
|
value?: string | number;
|
|
490
576
|
/** Uncontrolled initial value. */
|
|
491
577
|
defaultValue?: string | number;
|
|
492
|
-
/**
|
|
578
|
+
/** Escape hatch for the native DOM event. `e.target.value` is a **string** (the raw input the user typed), not a number — the field then clamps the displayed value to the currency precision. For controlled numeric state use `onValueChange` instead. */
|
|
493
579
|
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
494
|
-
/**
|
|
580
|
+
/** Primary value callback: the parsed numeric value (`number | null`) plus the clamped, formatted display string. Use this — not `onChange` — for controlled numeric state. */
|
|
495
581
|
onValueChange?: (value: number | null, formatted: string) => void;
|
|
496
582
|
}
|
|
497
583
|
|
|
@@ -516,7 +602,7 @@ interface CurrencyFieldProps extends Omit<React.InputHTMLAttributes<HTMLInputEle
|
|
|
516
602
|
required?: boolean;
|
|
517
603
|
size?: "sm" | "md" | "lg";
|
|
518
604
|
/** Color intent for the focus/open accent. @default "primary" */
|
|
519
|
-
tone?:
|
|
605
|
+
tone?: Tone;
|
|
520
606
|
/** Controlled selected currency code. */
|
|
521
607
|
currency?: string;
|
|
522
608
|
/** Uncontrolled initial currency code. @default "USD" */
|
|
@@ -525,13 +611,13 @@ interface CurrencyFieldProps extends Omit<React.InputHTMLAttributes<HTMLInputEle
|
|
|
525
611
|
onCurrencyChange?: (code: string) => void;
|
|
526
612
|
/** Limit the selectable currencies (codes or {value,label}); defaults to the full built-in list. */
|
|
527
613
|
currencies?: Array<string | CurrencyOption>;
|
|
528
|
-
/** Controlled amount string. */
|
|
614
|
+
/** Controlled amount (string or number). For numeric state, read the parsed value back from `onValueChange` — NOT from the `onChange` event, whose `e.target.value` is a string. */
|
|
529
615
|
value?: string | number;
|
|
530
616
|
/** Uncontrolled initial amount. */
|
|
531
617
|
defaultValue?: string | number;
|
|
532
|
-
/**
|
|
618
|
+
/** Escape hatch for the native DOM event. `e.target.value` is a **string** (the raw input), not a number — the field then clamps the displayed value to the currency precision. For controlled numeric state use `onValueChange`. */
|
|
533
619
|
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
534
|
-
/**
|
|
620
|
+
/** Primary value callback: the parsed number (`number | null`), the clamped formatted string, and the active currency code. Use this — not `onChange` — for controlled numeric state. */
|
|
535
621
|
onValueChange?: (value: number | null, formatted: string, currency: string) => void;
|
|
536
622
|
}
|
|
537
623
|
|
|
@@ -541,9 +627,9 @@ declare function CurrencyField(props: CurrencyFieldProps): React.JSX.Element;
|
|
|
541
627
|
* Advanced data table (Material UI Data Grid Premium style): sortable, filterable
|
|
542
628
|
* (per-column operators + quick search), hideable (with a searchable column list),
|
|
543
629
|
* and pinnable (left/right, sticky) columns, drag-to-reorder and drag-to-resize
|
|
544
|
-
* columns, a column-management + filter toolbar
|
|
545
|
-
* an optional aggregation/summary footer, optional
|
|
546
|
-
* batch-action toolbar, an actions column (per-row icon buttons + overflow menu),
|
|
630
|
+
* columns, a column-management + filter toolbar (with opt-in density / aggregation /
|
|
631
|
+
* pivot / CSV-export tools), an optional aggregation/summary footer, optional
|
|
632
|
+
* checkbox selection with a batch-action toolbar, an actions column (per-row icon buttons + overflow menu),
|
|
547
633
|
* page-number pagination with a configurable rows-per-page selector, a skeleton
|
|
548
634
|
* loading state, and an optional server-side mode (sort/filter/paginate on the
|
|
549
635
|
* backend — only the current page is loaded). Filter controls and the pager are
|
|
@@ -551,15 +637,15 @@ declare function CurrencyField(props: CurrencyFieldProps): React.JSX.Element;
|
|
|
551
637
|
*
|
|
552
638
|
* @startingPoint section="Data display" subtitle="MUI-style sortable/filterable/pinnable data table" viewport="900x460"
|
|
553
639
|
*/
|
|
554
|
-
interface DatatableProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "rows"> {
|
|
640
|
+
interface DatatableProps<T = any> extends Omit<React.HTMLAttributes<HTMLDivElement>, "rows"> {
|
|
555
641
|
/** Column definitions. */
|
|
556
|
-
columns: DatatableColumn[];
|
|
642
|
+
columns: DatatableColumn<T>[];
|
|
557
643
|
/** Row objects. In server mode, only the current page's rows. */
|
|
558
|
-
rows:
|
|
644
|
+
rows: T[];
|
|
559
645
|
/** Show shimmering skeleton rows instead of data. @default false */
|
|
560
646
|
loading?: boolean;
|
|
561
647
|
/** Returns a stable key per row. @default (r,i) => r.id ?? i */
|
|
562
|
-
rowKey?: (row:
|
|
648
|
+
rowKey?: (row: T, index: number) => string | number;
|
|
563
649
|
/** Render a leading checkbox-selection column. @default false */
|
|
564
650
|
checkboxSelection?: boolean;
|
|
565
651
|
/** Render a leading auto-numbered row column (1, 2, 3…). The number reflects each row's position in
|
|
@@ -578,8 +664,8 @@ interface DatatableProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "row
|
|
|
578
664
|
* cross-page selections, use the complete `selectedKeys` array and re-fetch the
|
|
579
665
|
* full row objects server-side rather than relying on `selectedRows`.
|
|
580
666
|
*/
|
|
581
|
-
batchActions?: DatatableBatchAction[];
|
|
582
|
-
/** Row height preset.
|
|
667
|
+
batchActions?: DatatableBatchAction<T>[];
|
|
668
|
+
/** Row height preset. With `showDensity`, the toolbar density button cycles it locally; changing this prop re-applies it. @default "comfortable" */
|
|
583
669
|
density?: "compact" | "standard" | "comfortable";
|
|
584
670
|
/** Initial rows per page. 0 disables pagination. @default 10 */
|
|
585
671
|
pageSize?: number;
|
|
@@ -598,8 +684,13 @@ interface DatatableProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "row
|
|
|
598
684
|
rowCount?: number;
|
|
599
685
|
/** Server-mode callback fired (debounced) whenever the query changes. */
|
|
600
686
|
onServerChange?: (state: DatatableQuery) => void;
|
|
601
|
-
/** Show the Export toolbar button (split button: click = CSV, chevron = format menu). @default
|
|
687
|
+
/** Show the Export toolbar button (split button: click = CSV, chevron = format menu). @default false */
|
|
602
688
|
showExport?: boolean;
|
|
689
|
+
/** Show the row-density toolbar button (cycles compact / standard / comfortable). The `density` prop
|
|
690
|
+
* still sets the row height even when this button is hidden. @default false */
|
|
691
|
+
showDensity?: boolean;
|
|
692
|
+
/** Show the Pivot toolbar button. Also shown automatically when `pivot` or `pivotMode` is set. @default false */
|
|
693
|
+
showPivot?: boolean;
|
|
603
694
|
/** Filename (without extension) for exports (CSV / Excel). @default "export" */
|
|
604
695
|
exportFilename?: string;
|
|
605
696
|
/** Server-mode precomputed aggregation. Per field, either a scalar/node (used as-is) or a per-function map
|
|
@@ -618,26 +709,28 @@ interface DatatableProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "row
|
|
|
618
709
|
/** Make all columns editable by default (double-click a cell to edit; per-column `editable` overrides). @default false */
|
|
619
710
|
editMode?: boolean;
|
|
620
711
|
/** Called when a cell edit is committed: (updatedRow, originalRow, field). */
|
|
621
|
-
onRowUpdate?: (updatedRow:
|
|
712
|
+
onRowUpdate?: (updatedRow: T, originalRow: T, field: string) => void;
|
|
622
713
|
/** Controlled-rows callback: receives the full next rows array after an edit (client mode). */
|
|
623
|
-
onRowsChange?: (rows:
|
|
714
|
+
onRowsChange?: (rows: T[]) => void;
|
|
624
715
|
/** Fired when the built-in batch editor applies columns across selected rows:
|
|
625
716
|
* (changedRows, patch, selectedKeys). The selection-toolbar "Edit" button appears
|
|
626
717
|
* automatically when there are editable columns. Server-mode caveat: `changedRows`
|
|
627
718
|
* resolves only rows on the currently loaded page; for cross-page selections use the
|
|
628
719
|
* complete `selectedKeys` array and apply the `patch` server-side. */
|
|
629
|
-
onBatchUpdate?: (changedRows:
|
|
720
|
+
onBatchUpdate?: (changedRows: T[], patch: Record<string, any>, selectedKeys: Array<string | number>) => void;
|
|
630
721
|
/** Show a "Go to" page jumper in the footer when there are more than 5 pages. @default true */
|
|
631
722
|
showPageJumper?: boolean;
|
|
632
723
|
/** Click-to-select mode: "row" highlights the clicked row, "cell" highlights a single cell. @default "none" */
|
|
633
724
|
selectionMode?: "none" | "row" | "cell";
|
|
634
725
|
/** Fired when a row is clicked in "row" selection mode: (row, key). */
|
|
635
|
-
onRowClick?: (row:
|
|
726
|
+
onRowClick?: (row: T, key: string | number) => void;
|
|
636
727
|
/** Fired when a cell is clicked in "cell" selection mode: (value, row, field). */
|
|
637
|
-
onCellClick?: (value: any, row:
|
|
728
|
+
onCellClick?: (value: any, row: T, field: string) => void;
|
|
638
729
|
/** Fired when the active cell changes: ({ key, field } | null). */
|
|
639
730
|
onActiveCellChange?: (cell: { key: string | number; field: string } | null) => void;
|
|
640
|
-
/**
|
|
731
|
+
/** Show the **Aggregation** toolbar button and start with the totals row on. From that panel the user
|
|
732
|
+
* toggles totals and picks columns + functions (a column's `aggregation` prop seeds the initial choice);
|
|
733
|
+
* changing the prop re-applies it. When false (the default) the Aggregation button is hidden. @default false */
|
|
641
734
|
showAggregation?: boolean;
|
|
642
735
|
/** Accessible label for the grid (role="grid"). A standard `aria-label` prop takes precedence. @default "Data table" */
|
|
643
736
|
ariaLabel?: string;
|
|
@@ -678,6 +771,18 @@ interface DatatableProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "row
|
|
|
678
771
|
rowHeight?: number;
|
|
679
772
|
}
|
|
680
773
|
|
|
774
|
+
/** String-column filter operators (Datatable server mode). */
|
|
775
|
+
type DatatableStringOp = "contains" | "equals" | "startsWith" | "endsWith" | "isEmpty" | "isNotEmpty" | "isAnyOf";
|
|
776
|
+
/** Number-column filter operators. */
|
|
777
|
+
type DatatableNumberOp = "=" | "!=" | ">" | ">=" | "<" | "<=" | "isAnyOf";
|
|
778
|
+
/** Any Datatable filter operator. */
|
|
779
|
+
type DatatableFilterOp = DatatableStringOp | DatatableNumberOp;
|
|
780
|
+
/** A single active filter — the value shape is discriminated by `op`. */
|
|
781
|
+
type DatatableFilter =
|
|
782
|
+
| { field: string; op: "isAnyOf"; value: string[] }
|
|
783
|
+
| { field: string; op: "isEmpty" | "isNotEmpty"; value?: undefined }
|
|
784
|
+
| { field: string; op: Exclude<DatatableFilterOp, "isAnyOf" | "isEmpty" | "isNotEmpty">; value: string };
|
|
785
|
+
|
|
681
786
|
/** Query state reported by a server-mode Datatable. */
|
|
682
787
|
interface DatatableQuery {
|
|
683
788
|
/** Zero-based page index. */
|
|
@@ -686,13 +791,16 @@ interface DatatableQuery {
|
|
|
686
791
|
pageSize: number;
|
|
687
792
|
/** Active sort, or null. */
|
|
688
793
|
sort: { field: string; dir: "asc" | "desc" } | null;
|
|
689
|
-
/**
|
|
690
|
-
|
|
794
|
+
/**
|
|
795
|
+
* Active column filters. String columns emit contains/equals/startsWith/endsWith/isAnyOf/isEmpty/isNotEmpty;
|
|
796
|
+
* number columns emit =, !=, >, >=, <, <=. `value` is a `string[]` for `isAnyOf` and omitted for `isEmpty`/`isNotEmpty`.
|
|
797
|
+
*/
|
|
798
|
+
filters: DatatableFilter[];
|
|
691
799
|
/** Quick-search text. */
|
|
692
800
|
quickFilter: string;
|
|
693
801
|
}
|
|
694
802
|
|
|
695
|
-
interface DatatableColumn {
|
|
803
|
+
interface DatatableColumn<T = any> {
|
|
696
804
|
/** Row object key (also the sort/filter key). */
|
|
697
805
|
field: string;
|
|
698
806
|
/** Header label. @default field ("Actions" for actions columns) */
|
|
@@ -718,11 +826,11 @@ interface DatatableColumn {
|
|
|
718
826
|
/** Allow drag-to-resize of this column. @default true */
|
|
719
827
|
resizable?: boolean;
|
|
720
828
|
/** Summary-footer aggregation: a preset, or a function over the column's values. */
|
|
721
|
-
aggregation?: "sum" | "avg" | "min" | "max" | "count" | ((values: any[], rows:
|
|
829
|
+
aggregation?: "sum" | "avg" | "min" | "max" | "count" | ((values: any[], rows: T[]) => React.ReactNode);
|
|
722
830
|
/** Format an aggregation result for the footer (falls back to valueFormatter). */
|
|
723
831
|
aggregationFormatter?: (value: any) => React.ReactNode;
|
|
724
832
|
/** Map a row to its exported CSV value (defaults to the raw field value). */
|
|
725
|
-
exportValue?: (value: any, row:
|
|
833
|
+
exportValue?: (value: any, row: T) => string | number;
|
|
726
834
|
/** Make this column's cells editable (double-click to edit). Overrides the grid `editMode`. */
|
|
727
835
|
editable?: boolean;
|
|
728
836
|
/** Editor type. "select" (or any column with `valueOptions`) renders a dropdown; else a text/number input by column type. */
|
|
@@ -735,21 +843,21 @@ interface DatatableColumn {
|
|
|
735
843
|
/** Distinct values for the "is any of" multi-value filter (recommended in server mode). */
|
|
736
844
|
valueOptions?: Array<string | { value: string; label: string }>;
|
|
737
845
|
/** Format the raw value to a string/number for display. */
|
|
738
|
-
valueFormatter?: (value: any, row:
|
|
846
|
+
valueFormatter?: (value: any, row: T) => React.ReactNode;
|
|
739
847
|
/** Fully custom cell renderer (badges, avatars, etc.). */
|
|
740
|
-
renderCell?: (value: any, row:
|
|
848
|
+
renderCell?: (value: any, row: T) => React.ReactNode;
|
|
741
849
|
/** For type:"actions" — returns the row's action items. */
|
|
742
|
-
getActions?: (row:
|
|
850
|
+
getActions?: (row: T) => DatatableRowAction<T>[];
|
|
743
851
|
}
|
|
744
852
|
|
|
745
853
|
/** A per-row action in an actions column. */
|
|
746
|
-
interface DatatableRowAction {
|
|
854
|
+
interface DatatableRowAction<T = any> {
|
|
747
855
|
/** Icon node (rendered as an icon button, or leading icon in the overflow menu). */
|
|
748
856
|
icon?: React.ReactNode;
|
|
749
857
|
/** Accessible label / tooltip / menu text. */
|
|
750
858
|
label: string;
|
|
751
859
|
/** Click handler, receives the row. */
|
|
752
|
-
onClick?: (row:
|
|
860
|
+
onClick?: (row: T) => void;
|
|
753
861
|
/** Place in the ⋮ overflow menu instead of inline. @default false */
|
|
754
862
|
showInMenu?: boolean;
|
|
755
863
|
/** Render in danger color. */
|
|
@@ -758,19 +866,19 @@ interface DatatableRowAction {
|
|
|
758
866
|
}
|
|
759
867
|
|
|
760
868
|
/** A batch action shown in the selection toolbar. */
|
|
761
|
-
interface DatatableBatchAction {
|
|
869
|
+
interface DatatableBatchAction<T = any> {
|
|
762
870
|
/** Button label. */
|
|
763
871
|
label: string;
|
|
764
872
|
/** Leading icon node. */
|
|
765
873
|
icon?: React.ReactNode;
|
|
766
874
|
/** Handler: (selectedKeys, selectedRows, clearSelection). */
|
|
767
|
-
onClick?: (keys: Array<string | number>, rows:
|
|
875
|
+
onClick?: (keys: Array<string | number>, rows: T[], clearSelection: () => void) => void;
|
|
768
876
|
/** Render in danger color. */
|
|
769
877
|
danger?: boolean;
|
|
770
878
|
disabled?: boolean;
|
|
771
879
|
}
|
|
772
880
|
|
|
773
|
-
declare function Datatable(props: DatatableProps): React.JSX.Element;
|
|
881
|
+
declare function Datatable<T = any>(props: DatatableProps<T>): React.JSX.Element;
|
|
774
882
|
|
|
775
883
|
/**
|
|
776
884
|
* Apply a `DatatableQuery` (the object a `serverMode` grid passes to
|
|
@@ -787,7 +895,7 @@ declare function Datatable(props: DatatableProps): React.JSX.Element;
|
|
|
787
895
|
declare function runDatatableQuery<T = any>(
|
|
788
896
|
rows: T[],
|
|
789
897
|
query: DatatableQuery,
|
|
790
|
-
options?: { columns?: DatatableColumn[]; searchFields?: string[] }
|
|
898
|
+
options?: { columns?: DatatableColumn<T>[]; searchFields?: string[] }
|
|
791
899
|
): { rows: T[]; total: number; filtered: T[] };
|
|
792
900
|
|
|
793
901
|
/**
|
|
@@ -816,7 +924,7 @@ interface DatePickerProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "on
|
|
|
816
924
|
max?: Date;
|
|
817
925
|
disabled?: boolean;
|
|
818
926
|
/** Color intent for the focus/open accent. @default "primary" */
|
|
819
|
-
tone?:
|
|
927
|
+
tone?: Tone;
|
|
820
928
|
/** Show a clear (×) button when a date is set. @default true */
|
|
821
929
|
clearable?: boolean;
|
|
822
930
|
/** Custom display formatter (defaults to a localized medium date). */
|
|
@@ -864,7 +972,7 @@ interface DateRangePickerProps extends Omit<React.HTMLAttributes<HTMLDivElement>
|
|
|
864
972
|
/** Disable all interaction (the popover cannot be opened). @default false */
|
|
865
973
|
disabled?: boolean;
|
|
866
974
|
/** Color intent for the focus/open accent. @default "primary" */
|
|
867
|
-
tone?:
|
|
975
|
+
tone?: Tone;
|
|
868
976
|
onChange?: (range: DateRange) => void;
|
|
869
977
|
}
|
|
870
978
|
|
|
@@ -899,7 +1007,7 @@ declare function Dialog(props: DialogProps): React.JSX.Element | null;
|
|
|
899
1007
|
* (or left/right-aligned) label.
|
|
900
1008
|
*/
|
|
901
1009
|
interface DividerProps extends React.HTMLAttributes<HTMLElement> {
|
|
902
|
-
/** @default "horizontal" */
|
|
1010
|
+
/** Rule axis — applies to both the plain and the labeled variant (exposed as `aria-orientation`). @default "horizontal" */
|
|
903
1011
|
orientation?: "horizontal" | "vertical";
|
|
904
1012
|
/** Indent the start of a horizontal rule. */
|
|
905
1013
|
inset?: boolean;
|
|
@@ -949,7 +1057,7 @@ interface EmptyStateProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "ti
|
|
|
949
1057
|
description?: React.ReactNode;
|
|
950
1058
|
/** Action buttons row. */
|
|
951
1059
|
actions?: React.ReactNode;
|
|
952
|
-
/** Add a dashed border (good for drop targets / placeholders). @deprecated
|
|
1060
|
+
/** Add a dashed border (good for drop targets / placeholders). @deprecated since 1.4, removed in 2.0 — use `border`. @default false */
|
|
953
1061
|
bordered?: boolean;
|
|
954
1062
|
/** Add a dashed border (good for drop targets / placeholders); preferred alias for `bordered`. @default false */
|
|
955
1063
|
border?: boolean;
|
|
@@ -1008,7 +1116,7 @@ interface FileUploadProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "on
|
|
|
1008
1116
|
multiple?: boolean;
|
|
1009
1117
|
disabled?: boolean;
|
|
1010
1118
|
/** Color intent for the focus/open accent. @default "primary" */
|
|
1011
|
-
tone?:
|
|
1119
|
+
tone?: Tone;
|
|
1012
1120
|
/** Field label rendered above the dropzone. */
|
|
1013
1121
|
label?: React.ReactNode;
|
|
1014
1122
|
/** Hint line under the prompt (defaults to the accept types). */
|
|
@@ -1038,7 +1146,7 @@ interface IconButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>
|
|
|
1038
1146
|
variant?: "solid" | "soft" | "outline" | "ghost";
|
|
1039
1147
|
/** Color/intent, orthogonal to `variant` (mirrors Button). A destructive icon button is
|
|
1040
1148
|
* `tone="danger"` with any variant. @default "primary" */
|
|
1041
|
-
tone?:
|
|
1149
|
+
tone?: ActionTone;
|
|
1042
1150
|
/** Control size; "xs" (~26px) is smaller than "sm". @default "md" */
|
|
1043
1151
|
size?: "xs" | "sm" | "md" | "lg";
|
|
1044
1152
|
/** Fully rounded (circular). @default false */
|
|
@@ -1066,7 +1174,7 @@ interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "
|
|
|
1066
1174
|
/** Control size. @default "md" */
|
|
1067
1175
|
size?: "sm" | "md" | "lg";
|
|
1068
1176
|
/** Color intent for the focus/open accent. @default "primary" */
|
|
1069
|
-
tone?:
|
|
1177
|
+
tone?: Tone;
|
|
1070
1178
|
/** Icon node inside the field, leading edge (prefix). */
|
|
1071
1179
|
leftIcon?: React.ReactNode;
|
|
1072
1180
|
/** Optional suffix icon/node inside the field, trailing edge. For `type="password"`, omitting this
|
|
@@ -1081,6 +1189,8 @@ interface KanbanColumn {
|
|
|
1081
1189
|
id: string;
|
|
1082
1190
|
/** Column heading. */
|
|
1083
1191
|
title: React.ReactNode;
|
|
1192
|
+
/** Accessible name for the column group — use when `title` is a non-string node. Falls back to a string title, then the id. */
|
|
1193
|
+
ariaLabel?: string;
|
|
1084
1194
|
/** Dot color for the heading. */
|
|
1085
1195
|
color?: string;
|
|
1086
1196
|
}
|
|
@@ -1091,6 +1201,8 @@ interface KanbanCard {
|
|
|
1091
1201
|
column: string;
|
|
1092
1202
|
title?: React.ReactNode;
|
|
1093
1203
|
description?: React.ReactNode;
|
|
1204
|
+
/** Accessible name for the card — use when the card content is graphical/icon-only. Falls back to a string title, then "Card". */
|
|
1205
|
+
ariaLabel?: string;
|
|
1094
1206
|
/** Small uppercase tag chips. */
|
|
1095
1207
|
tags?: React.ReactNode[];
|
|
1096
1208
|
/** Footer node (e.g. an Avatar / due date). */
|
|
@@ -1117,6 +1229,8 @@ interface KanbanProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
1117
1229
|
onCardMove?: (cardId: string, toColumn: string, nextCards: KanbanCard[]) => void;
|
|
1118
1230
|
/** Custom card renderer. */
|
|
1119
1231
|
renderCard?: (card: KanbanCard) => React.ReactNode;
|
|
1232
|
+
/** Accessible name for each card — supply this when `renderCard` produces graphical/icon-only content; falls back to a string title or "Card". */
|
|
1233
|
+
getCardLabel?: (card: KanbanCard) => string;
|
|
1120
1234
|
}
|
|
1121
1235
|
|
|
1122
1236
|
declare function Kanban(props: KanbanProps): React.JSX.Element;
|
|
@@ -1168,7 +1282,7 @@ interface MultiSelectProps extends Omit<React.InputHTMLAttributes<HTMLInputEleme
|
|
|
1168
1282
|
/** Control height preset, matching Select/Combobox. @default "md" */
|
|
1169
1283
|
size?: "sm" | "md" | "lg";
|
|
1170
1284
|
/** Color intent for the focus/open accent. @default "primary" */
|
|
1171
|
-
tone?:
|
|
1285
|
+
tone?: Tone;
|
|
1172
1286
|
placeholder?: string;
|
|
1173
1287
|
/** Options — strings, {value,label,description}, or {group,options} groups. */
|
|
1174
1288
|
options: Array<string | MultiSelectOption | MultiSelectGroup>;
|
|
@@ -1176,6 +1290,7 @@ interface MultiSelectProps extends Omit<React.InputHTMLAttributes<HTMLInputEleme
|
|
|
1176
1290
|
value?: string[];
|
|
1177
1291
|
/** Uncontrolled initial values. */
|
|
1178
1292
|
defaultValue?: string[];
|
|
1293
|
+
/** Called with the full array of selected values (empty array when none/cleared). */
|
|
1179
1294
|
onChange?: (values: string[]) => void;
|
|
1180
1295
|
/** Show a clear-all (×) affix when at least one value is selected. @default false */
|
|
1181
1296
|
clearable?: boolean;
|
|
@@ -1194,18 +1309,11 @@ interface MultiSelectProps extends Omit<React.InputHTMLAttributes<HTMLInputEleme
|
|
|
1194
1309
|
onKeyDown?: React.KeyboardEventHandler<HTMLInputElement>;
|
|
1195
1310
|
}
|
|
1196
1311
|
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
label: string;
|
|
1200
|
-
/** Optional second line shown under the label. */
|
|
1201
|
-
description?: string;
|
|
1202
|
-
}
|
|
1312
|
+
/** Alias of the shared {@link Option} type (kept for backward-compatible imports). */
|
|
1313
|
+
type MultiSelectOption = Option;
|
|
1203
1314
|
|
|
1204
|
-
/**
|
|
1205
|
-
|
|
1206
|
-
group: string;
|
|
1207
|
-
options: Array<string | MultiSelectOption>;
|
|
1208
|
-
}
|
|
1315
|
+
/** Alias of the shared {@link OptionGroup} type (kept for backward-compatible imports). */
|
|
1316
|
+
type MultiSelectGroup = OptionGroup;
|
|
1209
1317
|
|
|
1210
1318
|
declare function MultiSelect(props: MultiSelectProps): React.JSX.Element;
|
|
1211
1319
|
|
|
@@ -1239,6 +1347,12 @@ interface NavbarProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
1239
1347
|
sticky?: boolean;
|
|
1240
1348
|
/** Hamburger handler shown on small screens. */
|
|
1241
1349
|
onMenuClick?: () => void;
|
|
1350
|
+
/** Drives the hamburger's `aria-expanded` and its "Open menu"/"Close menu" accessible name. */
|
|
1351
|
+
menuOpen?: boolean;
|
|
1352
|
+
/** Id of the menu/drawer the hamburger controls (`aria-controls`). */
|
|
1353
|
+
menuControls?: string;
|
|
1354
|
+
/** Accessible name for the links `<nav>` landmark. @default "Primary" */
|
|
1355
|
+
navLabel?: string;
|
|
1242
1356
|
}
|
|
1243
1357
|
|
|
1244
1358
|
declare function Navbar(props: NavbarProps): React.JSX.Element;
|
|
@@ -1261,7 +1375,7 @@ interface PaginationProps extends Omit<React.HTMLAttributes<HTMLElement>, "onCha
|
|
|
1261
1375
|
boundaries?: number;
|
|
1262
1376
|
/** @default "md" */
|
|
1263
1377
|
size?: "sm" | "md" | "lg";
|
|
1264
|
-
/** Show a "Go to" page input for jumping directly to a page. @deprecated
|
|
1378
|
+
/** Show a "Go to" page input for jumping directly to a page. @deprecated since 1.4, removed in 2.0 — use `showPageJumper`. @default false */
|
|
1265
1379
|
showJumper?: boolean;
|
|
1266
1380
|
/** Show a "Go to" page input for jumping directly to a page; preferred alias for `showJumper`. @default false */
|
|
1267
1381
|
showPageJumper?: boolean;
|
|
@@ -1301,8 +1415,9 @@ declare function Popover(props: PopoverProps): React.JSX.Element;
|
|
|
1301
1415
|
|
|
1302
1416
|
/**
|
|
1303
1417
|
* Linear progress bar — determinate or indeterminate, with semantic tones.
|
|
1304
|
-
* `className` and
|
|
1305
|
-
*
|
|
1418
|
+
* `className` and extra HTML attributes (`style`, `id`, handlers, …) land on the root
|
|
1419
|
+
* wrapper; `role="progressbar"` + `aria-value*` live on the inner track. `aria-label` /
|
|
1420
|
+
* `aria-labelledby` are forwarded onto that track so they actually name the bar.
|
|
1306
1421
|
*/
|
|
1307
1422
|
interface ProgressProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
1308
1423
|
/** Current value. @default 0 */
|
|
@@ -1310,13 +1425,18 @@ interface ProgressProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
1310
1425
|
/** Maximum value. @default 100 */
|
|
1311
1426
|
max?: number;
|
|
1312
1427
|
/** @default "primary" */
|
|
1313
|
-
tone?:
|
|
1428
|
+
tone?: BarTone;
|
|
1314
1429
|
/** @default "md" */
|
|
1315
1430
|
size?: "sm" | "md" | "lg";
|
|
1316
1431
|
/** Animate as an indeterminate bar (ignores value). */
|
|
1317
1432
|
indeterminate?: boolean;
|
|
1318
1433
|
/** Show a percentage label above the bar. */
|
|
1319
1434
|
showLabel?: boolean;
|
|
1435
|
+
/**
|
|
1436
|
+
* Visible label in the meta row that also names the progressbar (via `aria-labelledby`).
|
|
1437
|
+
* @default "Progress" (only rendered when `showLabel` or `label` is set)
|
|
1438
|
+
*/
|
|
1439
|
+
label?: React.ReactNode;
|
|
1320
1440
|
}
|
|
1321
1441
|
|
|
1322
1442
|
declare function Progress(props: ProgressProps): React.JSX.Element;
|
|
@@ -1331,7 +1451,7 @@ interface RadioProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "
|
|
|
1331
1451
|
error?: React.ReactNode;
|
|
1332
1452
|
size?: "sm" | "md" | "lg";
|
|
1333
1453
|
/** Color intent. @default "primary" */
|
|
1334
|
-
tone?:
|
|
1454
|
+
tone?: Tone;
|
|
1335
1455
|
}
|
|
1336
1456
|
|
|
1337
1457
|
declare function Radio(props: RadioProps): React.JSX.Element;
|
|
@@ -1351,7 +1471,7 @@ interface RatingProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChan
|
|
|
1351
1471
|
/** @default "md" */
|
|
1352
1472
|
size?: "sm" | "md" | "lg";
|
|
1353
1473
|
/** Color intent for filled stars. @default "warning" */
|
|
1354
|
-
tone?:
|
|
1474
|
+
tone?: Tone;
|
|
1355
1475
|
/** Explicit filled-star color; overrides `tone` when set. */
|
|
1356
1476
|
color?: string;
|
|
1357
1477
|
/** Display only, no interaction. @default false */
|
|
@@ -1378,7 +1498,7 @@ interface SelectProps extends Omit<React.HTMLAttributes<HTMLButtonElement>, "onC
|
|
|
1378
1498
|
required?: boolean;
|
|
1379
1499
|
size?: "sm" | "md" | "lg";
|
|
1380
1500
|
/** Color intent for the focus/open accent. @default "primary" */
|
|
1381
|
-
tone?:
|
|
1501
|
+
tone?: Tone;
|
|
1382
1502
|
placeholder?: string;
|
|
1383
1503
|
/** Placeholder for the in-popover search box. @default "Search…" */
|
|
1384
1504
|
searchPlaceholder?: string;
|
|
@@ -1409,18 +1529,11 @@ interface SelectProps extends Omit<React.HTMLAttributes<HTMLButtonElement>, "onC
|
|
|
1409
1529
|
minWidth?: number;
|
|
1410
1530
|
}
|
|
1411
1531
|
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
label: string;
|
|
1415
|
-
/** Optional second line shown under the label. */
|
|
1416
|
-
description?: string;
|
|
1417
|
-
}
|
|
1532
|
+
/** Alias of the shared {@link Option} type (kept for backward-compatible imports). */
|
|
1533
|
+
type SelectOption = Option;
|
|
1418
1534
|
|
|
1419
|
-
/**
|
|
1420
|
-
|
|
1421
|
-
group: string;
|
|
1422
|
-
options: Array<string | SelectOption>;
|
|
1423
|
-
}
|
|
1535
|
+
/** Alias of the shared {@link OptionGroup} type (kept for backward-compatible imports). */
|
|
1536
|
+
type SelectGroup = OptionGroup;
|
|
1424
1537
|
|
|
1425
1538
|
declare function Select(props: SelectProps): React.JSX.Element;
|
|
1426
1539
|
|
|
@@ -1441,6 +1554,7 @@ interface SidebarItem {
|
|
|
1441
1554
|
/**
|
|
1442
1555
|
* Collapsible side navigation — brand header, grouped nav items with icons and
|
|
1443
1556
|
* badges, an optional footer, and a collapse toggle (icon-only when collapsed).
|
|
1557
|
+
* Set `overlay` for a mobile off-canvas drawer (backdrop, focus trap, Escape-to-close).
|
|
1444
1558
|
*
|
|
1445
1559
|
* @startingPoint section="Layout" subtitle="Collapsible side navigation" viewport="280x520"
|
|
1446
1560
|
*/
|
|
@@ -1456,12 +1570,30 @@ interface SidebarProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
1456
1570
|
/** Show the collapse toggle. @default true */
|
|
1457
1571
|
collapsible?: boolean;
|
|
1458
1572
|
onCollapsedChange?: (collapsed: boolean) => void;
|
|
1573
|
+
/**
|
|
1574
|
+
* Render as an off-canvas drawer instead of an in-flow rail: a fixed slide-over
|
|
1575
|
+
* panel behind a dismissable backdrop, portaled to `document.body`, with a focus
|
|
1576
|
+
* trap, Escape-to-close, and body-scroll lock. Drive visibility with
|
|
1577
|
+
* `open`/`defaultOpen`/`onOpenChange`. For a responsive layout, render the rail on
|
|
1578
|
+
* desktop and the overlay on mobile. @default false
|
|
1579
|
+
*/
|
|
1580
|
+
overlay?: boolean;
|
|
1581
|
+
/** Controlled open state of the overlay drawer (only when `overlay`). */
|
|
1582
|
+
open?: boolean;
|
|
1583
|
+
/** Uncontrolled initial open state of the overlay drawer. @default false */
|
|
1584
|
+
defaultOpen?: boolean;
|
|
1585
|
+
/** Called when the overlay drawer requests open/close (backdrop, Escape). */
|
|
1586
|
+
onOpenChange?: (open: boolean) => void;
|
|
1587
|
+
/** Accessible name for the inner `<nav>` landmark (and the overlay dialog). @default "Main" */
|
|
1588
|
+
navLabel?: string;
|
|
1459
1589
|
}
|
|
1460
1590
|
|
|
1461
1591
|
declare function Sidebar(props: SidebarProps): React.JSX.Element;
|
|
1462
1592
|
|
|
1463
1593
|
/**
|
|
1464
|
-
* Shimmering placeholder shown while content loads.
|
|
1594
|
+
* Shimmering placeholder shown while content loads. Decorative by default — the
|
|
1595
|
+
* placeholder gets `aria-hidden="true"` so screen readers skip it. Pass `label` to
|
|
1596
|
+
* instead announce loading via a `role="status"` live region.
|
|
1465
1597
|
*/
|
|
1466
1598
|
interface SkeletonProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
1467
1599
|
/** Shape preset: "text" line(s), "circle" (1:1 aspect, full radius), or "rect" block (--radius-md). @default "text" */
|
|
@@ -1472,6 +1604,11 @@ interface SkeletonProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
|
1472
1604
|
height?: string | number;
|
|
1473
1605
|
/** For text variant: number of lines (last is shortened). @default 1 */
|
|
1474
1606
|
lines?: number;
|
|
1607
|
+
/**
|
|
1608
|
+
* When set, announces loading via `role="status"` + `aria-live="polite"` + `aria-busy="true"`
|
|
1609
|
+
* plus visually-hidden text (e.g. "Loading…"); otherwise the placeholder is `aria-hidden="true"`.
|
|
1610
|
+
*/
|
|
1611
|
+
label?: string;
|
|
1475
1612
|
}
|
|
1476
1613
|
|
|
1477
1614
|
declare function Skeleton(props: SkeletonProps): React.JSX.Element;
|
|
@@ -1505,7 +1642,7 @@ interface SliderProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChan
|
|
|
1505
1642
|
/** Render step ticks along the rail. @default false */
|
|
1506
1643
|
showTicks?: boolean;
|
|
1507
1644
|
/** Color intent. @default "primary" */
|
|
1508
|
-
tone?:
|
|
1645
|
+
tone?: Tone;
|
|
1509
1646
|
/** Format the displayed value (label + bubble). */
|
|
1510
1647
|
formatValue?: (value: number) => React.ReactNode;
|
|
1511
1648
|
onChange?: (value: number) => void;
|
|
@@ -1520,9 +1657,9 @@ interface SpinnerProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
|
1520
1657
|
/** @default "md" */
|
|
1521
1658
|
size?: "sm" | "md" | "lg" | "xl";
|
|
1522
1659
|
/** Color. Wins over `tone` when both are set. @default "current" — inherits currentColor (visible inside buttons, themed). */
|
|
1523
|
-
color?: "current" |
|
|
1524
|
-
/** Color. @deprecated
|
|
1525
|
-
tone?: "current" |
|
|
1660
|
+
color?: "current" | Tone | "white";
|
|
1661
|
+
/** Color. @deprecated since 1.4, removed in 2.0 — use `color`. @default "current" — inherits currentColor (visible inside buttons, themed). */
|
|
1662
|
+
tone?: "current" | Tone | "white";
|
|
1526
1663
|
/** Accessible label. @default "Loading" */
|
|
1527
1664
|
label?: string;
|
|
1528
1665
|
}
|
|
@@ -1577,7 +1714,7 @@ interface StepperProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
1577
1714
|
/** @default "horizontal" */
|
|
1578
1715
|
orientation?: "horizontal" | "vertical";
|
|
1579
1716
|
/** Color intent. @default "primary" */
|
|
1580
|
-
tone?:
|
|
1717
|
+
tone?: Tone;
|
|
1581
1718
|
/** Allow clicking completed/active steps. @default false */
|
|
1582
1719
|
clickable?: boolean;
|
|
1583
1720
|
/** Fired when a clickable step is clicked. */
|
|
@@ -1598,7 +1735,7 @@ interface SwitchProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>,
|
|
|
1598
1735
|
error?: React.ReactNode;
|
|
1599
1736
|
size?: "sm" | "md" | "lg";
|
|
1600
1737
|
/** Color intent. @default "primary" */
|
|
1601
|
-
tone?:
|
|
1738
|
+
tone?: Tone;
|
|
1602
1739
|
}
|
|
1603
1740
|
|
|
1604
1741
|
declare function Switch(props: SwitchProps): React.JSX.Element;
|
|
@@ -1681,7 +1818,7 @@ interface TabsProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChange
|
|
|
1681
1818
|
/** @default "line" */
|
|
1682
1819
|
variant?: "line" | "pill";
|
|
1683
1820
|
/** Color intent. @default "primary" */
|
|
1684
|
-
tone?:
|
|
1821
|
+
tone?: Tone;
|
|
1685
1822
|
/** Layout axis. Vertical stacks the tablist with the indicator on its trailing edge and the panel beside it; ArrowUp/ArrowDown navigate. @default "horizontal" */
|
|
1686
1823
|
orientation?: "horizontal" | "vertical";
|
|
1687
1824
|
}
|
|
@@ -1693,8 +1830,10 @@ interface TabItem {
|
|
|
1693
1830
|
label: React.ReactNode;
|
|
1694
1831
|
/** Optional leading icon. */
|
|
1695
1832
|
icon?: React.ReactNode;
|
|
1696
|
-
/** Optional count pill. */
|
|
1697
|
-
count?:
|
|
1833
|
+
/** Optional count pill (e.g. `12`, `"99+"`, `"1.2k"`, or an element). Renders whenever `count != null` — pass `undefined` to hide a `0`. */
|
|
1834
|
+
count?: React.ReactNode;
|
|
1835
|
+
/** Disable the tab: not selectable via click or keyboard; dimmed and `aria-disabled`. */
|
|
1836
|
+
disabled?: boolean;
|
|
1698
1837
|
/** Panel content rendered when active (omit for nav-only tabs). */
|
|
1699
1838
|
content?: React.ReactNode;
|
|
1700
1839
|
}
|
|
@@ -1707,12 +1846,14 @@ declare function Tabs(props: TabsProps): React.JSX.Element;
|
|
|
1707
1846
|
interface TagProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
1708
1847
|
/** Show a remove (×) button and handle its click. */
|
|
1709
1848
|
onRemove?: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
1849
|
+
/** Accessible label for the remove (×) button. Defaults to `Remove {children}` when children is a string, else "Remove". */
|
|
1850
|
+
removeLabel?: string;
|
|
1710
1851
|
/** Optional leading icon. */
|
|
1711
1852
|
leftIcon?: React.ReactNode;
|
|
1712
1853
|
/** Fill style. @default "soft" */
|
|
1713
1854
|
variant?: "soft" | "solid" | "outline";
|
|
1714
1855
|
/** Color intent. @default "neutral" */
|
|
1715
|
-
tone?:
|
|
1856
|
+
tone?: Tone;
|
|
1716
1857
|
children?: React.ReactNode;
|
|
1717
1858
|
}
|
|
1718
1859
|
|
|
@@ -1733,7 +1874,7 @@ interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement
|
|
|
1733
1874
|
/** Control size — same padding steps as Input. @default "md" */
|
|
1734
1875
|
size?: "sm" | "md" | "lg";
|
|
1735
1876
|
/** Color intent for the focus/open accent. @default "primary" */
|
|
1736
|
-
tone?:
|
|
1877
|
+
tone?: Tone;
|
|
1737
1878
|
}
|
|
1738
1879
|
|
|
1739
1880
|
declare function Textarea(props: TextareaProps): React.JSX.Element;
|
|
@@ -1748,7 +1889,7 @@ interface TimelineItem {
|
|
|
1748
1889
|
/** Icon inside the node dot. */
|
|
1749
1890
|
icon?: React.ReactNode;
|
|
1750
1891
|
/** Node color. */
|
|
1751
|
-
tone?:
|
|
1892
|
+
tone?: BarTone;
|
|
1752
1893
|
}
|
|
1753
1894
|
|
|
1754
1895
|
/**
|
|
@@ -1769,7 +1910,7 @@ declare function Timeline(props: TimelineProps): React.JSX.Element;
|
|
|
1769
1910
|
*/
|
|
1770
1911
|
interface ToastProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {
|
|
1771
1912
|
/** Semantic tone. `"neutral"` is an alias for `"default"` (matches Badge's vocabulary). @default "default" */
|
|
1772
|
-
tone?:
|
|
1913
|
+
tone?: ToastTone;
|
|
1773
1914
|
/** Bold heading. */
|
|
1774
1915
|
title?: React.ReactNode;
|
|
1775
1916
|
/** Override the tone icon. */
|
|
@@ -1795,7 +1936,7 @@ declare function ToastViewport(props: ToastViewportProps): React.JSX.Element;
|
|
|
1795
1936
|
/** A single toast's options when pushed imperatively. */
|
|
1796
1937
|
interface ToastOptions {
|
|
1797
1938
|
/** @default "default" */
|
|
1798
|
-
tone?:
|
|
1939
|
+
tone?: ToastTone;
|
|
1799
1940
|
/** Bold heading. */
|
|
1800
1941
|
title?: React.ReactNode;
|
|
1801
1942
|
/** Body/description content. */
|
|
@@ -1914,6 +2055,19 @@ interface AppShellProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "chil
|
|
|
1914
2055
|
height?: string | number;
|
|
1915
2056
|
/** Pad the scrollable content region. @default true */
|
|
1916
2057
|
padded?: boolean;
|
|
2058
|
+
/** Id for the `<main>` content region and the skip-link target. @default "twc-main" */
|
|
2059
|
+
mainId?: string;
|
|
2060
|
+
/** Label for the visually-hidden-until-focused skip-to-content link (the shell's first child). Pass `false`/`null` to opt out. @default "Skip to content" */
|
|
2061
|
+
skipLinkLabel?: React.ReactNode | false;
|
|
2062
|
+
/**
|
|
2063
|
+
* Open state of the sidebar's off-canvas drawer on mobile. Providing this (or
|
|
2064
|
+
* `onSidebarOpenChange`) makes the shell forward `overlay`/`open`/`onOpenChange`
|
|
2065
|
+
* to the `sidebar` element, so it renders as a drawer. Respects any of those
|
|
2066
|
+
* props the sidebar already sets.
|
|
2067
|
+
*/
|
|
2068
|
+
sidebarOpen?: boolean;
|
|
2069
|
+
/** Called when the sidebar drawer requests open/close (backdrop, Escape) — wire a `Navbar`'s `onMenuClick` to `() => onSidebarOpenChange(true)`. */
|
|
2070
|
+
onSidebarOpenChange?: (open: boolean) => void;
|
|
1917
2071
|
}
|
|
1918
2072
|
|
|
1919
2073
|
declare function AppShell(props: AppShellProps): React.JSX.Element;
|
|
@@ -1921,7 +2075,7 @@ declare function AppShell(props: AppShellProps): React.JSX.Element;
|
|
|
1921
2075
|
/** Generic, token-styled element — the building block for non-flex layout. */
|
|
1922
2076
|
interface BoxProps extends React.HTMLAttributes<HTMLElement> {
|
|
1923
2077
|
/** Element/tag to render. @default "div" */
|
|
1924
|
-
as?:
|
|
2078
|
+
as?: PolymorphicAs;
|
|
1925
2079
|
/** Link destination — only used with as="a"; scheme-sanitized (javascript:/data:/vbscript: render without href). */
|
|
1926
2080
|
href?: string;
|
|
1927
2081
|
/** Anchor target — only used with as="a" (e.g. "_blank"). */
|
|
@@ -1959,7 +2113,7 @@ declare function Box(props: BoxProps): React.JSX.Element;
|
|
|
1959
2113
|
/** Centered, max-width content wrapper with responsive horizontal padding. */
|
|
1960
2114
|
interface ContainerProps extends React.HTMLAttributes<HTMLElement> {
|
|
1961
2115
|
/** Element/tag to render. @default "div" */
|
|
1962
|
-
as?:
|
|
2116
|
+
as?: PolymorphicAs;
|
|
1963
2117
|
/** Link destination — only used with as="a"; scheme-sanitized (javascript:/data:/vbscript: render without href). */
|
|
1964
2118
|
href?: string;
|
|
1965
2119
|
/** Anchor target — only used with as="a" (e.g. "_blank"). */
|
|
@@ -1974,24 +2128,35 @@ interface ContainerProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
1974
2128
|
|
|
1975
2129
|
declare function Container(props: ContainerProps): React.JSX.Element;
|
|
1976
2130
|
|
|
2131
|
+
/** Responsive column counts per breakpoint (base + sm/md/lg/xl at 640/768/1024/1280px). */
|
|
2132
|
+
type ResponsiveColumns = { base?: number; sm?: number; md?: number; lg?: number; xl?: number };
|
|
2133
|
+
|
|
1977
2134
|
/** CSS grid primitive — fixed columns or a responsive auto-fill grid. */
|
|
1978
2135
|
interface GridProps extends React.HTMLAttributes<HTMLElement> {
|
|
1979
2136
|
/** Element/tag to render. @default "div" */
|
|
1980
|
-
as?:
|
|
2137
|
+
as?: PolymorphicAs;
|
|
1981
2138
|
/** Link destination — only used with as="a"; scheme-sanitized (javascript:/data:/vbscript: render without href). */
|
|
1982
2139
|
href?: string;
|
|
1983
2140
|
/** Anchor target — only used with as="a" (e.g. "_blank"). */
|
|
1984
2141
|
target?: React.HTMLAttributeAnchorTarget;
|
|
1985
2142
|
/** Anchor rel — only used with as="a"; pair "noopener noreferrer" with target="_blank". */
|
|
1986
2143
|
rel?: string;
|
|
1987
|
-
/** Fixed
|
|
1988
|
-
columns?: number;
|
|
2144
|
+
/** Fixed column count, or a responsive object `{ base, sm, md, lg, xl }` (ignored when `minChildWidth` is set). */
|
|
2145
|
+
columns?: number | ResponsiveColumns;
|
|
1989
2146
|
/** Responsive auto-fill: minimum child width (number = px, or any CSS length). */
|
|
1990
2147
|
minChildWidth?: number | string;
|
|
1991
|
-
/** Gap as a spacing-scale step (number) or any CSS length. @default 4 */
|
|
2148
|
+
/** Gap (both axes) as a spacing-scale step (number) or any CSS length. @default 4 */
|
|
1992
2149
|
gap?: number | string;
|
|
2150
|
+
/** Row gap — falls back to `gap`. */
|
|
2151
|
+
rowGap?: number | string;
|
|
2152
|
+
/** Column gap — falls back to `gap`. */
|
|
2153
|
+
columnGap?: number | string;
|
|
1993
2154
|
align?: React.CSSProperties["alignItems"];
|
|
1994
2155
|
justify?: React.CSSProperties["justifyItems"];
|
|
2156
|
+
/** Distribute the grid's rows within extra block space. */
|
|
2157
|
+
alignContent?: React.CSSProperties["alignContent"];
|
|
2158
|
+
/** Distribute the grid's columns within extra inline space. */
|
|
2159
|
+
justifyContent?: React.CSSProperties["justifyContent"];
|
|
1995
2160
|
}
|
|
1996
2161
|
|
|
1997
2162
|
declare function Grid(props: GridProps): React.JSX.Element;
|
|
@@ -1999,7 +2164,7 @@ declare function Grid(props: GridProps): React.JSX.Element;
|
|
|
1999
2164
|
/** Flex layout primitive — rows or columns with token-based gaps. */
|
|
2000
2165
|
interface StackProps extends React.HTMLAttributes<HTMLElement> {
|
|
2001
2166
|
/** Element/tag to render. @default "div" */
|
|
2002
|
-
as?:
|
|
2167
|
+
as?: PolymorphicAs;
|
|
2003
2168
|
/** Link destination — only used with as="a"; scheme-sanitized (javascript:/data:/vbscript: render without href). */
|
|
2004
2169
|
href?: string;
|
|
2005
2170
|
/** Anchor target — only used with as="a" (e.g. "_blank"). */
|
|
@@ -2016,14 +2181,38 @@ interface StackProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
2016
2181
|
wrap?: boolean;
|
|
2017
2182
|
/** Use inline-flex instead of flex. @default false */
|
|
2018
2183
|
inline?: boolean;
|
|
2184
|
+
/** Padding — all sides. Spacing step (number) or any CSS length. */
|
|
2185
|
+
p?: number | string;
|
|
2186
|
+
/** Horizontal (inline) padding. */
|
|
2187
|
+
px?: number | string;
|
|
2188
|
+
/** Vertical (block) padding. */
|
|
2189
|
+
py?: number | string;
|
|
2190
|
+
/** Top padding (overrides `py`/`p`). */
|
|
2191
|
+
pt?: number | string;
|
|
2192
|
+
/** Right padding (overrides `px`/`p`). */
|
|
2193
|
+
pr?: number | string;
|
|
2194
|
+
/** Bottom padding (overrides `py`/`p`). */
|
|
2195
|
+
pb?: number | string;
|
|
2196
|
+
/** Left padding (overrides `px`/`p`). */
|
|
2197
|
+
pl?: number | string;
|
|
2198
|
+
/** Node rendered between each child (not before the first or after the last). Pass an orientation-appropriate `Divider`. */
|
|
2199
|
+
divider?: React.ReactNode;
|
|
2019
2200
|
}
|
|
2020
2201
|
|
|
2021
2202
|
declare function Stack(props: StackProps): React.JSX.Element;
|
|
2022
2203
|
|
|
2023
|
-
/** Inline code
|
|
2204
|
+
/** Inline code, or a scrollable multi-line block with an optional copy button. */
|
|
2024
2205
|
interface CodeProps extends React.HTMLAttributes<HTMLElement> {
|
|
2025
|
-
/** Element/tag to render. @default "code" */
|
|
2026
|
-
as?:
|
|
2206
|
+
/** Element/tag or component to render. @default "code" (or "pre" when `block`) */
|
|
2207
|
+
as?: PolymorphicAs;
|
|
2208
|
+
/** Render a scrollable multi-line `<pre>` block instead of the inline pill; defaults `as` to "pre". @default false */
|
|
2209
|
+
block?: boolean;
|
|
2210
|
+
/** Show a copy-to-clipboard button (typically with `block`). @default false */
|
|
2211
|
+
copyable?: boolean;
|
|
2212
|
+
/** Accessible label for the copy button. @default "Copy code" */
|
|
2213
|
+
copyLabel?: string;
|
|
2214
|
+
/** Accessible label announced after a successful copy. @default "Copied" */
|
|
2215
|
+
copiedLabel?: string;
|
|
2027
2216
|
/** Link destination — only used with as="a"; scheme-sanitized (javascript:/data:/vbscript: render without href). */
|
|
2028
2217
|
href?: string;
|
|
2029
2218
|
/** Anchor target — only used with as="a" (e.g. "_blank"). */
|
|
@@ -2034,10 +2223,17 @@ interface CodeProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
2034
2223
|
|
|
2035
2224
|
declare function Code(props: CodeProps): React.JSX.Element;
|
|
2036
2225
|
|
|
2037
|
-
/**
|
|
2226
|
+
/** Font-size token suffixes available to `Heading` (see tokens/typography.css). */
|
|
2227
|
+
type HeadingSize =
|
|
2228
|
+
| "xs" | "sm" | "base" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "display";
|
|
2229
|
+
|
|
2230
|
+
/**
|
|
2231
|
+
* Heading (h1–h6) with token typography. `level` sets the tag/semantics; `size` sets the visual
|
|
2232
|
+
* scale — the two are intentionally independent (e.g. a semantic `<h1>` at a small size).
|
|
2233
|
+
*/
|
|
2038
2234
|
interface HeadingProps extends React.HTMLAttributes<HTMLElement> {
|
|
2039
2235
|
/** Override the rendered tag (e.g. render a visual h2 as an h1). */
|
|
2040
|
-
as?:
|
|
2236
|
+
as?: PolymorphicAs;
|
|
2041
2237
|
/** Link destination — only used with as="a"; scheme-sanitized (javascript:/data:/vbscript: render without href). */
|
|
2042
2238
|
href?: string;
|
|
2043
2239
|
/** Anchor target — only used with as="a" (e.g. "_blank"). */
|
|
@@ -2046,9 +2242,15 @@ interface HeadingProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
2046
2242
|
rel?: string;
|
|
2047
2243
|
/** Heading level 1–6 — sets the tag and the default size. @default 2 */
|
|
2048
2244
|
level?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
2049
|
-
/**
|
|
2050
|
-
size?:
|
|
2245
|
+
/** Font-size token (xs…7xl or display), independent of `level`. */
|
|
2246
|
+
size?: HeadingSize;
|
|
2247
|
+
/** Convenience: render at the display size (`var(--text-display)`) regardless of level. @default false */
|
|
2248
|
+
display?: boolean;
|
|
2051
2249
|
align?: React.CSSProperties["textAlign"];
|
|
2250
|
+
/** Single-line ellipsis truncation (adds min-width:0 so it shrinks in a flex parent). @default false */
|
|
2251
|
+
truncate?: boolean;
|
|
2252
|
+
/** Clamp to N lines with an ellipsis (multi-line, -webkit-line-clamp). Overrides `truncate`. */
|
|
2253
|
+
lineClamp?: number;
|
|
2052
2254
|
}
|
|
2053
2255
|
|
|
2054
2256
|
declare function Heading(props: HeadingProps): React.JSX.Element;
|
|
@@ -2056,7 +2258,7 @@ declare function Heading(props: HeadingProps): React.JSX.Element;
|
|
|
2056
2258
|
/** Body text with token sizes and semantic color tones. Renders <p> by default. */
|
|
2057
2259
|
interface TextProps extends React.HTMLAttributes<HTMLElement> {
|
|
2058
2260
|
/** Element/tag to render (e.g. "span", "p"). @default "p" */
|
|
2059
|
-
as?:
|
|
2261
|
+
as?: PolymorphicAs;
|
|
2060
2262
|
/** Link destination — only used with as="a"; scheme-sanitized (javascript:/data:/vbscript: render without href). */
|
|
2061
2263
|
href?: string;
|
|
2062
2264
|
/** Anchor target — only used with as="a" (e.g. "_blank"). */
|
|
@@ -2065,11 +2267,15 @@ interface TextProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
2065
2267
|
rel?: string;
|
|
2066
2268
|
/** Font-size token suffix. @default "base" */
|
|
2067
2269
|
size?: "xs" | "sm" | "base" | "lg" | "xl" | string;
|
|
2068
|
-
/** Semantic color tone — text roles (default/muted/subtle)
|
|
2069
|
-
tone?:
|
|
2270
|
+
/** Semantic color tone — text roles (default/muted/subtle), the color intents, or `"inherit"` to adopt the parent color. @default "default" */
|
|
2271
|
+
tone?: TextTone;
|
|
2070
2272
|
/** Font-weight token suffix (e.g. "medium", "semibold", "bold"). */
|
|
2071
2273
|
weight?: "medium" | "semibold" | "bold" | string;
|
|
2072
2274
|
align?: React.CSSProperties["textAlign"];
|
|
2275
|
+
/** Single-line ellipsis truncation (adds min-width:0 so it shrinks in a flex parent). @default false */
|
|
2276
|
+
truncate?: boolean;
|
|
2277
|
+
/** Clamp to N lines with an ellipsis (multi-line, -webkit-line-clamp). Overrides `truncate`. */
|
|
2278
|
+
lineClamp?: number;
|
|
2073
2279
|
}
|
|
2074
2280
|
|
|
2075
2281
|
declare function Text(props: TextProps): React.JSX.Element;
|
|
@@ -2097,15 +2303,30 @@ declare function useDisclosure(initial?: boolean): {
|
|
|
2097
2303
|
setOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
2098
2304
|
};
|
|
2099
2305
|
|
|
2100
|
-
/**
|
|
2306
|
+
/**
|
|
2307
|
+
* Controlled/uncontrolled state — the pattern every form component needs.
|
|
2308
|
+
* Returns `[value, setValue, isControlled]`; the third element reports whether a
|
|
2309
|
+
* `value` prop is currently driving the state. In development it warns once if a
|
|
2310
|
+
* component switches between controlled and uncontrolled.
|
|
2311
|
+
*/
|
|
2101
2312
|
declare function useControllableState<T>(options?: {
|
|
2102
2313
|
value?: T;
|
|
2103
2314
|
defaultValue?: T;
|
|
2104
2315
|
onChange?: (value: T) => void;
|
|
2105
|
-
}): [T, (next: T | ((prev: T) => T)) => void];
|
|
2316
|
+
}): [T, (next: T | ((prev: T) => T)) => void, boolean];
|
|
2106
2317
|
|
|
2107
|
-
|
|
2108
|
-
|
|
2318
|
+
interface UseMediaQueryOptions {
|
|
2319
|
+
/** Value on the server and first client render (before the after-mount sync). @default false */
|
|
2320
|
+
defaultValue?: boolean;
|
|
2321
|
+
/** Read `matchMedia` eagerly in the initializer — client-only apps with no SSR. @default false */
|
|
2322
|
+
initializeWithValue?: boolean;
|
|
2323
|
+
}
|
|
2324
|
+
|
|
2325
|
+
/**
|
|
2326
|
+
* Reactively match a media query. Returns `defaultValue` on the server and the
|
|
2327
|
+
* first client render, then syncs after mount — so hydration never mismatches.
|
|
2328
|
+
*/
|
|
2329
|
+
declare function useMediaQuery(query: string, options?: UseMediaQueryOptions): boolean;
|
|
2109
2330
|
|
|
2110
2331
|
/** `true` when the user requests reduced motion. */
|
|
2111
2332
|
declare function usePrefersReducedMotion(): boolean;
|
|
@@ -2133,13 +2354,13 @@ declare function useColorScheme(options?: UseColorSchemeOptions): {
|
|
|
2133
2354
|
declare function useEventListener(
|
|
2134
2355
|
eventName: string,
|
|
2135
2356
|
handler: (event: any) => void,
|
|
2136
|
-
element?: React.RefObject<any> | EventTarget | null,
|
|
2357
|
+
element?: React.RefObject<any | null> | EventTarget | null,
|
|
2137
2358
|
options?: boolean | AddEventListenerOptions
|
|
2138
2359
|
): void;
|
|
2139
2360
|
|
|
2140
2361
|
/** Call `handler` when a pointer/touch event lands outside `ref`. */
|
|
2141
2362
|
declare function useClickOutside<T extends HTMLElement = HTMLElement>(
|
|
2142
|
-
ref: React.RefObject<T>,
|
|
2363
|
+
ref: React.RefObject<T | null>,
|
|
2143
2364
|
handler: (event: Event) => void,
|
|
2144
2365
|
events?: string[]
|
|
2145
2366
|
): void;
|
|
@@ -2190,11 +2411,11 @@ declare function useTimeout(callback: () => void, delay: number | null): void;
|
|
|
2190
2411
|
declare function useWindowSize(): { width: number; height: number };
|
|
2191
2412
|
|
|
2192
2413
|
/** `true` while the pointer is over the element referenced by `ref`. */
|
|
2193
|
-
declare function useHover<T extends HTMLElement = HTMLElement>(ref: React.RefObject<T>): boolean;
|
|
2414
|
+
declare function useHover<T extends HTMLElement = HTMLElement>(ref: React.RefObject<T | null>): boolean;
|
|
2194
2415
|
|
|
2195
2416
|
/** The latest IntersectionObserver entry for the element referenced by `ref`. */
|
|
2196
2417
|
declare function useIntersectionObserver<T extends HTMLElement = HTMLElement>(
|
|
2197
|
-
ref: React.RefObject<T>,
|
|
2418
|
+
ref: React.RefObject<T | null>,
|
|
2198
2419
|
options?: IntersectionObserverInit
|
|
2199
2420
|
): IntersectionObserverEntry | null;
|
|
2200
2421
|
|
|
@@ -2204,4 +2425,28 @@ declare function useScrollLock(locked?: boolean): void;
|
|
|
2204
2425
|
/** A stable, SSR-safe unique id (optionally prefixed). */
|
|
2205
2426
|
declare function useId(prefix?: string): string;
|
|
2206
2427
|
|
|
2207
|
-
|
|
2428
|
+
/** Options for {@link useFocusTrap}. */
|
|
2429
|
+
interface UseFocusTrapOptions {
|
|
2430
|
+
/** Restore focus to the previously-focused element when the trap deactivates. @default true */
|
|
2431
|
+
restoreFocus?: boolean;
|
|
2432
|
+
}
|
|
2433
|
+
|
|
2434
|
+
/**
|
|
2435
|
+
* Trap focus inside the modal region referenced by `ref`. While `active`, focus
|
|
2436
|
+
* moves inside on activate, Tab/Shift+Tab cycle within it, and (by default) focus
|
|
2437
|
+
* is restored to the previously-focused element on deactivate. Escape is NOT
|
|
2438
|
+
* handled — that stays with the component. SSR-safe.
|
|
2439
|
+
*/
|
|
2440
|
+
declare function useFocusTrap<T extends HTMLElement = HTMLElement>(
|
|
2441
|
+
ref: React.RefObject<T | null>,
|
|
2442
|
+
active?: boolean,
|
|
2443
|
+
options?: UseFocusTrapOptions
|
|
2444
|
+
): void;
|
|
2445
|
+
|
|
2446
|
+
/**
|
|
2447
|
+
* Returns a stable `render(node)` that portals `node` to `document.body`, or `null`
|
|
2448
|
+
* on the server (no document). Centralizes the overlay portal pattern.
|
|
2449
|
+
*/
|
|
2450
|
+
declare function usePortal(): (node: React.ReactNode) => React.ReactPortal | React.ReactNode | null;
|
|
2451
|
+
|
|
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 };
|