@orbitcommerce/constellation 0.0.0-stage → 1.0.2

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.
@@ -0,0 +1,1884 @@
1
+ import * as react from 'react';
2
+ import { SVGAttributes, HTMLAttributes, ButtonHTMLAttributes, ReactNode, ReactElement, InputHTMLAttributes, TableHTMLAttributes, TdHTMLAttributes, ThHTMLAttributes, ComponentPropsWithoutRef, RefAttributes, RefObject, FC, MouseEvent, TextareaHTMLAttributes, CSSProperties } from 'react';
3
+ import * as RadixTooltip from '@radix-ui/react-tooltip';
4
+ import * as MenuPrimitive from '@radix-ui/react-dropdown-menu';
5
+ import * as PopoverPrimitive from '@radix-ui/react-popover';
6
+ import * as DialogPrimitive from '@radix-ui/react-dialog';
7
+ import { Command } from 'cmdk';
8
+ import { ClassValue } from 'clsx';
9
+ import * as SelectPrimitive from '@radix-ui/react-select';
10
+ import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
11
+ import * as TabsPrimitive from '@radix-ui/react-tabs';
12
+ import { ToasterProps as ToasterProps$1 } from 'sonner';
13
+ import { Matcher } from 'react-day-picker';
14
+
15
+ interface OrbitLogoProps extends SVGAttributes<SVGSVGElement> {
16
+ /** `mark`: the ring and swoosh only. `lockup`: mark with the orbit commerce wordmark. */
17
+ variant?: 'mark' | 'lockup';
18
+ /** Rendered height in px. Width follows the logo's proportions. */
19
+ size?: number;
20
+ title?: string;
21
+ }
22
+ declare function OrbitLogo({ variant, size, title, className, ...rest }: OrbitLogoProps): react.JSX.Element;
23
+
24
+ type ThemeName = 'light' | 'dark';
25
+ /** The theme of the nearest ThemeScope, or undefined when the page theme applies. */
26
+ declare function useThemeScope(): ThemeName | undefined;
27
+ interface ThemeScopeProps extends HTMLAttributes<HTMLDivElement> {
28
+ theme: ThemeName;
29
+ }
30
+ /**
31
+ * A light or dark island inside a page of the other theme, e.g. a dark band on a light page or a
32
+ * docs preview. Menus, popovers, dialogs, tooltips and the command palette opened inside it follow
33
+ * the island, even though they are portalled out of it.
34
+ */
35
+ declare const ThemeScope: react.ForwardRefExoticComponent<ThemeScopeProps & react.RefAttributes<HTMLDivElement>>;
36
+
37
+ type ButtonVariant = 'primary' | 'secondary' | 'soft' | 'ghost' | 'inverse' | 'critical';
38
+ type ButtonSize = 'xs' | 'sm' | 'md' | 'lg';
39
+ interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
40
+ /** Material of the pill. One `primary` per view. Defaults to `secondary`. */
41
+ variant?: ButtonVariant;
42
+ size?: ButtonSize;
43
+ /** Leading icon. Replaced by a spinner while `loading`. */
44
+ icon?: ReactNode;
45
+ /** Trailing icon, e.g. a chevron for menus. */
46
+ iconEnd?: ReactNode;
47
+ /** Keeps the comet in orbit and blocks repeat presses. */
48
+ loading?: boolean;
49
+ fullWidth?: boolean;
50
+ /** Render the child element (e.g. a router Link) with button styling. */
51
+ asChild?: boolean;
52
+ }
53
+ declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement>>;
54
+ interface IconButtonProps extends Omit<ButtonProps, 'icon' | 'iconEnd' | 'children' | 'fullWidth'> {
55
+ /** Accessible name. To show it on hover, wrap the button in a Tooltip with the same words. */
56
+ label: string;
57
+ /** The icon. With `asChild`, the element to render (e.g. a router link) with the icon inside it. */
58
+ children: ReactNode;
59
+ }
60
+ /**
61
+ * A round button holding a single icon. Always has an accessible label. While `loading`, the
62
+ * spinner takes the icon's place.
63
+ */
64
+ declare const IconButton: react.ForwardRefExoticComponent<IconButtonProps & react.RefAttributes<HTMLButtonElement>>;
65
+
66
+ interface OrbitSpinnerProps {
67
+ /** Diameter in px. */
68
+ size?: number;
69
+ /** When set, the spinner announces itself as a status with this text. */
70
+ label?: string;
71
+ className?: string;
72
+ }
73
+ /**
74
+ * A satellite with a fading tail, circling a faint orbit. Inherits `color`. With a `label` it is a
75
+ * status whose text (visually hidden) screen readers announce; without one it is decoration.
76
+ */
77
+ declare function OrbitSpinner({ size, label, className }: OrbitSpinnerProps): react.JSX.Element;
78
+
79
+ type BadgeTone = 'neutral' | 'accent' | 'positive' | 'negative' | 'warning' | 'info';
80
+ type BadgeVariant = 'subtle' | 'solid' | 'outline';
81
+ type BadgeSize = 'sm' | 'md';
82
+ interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
83
+ /** Meaning of the badge. Status tones are for status only. Defaults to `neutral`. */
84
+ tone?: BadgeTone;
85
+ /**
86
+ * Material. `subtle` (default) is a tinted pill with toned text, `solid` is a filled pill for
87
+ * counts and strong states, `outline` is a hairline ring with no fill.
88
+ */
89
+ variant?: BadgeVariant;
90
+ /** `sm` is 18px tall with 11px text, `md` (default) is 22px with 12px text. */
91
+ size?: BadgeSize;
92
+ /** A 6px tone dot before the label. */
93
+ dot?: boolean;
94
+ /** The dot transmits a ring on a loop. For live states only (implies `dot`). */
95
+ pulse?: boolean;
96
+ /** Leading icon. Decorative. */
97
+ icon?: ReactNode;
98
+ }
99
+ /**
100
+ * A small pill that labels status, counts or categories.
101
+ *
102
+ * A numeric-only `solid` badge renders as a compact count, and any numeric badge bumps when
103
+ * its value changes (never on first render).
104
+ */
105
+ declare const Badge: react.ForwardRefExoticComponent<BadgeProps & react.RefAttributes<HTMLSpanElement>>;
106
+
107
+ type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
108
+ type AvatarShape = 'circle' | 'square';
109
+ type AvatarFit = 'cover' | 'contain';
110
+ type AvatarStatus = 'online' | 'away' | 'busy';
111
+ interface AvatarProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'children'> {
112
+ /** Image URL. Falls back to initials if it is missing or fails to load. */
113
+ src?: string | null;
114
+ /** Person or store name: the accessible name, the initials and the tint all come from it. */
115
+ name?: string;
116
+ /** Accessible name when it should differ from `name`. */
117
+ alt?: string;
118
+ /** xs 20, sm 24, md 32 (default), lg 40, xl 56. Inherited from an `AvatarGroup`. */
119
+ size?: AvatarSize;
120
+ /** `circle` for people (default), `square` for stores and brands. */
121
+ shape?: AvatarShape;
122
+ /** `contain` insets the image on the canvas colour, for logos. Defaults to `cover`. */
123
+ fit?: AvatarFit;
124
+ /** Presence dot: online, away or busy. */
125
+ status?: AvatarStatus;
126
+ /** Accessible text for the status, e.g. a translation. Defaults to "Online", "Away" or "Busy". */
127
+ statusLabel?: string;
128
+ /** Picks the fallback tint instead of `name`, e.g. a stable user ID. */
129
+ seed?: string;
130
+ }
131
+ /**
132
+ * One or two initials. People use first and last name ("Priya Shah" is "PS"); stores use their
133
+ * first two words, which is how shop names are abbreviated ("Harbour Desk Co" is "HD").
134
+ */
135
+ declare function initialsOf(name: string, kind?: 'person' | 'store'): string;
136
+ /** A person or store. Shows the image when it loads and initials on a quiet tint when it cannot. */
137
+ declare const Avatar: react.ForwardRefExoticComponent<AvatarProps & react.RefAttributes<HTMLSpanElement>>;
138
+ interface AvatarGroupProps extends HTMLAttributes<HTMLDivElement> {
139
+ /** Most avatars to show. The rest collapse into a "+N" chip. */
140
+ max?: number;
141
+ /** Size for every avatar in the group. Defaults to `md`. */
142
+ size?: AvatarSize;
143
+ /** Shape for every avatar in the group, unless an avatar sets its own. */
144
+ shape?: AvatarShape;
145
+ /** Accessible text for the "+N" chip. Defaults to "N more". */
146
+ overflowLabel?: (hidden: number) => string;
147
+ }
148
+ /** Overlapping avatars, each cut out of the one beneath by a ring in the surface colour. */
149
+ declare const AvatarGroup: react.ForwardRefExoticComponent<AvatarGroupProps & react.RefAttributes<HTMLDivElement>>;
150
+
151
+ /**
152
+ * True on macOS and iOS, where shortcuts use ⌘ rather than Ctrl. It reads the browser, so call it in
153
+ * effects and event handlers; while rendering on a server it says false. `Kbd` handles this itself.
154
+ */
155
+ declare function isApplePlatform(): boolean;
156
+ /** The primary shortcut modifier for this platform: ⌘ on Apple devices, Ctrl elsewhere. Reads the browser, like isApplePlatform. */
157
+ declare function modKey(): '⌘' | 'Ctrl';
158
+ interface KbdProps extends HTMLAttributes<HTMLElement> {
159
+ /**
160
+ * A shortcut as a list of keys, rendered as a group of caps. Accepts friendly names: `mod`
161
+ * (⌘ or Ctrl), `shift`, `alt`, `enter`, `esc`, `tab`, `backspace`, arrows. Single letters are
162
+ * upper-cased.
163
+ */
164
+ keys?: string[];
165
+ /** A single cap. A string is read as a key name, like one entry of `keys`. */
166
+ children?: ReactNode;
167
+ }
168
+ /** A keyboard key, or with `keys` a shortcut made of several. */
169
+ declare const Kbd: react.ForwardRefExoticComponent<KbdProps & react.RefAttributes<HTMLElement>>;
170
+
171
+ interface TooltipProviderProps {
172
+ children: ReactNode;
173
+ /** Hover time before the first tooltip opens. Defaults to 350ms. */
174
+ delayDuration?: number;
175
+ /** Window in which moving to another trigger opens its tooltip instantly. Defaults to 150ms. */
176
+ skipDelayDuration?: number;
177
+ /** Close as soon as the pointer leaves the trigger, even towards the tooltip. */
178
+ disableHoverableContent?: boolean;
179
+ }
180
+ /**
181
+ * Shares timing across tooltips: once one is open, its neighbours open instantly, which is what
182
+ * makes a toolbar feel quick. Wrap the app (or a toolbar) once.
183
+ */
184
+ declare function TooltipProvider({ children, delayDuration, skipDelayDuration, disableHoverableContent, }: TooltipProviderProps): react.JSX.Element;
185
+ type ContentProps = Omit<RadixTooltip.TooltipContentProps, 'content' | 'children' | 'side' | 'align' | 'asChild'>;
186
+ interface TooltipProps extends ContentProps {
187
+ /** What the tooltip says. Keep it short; nothing interactive. */
188
+ content: ReactNode;
189
+ /** Preferred side of the trigger. Flips when there is no room. Defaults to `top`. */
190
+ side?: 'top' | 'right' | 'bottom' | 'left';
191
+ align?: 'start' | 'center' | 'end';
192
+ /** A keyboard shortcut shown as caps after the text, e.g. `['mod', 'K']`. */
193
+ shortcut?: string[];
194
+ /** The trigger. Must accept a ref and props (Constellation buttons do). */
195
+ children: ReactElement;
196
+ /** Keeps the tooltip closed, e.g. while a menu from the same trigger is open. */
197
+ disabled?: boolean;
198
+ open?: boolean;
199
+ defaultOpen?: boolean;
200
+ onOpenChange?: (open: boolean) => void;
201
+ /** Overrides the provider's hover delay for this tooltip. */
202
+ delayDuration?: number;
203
+ }
204
+ /**
205
+ * A short label on an inverse pill that grows from its trigger. Pass `shortcut` to show the
206
+ * keyboard shortcut beside it.
207
+ */
208
+ declare const Tooltip: react.ForwardRefExoticComponent<TooltipProps & react.RefAttributes<HTMLDivElement>>;
209
+
210
+ type DeltaState = 'rising' | 'falling' | 'steady';
211
+ type DeltaSize = 'sm' | 'md';
212
+ interface DeltaProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'children'> {
213
+ /** Percentage change, e.g. `18.2` for +18.2%. */
214
+ value: number;
215
+ /**
216
+ * Whether going up is good news. Defaults to `true` (takings, orders). Set `false` for figures
217
+ * where a rise is bad (refunds, returns, abandoned checkouts).
218
+ */
219
+ positiveIsGood?: boolean;
220
+ /** Decimal places. Defaults to 1. */
221
+ precision?: number;
222
+ /** Comparison, rendered after the pill, e.g. "vs yesterday". */
223
+ label?: ReactNode;
224
+ /** `sm` for tables and dense rows, `md` (default) beside figures. */
225
+ size?: DeltaSize;
226
+ }
227
+ /** `+18.2%`, `−4.0%` (a true minus sign), or `0.0%` when it rounds to nothing. */
228
+ declare function formatDelta(value: number, precision?: number): string;
229
+ /**
230
+ * A change indicator: arrow and percentage on a tinted pill. The tone says whether the change is
231
+ * good news; `data-state` says which way it went. When the direction changes, the arrow swings
232
+ * to its new heading.
233
+ */
234
+ declare const Delta: react.ForwardRefExoticComponent<DeltaProps & react.RefAttributes<HTMLSpanElement>>;
235
+
236
+ type SkeletonRadius = 'sm' | 'md' | 'lg' | 'pill' | 'circle';
237
+ interface SkeletonProps extends HTMLAttributes<HTMLSpanElement> {
238
+ /** Number (px) or any CSS length. Defaults to the full width available. */
239
+ width?: number | string;
240
+ /** Number (px) or any CSS length. Defaults to 16px. */
241
+ height?: number | string;
242
+ /** Match the shape of what is loading: `circle` for avatars, `pill` for badges and text. */
243
+ radius?: SkeletonRadius;
244
+ }
245
+ /**
246
+ * A placeholder block in the shape of content that is on its way, with a slow sheen passing
247
+ * over it. Hidden from assistive technology: mark the loading region with `aria-busy` instead.
248
+ */
249
+ declare const Skeleton: react.ForwardRefExoticComponent<SkeletonProps & react.RefAttributes<HTMLSpanElement>>;
250
+ interface SkeletonTextProps extends HTMLAttributes<HTMLSpanElement> {
251
+ /** Number of lines. Defaults to 3. */
252
+ lines?: number;
253
+ /** Width of the last line when there is more than one. Defaults to 60%. */
254
+ lastLineWidth?: number | string;
255
+ }
256
+ /** Paragraph-shaped placeholder. Line height and spacing follow the surrounding font size. */
257
+ declare const SkeletonText: react.ForwardRefExoticComponent<SkeletonTextProps & react.RefAttributes<HTMLSpanElement>>;
258
+
259
+ type CardVariant = 'outline' | 'raised' | 'sunken';
260
+ type CardPadding = 'none' | 'sm' | 'md' | 'lg';
261
+ interface CardProps extends HTMLAttributes<HTMLDivElement> {
262
+ /**
263
+ * `outline` (default): canvas with a hairline. `raised`: lifted by a soft shadow, no border.
264
+ * `sunken`: set into the page, for secondary panels.
265
+ */
266
+ variant?: CardVariant;
267
+ /** Inner spacing: none, sm 16, md 20 (default), lg 24. Header, body and footer follow it. */
268
+ padding?: CardPadding;
269
+ /**
270
+ * The whole card is one target: hover, press and focus states. Pair with `asChild` on a link or
271
+ * button so it has the right semantics and keyboard support.
272
+ */
273
+ interactive?: boolean;
274
+ /** Render the child element (e.g. a router Link) as the card. */
275
+ asChild?: boolean;
276
+ }
277
+ /** A 16px-radius surface that groups related content. Border or shadow, never both. */
278
+ declare const Card: react.ForwardRefExoticComponent<CardProps & react.RefAttributes<HTMLDivElement>>;
279
+ interface CardHeaderProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
280
+ title: ReactNode;
281
+ description?: ReactNode;
282
+ /** Controls on the right, e.g. a small button or a menu. */
283
+ actions?: ReactNode;
284
+ /** An icon in a small tile before the title. Decorative. */
285
+ icon?: ReactNode;
286
+ /** Heading element for the title. Defaults to `h3`. */
287
+ titleAs?: 'h2' | 'h3' | 'h4' | 'p' | 'div';
288
+ }
289
+ declare const CardHeader: react.ForwardRefExoticComponent<CardHeaderProps & react.RefAttributes<HTMLDivElement>>;
290
+ declare const CardBody: react.ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & react.RefAttributes<HTMLDivElement>>;
291
+ /** Actions for the card, right-aligned under a hairline that runs edge to edge. */
292
+ declare const CardFooter: react.ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & react.RefAttributes<HTMLDivElement>>;
293
+
294
+ type EmptyStateSize = 'sm' | 'md' | 'lg';
295
+ interface EmptyStateProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
296
+ /** What is empty, plainly: "No orders yet". */
297
+ title: ReactNode;
298
+ /** What will fill it, or what to do next. Keep it to a sentence or two. */
299
+ description?: ReactNode;
300
+ /** One or two buttons: the next move. */
301
+ actions?: ReactNode;
302
+ /** `sm` for panels and search results, `md` (default) for pages and cards, `lg` for a whole screen such as a
303
+ * page that was not found. */
304
+ size?: EmptyStateSize;
305
+ /** Replaces the orbit mark, e.g. with an illustration. `null` hides it. Small (`sm`) empty states sit in
306
+ * panels beside others and show no mark unless you pass one: at that size it reads as clutter, not a moment. */
307
+ mark?: ReactNode;
308
+ /** Element for the title. Defaults to `h3`. */
309
+ titleAs?: 'h1' | 'h2' | 'h3' | 'h4' | 'p';
310
+ }
311
+ type OrbitMarkState = 'rest' | 'adrift';
312
+ interface OrbitMarkProps extends Omit<SVGAttributes<SVGSVGElement>, 'children'> {
313
+ /**
314
+ * `rest` (default): the satellite travels once around and settles at the upper right.
315
+ * `adrift`: it has slipped off its orbit and floats a little way off, for a page that was not found.
316
+ */
317
+ state?: OrbitMarkState;
318
+ }
319
+ /**
320
+ * The orbit mark on its own: a neutral planet inside a tilted teal orbit. EmptyState draws it by
321
+ * default; pass it to `mark` yourself to choose its state.
322
+ */
323
+ declare function OrbitMark({ state, className, ...rest }: OrbitMarkProps): react.JSX.Element;
324
+ /**
325
+ * What a view shows when there is nothing in it yet: a small drawn orbit (pages and whole screens),
326
+ * a plain title, a line on what will appear or what to do, and the next move.
327
+ */
328
+ declare const EmptyState: react.ForwardRefExoticComponent<EmptyStateProps & react.RefAttributes<HTMLDivElement>>;
329
+
330
+ type SwitchSize = 'sm' | 'md';
331
+ interface SwitchProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'value' | 'defaultValue' | 'defaultChecked' | 'onChange'> {
332
+ /** Controlled state. */
333
+ checked?: boolean;
334
+ /** Starting state when uncontrolled. */
335
+ defaultChecked?: boolean;
336
+ onCheckedChange?: (checked: boolean) => void;
337
+ /** `md` (default) is 36 x 20, `sm` is 30 x 17. */
338
+ size?: SwitchSize;
339
+ /** Text to the right. Clicking it toggles the switch, and it is the switch's accessible name. */
340
+ label?: ReactNode;
341
+ /** Submitted with a form when on (as `name=value`). Defaults to "on". */
342
+ value?: string;
343
+ }
344
+ /**
345
+ * An on/off setting that applies straight away. The thumb settles on a spring, and stretches a
346
+ * little while pressed, like a real toggle taking the weight of a finger.
347
+ *
348
+ * `ref` and native props go to the switch button; `className` goes to the outer element (the
349
+ * label row when there is a `label`).
350
+ */
351
+ declare const Switch: react.ForwardRefExoticComponent<SwitchProps & react.RefAttributes<HTMLButtonElement>>;
352
+
353
+ type CheckboxSize = 'sm' | 'md';
354
+ type CheckedState = boolean | 'indeterminate';
355
+ interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'checked' | 'defaultChecked' | 'onChange' | 'size'> {
356
+ /** Controlled state. `'indeterminate'` for a parent whose children are partly ticked. */
357
+ checked?: CheckedState;
358
+ defaultChecked?: boolean;
359
+ onCheckedChange?: (checked: boolean) => void;
360
+ /** Text to the right. Clicking it ticks the box, and it is the checkbox's accessible name. */
361
+ label?: ReactNode;
362
+ /** A quieter second line under the label. */
363
+ description?: ReactNode;
364
+ /** `md` is 16px (default), `sm` 14px. The hit area is always at least 24px. */
365
+ size?: CheckboxSize;
366
+ }
367
+ /**
368
+ * A box to tick: one of several independent choices, a row in a table, a setting that applies on
369
+ * save. A native checkbox underneath, so forms, keyboards and screen readers get the real thing;
370
+ * the tick draws itself in when checked.
371
+ *
372
+ * `ref`, `className` and native props go to the <input>; `aria-label` too, when there is no `label`.
373
+ */
374
+ declare const Checkbox: react.ForwardRefExoticComponent<CheckboxProps & react.RefAttributes<HTMLInputElement>>;
375
+
376
+ type TableDensity = 'comfortable' | 'compact';
377
+ type TableAlign = 'start' | 'center' | 'end';
378
+ type TableSort = 'ascending' | 'descending' | 'none';
379
+ interface TableFrameProps extends HTMLAttributes<HTMLDivElement> {
380
+ /** Height of the scroll area (px or any CSS length). The header sticks while rows scroll. */
381
+ height?: number | string;
382
+ /** Content pinned under the scroll area inside the frame, e.g. <Pagination>. */
383
+ footer?: ReactNode;
384
+ }
385
+ /**
386
+ * The hairline frame a table sits in, with its own scroll area. `ref` goes to the scroll area
387
+ * (virtual rows need it).
388
+ */
389
+ declare const TableFrame: react.ForwardRefExoticComponent<TableFrameProps & react.RefAttributes<HTMLDivElement>>;
390
+ interface TableProps extends TableHTMLAttributes<HTMLTableElement> {
391
+ /** Row height: `comfortable` 56px (default) or `compact` 44px. */
392
+ density?: TableDensity;
393
+ /** `fixed` pins column widths to a <colgroup> (steady columns under virtual rows). */
394
+ layout?: 'auto' | 'fixed';
395
+ }
396
+ declare const Table: react.ForwardRefExoticComponent<TableProps & react.RefAttributes<HTMLTableElement>>;
397
+ declare const TableHead: react.ForwardRefExoticComponent<HTMLAttributes<HTMLTableSectionElement> & react.RefAttributes<HTMLTableSectionElement>>;
398
+ declare const TableBody: react.ForwardRefExoticComponent<HTMLAttributes<HTMLTableSectionElement> & react.RefAttributes<HTMLTableSectionElement>>;
399
+ interface TableRowProps extends HTMLAttributes<HTMLTableRowElement> {
400
+ /** Marks the row as chosen: a teal line on its leading edge and a tint. */
401
+ selected?: boolean;
402
+ /** The whole row opens something: pointer cursor and hover tint. */
403
+ interactive?: boolean;
404
+ }
405
+ declare const TableRow: react.ForwardRefExoticComponent<TableRowProps & react.RefAttributes<HTMLTableRowElement>>;
406
+ interface TableHeaderCellProps extends Omit<ThHTMLAttributes<HTMLTableCellElement>, 'align'> {
407
+ align?: TableAlign;
408
+ /** Current sort of this column. With `onSort`, the heading becomes a button. */
409
+ sort?: TableSort;
410
+ onSort?: () => void;
411
+ }
412
+ declare const TableHeaderCell: react.ForwardRefExoticComponent<TableHeaderCellProps & react.RefAttributes<HTMLTableCellElement>>;
413
+ interface TableCellProps extends Omit<TdHTMLAttributes<HTMLTableCellElement>, 'align'> {
414
+ align?: TableAlign;
415
+ /** Money, counts, dates: tabular figures, aligned to the end. */
416
+ numeric?: boolean;
417
+ /** One line, cut with an ellipsis (set a column width). */
418
+ truncate?: boolean;
419
+ }
420
+ declare const TableCell: react.ForwardRefExoticComponent<TableCellProps & react.RefAttributes<HTMLTableCellElement>>;
421
+
422
+ interface PaginationProps extends Omit<HTMLAttributes<HTMLElement>, 'onChange'> {
423
+ /** The current page, from 1. */
424
+ page: number;
425
+ pageCount: number;
426
+ onPageChange: (page: number) => void;
427
+ /** Left of the pages, e.g. "1–50 of 1,241 orders". */
428
+ summary?: ReactNode;
429
+ /** Pages next to the current one on each side. Defaults to 1. */
430
+ siblings?: number;
431
+ /** While the next page loads: every control rests. */
432
+ disabled?: boolean;
433
+ /** Accessible name of the navigation. */
434
+ label?: string;
435
+ previousLabel?: string;
436
+ nextLabel?: string;
437
+ /** Accessible name of a page button. Defaults to "Page 3". */
438
+ pageLabel?: (page: number) => string;
439
+ }
440
+ type Item = number | 'gap-start' | 'gap-end';
441
+ /** First, last, the current page with its siblings, and a gap wherever pages are skipped. */
442
+ declare function paginationItems(page: number, pageCount: number, siblings?: number): Item[];
443
+ /**
444
+ * Pages of a long list. The current page is an ink circle; on phones the numbers fold into
445
+ * "3 / 25" between the arrows.
446
+ */
447
+ declare const Pagination: react.ForwardRefExoticComponent<PaginationProps & react.RefAttributes<HTMLElement>>;
448
+
449
+ interface SeparatorProps extends HTMLAttributes<HTMLDivElement> {
450
+ /** Defaults to `horizontal`. A vertical separator stretches to the height of its row. */
451
+ orientation?: 'horizontal' | 'vertical';
452
+ /**
453
+ * Purely visual (default), so assistive technology skips it. Set `false` when it divides
454
+ * content into meaningful groups, and it is announced as a separator.
455
+ */
456
+ decorative?: boolean;
457
+ }
458
+ /** A hairline between groups of content. */
459
+ declare const Separator: react.ForwardRefExoticComponent<SeparatorProps & react.RefAttributes<HTMLDivElement>>;
460
+
461
+ /** Width of a menu sheet: px, any CSS length, or `'trigger'` to match the trigger. */
462
+ type MenuWidth = number | string;
463
+ /** Owns the open state. `modal` (default) keeps focus and scroll inside the menu while open. */
464
+ declare const Menu: react.FC<MenuPrimitive.DropdownMenuProps>;
465
+ type MenuProps = MenuPrimitive.DropdownMenuProps;
466
+ /** Opens the menu. Use `asChild` to wrap a Constellation `Button` or `IconButton`. */
467
+ declare const MenuTrigger: react.ForwardRefExoticComponent<MenuPrimitive.DropdownMenuTriggerProps & react.RefAttributes<HTMLButtonElement>>;
468
+ type MenuTriggerProps = MenuPrimitive.DropdownMenuTriggerProps;
469
+ /** Groups related items for assistive tech. No visual of its own. */
470
+ declare const MenuGroup: react.ForwardRefExoticComponent<MenuPrimitive.DropdownMenuGroupProps & react.RefAttributes<HTMLDivElement>>;
471
+ type MenuGroupProps = MenuPrimitive.DropdownMenuGroupProps;
472
+ /** Holds `MenuRadioItem`s. Controlled with `value` + `onValueChange`. */
473
+ declare const MenuRadioGroup: react.ForwardRefExoticComponent<MenuPrimitive.DropdownMenuRadioGroupProps & react.RefAttributes<HTMLDivElement>>;
474
+ type MenuRadioGroupProps = MenuPrimitive.DropdownMenuRadioGroupProps;
475
+ /** Owns a submenu's open state. Holds a `MenuSubTrigger` and a `MenuSubContent`. */
476
+ declare const MenuSub: react.FC<MenuPrimitive.DropdownMenuSubProps>;
477
+ type MenuSubProps = MenuPrimitive.DropdownMenuSubProps;
478
+ interface MenuContentProps extends ComponentPropsWithoutRef<typeof MenuPrimitive.Content> {
479
+ /** Fixed width: px, any CSS length, or `'trigger'` to match the trigger. Default: fits content, min 220px. */
480
+ width?: MenuWidth;
481
+ /** Where the menu is portalled. Defaults to `document.body`. */
482
+ container?: HTMLElement | null;
483
+ }
484
+ /** The raised sheet. Portalled, collision-aware, and it grows out of its trigger. */
485
+ declare const MenuContent: react.ForwardRefExoticComponent<MenuContentProps & react.RefAttributes<HTMLDivElement>>;
486
+ interface ItemExtras {
487
+ /** Leading icon (16px). Muted until the row is highlighted. */
488
+ icon?: ReactNode;
489
+ /**
490
+ * Keyboard shortcut shown as keycaps, via `Kbd`: friendly names read right on every platform,
491
+ * e.g. `['mod', 'shift', 'C']` is ⌘⇧C on a Mac and Ctrl Shift C elsewhere. Visual only: bind the keys in the host.
492
+ */
493
+ shortcut?: string[];
494
+ /** Muted, right-aligned detail, e.g. the current value or a file format. */
495
+ hint?: ReactNode;
496
+ }
497
+ interface MenuItemProps extends ComponentPropsWithoutRef<typeof MenuPrimitive.Item>, ItemExtras {
498
+ /** `critical` for destructive or exit actions (delete, log out). */
499
+ tone?: 'critical';
500
+ }
501
+ /**
502
+ * An action. `onSelect` runs it and closes the menu (call `event.preventDefault()` to keep it open).
503
+ * Use `asChild` to render a router link: `<MenuItem asChild icon={…}><Link to="/settings">Settings</Link></MenuItem>`.
504
+ */
505
+ declare const MenuItem: react.ForwardRefExoticComponent<MenuItemProps & react.RefAttributes<HTMLDivElement>>;
506
+ interface MenuCheckboxItemProps extends ComponentPropsWithoutRef<typeof MenuPrimitive.CheckboxItem>, ItemExtras {
507
+ }
508
+ /** A setting that toggles. The teal check draws itself in when it turns on. */
509
+ declare const MenuCheckboxItem: react.ForwardRefExoticComponent<MenuCheckboxItemProps & react.RefAttributes<HTMLDivElement>>;
510
+ interface MenuRadioItemProps extends ComponentPropsWithoutRef<typeof MenuPrimitive.RadioItem>, ItemExtras {
511
+ }
512
+ /** One choice inside a `MenuRadioGroup`. The chosen row carries a teal satellite in its ring. */
513
+ declare const MenuRadioItem: react.ForwardRefExoticComponent<MenuRadioItemProps & react.RefAttributes<HTMLDivElement>>;
514
+ interface MenuSubTriggerProps extends ComponentPropsWithoutRef<typeof MenuPrimitive.SubTrigger> {
515
+ icon?: ReactNode;
516
+ /** Muted detail before the chevron, e.g. the current choice inside the submenu. */
517
+ hint?: ReactNode;
518
+ }
519
+ /** A row that opens a submenu (hover, click, or the arrow key towards it). */
520
+ declare const MenuSubTrigger: react.ForwardRefExoticComponent<MenuSubTriggerProps & react.RefAttributes<HTMLDivElement>>;
521
+ interface MenuSubContentProps extends ComponentPropsWithoutRef<typeof MenuPrimitive.SubContent> {
522
+ width?: MenuWidth;
523
+ container?: HTMLElement | null;
524
+ }
525
+ /**
526
+ * The submenu sheet. Sits 4px clear of the parent sheet (the offset is measured from the trigger row,
527
+ * which is inset by the sheet's 6px padding), lines its first row up with the trigger, and slides
528
+ * 4px out from the side it opens on.
529
+ */
530
+ declare const MenuSubContent: react.ForwardRefExoticComponent<MenuSubContentProps & react.RefAttributes<HTMLDivElement>>;
531
+ type MenuLabelProps = ComponentPropsWithoutRef<typeof MenuPrimitive.Label>;
532
+ /** A quiet heading for the rows below it. Sentence case, never all caps. */
533
+ declare const MenuLabel: react.ForwardRefExoticComponent<Omit<MenuPrimitive.DropdownMenuLabelProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
534
+ type MenuSeparatorProps = ComponentPropsWithoutRef<typeof MenuPrimitive.Separator>;
535
+ /** A hairline between groups of rows. */
536
+ declare const MenuSeparator: react.ForwardRefExoticComponent<Omit<MenuPrimitive.DropdownMenuSeparatorProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
537
+ type MenuHeaderProps = HTMLAttributes<HTMLDivElement>;
538
+ /** A free-form block at the top of the sheet, e.g. the signed-in person and their store. Not focusable. */
539
+ declare const MenuHeader: react.ForwardRefExoticComponent<MenuHeaderProps & react.RefAttributes<HTMLDivElement>>;
540
+
541
+ /** Owns the open state. */
542
+ declare const Popover: react.FC<PopoverPrimitive.PopoverProps>;
543
+ type PopoverProps = PopoverPrimitive.PopoverProps;
544
+ /** Opens the popover. Use `asChild` to wrap a Constellation `Button`. */
545
+ declare const PopoverTrigger: react.ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & react.RefAttributes<HTMLButtonElement>>;
546
+ type PopoverTriggerProps = PopoverPrimitive.PopoverTriggerProps;
547
+ /** Positions the popover against something other than the trigger. */
548
+ declare const PopoverAnchor: react.ForwardRefExoticComponent<PopoverPrimitive.PopoverAnchorProps & react.RefAttributes<HTMLDivElement>>;
549
+ type PopoverAnchorProps = PopoverPrimitive.PopoverAnchorProps;
550
+ /** Closes the popover. Use `asChild` to wrap a button inside the content. */
551
+ declare const PopoverClose: react.ForwardRefExoticComponent<PopoverPrimitive.PopoverCloseProps & react.RefAttributes<HTMLButtonElement>>;
552
+ type PopoverCloseProps = PopoverPrimitive.PopoverCloseProps;
553
+ type PopoverPadding = 'none' | 'sm' | 'md';
554
+ interface PopoverContentProps extends ComponentPropsWithoutRef<typeof PopoverPrimitive.Content> {
555
+ /** Inner padding: `none` (0, for lists that bring their own), `sm` (12px) or `md` (16px, default). */
556
+ padding?: PopoverPadding;
557
+ /** Fixed width: px, any CSS length, or `'trigger'` to match the trigger. Default: fits content. */
558
+ width?: number | string;
559
+ /** Where the popover is portalled. Defaults to `document.body`. */
560
+ container?: HTMLElement | null;
561
+ }
562
+ /** The raised sheet. Portalled, collision-aware, and it grows out of its trigger. */
563
+ declare const PopoverContent: react.ForwardRefExoticComponent<PopoverContentProps & react.RefAttributes<HTMLDivElement>>;
564
+
565
+ /** Owns the open state. Control it with `open` + `onOpenChange`, or let `DialogTrigger` drive it. */
566
+ declare const Dialog: react.FC<DialogPrimitive.DialogProps>;
567
+ type DialogProps = DialogPrimitive.DialogProps;
568
+ /** Opens the dialog. Use `asChild` to wrap a Constellation `Button`. */
569
+ declare const DialogTrigger: react.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & react.RefAttributes<HTMLButtonElement>>;
570
+ type DialogTriggerProps = DialogPrimitive.DialogTriggerProps;
571
+ /** Closes the dialog. Use `asChild` to wrap a `Button`, e.g. the footer's Cancel. */
572
+ declare const DialogClose: react.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & react.RefAttributes<HTMLButtonElement>>;
573
+ type DialogCloseProps = DialogPrimitive.DialogCloseProps;
574
+ type DialogSize = 'sm' | 'md' | 'lg' | 'xl' | 'full';
575
+ interface DialogContentProps extends ComponentPropsWithoutRef<typeof DialogPrimitive.Content> {
576
+ /**
577
+ * Width: `sm` 400px (confirmations), `md` 520px (default, short forms), `lg` 720px, `xl` 960px
578
+ * (tables, previews). `full` fills the window bar a margin, for a long form or an editor: the
579
+ * header becomes a bar and the body scrolls between it and the footer.
580
+ */
581
+ size?: DialogSize;
582
+ /** Hide the top-right close button, e.g. when the footer already offers a way out. */
583
+ hideClose?: boolean;
584
+ /** Accessible name of the close button. */
585
+ closeLabel?: string;
586
+ /** Where the dialog is portalled. Defaults to `document.body`. */
587
+ container?: HTMLElement | null;
588
+ }
589
+ /** The sheet and its overlay. Put a `DialogTitle` inside (it names the dialog for assistive tech). */
590
+ declare const DialogContent: react.ForwardRefExoticComponent<DialogContentProps & react.RefAttributes<HTMLDivElement>>;
591
+ type DialogHeaderProps = HTMLAttributes<HTMLDivElement>;
592
+ /** Title and description, stacked. The title leaves room for the close button when there is one. */
593
+ declare const DialogHeader: react.ForwardRefExoticComponent<DialogHeaderProps & react.RefAttributes<HTMLDivElement>>;
594
+ type DialogTitleProps = ComponentPropsWithoutRef<typeof DialogPrimitive.Title>;
595
+ /** The dialog's name, set in Sora. Phrase it as the task or the question: "Invite a staff member". */
596
+ declare const DialogTitle: react.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & react.RefAttributes<HTMLHeadingElement>, "ref"> & react.RefAttributes<HTMLHeadingElement>>;
597
+ type DialogDescriptionProps = ComponentPropsWithoutRef<typeof DialogPrimitive.Description>;
598
+ /** One or two sentences of context. Announced with the title. */
599
+ declare const DialogDescription: react.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & react.RefAttributes<HTMLParagraphElement>, "ref"> & react.RefAttributes<HTMLParagraphElement>>;
600
+ type DialogBodyProps = HTMLAttributes<HTMLDivElement>;
601
+ /** The content between header and footer. Scrolls on its own when the dialog meets the viewport. */
602
+ declare const DialogBody: react.ForwardRefExoticComponent<DialogBodyProps & react.RefAttributes<HTMLDivElement>>;
603
+ type DialogFooterProps = HTMLAttributes<HTMLDivElement>;
604
+ /** Actions, right-aligned, primary last. Stacks full width on phones with the primary on top. */
605
+ declare const DialogFooter: react.ForwardRefExoticComponent<DialogFooterProps & react.RefAttributes<HTMLDivElement>>;
606
+ interface ConfirmDialogProps {
607
+ open: boolean;
608
+ onOpenChange: (open: boolean) => void;
609
+ /** The question, e.g. "Log out of Orbit?". */
610
+ title: ReactNode;
611
+ /** What happens if they confirm, in a sentence or two. */
612
+ description?: ReactNode;
613
+ /** The verb that confirms, e.g. "Log out" or "Delete products". Never just "OK". */
614
+ confirmLabel: ReactNode;
615
+ cancelLabel?: ReactNode;
616
+ /** `critical` for destructive or exit actions: the confirm pill turns red and first focus goes to Cancel. */
617
+ tone?: 'critical';
618
+ /** Busy state while the action runs. Pass it to manage the work yourself (you then close the dialog). */
619
+ loading?: boolean;
620
+ /**
621
+ * Runs on confirm. Return a promise and the dialog shows the busy state, then closes when it
622
+ * resolves (it stays open if it rejects). Return nothing and the dialog closes straight away,
623
+ * unless you control `loading`.
624
+ */
625
+ onConfirm: () => void | Promise<unknown>;
626
+ /** Optional extra content between the description and the actions. */
627
+ children?: ReactNode;
628
+ }
629
+ /**
630
+ * A yes-or-no question before an action that matters. An `alertdialog`: it never closes on an
631
+ * outside click, and while the action runs it cannot be dismissed at all.
632
+ */
633
+ declare function ConfirmDialog({ open, onOpenChange, title, description, confirmLabel, cancelLabel, tone, loading, onConfirm, children, }: ConfirmDialogProps): react.JSX.Element;
634
+
635
+ /** Owns the open state. Control it with `open` + `onOpenChange`, or let `SheetTrigger` drive it. */
636
+ declare const Sheet: react.FC<DialogPrimitive.DialogProps>;
637
+ type SheetProps = DialogPrimitive.DialogProps;
638
+ /** Opens the sheet. Use `asChild` to wrap a Constellation `Button`. */
639
+ declare const SheetTrigger: react.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & react.RefAttributes<HTMLButtonElement>>;
640
+ type SheetTriggerProps = DialogPrimitive.DialogTriggerProps;
641
+ /** Closes the sheet. Use `asChild` to wrap a `Button`, e.g. the footer's Cancel. */
642
+ declare const SheetClose: react.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & react.RefAttributes<HTMLButtonElement>>;
643
+ type SheetCloseProps = DialogPrimitive.DialogCloseProps;
644
+ type SheetSide = 'right' | 'left';
645
+ type SheetSize = 'sm' | 'md' | 'lg';
646
+ interface SheetContentProps extends ComponentPropsWithoutRef<typeof DialogPrimitive.Content> {
647
+ /** The edge it slides from. Defaults to `right`. */
648
+ side?: SheetSide;
649
+ /** Width: `sm` 400px, `md` 480px (default), `lg` 640px. Always leaves a margin on a phone. */
650
+ size?: SheetSize;
651
+ /** Hide the top-right close button, e.g. when the footer already offers a way out. */
652
+ hideClose?: boolean;
653
+ /** Accessible name of the close button. */
654
+ closeLabel?: string;
655
+ /** Where the sheet is portalled. Defaults to `document.body`. */
656
+ container?: HTMLElement | null;
657
+ }
658
+ /** The panel and its overlay. Put a `SheetTitle` inside (it names the sheet for assistive tech). */
659
+ declare const SheetContent: react.ForwardRefExoticComponent<SheetContentProps & react.RefAttributes<HTMLDivElement>>;
660
+ type SheetHeaderProps = HTMLAttributes<HTMLDivElement>;
661
+ /** Title and description, stacked, over a hairline. */
662
+ declare const SheetHeader: react.ForwardRefExoticComponent<SheetHeaderProps & react.RefAttributes<HTMLDivElement>>;
663
+ type SheetTitleProps = ComponentPropsWithoutRef<typeof DialogPrimitive.Title>;
664
+ /** The sheet's name, set in Sora. */
665
+ declare const SheetTitle: react.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & react.RefAttributes<HTMLHeadingElement>, "ref"> & react.RefAttributes<HTMLHeadingElement>>;
666
+ type SheetDescriptionProps = ComponentPropsWithoutRef<typeof DialogPrimitive.Description>;
667
+ /** A line of context under the title. */
668
+ declare const SheetDescription: react.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & react.RefAttributes<HTMLParagraphElement>, "ref"> & react.RefAttributes<HTMLParagraphElement>>;
669
+ type SheetBodyProps = HTMLAttributes<HTMLDivElement>;
670
+ /** The content. Scrolls between the header and the footer. */
671
+ declare const SheetBody: react.ForwardRefExoticComponent<SheetBodyProps & react.RefAttributes<HTMLDivElement>>;
672
+ type SheetFooterProps = HTMLAttributes<HTMLDivElement>;
673
+ /** Actions, right-aligned, primary last, over a hairline. */
674
+ declare const SheetFooter: react.ForwardRefExoticComponent<SheetFooterProps & react.RefAttributes<HTMLDivElement>>;
675
+
676
+ interface SegmentedControlOption<V extends string = string> {
677
+ value: V;
678
+ /** Visible text, or with `iconOnly` the option's accessible name. */
679
+ label: ReactNode;
680
+ /** Leading icon (15px, 13px at `sm`). */
681
+ icon?: ReactNode;
682
+ /** Show the icon alone, centred; `label` is still read out. Pair the control with a tooltip or a visible heading. */
683
+ iconOnly?: boolean;
684
+ disabled?: boolean;
685
+ }
686
+ interface SegmentedControlBaseProps<V extends string> extends Omit<HTMLAttributes<HTMLDivElement>, 'defaultValue' | 'onChange' | 'role' | 'aria-label' | 'aria-labelledby'> {
687
+ options: ReadonlyArray<SegmentedControlOption<V>>;
688
+ /** Controlled value. */
689
+ value?: V;
690
+ /** Starting value when uncontrolled. Defaults to the first enabled option. */
691
+ defaultValue?: V;
692
+ onValueChange?: (value: V) => void;
693
+ /** `md` is 36px tall (default), `sm` 30px: the same heights as buttons. */
694
+ size?: 'sm' | 'md';
695
+ /** Stretch to the container, options sharing the width equally. */
696
+ fullWidth?: boolean;
697
+ disabled?: boolean;
698
+ }
699
+ /**
700
+ * The group needs a name for assistive tech: `aria-label` (e.g. "Date range"), or `aria-labelledby`
701
+ * pointing at a visible heading.
702
+ */
703
+ type SegmentedControlProps<V extends string = string> = SegmentedControlBaseProps<V> & ({
704
+ 'aria-label': string;
705
+ 'aria-labelledby'?: string;
706
+ } | {
707
+ 'aria-labelledby': string;
708
+ 'aria-label'?: string;
709
+ });
710
+ /**
711
+ * One of a few mutually exclusive views on a pill track, e.g. Today · 7 days · 30 days.
712
+ * For navigation between pages use tabs; for settings that apply on save use radios.
713
+ */
714
+ declare const SegmentedControl: <V extends string = string>(props: SegmentedControlProps<V> & RefAttributes<HTMLDivElement>) => ReactElement | null;
715
+
716
+ interface FieldControlContext {
717
+ /** The id the Field's <label> points at. */
718
+ id: string;
719
+ /** The label's own id, for controls a <label> cannot name (e.g. a div with a role): `aria-labelledby`. */
720
+ labelId: string;
721
+ /** Id of the hint or error text, for `aria-describedby`. */
722
+ describedBy?: string;
723
+ invalid: boolean;
724
+ }
725
+ /** The surrounding Field's wiring, for building custom controls. `null` outside a Field. */
726
+ declare function useFieldControl(): FieldControlContext | null;
727
+ type InputSize = 'sm' | 'md' | 'lg';
728
+ interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'prefix'> {
729
+ /** `sm` 30px, `md` 36px (default), `lg` 44px: the same heights as buttons. */
730
+ size?: InputSize;
731
+ /** Leading icon (16px). Muted, it wakes up while the field has focus. */
732
+ icon?: ReactNode;
733
+ /** Leading text set tight against the value, e.g. `£` or `https://`. */
734
+ prefix?: ReactNode;
735
+ /** Trailing node: a unit (`kg`, `GBP`), a status, or a small button. */
736
+ suffix?: ReactNode;
737
+ /** Shows the error treatment and sets `aria-invalid`. Inside a Field, follows the Field's `error`. */
738
+ invalid?: boolean;
739
+ }
740
+ /**
741
+ * A single-line text field. Every native input prop goes to the <input> (and so does the ref);
742
+ * `className` and `style` go to the frame around it.
743
+ */
744
+ declare const Input: react.ForwardRefExoticComponent<InputProps & react.RefAttributes<HTMLInputElement>>;
745
+ interface FieldProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
746
+ label: ReactNode;
747
+ /** Help below the control. Hidden while there is an error. */
748
+ hint?: ReactNode;
749
+ /** What is wrong and how to fix it. Marks the control invalid and replaces the hint. */
750
+ error?: ReactNode;
751
+ /** Id for the control inside. Generated when omitted. */
752
+ id?: string;
753
+ /** One control: `Input`, `SearchField`, or anything reading `useFieldControl()`. */
754
+ children: ReactNode;
755
+ }
756
+ /** Label, control, then hint or error, wired together for assistive tech. */
757
+ declare const Field: react.ForwardRefExoticComponent<FieldProps & react.RefAttributes<HTMLDivElement>>;
758
+
759
+ interface SearchFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'type' | 'value' | 'defaultValue' | 'prefix'> {
760
+ /** Controlled query. */
761
+ value?: string;
762
+ /** Starting query when uncontrolled. */
763
+ defaultValue?: string;
764
+ /** Called with the new query on every keystroke and on clear. */
765
+ onValueChange?: (value: string) => void;
766
+ /** Called after the clear button or Escape empties the field. */
767
+ onClear?: () => void;
768
+ /** `md` 36px (default), `sm` 30px. */
769
+ size?: 'sm' | 'md';
770
+ /**
771
+ * Keycaps shown while the field is empty and idle, via `Kbd`, e.g. `['mod', 'K']` (⌘K on a Mac,
772
+ * Ctrl K elsewhere) or `['/']`. Visual only: bind the keys in the host.
773
+ */
774
+ shortcut?: string[];
775
+ /** Accessible name of the clear button. */
776
+ clearLabel?: string;
777
+ }
778
+ /**
779
+ * A pill-shaped search input. Native input props go to the <input> (and so does the ref);
780
+ * `className` and `style` go to the pill. Give it an accessible name: a `Field` label or `aria-label`.
781
+ */
782
+ declare const SearchField: react.ForwardRefExoticComponent<SearchFieldProps & react.RefAttributes<HTMLInputElement>>;
783
+
784
+ interface SearchTriggerProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'> {
785
+ /** Placeholder-style text. Match the palette's placeholder so the morph reads as one object. */
786
+ placeholder?: string;
787
+ /** Called on click and on the keyboard shortcut. Open your CommandPalette here. */
788
+ onOpen?: () => void;
789
+ /** Show the ⌘ K (Mac) or Ctrl K caps. Defaults to true. */
790
+ shortcut?: boolean;
791
+ /** Listen for ⌘K / Ctrl K anywhere on the page and call `onOpen`. Defaults to true. */
792
+ hotkey?: boolean;
793
+ /** Preferred width (px or any CSS length). Shrinks with its container. Defaults to 360. */
794
+ width?: number | string;
795
+ }
796
+ /**
797
+ * The search pill in the app header. Looks like a field, behaves like a button: it opens the
798
+ * command palette, which grows out of it.
799
+ */
800
+ declare const SearchTrigger: react.ForwardRefExoticComponent<SearchTriggerProps & react.RefAttributes<HTMLButtonElement>>;
801
+
802
+ interface CommandPaletteProps {
803
+ /** Controlled open state. */
804
+ open: boolean;
805
+ onOpenChange: (open: boolean) => void;
806
+ /**
807
+ * Input placeholder. Defaults to the text of the SearchTrigger it grows out of, so the
808
+ * trigger's words carry straight into the field.
809
+ */
810
+ placeholder?: string;
811
+ /** The search query. Pass with `onValueChange` to control it, e.g. to fetch async results. */
812
+ value?: string;
813
+ onValueChange?: (query: string) => void;
814
+ /** Sends a comet along the input row while results are on their way. */
815
+ loading?: boolean;
816
+ /** Set to false when the host filters (e.g. server search); passed to cmdk. Defaults to true. */
817
+ shouldFilter?: boolean;
818
+ /** Custom ranking, passed to cmdk. Return 0 to hide an item, 1 for a perfect match. */
819
+ filter?: (value: string, search: string, keywords?: string[]) => number;
820
+ /** Arrow keys wrap around the list. Defaults to true. */
821
+ loop?: boolean;
822
+ /** Footer bar content. Defaults to keyboard hints; pass `null` for no footer. */
823
+ footer?: ReactNode;
824
+ /** Accessible name of the dialog and the listbox. Defaults to "Search". */
825
+ label?: string;
826
+ /**
827
+ * The element the palette grows out of. Defaults to the SearchTrigger that opened it (or any
828
+ * visible one). Pass `null` to always scale in from the centre.
829
+ */
830
+ origin?: HTMLElement | RefObject<HTMLElement | null> | null;
831
+ /** Portal container. Defaults to document.body. */
832
+ container?: HTMLElement | null;
833
+ className?: string;
834
+ children?: ReactNode;
835
+ }
836
+ /**
837
+ * The command palette: a thin, styled layer over cmdk in a Radix dialog. Opened from a
838
+ * SearchTrigger it grows out of the pill (and folds back into it on close); opened any other
839
+ * way it scales up from the centre. Compose it from CommandGroup, CommandItem, CommandEmpty,
840
+ * CommandLoading and CommandSeparator.
841
+ */
842
+ declare const CommandPalette: react.ForwardRefExoticComponent<CommandPaletteProps & react.RefAttributes<HTMLDivElement>>;
843
+ interface CommandKeyProps extends ComponentPropsWithoutRef<'kbd'> {
844
+ }
845
+ /** A keycap, as used in the footer hints and item shortcuts. */
846
+ declare const CommandKey: react.ForwardRefExoticComponent<CommandKeyProps & react.RefAttributes<HTMLElement>>;
847
+ /** The default footer: how to drive the palette from the keyboard. */
848
+ declare function CommandHints(): react.JSX.Element;
849
+ interface CommandGroupProps extends ComponentPropsWithoutRef<typeof Command.Group> {
850
+ }
851
+ /** A titled run of items. Headings are sentence case. */
852
+ declare const CommandGroup: react.ForwardRefExoticComponent<CommandGroupProps & react.RefAttributes<HTMLDivElement>>;
853
+ interface CommandItemProps extends Omit<ComponentPropsWithoutRef<typeof Command.Item>, 'children'> {
854
+ /** Shown in a rounded tile at the start of the row. */
855
+ icon?: ReactNode;
856
+ /** Quiet trailing text, e.g. a price or "12 in stock". */
857
+ hint?: ReactNode;
858
+ /** Keycaps shown at the end, e.g. `['G', 'O']`. */
859
+ shortcut?: string[];
860
+ children: ReactNode;
861
+ }
862
+ /**
863
+ * One result. `value` must be unique in the palette; it defaults to the text of `children`.
864
+ * The selected row carries the accent mark, which slides between rows as the selection moves.
865
+ */
866
+ declare const CommandItem: react.ForwardRefExoticComponent<CommandItemProps & react.RefAttributes<HTMLDivElement>>;
867
+ interface CommandSeparatorProps extends ComponentPropsWithoutRef<typeof Command.Separator> {
868
+ }
869
+ /** A hairline between groups. Hidden while searching unless `alwaysRender`. */
870
+ declare const CommandSeparator: react.ForwardRefExoticComponent<CommandSeparatorProps & react.RefAttributes<HTMLDivElement>>;
871
+ interface CommandEmptyProps extends ComponentPropsWithoutRef<typeof Command.Empty> {
872
+ /** Replaces the empty-orbit glyph. Pass `null` for none. */
873
+ icon?: ReactNode;
874
+ /** A quieter second line, e.g. what to try instead. */
875
+ description?: ReactNode;
876
+ }
877
+ /** Shown automatically when nothing matches. Render it only once async results have arrived. */
878
+ declare const CommandEmpty: react.ForwardRefExoticComponent<CommandEmptyProps & react.RefAttributes<HTMLDivElement>>;
879
+ interface CommandLoadingProps extends ComponentPropsWithoutRef<typeof Command.Loading> {
880
+ }
881
+ /** A row that says results are on their way. Render it while your async search runs. */
882
+ declare const CommandLoading: react.ForwardRefExoticComponent<CommandLoadingProps & react.RefAttributes<HTMLDivElement>>;
883
+
884
+ interface FigureTabItem<K extends string = string> {
885
+ key: K;
886
+ label: ReactNode;
887
+ /** The figure, already formatted. */
888
+ value: ReactNode;
889
+ /** Change indicator, e.g. <Delta />. */
890
+ change?: ReactNode;
891
+ /** Quiet context after the change, e.g. "vs previous 30 days". */
892
+ hint?: ReactNode;
893
+ }
894
+ interface FigureTabsProps<K extends string = string> extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
895
+ items: ReadonlyArray<FigureTabItem<K>>;
896
+ value: K;
897
+ onValueChange: (key: K) => void;
898
+ /** Shows a shimmer where the figures will be. */
899
+ loading?: boolean;
900
+ /** `compact`: one baseline per figure (label, figure, change), like the totals on a till's Z-read. */
901
+ variant?: 'default' | 'compact';
902
+ 'aria-label': string;
903
+ }
904
+ /**
905
+ * A row of headline figures where one drives the chart below it. The selected figure is marked
906
+ * by a teal line that glides between figures. Arrow keys move the selection.
907
+ */
908
+ declare function FigureTabsInner<K extends string>({ items, value, onValueChange, loading, variant, className, ...rest }: FigureTabsProps<K>, ref: React.ForwardedRef<HTMLDivElement>): react.JSX.Element;
909
+ declare const FigureTabs: <K extends string = string>(props: FigureTabsProps<K> & {
910
+ ref?: React.Ref<HTMLDivElement>;
911
+ }) => ReturnType<typeof FigureTabsInner>;
912
+
913
+ interface RollingNumberProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'children'> {
914
+ /** The number to show. Each digit rolls to its new value like a till display. */
915
+ value: number;
916
+ /** `Intl.NumberFormat` options, e.g. `{ style: 'currency', currency: 'GBP' }`. */
917
+ format?: Intl.NumberFormatOptions;
918
+ /** Locale for formatting. Defaults to `en-GB`. */
919
+ locale?: string;
920
+ /** Seconds one roll takes. Defaults to 0.9. */
921
+ duration?: number;
922
+ /** Roll up from zero on first render. Defaults to true. */
923
+ animateOnMount?: boolean;
924
+ /** Announce changes to screen readers as they happen (`aria-live="polite"`). Off by default. */
925
+ live?: boolean;
926
+ }
927
+ /**
928
+ * A till display. Each digit is a reel that rolls to its new value; separators and the currency
929
+ * sign stay put, and columns open or close smoothly when the number of digits changes.
930
+ * Screen readers get the plain formatted value.
931
+ */
932
+ declare const RollingNumber: react.ForwardRefExoticComponent<RollingNumberProps & react.RefAttributes<HTMLSpanElement>>;
933
+
934
+ type SparklineTone = 'accent' | 'positive' | 'negative' | 'neutral';
935
+ interface SparklineProps extends Omit<SVGAttributes<SVGSVGElement>, 'width' | 'height' | 'fill' | 'children'> {
936
+ /** Values in order, oldest first. Empty or flat data draws a level line. */
937
+ data: readonly number[];
938
+ /** Width in px. Defaults to 96. */
939
+ width?: number;
940
+ /** Height in px. Defaults to 28. */
941
+ height?: number;
942
+ /** Line colour by meaning. `accent` (default) for neutral trends, status tones only for status. */
943
+ tone?: SparklineTone;
944
+ /** Marks the latest value with a dot. */
945
+ showEnd?: boolean;
946
+ /** Soft wash under the line. */
947
+ fill?: boolean;
948
+ /** Accessible description, e.g. "Orders over the last 14 days, rising". Decorative when omitted. */
949
+ label?: string;
950
+ }
951
+ /** A tiny trend line that draws itself in once. Colour comes from `tone`, never from the data. */
952
+ declare const Sparkline: react.ForwardRefExoticComponent<SparklineProps & react.RefAttributes<SVGSVGElement>>;
953
+
954
+ interface AreaChartDatum {
955
+ /** The day (or bucket) this point stands for. `YYYY-MM-DD` strings are read as local dates. */
956
+ date: string | Date;
957
+ value: number;
958
+ /** The same point in the comparison period, drawn as a dashed line. */
959
+ compare?: number | null;
960
+ }
961
+ interface AreaChartProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
962
+ data: readonly AreaChartDatum[];
963
+ /** Height in px of the plot plus its date labels. The legend, when shown, sits above. Defaults to 240. */
964
+ height?: number;
965
+ /** Formats values in the tooltip and the accessible summary. */
966
+ formatValue?: (value: number) => string;
967
+ /** Formats gridline labels. Defaults to a compact number, e.g. "2.5K". */
968
+ formatTick?: (value: number) => string;
969
+ /** Formats dates on the axis. */
970
+ formatDate?: (date: Date) => string;
971
+ /** Formats the date heading the tooltip. Defaults to weekday, day and month. */
972
+ formatTooltipDate?: (date: Date) => string;
973
+ /** Names the main series in the legend and the accessible summary. Defaults to "This period". */
974
+ valueLabel?: string;
975
+ /** Names the comparison series. Defaults to "Previous period". */
976
+ compareLabel?: string;
977
+ /**
978
+ * Waiting for data. With no data yet, a shimmering placeholder stands in for the plot;
979
+ * with data already drawn, the chart holds its frame, dimmed, until the new data lands.
980
+ */
981
+ loading?: boolean;
982
+ /** Shown in place of the plot when `data` is empty. */
983
+ emptyMessage?: ReactNode;
984
+ /** Accessible summary. Generated from the data when omitted. */
985
+ label?: string;
986
+ }
987
+ /**
988
+ * The range chart: one smooth line with a soft wash beneath it, an optional dashed comparison,
989
+ * and a crosshair that snaps to the nearest day with a tooltip that glides between points.
990
+ * Keyboard: focus the plot, then arrow keys step through the days (Home/End jump, Escape hides).
991
+ */
992
+ declare const AreaChart: react.ForwardRefExoticComponent<AreaChartProps & react.RefAttributes<HTMLDivElement>>;
993
+
994
+ interface GlobeMarker {
995
+ lat: number;
996
+ lng: number;
997
+ /** Browsing right now (pings) vs seen recently (faint). */
998
+ live?: boolean;
999
+ /** City or country, shown in the chip beside the front-most marker. */
1000
+ label?: string;
1001
+ /** Sessions clustered at this point. */
1002
+ count?: number;
1003
+ /** performance.now() of the newest arrival here; drives the flash. */
1004
+ arrivedAt?: number;
1005
+ /** ISO 3166-1 alpha-2, so nearby pins can roll up into one per country. */
1006
+ countryCode?: string | null;
1007
+ }
1008
+ interface LiveGlobeProps {
1009
+ /** Canvas height in px (and width, unless `width` is set). The sphere is 0.76 of it. Defaults to 200. */
1010
+ size?: number;
1011
+ className?: string;
1012
+ /**
1013
+ * Pixels at the top/bottom of the canvas that the parent may clip
1014
+ * (e.g. a shorter hero centring a taller globe). Place chips inside it.
1015
+ */
1016
+ safeInset?: number;
1017
+ markers?: GlobeMarker[];
1018
+ /** Change the key to ease the globe round to that spot. */
1019
+ focus?: {
1020
+ lat: number;
1021
+ lng: number;
1022
+ key: string;
1023
+ } | null;
1024
+ /**
1025
+ * When every session is in one place, park on it: the globe eases there
1026
+ * and stops idle-spinning, so the view stays where the action is. Drag
1027
+ * still works and is respected afterwards.
1028
+ */
1029
+ holdAt?: {
1030
+ lat: number;
1031
+ lng: number;
1032
+ } | null;
1033
+ /** Click a pin to zoom in on it; click elsewhere to zoom back out. */
1034
+ zoomable?: boolean;
1035
+ /** Shown while zoomed in, so people know how to get back. */
1036
+ zoomOutHint?: string;
1037
+ /** Tap (not drag) on the globe with nothing zoomed. */
1038
+ onClick?: () => void;
1039
+ /** Tooltip and accessible name while the globe is interactive (zoomable or clickable). */
1040
+ title?: string;
1041
+ /**
1042
+ * Canvas width; defaults to `size` (a square). Wider than tall gives a
1043
+ * zoomed-in map room to breathe where the layout has the space.
1044
+ */
1045
+ width?: number;
1046
+ /** Draw once and hold still: no idle spin, no pulsing pins. For thumbnails and print. */
1047
+ still?: boolean;
1048
+ }
1049
+ declare const LiveGlobe: FC<LiveGlobeProps>;
1050
+
1051
+ type ShellMode = 'desktop' | 'tablet' | 'mobile';
1052
+ interface ShellContextValue {
1053
+ /** Sidebar shows icons only. */
1054
+ collapsed: boolean;
1055
+ setCollapsed: (next: boolean) => void;
1056
+ toggleCollapsed: () => void;
1057
+ /** Mobile drawer visibility. */
1058
+ drawerOpen: boolean;
1059
+ setDrawerOpen: (next: boolean) => void;
1060
+ mode: ShellMode;
1061
+ }
1062
+ /** Read and control the shell from anywhere inside <AppShell>. */
1063
+ declare function useShell(): ShellContextValue;
1064
+ /** Like useShell, but returns null outside a shell (for components that also render standalone). */
1065
+ declare function useOptionalShell(): ShellContextValue | null;
1066
+ interface AppShellProps extends HTMLAttributes<HTMLDivElement> {
1067
+ /** The <Sidebar>. */
1068
+ sidebar: ReactNode;
1069
+ /** The <TopBar>. */
1070
+ header: ReactNode;
1071
+ /** Controlled collapsed state. Leave undefined to let the shell manage it. */
1072
+ collapsed?: boolean;
1073
+ defaultCollapsed?: boolean;
1074
+ onCollapsedChange?: (collapsed: boolean) => void;
1075
+ /** Controlled mobile drawer state. */
1076
+ drawerOpen?: boolean;
1077
+ onDrawerOpenChange?: (open: boolean) => void;
1078
+ /** Content placed beside the canvas, e.g. a docked assistant panel. */
1079
+ aside?: ReactNode;
1080
+ children: ReactNode;
1081
+ }
1082
+ /**
1083
+ * The Orbit app frame: a full-height sidebar on the ground, a slim header, and the page on a raised
1084
+ * canvas. Collapses to an icon rail on tablets and to a drawer on phones.
1085
+ */
1086
+ declare const AppShell: react.ForwardRefExoticComponent<AppShellProps & react.RefAttributes<HTMLDivElement>>;
1087
+ interface CanvasProps extends HTMLAttributes<HTMLElement> {
1088
+ /** Element for the scroll container. Defaults to <main>. */
1089
+ as?: 'main' | 'div' | 'section';
1090
+ /** Classes for the inner scroll container (hosts may rely on a known selector). */
1091
+ scrollClassName?: string;
1092
+ /** Content pinned above the scroll area inside the canvas, e.g. banners. */
1093
+ top?: ReactNode;
1094
+ }
1095
+ /** The raised surface every page sits on. Scrolls independently of the chrome. */
1096
+ declare const Canvas: react.ForwardRefExoticComponent<CanvasProps & react.RefAttributes<HTMLElement>>;
1097
+
1098
+ interface SidebarProps extends HTMLAttributes<HTMLElement> {
1099
+ /** Accessible name for the navigation landmark. */
1100
+ label?: string;
1101
+ /** Force the icon rail regardless of the shell (e.g. when rendered standalone). */
1102
+ collapsed?: boolean;
1103
+ children: ReactNode;
1104
+ }
1105
+ /**
1106
+ * The Orbit sidebar. Items share one active pill and one hover pill, so moving between pages or
1107
+ * sweeping the pointer down the list glides a single shape instead of flashing many.
1108
+ */
1109
+ declare const Sidebar: react.ForwardRefExoticComponent<SidebarProps & react.RefAttributes<HTMLElement>>;
1110
+ declare function SidebarHeader({ className, ...rest }: HTMLAttributes<HTMLDivElement>): react.JSX.Element;
1111
+ declare function SidebarFooter({ className, ...rest }: HTMLAttributes<HTMLDivElement>): react.JSX.Element;
1112
+ interface SidebarNavProps extends HTMLAttributes<HTMLElement> {
1113
+ label?: string;
1114
+ }
1115
+ /** The scrolling list of sections. Clears the hover pill when the pointer leaves. */
1116
+ declare function SidebarNav({ className, label, onMouseLeave, ...rest }: SidebarNavProps): react.JSX.Element;
1117
+ interface SidebarSectionProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
1118
+ /** Quiet heading, sentence case. Hidden in the icon rail. */
1119
+ title?: ReactNode;
1120
+ }
1121
+ declare function SidebarSection({ title, className, children, ...rest }: SidebarSectionProps): react.JSX.Element;
1122
+ interface SidebarItemProps extends Omit<HTMLAttributes<HTMLLIElement>, 'onClick' | 'onSelect'> {
1123
+ label: ReactNode;
1124
+ /** Icon at rest. */
1125
+ icon?: ReactNode;
1126
+ /** Icon while active (e.g. a filled or duotone variant). Falls back to `icon`. */
1127
+ activeIcon?: ReactNode;
1128
+ /** Marks the current page: the active pill settles here. */
1129
+ active?: boolean;
1130
+ /** A child route is active: the item reads as current without taking the pill. */
1131
+ current?: boolean;
1132
+ /** Small count or marker on the right. Hidden from the accessible name. */
1133
+ badge?: ReactNode;
1134
+ /** Accessible description for the badge, e.g. "12 unfulfilled". */
1135
+ badgeLabel?: string;
1136
+ /**
1137
+ * The element that navigates, typically a router link: `link={<NavLink to="/orders" />}`.
1138
+ * Constellation fills it with the item's content and classes. Without it the row is a button.
1139
+ */
1140
+ link?: ReactElement;
1141
+ onSelect?: (event: MouseEvent<HTMLElement>) => void;
1142
+ /** Nested items (one level). */
1143
+ children?: ReactNode;
1144
+ /** Controlled open state for nested items. */
1145
+ open?: boolean;
1146
+ defaultOpen?: boolean;
1147
+ onOpenChange?: (open: boolean) => void;
1148
+ /** Label for the expand toggle, for screen readers. */
1149
+ toggleLabel?: string;
1150
+ /** Stable id for the hover pill. Defaults to a generated id. */
1151
+ itemId?: string;
1152
+ }
1153
+ declare const SidebarItem: react.ForwardRefExoticComponent<SidebarItemProps & react.RefAttributes<HTMLLIElement>>;
1154
+
1155
+ interface TopBarProps extends HTMLAttributes<HTMLElement> {
1156
+ /** Left: breadcrumbs or the page title. */
1157
+ start?: ReactNode;
1158
+ /** Centre: usually the <SearchTrigger>. */
1159
+ center?: ReactNode;
1160
+ /** Right: actions, notifications, account. */
1161
+ end?: ReactNode;
1162
+ /** Accessible label for the menu button shown on phones. */
1163
+ menuLabel?: string;
1164
+ }
1165
+ /** The slim bar above the canvas. Sits on the app ground, so it never competes with the page. */
1166
+ declare const TopBar: react.ForwardRefExoticComponent<TopBarProps & react.RefAttributes<HTMLElement>>;
1167
+ interface BreadcrumbItem {
1168
+ label: ReactNode;
1169
+ /** Router link element to render, e.g. <Link to="/orders" />. Omit for the current page. */
1170
+ link?: ReactElement;
1171
+ key?: string;
1172
+ }
1173
+ interface BreadcrumbsProps extends HTMLAttributes<HTMLElement> {
1174
+ items: BreadcrumbItem[];
1175
+ label?: string;
1176
+ }
1177
+ /** Where you are, quietly. The last crumb is the current page. */
1178
+ declare function Breadcrumbs({ items, label, className, ...rest }: BreadcrumbsProps): react.JSX.Element;
1179
+ interface SidebarToggleProps extends HTMLAttributes<HTMLButtonElement> {
1180
+ collapseLabel?: string;
1181
+ expandLabel?: string;
1182
+ }
1183
+ /** Collapses the sidebar to the icon rail and back. */
1184
+ declare function SidebarToggle({ collapseLabel, expandLabel, className, ...rest }: SidebarToggleProps): react.JSX.Element | null;
1185
+
1186
+ interface StoreButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'name'> {
1187
+ /** Store name. */
1188
+ name: ReactNode;
1189
+ /** Second line, e.g. the store's domain. */
1190
+ detail?: ReactNode;
1191
+ /** Store logo or initials, e.g. <Avatar shape="square" />. */
1192
+ avatar?: ReactNode;
1193
+ }
1194
+ /**
1195
+ * The merchant's store: name, domain and logo, as the trigger for whatever store switcher the host
1196
+ * renders. The Orbit shell keeps it at the foot of the sidebar, under the Orbit logo's navigation.
1197
+ */
1198
+ declare const StoreButton: react.ForwardRefExoticComponent<StoreButtonProps & react.RefAttributes<HTMLButtonElement>>;
1199
+ interface ShellBrandProps extends HTMLAttributes<HTMLDivElement> {
1200
+ /** Shown beside the logo when expanded, e.g. a plan name or version. */
1201
+ meta?: ReactNode;
1202
+ /**
1203
+ * `header`: the app's logo, top left of the sidebar, at full strength. `footer` (default): a
1204
+ * quiet signature at the foot. The icon rail shows the mark alone in both.
1205
+ */
1206
+ placement?: 'header' | 'footer';
1207
+ /**
1208
+ * The app's own name beside the Orbit mark, e.g. "Store Dashboard" or "Supplier Dashboard".
1209
+ * With a name the brand reads as the mark, the name in Sora and `byline` under it, in place of
1210
+ * the Orbit Commerce lockup.
1211
+ */
1212
+ name?: ReactNode;
1213
+ /** The line under `name`. Defaults to "by Orbit Commerce". */
1214
+ byline?: ReactNode;
1215
+ }
1216
+ /**
1217
+ * The Orbit logo in the sidebar: the app's mark at the top, or a quiet signature at the foot. Give
1218
+ * it a `name` to sign an app of the family: the mark, "Store Dashboard", "by Orbit Commerce".
1219
+ */
1220
+ declare function ShellBrand({ meta, placement, name, byline, className, ...rest }: ShellBrandProps): react.JSX.Element;
1221
+
1222
+ /**
1223
+ * Motion presets. Constellation motion is orbital: springs that settle with a whisper of
1224
+ * overshoot, never linear slides. CSS equivalents live in tokens.css (--o-ease-*).
1225
+ */
1226
+ declare const spring: {
1227
+ /** Pills, indicators, thumbs. Shared with orbitcommerce.net's pill spring. */
1228
+ readonly snappy: {
1229
+ type: "spring";
1230
+ stiffness: number;
1231
+ damping: number;
1232
+ mass: number;
1233
+ };
1234
+ /** Panels, drawers, the command palette. */
1235
+ readonly soft: {
1236
+ type: "spring";
1237
+ stiffness: number;
1238
+ damping: number;
1239
+ mass: number;
1240
+ };
1241
+ /** Large layout moves, e.g. the sidebar collapsing. */
1242
+ readonly gentle: {
1243
+ type: "spring";
1244
+ stiffness: number;
1245
+ damping: number;
1246
+ mass: number;
1247
+ };
1248
+ /** Critically damped: lands exactly, no wobble (e.g. the palette settling back into its pill). */
1249
+ readonly land: {
1250
+ type: "spring";
1251
+ stiffness: number;
1252
+ damping: number;
1253
+ mass: number;
1254
+ };
1255
+ /** Small celebratory pops: a badge count changing, a check landing. */
1256
+ readonly bouncy: {
1257
+ type: "spring";
1258
+ stiffness: number;
1259
+ damping: number;
1260
+ mass: number;
1261
+ };
1262
+ };
1263
+ declare const ease: {
1264
+ readonly out: readonly [0.16, 1, 0.3, 1];
1265
+ readonly inOut: readonly [0.65, 0, 0.35, 1];
1266
+ readonly brand: readonly [0.625, 0.05, 0, 1];
1267
+ };
1268
+ declare const duration: {
1269
+ readonly instant: 0.09;
1270
+ readonly fast: 0.15;
1271
+ readonly base: 0.22;
1272
+ readonly slow: 0.32;
1273
+ readonly slower: 0.48;
1274
+ readonly focal: 0.72;
1275
+ };
1276
+
1277
+ /** Joins class names. Constellation styles live in plain CSS, so no merge step is needed. */
1278
+ declare function cx(...inputs: ClassValue[]): string;
1279
+
1280
+ type SelectSize = 'sm' | 'md' | 'lg';
1281
+ interface SelectTriggerProps extends Omit<ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>, 'placeholder'> {
1282
+ /** Height, when it should differ from the `size` set on `Select`. */
1283
+ size?: SelectSize;
1284
+ /**
1285
+ * Leading icon (16px), muted until the trigger has focus. Leave it out when the rows carry icons:
1286
+ * the chosen row's icon shows here on its own.
1287
+ */
1288
+ icon?: ReactNode;
1289
+ /** Shown while nothing is chosen. Only used when the trigger has no `SelectValue` of its own. */
1290
+ placeholder?: ReactNode;
1291
+ /** Error look and `aria-invalid`. Inside a Field, follows the Field's `error`. */
1292
+ invalid?: boolean;
1293
+ }
1294
+ /**
1295
+ * The closed select: an Input frame showing the chosen value (or the placeholder) and a chevron.
1296
+ * Inside a `Field` it picks up the label, the hint or error, and the invalid state.
1297
+ */
1298
+ declare const SelectTrigger: react.ForwardRefExoticComponent<SelectTriggerProps & RefAttributes<HTMLButtonElement>>;
1299
+ interface SelectValueProps extends ComponentPropsWithoutRef<typeof SelectPrimitive.Value> {
1300
+ /** Shown in quiet slate while nothing is chosen, e.g. "Choose a rate". */
1301
+ placeholder?: ReactNode;
1302
+ }
1303
+ /**
1304
+ * The chosen row's label (and icon), mirrored into the trigger. Give it `children` to show
1305
+ * something else, e.g. a shorter form of the label.
1306
+ */
1307
+ declare const SelectValue: react.ForwardRefExoticComponent<SelectValueProps & RefAttributes<HTMLSpanElement>>;
1308
+ interface SelectContentProps extends ComponentPropsWithoutRef<typeof SelectPrimitive.Content> {
1309
+ /**
1310
+ * Width: px, any CSS length, or `'trigger'` to match the trigger exactly. By default the list is at
1311
+ * least as wide as the trigger and grows for longer rows.
1312
+ */
1313
+ width?: number | string;
1314
+ /** Where the list is portalled. Defaults to `document.body`. */
1315
+ container?: HTMLElement | null;
1316
+ }
1317
+ /**
1318
+ * The raised list. Portalled (above dialogs and sheets), collision-aware, and it grows out of the
1319
+ * trigger. Long lists scroll, with soft arrows at either end that scroll while the pointer rests on
1320
+ * them. `onScroll` reports the list's own scrolling, e.g. to load more rows near the end.
1321
+ */
1322
+ declare const SelectContent: react.ForwardRefExoticComponent<SelectContentProps & RefAttributes<HTMLDivElement>>;
1323
+ interface SelectItemProps extends ComponentPropsWithoutRef<typeof SelectPrimitive.Item> {
1324
+ /** Leading icon (16px). Once the row is chosen, it shows in the trigger too. */
1325
+ icon?: ReactNode;
1326
+ /** A quieter second line under the label. In the list only. */
1327
+ description?: ReactNode;
1328
+ /** Quiet trailing text, e.g. a price or "12 in stock". In the list only. */
1329
+ hint?: ReactNode;
1330
+ }
1331
+ /**
1332
+ * One choice. `children` is its label, which the trigger shows once it is chosen; `value` must be
1333
+ * unique and not empty. Pass `textValue` for type-to-select when the label is not plain text.
1334
+ */
1335
+ declare const SelectItem: react.ForwardRefExoticComponent<SelectItemProps & RefAttributes<HTMLDivElement>>;
1336
+ /** Groups rows under a `SelectLabel`, for assistive tech too. No visual of its own. */
1337
+ declare const SelectGroup: react.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & RefAttributes<HTMLDivElement>>;
1338
+ type SelectGroupProps = SelectPrimitive.SelectGroupProps;
1339
+ type SelectLabelProps = ComponentPropsWithoutRef<typeof SelectPrimitive.Label>;
1340
+ /** A quiet heading for the rows of a `SelectGroup`. Sentence case, never all caps. */
1341
+ declare const SelectLabel: react.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectLabelProps & RefAttributes<HTMLDivElement>, "ref"> & RefAttributes<HTMLDivElement>>;
1342
+ type SelectSeparatorProps = ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>;
1343
+ /** A hairline between groups of rows. */
1344
+ declare const SelectSeparator: react.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectSeparatorProps & RefAttributes<HTMLDivElement>, "ref"> & RefAttributes<HTMLDivElement>>;
1345
+ interface SelectOption<V extends string = string> {
1346
+ /** Unique, and never an empty string. */
1347
+ value: V;
1348
+ /** What the row shows, and the trigger once it is chosen. */
1349
+ label: ReactNode;
1350
+ /** A quieter second line under the label, in the list only. */
1351
+ description?: ReactNode;
1352
+ /** Leading icon (16px), shown in the trigger too once chosen. */
1353
+ icon?: ReactNode;
1354
+ /** Quiet trailing text, e.g. a price or "12 in stock", in the list only. */
1355
+ hint?: ReactNode;
1356
+ disabled?: boolean;
1357
+ /** Text for type-to-select when `label` is not plain text. */
1358
+ textValue?: string;
1359
+ }
1360
+ interface SelectOptionGroup<V extends string = string> {
1361
+ /** A quiet heading over the group's rows. */
1362
+ label: ReactNode;
1363
+ options: ReadonlyArray<SelectOption<V>>;
1364
+ }
1365
+ /** Props of the Radix root, and the size. Everything else belongs to the trigger. */
1366
+ type RootKey = keyof SelectPrimitive.SelectProps | 'size';
1367
+ interface SelectRootProps<V extends string> extends Omit<SelectPrimitive.SelectProps, 'value' | 'defaultValue' | 'onValueChange' | 'children'> {
1368
+ /** Controlled value. `''` clears it, and the placeholder shows again. */
1369
+ value?: V | '';
1370
+ /** Starting value when uncontrolled. */
1371
+ defaultValue?: V;
1372
+ onValueChange?: (value: V) => void;
1373
+ /** `sm` 30px, `md` 36px (default), `lg` 44px: the Input and Button heights. The list's rows follow it. */
1374
+ size?: SelectSize;
1375
+ }
1376
+ /** The parts, composed by hand: a `SelectTrigger`, then a `SelectContent` holding the rows. */
1377
+ interface SelectPartsProps<V extends string = string> extends SelectRootProps<V> {
1378
+ children: ReactNode;
1379
+ options?: undefined;
1380
+ }
1381
+ /**
1382
+ * The whole control from a list of options (and groups of options). Trigger props (`id`,
1383
+ * `aria-label`, `icon`, `invalid`, `className`...) go to the trigger, and so does the `ref`.
1384
+ */
1385
+ type SelectOptionsProps<V extends string = string> = SelectRootProps<V> & Omit<SelectTriggerProps, RootKey | 'placeholder'> & {
1386
+ options: ReadonlyArray<SelectOption<V> | SelectOptionGroup<V>>;
1387
+ /** Shown in the trigger while nothing is chosen, e.g. "Choose a rate". */
1388
+ placeholder?: ReactNode;
1389
+ /** Width of the list: px, any CSS length, or `'trigger'`. By default at least the trigger's width. */
1390
+ contentWidth?: number | string;
1391
+ children?: undefined;
1392
+ };
1393
+ type SelectProps<V extends string = string> = SelectPartsProps<V> | SelectOptionsProps<V>;
1394
+ /**
1395
+ * Choose one value from a list. Pass `options` for the common case and it renders the trigger and
1396
+ * the list for you; or compose `SelectTrigger`, `SelectContent` and `SelectItem` (with
1397
+ * `SelectGroup`, `SelectLabel` and `SelectSeparator`) as its children.
1398
+ *
1399
+ * For two to five choices that should all stay visible, use a RadioGroup or a SegmentedControl.
1400
+ */
1401
+ declare const Select: <V extends string = string>(props: SelectProps<V> & RefAttributes<HTMLButtonElement>) => ReactElement | null;
1402
+
1403
+ type TextareaSize = 'sm' | 'md' | 'lg';
1404
+ interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
1405
+ /** `sm` 13px, `md` 14px (default) or `lg` 15px text. One row is as tall as an Input of the same size. */
1406
+ size?: TextareaSize;
1407
+ /** Grow with the text, from `minRows` to `maxRows`, then scroll. The resize handle goes. */
1408
+ autoGrow?: boolean;
1409
+ /** With `autoGrow`: the fewest rows shown. Defaults to `rows`, or 3. */
1410
+ minRows?: number;
1411
+ /** With `autoGrow`: the most rows before the text scrolls. No limit when left out. */
1412
+ maxRows?: number;
1413
+ /**
1414
+ * Show a count of the characters typed, out of `maxLength` when there is one. In the last tenth
1415
+ * of the limit it takes the warning wash.
1416
+ */
1417
+ showCount?: boolean;
1418
+ /**
1419
+ * What screen readers hear for the count when there is a `maxLength`: read with the field, and
1420
+ * announced as it changes in the last tenth. Defaults to "12 characters left".
1421
+ */
1422
+ countLabel?: (length: number, maxLength: number) => string;
1423
+ /** Error look and `aria-invalid`. Inside a Field, follows the Field's `error`. */
1424
+ invalid?: boolean;
1425
+ }
1426
+ /**
1427
+ * A multi-line text field: notes, descriptions, messages. Every native textarea prop goes to the
1428
+ * <textarea> (and so does the ref); `className` and `style` go to the frame around it.
1429
+ */
1430
+ declare const Textarea: react.ForwardRefExoticComponent<TextareaProps & react.RefAttributes<HTMLTextAreaElement>>;
1431
+
1432
+ type RadioGroupVariant = 'list' | 'card';
1433
+ type RadioGroupSize = 'sm' | 'md';
1434
+ type RadioGroupOrientation = 'vertical' | 'horizontal';
1435
+ interface RadioGroupProps<V extends string = string> extends Omit<ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>, 'value' | 'defaultValue' | 'onValueChange' | 'orientation'> {
1436
+ /** Controlled value. `null` for no choice yet. */
1437
+ value?: V | null;
1438
+ /** Starting value when uncontrolled. Leave it out to start with nothing chosen. */
1439
+ defaultValue?: V;
1440
+ onValueChange?: (value: V) => void;
1441
+ /**
1442
+ * `list` (default): a radio beside each label. `card`: each option is a tile whose edge turns teal
1443
+ * when chosen, for settings that choose between richer options.
1444
+ */
1445
+ variant?: RadioGroupVariant;
1446
+ /**
1447
+ * `vertical` (default) stacks the options. `horizontal` sets them in a row that wraps; cards share
1448
+ * the width equally. The arrow keys move between options either way.
1449
+ */
1450
+ orientation?: RadioGroupOrientation;
1451
+ /** `md` 16px radios (default), `sm` 14px: the Checkbox sizes. */
1452
+ size?: RadioGroupSize;
1453
+ /** Error look on the radios and `aria-invalid`. Inside a Field, follows the Field's `error`. */
1454
+ invalid?: boolean;
1455
+ }
1456
+ /**
1457
+ * One choice out of a few, all of them in view: a delivery speed, what happens when stock runs out.
1458
+ * Give it a name: put it in a `Field`, or pass `aria-label` or `aria-labelledby`. Holds `RadioGroupItem`s.
1459
+ *
1460
+ * For a long list use a Select; for switching views use a SegmentedControl.
1461
+ */
1462
+ declare const RadioGroup: <V extends string = string>(props: RadioGroupProps<V> & RefAttributes<HTMLDivElement>) => ReactElement | null;
1463
+ interface RadioGroupItemProps extends Omit<ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>, 'children'> {
1464
+ /** The option's name: text beside the radio, or the card's title. Clicking it chooses the option. */
1465
+ label?: ReactNode;
1466
+ /** A quieter line under the label, linked for screen readers. */
1467
+ description?: ReactNode;
1468
+ /** Quiet trailing detail, e.g. a price ("£6.95") or "Free". Firmer on a card. */
1469
+ hint?: ReactNode;
1470
+ /** Draw this option as a list row or a card, whatever the group's `variant`. */
1471
+ variant?: RadioGroupVariant;
1472
+ }
1473
+ /**
1474
+ * One option. With a `label` it is a row (or a card); without one it is the bare radio, for a label
1475
+ * of your own (`<label htmlFor={id}>`) or an `aria-label`.
1476
+ *
1477
+ * `ref` and native props go to the radio button; `className` goes to the outer element.
1478
+ */
1479
+ declare const RadioGroupItem: react.ForwardRefExoticComponent<RadioGroupItemProps & RefAttributes<HTMLButtonElement>>;
1480
+
1481
+ type TabsVariant = 'line' | 'pill' | 'steps';
1482
+ type TabsSize = 'sm' | 'md' | 'lg';
1483
+ /** Where a step stands, for `variant="steps"`. */
1484
+ type TabsStepStatus = 'not-started' | 'in-progress' | 'completed';
1485
+ type RootProps = ComponentPropsWithoutRef<typeof TabsPrimitive.Root>;
1486
+ interface TabsProps<V extends string = string> extends Omit<RootProps, 'value' | 'defaultValue' | 'onValueChange' | 'orientation' | 'asChild'> {
1487
+ /** The chosen tab, when you control it. */
1488
+ value?: V;
1489
+ /** The tab chosen at first, when uncontrolled. */
1490
+ defaultValue?: V;
1491
+ /** Called with the newly chosen tab's value. */
1492
+ onValueChange?: (value: V) => void;
1493
+ }
1494
+ /**
1495
+ * Owns the chosen tab and holds the list and the panels. Control it with `value` and
1496
+ * `onValueChange`, or start it with `defaultValue`. Horizontal only.
1497
+ */
1498
+ declare const Tabs: <V extends string = string>(props: TabsProps<V> & RefAttributes<HTMLDivElement>) => ReactElement | null;
1499
+ interface TabsListProps extends Omit<ComponentPropsWithoutRef<typeof TabsPrimitive.List>, 'asChild'> {
1500
+ /**
1501
+ * `line` (default): page sections on a hairline. `pill`: a compact switch for cards and dialogs,
1502
+ * the segmented control's look. `steps`: the stages of a task, with a status on each trigger.
1503
+ */
1504
+ variant?: TabsVariant;
1505
+ /** `sm` 30px, `md` 36px (default), `lg` 44px: the same heights as buttons and fields. */
1506
+ size?: TabsSize;
1507
+ /** Tabs share the width equally (`line` and `pill`). */
1508
+ fullWidth?: boolean;
1509
+ }
1510
+ /**
1511
+ * The row of tabs. Name it with `aria-label` when nothing nearby says what the tabs are for.
1512
+ * `ref` and other props go to the tablist; `className` and `style` go to the scrolling row around it.
1513
+ */
1514
+ declare const TabsList: react.ForwardRefExoticComponent<TabsListProps & RefAttributes<HTMLDivElement>>;
1515
+ interface TabsTriggerProps extends Omit<ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>, 'asChild'> {
1516
+ /** Leading icon: 16px (15 at `sm`, 18 at `lg`). Decorative. */
1517
+ icon?: ReactNode;
1518
+ /** Icon while the tab is chosen, e.g. the duotone weight. Falls back to `icon`. */
1519
+ activeIcon?: ReactNode;
1520
+ /** A count after the label, e.g. how many variants. Not shown on steps. */
1521
+ count?: number | string;
1522
+ /** Where this step stands. `variant="steps"` only. */
1523
+ status?: TabsStepStatus;
1524
+ /**
1525
+ * What screen readers hear after the label for the step's status. Defaults to "completed" and
1526
+ * "in progress" (nothing while not started). `variant="steps"` only.
1527
+ */
1528
+ statusLabel?: string;
1529
+ }
1530
+ /** One tab. Disabled tabs are skipped by the arrow keys. */
1531
+ declare const TabsTrigger: react.ForwardRefExoticComponent<TabsTriggerProps & RefAttributes<HTMLButtonElement>>;
1532
+ type TabsContentProps = ComponentPropsWithoutRef<typeof TabsPrimitive.Content>;
1533
+ /**
1534
+ * The panel for one tab. Only the chosen panel is mounted (pass `forceMount` to keep the others),
1535
+ * and it fades in as it arrives. Space it from the list yourself.
1536
+ */
1537
+ declare const TabsContent: react.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsContentProps & RefAttributes<HTMLDivElement>, "ref"> & RefAttributes<HTMLDivElement>>;
1538
+
1539
+ type AlertTone = 'neutral' | 'info' | 'success' | 'warning' | 'critical';
1540
+ interface AlertProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
1541
+ /**
1542
+ * What the message means. `info` (default): worth knowing. `success`: done and good. `warning`:
1543
+ * needs the merchant soon. `critical`: something failed or is blocked. `neutral`: context with no
1544
+ * judgement, such as a tip.
1545
+ */
1546
+ tone?: AlertTone;
1547
+ /** A short bold first line. Optional: the children carry the message. */
1548
+ title?: ReactNode;
1549
+ /** Element for the title. Defaults to `p`. */
1550
+ titleAs?: 'h2' | 'h3' | 'h4' | 'p' | 'div';
1551
+ /** Replaces the tone's icon. `null` hides it. */
1552
+ icon?: ReactNode;
1553
+ /** One or two small buttons (`size="sm"`): the next move. */
1554
+ actions?: ReactNode;
1555
+ /** Shows a dismiss button. The alert removes itself when it is pressed. */
1556
+ dismissible?: boolean;
1557
+ /** Called once a dismissed alert has gone, e.g. to remember the choice. Shows the dismiss button. */
1558
+ onDismiss?: () => void;
1559
+ /** Accessible name of the dismiss button. */
1560
+ dismissLabel?: string;
1561
+ }
1562
+ /**
1563
+ * A message box inside a page, card or dialog. Warnings and critical alerts are announced at once
1564
+ * (`role="alert"`), the rest politely (`role="status"`); pass `role` to change that.
1565
+ */
1566
+ declare const Alert: react.ForwardRefExoticComponent<AlertProps & react.RefAttributes<HTMLDivElement>>;
1567
+
1568
+ type ToastTone = 'message' | 'success' | 'info' | 'warning' | 'error' | 'loading';
1569
+ type ToastPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
1570
+ type ToastId = string | number;
1571
+ interface ToastAction {
1572
+ /** The button's words: a verb, e.g. "Undo" or "View order". */
1573
+ label: ReactNode;
1574
+ /**
1575
+ * The button's accessible name when the label needs context, e.g. "Undo deleting Walnut desk riser".
1576
+ * Keep the label's words in it (voice control users say what they see); if they are missing, the
1577
+ * label is put in front.
1578
+ */
1579
+ altText?: string;
1580
+ /**
1581
+ * Runs on click. The toast then closes, unless it is a loading toast or the handler calls
1582
+ * `event.preventDefault()`. Return a promise and the button shows its busy state until it settles;
1583
+ * the toast closes when it resolves.
1584
+ */
1585
+ onClick: (event: MouseEvent<HTMLButtonElement>) => void | Promise<unknown>;
1586
+ /** `destructive` turns the button red, for a follow-up that destroys something. */
1587
+ variant?: 'default' | 'destructive';
1588
+ }
1589
+ interface ToastOptions {
1590
+ /** Pass an id that is already showing to update that toast in place (say, loading into done). */
1591
+ id?: ToastId;
1592
+ /** One more fact, under the title. */
1593
+ description?: ReactNode;
1594
+ /** Time on screen in ms; `Infinity` keeps it until it is dismissed. Defaults by tone (see the docs). */
1595
+ duration?: number;
1596
+ /** One follow-up action, shown as a small button under the text. */
1597
+ action?: ToastAction;
1598
+ /**
1599
+ * `false` hides the close button and turns off swipe to dismiss. Loading toasts offer neither
1600
+ * unless this is `true`, for work the person may want out of the way while it runs.
1601
+ */
1602
+ dismissable?: boolean;
1603
+ /** sonner's spelling of `dismissable`. */
1604
+ dismissible?: boolean;
1605
+ /** Shows this toast somewhere other than the Toaster's `position`. */
1606
+ position?: ToastPosition;
1607
+ /** Replaces the tone's icon. `null` shows none. */
1608
+ icon?: ReactNode;
1609
+ /** Runs when it is closed: by its close button, a swipe or `toast.dismiss`. */
1610
+ onDismiss?: (id: ToastId) => void;
1611
+ /** Runs when its time runs out. */
1612
+ onAutoClose?: (id: ToastId) => void;
1613
+ /** Sends it to the Toaster with this `id`, on a page that has more than one. */
1614
+ toasterId?: string;
1615
+ }
1616
+ /** What a promise toast shows in one of its states: a title, or a title and a description. */
1617
+ type ToastContent = ReactNode | {
1618
+ title: ReactNode;
1619
+ description?: ReactNode;
1620
+ };
1621
+ interface ToastPromiseOptions<T> extends Omit<ToastOptions, 'description' | 'icon'> {
1622
+ /** Shown while the work runs. */
1623
+ loading: ToastContent;
1624
+ /** Shown when it resolves; a function gets the result. Leave it out and the toast just closes. */
1625
+ success?: ToastContent | ((result: T) => ToastContent);
1626
+ /** Shown when it fails; a function gets the error. Leave it out and the toast just closes. */
1627
+ error?: ToastContent | ((error: unknown) => ToastContent);
1628
+ }
1629
+ interface ToastApi {
1630
+ /** A plain message, with no tone icon. Returns the toast's id. */
1631
+ (title: ReactNode, options?: ToastOptions): ToastId;
1632
+ success: (title: ReactNode, options?: ToastOptions) => ToastId;
1633
+ error: (title: ReactNode, options?: ToastOptions) => ToastId;
1634
+ warning: (title: ReactNode, options?: ToastOptions) => ToastId;
1635
+ info: (title: ReactNode, options?: ToastOptions) => ToastId;
1636
+ /** Stays until you update it (same `id`) or dismiss it. */
1637
+ loading: (title: ReactNode, options?: ToastOptions) => ToastId;
1638
+ /** A loading toast that turns into the outcome of `work`. Returns the id straight away. */
1639
+ promise: <T>(work: Promise<T> | (() => Promise<T>), options: ToastPromiseOptions<T>) => ToastId;
1640
+ /** Closes one toast, or every toast when called without an id. */
1641
+ dismiss: (id?: ToastId) => void;
1642
+ }
1643
+ /** Shows a toast. Mount a `Toaster` once, near the root of the app, for them to appear in. */
1644
+ declare const toast: ToastApi;
1645
+ interface ToasterProps extends Omit<ToasterProps$1, 'position' | 'theme' | 'richColors' | 'invert' | 'icons' | 'closeButton' | 'toastOptions' | 'duration'> {
1646
+ /** Where toasts appear. A toast can choose its own with `position`. Defaults to `bottom-right`. */
1647
+ position?: ToastPosition;
1648
+ /** Accessible name of each toast's close button, e.g. in another language. */
1649
+ closeLabel?: string;
1650
+ /** Where the toasts are portalled. Defaults to `document.body`. */
1651
+ container?: HTMLElement | null;
1652
+ }
1653
+ /**
1654
+ * Where toasts appear: mount one per app. The newest sits in front with older ones stacked behind;
1655
+ * hover (or Alt+T) fans them out and a swipe towards the edge dismisses one. Inside a `ThemeScope` it
1656
+ * takes the scope's theme; otherwise it follows the page.
1657
+ */
1658
+ declare const Toaster: react.ForwardRefExoticComponent<ToasterProps & react.RefAttributes<HTMLElement>>;
1659
+
1660
+ /** A run of whole days, both ends included. Each end is local midnight of its day. */
1661
+ interface DateRange {
1662
+ from: Date;
1663
+ to: Date;
1664
+ }
1665
+ /** 0 is Sunday, 1 Monday ... 6 Saturday, as `Date.getDay()` counts. */
1666
+ type Weekday = 0 | 1 | 2 | 3 | 4 | 5 | 6;
1667
+ /** `YYYY-MM-DD` for the date's local calendar day: the value an `<input type="date">` holds. */
1668
+ declare function toISODate(date: Date): string;
1669
+ /** `YYYY-MM-DDTHH:mm` in local time: the value an `<input type="datetime-local">` holds. */
1670
+ declare function toISODateTime(date: Date): string;
1671
+ /**
1672
+ * Reads `YYYY-MM-DD` as local midnight and `YYYY-MM-DDTHH:mm[:ss]` as local time, so neither shifts
1673
+ * a day. A timestamp with a zone (`2026-10-02T08:30:00Z`, `+01:00`) is an instant and is read as
1674
+ * one. Empty, malformed or impossible values (`2026-02-30`) give `null`.
1675
+ */
1676
+ declare function fromISODate(value: string | null | undefined): Date | null;
1677
+
1678
+ /** What can be ruled out: a date, dates, `{ before }`, `{ after }`, `{ from, to }`, `{ dayOfWeek }` or a function. */
1679
+ type CalendarMatcher = Matcher;
1680
+ /** The words a calendar reads out. Pass translations through `labels`. */
1681
+ interface CalendarLabels {
1682
+ /** The previous-month button. */
1683
+ previousMonth: string;
1684
+ /** The next-month button. */
1685
+ nextMonth: string;
1686
+ /** Read before today's date, e.g. "Today, Friday, 2 October 2026". */
1687
+ today: string;
1688
+ /** Read after a chosen date, e.g. "Friday, 2 October 2026, selected". */
1689
+ selected: string;
1690
+ }
1691
+ declare const calendarLabels: CalendarLabels;
1692
+ interface CalendarBaseProps {
1693
+ /** The earliest day that can be picked. Months before it cannot be reached. */
1694
+ minValue?: Date | null;
1695
+ /** The latest day that can be picked. Months after it cannot be reached. */
1696
+ maxValue?: Date | null;
1697
+ /** Days that cannot be picked, on top of `minValue` and `maxValue`, e.g. `{ dayOfWeek: [0] }` for Sundays. */
1698
+ disabled?: CalendarMatcher | CalendarMatcher[];
1699
+ /** BCP 47 locale for month and day names. Defaults to `en-GB`. */
1700
+ locale?: string;
1701
+ /** First column of the week, 0 (Sunday) to 6. Defaults to the locale's: Monday for `en-GB`. */
1702
+ weekStartsOn?: Weekday;
1703
+ /** Months side by side. Defaults to 1. */
1704
+ numberOfMonths?: number;
1705
+ /** Controlled month on show (the first, with several). */
1706
+ month?: Date;
1707
+ /** Month to open on when uncontrolled. Defaults to the chosen date, or today. */
1708
+ defaultMonth?: Date;
1709
+ onMonthChange?: (month: Date) => void;
1710
+ /** Show the days of the neighbouring months that fill the first and last weeks. Defaults to true with one month. */
1711
+ showOutsideDays?: boolean;
1712
+ /** Always draw six weeks, so the calendar keeps its height from month to month. Defaults to true. */
1713
+ fixedWeeks?: boolean;
1714
+ /** The date treated as today. Defaults to now. */
1715
+ today?: Date;
1716
+ /** Move focus to the chosen day (or today) on mount, e.g. when the calendar opens in a popover. */
1717
+ autoFocus?: boolean;
1718
+ /** Translations for what the calendar reads out. */
1719
+ labels?: Partial<CalendarLabels>;
1720
+ className?: string;
1721
+ style?: CSSProperties;
1722
+ id?: string;
1723
+ 'aria-label'?: string;
1724
+ 'aria-labelledby'?: string;
1725
+ dir?: 'ltr' | 'rtl';
1726
+ }
1727
+ interface CalendarSingleProps extends CalendarBaseProps {
1728
+ /** `single` (default) picks one day; `range` picks a first and a last day. */
1729
+ mode?: 'single';
1730
+ /** Controlled chosen day. */
1731
+ value?: Date | null;
1732
+ /** Starting day when uncontrolled. */
1733
+ defaultValue?: Date | null;
1734
+ /** Called with the day picked, or `null` when the chosen day is pressed again (unless `required`). */
1735
+ onChange?: (value: Date | null) => void;
1736
+ /** Pressing the chosen day keeps it rather than clearing it. */
1737
+ required?: boolean;
1738
+ }
1739
+ interface CalendarRangeProps extends CalendarBaseProps {
1740
+ mode: 'range';
1741
+ /** Controlled range. `to` is missing while the second day is being picked. */
1742
+ value?: Partial<DateRange> | null;
1743
+ /** Starting range when uncontrolled. */
1744
+ defaultValue?: Partial<DateRange> | null;
1745
+ /**
1746
+ * Called on every pick: the first gives `{ from }`, the second completes the range (picking an
1747
+ * earlier day swaps the ends), and the next starts a new range.
1748
+ */
1749
+ onChange?: (value: Partial<DateRange> | null) => void;
1750
+ /** A range can never be cleared by pressing its only day again. */
1751
+ required?: boolean;
1752
+ /** Restart the range rather than let it run across a disabled day. */
1753
+ excludeDisabled?: boolean;
1754
+ }
1755
+ type CalendarProps = CalendarSingleProps | CalendarRangeProps;
1756
+ /**
1757
+ * A month grid to pick a day or a range of days, inline on the page. Arrow keys move by day and
1758
+ * week, Page Up and Page Down by month (with Shift, by year), Home and End to the week's ends, and
1759
+ * Enter or Space picks. For a field that opens a calendar, use `DatePicker` or `DateRangePicker`.
1760
+ */
1761
+ declare const Calendar: react.ForwardRefExoticComponent<CalendarProps & react.RefAttributes<HTMLDivElement>>;
1762
+
1763
+ /** Props shared by both pickers. Native button attributes and the `ref` go to the trigger button. */
1764
+ interface PickerBaseProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'value' | 'defaultValue' | 'onChange' | 'type' | 'children' | 'name'> {
1765
+ /** `sm` 30px, `md` 36px (default), `lg` 44px: the same heights as Input and Button. */
1766
+ size?: InputSize;
1767
+ /** Shown while there is no date. */
1768
+ placeholder?: string;
1769
+ /** Error look and `aria-invalid`. Inside a Field, follows the Field's `error`. */
1770
+ invalid?: boolean;
1771
+ /** Shows the date but will not open. */
1772
+ readOnly?: boolean;
1773
+ /** Adds a clear button (and Backspace or Delete on the field) while there is a date. */
1774
+ clearable?: boolean;
1775
+ /** The earliest day that can be picked. */
1776
+ minValue?: Date | null;
1777
+ /** The latest day that can be picked. */
1778
+ maxValue?: Date | null;
1779
+ /** Days that cannot be picked, e.g. `{ dayOfWeek: [0] }` for Sundays or `(date) => isBankHoliday(date)`. */
1780
+ disabledDays?: CalendarMatcher | CalendarMatcher[];
1781
+ /** BCP 47 locale for the calendar and the date in the field. Defaults to `en-GB`. */
1782
+ locale?: string;
1783
+ /** First column of the week, 0 (Sunday) to 6. Defaults to the locale's: Monday for `en-GB`. */
1784
+ weekStartsOn?: Weekday;
1785
+ /** `Intl.DateTimeFormat` options for the date in the field. Defaults to `2 Oct 2026` (and `, 09:30` with a time). */
1786
+ format?: Intl.DateTimeFormatOptions;
1787
+ /** The date treated as today. Defaults to now. */
1788
+ today?: Date;
1789
+ /** Controlled open state of the calendar. */
1790
+ open?: boolean;
1791
+ defaultOpen?: boolean;
1792
+ onOpenChange?: (open: boolean) => void;
1793
+ /** Keep focus and the pointer inside the calendar while it is open. Defaults to true. */
1794
+ modal?: boolean;
1795
+ /** How the calendar lines up with the field. Defaults to `start`. */
1796
+ align?: 'start' | 'center' | 'end';
1797
+ /** Preferred side for the calendar. Defaults to `bottom`, and flips when there is no room. */
1798
+ side?: 'top' | 'right' | 'bottom' | 'left';
1799
+ /** Where the calendar is portalled. Defaults to `document.body`. */
1800
+ container?: HTMLElement | null;
1801
+ }
1802
+ type DatePickerGranularity = 'day' | 'minute';
1803
+ /** The words a date picker reads out or shows. Pass translations through `labels`. */
1804
+ interface DatePickerLabels extends CalendarLabels {
1805
+ /** The clear button. */
1806
+ clear: string;
1807
+ /** Names the time row under the calendar. */
1808
+ time: string;
1809
+ hours: string;
1810
+ minutes: string;
1811
+ /** The AM and PM switch on a 12-hour clock. */
1812
+ dayPeriod: string;
1813
+ }
1814
+ declare const datePickerLabels: DatePickerLabels;
1815
+ interface DatePickerProps extends PickerBaseProps {
1816
+ /** Controlled value: a local date (and time, with `granularity="minute"`), or `null` for none. */
1817
+ value?: Date | null;
1818
+ /** Starting value when uncontrolled. */
1819
+ defaultValue?: Date | null;
1820
+ /** Called when someone picks a day, changes the time or clears the field. Never on mount. */
1821
+ onChange?: (value: Date | null) => void;
1822
+ /** `day` (default) picks a day; `minute` adds hours and minutes under the calendar. */
1823
+ granularity?: DatePickerGranularity;
1824
+ /** Clock for the time and the field: 24-hour (default) or 12-hour with AM and PM. */
1825
+ hourCycle?: 12 | 24;
1826
+ /** Close as soon as a day is picked. Defaults to true, or false with a time to set. */
1827
+ closeOnSelect?: boolean;
1828
+ /** Submits the value with a form, as `YYYY-MM-DD` (or `YYYY-MM-DDTHH:mm` with a time), like a native date input. */
1829
+ name?: string;
1830
+ labels?: Partial<DatePickerLabels>;
1831
+ }
1832
+ /**
1833
+ * A field that opens a calendar to pick one day, and optionally a time. Picking a new day keeps the
1834
+ * time the value already had, so a 16:30 deadline moved to Friday is still at 16:30. The value is
1835
+ * a `Date`; `toISODate` and `fromISODate` convert to and from the `YYYY-MM-DD` of a native input.
1836
+ */
1837
+ declare const DatePicker: react.ForwardRefExoticComponent<DatePickerProps & react.RefAttributes<HTMLButtonElement>>;
1838
+ /** A ready-made range, offered beside the calendar. */
1839
+ interface DateRangePreset {
1840
+ /** Passed to `onChange` when the preset is picked, so the page can keep a relative range relative. */
1841
+ id: string;
1842
+ label: string;
1843
+ /** The range for a given today (local midnight). */
1844
+ range: (today: Date) => DateRange;
1845
+ }
1846
+ /** Today, Last 7 days, Last 30 days, This month and Last month. Each range ends today at the latest. */
1847
+ declare const dateRangePresets: readonly DateRangePreset[];
1848
+ /** The words a date range picker reads out or shows. Pass translations through `labels`. */
1849
+ interface DateRangePickerLabels extends CalendarLabels {
1850
+ /** The clear button. */
1851
+ clear: string;
1852
+ /** Joins the two dates in the field: "2 Oct 2026 to 9 Oct 2026". */
1853
+ to: string;
1854
+ /** Names the list of presets for assistive tech. */
1855
+ presets: string;
1856
+ }
1857
+ declare const dateRangePickerLabels: DateRangePickerLabels;
1858
+ interface DateRangePickerProps extends PickerBaseProps {
1859
+ /** Controlled range of whole days, or `null` for none. */
1860
+ value?: DateRange | null;
1861
+ /** Starting range when uncontrolled. */
1862
+ defaultValue?: DateRange | null;
1863
+ /**
1864
+ * Called once a range is complete (both days picked), when a preset is picked (with its `id`), or
1865
+ * when the field is cleared. Never on mount.
1866
+ */
1867
+ onChange?: (value: DateRange | null, preset?: string) => void;
1868
+ /** Ranges offered beside the calendar: `true` for `dateRangePresets`, or your own list. Off by default. */
1869
+ presets?: boolean | readonly DateRangePreset[];
1870
+ /** Months side by side. Defaults to two on screens 768px and wider, one below. */
1871
+ numberOfMonths?: number;
1872
+ /** Close once the range is complete or a preset is picked. Defaults to true. */
1873
+ closeOnSelect?: boolean;
1874
+ labels?: Partial<DateRangePickerLabels>;
1875
+ }
1876
+ /**
1877
+ * A field that opens a calendar to pick a first and a last day, with optional presets on the left
1878
+ * (as the analytics pages need). The first click starts the range, the second ends it (an earlier
1879
+ * day swaps the ends) and the calendar closes. While picking the end, the range follows the
1880
+ * pointer. When the range matches a preset, the field names the preset: "Last 7 days".
1881
+ */
1882
+ declare const DateRangePicker: react.ForwardRefExoticComponent<DateRangePickerProps & react.RefAttributes<HTMLButtonElement>>;
1883
+
1884
+ export { Alert, type AlertProps, type AlertTone, AppShell, type AppShellProps, AreaChart, type AreaChartDatum, type AreaChartProps, Avatar, type AvatarFit, AvatarGroup, type AvatarGroupProps, type AvatarProps, type AvatarShape, type AvatarSize, type AvatarStatus, Badge, type BadgeProps, type BadgeSize, type BadgeTone, type BadgeVariant, type BreadcrumbItem, Breadcrumbs, type BreadcrumbsProps, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Calendar, type CalendarLabels, type CalendarMatcher, type CalendarProps, type CalendarRangeProps, type CalendarSingleProps, type Weekday as CalendarWeekday, Canvas, type CanvasProps, Card, CardBody, CardFooter, CardHeader, type CardHeaderProps, type CardPadding, type CardProps, type CardVariant, Checkbox, type CheckboxProps, type CheckboxSize, type CheckedState, CommandEmpty, type CommandEmptyProps, CommandGroup, type CommandGroupProps, CommandHints, CommandItem, type CommandItemProps, CommandKey, type CommandKeyProps, CommandLoading, CommandPalette, type CommandPaletteProps, CommandSeparator, ConfirmDialog, type ConfirmDialogProps, DatePicker, type DatePickerGranularity, type DatePickerLabels, type DatePickerProps, type DateRange, DateRangePicker, type DateRangePickerLabels, type DateRangePickerProps, type DateRangePreset, Delta, type DeltaProps, type DeltaSize, type DeltaState, Dialog, DialogBody, type DialogBodyProps, DialogClose, type DialogCloseProps, DialogContent, type DialogContentProps, DialogDescription, type DialogDescriptionProps, DialogFooter, type DialogFooterProps, DialogHeader, type DialogHeaderProps, type DialogProps, type DialogSize, DialogTitle, type DialogTitleProps, DialogTrigger, type DialogTriggerProps, EmptyState, type EmptyStateProps, type EmptyStateSize, Field, type FieldControlContext, type FieldProps, type FigureTabItem, FigureTabs, type FigureTabsProps, type GlobeMarker, IconButton, type IconButtonProps, Input, type InputProps, type InputSize, Kbd, type KbdProps, LiveGlobe, type LiveGlobeProps, Menu, MenuCheckboxItem, type MenuCheckboxItemProps, MenuContent, type MenuContentProps, MenuGroup, type MenuGroupProps, MenuHeader, type MenuHeaderProps, MenuItem, type MenuItemProps, MenuLabel, type MenuLabelProps, type MenuProps, MenuRadioGroup, type MenuRadioGroupProps, MenuRadioItem, type MenuRadioItemProps, MenuSeparator, type MenuSeparatorProps, MenuSub, MenuSubContent, type MenuSubContentProps, type MenuSubProps, MenuSubTrigger, type MenuSubTriggerProps, MenuTrigger, type MenuTriggerProps, type MenuWidth, OrbitLogo, type OrbitLogoProps, OrbitMark, type OrbitMarkProps, type OrbitMarkState, OrbitSpinner, type OrbitSpinnerProps, Pagination, type PaginationProps, Popover, PopoverAnchor, type PopoverAnchorProps, PopoverClose, type PopoverCloseProps, PopoverContent, type PopoverContentProps, type PopoverPadding, type PopoverProps, PopoverTrigger, type PopoverTriggerProps, RadioGroup, RadioGroupItem, type RadioGroupItemProps, type RadioGroupOrientation, type RadioGroupProps, type RadioGroupSize, type RadioGroupVariant, RollingNumber, type RollingNumberProps, SearchField, type SearchFieldProps, SearchTrigger, type SearchTriggerProps, SegmentedControl, type SegmentedControlOption, type SegmentedControlProps, Select, SelectContent, type SelectContentProps, SelectGroup, type SelectGroupProps, SelectItem, type SelectItemProps, SelectLabel, type SelectLabelProps, type SelectOption, type SelectOptionGroup, type SelectOptionsProps, type SelectPartsProps, type SelectProps, SelectSeparator, type SelectSeparatorProps, type SelectSize, SelectTrigger, type SelectTriggerProps, SelectValue, type SelectValueProps, Separator, type SeparatorProps, Sheet, SheetBody, type SheetBodyProps, SheetClose, type SheetCloseProps, SheetContent, type SheetContentProps, SheetDescription, type SheetDescriptionProps, SheetFooter, type SheetFooterProps, SheetHeader, type SheetHeaderProps, type SheetProps, type SheetSide, type SheetSize, SheetTitle, type SheetTitleProps, SheetTrigger, type SheetTriggerProps, ShellBrand, type ShellBrandProps, type ShellMode, Sidebar, SidebarFooter, SidebarHeader, SidebarItem, type SidebarItemProps, SidebarNav, type SidebarNavProps, type SidebarProps, SidebarSection, type SidebarSectionProps, SidebarToggle, type SidebarToggleProps, Skeleton, type SkeletonProps, type SkeletonRadius, SkeletonText, type SkeletonTextProps, Sparkline, type SparklineProps, type SparklineTone, StoreButton, type StoreButtonProps, Switch, type SwitchProps, type SwitchSize, Table, type TableAlign, TableBody, TableCell, type TableCellProps, type TableDensity, TableFrame, type TableFrameProps, TableHead, TableHeaderCell, type TableHeaderCellProps, type TableProps, TableRow, type TableRowProps, type TableSort, Tabs, TabsContent, type TabsContentProps, TabsList, type TabsListProps, type TabsProps, type TabsSize, type TabsStepStatus, TabsTrigger, type TabsTriggerProps, type TabsVariant, Textarea, type TextareaProps, type TextareaSize, type ThemeName, ThemeScope, type ThemeScopeProps, type ToastAction, type ToastApi, type ToastContent, type ToastId, type ToastOptions, type ToastPosition, type ToastPromiseOptions, type ToastTone, Toaster, type ToasterProps, Tooltip, type TooltipProps, TooltipProvider, type TooltipProviderProps, TopBar, type TopBarProps, calendarLabels, cx, datePickerLabels, dateRangePickerLabels, dateRangePresets, duration, ease, formatDelta, fromISODate, initialsOf, isApplePlatform, modKey, paginationItems, spring, toISODate, toISODateTime, toast, useFieldControl, useOptionalShell, useShell, useThemeScope };