tensile 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +409 -0
- package/THIRD_PARTY_NOTICES +93 -0
- package/dist/CalendarView.d.ts +20 -0
- package/dist/Check.d.ts +4 -0
- package/dist/Expand.d.ts +34 -0
- package/dist/Menu.d.ts +18 -0
- package/dist/Modal.d.ts +14 -0
- package/dist/SeekBar.d.ts +20 -0
- package/dist/Sheet.d.ts +12 -0
- package/dist/SliderTrack.d.ts +18 -0
- package/dist/calendar.d.ts +12 -0
- package/dist/color.d.ts +16 -0
- package/dist/components/actions/ActionMenu.d.ts +12 -0
- package/dist/components/actions/Button.d.ts +12 -0
- package/dist/components/actions/CommandPalette.d.ts +15 -0
- package/dist/components/actions/CopyButton.d.ts +8 -0
- package/dist/components/actions/HoldButton.d.ts +11 -0
- package/dist/components/actions/IconButton.d.ts +5 -0
- package/dist/components/actions/MorphButton.d.ts +6 -0
- package/dist/components/actions/SelectionBar.d.ts +12 -0
- package/dist/components/actions/SwipeButton.d.ts +9 -0
- package/dist/components/actions/Toolbar.d.ts +7 -0
- package/dist/components/data-display/Avatar.d.ts +14 -0
- package/dist/components/data-display/AvatarGroup.d.ts +15 -0
- package/dist/components/data-display/BarChart.d.ts +13 -0
- package/dist/components/data-display/DataTable.d.ts +32 -0
- package/dist/components/data-display/DescriptionList.d.ts +8 -0
- package/dist/components/data-display/DonutChart.d.ts +17 -0
- package/dist/components/data-display/Icon.d.ts +9 -0
- package/dist/components/data-display/Kbd.d.ts +2 -0
- package/dist/components/data-display/LineChart.d.ts +13 -0
- package/dist/components/data-display/List.d.ts +16 -0
- package/dist/components/data-display/NumberTicker.d.ts +6 -0
- package/dist/components/data-display/StatTile.d.ts +15 -0
- package/dist/components/data-display/Table.d.ts +27 -0
- package/dist/components/data-display/Tag.d.ts +9 -0
- package/dist/components/data-display/Timeline.d.ts +13 -0
- package/dist/components/data-display/TreeView.d.ts +18 -0
- package/dist/components/feedback/Alert.d.ts +7 -0
- package/dist/components/feedback/Badge.d.ts +9 -0
- package/dist/components/feedback/EmptyState.d.ts +8 -0
- package/dist/components/feedback/LoadingState.d.ts +6 -0
- package/dist/components/feedback/NotificationList.d.ts +21 -0
- package/dist/components/feedback/ProgressBar.d.ts +8 -0
- package/dist/components/feedback/ProgressRing.d.ts +10 -0
- package/dist/components/feedback/Skeleton.d.ts +5 -0
- package/dist/components/feedback/Spinner.d.ts +7 -0
- package/dist/components/feedback/StatusBadge.d.ts +6 -0
- package/dist/components/feedback/Toast.d.ts +6 -0
- package/dist/components/feedback/ToastStack.d.ts +13 -0
- package/dist/components/inputs/Checkbox.d.ts +7 -0
- package/dist/components/inputs/CheckboxGroup.d.ts +15 -0
- package/dist/components/inputs/ColorPicker.d.ts +16 -0
- package/dist/components/inputs/ColorSwatches.d.ts +16 -0
- package/dist/components/inputs/Combobox.d.ts +18 -0
- package/dist/components/inputs/DatePicker.d.ts +6 -0
- package/dist/components/inputs/DateRangePicker.d.ts +9 -0
- package/dist/components/inputs/EditableText.d.ts +9 -0
- package/dist/components/inputs/Field.d.ts +52 -0
- package/dist/components/inputs/Fieldset.d.ts +9 -0
- package/dist/components/inputs/FileUpload.d.ts +16 -0
- package/dist/components/inputs/Input.d.ts +7 -0
- package/dist/components/inputs/MultiSelect.d.ts +20 -0
- package/dist/components/inputs/NumberInput.d.ts +11 -0
- package/dist/components/inputs/NumberStepper.d.ts +17 -0
- package/dist/components/inputs/OTPInput.d.ts +15 -0
- package/dist/components/inputs/PasswordInput.d.ts +6 -0
- package/dist/components/inputs/RadioGroup.d.ts +17 -0
- package/dist/components/inputs/RangeSlider.d.ts +16 -0
- package/dist/components/inputs/Rating.d.ts +17 -0
- package/dist/components/inputs/SearchField.d.ts +11 -0
- package/dist/components/inputs/Select.d.ts +18 -0
- package/dist/components/inputs/Slider.d.ts +15 -0
- package/dist/components/inputs/TagInput.d.ts +13 -0
- package/dist/components/inputs/TextField.d.ts +7 -0
- package/dist/components/inputs/Textarea.d.ts +5 -0
- package/dist/components/inputs/ThemeToggle.d.ts +9 -0
- package/dist/components/inputs/TimePicker.d.ts +27 -0
- package/dist/components/inputs/TimeWheel.d.ts +25 -0
- package/dist/components/inputs/Toggle.d.ts +7 -0
- package/dist/components/inputs/ToggleGroup.d.ts +15 -0
- package/dist/components/layout/Accordion.d.ts +12 -0
- package/dist/components/layout/AppShell.d.ts +12 -0
- package/dist/components/layout/Card.d.ts +5 -0
- package/dist/components/layout/ExpandableCard.d.ts +14 -0
- package/dist/components/layout/Footer.d.ts +14 -0
- package/dist/components/layout/Header.d.ts +16 -0
- package/dist/components/layout/PageHeader.d.ts +8 -0
- package/dist/components/layout/Separator.d.ts +5 -0
- package/dist/components/layout/SplitPane.d.ts +12 -0
- package/dist/components/media/Carousel.d.ts +24 -0
- package/dist/components/media/CompareSlider.d.ts +14 -0
- package/dist/components/media/Image.d.ts +8 -0
- package/dist/components/media/Lightbox.d.ts +15 -0
- package/dist/components/media/MusicPlayer.d.ts +16 -0
- package/dist/components/media/VideoControls.d.ts +21 -0
- package/dist/components/media/VolumeSlider.d.ts +10 -0
- package/dist/components/media/WaveformScrubber.d.ts +13 -0
- package/dist/components/navigation/Breadcrumbs.d.ts +19 -0
- package/dist/components/navigation/CollapsibleSidebar.d.ts +21 -0
- package/dist/components/navigation/Link.d.ts +12 -0
- package/dist/components/navigation/PageDots.d.ts +11 -0
- package/dist/components/navigation/Pagination.d.ts +18 -0
- package/dist/components/navigation/SegmentedTabs.d.ts +13 -0
- package/dist/components/navigation/SidebarNav.d.ts +17 -0
- package/dist/components/navigation/TabBar.d.ts +14 -0
- package/dist/components/navigation/Tabs.d.ts +14 -0
- package/dist/components/navigation/UnderlineTabs.d.ts +18 -0
- package/dist/components/navigation/WizardSteps.d.ts +16 -0
- package/dist/components/overlays/AlertDialog.d.ts +12 -0
- package/dist/components/overlays/BottomSheet.d.ts +9 -0
- package/dist/components/overlays/ContextMenu.d.ts +9 -0
- package/dist/components/overlays/Dialog.d.ts +12 -0
- package/dist/components/overlays/Drawer.d.ts +10 -0
- package/dist/components/overlays/Island.d.ts +17 -0
- package/dist/components/overlays/Popover.d.ts +19 -0
- package/dist/components/overlays/Tooltip.d.ts +19 -0
- package/dist/drag.d.ts +15 -0
- package/dist/focus.d.ts +2 -0
- package/dist/geist-cyrillic-ext-wght-normal.woff2 +0 -0
- package/dist/geist-cyrillic-wght-normal.woff2 +0 -0
- package/dist/geist-latin-ext-wght-normal.woff2 +0 -0
- package/dist/geist-latin-wght-normal.woff2 +0 -0
- package/dist/geist-vietnamese-wght-normal.woff2 +0 -0
- package/dist/icons.d.ts +12 -0
- package/dist/index.d.ts +105 -0
- package/dist/index.js +7972 -0
- package/dist/list.d.ts +18 -0
- package/dist/overlay.d.ts +22 -0
- package/dist/playback.d.ts +4 -0
- package/dist/reset.css +2 -0
- package/dist/springs.d.ts +27 -0
- package/dist/styles.css +2 -0
- package/dist/useSize.d.ts +7 -0
- package/dist/useWidth.d.ts +2 -0
- package/package.json +64 -0
package/dist/Sheet.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type SheetProps = {
|
|
2
|
+
open: boolean;
|
|
3
|
+
onOpenChange: (open: boolean) => void;
|
|
4
|
+
side: "bottom" | "left" | "right";
|
|
5
|
+
header: React.ReactNode;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
"aria-label"?: string;
|
|
8
|
+
"aria-labelledby"?: string;
|
|
9
|
+
className?: string;
|
|
10
|
+
};
|
|
11
|
+
export declare function Sheet({ open, onOpenChange, side, header, children, className, ...label }: SheetProps): import("react").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type SliderTrackProps = {
|
|
2
|
+
value: [number] | [number, number];
|
|
3
|
+
onValueChange: (index: number, value: number) => void;
|
|
4
|
+
min: number;
|
|
5
|
+
max: number;
|
|
6
|
+
step: number;
|
|
7
|
+
labels: string[];
|
|
8
|
+
formatValue: (value: number) => string;
|
|
9
|
+
id?: string;
|
|
10
|
+
labelledBy?: string;
|
|
11
|
+
describedBy?: string;
|
|
12
|
+
invalid?: boolean;
|
|
13
|
+
required?: boolean;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
className?: string;
|
|
16
|
+
};
|
|
17
|
+
export declare function SliderTrack({ className, ...props }: SliderTrackProps): import("react").JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type DateRange = {
|
|
2
|
+
start: string;
|
|
3
|
+
end: string;
|
|
4
|
+
};
|
|
5
|
+
export declare function toDate(day: string): Date;
|
|
6
|
+
export declare function toDay(date: Date): string;
|
|
7
|
+
export declare function addMonths(date: Date, months: number): Date;
|
|
8
|
+
export declare function monthDays(date: Date, firstDayOfWeek: number): string[];
|
|
9
|
+
export declare function keyboardDay(day: string, key: string, firstDayOfWeek: number): string | undefined;
|
|
10
|
+
export declare function clampDay(day: string, min?: string, max?: string): string;
|
|
11
|
+
export declare function orderedRange(first: string, second: string): DateRange;
|
|
12
|
+
export declare function isInRange(day: string, range: DateRange): boolean;
|
package/dist/color.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type Rgb = {
|
|
2
|
+
r: number;
|
|
3
|
+
g: number;
|
|
4
|
+
b: number;
|
|
5
|
+
};
|
|
6
|
+
export type Hsv = {
|
|
7
|
+
h: number;
|
|
8
|
+
s: number;
|
|
9
|
+
v: number;
|
|
10
|
+
};
|
|
11
|
+
export declare function hexToRgb(hex: string): Rgb;
|
|
12
|
+
export declare function rgbToHex({ r, g, b }: Rgb): string;
|
|
13
|
+
export declare function rgbToHsv({ r, g, b }: Rgb): Hsv;
|
|
14
|
+
export declare function hsvToRgb({ h, s, v }: Hsv): Rgb;
|
|
15
|
+
export declare function parseHex(text: string): string | null;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type MenuAction } from "../../Menu";
|
|
2
|
+
export type ActionMenuProps = {
|
|
3
|
+
actions: MenuAction[];
|
|
4
|
+
onAction: (action: MenuAction) => void;
|
|
5
|
+
label?: string;
|
|
6
|
+
menuLabel?: string;
|
|
7
|
+
trigger?: React.ReactNode;
|
|
8
|
+
/** `sm` is the 32 px trigger for dense rows, e.g. an icon trigger in a table. */
|
|
9
|
+
size?: "md" | "sm";
|
|
10
|
+
className?: string;
|
|
11
|
+
};
|
|
12
|
+
export declare function ActionMenu({ actions, onAction, label, menuLabel, trigger, size, className }: ActionMenuProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type ButtonProps = React.ComponentProps<"button"> & {
|
|
2
|
+
children: React.ReactNode;
|
|
3
|
+
variant?: "primary" | "secondary" | "ghost";
|
|
4
|
+
size?: "md" | "sm";
|
|
5
|
+
};
|
|
6
|
+
export declare const base = "inline-flex items-center justify-center whitespace-nowrap rounded-control font-medium outline-offset-2 focus-visible:outline-2 focus-visible:outline-focus enabled:press disabled:opacity-40";
|
|
7
|
+
export declare const variants: {
|
|
8
|
+
primary: string;
|
|
9
|
+
secondary: string;
|
|
10
|
+
ghost: string;
|
|
11
|
+
};
|
|
12
|
+
export declare function Button({ children, variant, size, type, className, ...props }: ButtonProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
type Command = {
|
|
2
|
+
label: string;
|
|
3
|
+
icon?: React.ReactNode;
|
|
4
|
+
};
|
|
5
|
+
export type CommandPaletteProps = {
|
|
6
|
+
commands: Command[];
|
|
7
|
+
onSelect: (command: Command) => void;
|
|
8
|
+
label?: string;
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
listLabel?: string;
|
|
11
|
+
emptyText?: string;
|
|
12
|
+
className?: string;
|
|
13
|
+
};
|
|
14
|
+
export declare function CommandPalette({ commands, onSelect, label, placeholder, listLabel, emptyText, className, }: CommandPaletteProps): import("react").JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type CopyButtonProps = {
|
|
2
|
+
/** Text written to the clipboard. */
|
|
3
|
+
value: string;
|
|
4
|
+
label?: string;
|
|
5
|
+
copiedLabel?: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare function CopyButton({ value, label, copiedLabel, className }: CopyButtonProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type HoldButtonProps = {
|
|
2
|
+
done: boolean;
|
|
3
|
+
/** Called when the fill reaches the end; set `done` to show the check. */
|
|
4
|
+
onDone: () => void;
|
|
5
|
+
children?: string;
|
|
6
|
+
doneLabel?: string;
|
|
7
|
+
/** How long to hold, in ms. */
|
|
8
|
+
duration?: number;
|
|
9
|
+
className?: string;
|
|
10
|
+
};
|
|
11
|
+
export declare function HoldButton({ done, onDone, children, doneLabel, duration, className, }: HoldButtonProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type MorphButtonProps = Omit<React.ComponentProps<"button">, "onDrag" | "onDragStart" | "onDragEnd" | "onAnimationStart"> & {
|
|
2
|
+
status: "idle" | "loading" | "success";
|
|
3
|
+
loadingLabel?: string;
|
|
4
|
+
successLabel?: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function MorphButton({ status, children, loadingLabel, successLabel, type, disabled, className, "aria-label": label, ...props }: MorphButtonProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type SelectionBarProps = {
|
|
2
|
+
/** The number of selected items; 0 hides the bar. */
|
|
3
|
+
count: number;
|
|
4
|
+
onClear: () => void;
|
|
5
|
+
/** The actions, e.g. ghost Buttons. */
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
label?: string;
|
|
8
|
+
countLabel?: (count: number) => string;
|
|
9
|
+
clearLabel?: string;
|
|
10
|
+
className?: string;
|
|
11
|
+
};
|
|
12
|
+
export declare function SelectionBar({ count, onClear, children, label, countLabel, clearLabel, className, }: SelectionBarProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type SwipeButtonProps = {
|
|
2
|
+
/** The done state. Set it to true in `onConfirm`, and back to false to let the user swipe again. */
|
|
3
|
+
confirmed: boolean;
|
|
4
|
+
onConfirm: () => void;
|
|
5
|
+
label?: string;
|
|
6
|
+
confirmedLabel?: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare function SwipeButton({ confirmed, onConfirm, label, confirmedLabel, className, }: SwipeButtonProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type AvatarProps = {
|
|
2
|
+
/** The accessible name, and the source of the initials. */
|
|
3
|
+
name: string;
|
|
4
|
+
src?: string;
|
|
5
|
+
/** 24, 32 or 44 px. */
|
|
6
|
+
size?: "sm" | "md" | "lg";
|
|
7
|
+
className?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const sizes: {
|
|
10
|
+
sm: string;
|
|
11
|
+
md: string;
|
|
12
|
+
lg: string;
|
|
13
|
+
};
|
|
14
|
+
export declare function Avatar({ name, src, size, className }: AvatarProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type AvatarGroupProps = {
|
|
2
|
+
people: {
|
|
3
|
+
name: string;
|
|
4
|
+
src?: string;
|
|
5
|
+
}[];
|
|
6
|
+
/** How many avatars show before the rest collapse into a "+N" circle. */
|
|
7
|
+
max?: number;
|
|
8
|
+
size?: "sm" | "md" | "lg";
|
|
9
|
+
/** Accessible name of the list. */
|
|
10
|
+
label?: string;
|
|
11
|
+
/** Accessible name of the "+N" circle. */
|
|
12
|
+
moreLabel?: (count: number) => string;
|
|
13
|
+
className?: string;
|
|
14
|
+
};
|
|
15
|
+
export declare function AvatarGroup({ people, max, size, label, moreLabel, className, }: AvatarGroupProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type Bar = {
|
|
2
|
+
label: string;
|
|
3
|
+
value: number;
|
|
4
|
+
};
|
|
5
|
+
export type BarChartProps = {
|
|
6
|
+
data: Bar[];
|
|
7
|
+
formatValue?: (value: number) => string;
|
|
8
|
+
/** Accessible summary of the chart. */
|
|
9
|
+
label?: string;
|
|
10
|
+
className?: string;
|
|
11
|
+
};
|
|
12
|
+
export declare function BarChart({ data, formatValue, label, className, }: BarChartProps): import("react").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { MenuAction } from "../../Menu";
|
|
2
|
+
import { type TableProps, type TableSort } from "./Table";
|
|
3
|
+
export type DataTableProps<Row> = Omit<TableProps<Row>, "columns" | "sort"> & {
|
|
4
|
+
columns: (TableProps<Row>["columns"][number] & {
|
|
5
|
+
sortable?: boolean;
|
|
6
|
+
})[];
|
|
7
|
+
sort: TableSort | null;
|
|
8
|
+
onSortChange: (sort: TableSort) => void;
|
|
9
|
+
/** Keys of the selected rows (from `rowKey`), on every page. */
|
|
10
|
+
selection: string[];
|
|
11
|
+
onSelectionChange: (selection: string[]) => void;
|
|
12
|
+
/** Current page, from 1 to `pageCount`. */
|
|
13
|
+
page: number;
|
|
14
|
+
pageCount: number;
|
|
15
|
+
onPageChange: (page: number) => void;
|
|
16
|
+
/** The actions in each row's menu; without it, there is no actions column. */
|
|
17
|
+
rowActions?: (row: Row) => MenuAction[];
|
|
18
|
+
onRowAction?: (row: Row, action: MenuAction) => void;
|
|
19
|
+
emptyText?: string;
|
|
20
|
+
selectAllLabel?: string;
|
|
21
|
+
selectRowLabel?: (row: Row) => string;
|
|
22
|
+
/** Describes the sortable column headers. */
|
|
23
|
+
sortLabel?: string;
|
|
24
|
+
/** The actions column's header, for screen readers. */
|
|
25
|
+
actionsLabel?: string;
|
|
26
|
+
rowActionsLabel?: (row: Row) => string;
|
|
27
|
+
paginationLabel?: string;
|
|
28
|
+
previousPageLabel?: string;
|
|
29
|
+
nextPageLabel?: string;
|
|
30
|
+
pageLabel?: (page: number) => string;
|
|
31
|
+
};
|
|
32
|
+
export declare function DataTable<Row>({ columns, rows, rowKey, caption, sort, onSortChange, selection, onSelectionChange, page, pageCount, onPageChange, loading, rowActions, onRowAction, emptyText, empty, selectAllLabel, selectRowLabel, sortLabel, actionsLabel, rowActionsLabel, paginationLabel, previousPageLabel, nextPageLabel, pageLabel, className, }: DataTableProps<Row>): import("react").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
type Segment = {
|
|
2
|
+
label: string;
|
|
3
|
+
value: number;
|
|
4
|
+
};
|
|
5
|
+
export type DonutChartProps = {
|
|
6
|
+
data: Segment[];
|
|
7
|
+
formatValue?: (value: number) => string;
|
|
8
|
+
/** Accessible summary of the chart. */
|
|
9
|
+
label?: string;
|
|
10
|
+
/** Shown in the center above the total. */
|
|
11
|
+
totalLabel?: string;
|
|
12
|
+
/** Read out for a segment, given its label and formatted value. */
|
|
13
|
+
segmentLabel?: (label: string, value: string) => string;
|
|
14
|
+
className?: string;
|
|
15
|
+
};
|
|
16
|
+
export declare function DonutChart({ data, formatValue, label, totalLabel, segmentLabel, className, }: DonutChartProps): import("react").JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type IconProps = {
|
|
2
|
+
/** Shapes on a 24 × 24 grid, e.g. `<path d="…" />`. */
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
/** Rendered size in px. The stroke follows it, so every line renders at 1.5 px. */
|
|
5
|
+
size?: number;
|
|
6
|
+
className?: string;
|
|
7
|
+
};
|
|
8
|
+
/** A line icon in the current text color, hidden from screen readers: the control around it carries the name. */
|
|
9
|
+
export declare function Icon({ children, size, className }: IconProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type Point = {
|
|
2
|
+
label: string;
|
|
3
|
+
value: number;
|
|
4
|
+
};
|
|
5
|
+
export type LineChartProps = {
|
|
6
|
+
data: Point[];
|
|
7
|
+
formatValue?: (value: number) => string;
|
|
8
|
+
/** Accessible summary of the chart. */
|
|
9
|
+
label?: string;
|
|
10
|
+
className?: string;
|
|
11
|
+
};
|
|
12
|
+
export declare function LineChart({ data, formatValue, label, className, }: LineChartProps): import("react").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type ListProps = {
|
|
2
|
+
items: {
|
|
3
|
+
id: string;
|
|
4
|
+
title: string;
|
|
5
|
+
description?: React.ReactNode;
|
|
6
|
+
leading?: React.ReactNode;
|
|
7
|
+
trailing?: React.ReactNode;
|
|
8
|
+
}[];
|
|
9
|
+
/** Names the list when no visible heading does. */
|
|
10
|
+
label?: string;
|
|
11
|
+
className?: string;
|
|
12
|
+
};
|
|
13
|
+
export declare function ListContent({ item }: {
|
|
14
|
+
item: ListProps["items"][number];
|
|
15
|
+
}): import("react").JSX.Element;
|
|
16
|
+
export declare function List({ items, label, className }: ListProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type StatTileProps = {
|
|
2
|
+
value: number;
|
|
3
|
+
/** Change as a fraction: 0.12 is up 12%, -0.04 is down 4%. */
|
|
4
|
+
change: number;
|
|
5
|
+
label?: string;
|
|
6
|
+
formatValue?: (value: number) => string;
|
|
7
|
+
/** Gets the signed change; the default shows only its size. */
|
|
8
|
+
formatChange?: (change: number) => string;
|
|
9
|
+
/** Read out instead of the up arrow, given the formatted change. */
|
|
10
|
+
upLabel?: (change: string) => string;
|
|
11
|
+
/** Read out instead of the down arrow, given the formatted change. */
|
|
12
|
+
downLabel?: (change: string) => string;
|
|
13
|
+
className?: string;
|
|
14
|
+
};
|
|
15
|
+
export declare function StatTile({ value, change, label, formatValue, formatChange, upLabel, downLabel, className, }: StatTileProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export type TableSort = {
|
|
2
|
+
key: string;
|
|
3
|
+
direction: "ascending" | "descending";
|
|
4
|
+
};
|
|
5
|
+
export type TableProps<Row> = {
|
|
6
|
+
columns: {
|
|
7
|
+
key: string;
|
|
8
|
+
header: React.ReactNode;
|
|
9
|
+
/** The cell's content; without it, the cell shows `row[key]`. Cells keep to one line unless their content sets `whitespace-normal`. */
|
|
10
|
+
cell?: (row: Row) => React.ReactNode;
|
|
11
|
+
align?: "start" | "end";
|
|
12
|
+
/** The column's cells are row headers, which name their rows. */
|
|
13
|
+
rowHeader?: boolean;
|
|
14
|
+
}[];
|
|
15
|
+
rows: Row[];
|
|
16
|
+
rowKey: (row: Row) => string;
|
|
17
|
+
/** Names the table for screen readers; not shown. */
|
|
18
|
+
caption: string;
|
|
19
|
+
/** Marks the sorted column's header with `aria-sort`. */
|
|
20
|
+
sort?: TableSort | null;
|
|
21
|
+
/** Shows placeholder rows instead of `rows` and marks the table busy. */
|
|
22
|
+
loading?: boolean;
|
|
23
|
+
/** Fills one row spanning every column when there are no rows. */
|
|
24
|
+
empty?: React.ReactNode;
|
|
25
|
+
className?: string;
|
|
26
|
+
};
|
|
27
|
+
export declare function Table<Row>({ columns, rows, rowKey, caption, sort, loading, empty, className, }: TableProps<Row>): import("react").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type TagProps = {
|
|
2
|
+
label: string;
|
|
3
|
+
icon?: React.ReactNode;
|
|
4
|
+
/** Shows a remove button beside the label that calls it. */
|
|
5
|
+
onRemove?: () => void;
|
|
6
|
+
removeLabel?: (label: string) => string;
|
|
7
|
+
className?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare function Tag({ label, icon, onRemove, removeLabel, className, }: TagProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type TimelineProps = {
|
|
2
|
+
items: {
|
|
3
|
+
id: string;
|
|
4
|
+
title: string;
|
|
5
|
+
description?: React.ReactNode;
|
|
6
|
+
time?: string;
|
|
7
|
+
icon?: React.ReactNode;
|
|
8
|
+
}[];
|
|
9
|
+
/** Names the list when no visible heading does. */
|
|
10
|
+
label?: string;
|
|
11
|
+
className?: string;
|
|
12
|
+
};
|
|
13
|
+
export declare function Timeline({ items, label, className }: TimelineProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type Item = {
|
|
2
|
+
value: string;
|
|
3
|
+
label: string;
|
|
4
|
+
icon?: React.ReactNode;
|
|
5
|
+
children?: Item[];
|
|
6
|
+
};
|
|
7
|
+
export type TreeViewProps = {
|
|
8
|
+
items: Item[];
|
|
9
|
+
value: string | null;
|
|
10
|
+
onValueChange: (value: string) => void;
|
|
11
|
+
/** Values of the open parents. */
|
|
12
|
+
expanded: string[];
|
|
13
|
+
onExpandedChange: (expanded: string[]) => void;
|
|
14
|
+
label?: string;
|
|
15
|
+
className?: string;
|
|
16
|
+
};
|
|
17
|
+
export declare function TreeView({ items, value, onValueChange, expanded, onExpandedChange, label, className }: TreeViewProps): import("react").JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type BadgeProps = {
|
|
2
|
+
/** A count, or null for something new without a number. 0 hides the badge. */
|
|
3
|
+
count: number | null;
|
|
4
|
+
format?: (value: number) => string;
|
|
5
|
+
/** Text for screen readers. */
|
|
6
|
+
label?: (count: number | null) => string;
|
|
7
|
+
className?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare function Badge({ count, format, label, className, }: BadgeProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type EmptyStateProps = {
|
|
2
|
+
title: React.ReactNode;
|
|
3
|
+
description?: React.ReactNode;
|
|
4
|
+
icon?: React.ReactNode;
|
|
5
|
+
action?: React.ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare function EmptyState({ title, description, icon, action, className }: EmptyStateProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type NotificationListProps = {
|
|
2
|
+
notifications: {
|
|
3
|
+
id: string;
|
|
4
|
+
title: string;
|
|
5
|
+
description?: React.ReactNode;
|
|
6
|
+
time: React.ReactNode;
|
|
7
|
+
read?: boolean;
|
|
8
|
+
avatar?: {
|
|
9
|
+
name: string;
|
|
10
|
+
src?: string;
|
|
11
|
+
};
|
|
12
|
+
}[];
|
|
13
|
+
onRead: (id: string) => void;
|
|
14
|
+
onDismiss: (id: string) => void;
|
|
15
|
+
label?: string;
|
|
16
|
+
emptyText?: string;
|
|
17
|
+
readLabel?: (title: string) => string;
|
|
18
|
+
dismissLabel?: (title: string) => string;
|
|
19
|
+
className?: string;
|
|
20
|
+
};
|
|
21
|
+
export declare function NotificationList({ notifications, onRead, onDismiss, label, emptyText, readLabel, dismissLabel, className, }: NotificationListProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type ProgressBarProps = {
|
|
2
|
+
/** 0..1, or null while the length is unknown. */
|
|
3
|
+
value: number | null;
|
|
4
|
+
label?: string;
|
|
5
|
+
formatValue?: (value: number) => string;
|
|
6
|
+
className?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare function ProgressBar({ value, label, formatValue, className, }: ProgressBarProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type ProgressRingProps = {
|
|
2
|
+
/** 0..1 */
|
|
3
|
+
value: number;
|
|
4
|
+
label?: string;
|
|
5
|
+
formatValue?: (value: number) => string;
|
|
6
|
+
/** Read out instead of the value once it reaches 1. */
|
|
7
|
+
doneLabel?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
};
|
|
10
|
+
export declare function ProgressRing({ value, label, formatValue, doneLabel, className, }: ProgressRingProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type SpinnerProps = {
|
|
2
|
+
/** Rendered size in px. The stroke follows it, so the arc renders at 1.5 px. */
|
|
3
|
+
size?: number;
|
|
4
|
+
className?: string;
|
|
5
|
+
};
|
|
6
|
+
/** A turning arc in the current text color. It's decorative: give the busy control or region its own name or status text. It stops turning when `--motion-duration-scale` is 0. */
|
|
7
|
+
export declare function Spinner({ size, className }: SpinnerProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type ToastStackProps = {
|
|
2
|
+
/** Oldest first: the last toast is in front. */
|
|
3
|
+
toasts: {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
icon?: React.ReactNode;
|
|
7
|
+
}[];
|
|
8
|
+
onDismiss: (id: string) => void;
|
|
9
|
+
label?: string;
|
|
10
|
+
dismissLabel?: (label: string) => string;
|
|
11
|
+
className?: string;
|
|
12
|
+
};
|
|
13
|
+
export declare function ToastStack({ toasts, onDismiss, label, dismissLabel, className, }: ToastStackProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type CheckboxProps = Omit<React.ComponentProps<"input">, "type" | "checked" | "onChange" | "children"> & {
|
|
2
|
+
checked: boolean;
|
|
3
|
+
onCheckedChange: (checked: boolean) => void;
|
|
4
|
+
label?: string;
|
|
5
|
+
indeterminate?: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare function Checkbox({ checked, onCheckedChange, label, indeterminate, disabled, className, ...props }: CheckboxProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type CheckboxGroupProps = {
|
|
2
|
+
options: {
|
|
3
|
+
value: string;
|
|
4
|
+
label: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
}[];
|
|
7
|
+
value: string[];
|
|
8
|
+
onValueChange: (value: string[]) => void;
|
|
9
|
+
label?: string;
|
|
10
|
+
id?: string;
|
|
11
|
+
name?: string;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
className?: string;
|
|
14
|
+
};
|
|
15
|
+
export declare function CheckboxGroup({ options, value, onValueChange, label, id, name, disabled, className, }: CheckboxGroupProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type ColorPickerProps = {
|
|
2
|
+
/** A lowercase "#rrggbb" color. */
|
|
3
|
+
value: string;
|
|
4
|
+
onValueChange: (value: string) => void;
|
|
5
|
+
label?: string;
|
|
6
|
+
areaLabel?: string;
|
|
7
|
+
hueLabel?: string;
|
|
8
|
+
hexLabel?: string;
|
|
9
|
+
/** The area knob's value text, from saturation and brightness between 0 and 1. */
|
|
10
|
+
formatArea?: (saturation: number, brightness: number) => string;
|
|
11
|
+
id?: string;
|
|
12
|
+
name?: string;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
className?: string;
|
|
15
|
+
};
|
|
16
|
+
export declare function ColorPicker({ value, onValueChange, label, areaLabel, hueLabel, hexLabel, formatArea, id, name, disabled, className, }: ColorPickerProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type ColorSwatchesProps = {
|
|
2
|
+
options: {
|
|
3
|
+
value: string;
|
|
4
|
+
label: string;
|
|
5
|
+
color: string;
|
|
6
|
+
}[];
|
|
7
|
+
value: string;
|
|
8
|
+
onValueChange: (value: string) => void;
|
|
9
|
+
label?: string;
|
|
10
|
+
id?: string;
|
|
11
|
+
name?: string;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
required?: boolean;
|
|
14
|
+
className?: string;
|
|
15
|
+
};
|
|
16
|
+
export declare function ColorSwatches({ options, value, onValueChange, label, id, name, disabled, required, className, }: ColorSwatchesProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type ComboboxProps = {
|
|
2
|
+
options: {
|
|
3
|
+
value: string;
|
|
4
|
+
label: string;
|
|
5
|
+
icon?: React.ReactNode;
|
|
6
|
+
}[];
|
|
7
|
+
value: string | null;
|
|
8
|
+
onValueChange: (value: string) => void;
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
label?: string;
|
|
11
|
+
emptyText?: string;
|
|
12
|
+
id?: string;
|
|
13
|
+
name?: string;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
required?: boolean;
|
|
16
|
+
className?: string;
|
|
17
|
+
};
|
|
18
|
+
export declare function Combobox({ options, value, onValueChange, placeholder, label, emptyText, id, name, disabled, required, className, }: ComboboxProps): import("react").JSX.Element;
|