@dashforge/tw 1.1.1 → 1.2.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/CHANGELOG.md +113 -0
- package/README.md +45 -0
- package/dist/index.esm.js +3985 -476
- package/dist/src/components/Accordion/Accordion.d.ts.map +1 -1
- package/dist/src/components/Accordion/accordion.types.d.ts +7 -0
- package/dist/src/components/Accordion/accordion.types.d.ts.map +1 -1
- package/dist/src/components/Alert/Alert.d.ts +1 -1
- package/dist/src/components/Alert/Alert.d.ts.map +1 -1
- package/dist/src/components/Alert/alert.types.d.ts +17 -0
- package/dist/src/components/Alert/alert.types.d.ts.map +1 -1
- package/dist/src/components/AppShell/AppShell.d.ts.map +1 -1
- package/dist/src/components/AppShell/appShell.types.d.ts +7 -0
- package/dist/src/components/AppShell/appShell.types.d.ts.map +1 -1
- package/dist/src/components/Autocomplete/Autocomplete.d.ts.map +1 -1
- package/dist/src/components/Autocomplete/autocomplete.types.d.ts +47 -1
- package/dist/src/components/Autocomplete/autocomplete.types.d.ts.map +1 -1
- package/dist/src/components/Avatar/Avatar.d.ts.map +1 -1
- package/dist/src/components/Avatar/avatar.types.d.ts +17 -1
- package/dist/src/components/Avatar/avatar.types.d.ts.map +1 -1
- package/dist/src/components/Badge/Badge.d.ts.map +1 -1
- package/dist/src/components/Badge/badge.types.d.ts +27 -2
- package/dist/src/components/Badge/badge.types.d.ts.map +1 -1
- package/dist/src/components/Box/Box.d.ts.map +1 -1
- package/dist/src/components/Box/box.types.d.ts +64 -1
- package/dist/src/components/Box/box.types.d.ts.map +1 -1
- package/dist/src/components/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
- package/dist/src/components/Breadcrumbs/breadcrumbs.types.d.ts +26 -1
- package/dist/src/components/Breadcrumbs/breadcrumbs.types.d.ts.map +1 -1
- package/dist/src/components/Button/Button.d.ts.map +1 -1
- package/dist/src/components/Button/button.types.d.ts +53 -1
- package/dist/src/components/Button/button.types.d.ts.map +1 -1
- package/dist/src/components/Calendar/Calendar.d.ts.map +1 -1
- package/dist/src/components/Calendar/calendar.types.d.ts +16 -0
- package/dist/src/components/Calendar/calendar.types.d.ts.map +1 -1
- package/dist/src/components/Card/Card.d.ts.map +1 -1
- package/dist/src/components/Card/card.types.d.ts +17 -0
- package/dist/src/components/Card/card.types.d.ts.map +1 -1
- package/dist/src/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/src/components/Checkbox/checkbox.types.d.ts +19 -1
- package/dist/src/components/Checkbox/checkbox.types.d.ts.map +1 -1
- package/dist/src/components/Chip/Chip.d.ts.map +1 -1
- package/dist/src/components/Chip/chip.types.d.ts +40 -1
- package/dist/src/components/Chip/chip.types.d.ts.map +1 -1
- package/dist/src/components/ConfirmDialog/ConfirmDialog.d.ts.map +1 -1
- package/dist/src/components/ConfirmDialog/confirmDialog.types.d.ts +30 -2
- package/dist/src/components/ConfirmDialog/confirmDialog.types.d.ts.map +1 -1
- package/dist/src/components/Container/Container.d.ts.map +1 -1
- package/dist/src/components/Container/container.types.d.ts +29 -1
- package/dist/src/components/Container/container.types.d.ts.map +1 -1
- package/dist/src/components/DataGrid/DataGrid.d.ts +1 -1
- package/dist/src/components/DataGrid/DataGrid.d.ts.map +1 -1
- package/dist/src/components/DataGrid/dataGrid.types.d.ts +124 -10
- package/dist/src/components/DataGrid/dataGrid.types.d.ts.map +1 -1
- package/dist/src/components/DatePicker/DatePicker.d.ts +1 -1
- package/dist/src/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/src/components/DatePicker/datePicker.types.d.ts +18 -0
- package/dist/src/components/DatePicker/datePicker.types.d.ts.map +1 -1
- package/dist/src/components/DateRangePicker/DateRangePicker.d.ts +1 -1
- package/dist/src/components/DateRangePicker/DateRangePicker.d.ts.map +1 -1
- package/dist/src/components/DateRangePicker/dateRangePicker.types.d.ts +18 -0
- package/dist/src/components/DateRangePicker/dateRangePicker.types.d.ts.map +1 -1
- package/dist/src/components/DateTimePicker/DateTimePicker.d.ts +1 -1
- package/dist/src/components/DateTimePicker/DateTimePicker.d.ts.map +1 -1
- package/dist/src/components/DateTimePicker/dateTimePicker.types.d.ts +20 -0
- package/dist/src/components/DateTimePicker/dateTimePicker.types.d.ts.map +1 -1
- package/dist/src/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/src/components/Dialog/dialog.types.d.ts +25 -1
- package/dist/src/components/Dialog/dialog.types.d.ts.map +1 -1
- package/dist/src/components/Divider/Divider.d.ts.map +1 -1
- package/dist/src/components/Divider/divider.types.d.ts +37 -1
- package/dist/src/components/Divider/divider.types.d.ts.map +1 -1
- package/dist/src/components/Drawer/Drawer.d.ts +21 -0
- package/dist/src/components/Drawer/Drawer.d.ts.map +1 -0
- package/dist/src/components/Drawer/drawer.types.d.ts +311 -0
- package/dist/src/components/Drawer/drawer.types.d.ts.map +1 -0
- package/dist/src/components/Drawer/drawer.variants.d.ts +177 -0
- package/dist/src/components/Drawer/drawer.variants.d.ts.map +1 -0
- package/dist/src/components/Grid/Grid.d.ts.map +1 -1
- package/dist/src/components/Grid/grid.types.d.ts +16 -0
- package/dist/src/components/Grid/grid.types.d.ts.map +1 -1
- package/dist/src/components/IconButton/IconButton.d.ts.map +1 -1
- package/dist/src/components/IconButton/iconButton.types.d.ts +40 -1
- package/dist/src/components/IconButton/iconButton.types.d.ts.map +1 -1
- package/dist/src/components/LeftNav/LeftNav.d.ts.map +1 -1
- package/dist/src/components/LeftNav/leftNav.types.d.ts +26 -6
- package/dist/src/components/LeftNav/leftNav.types.d.ts.map +1 -1
- package/dist/src/components/Link/Link.d.ts +15 -0
- package/dist/src/components/Link/Link.d.ts.map +1 -0
- package/dist/src/components/Link/link.types.d.ts +169 -0
- package/dist/src/components/Link/link.types.d.ts.map +1 -0
- package/dist/src/components/Link/link.variants.d.ts +107 -0
- package/dist/src/components/Link/link.variants.d.ts.map +1 -0
- package/dist/src/components/Menu/Menu.d.ts +1 -1
- package/dist/src/components/Menu/Menu.d.ts.map +1 -1
- package/dist/src/components/Menu/menu.types.d.ts +20 -0
- package/dist/src/components/Menu/menu.types.d.ts.map +1 -1
- package/dist/src/components/NumberField/NumberField.d.ts.map +1 -1
- package/dist/src/components/NumberField/numberField.types.d.ts +47 -1
- package/dist/src/components/NumberField/numberField.types.d.ts.map +1 -1
- package/dist/src/components/OTPField/OTPField.d.ts.map +1 -1
- package/dist/src/components/OTPField/otpField.types.d.ts +35 -1
- package/dist/src/components/OTPField/otpField.types.d.ts.map +1 -1
- package/dist/src/components/Pagination/Pagination.d.ts.map +1 -1
- package/dist/src/components/Pagination/pagination.types.d.ts +26 -1
- package/dist/src/components/Pagination/pagination.types.d.ts.map +1 -1
- package/dist/src/components/Popover/Popover.d.ts.map +1 -1
- package/dist/src/components/Popover/popover.types.d.ts +29 -0
- package/dist/src/components/Popover/popover.types.d.ts.map +1 -1
- package/dist/src/components/Progress/Progress.d.ts +20 -0
- package/dist/src/components/Progress/Progress.d.ts.map +1 -0
- package/dist/src/components/Progress/progress.types.d.ts +200 -0
- package/dist/src/components/Progress/progress.types.d.ts.map +1 -0
- package/dist/src/components/Progress/progress.variants.d.ts +224 -0
- package/dist/src/components/Progress/progress.variants.d.ts.map +1 -0
- package/dist/src/components/RadioGroup/RadioGroup.d.ts.map +1 -1
- package/dist/src/components/RadioGroup/radioGroup.types.d.ts +25 -1
- package/dist/src/components/RadioGroup/radioGroup.types.d.ts.map +1 -1
- package/dist/src/components/Select/Select.d.ts +14 -0
- package/dist/src/components/Select/Select.d.ts.map +1 -0
- package/dist/src/components/Select/select.types.d.ts +272 -0
- package/dist/src/components/Select/select.types.d.ts.map +1 -0
- package/dist/src/components/Select/select.variants.d.ts +204 -0
- package/dist/src/components/Select/select.variants.d.ts.map +1 -0
- package/dist/src/components/Skeleton/Skeleton.d.ts.map +1 -1
- package/dist/src/components/Skeleton/skeleton.types.d.ts +25 -1
- package/dist/src/components/Skeleton/skeleton.types.d.ts.map +1 -1
- package/dist/src/components/Slider/Slider.d.ts +15 -0
- package/dist/src/components/Slider/Slider.d.ts.map +1 -0
- package/dist/src/components/Slider/slider.types.d.ts +268 -0
- package/dist/src/components/Slider/slider.types.d.ts.map +1 -0
- package/dist/src/components/Slider/slider.variants.d.ts +313 -0
- package/dist/src/components/Slider/slider.variants.d.ts.map +1 -0
- package/dist/src/components/Snackbar/Snackbar.d.ts.map +1 -1
- package/dist/src/components/Snackbar/snackbar.types.d.ts +29 -5
- package/dist/src/components/Snackbar/snackbar.types.d.ts.map +1 -1
- package/dist/src/components/Spinner/Spinner.d.ts.map +1 -1
- package/dist/src/components/Spinner/spinner.types.d.ts +22 -2
- package/dist/src/components/Spinner/spinner.types.d.ts.map +1 -1
- package/dist/src/components/Stack/Stack.d.ts.map +1 -1
- package/dist/src/components/Stack/stack.types.d.ts +53 -2
- package/dist/src/components/Stack/stack.types.d.ts.map +1 -1
- package/dist/src/components/Stack/stack.variants.d.ts +23 -0
- package/dist/src/components/Stack/stack.variants.d.ts.map +1 -1
- package/dist/src/components/Stepper/Step.d.ts +30 -0
- package/dist/src/components/Stepper/Step.d.ts.map +1 -0
- package/dist/src/components/Stepper/Stepper.d.ts +15 -0
- package/dist/src/components/Stepper/Stepper.d.ts.map +1 -0
- package/dist/src/components/Stepper/StepperContext.d.ts +8 -0
- package/dist/src/components/Stepper/StepperContext.d.ts.map +1 -0
- package/dist/src/components/Stepper/stepper.types.d.ts +358 -0
- package/dist/src/components/Stepper/stepper.types.d.ts.map +1 -0
- package/dist/src/components/Stepper/stepper.variants.d.ts +253 -0
- package/dist/src/components/Stepper/stepper.variants.d.ts.map +1 -0
- package/dist/src/components/Stepper/useStep.d.ts +53 -0
- package/dist/src/components/Stepper/useStep.d.ts.map +1 -0
- package/dist/src/components/Switch/Switch.d.ts.map +1 -1
- package/dist/src/components/Switch/switch.types.d.ts +44 -1
- package/dist/src/components/Switch/switch.types.d.ts.map +1 -1
- package/dist/src/components/Table/Table.d.ts +1 -1
- package/dist/src/components/Table/Table.d.ts.map +1 -1
- package/dist/src/components/Table/table.types.d.ts +103 -8
- package/dist/src/components/Table/table.types.d.ts.map +1 -1
- package/dist/src/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/src/components/Tabs/tabs.types.d.ts +26 -1
- package/dist/src/components/Tabs/tabs.types.d.ts.map +1 -1
- package/dist/src/components/TextField/TextField.d.ts.map +1 -1
- package/dist/src/components/TextField/textField.types.d.ts +30 -1
- package/dist/src/components/TextField/textField.types.d.ts.map +1 -1
- package/dist/src/components/Textarea/Textarea.d.ts.map +1 -1
- package/dist/src/components/Textarea/textarea.types.d.ts +51 -1
- package/dist/src/components/Textarea/textarea.types.d.ts.map +1 -1
- package/dist/src/components/TimePicker/TimePicker.d.ts +1 -1
- package/dist/src/components/TimePicker/TimePicker.d.ts.map +1 -1
- package/dist/src/components/TimePicker/timePicker.types.d.ts +18 -0
- package/dist/src/components/TimePicker/timePicker.types.d.ts.map +1 -1
- package/dist/src/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/src/components/Tooltip/tooltip.types.d.ts +30 -0
- package/dist/src/components/Tooltip/tooltip.types.d.ts.map +1 -1
- package/dist/src/components/TopBar/TopBar.d.ts.map +1 -1
- package/dist/src/components/TopBar/topBar.types.d.ts +25 -1
- package/dist/src/components/TopBar/topBar.types.d.ts.map +1 -1
- package/dist/src/components/Typography/Typography.d.ts.map +1 -1
- package/dist/src/components/Typography/typography.types.d.ts +47 -1
- package/dist/src/components/Typography/typography.types.d.ts.map +1 -1
- package/dist/src/components/Typography/typography.variants.d.ts +2 -2
- package/dist/src/components/Typography/typography.variants.d.ts.map +1 -1
- package/dist/src/hooks/useStandaloneFieldWarning.d.ts +38 -0
- package/dist/src/hooks/useStandaloneFieldWarning.d.ts.map +1 -0
- package/dist/src/index.d.ts +61 -41
- package/dist/src/index.d.ts.map +1 -1
- package/package.json +6 -5
|
@@ -33,6 +33,26 @@ export interface DateTimePickerSlotProps {
|
|
|
33
33
|
* For a date-only field use `<DatePicker>`; for time-only use `<TimePicker>`.
|
|
34
34
|
* The prop surface mirrors the MUI `@dashforge/ui` `DateTimePicker`.
|
|
35
35
|
*/
|
|
36
|
+
/**
|
|
37
|
+
* Subset of `<DateTimePicker>` props theme-configurable via
|
|
38
|
+
* `theme.components.DateTimePicker.defaults` (Option C).
|
|
39
|
+
*/
|
|
40
|
+
export interface DateTimePickerVariantProps {
|
|
41
|
+
layout?: 'stacked' | 'inline';
|
|
42
|
+
weekStartDay?: WeekDay;
|
|
43
|
+
locale?: string;
|
|
44
|
+
stepMinutes?: number;
|
|
45
|
+
hour12?: boolean;
|
|
46
|
+
fullWidth?: boolean;
|
|
47
|
+
}
|
|
48
|
+
declare module '@dashforge/tw-tokens' {
|
|
49
|
+
interface TWComponentDefaults {
|
|
50
|
+
DateTimePicker?: {
|
|
51
|
+
defaults?: Partial<DateTimePickerVariantProps>;
|
|
52
|
+
slotProps?: DateTimePickerSlotProps;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
36
56
|
export interface DateTimePickerProps {
|
|
37
57
|
/** Field name — the bridge registration key. Required. */
|
|
38
58
|
name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dateTimePicker.types.d.ts","sourceRoot":"","sources":["../../../../src/components/DateTimePicker/dateTimePicker.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAEjE,6DAA6D;AAC7D,MAAM,WAAW,uBAAuB;IACtC,IAAI,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9B,KAAK,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KA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AClB,0CAA0C;IAC1C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,uCAAuC;IACvC,aAAa,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IACnC,kDAAkD;IAClD,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC;IAC5C,6DAA6D;IAC7D,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,6DAA6D;IAC7D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gEAAgE;IAChE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iEAAiE;IACjE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,kDAAkD;IAClD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,0CAA0C;IAC1C,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,sCAAsC;IACtC,SAAS,CAAC,EAAE,uBAAuB,CAAC;IACpC,yCAAyC;IACzC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
1
|
+
{"version":3,"file":"dateTimePicker.types.d.ts","sourceRoot":"","sources":["../../../../src/components/DateTimePicker/dateTimePicker.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAEjE,6DAA6D;AAC7D,MAAM,WAAW,uBAAuB;IACtC,IAAI,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9B,KAAK,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/B,YAAY,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACtC,OAAO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AE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC;IAC1C,+BAA+B;IAC/B,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,yDAAyD;IACzD,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,kCAAkC;IAClC,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC1C,4CAA4C;IAC5C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,0CAA0C;IAC1C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,uCAAuC;IACvC,aAAa,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IACnC,kDAAkD;IAClD,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC;IAC5C,6DAA6D;IAC7D,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,6DAA6D;IAC7D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gEAAgE;IAChE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iEAAiE;IACjE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,kDAAkD;IAClD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,0CAA0C;IAC1C,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,sCAAsC;IACtC,SAAS,CAAC,EAAE,uBAAuB,CAAC;IACpC,yCAAyC;IACzC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../../../src/components/Dialog/Dialog.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../../../src/components/Dialog/Dialog.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,2CAmHxC"}
|
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { DialogVariants } from './dialog.variants.js';
|
|
3
|
+
/**
|
|
4
|
+
* Subset of `<Dialog>` props theme-configurable via
|
|
5
|
+
* `theme.components.Dialog.defaults` (Option C).
|
|
6
|
+
*/
|
|
7
|
+
export interface DialogVariantProps {
|
|
8
|
+
size?: DialogVariants['size'];
|
|
9
|
+
showCloseButton?: boolean;
|
|
10
|
+
disableBackdropClose?: boolean;
|
|
11
|
+
disableEscapeClose?: boolean;
|
|
12
|
+
}
|
|
13
|
+
declare module '@dashforge/tw-tokens' {
|
|
14
|
+
interface TWComponentDefaults {
|
|
15
|
+
Dialog?: {
|
|
16
|
+
defaults?: Partial<DialogVariantProps>;
|
|
17
|
+
slotProps?: DialogSlotProps;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
}
|
|
3
21
|
/**
|
|
4
22
|
* Per-slot className overrides for `<Dialog>`. Mirrors the
|
|
5
23
|
* canonical TW slotProps shape: `{ slot?: { className?: string } }`.
|
|
@@ -41,7 +59,13 @@ export interface DialogSlotProps {
|
|
|
41
59
|
* Three size variants (`sm` / `md` / `lg`) with sensible defaults.
|
|
42
60
|
* Backdrop + content animations respect `prefers-reduced-motion`.
|
|
43
61
|
*/
|
|
44
|
-
export interface DialogProps
|
|
62
|
+
export interface DialogProps {
|
|
63
|
+
/**
|
|
64
|
+
* Content max-width tier — `sm` (28rem) / `md` (32rem, default) /
|
|
65
|
+
* `lg` (48rem). Useful for tuning to the content density.
|
|
66
|
+
* @default 'md'
|
|
67
|
+
*/
|
|
68
|
+
size?: DialogVariants['size'];
|
|
45
69
|
/** Controlled open state. */
|
|
46
70
|
open: boolean;
|
|
47
71
|
/** Called when the dialog requests to change open state. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.types.d.ts","sourceRoot":"","sources":["../../../../src/components/Dialog/dialog.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACjC,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACjC,KAAK,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/B,WAAW,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACrC,WAAW,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACrC,IAAI,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9B,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAClC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"dialog.types.d.ts","sourceRoot":"","sources":["../../../../src/components/Dialog/dialog.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IAC9B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;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C;IAC/B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,sDAAsD;IACtD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,0BAA0B;IAC1B,SAAS,CAAC,EAAE,eAAe,CAAC;CAC7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Divider.d.ts","sourceRoot":"","sources":["../../../../src/components/Divider/Divider.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Divider.d.ts","sourceRoot":"","sources":["../../../../src/components/Divider/Divider.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,eAAO,MAAM,OAAO,sGAoGnB,CAAC"}
|
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
import type { DividerVariants, DividerLineVariants } from './divider.variants.js';
|
|
3
|
+
/**
|
|
4
|
+
* Subset of `<Divider>` props theme-configurable via
|
|
5
|
+
* `theme.components.Divider.defaults` (Option C).
|
|
6
|
+
*/
|
|
7
|
+
export type DividerVariantProps = Pick<DividerVariants, 'orientation' | 'align'> & Pick<DividerLineVariants, 'variant' | 'color'>;
|
|
8
|
+
declare module '@dashforge/tw-tokens' {
|
|
9
|
+
interface TWComponentDefaults {
|
|
10
|
+
Divider?: {
|
|
11
|
+
defaults?: Partial<DividerVariantProps>;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
}
|
|
3
15
|
/**
|
|
4
16
|
* Props for `<Divider>` — visual separator with optional inline label.
|
|
5
17
|
*
|
|
@@ -13,7 +25,31 @@ import type { DividerVariants, DividerLineVariants } from './divider.variants.js
|
|
|
13
25
|
* The user passes ONE consistent prop set; the implementation chooses
|
|
14
26
|
* the mode based on whether `children` is provided.
|
|
15
27
|
*/
|
|
16
|
-
export interface DividerProps extends Omit<HTMLAttributes<HTMLElement>, 'className' | 'color' | 'children'
|
|
28
|
+
export interface DividerProps extends Omit<HTMLAttributes<HTMLElement>, 'className' | 'color' | 'children'> {
|
|
29
|
+
/**
|
|
30
|
+
* Line direction. `'horizontal'` renders as `<hr>` (line-only) or a
|
|
31
|
+
* `<div role="separator">` (labeled). `'vertical'` renders as a
|
|
32
|
+
* `<div>` because `<hr>` can't be styled vertical cross-browser.
|
|
33
|
+
* @default 'horizontal'
|
|
34
|
+
*/
|
|
35
|
+
orientation?: DividerVariants['orientation'];
|
|
36
|
+
/**
|
|
37
|
+
* Label position — only meaningful in labeled mode (when `children`
|
|
38
|
+
* is provided).
|
|
39
|
+
* @default 'center'
|
|
40
|
+
*/
|
|
41
|
+
align?: DividerVariants['align'];
|
|
42
|
+
/**
|
|
43
|
+
* Border style of the line segments.
|
|
44
|
+
* @default 'solid'
|
|
45
|
+
*/
|
|
46
|
+
variant?: DividerLineVariants['variant'];
|
|
47
|
+
/**
|
|
48
|
+
* Semantic color of the line — drives the border color via the
|
|
49
|
+
* corresponding token palette.
|
|
50
|
+
* @default 'neutral'
|
|
51
|
+
*/
|
|
52
|
+
color?: DividerLineVariants['color'];
|
|
17
53
|
/**
|
|
18
54
|
* Optional inline label. When present, the divider switches from
|
|
19
55
|
* "single line" to "two segments + label" layout — the canonical
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"divider.types.d.ts","sourceRoot":"","sources":["../../../../src/components/Divider/divider.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAElF;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,YACf,SAAQ,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,WAAW,GAAG,OAAO,GAAG,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"divider.types.d.ts","sourceRoot":"","sources":["../../../../src/components/Divider/divider.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAElF;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,eAAe,EAAE,aAAa,GAAG,OAAO,CAAC,GAC5E,IAAI,CAAC,mBAAmB,EAAE,SAAS,GAAG,OAAO,CAAC,CAAC;AAEnD,OAAO,QAAQ,sBAAsB,CAAC;IACpC,UAAU,mBAAmB;QAC3B,OAAO,CAAC,EAAE;YACR,QAAQ,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;SACzC,CAAC;KACH;CACF;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,YACf,SAAQ,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,WAAW,GAAG,OAAO,GAAG,UAAU,CAAC;IAC7E;;;;;OAKG;IACH,WAAW,CAAC,EAAE,eAAe,CAAC,aAAa,CAAC,CAAC;IAE7C;;;;OAIG;IACH,KAAK,CAAC,EAAE,eAAe,CAAC,OAAO,CAAC,CAAC;IAEjC;;;OAGG;IACH,OAAO,CAAC,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC;IAEzC;;;;OAIG;IACH,KAAK,CAAC,EAAE,mBAAmB,CAAC,OAAO,CAAC,CAAC;IAErC;;;;;;;;;OASG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;OAIG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;CACb"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { DrawerProps } from './drawer.types.js';
|
|
2
|
+
/**
|
|
3
|
+
* `<Drawer>` — edge-anchored sliding panel primitive (Sprint 6 SHIP #4).
|
|
4
|
+
*
|
|
5
|
+
* Distinct from Dialog / Popover / Menu: anchors to one of the four
|
|
6
|
+
* viewport edges and spans the full length of that edge. Three variants:
|
|
7
|
+
* - `temporary` (default) — modal with backdrop, focus trap, scroll lock,
|
|
8
|
+
* Esc + backdrop close.
|
|
9
|
+
* - `persistent` — non-modal, coexists with page content, no backdrop;
|
|
10
|
+
* Esc + click-outside still close (unless individually disabled).
|
|
11
|
+
* - `sticky` — non-modal, non-dismissible via user gesture. Same visual
|
|
12
|
+
* as `persistent` but Esc + click-outside are ignored. Only the close
|
|
13
|
+
* button and programmatic `onOpenChange(false)` close it.
|
|
14
|
+
*
|
|
15
|
+
* See {@link DrawerProps} for the full API surface.
|
|
16
|
+
*/
|
|
17
|
+
export declare function Drawer(props: DrawerProps): import("react/jsx-runtime").JSX.Element | null;
|
|
18
|
+
export declare namespace Drawer {
|
|
19
|
+
var displayName: string;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=Drawer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../../../src/components/Drawer/Drawer.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAgFrD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,kDAoZxC;yBApZe,MAAM"}
|
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { Engine } from '@dashforge/ui-core';
|
|
3
|
+
import type { AccessRequirement } from '@dashforge/rbac';
|
|
4
|
+
import type { DrawerVariants } from './drawer.variants.js';
|
|
5
|
+
/**
|
|
6
|
+
* Subset of `<Drawer>` props theme-configurable via
|
|
7
|
+
* `theme.components.Drawer.defaults` (Option C).
|
|
8
|
+
*
|
|
9
|
+
* Only *visual identity* axes go here — behavioral state (`open`,
|
|
10
|
+
* `resize`, `disableEscapeClose`, etc.) stays per-instance. A theme
|
|
11
|
+
* saying "all drawers default to `position='right'` + `size='md'` +
|
|
12
|
+
* `variant='temporary'` + close button visible" is the identity
|
|
13
|
+
* decision a DS designer would pin globally; a theme saying "all
|
|
14
|
+
* drawers default to `open={true}`" would be nonsensical.
|
|
15
|
+
*/
|
|
16
|
+
export interface DrawerVariantProps {
|
|
17
|
+
position?: DrawerVariants['position'];
|
|
18
|
+
size?: DrawerVariants['size'];
|
|
19
|
+
variant?: DrawerVariants['variant'];
|
|
20
|
+
showCloseButton?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Per-slot className override map. Consumed via
|
|
24
|
+
* `theme.components.Drawer.slotProps` (application-wide) and instance
|
|
25
|
+
* `slotProps` (per-render).
|
|
26
|
+
*/
|
|
27
|
+
export interface DrawerSlotProps {
|
|
28
|
+
overlay?: {
|
|
29
|
+
className?: string;
|
|
30
|
+
};
|
|
31
|
+
content?: {
|
|
32
|
+
className?: string;
|
|
33
|
+
};
|
|
34
|
+
header?: {
|
|
35
|
+
className?: string;
|
|
36
|
+
};
|
|
37
|
+
title?: {
|
|
38
|
+
className?: string;
|
|
39
|
+
};
|
|
40
|
+
closeButton?: {
|
|
41
|
+
className?: string;
|
|
42
|
+
};
|
|
43
|
+
body?: {
|
|
44
|
+
className?: string;
|
|
45
|
+
};
|
|
46
|
+
footer?: {
|
|
47
|
+
className?: string;
|
|
48
|
+
};
|
|
49
|
+
resizeHandle?: {
|
|
50
|
+
className?: string;
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
declare module '@dashforge/tw-tokens' {
|
|
54
|
+
interface TWComponentDefaults {
|
|
55
|
+
Drawer?: {
|
|
56
|
+
defaults?: Partial<DrawerVariantProps>;
|
|
57
|
+
slotProps?: DrawerSlotProps;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Props for `<Drawer>` — edge-anchored sliding panel.
|
|
63
|
+
*
|
|
64
|
+
* Distinct from `<Dialog>` (viewport-centered), `<Popover>` (attached to
|
|
65
|
+
* a trigger), and `<Menu>` (contextual list): Drawer anchors to a
|
|
66
|
+
* viewport edge and spans the full length of that edge. Typical uses:
|
|
67
|
+
* side inspector (right), navigation drawer (left mobile), tool drawer
|
|
68
|
+
* (left/right desktop), bottom sheet (bottom mobile), notification tray
|
|
69
|
+
* (top).
|
|
70
|
+
*
|
|
71
|
+
* Built on `@radix-ui/react-dialog` for the modal `temporary` variant
|
|
72
|
+
* (focus trap, scroll lock, Esc, `aria-modal`) and on
|
|
73
|
+
* `<RadixDialog.Root modal={false}>` for `persistent` (non-modal,
|
|
74
|
+
* coexists with page content).
|
|
75
|
+
*
|
|
76
|
+
* Bridge integration: **none** — Drawer is not a form field. `visibleWhen`
|
|
77
|
+
* and `access` follow the catalog convention (reactive predicate +
|
|
78
|
+
* RBAC gate).
|
|
79
|
+
*
|
|
80
|
+
* @example Right-side inspector
|
|
81
|
+
* ```tsx
|
|
82
|
+
* <Drawer
|
|
83
|
+
* open={inspectorOpen}
|
|
84
|
+
* onOpenChange={setInspectorOpen}
|
|
85
|
+
* position="right"
|
|
86
|
+
* variant="persistent"
|
|
87
|
+
* title="Properties"
|
|
88
|
+
* resize
|
|
89
|
+
* resizeKey="blueprintInspector"
|
|
90
|
+
* >
|
|
91
|
+
* <InspectorPanel />
|
|
92
|
+
* </Drawer>
|
|
93
|
+
* ```
|
|
94
|
+
*
|
|
95
|
+
* @example Mobile bottom sheet
|
|
96
|
+
* ```tsx
|
|
97
|
+
* <Drawer
|
|
98
|
+
* open={sheetOpen}
|
|
99
|
+
* onOpenChange={setSheetOpen}
|
|
100
|
+
* position="bottom"
|
|
101
|
+
* size="lg"
|
|
102
|
+
* title="Filters"
|
|
103
|
+
* footer={<Button onClick={applyFilters}>Apply</Button>}
|
|
104
|
+
* >
|
|
105
|
+
* <FilterList />
|
|
106
|
+
* </Drawer>
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
109
|
+
export interface DrawerProps {
|
|
110
|
+
/** Controlled open state. */
|
|
111
|
+
open: boolean;
|
|
112
|
+
/**
|
|
113
|
+
* Fires when the drawer requests to change open state — Esc,
|
|
114
|
+
* backdrop click, close button, or `Radix.Root.onOpenChange`. Mirror
|
|
115
|
+
* of `<Dialog onOpenChange>`. No `reason` parameter — consumers that
|
|
116
|
+
* need to differentiate escape-vs-backdrop use `disableEscapeClose` /
|
|
117
|
+
* `disableBackdropClose` explicitly.
|
|
118
|
+
*/
|
|
119
|
+
onOpenChange: (open: boolean) => void;
|
|
120
|
+
/**
|
|
121
|
+
* Which viewport edge the drawer anchors to. Drives the translate
|
|
122
|
+
* direction on open/close and which border is visible on the panel.
|
|
123
|
+
* @default 'right'
|
|
124
|
+
*/
|
|
125
|
+
position?: DrawerVariants['position'];
|
|
126
|
+
/**
|
|
127
|
+
* Bounded-axis preset (width for left/right, height for top/bottom).
|
|
128
|
+
* The `full` variant fills the viewport on the bounded axis.
|
|
129
|
+
* @default 'md'
|
|
130
|
+
*/
|
|
131
|
+
size?: DrawerVariants['size'];
|
|
132
|
+
/**
|
|
133
|
+
* Three modes, each with a different dismiss contract:
|
|
134
|
+
*
|
|
135
|
+
* - `'temporary'` (default) — modal. Backdrop dims the page,
|
|
136
|
+
* focus is trapped, `<body>` scroll is locked, Esc + backdrop
|
|
137
|
+
* click close.
|
|
138
|
+
* - `'persistent'` — non-modal. No backdrop, coexists with page
|
|
139
|
+
* content, no scroll lock. Esc + click-outside still close
|
|
140
|
+
* (unless individually disabled).
|
|
141
|
+
* - `'sticky'` — non-modal, non-dismissible via user gesture.
|
|
142
|
+
* Same visual as `persistent` but Esc + click-outside are
|
|
143
|
+
* ignored. The drawer stays open until the consumer closes it
|
|
144
|
+
* programmatically (via `onOpenChange(false)`) or the user
|
|
145
|
+
* clicks the `×` close button. Use for inspectors / toolbars
|
|
146
|
+
* that must remain anchored while the user works elsewhere on
|
|
147
|
+
* the page.
|
|
148
|
+
*
|
|
149
|
+
* Implemented via Radix's `modal` prop (`temporary` is `modal={true}`;
|
|
150
|
+
* both non-modal modes are `modal={false}`) plus the internal
|
|
151
|
+
* dismiss handlers.
|
|
152
|
+
*
|
|
153
|
+
* @default 'temporary'
|
|
154
|
+
*/
|
|
155
|
+
variant?: DrawerVariants['variant'];
|
|
156
|
+
/** Drawer body — rendered inside the `body` slot. */
|
|
157
|
+
children?: ReactNode;
|
|
158
|
+
/**
|
|
159
|
+
* Optional title — rendered in the `header` slot as
|
|
160
|
+
* `<RadixDialog.Title>`. Typed as `string | ReactNode` for API
|
|
161
|
+
* discoverability (a plain string is the 90% case, ReactNode
|
|
162
|
+
* unlocks full customization: icons + label, chip + title, etc.).
|
|
163
|
+
*/
|
|
164
|
+
title?: string | ReactNode;
|
|
165
|
+
/** Optional footer — action bar, rendered under the body. */
|
|
166
|
+
footer?: ReactNode;
|
|
167
|
+
/**
|
|
168
|
+
* Show the `×` close button in the header. Mirror of Dialog's
|
|
169
|
+
* `showCloseButton`.
|
|
170
|
+
* @default true
|
|
171
|
+
*/
|
|
172
|
+
showCloseButton?: boolean;
|
|
173
|
+
/**
|
|
174
|
+
* Where the `×` close button sits within the header row.
|
|
175
|
+
*
|
|
176
|
+
* - `'end'` (default) — right side of the header, after the title.
|
|
177
|
+
* Standard convention across MUI, Chakra, shadcn.
|
|
178
|
+
* - `'start'` — left side of the header, before the title. Used by
|
|
179
|
+
* some full-screen mobile drawers (Material Design guideline) and
|
|
180
|
+
* by iOS-style sheets where the close affordance is at the leading
|
|
181
|
+
* edge.
|
|
182
|
+
*
|
|
183
|
+
* @default 'end'
|
|
184
|
+
*/
|
|
185
|
+
closeButtonPosition?: 'start' | 'end';
|
|
186
|
+
/**
|
|
187
|
+
* Fires when the `×` close button is clicked. The drawer closes
|
|
188
|
+
* unconditionally afterward (via `onOpenChange(false)`) — this is
|
|
189
|
+
* a side-effect hook for logging, analytics, or last-mile cleanup.
|
|
190
|
+
* If you need to BLOCK the close, guard the state upstream in
|
|
191
|
+
* `onOpenChange` instead (the close button doesn't gate it).
|
|
192
|
+
*/
|
|
193
|
+
onCloseClick?: () => void;
|
|
194
|
+
/**
|
|
195
|
+
* Custom auto-focus handler fired when the drawer opens. Escape hatch
|
|
196
|
+
* for consumers who need different focus semantics than the default.
|
|
197
|
+
*
|
|
198
|
+
* DEFAULT (when this prop is omitted): the drawer prevents Radix's
|
|
199
|
+
* built-in auto-focus (which lands on the first focusable child = the
|
|
200
|
+
* × close button) and focuses the Content wrapper itself instead.
|
|
201
|
+
* Screen readers still announce the dialog via `aria-labelledby` →
|
|
202
|
+
* title; the visible focus ring simply doesn't stick to any child on
|
|
203
|
+
* open.
|
|
204
|
+
*
|
|
205
|
+
* OVERRIDE this when:
|
|
206
|
+
* - You want to focus a specific interactive element on open (e.g.
|
|
207
|
+
* the first form field: `(e) => { e.preventDefault();
|
|
208
|
+
* firstInputRef.current?.focus() }`).
|
|
209
|
+
* - You need the Radix default (auto-focus the first tabbable) —
|
|
210
|
+
* pass `undefined` at call site? No — pass a handler that does
|
|
211
|
+
* nothing: `() => undefined`. The absence of preventDefault lets
|
|
212
|
+
* Radix's default fire.
|
|
213
|
+
* - You're troubleshooting a screen-reader-specific issue (JAWS,
|
|
214
|
+
* older NVDA versions) that needs a specific focus target.
|
|
215
|
+
*
|
|
216
|
+
* The event receives the underlying `FocusEvent` — call
|
|
217
|
+
* `event.preventDefault()` to suppress Radix's default focus, then
|
|
218
|
+
* do your own focus management.
|
|
219
|
+
*/
|
|
220
|
+
onOpenAutoFocus?: (event: Event) => void;
|
|
221
|
+
/**
|
|
222
|
+
* Disable closing when the user clicks outside the drawer content.
|
|
223
|
+
* Applies to `variant='temporary'` (backdrop click) and
|
|
224
|
+
* `variant='persistent'` (click outside the invisible drawer area) —
|
|
225
|
+
* `variant='sticky'` implicitly defaults this to `true` to keep the
|
|
226
|
+
* drawer open.
|
|
227
|
+
*
|
|
228
|
+
* Explicit values WIN over the sticky default: pass `false` to
|
|
229
|
+
* re-enable click-outside close on a sticky drawer (opt-in escape).
|
|
230
|
+
* @default `false` for `temporary` and `persistent`, `true` for `sticky`
|
|
231
|
+
*/
|
|
232
|
+
disableBackdropClose?: boolean;
|
|
233
|
+
/**
|
|
234
|
+
* Disable closing when the user presses Escape.
|
|
235
|
+
*
|
|
236
|
+
* Explicit values WIN over the sticky default: `variant='sticky'`
|
|
237
|
+
* defaults this to `true` so the drawer stays open, but passing
|
|
238
|
+
* `disableEscapeClose={false}` re-enables Esc close on a sticky
|
|
239
|
+
* drawer (opt-in escape hatch).
|
|
240
|
+
* @default `false` for `temporary` and `persistent`, `true` for `sticky`
|
|
241
|
+
*/
|
|
242
|
+
disableEscapeClose?: boolean;
|
|
243
|
+
/**
|
|
244
|
+
* Render a drag handle on the free edge of the drawer that lets the
|
|
245
|
+
* user resize the bounded axis (width for left/right, height for
|
|
246
|
+
* top/bottom).
|
|
247
|
+
* @default false
|
|
248
|
+
*/
|
|
249
|
+
resize?: boolean;
|
|
250
|
+
/**
|
|
251
|
+
* `localStorage` key for persisting the resized dimension across
|
|
252
|
+
* sessions. Stored under `df.drawer.<resizeKey>`. When `resize=true`
|
|
253
|
+
* and this is omitted, a one-time dev-warn fires and no persistence
|
|
254
|
+
* is attempted.
|
|
255
|
+
*/
|
|
256
|
+
resizeKey?: string;
|
|
257
|
+
/**
|
|
258
|
+
* Minimum size (px) for the bounded axis. Clamps `pointermove` and
|
|
259
|
+
* keyboard-driven resizes.
|
|
260
|
+
* @default 240
|
|
261
|
+
*/
|
|
262
|
+
resizeMin?: number;
|
|
263
|
+
/**
|
|
264
|
+
* Maximum size (px) for the bounded axis.
|
|
265
|
+
* @default 800
|
|
266
|
+
*/
|
|
267
|
+
resizeMax?: number;
|
|
268
|
+
/**
|
|
269
|
+
* Optional callback that fires on every commit of the resize handle
|
|
270
|
+
* (pointer-up OR keyboard step). Useful for consumers that want to
|
|
271
|
+
* mirror the size into their own store (e.g. a Zustand slice for
|
|
272
|
+
* layout preferences).
|
|
273
|
+
*/
|
|
274
|
+
onSizeChange?: (size: number) => void;
|
|
275
|
+
/**
|
|
276
|
+
* Reactive visibility predicate. Falsy → renders `null`. The
|
|
277
|
+
* predicate can freely mix engine state (via the `engine` argument)
|
|
278
|
+
* and outer-scope local state / context / refs — React's re-render
|
|
279
|
+
* cascade guarantees fresh values on every evaluation.
|
|
280
|
+
*
|
|
281
|
+
* ## Behavior when combined with `open={true}`
|
|
282
|
+
*
|
|
283
|
+
* `visibleWhen` does NOT sync back to `open` state. If the predicate
|
|
284
|
+
* flips to `false` while `open={true}`:
|
|
285
|
+
* - The drawer unmounts (returns `null`)
|
|
286
|
+
* - `onOpenChange(false)` is NOT called — your `open` state stays
|
|
287
|
+
* `true`
|
|
288
|
+
* - When the predicate flips back to `true`, the drawer remounts
|
|
289
|
+
* with `open={true}` and reappears — no user gesture needed
|
|
290
|
+
*
|
|
291
|
+
* This is the "reactive UI" pattern: `visibleWhen` decides IF the
|
|
292
|
+
* component participates in the tree; `open` decides its state WHEN
|
|
293
|
+
* it participates. The two axes are orthogonal.
|
|
294
|
+
*
|
|
295
|
+
* If you need the drawer to close (state = false) when it's hidden —
|
|
296
|
+
* for example, to also unmount its side-effects downstream — wire
|
|
297
|
+
* that into `visibleWhen`'s upstream state via a `useEffect` in the
|
|
298
|
+
* consumer, or listen for the flip and call `onOpenChange(false)`
|
|
299
|
+
* yourself.
|
|
300
|
+
*/
|
|
301
|
+
visibleWhen?: (engine: Engine) => boolean;
|
|
302
|
+
/** RBAC gate — see `useAccessState`. */
|
|
303
|
+
access?: AccessRequirement;
|
|
304
|
+
/** Utility-class shortcut merged onto the `content` slot. */
|
|
305
|
+
sx?: string;
|
|
306
|
+
/** Per-slot className overrides. */
|
|
307
|
+
slotProps?: DrawerSlotProps;
|
|
308
|
+
/** `data-testid` on the content wrapper. */
|
|
309
|
+
testId?: string;
|
|
310
|
+
}
|
|
311
|
+
//# sourceMappingURL=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