@dreamtree-org/twreact-ui 1.3.10 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +70 -6
- package/ai-skills/dreamtree-ui.md +58 -15
- package/codemods/v2.cjs +198 -0
- package/dist/ai-schema.json +745 -53
- package/dist/charts/index.js +195 -66
- package/dist/components/blocks/AppShell.d.ts.map +1 -1
- package/dist/components/blocks/BottomActionBar.d.ts +6 -0
- package/dist/components/blocks/BottomActionBar.d.ts.map +1 -0
- package/dist/components/blocks/ConfirmDialog.d.ts.map +1 -1
- package/dist/components/blocks/PageHeader.d.ts.map +1 -1
- package/dist/components/charts/CartesianChart.d.ts.map +1 -1
- package/dist/components/charts/ChartFrame.d.ts.map +1 -1
- package/dist/components/charts/useChartLayout.d.ts +25 -0
- package/dist/components/charts/useChartLayout.d.ts.map +1 -0
- package/dist/components/core/Button.d.ts.map +1 -1
- package/dist/components/core/Checkbox.d.ts.map +1 -1
- package/dist/components/core/ColorPicker.d.ts.map +1 -1
- package/dist/components/core/DatePicker.d.ts.map +1 -1
- package/dist/components/core/DateRangePicker.d.ts.map +1 -1
- package/dist/components/core/Form.d.ts.map +1 -1
- package/dist/components/core/Input.d.ts.map +1 -1
- package/dist/components/core/Loader.d.ts.map +1 -1
- package/dist/components/core/LocationPicker.d.ts.map +1 -1
- package/dist/components/core/Popover.d.ts.map +1 -1
- package/dist/components/core/ProgressBar.d.ts.map +1 -1
- package/dist/components/core/Radio.d.ts.map +1 -1
- package/dist/components/core/Rate.d.ts.map +1 -1
- package/dist/components/core/RoundedTag.d.ts.map +1 -1
- package/dist/components/core/SearchField.d.ts +9 -0
- package/dist/components/core/SearchField.d.ts.map +1 -0
- package/dist/components/core/SegmentedControl.d.ts +8 -0
- package/dist/components/core/SegmentedControl.d.ts.map +1 -0
- package/dist/components/core/Select.d.ts.map +1 -1
- package/dist/components/core/Skeleton.d.ts.map +1 -1
- package/dist/components/core/Slider.d.ts.map +1 -1
- package/dist/components/core/SpeechToText.d.ts.map +1 -1
- package/dist/components/core/SwipeableListItem.d.ts +4 -0
- package/dist/components/core/SwipeableListItem.d.ts.map +1 -0
- package/dist/components/core/SwipeableListItemGesture.d.ts +58 -0
- package/dist/components/core/SwipeableListItemGesture.d.ts.map +1 -0
- package/dist/components/core/Switch.d.ts.map +1 -1
- package/dist/components/core/Table/ActionMenu.d.ts +10 -3
- package/dist/components/core/Table/ActionMenu.d.ts.map +1 -1
- package/dist/components/core/Table/MobileCard.d.ts +10 -1
- package/dist/components/core/Table/MobileCard.d.ts.map +1 -1
- package/dist/components/core/Table/MobileFilters.d.ts +8 -2
- package/dist/components/core/Table/MobileFilters.d.ts.map +1 -1
- package/dist/components/core/Table/Table.d.ts.map +1 -1
- package/dist/components/core/Table/TableRow.d.ts +2 -1
- package/dist/components/core/Table/TableRow.d.ts.map +1 -1
- package/dist/components/core/Tabs.d.ts +5 -8
- package/dist/components/core/Tabs.d.ts.map +1 -1
- package/dist/components/core/Textarea.d.ts.map +1 -1
- package/dist/components/core/ThreeDotPopover.d.ts +10 -22
- package/dist/components/core/ThreeDotPopover.d.ts.map +1 -1
- package/dist/components/core/Tooltip.d.ts +2 -1
- package/dist/components/core/Tooltip.d.ts.map +1 -1
- package/dist/components/core/internal/Calendar.d.ts +77 -0
- package/dist/components/core/internal/Calendar.d.ts.map +1 -0
- package/dist/components/core/menu/ActionMenuSurface.d.ts +42 -0
- package/dist/components/core/menu/ActionMenuSurface.d.ts.map +1 -0
- package/dist/components/core/menu/ActionSheetMenu.d.ts +17 -0
- package/dist/components/core/menu/ActionSheetMenu.d.ts.map +1 -0
- package/dist/components/core/menu/MenuPopover.d.ts +21 -0
- package/dist/components/core/menu/MenuPopover.d.ts.map +1 -0
- package/dist/components/core/menu/menuItems.d.ts +21 -0
- package/dist/components/core/menu/menuItems.d.ts.map +1 -0
- package/dist/components/core/menu/menuKeyboard.d.ts +16 -0
- package/dist/components/core/menu/menuKeyboard.d.ts.map +1 -0
- package/dist/components/feedback/ActionSheet.d.ts +4 -0
- package/dist/components/feedback/ActionSheet.d.ts.map +1 -0
- package/dist/components/feedback/Alert.d.ts.map +1 -1
- package/dist/components/feedback/Dialog.d.ts.map +1 -1
- package/dist/components/feedback/Drawer.d.ts.map +1 -1
- package/dist/components/feedback/Sheet.d.ts +4 -0
- package/dist/components/feedback/Sheet.d.ts.map +1 -0
- package/dist/components/feedback/Toast.d.ts +4 -3
- package/dist/components/feedback/Toast.d.ts.map +1 -1
- package/dist/components/feedback/ToastItem.d.ts +47 -0
- package/dist/components/feedback/ToastItem.d.ts.map +1 -0
- package/dist/components/feedback/ToastStack.d.ts +20 -0
- package/dist/components/feedback/ToastStack.d.ts.map +1 -0
- package/dist/components/feedback/ToastSwipe.d.ts +22 -0
- package/dist/components/feedback/ToastSwipe.d.ts.map +1 -0
- package/dist/components/feedback/Tour.d.ts.map +1 -1
- package/dist/components/feedback/sheetCore.d.ts +30 -0
- package/dist/components/feedback/sheetCore.d.ts.map +1 -0
- package/dist/components/navigation/Breadcrumbs.d.ts.map +1 -1
- package/dist/components/navigation/FootNav.d.ts.map +1 -1
- package/dist/components/navigation/Navbar.d.ts.map +1 -1
- package/dist/components/navigation/Sidebar.d.ts +6 -0
- package/dist/components/navigation/Sidebar.d.ts.map +1 -1
- package/dist/components/rich-text/RichTextEditor.d.ts.map +1 -1
- package/dist/components/rich-text/RichTextToolbar.d.ts +6 -2
- package/dist/components/rich-text/RichTextToolbar.d.ts.map +1 -1
- package/dist/components/utility/Avatar.d.ts +8 -0
- package/dist/components/utility/Avatar.d.ts.map +1 -1
- package/dist/components/utility/AvatarGroup.d.ts +4 -0
- package/dist/components/utility/AvatarGroup.d.ts.map +1 -0
- package/dist/components/utility/Badge.d.ts.map +1 -1
- package/dist/components/utility/Card.d.ts.map +1 -1
- package/dist/components/utility/Carousel.d.ts.map +1 -1
- package/dist/components/utility/FileUpload.d.ts.map +1 -1
- package/dist/components/utility/Pagination.d.ts.map +1 -1
- package/dist/components/utility/PullToRefresh.d.ts +5 -0
- package/dist/components/utility/PullToRefresh.d.ts.map +1 -0
- package/dist/components/utility/Sortable.d.ts.map +1 -1
- package/dist/components/utility/Stepper.d.ts.map +1 -1
- package/dist/esm/components/blocks/AppShell.js +97 -90
- package/dist/esm/components/blocks/BottomActionBar.js +132 -0
- package/dist/esm/components/blocks/ConfirmDialog.js +40 -4
- package/dist/esm/components/blocks/EmptyState.js +1 -1
- package/dist/esm/components/blocks/ErrorState.js +1 -1
- package/dist/esm/components/blocks/LoadingState.js +4 -4
- package/dist/esm/components/blocks/PageHeader.js +16 -3
- package/dist/esm/components/blocks/StatCard.js +6 -6
- package/dist/esm/components/blocks/StatusPill.js +5 -8
- package/dist/esm/components/charts/CartesianChart.js +85 -62
- package/dist/esm/components/charts/ChartFrame.js +12 -5
- package/dist/esm/components/charts/useChartLayout.js +105 -0
- package/dist/esm/components/core/Button.js +49 -25
- package/dist/esm/components/core/Checkbox.js +72 -57
- package/dist/esm/components/core/ColorPicker.js +31 -42
- package/dist/esm/components/core/DatePicker.js +117 -304
- package/dist/esm/components/core/DateRangePicker.js +260 -308
- package/dist/esm/components/core/Form.js +11 -2
- package/dist/esm/components/core/Input.js +100 -38
- package/dist/esm/components/core/Loader.js +30 -44
- package/dist/esm/components/core/LocationPicker.js +82 -16
- package/dist/esm/components/core/Popover.js +59 -48
- package/dist/esm/components/core/ProgressBar.js +40 -72
- package/dist/esm/components/core/Radio.js +10 -12
- package/dist/esm/components/core/Rate.js +77 -14
- package/dist/esm/components/core/RoundedTag.js +5 -5
- package/dist/esm/components/core/SearchField.js +311 -0
- package/dist/esm/components/core/SegmentedControl.js +189 -0
- package/dist/esm/components/core/Select.js +185 -190
- package/dist/esm/components/core/Skeleton.js +13 -14
- package/dist/esm/components/core/Slider.js +24 -6
- package/dist/esm/components/core/SpeechToText.js +68 -16
- package/dist/esm/components/core/SwipeableListItem.js +286 -0
- package/dist/esm/components/core/SwipeableListItemGesture.js +219 -0
- package/dist/esm/components/core/Switch.js +98 -28
- package/dist/esm/components/core/Table/ActionMenu.js +45 -231
- package/dist/esm/components/core/Table/ColumnMenu.js +1 -1
- package/dist/esm/components/core/Table/MobileCard.js +66 -16
- package/dist/esm/components/core/Table/MobileFilters.js +181 -10
- package/dist/esm/components/core/Table/Table.js +149 -102
- package/dist/esm/components/core/Table/TableRow.js +10 -2
- package/dist/esm/components/core/Tabs.js +186 -39
- package/dist/esm/components/core/Textarea.js +10 -2
- package/dist/esm/components/core/ThreeDotPopover.js +93 -99
- package/dist/esm/components/core/Tooltip.js +138 -145
- package/dist/esm/components/core/internal/Calendar.js +381 -0
- package/dist/esm/components/core/menu/ActionMenuSurface.js +110 -0
- package/dist/esm/components/core/menu/ActionSheetMenu.js +140 -0
- package/dist/esm/components/core/menu/MenuPopover.js +177 -0
- package/dist/esm/components/core/menu/menuItems.js +61 -0
- package/dist/esm/components/core/menu/menuKeyboard.js +54 -0
- package/dist/esm/components/feedback/ActionSheet.js +55 -0
- package/dist/esm/components/feedback/Alert.js +63 -53
- package/dist/esm/components/feedback/Dialog.js +141 -53
- package/dist/esm/components/feedback/Drawer.js +130 -132
- package/dist/esm/components/feedback/Sheet.js +125 -0
- package/dist/esm/components/feedback/Toast.js +21 -291
- package/dist/esm/components/feedback/ToastItem.js +348 -0
- package/dist/esm/components/feedback/ToastStack.js +130 -0
- package/dist/esm/components/feedback/ToastSwipe.js +52 -0
- package/dist/esm/components/feedback/Tour.js +107 -30
- package/dist/esm/components/feedback/sheetCore.js +494 -0
- package/dist/esm/components/navigation/Breadcrumbs.js +97 -35
- package/dist/esm/components/navigation/Dropdown.js +1 -1
- package/dist/esm/components/navigation/FootNav.js +102 -13
- package/dist/esm/components/navigation/Navbar.js +172 -37
- package/dist/esm/components/navigation/Sidebar.js +263 -111
- package/dist/esm/components/rich-text/RichTextEditor.js +9 -3
- package/dist/esm/components/rich-text/RichTextToolbar.js +29 -9
- package/dist/esm/components/utility/Avatar.js +14 -12
- package/dist/esm/components/utility/AvatarGroup.js +56 -0
- package/dist/esm/components/utility/Badge.js +43 -23
- package/dist/esm/components/utility/Card.js +32 -8
- package/dist/esm/components/utility/Carousel.js +139 -29
- package/dist/esm/components/utility/FileUpload.js +106 -31
- package/dist/esm/components/utility/Pagination.js +31 -13
- package/dist/esm/components/utility/Portal.js +31 -0
- package/dist/esm/components/utility/PullToRefresh.js +229 -0
- package/dist/esm/components/utility/Sortable.js +6 -2
- package/dist/esm/components/utility/Stepper.js +110 -47
- package/dist/esm/hooks/useFloatingPosition.js +82 -0
- package/dist/esm/hooks/useHaptics.js +65 -0
- package/dist/esm/hooks/usePresence.js +58 -0
- package/dist/esm/hooks/usePresentation.js +21 -0
- package/dist/esm/hooks/useSheetDrag.js +220 -0
- package/dist/esm/hooks/useSliderValues.js +8 -2
- package/dist/esm/hooks/useSortable.js +107 -5
- package/dist/esm/index.js +14 -2
- package/dist/esm/utils/position.js +10 -63
- package/dist/esm/utils/touchTarget.js +4 -1
- package/dist/hooks/useFloatingPosition.d.ts +8 -4
- package/dist/hooks/useFloatingPosition.d.ts.map +1 -1
- package/dist/hooks/useHaptics.d.ts +19 -0
- package/dist/hooks/useHaptics.d.ts.map +1 -0
- package/dist/hooks/useSheetDrag.d.ts +31 -0
- package/dist/hooks/useSheetDrag.d.ts.map +1 -0
- package/dist/hooks/useSliderValues.d.ts +6 -2
- package/dist/hooks/useSliderValues.d.ts.map +1 -1
- package/dist/hooks/useSortable.d.ts +11 -1
- package/dist/hooks/useSortable.d.ts.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +11 -2
- package/dist/index.esm.css +1 -1
- package/dist/index.esm.js +10645 -3842
- package/dist/index.js +10657 -3845
- package/dist/rich-text/index.js +41 -11
- package/dist/types/blocks.d.ts +32 -2
- package/dist/types/blocks.d.ts.map +1 -1
- package/dist/types/charts.d.ts +3 -1
- package/dist/types/charts.d.ts.map +1 -1
- package/dist/types/index.d.ts +409 -26
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/rich-text.d.ts +5 -0
- package/dist/types/rich-text.d.ts.map +1 -1
- package/dist/utils/position.d.ts +0 -15
- package/dist/utils/position.d.ts.map +1 -1
- package/doc/README.md +16 -0
- package/mcp/catalog.snapshot.json +1540 -407
- package/package.json +7 -2
- package/dist/esm/hooks/useSwipeToClose.js +0 -66
- package/dist/hooks/useSwipeToClose.d.ts +0 -24
- package/dist/hooks/useSwipeToClose.d.ts.map +0 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode, ReactElement, CSSProperties, ButtonHTMLAttributes, InputHTMLAttributes, ElementType, HTMLAttributes, RefObject, TextareaHTMLAttributes } from 'react';
|
|
1
|
+
import { ReactNode, ReactElement, CSSProperties, ButtonHTMLAttributes, InputHTMLAttributes, ElementType, HTMLAttributes, RefObject, TextareaHTMLAttributes, ComponentType } from 'react';
|
|
2
2
|
export type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
3
3
|
export type Variant = 'primary' | 'secondary' | 'outline' | 'ghost' | 'destructive' | 'success' | 'warning';
|
|
4
4
|
export type AlertType = 'success' | 'error' | 'warning' | 'info';
|
|
@@ -12,9 +12,12 @@ export interface BaseComponentProps {
|
|
|
12
12
|
style?: CSSProperties;
|
|
13
13
|
id?: string;
|
|
14
14
|
}
|
|
15
|
+
/** Square, icon-only Button sizes (pair with `aria-label`). */
|
|
16
|
+
export type ButtonIconSize = 'icon-sm' | 'icon' | 'icon-lg';
|
|
15
17
|
export interface ButtonProps extends BaseComponentProps, Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'className'> {
|
|
16
18
|
variant?: Variant;
|
|
17
|
-
size
|
|
19
|
+
/** Any shared `Size`, or a square icon size. `xs` / `sm` / `icon-sm` / `icon` grow to 44px on coarse pointers. */
|
|
20
|
+
size?: Size | ButtonIconSize;
|
|
18
21
|
disabled?: boolean;
|
|
19
22
|
loading?: boolean;
|
|
20
23
|
leftIcon?: ReactNode;
|
|
@@ -32,7 +35,7 @@ export interface ButtonProps extends BaseComponentProps, Omit<ButtonHTMLAttribut
|
|
|
32
35
|
/** Router destination, forwarded when `as` is a router Link. */
|
|
33
36
|
to?: string | Record<string, unknown>;
|
|
34
37
|
}
|
|
35
|
-
export interface InputProps extends BaseComponentProps, Omit<InputHTMLAttributes<HTMLInputElement>, 'className'> {
|
|
38
|
+
export interface InputProps extends BaseComponentProps, Omit<InputHTMLAttributes<HTMLInputElement>, 'className' | 'size'> {
|
|
36
39
|
type?: 'text' | 'password' | 'email' | 'search' | 'number' | 'tel' | 'url';
|
|
37
40
|
label?: string;
|
|
38
41
|
placeholder?: string;
|
|
@@ -42,8 +45,10 @@ export interface InputProps extends BaseComponentProps, Omit<InputHTMLAttributes
|
|
|
42
45
|
disabled?: boolean;
|
|
43
46
|
required?: boolean;
|
|
44
47
|
clearable?: boolean;
|
|
45
|
-
icon
|
|
46
|
-
|
|
48
|
+
/** Decorative icon before the value (`type="search"` shows its own search icon instead). Renamed from `icon` in 2.0.0. */
|
|
49
|
+
leftIcon?: ReactNode;
|
|
50
|
+
/** Decorative icon after the value; hidden while the password toggle or clear button shows. Replaces `iconPosition="right"` in 2.0.0. */
|
|
51
|
+
rightIcon?: ReactNode;
|
|
47
52
|
showCount?: boolean;
|
|
48
53
|
maxLength?: number;
|
|
49
54
|
readOnly?: boolean;
|
|
@@ -51,6 +56,16 @@ export interface InputProps extends BaseComponentProps, Omit<InputHTMLAttributes
|
|
|
51
56
|
value?: string | number;
|
|
52
57
|
defaultValue?: string | number;
|
|
53
58
|
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
59
|
+
/**
|
|
60
|
+
* Field size. `md` (default) is 40px and grows to the 44px touch target on
|
|
61
|
+
* coarse pointers; `lg` is 44px everywhere. A number is passed through as the
|
|
62
|
+
* native `<input size>` attribute.
|
|
63
|
+
*/
|
|
64
|
+
size?: 'sm' | 'md' | 'lg' | number;
|
|
65
|
+
/** Render `label` inside the field, floating above the value once focused or filled. */
|
|
66
|
+
floatingLabel?: boolean;
|
|
67
|
+
/** One-time code field: `autoComplete="one-time-code"` + `inputMode="numeric"` (unless passed). */
|
|
68
|
+
otp?: boolean;
|
|
54
69
|
}
|
|
55
70
|
export interface SelectOption {
|
|
56
71
|
value: string | number;
|
|
@@ -88,7 +103,19 @@ export interface SelectProps extends BaseComponentProps {
|
|
|
88
103
|
renderGroupLabel?: (label: string) => ReactNode;
|
|
89
104
|
/** Trigger size. `md` grows to the 44px touch target on coarse pointers; `lg` is 44px everywhere. */
|
|
90
105
|
size?: 'sm' | 'md' | 'lg';
|
|
91
|
-
|
|
106
|
+
/**
|
|
107
|
+
* How the open menu presents. `auto` (default) is a bottom sheet on small
|
|
108
|
+
* touch screens (`(pointer: coarse) and (max-width: 639px)`) and an anchored
|
|
109
|
+
* popover elsewhere (always a popover on the server).
|
|
110
|
+
*/
|
|
111
|
+
presentation?: 'auto' | 'popover' | 'sheet';
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Checkbox / Switch `color`: a token preset (`green` = success, `danger` / `red`
|
|
115
|
+
* = error) or a custom CSS colour string. The raw-palette presets `blue`,
|
|
116
|
+
* `indigo` and `purple` were removed in 2.0.0.
|
|
117
|
+
*/
|
|
118
|
+
export type ToggleColor = 'primary' | 'secondary' | 'success' | 'error' | 'warning' | 'green' | 'danger' | 'red' | (string & {});
|
|
92
119
|
export interface CheckboxProps extends BaseComponentProps {
|
|
93
120
|
checked?: boolean;
|
|
94
121
|
defaultChecked?: boolean;
|
|
@@ -102,9 +129,12 @@ export interface CheckboxProps extends BaseComponentProps {
|
|
|
102
129
|
value?: string | number;
|
|
103
130
|
ariaLabel?: string;
|
|
104
131
|
labelPosition?: 'left' | 'right';
|
|
105
|
-
|
|
132
|
+
/** Token preset (aliases `green` / `danger` / `red`), or a custom CSS colour string. */
|
|
133
|
+
color?: ToggleColor;
|
|
106
134
|
iconClass?: string;
|
|
107
135
|
checkedClass?: string;
|
|
136
|
+
/** Opt-in `selection` vibration on change (no-op without the Vibration API or under reduced motion). */
|
|
137
|
+
haptics?: boolean;
|
|
108
138
|
}
|
|
109
139
|
export interface RadioOption {
|
|
110
140
|
value: string | number;
|
|
@@ -125,6 +155,29 @@ export interface RadioProps extends BaseComponentProps {
|
|
|
125
155
|
radioColor?: string;
|
|
126
156
|
ariaLabel?: string;
|
|
127
157
|
}
|
|
158
|
+
export type SegmentedControlValue = string | number;
|
|
159
|
+
export interface SegmentedControlOption {
|
|
160
|
+
value: SegmentedControlValue;
|
|
161
|
+
label: ReactNode;
|
|
162
|
+
icon?: ReactNode;
|
|
163
|
+
disabled?: boolean;
|
|
164
|
+
}
|
|
165
|
+
/** Radiogroup view toggle. Use `Tabs variant="segmented"` when the choice switches panels. */
|
|
166
|
+
export interface SegmentedControlProps extends BaseComponentProps, Omit<HTMLAttributes<HTMLDivElement>, 'className' | 'style' | 'id' | 'onChange' | 'defaultValue' | 'children'> {
|
|
167
|
+
options: SegmentedControlOption[];
|
|
168
|
+
value?: SegmentedControlValue;
|
|
169
|
+
defaultValue?: SegmentedControlValue;
|
|
170
|
+
/** Receives the newly selected option's `value` (not a DOM event). */
|
|
171
|
+
onChange?: (value: SegmentedControlValue) => void;
|
|
172
|
+
/** `md` (default). Every size grows to 44px tall on coarse pointers. */
|
|
173
|
+
size?: 'sm' | 'md' | 'lg';
|
|
174
|
+
fullWidth?: boolean;
|
|
175
|
+
/** Submits the selected value through a hidden input. */
|
|
176
|
+
name?: string;
|
|
177
|
+
disabled?: boolean;
|
|
178
|
+
'aria-label'?: string;
|
|
179
|
+
'aria-labelledby'?: string;
|
|
180
|
+
}
|
|
128
181
|
export interface SwitchProps extends BaseComponentProps {
|
|
129
182
|
checked?: boolean;
|
|
130
183
|
defaultChecked?: boolean;
|
|
@@ -132,6 +185,8 @@ export interface SwitchProps extends BaseComponentProps {
|
|
|
132
185
|
disabled?: boolean;
|
|
133
186
|
size?: Size;
|
|
134
187
|
name?: string;
|
|
188
|
+
/** Token preset or a custom CSS colour string (raw-palette presets removed in 2.0.0). */
|
|
189
|
+
color?: ToggleColor;
|
|
135
190
|
trackClass?: string;
|
|
136
191
|
thumbClass?: string;
|
|
137
192
|
topLabel?: ReactNode;
|
|
@@ -139,6 +194,8 @@ export interface SwitchProps extends BaseComponentProps {
|
|
|
139
194
|
leftLabel?: ReactNode;
|
|
140
195
|
rightLabel?: ReactNode;
|
|
141
196
|
ariaLabel?: string;
|
|
197
|
+
/** Opt-in `selection` vibration on toggle (no-op without the Vibration API or under reduced motion). */
|
|
198
|
+
haptics?: boolean;
|
|
142
199
|
}
|
|
143
200
|
export interface DatePickerProps extends BaseComponentProps {
|
|
144
201
|
value?: Date | string | null;
|
|
@@ -157,6 +214,7 @@ export interface DatePickerProps extends BaseComponentProps {
|
|
|
157
214
|
locale?: any;
|
|
158
215
|
showClear?: boolean;
|
|
159
216
|
closeOnSelect?: boolean;
|
|
217
|
+
presentation?: 'auto' | 'popover' | 'sheet';
|
|
160
218
|
}
|
|
161
219
|
export interface DateRange {
|
|
162
220
|
start: Date | null;
|
|
@@ -179,6 +237,12 @@ export interface DateRangePickerProps extends BaseComponentProps {
|
|
|
179
237
|
locale?: any;
|
|
180
238
|
showClear?: boolean;
|
|
181
239
|
closeOnSelect?: boolean;
|
|
240
|
+
presentation?: 'auto' | 'popover' | 'sheet';
|
|
241
|
+
presets?: DateRangePreset[];
|
|
242
|
+
}
|
|
243
|
+
export interface DateRangePreset {
|
|
244
|
+
label: string;
|
|
245
|
+
range: [Date | string, Date | string];
|
|
182
246
|
}
|
|
183
247
|
export interface ColorPickerProps extends BaseComponentProps {
|
|
184
248
|
value?: string;
|
|
@@ -279,7 +343,10 @@ export interface TableAction<T = any> {
|
|
|
279
343
|
hidden?: TableValueOrFn<boolean, T>;
|
|
280
344
|
disabled?: TableValueOrFn<boolean, T>;
|
|
281
345
|
inline?: boolean;
|
|
346
|
+
tone?: 'default' | 'destructive';
|
|
347
|
+
destructive?: boolean;
|
|
282
348
|
}
|
|
349
|
+
export type OverlayPresentation = 'auto' | 'popover' | 'sheet';
|
|
283
350
|
export interface TableSortConfig {
|
|
284
351
|
key: string | null;
|
|
285
352
|
direction: 'asc' | 'desc';
|
|
@@ -346,6 +413,7 @@ export interface TableProps<T = any> extends BaseComponentProps {
|
|
|
346
413
|
stripedRows?: boolean;
|
|
347
414
|
theme?: TableTheme;
|
|
348
415
|
responsiveBreakpoint?: number;
|
|
416
|
+
actionMenuPresentation?: OverlayPresentation;
|
|
349
417
|
showToolbar?: boolean;
|
|
350
418
|
showColumnPicker?: boolean;
|
|
351
419
|
wrapCells?: boolean;
|
|
@@ -382,6 +450,85 @@ export interface TableProps<T = any> extends BaseComponentProps {
|
|
|
382
450
|
}) => void;
|
|
383
451
|
onRowAdd?: (row: Partial<T>) => void;
|
|
384
452
|
onRowDelete?: (rowKey: string) => void;
|
|
453
|
+
/**
|
|
454
|
+
* Layout on the server and while hydrating, before the breakpoint media
|
|
455
|
+
* query can be read. `true` renders cards first (phone-first pages).
|
|
456
|
+
* Default `false`.
|
|
457
|
+
*/
|
|
458
|
+
defaultMobileView?: boolean;
|
|
459
|
+
/**
|
|
460
|
+
* Card-mode filters (`filterable`): `sheet` is a Filters button opening a
|
|
461
|
+
* bottom Sheet with Apply / Clear; `inline` is the collapsible panel; `auto`
|
|
462
|
+
* (default) uses the sheet on small touch screens.
|
|
463
|
+
*/
|
|
464
|
+
mobileFiltersPresentation?: 'auto' | 'sheet' | 'inline';
|
|
465
|
+
/**
|
|
466
|
+
* Swipe actions for the mobile cards (built on SwipeableListItem). Return
|
|
467
|
+
* `null` (or empty arrays) for rows without any.
|
|
468
|
+
*/
|
|
469
|
+
swipeActions?: (row: T, index: number) => TableSwipeActions | null | undefined;
|
|
470
|
+
/**
|
|
471
|
+
* Sticky desktop header. `true` sticks within the table's scroll container;
|
|
472
|
+
* a CSS length (`"24rem"`) or a number (px) also caps the container height
|
|
473
|
+
* so the body scrolls under the header.
|
|
474
|
+
*/
|
|
475
|
+
stickyHeader?: boolean | string | number;
|
|
476
|
+
}
|
|
477
|
+
export interface TableSwipeActions {
|
|
478
|
+
leading?: SwipeAction[];
|
|
479
|
+
trailing?: SwipeAction[];
|
|
480
|
+
}
|
|
481
|
+
export type SwipeActionTone = 'default' | 'primary' | 'secondary' | 'success' | 'warning' | 'info' | 'error' | 'destructive';
|
|
482
|
+
export type SwipeSide = 'leading' | 'trailing';
|
|
483
|
+
export interface SwipeAction {
|
|
484
|
+
key: string;
|
|
485
|
+
label: ReactNode;
|
|
486
|
+
/** A node (`<Trash2 />`) or a component (`Trash2`). */
|
|
487
|
+
icon?: ReactNode | React.ComponentType<{
|
|
488
|
+
className?: string;
|
|
489
|
+
}>;
|
|
490
|
+
tone?: SwipeActionTone;
|
|
491
|
+
disabled?: boolean;
|
|
492
|
+
/** `source` is how it was triggered: a revealed button, a full swipe, or the menu. */
|
|
493
|
+
onSelect?: (event: {
|
|
494
|
+
action: SwipeAction;
|
|
495
|
+
source: 'button' | 'full-swipe' | 'menu';
|
|
496
|
+
}) => void;
|
|
497
|
+
}
|
|
498
|
+
export interface SwipeableListItemProps extends BaseComponentProps, Omit<HTMLAttributes<HTMLElement>, 'className' | 'children'> {
|
|
499
|
+
/** Root element, e.g. `"li"`. Default `"div"`. */
|
|
500
|
+
as?: React.ElementType;
|
|
501
|
+
children?: ReactNode;
|
|
502
|
+
/** Revealed by swiping right; the first one sits at the left edge. */
|
|
503
|
+
leadingActions?: SwipeAction[];
|
|
504
|
+
/** Revealed by swiping left; the first one sits at the right edge. */
|
|
505
|
+
trailingActions?: SwipeAction[];
|
|
506
|
+
/** A swipe past `fullSwipeThreshold` commits the first action of that side. Default `true`. */
|
|
507
|
+
fullSwipe?: boolean | {
|
|
508
|
+
leading?: boolean;
|
|
509
|
+
trailing?: boolean;
|
|
510
|
+
};
|
|
511
|
+
/** Fraction of the row width a full swipe must travel. Default `0.6`. */
|
|
512
|
+
fullSwipeThreshold?: number;
|
|
513
|
+
/** Width (px) of each revealed action. Default `80`. */
|
|
514
|
+
actionWidth?: number;
|
|
515
|
+
/** Controlled open side (`null` = closed). */
|
|
516
|
+
open?: SwipeSide | null;
|
|
517
|
+
defaultOpen?: SwipeSide | null;
|
|
518
|
+
onOpenChange?: (side: SwipeSide | null) => void;
|
|
519
|
+
/** Turns the gesture and the More actions button off. */
|
|
520
|
+
disabled?: boolean;
|
|
521
|
+
/**
|
|
522
|
+
* The gesture-free "More actions" button: `focus` (default) shows it on
|
|
523
|
+
* keyboard focus and mouse hover, `always` keeps it visible, `false` removes it.
|
|
524
|
+
*/
|
|
525
|
+
moreActions?: 'focus' | 'always' | false;
|
|
526
|
+
/** Accessible name of the More actions button and its menu. Default `"More actions"`. */
|
|
527
|
+
moreActionsLabel?: string;
|
|
528
|
+
/** How the More actions menu opens. Default `'auto'` (action sheet on phones). */
|
|
529
|
+
menuPresentation?: OverlayPresentation;
|
|
530
|
+
/** Classes for the sliding content layer (default `bg-surface`). */
|
|
531
|
+
contentClassName?: string;
|
|
385
532
|
}
|
|
386
533
|
export interface NavItem {
|
|
387
534
|
id: string;
|
|
@@ -405,7 +552,9 @@ export interface FootNavItem extends NavItem {
|
|
|
405
552
|
badge?: string | number;
|
|
406
553
|
/** `'action'` renders a raised, circular primary button (FAB), e.g. a centre "+" that opens a sheet. */
|
|
407
554
|
variant?: 'default' | 'action';
|
|
408
|
-
/**
|
|
555
|
+
/** Router destination; with `href` or `to` the item renders as a link (`<a>` or FootNav's `linkAs`). */
|
|
556
|
+
to?: string | Record<string, unknown>;
|
|
557
|
+
/** aria-* and data-* keys are passed through to the item's button or link. */
|
|
409
558
|
[attr: `aria-${string}` | `data-${string}`]: string | number | boolean | undefined;
|
|
410
559
|
}
|
|
411
560
|
export interface MenuItem {
|
|
@@ -448,6 +597,10 @@ export interface NavbarProps extends BaseComponentProps {
|
|
|
448
597
|
rightMenuContent?: ReactNode | ((props: {
|
|
449
598
|
notifications?: Notification[];
|
|
450
599
|
}) => ReactNode);
|
|
600
|
+
/** Sticky top bar: `sticky top-0 z-sticky pt-safe`, translucent `bg-surface/80 backdrop-blur`. Default `false`. */
|
|
601
|
+
sticky?: boolean;
|
|
602
|
+
/** iOS large title (an `<h1>` under the bar) that collapses into the bar on window scroll. */
|
|
603
|
+
largeTitle?: ReactNode;
|
|
451
604
|
}
|
|
452
605
|
export interface SidebarProps extends BaseComponentProps {
|
|
453
606
|
items: SidebarItem[];
|
|
@@ -468,6 +621,8 @@ export interface SidebarProps extends BaseComponentProps {
|
|
|
468
621
|
footer?: ReactNode | ((ctx: SidebarFooterContext) => ReactNode);
|
|
469
622
|
stickyOffset?: number | string;
|
|
470
623
|
containerClassName?: string;
|
|
624
|
+
/** Phones: edge swipe opens the drawer, swiping it toward its edge closes it. Default `true`. */
|
|
625
|
+
swipeable?: boolean;
|
|
471
626
|
}
|
|
472
627
|
export interface SidebarFooterContext {
|
|
473
628
|
collapsed: boolean;
|
|
@@ -476,7 +631,17 @@ export interface SidebarFooterContext {
|
|
|
476
631
|
}
|
|
477
632
|
export interface FootNavProps extends BaseComponentProps {
|
|
478
633
|
items: FootNavItem[];
|
|
479
|
-
|
|
634
|
+
/** Component used for items with `href` / `to` (e.g. a router `Link`). Default `'a'`. */
|
|
635
|
+
linkAs?: ElementType;
|
|
636
|
+
/** Hide the bar while scrolling down, show it on scroll up. Default `false`. */
|
|
637
|
+
hideOnScroll?: boolean;
|
|
638
|
+
/** Numeric badges above this read `${badgeMax}+`. Default `99`. */
|
|
639
|
+
badgeMax?: number;
|
|
640
|
+
/** Accessible name of the `<nav>` landmark. Default `"Primary"`. */
|
|
641
|
+
'aria-label'?: string;
|
|
642
|
+
}
|
|
643
|
+
/** `FootNav.Spacer`: reserves the bar's height plus the bottom safe area. */
|
|
644
|
+
export type FootNavSpacerProps = BaseComponentProps;
|
|
480
645
|
export interface BreadcrumbItem {
|
|
481
646
|
id?: string | number;
|
|
482
647
|
label: string;
|
|
@@ -490,13 +655,19 @@ export interface BreadcrumbsProps extends BaseComponentProps {
|
|
|
490
655
|
showHome?: boolean;
|
|
491
656
|
homeIcon?: ReactNode;
|
|
492
657
|
onHomeClick?: (item: BreadcrumbItem) => void;
|
|
658
|
+
maxItems?: number;
|
|
493
659
|
}
|
|
660
|
+
export type AlertVariant = AlertType | 'neutral';
|
|
494
661
|
export interface AlertProps extends BaseComponentProps {
|
|
495
|
-
variant?:
|
|
662
|
+
variant?: AlertVariant;
|
|
496
663
|
title?: string;
|
|
497
664
|
children?: ReactNode;
|
|
665
|
+
/** Rendered after the description (buttons, links). */
|
|
666
|
+
actions?: ReactNode;
|
|
498
667
|
dismissible?: boolean;
|
|
499
668
|
onDismiss?: () => void;
|
|
669
|
+
/** Accessible name of the dismiss button. Default `'Dismiss'`. */
|
|
670
|
+
dismissLabel?: string;
|
|
500
671
|
}
|
|
501
672
|
export type DialogSize = 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
502
673
|
export interface DialogProps extends BaseComponentProps {
|
|
@@ -511,6 +682,11 @@ export interface DialogProps extends BaseComponentProps {
|
|
|
511
682
|
onOpen?: (context: {
|
|
512
683
|
dialogRef: HTMLDivElement | null;
|
|
513
684
|
}) => void;
|
|
685
|
+
/**
|
|
686
|
+
* `'popover'` is the centred modal, `'sheet'` a bottom Sheet with stacked
|
|
687
|
+
* full-width footer actions, `'auto'` (default) picks per device.
|
|
688
|
+
*/
|
|
689
|
+
presentation?: OverlayPresentation;
|
|
514
690
|
}
|
|
515
691
|
export interface ToastProps extends BaseComponentProps {
|
|
516
692
|
id: string;
|
|
@@ -520,14 +696,42 @@ export interface ToastProps extends BaseComponentProps {
|
|
|
520
696
|
duration?: number;
|
|
521
697
|
onClose?: (id: string) => void;
|
|
522
698
|
position?: Position;
|
|
523
|
-
|
|
524
|
-
|
|
699
|
+
/** Pause the auto-dismiss timer from outside (the stack does this while expanded). */
|
|
700
|
+
paused?: boolean;
|
|
701
|
+
/** Horizontal swipe (pointer drag past 64px, or a flick) dismisses. Default `true`. */
|
|
702
|
+
swipeToDismiss?: boolean;
|
|
703
|
+
/**
|
|
704
|
+
* Placement on phones (coarse pointer, < 640px): full width inside a 1rem
|
|
705
|
+
* gutter. `false` keeps `position`. Default `'bottom-center'`.
|
|
706
|
+
*/
|
|
707
|
+
mobilePosition?: ToastMobilePosition | false;
|
|
708
|
+
/** Gap above the bottom edge on phones (px or CSS length); sets `--dt-toast-mobile-offset`. Default `5rem` (clears FootNav). */
|
|
709
|
+
mobileOffset?: number | string;
|
|
710
|
+
/** Accessible name of the close button. Default `'Close notification'`. */
|
|
711
|
+
closeLabel?: string;
|
|
712
|
+
}
|
|
713
|
+
export type ToastMobilePosition = 'bottom-center' | 'top-center';
|
|
714
|
+
export interface ToastStackOptions {
|
|
715
|
+
/**
|
|
716
|
+
* `undefined` (default): collapse into a peek stack past `visibleToasts`,
|
|
717
|
+
* expanding on hover / focus / tap. `true`: always list every toast.
|
|
718
|
+
* `false`: collapse whenever there is more than one toast.
|
|
719
|
+
*/
|
|
720
|
+
expand?: boolean;
|
|
721
|
+
/** Toasts shown before the stack collapses (and peeking while collapsed). Default `3`. */
|
|
722
|
+
visibleToasts?: number;
|
|
723
|
+
/** Phone placement; `false` keeps `position`. Default `'bottom-center'`. */
|
|
724
|
+
mobilePosition?: ToastMobilePosition | false;
|
|
725
|
+
/** Gap above the bottom edge on phones (px or CSS length). Default `5rem` (clears FootNav). */
|
|
726
|
+
mobileOffset?: number | string;
|
|
727
|
+
}
|
|
728
|
+
export interface ToastContainerProps extends ToastStackOptions {
|
|
525
729
|
toasts?: ToastProps[];
|
|
526
730
|
position?: Position;
|
|
527
731
|
onRemove?: (id: string) => void;
|
|
528
732
|
className?: string;
|
|
529
733
|
}
|
|
530
|
-
export interface ToastProviderProps {
|
|
734
|
+
export interface ToastProviderProps extends ToastStackOptions {
|
|
531
735
|
children?: ReactNode;
|
|
532
736
|
position?: Position;
|
|
533
737
|
className?: string;
|
|
@@ -535,6 +739,7 @@ export interface ToastProviderProps {
|
|
|
535
739
|
export interface CardProps extends BaseComponentProps {
|
|
536
740
|
children?: ReactNode;
|
|
537
741
|
hover?: boolean;
|
|
742
|
+
interactive?: boolean;
|
|
538
743
|
}
|
|
539
744
|
export interface CardHeaderProps extends BaseComponentProps {
|
|
540
745
|
children?: ReactNode;
|
|
@@ -559,11 +764,25 @@ export interface AvatarProps extends BaseComponentProps {
|
|
|
559
764
|
shape?: Shape;
|
|
560
765
|
status?: Status;
|
|
561
766
|
}
|
|
767
|
+
export interface AvatarGroupProps extends BaseComponentProps {
|
|
768
|
+
/** `Avatar` elements. */
|
|
769
|
+
children?: ReactNode;
|
|
770
|
+
/** Show at most this many avatars, then a "+N" overflow tile. */
|
|
771
|
+
max?: number;
|
|
772
|
+
/** Size applied to every avatar that doesn't set its own. */
|
|
773
|
+
size?: Size;
|
|
774
|
+
}
|
|
562
775
|
export interface BadgeProps extends BaseComponentProps {
|
|
563
776
|
children?: ReactNode;
|
|
564
777
|
variant?: 'default' | 'primary' | 'secondary' | 'success' | 'warning' | 'error' | 'info' | 'outline';
|
|
565
778
|
size?: Size;
|
|
566
779
|
rounded?: boolean;
|
|
780
|
+
/** Leading decorative dot in the current text colour. */
|
|
781
|
+
dot?: boolean;
|
|
782
|
+
/** Leading icon slot (decorative). */
|
|
783
|
+
icon?: ReactNode;
|
|
784
|
+
/** When `children` is a number above `max`, renders `${max}+` (e.g. `99+`). */
|
|
785
|
+
max?: number;
|
|
567
786
|
}
|
|
568
787
|
export interface TabsProps extends BaseComponentProps {
|
|
569
788
|
children?: ReactNode;
|
|
@@ -572,8 +791,9 @@ export interface TabsProps extends BaseComponentProps {
|
|
|
572
791
|
onChange?: (index: number) => void;
|
|
573
792
|
orientation?: Orientation;
|
|
574
793
|
size?: Size;
|
|
575
|
-
variant?: 'line' | 'pills' | 'unstyled';
|
|
794
|
+
variant?: 'line' | 'pills' | 'segmented' | 'unstyled';
|
|
576
795
|
animated?: boolean;
|
|
796
|
+
swipeable?: boolean;
|
|
577
797
|
}
|
|
578
798
|
export interface TabListProps extends BaseComponentProps {
|
|
579
799
|
children?: ReactNode;
|
|
@@ -581,8 +801,10 @@ export interface TabListProps extends BaseComponentProps {
|
|
|
581
801
|
export interface TabProps extends BaseComponentProps {
|
|
582
802
|
children?: ReactNode;
|
|
583
803
|
index?: number;
|
|
584
|
-
iconLeft
|
|
585
|
-
|
|
804
|
+
/** Renamed from `iconLeft` in 2.0.0. */
|
|
805
|
+
leftIcon?: ReactNode;
|
|
806
|
+
/** Renamed from `iconRight` in 2.0.0. */
|
|
807
|
+
rightIcon?: ReactNode;
|
|
586
808
|
disabled?: boolean;
|
|
587
809
|
tabClassName?: string;
|
|
588
810
|
}
|
|
@@ -634,8 +856,8 @@ export interface StepperProps extends BaseComponentProps {
|
|
|
634
856
|
steps: Array<StepperStep | StepperLabelStep>;
|
|
635
857
|
currentStep: number;
|
|
636
858
|
onStepClick?: (step: StepperStep, index: number) => void;
|
|
637
|
-
orientation?: Orientation;
|
|
638
|
-
variant?: string;
|
|
859
|
+
orientation?: Orientation | 'auto';
|
|
860
|
+
variant?: 'default' | 'dots' | (string & {});
|
|
639
861
|
}
|
|
640
862
|
export interface PaginationProps extends BaseComponentProps {
|
|
641
863
|
currentPage: number;
|
|
@@ -669,15 +891,15 @@ export interface SkeletonProps extends BaseComponentProps {
|
|
|
669
891
|
inline?: boolean;
|
|
670
892
|
children?: ReactNode;
|
|
671
893
|
}
|
|
894
|
+
export type ProgressBarVariant = 'primary' | 'secondary' | 'success' | 'warning' | 'destructive';
|
|
672
895
|
export interface ProgressBarProps extends BaseComponentProps {
|
|
673
896
|
value?: number;
|
|
674
897
|
max?: number;
|
|
675
898
|
size?: Size | number;
|
|
676
899
|
showValue?: boolean;
|
|
677
900
|
rounded?: boolean;
|
|
678
|
-
color
|
|
679
|
-
|
|
680
|
-
valueColor?: string;
|
|
901
|
+
/** Token tone for the fill and track. The HEX props `color` / `bgColor` / `valueColor` were removed in 2.0.0. */
|
|
902
|
+
variant?: ProgressBarVariant;
|
|
681
903
|
striped?: boolean;
|
|
682
904
|
animated?: boolean;
|
|
683
905
|
label?: ReactNode;
|
|
@@ -698,7 +920,7 @@ export interface RoundedTagProps extends BaseComponentProps {
|
|
|
698
920
|
initialClassname?: string;
|
|
699
921
|
}
|
|
700
922
|
export type TooltipTrigger = 'hover' | 'click' | 'focus';
|
|
701
|
-
export interface TooltipProps extends BaseComponentProps {
|
|
923
|
+
export interface TooltipProps extends BaseComponentProps, Omit<HTMLAttributes<HTMLDivElement>, 'className' | 'style' | 'id' | 'content' | 'children' | 'onChange'> {
|
|
702
924
|
position?: 'auto' | 'top' | 'bottom' | 'left' | 'right';
|
|
703
925
|
trigger?: TooltipTrigger | TooltipTrigger[];
|
|
704
926
|
content?: ReactNode | ((args: {
|
|
@@ -723,6 +945,7 @@ export interface FileUploadProps extends BaseComponentProps {
|
|
|
723
945
|
onFileSelect?: (files: File[]) => void;
|
|
724
946
|
onFileRemove?: (index: number) => void;
|
|
725
947
|
disabled?: boolean;
|
|
948
|
+
capture?: boolean | 'user' | 'environment';
|
|
726
949
|
}
|
|
727
950
|
export interface CarouselProps extends BaseComponentProps, Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
728
951
|
children?: ReactNode;
|
|
@@ -743,8 +966,6 @@ export interface RateProps extends BaseComponentProps {
|
|
|
743
966
|
readOnly?: boolean;
|
|
744
967
|
icon?: ReactNode;
|
|
745
968
|
toggledIcon?: ReactNode;
|
|
746
|
-
activeColor?: string;
|
|
747
|
-
inactiveColor?: string;
|
|
748
969
|
size?: number;
|
|
749
970
|
onChange?: (value: number) => void;
|
|
750
971
|
onClick?: (value: number) => void;
|
|
@@ -758,14 +979,18 @@ export interface ThreeDotPopoverItem {
|
|
|
758
979
|
onClick?: (item: ThreeDotPopoverItem) => void;
|
|
759
980
|
disabled?: boolean;
|
|
760
981
|
destructive?: boolean;
|
|
982
|
+
tone?: 'default' | 'destructive';
|
|
761
983
|
}
|
|
762
984
|
export interface ThreeDotPopoverProps extends BaseComponentProps {
|
|
763
985
|
items?: ThreeDotPopoverItem[];
|
|
764
986
|
trigger?: ReactElement;
|
|
987
|
+
wrapperClassName?: string;
|
|
765
988
|
menuClass?: string;
|
|
766
989
|
menuItemClass?: string;
|
|
767
990
|
closeOnSelect?: boolean;
|
|
768
991
|
ariaLabel?: string;
|
|
992
|
+
presentation?: OverlayPresentation;
|
|
993
|
+
cancelLabel?: ReactNode;
|
|
769
994
|
}
|
|
770
995
|
export interface LatLng {
|
|
771
996
|
lat: number;
|
|
@@ -779,9 +1004,11 @@ export interface LocationPickerProps extends BaseComponentProps {
|
|
|
779
1004
|
iconProps?: Record<string, any>;
|
|
780
1005
|
iconPosition?: 'left' | 'right';
|
|
781
1006
|
placeholder?: string;
|
|
1007
|
+
fullWidth?: boolean;
|
|
782
1008
|
}
|
|
783
1009
|
export interface SpeechToTextState {
|
|
784
1010
|
isListening: boolean;
|
|
1011
|
+
isHearing: boolean;
|
|
785
1012
|
isSupported: boolean;
|
|
786
1013
|
error: Error | null;
|
|
787
1014
|
start: () => void;
|
|
@@ -843,6 +1070,21 @@ export interface ApiConfig {
|
|
|
843
1070
|
createRequestInstance?: (baseURL?: string | null, defaultHeaders?: Record<string, string>) => any;
|
|
844
1071
|
sendRequest?: (requestInstance: any, method: string, url: string, data?: any, headers?: Record<string, string>) => Promise<any>;
|
|
845
1072
|
}
|
|
1073
|
+
export type HapticPatternName = "selection" | "success" | "warning" | "error";
|
|
1074
|
+
/** A named pattern, a single duration in ms, or a vibrate/pause sequence. */
|
|
1075
|
+
export type HapticPattern = HapticPatternName | number | number[];
|
|
1076
|
+
export interface UseHapticsOptions {
|
|
1077
|
+
/** Gates every `trigger` call (default `true`). */
|
|
1078
|
+
enabled?: boolean;
|
|
1079
|
+
}
|
|
1080
|
+
export interface UseHapticsReturn {
|
|
1081
|
+
/** Requests a vibration; returns `true` when one was requested. */
|
|
1082
|
+
trigger: (pattern?: HapticPattern) => boolean;
|
|
1083
|
+
/** `true` when the device exposes `navigator.vibrate` (`false` on the server and while hydrating). */
|
|
1084
|
+
supported: boolean;
|
|
1085
|
+
/** Mirrors `prefers-reduced-motion`; `trigger` is a no-op while it is `true`. */
|
|
1086
|
+
reducedMotion: boolean;
|
|
1087
|
+
}
|
|
846
1088
|
export interface UseApiReturn {
|
|
847
1089
|
data: any;
|
|
848
1090
|
error: any;
|
|
@@ -908,12 +1150,82 @@ export interface DrawerProps extends BaseComponentProps, Omit<HTMLAttributes<HTM
|
|
|
908
1150
|
initialFocusRef?: RefObject<HTMLElement>;
|
|
909
1151
|
/** Decorative grab handle. Defaults to `true` for `placement="bottom"`. */
|
|
910
1152
|
handle?: boolean;
|
|
911
|
-
/**
|
|
1153
|
+
/** Dragging the handle/header toward the drawer's own edge past a threshold (or a flick) calls `onClose`. Any placement. */
|
|
912
1154
|
swipeToClose?: boolean;
|
|
913
1155
|
}
|
|
914
1156
|
export interface DrawerSectionProps extends BaseComponentProps, Omit<HTMLAttributes<HTMLDivElement>, 'className'> {
|
|
915
1157
|
children?: ReactNode;
|
|
916
1158
|
}
|
|
1159
|
+
export type SheetPlacement = 'bottom' | 'top' | 'left' | 'right';
|
|
1160
|
+
export type SheetCloseReason = 'escape' | 'backdrop' | 'drag' | 'close-button';
|
|
1161
|
+
export interface SheetProps extends BaseComponentProps, Omit<HTMLAttributes<HTMLDivElement>, 'className' | 'title'> {
|
|
1162
|
+
/** Controlled visibility. */
|
|
1163
|
+
open?: boolean;
|
|
1164
|
+
/** Alias of `open` (matches Drawer / Dialog). */
|
|
1165
|
+
isOpen?: boolean;
|
|
1166
|
+
/** Called with why the sheet wants to close. */
|
|
1167
|
+
onClose?: (reason: SheetCloseReason) => void;
|
|
1168
|
+
placement?: SheetPlacement;
|
|
1169
|
+
/** Fractions of the visual viewport height in (0, 1]; bottom/top only. */
|
|
1170
|
+
snapPoints?: number[];
|
|
1171
|
+
/** Controlled snap index into `snapPoints`. */
|
|
1172
|
+
activeSnap?: number;
|
|
1173
|
+
/** Uncontrolled initial snap index (default 0); restored on every open. */
|
|
1174
|
+
defaultSnap?: number;
|
|
1175
|
+
onSnapChange?: (index: number) => void;
|
|
1176
|
+
/** Opt-in `selection` vibration when a drag or arrow key settles on a new snap point. */
|
|
1177
|
+
haptics?: boolean;
|
|
1178
|
+
/** `false` disables Escape, backdrop and drag dismissal (drags rubber-band back). */
|
|
1179
|
+
dismissible?: boolean;
|
|
1180
|
+
/** Grab handle. Defaults to `true` for `placement="bottom"`. */
|
|
1181
|
+
handle?: boolean;
|
|
1182
|
+
/** Scale the element marked `data-sheet-background` while open. No-op under reduced motion. */
|
|
1183
|
+
scaleBackground?: boolean;
|
|
1184
|
+
/** Rendered in an automatic Sheet.Header; labels the dialog. */
|
|
1185
|
+
title?: ReactNode;
|
|
1186
|
+
/** Rendered under the title; wired to `aria-describedby`. */
|
|
1187
|
+
description?: ReactNode;
|
|
1188
|
+
/** Close button in the automatic header (shown when `title`/`description` is set). */
|
|
1189
|
+
showCloseButton?: boolean;
|
|
1190
|
+
/** Element to focus on open (default: first focusable element, skipping the handle). */
|
|
1191
|
+
initialFocus?: RefObject<HTMLElement>;
|
|
1192
|
+
children?: ReactNode;
|
|
1193
|
+
}
|
|
1194
|
+
export interface SheetSectionProps extends BaseComponentProps, Omit<HTMLAttributes<HTMLDivElement>, 'className'> {
|
|
1195
|
+
children?: ReactNode;
|
|
1196
|
+
}
|
|
1197
|
+
export type ActionSheetCloseReason = 'select' | 'cancel' | 'escape' | 'backdrop' | 'drag';
|
|
1198
|
+
export interface ActionSheetAction {
|
|
1199
|
+
/** React key; defaults to the index. */
|
|
1200
|
+
key?: string | number;
|
|
1201
|
+
label: ReactNode;
|
|
1202
|
+
/** A node (`<Trash2 />`) or a component type (`Trash2`). */
|
|
1203
|
+
icon?: ReactNode | ComponentType<{
|
|
1204
|
+
className?: string;
|
|
1205
|
+
}>;
|
|
1206
|
+
/** `'destructive'` renders the row in the error tone. Default `'default'`. */
|
|
1207
|
+
tone?: 'default' | 'destructive';
|
|
1208
|
+
/** Called before the sheet's `onClose('select')`. */
|
|
1209
|
+
onSelect?: () => void;
|
|
1210
|
+
disabled?: boolean;
|
|
1211
|
+
}
|
|
1212
|
+
export interface ActionSheetProps extends BaseComponentProps, Omit<HTMLAttributes<HTMLDivElement>, 'className' | 'title'> {
|
|
1213
|
+
/** Controlled visibility. */
|
|
1214
|
+
open?: boolean;
|
|
1215
|
+
/** Alias of `open`. */
|
|
1216
|
+
isOpen?: boolean;
|
|
1217
|
+
/** Called after an action's `onSelect` (reason `'select'`), on Cancel, Escape, backdrop or drag. */
|
|
1218
|
+
onClose?: (reason: ActionSheetCloseReason) => void;
|
|
1219
|
+
/** Small heading above the actions; names the sheet unless `aria-label` is set. */
|
|
1220
|
+
title?: ReactNode;
|
|
1221
|
+
/** Muted text under the title; wired to `aria-describedby`. */
|
|
1222
|
+
message?: ReactNode;
|
|
1223
|
+
actions?: ActionSheetAction[];
|
|
1224
|
+
/** Text of the separate Cancel button. Default `'Cancel'`. */
|
|
1225
|
+
cancelLabel?: ReactNode;
|
|
1226
|
+
/** `false` disables Escape, backdrop and drag dismissal. Default `true`. */
|
|
1227
|
+
dismissible?: boolean;
|
|
1228
|
+
}
|
|
917
1229
|
export type PopoverPlacement = 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end';
|
|
918
1230
|
export interface PopoverProps extends BaseComponentProps, Omit<HTMLAttributes<HTMLDivElement>, 'className' | 'title' | 'children'> {
|
|
919
1231
|
/** The element that toggles the popover. Non-elements are wrapped in a `<button>`. */
|
|
@@ -930,6 +1242,8 @@ export interface PopoverProps extends BaseComponentProps, Omit<HTMLAttributes<HT
|
|
|
930
1242
|
title?: ReactNode;
|
|
931
1243
|
initialFocusRef?: RefObject<HTMLElement>;
|
|
932
1244
|
disabled?: boolean;
|
|
1245
|
+
/** `auto` (default): a bottom Sheet on phones, the anchored panel elsewhere. */
|
|
1246
|
+
presentation?: OverlayPresentation;
|
|
933
1247
|
}
|
|
934
1248
|
export interface TextareaProps extends BaseComponentProps, Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'className'> {
|
|
935
1249
|
label?: ReactNode;
|
|
@@ -943,6 +1257,8 @@ export interface TextareaProps extends BaseComponentProps, Omit<TextareaHTMLAttr
|
|
|
943
1257
|
autoResize?: boolean;
|
|
944
1258
|
rows?: number;
|
|
945
1259
|
maxRows?: number;
|
|
1260
|
+
/** Padding / text size. `md` (default) is the original look. */
|
|
1261
|
+
size?: 'sm' | 'md' | 'lg';
|
|
946
1262
|
}
|
|
947
1263
|
export type SliderValue = number | [number, number];
|
|
948
1264
|
export interface SliderProps extends BaseComponentProps, Omit<HTMLAttributes<HTMLDivElement>, 'className' | 'onChange' | 'defaultValue'> {
|
|
@@ -960,6 +1276,8 @@ export interface SliderProps extends BaseComponentProps, Omit<HTMLAttributes<HTM
|
|
|
960
1276
|
disabled?: boolean;
|
|
961
1277
|
label?: ReactNode;
|
|
962
1278
|
showValue?: boolean;
|
|
1279
|
+
/** Show a value bubble above the thumb while it is being dragged. Default `true`. */
|
|
1280
|
+
showBubble?: boolean;
|
|
963
1281
|
formatValue?: (value: number) => string;
|
|
964
1282
|
/** Accessible names for the two range thumbs. */
|
|
965
1283
|
thumbLabels?: [string, string];
|
|
@@ -1004,7 +1322,7 @@ export interface SortableProps<T = any> extends BaseComponentProps, Omit<HTMLAtt
|
|
|
1004
1322
|
itemClassName?: string;
|
|
1005
1323
|
messages?: SortableMessages;
|
|
1006
1324
|
}
|
|
1007
|
-
export type TourPlacement = 'top' | 'bottom' | 'left' | 'right' | 'center';
|
|
1325
|
+
export type TourPlacement = 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end' | 'center';
|
|
1008
1326
|
export type TourTarget = string | RefObject<HTMLElement> | HTMLElement | (() => HTMLElement | null);
|
|
1009
1327
|
export type TourCloseReason = 'skip' | 'escape' | 'close' | 'finish';
|
|
1010
1328
|
export interface TourStep {
|
|
@@ -1035,6 +1353,71 @@ export interface TourProps extends BaseComponentProps, Omit<HTMLAttributes<HTMLD
|
|
|
1035
1353
|
/** How long (ms) to wait for a step's target before showing a centred card. */
|
|
1036
1354
|
targetTimeout?: number;
|
|
1037
1355
|
spotlightPadding?: number;
|
|
1356
|
+
/**
|
|
1357
|
+
* `sheet` docks the step card at the bottom of the screen (swipe left/right
|
|
1358
|
+
* for next/back); `popover` anchors it to the target; `auto` (default) docks
|
|
1359
|
+
* on small touch screens.
|
|
1360
|
+
*/
|
|
1361
|
+
presentation?: OverlayPresentation;
|
|
1362
|
+
}
|
|
1363
|
+
export interface SearchFieldResultsContext {
|
|
1364
|
+
/** The current text. */
|
|
1365
|
+
value: string;
|
|
1366
|
+
/** Hides the results (popover or sheet). */
|
|
1367
|
+
close: () => void;
|
|
1368
|
+
}
|
|
1369
|
+
export interface SearchFieldProps extends BaseComponentProps, Omit<InputHTMLAttributes<HTMLInputElement>, 'className' | 'style' | 'value' | 'defaultValue' | 'onChange' | 'type' | 'size' | 'results'> {
|
|
1370
|
+
/** Controlled value. */
|
|
1371
|
+
value?: string;
|
|
1372
|
+
/** Uncontrolled initial value. Default `""`. */
|
|
1373
|
+
defaultValue?: string;
|
|
1374
|
+
/** New text on every change (typing, clear, Escape, Cancel). */
|
|
1375
|
+
onValueChange?: (value: string) => void;
|
|
1376
|
+
/** The input's change event; clear / Escape / Cancel pass `{ target: { value: "" } }`. */
|
|
1377
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement> | {
|
|
1378
|
+
target: {
|
|
1379
|
+
value: string;
|
|
1380
|
+
};
|
|
1381
|
+
}) => void;
|
|
1382
|
+
/** Enter (outside IME composition). */
|
|
1383
|
+
onSearch?: (value: string) => void;
|
|
1384
|
+
onClear?: () => void;
|
|
1385
|
+
/** After Cancel clears and blurs the field. */
|
|
1386
|
+
onCancel?: () => void;
|
|
1387
|
+
/** `'auto'` (default): on phones while focused. */
|
|
1388
|
+
showCancel?: boolean | 'auto';
|
|
1389
|
+
/** Default `"Cancel"`. */
|
|
1390
|
+
cancelLabel?: string;
|
|
1391
|
+
/** Default `"Clear search"`. */
|
|
1392
|
+
clearLabel?: string;
|
|
1393
|
+
/** Results content; turns the results surface on. */
|
|
1394
|
+
results?: ReactNode;
|
|
1395
|
+
renderResults?: (ctx: SearchFieldResultsContext) => ReactNode;
|
|
1396
|
+
/** Controlled results visibility. */
|
|
1397
|
+
resultsOpen?: boolean;
|
|
1398
|
+
onResultsOpenChange?: (open: boolean) => void;
|
|
1399
|
+
/** Accessible name of the results region / sheet. Default `"Search results"`. */
|
|
1400
|
+
resultsLabel?: string;
|
|
1401
|
+
/** `'auto'` (default): a full-height Sheet on phones, a popover beneath the field elsewhere. */
|
|
1402
|
+
presentation?: OverlayPresentation;
|
|
1403
|
+
/** Classes for the `<input>`; `className` styles the root wrapper. */
|
|
1404
|
+
inputClassName?: string;
|
|
1038
1405
|
}
|
|
1039
1406
|
export * from './blocks';
|
|
1407
|
+
export interface PullToRefreshProps extends BaseComponentProps, Omit<HTMLAttributes<HTMLDivElement>, 'className'> {
|
|
1408
|
+
/** Called on release past `threshold`; the spinner spins until the returned promise settles. */
|
|
1409
|
+
onRefresh?: () => Promise<unknown> | void;
|
|
1410
|
+
/** Pull distance (px, after resistance) that arms a refresh. Default 64. */
|
|
1411
|
+
threshold?: number;
|
|
1412
|
+
/** Ceiling of the resistance-scaled pull (px). Default `threshold * 2`. */
|
|
1413
|
+
maxPull?: number;
|
|
1414
|
+
disabled?: boolean;
|
|
1415
|
+
/** Polite live-region text while refreshing. Default "Refreshing…". */
|
|
1416
|
+
refreshingLabel?: string;
|
|
1417
|
+
/** Your own scroll container inside `children`; omit to let PullToRefresh render one. */
|
|
1418
|
+
scrollRef?: RefObject<HTMLElement>;
|
|
1419
|
+
/** Classes for the inner content (scroll) element. */
|
|
1420
|
+
contentClassName?: string;
|
|
1421
|
+
children?: ReactNode;
|
|
1422
|
+
}
|
|
1040
1423
|
//# sourceMappingURL=index.d.ts.map
|