@astherix/ui 0.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +933 -0
- package/dist/chunk-IZEGCTZW.js +588 -0
- package/dist/chunk-IZEGCTZW.js.map +1 -0
- package/dist/cli.js +345 -0
- package/dist/controlStyles-Bco2sOHE.d.ts +4 -0
- package/dist/editor.d.ts +43 -0
- package/dist/editor.js +373 -0
- package/dist/editor.js.map +1 -0
- package/dist/index.d.ts +2470 -0
- package/dist/index.js +10582 -0
- package/dist/index.js.map +1 -0
- package/dist/theme.d.ts +78 -0
- package/dist/theme.js +287 -0
- package/dist/theme.js.map +1 -0
- package/package.json +69 -0
- package/theme.css +909 -0
- package/ui.theme.schema.json +462 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,2470 @@
|
|
|
1
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
|
4
|
+
import { ClassValue } from 'clsx';
|
|
5
|
+
import { a as ControlSize, C as ControlRounded } from './controlStyles-Bco2sOHE.js';
|
|
6
|
+
|
|
7
|
+
declare const buttonVariants: (props?: ({
|
|
8
|
+
variant?: "primary" | "secondary" | "ghost" | "danger" | null | undefined;
|
|
9
|
+
raised?: boolean | null | undefined;
|
|
10
|
+
shadow?: "none" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
11
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
12
|
+
rounded?: "none" | "sm" | "md" | "lg" | "full" | null | undefined;
|
|
13
|
+
iconOnly?: boolean | null | undefined;
|
|
14
|
+
fullWidth?: boolean | null | undefined;
|
|
15
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
16
|
+
interface ButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "onClick">, VariantProps<typeof buttonVariants> {
|
|
17
|
+
/**
|
|
18
|
+
* Click handler. Return a Promise (e.g. from fetch or axios) and the button
|
|
19
|
+
* shows its spinner until the Promise settles — no loading state to manage.
|
|
20
|
+
*/
|
|
21
|
+
onClick?: (event: React.MouseEvent<HTMLButtonElement>) => unknown;
|
|
22
|
+
/**
|
|
23
|
+
* Render the child element instead of a <button>, keeping the button styles.
|
|
24
|
+
* Use it for links: <Button asChild><Link href="/x">Open</Link></Button>
|
|
25
|
+
*/
|
|
26
|
+
asChild?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Show the spinner on demand. Use it with state you already have, such as
|
|
29
|
+
* Inertia's `form.processing` or React's `isPending` from useTransition.
|
|
30
|
+
*/
|
|
31
|
+
loading?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Where the spinner appears while loading.
|
|
34
|
+
* - "center": replaces the label (the button keeps its width)
|
|
35
|
+
* - "start" / "end": appears beside the label; takes the icon's place if there is one
|
|
36
|
+
*/
|
|
37
|
+
spinnerPlacement?: "center" | "start" | "end";
|
|
38
|
+
/**
|
|
39
|
+
* How loading is shown.
|
|
40
|
+
* - "spinner": a spinning icon (default)
|
|
41
|
+
* - "orbit": experimental — a light runs around the button's edge and the label stays visible
|
|
42
|
+
* - "progress": experimental — a progress fill or bar; the label stays visible
|
|
43
|
+
*/
|
|
44
|
+
loadingIndicator?: "spinner" | "orbit" | "progress";
|
|
45
|
+
/**
|
|
46
|
+
* With loadingIndicator="progress":
|
|
47
|
+
* - "fill": a translucent fill sweeps across the button from left to right (default)
|
|
48
|
+
* - "bar": a thin bar runs along the bottom edge
|
|
49
|
+
*/
|
|
50
|
+
progressStyle?: "fill" | "bar";
|
|
51
|
+
/**
|
|
52
|
+
* With loadingIndicator="progress": the real progress, 0–100 (e.g. from an upload).
|
|
53
|
+
* Leave it out and the progress creeps forward on its own until the work finishes.
|
|
54
|
+
*/
|
|
55
|
+
progress?: number;
|
|
56
|
+
/** Label shown while loading, e.g. "Saving…". Used with "start"/"end" placement, "orbit" and "progress". */
|
|
57
|
+
loadingLabel?: React.ReactNode;
|
|
58
|
+
/**
|
|
59
|
+
* Keep the spinner visible for at least this many milliseconds, so very fast
|
|
60
|
+
* requests don't cause a flicker. Applies to Promise-based loading. Default 0.
|
|
61
|
+
*/
|
|
62
|
+
minLoadingTime?: number;
|
|
63
|
+
/**
|
|
64
|
+
* Icon shown before the label. Pass an element (<DownloadIcon />) or an
|
|
65
|
+
* icon-font class string, e.g. "bi bi-download" or "fa-solid fa-download".
|
|
66
|
+
*/
|
|
67
|
+
leadingIcon?: IconInput;
|
|
68
|
+
/** Icon shown after the label. Same options as `leadingIcon`. */
|
|
69
|
+
trailingIcon?: IconInput;
|
|
70
|
+
/**
|
|
71
|
+
* The icon for an icon-only button (use with `iconOnly` and an `aria-label`).
|
|
72
|
+
* Same options as `leadingIcon`; used instead of children.
|
|
73
|
+
*/
|
|
74
|
+
icon?: IconInput;
|
|
75
|
+
}
|
|
76
|
+
/** An icon element, or a class string for an icon font. */
|
|
77
|
+
type IconInput = React.ReactNode | string;
|
|
78
|
+
/** Turns an icon-font class string into an <i>; passes elements through. */
|
|
79
|
+
declare function renderIcon(icon: IconInput): number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
|
|
80
|
+
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
81
|
+
|
|
82
|
+
/** Merge class names, letting later Tailwind classes override earlier ones. */
|
|
83
|
+
declare function cn(...inputs: ClassValue[]): string;
|
|
84
|
+
|
|
85
|
+
interface ModalProps {
|
|
86
|
+
/** Controlled open state. Pair with `onOpenChange`. */
|
|
87
|
+
open?: boolean;
|
|
88
|
+
/** Initial open state when uncontrolled. */
|
|
89
|
+
defaultOpen?: boolean;
|
|
90
|
+
/** Called whenever the modal asks to open or close (trigger, close button, Escape, backdrop). */
|
|
91
|
+
onOpenChange?: (open: boolean) => void;
|
|
92
|
+
children: React.ReactNode;
|
|
93
|
+
}
|
|
94
|
+
declare function Modal({ open: openProp, defaultOpen, onOpenChange, children }: ModalProps): React.JSX.Element;
|
|
95
|
+
/**
|
|
96
|
+
* Open and close a modal from anywhere in your component.
|
|
97
|
+
*
|
|
98
|
+
* const confirm = useModal();
|
|
99
|
+
* <Modal {...confirm.modalProps}>…</Modal>
|
|
100
|
+
* confirm.open();
|
|
101
|
+
*/
|
|
102
|
+
declare function useModal(initialOpen?: boolean): {
|
|
103
|
+
isOpen: boolean;
|
|
104
|
+
open: () => void;
|
|
105
|
+
close: () => void;
|
|
106
|
+
toggle: () => void;
|
|
107
|
+
/** Spread onto <Modal>. */
|
|
108
|
+
modalProps: {
|
|
109
|
+
open: boolean;
|
|
110
|
+
onOpenChange: React.Dispatch<React.SetStateAction<boolean>>;
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
declare const ModalTrigger: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
114
|
+
/** Merge behavior into your own element, e.g. <ModalTrigger asChild><Button>…</Button></ModalTrigger>. */
|
|
115
|
+
asChild?: boolean;
|
|
116
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
117
|
+
declare const ModalClose: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
118
|
+
/** Merge behavior into your own element, e.g. <ModalTrigger asChild><Button>…</Button></ModalTrigger>. */
|
|
119
|
+
asChild?: boolean;
|
|
120
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
121
|
+
declare const backdropClasses: {
|
|
122
|
+
readonly default: "backdrop:bg-[var(--ui-backdrop,rgb(18_20_24/0.5))]";
|
|
123
|
+
readonly dark: "backdrop:bg-[var(--ui-backdrop-dark,rgb(8_10_13/0.82))]";
|
|
124
|
+
readonly blur: "backdrop:bg-[var(--ui-backdrop-blur,rgb(18_20_24/0.22))] backdrop:backdrop-blur-[var(--ui-backdrop-blur-radius,8px)]";
|
|
125
|
+
readonly solid: "backdrop:bg-[var(--ui-backdrop-solid,#f6f7f9)]";
|
|
126
|
+
};
|
|
127
|
+
type ModalBackdrop = keyof typeof backdropClasses;
|
|
128
|
+
declare const modalPanelVariants: (props?: ({
|
|
129
|
+
size?: "sm" | "md" | "lg" | "xl" | "full" | null | undefined;
|
|
130
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
131
|
+
interface ModalContentProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof modalPanelVariants> {
|
|
132
|
+
/**
|
|
133
|
+
* Whether Escape, a backdrop click and the × button close the modal. Set false
|
|
134
|
+
* while something is saving, or when the person must choose an action.
|
|
135
|
+
*/
|
|
136
|
+
dismissible?: boolean;
|
|
137
|
+
/**
|
|
138
|
+
* How the page behind the modal is covered.
|
|
139
|
+
* - "default": dimmed
|
|
140
|
+
* - "dark": heavily darkened
|
|
141
|
+
* - "blur": lightly dimmed and blurred
|
|
142
|
+
* - "solid": fully covered with the page background color, so nothing behind shows
|
|
143
|
+
*/
|
|
144
|
+
backdrop?: ModalBackdrop;
|
|
145
|
+
/** Show the × button in the top-right corner. */
|
|
146
|
+
showCloseButton?: boolean;
|
|
147
|
+
/** Accessible label for the × button. */
|
|
148
|
+
closeLabel?: string;
|
|
149
|
+
}
|
|
150
|
+
declare const ModalContent: React.ForwardRefExoticComponent<ModalContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
151
|
+
declare const ModalHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
152
|
+
declare const ModalTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLHeadingElement>>;
|
|
153
|
+
declare const ModalDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
154
|
+
declare const ModalBody: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
155
|
+
declare const ModalFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
156
|
+
|
|
157
|
+
type FieldContextValue = {
|
|
158
|
+
id: string;
|
|
159
|
+
labelId: string;
|
|
160
|
+
descriptionId?: string;
|
|
161
|
+
errorId?: string;
|
|
162
|
+
invalid: boolean;
|
|
163
|
+
required: boolean;
|
|
164
|
+
disabled: boolean;
|
|
165
|
+
};
|
|
166
|
+
/** Read the surrounding Field's ids and state (returns null outside a Field). */
|
|
167
|
+
declare function useField(): FieldContextValue | null;
|
|
168
|
+
interface FieldProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children"> {
|
|
169
|
+
/** The visible label. */
|
|
170
|
+
label: React.ReactNode;
|
|
171
|
+
/** Help text under the label. */
|
|
172
|
+
description?: React.ReactNode;
|
|
173
|
+
/** Error message. When set, the control is marked invalid. */
|
|
174
|
+
error?: React.ReactNode;
|
|
175
|
+
/** Marks the control as required and shows an asterisk. */
|
|
176
|
+
required?: boolean;
|
|
177
|
+
/** Shows "(optional)" after the label. Use it instead of `required` when most fields are required. */
|
|
178
|
+
optional?: boolean;
|
|
179
|
+
disabled?: boolean;
|
|
180
|
+
/** Use your own id for the control. */
|
|
181
|
+
id?: string;
|
|
182
|
+
children: React.ReactNode;
|
|
183
|
+
}
|
|
184
|
+
declare function Field({ label, description, error, required, optional, disabled, id: idProp, className, children, ...props }: FieldProps): React.JSX.Element;
|
|
185
|
+
|
|
186
|
+
interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "prefix"> {
|
|
187
|
+
/** Height matches Button sizes, so inputs and buttons line up in a row. */
|
|
188
|
+
size?: ControlSize;
|
|
189
|
+
rounded?: ControlRounded;
|
|
190
|
+
/** Icon before the text: an element or an icon-font class string. */
|
|
191
|
+
leadingIcon?: IconInput;
|
|
192
|
+
/** Icon after the text: an element or an icon-font class string. */
|
|
193
|
+
trailingIcon?: IconInput;
|
|
194
|
+
/** Fixed text before the value, e.g. "https://" or "$". */
|
|
195
|
+
prefix?: React.ReactNode;
|
|
196
|
+
/** Fixed text after the value, e.g. "kg" or "@example.com". */
|
|
197
|
+
suffix?: React.ReactNode;
|
|
198
|
+
/** Marks the input as invalid. Inside a Field with an error this is set for you. */
|
|
199
|
+
invalid?: boolean;
|
|
200
|
+
/** Show a clear (×) button when the input has a value. */
|
|
201
|
+
clearable?: boolean;
|
|
202
|
+
/** Called after the clear button empties the input. */
|
|
203
|
+
onClear?: () => void;
|
|
204
|
+
/** For type="password": show a button that reveals the password. Default true. */
|
|
205
|
+
revealable?: boolean;
|
|
206
|
+
/** Class for the outer frame. `className` goes on the <input> itself. */
|
|
207
|
+
frameClassName?: string;
|
|
208
|
+
/** Content layered exactly over the text box (same font and position), e.g. an inline completion. */
|
|
209
|
+
overlay?: React.ReactNode;
|
|
210
|
+
}
|
|
211
|
+
declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
212
|
+
|
|
213
|
+
interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
214
|
+
size?: ControlSize;
|
|
215
|
+
/** Corner radius. "full" isn't offered — it doesn't suit multi-line text. */
|
|
216
|
+
rounded?: Exclude<ControlRounded, "full">;
|
|
217
|
+
/** Marks the textarea as invalid. Inside a Field with an error this is set for you. */
|
|
218
|
+
invalid?: boolean;
|
|
219
|
+
/** Grow and shrink with the text, between minRows and maxRows. */
|
|
220
|
+
autoResize?: boolean;
|
|
221
|
+
/** Smallest height in rows (with autoResize, or as the default `rows`). Default 3. */
|
|
222
|
+
minRows?: number;
|
|
223
|
+
/** Largest height in rows with autoResize; it scrolls after that. */
|
|
224
|
+
maxRows?: number;
|
|
225
|
+
/** Show a character count. With maxLength it shows "12 / 280". */
|
|
226
|
+
showCount?: boolean;
|
|
227
|
+
/** Whether people can drag to resize. Ignored with autoResize. Default "vertical". */
|
|
228
|
+
resize?: "none" | "vertical";
|
|
229
|
+
/** Class for the outer frame. `className` goes on the <textarea> itself. */
|
|
230
|
+
frameClassName?: string;
|
|
231
|
+
}
|
|
232
|
+
declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
233
|
+
|
|
234
|
+
interface SelectOption {
|
|
235
|
+
value: string;
|
|
236
|
+
label: string;
|
|
237
|
+
/** Smaller second line. Also searched. */
|
|
238
|
+
description?: string;
|
|
239
|
+
/** Icon before the label: an element or an icon-font class string. */
|
|
240
|
+
icon?: IconInput;
|
|
241
|
+
/** Options with the same group are listed together under that heading. */
|
|
242
|
+
group?: string;
|
|
243
|
+
disabled?: boolean;
|
|
244
|
+
/** Extra words to match when searching (e.g. country codes). */
|
|
245
|
+
keywords?: string[];
|
|
246
|
+
}
|
|
247
|
+
type BaseProps = {
|
|
248
|
+
/** The options to choose from. Leave empty when using loadOptions. */
|
|
249
|
+
options?: SelectOption[];
|
|
250
|
+
placeholder?: string;
|
|
251
|
+
/** Show a search box in the dropdown. Default true. */
|
|
252
|
+
searchable?: boolean;
|
|
253
|
+
/** Placeholder for the search box. */
|
|
254
|
+
searchPlaceholder?: string;
|
|
255
|
+
/** Show a × to clear the selection. */
|
|
256
|
+
clearable?: boolean;
|
|
257
|
+
disabled?: boolean;
|
|
258
|
+
invalid?: boolean;
|
|
259
|
+
required?: boolean;
|
|
260
|
+
size?: ControlSize;
|
|
261
|
+
rounded?: ControlRounded;
|
|
262
|
+
/** Adds hidden inputs with this name, so the value is sent with a normal form submit. */
|
|
263
|
+
name?: string;
|
|
264
|
+
id?: string;
|
|
265
|
+
/** Fetch options from a server as the person types (debounced). */
|
|
266
|
+
loadOptions?: (query: string) => Promise<SelectOption[]>;
|
|
267
|
+
/** Wait for this many characters before searching (with loadOptions). Default 0. */
|
|
268
|
+
minSearchLength?: number;
|
|
269
|
+
/** Debounce for loadOptions, in ms. Default 250. */
|
|
270
|
+
searchDelay?: number;
|
|
271
|
+
/** Let people add an option that isn't in the list by typing it. */
|
|
272
|
+
creatable?: boolean;
|
|
273
|
+
/**
|
|
274
|
+
* Called when a new option is created. Return the option to add (or a Promise of it),
|
|
275
|
+
* e.g. after saving it on the server. By default the typed text becomes the option.
|
|
276
|
+
*/
|
|
277
|
+
onCreateOption?: (input: string) => SelectOption | Promise<SelectOption>;
|
|
278
|
+
/** Custom rendering for an option row. */
|
|
279
|
+
renderOption?: (option: SelectOption, state: {
|
|
280
|
+
selected: boolean;
|
|
281
|
+
active: boolean;
|
|
282
|
+
}) => React.ReactNode;
|
|
283
|
+
/** Text when nothing matches. */
|
|
284
|
+
noOptionsMessage?: (query: string) => React.ReactNode;
|
|
285
|
+
/** Close the dropdown after picking. Default: true for single, false for multiple. */
|
|
286
|
+
closeOnSelect?: boolean;
|
|
287
|
+
/** Called when the dropdown opens or closes. */
|
|
288
|
+
onOpenChange?: (open: boolean) => void;
|
|
289
|
+
className?: string;
|
|
290
|
+
"aria-label"?: string;
|
|
291
|
+
"aria-describedby"?: string;
|
|
292
|
+
};
|
|
293
|
+
type SingleProps$1 = BaseProps & {
|
|
294
|
+
multiple?: false;
|
|
295
|
+
value?: string | null;
|
|
296
|
+
defaultValue?: string | null;
|
|
297
|
+
onChange?: (value: string | null, option: SelectOption | null) => void;
|
|
298
|
+
maxSelected?: never;
|
|
299
|
+
};
|
|
300
|
+
type MultipleProps$1 = BaseProps & {
|
|
301
|
+
multiple: true;
|
|
302
|
+
value?: string[];
|
|
303
|
+
defaultValue?: string[];
|
|
304
|
+
onChange?: (value: string[], options: SelectOption[]) => void;
|
|
305
|
+
/** Most options that can be chosen. */
|
|
306
|
+
maxSelected?: number;
|
|
307
|
+
};
|
|
308
|
+
type SelectProps = SingleProps$1 | MultipleProps$1;
|
|
309
|
+
declare const Select: React.ForwardRefExoticComponent<SelectProps & React.RefAttributes<HTMLDivElement>>;
|
|
310
|
+
|
|
311
|
+
type Orientation = "horizontal" | "vertical";
|
|
312
|
+
type Variant = "line" | "enclosed" | "pills";
|
|
313
|
+
interface TabsProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "defaultValue" | "onChange"> {
|
|
314
|
+
value?: string | null;
|
|
315
|
+
defaultValue?: string | null;
|
|
316
|
+
onValueChange?: (value: string | null) => void;
|
|
317
|
+
orientation?: Orientation;
|
|
318
|
+
/** "line": underline under the active tab. "enclosed": folder-style tabs. "pills": a segmented control. */
|
|
319
|
+
variant?: Variant;
|
|
320
|
+
size?: "sm" | "md";
|
|
321
|
+
/** "automatic" selects a tab as soon as it gets focus; "manual" waits for Enter or Space. */
|
|
322
|
+
activation?: "automatic" | "manual";
|
|
323
|
+
}
|
|
324
|
+
declare function Tabs({ value: valueProp, defaultValue, onValueChange, orientation, variant, size, activation, className, children, ...props }: TabsProps): React.JSX.Element;
|
|
325
|
+
interface TabListProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
326
|
+
/** Makes tabs draggable (and movable with Alt + arrow keys). Called with the new order of values. */
|
|
327
|
+
onReorder?: (values: string[]) => void;
|
|
328
|
+
/** Makes tabs renamable by double-click or F2. Called with the tab's value and new label. */
|
|
329
|
+
onRename?: (value: string, label: string) => void;
|
|
330
|
+
/**
|
|
331
|
+
* Shows a + button. Return the new tab's value (or a Promise of it) to select and focus
|
|
332
|
+
* it — and start renaming it with renameOnAdd.
|
|
333
|
+
*/
|
|
334
|
+
onAdd?: () => string | void | Promise<string | void>;
|
|
335
|
+
/** Label for the + button. */
|
|
336
|
+
addLabel?: string;
|
|
337
|
+
/** Start renaming a tab right after it's added. */
|
|
338
|
+
renameOnAdd?: boolean;
|
|
339
|
+
/** Shows a × on tabs. If the active tab closes, a neighbor is selected first. */
|
|
340
|
+
onClose?: (value: string) => void;
|
|
341
|
+
closeLabel?: (label: string) => string;
|
|
342
|
+
}
|
|
343
|
+
declare function TabList({ onReorder, onRename, onAdd, addLabel, renameOnAdd, onClose, closeLabel, className, children, ...props }: TabListProps): React.JSX.Element;
|
|
344
|
+
interface TabProps {
|
|
345
|
+
value: string;
|
|
346
|
+
/** Plain-text label (used for renaming and announcements). Defaults to the children's text. */
|
|
347
|
+
label?: string;
|
|
348
|
+
children?: React.ReactNode;
|
|
349
|
+
disabled?: boolean;
|
|
350
|
+
icon?: IconInput;
|
|
351
|
+
/** Extra content after the label, e.g. a count badge. */
|
|
352
|
+
badge?: React.ReactNode;
|
|
353
|
+
/** Opt this tab out of renaming. */
|
|
354
|
+
renamable?: boolean;
|
|
355
|
+
/** Opt this tab out of closing. */
|
|
356
|
+
closable?: boolean;
|
|
357
|
+
className?: string;
|
|
358
|
+
}
|
|
359
|
+
declare function Tab({ value, label, children, disabled, icon, badge, renamable, closable, className }: TabProps): React.JSX.Element;
|
|
360
|
+
interface TabPanelProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
361
|
+
value: string;
|
|
362
|
+
/** Keep the panel in the page while hidden, so its state (scroll, form input) is kept. */
|
|
363
|
+
keepMounted?: boolean;
|
|
364
|
+
}
|
|
365
|
+
declare function TabPanel({ value, keepMounted, className, children, ...props }: TabPanelProps): React.JSX.Element | null;
|
|
366
|
+
|
|
367
|
+
type PillTone = "neutral" | "primary" | "success" | "warning" | "danger" | "info";
|
|
368
|
+
type PillAppearance = "soft" | "solid" | "outline";
|
|
369
|
+
declare const pillVariants: (props?: ({
|
|
370
|
+
appearance?: "solid" | "outline" | "soft" | null | undefined;
|
|
371
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
372
|
+
tone?: "primary" | "danger" | "neutral" | "success" | "warning" | "info" | null | undefined;
|
|
373
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
374
|
+
interface PillProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, "children"> {
|
|
375
|
+
children?: React.ReactNode;
|
|
376
|
+
tone?: PillTone;
|
|
377
|
+
appearance?: PillAppearance;
|
|
378
|
+
size?: "sm" | "md" | "lg";
|
|
379
|
+
icon?: IconInput;
|
|
380
|
+
/** A small status dot before the label. "pulse" adds a gentle pulse, e.g. for "Live". */
|
|
381
|
+
dot?: boolean | "pulse";
|
|
382
|
+
/** A number after the label. */
|
|
383
|
+
count?: number;
|
|
384
|
+
/** Shows a × button that calls this. */
|
|
385
|
+
onRemove?: () => void;
|
|
386
|
+
/** Label for the × button. Defaults to "Remove {label}". */
|
|
387
|
+
removeLabel?: string;
|
|
388
|
+
/** Render your own element, e.g. a link: <Pill asChild><a href="…">Design</a></Pill>. */
|
|
389
|
+
asChild?: boolean;
|
|
390
|
+
}
|
|
391
|
+
declare const Pill: React.ForwardRefExoticComponent<PillProps & React.RefAttributes<HTMLSpanElement>>;
|
|
392
|
+
type GroupBase = Omit<React.HTMLAttributes<HTMLDivElement>, "defaultValue" | "onChange"> & {
|
|
393
|
+
size?: "sm" | "md" | "lg";
|
|
394
|
+
/** Color of selected pills. Default "primary". */
|
|
395
|
+
tone?: PillTone;
|
|
396
|
+
/** Show a check mark on selected pills. Default true for multiple. */
|
|
397
|
+
showCheck?: boolean;
|
|
398
|
+
disabled?: boolean;
|
|
399
|
+
/** Required for screen readers when there's no visible label. */
|
|
400
|
+
"aria-label"?: string;
|
|
401
|
+
};
|
|
402
|
+
type PillGroupProps = (GroupBase & {
|
|
403
|
+
type?: "single";
|
|
404
|
+
value?: string | null;
|
|
405
|
+
defaultValue?: string | null;
|
|
406
|
+
onValueChange?: (value: string | null) => void;
|
|
407
|
+
/** Let people unselect the current pill. Default false. */
|
|
408
|
+
allowDeselect?: boolean;
|
|
409
|
+
}) | (GroupBase & {
|
|
410
|
+
type: "multiple";
|
|
411
|
+
value?: string[];
|
|
412
|
+
defaultValue?: string[];
|
|
413
|
+
onValueChange?: (value: string[]) => void;
|
|
414
|
+
allowDeselect?: never;
|
|
415
|
+
});
|
|
416
|
+
declare function PillGroup(props: PillGroupProps): React.JSX.Element;
|
|
417
|
+
interface PillOptionProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "value"> {
|
|
418
|
+
value: string;
|
|
419
|
+
icon?: IconInput;
|
|
420
|
+
count?: number;
|
|
421
|
+
}
|
|
422
|
+
declare const PillOption: React.ForwardRefExoticComponent<PillOptionProps & React.RefAttributes<HTMLButtonElement>>;
|
|
423
|
+
|
|
424
|
+
type ActivityTone = "primary" | "neutral" | "current" | "success" | "warning" | "danger" | "info";
|
|
425
|
+
declare const sizePx: {
|
|
426
|
+
readonly xs: 12;
|
|
427
|
+
readonly sm: 16;
|
|
428
|
+
readonly md: 24;
|
|
429
|
+
readonly lg: 40;
|
|
430
|
+
readonly xl: 56;
|
|
431
|
+
};
|
|
432
|
+
type ActivitySize = keyof typeof sizePx;
|
|
433
|
+
interface ActivityIndicatorProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
434
|
+
/**
|
|
435
|
+
* - "spinner": a spinning arc (general loading)
|
|
436
|
+
* - "dots": three bouncing dots (someone is typing, a reply is coming)
|
|
437
|
+
* - "bars": an equalizer (listening, processing audio or data)
|
|
438
|
+
* - "pulse": a beacon (live, connected, recording)
|
|
439
|
+
* - "orbit": a light with a fading tail circling a ring
|
|
440
|
+
*/
|
|
441
|
+
variant?: "spinner" | "dots" | "bars" | "pulse" | "orbit";
|
|
442
|
+
size?: ActivitySize;
|
|
443
|
+
tone?: ActivityTone;
|
|
444
|
+
/** What's happening, e.g. "Loading invoices". Read by screen readers; shown with showLabel. */
|
|
445
|
+
label?: string;
|
|
446
|
+
showLabel?: boolean;
|
|
447
|
+
/** Put the label beside ("inline") or under ("stacked") the indicator. */
|
|
448
|
+
labelPosition?: "inline" | "stacked";
|
|
449
|
+
}
|
|
450
|
+
declare function ActivityIndicator({ variant, size, tone, label, showLabel, labelPosition, className, ...props }: ActivityIndicatorProps): React.JSX.Element;
|
|
451
|
+
interface ProgressBarProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children"> {
|
|
452
|
+
/** 0–max. Leave out for an indeterminate bar. */
|
|
453
|
+
value?: number;
|
|
454
|
+
max?: number;
|
|
455
|
+
/** Visible label above the bar (also its accessible name). */
|
|
456
|
+
label?: React.ReactNode;
|
|
457
|
+
/** Show the value at the right: true for a percentage, or pass your own text. */
|
|
458
|
+
showValue?: boolean | ((value: number, max: number) => React.ReactNode);
|
|
459
|
+
/** Accessible text for the value, e.g. "3 of 5 files". */
|
|
460
|
+
valueText?: string;
|
|
461
|
+
size?: "sm" | "md" | "lg";
|
|
462
|
+
tone?: Exclude<ActivityTone, "current">;
|
|
463
|
+
/** Moving stripes on the fill, for work that's actively running. */
|
|
464
|
+
striped?: boolean;
|
|
465
|
+
}
|
|
466
|
+
declare function ProgressBar({ value, max, label, showValue, valueText, size, tone, striped, className, "aria-label": ariaLabel, ...props }: ProgressBarProps): React.JSX.Element;
|
|
467
|
+
interface ProgressRingProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children"> {
|
|
468
|
+
/** 0–max. Leave out for an indeterminate (spinning) ring. */
|
|
469
|
+
value?: number;
|
|
470
|
+
max?: number;
|
|
471
|
+
size?: "sm" | "md" | "lg" | "xl";
|
|
472
|
+
tone?: Exclude<ActivityTone, "current">;
|
|
473
|
+
/** What's in the middle: true for a percentage, or your own content. Default true from "md" up. */
|
|
474
|
+
children?: React.ReactNode;
|
|
475
|
+
showValue?: boolean;
|
|
476
|
+
/** Accessible name, e.g. "Storage used". */
|
|
477
|
+
label?: string;
|
|
478
|
+
valueText?: string;
|
|
479
|
+
}
|
|
480
|
+
declare function ProgressRing({ value, max, size, tone, showValue, label, valueText, children, className, ...props }: ProgressRingProps): React.JSX.Element;
|
|
481
|
+
interface SkeletonProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
482
|
+
/** "rect" (default), "circle", "text" lines, "pill" or "line" (a thin rounded bar). */
|
|
483
|
+
shape?: "rect" | "circle" | "text" | "pill" | "line";
|
|
484
|
+
/** Number of lines for shape="text". The last line is shorter. */
|
|
485
|
+
lines?: number;
|
|
486
|
+
/** Width of the last text line. Default "62%". */
|
|
487
|
+
lastLineWidth?: string;
|
|
488
|
+
/** Size shortcuts — or use classes (className="h-24 w-full"). */
|
|
489
|
+
width?: number | string;
|
|
490
|
+
height?: number | string;
|
|
491
|
+
/** Rounded corners: a CSS radius, e.g. "0.75rem". */
|
|
492
|
+
radius?: string;
|
|
493
|
+
/** "shimmer" (default), "pulse" (a gentle fade) or "none". */
|
|
494
|
+
animation?: "shimmer" | "pulse" | "none";
|
|
495
|
+
/** Start the shimmer a little later, so a stack of rows ripples. In ms. */
|
|
496
|
+
delay?: number;
|
|
497
|
+
}
|
|
498
|
+
/** Placeholder shapes while content loads. Size it with classes, e.g. className="h-24 w-full". */
|
|
499
|
+
declare function Skeleton({ shape, lines, lastLineWidth, width, height, radius, animation, delay, className, style, ...props }: SkeletonProps): React.JSX.Element;
|
|
500
|
+
type StepStatus = "done" | "active" | "pending" | "error" | "skipped";
|
|
501
|
+
interface ActivityStep {
|
|
502
|
+
label: React.ReactNode;
|
|
503
|
+
description?: React.ReactNode;
|
|
504
|
+
status: StepStatus;
|
|
505
|
+
/** Extra detail at the right, e.g. a duration ("12s"). */
|
|
506
|
+
meta?: React.ReactNode;
|
|
507
|
+
}
|
|
508
|
+
interface ActivityStepsProps extends React.HTMLAttributes<HTMLOListElement> {
|
|
509
|
+
steps: ActivityStep[];
|
|
510
|
+
orientation?: "vertical" | "horizontal";
|
|
511
|
+
size?: "sm" | "md";
|
|
512
|
+
}
|
|
513
|
+
declare function ActivitySteps({ steps, orientation, size, className, ...props }: ActivityStepsProps): React.JSX.Element;
|
|
514
|
+
interface LoadingOverlayProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
515
|
+
loading: boolean;
|
|
516
|
+
/** Shown under the indicator and read by screen readers. */
|
|
517
|
+
label?: string;
|
|
518
|
+
variant?: ActivityIndicatorProps["variant"];
|
|
519
|
+
/** Wait this long (ms) before showing, so quick refreshes don't flash. Default 150. */
|
|
520
|
+
delay?: number;
|
|
521
|
+
}
|
|
522
|
+
/** Covers its children while loading: dims them, blocks clicks, and shows an indicator. */
|
|
523
|
+
declare function LoadingOverlay({ loading, label, variant, delay, className, children, ...props }: LoadingOverlayProps): React.JSX.Element;
|
|
524
|
+
|
|
525
|
+
type TextTone = "default" | "muted" | "subtle" | "primary" | "success" | "warning" | "danger" | "info" | "inherit";
|
|
526
|
+
declare const weightClass: {
|
|
527
|
+
readonly normal: "font-normal";
|
|
528
|
+
readonly medium: "font-medium";
|
|
529
|
+
readonly semibold: "font-semibold";
|
|
530
|
+
readonly bold: "font-bold";
|
|
531
|
+
};
|
|
532
|
+
type Weight = keyof typeof weightClass;
|
|
533
|
+
declare const alignClass: {
|
|
534
|
+
readonly start: "text-start";
|
|
535
|
+
readonly center: "text-center";
|
|
536
|
+
readonly end: "text-end";
|
|
537
|
+
};
|
|
538
|
+
/** Shared props for truncating text. */
|
|
539
|
+
type Clamp = {
|
|
540
|
+
/** Cut off with "…" after one line. */
|
|
541
|
+
truncate?: boolean;
|
|
542
|
+
/** Cut off with "…" after this many lines. */
|
|
543
|
+
lineClamp?: number;
|
|
544
|
+
};
|
|
545
|
+
declare const headingSizes: (props?: ({
|
|
546
|
+
size?: "display" | "h2" | "h1" | "h3" | "h4" | "h5" | "h6" | null | undefined;
|
|
547
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
548
|
+
type HeadingSize = "display" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
549
|
+
interface HeadingProps extends React.HTMLAttributes<HTMLHeadingElement>, Clamp {
|
|
550
|
+
/** The heading level (h1–h6). Pick it for the page outline, not for looks. */
|
|
551
|
+
level?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
552
|
+
/** The look. Defaults to match the level; "display" is for hero titles. */
|
|
553
|
+
size?: HeadingSize;
|
|
554
|
+
tone?: TextTone;
|
|
555
|
+
weight?: Weight;
|
|
556
|
+
align?: keyof typeof alignClass;
|
|
557
|
+
asChild?: boolean;
|
|
558
|
+
}
|
|
559
|
+
declare const Heading: React.ForwardRefExoticComponent<HeadingProps & React.RefAttributes<HTMLHeadingElement>>;
|
|
560
|
+
declare const textSizes: (props?: ({
|
|
561
|
+
size?: "sm" | "md" | "lg" | "xl" | "xs" | null | undefined;
|
|
562
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
563
|
+
interface TextProps extends React.HTMLAttributes<HTMLElement>, Clamp {
|
|
564
|
+
as?: "p" | "span" | "div" | "label" | "small" | "strong" | "em" | "time" | "figcaption";
|
|
565
|
+
size?: "xl" | "lg" | "md" | "sm" | "xs";
|
|
566
|
+
tone?: TextTone;
|
|
567
|
+
weight?: Weight;
|
|
568
|
+
align?: keyof typeof alignClass;
|
|
569
|
+
/** Tabular (equal-width) numbers, for amounts and times that line up. */
|
|
570
|
+
numeric?: boolean;
|
|
571
|
+
asChild?: boolean;
|
|
572
|
+
}
|
|
573
|
+
declare const Text: React.ForwardRefExoticComponent<TextProps & React.RefAttributes<HTMLElement>>;
|
|
574
|
+
/** The opening paragraph of a page or section: larger and softer than body text. */
|
|
575
|
+
declare const Lead: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
576
|
+
interface LinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
577
|
+
/**
|
|
578
|
+
* - "inline": underlined, in the primary color — for links inside sentences (default)
|
|
579
|
+
* - "subtle": body color, underline on hover — for dense lists and footers
|
|
580
|
+
* - "standalone": medium weight, no underline until hover — for links on their own line
|
|
581
|
+
*/
|
|
582
|
+
variant?: "inline" | "subtle" | "standalone";
|
|
583
|
+
/** Opens in a new tab with an ↗ icon and a note for screen readers. Default: true for other sites. */
|
|
584
|
+
external?: boolean;
|
|
585
|
+
/** Render your framework's link: <Link asChild><NextLink href="/x">…</NextLink></Link> */
|
|
586
|
+
asChild?: boolean;
|
|
587
|
+
}
|
|
588
|
+
declare const Link: React.ForwardRefExoticComponent<LinkProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
589
|
+
/** Inline code: file names, commands, values. */
|
|
590
|
+
declare const Code: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & React.RefAttributes<HTMLElement>>;
|
|
591
|
+
interface KbdProps extends React.HTMLAttributes<HTMLElement> {
|
|
592
|
+
/** A shortcut as separate keys, e.g. ["⌘", "K"] — shown as key caps joined together. */
|
|
593
|
+
keys?: string[];
|
|
594
|
+
}
|
|
595
|
+
/** Keyboard keys, drawn as small raised key caps (the same physical feel as Button). */
|
|
596
|
+
declare const Kbd: React.ForwardRefExoticComponent<KbdProps & React.RefAttributes<HTMLElement>>;
|
|
597
|
+
/** Highlighted text, like a highlighter pen — e.g. search matches. */
|
|
598
|
+
declare const Mark: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & React.RefAttributes<HTMLElement>>;
|
|
599
|
+
interface BlockquoteProps extends React.BlockquoteHTMLAttributes<HTMLQuoteElement> {
|
|
600
|
+
/** Who said it, e.g. "Maria Santos". */
|
|
601
|
+
author?: React.ReactNode;
|
|
602
|
+
/** Their role or the source, e.g. "Product designer, Northwind". */
|
|
603
|
+
source?: React.ReactNode;
|
|
604
|
+
size?: "md" | "lg";
|
|
605
|
+
}
|
|
606
|
+
declare const Blockquote: React.ForwardRefExoticComponent<BlockquoteProps & React.RefAttributes<HTMLQuoteElement>>;
|
|
607
|
+
type ListVariant = "bullet" | "number" | "check" | "none";
|
|
608
|
+
interface ListProps extends React.HTMLAttributes<HTMLUListElement | HTMLOListElement> {
|
|
609
|
+
/** "bullet" (default), "number", "check" (a check mark per item) or "none". */
|
|
610
|
+
variant?: ListVariant;
|
|
611
|
+
/** Space between items. */
|
|
612
|
+
spacing?: "tight" | "normal" | "loose";
|
|
613
|
+
size?: "md" | "sm";
|
|
614
|
+
}
|
|
615
|
+
declare function List({ variant, spacing, size, className, ...props }: ListProps): React.JSX.Element;
|
|
616
|
+
declare function ListItem({ className, children, ...props }: React.LiHTMLAttributes<HTMLLIElement>): React.JSX.Element;
|
|
617
|
+
interface ProseProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
618
|
+
/** Base size of the long-form text. */
|
|
619
|
+
size?: "sm" | "md" | "lg";
|
|
620
|
+
/** Render HTML you trust or have sanitized (e.g. from the Editor, a CMS or Markdown). */
|
|
621
|
+
html?: string;
|
|
622
|
+
}
|
|
623
|
+
/** Styles long-form content — articles, docs, CMS or Markdown output — with the same scale as the rest. */
|
|
624
|
+
declare const Prose: React.ForwardRefExoticComponent<ProseProps & React.RefAttributes<HTMLDivElement>>;
|
|
625
|
+
interface StatProps extends React.HTMLAttributes<HTMLElement> {
|
|
626
|
+
label: React.ReactNode;
|
|
627
|
+
value: React.ReactNode;
|
|
628
|
+
/** The change, e.g. "+12.5%". */
|
|
629
|
+
change?: React.ReactNode;
|
|
630
|
+
/** Direction of the change. Colors it and adds an arrow. */
|
|
631
|
+
trend?: "up" | "down" | "flat";
|
|
632
|
+
/** When "down" is good (costs, errors, response time), swap the colors. */
|
|
633
|
+
invertTrend?: boolean;
|
|
634
|
+
/** Context for the number, e.g. "vs last month". */
|
|
635
|
+
description?: React.ReactNode;
|
|
636
|
+
size?: "md" | "lg";
|
|
637
|
+
}
|
|
638
|
+
interface StatGroupProps extends React.HTMLAttributes<HTMLDListElement> {
|
|
639
|
+
/** Columns on wider screens. Stats stack on phones. */
|
|
640
|
+
columns?: 2 | 3 | 4;
|
|
641
|
+
/** Draw dividers between stats. */
|
|
642
|
+
divided?: boolean;
|
|
643
|
+
}
|
|
644
|
+
/** Lays out several Stats as one description list. */
|
|
645
|
+
declare function StatGroup({ columns, divided, className, ...props }: StatGroupProps): React.JSX.Element;
|
|
646
|
+
/** A key number with its label and change — for dashboards and summaries. */
|
|
647
|
+
declare function Stat({ label, value, change, trend, invertTrend, description, size, className, ...props }: StatProps): React.JSX.Element;
|
|
648
|
+
|
|
649
|
+
declare const sizes: {
|
|
650
|
+
readonly xs: 20;
|
|
651
|
+
readonly sm: 28;
|
|
652
|
+
readonly md: 36;
|
|
653
|
+
readonly lg: 48;
|
|
654
|
+
readonly xl: 64;
|
|
655
|
+
readonly "2xl": 96;
|
|
656
|
+
};
|
|
657
|
+
type AvatarSize = keyof typeof sizes;
|
|
658
|
+
type AvatarStatus = "online" | "away" | "busy" | "offline";
|
|
659
|
+
/** "Maria Santos" → "MS", "cher" → "C". */
|
|
660
|
+
declare function getInitials(name?: string): string;
|
|
661
|
+
interface AvatarProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, "children"> {
|
|
662
|
+
/** Image URL. If it's missing or fails to load, the fallback shows. */
|
|
663
|
+
src?: string | null;
|
|
664
|
+
/** The person's name: used for the alt text, initials and color. */
|
|
665
|
+
name?: string;
|
|
666
|
+
size?: AvatarSize;
|
|
667
|
+
/** "circle" for people, "square" (rounded) for teams, companies and projects. */
|
|
668
|
+
shape?: "circle" | "square";
|
|
669
|
+
/** Presence dot in the corner. */
|
|
670
|
+
status?: AvatarStatus;
|
|
671
|
+
/** Shown when there's no image and no name (or instead of initials). */
|
|
672
|
+
icon?: IconInput;
|
|
673
|
+
/** Small content in the top corner, e.g. an unread count. */
|
|
674
|
+
badge?: React.ReactNode;
|
|
675
|
+
/** A ring around it, e.g. to mark the selected person. */
|
|
676
|
+
ring?: boolean;
|
|
677
|
+
/** Hide from screen readers when the name is already written next to it. */
|
|
678
|
+
decorative?: boolean;
|
|
679
|
+
/** Custom fallback content (overrides initials and icon). */
|
|
680
|
+
fallback?: React.ReactNode;
|
|
681
|
+
}
|
|
682
|
+
declare const Avatar: React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<HTMLSpanElement>>;
|
|
683
|
+
interface AvatarGroupProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
684
|
+
size?: AvatarSize;
|
|
685
|
+
shape?: "circle" | "square";
|
|
686
|
+
/** Show at most this many; the rest become a "+N" avatar. */
|
|
687
|
+
max?: number;
|
|
688
|
+
/** How much they overlap. */
|
|
689
|
+
spacing?: "tight" | "normal" | "loose";
|
|
690
|
+
/** Called when the "+N" avatar is clicked, e.g. to open the full list. */
|
|
691
|
+
onOverflowClick?: () => void;
|
|
692
|
+
}
|
|
693
|
+
declare function AvatarGroup({ size, shape, max, spacing, onOverflowClick, className, children, "aria-label": ariaLabel, ...props }: AvatarGroupProps): React.JSX.Element;
|
|
694
|
+
interface AvatarLabelProps extends Omit<AvatarProps, "decorative"> {
|
|
695
|
+
/** A second line, e.g. a role or email. */
|
|
696
|
+
description?: React.ReactNode;
|
|
697
|
+
/** Something at the end, e.g. a Pill or a button. */
|
|
698
|
+
end?: React.ReactNode;
|
|
699
|
+
}
|
|
700
|
+
/** An avatar with the name (and a detail) beside it — for lists, comments and menus. */
|
|
701
|
+
declare function AvatarLabel({ name, description, end, size, className, ...avatarProps }: AvatarLabelProps): React.JSX.Element;
|
|
702
|
+
interface AvatarUploadProps {
|
|
703
|
+
/** Current picture URL (e.g. from the server). */
|
|
704
|
+
value?: string | null;
|
|
705
|
+
/** Called with the chosen file, or null when removed. */
|
|
706
|
+
onChange?: (file: File | null) => void;
|
|
707
|
+
/** The person's name, for the fallback initials. */
|
|
708
|
+
name?: string;
|
|
709
|
+
size?: "lg" | "xl" | "2xl";
|
|
710
|
+
shape?: "circle" | "square";
|
|
711
|
+
/** Largest file allowed, in MB. Default 5. */
|
|
712
|
+
maxSizeMB?: number;
|
|
713
|
+
accept?: string;
|
|
714
|
+
/** Adds a file input with this name so the photo is sent with a normal form. */
|
|
715
|
+
inputName?: string;
|
|
716
|
+
disabled?: boolean;
|
|
717
|
+
className?: string;
|
|
718
|
+
}
|
|
719
|
+
/** Choose, preview and remove a profile photo — by clicking or dropping an image on it. */
|
|
720
|
+
declare function AvatarUpload({ value, onChange, name, size, shape, maxSizeMB, accept, inputName, disabled, className, }: AvatarUploadProps): React.JSX.Element;
|
|
721
|
+
|
|
722
|
+
declare const cardVariants: (props?: ({
|
|
723
|
+
variant?: "ghost" | "filled" | "outline" | "elevated" | null | undefined;
|
|
724
|
+
tone?: "primary" | "danger" | "default" | null | undefined;
|
|
725
|
+
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
726
|
+
interactive?: boolean | null | undefined;
|
|
727
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
728
|
+
type Padding = "none" | "sm" | "md" | "lg";
|
|
729
|
+
interface CardProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof cardVariants> {
|
|
730
|
+
/** Inner spacing for header, content and footer. */
|
|
731
|
+
padding?: Padding;
|
|
732
|
+
/** Render as another element, e.g. <Card asChild><article>…</article></Card>. */
|
|
733
|
+
asChild?: boolean;
|
|
734
|
+
}
|
|
735
|
+
declare const Card: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLDivElement>>;
|
|
736
|
+
interface CardHeaderProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {
|
|
737
|
+
/** Shorthand for <CardTitle>. */
|
|
738
|
+
title?: React.ReactNode;
|
|
739
|
+
/** Shorthand for <CardDescription>. */
|
|
740
|
+
description?: React.ReactNode;
|
|
741
|
+
/** Something at the top right, e.g. a menu button or a Pill. */
|
|
742
|
+
action?: React.ReactNode;
|
|
743
|
+
icon?: IconInput;
|
|
744
|
+
/** Heading level for the title shorthand. Default 3. */
|
|
745
|
+
titleLevel?: 2 | 3 | 4;
|
|
746
|
+
}
|
|
747
|
+
declare const CardHeader: React.ForwardRefExoticComponent<CardHeaderProps & React.RefAttributes<HTMLDivElement>>;
|
|
748
|
+
declare const CardTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & {
|
|
749
|
+
as?: "h2" | "h3" | "h4" | "p";
|
|
750
|
+
} & React.RefAttributes<HTMLHeadingElement>>;
|
|
751
|
+
declare const CardDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
752
|
+
declare const CardContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
753
|
+
interface CardFooterProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
754
|
+
/** A line above the footer, with a tinted background — for settings cards with a Save button. */
|
|
755
|
+
divided?: boolean;
|
|
756
|
+
/** Where the content sits. Default "end" (buttons on the right). */
|
|
757
|
+
justify?: "start" | "between" | "end";
|
|
758
|
+
}
|
|
759
|
+
declare const CardFooter: React.ForwardRefExoticComponent<CardFooterProps & React.RefAttributes<HTMLDivElement>>;
|
|
760
|
+
interface CardMediaProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
761
|
+
/** Image URL, or pass your own content (e.g. <img>, <video>, a chart) as children. */
|
|
762
|
+
src?: string;
|
|
763
|
+
alt?: string;
|
|
764
|
+
/** Shape of the media area, e.g. "16/9", "4/3", "1/1". Default "16/9". */
|
|
765
|
+
ratio?: string;
|
|
766
|
+
/** Inset from the card's edges with rounded corners, instead of edge to edge. */
|
|
767
|
+
inset?: boolean;
|
|
768
|
+
}
|
|
769
|
+
declare const CardMedia: React.ForwardRefExoticComponent<CardMediaProps & React.RefAttributes<HTMLDivElement>>;
|
|
770
|
+
/**
|
|
771
|
+
* Makes the whole card clickable while keeping it accessible: put it around the card's
|
|
772
|
+
* title text. Its click area stretches over the card; buttons in the header action and
|
|
773
|
+
* footer stay clickable on top. Works with framework links via asChild.
|
|
774
|
+
*/
|
|
775
|
+
declare const CardLink: React.ForwardRefExoticComponent<React.AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
776
|
+
asChild?: boolean;
|
|
777
|
+
} & React.RefAttributes<HTMLAnchorElement>>;
|
|
778
|
+
type ChoiceGroupBase = Omit<React.HTMLAttributes<HTMLDivElement>, "defaultValue" | "onChange"> & {
|
|
779
|
+
/** Form field name (a radio group needs one). Generated if you leave it out. */
|
|
780
|
+
name?: string;
|
|
781
|
+
/** Columns from the small breakpoint up; stacks on phones. */
|
|
782
|
+
columns?: 1 | 2 | 3 | 4;
|
|
783
|
+
disabled?: boolean;
|
|
784
|
+
invalid?: boolean;
|
|
785
|
+
required?: boolean;
|
|
786
|
+
};
|
|
787
|
+
type ChoiceCardGroupProps = (ChoiceGroupBase & {
|
|
788
|
+
type?: "single";
|
|
789
|
+
value?: string | null;
|
|
790
|
+
defaultValue?: string | null;
|
|
791
|
+
onValueChange?: (value: string) => void;
|
|
792
|
+
}) | (ChoiceGroupBase & {
|
|
793
|
+
type: "multiple";
|
|
794
|
+
value?: string[];
|
|
795
|
+
defaultValue?: string[];
|
|
796
|
+
onValueChange?: (value: string[]) => void;
|
|
797
|
+
});
|
|
798
|
+
/** A set of ChoiceCards backed by real radio buttons (single) or checkboxes (multiple). */
|
|
799
|
+
declare function ChoiceCardGroup(props: ChoiceCardGroupProps): React.JSX.Element;
|
|
800
|
+
interface ChoiceCardProps extends Omit<React.LabelHTMLAttributes<HTMLLabelElement>, "title"> {
|
|
801
|
+
value: string;
|
|
802
|
+
title: React.ReactNode;
|
|
803
|
+
description?: React.ReactNode;
|
|
804
|
+
icon?: IconInput;
|
|
805
|
+
/** Extra detail, e.g. a price. */
|
|
806
|
+
meta?: React.ReactNode;
|
|
807
|
+
/** A small tag like "Recommended". */
|
|
808
|
+
badge?: React.ReactNode;
|
|
809
|
+
disabled?: boolean;
|
|
810
|
+
}
|
|
811
|
+
declare function ChoiceCard({ value, title, description, icon, meta, badge, disabled, className, children, ...props }: ChoiceCardProps): React.JSX.Element;
|
|
812
|
+
/** Groups header, content and footer — needed beside CardMedia in a horizontal card. */
|
|
813
|
+
declare const CardBody: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
814
|
+
|
|
815
|
+
interface DropdownMenuProps {
|
|
816
|
+
open?: boolean;
|
|
817
|
+
defaultOpen?: boolean;
|
|
818
|
+
onOpenChange?: (open: boolean) => void;
|
|
819
|
+
children: React.ReactNode;
|
|
820
|
+
}
|
|
821
|
+
declare function DropdownMenu({ open: openProp, defaultOpen, onOpenChange, children }: DropdownMenuProps): React.JSX.Element;
|
|
822
|
+
interface DropdownMenuTriggerProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
823
|
+
/** Use your own button: <DropdownMenuTrigger asChild><Button>Options</Button></DropdownMenuTrigger> */
|
|
824
|
+
asChild?: boolean;
|
|
825
|
+
}
|
|
826
|
+
declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
827
|
+
interface DropdownMenuContentProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
828
|
+
/** Line up the menu with the trigger's start (left) or end (right) edge. */
|
|
829
|
+
align?: "start" | "end";
|
|
830
|
+
/** Open below (default) or above; it flips automatically when there's no room. */
|
|
831
|
+
side?: "bottom" | "top";
|
|
832
|
+
/** Match the trigger's width at least. */
|
|
833
|
+
matchTriggerWidth?: boolean;
|
|
834
|
+
}
|
|
835
|
+
declare const DropdownMenuContent: React.ForwardRefExoticComponent<DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
836
|
+
type ItemBase = {
|
|
837
|
+
/** Called when the item is picked. Call event.preventDefault() to keep the menu open. */
|
|
838
|
+
onSelect?: (event: Event) => void;
|
|
839
|
+
disabled?: boolean;
|
|
840
|
+
icon?: IconInput;
|
|
841
|
+
/** A keyboard shortcut shown at the right, e.g. "⌘D". Purely a hint; wire the keys yourself. */
|
|
842
|
+
shortcut?: string;
|
|
843
|
+
/** A second line of smaller text. */
|
|
844
|
+
description?: React.ReactNode;
|
|
845
|
+
/** Styles the item in red, for actions like Delete. */
|
|
846
|
+
destructive?: boolean;
|
|
847
|
+
/** Line the text up with items that have icons. */
|
|
848
|
+
inset?: boolean;
|
|
849
|
+
/** Text used for type-ahead when the label isn't plain text. */
|
|
850
|
+
textValue?: string;
|
|
851
|
+
};
|
|
852
|
+
interface DropdownMenuItemProps extends ItemBase, Omit<React.HTMLAttributes<HTMLElement>, "onSelect"> {
|
|
853
|
+
/** Render your own element, e.g. a link: <DropdownMenuItem asChild><a href="/settings">Settings</a></DropdownMenuItem> */
|
|
854
|
+
asChild?: boolean;
|
|
855
|
+
}
|
|
856
|
+
declare const DropdownMenuItem: React.ForwardRefExoticComponent<DropdownMenuItemProps & React.RefAttributes<HTMLElement>>;
|
|
857
|
+
interface DropdownMenuCheckboxItemProps extends Omit<ItemBase, "destructive" | "inset" | "icon">, Omit<React.HTMLAttributes<HTMLDivElement>, "onSelect"> {
|
|
858
|
+
checked: boolean;
|
|
859
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
860
|
+
/** Close the menu after toggling. Default false, so several can be changed at once. */
|
|
861
|
+
closeOnSelect?: boolean;
|
|
862
|
+
}
|
|
863
|
+
declare function DropdownMenuCheckboxItem({ checked, onCheckedChange, closeOnSelect, onSelect, disabled, shortcut, description, textValue, className, children, ...props }: DropdownMenuCheckboxItemProps): React.JSX.Element;
|
|
864
|
+
interface DropdownMenuRadioGroupProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
865
|
+
value: string | null;
|
|
866
|
+
onValueChange?: (value: string) => void;
|
|
867
|
+
/** Close the menu after choosing. Default true. */
|
|
868
|
+
closeOnSelect?: boolean;
|
|
869
|
+
}
|
|
870
|
+
declare function DropdownMenuRadioGroup({ value, onValueChange, closeOnSelect, ...props }: DropdownMenuRadioGroupProps): React.JSX.Element;
|
|
871
|
+
interface DropdownMenuRadioItemProps extends Omit<ItemBase, "destructive" | "inset" | "icon">, Omit<React.HTMLAttributes<HTMLDivElement>, "onSelect"> {
|
|
872
|
+
value: string;
|
|
873
|
+
}
|
|
874
|
+
declare function DropdownMenuRadioItem({ value, onSelect, disabled, shortcut, description, textValue, className, children, ...props }: DropdownMenuRadioItemProps): React.JSX.Element;
|
|
875
|
+
/** A small heading for a group of items. */
|
|
876
|
+
declare function DropdownMenuLabel({ className, inset, ...props }: React.HTMLAttributes<HTMLDivElement> & {
|
|
877
|
+
inset?: boolean;
|
|
878
|
+
}): React.JSX.Element;
|
|
879
|
+
declare function DropdownMenuSeparator({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
|
|
880
|
+
/** Groups related items (optionally under a DropdownMenuLabel). */
|
|
881
|
+
declare function DropdownMenuGroup(props: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
|
|
882
|
+
interface SplitButtonProps extends Omit<ButtonProps, "iconOnly" | "asChild"> {
|
|
883
|
+
/** The menu items (DropdownMenuItem, separators…). */
|
|
884
|
+
menu: React.ReactNode;
|
|
885
|
+
/** Accessible label for the arrow button. Default "More options". */
|
|
886
|
+
menuLabel?: string;
|
|
887
|
+
align?: "start" | "end";
|
|
888
|
+
}
|
|
889
|
+
/** A main action with an attached arrow that opens related actions. */
|
|
890
|
+
declare function SplitButton({ menu, menuLabel, align, variant, size, rounded, raised, shadow, disabled, className, ...props }: SplitButtonProps): React.JSX.Element;
|
|
891
|
+
|
|
892
|
+
interface DataTableColumn<T> {
|
|
893
|
+
/** Unique key. Also reads row[key] when there's no accessor. */
|
|
894
|
+
key: string;
|
|
895
|
+
header: React.ReactNode;
|
|
896
|
+
/** The raw value, used for sorting and searching. Defaults to row[key]. */
|
|
897
|
+
accessor?: (row: T) => unknown;
|
|
898
|
+
/** How the cell looks. Defaults to the value as text. */
|
|
899
|
+
cell?: (row: T) => React.ReactNode;
|
|
900
|
+
sortable?: boolean;
|
|
901
|
+
/** Custom sort compare (a, b) → number. */
|
|
902
|
+
sortFn?: (a: T, b: T) => number;
|
|
903
|
+
align?: "start" | "center" | "end";
|
|
904
|
+
/** Column width, e.g. "8rem" or "20%". */
|
|
905
|
+
width?: string;
|
|
906
|
+
/** The row's title in the card layout (shown larger, without a label). Use on one column. */
|
|
907
|
+
primary?: boolean;
|
|
908
|
+
/** Leave this column out of the card layout. */
|
|
909
|
+
hideOnMobile?: boolean;
|
|
910
|
+
/** Include in search. Default true. */
|
|
911
|
+
searchable?: boolean;
|
|
912
|
+
className?: string;
|
|
913
|
+
}
|
|
914
|
+
type SortState = {
|
|
915
|
+
key: string;
|
|
916
|
+
direction: "asc" | "desc";
|
|
917
|
+
} | null;
|
|
918
|
+
type DataTableStatusState = {
|
|
919
|
+
loading: boolean;
|
|
920
|
+
refreshing: boolean;
|
|
921
|
+
lastUpdated: Date | null;
|
|
922
|
+
error: React.ReactNode;
|
|
923
|
+
total: number;
|
|
924
|
+
};
|
|
925
|
+
type DataTableQuery = {
|
|
926
|
+
page: number;
|
|
927
|
+
pageSize: number;
|
|
928
|
+
sort: SortState;
|
|
929
|
+
search: string;
|
|
930
|
+
};
|
|
931
|
+
interface DataTableProps<T> {
|
|
932
|
+
data: T[];
|
|
933
|
+
columns: DataTableColumn<T>[];
|
|
934
|
+
/** A stable id per row: a key of the row, or a function. */
|
|
935
|
+
rowKey: keyof T | ((row: T) => string | number);
|
|
936
|
+
/** Accessible name, e.g. "Invoices". Shown visually only if showCaption. */
|
|
937
|
+
caption: string;
|
|
938
|
+
showCaption?: boolean;
|
|
939
|
+
/** Show a search box. */
|
|
940
|
+
searchable?: boolean;
|
|
941
|
+
searchPlaceholder?: string;
|
|
942
|
+
/** Rows per page. Set 0 to show everything. Default 10. */
|
|
943
|
+
pageSize?: number;
|
|
944
|
+
pageSizeOptions?: number[];
|
|
945
|
+
defaultSort?: SortState;
|
|
946
|
+
/** Adds a checkbox column. */
|
|
947
|
+
selectable?: boolean;
|
|
948
|
+
selected?: Array<string | number>;
|
|
949
|
+
onSelectedChange?: (keys: Array<string | number>) => void;
|
|
950
|
+
/** Shown in a bar when rows are selected. Gets the selected rows and a way to clear them. */
|
|
951
|
+
bulkActions?: (rows: T[], clear: () => void) => React.ReactNode;
|
|
952
|
+
/** Content at the end of each row, e.g. a DropdownMenu. */
|
|
953
|
+
rowActions?: (row: T) => React.ReactNode;
|
|
954
|
+
onRowClick?: (row: T) => void;
|
|
955
|
+
/** Extra buttons in the toolbar, e.g. "New invoice". */
|
|
956
|
+
toolbar?: React.ReactNode;
|
|
957
|
+
loading?: boolean;
|
|
958
|
+
/**
|
|
959
|
+
* How a refresh (loading while rows are already showing) is shown:
|
|
960
|
+
* - "border": a light runs around the table's edge (default)
|
|
961
|
+
* - "bar": a thin bar slides along the top
|
|
962
|
+
* - "shimmer": a soft sweep of light passes over the rows
|
|
963
|
+
* - "none": rows just dim
|
|
964
|
+
*/
|
|
965
|
+
refreshIndicator?: "border" | "bar" | "shimmer" | "none";
|
|
966
|
+
/** Adds a refresh button to the toolbar. Return a Promise; the indicator runs until it settles. */
|
|
967
|
+
onRefresh?: () => Promise<unknown> | void;
|
|
968
|
+
/**
|
|
969
|
+
* A status line at the top of the table, like a live caption.
|
|
970
|
+
* - true: automatic messages — "Loading rows…", "Fetching the latest rows…",
|
|
971
|
+
* "Updated 2 minutes ago", or the error
|
|
972
|
+
* - a message (text or content) to show your own, e.g. "Showing cached data"
|
|
973
|
+
* - a function that gets the table's state and returns a message (or null to hide)
|
|
974
|
+
*/
|
|
975
|
+
status?: boolean | React.ReactNode | ((state: DataTableStatusState) => React.ReactNode);
|
|
976
|
+
/** Color of a custom status message. Automatic messages pick their own. */
|
|
977
|
+
statusTone?: "neutral" | "info" | "success" | "warning" | "danger";
|
|
978
|
+
/** An error to show in the status line (e.g. the last refresh failed). Offers Retry with onRefresh. */
|
|
979
|
+
error?: React.ReactNode;
|
|
980
|
+
/** When the data was last loaded, if you track it. Otherwise the table notes when a refresh finishes. */
|
|
981
|
+
lastUpdated?: Date | null;
|
|
982
|
+
/**
|
|
983
|
+
* Cover the table with a message while it loads or refreshes:
|
|
984
|
+
* true for "Loading rows…" / "Refreshing rows…", or pass your own message.
|
|
985
|
+
* The rows behind are dimmed and can't be clicked until it's done.
|
|
986
|
+
*/
|
|
987
|
+
loadingOverlay?: boolean | React.ReactNode;
|
|
988
|
+
/** Where the overlay's message sits: near the top (default; stays in view on tall tables) or centered. */
|
|
989
|
+
overlayPosition?: "top" | "center";
|
|
990
|
+
/** The indicator in the overlay. Default "orbit". */
|
|
991
|
+
overlayIndicator?: "spinner" | "dots" | "bars" | "pulse" | "orbit";
|
|
992
|
+
/** Adds a Cancel button to the overlay. */
|
|
993
|
+
onCancelLoading?: () => void;
|
|
994
|
+
/** Shown when there are no rows (and when a search finds nothing). */
|
|
995
|
+
emptyState?: React.ReactNode;
|
|
996
|
+
density?: "comfortable" | "compact";
|
|
997
|
+
striped?: boolean;
|
|
998
|
+
/** Narrow containers: rows become cards ("cards", default) or the table scrolls sideways ("scroll"). */
|
|
999
|
+
mobile?: "cards" | "scroll";
|
|
1000
|
+
/** Limit the height; the header stays visible while the body scrolls. */
|
|
1001
|
+
maxHeight?: string;
|
|
1002
|
+
/** Server mode: you sort, search and page; the table only shows `data`. */
|
|
1003
|
+
manual?: boolean;
|
|
1004
|
+
/** Server mode: total number of rows across all pages. */
|
|
1005
|
+
total?: number;
|
|
1006
|
+
/** Called when page, page size, sort or search change (search is debounced). */
|
|
1007
|
+
onQueryChange?: (query: DataTableQuery) => void;
|
|
1008
|
+
className?: string;
|
|
1009
|
+
}
|
|
1010
|
+
declare function DataTable<T>({ data, columns, rowKey, caption, showCaption, searchable, searchPlaceholder, pageSize: initialPageSize, pageSizeOptions, defaultSort, selectable, selected: selectedProp, onSelectedChange, bulkActions, rowActions, onRowClick, toolbar, loading, refreshIndicator, onRefresh, status, statusTone, error, lastUpdated: lastUpdatedProp, loadingOverlay, overlayPosition, overlayIndicator, onCancelLoading, emptyState, density, striped, mobile, maxHeight, manual, total, onQueryChange, className, }: DataTableProps<T>): React.JSX.Element;
|
|
1011
|
+
|
|
1012
|
+
type TimelineTone = "neutral" | "primary" | "success" | "warning" | "danger" | "info";
|
|
1013
|
+
type TimelineStatus = "past" | "current" | "upcoming";
|
|
1014
|
+
/** "2 hours ago" for recent times, "12 Sep" / "12 Sep 2025" otherwise. */
|
|
1015
|
+
declare function formatTimelineTime(t: Date | string | number, now?: Date): string;
|
|
1016
|
+
/** "Today", "Yesterday", "Tomorrow", or "Friday, 12 September". */
|
|
1017
|
+
declare function formatTimelineDay(t: Date | string | number, now?: Date): string;
|
|
1018
|
+
interface TimelineProps extends React.OlHTMLAttributes<HTMLOListElement> {
|
|
1019
|
+
/**
|
|
1020
|
+
* "left" (default): the thread on the left, items to the right.
|
|
1021
|
+
* "alternate": on wide containers, items alternate around a centered thread with times opposite.
|
|
1022
|
+
*/
|
|
1023
|
+
layout?: "left" | "alternate";
|
|
1024
|
+
/**
|
|
1025
|
+
* "feed" (default): a neutral thread, for activity and history.
|
|
1026
|
+
* "progress": the traveled thread is solid, the future dashed — for processes and plans.
|
|
1027
|
+
*/
|
|
1028
|
+
variant?: "feed" | "progress";
|
|
1029
|
+
size?: "sm" | "md";
|
|
1030
|
+
/** Draw the thread as it scrolls into view. Default true (skipped with reduced motion). */
|
|
1031
|
+
animated?: boolean;
|
|
1032
|
+
}
|
|
1033
|
+
declare function Timeline({ layout, variant, size, animated, className, children, ...props }: TimelineProps): React.JSX.Element;
|
|
1034
|
+
interface TimelineGroupProps extends Omit<React.LiHTMLAttributes<HTMLLIElement>, "title"> {
|
|
1035
|
+
/** The heading, e.g. "Today". Or pass `date` to have it written for you. */
|
|
1036
|
+
label?: React.ReactNode;
|
|
1037
|
+
/** A date for the heading: "Today", "Yesterday", or "Friday, 12 September". */
|
|
1038
|
+
date?: Date | string | number;
|
|
1039
|
+
}
|
|
1040
|
+
/** A chapter of the timeline, e.g. a day. Its heading sticks while you scroll through it. */
|
|
1041
|
+
declare function TimelineGroup({ label, date, className, children, ...props }: TimelineGroupProps): React.JSX.Element;
|
|
1042
|
+
interface TimelineItemProps extends Omit<React.LiHTMLAttributes<HTMLLIElement>, "title"> {
|
|
1043
|
+
title: React.ReactNode;
|
|
1044
|
+
/** When it happened. Shown as "2 hours ago" (exact time on hover), unless you pass timeLabel. */
|
|
1045
|
+
time?: Date | string | number;
|
|
1046
|
+
/** Your own time text, e.g. "Q3 2026" or "Step 2". */
|
|
1047
|
+
timeLabel?: React.ReactNode;
|
|
1048
|
+
/** The bead: an icon, or an avatar (e.g. <Avatar size="sm" … />). Without either, a small dot. */
|
|
1049
|
+
icon?: IconInput;
|
|
1050
|
+
avatar?: React.ReactNode;
|
|
1051
|
+
tone?: TimelineTone;
|
|
1052
|
+
/** past (default), current (a pulsing bead), or upcoming (muted, dashed thread). */
|
|
1053
|
+
status?: TimelineStatus;
|
|
1054
|
+
/** Something at the right of the title, e.g. a Pill. */
|
|
1055
|
+
meta?: React.ReactNode;
|
|
1056
|
+
/** Render the body as a card, for longer content like comments. */
|
|
1057
|
+
card?: boolean;
|
|
1058
|
+
/** Hide the thread after this item (the last item does this automatically only in its group). */
|
|
1059
|
+
last?: boolean;
|
|
1060
|
+
}
|
|
1061
|
+
declare function TimelineItem({ title, time, timeLabel, icon, avatar, tone, status, meta, card, last, className, children, ...props }: TimelineItemProps): React.JSX.Element;
|
|
1062
|
+
interface TimelineCollapseProps {
|
|
1063
|
+
/** e.g. (n) => `Show ${n} more updates`. */
|
|
1064
|
+
label?: (count: number) => React.ReactNode;
|
|
1065
|
+
children: React.ReactNode;
|
|
1066
|
+
defaultOpen?: boolean;
|
|
1067
|
+
}
|
|
1068
|
+
/** Folds several quiet items into one "Show 4 more" line on the thread. */
|
|
1069
|
+
declare function TimelineCollapse({ label, children, defaultOpen }: TimelineCollapseProps): React.JSX.Element;
|
|
1070
|
+
interface RoadmapItem {
|
|
1071
|
+
/** Short time label on the track, e.g. "Q3 2026" or "Oct". */
|
|
1072
|
+
label: React.ReactNode;
|
|
1073
|
+
title: React.ReactNode;
|
|
1074
|
+
description?: React.ReactNode;
|
|
1075
|
+
status?: "done" | "current" | "upcoming";
|
|
1076
|
+
/** Extra content under the description, e.g. Pills. */
|
|
1077
|
+
footer?: React.ReactNode;
|
|
1078
|
+
}
|
|
1079
|
+
interface RoadmapProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
1080
|
+
items: RoadmapItem[];
|
|
1081
|
+
/** Accessible name, e.g. "Product roadmap". */
|
|
1082
|
+
"aria-label": string;
|
|
1083
|
+
/** Width of each milestone column. Default "16rem". */
|
|
1084
|
+
itemWidth?: string;
|
|
1085
|
+
}
|
|
1086
|
+
/** A horizontal track of milestones that scrolls sideways, with snap points and edge fades. */
|
|
1087
|
+
declare function Roadmap({ items, itemWidth, className, ...props }: RoadmapProps): React.JSX.Element;
|
|
1088
|
+
|
|
1089
|
+
type UploadStatus = "selected" | "queued" | "uploading" | "done" | "error" | "cancelled";
|
|
1090
|
+
interface UploadItem {
|
|
1091
|
+
id: string;
|
|
1092
|
+
file: File;
|
|
1093
|
+
status: UploadStatus;
|
|
1094
|
+
/** 0–100 */
|
|
1095
|
+
progress: number;
|
|
1096
|
+
error?: string;
|
|
1097
|
+
/** Whatever your upload function resolved with (e.g. the server's JSON). */
|
|
1098
|
+
response?: unknown;
|
|
1099
|
+
/** An object URL for image previews. */
|
|
1100
|
+
previewUrl?: string;
|
|
1101
|
+
}
|
|
1102
|
+
/** Upload one file. Call onProgress(0–100) as it goes, and stop when signal aborts. */
|
|
1103
|
+
type UploadFn = (file: File, ctx: {
|
|
1104
|
+
onProgress: (percent: number) => void;
|
|
1105
|
+
signal: AbortSignal;
|
|
1106
|
+
}) => Promise<unknown>;
|
|
1107
|
+
interface UseFileUploadsOptions {
|
|
1108
|
+
/** Your upload function (see xhrUpload). Without it, files are only selected. */
|
|
1109
|
+
upload?: UploadFn;
|
|
1110
|
+
/** Same format as <input accept>: "image/*,.pdf". */
|
|
1111
|
+
accept?: string;
|
|
1112
|
+
/** Largest file in bytes. */
|
|
1113
|
+
maxSize?: number;
|
|
1114
|
+
/** Most files in the list at once. */
|
|
1115
|
+
maxFiles?: number;
|
|
1116
|
+
multiple?: boolean;
|
|
1117
|
+
/** How many upload at the same time. Default 3. */
|
|
1118
|
+
concurrency?: number;
|
|
1119
|
+
/** Called whenever the list changes. */
|
|
1120
|
+
onChange?: (items: UploadItem[]) => void;
|
|
1121
|
+
/** Called when one file finishes uploading. */
|
|
1122
|
+
onUploaded?: (item: UploadItem) => void;
|
|
1123
|
+
}
|
|
1124
|
+
declare function formatBytes(bytes: number): string;
|
|
1125
|
+
/** Turn an accept string into friendly words: "image/*,.pdf" → "images or PDF". */
|
|
1126
|
+
declare function describeAccept(accept?: string): string;
|
|
1127
|
+
declare function fileMatchesAccept(file: File, accept?: string): boolean;
|
|
1128
|
+
interface XhrUploadOptions {
|
|
1129
|
+
/** Form field name for the file. Default "file". */
|
|
1130
|
+
fieldName?: string;
|
|
1131
|
+
method?: "POST" | "PUT";
|
|
1132
|
+
headers?: Record<string, string>;
|
|
1133
|
+
/** Extra form fields sent with each file. */
|
|
1134
|
+
data?: Record<string, string>;
|
|
1135
|
+
/** Send cookies. Default true. */
|
|
1136
|
+
withCredentials?: boolean;
|
|
1137
|
+
/** Read this cookie and send it as X-XSRF-TOKEN (Laravel). Default "XSRF-TOKEN"; false to skip. */
|
|
1138
|
+
xsrfCookie?: string | false;
|
|
1139
|
+
}
|
|
1140
|
+
/**
|
|
1141
|
+
* An UploadFn for a plain HTTP endpoint, with real upload progress (fetch can't report it).
|
|
1142
|
+
* Laravel-friendly: sends the XSRF cookie as a header and turns validation errors into messages.
|
|
1143
|
+
*/
|
|
1144
|
+
declare function xhrUpload(url: string, options?: XhrUploadOptions): UploadFn;
|
|
1145
|
+
declare function useFileUploads({ upload, accept, maxSize, maxFiles, multiple, concurrency, onChange, onUploaded, }?: UseFileUploadsOptions): {
|
|
1146
|
+
items: UploadItem[];
|
|
1147
|
+
rejections: string[];
|
|
1148
|
+
addFiles: (list: FileList | File[]) => UploadItem[];
|
|
1149
|
+
cancel: (id: string) => void | undefined;
|
|
1150
|
+
retry: (id: string) => void;
|
|
1151
|
+
remove: (id: string) => void;
|
|
1152
|
+
clear: () => void;
|
|
1153
|
+
dismissRejections: () => void;
|
|
1154
|
+
};
|
|
1155
|
+
|
|
1156
|
+
interface FileListProps extends React.HTMLAttributes<HTMLUListElement> {
|
|
1157
|
+
items: UploadItem[];
|
|
1158
|
+
onCancel?: (id: string) => void;
|
|
1159
|
+
onRetry?: (id: string) => void;
|
|
1160
|
+
onRemove?: (id: string) => void;
|
|
1161
|
+
}
|
|
1162
|
+
/** The list of files with thumbnail, size, progress and actions. Used by FileDropzone; usable on its own. */
|
|
1163
|
+
declare function FileList$1({ items, onCancel, onRetry, onRemove, className, ...props }: FileListProps): React.JSX.Element | null;
|
|
1164
|
+
interface FileDropzoneProps extends Omit<UseFileUploadsOptions, "onChange"> {
|
|
1165
|
+
/** Called with the current list (files, statuses, server responses). */
|
|
1166
|
+
onChange?: (items: UploadItem[]) => void;
|
|
1167
|
+
/** Main line of text. */
|
|
1168
|
+
title?: React.ReactNode;
|
|
1169
|
+
/** Hint under it. Generated from accept and maxSize if you leave it out. */
|
|
1170
|
+
hint?: React.ReactNode;
|
|
1171
|
+
/** Adds a hidden file input with this name, for a normal form post (without upload). */
|
|
1172
|
+
name?: string;
|
|
1173
|
+
disabled?: boolean;
|
|
1174
|
+
/** Also accept files pasted with Ctrl/⌘+V while the dropzone is focused. Default true. */
|
|
1175
|
+
pasteable?: boolean;
|
|
1176
|
+
size?: "sm" | "md" | "lg";
|
|
1177
|
+
className?: string;
|
|
1178
|
+
id?: string;
|
|
1179
|
+
}
|
|
1180
|
+
declare function FileDropzone({ title, hint, name, disabled, pasteable, size, className, id, multiple, ...options }: FileDropzoneProps): React.JSX.Element;
|
|
1181
|
+
interface FileInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "type" | "size" | "onChange" | "value" | "defaultValue"> {
|
|
1182
|
+
/** Called with the chosen files (empty when cleared). */
|
|
1183
|
+
onFilesChange?: (files: File[]) => void;
|
|
1184
|
+
/** Text on the button part. */
|
|
1185
|
+
buttonLabel?: string;
|
|
1186
|
+
placeholder?: string;
|
|
1187
|
+
size?: "sm" | "md" | "lg";
|
|
1188
|
+
rounded?: Exclude<ControlRounded, "full">;
|
|
1189
|
+
invalid?: boolean;
|
|
1190
|
+
/** Largest file in bytes; bigger files are refused with a message. */
|
|
1191
|
+
maxSize?: number;
|
|
1192
|
+
/** Show a × to clear the choice. Default true. */
|
|
1193
|
+
clearable?: boolean;
|
|
1194
|
+
}
|
|
1195
|
+
/** A redesigned <input type="file">: a "Choose file" button joined to the file name, in the same frame as Input. */
|
|
1196
|
+
declare const FileInput: React.ForwardRefExoticComponent<FileInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
1197
|
+
interface FileUploadButtonProps extends Omit<ButtonProps, "onChange" | "onClick" | "children"> {
|
|
1198
|
+
/** Uploads the chosen file. Use xhrUpload(url) for most endpoints. */
|
|
1199
|
+
upload: UploadFn;
|
|
1200
|
+
accept?: string;
|
|
1201
|
+
maxSize?: number;
|
|
1202
|
+
/** Button text. */
|
|
1203
|
+
children?: React.ReactNode;
|
|
1204
|
+
/** Called when the upload finishes, with the server's response. */
|
|
1205
|
+
onUploaded?: (item: UploadItem) => void;
|
|
1206
|
+
/** Called when the file is removed after uploading. */
|
|
1207
|
+
onRemove?: () => void;
|
|
1208
|
+
/** Text once done. Default "Upload complete". */
|
|
1209
|
+
completeLabel?: string;
|
|
1210
|
+
}
|
|
1211
|
+
/** A button that picks one file, then shows its name, progress %, and "Upload complete" when done. */
|
|
1212
|
+
declare function FileUploadButton({ upload, accept, maxSize, children, onUploaded, onRemove, completeLabel, variant, leadingIcon, className, ...buttonProps }: FileUploadButtonProps): React.JSX.Element;
|
|
1213
|
+
|
|
1214
|
+
type Size = "sm" | "md";
|
|
1215
|
+
interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "type" | "size" | "onChange"> {
|
|
1216
|
+
label?: React.ReactNode;
|
|
1217
|
+
description?: React.ReactNode;
|
|
1218
|
+
/** A "some are selected" state, e.g. for a select-all box. */
|
|
1219
|
+
indeterminate?: boolean;
|
|
1220
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
1221
|
+
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
1222
|
+
invalid?: boolean;
|
|
1223
|
+
size?: Size;
|
|
1224
|
+
}
|
|
1225
|
+
declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLInputElement>>;
|
|
1226
|
+
interface CheckboxGroupProps extends Omit<React.FieldsetHTMLAttributes<HTMLFieldSetElement>, "onChange" | "defaultValue"> {
|
|
1227
|
+
/** The group's label (a legend). Leave it out inside a Field. */
|
|
1228
|
+
label?: React.ReactNode;
|
|
1229
|
+
description?: React.ReactNode;
|
|
1230
|
+
options: Array<{
|
|
1231
|
+
value: string;
|
|
1232
|
+
label: React.ReactNode;
|
|
1233
|
+
description?: React.ReactNode;
|
|
1234
|
+
disabled?: boolean;
|
|
1235
|
+
}>;
|
|
1236
|
+
value?: string[];
|
|
1237
|
+
defaultValue?: string[];
|
|
1238
|
+
onValueChange?: (value: string[]) => void;
|
|
1239
|
+
/** Form field name; each checked option posts as name=value (use "name[]" for Laravel arrays). */
|
|
1240
|
+
name?: string;
|
|
1241
|
+
orientation?: "vertical" | "horizontal";
|
|
1242
|
+
size?: Size;
|
|
1243
|
+
disabled?: boolean;
|
|
1244
|
+
invalid?: boolean;
|
|
1245
|
+
}
|
|
1246
|
+
declare function CheckboxGroup({ label, description, options, value, defaultValue, onValueChange, name, orientation, size, disabled, invalid, className, ...props }: CheckboxGroupProps): React.JSX.Element;
|
|
1247
|
+
interface RadioGroupProps extends Omit<React.FieldsetHTMLAttributes<HTMLFieldSetElement>, "onChange" | "defaultValue"> {
|
|
1248
|
+
label?: React.ReactNode;
|
|
1249
|
+
description?: React.ReactNode;
|
|
1250
|
+
value?: string | null;
|
|
1251
|
+
defaultValue?: string | null;
|
|
1252
|
+
onValueChange?: (value: string) => void;
|
|
1253
|
+
/** Form field name. Generated if you leave it out. */
|
|
1254
|
+
name?: string;
|
|
1255
|
+
orientation?: "vertical" | "horizontal";
|
|
1256
|
+
size?: Size;
|
|
1257
|
+
disabled?: boolean;
|
|
1258
|
+
invalid?: boolean;
|
|
1259
|
+
required?: boolean;
|
|
1260
|
+
}
|
|
1261
|
+
declare function RadioGroup({ label, description, value, defaultValue, onValueChange, name, orientation, size, disabled, invalid, required, className, children, ...props }: RadioGroupProps): React.JSX.Element;
|
|
1262
|
+
interface RadioProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "type" | "size" | "value" | "name"> {
|
|
1263
|
+
value: string;
|
|
1264
|
+
label?: React.ReactNode;
|
|
1265
|
+
description?: React.ReactNode;
|
|
1266
|
+
}
|
|
1267
|
+
declare const Radio: React.ForwardRefExoticComponent<RadioProps & React.RefAttributes<HTMLInputElement>>;
|
|
1268
|
+
type SwitchVariant = "labelled" | "mark" | "liquid";
|
|
1269
|
+
/** Theme colors for the "on" state, or any CSS color (e.g. "#16a34a", "oklch(0.7 0.2 150)"). */
|
|
1270
|
+
type SwitchColor = "primary" | "secondary" | "tertiary" | "success" | "warning" | "danger" | "info" | (string & {});
|
|
1271
|
+
interface SwitchProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "type" | "size" | "onChange"> {
|
|
1272
|
+
label?: React.ReactNode;
|
|
1273
|
+
description?: React.ReactNode;
|
|
1274
|
+
/**
|
|
1275
|
+
* - "labelled" (default): a pill with the word inside — "On" in white on blue, "Off" in gray
|
|
1276
|
+
* - "mark": the knob shows × when off and bends into a blue ✓ when on
|
|
1277
|
+
* - "liquid": an outlined pill that floods blue from the knob when turned on
|
|
1278
|
+
*/
|
|
1279
|
+
variant?: SwitchVariant;
|
|
1280
|
+
/**
|
|
1281
|
+
* Color when on. "primary" (the default blue), "secondary" (green), "tertiary" (orange) —
|
|
1282
|
+
* theme tokens you can rebrand — or success, warning, danger, info, or any CSS color.
|
|
1283
|
+
*/
|
|
1284
|
+
color?: SwitchColor;
|
|
1285
|
+
/** Text color on a custom `color` (for "labelled"). Default white. */
|
|
1286
|
+
colorForeground?: string;
|
|
1287
|
+
/**
|
|
1288
|
+
* Called when flipped. Return a Promise (e.g. saving the setting) and the knob shows a
|
|
1289
|
+
* spinner until it settles — and flips back if it fails.
|
|
1290
|
+
*/
|
|
1291
|
+
onCheckedChange?: (checked: boolean) => void | Promise<unknown>;
|
|
1292
|
+
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
1293
|
+
size?: Size;
|
|
1294
|
+
/** Put the label before the switch, spread across the row — common in settings lists. */
|
|
1295
|
+
labelPosition?: "end" | "start";
|
|
1296
|
+
/** Words for the "labelled" variant. Default "On" / "Off". */
|
|
1297
|
+
onLabel?: string;
|
|
1298
|
+
offLabel?: string;
|
|
1299
|
+
}
|
|
1300
|
+
/** A switch for settings that take effect right away. Three looks: labelled, mark and liquid. */
|
|
1301
|
+
declare const Switch: React.ForwardRefExoticComponent<SwitchProps & React.RefAttributes<HTMLInputElement>>;
|
|
1302
|
+
|
|
1303
|
+
type ToastType = "default" | "success" | "error" | "warning" | "info" | "loading";
|
|
1304
|
+
interface ToastOptions {
|
|
1305
|
+
/** Reuse an id to update a toast in place instead of adding another. */
|
|
1306
|
+
id?: string | number;
|
|
1307
|
+
description?: React.ReactNode;
|
|
1308
|
+
/** A button in the toast, e.g. Undo. The toast closes after it's clicked. */
|
|
1309
|
+
action?: {
|
|
1310
|
+
label: string;
|
|
1311
|
+
onClick: () => void;
|
|
1312
|
+
};
|
|
1313
|
+
/** How long it stays, in ms. Default 5000 (errors 8000, loading until updated). Infinity to keep it. */
|
|
1314
|
+
duration?: number;
|
|
1315
|
+
/** Replace the icon. */
|
|
1316
|
+
icon?: React.ReactNode;
|
|
1317
|
+
/** Show the × button. Default true. */
|
|
1318
|
+
dismissible?: boolean;
|
|
1319
|
+
onDismiss?: () => void;
|
|
1320
|
+
}
|
|
1321
|
+
interface ToastData extends ToastOptions {
|
|
1322
|
+
id: string | number;
|
|
1323
|
+
type: ToastType;
|
|
1324
|
+
title: React.ReactNode;
|
|
1325
|
+
createdAt: number;
|
|
1326
|
+
dismissed?: boolean;
|
|
1327
|
+
}
|
|
1328
|
+
declare function dismiss(id?: string | number): void;
|
|
1329
|
+
type Message<T> = React.ReactNode | ((value: T) => React.ReactNode);
|
|
1330
|
+
declare const toast: ((title: React.ReactNode, options?: ToastOptions) => string | number) & {
|
|
1331
|
+
success: (title: React.ReactNode, options?: ToastOptions) => string | number;
|
|
1332
|
+
error: (title: React.ReactNode, options?: ToastOptions) => string | number;
|
|
1333
|
+
warning: (title: React.ReactNode, options?: ToastOptions) => string | number;
|
|
1334
|
+
info: (title: React.ReactNode, options?: ToastOptions) => string | number;
|
|
1335
|
+
loading: (title: React.ReactNode, options?: ToastOptions) => string | number;
|
|
1336
|
+
/** Show "loading" while a Promise runs, then success or error. Returns the same Promise. */
|
|
1337
|
+
promise<T>(promise: Promise<T> | (() => Promise<T>), messages: {
|
|
1338
|
+
loading: React.ReactNode;
|
|
1339
|
+
success: Message<T>;
|
|
1340
|
+
error: Message<unknown>;
|
|
1341
|
+
description?: React.ReactNode;
|
|
1342
|
+
}, options?: ToastOptions): Promise<T>;
|
|
1343
|
+
/** Close one toast, or all of them. */
|
|
1344
|
+
dismiss: typeof dismiss;
|
|
1345
|
+
};
|
|
1346
|
+
type ToasterPosition = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
|
|
1347
|
+
interface ToasterProps {
|
|
1348
|
+
/** Where toasts appear on wide screens. On phones they span the width at the top or bottom. */
|
|
1349
|
+
position?: ToasterPosition;
|
|
1350
|
+
/** Show every toast spread out, instead of a neat stack that opens on hover. */
|
|
1351
|
+
expand?: boolean;
|
|
1352
|
+
/** How many are visible at once (the rest wait). Default 3. */
|
|
1353
|
+
visibleToasts?: number;
|
|
1354
|
+
/** Colored backgrounds for success, error, warning and info. */
|
|
1355
|
+
richColors?: boolean;
|
|
1356
|
+
/** Show a thin line counting down the time left. Default true. */
|
|
1357
|
+
showTimer?: boolean;
|
|
1358
|
+
/** Keyboard shortcut to jump to the toasts. Default Alt+T. */
|
|
1359
|
+
hotkey?: string[];
|
|
1360
|
+
className?: string;
|
|
1361
|
+
}
|
|
1362
|
+
declare function Toaster({ position, expand, visibleToasts, richColors, showTimer, hotkey, className, }: ToasterProps): React.JSX.Element;
|
|
1363
|
+
|
|
1364
|
+
type ColorInput = string | {
|
|
1365
|
+
/** The color in light mode. */
|
|
1366
|
+
light: string;
|
|
1367
|
+
/** The color in dark mode. Worked out from light if left out. */
|
|
1368
|
+
dark?: string;
|
|
1369
|
+
/** Text/icons on the color in light mode. Worked out for contrast if left out. */
|
|
1370
|
+
foreground?: string;
|
|
1371
|
+
darkForeground?: string;
|
|
1372
|
+
};
|
|
1373
|
+
type SurfaceInput = string | {
|
|
1374
|
+
light: string;
|
|
1375
|
+
dark?: string;
|
|
1376
|
+
};
|
|
1377
|
+
interface ThemeConfig {
|
|
1378
|
+
$schema?: string;
|
|
1379
|
+
colors?: {
|
|
1380
|
+
/** Buttons, links, focus rings, selected states. Hover, pressed edge and dark mode are derived. */
|
|
1381
|
+
primary?: ColorInput;
|
|
1382
|
+
/** Extra accents (e.g. Switch color="secondary" / "tertiary"). */
|
|
1383
|
+
secondary?: ColorInput;
|
|
1384
|
+
tertiary?: ColorInput;
|
|
1385
|
+
success?: ColorInput;
|
|
1386
|
+
warning?: ColorInput;
|
|
1387
|
+
danger?: ColorInput;
|
|
1388
|
+
info?: ColorInput;
|
|
1389
|
+
/** Page background. */
|
|
1390
|
+
background?: SurfaceInput;
|
|
1391
|
+
/** Cards, fields, menus. */
|
|
1392
|
+
surface?: SurfaceInput;
|
|
1393
|
+
/** Main text. */
|
|
1394
|
+
foreground?: SurfaceInput;
|
|
1395
|
+
/** Secondary text. */
|
|
1396
|
+
muted?: SurfaceInput;
|
|
1397
|
+
/** Hairlines and field borders. */
|
|
1398
|
+
border?: SurfaceInput;
|
|
1399
|
+
};
|
|
1400
|
+
fonts?: {
|
|
1401
|
+
/** Body font stack, e.g. "Inter, system-ui, sans-serif". */
|
|
1402
|
+
sans?: string;
|
|
1403
|
+
/** Headings (defaults to sans). */
|
|
1404
|
+
heading?: string;
|
|
1405
|
+
mono?: string;
|
|
1406
|
+
/** Google Fonts to load, e.g. ["Inter:wght@400..700", "Fraunces:wght@600"]. */
|
|
1407
|
+
googleFonts?: string[];
|
|
1408
|
+
};
|
|
1409
|
+
/** Corner roundness: a preset, or exact values. */
|
|
1410
|
+
radius?: "none" | "sm" | "md" | "lg" | {
|
|
1411
|
+
control?: string;
|
|
1412
|
+
controlSm?: string;
|
|
1413
|
+
controlLg?: string;
|
|
1414
|
+
card?: string;
|
|
1415
|
+
modal?: string;
|
|
1416
|
+
};
|
|
1417
|
+
/** Spacing and control sizes: a preset, or a multiplier (1 = default, 0.9 = tighter, 1.1 = roomier). */
|
|
1418
|
+
density?: "compact" | "comfortable" | "spacious" | number;
|
|
1419
|
+
/** Shadow strength. */
|
|
1420
|
+
shadows?: "none" | "subtle" | "default" | "strong";
|
|
1421
|
+
/** Root font size, e.g. "16px" (default) or "15px". Scales everything sized in rem. */
|
|
1422
|
+
baseFontSize?: string;
|
|
1423
|
+
}
|
|
1424
|
+
|
|
1425
|
+
interface ThemeProviderProps {
|
|
1426
|
+
/** Your theme — e.g. `import theme from "./ui.theme.json"`, or one loaded from an API. */
|
|
1427
|
+
theme: ThemeConfig;
|
|
1428
|
+
/**
|
|
1429
|
+
* Where the theme applies. Default ":root" (the whole page). Use a selector such as
|
|
1430
|
+
* "[data-theme-scope=preview]" to theme only part of the page.
|
|
1431
|
+
*/
|
|
1432
|
+
selector?: string;
|
|
1433
|
+
/** Nonce for a strict Content-Security-Policy. */
|
|
1434
|
+
nonce?: string;
|
|
1435
|
+
children?: React.ReactNode;
|
|
1436
|
+
}
|
|
1437
|
+
/**
|
|
1438
|
+
* Applies a theme config at runtime by writing its CSS variables into the page.
|
|
1439
|
+
* For a theme that never changes, prefer the build step (`jm-ui theme`) — it needs no JavaScript.
|
|
1440
|
+
*/
|
|
1441
|
+
declare function ThemeProvider({ theme, selector, nonce, children }: ThemeProviderProps): React.JSX.Element;
|
|
1442
|
+
|
|
1443
|
+
type Mode = "drawer" | "desktop";
|
|
1444
|
+
type SidebarContextValue = {
|
|
1445
|
+
side: "left" | "right";
|
|
1446
|
+
mode: Mode;
|
|
1447
|
+
collapsed: boolean;
|
|
1448
|
+
setCollapsed: (v: boolean) => void;
|
|
1449
|
+
drawerOpen: boolean;
|
|
1450
|
+
setDrawerOpen: (v: boolean) => void;
|
|
1451
|
+
toggle: () => void;
|
|
1452
|
+
contained: boolean;
|
|
1453
|
+
sidebarId: string;
|
|
1454
|
+
triggerRef: React.MutableRefObject<HTMLElement | null>;
|
|
1455
|
+
linkComponent: React.ElementType;
|
|
1456
|
+
onNavigate?: (href: string) => void;
|
|
1457
|
+
};
|
|
1458
|
+
declare function useSidebar(): SidebarContextValue;
|
|
1459
|
+
interface SidebarProviderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
1460
|
+
/** Which side the sidebar is on. */
|
|
1461
|
+
side?: "left" | "right";
|
|
1462
|
+
/** Start collapsed to an icon rail (wide screens). */
|
|
1463
|
+
defaultCollapsed?: boolean;
|
|
1464
|
+
/** Controlled collapsed state. */
|
|
1465
|
+
collapsed?: boolean;
|
|
1466
|
+
onCollapsedChange?: (collapsed: boolean) => void;
|
|
1467
|
+
/** Below this layout width (px) the sidebar becomes a drawer. Default 768. */
|
|
1468
|
+
drawerBelow?: number;
|
|
1469
|
+
/** Between drawerBelow and this width, start as an icon rail unless the person chose otherwise. Default 1024. */
|
|
1470
|
+
railBelow?: number;
|
|
1471
|
+
/** Remember collapsed/expanded in this browser under this key. */
|
|
1472
|
+
persistKey?: string;
|
|
1473
|
+
/** Keyboard shortcut Ctrl/⌘ + this key toggles the sidebar. Default "b"; false to turn off. */
|
|
1474
|
+
shortcut?: string | false;
|
|
1475
|
+
/**
|
|
1476
|
+
* The link component for menu items — e.g. Next.js `Link` or Inertia's `Link`.
|
|
1477
|
+
* It receives href, className, children, onClick and aria-current.
|
|
1478
|
+
*/
|
|
1479
|
+
linkComponent?: React.ElementType;
|
|
1480
|
+
/** Called when a menu link is followed (after the drawer closes on phones). */
|
|
1481
|
+
onNavigate?: (href: string) => void;
|
|
1482
|
+
/** Fit inside a box (e.g. a preview) instead of the whole window. */
|
|
1483
|
+
contained?: boolean;
|
|
1484
|
+
}
|
|
1485
|
+
declare function SidebarProvider({ side, defaultCollapsed, collapsed: collapsedProp, onCollapsedChange, drawerBelow, railBelow, persistKey, shortcut, linkComponent, onNavigate, contained, className, children, ...props }: SidebarProviderProps): React.JSX.Element;
|
|
1486
|
+
interface SidebarProps extends React.HTMLAttributes<HTMLElement> {
|
|
1487
|
+
/** Width when expanded. Default "16rem". */
|
|
1488
|
+
width?: string;
|
|
1489
|
+
/** Width of the icon rail. Default "4.25rem". */
|
|
1490
|
+
railWidth?: string;
|
|
1491
|
+
/** Accessible name for the panel. Default "Sidebar". */
|
|
1492
|
+
"aria-label"?: string;
|
|
1493
|
+
}
|
|
1494
|
+
declare function Sidebar({ width, railWidth, className, children, style, "aria-label": ariaLabel, ...props }: SidebarProps): React.JSX.Element;
|
|
1495
|
+
declare function SidebarHeader({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
|
|
1496
|
+
declare function SidebarContent({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
|
|
1497
|
+
declare function SidebarFooter({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
|
|
1498
|
+
interface SidebarGroupProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
1499
|
+
/** A small heading above the group. Hidden in the icon rail (a divider shows instead). */
|
|
1500
|
+
label?: React.ReactNode;
|
|
1501
|
+
/** Something at the right of the heading, e.g. an "add" button. */
|
|
1502
|
+
action?: React.ReactNode;
|
|
1503
|
+
}
|
|
1504
|
+
declare function SidebarGroup({ label, action, className, children, ...props }: SidebarGroupProps): React.JSX.Element;
|
|
1505
|
+
interface SidebarTriggerProps extends Omit<React.ComponentProps<typeof Button>, "children"> {
|
|
1506
|
+
/** Accessible label. Default "Toggle sidebar". */
|
|
1507
|
+
label?: string;
|
|
1508
|
+
}
|
|
1509
|
+
/** The button that opens/closes the drawer on phones and collapses/expands the sidebar on wide screens. */
|
|
1510
|
+
declare const SidebarTrigger: React.ForwardRefExoticComponent<Omit<SidebarTriggerProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
1511
|
+
/** The main area beside the sidebar. */
|
|
1512
|
+
declare function SidebarInset({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
|
|
1513
|
+
interface SidebarNavItem {
|
|
1514
|
+
label: string;
|
|
1515
|
+
/** Where it goes. Items with children don't need one (they open their submenu). */
|
|
1516
|
+
href?: string;
|
|
1517
|
+
icon?: IconInput;
|
|
1518
|
+
/** Something at the end, e.g. a count: <Pill size="sm">12</Pill>. */
|
|
1519
|
+
badge?: React.ReactNode;
|
|
1520
|
+
/** A submenu. Nest as deep as you need. */
|
|
1521
|
+
children?: SidebarNavItem[];
|
|
1522
|
+
/** Open this submenu at first. Parents of the active page open automatically. */
|
|
1523
|
+
defaultOpen?: boolean;
|
|
1524
|
+
disabled?: boolean;
|
|
1525
|
+
/** For actions that aren't links (e.g. "Invite people"). */
|
|
1526
|
+
onSelect?: () => void;
|
|
1527
|
+
/** Open in a new tab. */
|
|
1528
|
+
external?: boolean;
|
|
1529
|
+
/** Stable key if labels repeat. */
|
|
1530
|
+
id?: string;
|
|
1531
|
+
}
|
|
1532
|
+
interface SidebarNavProps {
|
|
1533
|
+
items: SidebarNavItem[];
|
|
1534
|
+
/** The current page's path. Its item is highlighted and its parents open. */
|
|
1535
|
+
activeHref?: string;
|
|
1536
|
+
/** Also treat an item as active when the current path starts with its href (e.g. /invoices/1047). Default true. */
|
|
1537
|
+
matchNested?: boolean;
|
|
1538
|
+
"aria-label"?: string;
|
|
1539
|
+
className?: string;
|
|
1540
|
+
}
|
|
1541
|
+
/** A menu from data, with submenus to any depth. */
|
|
1542
|
+
declare function SidebarNav({ items, activeHref, matchNested, "aria-label": ariaLabel, className }: SidebarNavProps): React.JSX.Element;
|
|
1543
|
+
|
|
1544
|
+
type AutocompleteItem = string | {
|
|
1545
|
+
/** What goes into the field when picked. */
|
|
1546
|
+
value: string;
|
|
1547
|
+
/** Shown in the list (defaults to value). */
|
|
1548
|
+
label?: string;
|
|
1549
|
+
description?: React.ReactNode;
|
|
1550
|
+
icon?: IconInput;
|
|
1551
|
+
/** Show under this heading. */
|
|
1552
|
+
group?: string;
|
|
1553
|
+
};
|
|
1554
|
+
type Item = {
|
|
1555
|
+
value: string;
|
|
1556
|
+
label: string;
|
|
1557
|
+
description?: React.ReactNode;
|
|
1558
|
+
icon?: IconInput;
|
|
1559
|
+
group?: string;
|
|
1560
|
+
recent?: boolean;
|
|
1561
|
+
};
|
|
1562
|
+
interface AutocompleteProps extends Omit<InputProps, "value" | "defaultValue" | "onChange" | "onSubmit" | "overlay" | "type"> {
|
|
1563
|
+
value?: string;
|
|
1564
|
+
defaultValue?: string;
|
|
1565
|
+
/** Called with the text on every change (typing, picking, completing, clearing). */
|
|
1566
|
+
onChange?: (value: string) => void;
|
|
1567
|
+
/** A fixed list, or a function that returns suggestions for what's typed. */
|
|
1568
|
+
suggestions?: AutocompleteItem[] | ((query: string) => AutocompleteItem[]);
|
|
1569
|
+
/** Fetch suggestions from a server. Debounced; slow earlier replies never overwrite newer ones. */
|
|
1570
|
+
loadSuggestions?: (query: string, context: {
|
|
1571
|
+
signal: AbortSignal;
|
|
1572
|
+
}) => Promise<AutocompleteItem[]>;
|
|
1573
|
+
/** Characters needed before suggesting. Default 1. */
|
|
1574
|
+
minLength?: number;
|
|
1575
|
+
/** Wait this long (ms) after typing before calling loadSuggestions. Default 200. */
|
|
1576
|
+
debounce?: number;
|
|
1577
|
+
/** Most suggestions shown. Default 8. */
|
|
1578
|
+
maxSuggestions?: number;
|
|
1579
|
+
/** Show the rest of the best match faintly in the field; Tab or → accepts it. Default true. */
|
|
1580
|
+
inlineComplete?: boolean;
|
|
1581
|
+
/** Called when a suggestion is picked (from the list or by completing it). */
|
|
1582
|
+
onSelectSuggestion?: (item: Item) => void;
|
|
1583
|
+
/** Called when Enter is pressed without a suggestion highlighted — e.g. to run a search. (With type="search", Escape also clears the field.) */
|
|
1584
|
+
onSubmit?: (value: string) => void;
|
|
1585
|
+
/** Remember submitted and picked values in this browser under this key, and offer them when the field is empty. */
|
|
1586
|
+
recentKey?: string;
|
|
1587
|
+
/** How many recent values to keep. Default 5. */
|
|
1588
|
+
maxRecent?: number;
|
|
1589
|
+
/** Shown when nothing matches. Default: the list simply closes. */
|
|
1590
|
+
emptyMessage?: React.ReactNode;
|
|
1591
|
+
/** Custom matching for fixed suggestions. Default: every word appears (case and accents ignored). */
|
|
1592
|
+
filter?: (item: Item, query: string) => boolean;
|
|
1593
|
+
type?: "text" | "search" | "email" | "url" | "tel";
|
|
1594
|
+
}
|
|
1595
|
+
declare const Autocomplete: React.ForwardRefExoticComponent<AutocompleteProps & React.RefAttributes<HTMLInputElement>>;
|
|
1596
|
+
|
|
1597
|
+
type Value = number | [number, number];
|
|
1598
|
+
interface SliderMark {
|
|
1599
|
+
value: number;
|
|
1600
|
+
label?: React.ReactNode;
|
|
1601
|
+
}
|
|
1602
|
+
interface SliderProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "defaultValue" | "onChange" | "color"> {
|
|
1603
|
+
/** A number, or [low, high] for a range with two thumbs. */
|
|
1604
|
+
value?: Value;
|
|
1605
|
+
defaultValue?: Value;
|
|
1606
|
+
/** Called continuously while dragging. */
|
|
1607
|
+
onChange?: (value: Value) => void;
|
|
1608
|
+
/** Called once the person lets go (or finishes with the keyboard) — good for saving. */
|
|
1609
|
+
onValueCommit?: (value: Value) => void;
|
|
1610
|
+
min?: number;
|
|
1611
|
+
max?: number;
|
|
1612
|
+
step?: number;
|
|
1613
|
+
/** Tick marks: true for one per step, an array of values, or values with labels. */
|
|
1614
|
+
marks?: boolean | number[] | SliderMark[];
|
|
1615
|
+
/** Turn a value into text, e.g. (v) => `₱${v.toLocaleString()}`. Also read by screen readers. */
|
|
1616
|
+
formatValue?: (value: number) => string;
|
|
1617
|
+
/** When the value bubble shows: while pressed or focused (default), always, or never. */
|
|
1618
|
+
showValue?: "active" | "always" | "never";
|
|
1619
|
+
/** Fill color: the Switch palette (primary, secondary, tertiary, success, warning, danger, info) or any CSS color. */
|
|
1620
|
+
color?: string;
|
|
1621
|
+
size?: "sm" | "md" | "lg";
|
|
1622
|
+
disabled?: boolean;
|
|
1623
|
+
/** Smallest gap between the two thumbs of a range. Default one step. */
|
|
1624
|
+
minDistance?: number;
|
|
1625
|
+
/** A tiny vibration when snapping between marks (phones that support it). Default true. */
|
|
1626
|
+
haptics?: boolean;
|
|
1627
|
+
/** Adds hidden inputs with this name for normal form posts (name[] for a range in Laravel). */
|
|
1628
|
+
name?: string;
|
|
1629
|
+
/** Labels for the two thumbs of a range. Default ["Minimum", "Maximum"]. */
|
|
1630
|
+
thumbLabels?: [string, string];
|
|
1631
|
+
id?: string;
|
|
1632
|
+
"aria-label"?: string;
|
|
1633
|
+
"aria-labelledby"?: string;
|
|
1634
|
+
}
|
|
1635
|
+
declare const Slider: React.ForwardRefExoticComponent<SliderProps & React.RefAttributes<HTMLDivElement>>;
|
|
1636
|
+
|
|
1637
|
+
type PageItem = number | "start-gap" | "end-gap";
|
|
1638
|
+
/** The list of page numbers and gaps to show. */
|
|
1639
|
+
declare function getPageItems(page: number, pageCount: number, siblings?: number, boundaries?: number): PageItem[];
|
|
1640
|
+
interface PaginationProps extends Omit<React.HTMLAttributes<HTMLElement>, "onChange"> {
|
|
1641
|
+
/** Current page (1-based). */
|
|
1642
|
+
page: number;
|
|
1643
|
+
/** Number of pages. Or give total + pageSize. */
|
|
1644
|
+
pageCount?: number;
|
|
1645
|
+
total?: number;
|
|
1646
|
+
pageSize?: number;
|
|
1647
|
+
onPageChange?: (page: number) => void;
|
|
1648
|
+
/**
|
|
1649
|
+
* Make pages real links (good for search engines and opening in new tabs).
|
|
1650
|
+
* Pair with linkComponent for Next.js/Inertia links.
|
|
1651
|
+
*/
|
|
1652
|
+
getHref?: (page: number) => string;
|
|
1653
|
+
linkComponent?: React.ElementType;
|
|
1654
|
+
/** Pages shown on each side of the current one. Default 1 (fewer when narrow). */
|
|
1655
|
+
siblingCount?: number;
|
|
1656
|
+
/** Pages always shown at the start and end. Default 1. */
|
|
1657
|
+
boundaryCount?: number;
|
|
1658
|
+
/** First/last page buttons. Default false. */
|
|
1659
|
+
showFirstLast?: boolean;
|
|
1660
|
+
/** "numbers" (default) or "simple": ‹ Page 3 of 12 ›. With responsive, narrow widths switch to simple. */
|
|
1661
|
+
variant?: "numbers" | "simple";
|
|
1662
|
+
/** Adapt to the available width. Default true. */
|
|
1663
|
+
responsive?: boolean;
|
|
1664
|
+
/** Show "21–30 of 470" (needs total and pageSize). */
|
|
1665
|
+
showSummary?: boolean;
|
|
1666
|
+
/** Offer a page-size picker with these options. */
|
|
1667
|
+
pageSizeOptions?: number[];
|
|
1668
|
+
onPageSizeChange?: (size: number) => void;
|
|
1669
|
+
/** Show a "Go to page" box. */
|
|
1670
|
+
showJump?: boolean;
|
|
1671
|
+
size?: "sm" | "md";
|
|
1672
|
+
/** Words, for other languages. */
|
|
1673
|
+
labels?: Partial<{
|
|
1674
|
+
previous: string;
|
|
1675
|
+
next: string;
|
|
1676
|
+
first: string;
|
|
1677
|
+
last: string;
|
|
1678
|
+
page: string;
|
|
1679
|
+
of: string;
|
|
1680
|
+
goTo: string;
|
|
1681
|
+
perPage: string;
|
|
1682
|
+
nav: string;
|
|
1683
|
+
}>;
|
|
1684
|
+
}
|
|
1685
|
+
declare const Pagination: React.ForwardRefExoticComponent<PaginationProps & React.RefAttributes<HTMLElement>>;
|
|
1686
|
+
interface LoadMoreProps {
|
|
1687
|
+
/** How many are showing now. */
|
|
1688
|
+
loaded: number;
|
|
1689
|
+
/** How many there are in total (if known). */
|
|
1690
|
+
total?: number;
|
|
1691
|
+
/** Load the next batch. Return a Promise and the button shows progress until it settles. */
|
|
1692
|
+
onLoadMore: () => unknown;
|
|
1693
|
+
/** Is there anything left? Default: loaded < total. */
|
|
1694
|
+
hasMore?: boolean;
|
|
1695
|
+
/** Load automatically when the button scrolls into view (infinite scroll). */
|
|
1696
|
+
auto?: boolean;
|
|
1697
|
+
/** Words. */
|
|
1698
|
+
label?: string;
|
|
1699
|
+
className?: string;
|
|
1700
|
+
}
|
|
1701
|
+
/** For feeds and lists: "Showing 20 of 47" with a Load more button — or automatic loading as you scroll. */
|
|
1702
|
+
declare function LoadMore({ loaded, total, onLoadMore, hasMore, auto, label, className }: LoadMoreProps): React.JSX.Element;
|
|
1703
|
+
|
|
1704
|
+
type Datum = Record<string, string | number | null | undefined>;
|
|
1705
|
+
interface ChartSeries {
|
|
1706
|
+
/** Field in each data row. */
|
|
1707
|
+
key: string;
|
|
1708
|
+
label?: string;
|
|
1709
|
+
/** Any CSS color. Defaults to the chart palette (--ui-chart-1 … 6). */
|
|
1710
|
+
color?: string;
|
|
1711
|
+
}
|
|
1712
|
+
interface BaseChartProps {
|
|
1713
|
+
data: Datum[];
|
|
1714
|
+
/** The field used along the bottom, e.g. "month". */
|
|
1715
|
+
index: string;
|
|
1716
|
+
series: ChartSeries[];
|
|
1717
|
+
/** Height in px. Default 240. */
|
|
1718
|
+
height?: number;
|
|
1719
|
+
formatValue?: (value: number) => string;
|
|
1720
|
+
formatIndex?: (value: string | number) => string;
|
|
1721
|
+
/** Legend above the chart (click to show/hide a series). Default true for 2+ series. */
|
|
1722
|
+
showLegend?: boolean;
|
|
1723
|
+
showGrid?: boolean;
|
|
1724
|
+
/** A horizontal reference line, e.g. a target. */
|
|
1725
|
+
referenceLine?: {
|
|
1726
|
+
value: number;
|
|
1727
|
+
label?: string;
|
|
1728
|
+
};
|
|
1729
|
+
/** Accessible summary, e.g. "Revenue by month, January to December". */
|
|
1730
|
+
"aria-label": string;
|
|
1731
|
+
/** Draw in on first load. Default true (inside a DashboardGrid, follows its animate setting). */
|
|
1732
|
+
animate?: boolean;
|
|
1733
|
+
/** Glide to new values when the data changes (live dashboards). Default true. */
|
|
1734
|
+
transition?: boolean;
|
|
1735
|
+
className?: string;
|
|
1736
|
+
}
|
|
1737
|
+
interface LineChartProps extends BaseChartProps {
|
|
1738
|
+
/** Fill under the lines. */
|
|
1739
|
+
area?: boolean;
|
|
1740
|
+
/** "smooth" (default) or "linear". */
|
|
1741
|
+
curve?: "smooth" | "linear";
|
|
1742
|
+
/** Show a dot on every point. Default: only when there are few points. */
|
|
1743
|
+
dots?: boolean;
|
|
1744
|
+
}
|
|
1745
|
+
declare function LineChart(props: LineChartProps): React.JSX.Element;
|
|
1746
|
+
/** A LineChart with the area filled. */
|
|
1747
|
+
declare const AreaChart: (props: Omit<LineChartProps, "area">) => React.JSX.Element;
|
|
1748
|
+
interface BarChartProps extends BaseChartProps {
|
|
1749
|
+
/** Stack series on top of each other instead of side by side. */
|
|
1750
|
+
stacked?: boolean;
|
|
1751
|
+
}
|
|
1752
|
+
declare function BarChart(props: BarChartProps): React.JSX.Element;
|
|
1753
|
+
|
|
1754
|
+
interface DonutSlice {
|
|
1755
|
+
label: string;
|
|
1756
|
+
value: number;
|
|
1757
|
+
color?: string;
|
|
1758
|
+
}
|
|
1759
|
+
interface DonutChartProps {
|
|
1760
|
+
data: DonutSlice[];
|
|
1761
|
+
/** Diameter in px. Default 180. */
|
|
1762
|
+
size?: number;
|
|
1763
|
+
/** Ring thickness in px. Default 22. */
|
|
1764
|
+
thickness?: number;
|
|
1765
|
+
formatValue?: (value: number) => string;
|
|
1766
|
+
/** Text under the number in the middle. Default "Total". */
|
|
1767
|
+
centerLabel?: string;
|
|
1768
|
+
/** Legend beside ("side", default when there's room), "bottom", or none. */
|
|
1769
|
+
legend?: "side" | "bottom" | false;
|
|
1770
|
+
/** Sweep in on first load. Default true (inside a DashboardGrid, follows its animate setting). */
|
|
1771
|
+
animate?: boolean;
|
|
1772
|
+
"aria-label": string;
|
|
1773
|
+
className?: string;
|
|
1774
|
+
}
|
|
1775
|
+
declare function DonutChart({ data, size, thickness, formatValue, centerLabel, legend, animate, className, ...rest }: DonutChartProps): React.JSX.Element;
|
|
1776
|
+
interface GaugeProps {
|
|
1777
|
+
value: number;
|
|
1778
|
+
max: number;
|
|
1779
|
+
min?: number;
|
|
1780
|
+
/** A marker on the arc, e.g. the target. */
|
|
1781
|
+
target?: number;
|
|
1782
|
+
label?: string;
|
|
1783
|
+
formatValue?: (value: number) => string;
|
|
1784
|
+
/** Color bands by how far along it is: e.g. [{ upTo: 0.5, color: "var(--color-danger)" }, …]. Default: primary. */
|
|
1785
|
+
bands?: Array<{
|
|
1786
|
+
upTo: number;
|
|
1787
|
+
color: string;
|
|
1788
|
+
}>;
|
|
1789
|
+
/** Width in px. Default 220. */
|
|
1790
|
+
size?: number;
|
|
1791
|
+
/** Sweep up from zero on first load. Default true (inside a DashboardGrid, follows its animate setting). */
|
|
1792
|
+
animate?: boolean;
|
|
1793
|
+
"aria-label"?: string;
|
|
1794
|
+
className?: string;
|
|
1795
|
+
}
|
|
1796
|
+
/** A half-circle meter for attainment against a goal. */
|
|
1797
|
+
declare function Gauge({ value, max, min, target, label, formatValue, bands, size, animate, className, ...rest }: GaugeProps): React.JSX.Element;
|
|
1798
|
+
interface BarListItem {
|
|
1799
|
+
label: string;
|
|
1800
|
+
value: number;
|
|
1801
|
+
icon?: IconInput;
|
|
1802
|
+
href?: string;
|
|
1803
|
+
/** Secondary text on the right, e.g. "12 invoices". */
|
|
1804
|
+
meta?: React.ReactNode;
|
|
1805
|
+
}
|
|
1806
|
+
interface BarListProps {
|
|
1807
|
+
items: BarListItem[];
|
|
1808
|
+
formatValue?: (value: number) => string;
|
|
1809
|
+
/** Sort from highest. Default true. */
|
|
1810
|
+
sort?: boolean;
|
|
1811
|
+
/** Show at most this many (a "Show all" button reveals the rest). */
|
|
1812
|
+
limit?: number;
|
|
1813
|
+
color?: string;
|
|
1814
|
+
/** Grow the bars in on first load. Default true (inside a DashboardGrid, follows its animate setting). */
|
|
1815
|
+
animate?: boolean;
|
|
1816
|
+
"aria-label"?: string;
|
|
1817
|
+
className?: string;
|
|
1818
|
+
}
|
|
1819
|
+
/** A ranked list with bars behind the labels — top clients, pages, products. Rows slide when the order changes. */
|
|
1820
|
+
declare function BarList({ items, formatValue, sort, limit, color, animate, className, ...rest }: BarListProps): React.JSX.Element;
|
|
1821
|
+
interface CalendarHeatmapProps {
|
|
1822
|
+
/** One entry per day with activity: { date: "2026-09-21", value: 4 }. */
|
|
1823
|
+
data: Array<{
|
|
1824
|
+
date: string;
|
|
1825
|
+
value: number;
|
|
1826
|
+
}>;
|
|
1827
|
+
/** Last day shown. Default today. */
|
|
1828
|
+
end?: Date;
|
|
1829
|
+
/** How many weeks back. Default 26. */
|
|
1830
|
+
weeks?: number;
|
|
1831
|
+
color?: string;
|
|
1832
|
+
formatValue?: (value: number) => string;
|
|
1833
|
+
"aria-label": string;
|
|
1834
|
+
className?: string;
|
|
1835
|
+
}
|
|
1836
|
+
/** Daily activity as a grid of squares — darker means more. */
|
|
1837
|
+
declare function CalendarHeatmap({ data, end, weeks, color, formatValue, className, ...rest }: CalendarHeatmapProps): React.JSX.Element;
|
|
1838
|
+
interface SparklineProps {
|
|
1839
|
+
data: number[];
|
|
1840
|
+
/** "line" (default), "area" or "bar". */
|
|
1841
|
+
type?: "line" | "area" | "bar";
|
|
1842
|
+
color?: string;
|
|
1843
|
+
/** Height in px. Default 36. Width fills the container. */
|
|
1844
|
+
height?: number;
|
|
1845
|
+
/** Mark the last point. Default true for line/area. */
|
|
1846
|
+
showLast?: boolean;
|
|
1847
|
+
"aria-label"?: string;
|
|
1848
|
+
className?: string;
|
|
1849
|
+
}
|
|
1850
|
+
/** A tiny chart for trends inside cards and tables. */
|
|
1851
|
+
declare function Sparkline({ data: target, type, color, height, showLast, className, ...rest }: SparklineProps): React.JSX.Element;
|
|
1852
|
+
|
|
1853
|
+
interface KpiCardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {
|
|
1854
|
+
label: React.ReactNode;
|
|
1855
|
+
/**
|
|
1856
|
+
* The headline number. Pass a number (with formatValue) to have it count up on first load and
|
|
1857
|
+
* roll to new values on live updates — or pre-formatted text like "18 days".
|
|
1858
|
+
*/
|
|
1859
|
+
value: React.ReactNode | number;
|
|
1860
|
+
/** Formats a numeric value, e.g. (v) => `₱${v.toLocaleString()}`. Default: whole number with separators. */
|
|
1861
|
+
formatValue?: (value: number) => string;
|
|
1862
|
+
/** Count up on first load. Default false (inside a DashboardGrid, follows its animate setting). */
|
|
1863
|
+
animate?: boolean;
|
|
1864
|
+
/** Change vs the previous period, as a percentage (8.2 or -4.1). */
|
|
1865
|
+
change?: number;
|
|
1866
|
+
/** Text after the change. Default "vs last period". */
|
|
1867
|
+
changeLabel?: string;
|
|
1868
|
+
/** For numbers where going down is good (costs, churn, overdue): flips the colors. */
|
|
1869
|
+
invertTrend?: boolean;
|
|
1870
|
+
icon?: IconInput;
|
|
1871
|
+
/** A small trend chart under the number. */
|
|
1872
|
+
sparkline?: number[];
|
|
1873
|
+
sparklineType?: "line" | "area" | "bar";
|
|
1874
|
+
/** Progress toward a goal: 0–1 plus a label like "78% of ₱400K target". */
|
|
1875
|
+
progress?: {
|
|
1876
|
+
value: number;
|
|
1877
|
+
label?: React.ReactNode;
|
|
1878
|
+
};
|
|
1879
|
+
/** Makes the whole card a link. */
|
|
1880
|
+
href?: string;
|
|
1881
|
+
loading?: boolean;
|
|
1882
|
+
}
|
|
1883
|
+
declare function KpiCard({ label, value, formatValue, animate, change, changeLabel, invertTrend, icon, sparkline, sparklineType, progress, href, loading, className, ...props }: KpiCardProps): React.JSX.Element;
|
|
1884
|
+
interface WidgetCardProps extends Omit<React.HTMLAttributes<HTMLElement>, "title"> {
|
|
1885
|
+
title: React.ReactNode;
|
|
1886
|
+
description?: React.ReactNode;
|
|
1887
|
+
/** Controls at the top right, e.g. a period picker. */
|
|
1888
|
+
action?: React.ReactNode;
|
|
1889
|
+
/** A big number under the title (e.g. the total the chart shows). */
|
|
1890
|
+
value?: React.ReactNode;
|
|
1891
|
+
loading?: boolean;
|
|
1892
|
+
/** Shown instead of the content when there's nothing to show. */
|
|
1893
|
+
empty?: React.ReactNode;
|
|
1894
|
+
/** Shown instead of the content when loading failed. */
|
|
1895
|
+
error?: React.ReactNode;
|
|
1896
|
+
onRetry?: () => void;
|
|
1897
|
+
footer?: React.ReactNode;
|
|
1898
|
+
/** Show a LiveIndicator in the header: true, or the time the data last changed. */
|
|
1899
|
+
live?: boolean | Date | number;
|
|
1900
|
+
}
|
|
1901
|
+
/** The frame for a dashboard widget: title, controls, and loading / empty / error states. */
|
|
1902
|
+
declare function WidgetCard({ title, description, action, value, loading, empty, error, onRetry, footer, live, className, children, ...props }: WidgetCardProps): React.JSX.Element;
|
|
1903
|
+
interface DashboardGridProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
1904
|
+
/** Columns on wide screens. Default 4. It steps down to 2 and then 1 as space shrinks. */
|
|
1905
|
+
columns?: 2 | 3 | 4 | 6 | 12;
|
|
1906
|
+
/**
|
|
1907
|
+
* Animate on first load: widgets rise in one after another, KPI numbers count up, charts draw in,
|
|
1908
|
+
* donuts and gauges sweep. Off by default; skipped for people who prefer reduced motion.
|
|
1909
|
+
*/
|
|
1910
|
+
animate?: boolean;
|
|
1911
|
+
}
|
|
1912
|
+
/** A responsive grid for widgets. Give a child `data-span="2"` (or use DashboardGrid.Item) to make it wider. */
|
|
1913
|
+
declare function DashboardGrid({ columns, animate, className, style, ...props }: DashboardGridProps): React.JSX.Element;
|
|
1914
|
+
interface LiveIndicatorProps {
|
|
1915
|
+
/** When the data last changed. Shows "updated 3s ago", ticking. */
|
|
1916
|
+
updatedAt?: Date | number | null;
|
|
1917
|
+
/** Show "Paused" instead of "Live". */
|
|
1918
|
+
paused?: boolean;
|
|
1919
|
+
/** Connection trouble: shows "Reconnecting…" in amber. */
|
|
1920
|
+
reconnecting?: boolean;
|
|
1921
|
+
className?: string;
|
|
1922
|
+
}
|
|
1923
|
+
/** A pulsing "Live" badge with how long ago the data changed. */
|
|
1924
|
+
declare function LiveIndicator({ updatedAt, paused, reconnecting, className }: LiveIndicatorProps): React.JSX.Element;
|
|
1925
|
+
|
|
1926
|
+
/** "Nice" round axis ticks covering [min, max]. */
|
|
1927
|
+
declare function niceTicks(min: number, max: number, count?: number): number[];
|
|
1928
|
+
/** 1200 → 1.2K, 3400000 → 3.4M. */
|
|
1929
|
+
declare function formatCompact(n: number): string;
|
|
1930
|
+
/**
|
|
1931
|
+
* Smoothly move a list of numbers to new targets (for live updates). New entries start from the
|
|
1932
|
+
* previous last value (so an appended point grows out of the line), or from `from` on first mount.
|
|
1933
|
+
*/
|
|
1934
|
+
declare function useTweenedNumbers(target: number[], { duration, enabled, from }?: {
|
|
1935
|
+
duration?: number;
|
|
1936
|
+
enabled?: boolean;
|
|
1937
|
+
from?: number;
|
|
1938
|
+
}): number[];
|
|
1939
|
+
|
|
1940
|
+
declare const useAccordion: () => {
|
|
1941
|
+
open: string[];
|
|
1942
|
+
toggle: (value: string, force?: boolean) => void;
|
|
1943
|
+
expandAll: () => void;
|
|
1944
|
+
collapseAll: () => void;
|
|
1945
|
+
};
|
|
1946
|
+
type SingleProps = {
|
|
1947
|
+
/** One section open at a time. */
|
|
1948
|
+
type?: "single";
|
|
1949
|
+
value?: string | null;
|
|
1950
|
+
defaultValue?: string | null;
|
|
1951
|
+
onValueChange?: (value: string | null) => void;
|
|
1952
|
+
/** Allow closing the open section (so none is open). Default true. */
|
|
1953
|
+
collapsible?: boolean;
|
|
1954
|
+
};
|
|
1955
|
+
type MultipleProps = {
|
|
1956
|
+
/** Any number open at once. */
|
|
1957
|
+
type: "multiple";
|
|
1958
|
+
value?: string[];
|
|
1959
|
+
defaultValue?: string[];
|
|
1960
|
+
onValueChange?: (value: string[]) => void;
|
|
1961
|
+
collapsible?: never;
|
|
1962
|
+
};
|
|
1963
|
+
type AccordionProps = (SingleProps | MultipleProps) & Omit<React.HTMLAttributes<HTMLDivElement>, "defaultValue" | "onChange"> & {
|
|
1964
|
+
/** "separated" cards (default), "outline" one bordered group, or "flush" with dividers only. */
|
|
1965
|
+
variant?: "separated" | "outline" | "flush";
|
|
1966
|
+
size?: "sm" | "md";
|
|
1967
|
+
/** The heading level of item titles, for a correct document outline. Default 3. */
|
|
1968
|
+
headingLevel?: 2 | 3 | 4 | 5 | 6;
|
|
1969
|
+
/** Open the section whose value matches the URL hash (#value), and update it when one opens. */
|
|
1970
|
+
linkToHash?: boolean;
|
|
1971
|
+
};
|
|
1972
|
+
declare function Accordion(props: AccordionProps): React.JSX.Element;
|
|
1973
|
+
type AccordionStatus = "complete" | "current" | "error" | "locked";
|
|
1974
|
+
interface AccordionItemProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {
|
|
1975
|
+
value: string;
|
|
1976
|
+
title: React.ReactNode;
|
|
1977
|
+
/** Smaller text under the title (always visible). */
|
|
1978
|
+
description?: React.ReactNode;
|
|
1979
|
+
/** Shown under the title only while closed — e.g. what was entered in a finished step. */
|
|
1980
|
+
summary?: React.ReactNode;
|
|
1981
|
+
icon?: IconInput;
|
|
1982
|
+
/** Something on the right of the header (not part of the button): a count, a Pill, a Switch. */
|
|
1983
|
+
meta?: React.ReactNode;
|
|
1984
|
+
/** Controls in the header that shouldn't toggle the section, e.g. <Switch />. */
|
|
1985
|
+
action?: React.ReactNode;
|
|
1986
|
+
/** Step status icon: complete (✓), current, error (!), locked. Locked items can't open. */
|
|
1987
|
+
status?: AccordionStatus;
|
|
1988
|
+
disabled?: boolean;
|
|
1989
|
+
/** Keep the content in the page while closed (default true, so find-in-page and forms work). */
|
|
1990
|
+
keepMounted?: boolean;
|
|
1991
|
+
}
|
|
1992
|
+
declare function AccordionItem({ value, title, description, summary, icon, meta, action, status, disabled: disabledProp, keepMounted, className, children, ...props }: AccordionItemProps): React.JSX.Element;
|
|
1993
|
+
/** Buttons to open or close every section (for type="multiple"). Place inside <Accordion> or pass a ref-less wrapper. */
|
|
1994
|
+
declare function AccordionToggleAll({ expandLabel, collapseLabel, className }: {
|
|
1995
|
+
expandLabel?: string;
|
|
1996
|
+
collapseLabel?: string;
|
|
1997
|
+
className?: string;
|
|
1998
|
+
}): React.JSX.Element;
|
|
1999
|
+
|
|
2000
|
+
type PerView = number | {
|
|
2001
|
+
base?: number;
|
|
2002
|
+
sm?: number;
|
|
2003
|
+
md?: number;
|
|
2004
|
+
lg?: number;
|
|
2005
|
+
};
|
|
2006
|
+
interface CarouselHandle {
|
|
2007
|
+
next: () => void;
|
|
2008
|
+
prev: () => void;
|
|
2009
|
+
goTo: (index: number) => void;
|
|
2010
|
+
index: number;
|
|
2011
|
+
}
|
|
2012
|
+
interface CarouselProps extends Omit<React.HTMLAttributes<HTMLElement>, "onChange"> {
|
|
2013
|
+
/** Name for the carousel, e.g. "Product photos". */
|
|
2014
|
+
"aria-label": string;
|
|
2015
|
+
/** Slides shown at once: a number, or by width { base: 1, sm: 2, md: 3 } (container ≥480 / 768 / 1024px). */
|
|
2016
|
+
slidesPerView?: PerView;
|
|
2017
|
+
/** Space between slides in px. Default 16. */
|
|
2018
|
+
gap?: number;
|
|
2019
|
+
/** Let the next slide peek in by this many px (or true for 48). */
|
|
2020
|
+
peek?: boolean | number;
|
|
2021
|
+
/** "start" (default) or "center" — the active slide sits in the middle. */
|
|
2022
|
+
align?: "start" | "center";
|
|
2023
|
+
/** "coverflow": slides shrink and fade as they move away from the center. */
|
|
2024
|
+
effect?: "none" | "coverflow";
|
|
2025
|
+
/** After the last slide, next goes back to the first (and prev from the first to the last). */
|
|
2026
|
+
loop?: boolean;
|
|
2027
|
+
/** Move on by itself every N ms. Pauses on hover, touch, focus and hidden tabs; off with reduced motion. */
|
|
2028
|
+
autoplay?: number | false;
|
|
2029
|
+
/** "dots" (default), "counter" (3 / 8), "stories" (bars at the top), "thumbnails", or "none". */
|
|
2030
|
+
indicators?: "dots" | "counter" | "stories" | "thumbnails" | "none";
|
|
2031
|
+
/** Previous/next buttons: over the slides (default), below them, or none. */
|
|
2032
|
+
controls?: "overlay" | "below" | "none";
|
|
2033
|
+
defaultIndex?: number;
|
|
2034
|
+
onSlideChange?: (index: number) => void;
|
|
2035
|
+
}
|
|
2036
|
+
interface CarouselSlideProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
2037
|
+
/** Small preview shown when indicators="thumbnails". */
|
|
2038
|
+
thumbnail?: React.ReactNode;
|
|
2039
|
+
/** Accessible name for the slide (default "3 of 8"). */
|
|
2040
|
+
label?: string;
|
|
2041
|
+
}
|
|
2042
|
+
/** One slide. Put anything inside: an image, text, a card, a form. */
|
|
2043
|
+
declare const CarouselSlide: React.ForwardRefExoticComponent<CarouselSlideProps & React.RefAttributes<HTMLDivElement>>;
|
|
2044
|
+
declare const Carousel: React.ForwardRefExoticComponent<CarouselProps & React.RefAttributes<CarouselHandle>>;
|
|
2045
|
+
|
|
2046
|
+
type IconButtonTone = "neutral" | "primary" | "secondary" | "tertiary" | "success" | "warning" | "danger" | "info" | (string & {});
|
|
2047
|
+
interface IconButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "children" | "color"> {
|
|
2048
|
+
/** The icon: an element (<svg>) or an icon-font class like "bi bi-heart". */
|
|
2049
|
+
icon: IconInput;
|
|
2050
|
+
/** What it does, e.g. "Like" or "Delete invoice". Required: it's the only text a screen reader gets. Also shown as a tooltip. */
|
|
2051
|
+
label: string;
|
|
2052
|
+
/** "plain" (just the icon; a soft halo on hover — default), "soft" (tinted circle) or "solid". */
|
|
2053
|
+
variant?: "plain" | "soft" | "solid";
|
|
2054
|
+
tone?: IconButtonTone;
|
|
2055
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl";
|
|
2056
|
+
shape?: "circle" | "square";
|
|
2057
|
+
/** Make it a toggle (like, bookmark, star): aria-pressed, and pressedIcon while on. */
|
|
2058
|
+
pressed?: boolean;
|
|
2059
|
+
defaultPressed?: boolean;
|
|
2060
|
+
onPressedChange?: (pressed: boolean) => void;
|
|
2061
|
+
/** Icon while pressed, e.g. the filled version: "bi bi-heart-fill". */
|
|
2062
|
+
pressedIcon?: IconInput;
|
|
2063
|
+
/** A burst of particles when turned on. Default true for toggles. */
|
|
2064
|
+
burst?: boolean;
|
|
2065
|
+
/** A count or dot in the corner: a number (99+ above 99) or true for a dot. */
|
|
2066
|
+
badge?: number | boolean;
|
|
2067
|
+
/** Show a spinner instead of the icon. Return a Promise from onClick to get this automatically. */
|
|
2068
|
+
loading?: boolean;
|
|
2069
|
+
/** Render as a link. */
|
|
2070
|
+
href?: string;
|
|
2071
|
+
/** Show the label as a tooltip on hover (the browser's own). Default true. */
|
|
2072
|
+
tooltip?: boolean;
|
|
2073
|
+
onClick?: (event: React.MouseEvent<HTMLElement>) => unknown;
|
|
2074
|
+
}
|
|
2075
|
+
declare const IconButton: React.ForwardRefExoticComponent<IconButtonProps & React.RefAttributes<HTMLElement>>;
|
|
2076
|
+
|
|
2077
|
+
interface SpotlightTextProps extends React.HTMLAttributes<HTMLElement> {
|
|
2078
|
+
/** "follow" (default): follows the pointer, drifts on its own when idle. "sweep": a beam passes every few seconds. "reveal": dark until lit. */
|
|
2079
|
+
mode?: "follow" | "sweep" | "reveal";
|
|
2080
|
+
/** The element to render. Default "span"; use "h1", "h2", "p"… for real headings and paragraphs. */
|
|
2081
|
+
as?: React.ElementType;
|
|
2082
|
+
/** Spotlight radius in px. Default: about the text's size (at least 60px). */
|
|
2083
|
+
radius?: number;
|
|
2084
|
+
/** Color of the lit text: any CSS color, or a gradient like "linear-gradient(90deg, #0d6efd, #db2777)". Default: the text's own color. */
|
|
2085
|
+
tint?: string;
|
|
2086
|
+
/** How visible the unlit text is, 0–1. Default 0.4 (0.08 for reveal). */
|
|
2087
|
+
dim?: number;
|
|
2088
|
+
/** A soft glow around the lit letters. Default true. */
|
|
2089
|
+
glow?: boolean;
|
|
2090
|
+
/**
|
|
2091
|
+
* How fast the light moves: "slow", "normal" (default) or "fast" — or ms for one pass.
|
|
2092
|
+
* "fast" makes a quick shimmer that suits status messages ("Syncing…").
|
|
2093
|
+
*/
|
|
2094
|
+
speed?: "slow" | "normal" | "fast" | number;
|
|
2095
|
+
/** For sweep: ms for one pass (overrides speed). */
|
|
2096
|
+
duration?: number;
|
|
2097
|
+
/** For sweep: pause between passes in ms (overrides speed). */
|
|
2098
|
+
pause?: number;
|
|
2099
|
+
/** How closely it follows the pointer, 0–1 (1 = instantly). Default 0.14 — a smooth trail. */
|
|
2100
|
+
smoothing?: number;
|
|
2101
|
+
}
|
|
2102
|
+
declare function SpotlightText({ mode, as: Tag, radius, tint, dim, glow, speed, duration: durationProp, pause: pauseProp, smoothing, className, style, children, ...props }: SpotlightTextProps): React.JSX.Element;
|
|
2103
|
+
|
|
2104
|
+
type Anim = SkeletonProps["animation"];
|
|
2105
|
+
type Common = {
|
|
2106
|
+
animation?: Anim;
|
|
2107
|
+
className?: string;
|
|
2108
|
+
};
|
|
2109
|
+
interface SkeletonTextProps extends Common {
|
|
2110
|
+
/** How many lines. Default 3. */
|
|
2111
|
+
lines?: number;
|
|
2112
|
+
/** Width of the last line. Default "62%". */
|
|
2113
|
+
lastLineWidth?: string;
|
|
2114
|
+
/** Line thickness, e.g. "0.75rem" for bigger text. */
|
|
2115
|
+
lineHeight?: string;
|
|
2116
|
+
width?: string | number;
|
|
2117
|
+
}
|
|
2118
|
+
/** Lines of text, with a shorter last line and a gentle ripple down the stack. */
|
|
2119
|
+
declare function SkeletonText({ lines, lastLineWidth, lineHeight, width, animation, className }: SkeletonTextProps): React.JSX.Element;
|
|
2120
|
+
interface SkeletonAvatarProps extends Common {
|
|
2121
|
+
/** Matches the Avatar sizes. */
|
|
2122
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
|
|
2123
|
+
shape?: "circle" | "square";
|
|
2124
|
+
}
|
|
2125
|
+
/** A round (or square) placeholder for a profile picture. */
|
|
2126
|
+
declare function SkeletonAvatar({ size, shape, animation, className }: SkeletonAvatarProps): React.JSX.Element;
|
|
2127
|
+
interface SkeletonButtonProps extends Common {
|
|
2128
|
+
size?: "sm" | "md" | "lg";
|
|
2129
|
+
width?: number | string;
|
|
2130
|
+
}
|
|
2131
|
+
/** A button-shaped placeholder. */
|
|
2132
|
+
declare function SkeletonButton({ size, width, animation, className }: SkeletonButtonProps): React.JSX.Element;
|
|
2133
|
+
interface SkeletonImageProps extends Common {
|
|
2134
|
+
/** e.g. "16/9" (default), "1/1", "4/3". */
|
|
2135
|
+
ratio?: string;
|
|
2136
|
+
radius?: string;
|
|
2137
|
+
}
|
|
2138
|
+
/** A picture-shaped placeholder that keeps its aspect ratio. */
|
|
2139
|
+
declare function SkeletonImage({ ratio, radius, animation, className }: SkeletonImageProps): React.JSX.Element;
|
|
2140
|
+
interface SkeletonCardProps extends Common {
|
|
2141
|
+
/** Show a picture at the top. */
|
|
2142
|
+
media?: boolean;
|
|
2143
|
+
/** Show an avatar and two short lines in the header. */
|
|
2144
|
+
header?: boolean;
|
|
2145
|
+
lines?: number;
|
|
2146
|
+
/** Show buttons at the bottom. */
|
|
2147
|
+
footer?: boolean;
|
|
2148
|
+
}
|
|
2149
|
+
/** A card-shaped placeholder: optional picture, header, lines of text and buttons. */
|
|
2150
|
+
declare function SkeletonCard({ media, header, lines, footer, animation, className }: SkeletonCardProps): React.JSX.Element;
|
|
2151
|
+
interface SkeletonListProps extends Common {
|
|
2152
|
+
/** How many rows. Default 5. */
|
|
2153
|
+
rows?: number;
|
|
2154
|
+
/** An avatar at the start of each row. Default true. */
|
|
2155
|
+
avatar?: boolean;
|
|
2156
|
+
/** A value at the end of each row (amount, date). Default true. */
|
|
2157
|
+
trailing?: boolean;
|
|
2158
|
+
/** Put a border and dividers around it. Default true. */
|
|
2159
|
+
bordered?: boolean;
|
|
2160
|
+
}
|
|
2161
|
+
/** Rows of a list: avatar, two lines, and a value on the right. */
|
|
2162
|
+
declare function SkeletonList({ rows, avatar, trailing, bordered, animation, className }: SkeletonListProps): React.JSX.Element;
|
|
2163
|
+
interface SkeletonTableProps extends Common {
|
|
2164
|
+
rows?: number;
|
|
2165
|
+
columns?: number;
|
|
2166
|
+
/** Show a header row. Default true. */
|
|
2167
|
+
header?: boolean;
|
|
2168
|
+
}
|
|
2169
|
+
/** A table-shaped placeholder that matches DataTable's rhythm. */
|
|
2170
|
+
declare function SkeletonTable({ rows, columns, header, animation, className }: SkeletonTableProps): React.JSX.Element;
|
|
2171
|
+
interface SkeletonChartProps extends Common {
|
|
2172
|
+
/** "bars" (default) or "line". */
|
|
2173
|
+
variant?: "bars" | "line";
|
|
2174
|
+
height?: number;
|
|
2175
|
+
bars?: number;
|
|
2176
|
+
}
|
|
2177
|
+
/** A chart-shaped placeholder for dashboard widgets. */
|
|
2178
|
+
declare function SkeletonChart({ variant, height, bars, animation, className }: SkeletonChartProps): React.JSX.Element;
|
|
2179
|
+
interface UseDelayedLoadingOptions {
|
|
2180
|
+
/** Wait this long before showing the skeleton, so quick loads never flash one. Default 180ms. */
|
|
2181
|
+
delay?: number;
|
|
2182
|
+
/** Once shown, keep it at least this long, so it isn't a blink. Default 500ms. */
|
|
2183
|
+
minDuration?: number;
|
|
2184
|
+
}
|
|
2185
|
+
/**
|
|
2186
|
+
* Turns a raw loading flag into one that's pleasant to look at: nothing for quick loads,
|
|
2187
|
+
* and no half-frame flicker for slow ones.
|
|
2188
|
+
*/
|
|
2189
|
+
declare function useDelayedLoading(loading: boolean, { delay, minDuration }?: UseDelayedLoadingOptions): boolean;
|
|
2190
|
+
interface SkeletonSwapProps extends UseDelayedLoadingOptions, React.HTMLAttributes<HTMLDivElement> {
|
|
2191
|
+
loading: boolean;
|
|
2192
|
+
/** What to show while loading, e.g. <SkeletonCard />. */
|
|
2193
|
+
skeleton: React.ReactNode;
|
|
2194
|
+
/** What's being loaded, for screen readers: "Loading invoices". */
|
|
2195
|
+
label?: string;
|
|
2196
|
+
/** Cross-fade in ms. Default 250. */
|
|
2197
|
+
fade?: number;
|
|
2198
|
+
}
|
|
2199
|
+
/** Shows a skeleton while loading, then cross-fades to the real content. */
|
|
2200
|
+
declare function SkeletonSwap({ loading, skeleton, label, fade, delay, minDuration, className, children, ...props }: SkeletonSwapProps): React.JSX.Element;
|
|
2201
|
+
|
|
2202
|
+
interface SignaturePadHandle {
|
|
2203
|
+
/** Wipe it. */
|
|
2204
|
+
clear: () => void;
|
|
2205
|
+
/** Remove the last stroke. */
|
|
2206
|
+
undo: () => void;
|
|
2207
|
+
isEmpty: () => boolean;
|
|
2208
|
+
/**
|
|
2209
|
+
* PNG (or another type) as a data URL. trim crops the empty space around the signature;
|
|
2210
|
+
* ink forces a color (store dark ink even when someone signs in dark mode).
|
|
2211
|
+
*/
|
|
2212
|
+
toDataURL: (options?: {
|
|
2213
|
+
type?: string;
|
|
2214
|
+
quality?: number;
|
|
2215
|
+
trim?: boolean;
|
|
2216
|
+
background?: string;
|
|
2217
|
+
scale?: number;
|
|
2218
|
+
ink?: string;
|
|
2219
|
+
}) => string;
|
|
2220
|
+
/** Vector SVG — sharp at any size, ideal for PDFs and print. */
|
|
2221
|
+
toSVG: (options?: {
|
|
2222
|
+
trim?: boolean;
|
|
2223
|
+
background?: string;
|
|
2224
|
+
ink?: string;
|
|
2225
|
+
}) => string;
|
|
2226
|
+
/** Load a saved PNG back in (for viewing; undo won't know its strokes). */
|
|
2227
|
+
fromDataURL: (dataUrl: string) => Promise<void>;
|
|
2228
|
+
canvas: HTMLCanvasElement | null;
|
|
2229
|
+
}
|
|
2230
|
+
interface SignaturePadProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
2231
|
+
/** Called whenever the drawing changes: a PNG data URL, or null when empty. */
|
|
2232
|
+
onChange?: (dataUrl: string | null) => void;
|
|
2233
|
+
onBegin?: () => void;
|
|
2234
|
+
onEnd?: () => void;
|
|
2235
|
+
/** Ink color. Default: the text color. */
|
|
2236
|
+
penColor?: string;
|
|
2237
|
+
/** Thinnest and thickest the ink gets, in px. Default [0.9, 2.6]. */
|
|
2238
|
+
penWidth?: [number, number];
|
|
2239
|
+
/** Height of the pad in px. Default 200. */
|
|
2240
|
+
height?: number;
|
|
2241
|
+
/** Background behind the ink. Default transparent (the card's own background shows through). */
|
|
2242
|
+
background?: string;
|
|
2243
|
+
/** The signing line and hint inside the pad. Default true. */
|
|
2244
|
+
guide?: boolean;
|
|
2245
|
+
/** Text next to the ✗ on the line. Default "Sign here". */
|
|
2246
|
+
guideLabel?: string;
|
|
2247
|
+
/** Clear and Undo buttons under the pad. Default true. */
|
|
2248
|
+
toolbar?: boolean;
|
|
2249
|
+
/** Extra buttons beside Clear and Undo. */
|
|
2250
|
+
actions?: React.ReactNode;
|
|
2251
|
+
/** Show a saved signature and don't allow drawing. */
|
|
2252
|
+
readOnly?: boolean;
|
|
2253
|
+
disabled?: boolean;
|
|
2254
|
+
/** A saved PNG to start from. */
|
|
2255
|
+
defaultValue?: string;
|
|
2256
|
+
/** Posts the signature (a PNG data URL) with the form. */
|
|
2257
|
+
name?: string;
|
|
2258
|
+
/**
|
|
2259
|
+
* Offer a "Type" tab that renders a typed name in a handwriting font — the accessible
|
|
2260
|
+
* alternative for people who can't draw with a mouse or finger.
|
|
2261
|
+
*/
|
|
2262
|
+
allowTyped?: boolean;
|
|
2263
|
+
/** Font for typed signatures. */
|
|
2264
|
+
typedFont?: string;
|
|
2265
|
+
}
|
|
2266
|
+
declare const SignaturePad: React.ForwardRefExoticComponent<SignaturePadProps & React.RefAttributes<SignaturePadHandle>>;
|
|
2267
|
+
|
|
2268
|
+
type AlertTone = "info" | "success" | "warning" | "danger" | "neutral";
|
|
2269
|
+
type AlertVariant = "soft" | "outline" | "accent" | "solid";
|
|
2270
|
+
interface AlertProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {
|
|
2271
|
+
/** Which kind of message this is. Sets the color and the default icon. */
|
|
2272
|
+
tone?: AlertTone;
|
|
2273
|
+
/** How it looks: a tinted panel, an outline, a colored edge, or filled. */
|
|
2274
|
+
variant?: AlertVariant;
|
|
2275
|
+
/** The headline, in bold. */
|
|
2276
|
+
title?: React.ReactNode;
|
|
2277
|
+
/** Your own icon (an icon-font class or an element), or `false` for none. */
|
|
2278
|
+
icon?: IconInput | false;
|
|
2279
|
+
/** A list of problems, rendered as bullets — e.g. `Object.values(errors)`. */
|
|
2280
|
+
items?: React.ReactNode[];
|
|
2281
|
+
/** Buttons or links shown under the message. */
|
|
2282
|
+
actions?: React.ReactNode;
|
|
2283
|
+
/** Adds the close button. */
|
|
2284
|
+
dismissible?: boolean;
|
|
2285
|
+
/** Called once the alert has finished collapsing. */
|
|
2286
|
+
onDismiss?: () => void;
|
|
2287
|
+
/** Close after this many milliseconds. Pauses while hovered or focused. */
|
|
2288
|
+
autoDismiss?: number;
|
|
2289
|
+
size?: "sm" | "md";
|
|
2290
|
+
/** Edge to edge with square corners, for the top of a page. */
|
|
2291
|
+
banner?: boolean;
|
|
2292
|
+
/**
|
|
2293
|
+
* How screen readers announce it. "auto" (the default) interrupts for danger and warning,
|
|
2294
|
+
* and waits for a pause otherwise. Use "off" for alerts already on the page at load.
|
|
2295
|
+
*/
|
|
2296
|
+
live?: "auto" | "polite" | "assertive" | "off";
|
|
2297
|
+
}
|
|
2298
|
+
declare const Alert: React.ForwardRefExoticComponent<AlertProps & React.RefAttributes<HTMLDivElement>>;
|
|
2299
|
+
|
|
2300
|
+
/** A value that can change by screen size: `4` or `{ base: 2, md: 4 }`. */
|
|
2301
|
+
type Responsive<T> = T | {
|
|
2302
|
+
base?: T;
|
|
2303
|
+
sm?: T;
|
|
2304
|
+
md?: T;
|
|
2305
|
+
lg?: T;
|
|
2306
|
+
};
|
|
2307
|
+
declare const alignMap: {
|
|
2308
|
+
readonly start: "flex-start";
|
|
2309
|
+
readonly center: "center";
|
|
2310
|
+
readonly end: "flex-end";
|
|
2311
|
+
readonly stretch: "stretch";
|
|
2312
|
+
readonly baseline: "baseline";
|
|
2313
|
+
};
|
|
2314
|
+
declare const justifyMap: {
|
|
2315
|
+
readonly start: "flex-start";
|
|
2316
|
+
readonly center: "center";
|
|
2317
|
+
readonly end: "flex-end";
|
|
2318
|
+
readonly between: "space-between";
|
|
2319
|
+
readonly around: "space-around";
|
|
2320
|
+
readonly evenly: "space-evenly";
|
|
2321
|
+
};
|
|
2322
|
+
type StackAlign = keyof typeof alignMap;
|
|
2323
|
+
type StackJustify = keyof typeof justifyMap;
|
|
2324
|
+
type StackDirection = "row" | "column" | "row-reverse" | "column-reverse";
|
|
2325
|
+
interface StackProps extends React.HTMLAttributes<HTMLElement> {
|
|
2326
|
+
/** "row" or "column" (the default), per screen size if you like. */
|
|
2327
|
+
direction?: Responsive<StackDirection>;
|
|
2328
|
+
/** Space between children, in spacing steps. */
|
|
2329
|
+
gap?: Responsive<number>;
|
|
2330
|
+
align?: Responsive<StackAlign>;
|
|
2331
|
+
justify?: Responsive<StackJustify>;
|
|
2332
|
+
/** Let a row fold onto a second line instead of overflowing. */
|
|
2333
|
+
wrap?: boolean;
|
|
2334
|
+
/** Draw a line between children. */
|
|
2335
|
+
divider?: boolean;
|
|
2336
|
+
/** Render as another element — "section", "ul", "nav"… */
|
|
2337
|
+
as?: React.ElementType;
|
|
2338
|
+
}
|
|
2339
|
+
/** Children in a row or a column with even spacing. */
|
|
2340
|
+
declare const Stack: React.ForwardRefExoticComponent<StackProps & React.RefAttributes<HTMLElement>>;
|
|
2341
|
+
interface GridProps extends React.HTMLAttributes<HTMLElement> {
|
|
2342
|
+
/** How many equal columns. */
|
|
2343
|
+
columns?: Responsive<number>;
|
|
2344
|
+
/**
|
|
2345
|
+
* Instead of a column count: fit as many columns as will hold this width and reflow.
|
|
2346
|
+
* Reacts to the grid's own width, so it works inside panels of unknown size.
|
|
2347
|
+
*/
|
|
2348
|
+
minChildWidth?: string;
|
|
2349
|
+
gap?: Responsive<number>;
|
|
2350
|
+
align?: Responsive<StackAlign>;
|
|
2351
|
+
as?: React.ElementType;
|
|
2352
|
+
}
|
|
2353
|
+
/** A grid of equal columns. */
|
|
2354
|
+
declare const Grid: React.ForwardRefExoticComponent<GridProps & React.RefAttributes<HTMLElement>>;
|
|
2355
|
+
interface GridItemProps extends React.HTMLAttributes<HTMLElement> {
|
|
2356
|
+
/** How many columns to take. Never exceeds the grid's column count, so nothing overflows. */
|
|
2357
|
+
span?: Responsive<number>;
|
|
2358
|
+
rowSpan?: number;
|
|
2359
|
+
as?: React.ElementType;
|
|
2360
|
+
}
|
|
2361
|
+
/** A grid child that spans several columns or rows. */
|
|
2362
|
+
declare const GridItem: React.ForwardRefExoticComponent<GridItemProps & React.RefAttributes<HTMLElement>>;
|
|
2363
|
+
interface ContainerProps extends React.HTMLAttributes<HTMLElement> {
|
|
2364
|
+
/** A preset width, or any CSS length. */
|
|
2365
|
+
size?: "sm" | "md" | "lg" | "xl" | "2xl" | "prose" | "full" | (string & {});
|
|
2366
|
+
/** Side padding, in spacing steps. */
|
|
2367
|
+
padding?: Responsive<number>;
|
|
2368
|
+
align?: "center" | "start";
|
|
2369
|
+
as?: React.ElementType;
|
|
2370
|
+
}
|
|
2371
|
+
/** Keeps content from getting too wide, and centers it. */
|
|
2372
|
+
declare const Container: React.ForwardRefExoticComponent<ContainerProps & React.RefAttributes<HTMLElement>>;
|
|
2373
|
+
interface CenterProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
2374
|
+
minHeight?: number | string;
|
|
2375
|
+
axis?: "both" | "horizontal" | "vertical";
|
|
2376
|
+
}
|
|
2377
|
+
/** Puts its children in the middle. */
|
|
2378
|
+
declare const Center: React.ForwardRefExoticComponent<CenterProps & React.RefAttributes<HTMLDivElement>>;
|
|
2379
|
+
/** Eats the free space in a row, pushing what follows to the end. */
|
|
2380
|
+
declare function Spacer({ className, ...rest }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
|
|
2381
|
+
interface AspectRatioProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
2382
|
+
/** "16/9", "1/1", "4/3"… */
|
|
2383
|
+
ratio?: string;
|
|
2384
|
+
}
|
|
2385
|
+
/** Keeps a box at a fixed shape; the child fills it and is cropped to fit. */
|
|
2386
|
+
declare const AspectRatio: React.ForwardRefExoticComponent<AspectRatioProps & React.RefAttributes<HTMLDivElement>>;
|
|
2387
|
+
interface DividerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
2388
|
+
orientation?: "horizontal" | "vertical";
|
|
2389
|
+
dashed?: boolean;
|
|
2390
|
+
/** Space above and below (or either side), in spacing steps. */
|
|
2391
|
+
spacing?: number;
|
|
2392
|
+
}
|
|
2393
|
+
/** A line between things, optionally with a word in the middle. */
|
|
2394
|
+
declare const Divider: React.ForwardRefExoticComponent<DividerProps & React.RefAttributes<HTMLDivElement>>;
|
|
2395
|
+
|
|
2396
|
+
type HeroBackground = "none" | "aurora" | "grid" | "dots" | "gradient" | "image";
|
|
2397
|
+
interface HeroProps extends Omit<React.HTMLAttributes<HTMLElement>, "title"> {
|
|
2398
|
+
/** What sits behind the words. */
|
|
2399
|
+
background?: HeroBackground;
|
|
2400
|
+
/** The photo for `background="image"`. */
|
|
2401
|
+
image?: string;
|
|
2402
|
+
/** How much the image is darkened, 0–1, so text stays readable. */
|
|
2403
|
+
overlay?: number;
|
|
2404
|
+
/** Force light text — set automatically for image backgrounds. */
|
|
2405
|
+
dark?: boolean;
|
|
2406
|
+
align?: "center" | "start";
|
|
2407
|
+
/** How tall it is. "screen" fills the first screenful. */
|
|
2408
|
+
size?: "sm" | "md" | "lg" | "screen";
|
|
2409
|
+
/** A screenshot or illustration, placed beside the words from medium screens up. */
|
|
2410
|
+
media?: React.ReactNode;
|
|
2411
|
+
/** The three colors the aurora and gradient backgrounds are mixed from. */
|
|
2412
|
+
colors?: [string, string, string];
|
|
2413
|
+
as?: React.ElementType;
|
|
2414
|
+
}
|
|
2415
|
+
/** The band at the top of a landing page. */
|
|
2416
|
+
declare const Hero: React.ForwardRefExoticComponent<HeroProps & React.RefAttributes<HTMLElement>>;
|
|
2417
|
+
interface HeroEyebrowProps extends React.HTMLAttributes<HTMLElement> {
|
|
2418
|
+
/** Makes it a link and adds a chevron. */
|
|
2419
|
+
href?: string;
|
|
2420
|
+
icon?: IconInput;
|
|
2421
|
+
}
|
|
2422
|
+
/** The small pill above the headline — an announcement, a version, a category. */
|
|
2423
|
+
declare function HeroEyebrow({ href, icon, className, children, ...rest }: HeroEyebrowProps): React.JSX.Element;
|
|
2424
|
+
interface HeroTitleProps extends React.HTMLAttributes<HTMLHeadingElement> {
|
|
2425
|
+
as?: "h1" | "h2";
|
|
2426
|
+
/** Fades the headline through the hero's colors. */
|
|
2427
|
+
gradient?: boolean;
|
|
2428
|
+
size?: "md" | "lg" | "xl";
|
|
2429
|
+
colors?: [string, string, string];
|
|
2430
|
+
}
|
|
2431
|
+
/** The headline. */
|
|
2432
|
+
declare function HeroTitle({ as: Tag, gradient, size, colors, className, style, children, ...rest }: HeroTitleProps): React.JSX.Element;
|
|
2433
|
+
/** The sentence under the headline. Keep it to a line or two. */
|
|
2434
|
+
declare function HeroSubtitle({ className, ...rest }: React.HTMLAttributes<HTMLParagraphElement>): React.JSX.Element;
|
|
2435
|
+
/** The buttons. Full width and stacked on phones, side by side from small screens up. */
|
|
2436
|
+
declare function HeroActions({ className, ...rest }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
|
|
2437
|
+
interface HeroStat {
|
|
2438
|
+
value: React.ReactNode;
|
|
2439
|
+
label: React.ReactNode;
|
|
2440
|
+
}
|
|
2441
|
+
interface HeroStatsProps extends React.HTMLAttributes<HTMLDListElement> {
|
|
2442
|
+
stats: HeroStat[];
|
|
2443
|
+
}
|
|
2444
|
+
/** A short row of proof points under the buttons. */
|
|
2445
|
+
declare function HeroStats({ stats, className, ...rest }: HeroStatsProps): React.JSX.Element;
|
|
2446
|
+
interface HeroLogosProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
2447
|
+
/** Names, or <img> elements for real logos. */
|
|
2448
|
+
logos: React.ReactNode[];
|
|
2449
|
+
label?: React.ReactNode;
|
|
2450
|
+
/** Scroll them endlessly instead of wrapping. Stops for prefers-reduced-motion. */
|
|
2451
|
+
marquee?: boolean;
|
|
2452
|
+
/** Seconds for one full pass. */
|
|
2453
|
+
speed?: number;
|
|
2454
|
+
}
|
|
2455
|
+
/** The "trusted by" strip. */
|
|
2456
|
+
declare function HeroLogos({ logos, label, marquee, speed, className, ...rest }: HeroLogosProps): React.JSX.Element;
|
|
2457
|
+
interface HeroMediaProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
2458
|
+
/** Wraps the content in browser chrome. */
|
|
2459
|
+
frame?: boolean;
|
|
2460
|
+
/** The address shown in the frame's bar. */
|
|
2461
|
+
url?: string;
|
|
2462
|
+
/** Drifts up and down forever. */
|
|
2463
|
+
float?: boolean;
|
|
2464
|
+
/** Turns it slightly, as if sitting on a desk. Flat on phones. */
|
|
2465
|
+
tilt?: boolean;
|
|
2466
|
+
}
|
|
2467
|
+
/** The screenshot beside the words. */
|
|
2468
|
+
declare function HeroMedia({ frame, url, float, tilt, className, children, ...rest }: HeroMediaProps): React.JSX.Element;
|
|
2469
|
+
|
|
2470
|
+
export { Accordion, AccordionItem, type AccordionItemProps, type AccordionProps, type AccordionStatus, AccordionToggleAll, ActivityIndicator, type ActivityIndicatorProps, type ActivitySize, type ActivityStep, ActivitySteps, type ActivityStepsProps, type ActivityTone, Alert, type AlertProps, type AlertTone, type AlertVariant, AreaChart, AspectRatio, type AspectRatioProps, Autocomplete, type AutocompleteItem, type AutocompleteProps, Avatar, AvatarGroup, type AvatarGroupProps, AvatarLabel, type AvatarLabelProps, type AvatarProps, type AvatarSize, type AvatarStatus, AvatarUpload, type AvatarUploadProps, BarChart, type BarChartProps, BarList, type BarListItem, type BarListProps, Blockquote, type BlockquoteProps, Button, type ButtonProps, CalendarHeatmap, type CalendarHeatmapProps, Card, CardBody, CardContent, CardDescription, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, CardLink, CardMedia, type CardMediaProps, type CardProps, CardTitle, Carousel, type CarouselHandle, type CarouselProps, CarouselSlide, type CarouselSlideProps, Center, type CenterProps, type ChartSeries, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, ChoiceCard, ChoiceCardGroup, type ChoiceCardGroupProps, type ChoiceCardProps, Code, Container, type ContainerProps, DashboardGrid, type DashboardGridProps, DataTable, type DataTableColumn, type DataTableProps, type DataTableQuery, type DataTableStatusState, type Datum, Divider, type DividerProps, DonutChart, type DonutChartProps, type DonutSlice, DropdownMenu, DropdownMenuCheckboxItem, type DropdownMenuCheckboxItemProps, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuGroup, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuLabel, type DropdownMenuProps, DropdownMenuRadioGroup, type DropdownMenuRadioGroupProps, DropdownMenuRadioItem, type DropdownMenuRadioItemProps, DropdownMenuSeparator, DropdownMenuTrigger, type DropdownMenuTriggerProps, Field, type FieldContextValue, type FieldProps, FileDropzone, type FileDropzoneProps, FileInput, type FileInputProps, FileList$1 as FileList, type FileListProps, FileUploadButton, type FileUploadButtonProps, Gauge, type GaugeProps, Grid, GridItem, type GridItemProps, type GridProps, Heading, type HeadingProps, type HeadingSize, Hero, HeroActions, type HeroBackground, HeroEyebrow, type HeroEyebrowProps, HeroLogos, type HeroLogosProps, HeroMedia, type HeroMediaProps, type HeroProps, type HeroStat, HeroStats, type HeroStatsProps, HeroSubtitle, HeroTitle, type HeroTitleProps, IconButton, type IconButtonProps, type IconButtonTone, type IconInput, Input, type InputProps, Kbd, type KbdProps, KpiCard, type KpiCardProps, Lead, LineChart, type LineChartProps, Link, type LinkProps, List, ListItem, type ListProps, LiveIndicator, type LiveIndicatorProps, LoadMore, type LoadMoreProps, LoadingOverlay, type LoadingOverlayProps, Mark, Modal, type ModalBackdrop, ModalBody, ModalClose, ModalContent, type ModalContentProps, ModalDescription, ModalFooter, ModalHeader, type ModalProps, ModalTitle, ModalTrigger, Pagination, type PaginationProps, type PerView, Pill, type PillAppearance, PillGroup, type PillGroupProps, PillOption, type PillOptionProps, type PillProps, type PillTone, ProgressBar, type ProgressBarProps, ProgressRing, type ProgressRingProps, Prose, type ProseProps, Radio, RadioGroup, type RadioGroupProps, type RadioProps, type Responsive, Roadmap, type RoadmapItem, type RoadmapProps, Select, type SelectOption, type SelectProps, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, type SidebarGroupProps, SidebarHeader, SidebarInset, SidebarNav, type SidebarNavItem, type SidebarNavProps, type SidebarProps, SidebarProvider, type SidebarProviderProps, SidebarTrigger, type SidebarTriggerProps, SignaturePad, type SignaturePadHandle, type SignaturePadProps, Skeleton, SkeletonAvatar, type SkeletonAvatarProps, SkeletonButton, type SkeletonButtonProps, SkeletonCard, type SkeletonCardProps, SkeletonChart, type SkeletonChartProps, SkeletonImage, type SkeletonImageProps, SkeletonList, type SkeletonListProps, type SkeletonProps, SkeletonSwap, type SkeletonSwapProps, SkeletonTable, type SkeletonTableProps, SkeletonText, type SkeletonTextProps, Slider, type SliderMark, type SliderProps, type SortState, Spacer, Sparkline, type SparklineProps, SplitButton, type SplitButtonProps, SpotlightText, type SpotlightTextProps, Stack, type StackAlign, type StackDirection, type StackJustify, type StackProps, Stat, StatGroup, type StatGroupProps, type StatProps, type StepStatus, Switch, type SwitchColor, type SwitchProps, type SwitchVariant, Tab, TabList, type TabListProps, TabPanel, type TabPanelProps, type TabProps, Tabs, type TabsProps, Text, type TextProps, type TextTone, Textarea, type TextareaProps, type ThemeConfig, ThemeProvider, type ThemeProviderProps, Timeline, TimelineCollapse, type TimelineCollapseProps, TimelineGroup, type TimelineGroupProps, TimelineItem, type TimelineItemProps, type TimelineProps, type TimelineStatus, type TimelineTone, type ToastData, type ToastOptions, type ToastType, Toaster, type ToasterPosition, type ToasterProps, type UploadFn, type UploadItem, type UploadStatus, type UseDelayedLoadingOptions, type UseFileUploadsOptions, WidgetCard, type WidgetCardProps, type XhrUploadOptions, buttonVariants, cardVariants, cn, describeAccept, fileMatchesAccept, formatBytes, formatCompact, formatTimelineDay, formatTimelineTime, getInitials, getPageItems, headingSizes, modalPanelVariants, niceTicks, pillVariants, renderIcon, textSizes, toast, useAccordion, useDelayedLoading, useField, useFileUploads, useModal, useSidebar, useTweenedNumbers, xhrUpload };
|