@dreamtree-org/twreact-ui 1.3.11 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -6
- package/ai-skills/dreamtree-ui.md +47 -9
- package/codemods/v2.cjs +198 -0
- package/dist/ai-schema.json +609 -33
- 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/core/Checkbox.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/Popover.d.ts.map +1 -1
- package/dist/components/core/ProgressBar.d.ts.map +1 -1
- package/dist/components/core/Rate.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/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 +3 -3
- package/dist/components/core/Tabs.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/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/PullToRefresh.d.ts +5 -0
- package/dist/components/utility/PullToRefresh.d.ts.map +1 -0
- 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/PageHeader.js +16 -3
- package/dist/esm/components/core/Checkbox.js +13 -24
- 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 +13 -18
- package/dist/esm/components/core/Popover.js +59 -48
- package/dist/esm/components/core/ProgressBar.js +36 -64
- package/dist/esm/components/core/Rate.js +5 -10
- 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/SwipeableListItem.js +286 -0
- package/dist/esm/components/core/SwipeableListItemGesture.js +219 -0
- package/dist/esm/components/core/Switch.js +11 -13
- 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 +7 -7
- 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/Dropdown.js +1 -1
- 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/Portal.js +31 -0
- package/dist/esm/components/utility/PullToRefresh.js +229 -0
- 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/index.js +13 -2
- package/dist/esm/utils/position.js +10 -63
- 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/index.css +1 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.esm.css +1 -1
- package/dist/index.esm.js +8851 -3198
- package/dist/index.js +8856 -3195
- 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/index.d.ts +353 -19
- 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 +15 -0
- package/mcp/catalog.snapshot.json +1398 -464
- 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';
|
|
@@ -45,8 +45,10 @@ export interface InputProps extends BaseComponentProps, Omit<InputHTMLAttributes
|
|
|
45
45
|
disabled?: boolean;
|
|
46
46
|
required?: boolean;
|
|
47
47
|
clearable?: boolean;
|
|
48
|
-
icon
|
|
49
|
-
|
|
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;
|
|
50
52
|
showCount?: boolean;
|
|
51
53
|
maxLength?: number;
|
|
52
54
|
readOnly?: boolean;
|
|
@@ -101,7 +103,19 @@ export interface SelectProps extends BaseComponentProps {
|
|
|
101
103
|
renderGroupLabel?: (label: string) => ReactNode;
|
|
102
104
|
/** Trigger size. `md` grows to the 44px touch target on coarse pointers; `lg` is 44px everywhere. */
|
|
103
105
|
size?: 'sm' | 'md' | 'lg';
|
|
104
|
-
|
|
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 & {});
|
|
105
119
|
export interface CheckboxProps extends BaseComponentProps {
|
|
106
120
|
checked?: boolean;
|
|
107
121
|
defaultChecked?: boolean;
|
|
@@ -115,9 +129,12 @@ export interface CheckboxProps extends BaseComponentProps {
|
|
|
115
129
|
value?: string | number;
|
|
116
130
|
ariaLabel?: string;
|
|
117
131
|
labelPosition?: 'left' | 'right';
|
|
118
|
-
|
|
132
|
+
/** Token preset (aliases `green` / `danger` / `red`), or a custom CSS colour string. */
|
|
133
|
+
color?: ToggleColor;
|
|
119
134
|
iconClass?: string;
|
|
120
135
|
checkedClass?: string;
|
|
136
|
+
/** Opt-in `selection` vibration on change (no-op without the Vibration API or under reduced motion). */
|
|
137
|
+
haptics?: boolean;
|
|
121
138
|
}
|
|
122
139
|
export interface RadioOption {
|
|
123
140
|
value: string | number;
|
|
@@ -138,6 +155,29 @@ export interface RadioProps extends BaseComponentProps {
|
|
|
138
155
|
radioColor?: string;
|
|
139
156
|
ariaLabel?: string;
|
|
140
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
|
+
}
|
|
141
181
|
export interface SwitchProps extends BaseComponentProps {
|
|
142
182
|
checked?: boolean;
|
|
143
183
|
defaultChecked?: boolean;
|
|
@@ -145,6 +185,8 @@ export interface SwitchProps extends BaseComponentProps {
|
|
|
145
185
|
disabled?: boolean;
|
|
146
186
|
size?: Size;
|
|
147
187
|
name?: string;
|
|
188
|
+
/** Token preset or a custom CSS colour string (raw-palette presets removed in 2.0.0). */
|
|
189
|
+
color?: ToggleColor;
|
|
148
190
|
trackClass?: string;
|
|
149
191
|
thumbClass?: string;
|
|
150
192
|
topLabel?: ReactNode;
|
|
@@ -152,6 +194,8 @@ export interface SwitchProps extends BaseComponentProps {
|
|
|
152
194
|
leftLabel?: ReactNode;
|
|
153
195
|
rightLabel?: ReactNode;
|
|
154
196
|
ariaLabel?: string;
|
|
197
|
+
/** Opt-in `selection` vibration on toggle (no-op without the Vibration API or under reduced motion). */
|
|
198
|
+
haptics?: boolean;
|
|
155
199
|
}
|
|
156
200
|
export interface DatePickerProps extends BaseComponentProps {
|
|
157
201
|
value?: Date | string | null;
|
|
@@ -170,6 +214,7 @@ export interface DatePickerProps extends BaseComponentProps {
|
|
|
170
214
|
locale?: any;
|
|
171
215
|
showClear?: boolean;
|
|
172
216
|
closeOnSelect?: boolean;
|
|
217
|
+
presentation?: 'auto' | 'popover' | 'sheet';
|
|
173
218
|
}
|
|
174
219
|
export interface DateRange {
|
|
175
220
|
start: Date | null;
|
|
@@ -192,6 +237,12 @@ export interface DateRangePickerProps extends BaseComponentProps {
|
|
|
192
237
|
locale?: any;
|
|
193
238
|
showClear?: boolean;
|
|
194
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];
|
|
195
246
|
}
|
|
196
247
|
export interface ColorPickerProps extends BaseComponentProps {
|
|
197
248
|
value?: string;
|
|
@@ -292,7 +343,10 @@ export interface TableAction<T = any> {
|
|
|
292
343
|
hidden?: TableValueOrFn<boolean, T>;
|
|
293
344
|
disabled?: TableValueOrFn<boolean, T>;
|
|
294
345
|
inline?: boolean;
|
|
346
|
+
tone?: 'default' | 'destructive';
|
|
347
|
+
destructive?: boolean;
|
|
295
348
|
}
|
|
349
|
+
export type OverlayPresentation = 'auto' | 'popover' | 'sheet';
|
|
296
350
|
export interface TableSortConfig {
|
|
297
351
|
key: string | null;
|
|
298
352
|
direction: 'asc' | 'desc';
|
|
@@ -359,6 +413,7 @@ export interface TableProps<T = any> extends BaseComponentProps {
|
|
|
359
413
|
stripedRows?: boolean;
|
|
360
414
|
theme?: TableTheme;
|
|
361
415
|
responsiveBreakpoint?: number;
|
|
416
|
+
actionMenuPresentation?: OverlayPresentation;
|
|
362
417
|
showToolbar?: boolean;
|
|
363
418
|
showColumnPicker?: boolean;
|
|
364
419
|
wrapCells?: boolean;
|
|
@@ -395,6 +450,85 @@ export interface TableProps<T = any> extends BaseComponentProps {
|
|
|
395
450
|
}) => void;
|
|
396
451
|
onRowAdd?: (row: Partial<T>) => void;
|
|
397
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;
|
|
398
532
|
}
|
|
399
533
|
export interface NavItem {
|
|
400
534
|
id: string;
|
|
@@ -463,6 +597,10 @@ export interface NavbarProps extends BaseComponentProps {
|
|
|
463
597
|
rightMenuContent?: ReactNode | ((props: {
|
|
464
598
|
notifications?: Notification[];
|
|
465
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;
|
|
466
604
|
}
|
|
467
605
|
export interface SidebarProps extends BaseComponentProps {
|
|
468
606
|
items: SidebarItem[];
|
|
@@ -483,6 +621,8 @@ export interface SidebarProps extends BaseComponentProps {
|
|
|
483
621
|
footer?: ReactNode | ((ctx: SidebarFooterContext) => ReactNode);
|
|
484
622
|
stickyOffset?: number | string;
|
|
485
623
|
containerClassName?: string;
|
|
624
|
+
/** Phones: edge swipe opens the drawer, swiping it toward its edge closes it. Default `true`. */
|
|
625
|
+
swipeable?: boolean;
|
|
486
626
|
}
|
|
487
627
|
export interface SidebarFooterContext {
|
|
488
628
|
collapsed: boolean;
|
|
@@ -517,12 +657,17 @@ export interface BreadcrumbsProps extends BaseComponentProps {
|
|
|
517
657
|
onHomeClick?: (item: BreadcrumbItem) => void;
|
|
518
658
|
maxItems?: number;
|
|
519
659
|
}
|
|
660
|
+
export type AlertVariant = AlertType | 'neutral';
|
|
520
661
|
export interface AlertProps extends BaseComponentProps {
|
|
521
|
-
variant?:
|
|
662
|
+
variant?: AlertVariant;
|
|
522
663
|
title?: string;
|
|
523
664
|
children?: ReactNode;
|
|
665
|
+
/** Rendered after the description (buttons, links). */
|
|
666
|
+
actions?: ReactNode;
|
|
524
667
|
dismissible?: boolean;
|
|
525
668
|
onDismiss?: () => void;
|
|
669
|
+
/** Accessible name of the dismiss button. Default `'Dismiss'`. */
|
|
670
|
+
dismissLabel?: string;
|
|
526
671
|
}
|
|
527
672
|
export type DialogSize = 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
528
673
|
export interface DialogProps extends BaseComponentProps {
|
|
@@ -537,6 +682,11 @@ export interface DialogProps extends BaseComponentProps {
|
|
|
537
682
|
onOpen?: (context: {
|
|
538
683
|
dialogRef: HTMLDivElement | null;
|
|
539
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;
|
|
540
690
|
}
|
|
541
691
|
export interface ToastProps extends BaseComponentProps {
|
|
542
692
|
id: string;
|
|
@@ -546,14 +696,42 @@ export interface ToastProps extends BaseComponentProps {
|
|
|
546
696
|
duration?: number;
|
|
547
697
|
onClose?: (id: string) => void;
|
|
548
698
|
position?: Position;
|
|
549
|
-
|
|
550
|
-
|
|
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 {
|
|
551
729
|
toasts?: ToastProps[];
|
|
552
730
|
position?: Position;
|
|
553
731
|
onRemove?: (id: string) => void;
|
|
554
732
|
className?: string;
|
|
555
733
|
}
|
|
556
|
-
export interface ToastProviderProps {
|
|
734
|
+
export interface ToastProviderProps extends ToastStackOptions {
|
|
557
735
|
children?: ReactNode;
|
|
558
736
|
position?: Position;
|
|
559
737
|
className?: string;
|
|
@@ -623,8 +801,10 @@ export interface TabListProps extends BaseComponentProps {
|
|
|
623
801
|
export interface TabProps extends BaseComponentProps {
|
|
624
802
|
children?: ReactNode;
|
|
625
803
|
index?: number;
|
|
626
|
-
iconLeft
|
|
627
|
-
|
|
804
|
+
/** Renamed from `iconLeft` in 2.0.0. */
|
|
805
|
+
leftIcon?: ReactNode;
|
|
806
|
+
/** Renamed from `iconRight` in 2.0.0. */
|
|
807
|
+
rightIcon?: ReactNode;
|
|
628
808
|
disabled?: boolean;
|
|
629
809
|
tabClassName?: string;
|
|
630
810
|
}
|
|
@@ -711,15 +891,15 @@ export interface SkeletonProps extends BaseComponentProps {
|
|
|
711
891
|
inline?: boolean;
|
|
712
892
|
children?: ReactNode;
|
|
713
893
|
}
|
|
894
|
+
export type ProgressBarVariant = 'primary' | 'secondary' | 'success' | 'warning' | 'destructive';
|
|
714
895
|
export interface ProgressBarProps extends BaseComponentProps {
|
|
715
896
|
value?: number;
|
|
716
897
|
max?: number;
|
|
717
898
|
size?: Size | number;
|
|
718
899
|
showValue?: boolean;
|
|
719
900
|
rounded?: boolean;
|
|
720
|
-
color
|
|
721
|
-
|
|
722
|
-
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;
|
|
723
903
|
striped?: boolean;
|
|
724
904
|
animated?: boolean;
|
|
725
905
|
label?: ReactNode;
|
|
@@ -740,7 +920,7 @@ export interface RoundedTagProps extends BaseComponentProps {
|
|
|
740
920
|
initialClassname?: string;
|
|
741
921
|
}
|
|
742
922
|
export type TooltipTrigger = 'hover' | 'click' | 'focus';
|
|
743
|
-
export interface TooltipProps extends BaseComponentProps {
|
|
923
|
+
export interface TooltipProps extends BaseComponentProps, Omit<HTMLAttributes<HTMLDivElement>, 'className' | 'style' | 'id' | 'content' | 'children' | 'onChange'> {
|
|
744
924
|
position?: 'auto' | 'top' | 'bottom' | 'left' | 'right';
|
|
745
925
|
trigger?: TooltipTrigger | TooltipTrigger[];
|
|
746
926
|
content?: ReactNode | ((args: {
|
|
@@ -786,8 +966,6 @@ export interface RateProps extends BaseComponentProps {
|
|
|
786
966
|
readOnly?: boolean;
|
|
787
967
|
icon?: ReactNode;
|
|
788
968
|
toggledIcon?: ReactNode;
|
|
789
|
-
activeColor?: string;
|
|
790
|
-
inactiveColor?: string;
|
|
791
969
|
size?: number;
|
|
792
970
|
onChange?: (value: number) => void;
|
|
793
971
|
onClick?: (value: number) => void;
|
|
@@ -801,14 +979,18 @@ export interface ThreeDotPopoverItem {
|
|
|
801
979
|
onClick?: (item: ThreeDotPopoverItem) => void;
|
|
802
980
|
disabled?: boolean;
|
|
803
981
|
destructive?: boolean;
|
|
982
|
+
tone?: 'default' | 'destructive';
|
|
804
983
|
}
|
|
805
984
|
export interface ThreeDotPopoverProps extends BaseComponentProps {
|
|
806
985
|
items?: ThreeDotPopoverItem[];
|
|
807
986
|
trigger?: ReactElement;
|
|
987
|
+
wrapperClassName?: string;
|
|
808
988
|
menuClass?: string;
|
|
809
989
|
menuItemClass?: string;
|
|
810
990
|
closeOnSelect?: boolean;
|
|
811
991
|
ariaLabel?: string;
|
|
992
|
+
presentation?: OverlayPresentation;
|
|
993
|
+
cancelLabel?: ReactNode;
|
|
812
994
|
}
|
|
813
995
|
export interface LatLng {
|
|
814
996
|
lat: number;
|
|
@@ -888,6 +1070,21 @@ export interface ApiConfig {
|
|
|
888
1070
|
createRequestInstance?: (baseURL?: string | null, defaultHeaders?: Record<string, string>) => any;
|
|
889
1071
|
sendRequest?: (requestInstance: any, method: string, url: string, data?: any, headers?: Record<string, string>) => Promise<any>;
|
|
890
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
|
+
}
|
|
891
1088
|
export interface UseApiReturn {
|
|
892
1089
|
data: any;
|
|
893
1090
|
error: any;
|
|
@@ -953,12 +1150,82 @@ export interface DrawerProps extends BaseComponentProps, Omit<HTMLAttributes<HTM
|
|
|
953
1150
|
initialFocusRef?: RefObject<HTMLElement>;
|
|
954
1151
|
/** Decorative grab handle. Defaults to `true` for `placement="bottom"`. */
|
|
955
1152
|
handle?: boolean;
|
|
956
|
-
/**
|
|
1153
|
+
/** Dragging the handle/header toward the drawer's own edge past a threshold (or a flick) calls `onClose`. Any placement. */
|
|
957
1154
|
swipeToClose?: boolean;
|
|
958
1155
|
}
|
|
959
1156
|
export interface DrawerSectionProps extends BaseComponentProps, Omit<HTMLAttributes<HTMLDivElement>, 'className'> {
|
|
960
1157
|
children?: ReactNode;
|
|
961
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
|
+
}
|
|
962
1229
|
export type PopoverPlacement = 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end';
|
|
963
1230
|
export interface PopoverProps extends BaseComponentProps, Omit<HTMLAttributes<HTMLDivElement>, 'className' | 'title' | 'children'> {
|
|
964
1231
|
/** The element that toggles the popover. Non-elements are wrapped in a `<button>`. */
|
|
@@ -975,6 +1242,8 @@ export interface PopoverProps extends BaseComponentProps, Omit<HTMLAttributes<HT
|
|
|
975
1242
|
title?: ReactNode;
|
|
976
1243
|
initialFocusRef?: RefObject<HTMLElement>;
|
|
977
1244
|
disabled?: boolean;
|
|
1245
|
+
/** `auto` (default): a bottom Sheet on phones, the anchored panel elsewhere. */
|
|
1246
|
+
presentation?: OverlayPresentation;
|
|
978
1247
|
}
|
|
979
1248
|
export interface TextareaProps extends BaseComponentProps, Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'className'> {
|
|
980
1249
|
label?: ReactNode;
|
|
@@ -1053,7 +1322,7 @@ export interface SortableProps<T = any> extends BaseComponentProps, Omit<HTMLAtt
|
|
|
1053
1322
|
itemClassName?: string;
|
|
1054
1323
|
messages?: SortableMessages;
|
|
1055
1324
|
}
|
|
1056
|
-
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';
|
|
1057
1326
|
export type TourTarget = string | RefObject<HTMLElement> | HTMLElement | (() => HTMLElement | null);
|
|
1058
1327
|
export type TourCloseReason = 'skip' | 'escape' | 'close' | 'finish';
|
|
1059
1328
|
export interface TourStep {
|
|
@@ -1084,6 +1353,71 @@ export interface TourProps extends BaseComponentProps, Omit<HTMLAttributes<HTMLD
|
|
|
1084
1353
|
/** How long (ms) to wait for a step's target before showing a centred card. */
|
|
1085
1354
|
targetTimeout?: number;
|
|
1086
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;
|
|
1087
1405
|
}
|
|
1088
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
|
+
}
|
|
1089
1423
|
//# sourceMappingURL=index.d.ts.map
|