@akhil-saxena/design-system 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +122 -0
- package/dist/Icon-XUp5t4PQ.d.ts +10 -0
- package/dist/chunk-FUXR6QZ3.js +108 -0
- package/dist/chunk-FUXR6QZ3.js.map +1 -0
- package/dist/chunk-TG25XACB.js +65 -0
- package/dist/chunk-TG25XACB.js.map +1 -0
- package/dist/hooks/index.d.ts +145 -0
- package/dist/hooks/index.js +177 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/icons/index.d.ts +39 -0
- package/dist/icons/index.js +3 -0
- package/dist/icons/index.js.map +1 -0
- package/dist/index.d.ts +2091 -0
- package/dist/index.js +9200 -0
- package/dist/index.js.map +1 -0
- package/dist/primitives.css +4775 -0
- package/dist/tokens.css +180 -0
- package/dist/utilities.css +200 -0
- package/package.json +104 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,2091 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import react__default, { ButtonHTMLAttributes, ReactNode, InputHTMLAttributes, TextareaHTMLAttributes, HTMLAttributes, ChangeEvent, CSSProperties, ReactElement, RefObject } from 'react';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
export { I as Icon, a as IconProps } from './Icon-XUp5t4PQ.js';
|
|
5
|
+
import { UniqueIdentifier } from '@dnd-kit/core';
|
|
6
|
+
import 'lucide-react';
|
|
7
|
+
|
|
8
|
+
type ButtonVariant = "primary" | "secondary" | "ghost" | "danger";
|
|
9
|
+
type ButtonSize = "xs" | "sm" | "md" | "lg";
|
|
10
|
+
/**
|
|
11
|
+
* Props for the Button primitive.
|
|
12
|
+
*
|
|
13
|
+
* Extends all native `<button>` attributes (`onClick`, `type`, `aria-*`, etc) via spread.
|
|
14
|
+
*/
|
|
15
|
+
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
16
|
+
/**
|
|
17
|
+
* Visual variant.
|
|
18
|
+
*
|
|
19
|
+
* - `primary` - brand amber CTA. Use for the most-prominent action per surface.
|
|
20
|
+
* - `secondary` - outlined cream surface. Use for second-priority actions.
|
|
21
|
+
* - `ghost` - transparent, text-only. Use for tertiary, icon-only, or cancel-in-modal.
|
|
22
|
+
* - `danger` - red destructive. Use for Delete, Remove, Archive, anything irreversible.
|
|
23
|
+
*
|
|
24
|
+
* @default "primary"
|
|
25
|
+
*/
|
|
26
|
+
variant?: ButtonVariant;
|
|
27
|
+
/**
|
|
28
|
+
* Size token. Most contexts use `md`. Use `xs`/`sm` for dense rows or chip-adjacent UI.
|
|
29
|
+
*
|
|
30
|
+
* @default "md"
|
|
31
|
+
*/
|
|
32
|
+
size?: ButtonSize;
|
|
33
|
+
/** When true, replaces the icon with a spinner and disables interaction. */
|
|
34
|
+
loading?: boolean;
|
|
35
|
+
/** Optional icon rendered before the label. Pass a sized `<Icon>` or lucide component. */
|
|
36
|
+
icon?: ReactNode;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Primary action element. Use exactly one `primary` per surface as the main CTA;
|
|
40
|
+
* pair with `secondary` or `ghost` for adjacent actions; reserve `danger` for
|
|
41
|
+
* destructive operations that cannot be undone.
|
|
42
|
+
*
|
|
43
|
+
* Accepts all native `<button>` props via spread (including `onClick`, `aria-*`,
|
|
44
|
+
* `type`, `form`). Forwards a ref to the underlying element.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* <Button variant="primary" onClick={save}>Save</Button>
|
|
48
|
+
* <Button variant="secondary" size="sm">Cancel</Button>
|
|
49
|
+
* <Button variant="danger" icon={<Trash2 size={14} />}>Delete</Button>
|
|
50
|
+
* <Button variant="primary" loading>Saving…</Button>
|
|
51
|
+
*/
|
|
52
|
+
declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement>>;
|
|
53
|
+
|
|
54
|
+
interface TextInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "prefix"> {
|
|
55
|
+
/** When true, applies error-state border color to the input or wrapper. */
|
|
56
|
+
error?: boolean;
|
|
57
|
+
/** Leading icon rendered inside the wrapper (Lucide recommended size 14–16). */
|
|
58
|
+
icon?: ReactNode;
|
|
59
|
+
/** Static text or node rendered before the input (e.g. `"https://"`). */
|
|
60
|
+
prefix?: ReactNode;
|
|
61
|
+
/** Static text or node rendered after the input (e.g. `".com"`). */
|
|
62
|
+
suffix?: ReactNode;
|
|
63
|
+
/** Trailing keyboard-shortcut hint (e.g. `"⌘K"`) styled as a monospace pill. */
|
|
64
|
+
kbd?: ReactNode;
|
|
65
|
+
}
|
|
66
|
+
declare const TextInput: react.ForwardRefExoticComponent<TextInputProps & react.RefAttributes<HTMLInputElement>>;
|
|
67
|
+
|
|
68
|
+
interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
69
|
+
/** When true, applies error-state border color to the textarea. */
|
|
70
|
+
error?: boolean;
|
|
71
|
+
}
|
|
72
|
+
declare const Textarea: react.ForwardRefExoticComponent<TextareaProps & react.RefAttributes<HTMLTextAreaElement>>;
|
|
73
|
+
|
|
74
|
+
type BadgeTone = "upcoming" | "passed" | "pending" | "done" | "count" | "neutral";
|
|
75
|
+
interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
76
|
+
/** Color tone of the badge, mapping to a semantic status.
|
|
77
|
+
* @default "neutral"
|
|
78
|
+
*/
|
|
79
|
+
tone?: BadgeTone;
|
|
80
|
+
/** When true, renders a small leading colored dot inside the badge; color defaults to the tone's vivid value. */
|
|
81
|
+
dot?: boolean;
|
|
82
|
+
/** Override the dot color with any CSS color string; falls back to the tone-mapped vivid color. */
|
|
83
|
+
dotColor?: string;
|
|
84
|
+
}
|
|
85
|
+
declare const Badge: react.ForwardRefExoticComponent<BadgeProps & react.RefAttributes<HTMLSpanElement>>;
|
|
86
|
+
|
|
87
|
+
type ChipTone = "default" | "match" | "miss" | "learning" | "tag";
|
|
88
|
+
interface ChipProps extends HTMLAttributes<HTMLSpanElement> {
|
|
89
|
+
/** Color tone applying semantic background and text colors.
|
|
90
|
+
* @default "default"
|
|
91
|
+
*/
|
|
92
|
+
tone?: ChipTone;
|
|
93
|
+
/** When provided, renders a small X button that calls this handler on click. */
|
|
94
|
+
onRemove?: () => void;
|
|
95
|
+
/** Optional leading icon rendered before the label text (Lucide, size 10–11 recommended). */
|
|
96
|
+
icon?: ReactNode;
|
|
97
|
+
}
|
|
98
|
+
declare const Chip: react.ForwardRefExoticComponent<ChipProps & react.RefAttributes<HTMLSpanElement>>;
|
|
99
|
+
|
|
100
|
+
type AvatarSize = 24 | 28 | 32 | 36 | 40;
|
|
101
|
+
type AvatarPresence = "online" | "away" | "offline" | "dnd";
|
|
102
|
+
type AvatarPresencePosition = "top-right" | "bottom-right" | "top-left" | "bottom-left";
|
|
103
|
+
interface AvatarProps extends HTMLAttributes<HTMLDivElement> {
|
|
104
|
+
/** Full name used to derive initials and background color. Also becomes `aria-label`. */
|
|
105
|
+
name?: string;
|
|
106
|
+
/** Override the auto-derived initials (1–2 uppercase letters). */
|
|
107
|
+
initials?: string;
|
|
108
|
+
/**
|
|
109
|
+
* URL of an image to display. When provided, the image fills the circle and
|
|
110
|
+
* initials/background are not rendered.
|
|
111
|
+
*/
|
|
112
|
+
src?: string;
|
|
113
|
+
/** Alt text for the image. Falls back to `name` when omitted. */
|
|
114
|
+
alt?: string;
|
|
115
|
+
/**
|
|
116
|
+
* Use a two-stop gradient background instead of the default solid color.
|
|
117
|
+
* Pass `[fromColor, toColor]` to override, or omit to use the auto-derived gradient.
|
|
118
|
+
* When not set, a solid color derived from the name is used.
|
|
119
|
+
*/
|
|
120
|
+
gradient?: [string, string] | true;
|
|
121
|
+
/** Diameter of the avatar circle in pixels.
|
|
122
|
+
* @default 32
|
|
123
|
+
*/
|
|
124
|
+
size?: AvatarSize;
|
|
125
|
+
/** Shows a colored presence dot at the bottom-right edge. */
|
|
126
|
+
presence?: AvatarPresence;
|
|
127
|
+
/**
|
|
128
|
+
* Which corner of the avatar the presence dot appears at.
|
|
129
|
+
* @default "bottom-right"
|
|
130
|
+
*/
|
|
131
|
+
presencePosition?: AvatarPresencePosition;
|
|
132
|
+
}
|
|
133
|
+
declare function deriveInitials(name?: string | null): string;
|
|
134
|
+
declare function deriveGradient(seed: string): readonly [string, string];
|
|
135
|
+
declare const Avatar: react.ForwardRefExoticComponent<AvatarProps & react.RefAttributes<HTMLDivElement>>;
|
|
136
|
+
interface AvatarStackProps extends HTMLAttributes<HTMLDivElement> {
|
|
137
|
+
/** Array of avatar descriptors rendered as an overlapping stack. */
|
|
138
|
+
avatars: ReadonlyArray<{
|
|
139
|
+
name?: string;
|
|
140
|
+
initials?: string;
|
|
141
|
+
gradient?: [string, string];
|
|
142
|
+
}>;
|
|
143
|
+
/** Maximum number of avatars shown before a "+N more" overflow badge.
|
|
144
|
+
* @default 4
|
|
145
|
+
*/
|
|
146
|
+
max?: number;
|
|
147
|
+
/** Size in pixels applied to every avatar in the stack.
|
|
148
|
+
* @default 32
|
|
149
|
+
*/
|
|
150
|
+
size?: AvatarSize;
|
|
151
|
+
}
|
|
152
|
+
declare function AvatarStack({ avatars, max, size, style, ...rest }: AvatarStackProps): react_jsx_runtime.JSX.Element;
|
|
153
|
+
|
|
154
|
+
interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type"> {
|
|
155
|
+
/** Visible text label rendered beside the checkbox. */
|
|
156
|
+
label?: string;
|
|
157
|
+
/** When true, sets the native DOM `indeterminate` property (the "some selected" tri-state).
|
|
158
|
+
* Cannot be expressed as a JSX attribute - set imperatively via a DOM property. */
|
|
159
|
+
indeterminate?: boolean;
|
|
160
|
+
}
|
|
161
|
+
declare const Checkbox: react.ForwardRefExoticComponent<CheckboxProps & react.RefAttributes<HTMLInputElement>>;
|
|
162
|
+
|
|
163
|
+
interface RadioGroupProps {
|
|
164
|
+
/** The `name` attribute shared by all Radio children in the group. */
|
|
165
|
+
name: string;
|
|
166
|
+
/** Controlled selected value; the matching Radio renders as checked. Use with `onChange`. */
|
|
167
|
+
value?: string;
|
|
168
|
+
/** Initial selected value when uncontrolled (no `value` prop). */
|
|
169
|
+
defaultValue?: string;
|
|
170
|
+
/** Called when any Radio in the group is selected with the new value and native event. */
|
|
171
|
+
onChange?: (value: string, e: ChangeEvent<HTMLInputElement>) => void;
|
|
172
|
+
/** Radio children to render in a vertical flex column. */
|
|
173
|
+
children: ReactNode;
|
|
174
|
+
/** Inline styles applied to the `role="radiogroup"` div. */
|
|
175
|
+
style?: CSSProperties;
|
|
176
|
+
/** Additional className applied to the `role="radiogroup"` div. */
|
|
177
|
+
className?: string;
|
|
178
|
+
}
|
|
179
|
+
declare function RadioGroup({ name, value: controlledValue, defaultValue, onChange, children, style, className, }: Readonly<RadioGroupProps>): react_jsx_runtime.JSX.Element;
|
|
180
|
+
interface RadioProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "value"> {
|
|
181
|
+
/** Visible text label rendered beside the radio button. */
|
|
182
|
+
label?: string;
|
|
183
|
+
/** The value this radio represents; matched against RadioGroup's `value` to determine checked state. */
|
|
184
|
+
value: string;
|
|
185
|
+
}
|
|
186
|
+
declare const Radio: react.ForwardRefExoticComponent<RadioProps & react.RefAttributes<HTMLInputElement>>;
|
|
187
|
+
|
|
188
|
+
interface ToggleProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type"> {
|
|
189
|
+
/** Visible text label rendered beside the toggle track. */
|
|
190
|
+
label?: string;
|
|
191
|
+
}
|
|
192
|
+
declare const Toggle: react.ForwardRefExoticComponent<ToggleProps & react.RefAttributes<HTMLInputElement>>;
|
|
193
|
+
|
|
194
|
+
interface NumberStepperProps {
|
|
195
|
+
/** Controlled numeric value. */
|
|
196
|
+
value: number;
|
|
197
|
+
/** Called with the clamped next value after each increment, decrement, or manual edit. */
|
|
198
|
+
onChange: (next: number) => void;
|
|
199
|
+
/** Minimum allowed value; decrement button disables at this boundary. */
|
|
200
|
+
min?: number;
|
|
201
|
+
/** Maximum allowed value; increment button disables at this boundary. */
|
|
202
|
+
max?: number;
|
|
203
|
+
/** Amount added or subtracted per button click.
|
|
204
|
+
* @default 1
|
|
205
|
+
*/
|
|
206
|
+
step?: number;
|
|
207
|
+
/** Optional leading adornment (e.g. currency symbol) rendered before the value. */
|
|
208
|
+
prefix?: ReactNode;
|
|
209
|
+
/** Optional trailing adornment (e.g. unit label) rendered after the value. */
|
|
210
|
+
suffix?: ReactNode;
|
|
211
|
+
/** Custom display formatter called when the input is not focused; raw value shown while editing. */
|
|
212
|
+
formatFn?: (value: number) => string;
|
|
213
|
+
/** When true, disables all interaction including both buttons and the input. */
|
|
214
|
+
disabled?: boolean;
|
|
215
|
+
/** Accessible label for the stepper container used by assistive technology. */
|
|
216
|
+
ariaLabel?: string;
|
|
217
|
+
/** Additional className applied to the root wrapper element. */
|
|
218
|
+
className?: string;
|
|
219
|
+
/** Inline styles applied to the root wrapper element. */
|
|
220
|
+
style?: CSSProperties;
|
|
221
|
+
}
|
|
222
|
+
declare const NumberStepper: react.ForwardRefExoticComponent<NumberStepperProps & react.RefAttributes<HTMLInputElement>>;
|
|
223
|
+
|
|
224
|
+
type RollingNumberVariant = "default" | "dark" | "light";
|
|
225
|
+
interface RollingNumberProps {
|
|
226
|
+
/** Numeric value to display; digit columns animate vertically when the value changes. */
|
|
227
|
+
value: number;
|
|
228
|
+
/** Custom formatter applied before splitting into individual characters; defaults to `String(value)`. */
|
|
229
|
+
format?: (value: number) => string;
|
|
230
|
+
/** Static text prepended before the formatted number (e.g. `"$"`). */
|
|
231
|
+
prefix?: string;
|
|
232
|
+
/** Static text appended after the formatted number (e.g. `" pts"`). */
|
|
233
|
+
suffix?: string;
|
|
234
|
+
/**
|
|
235
|
+
* Visual background treatment.
|
|
236
|
+
* - `"default"` - no background, inherits from parent (current behaviour).
|
|
237
|
+
* - `"dark"` - black background per digit cell with white text; ideal for counters and clocks.
|
|
238
|
+
* - `"light"` - cream background per digit cell with dark text; for use on dark surfaces.
|
|
239
|
+
* @default "default"
|
|
240
|
+
*/
|
|
241
|
+
variant?: RollingNumberVariant;
|
|
242
|
+
/** Accessible label for the `aria-live` region; defaults to the full rendered display string. */
|
|
243
|
+
ariaLabel?: string;
|
|
244
|
+
/** Additional className applied to the root `<span>` element. */
|
|
245
|
+
className?: string;
|
|
246
|
+
/** Inline styles applied to the root `<span>` element. */
|
|
247
|
+
style?: CSSProperties;
|
|
248
|
+
}
|
|
249
|
+
declare function RollingNumber({ value, format, prefix, suffix, variant, ariaLabel, className, style, }: RollingNumberProps): react_jsx_runtime.JSX.Element;
|
|
250
|
+
|
|
251
|
+
interface RangeSliderProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "value" | "onChange" | "min" | "max" | "step" | "disabled"> {
|
|
252
|
+
/** Controlled numeric value of the slider thumb position. */
|
|
253
|
+
value: number;
|
|
254
|
+
/** Called on every thumb movement with the new numeric value and the native event. */
|
|
255
|
+
onChange: (value: number, e: ChangeEvent<HTMLInputElement>) => void;
|
|
256
|
+
/** Minimum selectable value.
|
|
257
|
+
* @default 0
|
|
258
|
+
*/
|
|
259
|
+
min?: number;
|
|
260
|
+
/** Maximum selectable value.
|
|
261
|
+
* @default 100
|
|
262
|
+
*/
|
|
263
|
+
max?: number;
|
|
264
|
+
/** Increment between selectable values.
|
|
265
|
+
* @default 1
|
|
266
|
+
*/
|
|
267
|
+
step?: number;
|
|
268
|
+
/** Optional text label rendered above the track on the left side. */
|
|
269
|
+
label?: string;
|
|
270
|
+
/** Formats the current value displayed on the right side of the label row. */
|
|
271
|
+
valueFormat?: (value: number) => string;
|
|
272
|
+
/** When true, disables the slider and grays it out. */
|
|
273
|
+
disabled?: boolean;
|
|
274
|
+
/** Accessible label for the underlying `<input type="range">`; falls back to `label`. */
|
|
275
|
+
ariaLabel?: string;
|
|
276
|
+
}
|
|
277
|
+
declare const RangeSlider: react.ForwardRefExoticComponent<RangeSliderProps & react.RefAttributes<HTMLInputElement>>;
|
|
278
|
+
|
|
279
|
+
type StarRatingSize = "default" | "compact";
|
|
280
|
+
/**
|
|
281
|
+
* Deliberate deviation from D-240: D-240 specified `variant?: 'interactive' | 'compact'` which
|
|
282
|
+
* conflated icon size with interaction mode. We split into orthogonal `size` (icon dimensions)
|
|
283
|
+
* and `readOnly` (interaction mode) props because (a) consumers may want a compact yet still-
|
|
284
|
+
* interactive rating in dense list views, and (b) read-only at default size is the common
|
|
285
|
+
* "display existing rating" case. Documented as the public StarRating API of v2.0.
|
|
286
|
+
*/
|
|
287
|
+
interface StarRatingProps {
|
|
288
|
+
/** Controlled rating value (1–5). */
|
|
289
|
+
value: number;
|
|
290
|
+
/** Called when the user clicks a star with the new rating; omit for read-only display. */
|
|
291
|
+
onChange?: (value: number) => void;
|
|
292
|
+
/** Icon size token; `"compact"` uses 14px stars for dense list contexts.
|
|
293
|
+
* @default "default"
|
|
294
|
+
*/
|
|
295
|
+
size?: StarRatingSize;
|
|
296
|
+
/** Accessible label for the `role="radiogroup"` container. */
|
|
297
|
+
label?: string;
|
|
298
|
+
/** When true, disables hover preview and click interaction without the disabled visual.
|
|
299
|
+
* @default false
|
|
300
|
+
*/
|
|
301
|
+
readOnly?: boolean;
|
|
302
|
+
/** When true, disables all interaction and dims the stars.
|
|
303
|
+
* @default false
|
|
304
|
+
*/
|
|
305
|
+
disabled?: boolean;
|
|
306
|
+
/** Additional className applied to the root element. */
|
|
307
|
+
className?: string;
|
|
308
|
+
/** Inline styles applied to the root element. */
|
|
309
|
+
style?: CSSProperties;
|
|
310
|
+
}
|
|
311
|
+
declare function StarRating({ value, onChange, size, label, readOnly, disabled, className, style, }: StarRatingProps): react_jsx_runtime.JSX.Element;
|
|
312
|
+
|
|
313
|
+
type StickyNoteRotation = "left" | "right" | "none";
|
|
314
|
+
interface StickyNoteProps extends HTMLAttributes<HTMLDivElement> {
|
|
315
|
+
/** Static rotation applied to the note surface for a handwritten feel.
|
|
316
|
+
* @default "right"
|
|
317
|
+
*/
|
|
318
|
+
rotation?: StickyNoteRotation;
|
|
319
|
+
/** Arbitrary JSX content rendered inside the note; compose freely. */
|
|
320
|
+
children: ReactNode;
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* StickyNote - yellow-gradient note surface with slight static rotation.
|
|
324
|
+
*
|
|
325
|
+
* <StickyNote>Reach out to David before screening.</StickyNote>
|
|
326
|
+
* <StickyNote rotation="left">Follow up by May 2.</StickyNote>
|
|
327
|
+
* <StickyNote rotation="none">Aligned baseline note.</StickyNote>
|
|
328
|
+
*
|
|
329
|
+
* Children are arbitrary JSX (mirrors Card freely-composed pattern). The
|
|
330
|
+
* `.ds-sticky-hint` mini-line in the handoff is NOT part of the primitive
|
|
331
|
+
* - consumers compose it as a child <div>.
|
|
332
|
+
*
|
|
333
|
+
* Always-dark text invariant (per handoff): the text color stays #292524
|
|
334
|
+
* regardless of :root.dark cascade. The amber-yellow surface is identical
|
|
335
|
+
* in light and dark modes - sticky notes are visually consistent across
|
|
336
|
+
* themes, intentionally.
|
|
337
|
+
*/
|
|
338
|
+
declare const StickyNote: react.ForwardRefExoticComponent<StickyNoteProps & react.RefAttributes<HTMLDivElement>>;
|
|
339
|
+
|
|
340
|
+
type CardVariant = "glass" | "amber" | "dark" | "kanban";
|
|
341
|
+
interface CardProps extends HTMLAttributes<HTMLDivElement> {
|
|
342
|
+
/** Surface style variant.
|
|
343
|
+
* - `glass` - translucent glass surface (default).
|
|
344
|
+
* - `amber` - amber-tinted CTA card.
|
|
345
|
+
* - `dark` - always-dark surface independent of theme.
|
|
346
|
+
* - `kanban` - compact glass with hover-lift; use for drag-and-drop boards.
|
|
347
|
+
* @default "glass"
|
|
348
|
+
*/
|
|
349
|
+
variant?: CardVariant;
|
|
350
|
+
/** Arbitrary JSX content; Card has no compound structure - compose freely. */
|
|
351
|
+
children: ReactNode;
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* Card - surface primitive with 4 variants (D-300, D-301, D-302).
|
|
355
|
+
*
|
|
356
|
+
* <Card variant="glass"> // default - translucent glass surface
|
|
357
|
+
* <Card variant="amber"> // amber-tinted CTA card
|
|
358
|
+
* <Card variant="dark"> // always-dark surface (handoff invariant)
|
|
359
|
+
* <Card variant="kanban"> // compact glass card with hover-lift; visual surface only
|
|
360
|
+
*
|
|
361
|
+
* Children are arbitrary JSX - there is no compound API. Compose freely:
|
|
362
|
+
*
|
|
363
|
+
* <Card variant="glass">
|
|
364
|
+
* <header>...</header>
|
|
365
|
+
* <div>...</div>
|
|
366
|
+
* <footer>...</footer>
|
|
367
|
+
* </Card>
|
|
368
|
+
*
|
|
369
|
+
* The `kanban` variant ships only the VISUAL surface (12px padding, 10px
|
|
370
|
+
* radius, glass bg, hover shadow lift). Application data binding (logo +
|
|
371
|
+
* role + age + chips + priority dot) is deferred to Wave 7 / DragDropList
|
|
372
|
+
* per D-302.
|
|
373
|
+
*/
|
|
374
|
+
declare const Card: react.ForwardRefExoticComponent<CardProps & react.RefAttributes<HTMLDivElement>>;
|
|
375
|
+
|
|
376
|
+
interface DSPortalProps {
|
|
377
|
+
children: ReactNode;
|
|
378
|
+
target?: HTMLElement;
|
|
379
|
+
}
|
|
380
|
+
/**
|
|
381
|
+
* SSR-safe React.createPortal wrapper.
|
|
382
|
+
*
|
|
383
|
+
* Returns null on the server and during the first client render, then
|
|
384
|
+
* portals `children` to `target` (default: document.body) after the
|
|
385
|
+
* initial useEffect fires. Consumed by Tooltip, Popover, Modal, Sheet,
|
|
386
|
+
* BottomSheet, Lightbox, HoverCard (Wave 3) and Toast (Wave 4).
|
|
387
|
+
*
|
|
388
|
+
* Mount target defaults to document.body to avoid coupling to consumer
|
|
389
|
+
* DOM layout (D-310).
|
|
390
|
+
*/
|
|
391
|
+
declare function DSPortal({ children, target }: DSPortalProps): react.ReactPortal | null;
|
|
392
|
+
|
|
393
|
+
type TooltipPlacement = "auto" | "top" | "right" | "bottom" | "left";
|
|
394
|
+
interface TooltipProps {
|
|
395
|
+
/** Content rendered inside the tooltip surface; accepts any ReactNode. */
|
|
396
|
+
content: ReactNode;
|
|
397
|
+
/** Preferred placement relative to the trigger; `"auto"` picks the side with the most viewport room.
|
|
398
|
+
* @default "auto"
|
|
399
|
+
*/
|
|
400
|
+
placement?: TooltipPlacement;
|
|
401
|
+
/** Milliseconds to wait after mouseenter/focus before showing the tooltip.
|
|
402
|
+
* @default 150
|
|
403
|
+
*/
|
|
404
|
+
delay?: number;
|
|
405
|
+
/** The single trigger element; Tooltip clones it to attach event handlers and `aria-describedby`. */
|
|
406
|
+
children: ReactElement;
|
|
407
|
+
}
|
|
408
|
+
/**
|
|
409
|
+
* Tooltip - overlay micro-primitive (DS-32).
|
|
410
|
+
*
|
|
411
|
+
* <Tooltip content="Star this application">
|
|
412
|
+
* <button aria-label="Star">★</button>
|
|
413
|
+
* </Tooltip>
|
|
414
|
+
*
|
|
415
|
+
* - Wraps EXACTLY ONE child element (React.Children.only - throws on multiple).
|
|
416
|
+
* - Clones the child to attach onMouseEnter / onMouseLeave / onFocus / onBlur +
|
|
417
|
+
* aria-describedby={tooltipId} (D-311).
|
|
418
|
+
* - Mounts the tooltip surface via DSPortal to document.body.
|
|
419
|
+
* - Position computed from trigger.getBoundingClientRect() per `placement`
|
|
420
|
+
* (D-312, manual calc - no Floating-UI dep).
|
|
421
|
+
* - Open delay default 150ms (D-311 - handoff 0ms feels twitchy, 700ms feels broken).
|
|
422
|
+
* - Hover and focus both open with the SAME 150ms delay (Path A from the plan
|
|
423
|
+
* behavior block - keeps timing consistent for assistive-tech and pointer
|
|
424
|
+
* users; mouseleave + blur close immediately by clearing the timer).
|
|
425
|
+
* - aria-describedby is wired on the trigger when open (assistive-tech surface).
|
|
426
|
+
*
|
|
427
|
+
* v2.0 simplifications (deferred to v2.1):
|
|
428
|
+
* - Consumer ref on trigger is NOT preserved (Tooltip's internal triggerRef
|
|
429
|
+
* wins). Most leaf-button triggers don't pass refs, so this is acceptable.
|
|
430
|
+
* - No auto-flip on viewport collision - caller is responsible for placing
|
|
431
|
+
* tooltips with adequate viewport room.
|
|
432
|
+
* - No re-position on scroll/resize while open (most tooltips open + close
|
|
433
|
+
* within a frame anyway). Re-opens recompute fresh.
|
|
434
|
+
* - No exit animation - surface hard-unmounts on close.
|
|
435
|
+
*/
|
|
436
|
+
declare function Tooltip({ content, placement, delay, children }: TooltipProps): react_jsx_runtime.JSX.Element;
|
|
437
|
+
|
|
438
|
+
type PopoverPlacement = "bottom-start" | "bottom-end" | "top-start" | "top-end";
|
|
439
|
+
type PopoverVariant = "default" | "contextmenu";
|
|
440
|
+
interface PopoverProps {
|
|
441
|
+
/** Ref to the anchor element; the popover positions itself relative to this element's bounding box. */
|
|
442
|
+
anchorRef: RefObject<HTMLElement | null>;
|
|
443
|
+
/** Controls visibility; the popover returns null when false. */
|
|
444
|
+
open: boolean;
|
|
445
|
+
/** Called when the popover requests to close (Escape key or outside click). */
|
|
446
|
+
onOpenChange: (open: boolean) => void;
|
|
447
|
+
/** Which edge of the anchor the panel appears on.
|
|
448
|
+
* @default "bottom-start"
|
|
449
|
+
*/
|
|
450
|
+
placement?: PopoverPlacement;
|
|
451
|
+
/** Gap in pixels between the anchor edge and the panel.
|
|
452
|
+
* @default 4
|
|
453
|
+
*/
|
|
454
|
+
offset?: number;
|
|
455
|
+
/** Visual variant; `"contextmenu"` applies tighter padding and narrower width.
|
|
456
|
+
* @default "default"
|
|
457
|
+
*/
|
|
458
|
+
variant?: PopoverVariant;
|
|
459
|
+
/** Content rendered inside the popover panel. */
|
|
460
|
+
children: ReactNode;
|
|
461
|
+
/** Additional className applied to the panel element. */
|
|
462
|
+
className?: string;
|
|
463
|
+
/** Inline styles applied to the panel element. */
|
|
464
|
+
style?: CSSProperties;
|
|
465
|
+
}
|
|
466
|
+
/**
|
|
467
|
+
* Anchor-positioned overlay primitive (D-330). DSPortal-mounted to body;
|
|
468
|
+
* positions via `anchorRef.current.getBoundingClientRect()` + placement +
|
|
469
|
+
* offset. Closes on outside click (via `useClickOutside`) and on Escape
|
|
470
|
+
* (document keydown listener installed only while open).
|
|
471
|
+
*
|
|
472
|
+
* 4 fixed placements; auto-flip-on-collision deferred to v2.1.
|
|
473
|
+
*/
|
|
474
|
+
declare function Popover({ anchorRef, open, onOpenChange, placement, offset, variant, children, className, style, }: PopoverProps): react_jsx_runtime.JSX.Element | null;
|
|
475
|
+
interface ContextMenuItem {
|
|
476
|
+
label: string;
|
|
477
|
+
icon?: ReactNode;
|
|
478
|
+
onSelect: () => void;
|
|
479
|
+
disabled?: boolean;
|
|
480
|
+
variant?: "default" | "danger";
|
|
481
|
+
}
|
|
482
|
+
interface ContextMenuProps extends Omit<PopoverProps, "children" | "variant"> {
|
|
483
|
+
items: ContextMenuItem[];
|
|
484
|
+
}
|
|
485
|
+
/**
|
|
486
|
+
* Curated context-menu variant of Popover (D-331). Same-file export so
|
|
487
|
+
* consumers can import either primitive without an extra path. Renders
|
|
488
|
+
* items as `<button class="ds-atom-popover-item">` rows; danger variant
|
|
489
|
+
* uses `data-tone="danger"`; disabled items short-circuit `onSelect`.
|
|
490
|
+
*/
|
|
491
|
+
declare function ContextMenu({ items, onOpenChange, ...rest }: ContextMenuProps): react_jsx_runtime.JSX.Element;
|
|
492
|
+
|
|
493
|
+
type ModalRole = "dialog" | "alertdialog";
|
|
494
|
+
interface ModalProps {
|
|
495
|
+
/** Controls visibility; returns null when false. */
|
|
496
|
+
open: boolean;
|
|
497
|
+
/** Called when the user closes the modal via Escape or backdrop click. */
|
|
498
|
+
onClose: () => void;
|
|
499
|
+
/** Heading rendered in the modal header; auto-wired to `aria-labelledby`. */
|
|
500
|
+
title?: ReactNode;
|
|
501
|
+
/** Short description rendered above children; auto-wired to `aria-describedby`. */
|
|
502
|
+
description?: string;
|
|
503
|
+
/** Content for the footer slot (typically action buttons). */
|
|
504
|
+
footer?: ReactNode;
|
|
505
|
+
/** Main body content of the modal. */
|
|
506
|
+
children?: ReactNode;
|
|
507
|
+
/** Whether clicking the backdrop calls `onClose`.
|
|
508
|
+
* @default true
|
|
509
|
+
*/
|
|
510
|
+
closeOnBackdropClick?: boolean;
|
|
511
|
+
/** ARIA role - use `"alertdialog"` for destructive confirmations.
|
|
512
|
+
* @default "dialog"
|
|
513
|
+
*/
|
|
514
|
+
role?: ModalRole;
|
|
515
|
+
/** Ref to the element that should receive focus when the modal opens; defaults to the panel itself. */
|
|
516
|
+
initialFocus?: RefObject<HTMLElement | null>;
|
|
517
|
+
/** Additional className applied to the modal panel. */
|
|
518
|
+
className?: string;
|
|
519
|
+
/** Inline styles applied to the modal panel. */
|
|
520
|
+
style?: CSSProperties;
|
|
521
|
+
}
|
|
522
|
+
/**
|
|
523
|
+
* Modal - DSPortal-mounted dialog with focus trap, Escape close, backdrop close.
|
|
524
|
+
*
|
|
525
|
+
* <Modal open={open} onClose={close} title="Edit profile">
|
|
526
|
+
* <form>...</form>
|
|
527
|
+
* </Modal>
|
|
528
|
+
*
|
|
529
|
+
* A11y wiring (D-321):
|
|
530
|
+
* - role defaults to "dialog"; pass "alertdialog" for destructive confirms
|
|
531
|
+
* - aria-labelledby auto-generated from `title` via useId()
|
|
532
|
+
* - aria-describedby auto-generated from `description` via useId()
|
|
533
|
+
* - aria-modal="true" always
|
|
534
|
+
* - useFocusTrap traps Tab inside panel + restores focus to trigger on close
|
|
535
|
+
* - Document-level keydown listener for Escape (useFocusTrap handles only Tab)
|
|
536
|
+
*
|
|
537
|
+
* Behavior (D-320, D-322):
|
|
538
|
+
* - closeOnBackdropClick defaults to true; click on backdrop only (not panel) closes
|
|
539
|
+
* - Animations namespaced (ds-atom-modal-fadein, ds-atom-modal-in) to avoid
|
|
540
|
+
* colliding with consumer-defined keyframes
|
|
541
|
+
*
|
|
542
|
+
* ConfirmDialog ships from this same file as a named variant export (D-287, D-356).
|
|
543
|
+
*/
|
|
544
|
+
declare function Modal({ open, onClose, title, description, footer, children, closeOnBackdropClick, role, initialFocus, className, style, }: ModalProps): react_jsx_runtime.JSX.Element | null;
|
|
545
|
+
interface ConfirmDialogProps {
|
|
546
|
+
/** Controls visibility; returns null when false. */
|
|
547
|
+
open: boolean;
|
|
548
|
+
/** Called when the user dismisses or cancels the dialog. */
|
|
549
|
+
onClose: () => void;
|
|
550
|
+
/** Heading text for the confirmation dialog. */
|
|
551
|
+
title: ReactNode;
|
|
552
|
+
/** Supplemental explanation shown below the title; string gets `aria-describedby`, ReactNode renders as children. */
|
|
553
|
+
description?: ReactNode;
|
|
554
|
+
/** Label for the confirm action button.
|
|
555
|
+
* @default "Confirm"
|
|
556
|
+
*/
|
|
557
|
+
confirmLabel?: string;
|
|
558
|
+
/** Label for the cancel action button.
|
|
559
|
+
* @default "Cancel"
|
|
560
|
+
*/
|
|
561
|
+
cancelLabel?: string;
|
|
562
|
+
/** When true, uses `role="alertdialog"`, disables backdrop close, and styles confirm as `danger`.
|
|
563
|
+
* @default false
|
|
564
|
+
*/
|
|
565
|
+
danger?: boolean;
|
|
566
|
+
/** Called when the user clicks the confirm button. */
|
|
567
|
+
onConfirm: () => void;
|
|
568
|
+
}
|
|
569
|
+
/**
|
|
570
|
+
* ConfirmDialog - Modal-as-confirmation variant (D-287, D-356).
|
|
571
|
+
*
|
|
572
|
+
* <ConfirmDialog
|
|
573
|
+
* open={open}
|
|
574
|
+
* onClose={close}
|
|
575
|
+
* onConfirm={doDelete}
|
|
576
|
+
* title="Delete application?"
|
|
577
|
+
* description="This cannot be undone."
|
|
578
|
+
* confirmLabel="Yes, delete"
|
|
579
|
+
* danger
|
|
580
|
+
* />
|
|
581
|
+
*
|
|
582
|
+
* When `danger=true`:
|
|
583
|
+
* - role="alertdialog"
|
|
584
|
+
* - closeOnBackdropClick=false (forces explicit Cancel/Confirm)
|
|
585
|
+
* - Confirm button uses Button variant="danger"
|
|
586
|
+
*
|
|
587
|
+
* `description` accepts string or ReactNode. Strings flow to Modal's
|
|
588
|
+
* `description` prop (gets aria-describedby wiring); ReactNode renders
|
|
589
|
+
* inline as Modal children (no auto aria-describedby).
|
|
590
|
+
*/
|
|
591
|
+
declare function ConfirmDialog({ open, onClose, title, description, confirmLabel, cancelLabel, danger, onConfirm, }: ConfirmDialogProps): react_jsx_runtime.JSX.Element;
|
|
592
|
+
|
|
593
|
+
type SheetSide = "right" | "left";
|
|
594
|
+
interface SheetProps {
|
|
595
|
+
/** Controls visibility; returns null when false. */
|
|
596
|
+
open: boolean;
|
|
597
|
+
/** Called when the user closes the sheet via Escape or backdrop click. */
|
|
598
|
+
onClose: () => void;
|
|
599
|
+
/** Which edge the panel slides in from.
|
|
600
|
+
* @default "right"
|
|
601
|
+
*/
|
|
602
|
+
side?: SheetSide;
|
|
603
|
+
/** Heading rendered in the sheet header; auto-wired to `aria-labelledby`. */
|
|
604
|
+
title?: ReactNode;
|
|
605
|
+
/** Short description rendered above children; auto-wired to `aria-describedby`. */
|
|
606
|
+
description?: string;
|
|
607
|
+
/** Content for the footer slot (typically action buttons). */
|
|
608
|
+
footer?: ReactNode;
|
|
609
|
+
/** Main body content of the sheet. */
|
|
610
|
+
children: ReactNode;
|
|
611
|
+
/** Whether clicking the backdrop calls `onClose`.
|
|
612
|
+
* @default true
|
|
613
|
+
*/
|
|
614
|
+
closeOnBackdropClick?: boolean;
|
|
615
|
+
/** Additional className applied to the sheet panel. */
|
|
616
|
+
className?: string;
|
|
617
|
+
/** Inline styles applied to the sheet panel. */
|
|
618
|
+
style?: CSSProperties;
|
|
619
|
+
}
|
|
620
|
+
/**
|
|
621
|
+
* Side-anchored drawer primitive (Wave 3, DS-35).
|
|
622
|
+
*
|
|
623
|
+
* Mirrors Modal architecture (DSPortal-mounted backdrop + panel; useFocusTrap;
|
|
624
|
+
* explicit Escape document keydown; auto-generated aria-labelledby/describedby
|
|
625
|
+
* via useId()) but slides in from the chosen edge instead of scaling in.
|
|
626
|
+
*
|
|
627
|
+
* Per D-332:
|
|
628
|
+
* - 400px wide on desktop (≥640px)
|
|
629
|
+
* - 100vw on mobile (<640px) via @media - no prop required
|
|
630
|
+
* - side: 'right' (default) | 'left'; CSS keys off [data-side]
|
|
631
|
+
*
|
|
632
|
+
* Returns null when open=false. When open=true, portals a backdrop +
|
|
633
|
+
* side-anchored panel to document.body. Backdrop click calls onClose iff
|
|
634
|
+
* closeOnBackdropClick (default true). Click on panel itself does NOT close.
|
|
635
|
+
*
|
|
636
|
+
* useFocusTrap traps Tab inside the panel + restores focus on close.
|
|
637
|
+
* Escape closes via a document keydown listener installed only while open
|
|
638
|
+
* (Wave 0 useFocusTrap only handles Tab - we add Escape ourselves).
|
|
639
|
+
*/
|
|
640
|
+
declare function Sheet({ open, onClose, side, title, description, footer, children, closeOnBackdropClick, className, style, }: SheetProps): react_jsx_runtime.JSX.Element | null;
|
|
641
|
+
|
|
642
|
+
type HoverCardPlacement = "bottom-start" | "bottom-end" | "top-start" | "top-end";
|
|
643
|
+
interface HoverCardProps {
|
|
644
|
+
/** Ref attached to the trigger element; HoverCard installs mouse/click listeners on it directly. */
|
|
645
|
+
anchorRef: RefObject<HTMLElement | null>;
|
|
646
|
+
/** Rich card content - arbitrary ReactNode such as avatars, charts, or action buttons. */
|
|
647
|
+
children: ReactNode;
|
|
648
|
+
/** Panel placement relative to the anchor.
|
|
649
|
+
* @default "bottom-start"
|
|
650
|
+
*/
|
|
651
|
+
placement?: HoverCardPlacement;
|
|
652
|
+
/** Gap in pixels between the anchor edge and the panel.
|
|
653
|
+
* @default 8
|
|
654
|
+
*/
|
|
655
|
+
offset?: number;
|
|
656
|
+
/** Milliseconds to wait after mouseenter before opening; filters accidental cursor pass-throughs.
|
|
657
|
+
* @default 300
|
|
658
|
+
*/
|
|
659
|
+
openDelay?: number;
|
|
660
|
+
/** Milliseconds to wait after mouseleave before closing; gives the cursor time to move into the card.
|
|
661
|
+
* @default 150
|
|
662
|
+
*/
|
|
663
|
+
closeDelay?: number;
|
|
664
|
+
/** Additional className applied to the panel root element. */
|
|
665
|
+
className?: string;
|
|
666
|
+
}
|
|
667
|
+
/**
|
|
668
|
+
* HoverCard - rich-content popover-on-hover with click-to-pin (DS-38, D-355).
|
|
669
|
+
*
|
|
670
|
+
* Behavior:
|
|
671
|
+
* - mouseenter on anchor → openDelay timer → render via DSPortal
|
|
672
|
+
* - mouseleave on anchor OR panel → closeDelay timer → unmount
|
|
673
|
+
* - panel mouseenter cancels pending close (cursor-into-card grace window)
|
|
674
|
+
* - click on anchor pins the card open; mouseleave is ignored while pinned
|
|
675
|
+
* - click outside both anchor + panel (via useClickOutside) unpins + closes
|
|
676
|
+
* - non-modal: NO focus trap; Tab from anchor moves into panel children naturally
|
|
677
|
+
*
|
|
678
|
+
* Position is computed once at the moment of `setOpen(true)` from
|
|
679
|
+
* `anchorRef.current.getBoundingClientRect()`. Scrolling-while-open is NOT
|
|
680
|
+
* tracked in v0.2 (acceptable for a hover preview that closes when cursor
|
|
681
|
+
* leaves anyway). v0.3 may add a ResizeObserver/scroll listener.
|
|
682
|
+
*/
|
|
683
|
+
declare function HoverCard({ anchorRef, children, placement, offset, openDelay, closeDelay, className, }: HoverCardProps): react_jsx_runtime.JSX.Element | null;
|
|
684
|
+
|
|
685
|
+
type BottomSheetHeight = "half" | "full";
|
|
686
|
+
interface BottomSheetProps {
|
|
687
|
+
open: boolean;
|
|
688
|
+
onClose: () => void;
|
|
689
|
+
title?: ReactNode;
|
|
690
|
+
footer?: ReactNode;
|
|
691
|
+
children: ReactNode;
|
|
692
|
+
height?: BottomSheetHeight;
|
|
693
|
+
closeOnBackdropClick?: boolean;
|
|
694
|
+
/**
|
|
695
|
+
* Force dark-mode rendering of the sheet panel independent of the page theme.
|
|
696
|
+
* Useful when the trigger lives inside a `.dark` scoped container (e.g. Storybook Docs dark story).
|
|
697
|
+
* Defaults to detecting `html.dark` (Canvas dark mode toggle).
|
|
698
|
+
*/
|
|
699
|
+
dark?: boolean;
|
|
700
|
+
className?: string;
|
|
701
|
+
style?: CSSProperties;
|
|
702
|
+
}
|
|
703
|
+
/**
|
|
704
|
+
* Bottom-anchored drawer primitive (Wave 3, DS-36).
|
|
705
|
+
*
|
|
706
|
+
* Mobile-style sheet that slides up from the bottom edge. Mirrors Sheet
|
|
707
|
+
* (DS-35) architecture - DSPortal-mounted backdrop + panel, useFocusTrap
|
|
708
|
+
* for Tab cycling + focus restore, document Escape keydown - but its
|
|
709
|
+
* geometry is bottom-anchored with top-rounded corners and a purely-visual
|
|
710
|
+
* drag-handle indicator at the top.
|
|
711
|
+
*
|
|
712
|
+
* Per D-340 (with v0.5.1 swipe-to-close upgrade):
|
|
713
|
+
* - Two height variants: 'half' (default, max-height 60vh) and 'full'
|
|
714
|
+
* (height 100vh, no top corners) - switched via [data-height] +
|
|
715
|
+
* sibling-CSS selectors (Phase 12 D-130 pattern).
|
|
716
|
+
* - Drag handle (.ds-atom-bottomsheet-handle, 32x4 ink-5 pill) supports
|
|
717
|
+
* swipe-to-close via Pointer Events (v0.5.1 patch - resolves D-340 v2.1
|
|
718
|
+
* deferral). pointerdown captures the pointer; pointermove translates
|
|
719
|
+
* the panel by positive Y delta only (drag-down); pointerup closes if
|
|
720
|
+
* delta > 120px OR > 40% of panel height, else snaps back via CSS
|
|
721
|
+
* transition. data-dragging="true" disables the transition during drag
|
|
722
|
+
* so the panel follows the finger directly.
|
|
723
|
+
* - role="dialog" + aria-modal="true"; aria-labelledby auto-wired via
|
|
724
|
+
* useId() when a title is provided.
|
|
725
|
+
* - closeOnBackdropClick defaults to true; pass false for destructive
|
|
726
|
+
* confirm flows that require explicit Cancel.
|
|
727
|
+
*
|
|
728
|
+
* DSPortal (D-310) gates its children on a mount-tick for SSR safety, so
|
|
729
|
+
* panelRef is null on the initial render. Tracking a local mount flag and
|
|
730
|
+
* feeding it into useFocusTrap's `active` arg ensures the trap re-runs
|
|
731
|
+
* once the portal commits the panel into the DOM.
|
|
732
|
+
*/
|
|
733
|
+
declare function BottomSheet({ open, onClose, title, footer, children, height, closeOnBackdropClick, dark, className, style, }: BottomSheetProps): react_jsx_runtime.JSX.Element | null;
|
|
734
|
+
|
|
735
|
+
interface LightboxItem {
|
|
736
|
+
src: string;
|
|
737
|
+
alt: string;
|
|
738
|
+
caption?: ReactNode;
|
|
739
|
+
}
|
|
740
|
+
interface LightboxProps {
|
|
741
|
+
/** Controls visibility; component returns null when false. */
|
|
742
|
+
open: boolean;
|
|
743
|
+
/** Called when the user clicks the close button or presses Escape. */
|
|
744
|
+
onClose: () => void;
|
|
745
|
+
/** Ordered array of images to display; must be non-empty when open. */
|
|
746
|
+
items: LightboxItem[];
|
|
747
|
+
/** Controlled index of the currently displayed image.
|
|
748
|
+
* @default 0
|
|
749
|
+
*/
|
|
750
|
+
activeIndex?: number;
|
|
751
|
+
/** Called when the user navigates to a different image with the new index. */
|
|
752
|
+
onIndexChange?: (index: number) => void;
|
|
753
|
+
}
|
|
754
|
+
/**
|
|
755
|
+
* Lightbox - full-bleed media-display overlay where the image IS the surface.
|
|
756
|
+
* D-350: heavier backdrop rgba(0,0,0,.92), arrow-key navigation with wrap-
|
|
757
|
+
* around, always-dark invariant (NO :root.dark overrides). Modal-adjacent
|
|
758
|
+
* architecture (DSPortal-mounted, Escape-to-close, initial focus on close).
|
|
759
|
+
*
|
|
760
|
+
* Controlled pattern: caller manages activeIndex + onIndexChange. Lightbox
|
|
761
|
+
* holds no state itself - pairs cleanly with gallery thumbnail-strip selection.
|
|
762
|
+
*
|
|
763
|
+
* <Lightbox
|
|
764
|
+
* open={open}
|
|
765
|
+
* onClose={() => setOpen(false)}
|
|
766
|
+
* items={[{ src: "/a.jpg", alt: "Resume" }]}
|
|
767
|
+
* activeIndex={0}
|
|
768
|
+
* />
|
|
769
|
+
*
|
|
770
|
+
* a11y: role="dialog" + aria-modal + aria-label includes active item.alt;
|
|
771
|
+
* close button gets initial focus (image is non-focusable); ArrowLeft/Right
|
|
772
|
+
* + Escape via global document keydown listener (no useFocusTrap - only 3
|
|
773
|
+
* focusable elements).
|
|
774
|
+
*/
|
|
775
|
+
declare function Lightbox({ open, onClose, items, activeIndex, onIndexChange }: LightboxProps): react_jsx_runtime.JSX.Element | null;
|
|
776
|
+
|
|
777
|
+
interface ProgressBarProps extends HTMLAttributes<HTMLDivElement> {
|
|
778
|
+
/** Current progress value; clamped to [0, max] internally.
|
|
779
|
+
* @default 0
|
|
780
|
+
*/
|
|
781
|
+
value?: number;
|
|
782
|
+
/** Maximum value used to compute the fill percentage.
|
|
783
|
+
* @default 100
|
|
784
|
+
*/
|
|
785
|
+
max?: number;
|
|
786
|
+
/** When true, renders an animated 3-dot pulse instead of a determinate fill bar.
|
|
787
|
+
* @default false
|
|
788
|
+
*/
|
|
789
|
+
loading?: boolean;
|
|
790
|
+
/** Accessible label; string values also render visually above the bar. */
|
|
791
|
+
label?: ReactNode;
|
|
792
|
+
}
|
|
793
|
+
/**
|
|
794
|
+
* ProgressBar - determinate progress indicator + loading variant (DS-42).
|
|
795
|
+
*
|
|
796
|
+
* <ProgressBar value={50} /> // determinate, 50%
|
|
797
|
+
* <ProgressBar value={3} max={10} label="Upload" /> // 3 of 10 (30%)
|
|
798
|
+
* <ProgressBar loading /> // 3-dot pulse
|
|
799
|
+
*
|
|
800
|
+
* Determinate: track + solid amber fill (var(--amber)); fill width transitions
|
|
801
|
+
* over 500ms ease-out. role="progressbar"
|
|
802
|
+
* with aria-valuenow / aria-valuemin / aria-valuemax wired.
|
|
803
|
+
*
|
|
804
|
+
* Loading: 3-dot pulse animation (handoff visual). role="status"; aria-live="polite";
|
|
805
|
+
* defaults aria-label to "Loading" if no `label` passed.
|
|
806
|
+
*
|
|
807
|
+
* Value clamped to [0, max] internally so callers can pass anything.
|
|
808
|
+
*/
|
|
809
|
+
declare const ProgressBar: react.ForwardRefExoticComponent<ProgressBarProps & react.RefAttributes<HTMLDivElement>>;
|
|
810
|
+
|
|
811
|
+
type SkeletonShape = "text" | "circle" | "pill";
|
|
812
|
+
interface SkeletonProps extends HTMLAttributes<HTMLDivElement> {
|
|
813
|
+
/** Shape of the skeleton placeholder.
|
|
814
|
+
* - `text` - full-width line at `1.2em` height (default).
|
|
815
|
+
* - `circle` - disc sized to `width`; use for avatar placeholders.
|
|
816
|
+
* - `pill` - rounded badge/chip-sized shape at `1.5em` height.
|
|
817
|
+
* @default "text"
|
|
818
|
+
*/
|
|
819
|
+
shape?: SkeletonShape;
|
|
820
|
+
/** Width of the skeleton; accepts any CSS length or a pixel number.
|
|
821
|
+
* @default "100%"
|
|
822
|
+
*/
|
|
823
|
+
width?: number | string;
|
|
824
|
+
/** Height override; defaults are shape-aware (text → 1.2em, circle → width, pill → 1.5em). */
|
|
825
|
+
height?: number | string;
|
|
826
|
+
}
|
|
827
|
+
/**
|
|
828
|
+
* Skeleton - placeholder shape for loading states (DS-43, D-420).
|
|
829
|
+
*
|
|
830
|
+
* <Skeleton /> // default text line, full width
|
|
831
|
+
* <Skeleton width={120} /> // 120px text line
|
|
832
|
+
* <Skeleton shape="circle" width={40} /> // 40x40 circle (avatar placeholder)
|
|
833
|
+
* <Skeleton shape="pill" width={80} /> // pill (badge / chip placeholder)
|
|
834
|
+
*
|
|
835
|
+
* Single primitive with `shape` prop instead of three separate primitives -
|
|
836
|
+
* keeps barrel small (D-420). Compose multi-line / avatar+name / card
|
|
837
|
+
* placeholders by rendering MULTIPLE Skeletons inside a consumer-controlled
|
|
838
|
+
* flex/grid container - the primitive itself renders ONE node only.
|
|
839
|
+
*
|
|
840
|
+
* Visual: cream-2 background with pulse animation (opacity 0.6 ↔ 1 at
|
|
841
|
+
* 1.2s ease-in-out infinite). Dark mode: rgba(255,255,255,0.06).
|
|
842
|
+
*
|
|
843
|
+
* `aria-hidden="true"` is hard-coded - Skeleton is decorative. Consumers
|
|
844
|
+
* wrap the surrounding region with their own `aria-busy={loading}` or
|
|
845
|
+
* similar to communicate the loading state to assistive tech.
|
|
846
|
+
*/
|
|
847
|
+
declare const Skeleton: react.ForwardRefExoticComponent<SkeletonProps & react.RefAttributes<HTMLDivElement>>;
|
|
848
|
+
|
|
849
|
+
/** Props injected into the trigger element by InlineConfirm. */
|
|
850
|
+
interface InlineConfirmTriggerProps {
|
|
851
|
+
/** Wires the trigger into InlineConfirm's state machine. Spread onto your button. */
|
|
852
|
+
onClick: () => void;
|
|
853
|
+
}
|
|
854
|
+
interface InlineConfirmProps {
|
|
855
|
+
/**
|
|
856
|
+
* Render-prop returning the trigger element (button, icon-button, etc.).
|
|
857
|
+
* Spread the provided `triggerProps` onto your element to wire the click handler.
|
|
858
|
+
*
|
|
859
|
+
* @example
|
|
860
|
+
* trigger={(p) => <Button variant="danger" {...p}>Delete</Button>}
|
|
861
|
+
*/
|
|
862
|
+
trigger: (triggerProps: InlineConfirmTriggerProps) => ReactNode;
|
|
863
|
+
/** Called when the user clicks the confirm button. */
|
|
864
|
+
onConfirm: () => void;
|
|
865
|
+
/** Called when the user cancels - via No button, Escape, click-outside, or auto-cancel timeout. */
|
|
866
|
+
onCancel?: () => void;
|
|
867
|
+
/**
|
|
868
|
+
* Label for the confirm button.
|
|
869
|
+
* @default "Yes"
|
|
870
|
+
*/
|
|
871
|
+
confirmLabel?: string;
|
|
872
|
+
/**
|
|
873
|
+
* Label for the cancel button.
|
|
874
|
+
* @default "No"
|
|
875
|
+
*/
|
|
876
|
+
cancelLabel?: string;
|
|
877
|
+
/**
|
|
878
|
+
* Variant for the confirm button. Use `"danger"` for destructive actions and
|
|
879
|
+
* `"primary"` for non-destructive confirms (e.g. Send, Submit).
|
|
880
|
+
* @default "danger"
|
|
881
|
+
*/
|
|
882
|
+
confirmVariant?: "danger" | "primary";
|
|
883
|
+
/**
|
|
884
|
+
* Milliseconds before the prompt auto-cancels. Hover or focus inside the
|
|
885
|
+
* prompt row pauses the timer. Pass `Infinity` to disable auto-cancel.
|
|
886
|
+
* @default 4000
|
|
887
|
+
*/
|
|
888
|
+
autoCancelMs?: number;
|
|
889
|
+
/**
|
|
890
|
+
* Text shown between the trigger state and the confirm/cancel buttons.
|
|
891
|
+
* @default "Are you sure?"
|
|
892
|
+
*/
|
|
893
|
+
promptText?: ReactNode;
|
|
894
|
+
}
|
|
895
|
+
/**
|
|
896
|
+
* InlineConfirm - render-prop trigger replacement for inline destructives (DS-45, D-430).
|
|
897
|
+
*
|
|
898
|
+
* <InlineConfirm
|
|
899
|
+
* trigger={(p) => <Button variant="danger" {...p}>Delete</Button>}
|
|
900
|
+
* onConfirm={handleDelete}
|
|
901
|
+
* promptText="Delete this application?"
|
|
902
|
+
* />
|
|
903
|
+
*
|
|
904
|
+
* Idle: renders the trigger function's returned element with `onClick` wired
|
|
905
|
+
* to enter pending state. Pending: replaces trigger with inline-row
|
|
906
|
+
* `[promptText] [No] [Yes]` in the same container - zero layout shift.
|
|
907
|
+
*
|
|
908
|
+
* 4s auto-cancel timer (configurable via `autoCancelMs`; pass Infinity to
|
|
909
|
+
* disable). Mouse-enter prompt OR focus-within pauses timer; un-hover AND
|
|
910
|
+
* blur resumes. Escape, click-outside, and explicit cancel-button click
|
|
911
|
+
* all dismiss immediately.
|
|
912
|
+
*
|
|
913
|
+
* For HIGH-stakes destructives (delete account, mass-delete, irreversible)
|
|
914
|
+
* use ConfirmDialog (Modal variant) instead - InlineConfirm is for LOW-stakes
|
|
915
|
+
* inline confirms in dense lists (D-431).
|
|
916
|
+
*
|
|
917
|
+
* Uncontrolled - manages internal `pending` state. No ref forwarding (the
|
|
918
|
+
* component switches between two different DOM trees).
|
|
919
|
+
*/
|
|
920
|
+
declare function InlineConfirm({ trigger, onConfirm, onCancel, confirmLabel, cancelLabel, confirmVariant, autoCancelMs, promptText, }: InlineConfirmProps): react_jsx_runtime.JSX.Element;
|
|
921
|
+
|
|
922
|
+
type AlertBannerTone = "info" | "success" | "warning" | "error";
|
|
923
|
+
interface AlertBannerProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
|
924
|
+
/** Controls visibility; component returns null when false. Caller manages open state. */
|
|
925
|
+
open: boolean;
|
|
926
|
+
/** Callback when the dismiss X button is clicked; also enables the X button by default. */
|
|
927
|
+
onDismiss?: () => void;
|
|
928
|
+
/** Visual tone variant for the banner background and icon.
|
|
929
|
+
* @default "info"
|
|
930
|
+
*/
|
|
931
|
+
tone?: AlertBannerTone;
|
|
932
|
+
/** Required heading text rendered in bold. Accepts ReactNode for rich content. */
|
|
933
|
+
title: ReactNode;
|
|
934
|
+
/** Optional secondary body text beneath the title. */
|
|
935
|
+
description?: ReactNode;
|
|
936
|
+
/** Overrides `description` when present - use for advanced layouts with embedded buttons. */
|
|
937
|
+
children?: ReactNode;
|
|
938
|
+
/** Whether to show the dismiss X button. Defaults to `!!onDismiss`. Pass `false` to suppress it. */
|
|
939
|
+
dismissible?: boolean;
|
|
940
|
+
}
|
|
941
|
+
/**
|
|
942
|
+
* AlertBanner - inline-flow controlled tone banner (D-410, D-411).
|
|
943
|
+
*
|
|
944
|
+
* <AlertBanner
|
|
945
|
+
* open={showTrialBanner}
|
|
946
|
+
* onDismiss={() => setShowTrialBanner(false)}
|
|
947
|
+
* tone="warning"
|
|
948
|
+
* title="Trial ends in 3 days"
|
|
949
|
+
* description="Upgrade now to keep your data."
|
|
950
|
+
* />
|
|
951
|
+
*
|
|
952
|
+
* <AlertBanner open tone="success" title="Saved as draft" /> // non-dismissible
|
|
953
|
+
*
|
|
954
|
+
* Controlled - caller manages `open`. Returns `null` when `open === false`.
|
|
955
|
+
* NO auto-dismiss (different from Toast). For ephemeral feedback use Toast (DS-40).
|
|
956
|
+
*
|
|
957
|
+
* Layout: `[icon] [title + description-or-children] [dismiss-X-when-dismissible]`.
|
|
958
|
+
* Tone via `data-variant` (Card pattern); CSS attribute selectors in primitives.css
|
|
959
|
+
* apply tone-tinted bg + border + icon-color.
|
|
960
|
+
*
|
|
961
|
+
* `dismissible` defaults to `!!onDismiss` - passing `onDismiss` shows the X by default.
|
|
962
|
+
* Force-hide with `dismissible={false}` (consumer wants to control close another way).
|
|
963
|
+
*/
|
|
964
|
+
declare const AlertBanner: react.ForwardRefExoticComponent<AlertBannerProps & react.RefAttributes<HTMLDivElement>>;
|
|
965
|
+
|
|
966
|
+
interface EmptyStateProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
|
967
|
+
/**
|
|
968
|
+
* Optional icon rendered above the title. Pass a lucide icon or any SVG at **40×40**.
|
|
969
|
+
* Omit for minimal inline empty states where an icon would add visual noise.
|
|
970
|
+
*/
|
|
971
|
+
icon?: ReactNode;
|
|
972
|
+
/**
|
|
973
|
+
* Primary heading. Required. Rendered in the display font at 600 weight.
|
|
974
|
+
* Keep to one short sentence - "No applications yet", "Nothing matched".
|
|
975
|
+
*/
|
|
976
|
+
title: ReactNode;
|
|
977
|
+
/**
|
|
978
|
+
* Secondary line below the title. Use to explain why the state occurred or
|
|
979
|
+
* suggest the next action. Rendered in `--ink-3` (flips with dark mode).
|
|
980
|
+
*/
|
|
981
|
+
description?: ReactNode;
|
|
982
|
+
/**
|
|
983
|
+
* CTA slot. Pass one or two `<Button>` elements (or any ReactNode).
|
|
984
|
+
* Rendered as a flex row below the description.
|
|
985
|
+
* Common patterns: single primary Button, primary + ghost pair.
|
|
986
|
+
*/
|
|
987
|
+
children?: ReactNode;
|
|
988
|
+
}
|
|
989
|
+
/**
|
|
990
|
+
* EmptyState - centered display for empty/no-data/first-run states (DS-44, D-421).
|
|
991
|
+
*
|
|
992
|
+
* <EmptyState
|
|
993
|
+
* icon={<Inbox size={40} />}
|
|
994
|
+
* title="No applications yet"
|
|
995
|
+
* description="Add your first job to get started."
|
|
996
|
+
* >
|
|
997
|
+
* <Button>Add application</Button>
|
|
998
|
+
* </EmptyState>
|
|
999
|
+
*
|
|
1000
|
+
* Centered vertical stack: icon → title → description → children-as-CTA.
|
|
1001
|
+
* Children slot accepts arbitrary JSX - single Button, primary+secondary
|
|
1002
|
+
* Buttons in a row, link, or any combination.
|
|
1003
|
+
*
|
|
1004
|
+
* NO compound API (no `<EmptyState.Icon>`, `<EmptyState.Action>`).
|
|
1005
|
+
* Structured props for icon/title/description; children for CTA actions.
|
|
1006
|
+
*
|
|
1007
|
+
* Padding `var(--space-8)` outer; gap `var(--space-3)` between stack
|
|
1008
|
+
* elements; max-width 360px on text content (consumer can override via
|
|
1009
|
+
* `style` or wrapping container width).
|
|
1010
|
+
*
|
|
1011
|
+
* `description` color uses `var(--ink-3)` token - flips with theme.
|
|
1012
|
+
*/
|
|
1013
|
+
declare const EmptyState: react.ForwardRefExoticComponent<EmptyStateProps & react.RefAttributes<HTMLDivElement>>;
|
|
1014
|
+
|
|
1015
|
+
type ToastTone = "success" | "error" | "info" | "warning";
|
|
1016
|
+
interface ToastOptions {
|
|
1017
|
+
/** Auto-dismiss after `duration` ms. Default 3000. Pass `Infinity` to disable auto-dismiss. */
|
|
1018
|
+
duration?: number;
|
|
1019
|
+
}
|
|
1020
|
+
interface ToastApi {
|
|
1021
|
+
success: (message: ReactNode, opts?: ToastOptions) => number;
|
|
1022
|
+
error: (message: ReactNode, opts?: ToastOptions) => number;
|
|
1023
|
+
info: (message: ReactNode, opts?: ToastOptions) => number;
|
|
1024
|
+
warning: (message: ReactNode, opts?: ToastOptions) => number;
|
|
1025
|
+
dismiss: (id: number) => void;
|
|
1026
|
+
}
|
|
1027
|
+
/**
|
|
1028
|
+
* useToast - imperative toast API hook (D-400).
|
|
1029
|
+
*
|
|
1030
|
+
* Must be called inside a `<ToastProvider>`. Throws otherwise.
|
|
1031
|
+
*
|
|
1032
|
+
* const toast = useToast();
|
|
1033
|
+
* toast.success("Saved");
|
|
1034
|
+
* toast.error("Failed", { duration: 5000 });
|
|
1035
|
+
* toast.info("Heads up");
|
|
1036
|
+
* toast.warning("Almost full");
|
|
1037
|
+
* const id = toast.success("...");
|
|
1038
|
+
* toast.dismiss(id);
|
|
1039
|
+
*/
|
|
1040
|
+
declare function useToast(): ToastApi;
|
|
1041
|
+
interface ToastProviderProps {
|
|
1042
|
+
children: ReactNode;
|
|
1043
|
+
}
|
|
1044
|
+
/**
|
|
1045
|
+
* ToastProvider - context provider + DSPortal-mounted region (D-400, D-401).
|
|
1046
|
+
*
|
|
1047
|
+
* <ToastProvider>
|
|
1048
|
+
* <App />
|
|
1049
|
+
* </ToastProvider>
|
|
1050
|
+
*
|
|
1051
|
+
* Mounts a fixed top-right region (z-1100) that renders only when ≥1 toast
|
|
1052
|
+
* is active. Max 3 concurrent toasts; 4th added → oldest FIFO drops.
|
|
1053
|
+
* Each toast auto-dismisses after `duration` ms (default 3000); pass
|
|
1054
|
+
* `duration: Infinity` to disable auto-dismiss.
|
|
1055
|
+
*
|
|
1056
|
+
* Callback-ref-as-state mounts the stack-container DOM as state (Tooltip
|
|
1057
|
+
* line 79 + Popover line 73 pattern). Animations start cleanly once DSPortal
|
|
1058
|
+
* commits the portaled node and React fires the callback ref.
|
|
1059
|
+
*/
|
|
1060
|
+
declare function ToastProvider({ children }: ToastProviderProps): react_jsx_runtime.JSX.Element;
|
|
1061
|
+
|
|
1062
|
+
interface CopyToClipboardProps extends Omit<HTMLAttributes<HTMLButtonElement>, "onCopy" | "onError"> {
|
|
1063
|
+
/** The string value written to the clipboard on click. */
|
|
1064
|
+
value: string;
|
|
1065
|
+
/** Display text shown inside the button; falls back to `value` when omitted. */
|
|
1066
|
+
label?: string;
|
|
1067
|
+
/**
|
|
1068
|
+
* Text shown in place of `label`/`value` for 2 s after a successful copy.
|
|
1069
|
+
* Omit to keep the original label visible (icon-swap + green border only).
|
|
1070
|
+
* @example copiedLabel="Copied!"
|
|
1071
|
+
*/
|
|
1072
|
+
copiedLabel?: string;
|
|
1073
|
+
/** Called after a successful clipboard write; use to trigger a Toast or other feedback. */
|
|
1074
|
+
onCopy?: () => void;
|
|
1075
|
+
/** Called when the clipboard API fails (e.g. insecure context or permission denied). */
|
|
1076
|
+
onError?: (err: Error) => void;
|
|
1077
|
+
}
|
|
1078
|
+
/**
|
|
1079
|
+
* Inline value + Copy↔Check icon (DS-55, D-531).
|
|
1080
|
+
*
|
|
1081
|
+
* On click: navigator.clipboard.writeText(value) → success: icon swaps to
|
|
1082
|
+
* green Check for 2s, calls onCopy?(); failure: console.warn(err), icon
|
|
1083
|
+
* stays as Copy, calls onError?(err). NO internal Toast dep.
|
|
1084
|
+
*/
|
|
1085
|
+
declare const CopyToClipboard: react.ForwardRefExoticComponent<CopyToClipboardProps & react.RefAttributes<HTMLButtonElement>>;
|
|
1086
|
+
|
|
1087
|
+
interface DatePickerProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
1088
|
+
/** Controlled selected date; pass `null` for no selection. */
|
|
1089
|
+
value: Date | null;
|
|
1090
|
+
/** Called when the user clicks a calendar day cell with the selected Date. */
|
|
1091
|
+
onChange: (d: Date) => void;
|
|
1092
|
+
/** Called when the user navigates to a different month, with the first day of that month. */
|
|
1093
|
+
onMonthChange?: (d: Date) => void;
|
|
1094
|
+
/** Predicate that returns true for dates that should be disabled (unclickable). */
|
|
1095
|
+
disabled?: (d: Date) => boolean;
|
|
1096
|
+
/** Array of dates that receive an event-dot indicator on their cell. */
|
|
1097
|
+
events?: Date[];
|
|
1098
|
+
/** When true, all dates before today are disabled.
|
|
1099
|
+
* @default false
|
|
1100
|
+
*/
|
|
1101
|
+
disablePast?: boolean;
|
|
1102
|
+
/** When true, all dates after today are disabled.
|
|
1103
|
+
* @default false
|
|
1104
|
+
*/
|
|
1105
|
+
disableFuture?: boolean;
|
|
1106
|
+
/** When true, renders a 12-hour time picker row below the grid.
|
|
1107
|
+
* @default false
|
|
1108
|
+
*/
|
|
1109
|
+
showTime?: boolean;
|
|
1110
|
+
/** Predicate for cells that fall within an in-progress date range; adds the amber-light between-state bg. Consumed by DateRangePicker. */
|
|
1111
|
+
inRange?: (d: Date) => boolean;
|
|
1112
|
+
/** Initial month displayed when `value` is null; useful for range-picker right calendar. */
|
|
1113
|
+
defaultMonth?: Date;
|
|
1114
|
+
/** Override cell-selected detection; DateRangePicker uses this to highlight both range endpoints. */
|
|
1115
|
+
isCellSelected?: (d: Date) => boolean;
|
|
1116
|
+
/** Marks a cell as the start of a range for edge-pill visual polish; used by DateRangePicker. */
|
|
1117
|
+
isRangeStart?: (d: Date) => boolean;
|
|
1118
|
+
/** Marks a cell as the end of a range for edge-pill visual polish; used by DateRangePicker. */
|
|
1119
|
+
isRangeEnd?: (d: Date) => boolean;
|
|
1120
|
+
}
|
|
1121
|
+
declare const DatePicker: react.ForwardRefExoticComponent<DatePickerProps & react.RefAttributes<HTMLDivElement>>;
|
|
1122
|
+
|
|
1123
|
+
interface SplitButtonAction {
|
|
1124
|
+
/** Display label for this action. */
|
|
1125
|
+
label: string;
|
|
1126
|
+
/** Optional icon rendered before the label. */
|
|
1127
|
+
icon?: ReactNode;
|
|
1128
|
+
/** Handler called when this action is selected. */
|
|
1129
|
+
onClick: () => void;
|
|
1130
|
+
/**
|
|
1131
|
+
* Per-action variant override. Drives the primary face appearance when selected
|
|
1132
|
+
* AND adds a left-border color hint in the menu. Defaults to the SplitButton-level `variant`.
|
|
1133
|
+
*/
|
|
1134
|
+
variant?: ButtonVariant;
|
|
1135
|
+
/**
|
|
1136
|
+
* Semantic tone applied to this menu item. Overrides the variant color in the dropdown only -
|
|
1137
|
+
* does not affect the primary face. Use for signalling intent (e.g. `"danger"` for Delete).
|
|
1138
|
+
* - `"danger"` → red text
|
|
1139
|
+
* - `"warning"` → amber text
|
|
1140
|
+
* - `"success"` → green text
|
|
1141
|
+
*/
|
|
1142
|
+
tone?: "danger" | "warning" | "success";
|
|
1143
|
+
}
|
|
1144
|
+
interface SplitButtonProps {
|
|
1145
|
+
/** Non-empty array of actions; the first element is shown as the primary face on mount. */
|
|
1146
|
+
actions: [SplitButtonAction, ...SplitButtonAction[]];
|
|
1147
|
+
/** Default visual variant applied to actions that don't set their own `variant`.
|
|
1148
|
+
* @default "primary"
|
|
1149
|
+
*/
|
|
1150
|
+
variant?: ButtonVariant;
|
|
1151
|
+
/** Size token applied to both the primary face and the chevron trigger.
|
|
1152
|
+
* @default "md"
|
|
1153
|
+
*/
|
|
1154
|
+
size?: "sm" | "md" | "lg";
|
|
1155
|
+
/** Additional className applied to the root wrapper element. */
|
|
1156
|
+
className?: string;
|
|
1157
|
+
}
|
|
1158
|
+
/**
|
|
1159
|
+
* Split-action button (DS-56, D-530). Primary face + chevron-divider button
|
|
1160
|
+
* exposing a Popover menu of alternative actions. Selecting an alternative
|
|
1161
|
+
* makes it the primary face for this instance - re-mount resets to actions[0]
|
|
1162
|
+
* (in-instance state only; persistence deferred to v2.1).
|
|
1163
|
+
*
|
|
1164
|
+
* v0.5.1 patch - full Button variant set (primary | secondary | ghost |
|
|
1165
|
+
* danger) on the SplitButton level AND per-action. The currently-selected
|
|
1166
|
+
* action's variant drives the primary face's appearance; menu items render
|
|
1167
|
+
* with their own variants as visual hints.
|
|
1168
|
+
*
|
|
1169
|
+
* v0.5.4 - menu item accent only renders for explicit per-action variant
|
|
1170
|
+
* overrides; inherited variants show no left-border accent (cleans the
|
|
1171
|
+
* default-only case where every item was getting an amber edge via the
|
|
1172
|
+
* primary fallback, defeating the differentiation intent).
|
|
1173
|
+
*
|
|
1174
|
+
* Composes Popover (Wave 3) - NOT DSDropdown - because SplitButton's menu is
|
|
1175
|
+
* a 2–5 item action menu, not a listbox semantic.
|
|
1176
|
+
*/
|
|
1177
|
+
declare const SplitButton: react.ForwardRefExoticComponent<SplitButtonProps & react.RefAttributes<HTMLDivElement>>;
|
|
1178
|
+
|
|
1179
|
+
interface MultiSelectOption {
|
|
1180
|
+
value: string;
|
|
1181
|
+
label: string;
|
|
1182
|
+
}
|
|
1183
|
+
interface MultiSelectProps {
|
|
1184
|
+
/** Controlled array of selected option values. */
|
|
1185
|
+
value: string[];
|
|
1186
|
+
/** Called with the full updated selection array after each toggle or remove. */
|
|
1187
|
+
onChange: (vs: string[]) => void;
|
|
1188
|
+
/** Full list of available options shown in the dropdown. */
|
|
1189
|
+
options: MultiSelectOption[];
|
|
1190
|
+
/** Placeholder text shown in the trigger when nothing is selected.
|
|
1191
|
+
* @default "Select…"
|
|
1192
|
+
*/
|
|
1193
|
+
placeholder?: string;
|
|
1194
|
+
/** When true, disables the trigger and prevents interaction.
|
|
1195
|
+
* @default false
|
|
1196
|
+
*/
|
|
1197
|
+
disabled?: boolean;
|
|
1198
|
+
/** Additional className applied to the trigger button. */
|
|
1199
|
+
className?: string;
|
|
1200
|
+
/** Inline styles applied to the trigger button. */
|
|
1201
|
+
style?: CSSProperties;
|
|
1202
|
+
}
|
|
1203
|
+
/**
|
|
1204
|
+
* Multi-select dropdown (DS-51). Chips-in-trigger layout (D-520) with
|
|
1205
|
+
* cap-3 + "+N more" Popover expansion. ARIA: combobox + listbox with
|
|
1206
|
+
* aria-multiselectable=true per D-501. Composes DSDropdown (16-01) +
|
|
1207
|
+
* Popover (Wave 3). Mini-checkbox per option in the dropdown panel.
|
|
1208
|
+
*/
|
|
1209
|
+
declare const MultiSelect: react.ForwardRefExoticComponent<MultiSelectProps & react.RefAttributes<HTMLButtonElement>>;
|
|
1210
|
+
|
|
1211
|
+
interface SelectOption {
|
|
1212
|
+
value: string;
|
|
1213
|
+
label: string;
|
|
1214
|
+
dotColor?: string;
|
|
1215
|
+
}
|
|
1216
|
+
interface SelectProps {
|
|
1217
|
+
/** Controlled selected option value; pass `null` for no selection. */
|
|
1218
|
+
value: string | null;
|
|
1219
|
+
/** Called with the value string of the option the user selected. */
|
|
1220
|
+
onChange: (v: string) => void;
|
|
1221
|
+
/** Full list of options rendered in the dropdown. */
|
|
1222
|
+
options: SelectOption[];
|
|
1223
|
+
/** Placeholder text shown in the trigger when no option is selected.
|
|
1224
|
+
* @default "Select…"
|
|
1225
|
+
*/
|
|
1226
|
+
placeholder?: string;
|
|
1227
|
+
/** When true, renders a search input at the top of the dropdown that filters options.
|
|
1228
|
+
* @default true
|
|
1229
|
+
*/
|
|
1230
|
+
searchable?: boolean;
|
|
1231
|
+
/** When true, disables the trigger button and prevents interaction.
|
|
1232
|
+
* @default false
|
|
1233
|
+
*/
|
|
1234
|
+
disabled?: boolean;
|
|
1235
|
+
/** Additional className applied to the trigger button. */
|
|
1236
|
+
className?: string;
|
|
1237
|
+
/** Inline styles applied to the trigger button. */
|
|
1238
|
+
style?: CSSProperties;
|
|
1239
|
+
}
|
|
1240
|
+
/**
|
|
1241
|
+
* Single-select dropdown (DS-50). Composes the internal DSDropdown helper
|
|
1242
|
+
* for portal/positioning/keyboard while wiring the listbox a11y per D-501:
|
|
1243
|
+
* trigger gets role="combobox" + aria-expanded + aria-haspopup="listbox" +
|
|
1244
|
+
* aria-controls + aria-activedescendant; panel renders <ul role="listbox">
|
|
1245
|
+
* with <li role="option" aria-selected> items.
|
|
1246
|
+
*
|
|
1247
|
+
* Searchable by default - when `searchable` and the option list >5 (or any),
|
|
1248
|
+
* a header search input filters by case-insensitive label substring; an
|
|
1249
|
+
* empty filtered result shows a "No results" empty state.
|
|
1250
|
+
*
|
|
1251
|
+
* Each option may carry an optional `dotColor` rendered as an 8×8 round
|
|
1252
|
+
* indicator before the label; the currently-selected option also gets a
|
|
1253
|
+
* trailing Check icon.
|
|
1254
|
+
*
|
|
1255
|
+
* Reuses .ds-atom-dropdown panel chrome from 16-01 - only .ds-atom-select
|
|
1256
|
+
* styling is added in this plan's primitives.css block.
|
|
1257
|
+
*/
|
|
1258
|
+
declare const Select: react.ForwardRefExoticComponent<SelectProps & react.RefAttributes<HTMLButtonElement>>;
|
|
1259
|
+
|
|
1260
|
+
interface DateRange {
|
|
1261
|
+
start: Date | null;
|
|
1262
|
+
end: Date | null;
|
|
1263
|
+
}
|
|
1264
|
+
interface DateRangePickerProps {
|
|
1265
|
+
/** Controlled range with `start` and `end` dates (either may be null while picking). */
|
|
1266
|
+
value: DateRange;
|
|
1267
|
+
/** Called on every click with the updated `{ start, end }` range object. */
|
|
1268
|
+
onChange: (r: DateRange) => void;
|
|
1269
|
+
/** When true, all dates before today are disabled.
|
|
1270
|
+
* @default false
|
|
1271
|
+
*/
|
|
1272
|
+
disablePast?: boolean;
|
|
1273
|
+
/** When true, all dates after today are disabled.
|
|
1274
|
+
* @default false
|
|
1275
|
+
*/
|
|
1276
|
+
disableFuture?: boolean;
|
|
1277
|
+
/** Additional className applied to the root wrapper element. */
|
|
1278
|
+
className?: string;
|
|
1279
|
+
/** Inline styles applied to the root wrapper element. */
|
|
1280
|
+
style?: CSSProperties;
|
|
1281
|
+
}
|
|
1282
|
+
/**
|
|
1283
|
+
* Date-range picker (DS-54). Single calendar with click-twice flow:
|
|
1284
|
+
* 1st click = start (end cleared); 2nd click = end (auto-swap if before
|
|
1285
|
+
* start); 3rd click = reset to new start. Hover preview between selected
|
|
1286
|
+
* start and current hover styled via DatePicker's inRange predicate prop.
|
|
1287
|
+
* NO time picker for v2.0 (deferred to v2.1).
|
|
1288
|
+
*
|
|
1289
|
+
* Single-calendar redesign (v0.5.1) overrides the original D-512 two-cal
|
|
1290
|
+
* layout - matches handoff `ds-pickers.jsx` and user preference.
|
|
1291
|
+
*/
|
|
1292
|
+
declare const DateRangePicker: react.ForwardRefExoticComponent<DateRangePickerProps & react.RefAttributes<HTMLDivElement>>;
|
|
1293
|
+
|
|
1294
|
+
interface AutocompleteProps<T> {
|
|
1295
|
+
/** Controlled text value of the input field. */
|
|
1296
|
+
value: string;
|
|
1297
|
+
/** Called on every keystroke with the new input string. */
|
|
1298
|
+
onValueChange: (q: string) => void;
|
|
1299
|
+
/** Consumer-filtered list of items to show; Autocomplete never filters internally. */
|
|
1300
|
+
items: T[];
|
|
1301
|
+
/** Optional array of recently-used items shown when the input is empty and focused. */
|
|
1302
|
+
recentItems?: T[];
|
|
1303
|
+
/** Called when the user selects an item from the dropdown. */
|
|
1304
|
+
onSelect: (item: T) => void;
|
|
1305
|
+
/** When provided, shows a "+ Add …" button when `items` is empty; called with the current query. */
|
|
1306
|
+
onCreate?: (query: string) => void;
|
|
1307
|
+
/** Extracts a display string from an item for rendering and type-ahead. */
|
|
1308
|
+
getItemLabel: (item: T) => string;
|
|
1309
|
+
/** Extracts a unique React key string from an item. */
|
|
1310
|
+
getItemKey: (item: T) => string;
|
|
1311
|
+
/** Custom render function for each option row; receives the item and whether it is keyboard-active. */
|
|
1312
|
+
renderItem?: (item: T, isActive: boolean) => ReactNode;
|
|
1313
|
+
/** Placeholder text shown in the empty input.
|
|
1314
|
+
* @default "Search…"
|
|
1315
|
+
*/
|
|
1316
|
+
placeholder?: string;
|
|
1317
|
+
/** Additional className applied to the underlying `<input>` element. */
|
|
1318
|
+
className?: string;
|
|
1319
|
+
/** Inline styles applied to the underlying `<input>` element. */
|
|
1320
|
+
style?: CSSProperties;
|
|
1321
|
+
}
|
|
1322
|
+
/**
|
|
1323
|
+
* Generic combobox primitive (DS-52, D-521). Consumer-filtered items +
|
|
1324
|
+
* optional recents + optional create-as-new. Composes DSDropdown helper.
|
|
1325
|
+
*
|
|
1326
|
+
* Filtering is consumer-controlled: caller filters `items` prop before
|
|
1327
|
+
* passing - Autocomplete never filters internally. Recents are also
|
|
1328
|
+
* consumer-provided (no internal localStorage) per D-521.
|
|
1329
|
+
*
|
|
1330
|
+
* Behavior:
|
|
1331
|
+
* - Empty input + focus + non-empty `recentItems` → dropdown shows
|
|
1332
|
+
* `RECENT` header + recent items prefixed with a Clock icon.
|
|
1333
|
+
* - Empty input + empty/absent `recentItems` → dropdown stays closed.
|
|
1334
|
+
* - Non-empty input + items=[] + `onCreate` provided → dropdown shows
|
|
1335
|
+
* a single `+ Add "{query}" as new` button outside the listbox
|
|
1336
|
+
* (plain `<button>`, NOT `role=option` - listbox semantic preserved).
|
|
1337
|
+
* - Non-empty input + items=[] + no `onCreate` → "No results" empty state.
|
|
1338
|
+
*
|
|
1339
|
+
* ARIA per D-501: native `<input>` trigger with `role="combobox"`,
|
|
1340
|
+
* `aria-autocomplete="list"`, `aria-expanded`, `aria-controls`.
|
|
1341
|
+
* Listbox uses `<ul role="listbox">` + `<li role="option">` items.
|
|
1342
|
+
*/
|
|
1343
|
+
declare function Autocomplete<T>({ value, onValueChange, items, recentItems, onSelect, onCreate, getItemLabel, getItemKey, renderItem, placeholder, className, style, }: AutocompleteProps<T>): react_jsx_runtime.JSX.Element;
|
|
1344
|
+
|
|
1345
|
+
interface SegmentedOption<T extends string = string> {
|
|
1346
|
+
value: T;
|
|
1347
|
+
label: string;
|
|
1348
|
+
disabled?: boolean;
|
|
1349
|
+
}
|
|
1350
|
+
interface SegmentedControlProps<T extends string = string> {
|
|
1351
|
+
options: SegmentedOption<T>[];
|
|
1352
|
+
value: T;
|
|
1353
|
+
onChange: (value: T) => void;
|
|
1354
|
+
size?: "sm" | "md" | "lg";
|
|
1355
|
+
disabled?: boolean;
|
|
1356
|
+
ariaLabel: string;
|
|
1357
|
+
className?: string;
|
|
1358
|
+
style?: React.CSSProperties;
|
|
1359
|
+
}
|
|
1360
|
+
declare function SegmentedControlInner<T extends string>({ options, value, onChange, size, disabled, ariaLabel, className, style, }: SegmentedControlProps<T>, ref: React.Ref<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
1361
|
+
declare const SegmentedControl: <T extends string>(props: SegmentedControlProps<T> & {
|
|
1362
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
1363
|
+
}) => ReturnType<typeof SegmentedControlInner>;
|
|
1364
|
+
|
|
1365
|
+
interface BreadcrumbItem {
|
|
1366
|
+
label: string;
|
|
1367
|
+
href?: string;
|
|
1368
|
+
onClick?: (e: React.MouseEvent) => void;
|
|
1369
|
+
}
|
|
1370
|
+
interface BreadcrumbsProps {
|
|
1371
|
+
/** Ordered list of breadcrumb items; last item is marked as the current page. */
|
|
1372
|
+
items: BreadcrumbItem[];
|
|
1373
|
+
/** Maximum items shown before collapsing middle items into a "…" overflow menu.
|
|
1374
|
+
* @default 4
|
|
1375
|
+
*/
|
|
1376
|
+
maxVisible?: number;
|
|
1377
|
+
/** Accessible label for the `<nav>` landmark.
|
|
1378
|
+
* @default "Breadcrumb"
|
|
1379
|
+
*/
|
|
1380
|
+
ariaLabel?: string;
|
|
1381
|
+
/** Additional className applied to the root `<nav>` element. */
|
|
1382
|
+
className?: string;
|
|
1383
|
+
/** Inline styles applied to the root `<nav>` element. */
|
|
1384
|
+
style?: CSSProperties;
|
|
1385
|
+
}
|
|
1386
|
+
declare const Breadcrumbs: react.ForwardRefExoticComponent<BreadcrumbsProps & react.RefAttributes<HTMLElement>>;
|
|
1387
|
+
|
|
1388
|
+
interface TimelineEvent {
|
|
1389
|
+
id: string | number;
|
|
1390
|
+
date: Date | string;
|
|
1391
|
+
label: string;
|
|
1392
|
+
description?: string;
|
|
1393
|
+
color?: string;
|
|
1394
|
+
onClick?: () => void;
|
|
1395
|
+
}
|
|
1396
|
+
interface TimelineProps {
|
|
1397
|
+
/** Ordered array of events rendered as dots connected by a line. */
|
|
1398
|
+
events: TimelineEvent[];
|
|
1399
|
+
/** Layout direction of the timeline.
|
|
1400
|
+
* @default "horizontal"
|
|
1401
|
+
*/
|
|
1402
|
+
orientation?: "horizontal" | "vertical";
|
|
1403
|
+
/** Additional className applied to the root `<ol>` element. */
|
|
1404
|
+
className?: string;
|
|
1405
|
+
/** Inline styles applied to the root `<ol>` element. */
|
|
1406
|
+
style?: CSSProperties;
|
|
1407
|
+
/** Accessible label for the `<ol>` list.
|
|
1408
|
+
* @default "Timeline"
|
|
1409
|
+
*/
|
|
1410
|
+
ariaLabel?: string;
|
|
1411
|
+
}
|
|
1412
|
+
declare const Timeline: react.ForwardRefExoticComponent<TimelineProps & react.RefAttributes<HTMLOListElement>>;
|
|
1413
|
+
|
|
1414
|
+
interface InfiniteListProps<T = unknown> {
|
|
1415
|
+
/** Consumer-managed array of items; InfiniteList never slices or paginates internally. */
|
|
1416
|
+
items: T[];
|
|
1417
|
+
/** Render function called for each item; returns the list-item content. */
|
|
1418
|
+
renderItem: (item: T, index: number) => ReactNode;
|
|
1419
|
+
/** Whether more items are available to load; controls sentinel and end-slot visibility. */
|
|
1420
|
+
hasMore: boolean;
|
|
1421
|
+
/** Whether a fetch is currently in flight; pauses the IntersectionObserver while true. */
|
|
1422
|
+
loading: boolean;
|
|
1423
|
+
/** Called when the sentinel element enters the viewport; consumer triggers the next page fetch. */
|
|
1424
|
+
onLoadMore: () => void;
|
|
1425
|
+
/** Custom loading indicator; replaces the default 3-Skeleton row. */
|
|
1426
|
+
loadingSlot?: ReactNode;
|
|
1427
|
+
/** Custom end-of-list message; replaces the default "End of list" text. */
|
|
1428
|
+
endSlot?: ReactNode;
|
|
1429
|
+
/** IntersectionObserver rootMargin for pre-fetching before the sentinel reaches the viewport.
|
|
1430
|
+
* @default "200px"
|
|
1431
|
+
*/
|
|
1432
|
+
rootMargin?: string;
|
|
1433
|
+
/** Additional className applied to the root `<ul>` element. */
|
|
1434
|
+
className?: string;
|
|
1435
|
+
/** Inline styles applied to the root `<ul>` element. */
|
|
1436
|
+
style?: CSSProperties;
|
|
1437
|
+
/** Accessible label for the list region.
|
|
1438
|
+
* @default "List"
|
|
1439
|
+
*/
|
|
1440
|
+
ariaLabel?: string;
|
|
1441
|
+
}
|
|
1442
|
+
declare function InfiniteListInner<T>({ items, renderItem, hasMore, loading, onLoadMore, loadingSlot, endSlot, rootMargin, className, style, ariaLabel, }: InfiniteListProps<T>, ref: React.Ref<HTMLUListElement>): react_jsx_runtime.JSX.Element;
|
|
1443
|
+
declare const InfiniteList: <T>(props: InfiniteListProps<T> & {
|
|
1444
|
+
ref?: React.Ref<HTMLUListElement>;
|
|
1445
|
+
}) => ReturnType<typeof InfiniteListInner>;
|
|
1446
|
+
|
|
1447
|
+
interface AccordionProps {
|
|
1448
|
+
mode?: "single" | "multi";
|
|
1449
|
+
defaultOpenIds?: string[];
|
|
1450
|
+
openIds?: string[];
|
|
1451
|
+
onOpenIdsChange?: (ids: string[]) => void;
|
|
1452
|
+
children: React.ReactNode;
|
|
1453
|
+
className?: string;
|
|
1454
|
+
style?: React.CSSProperties;
|
|
1455
|
+
}
|
|
1456
|
+
interface AccordionItemProps {
|
|
1457
|
+
id: string;
|
|
1458
|
+
title: React.ReactNode;
|
|
1459
|
+
headingLevel?: 2 | 3 | 4 | 5 | 6;
|
|
1460
|
+
disabled?: boolean;
|
|
1461
|
+
children: React.ReactNode;
|
|
1462
|
+
}
|
|
1463
|
+
declare function AccordionItem({ id, title, headingLevel, disabled, children, }: Readonly<AccordionItemProps>): react_jsx_runtime.JSX.Element;
|
|
1464
|
+
declare const Accordion: react.ForwardRefExoticComponent<AccordionProps & react.RefAttributes<HTMLDivElement>> & {
|
|
1465
|
+
Item: typeof AccordionItem;
|
|
1466
|
+
};
|
|
1467
|
+
|
|
1468
|
+
/**
|
|
1469
|
+
* # Usage Audit - Carousel (DS-65)
|
|
1470
|
+
*
|
|
1471
|
+
* Consumers (post v0.6):
|
|
1472
|
+
* - Marketing hero rotations: image galleries, tutorial steps, testimonial rotators
|
|
1473
|
+
*
|
|
1474
|
+
* API:
|
|
1475
|
+
* - slides: CarouselSlide[] - array of { id, content, ariaLabel? }
|
|
1476
|
+
* - index / defaultIndex / onIndexChange - controlled or uncontrolled position
|
|
1477
|
+
* - autoPlayInterval: number - ms between auto-advances; 0 = disabled
|
|
1478
|
+
* - showArrows: boolean - render Prev/Next arrow buttons (default true)
|
|
1479
|
+
* - showDots: boolean - render dot indicator tablist (default true)
|
|
1480
|
+
* - ariaLabel: string - accessible label for the carousel region
|
|
1481
|
+
*
|
|
1482
|
+
* Implementation:
|
|
1483
|
+
* - WAI-ARIA Carousel pattern: <section aria-roledescription="carousel">
|
|
1484
|
+
* with <div role="group" aria-roledescription="slide"> per slide
|
|
1485
|
+
* - Dot tablist: role="tablist" + role="tab" buttons with aria-selected
|
|
1486
|
+
* - Touch swipe via Pointer Events with setPointerCapture (lifted from BottomSheet)
|
|
1487
|
+
* - touch-only filter via e.pointerType === "touch"
|
|
1488
|
+
* - Autoplay gated by useReducedMotion (W3C guidance: skip timer entirely when set)
|
|
1489
|
+
* - Pause on hover/focus per WAI-ARIA spec
|
|
1490
|
+
* - Keyboard: ArrowLeft/Right when carousel section has focus
|
|
1491
|
+
*/
|
|
1492
|
+
interface CarouselSlide {
|
|
1493
|
+
/** Unique key for React + DOM identity. */
|
|
1494
|
+
id: string | number;
|
|
1495
|
+
/** Content to render inside the slide. Consumer controls markup and media. */
|
|
1496
|
+
content: React.ReactNode;
|
|
1497
|
+
/**
|
|
1498
|
+
* Override for the slide's aria-label. Defaults to "{i+1} of {N}".
|
|
1499
|
+
* Use when you have a more descriptive label (e.g. "Product photo: Running shoe").
|
|
1500
|
+
*/
|
|
1501
|
+
ariaLabel?: string;
|
|
1502
|
+
}
|
|
1503
|
+
interface CarouselProps {
|
|
1504
|
+
/** Array of slides to display. */
|
|
1505
|
+
slides: CarouselSlide[];
|
|
1506
|
+
/** Controlled current index. When provided, component is fully controlled. */
|
|
1507
|
+
index?: number;
|
|
1508
|
+
/** Initial index when uncontrolled. Defaults to 0. */
|
|
1509
|
+
defaultIndex?: number;
|
|
1510
|
+
/** Called when the active index changes (both controlled and uncontrolled). */
|
|
1511
|
+
onIndexChange?: (i: number) => void;
|
|
1512
|
+
/** Auto-advance interval in ms. 0 or undefined = no autoplay. Autoplay is
|
|
1513
|
+
* silently disabled when the OS prefers-reduced-motion preference is set. */
|
|
1514
|
+
autoPlayInterval?: number;
|
|
1515
|
+
/** Show Prev/Next arrow buttons. Defaults to true. */
|
|
1516
|
+
showArrows?: boolean;
|
|
1517
|
+
/** Show dot indicator navigation. Defaults to true. */
|
|
1518
|
+
showDots?: boolean;
|
|
1519
|
+
/** Accessible label for the carousel region (required). */
|
|
1520
|
+
ariaLabel: string;
|
|
1521
|
+
/** Additional className for the root section element. */
|
|
1522
|
+
className?: string;
|
|
1523
|
+
/** Inline style for the root section element. */
|
|
1524
|
+
style?: React.CSSProperties;
|
|
1525
|
+
}
|
|
1526
|
+
declare const Carousel: react.ForwardRefExoticComponent<CarouselProps & react.RefAttributes<HTMLElement>>;
|
|
1527
|
+
|
|
1528
|
+
interface TabItem {
|
|
1529
|
+
id: string;
|
|
1530
|
+
label: string;
|
|
1531
|
+
count?: number;
|
|
1532
|
+
disabled?: boolean;
|
|
1533
|
+
content: ReactNode;
|
|
1534
|
+
}
|
|
1535
|
+
interface TabsProps {
|
|
1536
|
+
/** Array of tab definitions including id, label, optional count badge, disabled flag, and panel content. */
|
|
1537
|
+
tabs: TabItem[];
|
|
1538
|
+
/** Controlled id of the currently active tab. */
|
|
1539
|
+
value: string;
|
|
1540
|
+
/** Called with the tab id when the user activates a different tab. */
|
|
1541
|
+
onChange: (id: string) => void;
|
|
1542
|
+
/** Visual style of the tab triggers.
|
|
1543
|
+
* @default "underline"
|
|
1544
|
+
*/
|
|
1545
|
+
variant?: "underline" | "pill";
|
|
1546
|
+
/** Whether selecting a tab happens on arrow-key press (`"automatic"`) or only on Enter/Space (`"manual"`).
|
|
1547
|
+
* @default "automatic"
|
|
1548
|
+
*/
|
|
1549
|
+
activationMode?: "automatic" | "manual";
|
|
1550
|
+
/** Accessible label for the `role="tablist"` element (required). */
|
|
1551
|
+
ariaLabel: string;
|
|
1552
|
+
/** Additional className applied to the root wrapper element. */
|
|
1553
|
+
className?: string;
|
|
1554
|
+
/** Inline styles applied to the root wrapper element. */
|
|
1555
|
+
style?: CSSProperties;
|
|
1556
|
+
}
|
|
1557
|
+
declare const Tabs: react.ForwardRefExoticComponent<TabsProps & react.RefAttributes<HTMLDivElement>>;
|
|
1558
|
+
|
|
1559
|
+
/**
|
|
1560
|
+
* # Usage Audit - Table (DS-61, D-17-06..D-17-12)
|
|
1561
|
+
*
|
|
1562
|
+
* Compound API:
|
|
1563
|
+
* <Table.Root density="comfortable" sticky ariaLabel="Users">
|
|
1564
|
+
* <Table.Header>
|
|
1565
|
+
* <Table.Row>
|
|
1566
|
+
* <Table.SelectAllCell isAllSelected={isAll} isIndeterminate={isIndet} onToggleAll={toggleAll} />
|
|
1567
|
+
* <Table.HeaderCell
|
|
1568
|
+
* sortable
|
|
1569
|
+
* sortDir={sortCol === "name" ? sortDir : null}
|
|
1570
|
+
* onToggleSort={() => toggleSort("name")}
|
|
1571
|
+
* resizable
|
|
1572
|
+
* width={widths.name}
|
|
1573
|
+
* onResizeStart={(e) => startResize("name", e)}
|
|
1574
|
+
* >
|
|
1575
|
+
* Name
|
|
1576
|
+
* </Table.HeaderCell>
|
|
1577
|
+
* </Table.Row>
|
|
1578
|
+
* </Table.Header>
|
|
1579
|
+
* <Table.Body>
|
|
1580
|
+
* {sorted.map(row => (
|
|
1581
|
+
* <Table.Row key={row.id} selected={isSelected(row.id)}>
|
|
1582
|
+
* <Table.SelectCell selected={isSelected(row.id)} onToggle={() => toggle(row.id)} />
|
|
1583
|
+
* <Table.Cell>{row.name}</Table.Cell>
|
|
1584
|
+
* </Table.Row>
|
|
1585
|
+
* ))}
|
|
1586
|
+
* </Table.Body>
|
|
1587
|
+
* </Table.Root>
|
|
1588
|
+
* <Table.Pagination page={p} pageCount={n} onPageChange={setP} />
|
|
1589
|
+
*
|
|
1590
|
+
* Helper hooks:
|
|
1591
|
+
* useSortableTable - plan 17-10 (DS-61 part 1)
|
|
1592
|
+
* useTableSelection / useResizableColumns - plan 17-11 (DS-61 part 2)
|
|
1593
|
+
*
|
|
1594
|
+
* Sort indicator: UTF-8 ▲/▼ at ~9px monospace per D-17-07 (not Lucide icons).
|
|
1595
|
+
* Sticky: Table.Root sticky prop → data-sticky="true" → CSS position:sticky on thead.
|
|
1596
|
+
* Density: Table.Root density prop → data-density attr → CSS row-height variants.
|
|
1597
|
+
*/
|
|
1598
|
+
interface TableRootProps extends React.TableHTMLAttributes<HTMLTableElement> {
|
|
1599
|
+
/** Row height density mode. Default: "comfortable" (40px). */
|
|
1600
|
+
density?: "cozy" | "comfortable" | "spacious";
|
|
1601
|
+
/** When true, <thead> becomes position:sticky so the header stays visible on scroll. */
|
|
1602
|
+
sticky?: boolean;
|
|
1603
|
+
/** Accessible label for the table (renders as aria-label). */
|
|
1604
|
+
ariaLabel?: string;
|
|
1605
|
+
/** When true, sets aria-multiselectable="true" for multi-row selection (D-17-09). */
|
|
1606
|
+
multiSelectable?: boolean;
|
|
1607
|
+
}
|
|
1608
|
+
interface TableHeaderCellProps extends React.ThHTMLAttributes<HTMLTableCellElement> {
|
|
1609
|
+
/** Enables click-to-sort behaviour, keyboard activation, and aria-sort. */
|
|
1610
|
+
sortable?: boolean;
|
|
1611
|
+
/**
|
|
1612
|
+
* Current sort direction for this column.
|
|
1613
|
+
* null (or undefined) → unsorted → aria-sort="none", no chevron.
|
|
1614
|
+
*/
|
|
1615
|
+
sortDir?: "asc" | "desc" | null;
|
|
1616
|
+
/** Callback fired on click or Enter/Space keydown when sortable. */
|
|
1617
|
+
onToggleSort?: () => void;
|
|
1618
|
+
/** When true, renders a drag handle on the right edge for column resizing (D-17-10). */
|
|
1619
|
+
resizable?: boolean;
|
|
1620
|
+
/** Called on pointerdown of the resize handle. Wire to useResizableColumns.startResize. */
|
|
1621
|
+
onResizeStart?: (e: React.PointerEvent<HTMLSpanElement>) => void;
|
|
1622
|
+
/** When provided, sets the column width inline (used with useResizableColumns). */
|
|
1623
|
+
width?: number;
|
|
1624
|
+
}
|
|
1625
|
+
interface TableRowProps extends React.HTMLAttributes<HTMLTableRowElement> {
|
|
1626
|
+
/** When true, sets aria-selected + data-selected for CSS highlight (D-17-09). */
|
|
1627
|
+
selected?: boolean;
|
|
1628
|
+
}
|
|
1629
|
+
interface TableSelectAllCellProps extends React.ThHTMLAttributes<HTMLTableCellElement> {
|
|
1630
|
+
isAllSelected: boolean;
|
|
1631
|
+
isIndeterminate: boolean;
|
|
1632
|
+
onToggleAll: () => void;
|
|
1633
|
+
ariaLabel?: string;
|
|
1634
|
+
}
|
|
1635
|
+
interface TableSelectCellProps extends React.TdHTMLAttributes<HTMLTableCellElement> {
|
|
1636
|
+
selected: boolean;
|
|
1637
|
+
onToggle: () => void;
|
|
1638
|
+
ariaLabel?: string;
|
|
1639
|
+
}
|
|
1640
|
+
/**
|
|
1641
|
+
* Render `<Table.Pagination />` as a SIBLING of `<Table.Root>`, NOT as a child.
|
|
1642
|
+
* Pagination produces a `<nav>` element, and `<nav>` inside `<table>` (or any of
|
|
1643
|
+
* its descendants except `<caption>`) is invalid HTML - browsers will silently
|
|
1644
|
+
* hoist or strip it, and assistive tech may report inconsistent landmarks.
|
|
1645
|
+
*
|
|
1646
|
+
* GOOD:
|
|
1647
|
+
* <div>
|
|
1648
|
+
* <Table.Root>...</Table.Root>
|
|
1649
|
+
* <Table.Pagination page={p} pageCount={n} onPageChange={setP} />
|
|
1650
|
+
* </div>
|
|
1651
|
+
*
|
|
1652
|
+
* BAD:
|
|
1653
|
+
* <Table.Root>
|
|
1654
|
+
* <Table.Body>
|
|
1655
|
+
* <Table.Row><Table.Cell colSpan={5}>
|
|
1656
|
+
* <Table.Pagination ... /> // invalid: <nav> inside <table>
|
|
1657
|
+
* </Table.Cell></Table.Row>
|
|
1658
|
+
* </Table.Body>
|
|
1659
|
+
* </Table.Root>
|
|
1660
|
+
*
|
|
1661
|
+
* Demonstrated in the `PaginationOutsideTable` Storybook story.
|
|
1662
|
+
*/
|
|
1663
|
+
interface TablePaginationProps {
|
|
1664
|
+
page: number;
|
|
1665
|
+
pageCount: number;
|
|
1666
|
+
onPageChange: (page: number) => void;
|
|
1667
|
+
pageSize?: number;
|
|
1668
|
+
total?: number;
|
|
1669
|
+
ariaLabel?: string;
|
|
1670
|
+
className?: string;
|
|
1671
|
+
style?: React.CSSProperties;
|
|
1672
|
+
}
|
|
1673
|
+
/**
|
|
1674
|
+
* Table - compound primitive (DS-61, parts 1 + 2).
|
|
1675
|
+
*
|
|
1676
|
+
* Members: Table.Root, Table.Header, Table.HeaderCell, Table.Body, Table.Row, Table.Cell
|
|
1677
|
+
* Table.SelectAllCell, Table.SelectCell, Table.Pagination
|
|
1678
|
+
*
|
|
1679
|
+
* Important: render <Table.Pagination /> as a sibling of <Table.Root>, NOT a child.
|
|
1680
|
+
* <nav> inside <table> is invalid HTML. See TablePaginationProps JSDoc for details.
|
|
1681
|
+
*/
|
|
1682
|
+
declare const Table: {
|
|
1683
|
+
Root: react.ForwardRefExoticComponent<TableRootProps & react.RefAttributes<HTMLTableElement>>;
|
|
1684
|
+
Header: react.ForwardRefExoticComponent<react.HTMLAttributes<HTMLTableSectionElement> & react.RefAttributes<HTMLTableSectionElement>>;
|
|
1685
|
+
HeaderCell: react.ForwardRefExoticComponent<TableHeaderCellProps & react.RefAttributes<HTMLTableCellElement>>;
|
|
1686
|
+
Body: react.ForwardRefExoticComponent<react.HTMLAttributes<HTMLTableSectionElement> & react.RefAttributes<HTMLTableSectionElement>>;
|
|
1687
|
+
Row: react.ForwardRefExoticComponent<TableRowProps & react.RefAttributes<HTMLTableRowElement>>;
|
|
1688
|
+
Cell: react.ForwardRefExoticComponent<react.TdHTMLAttributes<HTMLTableCellElement> & react.RefAttributes<HTMLTableCellElement>>;
|
|
1689
|
+
SelectAllCell: react.ForwardRefExoticComponent<TableSelectAllCellProps & react.RefAttributes<HTMLTableCellElement>>;
|
|
1690
|
+
SelectCell: react.ForwardRefExoticComponent<TableSelectCellProps & react.RefAttributes<HTMLTableCellElement>>;
|
|
1691
|
+
Pagination: react.ForwardRefExoticComponent<TablePaginationProps & react.RefAttributes<HTMLElement>>;
|
|
1692
|
+
};
|
|
1693
|
+
|
|
1694
|
+
interface CalendarEvent {
|
|
1695
|
+
id: string;
|
|
1696
|
+
date: Date | string;
|
|
1697
|
+
endDate?: Date | string;
|
|
1698
|
+
label: string;
|
|
1699
|
+
color?: string;
|
|
1700
|
+
meta?: unknown;
|
|
1701
|
+
}
|
|
1702
|
+
interface CalendarProps {
|
|
1703
|
+
/** Array of events to display as chips on day cells. */
|
|
1704
|
+
events?: CalendarEvent[];
|
|
1705
|
+
/** Controlled active view; omit for uncontrolled. */
|
|
1706
|
+
view?: "month" | "week" | "day";
|
|
1707
|
+
/** Initial view when uncontrolled.
|
|
1708
|
+
* @default "month"
|
|
1709
|
+
*/
|
|
1710
|
+
defaultView?: "month" | "week" | "day";
|
|
1711
|
+
/** Called when the user switches views via the SegmentedControl. */
|
|
1712
|
+
onViewChange?: (v: "month" | "week" | "day") => void;
|
|
1713
|
+
/** Controlled selected date; highlighted in amber on the grid. */
|
|
1714
|
+
selectedDate?: Date | null;
|
|
1715
|
+
/** Called when a day cell is clicked with the clicked Date. */
|
|
1716
|
+
onSelectedDateChange?: (d: Date) => void;
|
|
1717
|
+
/** Day the week starts on: 0 = Sunday, 1 = Monday.
|
|
1718
|
+
* @default 1
|
|
1719
|
+
*/
|
|
1720
|
+
weekStart?: 0 | 1;
|
|
1721
|
+
/** Maximum event chips shown per day cell before a "+N more" overflow trigger.
|
|
1722
|
+
* @default 3
|
|
1723
|
+
*/
|
|
1724
|
+
maxVisibleEventsPerDay?: number;
|
|
1725
|
+
/**
|
|
1726
|
+
* Fixed height in px for the day-view time grid (the scrollable 24-hour area).
|
|
1727
|
+
* The all-day row above the grid is unaffected.
|
|
1728
|
+
* When omitted the grid expands to show all 24 hours.
|
|
1729
|
+
* @default 480
|
|
1730
|
+
*/
|
|
1731
|
+
dayViewHeight?: number;
|
|
1732
|
+
/** Accessible label for the calendar region.
|
|
1733
|
+
* @default "Calendar"
|
|
1734
|
+
*/
|
|
1735
|
+
ariaLabel?: string;
|
|
1736
|
+
/** Additional className applied to the root element. */
|
|
1737
|
+
className?: string;
|
|
1738
|
+
/** Inline styles applied to the root element. */
|
|
1739
|
+
style?: CSSProperties;
|
|
1740
|
+
}
|
|
1741
|
+
declare function AgendaList({ events, ariaLabel, }: {
|
|
1742
|
+
events: CalendarEvent[];
|
|
1743
|
+
ariaLabel?: string;
|
|
1744
|
+
}): react_jsx_runtime.JSX.Element;
|
|
1745
|
+
/**
|
|
1746
|
+
* Calendar primitive (DS-68).
|
|
1747
|
+
* Three views: month (default), week, day.
|
|
1748
|
+
* Compound: <Calendar.Agenda events={...} /> for consumer-rendered agenda list.
|
|
1749
|
+
*/
|
|
1750
|
+
declare const Calendar: react.ForwardRefExoticComponent<CalendarProps & react.RefAttributes<HTMLDivElement>> & {
|
|
1751
|
+
Agenda: typeof AgendaList;
|
|
1752
|
+
};
|
|
1753
|
+
|
|
1754
|
+
interface RichTextProps {
|
|
1755
|
+
/** Controlled HTML string (default) or TipTap JSON Doc object when `outputFormat="json"`. */
|
|
1756
|
+
value: string | object;
|
|
1757
|
+
/** Called on every editor change with the updated HTML string or JSON Doc. */
|
|
1758
|
+
onChange: (value: string | object) => void;
|
|
1759
|
+
/** Placeholder text shown in the empty editor surface. */
|
|
1760
|
+
placeholder?: string;
|
|
1761
|
+
/** When true, hides the toolbar and makes the editor non-editable.
|
|
1762
|
+
* @default false
|
|
1763
|
+
*/
|
|
1764
|
+
readOnly?: boolean;
|
|
1765
|
+
/** Output format emitted to `onChange`; `"html"` emits a string, `"json"` emits a TipTap Doc object.
|
|
1766
|
+
* @default "html"
|
|
1767
|
+
*/
|
|
1768
|
+
outputFormat?: "html" | "json";
|
|
1769
|
+
/** Replace the default toolbar with a custom ReactNode; pass `null` to suppress the toolbar entirely. */
|
|
1770
|
+
toolbar?: ReactNode;
|
|
1771
|
+
/** Additional className applied to the inner editor surface wrapper. */
|
|
1772
|
+
className?: string;
|
|
1773
|
+
/** Accessible label for the editor region.
|
|
1774
|
+
* @default "Rich text editor"
|
|
1775
|
+
*/
|
|
1776
|
+
ariaLabel?: string;
|
|
1777
|
+
/** Inline styles applied to the outer root wrapper. */
|
|
1778
|
+
style?: CSSProperties;
|
|
1779
|
+
}
|
|
1780
|
+
declare const RichText: react.ForwardRefExoticComponent<RichTextProps & react.RefAttributes<HTMLDivElement>>;
|
|
1781
|
+
|
|
1782
|
+
interface AppShellProps {
|
|
1783
|
+
/** Sidebar nav component - receives collapsed + onToggleCollapse via cloneElement */
|
|
1784
|
+
sidebar: ReactElement<{
|
|
1785
|
+
collapsed?: boolean;
|
|
1786
|
+
onToggleCollapse?: () => void;
|
|
1787
|
+
}>;
|
|
1788
|
+
/** Topbar component (AppBar DS-72 or any ReactNode) */
|
|
1789
|
+
topbar: ReactNode;
|
|
1790
|
+
/** Main page content */
|
|
1791
|
+
main: ReactNode;
|
|
1792
|
+
/** Optional footer (DS-73 or any ReactNode) */
|
|
1793
|
+
footer?: ReactNode;
|
|
1794
|
+
/**
|
|
1795
|
+
* localStorage key for sidebar collapse persistence.
|
|
1796
|
+
* Pass null to disable persistence.
|
|
1797
|
+
* @default "ds-sidebar-collapsed"
|
|
1798
|
+
*/
|
|
1799
|
+
storageKey?: string | null;
|
|
1800
|
+
/**
|
|
1801
|
+
* Expanded sidebar width in pixels.
|
|
1802
|
+
* @default 240
|
|
1803
|
+
*/
|
|
1804
|
+
sidebarWidth?: number;
|
|
1805
|
+
className?: string;
|
|
1806
|
+
style?: CSSProperties;
|
|
1807
|
+
}
|
|
1808
|
+
/**
|
|
1809
|
+
* AppShell (DS-71) - top-level CSS Grid layout primitive.
|
|
1810
|
+
*
|
|
1811
|
+
* Slots: topbar (sticky header), sidebar (collapsible icon rail), main (scrollable content),
|
|
1812
|
+
* footer (optional bottom bar).
|
|
1813
|
+
*
|
|
1814
|
+
* The sidebar slot child receives `collapsed` and `onToggleCollapse` injected via
|
|
1815
|
+
* React.cloneElement - no extra context or ref needed.
|
|
1816
|
+
*/
|
|
1817
|
+
declare const AppShell: react__default.ForwardRefExoticComponent<AppShellProps & react__default.RefAttributes<HTMLDivElement>>;
|
|
1818
|
+
|
|
1819
|
+
type AppBarVariant = "minimal" | "withSearch" | "default" | "centered";
|
|
1820
|
+
interface AppBarProps {
|
|
1821
|
+
/** Visual variant. @default "default" */
|
|
1822
|
+
variant?: AppBarVariant;
|
|
1823
|
+
/** When true, applies frosted-glass background + shadow. Consumer drives via scroll listener. @default false */
|
|
1824
|
+
scrolled?: boolean;
|
|
1825
|
+
/** Custom logo content. If omitted, renders a default ink box with "DS" label. */
|
|
1826
|
+
logo?: ReactNode;
|
|
1827
|
+
/** Nav links slot (default + centered variants). */
|
|
1828
|
+
nav?: ReactNode;
|
|
1829
|
+
/** Right-side actions slot (avatar, notifications, etc.). */
|
|
1830
|
+
actions?: ReactNode;
|
|
1831
|
+
/** Callback fired when the search input value changes (withSearch variant). */
|
|
1832
|
+
onSearchChange?: (value: string) => void;
|
|
1833
|
+
/** Placeholder for the search input. @default "Search..." */
|
|
1834
|
+
searchPlaceholder?: string;
|
|
1835
|
+
className?: string;
|
|
1836
|
+
style?: CSSProperties;
|
|
1837
|
+
}
|
|
1838
|
+
/**
|
|
1839
|
+
* AppBar - DS-72
|
|
1840
|
+
*
|
|
1841
|
+
* Standalone sticky topbar primitive. Pass as the `topbar` slot to AppShell (DS-71).
|
|
1842
|
+
* Provides 4 variants: minimal, withSearch, default, centered.
|
|
1843
|
+
* Consumer-driven `scrolled` prop applies frosted-glass background + shadow transition.
|
|
1844
|
+
*/
|
|
1845
|
+
declare const AppBar: react.ForwardRefExoticComponent<AppBarProps & react.RefAttributes<HTMLElement>>;
|
|
1846
|
+
|
|
1847
|
+
type FooterVariant = "compact" | "expanded";
|
|
1848
|
+
interface FooterColumn {
|
|
1849
|
+
title: string;
|
|
1850
|
+
links: Array<{
|
|
1851
|
+
label: string;
|
|
1852
|
+
href?: string;
|
|
1853
|
+
onClick?: () => void;
|
|
1854
|
+
}>;
|
|
1855
|
+
}
|
|
1856
|
+
interface FooterProps {
|
|
1857
|
+
/** Visual variant. @default "compact" */
|
|
1858
|
+
variant?: FooterVariant;
|
|
1859
|
+
/** Copyright line text. @default "© 2026 - All rights reserved" */
|
|
1860
|
+
copyright?: string;
|
|
1861
|
+
/** Compact variant: right-side link row. */
|
|
1862
|
+
links?: Array<{
|
|
1863
|
+
label: string;
|
|
1864
|
+
href?: string;
|
|
1865
|
+
onClick?: () => void;
|
|
1866
|
+
}>;
|
|
1867
|
+
/** Expanded variant: array of column definitions (4 columns recommended). */
|
|
1868
|
+
columns?: FooterColumn[];
|
|
1869
|
+
className?: string;
|
|
1870
|
+
style?: CSSProperties;
|
|
1871
|
+
}
|
|
1872
|
+
/**
|
|
1873
|
+
* Footer - DS-73
|
|
1874
|
+
*
|
|
1875
|
+
* Standalone page footer primitive. Pass as the `footer` slot to AppShell (DS-71).
|
|
1876
|
+
* - `compact`: 1-line bar with copyright + utility links.
|
|
1877
|
+
* - `expanded`: 4-column marketing footer with column titles + links + bottom copyright row.
|
|
1878
|
+
*/
|
|
1879
|
+
declare const Footer: react.ForwardRefExoticComponent<FooterProps & react.RefAttributes<HTMLElement>>;
|
|
1880
|
+
|
|
1881
|
+
interface PasswordStrengthProps {
|
|
1882
|
+
/** 0=empty, 1=weak, 2=fair, 3=good, 4=strong */
|
|
1883
|
+
score: 0 | 1 | 2 | 3 | 4;
|
|
1884
|
+
className?: string;
|
|
1885
|
+
style?: CSSProperties;
|
|
1886
|
+
}
|
|
1887
|
+
declare function PasswordStrength({ score, className, style }: PasswordStrengthProps): react_jsx_runtime.JSX.Element;
|
|
1888
|
+
interface FieldErrorProps {
|
|
1889
|
+
message?: string | null;
|
|
1890
|
+
className?: string;
|
|
1891
|
+
}
|
|
1892
|
+
declare function FieldError({ message, className }: FieldErrorProps): react_jsx_runtime.JSX.Element | null;
|
|
1893
|
+
interface FormErrorSummaryProps {
|
|
1894
|
+
errors: string[];
|
|
1895
|
+
/** @default "Please fix the following errors:" */
|
|
1896
|
+
title?: string;
|
|
1897
|
+
className?: string;
|
|
1898
|
+
}
|
|
1899
|
+
declare function FormErrorSummary({ errors, title, className, }: FormErrorSummaryProps): react_jsx_runtime.JSX.Element | null;
|
|
1900
|
+
|
|
1901
|
+
interface CoachmarkProps {
|
|
1902
|
+
/** Ref to the element being highlighted */
|
|
1903
|
+
anchorRef: RefObject<HTMLElement | null>;
|
|
1904
|
+
title: string;
|
|
1905
|
+
desc?: string;
|
|
1906
|
+
/** Current step number (1-based) */
|
|
1907
|
+
step?: number;
|
|
1908
|
+
/** Total steps in the coachmark sequence */
|
|
1909
|
+
total?: number;
|
|
1910
|
+
onNext?: () => void;
|
|
1911
|
+
onDone?: () => void;
|
|
1912
|
+
/**
|
|
1913
|
+
* localStorage key for persist-dismiss state.
|
|
1914
|
+
* Omit or pass null to disable persistence.
|
|
1915
|
+
*/
|
|
1916
|
+
storageKey?: string | null;
|
|
1917
|
+
placement?: "bottom-start" | "bottom-end" | "top-start" | "top-end";
|
|
1918
|
+
}
|
|
1919
|
+
declare function Coachmark({ anchorRef, title, desc, step, total, onNext, onDone, storageKey, placement, }: CoachmarkProps): react_jsx_runtime.JSX.Element;
|
|
1920
|
+
|
|
1921
|
+
interface WizardStep {
|
|
1922
|
+
label: string;
|
|
1923
|
+
desc?: string;
|
|
1924
|
+
/** Return error string to block advance; return null/undefined to proceed. */
|
|
1925
|
+
validate?: () => string | null | undefined;
|
|
1926
|
+
}
|
|
1927
|
+
interface WizardProps {
|
|
1928
|
+
steps: WizardStep[];
|
|
1929
|
+
onComplete: () => void;
|
|
1930
|
+
onCancel?: () => void;
|
|
1931
|
+
/** @default "horizontal" */
|
|
1932
|
+
orientation?: "horizontal" | "vertical";
|
|
1933
|
+
children: ReactNode | ((step: number) => ReactNode);
|
|
1934
|
+
}
|
|
1935
|
+
/**
|
|
1936
|
+
* Wizard - multi-step form scaffold (DS-74).
|
|
1937
|
+
*
|
|
1938
|
+
* <Wizard steps={steps} onComplete={handleFinish}>
|
|
1939
|
+
* {(step) => <StepContent step={step} />}
|
|
1940
|
+
* </Wizard>
|
|
1941
|
+
*
|
|
1942
|
+
* Renders a horizontal (or vertical) stepper, a ProgressBar, step content,
|
|
1943
|
+
* optional inline validation error, and Back/Next navigation - all within a
|
|
1944
|
+
* single focus-trapped container.
|
|
1945
|
+
*
|
|
1946
|
+
* Per-step validation: attach `validate()` to a WizardStep; returning a
|
|
1947
|
+
* non-empty string blocks advance and surfaces the error inline.
|
|
1948
|
+
* Thrown exceptions are caught and treated as validation failures
|
|
1949
|
+
* (threat T-18-04-02).
|
|
1950
|
+
*
|
|
1951
|
+
* Does NOT wrap content in a <form> - step fields are the consumer's
|
|
1952
|
+
* responsibility. Wizard manages step state only.
|
|
1953
|
+
*/
|
|
1954
|
+
declare function Wizard({ steps, onComplete, onCancel, orientation, children }: WizardProps): react_jsx_runtime.JSX.Element;
|
|
1955
|
+
|
|
1956
|
+
interface InlineEditProps {
|
|
1957
|
+
/** Current display value. */
|
|
1958
|
+
value: string;
|
|
1959
|
+
/**
|
|
1960
|
+
* Called with the new value when the user commits (Enter key or blur).
|
|
1961
|
+
* Return a Promise to trigger the saving state. If the Promise rejects,
|
|
1962
|
+
* the component enters error state with the rejection message.
|
|
1963
|
+
*/
|
|
1964
|
+
onSave: (value: string) => Promise<void> | void;
|
|
1965
|
+
/** When true, renders a textarea instead of a single-line input.
|
|
1966
|
+
* @default false
|
|
1967
|
+
*/
|
|
1968
|
+
multiline?: boolean;
|
|
1969
|
+
/** Placeholder shown in idle state when value is empty. */
|
|
1970
|
+
placeholder?: string;
|
|
1971
|
+
/** When true, the idle span is not clickable (no editing allowed).
|
|
1972
|
+
* @default false
|
|
1973
|
+
*/
|
|
1974
|
+
disabled?: boolean;
|
|
1975
|
+
className?: string;
|
|
1976
|
+
style?: CSSProperties;
|
|
1977
|
+
}
|
|
1978
|
+
/**
|
|
1979
|
+
* InlineEdit (DS-77) - click-to-edit pattern with optimistic save + error recovery.
|
|
1980
|
+
*
|
|
1981
|
+
* State machine:
|
|
1982
|
+
* idle → click / Enter / Space → editing
|
|
1983
|
+
* editing → Enter → saving
|
|
1984
|
+
* editing → Escape / blur → idle (restored original)
|
|
1985
|
+
* saving → onSave resolves → idle
|
|
1986
|
+
* saving → onSave rejects → error (input re-enabled with last draft)
|
|
1987
|
+
* error → Escape / blur → idle (restored original)
|
|
1988
|
+
* error → Enter → saving (retry)
|
|
1989
|
+
*
|
|
1990
|
+
* Blur always cancels (reverts), matching the handoff spec for click-to-edit
|
|
1991
|
+
* in table cells and inline fields.
|
|
1992
|
+
*/
|
|
1993
|
+
declare function InlineEdit({ value, onSave, multiline, placeholder, disabled, className, style, }: InlineEditProps): react_jsx_runtime.JSX.Element;
|
|
1994
|
+
|
|
1995
|
+
interface SearchFilter {
|
|
1996
|
+
id: string;
|
|
1997
|
+
label: string;
|
|
1998
|
+
tone?: "default" | "match" | "miss" | "learning" | "tag";
|
|
1999
|
+
}
|
|
2000
|
+
interface SearchSuggestion {
|
|
2001
|
+
id: string;
|
|
2002
|
+
label: string;
|
|
2003
|
+
}
|
|
2004
|
+
interface SearchAndFiltersProps {
|
|
2005
|
+
/** Controlled value for the search input. */
|
|
2006
|
+
value?: string;
|
|
2007
|
+
/** Placeholder text for the search input.
|
|
2008
|
+
* @default "Search..."
|
|
2009
|
+
*/
|
|
2010
|
+
placeholder?: string;
|
|
2011
|
+
/**
|
|
2012
|
+
* Suggestions shown in the DSDropdown autocomplete when the input is
|
|
2013
|
+
* focused and has a value. Consumer is responsible for filtering.
|
|
2014
|
+
*/
|
|
2015
|
+
suggestions?: SearchSuggestion[];
|
|
2016
|
+
/** Filter chips shown below the search input. */
|
|
2017
|
+
activeFilters?: SearchFilter[];
|
|
2018
|
+
/** Called on every keystroke with the current search string. */
|
|
2019
|
+
onSearch?: (value: string) => void;
|
|
2020
|
+
/** Called when a suggestion is selected from the dropdown. */
|
|
2021
|
+
onSuggestionSelect?: (suggestion: SearchSuggestion) => void;
|
|
2022
|
+
/** Called when a filter chip × button is clicked. */
|
|
2023
|
+
onFilterRemove?: (filter: SearchFilter) => void;
|
|
2024
|
+
/** Called when the "Clear all" button is clicked. */
|
|
2025
|
+
onClearFilters?: () => void;
|
|
2026
|
+
className?: string;
|
|
2027
|
+
style?: CSSProperties;
|
|
2028
|
+
}
|
|
2029
|
+
/**
|
|
2030
|
+
* SearchAndFilters (DS-78) - search input with DSDropdown autocomplete + Chip filter tokens.
|
|
2031
|
+
*
|
|
2032
|
+
* Composes:
|
|
2033
|
+
* - DSDropdown (_internals/DSDropdown) for the suggestions overlay
|
|
2034
|
+
* - Chip (Chip.tsx) for each active filter token
|
|
2035
|
+
*
|
|
2036
|
+
* Usage:
|
|
2037
|
+
* ```tsx
|
|
2038
|
+
* <SearchAndFilters
|
|
2039
|
+
* suggestions={filteredSuggestions}
|
|
2040
|
+
* activeFilters={activeFilters}
|
|
2041
|
+
* onSearch={setQuery}
|
|
2042
|
+
* onSuggestionSelect={(s) => addFilter({ id: s.id, label: s.label })}
|
|
2043
|
+
* onFilterRemove={(f) => removeFilter(f.id)}
|
|
2044
|
+
* onClearFilters={clearAllFilters}
|
|
2045
|
+
* />
|
|
2046
|
+
* ```
|
|
2047
|
+
*/
|
|
2048
|
+
declare function SearchAndFilters({ value, placeholder, suggestions, activeFilters, onSearch, onSuggestionSelect, onFilterRemove, onClearFilters, className, style, }: SearchAndFiltersProps): react_jsx_runtime.JSX.Element;
|
|
2049
|
+
|
|
2050
|
+
interface SortableItemData {
|
|
2051
|
+
id: string;
|
|
2052
|
+
[key: string]: unknown;
|
|
2053
|
+
}
|
|
2054
|
+
interface SortableProps {
|
|
2055
|
+
/** Array of items; each must have a unique `id` string */
|
|
2056
|
+
items: SortableItemData[];
|
|
2057
|
+
/** Called after a successful drag-and-drop reorder with the new items array */
|
|
2058
|
+
onReorder: (items: SortableItemData[]) => void;
|
|
2059
|
+
/** Render each item's content */
|
|
2060
|
+
renderItem: (item: SortableItemData, index: number) => ReactNode;
|
|
2061
|
+
/** Stable list identifier - required when used inside SortableDndContext */
|
|
2062
|
+
id?: string;
|
|
2063
|
+
className?: string;
|
|
2064
|
+
style?: React.CSSProperties;
|
|
2065
|
+
}
|
|
2066
|
+
interface SortableItemProps {
|
|
2067
|
+
id: string;
|
|
2068
|
+
children: ReactNode;
|
|
2069
|
+
reducedMotion: boolean;
|
|
2070
|
+
}
|
|
2071
|
+
interface SortableDndContextProps {
|
|
2072
|
+
children: ReactNode;
|
|
2073
|
+
/**
|
|
2074
|
+
* Called when an item moves between two lists.
|
|
2075
|
+
* @param activeId - id of the dragged item
|
|
2076
|
+
* @param overId - id of the item it was dropped over
|
|
2077
|
+
* @param activeListId - `id` prop of the source Sortable
|
|
2078
|
+
* @param overListId - `id` prop of the destination Sortable
|
|
2079
|
+
*/
|
|
2080
|
+
onMove: (activeId: UniqueIdentifier, overId: UniqueIdentifier, activeListId: string | undefined, overListId: string | undefined) => void;
|
|
2081
|
+
/**
|
|
2082
|
+
* Renders the drag overlay card when an item is being dragged across lists.
|
|
2083
|
+
* Receives the active item id. If omitted, a ghost placeholder is shown.
|
|
2084
|
+
*/
|
|
2085
|
+
renderOverlay?: (activeId: UniqueIdentifier) => ReactNode;
|
|
2086
|
+
}
|
|
2087
|
+
declare function SortableItem({ id, children, reducedMotion }: SortableItemProps): react_jsx_runtime.JSX.Element;
|
|
2088
|
+
declare function SortableDndContext({ children, onMove, renderOverlay }: SortableDndContextProps): react_jsx_runtime.JSX.Element;
|
|
2089
|
+
declare function Sortable({ items, onReorder, renderItem, id, className, style }: SortableProps): react_jsx_runtime.JSX.Element;
|
|
2090
|
+
|
|
2091
|
+
export { Accordion, type AccordionItemProps, type AccordionProps, AlertBanner, type AlertBannerProps, type AlertBannerTone, AppBar, type AppBarProps, type AppBarVariant, AppShell, type AppShellProps, Autocomplete, type AutocompleteProps, Avatar, type AvatarPresence, type AvatarPresencePosition, type AvatarProps, type AvatarSize, AvatarStack, type AvatarStackProps, Badge, type BadgeProps, type BadgeTone, BottomSheet, type BottomSheetHeight, type BottomSheetProps, type BreadcrumbItem, Breadcrumbs, type BreadcrumbsProps, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Calendar, type CalendarEvent, type CalendarProps, Card, type CardProps, type CardVariant, Carousel, type CarouselProps, type CarouselSlide, Checkbox, type CheckboxProps, Chip, type ChipProps, type ChipTone, Coachmark, type CoachmarkProps, ConfirmDialog, type ConfirmDialogProps, ContextMenu, type ContextMenuItem, type ContextMenuProps, CopyToClipboard, type CopyToClipboardProps, DSPortal, type DSPortalProps, DatePicker, type DatePickerProps, type DateRange, DateRangePicker, type DateRangePickerProps, EmptyState, type EmptyStateProps, FieldError, type FieldErrorProps, Footer, type FooterColumn, type FooterProps, type FooterVariant, FormErrorSummary, type FormErrorSummaryProps, HoverCard, type HoverCardPlacement, type HoverCardProps, InfiniteList, type InfiniteListProps, InlineConfirm, type InlineConfirmProps, type InlineConfirmTriggerProps, InlineEdit, type InlineEditProps, Lightbox, type LightboxItem, type LightboxProps, Modal, type ModalProps, type ModalRole, MultiSelect, type MultiSelectOption, type MultiSelectProps, NumberStepper, type NumberStepperProps, PasswordStrength, type PasswordStrengthProps, Popover, type PopoverPlacement, type PopoverProps, type PopoverVariant, ProgressBar, type ProgressBarProps, Radio, RadioGroup, type RadioGroupProps, type RadioProps, RangeSlider, type RangeSliderProps, RichText, type RichTextProps, RollingNumber, type RollingNumberProps, SearchAndFilters, type SearchAndFiltersProps, type SearchFilter, type SearchSuggestion, SegmentedControl, type SegmentedControlProps, type SegmentedOption, Select, type SelectOption, type SelectProps, Sheet, type SheetProps, type SheetSide, Skeleton, type SkeletonProps, type SkeletonShape, Sortable, SortableDndContext, type SortableDndContextProps, SortableItem, type SortableItemData, type SortableItemProps, type SortableProps, SplitButton, type SplitButtonAction, type SplitButtonProps, StarRating, type StarRatingProps, type StarRatingSize, StickyNote, type StickyNoteProps, type StickyNoteRotation, type TabItem, Table, type TableHeaderCellProps, type TableRootProps, Tabs, type TabsProps, TextInput, type TextInputProps, Textarea, type TextareaProps, Timeline, type TimelineEvent, type TimelineProps, type ToastOptions, ToastProvider, type ToastProviderProps, type ToastTone, Toggle, type ToggleProps, Tooltip, type TooltipPlacement, type TooltipProps, Wizard, type WizardProps, type WizardStep, deriveGradient, deriveInitials, useToast };
|