@accelint/design-system 0.3.3 → 0.5.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 +12 -12
- package/dist/chunk-PZ5AY32C.js +9 -0
- package/dist/chunk-PZ5AY32C.js.map +1 -0
- package/dist/components/aria/aria.d.ts +32 -0
- package/dist/components/aria/aria.js +39 -0
- package/dist/components/aria/aria.js.map +1 -0
- package/dist/components/aria/index.d.ts +3 -0
- package/dist/components/aria/index.js +4 -0
- package/dist/components/aria/index.js.map +1 -0
- package/dist/components/button/button.css.d.ts +41 -0
- package/dist/components/button/button.css.js +12 -0
- package/dist/components/button/button.css.js.map +1 -0
- package/dist/components/button/button.d.ts +47 -0
- package/dist/components/button/button.js +104 -0
- package/dist/components/button/button.js.map +1 -0
- package/dist/components/button/index.d.ts +8 -0
- package/dist/components/button/index.js +6 -0
- package/dist/components/button/index.js.map +1 -0
- package/dist/components/button/types.d.ts +32 -0
- package/dist/components/button/types.js +3 -0
- package/dist/components/button/types.js.map +1 -0
- package/dist/components/checkbox/checkbox.css.d.ts +44 -0
- package/dist/components/checkbox/checkbox.css.js +14 -0
- package/dist/components/checkbox/checkbox.css.js.map +1 -0
- package/dist/components/checkbox/checkbox.d.ts +30 -0
- package/dist/components/checkbox/checkbox.js +123 -0
- package/dist/components/checkbox/checkbox.js.map +1 -0
- package/dist/components/checkbox/index.d.ts +9 -0
- package/dist/components/checkbox/index.js +6 -0
- package/dist/components/checkbox/index.js.map +1 -0
- package/dist/components/checkbox/types.d.ts +41 -0
- package/dist/components/checkbox/types.js +3 -0
- package/dist/components/checkbox/types.js.map +1 -0
- package/dist/components/chip/chip.css.d.ts +41 -0
- package/dist/components/chip/chip.css.js +12 -0
- package/dist/components/chip/chip.css.js.map +1 -0
- package/dist/components/chip/chip.d.ts +41 -0
- package/dist/components/chip/chip.js +171 -0
- package/dist/components/chip/chip.js.map +1 -0
- package/dist/components/chip/index.d.ts +11 -0
- package/dist/components/chip/index.js +6 -0
- package/dist/components/chip/index.js.map +1 -0
- package/dist/components/chip/types.d.ts +37 -0
- package/dist/components/chip/types.js +3 -0
- package/dist/components/chip/types.js.map +1 -0
- package/dist/components/collection/collection.d.ts +17 -0
- package/dist/components/collection/collection.js +22 -0
- package/dist/components/collection/collection.js.map +1 -0
- package/dist/components/collection/index.d.ts +6 -0
- package/dist/components/collection/index.js +4 -0
- package/dist/components/collection/index.js.map +1 -0
- package/dist/components/combo-box/combo-box.css.d.ts +35 -0
- package/dist/components/combo-box/combo-box.css.js +12 -0
- package/dist/components/combo-box/combo-box.css.js.map +1 -0
- package/dist/components/combo-box/combo-box.d.ts +21 -0
- package/dist/components/combo-box/combo-box.js +116 -0
- package/dist/components/combo-box/combo-box.js.map +1 -0
- package/dist/components/combo-box/index.d.ts +13 -0
- package/dist/components/combo-box/index.js +6 -0
- package/dist/components/combo-box/index.js.map +1 -0
- package/dist/components/combo-box/types.d.ts +38 -0
- package/dist/components/combo-box/types.js +3 -0
- package/dist/components/combo-box/types.js.map +1 -0
- package/dist/components/dialog/dialog.css.d.ts +45 -0
- package/dist/components/dialog/dialog.css.js +12 -0
- package/dist/components/dialog/dialog.css.js.map +1 -0
- package/dist/components/dialog/dialog.d.ts +29 -0
- package/dist/components/dialog/dialog.js +186 -0
- package/dist/components/dialog/dialog.js.map +1 -0
- package/dist/components/dialog/index.d.ts +11 -0
- package/dist/components/dialog/index.js +6 -0
- package/dist/components/dialog/index.js.map +1 -0
- package/dist/components/dialog/types.d.ts +53 -0
- package/dist/components/dialog/types.js +3 -0
- package/dist/components/dialog/types.js.map +1 -0
- package/dist/components/drawer/drawer.css.d.ts +48 -0
- package/dist/components/drawer/drawer.css.js +14 -0
- package/dist/components/drawer/drawer.css.js.map +1 -0
- package/dist/components/drawer/drawer.d.ts +28 -0
- package/dist/components/drawer/drawer.js +305 -0
- package/dist/components/drawer/drawer.js.map +1 -0
- package/dist/components/drawer/index.d.ts +16 -0
- package/dist/components/drawer/index.js +6 -0
- package/dist/components/drawer/index.js.map +1 -0
- package/dist/components/drawer/types.d.ts +77 -0
- package/dist/components/drawer/types.js +3 -0
- package/dist/components/drawer/types.js.map +1 -0
- package/dist/components/element/element.d.ts +16 -0
- package/dist/components/element/element.js +24 -0
- package/dist/components/element/element.js.map +1 -0
- package/dist/components/element/index.d.ts +5 -0
- package/dist/components/element/index.js +5 -0
- package/dist/components/element/index.js.map +1 -0
- package/dist/components/element/types.d.ts +24 -0
- package/dist/components/element/types.js +3 -0
- package/dist/components/element/types.js.map +1 -0
- package/dist/components/group/group.css.d.ts +20 -0
- package/dist/components/group/group.css.js +11 -0
- package/dist/components/group/group.css.js.map +1 -0
- package/dist/components/group/group.d.ts +16 -0
- package/dist/components/group/group.js +61 -0
- package/dist/components/group/group.js.map +1 -0
- package/dist/components/group/index.d.ts +6 -0
- package/dist/components/group/index.js +6 -0
- package/dist/components/group/index.js.map +1 -0
- package/dist/components/group/types.d.ts +38 -0
- package/dist/components/group/types.js +3 -0
- package/dist/components/group/types.js.map +1 -0
- package/dist/components/icon/icon.css.d.ts +23 -0
- package/dist/components/icon/icon.css.js +12 -0
- package/dist/components/icon/icon.css.js.map +1 -0
- package/dist/components/icon/icon.d.ts +17 -0
- package/dist/components/icon/icon.js +39 -0
- package/dist/components/icon/icon.js.map +1 -0
- package/dist/components/icon/index.d.ts +5 -0
- package/dist/components/icon/index.js +6 -0
- package/dist/components/icon/index.js.map +1 -0
- package/dist/components/icon/types.d.ts +16 -0
- package/dist/components/icon/types.js +3 -0
- package/dist/components/icon/types.js.map +1 -0
- package/dist/components/index.d.ts +93 -0
- package/dist/components/index.js +31 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/input/index.d.ts +6 -0
- package/dist/components/input/index.js +6 -0
- package/dist/components/input/index.js.map +1 -0
- package/dist/components/input/input.css.d.ts +34 -0
- package/dist/components/input/input.css.js +12 -0
- package/dist/components/input/input.css.js.map +1 -0
- package/dist/components/input/input.d.ts +13 -0
- package/dist/components/input/input.js +141 -0
- package/dist/components/input/input.js.map +1 -0
- package/dist/components/input/types.d.ts +47 -0
- package/dist/components/input/types.js +3 -0
- package/dist/components/input/types.js.map +1 -0
- package/dist/components/menu/index.d.ts +8 -0
- package/dist/components/menu/index.js +6 -0
- package/dist/components/menu/index.js.map +1 -0
- package/dist/components/menu/menu.css.d.ts +83 -0
- package/dist/components/menu/menu.css.js +13 -0
- package/dist/components/menu/menu.css.js.map +1 -0
- package/dist/components/menu/menu.d.ts +32 -0
- package/dist/components/menu/menu.js +252 -0
- package/dist/components/menu/menu.js.map +1 -0
- package/dist/components/menu/types.d.ts +51 -0
- package/dist/components/menu/types.js +3 -0
- package/dist/components/menu/types.js.map +1 -0
- package/dist/components/merge-provider/index.d.ts +5 -0
- package/dist/components/merge-provider/index.js +5 -0
- package/dist/components/merge-provider/index.js.map +1 -0
- package/dist/components/merge-provider/merge-provider.d.ts +20 -0
- package/dist/components/merge-provider/merge-provider.js +46 -0
- package/dist/components/merge-provider/merge-provider.js.map +1 -0
- package/dist/components/merge-provider/types.d.ts +8 -0
- package/dist/components/merge-provider/types.js +3 -0
- package/dist/components/merge-provider/types.js.map +1 -0
- package/dist/components/number-field/index.d.ts +12 -0
- package/dist/components/number-field/index.js +5 -0
- package/dist/components/number-field/index.js.map +1 -0
- package/dist/components/number-field/number-field.css.d.ts +40 -0
- package/dist/components/number-field/number-field.css.js +12 -0
- package/dist/components/number-field/number-field.css.js.map +1 -0
- package/dist/components/number-field/number-field.d.ts +20 -0
- package/dist/components/number-field/number-field.js +125 -0
- package/dist/components/number-field/number-field.js.map +1 -0
- package/dist/components/number-field/types.d.ts +38 -0
- package/dist/components/number-field/types.js +3 -0
- package/dist/components/number-field/types.js.map +1 -0
- package/dist/components/options/index.d.ts +8 -0
- package/dist/components/options/index.js +6 -0
- package/dist/components/options/index.js.map +1 -0
- package/dist/components/options/options.css.d.ts +87 -0
- package/dist/components/options/options.css.js +14 -0
- package/dist/components/options/options.css.js.map +1 -0
- package/dist/components/options/options.d.ts +28 -0
- package/dist/components/options/options.js +253 -0
- package/dist/components/options/options.js.map +1 -0
- package/dist/components/options/types.d.ts +52 -0
- package/dist/components/options/types.js +3 -0
- package/dist/components/options/types.js.map +1 -0
- package/dist/components/picker/index.d.ts +6 -0
- package/dist/components/picker/index.js +6 -0
- package/dist/components/picker/index.js.map +1 -0
- package/dist/components/picker/picker.css.d.ts +37 -0
- package/dist/components/picker/picker.css.js +13 -0
- package/dist/components/picker/picker.css.js.map +1 -0
- package/dist/components/picker/picker.d.ts +24 -0
- package/dist/components/picker/picker.js +113 -0
- package/dist/components/picker/picker.js.map +1 -0
- package/dist/components/picker/picker.stories.css.d.ts +5 -0
- package/dist/components/picker/picker.stories.css.js +10 -0
- package/dist/components/picker/picker.stories.css.js.map +1 -0
- package/dist/components/picker/types.d.ts +30 -0
- package/dist/components/picker/types.js +3 -0
- package/dist/components/picker/types.js.map +1 -0
- package/dist/components/popover/index.d.ts +14 -0
- package/dist/components/popover/index.js +6 -0
- package/dist/components/popover/index.js.map +1 -0
- package/dist/components/popover/popover.css.d.ts +45 -0
- package/dist/components/popover/popover.css.js +12 -0
- package/dist/components/popover/popover.css.js.map +1 -0
- package/dist/components/popover/popover.d.ts +22 -0
- package/dist/components/popover/popover.js +139 -0
- package/dist/components/popover/popover.js.map +1 -0
- package/dist/components/popover/types.d.ts +39 -0
- package/dist/components/popover/types.js +3 -0
- package/dist/components/popover/types.js.map +1 -0
- package/dist/components/query-builder/action-element.d.ts +23 -0
- package/dist/components/query-builder/action-element.js +26 -0
- package/dist/components/query-builder/action-element.js.map +1 -0
- package/dist/components/query-builder/constants.d.ts +25 -0
- package/dist/components/query-builder/constants.js +25 -0
- package/dist/components/query-builder/constants.js.map +1 -0
- package/dist/components/query-builder/dataset-sample.d.ts +95 -0
- package/dist/components/query-builder/dataset-sample.js +272 -0
- package/dist/components/query-builder/dataset-sample.js.map +1 -0
- package/dist/components/query-builder/group.d.ts +9 -0
- package/dist/components/query-builder/group.js +396 -0
- package/dist/components/query-builder/group.js.map +1 -0
- package/dist/components/query-builder/index.d.ts +23 -0
- package/dist/components/query-builder/index.js +8 -0
- package/dist/components/query-builder/index.js.map +1 -0
- package/dist/components/query-builder/query-builder.css.d.ts +116 -0
- package/dist/components/query-builder/query-builder.css.js +14 -0
- package/dist/components/query-builder/query-builder.css.js.map +1 -0
- package/dist/components/query-builder/query-builder.d.ts +23 -0
- package/dist/components/query-builder/query-builder.js +196 -0
- package/dist/components/query-builder/query-builder.js.map +1 -0
- package/dist/components/query-builder/rule.d.ts +7 -0
- package/dist/components/query-builder/rule.js +401 -0
- package/dist/components/query-builder/rule.js.map +1 -0
- package/dist/components/query-builder/types.d.ts +146 -0
- package/dist/components/query-builder/types.js +3 -0
- package/dist/components/query-builder/types.js.map +1 -0
- package/dist/components/query-builder/utils.d.ts +32 -0
- package/dist/components/query-builder/utils.js +25 -0
- package/dist/components/query-builder/utils.js.map +1 -0
- package/dist/components/query-builder/value-editor.d.ts +24 -0
- package/dist/components/query-builder/value-editor.js +207 -0
- package/dist/components/query-builder/value-editor.js.map +1 -0
- package/dist/components/query-builder/value-selector.d.ts +6 -0
- package/dist/components/query-builder/value-selector.js +77 -0
- package/dist/components/query-builder/value-selector.js.map +1 -0
- package/dist/components/radio/index.d.ts +7 -0
- package/dist/components/radio/index.js +6 -0
- package/dist/components/radio/index.js.map +1 -0
- package/dist/components/radio/radio.css.d.ts +41 -0
- package/dist/components/radio/radio.css.js +14 -0
- package/dist/components/radio/radio.css.js.map +1 -0
- package/dist/components/radio/radio.d.ts +23 -0
- package/dist/components/radio/radio.js +114 -0
- package/dist/components/radio/radio.js.map +1 -0
- package/dist/components/radio/types.d.ts +32 -0
- package/dist/components/radio/types.js +3 -0
- package/dist/components/radio/types.js.map +1 -0
- package/dist/components/search-field/index.d.ts +12 -0
- package/dist/components/search-field/index.js +6 -0
- package/dist/components/search-field/index.js.map +1 -0
- package/dist/components/search-field/search-field.css.d.ts +28 -0
- package/dist/components/search-field/search-field.css.js +11 -0
- package/dist/components/search-field/search-field.css.js.map +1 -0
- package/dist/components/search-field/search-field.d.ts +21 -0
- package/dist/components/search-field/search-field.js +92 -0
- package/dist/components/search-field/search-field.js.map +1 -0
- package/dist/components/search-field/types.d.ts +34 -0
- package/dist/components/search-field/types.js +3 -0
- package/dist/components/search-field/types.js.map +1 -0
- package/dist/components/select/index.d.ts +12 -0
- package/dist/components/select/index.js +6 -0
- package/dist/components/select/index.js.map +1 -0
- package/dist/components/select/select.css.d.ts +37 -0
- package/dist/components/select/select.css.js +12 -0
- package/dist/components/select/select.css.js.map +1 -0
- package/dist/components/select/select.d.ts +20 -0
- package/dist/components/select/select.js +109 -0
- package/dist/components/select/select.js.map +1 -0
- package/dist/components/select/types.d.ts +36 -0
- package/dist/components/select/types.js +3 -0
- package/dist/components/select/types.js.map +1 -0
- package/dist/components/switch/index.d.ts +6 -0
- package/dist/components/switch/index.js +6 -0
- package/dist/components/switch/index.js.map +1 -0
- package/dist/components/switch/switch.css.d.ts +31 -0
- package/dist/components/switch/switch.css.js +12 -0
- package/dist/components/switch/switch.css.js.map +1 -0
- package/dist/components/switch/switch.d.ts +10 -0
- package/dist/components/switch/switch.js +60 -0
- package/dist/components/switch/switch.js.map +1 -0
- package/dist/components/switch/types.d.ts +21 -0
- package/dist/components/switch/types.js +3 -0
- package/dist/components/switch/types.js.map +1 -0
- package/dist/components/tabs/index.d.ts +8 -0
- package/dist/components/tabs/index.js +6 -0
- package/dist/components/tabs/index.js.map +1 -0
- package/dist/components/tabs/tabs.css.d.ts +57 -0
- package/dist/components/tabs/tabs.css.js +15 -0
- package/dist/components/tabs/tabs.css.js.map +1 -0
- package/dist/components/tabs/tabs.d.ts +75 -0
- package/dist/components/tabs/tabs.js +258 -0
- package/dist/components/tabs/tabs.js.map +1 -0
- package/dist/components/tabs/types.d.ts +84 -0
- package/dist/components/tabs/types.js +3 -0
- package/dist/components/tabs/types.js.map +1 -0
- package/dist/components/text-field/index.d.ts +9 -0
- package/dist/components/text-field/index.js +5 -0
- package/dist/components/text-field/index.js.map +1 -0
- package/dist/components/text-field/text-field.css.d.ts +28 -0
- package/dist/components/text-field/text-field.css.js +12 -0
- package/dist/components/text-field/text-field.css.js.map +1 -0
- package/dist/components/text-field/text-field.d.ts +63 -0
- package/dist/components/text-field/text-field.js +91 -0
- package/dist/components/text-field/text-field.js.map +1 -0
- package/dist/components/text-field/types.d.ts +28 -0
- package/dist/components/text-field/types.js +3 -0
- package/dist/components/text-field/types.js.map +1 -0
- package/dist/components/textarea/index.d.ts +6 -0
- package/dist/components/textarea/index.js +6 -0
- package/dist/components/textarea/index.js.map +1 -0
- package/dist/components/textarea/textarea.css.d.ts +37 -0
- package/dist/components/textarea/textarea.css.js +12 -0
- package/dist/components/textarea/textarea.css.js.map +1 -0
- package/dist/components/textarea/textarea.d.ts +19 -0
- package/dist/components/textarea/textarea.js +134 -0
- package/dist/components/textarea/textarea.js.map +1 -0
- package/dist/components/textarea/types.d.ts +42 -0
- package/dist/components/textarea/types.js +3 -0
- package/dist/components/textarea/types.js.map +1 -0
- package/dist/components/tooltip/index.d.ts +7 -0
- package/dist/components/tooltip/index.js +6 -0
- package/dist/components/tooltip/index.js.map +1 -0
- package/dist/components/tooltip/tooltip.css.d.ts +30 -0
- package/dist/components/tooltip/tooltip.css.js +12 -0
- package/dist/components/tooltip/tooltip.css.js.map +1 -0
- package/dist/components/tooltip/tooltip.d.ts +30 -0
- package/dist/components/tooltip/tooltip.js +112 -0
- package/dist/components/tooltip/tooltip.js.map +1 -0
- package/dist/components/tooltip/types.d.ts +41 -0
- package/dist/components/tooltip/types.js +3 -0
- package/dist/components/tooltip/types.js.map +1 -0
- package/dist/components/tree/index.d.ts +17 -0
- package/dist/components/tree/index.js +6 -0
- package/dist/components/tree/index.js.map +1 -0
- package/dist/components/tree/tree.css.d.ts +90 -0
- package/dist/components/tree/tree.css.js +15 -0
- package/dist/components/tree/tree.css.js.map +1 -0
- package/dist/components/tree/tree.d.ts +29 -0
- package/dist/components/tree/tree.js +491 -0
- package/dist/components/tree/tree.js.map +1 -0
- package/dist/components/tree/types.d.ts +121 -0
- package/dist/components/tree/types.js +3 -0
- package/dist/components/tree/types.js.map +1 -0
- package/dist/components/tree/utils.d.ts +12 -0
- package/dist/components/tree/utils.js +89 -0
- package/dist/components/tree/utils.js.map +1 -0
- package/dist/hooks/index.d.ts +52 -0
- package/dist/hooks/index.js +11 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/use-collection-render/index.d.ts +3 -0
- package/dist/hooks/use-collection-render/index.js +4 -0
- package/dist/hooks/use-collection-render/index.js.map +1 -0
- package/dist/hooks/use-collection-render/use-collection-render.d.ts +11 -0
- package/dist/hooks/use-collection-render/use-collection-render.js +28 -0
- package/dist/hooks/use-collection-render/use-collection-render.js.map +1 -0
- package/dist/hooks/use-context-props/index.d.ts +3 -0
- package/dist/hooks/use-context-props/index.js +4 -0
- package/dist/hooks/use-context-props/index.js.map +1 -0
- package/dist/hooks/use-context-props/use-context-props.d.ts +10 -0
- package/dist/hooks/use-context-props/use-context-props.js +18 -0
- package/dist/hooks/use-context-props/use-context-props.js.map +1 -0
- package/dist/hooks/use-defaults/index.d.ts +37 -0
- package/dist/hooks/use-defaults/index.js +5 -0
- package/dist/hooks/use-defaults/index.js.map +1 -0
- package/dist/hooks/use-defaults/types.d.ts +83 -0
- package/dist/hooks/use-defaults/types.js +3 -0
- package/dist/hooks/use-defaults/types.js.map +1 -0
- package/dist/hooks/use-defaults/use-defaults.d.ts +96 -0
- package/dist/hooks/use-defaults/use-defaults.js +36 -0
- package/dist/hooks/use-defaults/use-defaults.js.map +1 -0
- package/dist/hooks/use-propagating-press/index.d.ts +2 -0
- package/dist/hooks/use-propagating-press/index.js +4 -0
- package/dist/hooks/use-propagating-press/index.js.map +1 -0
- package/dist/hooks/use-propagating-press/use-propagating-press.d.ts +13 -0
- package/dist/hooks/use-propagating-press/use-propagating-press.js +21 -0
- package/dist/hooks/use-propagating-press/use-propagating-press.js.map +1 -0
- package/dist/hooks/use-slot/index.d.ts +2 -0
- package/dist/hooks/use-slot/index.js +4 -0
- package/dist/hooks/use-slot/index.js.map +1 -0
- package/dist/hooks/use-slot/use-slot.d.ts +16 -0
- package/dist/hooks/use-slot/use-slot.js +21 -0
- package/dist/hooks/use-slot/use-slot.js.map +1 -0
- package/dist/hooks/use-theme/index.d.ts +43 -0
- package/dist/hooks/use-theme/index.js +5 -0
- package/dist/hooks/use-theme/index.js.map +1 -0
- package/dist/hooks/use-theme/types.d.ts +104 -0
- package/dist/hooks/use-theme/types.js +3 -0
- package/dist/hooks/use-theme/types.js.map +1 -0
- package/dist/hooks/use-theme/use-theme.css.d.ts +3 -0
- package/dist/hooks/use-theme/use-theme.css.js +8 -0
- package/dist/hooks/use-theme/use-theme.css.js.map +1 -0
- package/dist/hooks/use-theme/use-theme.d.ts +72 -0
- package/dist/hooks/use-theme/use-theme.js +108 -0
- package/dist/hooks/use-theme/use-theme.js.map +1 -0
- package/dist/hooks/use-tree/index.d.ts +4 -0
- package/dist/hooks/use-tree/index.js +4 -0
- package/dist/hooks/use-tree/index.js.map +1 -0
- package/dist/hooks/use-tree/use-tree.d.ts +7 -0
- package/dist/hooks/use-tree/use-tree.js +262 -0
- package/dist/hooks/use-tree/use-tree.js.map +1 -0
- package/dist/hooks/use-tree/utils.d.ts +10 -0
- package/dist/hooks/use-tree/utils.js +83 -0
- package/dist/hooks/use-tree/utils.js.map +1 -0
- package/dist/hooks/use-update-effect/index.d.ts +1 -0
- package/dist/hooks/use-update-effect/index.js +4 -0
- package/dist/hooks/use-update-effect/index.js.map +1 -0
- package/dist/hooks/use-update-effect/use-update-effect.d.ts +3 -0
- package/dist/hooks/use-update-effect/use-update-effect.js +23 -0
- package/dist/hooks/use-update-effect/use-update-effect.js.map +1 -0
- package/dist/index.css +124 -84
- package/dist/index.d.ts +111 -764
- package/dist/index.js +5 -5295
- package/dist/index.js.map +1 -1
- package/dist/ladle/actions.d.ts +3 -0
- package/dist/ladle/actions.js +26 -0
- package/dist/ladle/actions.js.map +1 -0
- package/dist/ladle/index.d.ts +1 -0
- package/dist/ladle/index.js +4 -0
- package/dist/ladle/index.js.map +1 -0
- package/dist/styles/index.d.ts +6 -0
- package/dist/styles/index.js +9 -0
- package/dist/styles/index.js.map +1 -0
- package/dist/styles/layers.css.d.ts +18 -0
- package/dist/styles/layers.css.js +8 -0
- package/dist/styles/layers.css.js.map +1 -0
- package/dist/styles/reset.css.d.ts +2 -0
- package/dist/styles/reset.css.js +3 -0
- package/dist/styles/reset.css.js.map +1 -0
- package/dist/styles/space.css.d.ts +2 -0
- package/dist/styles/space.css.js +3 -0
- package/dist/styles/space.css.js.map +1 -0
- package/dist/styles/surfaces.css.d.ts +6 -0
- package/dist/styles/surfaces.css.js +8 -0
- package/dist/styles/surfaces.css.js.map +1 -0
- package/dist/styles/theme.css.d.ts +337 -0
- package/dist/styles/theme.css.js +35 -0
- package/dist/styles/theme.css.js.map +1 -0
- package/dist/styles/typography.css.d.ts +21 -0
- package/dist/styles/typography.css.js +12 -0
- package/dist/styles/typography.css.js.map +1 -0
- package/dist/test/setup.d.ts +2 -0
- package/dist/test/setup.js +6895 -0
- package/dist/test/setup.js.map +1 -0
- package/dist/types/deckgl.d.ts +3 -0
- package/dist/types/deckgl.js +3 -0
- package/dist/types/deckgl.js.map +1 -0
- package/dist/types/generic.d.ts +5 -0
- package/dist/types/generic.js +3 -0
- package/dist/types/generic.js.map +1 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/index.js +3 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/props.d.ts +6 -0
- package/dist/types/props.js +3 -0
- package/dist/types/props.js.map +1 -0
- package/dist/types/react-aria.d.ts +94 -0
- package/dist/types/react-aria.js +3 -0
- package/dist/types/react-aria.js.map +1 -0
- package/dist/types/react.d.d.ts +22 -0
- package/dist/types/react.d.js +3 -0
- package/dist/types/react.d.js.map +1 -0
- package/dist/types/use-tree.d.ts +56 -0
- package/dist/types/use-tree.js +3 -0
- package/dist/types/use-tree.js.map +1 -0
- package/dist/types/vanilla-extract.d.ts +18 -0
- package/dist/types/vanilla-extract.js +3 -0
- package/dist/types/vanilla-extract.js.map +1 -0
- package/dist/utils/css.d.ts +142 -0
- package/dist/utils/css.js +165 -0
- package/dist/utils/css.js.map +1 -0
- package/dist/utils/events.d.ts +11 -0
- package/dist/utils/events.js +10 -0
- package/dist/utils/events.js.map +1 -0
- package/dist/utils/index.d.ts +10 -0
- package/dist/utils/index.js +7 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/props.d.ts +32 -0
- package/dist/utils/props.js +144 -0
- package/dist/utils/props.js.map +1 -0
- package/dist/utils/validators.d.ts +52 -0
- package/dist/utils/validators.js +42 -0
- package/dist/utils/validators.js.map +1 -0
- package/dist/vanilla.d.ts +63 -3
- package/dist/vanilla.js +27 -1
- package/dist/vanilla.js.map +1 -1
- package/package.json +59 -54
- package/dist/chunk-4ZUGQMUD.js +0 -419
- package/dist/chunk-4ZUGQMUD.js.map +0 -1
- package/dist/index.css.map +0 -1
- package/dist/vanilla-oo0eN2ya.d.ts +0 -2628
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
import { ModalRenderProps, HeadingProps, ModalOverlayProps, DialogProps as DialogProps$1 } from 'react-aria-components';
|
|
3
|
+
import { OmitProtectedProps } from '../../types/props.js';
|
|
4
|
+
import { RenderPropsChildren } from '../../types/react-aria.js';
|
|
5
|
+
import { ButtonProps } from '../button/types.js';
|
|
6
|
+
import { GroupProps } from '../group/types.js';
|
|
7
|
+
import '../icon/types.js';
|
|
8
|
+
import '@react-types/shared';
|
|
9
|
+
|
|
10
|
+
type DialogClassNames = Partial<{
|
|
11
|
+
portal: string;
|
|
12
|
+
container: string;
|
|
13
|
+
modal: string;
|
|
14
|
+
dialog: string;
|
|
15
|
+
header: string;
|
|
16
|
+
content: string;
|
|
17
|
+
footer: string;
|
|
18
|
+
}>;
|
|
19
|
+
type DialogSizes = 'sm' | 'lg';
|
|
20
|
+
type DialogMapping = {
|
|
21
|
+
heading: Partial<Record<DialogSizes, HeadingProps>>;
|
|
22
|
+
actions: GroupProps<ButtonProps, HTMLButtonElement>;
|
|
23
|
+
primary: Partial<Record<DialogSizes, OmitProtectedProps<ButtonProps>>>;
|
|
24
|
+
secondary: Partial<Record<DialogSizes, OmitProtectedProps<ButtonProps>>>;
|
|
25
|
+
};
|
|
26
|
+
type DialogRenderProps = ModalRenderProps & {
|
|
27
|
+
/**
|
|
28
|
+
* If the dialog is relative to the viewport (vs a specified parent element)
|
|
29
|
+
*/
|
|
30
|
+
isGlobal: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* If the dialog is visible
|
|
33
|
+
*/
|
|
34
|
+
isOpen: boolean;
|
|
35
|
+
};
|
|
36
|
+
type BaseDialogProps = Pick<DialogProps$1, 'role'> & {
|
|
37
|
+
children?: RenderPropsChildren<DialogRenderProps>;
|
|
38
|
+
classNames?: DialogClassNames;
|
|
39
|
+
mapping?: Partial<DialogMapping>;
|
|
40
|
+
/**
|
|
41
|
+
* Optionally provide a ref to a parent container that the dialog will be portaled into
|
|
42
|
+
* This will make it so the Dialog is not global in the DOM and will visually center it
|
|
43
|
+
* to the parent's area instead of the whole viewport
|
|
44
|
+
*/
|
|
45
|
+
parentRef?: RefObject<HTMLElement>;
|
|
46
|
+
size?: DialogSizes;
|
|
47
|
+
};
|
|
48
|
+
type DialogState = Omit<DialogRenderProps, 'state'> & Required<Pick<BaseDialogProps, 'size'>> & {
|
|
49
|
+
hasHeader: boolean;
|
|
50
|
+
};
|
|
51
|
+
type DialogProps = Omit<ModalOverlayProps, 'children' | 'className' | 'style'> & BaseDialogProps;
|
|
52
|
+
|
|
53
|
+
export type { DialogClassNames, DialogMapping, DialogProps, DialogRenderProps, DialogSizes, DialogState };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"types.js"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { DrawerClassNames } from './types.js';
|
|
2
|
+
import '@react-aria/overlays';
|
|
3
|
+
import '@react-stately/overlays';
|
|
4
|
+
import '@react-types/shared';
|
|
5
|
+
import 'react';
|
|
6
|
+
import 'type-fest';
|
|
7
|
+
import '../../types/props.js';
|
|
8
|
+
import '../../types/react-aria.js';
|
|
9
|
+
import '../button/types.js';
|
|
10
|
+
import 'react-aria-components';
|
|
11
|
+
import '../icon/types.js';
|
|
12
|
+
import '../tabs/types.js';
|
|
13
|
+
import '../../types/generic.js';
|
|
14
|
+
|
|
15
|
+
declare const drawerContainer: string;
|
|
16
|
+
declare const drawerAnimationVars: {
|
|
17
|
+
delay: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
18
|
+
duration: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
19
|
+
easing: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
20
|
+
};
|
|
21
|
+
declare const drawerColorVars: {
|
|
22
|
+
background: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
23
|
+
color: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
24
|
+
};
|
|
25
|
+
declare const drawerSpaceVars: {
|
|
26
|
+
drawer: {
|
|
27
|
+
width: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
28
|
+
gap: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
29
|
+
x: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
30
|
+
y: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
31
|
+
};
|
|
32
|
+
list: {
|
|
33
|
+
top: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
34
|
+
translateY: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
declare const drawerStateVars: {
|
|
38
|
+
anchor: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
39
|
+
layoutShift: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
40
|
+
isChild: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
41
|
+
isOpen: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
42
|
+
};
|
|
43
|
+
declare const drawerDialogStateVars: {
|
|
44
|
+
isChild: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
45
|
+
};
|
|
46
|
+
declare const drawerClassNames: DrawerClassNames;
|
|
47
|
+
|
|
48
|
+
export { drawerAnimationVars, drawerClassNames, drawerColorVars, drawerContainer, drawerDialogStateVars, drawerSpaceVars, drawerStateVars };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import '../../chunk-PZ5AY32C.js';
|
|
2
|
+
|
|
3
|
+
// src/components/drawer/drawer.css.ts
|
|
4
|
+
var drawerAnimationVars = { delay: "var(--delay__3hvldb1)", duration: "var(--duration__3hvldb2)", easing: "var(--easing__3hvldb3)" };
|
|
5
|
+
var drawerClassNames = { container: "drawer_drawerClassNames_container__3hvldbh", tabs: { tabs: "drawer_drawerClassNames_tabs_tabs__3hvldbi", list: { list: "drawer_drawerClassNames_tabs_list_list__3hvldbj surfaces_proud__15mw6jf1 surfaces_flush__15mw6jf0" } }, dialog: { container: "drawer_drawerClassNames_dialog_container__3hvldbk", dialog: "drawer_drawerClassNames_dialog_dialog__3hvldbl surfaces_proud__15mw6jf1 surfaces_flush__15mw6jf0" }, header: { header: "drawer_drawerClassNames_header_header__3hvldbm", back: { container: "drawer_drawerClassNames_header_back_container__3hvldbn" }, title: "drawer_drawerClassNames_header_title__3hvldbo", close: { container: "drawer_drawerClassNames_header_close_container__3hvldbp" } }, content: "drawer_drawerClassNames_content__3hvldbq", footer: "drawer_drawerClassNames_footer__3hvldbr" };
|
|
6
|
+
var drawerColorVars = { background: "var(--background__3hvldb4)", color: "var(--color__3hvldb5)" };
|
|
7
|
+
var drawerContainer = "drawer_drawerContainer__3hvldb0";
|
|
8
|
+
var drawerDialogStateVars = { isChild: "var(--isChild__3hvldbg)" };
|
|
9
|
+
var drawerSpaceVars = { drawer: { width: "var(--drawer-width__3hvldb6)", gap: "var(--drawer-gap__3hvldb7)", x: "var(--drawer-x__3hvldb8)", y: "var(--drawer-y__3hvldb9)" }, list: { top: "var(--list-top__3hvldba)", translateY: "var(--list-translateY__3hvldbb)" } };
|
|
10
|
+
var drawerStateVars = { anchor: "var(--anchor__3hvldbc)", layoutShift: "var(--layoutShift__3hvldbd)", isChild: "var(--isChild__3hvldbe)", isOpen: "var(--isOpen__3hvldbf)" };
|
|
11
|
+
|
|
12
|
+
export { drawerAnimationVars, drawerClassNames, drawerColorVars, drawerContainer, drawerDialogStateVars, drawerSpaceVars, drawerStateVars };
|
|
13
|
+
//# sourceMappingURL=drawer.css.js.map
|
|
14
|
+
//# sourceMappingURL=drawer.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/drawer/drawer.css.ts"],"names":[],"mappings":";;;AAAO,IAAI,sBAAsB,EAAC,KAAA,EAAM,yBAAwB,QAAS,EAAA,0BAAA,EAA2B,QAAO,wBAAwB;AAC5H,IAAI,mBAAmB,EAAC,SAAA,EAAU,8CAA6C,IAAK,EAAA,EAAC,MAAK,4CAA6C,EAAA,IAAA,EAAK,EAAC,IAAA,EAAK,qGAAoG,EAAA,EAAE,QAAO,EAAC,SAAA,EAAU,qDAAoD,MAAO,EAAA,kGAAA,EAAoG,EAAA,MAAA,EAAO,EAAC,MAAO,EAAA,gDAAA,EAAiD,MAAK,EAAC,SAAA,EAAU,0DAA0D,EAAA,KAAA,EAAM,iDAAgD,KAAM,EAAA,EAAC,WAAU,yDAAyD,EAAA,IAAG,OAAQ,EAAA,0CAAA,EAA2C,QAAO,yCAAyC;AACzxB,IAAI,eAAkB,GAAA,EAAC,UAAW,EAAA,4BAAA,EAA6B,OAAM,uBAAuB;AAC5F,IAAI,eAAkB,GAAA;AAClB,IAAA,qBAAA,GAAwB,EAAC,OAAA,EAAQ,yBAAyB;AAC9D,IAAI,kBAAkB,EAAC,MAAA,EAAO,EAAC,KAAM,EAAA,8BAAA,EAA+B,KAAI,4BAA6B,EAAA,CAAA,EAAE,4BAA2B,CAAE,EAAA,0BAAA,IAA4B,IAAK,EAAA,EAAC,KAAI,0BAA2B,EAAA,UAAA,EAAW,mCAAkC;AAC9O,IAAA,eAAA,GAAkB,EAAC,MAAO,EAAA,wBAAA,EAAyB,aAAY,6BAA8B,EAAA,OAAA,EAAQ,yBAA0B,EAAA,MAAA,EAAO,wBAAwB","file":"drawer.css.js","sourcesContent":["export var drawerAnimationVars = {delay:'var(--delay__3hvldb1)',duration:'var(--duration__3hvldb2)',easing:'var(--easing__3hvldb3)'};\nexport var drawerClassNames = {container:'drawer_drawerClassNames_container__3hvldbh',tabs:{tabs:'drawer_drawerClassNames_tabs_tabs__3hvldbi',list:{list:'drawer_drawerClassNames_tabs_list_list__3hvldbj surfaces_proud__15mw6jf1 surfaces_flush__15mw6jf0'}},dialog:{container:'drawer_drawerClassNames_dialog_container__3hvldbk',dialog:'drawer_drawerClassNames_dialog_dialog__3hvldbl surfaces_proud__15mw6jf1 surfaces_flush__15mw6jf0'},header:{header:'drawer_drawerClassNames_header_header__3hvldbm',back:{container:'drawer_drawerClassNames_header_back_container__3hvldbn'},title:'drawer_drawerClassNames_header_title__3hvldbo',close:{container:'drawer_drawerClassNames_header_close_container__3hvldbp'}},content:'drawer_drawerClassNames_content__3hvldbq',footer:'drawer_drawerClassNames_footer__3hvldbr'};\nexport var drawerColorVars = {background:'var(--background__3hvldb4)',color:'var(--color__3hvldb5)'};\nexport var drawerContainer = 'drawer_drawerContainer__3hvldb0';\nexport var drawerDialogStateVars = {isChild:'var(--isChild__3hvldbg)'};\nexport var drawerSpaceVars = {drawer:{width:'var(--drawer-width__3hvldb6)',gap:'var(--drawer-gap__3hvldb7)',x:'var(--drawer-x__3hvldb8)',y:'var(--drawer-y__3hvldb9)'},list:{top:'var(--list-top__3hvldba)',translateY:'var(--list-translateY__3hvldbb)'}};\nexport var drawerStateVars = {anchor:'var(--anchor__3hvldbc)',layoutShift:'var(--layoutShift__3hvldbd)',isChild:'var(--isChild__3hvldbe)',isOpen:'var(--isOpen__3hvldbf)'};"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { DrawerProps, DrawerClassNames, DrawerMapping, DrawerTabProps, DrawerTabListProps, DrawerDialogProps } from './types.js';
|
|
2
|
+
import * as _react_types_shared from '@react-types/shared';
|
|
3
|
+
import * as react from 'react';
|
|
4
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
|
+
import { ContextValue } from 'react-aria-components';
|
|
6
|
+
import '@react-aria/overlays';
|
|
7
|
+
import '@react-stately/overlays';
|
|
8
|
+
import 'type-fest';
|
|
9
|
+
import '../../types/props.js';
|
|
10
|
+
import '../../types/react-aria.js';
|
|
11
|
+
import '../button/types.js';
|
|
12
|
+
import '../icon/types.js';
|
|
13
|
+
import '../tabs/types.js';
|
|
14
|
+
import '../../types/generic.js';
|
|
15
|
+
|
|
16
|
+
declare function Drawer(props: DrawerProps): react_jsx_runtime.JSX.Element;
|
|
17
|
+
declare function DrawerTabList<T extends object>(props: DrawerTabListProps<T>): react_jsx_runtime.JSX.Element;
|
|
18
|
+
declare function DrawerTab(props: DrawerTabProps): react_jsx_runtime.JSX.Element;
|
|
19
|
+
declare const DrawerDialogContext: react.Context<ContextValue<DrawerDialogProps, HTMLDivElement>>;
|
|
20
|
+
declare const DrawerDialog: (props: _react_types_shared.AriaLabelingProps & {
|
|
21
|
+
classNames?: DrawerClassNames;
|
|
22
|
+
} & {
|
|
23
|
+
mapping?: DrawerMapping;
|
|
24
|
+
} & {
|
|
25
|
+
children?: react.ReactNode | undefined;
|
|
26
|
+
} & react.RefAttributes<HTMLDivElement>) => react.ReactElement | null;
|
|
27
|
+
|
|
28
|
+
export { Drawer, DrawerDialog, DrawerDialogContext, DrawerTab, DrawerTabList };
|
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
import '../../chunk-PZ5AY32C.js';
|
|
2
|
+
import { toBoolean } from '@accelint/converters';
|
|
3
|
+
import { noop } from '@accelint/core';
|
|
4
|
+
import { useFocusWithin } from '@react-aria/interactions';
|
|
5
|
+
import { useOverlay } from '@react-aria/overlays';
|
|
6
|
+
import { useIsSSR } from '@react-aria/ssr';
|
|
7
|
+
import { useOverlayTriggerState } from '@react-stately/overlays';
|
|
8
|
+
import { createContext, forwardRef, useContext, useMemo, useCallback, useRef } from 'react';
|
|
9
|
+
import { DEFAULT_SLOT, Provider } from 'react-aria-components';
|
|
10
|
+
import { useContextProps, useSlot, useTheme, useDefaultProps } from '../../hooks/index.js';
|
|
11
|
+
import { headings } from '../../styles/index.js';
|
|
12
|
+
import { mergeClassNames, inlineVars, callRenderProps, mergeProps } from '../../utils/index.js';
|
|
13
|
+
import { AriaHeadingContext } from '../aria/index.js';
|
|
14
|
+
import { ButtonContext } from '../button/index.js';
|
|
15
|
+
import { ElementContext } from '../element/index.js';
|
|
16
|
+
import { Tabs, TabList, Tab } from '../tabs/index.js';
|
|
17
|
+
import { TooltipContext, TooltipTargetContext } from '../tooltip/index.js';
|
|
18
|
+
import { drawerClassNames, drawerDialogStateVars, drawerStateVars } from './drawer.css.js';
|
|
19
|
+
import { jsx } from 'react/jsx-runtime';
|
|
20
|
+
|
|
21
|
+
var DrawerContext = createContext({
|
|
22
|
+
anchor: "right",
|
|
23
|
+
layoutShift: false,
|
|
24
|
+
isOpen: false,
|
|
25
|
+
close: noop,
|
|
26
|
+
open: noop,
|
|
27
|
+
setOpen: noop,
|
|
28
|
+
toggle: noop
|
|
29
|
+
});
|
|
30
|
+
function Drawer(props) {
|
|
31
|
+
props = useDefaultProps(props, "Drawer");
|
|
32
|
+
const {
|
|
33
|
+
children: childrenProp,
|
|
34
|
+
classNames: classNamesProp,
|
|
35
|
+
anchor = "right",
|
|
36
|
+
defaultOpen = false,
|
|
37
|
+
layoutShift = false,
|
|
38
|
+
shouldCloseOnBlur = false,
|
|
39
|
+
isDismissable = true,
|
|
40
|
+
isKeyboardDismissDisabled = false,
|
|
41
|
+
isOpen: isOpenProp,
|
|
42
|
+
onOpenChange,
|
|
43
|
+
...rest
|
|
44
|
+
} = props;
|
|
45
|
+
const theme = useTheme();
|
|
46
|
+
const isSSR = useIsSSR();
|
|
47
|
+
const classNames = useMemo(
|
|
48
|
+
() => mergeClassNames(drawerClassNames, theme.Drawer, classNamesProp),
|
|
49
|
+
[theme.Drawer, classNamesProp]
|
|
50
|
+
);
|
|
51
|
+
const handleOpenChange = useCallback(
|
|
52
|
+
(isOpen2) => {
|
|
53
|
+
if (!isOpen2) {
|
|
54
|
+
const focused = isSSR ? null : document.activeElement;
|
|
55
|
+
if (focused && "blur" in focused && typeof focused.blur === "function") {
|
|
56
|
+
focused.blur();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
onOpenChange?.(isOpen2);
|
|
60
|
+
},
|
|
61
|
+
[isSSR, onOpenChange]
|
|
62
|
+
);
|
|
63
|
+
const state = useOverlayTriggerState({
|
|
64
|
+
defaultOpen,
|
|
65
|
+
isOpen: isOpenProp,
|
|
66
|
+
onOpenChange: handleOpenChange
|
|
67
|
+
});
|
|
68
|
+
const { isOpen, close, open } = state;
|
|
69
|
+
const ref = useRef(null);
|
|
70
|
+
const { overlayProps } = useOverlay(
|
|
71
|
+
{
|
|
72
|
+
isOpen,
|
|
73
|
+
shouldCloseOnBlur,
|
|
74
|
+
isDismissable,
|
|
75
|
+
isKeyboardDismissDisabled,
|
|
76
|
+
onClose: close
|
|
77
|
+
},
|
|
78
|
+
ref
|
|
79
|
+
);
|
|
80
|
+
const { focusWithinProps } = useFocusWithin({
|
|
81
|
+
onFocusWithin: open
|
|
82
|
+
});
|
|
83
|
+
const context = useMemo(
|
|
84
|
+
() => ({ ...state, anchor, layoutShift }),
|
|
85
|
+
[state, anchor, layoutShift]
|
|
86
|
+
);
|
|
87
|
+
const values = useMemo(
|
|
88
|
+
() => [
|
|
89
|
+
[DrawerContext, context],
|
|
90
|
+
[DrawerDialogContext, { classNames }]
|
|
91
|
+
],
|
|
92
|
+
[context, classNames]
|
|
93
|
+
);
|
|
94
|
+
const style = useMemo(
|
|
95
|
+
() => inlineVars(drawerStateVars, {
|
|
96
|
+
anchor,
|
|
97
|
+
layoutShift,
|
|
98
|
+
isOpen
|
|
99
|
+
}),
|
|
100
|
+
[anchor, layoutShift, isOpen]
|
|
101
|
+
);
|
|
102
|
+
const children = useMemo(
|
|
103
|
+
() => callRenderProps(childrenProp, state),
|
|
104
|
+
[childrenProp, state]
|
|
105
|
+
);
|
|
106
|
+
return /* @__PURE__ */ jsx(Provider, { values, children: /* @__PURE__ */ jsx(
|
|
107
|
+
"div",
|
|
108
|
+
{
|
|
109
|
+
...mergeProps(overlayProps, focusWithinProps),
|
|
110
|
+
ref,
|
|
111
|
+
className: classNames?.container,
|
|
112
|
+
style,
|
|
113
|
+
children: /* @__PURE__ */ jsx(Tabs, { classNames: classNames?.tabs, ...rest, children })
|
|
114
|
+
}
|
|
115
|
+
) });
|
|
116
|
+
}
|
|
117
|
+
function DrawerTabList(props) {
|
|
118
|
+
props = useDefaultProps(props, "DrawerTabList");
|
|
119
|
+
const { children, classNames: classNamesProp, variant = "fill" } = props;
|
|
120
|
+
const { anchor } = useContext(DrawerContext);
|
|
121
|
+
const theme = useTheme();
|
|
122
|
+
const classNames = useMemo(
|
|
123
|
+
() => mergeClassNames(drawerClassNames, theme.Drawer, classNamesProp),
|
|
124
|
+
[theme.Drawer, classNamesProp]
|
|
125
|
+
);
|
|
126
|
+
const values = useMemo(
|
|
127
|
+
() => [
|
|
128
|
+
[TooltipContext, { placement: anchor === "left" ? "right" : "left" }],
|
|
129
|
+
[TooltipTargetContext, { focusable: false, relative: "parent" }]
|
|
130
|
+
],
|
|
131
|
+
[anchor]
|
|
132
|
+
);
|
|
133
|
+
return /* @__PURE__ */ jsx(Provider, { values, children: /* @__PURE__ */ jsx(
|
|
134
|
+
TabList,
|
|
135
|
+
{
|
|
136
|
+
classNames: classNames?.tabs,
|
|
137
|
+
align: "center",
|
|
138
|
+
anchor: anchor === "left" ? "start" : "end",
|
|
139
|
+
orientation: "vertical",
|
|
140
|
+
variant,
|
|
141
|
+
children
|
|
142
|
+
}
|
|
143
|
+
) });
|
|
144
|
+
}
|
|
145
|
+
function DrawerTab(props) {
|
|
146
|
+
props = useDefaultProps(props, "DrawerTab");
|
|
147
|
+
const { children: childrenProp, classNames: classNamesProp, ...rest } = props;
|
|
148
|
+
const { isOpen, open, toggle } = useContext(DrawerContext);
|
|
149
|
+
const theme = useTheme();
|
|
150
|
+
const classNames = useMemo(
|
|
151
|
+
() => mergeClassNames(drawerClassNames, theme.Drawer, classNamesProp),
|
|
152
|
+
[theme.Drawer, classNamesProp]
|
|
153
|
+
);
|
|
154
|
+
const handlePressStart = useCallback(
|
|
155
|
+
(event) => {
|
|
156
|
+
const { selected } = event.target.parentElement?.dataset ?? {};
|
|
157
|
+
if (toBoolean(selected)) {
|
|
158
|
+
toggle();
|
|
159
|
+
} else {
|
|
160
|
+
open();
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
[open, toggle]
|
|
164
|
+
);
|
|
165
|
+
const children = useCallback(
|
|
166
|
+
(renderProps) => callRenderProps(childrenProp, { ...renderProps, isOpen }),
|
|
167
|
+
[childrenProp, isOpen]
|
|
168
|
+
);
|
|
169
|
+
return /* @__PURE__ */ jsx(
|
|
170
|
+
Tab,
|
|
171
|
+
{
|
|
172
|
+
...rest,
|
|
173
|
+
classNames: classNames?.tabs,
|
|
174
|
+
onPressStart: handlePressStart,
|
|
175
|
+
children
|
|
176
|
+
}
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
var defaultMapping = {
|
|
180
|
+
heading: {
|
|
181
|
+
child: headings.v4,
|
|
182
|
+
parent: headings.v3
|
|
183
|
+
},
|
|
184
|
+
back: {
|
|
185
|
+
variant: "icon"
|
|
186
|
+
},
|
|
187
|
+
close: {
|
|
188
|
+
variant: "icon"
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
var DrawerDialogContext = createContext(null);
|
|
192
|
+
var DrawerDialog = forwardRef(function DrawerDialog2(props, ref) {
|
|
193
|
+
[props, ref] = useContextProps(props, ref, DrawerDialogContext);
|
|
194
|
+
const {
|
|
195
|
+
children,
|
|
196
|
+
classNames: classNamesProp,
|
|
197
|
+
mapping: mappingProp,
|
|
198
|
+
"aria-label": ariaLabel,
|
|
199
|
+
"aria-labelledby": ariaLabelledBy,
|
|
200
|
+
...rest
|
|
201
|
+
} = props;
|
|
202
|
+
const { close } = useContext(DrawerContext);
|
|
203
|
+
const [backRef, hasBack] = useSlot();
|
|
204
|
+
const [titleRef, hasTitle] = useSlot();
|
|
205
|
+
const theme = useTheme();
|
|
206
|
+
const mapping = useMemo(
|
|
207
|
+
() => ({ ...defaultMapping, ...mappingProp }),
|
|
208
|
+
[mappingProp]
|
|
209
|
+
);
|
|
210
|
+
const classNames = useMemo(
|
|
211
|
+
() => mergeClassNames(drawerClassNames, theme.Drawer, classNamesProp, {
|
|
212
|
+
header: {
|
|
213
|
+
title: hasBack ? mapping.heading.child : mapping.heading.parent
|
|
214
|
+
}
|
|
215
|
+
}),
|
|
216
|
+
[theme.Drawer, classNamesProp, hasBack, mapping]
|
|
217
|
+
);
|
|
218
|
+
const style = useMemo(
|
|
219
|
+
() => inlineVars(drawerDialogStateVars, {
|
|
220
|
+
isChild: !!hasBack
|
|
221
|
+
}),
|
|
222
|
+
[hasBack]
|
|
223
|
+
);
|
|
224
|
+
const values = useMemo(
|
|
225
|
+
() => [
|
|
226
|
+
[
|
|
227
|
+
ElementContext,
|
|
228
|
+
{
|
|
229
|
+
slots: {
|
|
230
|
+
[DEFAULT_SLOT]: {},
|
|
231
|
+
header: {
|
|
232
|
+
as: "header",
|
|
233
|
+
className: classNames?.header?.header,
|
|
234
|
+
values: [
|
|
235
|
+
[
|
|
236
|
+
ButtonContext,
|
|
237
|
+
{
|
|
238
|
+
slots: {
|
|
239
|
+
[DEFAULT_SLOT]: {},
|
|
240
|
+
back: {
|
|
241
|
+
...mapping.back,
|
|
242
|
+
ref: backRef,
|
|
243
|
+
classNames: classNames?.header?.back
|
|
244
|
+
},
|
|
245
|
+
close: {
|
|
246
|
+
...mapping.close,
|
|
247
|
+
classNames: classNames?.header?.close,
|
|
248
|
+
onPress: close
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
],
|
|
253
|
+
[
|
|
254
|
+
AriaHeadingContext,
|
|
255
|
+
{
|
|
256
|
+
slots: {
|
|
257
|
+
title: {
|
|
258
|
+
ref: titleRef,
|
|
259
|
+
className: classNames?.header?.title
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
]
|
|
264
|
+
]
|
|
265
|
+
},
|
|
266
|
+
content: { className: classNames?.content },
|
|
267
|
+
footer: { as: "footer", className: classNames?.footer }
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
]
|
|
271
|
+
],
|
|
272
|
+
[
|
|
273
|
+
classNames?.header?.header,
|
|
274
|
+
classNames?.header?.back,
|
|
275
|
+
classNames?.header?.close,
|
|
276
|
+
classNames?.header?.title,
|
|
277
|
+
classNames?.content,
|
|
278
|
+
classNames?.footer,
|
|
279
|
+
backRef,
|
|
280
|
+
close,
|
|
281
|
+
mapping,
|
|
282
|
+
titleRef
|
|
283
|
+
]
|
|
284
|
+
);
|
|
285
|
+
if (!ariaLabel && !ariaLabelledBy && !hasTitle) {
|
|
286
|
+
console.warn(
|
|
287
|
+
'If a Drawer does not contain a <Heading slot="title">, it must have an aria-label or aria-labelledby attribute for accessibility.'
|
|
288
|
+
);
|
|
289
|
+
}
|
|
290
|
+
return /* @__PURE__ */ jsx(Provider, { values, children: /* @__PURE__ */ jsx(
|
|
291
|
+
"div",
|
|
292
|
+
{
|
|
293
|
+
...rest,
|
|
294
|
+
className: classNames?.dialog?.container,
|
|
295
|
+
style,
|
|
296
|
+
"aria-label": ariaLabel,
|
|
297
|
+
"aria-labelledby": ariaLabelledBy,
|
|
298
|
+
children: /* @__PURE__ */ jsx("div", { className: classNames?.dialog?.dialog, children })
|
|
299
|
+
}
|
|
300
|
+
) });
|
|
301
|
+
});
|
|
302
|
+
|
|
303
|
+
export { Drawer, DrawerDialog, DrawerDialogContext, DrawerTab, DrawerTabList };
|
|
304
|
+
//# sourceMappingURL=drawer.js.map
|
|
305
|
+
//# sourceMappingURL=drawer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/drawer/drawer.tsx"],"names":["isOpen","DrawerDialog"],"mappings":";;;;;;;;;;;;;;;;;;;;AAuEA,IAAM,gBAAgB,aAAkC,CAAA;AAAA,EACtD,MAAQ,EAAA,OAAA;AAAA,EACR,WAAa,EAAA,KAAA;AAAA,EACb,MAAQ,EAAA,KAAA;AAAA,EACR,KAAO,EAAA,IAAA;AAAA,EACP,IAAM,EAAA,IAAA;AAAA,EACN,OAAS,EAAA,IAAA;AAAA,EACT,MAAQ,EAAA;AACV,CAAC,CAAA;AAEM,SAAS,OAAO,KAAoB,EAAA;AACzC,EAAQ,KAAA,GAAA,eAAA,CAAgB,OAAO,QAAQ,CAAA;AAEvC,EAAM,MAAA;AAAA,IACJ,QAAU,EAAA,YAAA;AAAA,IACV,UAAY,EAAA,cAAA;AAAA,IACZ,MAAS,GAAA,OAAA;AAAA,IACT,WAAc,GAAA,KAAA;AAAA,IACd,WAAc,GAAA,KAAA;AAAA,IACd,iBAAoB,GAAA,KAAA;AAAA,IACpB,aAAgB,GAAA,IAAA;AAAA,IAChB,yBAA4B,GAAA,KAAA;AAAA,IAC5B,MAAQ,EAA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SAAA,IAAa,CAAC,cAAA,IAAkB,CAAC,QAAU,EAAA;AAC9C,IAAQ,OAAA,CAAA,IAAA;AAAA,MACN;AAAA,KACF;AAAA;AAGF,EACE,uBAAA,GAAA,CAAC,YAAS,MACR,EAAA,QAAA,kBAAA,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACE,GAAG,IAAA;AAAA,MACJ,SAAA,EAAW,YAAY,MAAQ,EAAA,SAAA;AAAA,MAC/B,KAAA;AAAA,MACA,YAAY,EAAA,SAAA;AAAA,MACZ,iBAAiB,EAAA,cAAA;AAAA,MAEjB,8BAAC,KAAI,EAAA,EAAA,SAAA,EAAW,UAAY,EAAA,MAAA,EAAQ,QAAS,QAAS,EAAA;AAAA;AAAA,GAE1D,EAAA,CAAA;AAEJ,CAAC","file":"drawer.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { toBoolean } from '@accelint/converters';\nimport { noop } from '@accelint/core';\nimport { useFocusWithin } from '@react-aria/interactions';\nimport { useOverlay } from '@react-aria/overlays';\nimport { useIsSSR } from '@react-aria/ssr';\nimport { useOverlayTriggerState } from '@react-stately/overlays';\nimport type { PressEvent } from '@react-types/shared';\nimport {\n type ForwardedRef,\n type HTMLAttributes,\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useMemo,\n useRef,\n} from 'react';\nimport {\n type ContextValue,\n DEFAULT_SLOT,\n Provider,\n} from 'react-aria-components';\nimport {\n useContextProps,\n useDefaultProps,\n useSlot,\n useTheme,\n} from '../../hooks';\nimport { headings } from '../../styles';\nimport {\n callRenderProps,\n inlineVars,\n mergeClassNames,\n mergeProps,\n} from '../../utils';\nimport { AriaHeadingContext } from '../aria';\nimport { ButtonContext, type ButtonProps } from '../button';\nimport { ElementContext, type ElementProps } from '../element';\nimport { Tab, TabList, type TabRenderProps, Tabs } from '../tabs';\nimport {\n TooltipContext,\n type TooltipProps,\n TooltipTargetContext,\n type TooltipTargetProps,\n} from '../tooltip';\nimport {\n drawerClassNames,\n drawerDialogStateVars,\n drawerStateVars,\n} from './drawer.css';\nimport type {\n DrawerContextValue,\n DrawerDialogProps,\n DrawerMapping,\n DrawerProps,\n DrawerTabListProps,\n DrawerTabProps,\n} from './types';\n\nconst DrawerContext = createContext<DrawerContextValue>({\n anchor: 'right',\n layoutShift: false,\n isOpen: false,\n close: noop,\n open: noop,\n setOpen: noop,\n toggle: noop,\n});\n\nexport function Drawer(props: DrawerProps) {\n props = useDefaultProps(props, 'Drawer');\n\n const {\n children: childrenProp,\n classNames: classNamesProp,\n anchor = 'right',\n defaultOpen = false,\n layoutShift = false,\n shouldCloseOnBlur = false,\n isDismissable = true,\n isKeyboardDismissDisabled = false,\n isOpen: isOpenProp,\n onOpenChange,\n ...rest\n } = props;\n\n const theme = useTheme();\n const isSSR = useIsSSR();\n\n const classNames = useMemo(\n () => mergeClassNames(drawerClassNames, theme.Drawer, classNamesProp),\n [theme.Drawer, classNamesProp],\n );\n\n // Remove focus when Drawer closes\n const handleOpenChange = useCallback(\n (isOpen: boolean) => {\n if (!isOpen) {\n const focused = isSSR ? null : document.activeElement;\n\n if (\n focused &&\n 'blur' in focused &&\n typeof focused.blur === 'function'\n ) {\n focused.blur();\n }\n }\n\n onOpenChange?.(isOpen);\n },\n [isSSR, onOpenChange],\n );\n\n const state = useOverlayTriggerState({\n defaultOpen,\n isOpen: isOpenProp,\n onOpenChange: handleOpenChange,\n });\n\n const { isOpen, close, open } = state;\n const ref = useRef<HTMLDivElement>(null);\n\n const { overlayProps } = useOverlay(\n {\n isOpen,\n shouldCloseOnBlur,\n isDismissable,\n isKeyboardDismissDisabled,\n onClose: close,\n },\n ref,\n );\n\n // TODO: it may be desirable to disallow focus within the closed Drawer instead\n // If focus forces the Drawer open\n const { focusWithinProps } = useFocusWithin({\n onFocusWithin: open,\n });\n\n const context = useMemo(\n () => ({ ...state, anchor, layoutShift }),\n [state, anchor, layoutShift],\n );\n\n const values = useMemo<\n [\n [typeof DrawerContext, DrawerContextValue],\n [\n typeof DrawerDialogContext,\n ContextValue<DrawerDialogProps, HTMLDivElement>,\n ],\n ]\n >(\n () => [\n [DrawerContext, context],\n [DrawerDialogContext, { classNames }],\n ],\n [context, classNames],\n );\n\n const style = useMemo(\n () =>\n inlineVars(drawerStateVars, {\n anchor,\n layoutShift,\n isOpen,\n }),\n [anchor, layoutShift, isOpen],\n );\n\n const children = useMemo(\n () => callRenderProps(childrenProp, state),\n [childrenProp, state],\n );\n\n return (\n <Provider values={values}>\n <div\n {...mergeProps(overlayProps, focusWithinProps)}\n ref={ref}\n className={classNames?.container}\n style={style}\n >\n <Tabs classNames={classNames?.tabs} {...rest}>\n {children}\n </Tabs>\n </div>\n </Provider>\n );\n}\n\nexport function DrawerTabList<T extends object>(props: DrawerTabListProps<T>) {\n props = useDefaultProps(props, 'DrawerTabList');\n\n const { children, classNames: classNamesProp, variant = 'fill' } = props;\n const { anchor } = useContext(DrawerContext);\n const theme = useTheme();\n\n const classNames = useMemo(\n () => mergeClassNames(drawerClassNames, theme.Drawer, classNamesProp),\n [theme.Drawer, classNamesProp],\n );\n\n const values = useMemo<\n [\n [typeof TooltipContext, ContextValue<TooltipProps, HTMLDivElement>],\n [\n typeof TooltipTargetContext,\n ContextValue<TooltipTargetProps, HTMLDivElement>,\n ],\n ]\n >(\n () => [\n [TooltipContext, { placement: anchor === 'left' ? 'right' : 'left' }],\n [TooltipTargetContext, { focusable: false, relative: 'parent' }],\n ],\n [anchor],\n );\n\n return (\n <Provider values={values}>\n <TabList<T>\n classNames={classNames?.tabs}\n align='center'\n anchor={anchor === 'left' ? 'start' : 'end'}\n orientation='vertical'\n variant={variant}\n >\n {children}\n </TabList>\n </Provider>\n );\n}\n\nexport function DrawerTab(props: DrawerTabProps) {\n props = useDefaultProps(props, 'DrawerTab');\n\n const { children: childrenProp, classNames: classNamesProp, ...rest } = props;\n const { isOpen, open, toggle } = useContext(DrawerContext);\n const theme = useTheme();\n\n const classNames = useMemo(\n () => mergeClassNames(drawerClassNames, theme.Drawer, classNamesProp),\n [theme.Drawer, classNamesProp],\n );\n\n // Must bind to press start (instead of later press events) due to Tab changing selected state on start\n const handlePressStart = useCallback(\n (event: PressEvent) => {\n const { selected } = event.target.parentElement?.dataset ?? {};\n\n if (toBoolean(selected)) {\n toggle();\n } else {\n open();\n }\n },\n [open, toggle],\n );\n\n const children = useCallback(\n (renderProps: TabRenderProps) =>\n callRenderProps(childrenProp, { ...renderProps, isOpen }),\n [childrenProp, isOpen],\n );\n\n return (\n <Tab\n {...rest}\n classNames={classNames?.tabs}\n onPressStart={handlePressStart}\n >\n {children}\n </Tab>\n );\n}\n\nconst defaultMapping: DrawerMapping = {\n heading: {\n child: headings.v4,\n parent: headings.v3,\n },\n back: {\n variant: 'icon',\n },\n close: {\n variant: 'icon',\n },\n};\n\nexport const DrawerDialogContext =\n createContext<ContextValue<DrawerDialogProps, HTMLDivElement>>(null);\n\nexport const DrawerDialog = forwardRef(function DrawerDialog(\n props: DrawerDialogProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n [props, ref] = useContextProps(props, ref, DrawerDialogContext);\n\n const {\n children,\n classNames: classNamesProp,\n mapping: mappingProp,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n ...rest\n } = props;\n\n const { close } = useContext(DrawerContext);\n const [backRef, hasBack] = useSlot();\n const [titleRef, hasTitle] = useSlot();\n const theme = useTheme();\n\n const mapping = useMemo(\n () => ({ ...defaultMapping, ...mappingProp }),\n [mappingProp],\n );\n\n const classNames = useMemo(\n () =>\n mergeClassNames(drawerClassNames, theme.Drawer, classNamesProp, {\n header: {\n title: hasBack ? mapping.heading.child : mapping.heading.parent,\n },\n }),\n [theme.Drawer, classNamesProp, hasBack, mapping],\n );\n\n const style = useMemo(\n () =>\n inlineVars(drawerDialogStateVars, {\n isChild: !!hasBack,\n }),\n [hasBack],\n );\n\n const values = useMemo<\n [\n [\n typeof ElementContext,\n ContextValue<\n ElementProps<\n ContextValue<ButtonProps, HTMLButtonElement>,\n ContextValue<HTMLAttributes<HTMLElement>, HTMLHeadingElement>\n >,\n HTMLElement\n >,\n ],\n ]\n >(\n () => [\n [\n ElementContext,\n {\n slots: {\n [DEFAULT_SLOT]: {},\n header: {\n as: 'header',\n className: classNames?.header?.header,\n values: [\n [\n ButtonContext,\n {\n slots: {\n [DEFAULT_SLOT]: {},\n back: {\n ...mapping.back,\n ref: backRef,\n classNames: classNames?.header?.back,\n },\n close: {\n ...mapping.close,\n classNames: classNames?.header?.close,\n onPress: close,\n },\n },\n },\n ],\n [\n AriaHeadingContext,\n {\n slots: {\n title: {\n ref: titleRef,\n className: classNames?.header?.title,\n },\n },\n },\n ],\n ],\n },\n content: { className: classNames?.content },\n footer: { as: 'footer', className: classNames?.footer },\n },\n },\n ],\n ],\n [\n classNames?.header?.header,\n classNames?.header?.back,\n classNames?.header?.close,\n classNames?.header?.title,\n classNames?.content,\n classNames?.footer,\n backRef,\n close,\n mapping,\n titleRef,\n ],\n );\n\n // biome-ignore lint/complexity/useSimplifiedLogicExpression: intentional\n if (!ariaLabel && !ariaLabelledBy && !hasTitle) {\n console.warn(\n 'If a Drawer does not contain a <Heading slot=\"title\">, it must have an aria-label or aria-labelledby attribute for accessibility.',\n );\n }\n\n return (\n <Provider values={values}>\n <div\n {...rest}\n className={classNames?.dialog?.container}\n style={style}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n >\n <div className={classNames?.dialog?.dialog}>{children}</div>\n </div>\n </Provider>\n );\n});\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export { Drawer, DrawerDialog, DrawerTab, DrawerTabList } from './drawer.js';
|
|
2
|
+
export { drawerAnimationVars, drawerClassNames, drawerColorVars, drawerContainer, drawerDialogStateVars, drawerSpaceVars, drawerStateVars } from './drawer.css.js';
|
|
3
|
+
export { DrawerAnchor, DrawerClassNames, DrawerDialogProps, DrawerDialogState, DrawerMapping, DrawerProps, DrawerRenderProps, DrawerState, DrawerTabListProps, DrawerTabProps, DrawerTabRenderProps } from './types.js';
|
|
4
|
+
import '@react-types/shared';
|
|
5
|
+
import 'react';
|
|
6
|
+
import 'react/jsx-runtime';
|
|
7
|
+
import 'react-aria-components';
|
|
8
|
+
import '@react-aria/overlays';
|
|
9
|
+
import '@react-stately/overlays';
|
|
10
|
+
import 'type-fest';
|
|
11
|
+
import '../../types/props.js';
|
|
12
|
+
import '../../types/react-aria.js';
|
|
13
|
+
import '../button/types.js';
|
|
14
|
+
import '../icon/types.js';
|
|
15
|
+
import '../tabs/types.js';
|
|
16
|
+
import '../../types/generic.js';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import '../../chunk-PZ5AY32C.js';
|
|
2
|
+
export { Drawer, DrawerDialog, DrawerTab, DrawerTabList } from './drawer.js';
|
|
3
|
+
export { drawerAnimationVars, drawerClassNames, drawerColorVars, drawerContainer, drawerDialogStateVars, drawerSpaceVars, drawerStateVars } from './drawer.css.js';
|
|
4
|
+
import './types.js';
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js","sourcesContent":[]}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { AriaOverlayProps } from '@react-aria/overlays';
|
|
2
|
+
import { OverlayTriggerProps, OverlayTriggerState } from '@react-stately/overlays';
|
|
3
|
+
import { AriaLabelingProps } from '@react-types/shared';
|
|
4
|
+
import { PropsWithChildren } from 'react';
|
|
5
|
+
import { PartialDeep } from 'type-fest';
|
|
6
|
+
import { OmitProtectedProps } from '../../types/props.js';
|
|
7
|
+
import { RenderPropsChildren } from '../../types/react-aria.js';
|
|
8
|
+
import { ButtonClassNames, ButtonProps } from '../button/types.js';
|
|
9
|
+
import { TabsProps, TabsClassNames, TabProps, TabRenderProps, TabListProps } from '../tabs/types.js';
|
|
10
|
+
import 'react-aria-components';
|
|
11
|
+
import '../icon/types.js';
|
|
12
|
+
import '../../types/generic.js';
|
|
13
|
+
|
|
14
|
+
type DrawerClassNames = PartialDeep<{
|
|
15
|
+
container: string;
|
|
16
|
+
tabs: TabsClassNames;
|
|
17
|
+
dialog: {
|
|
18
|
+
container: string;
|
|
19
|
+
dialog: string;
|
|
20
|
+
};
|
|
21
|
+
header: {
|
|
22
|
+
header: string;
|
|
23
|
+
back: ButtonClassNames;
|
|
24
|
+
title: string;
|
|
25
|
+
close: ButtonClassNames;
|
|
26
|
+
};
|
|
27
|
+
content: string;
|
|
28
|
+
footer: string;
|
|
29
|
+
}>;
|
|
30
|
+
type DrawerAnchor = 'left' | 'right';
|
|
31
|
+
type DrawerMapping = {
|
|
32
|
+
heading: {
|
|
33
|
+
child: string;
|
|
34
|
+
parent: string;
|
|
35
|
+
};
|
|
36
|
+
back: Partial<OmitProtectedProps<ButtonProps>>;
|
|
37
|
+
close: Partial<OmitProtectedProps<ButtonProps>>;
|
|
38
|
+
};
|
|
39
|
+
type DrawerRenderProps = OverlayTriggerState;
|
|
40
|
+
type DrawerTabRenderProps = TabRenderProps & {
|
|
41
|
+
isOpen: boolean;
|
|
42
|
+
};
|
|
43
|
+
type BaseProps = {
|
|
44
|
+
classNames?: DrawerClassNames;
|
|
45
|
+
};
|
|
46
|
+
type BaseDrawerProps = Pick<AriaOverlayProps, 'shouldCloseOnBlur' | 'isDismissable' | 'isKeyboardDismissDisabled'> & {
|
|
47
|
+
children?: RenderPropsChildren<DrawerRenderProps>;
|
|
48
|
+
/**
|
|
49
|
+
* Which side of the viewport to originate from
|
|
50
|
+
*/
|
|
51
|
+
anchor?: DrawerAnchor;
|
|
52
|
+
/**
|
|
53
|
+
* If true will push sibling DOM around, else act as an independent overlay
|
|
54
|
+
*
|
|
55
|
+
* NOTE: Layout shift animations are less performant
|
|
56
|
+
*/
|
|
57
|
+
layoutShift?: boolean;
|
|
58
|
+
};
|
|
59
|
+
type BaseDrawerTabProps = {
|
|
60
|
+
children?: RenderPropsChildren<DrawerTabRenderProps>;
|
|
61
|
+
};
|
|
62
|
+
type DrawerState = Pick<DrawerRenderProps, 'isOpen'> & Required<Pick<BaseDrawerProps, 'anchor' | 'layoutShift'>>;
|
|
63
|
+
type DrawerDialogState = {
|
|
64
|
+
/**
|
|
65
|
+
* If back button is present
|
|
66
|
+
*/
|
|
67
|
+
isChild: boolean;
|
|
68
|
+
};
|
|
69
|
+
type DrawerContextValue = DrawerRenderProps & Required<Pick<BaseDrawerProps, 'anchor' | 'layoutShift'>>;
|
|
70
|
+
type DrawerProps = OverlayTriggerProps & Omit<TabsProps, 'children' | 'classNames' | 'orientation'> & BaseProps & BaseDrawerProps;
|
|
71
|
+
type DrawerTabListProps<T> = Omit<TabListProps<T>, 'classNames' | 'align' | 'anchor' | 'orientation'> & BaseProps;
|
|
72
|
+
type DrawerTabProps = Omit<TabProps, 'children'> & BaseDrawerTabProps & BaseProps;
|
|
73
|
+
type DrawerDialogProps = PropsWithChildren<AriaLabelingProps & BaseProps & {
|
|
74
|
+
mapping?: DrawerMapping;
|
|
75
|
+
}>;
|
|
76
|
+
|
|
77
|
+
export type { BaseDrawerProps, BaseDrawerTabProps, DrawerAnchor, DrawerClassNames, DrawerContextValue, DrawerDialogProps, DrawerDialogState, DrawerMapping, DrawerProps, DrawerRenderProps, DrawerState, DrawerTabListProps, DrawerTabProps, DrawerTabRenderProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"types.js"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ContextValue } from 'react-aria-components';
|
|
3
|
+
import { ElementProps } from './types.js';
|
|
4
|
+
import '../../types/react-aria.js';
|
|
5
|
+
|
|
6
|
+
declare const ElementContext: react.Context<ContextValue<ElementProps<any, any, any, any, any, any, any, any, any, any, any>, HTMLElement>>;
|
|
7
|
+
/**
|
|
8
|
+
* This generic component serves as any easy way for more complex components
|
|
9
|
+
* to establish stylable content areas within their layout with optional
|
|
10
|
+
* targetted contexts for any subcomponents
|
|
11
|
+
*
|
|
12
|
+
* See Dialog & Drawer as examples
|
|
13
|
+
*/
|
|
14
|
+
declare const Element: <A, B, C, D, E, F, G, H, I, J, K>(props: ElementProps<A, B, C, D, E, F, G, H, I, J, K> & react.RefAttributes<HTMLElement>) => react.ReactElement | null;
|
|
15
|
+
|
|
16
|
+
export { Element, ElementContext };
|