@openwarelabs/ui 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/LICENSE +21 -0
- package/README.md +100 -2
- package/dist/components/Accordion/Accordion.d.cts +54 -0
- package/dist/components/Accordion/Accordion.d.ts +54 -0
- package/dist/components/Alert/Alert.d.cts +18 -0
- package/dist/components/Alert/Alert.d.ts +18 -0
- package/dist/components/Avatar/Avatar.d.cts +14 -0
- package/dist/components/Avatar/Avatar.d.ts +14 -0
- package/dist/components/Avatar/AvatarGroup.d.cts +28 -0
- package/dist/components/Avatar/AvatarGroup.d.ts +28 -0
- package/dist/components/Badge/Badge.d.cts +13 -0
- package/dist/components/Badge/Badge.d.ts +13 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.d.cts +33 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +33 -0
- package/dist/components/Button/Button.d.cts +42 -0
- package/dist/components/Button/Button.d.ts +42 -0
- package/dist/components/Button/ButtonGroup.d.cts +33 -0
- package/dist/components/Button/ButtonGroup.d.ts +33 -0
- package/dist/components/Calendar/Calendar.d.cts +31 -0
- package/dist/components/Calendar/Calendar.d.ts +31 -0
- package/dist/components/Calendar/DatePicker.d.cts +21 -0
- package/dist/components/Calendar/DatePicker.d.ts +21 -0
- package/dist/components/Calendar/dates.d.cts +15 -0
- package/dist/components/Calendar/dates.d.ts +15 -0
- package/dist/components/Card/Card.d.cts +18 -0
- package/dist/components/Card/Card.d.ts +18 -0
- package/dist/components/Checkbox/Checkbox.d.cts +59 -0
- package/dist/components/Checkbox/Checkbox.d.ts +59 -0
- package/dist/components/ChoiceCard/ChoiceCard.d.cts +14 -0
- package/dist/components/ChoiceCard/ChoiceCard.d.ts +14 -0
- package/dist/components/CodeBlock/CodeBlock.d.cts +50 -0
- package/dist/components/CodeBlock/CodeBlock.d.ts +50 -0
- package/dist/components/ColorPicker/ColorPicker.d.cts +62 -0
- package/dist/components/ColorPicker/ColorPicker.d.ts +62 -0
- package/dist/components/Combobox/Combobox.d.cts +42 -0
- package/dist/components/Combobox/Combobox.d.ts +42 -0
- package/dist/components/CommandPalette/CommandPalette.d.cts +27 -0
- package/dist/components/CommandPalette/CommandPalette.d.ts +27 -0
- package/dist/components/CommandPalette/filterCommands.d.cts +3 -0
- package/dist/components/CommandPalette/filterCommands.d.ts +3 -0
- package/dist/components/Dialog/Dialog.d.cts +42 -0
- package/dist/components/Dialog/Dialog.d.ts +42 -0
- package/dist/components/Drawer/Drawer.d.cts +23 -0
- package/dist/components/Drawer/Drawer.d.ts +23 -0
- package/dist/components/EmptyState/EmptyState.d.cts +18 -0
- package/dist/components/EmptyState/EmptyState.d.ts +18 -0
- package/dist/components/Field/Field.d.cts +18 -0
- package/dist/components/Field/Field.d.ts +18 -0
- package/dist/components/FileDropZone/FileDropZone.d.cts +29 -0
- package/dist/components/FileDropZone/FileDropZone.d.ts +29 -0
- package/dist/components/FileTree/FileTree.d.cts +29 -0
- package/dist/components/FileTree/FileTree.d.ts +29 -0
- package/dist/components/Input/Input.d.cts +18 -0
- package/dist/components/Input/Input.d.ts +18 -0
- package/dist/components/InputOTP/InputOTP.d.cts +31 -0
- package/dist/components/InputOTP/InputOTP.d.ts +31 -0
- package/dist/components/Kbd/Kbd.d.cts +5 -0
- package/dist/components/Kbd/Kbd.d.ts +5 -0
- package/dist/components/Layout/Layout.d.cts +50 -0
- package/dist/components/Layout/Layout.d.ts +50 -0
- package/dist/components/Marketing/Marketing.d.cts +39 -0
- package/dist/components/Marketing/Marketing.d.ts +39 -0
- package/dist/components/Menu/Menu.d.cts +43 -0
- package/dist/components/Menu/Menu.d.ts +43 -0
- package/dist/components/NavList/NavList.d.cts +27 -0
- package/dist/components/NavList/NavList.d.ts +27 -0
- package/dist/components/NumberField/NumberField.d.cts +23 -0
- package/dist/components/NumberField/NumberField.d.ts +23 -0
- package/dist/components/Pagination/Pagination.d.cts +24 -0
- package/dist/components/Pagination/Pagination.d.ts +24 -0
- package/dist/components/Popover/Popover.d.cts +30 -0
- package/dist/components/Popover/Popover.d.ts +30 -0
- package/dist/components/Progress/Progress.d.cts +41 -0
- package/dist/components/Progress/Progress.d.ts +41 -0
- package/dist/components/RadioGroup/RadioGroup.d.cts +36 -0
- package/dist/components/RadioGroup/RadioGroup.d.ts +36 -0
- package/dist/components/SearchField/SearchField.d.cts +17 -0
- package/dist/components/SearchField/SearchField.d.ts +17 -0
- package/dist/components/SegmentedControl/SegmentedControl.d.cts +32 -0
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +32 -0
- package/dist/components/Select/Select.d.cts +40 -0
- package/dist/components/Select/Select.d.ts +40 -0
- package/dist/components/Skeleton/Skeleton.d.cts +26 -0
- package/dist/components/Skeleton/Skeleton.d.ts +26 -0
- package/dist/components/Slider/Slider.d.cts +33 -0
- package/dist/components/Slider/Slider.d.ts +33 -0
- package/dist/components/Spinner/Spinner.d.cts +14 -0
- package/dist/components/Spinner/Spinner.d.ts +14 -0
- package/dist/components/Stat/Stat.d.cts +20 -0
- package/dist/components/Stat/Stat.d.ts +20 -0
- package/dist/components/Steps/Steps.d.cts +27 -0
- package/dist/components/Steps/Steps.d.ts +27 -0
- package/dist/components/Switch/Switch.d.cts +9 -0
- package/dist/components/Switch/Switch.d.ts +9 -0
- package/dist/components/Table/Table.d.cts +55 -0
- package/dist/components/Table/Table.d.ts +55 -0
- package/dist/components/Tabs/Tabs.d.cts +35 -0
- package/dist/components/Tabs/Tabs.d.ts +35 -0
- package/dist/components/Tag/Tag.d.cts +40 -0
- package/dist/components/Tag/Tag.d.ts +40 -0
- package/dist/components/Textarea/Textarea.d.cts +12 -0
- package/dist/components/Textarea/Textarea.d.ts +12 -0
- package/dist/components/Toast/Toast.d.cts +41 -0
- package/dist/components/Toast/Toast.d.ts +41 -0
- package/dist/components/Tooltip/Tooltip.d.cts +19 -0
- package/dist/components/Tooltip/Tooltip.d.ts +19 -0
- package/dist/components.css +5236 -0
- package/dist/fonts.css +3 -0
- package/dist/hooks/useControllableState.d.cts +5 -0
- package/dist/hooks/useControllableState.d.ts +5 -0
- package/dist/hooks/useFloating.d.cts +26 -0
- package/dist/hooks/useFloating.d.ts +26 -0
- package/dist/hooks/useIndicator.d.cts +8 -0
- package/dist/hooks/useIndicator.d.ts +8 -0
- package/dist/hooks/useMenuKeyboard.d.cts +12 -0
- package/dist/hooks/useMenuKeyboard.d.ts +12 -0
- package/dist/hooks/useModalDialog.d.cts +9 -0
- package/dist/hooks/useModalDialog.d.ts +9 -0
- package/dist/hooks/usePresence.d.cts +13 -0
- package/dist/hooks/usePresence.d.ts +13 -0
- package/dist/icons.d.cts +33 -0
- package/dist/icons.d.ts +33 -0
- package/dist/index.cjs +4622 -0
- package/dist/index.cjs.map +7 -0
- package/dist/index.d.cts +114 -0
- package/dist/index.d.ts +114 -0
- package/dist/index.js +4650 -0
- package/dist/index.js.map +7 -0
- package/dist/openware-ui.iife.js +8 -0
- package/dist/styles.css +5664 -0
- package/dist/tailwind.css +145 -0
- package/dist/tokens.css +427 -0
- package/dist/tokens.json +1163 -0
- package/dist/utils/brand.d.cts +30 -0
- package/dist/utils/brand.d.ts +30 -0
- package/dist/utils/copyText.d.cts +2 -0
- package/dist/utils/copyText.d.ts +2 -0
- package/dist/utils/cx.d.cts +4 -0
- package/dist/utils/cx.d.ts +4 -0
- package/dist/utils/resizeTextArea.d.cts +2 -0
- package/dist/utils/resizeTextArea.d.ts +2 -0
- package/dist/utils/text.d.cts +4 -0
- package/dist/utils/text.d.ts +4 -0
- package/package.json +83 -4
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export interface SelectOption {
|
|
3
|
+
value: string;
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
/** Plain text for type-to-find and the trigger's tooltip, when `label` isn't a string. */
|
|
6
|
+
textValue?: string;
|
|
7
|
+
/** A muted line under the label. */
|
|
8
|
+
description?: ReactNode;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface SelectGroup {
|
|
12
|
+
label: string;
|
|
13
|
+
options: SelectOption[];
|
|
14
|
+
}
|
|
15
|
+
export type SelectItem = SelectOption | SelectGroup;
|
|
16
|
+
export interface SelectProps {
|
|
17
|
+
value: string;
|
|
18
|
+
options: SelectItem[];
|
|
19
|
+
onChange(value: string): void;
|
|
20
|
+
"aria-label"?: string;
|
|
21
|
+
"aria-labelledby"?: string;
|
|
22
|
+
"aria-describedby"?: string;
|
|
23
|
+
id?: string;
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
/** Shown when no option matches `value`. Default "Select…". */
|
|
26
|
+
placeholder?: string;
|
|
27
|
+
size?: "sm" | "md";
|
|
28
|
+
isInvalid?: boolean;
|
|
29
|
+
/** Classes for the trigger, e.g. a width. */
|
|
30
|
+
className?: string;
|
|
31
|
+
/** Classes for the trigger's and options' text, e.g. a monospace class. */
|
|
32
|
+
valueClassName?: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* A dropdown: a button that opens a listbox of options, in place of a native <select>.
|
|
36
|
+
* It works with the keyboard like a select (arrows, Home/End, type to find, Enter/Space to pick,
|
|
37
|
+
* Escape/Tab to close), keeps focus on the trigger, and its menu sits in the top layer so it
|
|
38
|
+
* isn't clipped by dialogs or scroll areas.
|
|
39
|
+
*/
|
|
40
|
+
export declare function Select({ value, options, onChange, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, id, disabled, placeholder, size, isInvalid, className, valueClassName, }: SelectProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export interface SelectOption {
|
|
3
|
+
value: string;
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
/** Plain text for type-to-find and the trigger's tooltip, when `label` isn't a string. */
|
|
6
|
+
textValue?: string;
|
|
7
|
+
/** A muted line under the label. */
|
|
8
|
+
description?: ReactNode;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface SelectGroup {
|
|
12
|
+
label: string;
|
|
13
|
+
options: SelectOption[];
|
|
14
|
+
}
|
|
15
|
+
export type SelectItem = SelectOption | SelectGroup;
|
|
16
|
+
export interface SelectProps {
|
|
17
|
+
value: string;
|
|
18
|
+
options: SelectItem[];
|
|
19
|
+
onChange(value: string): void;
|
|
20
|
+
"aria-label"?: string;
|
|
21
|
+
"aria-labelledby"?: string;
|
|
22
|
+
"aria-describedby"?: string;
|
|
23
|
+
id?: string;
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
/** Shown when no option matches `value`. Default "Select…". */
|
|
26
|
+
placeholder?: string;
|
|
27
|
+
size?: "sm" | "md";
|
|
28
|
+
isInvalid?: boolean;
|
|
29
|
+
/** Classes for the trigger, e.g. a width. */
|
|
30
|
+
className?: string;
|
|
31
|
+
/** Classes for the trigger's and options' text, e.g. a monospace class. */
|
|
32
|
+
valueClassName?: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* A dropdown: a button that opens a listbox of options, in place of a native <select>.
|
|
36
|
+
* It works with the keyboard like a select (arrows, Home/End, type to find, Enter/Space to pick,
|
|
37
|
+
* Escape/Tab to close), keeps focus on the trigger, and its menu sits in the top layer so it
|
|
38
|
+
* isn't clipped by dialogs or scroll areas.
|
|
39
|
+
*/
|
|
40
|
+
export declare function Select({ value, options, onChange, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, id, disabled, placeholder, size, isInvalid, className, valueClassName, }: SelectProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type CSSProperties } from "react";
|
|
2
|
+
export interface SkeletonProps {
|
|
3
|
+
/** CSS width, e.g. "40%" or 120. Default 100%. */
|
|
4
|
+
width?: CSSProperties["width"];
|
|
5
|
+
/** CSS height. Default 14px. */
|
|
6
|
+
height?: CSSProperties["height"];
|
|
7
|
+
/** The lighter grey, for second lines and control shapes. */
|
|
8
|
+
soft?: boolean;
|
|
9
|
+
/** `bar` has round ends; `block` has the field corners, for control placeholders. */
|
|
10
|
+
shape?: "bar" | "block";
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
/** One grey placeholder bar. Wrap a group of them in something with role="status" and a label. */
|
|
14
|
+
export declare function Skeleton({ width, height, soft, shape, className }: SkeletonProps): import("react").JSX.Element;
|
|
15
|
+
export interface SkeletonRowsProps {
|
|
16
|
+
/** Read out by screen readers while it's showing. Default "Loading". */
|
|
17
|
+
label?: string;
|
|
18
|
+
rows?: number;
|
|
19
|
+
/** Waits this long before appearing, so content that loads quickly never flashes it. Default 150. */
|
|
20
|
+
delayMs?: number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* A placeholder in the shape of settings rows (a label and description on the left, a control on the right),
|
|
24
|
+
* so a panel keeps its layout while it loads.
|
|
25
|
+
*/
|
|
26
|
+
export declare function SkeletonRows({ label, rows, delayMs }: SkeletonRowsProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type CSSProperties } from "react";
|
|
2
|
+
export interface SkeletonProps {
|
|
3
|
+
/** CSS width, e.g. "40%" or 120. Default 100%. */
|
|
4
|
+
width?: CSSProperties["width"];
|
|
5
|
+
/** CSS height. Default 14px. */
|
|
6
|
+
height?: CSSProperties["height"];
|
|
7
|
+
/** The lighter grey, for second lines and control shapes. */
|
|
8
|
+
soft?: boolean;
|
|
9
|
+
/** `bar` has round ends; `block` has the field corners, for control placeholders. */
|
|
10
|
+
shape?: "bar" | "block";
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
/** One grey placeholder bar. Wrap a group of them in something with role="status" and a label. */
|
|
14
|
+
export declare function Skeleton({ width, height, soft, shape, className }: SkeletonProps): import("react").JSX.Element;
|
|
15
|
+
export interface SkeletonRowsProps {
|
|
16
|
+
/** Read out by screen readers while it's showing. Default "Loading". */
|
|
17
|
+
label?: string;
|
|
18
|
+
rows?: number;
|
|
19
|
+
/** Waits this long before appearing, so content that loads quickly never flashes it. Default 150. */
|
|
20
|
+
delayMs?: number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* A placeholder in the shape of settings rows (a label and description on the left, a control on the right),
|
|
24
|
+
* so a panel keeps its layout while it loads.
|
|
25
|
+
*/
|
|
26
|
+
export declare function SkeletonRows({ label, rows, delayMs }: SkeletonRowsProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
type SliderValue = number | [number, number];
|
|
3
|
+
export interface SliderProps<V extends SliderValue = number> {
|
|
4
|
+
/** A number, or a [low, high] pair for a range with two handles. */
|
|
5
|
+
value?: V;
|
|
6
|
+
defaultValue?: V;
|
|
7
|
+
onChange?(value: NoInfer<V>): void;
|
|
8
|
+
/** Called when the person lets go, for work too slow to do on every move. */
|
|
9
|
+
onChangeEnd?(value: NoInfer<V>): void;
|
|
10
|
+
/** @default 0 */
|
|
11
|
+
min?: number;
|
|
12
|
+
/** @default 100 */
|
|
13
|
+
max?: number;
|
|
14
|
+
/** @default 1 */
|
|
15
|
+
step?: number;
|
|
16
|
+
/** Shown above the track, and names the slider for screen readers. */
|
|
17
|
+
label?: ReactNode;
|
|
18
|
+
/** Shows the current value at the right of the label.
|
|
19
|
+
* @default true */
|
|
20
|
+
showValue?: boolean;
|
|
21
|
+
/** Turns a number into the text shown and read out, e.g. (v) => `${v}%`. */
|
|
22
|
+
formatValue?(value: number): string;
|
|
23
|
+
/** Names the slider when there's no visible label. */
|
|
24
|
+
"aria-label"?: string;
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
className?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Picks a number, or a range, by dragging. It's built on native range inputs, so the arrow keys,
|
|
30
|
+
* PageUp, PageDown, Home and End work as people expect.
|
|
31
|
+
*/
|
|
32
|
+
export declare function Slider<V extends SliderValue = number>({ value, defaultValue, onChange, onChangeEnd, min, max, step, label, showValue, formatValue, "aria-label": ariaLabel, disabled, className, }: SliderProps<V>): import("react").JSX.Element;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
type SliderValue = number | [number, number];
|
|
3
|
+
export interface SliderProps<V extends SliderValue = number> {
|
|
4
|
+
/** A number, or a [low, high] pair for a range with two handles. */
|
|
5
|
+
value?: V;
|
|
6
|
+
defaultValue?: V;
|
|
7
|
+
onChange?(value: NoInfer<V>): void;
|
|
8
|
+
/** Called when the person lets go, for work too slow to do on every move. */
|
|
9
|
+
onChangeEnd?(value: NoInfer<V>): void;
|
|
10
|
+
/** @default 0 */
|
|
11
|
+
min?: number;
|
|
12
|
+
/** @default 100 */
|
|
13
|
+
max?: number;
|
|
14
|
+
/** @default 1 */
|
|
15
|
+
step?: number;
|
|
16
|
+
/** Shown above the track, and names the slider for screen readers. */
|
|
17
|
+
label?: ReactNode;
|
|
18
|
+
/** Shows the current value at the right of the label.
|
|
19
|
+
* @default true */
|
|
20
|
+
showValue?: boolean;
|
|
21
|
+
/** Turns a number into the text shown and read out, e.g. (v) => `${v}%`. */
|
|
22
|
+
formatValue?(value: number): string;
|
|
23
|
+
/** Names the slider when there's no visible label. */
|
|
24
|
+
"aria-label"?: string;
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
className?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Picks a number, or a range, by dragging. It's built on native range inputs, so the arrow keys,
|
|
30
|
+
* PageUp, PageDown, Home and End work as people expect.
|
|
31
|
+
*/
|
|
32
|
+
export declare function Slider<V extends SliderValue = number>({ value, defaultValue, onChange, onChangeEnd, min, max, step, label, showValue, formatValue, "aria-label": ariaLabel, disabled, className, }: SliderProps<V>): import("react").JSX.Element;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface SpinnerProps {
|
|
2
|
+
/** sm 14px, md 20px, lg 28px.
|
|
3
|
+
* @default "md" */
|
|
4
|
+
size?: "sm" | "md" | "lg";
|
|
5
|
+
/** `primary` draws the arc in the progress colour; `current` takes the text colour, for use inside buttons.
|
|
6
|
+
* @default "primary" */
|
|
7
|
+
tone?: "primary" | "current";
|
|
8
|
+
/** Read out by screen readers. Pass an empty string when something nearby already says it's loading.
|
|
9
|
+
* @default "Loading" */
|
|
10
|
+
label?: string;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
/** A small spinning ring for work that takes a moment. */
|
|
14
|
+
export declare function Spinner({ size, tone, label, className }: SpinnerProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface SpinnerProps {
|
|
2
|
+
/** sm 14px, md 20px, lg 28px.
|
|
3
|
+
* @default "md" */
|
|
4
|
+
size?: "sm" | "md" | "lg";
|
|
5
|
+
/** `primary` draws the arc in the progress colour; `current` takes the text colour, for use inside buttons.
|
|
6
|
+
* @default "primary" */
|
|
7
|
+
tone?: "primary" | "current";
|
|
8
|
+
/** Read out by screen readers. Pass an empty string when something nearby already says it's loading.
|
|
9
|
+
* @default "Loading" */
|
|
10
|
+
label?: string;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
/** A small spinning ring for work that takes a moment. */
|
|
14
|
+
export declare function Spinner({ size, tone, label, className }: SpinnerProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export interface StatProps {
|
|
3
|
+
/** What's measured, in a few words: "Tokens this week". */
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
/** The number, formatted: "1.2M", "€48.20". */
|
|
6
|
+
value: ReactNode;
|
|
7
|
+
/** A 14px icon on a small tile beside the label. */
|
|
8
|
+
icon?: ReactNode;
|
|
9
|
+
/** The change since last time, as text: "+12%", "−3". */
|
|
10
|
+
change?: string;
|
|
11
|
+
/** Whether the change is good or bad. Worked out from a leading + or − when left out; costs going up are negative, so set it. */
|
|
12
|
+
changeTone?: "positive" | "negative" | "neutral";
|
|
13
|
+
/** A muted line under the value: "vs last week". */
|
|
14
|
+
description?: ReactNode;
|
|
15
|
+
/** Recent values for a small line chart under the number. */
|
|
16
|
+
trend?: number[];
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
/** One headline number with its label, change and trend, for overview cards. */
|
|
20
|
+
export declare function Stat({ label, value, icon, change, changeTone, description, trend, className }: StatProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export interface StatProps {
|
|
3
|
+
/** What's measured, in a few words: "Tokens this week". */
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
/** The number, formatted: "1.2M", "€48.20". */
|
|
6
|
+
value: ReactNode;
|
|
7
|
+
/** A 14px icon on a small tile beside the label. */
|
|
8
|
+
icon?: ReactNode;
|
|
9
|
+
/** The change since last time, as text: "+12%", "−3". */
|
|
10
|
+
change?: string;
|
|
11
|
+
/** Whether the change is good or bad. Worked out from a leading + or − when left out; costs going up are negative, so set it. */
|
|
12
|
+
changeTone?: "positive" | "negative" | "neutral";
|
|
13
|
+
/** A muted line under the value: "vs last week". */
|
|
14
|
+
description?: ReactNode;
|
|
15
|
+
/** Recent values for a small line chart under the number. */
|
|
16
|
+
trend?: number[];
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
/** One headline number with its label, change and trend, for overview cards. */
|
|
20
|
+
export declare function Stat({ label, value, icon, change, changeTone, description, trend, className }: StatProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export interface StepItem {
|
|
3
|
+
title: ReactNode;
|
|
4
|
+
/** A line under the title. Hidden once the step is done, in the vertical layout. */
|
|
5
|
+
description?: ReactNode;
|
|
6
|
+
/** A control on the right of the current step, such as a small Button. */
|
|
7
|
+
action?: ReactNode;
|
|
8
|
+
/** Overrides the status worked out from `current`. */
|
|
9
|
+
status?: "done" | "current" | "upcoming";
|
|
10
|
+
}
|
|
11
|
+
export interface StepsProps {
|
|
12
|
+
items: StepItem[];
|
|
13
|
+
/** The index of the step in progress. Steps before it are done. Use items.length when every step is done.
|
|
14
|
+
* @default 0 */
|
|
15
|
+
current?: number;
|
|
16
|
+
/** `vertical` is a first-run checklist; `horizontal` is a compact progress strip.
|
|
17
|
+
* @default "vertical" */
|
|
18
|
+
orientation?: "vertical" | "horizontal";
|
|
19
|
+
/** A heading above a vertical list, with a "2 of 4 done" count beside it. */
|
|
20
|
+
title?: ReactNode;
|
|
21
|
+
/** Names the list for screen readers when there's no title.
|
|
22
|
+
* @default "Steps" */
|
|
23
|
+
label?: string;
|
|
24
|
+
className?: string;
|
|
25
|
+
}
|
|
26
|
+
/** Numbered steps toward a goal. The current one is raised; finished ones are checked off. */
|
|
27
|
+
export declare function Steps({ items, current, orientation, title, label, className }: StepsProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export interface StepItem {
|
|
3
|
+
title: ReactNode;
|
|
4
|
+
/** A line under the title. Hidden once the step is done, in the vertical layout. */
|
|
5
|
+
description?: ReactNode;
|
|
6
|
+
/** A control on the right of the current step, such as a small Button. */
|
|
7
|
+
action?: ReactNode;
|
|
8
|
+
/** Overrides the status worked out from `current`. */
|
|
9
|
+
status?: "done" | "current" | "upcoming";
|
|
10
|
+
}
|
|
11
|
+
export interface StepsProps {
|
|
12
|
+
items: StepItem[];
|
|
13
|
+
/** The index of the step in progress. Steps before it are done. Use items.length when every step is done.
|
|
14
|
+
* @default 0 */
|
|
15
|
+
current?: number;
|
|
16
|
+
/** `vertical` is a first-run checklist; `horizontal` is a compact progress strip.
|
|
17
|
+
* @default "vertical" */
|
|
18
|
+
orientation?: "vertical" | "horizontal";
|
|
19
|
+
/** A heading above a vertical list, with a "2 of 4 done" count beside it. */
|
|
20
|
+
title?: ReactNode;
|
|
21
|
+
/** Names the list for screen readers when there's no title.
|
|
22
|
+
* @default "Steps" */
|
|
23
|
+
label?: string;
|
|
24
|
+
className?: string;
|
|
25
|
+
}
|
|
26
|
+
/** Numbered steps toward a goal. The current one is raised; finished ones are checked off. */
|
|
27
|
+
export declare function Steps({ items, current, orientation, title, label, className }: StepsProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ButtonHTMLAttributes } from "react";
|
|
2
|
+
export interface SwitchProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "onChange" | "value" | "type" | "role"> {
|
|
3
|
+
checked: boolean;
|
|
4
|
+
onChange(checked: boolean): void;
|
|
5
|
+
/** What it turns on, for screen readers. Leave it out only when aria-labelledby names it. */
|
|
6
|
+
label?: string;
|
|
7
|
+
}
|
|
8
|
+
/** A small on/off switch for settings rows; it takes effect at once, with no save button. */
|
|
9
|
+
export declare const Switch: import("react").ForwardRefExoticComponent<SwitchProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ButtonHTMLAttributes } from "react";
|
|
2
|
+
export interface SwitchProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "onChange" | "value" | "type" | "role"> {
|
|
3
|
+
checked: boolean;
|
|
4
|
+
onChange(checked: boolean): void;
|
|
5
|
+
/** What it turns on, for screen readers. Leave it out only when aria-labelledby names it. */
|
|
6
|
+
label?: string;
|
|
7
|
+
}
|
|
8
|
+
/** A small on/off switch for settings rows; it takes effect at once, with no save button. */
|
|
9
|
+
export declare const Switch: import("react").ForwardRefExoticComponent<SwitchProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { type Key, type ReactNode } from "react";
|
|
2
|
+
export interface TableColumn<Row> {
|
|
3
|
+
/** Unique; also the row field shown when there's no `render`. */
|
|
4
|
+
key: string;
|
|
5
|
+
header: ReactNode;
|
|
6
|
+
/** Numbers and amounts go at the end, so their digits line up.
|
|
7
|
+
* @default "start" */
|
|
8
|
+
align?: "start" | "center" | "end";
|
|
9
|
+
/** A CSS width, e.g. 120 or "30%". */
|
|
10
|
+
width?: number | string;
|
|
11
|
+
/** Lets the person sort by this column. */
|
|
12
|
+
sortable?: boolean;
|
|
13
|
+
/** What the cell shows. Defaults to the row's field named by `key`. */
|
|
14
|
+
render?(row: Row): ReactNode;
|
|
15
|
+
/** The value sorted by, when it isn't the field itself. */
|
|
16
|
+
sortValue?(row: Row): string | number;
|
|
17
|
+
}
|
|
18
|
+
export interface TableSort {
|
|
19
|
+
key: string;
|
|
20
|
+
direction: "ascending" | "descending";
|
|
21
|
+
}
|
|
22
|
+
export interface TableProps<Row> {
|
|
23
|
+
columns: Array<TableColumn<Row>>;
|
|
24
|
+
rows: Row[];
|
|
25
|
+
/** A field name or function giving each row a unique key.
|
|
26
|
+
* @default "id" */
|
|
27
|
+
rowKey?: keyof Row | ((row: Row) => Key);
|
|
28
|
+
/** Describes the table for screen readers; shown above it unless `hideCaption`. */
|
|
29
|
+
caption?: ReactNode;
|
|
30
|
+
/** @default false */
|
|
31
|
+
hideCaption?: boolean;
|
|
32
|
+
sort?: TableSort;
|
|
33
|
+
defaultSort?: TableSort;
|
|
34
|
+
onSortChange?(sort: TableSort): void;
|
|
35
|
+
/** Sort the rows yourself (e.g. on a server) and only show the arrows.
|
|
36
|
+
* @default false */
|
|
37
|
+
manualSort?: boolean;
|
|
38
|
+
/** Adds a checkbox column.
|
|
39
|
+
* @default "none" */
|
|
40
|
+
selectionMode?: "none" | "multiple";
|
|
41
|
+
selectedKeys?: Key[];
|
|
42
|
+
defaultSelectedKeys?: Key[];
|
|
43
|
+
onSelectionChange?(keys: Key[]): void;
|
|
44
|
+
/** Shown in place of the rows when there are none, such as an EmptyState. */
|
|
45
|
+
emptyContent?: ReactNode;
|
|
46
|
+
/** `compact` rows are 36px; `comfortable` 44px.
|
|
47
|
+
* @default "comfortable" */
|
|
48
|
+
density?: "compact" | "comfortable";
|
|
49
|
+
/** Keeps the header in view while the table scrolls; use with maxHeight. */
|
|
50
|
+
stickyHeader?: boolean;
|
|
51
|
+
maxHeight?: number | string;
|
|
52
|
+
className?: string;
|
|
53
|
+
}
|
|
54
|
+
/** Rows of records with sortable columns and optional selection, in a bordered card. */
|
|
55
|
+
export declare function Table<Row extends object>({ columns, rows, rowKey, caption, hideCaption, sort, defaultSort, onSortChange, manualSort, selectionMode, selectedKeys, defaultSelectedKeys, onSelectionChange, emptyContent, density, stickyHeader, maxHeight, className, }: TableProps<Row>): import("react").JSX.Element;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { type Key, type ReactNode } from "react";
|
|
2
|
+
export interface TableColumn<Row> {
|
|
3
|
+
/** Unique; also the row field shown when there's no `render`. */
|
|
4
|
+
key: string;
|
|
5
|
+
header: ReactNode;
|
|
6
|
+
/** Numbers and amounts go at the end, so their digits line up.
|
|
7
|
+
* @default "start" */
|
|
8
|
+
align?: "start" | "center" | "end";
|
|
9
|
+
/** A CSS width, e.g. 120 or "30%". */
|
|
10
|
+
width?: number | string;
|
|
11
|
+
/** Lets the person sort by this column. */
|
|
12
|
+
sortable?: boolean;
|
|
13
|
+
/** What the cell shows. Defaults to the row's field named by `key`. */
|
|
14
|
+
render?(row: Row): ReactNode;
|
|
15
|
+
/** The value sorted by, when it isn't the field itself. */
|
|
16
|
+
sortValue?(row: Row): string | number;
|
|
17
|
+
}
|
|
18
|
+
export interface TableSort {
|
|
19
|
+
key: string;
|
|
20
|
+
direction: "ascending" | "descending";
|
|
21
|
+
}
|
|
22
|
+
export interface TableProps<Row> {
|
|
23
|
+
columns: Array<TableColumn<Row>>;
|
|
24
|
+
rows: Row[];
|
|
25
|
+
/** A field name or function giving each row a unique key.
|
|
26
|
+
* @default "id" */
|
|
27
|
+
rowKey?: keyof Row | ((row: Row) => Key);
|
|
28
|
+
/** Describes the table for screen readers; shown above it unless `hideCaption`. */
|
|
29
|
+
caption?: ReactNode;
|
|
30
|
+
/** @default false */
|
|
31
|
+
hideCaption?: boolean;
|
|
32
|
+
sort?: TableSort;
|
|
33
|
+
defaultSort?: TableSort;
|
|
34
|
+
onSortChange?(sort: TableSort): void;
|
|
35
|
+
/** Sort the rows yourself (e.g. on a server) and only show the arrows.
|
|
36
|
+
* @default false */
|
|
37
|
+
manualSort?: boolean;
|
|
38
|
+
/** Adds a checkbox column.
|
|
39
|
+
* @default "none" */
|
|
40
|
+
selectionMode?: "none" | "multiple";
|
|
41
|
+
selectedKeys?: Key[];
|
|
42
|
+
defaultSelectedKeys?: Key[];
|
|
43
|
+
onSelectionChange?(keys: Key[]): void;
|
|
44
|
+
/** Shown in place of the rows when there are none, such as an EmptyState. */
|
|
45
|
+
emptyContent?: ReactNode;
|
|
46
|
+
/** `compact` rows are 36px; `comfortable` 44px.
|
|
47
|
+
* @default "comfortable" */
|
|
48
|
+
density?: "compact" | "comfortable";
|
|
49
|
+
/** Keeps the header in view while the table scrolls; use with maxHeight. */
|
|
50
|
+
stickyHeader?: boolean;
|
|
51
|
+
maxHeight?: number | string;
|
|
52
|
+
className?: string;
|
|
53
|
+
}
|
|
54
|
+
/** Rows of records with sortable columns and optional selection, in a bordered card. */
|
|
55
|
+
export declare function Table<Row extends object>({ columns, rows, rowKey, caption, hideCaption, sort, defaultSort, onSortChange, manualSort, selectionMode, selectedKeys, defaultSelectedKeys, onSelectionChange, emptyContent, density, stickyHeader, maxHeight, className, }: TableProps<Row>): import("react").JSX.Element;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type ButtonHTMLAttributes, type HTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
export interface TabsProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "defaultValue"> {
|
|
3
|
+
/** The selected tab's value. Leave out to let Tabs keep its own state. */
|
|
4
|
+
value?: string;
|
|
5
|
+
/** The tab selected first when uncontrolled. */
|
|
6
|
+
defaultValue?: string;
|
|
7
|
+
onValueChange?(value: string): void;
|
|
8
|
+
/** `segmented` raises the chosen tab in a well; `line` underlines it.
|
|
9
|
+
* @default "segmented" */
|
|
10
|
+
variant?: "segmented" | "line";
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
/** Views of the same thing, one at a time: TabList with Tabs, then a TabPanel for each. */
|
|
14
|
+
export declare function Tabs({ value, defaultValue, onValueChange, variant, className, children, ...props }: TabsProps): import("react").JSX.Element;
|
|
15
|
+
export interface TabListProps extends HTMLAttributes<HTMLDivElement> {
|
|
16
|
+
/** Names the set of tabs for screen readers. */
|
|
17
|
+
"aria-label"?: string;
|
|
18
|
+
}
|
|
19
|
+
/** The row of tabs. The arrow keys, Home and End move between them and select. */
|
|
20
|
+
export declare function TabList({ className, onKeyDown, children, ...props }: TabListProps): import("react").JSX.Element;
|
|
21
|
+
export interface TabProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "value"> {
|
|
22
|
+
value: string;
|
|
23
|
+
/** A 16px icon before the label. */
|
|
24
|
+
icon?: ReactNode;
|
|
25
|
+
}
|
|
26
|
+
/** One tab. Its `value` matches a TabPanel's. */
|
|
27
|
+
export declare function Tab({ value, icon, className, children, onClick, ...props }: TabProps): import("react").JSX.Element;
|
|
28
|
+
export interface TabPanelProps extends HTMLAttributes<HTMLDivElement> {
|
|
29
|
+
value: string;
|
|
30
|
+
/** Keep the panel in the page while hidden, so its state survives switching tabs.
|
|
31
|
+
* @default false */
|
|
32
|
+
keepMounted?: boolean;
|
|
33
|
+
}
|
|
34
|
+
/** The content for one tab. */
|
|
35
|
+
export declare function TabPanel({ value, keepMounted, className, children, ...props }: TabPanelProps): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type ButtonHTMLAttributes, type HTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
export interface TabsProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "defaultValue"> {
|
|
3
|
+
/** The selected tab's value. Leave out to let Tabs keep its own state. */
|
|
4
|
+
value?: string;
|
|
5
|
+
/** The tab selected first when uncontrolled. */
|
|
6
|
+
defaultValue?: string;
|
|
7
|
+
onValueChange?(value: string): void;
|
|
8
|
+
/** `segmented` raises the chosen tab in a well; `line` underlines it.
|
|
9
|
+
* @default "segmented" */
|
|
10
|
+
variant?: "segmented" | "line";
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
/** Views of the same thing, one at a time: TabList with Tabs, then a TabPanel for each. */
|
|
14
|
+
export declare function Tabs({ value, defaultValue, onValueChange, variant, className, children, ...props }: TabsProps): import("react").JSX.Element;
|
|
15
|
+
export interface TabListProps extends HTMLAttributes<HTMLDivElement> {
|
|
16
|
+
/** Names the set of tabs for screen readers. */
|
|
17
|
+
"aria-label"?: string;
|
|
18
|
+
}
|
|
19
|
+
/** The row of tabs. The arrow keys, Home and End move between them and select. */
|
|
20
|
+
export declare function TabList({ className, onKeyDown, children, ...props }: TabListProps): import("react").JSX.Element;
|
|
21
|
+
export interface TabProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "value"> {
|
|
22
|
+
value: string;
|
|
23
|
+
/** A 16px icon before the label. */
|
|
24
|
+
icon?: ReactNode;
|
|
25
|
+
}
|
|
26
|
+
/** One tab. Its `value` matches a TabPanel's. */
|
|
27
|
+
export declare function Tab({ value, icon, className, children, onClick, ...props }: TabProps): import("react").JSX.Element;
|
|
28
|
+
export interface TabPanelProps extends HTMLAttributes<HTMLDivElement> {
|
|
29
|
+
value: string;
|
|
30
|
+
/** Keep the panel in the page while hidden, so its state survives switching tabs.
|
|
31
|
+
* @default false */
|
|
32
|
+
keepMounted?: boolean;
|
|
33
|
+
}
|
|
34
|
+
/** The content for one tab. */
|
|
35
|
+
export declare function TabPanel({ value, keepMounted, className, children, ...props }: TabPanelProps): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from "react";
|
|
2
|
+
export interface TagProps extends HTMLAttributes<HTMLSpanElement> {
|
|
3
|
+
/** Shows a ✕ that calls this. */
|
|
4
|
+
onRemove?(): void;
|
|
5
|
+
/** `neutral` for labels and filters; `active` for the ones currently applied.
|
|
6
|
+
* @default "neutral" */
|
|
7
|
+
variant?: "neutral" | "active";
|
|
8
|
+
/** @default "md" */
|
|
9
|
+
size?: "sm" | "md";
|
|
10
|
+
/** A 14px icon or a ColorSwatch before the text. */
|
|
11
|
+
icon?: ReactNode;
|
|
12
|
+
/** What the ✕ removes, read out as "Remove …". Defaults to the text when it's a string. */
|
|
13
|
+
removeLabel?: string;
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
/** A label on something (a topic, a filter, a recipient) that can be removed. */
|
|
17
|
+
export declare function Tag({ onRemove, variant, size, icon, removeLabel, className, children, ...props }: TagProps): import("react").JSX.Element;
|
|
18
|
+
export interface TagGroupProps extends HTMLAttributes<HTMLDivElement> {
|
|
19
|
+
/** Names the set for screen readers, e.g. "Filters". */
|
|
20
|
+
label?: string;
|
|
21
|
+
children: ReactNode;
|
|
22
|
+
}
|
|
23
|
+
/** Tags in a wrapping row. */
|
|
24
|
+
export declare function TagGroup({ label, className, children, ...props }: TagGroupProps): import("react").JSX.Element;
|
|
25
|
+
export interface ColorSwatchProps {
|
|
26
|
+
/** Any CSS colour: "#312c7e", "var(--ow-brass)". */
|
|
27
|
+
color: string;
|
|
28
|
+
/** The colour's name, read out and shown beside the swatch. */
|
|
29
|
+
name?: string;
|
|
30
|
+
/** The value shown under the name, e.g. the hex. */
|
|
31
|
+
value?: string;
|
|
32
|
+
/** sm 16px, md 24px, lg 40px.
|
|
33
|
+
* @default "md" */
|
|
34
|
+
size?: "sm" | "md" | "lg";
|
|
35
|
+
/** @default "square" */
|
|
36
|
+
shape?: "square" | "circle";
|
|
37
|
+
className?: string;
|
|
38
|
+
}
|
|
39
|
+
/** A colour sample, with its name and value if given. */
|
|
40
|
+
export declare function ColorSwatch({ color, name, value, size, shape, className }: ColorSwatchProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from "react";
|
|
2
|
+
export interface TagProps extends HTMLAttributes<HTMLSpanElement> {
|
|
3
|
+
/** Shows a ✕ that calls this. */
|
|
4
|
+
onRemove?(): void;
|
|
5
|
+
/** `neutral` for labels and filters; `active` for the ones currently applied.
|
|
6
|
+
* @default "neutral" */
|
|
7
|
+
variant?: "neutral" | "active";
|
|
8
|
+
/** @default "md" */
|
|
9
|
+
size?: "sm" | "md";
|
|
10
|
+
/** A 14px icon or a ColorSwatch before the text. */
|
|
11
|
+
icon?: ReactNode;
|
|
12
|
+
/** What the ✕ removes, read out as "Remove …". Defaults to the text when it's a string. */
|
|
13
|
+
removeLabel?: string;
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
/** A label on something (a topic, a filter, a recipient) that can be removed. */
|
|
17
|
+
export declare function Tag({ onRemove, variant, size, icon, removeLabel, className, children, ...props }: TagProps): import("react").JSX.Element;
|
|
18
|
+
export interface TagGroupProps extends HTMLAttributes<HTMLDivElement> {
|
|
19
|
+
/** Names the set for screen readers, e.g. "Filters". */
|
|
20
|
+
label?: string;
|
|
21
|
+
children: ReactNode;
|
|
22
|
+
}
|
|
23
|
+
/** Tags in a wrapping row. */
|
|
24
|
+
export declare function TagGroup({ label, className, children, ...props }: TagGroupProps): import("react").JSX.Element;
|
|
25
|
+
export interface ColorSwatchProps {
|
|
26
|
+
/** Any CSS colour: "#312c7e", "var(--ow-brass)". */
|
|
27
|
+
color: string;
|
|
28
|
+
/** The colour's name, read out and shown beside the swatch. */
|
|
29
|
+
name?: string;
|
|
30
|
+
/** The value shown under the name, e.g. the hex. */
|
|
31
|
+
value?: string;
|
|
32
|
+
/** sm 16px, md 24px, lg 40px.
|
|
33
|
+
* @default "md" */
|
|
34
|
+
size?: "sm" | "md" | "lg";
|
|
35
|
+
/** @default "square" */
|
|
36
|
+
shape?: "square" | "circle";
|
|
37
|
+
className?: string;
|
|
38
|
+
}
|
|
39
|
+
/** A colour sample, with its name and value if given. */
|
|
40
|
+
export declare function ColorSwatch({ color, name, value, size, shape, className }: ColorSwatchProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type TextareaHTMLAttributes } from "react";
|
|
2
|
+
export interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
3
|
+
/** Grows with its text, up to `autoGrowMaxHeight`, then scrolls. */
|
|
4
|
+
autoGrow?: boolean;
|
|
5
|
+
/** The tallest an auto-growing box gets. A number is pixels. Default 180. */
|
|
6
|
+
autoGrowMaxHeight?: number | string;
|
|
7
|
+
/** Borderless and transparent, for use inside your own field container (a chat composer). */
|
|
8
|
+
bare?: boolean;
|
|
9
|
+
isInvalid?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/** A multi-line text field, 72px tall at least; it can grow with its text. */
|
|
12
|
+
export declare const Textarea: import("react").ForwardRefExoticComponent<TextareaProps & import("react").RefAttributes<HTMLTextAreaElement>>;
|