@flatwork-ui/react 0.0.0-stage → 0.1.1
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 +79 -2
- package/dist/index.cjs +1261 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +598 -0
- package/dist/index.d.ts +598 -0
- package/dist/index.js +1166 -0
- package/dist/index.js.map +1 -0
- package/dist/styles/flatwork-saas/flatwork-saas.css +454 -0
- package/dist/styles/flatwork-saas/fonts/geist-400.woff2 +0 -0
- package/dist/styles/flatwork-saas/fonts/geist-500.woff2 +0 -0
- package/dist/styles/flatwork-saas/fonts/geist-600.woff2 +0 -0
- package/dist/styles/flatwork-saas/fonts/plex-mono-400.woff2 +0 -0
- package/dist/styles/flatwork-saas/tokens.css +126 -0
- package/dist/styles/flatwork-saas/tokens.json +124 -0
- package/package.json +54 -4
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,598 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { HTMLAttributes, ElementType, ComponentPropsWithoutRef, ReactNode, ButtonHTMLAttributes, AnchorHTMLAttributes, InputHTMLAttributes, FieldsetHTMLAttributes, SelectHTMLAttributes, TextareaHTMLAttributes, CSSProperties, ReactElement, DetailsHTMLAttributes, ThHTMLAttributes, TableHTMLAttributes, SVGProps } from 'react';
|
|
3
|
+
|
|
4
|
+
/** Joins class names, skipping falsy values. */
|
|
5
|
+
declare function cx(...classes: Array<string | false | null | undefined>): string;
|
|
6
|
+
|
|
7
|
+
type ThemeMode = "dark" | "light" | "system";
|
|
8
|
+
interface FlatworkRootProps extends HTMLAttributes<HTMLDivElement> {
|
|
9
|
+
/** Colour mode. "system" follows prefers-color-scheme. Defaults to the theme's default (dark). */
|
|
10
|
+
mode?: ThemeMode;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The root every flatwork component must render inside: it carries the tokens,
|
|
14
|
+
* base font and colours. Wrap your app (or one region of it) once.
|
|
15
|
+
*/
|
|
16
|
+
declare const FlatworkRoot: react.ForwardRefExoticComponent<FlatworkRootProps & react.RefAttributes<HTMLDivElement>>;
|
|
17
|
+
type TextVariant = "display" | "title" | "heading" | "body" | "label" | "caption" | "mono";
|
|
18
|
+
type TextProps<T extends ElementType = "p"> = {
|
|
19
|
+
variant?: TextVariant;
|
|
20
|
+
muted?: boolean;
|
|
21
|
+
as?: T;
|
|
22
|
+
} & Omit<ComponentPropsWithoutRef<T>, "as">;
|
|
23
|
+
/** The type scale: display, title, heading, body, label, caption and mono. */
|
|
24
|
+
declare function Text<T extends ElementType = "p">({ variant, muted, as, className, ...props }: TextProps<T>): react.JSX.Element;
|
|
25
|
+
/** Keyboard key: <Kbd>⌘</Kbd> <Kbd>K</Kbd>. */
|
|
26
|
+
declare function Kbd(props: HTMLAttributes<HTMLElement>): react.JSX.Element;
|
|
27
|
+
interface SpinnerProps extends HTMLAttributes<HTMLSpanElement> {
|
|
28
|
+
size?: "md" | "lg";
|
|
29
|
+
/** Accessible label. Omit when the spinner sits next to visible text. */
|
|
30
|
+
label?: string;
|
|
31
|
+
}
|
|
32
|
+
declare function Spinner({ size, label, className, ...props }: SpinnerProps): react.JSX.Element;
|
|
33
|
+
/** Visually hidden text for screen readers. */
|
|
34
|
+
declare function VisuallyHidden({ children }: {
|
|
35
|
+
children: ReactNode;
|
|
36
|
+
}): react.JSX.Element;
|
|
37
|
+
|
|
38
|
+
type ButtonVariant = "primary" | "secondary" | "ghost" | "danger" | "link";
|
|
39
|
+
type ButtonSize = "sm" | "md" | "lg";
|
|
40
|
+
interface ButtonOwnProps {
|
|
41
|
+
variant?: ButtonVariant;
|
|
42
|
+
size?: ButtonSize;
|
|
43
|
+
/** Square icon-only button. Always pass an aria-label. */
|
|
44
|
+
iconOnly?: boolean;
|
|
45
|
+
/** Full width. */
|
|
46
|
+
block?: boolean;
|
|
47
|
+
/** Shows a spinner, sets aria-busy and disables the button. */
|
|
48
|
+
loading?: boolean;
|
|
49
|
+
/** Icon before the label. */
|
|
50
|
+
leadingIcon?: ReactNode;
|
|
51
|
+
/** Icon after the label (chevrons for menus, arrows for navigation). */
|
|
52
|
+
trailingIcon?: ReactNode;
|
|
53
|
+
}
|
|
54
|
+
type ButtonProps = ButtonOwnProps & ButtonHTMLAttributes<HTMLButtonElement>;
|
|
55
|
+
type ButtonLinkProps = ButtonOwnProps & AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
56
|
+
href: string;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* One primary action per view. Secondary for everything else, ghost inside
|
|
60
|
+
* toolbars and menus, danger only for destructive confirmation.
|
|
61
|
+
*/
|
|
62
|
+
declare const Button: react.ForwardRefExoticComponent<ButtonOwnProps & ButtonHTMLAttributes<HTMLButtonElement> & react.RefAttributes<HTMLButtonElement>>;
|
|
63
|
+
/** A link styled as a button. */
|
|
64
|
+
declare const ButtonLink: react.ForwardRefExoticComponent<ButtonOwnProps & AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
65
|
+
href: string;
|
|
66
|
+
} & react.RefAttributes<HTMLAnchorElement>>;
|
|
67
|
+
/** Joined secondary buttons for related actions. */
|
|
68
|
+
declare function ButtonGroup({ className, ...props }: HTMLAttributes<HTMLDivElement>): react.JSX.Element;
|
|
69
|
+
|
|
70
|
+
interface FieldProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
|
|
71
|
+
label: ReactNode;
|
|
72
|
+
/** Adds a muted "(optional)" to the label. */
|
|
73
|
+
optional?: boolean;
|
|
74
|
+
/** Help text below the control. Replaced by `error` when set. */
|
|
75
|
+
help?: ReactNode;
|
|
76
|
+
/** Error message; also marks the control aria-invalid. */
|
|
77
|
+
error?: ReactNode;
|
|
78
|
+
/** Something to the right of the label (a value, a counter). */
|
|
79
|
+
labelEnd?: ReactNode;
|
|
80
|
+
/** Set when the control is not a labelable element (a dropzone, a group); renders the label as text. */
|
|
81
|
+
labelAsText?: boolean;
|
|
82
|
+
id?: string;
|
|
83
|
+
children: ReactNode;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Every control sits in a field: label above, control, then help or error text.
|
|
87
|
+
* Labels are always visible; placeholders are examples, not labels.
|
|
88
|
+
*/
|
|
89
|
+
declare function Field({ label, optional, help, error, labelEnd, labelAsText, id, className, children, ...props }: FieldProps): react.JSX.Element;
|
|
90
|
+
interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size"> {
|
|
91
|
+
size?: "sm" | "md";
|
|
92
|
+
invalid?: boolean;
|
|
93
|
+
/** Set in Plex Mono, for machine values (IDs, hosts, ports, dates). */
|
|
94
|
+
mono?: boolean;
|
|
95
|
+
}
|
|
96
|
+
declare const Input: react.ForwardRefExoticComponent<InputProps & react.RefAttributes<HTMLInputElement>>;
|
|
97
|
+
interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
98
|
+
invalid?: boolean;
|
|
99
|
+
}
|
|
100
|
+
declare const Textarea: react.ForwardRefExoticComponent<TextareaProps & react.RefAttributes<HTMLTextAreaElement>>;
|
|
101
|
+
interface SelectProps extends SelectHTMLAttributes<HTMLSelectElement> {
|
|
102
|
+
invalid?: boolean;
|
|
103
|
+
}
|
|
104
|
+
/** Native select with the flatwork chevron. */
|
|
105
|
+
declare const Select: react.ForwardRefExoticComponent<SelectProps & react.RefAttributes<HTMLSelectElement>>;
|
|
106
|
+
/**
|
|
107
|
+
* An input with things attached: icons, prefixes like https://, suffixes like
|
|
108
|
+
* .buunk.org, or a button. Put an <Input> and <Affix>es inside.
|
|
109
|
+
*/
|
|
110
|
+
declare function InputGroup({ className, ...props }: HTMLAttributes<HTMLDivElement>): react.JSX.Element;
|
|
111
|
+
interface AffixProps extends HTMLAttributes<HTMLSpanElement> {
|
|
112
|
+
/** Boxed mono affix (https://, .buunk.org, port) instead of a plain icon/hint. */
|
|
113
|
+
boxed?: boolean;
|
|
114
|
+
/** Boxed affix placed after the input. */
|
|
115
|
+
end?: boolean;
|
|
116
|
+
}
|
|
117
|
+
declare function Affix({ boxed, end, className, ...props }: AffixProps): react.JSX.Element;
|
|
118
|
+
interface ChoiceProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type"> {
|
|
119
|
+
/** Text next to the control. */
|
|
120
|
+
label?: ReactNode;
|
|
121
|
+
/** Muted second line under the label. */
|
|
122
|
+
description?: ReactNode;
|
|
123
|
+
}
|
|
124
|
+
interface CheckboxProps extends ChoiceProps {
|
|
125
|
+
indeterminate?: boolean;
|
|
126
|
+
}
|
|
127
|
+
declare const Checkbox: react.ForwardRefExoticComponent<CheckboxProps & react.RefAttributes<HTMLInputElement>>;
|
|
128
|
+
declare const Radio: react.ForwardRefExoticComponent<ChoiceProps & react.RefAttributes<HTMLInputElement>>;
|
|
129
|
+
interface SwitchProps extends ChoiceProps {
|
|
130
|
+
/** Label on the left and switch on the right, full width (settings rows). */
|
|
131
|
+
spread?: boolean;
|
|
132
|
+
}
|
|
133
|
+
declare const Switch: react.ForwardRefExoticComponent<SwitchProps & react.RefAttributes<HTMLInputElement>>;
|
|
134
|
+
interface RangeProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type"> {
|
|
135
|
+
}
|
|
136
|
+
/** Slider. The filled part of the track follows the value. */
|
|
137
|
+
declare const Range: react.ForwardRefExoticComponent<RangeProps & react.RefAttributes<HTMLInputElement>>;
|
|
138
|
+
interface DropzoneProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "title"> {
|
|
139
|
+
title?: ReactNode;
|
|
140
|
+
hint?: ReactNode;
|
|
141
|
+
/** Called with the dropped or picked files. */
|
|
142
|
+
onFiles?: (files: FileList) => void;
|
|
143
|
+
}
|
|
144
|
+
/** File upload area: click to pick, or drag and drop. */
|
|
145
|
+
declare function Dropzone({ title, hint, onFiles, onChange, className, ...props }: DropzoneProps): react.JSX.Element;
|
|
146
|
+
interface FieldsetProps extends FieldsetHTMLAttributes<HTMLFieldSetElement> {
|
|
147
|
+
legend: ReactNode;
|
|
148
|
+
}
|
|
149
|
+
/** A bordered group of fields with a legend. */
|
|
150
|
+
declare function Fieldset({ legend, className, children, ...props }: FieldsetProps): react.JSX.Element;
|
|
151
|
+
|
|
152
|
+
type Tone = "info" | "success" | "warning" | "error" | "neutral";
|
|
153
|
+
interface AlertProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
|
154
|
+
tone?: Tone;
|
|
155
|
+
title?: ReactNode;
|
|
156
|
+
/** Replaces the tone's icon; pass null for none. */
|
|
157
|
+
icon?: ReactNode;
|
|
158
|
+
/** Shows a dismiss button. */
|
|
159
|
+
onDismiss?: () => void;
|
|
160
|
+
}
|
|
161
|
+
/** Inline, persistent message inside the content flow. Errors use role="alert". */
|
|
162
|
+
declare function Alert({ tone, title, icon, onDismiss, className, children, ...props }: AlertProps): react.JSX.Element;
|
|
163
|
+
interface ToastProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
|
164
|
+
tone?: Tone;
|
|
165
|
+
title: ReactNode;
|
|
166
|
+
description?: ReactNode;
|
|
167
|
+
/** Text buttons under the message (Undo, Retry). */
|
|
168
|
+
actions?: ReactNode;
|
|
169
|
+
onDismiss?: () => void;
|
|
170
|
+
}
|
|
171
|
+
declare function Toast({ tone, title, description, actions, onDismiss, className, ...props }: ToastProps): react.JSX.Element;
|
|
172
|
+
interface ToastOptions extends Omit<ToastProps, "onDismiss"> {
|
|
173
|
+
/** Milliseconds before it disappears; errors stay until dismissed. Default 5000. */
|
|
174
|
+
duration?: number;
|
|
175
|
+
}
|
|
176
|
+
interface ToastApi {
|
|
177
|
+
show: (toast: ToastOptions) => string;
|
|
178
|
+
dismiss: (id: string) => void;
|
|
179
|
+
}
|
|
180
|
+
/** Renders the bottom-right toast stack. Put it inside <FlatworkRoot>. */
|
|
181
|
+
declare function ToastProvider({ children }: {
|
|
182
|
+
children: ReactNode;
|
|
183
|
+
}): react.JSX.Element;
|
|
184
|
+
/** `const toast = useToast(); toast.show({ title: "Changes saved" })` */
|
|
185
|
+
declare function useToast(): ToastApi;
|
|
186
|
+
type BadgeTone = "neutral" | "accent" | "success" | "warning" | "error";
|
|
187
|
+
interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
188
|
+
tone?: BadgeTone;
|
|
189
|
+
/** Leading status dot. */
|
|
190
|
+
dot?: boolean;
|
|
191
|
+
/** Round accent counter (3, 99+). */
|
|
192
|
+
count?: boolean;
|
|
193
|
+
}
|
|
194
|
+
/** Read-only status. */
|
|
195
|
+
declare function Badge({ tone, dot, count, className, children, ...props }: BadgeProps): react.JSX.Element;
|
|
196
|
+
interface TagProps extends HTMLAttributes<HTMLSpanElement> {
|
|
197
|
+
onRemove?: () => void;
|
|
198
|
+
/** Accessible name for the remove button. Defaults to "Remove <text>". */
|
|
199
|
+
removeLabel?: string;
|
|
200
|
+
}
|
|
201
|
+
/** User-editable, removable token. */
|
|
202
|
+
declare function Tag({ onRemove, removeLabel, className, children, ...props }: TagProps): react.JSX.Element;
|
|
203
|
+
interface ProgressProps extends HTMLAttributes<HTMLDivElement> {
|
|
204
|
+
/** 0–max. Omit for an indeterminate bar. */
|
|
205
|
+
value?: number;
|
|
206
|
+
max?: number;
|
|
207
|
+
tone?: "accent" | "success" | "warning" | "error";
|
|
208
|
+
/** A measurement (storage, strength) instead of task progress. */
|
|
209
|
+
meter?: boolean;
|
|
210
|
+
}
|
|
211
|
+
declare function Progress({ value, max, tone, meter, className, ...props }: ProgressProps): react.JSX.Element;
|
|
212
|
+
interface SkeletonProps extends HTMLAttributes<HTMLSpanElement> {
|
|
213
|
+
width?: CSSProperties["width"];
|
|
214
|
+
height?: CSSProperties["height"];
|
|
215
|
+
circle?: boolean;
|
|
216
|
+
}
|
|
217
|
+
/** Loading placeholder in the shape of the content. */
|
|
218
|
+
declare function Skeleton({ width, height, circle, className, style, ...props }: SkeletonProps): react.JSX.Element;
|
|
219
|
+
interface EmptyStateProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
|
220
|
+
icon?: ReactNode;
|
|
221
|
+
title: ReactNode;
|
|
222
|
+
description?: ReactNode;
|
|
223
|
+
/** Usually one small primary button. */
|
|
224
|
+
action?: ReactNode;
|
|
225
|
+
}
|
|
226
|
+
declare function EmptyState({ icon, title, description, action, className, ...props }: EmptyStateProps): react.JSX.Element;
|
|
227
|
+
|
|
228
|
+
/** Floating list of actions or options. Use inside <DropdownMenu>, or on its own with role="listbox". */
|
|
229
|
+
declare const Menu: react.ForwardRefExoticComponent<HTMLAttributes<HTMLUListElement> & react.RefAttributes<HTMLUListElement>>;
|
|
230
|
+
declare function MenuLabel({ className, ...props }: HTMLAttributes<HTMLLIElement>): react.JSX.Element;
|
|
231
|
+
declare function MenuSeparator({ className, ...props }: HTMLAttributes<HTMLLIElement>): react.JSX.Element;
|
|
232
|
+
interface MenuItemProps extends HTMLAttributes<HTMLElement> {
|
|
233
|
+
icon?: ReactNode;
|
|
234
|
+
/** Keyboard shortcut, right-aligned in mono. */
|
|
235
|
+
shortcut?: ReactNode;
|
|
236
|
+
danger?: boolean;
|
|
237
|
+
/** Selected option in a single-choice menu; shows a check. */
|
|
238
|
+
selected?: boolean;
|
|
239
|
+
disabled?: boolean;
|
|
240
|
+
/** "li" for listbox options; default is a <button role="menuitem"> inside an <li>. */
|
|
241
|
+
as?: "button" | "li";
|
|
242
|
+
}
|
|
243
|
+
declare function MenuItem({ icon, shortcut, danger, selected, disabled, as, className, children, ...props }: MenuItemProps): react.JSX.Element;
|
|
244
|
+
|
|
245
|
+
type TriggerElement = ReactElement<Record<string, unknown>>;
|
|
246
|
+
interface TooltipProps {
|
|
247
|
+
/** Short label; never essential information. */
|
|
248
|
+
content: ReactNode;
|
|
249
|
+
/** Optional shortcut shown after the label. */
|
|
250
|
+
shortcut?: string;
|
|
251
|
+
/** A single focusable element, usually an icon button. */
|
|
252
|
+
children: TriggerElement;
|
|
253
|
+
/** Milliseconds before showing. Default 500. */
|
|
254
|
+
delay?: number;
|
|
255
|
+
}
|
|
256
|
+
/** Inverted label above a trigger, after a 500ms hover or on focus. */
|
|
257
|
+
declare function Tooltip({ content, shortcut, children, delay }: TooltipProps): react.JSX.Element;
|
|
258
|
+
interface PopoverProps extends Omit<HTMLAttributes<HTMLDivElement>, "content"> {
|
|
259
|
+
/** The element that toggles the popover, usually a button. */
|
|
260
|
+
trigger: TriggerElement;
|
|
261
|
+
children: ReactNode;
|
|
262
|
+
open?: boolean;
|
|
263
|
+
defaultOpen?: boolean;
|
|
264
|
+
onOpenChange?: (open: boolean) => void;
|
|
265
|
+
/** Align to the trigger's right edge. */
|
|
266
|
+
alignEnd?: boolean;
|
|
267
|
+
/** Accessible name of the popover. */
|
|
268
|
+
label?: string;
|
|
269
|
+
}
|
|
270
|
+
/** Non-modal panel anchored 8px below its trigger; closes on outside click and Esc. */
|
|
271
|
+
declare function Popover({ trigger, children, open: controlled, defaultOpen, onOpenChange, alignEnd, label, className, ...props }: PopoverProps): react.JSX.Element;
|
|
272
|
+
interface DropdownMenuProps {
|
|
273
|
+
trigger: TriggerElement;
|
|
274
|
+
/** <MenuItem>s, <MenuLabel>s and <MenuSeparator>s. Selecting an item closes the menu. */
|
|
275
|
+
children: ReactNode;
|
|
276
|
+
alignEnd?: boolean;
|
|
277
|
+
/** Accessible name of the menu. */
|
|
278
|
+
label?: string;
|
|
279
|
+
}
|
|
280
|
+
/** A button that opens a menu below it. Arrow keys move between items. */
|
|
281
|
+
declare function DropdownMenu({ trigger, children, alignEnd, label }: DropdownMenuProps): react.JSX.Element;
|
|
282
|
+
interface DialogProps extends Omit<HTMLAttributes<HTMLDialogElement>, "title"> {
|
|
283
|
+
open: boolean;
|
|
284
|
+
onClose: () => void;
|
|
285
|
+
title: ReactNode;
|
|
286
|
+
/** Muted line under the title. */
|
|
287
|
+
subtitle?: ReactNode;
|
|
288
|
+
/** Buttons, right-aligned in the footer. Secondary first, primary last. */
|
|
289
|
+
footer?: ReactNode;
|
|
290
|
+
/** Use for destructive confirmation; the dialog is announced as an alertdialog. */
|
|
291
|
+
alert?: boolean;
|
|
292
|
+
/** Hide the close button. */
|
|
293
|
+
hideClose?: boolean;
|
|
294
|
+
}
|
|
295
|
+
/** Modal dialog. Traps focus, closes on Esc and backdrop click, and returns focus to its trigger. */
|
|
296
|
+
declare function Dialog({ open, onClose, title, subtitle, footer, alert, hideClose, className, children, ...props }: DialogProps): react.JSX.Element;
|
|
297
|
+
/** Side sheet from the right edge, for forms and detail views. Same behaviour as Dialog. */
|
|
298
|
+
declare function Drawer({ open, onClose, title, subtitle, footer, hideClose, className, children, ...props }: Omit<DialogProps, "alert">): react.JSX.Element;
|
|
299
|
+
interface Command {
|
|
300
|
+
id: string;
|
|
301
|
+
label: string;
|
|
302
|
+
group?: string;
|
|
303
|
+
icon?: ReactNode;
|
|
304
|
+
shortcut?: string;
|
|
305
|
+
/** Extra words to match when searching. */
|
|
306
|
+
keywords?: string[];
|
|
307
|
+
onSelect: () => void;
|
|
308
|
+
}
|
|
309
|
+
interface CommandPaletteProps {
|
|
310
|
+
open: boolean;
|
|
311
|
+
onClose: () => void;
|
|
312
|
+
commands: Command[];
|
|
313
|
+
placeholder?: string;
|
|
314
|
+
/** Open with ⌘K / Ctrl+K. Default true; you still own the open state. */
|
|
315
|
+
onOpenShortcut?: () => void;
|
|
316
|
+
}
|
|
317
|
+
/** ⌘K palette: a combobox over a grouped listbox. Arrows move, ↵ runs, Esc closes. */
|
|
318
|
+
declare function CommandPalette({ open, onClose, commands, placeholder, onOpenShortcut }: CommandPaletteProps): react.JSX.Element;
|
|
319
|
+
|
|
320
|
+
interface TopNavProps extends HTMLAttributes<HTMLElement> {
|
|
321
|
+
/** Logo and product name, usually a link home. */
|
|
322
|
+
brand?: ReactNode;
|
|
323
|
+
/** Right side: search, notifications, avatar. */
|
|
324
|
+
end?: ReactNode;
|
|
325
|
+
/** Accessible name for the primary nav. */
|
|
326
|
+
navLabel?: string;
|
|
327
|
+
}
|
|
328
|
+
/** App top bar. Put plain links (or your router's links) as children; mark the current one with aria-current="page". */
|
|
329
|
+
declare function TopNav({ brand, end, navLabel, className, children, ...props }: TopNavProps): react.JSX.Element;
|
|
330
|
+
interface BrandProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
331
|
+
/** The square accent mark; usually a 14px icon or a letter. */
|
|
332
|
+
mark?: ReactNode;
|
|
333
|
+
}
|
|
334
|
+
declare function Brand({ mark, className, children, style, ...props }: BrandProps): react.JSX.Element;
|
|
335
|
+
declare function SideNav({ className, ...props }: HTMLAttributes<HTMLElement>): react.JSX.Element;
|
|
336
|
+
declare function NavGroupLabel({ className, ...props }: HTMLAttributes<HTMLSpanElement>): react.JSX.Element;
|
|
337
|
+
type NavItemProps<T extends ElementType = "a"> = {
|
|
338
|
+
icon?: ReactNode;
|
|
339
|
+
/** Right-aligned badge or count. */
|
|
340
|
+
badge?: ReactNode;
|
|
341
|
+
current?: boolean;
|
|
342
|
+
/** Your router's link component, e.g. Next.js Link. Default <a>. */
|
|
343
|
+
as?: T;
|
|
344
|
+
} & Omit<ComponentPropsWithoutRef<T>, "as">;
|
|
345
|
+
declare function NavItem<T extends ElementType = "a">({ icon, badge, current, as, className, children, ...props }: NavItemProps<T>): react.JSX.Element;
|
|
346
|
+
interface TabsProps {
|
|
347
|
+
value?: string;
|
|
348
|
+
defaultValue?: string;
|
|
349
|
+
onValueChange?: (value: string) => void;
|
|
350
|
+
children: ReactNode;
|
|
351
|
+
}
|
|
352
|
+
/** Tabs state. Contains a <TabList> and <TabPanel>s. */
|
|
353
|
+
declare function Tabs({ value: controlled, defaultValue, onValueChange, children }: TabsProps): react.JSX.Element;
|
|
354
|
+
declare function TabList({ className, ...props }: HTMLAttributes<HTMLDivElement>): react.JSX.Element;
|
|
355
|
+
interface TabProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "value"> {
|
|
356
|
+
value: string;
|
|
357
|
+
/** Count after the label. */
|
|
358
|
+
badge?: ReactNode;
|
|
359
|
+
}
|
|
360
|
+
declare function Tab({ value, badge, className, children, ...props }: TabProps): react.JSX.Element;
|
|
361
|
+
declare function TabPanel({ value, ...props }: HTMLAttributes<HTMLDivElement> & {
|
|
362
|
+
value: string;
|
|
363
|
+
}): react.JSX.Element | null;
|
|
364
|
+
interface SegmentedOption {
|
|
365
|
+
value: string;
|
|
366
|
+
label: ReactNode;
|
|
367
|
+
icon?: ReactNode;
|
|
368
|
+
/** Required when the option is icon-only. */
|
|
369
|
+
ariaLabel?: string;
|
|
370
|
+
}
|
|
371
|
+
interface SegmentedControlProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "defaultValue"> {
|
|
372
|
+
options: SegmentedOption[];
|
|
373
|
+
value?: string;
|
|
374
|
+
defaultValue?: string;
|
|
375
|
+
onValueChange?: (value: string) => void;
|
|
376
|
+
/** Accessible name of the group. */
|
|
377
|
+
label: string;
|
|
378
|
+
}
|
|
379
|
+
/** Switches between views of the same data (Day / Week / Month, grid / list). */
|
|
380
|
+
declare function SegmentedControl({ options, value: controlled, defaultValue, onValueChange, label, className, ...props }: SegmentedControlProps): react.JSX.Element;
|
|
381
|
+
interface Crumb {
|
|
382
|
+
label: ReactNode;
|
|
383
|
+
href?: string;
|
|
384
|
+
}
|
|
385
|
+
interface BreadcrumbProps extends HTMLAttributes<HTMLElement> {
|
|
386
|
+
items: Crumb[];
|
|
387
|
+
/** Render links with your router. Default <a href>. */
|
|
388
|
+
renderLink?: (crumb: Crumb) => ReactNode;
|
|
389
|
+
}
|
|
390
|
+
/** The last item is the current page. */
|
|
391
|
+
declare function Breadcrumb({ items, renderLink, className, ...props }: BreadcrumbProps): react.JSX.Element;
|
|
392
|
+
/** Page numbers to show: always first, last and the current ±1, with "…" gaps. */
|
|
393
|
+
declare function pageRange(page: number, count: number): Array<number | "gap">;
|
|
394
|
+
interface PaginationProps extends Omit<HTMLAttributes<HTMLElement>, "onChange"> {
|
|
395
|
+
page: number;
|
|
396
|
+
count: number;
|
|
397
|
+
onPageChange: (page: number) => void;
|
|
398
|
+
}
|
|
399
|
+
declare function Pagination({ page, count, onPageChange, className, ...props }: PaginationProps): react.JSX.Element;
|
|
400
|
+
interface StepperProps extends HTMLAttributes<HTMLOListElement> {
|
|
401
|
+
steps: ReactNode[];
|
|
402
|
+
/** Index of the current step; earlier steps show as done. */
|
|
403
|
+
current: number;
|
|
404
|
+
}
|
|
405
|
+
declare function Stepper({ steps, current, className, ...props }: StepperProps): react.JSX.Element;
|
|
406
|
+
|
|
407
|
+
declare function Card({ className, ...props }: HTMLAttributes<HTMLDivElement>): react.JSX.Element;
|
|
408
|
+
interface CardHeaderProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
|
409
|
+
title?: ReactNode;
|
|
410
|
+
subtitle?: ReactNode;
|
|
411
|
+
/** Right side: a badge, switch or button. */
|
|
412
|
+
action?: ReactNode;
|
|
413
|
+
}
|
|
414
|
+
declare function CardHeader({ title, subtitle, action, className, children, ...props }: CardHeaderProps): react.JSX.Element;
|
|
415
|
+
declare function CardBody({ className, ...props }: HTMLAttributes<HTMLDivElement>): react.JSX.Element;
|
|
416
|
+
declare function CardFooter({ className, ...props }: HTMLAttributes<HTMLDivElement>): react.JSX.Element;
|
|
417
|
+
interface StatCardProps extends HTMLAttributes<HTMLDivElement> {
|
|
418
|
+
label: ReactNode;
|
|
419
|
+
value: ReactNode;
|
|
420
|
+
/** Change indicator, usually a <Badge>. */
|
|
421
|
+
delta?: ReactNode;
|
|
422
|
+
caption?: ReactNode;
|
|
423
|
+
}
|
|
424
|
+
/** A metric: label, big mono value, change badge and context. */
|
|
425
|
+
declare function StatCard({ label, value, delta, caption, ...props }: StatCardProps): react.JSX.Element;
|
|
426
|
+
interface TableProps extends TableHTMLAttributes<HTMLTableElement> {
|
|
427
|
+
caption?: ReactNode;
|
|
428
|
+
/** Footer bar under the table: selection count, pagination. */
|
|
429
|
+
footer?: ReactNode;
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* 40px header, 48px rows, row hover. Write <thead>/<tbody> yourself; use
|
|
433
|
+
* className="fw-num" for right-aligned mono numbers, "fw-mono" for IDs and IPs,
|
|
434
|
+
* and "is-selected" on selected rows.
|
|
435
|
+
*/
|
|
436
|
+
declare function Table({ caption, footer, className, children, ...props }: TableProps): react.JSX.Element;
|
|
437
|
+
interface SortableHeaderProps extends ThHTMLAttributes<HTMLTableCellElement> {
|
|
438
|
+
sort?: "ascending" | "descending" | "none";
|
|
439
|
+
onSort?: () => void;
|
|
440
|
+
}
|
|
441
|
+
declare function SortableHeader({ sort, onSort, className, children, ...props }: SortableHeaderProps): react.JSX.Element;
|
|
442
|
+
declare function List({ className, ...props }: HTMLAttributes<HTMLUListElement>): react.JSX.Element;
|
|
443
|
+
interface ListItemProps extends Omit<HTMLAttributes<HTMLLIElement>, "title"> {
|
|
444
|
+
leading?: ReactNode;
|
|
445
|
+
title: ReactNode;
|
|
446
|
+
meta?: ReactNode;
|
|
447
|
+
trailing?: ReactNode;
|
|
448
|
+
}
|
|
449
|
+
declare function ListItem({ leading, title, meta, trailing, ...props }: ListItemProps): react.JSX.Element;
|
|
450
|
+
interface DescriptionListProps extends HTMLAttributes<HTMLDListElement> {
|
|
451
|
+
items: Array<{
|
|
452
|
+
term: ReactNode;
|
|
453
|
+
value: ReactNode;
|
|
454
|
+
mono?: boolean;
|
|
455
|
+
}>;
|
|
456
|
+
}
|
|
457
|
+
/** Key/value details. Mark machine values `mono`. */
|
|
458
|
+
declare function DescriptionList({ items, className, ...props }: DescriptionListProps): react.JSX.Element;
|
|
459
|
+
declare function Accordion({ className, ...props }: HTMLAttributes<HTMLDivElement>): react.JSX.Element;
|
|
460
|
+
interface AccordionItemProps extends Omit<DetailsHTMLAttributes<HTMLDetailsElement>, "title"> {
|
|
461
|
+
title: ReactNode;
|
|
462
|
+
}
|
|
463
|
+
declare function AccordionItem({ title, children, ...props }: AccordionItemProps): react.JSX.Element;
|
|
464
|
+
declare function CodeBlock({ className, ...props }: HTMLAttributes<HTMLPreElement>): react.JSX.Element;
|
|
465
|
+
declare function Divider({ label }: {
|
|
466
|
+
label?: ReactNode;
|
|
467
|
+
}): react.JSX.Element;
|
|
468
|
+
interface AvatarProps extends HTMLAttributes<HTMLSpanElement> {
|
|
469
|
+
/** Initials or an <img>. */
|
|
470
|
+
children: ReactNode;
|
|
471
|
+
size?: "sm" | "md" | "lg";
|
|
472
|
+
/** Square, for projects and organisations. */
|
|
473
|
+
square?: boolean;
|
|
474
|
+
/** Green online dot. */
|
|
475
|
+
online?: boolean;
|
|
476
|
+
}
|
|
477
|
+
declare function Avatar({ size, square, online, className, ...props }: AvatarProps): react.JSX.Element;
|
|
478
|
+
declare function AvatarGroup({ className, ...props }: HTMLAttributes<HTMLDivElement>): react.JSX.Element;
|
|
479
|
+
|
|
480
|
+
type IconProps = SVGProps<SVGSVGElement>;
|
|
481
|
+
declare const IconHome: {
|
|
482
|
+
(props: IconProps): react.JSX.Element;
|
|
483
|
+
displayName: string;
|
|
484
|
+
};
|
|
485
|
+
declare const IconUser: {
|
|
486
|
+
(props: IconProps): react.JSX.Element;
|
|
487
|
+
displayName: string;
|
|
488
|
+
};
|
|
489
|
+
declare const IconSettings: {
|
|
490
|
+
(props: IconProps): react.JSX.Element;
|
|
491
|
+
displayName: string;
|
|
492
|
+
};
|
|
493
|
+
declare const IconPlus: {
|
|
494
|
+
(props: IconProps): react.JSX.Element;
|
|
495
|
+
displayName: string;
|
|
496
|
+
};
|
|
497
|
+
declare const IconDownload: {
|
|
498
|
+
(props: IconProps): react.JSX.Element;
|
|
499
|
+
displayName: string;
|
|
500
|
+
};
|
|
501
|
+
declare const IconUpload: {
|
|
502
|
+
(props: IconProps): react.JSX.Element;
|
|
503
|
+
displayName: string;
|
|
504
|
+
};
|
|
505
|
+
declare const IconChevronDown: {
|
|
506
|
+
(props: IconProps): react.JSX.Element;
|
|
507
|
+
displayName: string;
|
|
508
|
+
};
|
|
509
|
+
declare const IconChevronUp: {
|
|
510
|
+
(props: IconProps): react.JSX.Element;
|
|
511
|
+
displayName: string;
|
|
512
|
+
};
|
|
513
|
+
declare const IconChevronRight: {
|
|
514
|
+
(props: IconProps): react.JSX.Element;
|
|
515
|
+
displayName: string;
|
|
516
|
+
};
|
|
517
|
+
declare const IconChevronLeft: {
|
|
518
|
+
(props: IconProps): react.JSX.Element;
|
|
519
|
+
displayName: string;
|
|
520
|
+
};
|
|
521
|
+
declare const IconArrowRight: {
|
|
522
|
+
(props: IconProps): react.JSX.Element;
|
|
523
|
+
displayName: string;
|
|
524
|
+
};
|
|
525
|
+
declare const IconPencil: {
|
|
526
|
+
(props: IconProps): react.JSX.Element;
|
|
527
|
+
displayName: string;
|
|
528
|
+
};
|
|
529
|
+
declare const IconCopy: {
|
|
530
|
+
(props: IconProps): react.JSX.Element;
|
|
531
|
+
displayName: string;
|
|
532
|
+
};
|
|
533
|
+
declare const IconMore: {
|
|
534
|
+
(props: IconProps): react.JSX.Element;
|
|
535
|
+
displayName: string;
|
|
536
|
+
};
|
|
537
|
+
declare const IconX: {
|
|
538
|
+
(props: IconProps): react.JSX.Element;
|
|
539
|
+
displayName: string;
|
|
540
|
+
};
|
|
541
|
+
declare const IconTrash: {
|
|
542
|
+
(props: IconProps): react.JSX.Element;
|
|
543
|
+
displayName: string;
|
|
544
|
+
};
|
|
545
|
+
declare const IconSearch: {
|
|
546
|
+
(props: IconProps): react.JSX.Element;
|
|
547
|
+
displayName: string;
|
|
548
|
+
};
|
|
549
|
+
declare const IconEye: {
|
|
550
|
+
(props: IconProps): react.JSX.Element;
|
|
551
|
+
displayName: string;
|
|
552
|
+
};
|
|
553
|
+
declare const IconInfo: {
|
|
554
|
+
(props: IconProps): react.JSX.Element;
|
|
555
|
+
displayName: string;
|
|
556
|
+
};
|
|
557
|
+
declare const IconCheckCircle: {
|
|
558
|
+
(props: IconProps): react.JSX.Element;
|
|
559
|
+
displayName: string;
|
|
560
|
+
};
|
|
561
|
+
declare const IconWarning: {
|
|
562
|
+
(props: IconProps): react.JSX.Element;
|
|
563
|
+
displayName: string;
|
|
564
|
+
};
|
|
565
|
+
declare const IconError: {
|
|
566
|
+
(props: IconProps): react.JSX.Element;
|
|
567
|
+
displayName: string;
|
|
568
|
+
};
|
|
569
|
+
declare const IconFolder: {
|
|
570
|
+
(props: IconProps): react.JSX.Element;
|
|
571
|
+
displayName: string;
|
|
572
|
+
};
|
|
573
|
+
declare const IconBell: {
|
|
574
|
+
(props: IconProps): react.JSX.Element;
|
|
575
|
+
displayName: string;
|
|
576
|
+
};
|
|
577
|
+
declare const IconChart: {
|
|
578
|
+
(props: IconProps): react.JSX.Element;
|
|
579
|
+
displayName: string;
|
|
580
|
+
};
|
|
581
|
+
declare const IconLock: {
|
|
582
|
+
(props: IconProps): react.JSX.Element;
|
|
583
|
+
displayName: string;
|
|
584
|
+
};
|
|
585
|
+
declare const IconGrid: {
|
|
586
|
+
(props: IconProps): react.JSX.Element;
|
|
587
|
+
displayName: string;
|
|
588
|
+
};
|
|
589
|
+
declare const IconList: {
|
|
590
|
+
(props: IconProps): react.JSX.Element;
|
|
591
|
+
displayName: string;
|
|
592
|
+
};
|
|
593
|
+
declare const IconCheck: {
|
|
594
|
+
(props: IconProps): react.JSX.Element;
|
|
595
|
+
displayName: string;
|
|
596
|
+
};
|
|
597
|
+
|
|
598
|
+
export { Accordion, AccordionItem, type AccordionItemProps, Affix, type AffixProps, Alert, type AlertProps, Avatar, AvatarGroup, type AvatarProps, Badge, type BadgeProps, type BadgeTone, Brand, type BrandProps, Breadcrumb, type BreadcrumbProps, Button, ButtonGroup, ButtonLink, type ButtonLinkProps, type ButtonProps, type ButtonSize, type ButtonVariant, Card, CardBody, CardFooter, CardHeader, type CardHeaderProps, Checkbox, type CheckboxProps, CodeBlock, type Command, CommandPalette, type CommandPaletteProps, type Crumb, DescriptionList, type DescriptionListProps, Dialog, type DialogProps, Divider, Drawer, DropdownMenu, type DropdownMenuProps, Dropzone, type DropzoneProps, EmptyState, type EmptyStateProps, Field, type FieldProps, Fieldset, type FieldsetProps, FlatworkRoot, type FlatworkRootProps, IconArrowRight, IconBell, IconChart, IconCheck, IconCheckCircle, IconChevronDown, IconChevronLeft, IconChevronRight, IconChevronUp, IconCopy, IconDownload, IconError, IconEye, IconFolder, IconGrid, IconHome, IconInfo, IconList, IconLock, IconMore, IconPencil, IconPlus, type IconProps, IconSearch, IconSettings, IconTrash, IconUpload, IconUser, IconWarning, IconX, Input, InputGroup, type InputProps, Kbd, List, ListItem, type ListItemProps, Menu, MenuItem, type MenuItemProps, MenuLabel, MenuSeparator, NavGroupLabel, NavItem, type NavItemProps, Pagination, type PaginationProps, Popover, type PopoverProps, Progress, type ProgressProps, Radio, Range, type RangeProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, Select, type SelectProps, SideNav, Skeleton, type SkeletonProps, SortableHeader, type SortableHeaderProps, Spinner, type SpinnerProps, StatCard, type StatCardProps, Stepper, type StepperProps, Switch, type SwitchProps, Tab, TabList, TabPanel, type TabProps, Table, type TableProps, Tabs, type TabsProps, Tag, type TagProps, Text, type TextProps, Textarea, type TextareaProps, type ThemeMode, Toast, type ToastOptions, type ToastProps, ToastProvider, type Tone, Tooltip, type TooltipProps, TopNav, type TopNavProps, VisuallyHidden, cx, pageRange, useToast };
|