@accelint/design-system 0.3.2 → 0.4.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 +11 -7
- 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 +304 -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 +288 -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 +62 -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 +89 -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 +488 -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 +27 -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 +55 -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 +257 -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 +84 -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 +90 -53
- package/dist/index.d.ts +113 -757
- package/dist/index.js +5 -5278
- 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 +6879 -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 +6 -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 +55 -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 +145 -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 +66 -5
- package/dist/vanilla.js +27 -1
- package/dist/vanilla.js.map +1 -1
- package/package.json +30 -21
- 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-Ibcop5d3.d.ts +0 -2627
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import '../../chunk-PZ5AY32C.js';
|
|
2
|
+
import { createContext, forwardRef, useMemo, useCallback } from 'react';
|
|
3
|
+
import { Provider, Popover, Collection, MenuStateContext, UNSTABLE_CollectionRendererContext, Menu as Menu$1, DEFAULT_SLOT, MenuItem as MenuItem$1 } from 'react-aria-components';
|
|
4
|
+
import { useContextProps, useDefaultProps, useTheme, useSlot } from '../../hooks/index.js';
|
|
5
|
+
import { bodies, headings } from '../../styles/index.js';
|
|
6
|
+
import { mergeClassNames, inlineVars, callRenderProps } from '../../utils/index.js';
|
|
7
|
+
import { AriaSectionContext, AriaHeaderContext, AriaSeparatorContext, AriaSection, AriaTextContext, AriaKeyboardContext, AriaText } from '../aria/index.js';
|
|
8
|
+
import { createCollectionRenderer } from '../collection/index.js';
|
|
9
|
+
import { IconContext } from '../icon/index.js';
|
|
10
|
+
import { menuClassNames, menuStateVars, menuItemStateVars } from './menu.css.js';
|
|
11
|
+
import { jsx } from 'react/jsx-runtime';
|
|
12
|
+
|
|
13
|
+
var defaultMapping = {
|
|
14
|
+
description: {
|
|
15
|
+
sm: bodies.xs,
|
|
16
|
+
lg: bodies.xs
|
|
17
|
+
},
|
|
18
|
+
header: {
|
|
19
|
+
sm: headings.v4,
|
|
20
|
+
lg: headings.v5
|
|
21
|
+
},
|
|
22
|
+
label: {
|
|
23
|
+
sm: bodies.sm,
|
|
24
|
+
lg: bodies.sm
|
|
25
|
+
},
|
|
26
|
+
shortcut: {
|
|
27
|
+
sm: bodies.xs,
|
|
28
|
+
lg: bodies.xs
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
var defaultSize = "lg";
|
|
32
|
+
var MenuContext = createContext(null);
|
|
33
|
+
var Menu = forwardRef(function Menu2(props, ref) {
|
|
34
|
+
[props, ref] = useContextProps(props, ref, MenuContext);
|
|
35
|
+
props = useDefaultProps(props, "Menu");
|
|
36
|
+
const {
|
|
37
|
+
children: childrenProp,
|
|
38
|
+
classNames: classNamesProp,
|
|
39
|
+
mapping: mappingProp,
|
|
40
|
+
size = defaultSize,
|
|
41
|
+
...rest
|
|
42
|
+
} = props;
|
|
43
|
+
const theme = useTheme();
|
|
44
|
+
const classNames = useMemo(
|
|
45
|
+
() => mergeClassNames(menuClassNames, classNamesProp, theme.Menu, {
|
|
46
|
+
menu: { container: theme.className }
|
|
47
|
+
// required to consume global theme within Popover
|
|
48
|
+
}),
|
|
49
|
+
[classNamesProp, theme.Menu, theme.className]
|
|
50
|
+
);
|
|
51
|
+
const mapping = useMemo(
|
|
52
|
+
() => ({
|
|
53
|
+
...defaultMapping,
|
|
54
|
+
...mappingProp
|
|
55
|
+
}),
|
|
56
|
+
[mappingProp]
|
|
57
|
+
);
|
|
58
|
+
const style = useCallback(
|
|
59
|
+
(renderProps) => ({
|
|
60
|
+
...theme.style,
|
|
61
|
+
// required to consume global styles within Popover
|
|
62
|
+
...inlineVars(menuStateVars, {
|
|
63
|
+
...renderProps,
|
|
64
|
+
size
|
|
65
|
+
})
|
|
66
|
+
}),
|
|
67
|
+
[theme.style, size]
|
|
68
|
+
);
|
|
69
|
+
const values = useMemo(
|
|
70
|
+
() => [[MenuListContext, { classNames, mapping, size }]],
|
|
71
|
+
[classNames, mapping, size]
|
|
72
|
+
);
|
|
73
|
+
const children = useCallback(
|
|
74
|
+
(renderProps) => /* @__PURE__ */ jsx(Provider, { values, children: /* @__PURE__ */ jsx("div", { className: classNames?.menu?.menu, children: callRenderProps(childrenProp, {
|
|
75
|
+
...renderProps,
|
|
76
|
+
size,
|
|
77
|
+
defaultChildren: null
|
|
78
|
+
}) }) }),
|
|
79
|
+
[childrenProp, classNames?.menu?.menu, size, values]
|
|
80
|
+
);
|
|
81
|
+
return /* @__PURE__ */ jsx(
|
|
82
|
+
Popover,
|
|
83
|
+
{
|
|
84
|
+
...rest,
|
|
85
|
+
ref,
|
|
86
|
+
className: classNames?.menu?.container,
|
|
87
|
+
style,
|
|
88
|
+
children
|
|
89
|
+
}
|
|
90
|
+
);
|
|
91
|
+
});
|
|
92
|
+
var MenuListContext = createContext(null);
|
|
93
|
+
var MenuList = forwardRef(function MenuList2(props, ref) {
|
|
94
|
+
[props, ref] = useContextProps(props, ref, MenuListContext);
|
|
95
|
+
props = useDefaultProps(props, "Menu");
|
|
96
|
+
const {
|
|
97
|
+
children: childrenProp,
|
|
98
|
+
classNames: classNamesProp,
|
|
99
|
+
items,
|
|
100
|
+
mapping: mappingProp,
|
|
101
|
+
selectionMode = "single",
|
|
102
|
+
size = defaultSize,
|
|
103
|
+
"aria-label": ariaLabel,
|
|
104
|
+
"aria-labelledby": ariaLabelledBy,
|
|
105
|
+
...rest
|
|
106
|
+
} = props;
|
|
107
|
+
const theme = useTheme();
|
|
108
|
+
const mapping = useMemo(
|
|
109
|
+
() => ({
|
|
110
|
+
...defaultMapping,
|
|
111
|
+
...mappingProp
|
|
112
|
+
}),
|
|
113
|
+
[mappingProp]
|
|
114
|
+
);
|
|
115
|
+
const classNames = useMemo(
|
|
116
|
+
() => mergeClassNames(menuClassNames, theme.Menu, classNamesProp, {
|
|
117
|
+
list: { header: mapping.header[size] }
|
|
118
|
+
}),
|
|
119
|
+
[theme.Menu, classNamesProp, mapping.header, size]
|
|
120
|
+
);
|
|
121
|
+
const values = useMemo(
|
|
122
|
+
() => [
|
|
123
|
+
[MenuItemContext, { classNames, mapping, size }],
|
|
124
|
+
[AriaSectionContext, { className: classNames?.list?.section }],
|
|
125
|
+
[AriaHeaderContext, { className: classNames?.list?.header }],
|
|
126
|
+
[AriaSeparatorContext, { className: classNames?.list?.separator }]
|
|
127
|
+
],
|
|
128
|
+
[classNames, mapping, size]
|
|
129
|
+
);
|
|
130
|
+
const children = useMemo(() => {
|
|
131
|
+
if (!(childrenProp || items)) {
|
|
132
|
+
return null;
|
|
133
|
+
}
|
|
134
|
+
return /* @__PURE__ */ jsx(AriaSection, { className: classNames?.list?.list, children: typeof childrenProp === "function" ? /* @__PURE__ */ jsx(Collection, { items, children: childrenProp }) : childrenProp });
|
|
135
|
+
}, [childrenProp, classNames?.list?.list, items]);
|
|
136
|
+
const renderer = useMemo(
|
|
137
|
+
() => createCollectionRenderer(MenuStateContext, values),
|
|
138
|
+
[values]
|
|
139
|
+
);
|
|
140
|
+
return /* @__PURE__ */ jsx(UNSTABLE_CollectionRendererContext.Provider, { value: renderer, children: /* @__PURE__ */ jsx(Provider, { values, children: /* @__PURE__ */ jsx(
|
|
141
|
+
Menu$1,
|
|
142
|
+
{
|
|
143
|
+
...rest,
|
|
144
|
+
ref,
|
|
145
|
+
className: classNames?.list?.container,
|
|
146
|
+
items,
|
|
147
|
+
selectionMode,
|
|
148
|
+
"aria-label": ariaLabel,
|
|
149
|
+
"aria-labelledby": ariaLabelledBy,
|
|
150
|
+
children
|
|
151
|
+
}
|
|
152
|
+
) }) });
|
|
153
|
+
});
|
|
154
|
+
var MenuItemContext = createContext(null);
|
|
155
|
+
var MenuItem = forwardRef(function MenuItem2(props, ref) {
|
|
156
|
+
[props, ref] = useContextProps(props, ref, MenuItemContext);
|
|
157
|
+
props = useDefaultProps(props, "MenuItem");
|
|
158
|
+
const {
|
|
159
|
+
id,
|
|
160
|
+
children: childrenProp,
|
|
161
|
+
classNames: classNamesProp,
|
|
162
|
+
mapping: mappingProp,
|
|
163
|
+
size = defaultSize,
|
|
164
|
+
textValue = typeof childrenProp === "string" ? childrenProp : void 0,
|
|
165
|
+
...rest
|
|
166
|
+
} = props;
|
|
167
|
+
const theme = useTheme();
|
|
168
|
+
const mapping = useMemo(
|
|
169
|
+
() => ({
|
|
170
|
+
...defaultMapping,
|
|
171
|
+
...mappingProp
|
|
172
|
+
}),
|
|
173
|
+
[mappingProp]
|
|
174
|
+
);
|
|
175
|
+
const classNames = useMemo(
|
|
176
|
+
() => mergeClassNames(menuClassNames, classNamesProp, theme.Menu, {
|
|
177
|
+
item: {
|
|
178
|
+
description: mapping.description[size],
|
|
179
|
+
label: mapping.label[size],
|
|
180
|
+
shortcut: mapping.shortcut[size]
|
|
181
|
+
}
|
|
182
|
+
}),
|
|
183
|
+
[theme.Menu, classNamesProp, mapping, size]
|
|
184
|
+
);
|
|
185
|
+
const [descriptionRef, hasDescription] = useSlot();
|
|
186
|
+
const style = useCallback(
|
|
187
|
+
(renderProps) => inlineVars(menuItemStateVars, { ...renderProps, size, hasDescription }),
|
|
188
|
+
[hasDescription, size]
|
|
189
|
+
);
|
|
190
|
+
const values = useMemo(
|
|
191
|
+
() => [
|
|
192
|
+
[
|
|
193
|
+
AriaTextContext,
|
|
194
|
+
{
|
|
195
|
+
slots: {
|
|
196
|
+
[DEFAULT_SLOT]: {},
|
|
197
|
+
label: { className: classNames?.item?.label },
|
|
198
|
+
description: {
|
|
199
|
+
ref: descriptionRef,
|
|
200
|
+
className: classNames?.item?.description
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
],
|
|
205
|
+
[
|
|
206
|
+
IconContext,
|
|
207
|
+
{
|
|
208
|
+
slots: {
|
|
209
|
+
[DEFAULT_SLOT]: { classNames: classNames?.item?.icon },
|
|
210
|
+
more: { classNames: classNames?.item?.more }
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
],
|
|
214
|
+
[AriaKeyboardContext, { className: classNames?.item?.shortcut }]
|
|
215
|
+
],
|
|
216
|
+
[
|
|
217
|
+
classNames?.item?.label,
|
|
218
|
+
descriptionRef,
|
|
219
|
+
classNames?.item?.description,
|
|
220
|
+
classNames?.item?.icon,
|
|
221
|
+
classNames?.item?.more,
|
|
222
|
+
classNames?.item?.shortcut
|
|
223
|
+
]
|
|
224
|
+
);
|
|
225
|
+
const children = useCallback(
|
|
226
|
+
(renderProps) => {
|
|
227
|
+
const content = callRenderProps(childrenProp, {
|
|
228
|
+
...renderProps,
|
|
229
|
+
size,
|
|
230
|
+
defaultChildren: null
|
|
231
|
+
});
|
|
232
|
+
return /* @__PURE__ */ jsx(Provider, { values, children: /* @__PURE__ */ jsx("div", { className: classNames?.item?.item, children: typeof content === "string" ? /* @__PURE__ */ jsx(AriaText, { slot: "label", children: content }) : content }) });
|
|
233
|
+
},
|
|
234
|
+
[childrenProp, classNames?.item?.item, size, values]
|
|
235
|
+
);
|
|
236
|
+
return /* @__PURE__ */ jsx(
|
|
237
|
+
MenuItem$1,
|
|
238
|
+
{
|
|
239
|
+
...rest,
|
|
240
|
+
id: id ?? textValue,
|
|
241
|
+
ref,
|
|
242
|
+
className: classNames?.item?.container,
|
|
243
|
+
style,
|
|
244
|
+
textValue,
|
|
245
|
+
children
|
|
246
|
+
}
|
|
247
|
+
);
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
export { Menu, MenuContext, MenuItem, MenuItemContext, MenuList, MenuListContext };
|
|
251
|
+
//# sourceMappingURL=menu.js.map
|
|
252
|
+
//# sourceMappingURL=menu.js.map
|
|
@@ -0,0 +1 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A;AAAA,QACA,eAAiB,EAAA;AAAA,OAClB,CAAA;AAED,MAAA,2BACG,QAAS,EAAA,EAAA,MAAA,EACR,8BAAC,KAAI,EAAA,EAAA,SAAA,EAAW,YAAY,IAAM,EAAA,IAAA,EAC/B,iBAAO,OAAY,KAAA,QAAA,uBACjB,QAAS,EAAA,EAAA,IAAA,EAAK,SAAS,QAAQ,EAAA,OAAA,EAAA,CAAA,GAEhC,SAEJ,CACF,EAAA,CAAA;AAAA,KAEJ;AAAA,IACA,CAAC,YAAc,EAAA,UAAA,EAAY,IAAM,EAAA,IAAA,EAAM,MAAM,MAAM;AAAA,GACrD;AAEA,EACE,uBAAA,GAAA;AAAA,IAACC,UAAA;AAAA,IAAA;AAAA,MACE,GAAG,IAAA;AAAA,MACJ,IAAI,EAAM,IAAA,SAAA;AAAA,MACV,GAAA;AAAA,MACA,SAAA,EAAW,YAAY,IAAM,EAAA,SAAA;AAAA,MAC7B,KAAA;AAAA,MACA,SAAA;AAAA,MAEC;AAAA;AAAA,GACH;AAEJ,CAAC","file":"menu.js","sourcesContent":["import {\n createContext,\n forwardRef,\n useCallback,\n useMemo,\n type ForwardedRef,\n type HTMLAttributes,\n} from 'react';\nimport {\n Collection,\n DEFAULT_SLOT,\n MenuStateContext,\n Popover,\n Provider,\n Menu as RACMenu,\n MenuItem as RACMenuItem,\n UNSTABLE_CollectionRendererContext,\n type CollectionRenderer,\n type ContextValue,\n type PopoverRenderProps,\n type MenuItemRenderProps as RACMenuItemRenderProps,\n type SectionProps,\n type SeparatorProps,\n type TextProps,\n} from 'react-aria-components';\nimport {\n useContextProps,\n useDefaultProps,\n useSlot,\n useTheme,\n} from '../../hooks';\nimport { bodies, headings } from '../../styles';\nimport { callRenderProps, inlineVars, mergeClassNames } from '../../utils';\nimport {\n AriaHeaderContext,\n AriaKeyboardContext,\n AriaSection,\n AriaSectionContext,\n AriaSeparatorContext,\n AriaText,\n AriaTextContext,\n} from '../aria';\nimport { createCollectionRenderer } from '../collection';\nimport { IconContext, type IconProps } from '../icon';\nimport { menuClassNames, menuItemStateVars, menuStateVars } from './menu.css';\nimport type {\n MenuItemProps,\n MenuListProps,\n MenuMapping,\n MenuProps,\n} from './types';\n\nconst defaultMapping: MenuMapping = {\n description: {\n sm: bodies.xs,\n lg: bodies.xs,\n },\n header: {\n sm: headings.v4,\n lg: headings.v5,\n },\n label: {\n sm: bodies.sm,\n lg: bodies.sm,\n },\n shortcut: {\n sm: bodies.xs,\n lg: bodies.xs,\n },\n};\n\nconst defaultSize = 'lg';\n\nexport const MenuContext =\n createContext<ContextValue<MenuProps, HTMLElement>>(null);\n\n/**\n * Menu component that supports display and selection of menu items via a trigger (right-click or click)\n * Customization of React Aria's Menu and Menu Item components https://react-spectrum.adobe.com/react-aria/Menu.html\n */\nexport const Menu = forwardRef(function Menu(\n props: MenuProps,\n ref: ForwardedRef<HTMLElement>,\n) {\n [props, ref] = useContextProps(props, ref, MenuContext);\n props = useDefaultProps(props, 'Menu');\n\n const {\n children: childrenProp,\n classNames: classNamesProp,\n mapping: mappingProp,\n size = defaultSize,\n ...rest\n } = props;\n\n const theme = useTheme();\n\n const classNames = useMemo(\n () =>\n mergeClassNames(menuClassNames, classNamesProp, theme.Menu, {\n menu: { container: theme.className }, // required to consume global theme within Popover\n }),\n [classNamesProp, theme.Menu, theme.className],\n );\n\n const mapping = useMemo(\n () => ({\n ...defaultMapping,\n ...mappingProp,\n }),\n [mappingProp],\n );\n\n const style = useCallback(\n (renderProps: PopoverRenderProps) => ({\n ...theme.style, // required to consume global styles within Popover\n ...inlineVars(menuStateVars, {\n ...renderProps,\n size,\n }),\n }),\n [theme.style, size],\n );\n\n const values = useMemo<\n [\n [\n typeof MenuListContext,\n ContextValue<MenuListProps<unknown>, HTMLDivElement>,\n ],\n ]\n >(\n () => [[MenuListContext, { classNames, mapping, size }]],\n [classNames, mapping, size],\n );\n\n const children = useCallback(\n (renderProps: PopoverRenderProps) => (\n <Provider values={values}>\n <div className={classNames?.menu?.menu}>\n {callRenderProps(childrenProp, {\n ...renderProps,\n size,\n defaultChildren: null,\n })}\n </div>\n </Provider>\n ),\n [childrenProp, classNames?.menu?.menu, size, values],\n );\n\n return (\n <Popover\n {...rest}\n ref={ref}\n className={classNames?.menu?.container}\n style={style}\n >\n {children}\n </Popover>\n );\n});\n\nexport const MenuListContext =\n createContext<ContextValue<MenuListProps<unknown>, HTMLDivElement>>(null);\n\ntype MenuListContexts = [\n [\n typeof MenuItemContext,\n ContextValue<MenuItemProps<unknown>, HTMLDivElement>,\n ],\n [typeof AriaSectionContext, ContextValue<SectionProps<object>, HTMLElement>],\n [\n typeof AriaHeaderContext,\n ContextValue<HTMLAttributes<HTMLElement>, HTMLElement>,\n ],\n [typeof AriaSeparatorContext, ContextValue<SeparatorProps, HTMLElement>],\n];\n\nexport const MenuList = forwardRef(function MenuList<T extends object>(\n props: MenuListProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n [props, ref] = useContextProps(props, ref, MenuListContext);\n props = useDefaultProps(props, 'Menu');\n\n const {\n children: childrenProp,\n classNames: classNamesProp,\n items,\n mapping: mappingProp,\n selectionMode = 'single',\n size = defaultSize,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n ...rest\n } = props;\n\n const theme = useTheme();\n\n const mapping = useMemo(\n () => ({\n ...defaultMapping,\n ...mappingProp,\n }),\n [mappingProp],\n );\n\n const classNames = useMemo(\n () =>\n mergeClassNames(menuClassNames, theme.Menu, classNamesProp, {\n list: { header: mapping.header[size] },\n }),\n [theme.Menu, classNamesProp, mapping.header, size],\n );\n\n const values = useMemo<MenuListContexts>(\n () => [\n [MenuItemContext, { classNames, mapping, size }],\n [AriaSectionContext, { className: classNames?.list?.section }],\n [AriaHeaderContext, { className: classNames?.list?.header }],\n [AriaSeparatorContext, { className: classNames?.list?.separator }],\n ],\n [classNames, mapping, size],\n );\n\n const children = useMemo(() => {\n if (!(childrenProp || items)) {\n return null;\n }\n\n return (\n <AriaSection className={classNames?.list?.list}>\n {typeof childrenProp === 'function' ? (\n <Collection items={items}>{childrenProp}</Collection>\n ) : (\n childrenProp\n )}\n </AriaSection>\n );\n }, [childrenProp, classNames?.list?.list, items]);\n\n const renderer = useMemo<CollectionRenderer>(\n () => createCollectionRenderer(MenuStateContext, values),\n [values],\n );\n\n return (\n <UNSTABLE_CollectionRendererContext.Provider value={renderer}>\n <Provider values={values}>\n <RACMenu<T>\n {...rest}\n ref={ref}\n className={classNames?.list?.container}\n items={items}\n selectionMode={selectionMode}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n >\n {children}\n </RACMenu>\n </Provider>\n </UNSTABLE_CollectionRendererContext.Provider>\n );\n});\n\nexport const MenuItemContext =\n createContext<ContextValue<MenuItemProps<unknown>, HTMLDivElement>>(null);\n\nexport const MenuItem = forwardRef(function MenuItem<T extends object>(\n props: MenuItemProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n [props, ref] = useContextProps(props, ref, MenuItemContext);\n props = useDefaultProps(props, 'MenuItem');\n\n const {\n id,\n children: childrenProp,\n classNames: classNamesProp,\n mapping: mappingProp,\n size = defaultSize,\n textValue = typeof childrenProp === 'string' ? childrenProp : undefined,\n ...rest\n } = props;\n\n const theme = useTheme();\n\n const mapping = useMemo(\n () => ({\n ...defaultMapping,\n ...mappingProp,\n }),\n [mappingProp],\n );\n\n const classNames = useMemo(\n () =>\n mergeClassNames(menuClassNames, classNamesProp, theme.Menu, {\n item: {\n description: mapping.description[size],\n label: mapping.label[size],\n shortcut: mapping.shortcut[size],\n },\n }),\n [theme.Menu, classNamesProp, mapping, size],\n );\n\n const [descriptionRef, hasDescription] = useSlot();\n\n const style = useCallback(\n (renderProps: RACMenuItemRenderProps) =>\n inlineVars(menuItemStateVars, { ...renderProps, size, hasDescription }),\n [hasDescription, size],\n );\n\n const values = useMemo<\n [\n [typeof AriaTextContext, ContextValue<TextProps, HTMLElement>],\n [typeof IconContext, ContextValue<IconProps, HTMLDivElement>],\n [\n typeof AriaKeyboardContext,\n ContextValue<HTMLAttributes<HTMLElement>, HTMLElement>,\n ],\n ]\n >(\n () => [\n [\n AriaTextContext,\n {\n slots: {\n [DEFAULT_SLOT]: {},\n label: { className: classNames?.item?.label },\n description: {\n ref: descriptionRef,\n className: classNames?.item?.description,\n },\n },\n },\n ],\n [\n IconContext,\n {\n slots: {\n [DEFAULT_SLOT]: { classNames: classNames?.item?.icon },\n more: { classNames: classNames?.item?.more },\n },\n },\n ],\n [AriaKeyboardContext, { className: classNames?.item?.shortcut }],\n ],\n [\n classNames?.item?.label,\n descriptionRef,\n classNames?.item?.description,\n classNames?.item?.icon,\n classNames?.item?.more,\n classNames?.item?.shortcut,\n ],\n );\n\n const children = useCallback(\n (renderProps: RACMenuItemRenderProps) => {\n const content = callRenderProps(childrenProp, {\n ...renderProps,\n size,\n defaultChildren: null,\n });\n\n return (\n <Provider values={values}>\n <div className={classNames?.item?.item}>\n {typeof content === 'string' ? (\n <AriaText slot='label'>{content}</AriaText>\n ) : (\n content\n )}\n </div>\n </Provider>\n );\n },\n [childrenProp, classNames?.item?.item, size, values],\n );\n\n return (\n <RACMenuItem<T>\n {...rest}\n id={id ?? textValue}\n ref={ref as ForwardedRef<T>}\n className={classNames?.item?.container}\n style={style}\n textValue={textValue}\n >\n {children}\n </RACMenuItem>\n );\n});\n"]}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { AsType } from '../../types/generic.js';
|
|
2
|
+
import { PopoverProps, MenuProps as MenuProps$1, MenuItemProps as MenuItemProps$1, PopoverRenderProps, MenuItemRenderProps as MenuItemRenderProps$1 } from 'react-aria-components';
|
|
3
|
+
import { PartialDeep } from 'type-fest';
|
|
4
|
+
import { IconClassNames } from '../icon/types.js';
|
|
5
|
+
import 'react';
|
|
6
|
+
|
|
7
|
+
type MenuClassNames = PartialDeep<{
|
|
8
|
+
menu: {
|
|
9
|
+
container: string;
|
|
10
|
+
menu: string;
|
|
11
|
+
};
|
|
12
|
+
list: {
|
|
13
|
+
container: string;
|
|
14
|
+
list: string;
|
|
15
|
+
section: string;
|
|
16
|
+
header: string;
|
|
17
|
+
separator: string;
|
|
18
|
+
};
|
|
19
|
+
item: {
|
|
20
|
+
container: string;
|
|
21
|
+
item: string;
|
|
22
|
+
icon: IconClassNames;
|
|
23
|
+
label: string;
|
|
24
|
+
description: string;
|
|
25
|
+
more: IconClassNames;
|
|
26
|
+
shortcut: string;
|
|
27
|
+
};
|
|
28
|
+
}>;
|
|
29
|
+
type MenuSizes = 'sm' | 'lg';
|
|
30
|
+
type MenuMapping = {
|
|
31
|
+
description: Partial<Record<MenuSizes, string>>;
|
|
32
|
+
header: Partial<Record<MenuSizes, string>>;
|
|
33
|
+
label: Partial<Record<MenuSizes, string>>;
|
|
34
|
+
shortcut: Partial<Record<MenuSizes, string>>;
|
|
35
|
+
};
|
|
36
|
+
type BaseMenuProps = {
|
|
37
|
+
classNames?: MenuClassNames;
|
|
38
|
+
mapping?: Partial<MenuMapping>;
|
|
39
|
+
size?: MenuSizes;
|
|
40
|
+
};
|
|
41
|
+
type MenuProps = Omit<PopoverProps, 'className' | 'style'> & BaseMenuProps;
|
|
42
|
+
type MenuListProps<T> = Omit<MenuProps$1<T>, 'className' | 'style'> & BaseMenuProps;
|
|
43
|
+
type MenuItemProps<T> = Omit<MenuItemProps$1<T>, 'className' | 'style'> & BaseMenuProps;
|
|
44
|
+
type MenuRenderProps = AsType<PopoverRenderProps> & Required<Pick<BaseMenuProps, 'size'>>;
|
|
45
|
+
type MenuItemRenderProps = AsType<MenuItemRenderProps$1> & Required<Pick<BaseMenuProps, 'size'>>;
|
|
46
|
+
type MenuState = Omit<MenuRenderProps, 'trigger'>;
|
|
47
|
+
type MenuItemState = Omit<MenuItemRenderProps, 'allowsDragging' | 'isDragging' | 'isDropTarget'> & {
|
|
48
|
+
hasDescription: boolean;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export type { MenuClassNames, MenuItemProps, MenuItemRenderProps, MenuItemState, MenuListProps, MenuMapping, MenuProps, MenuRenderProps, MenuSizes, MenuState };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"types.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js","sourcesContent":[]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { MergeProviderProps } from './types.js';
|
|
3
|
+
import 'react';
|
|
4
|
+
import '../../types/react-aria.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Merges provided contexts with parent contexts, if available and of the same structure
|
|
8
|
+
* If parent context doesn't exist or differs in structure (slotted vs non-slotted) from
|
|
9
|
+
* the context being provided, the provided context will override the parent context
|
|
10
|
+
*
|
|
11
|
+
* This is typically used in conjunction with React Aria Component's contexts, where a
|
|
12
|
+
* RAC may provide a slotted context (ex: ButtonContext, with a slot of "remove") where
|
|
13
|
+
* that slot has a number of attributes and event listeners, but we want to merge in our
|
|
14
|
+
* own to supplement things for stylistic or additional functionality purposes
|
|
15
|
+
*
|
|
16
|
+
* See tests for examples
|
|
17
|
+
*/
|
|
18
|
+
declare function MergeProvider<A, B, C, D, E, F, G, H, I, J, K>({ values, children, }: MergeProviderProps<A, B, C, D, E, F, G, H, I, J, K>): react_jsx_runtime.JSX.Element;
|
|
19
|
+
|
|
20
|
+
export { MergeProvider };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import '../../chunk-PZ5AY32C.js';
|
|
2
|
+
import { mergeProps } from '../../utils/index.js';
|
|
3
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
function merge(context, next, children) {
|
|
6
|
+
return function Consumer(prev) {
|
|
7
|
+
let merged = next;
|
|
8
|
+
if (prev != null && next != null && typeof prev === "object" && typeof next === "object") {
|
|
9
|
+
const prevSlots = "slots" in prev && prev.slots;
|
|
10
|
+
const nextSlots = "slots" in next && next.slots;
|
|
11
|
+
if (prevSlots && nextSlots) {
|
|
12
|
+
merged = {
|
|
13
|
+
...prev,
|
|
14
|
+
...next,
|
|
15
|
+
slots: {
|
|
16
|
+
...prevSlots,
|
|
17
|
+
...nextSlots,
|
|
18
|
+
...Reflect.ownKeys(nextSlots).reduce((acc, key) => {
|
|
19
|
+
const value = nextSlots[key];
|
|
20
|
+
if (Object.hasOwn(prevSlots, key)) {
|
|
21
|
+
acc[key] = mergeProps(prevSlots[key], value);
|
|
22
|
+
}
|
|
23
|
+
return acc;
|
|
24
|
+
}, {})
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
} else if (!prevSlots && !nextSlots) {
|
|
28
|
+
merged = mergeProps(prev, next);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return /* @__PURE__ */ jsx(context.Provider, { value: merged, children });
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function MergeProvider({
|
|
35
|
+
values,
|
|
36
|
+
children
|
|
37
|
+
}) {
|
|
38
|
+
for (let [context, next] of values) {
|
|
39
|
+
children = /* @__PURE__ */ jsx(context.Consumer, { children: merge(context, next, children) });
|
|
40
|
+
}
|
|
41
|
+
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export { MergeProvider };
|
|
45
|
+
//# sourceMappingURL=merge-provider.js.map
|
|
46
|
+
//# sourceMappingURL=merge-provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/merge-provider/merge-provider.tsx"],"names":[],"mappings":";;;;AAIA,SAAS,KAAA,CAAS,OAAqB,EAAA,IAAA,EAAS,QAAqB,EAAA;AACnE,EAAO,OAAA,SAAS,SAAS,IAAS,EAAA;AAChC,IAAA,IAAI,MAAS,GAAA,IAAA;AAEb,IACE,IAAA,IAAA,IAAQ,QACR,IAAQ,IAAA,IAAA,IACR,OAAO,IAAS,KAAA,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AAA;AAIJ,EAAA,uCAAU,QAAS,EAAA,CAAA;AACrB","file":"merge-provider.js","sourcesContent":["import type { Context, ReactNode } from 'react';\nimport { mergeProps } from '../../utils';\nimport type { MergeProviderProps } from './types';\n\nfunction merge<T>(context: Context<T>, next: T, children: ReactNode) {\n return function Consumer(prev: T) {\n let merged = next;\n\n if (\n prev != null &&\n next != null &&\n typeof prev === 'object' &&\n typeof next === 'object'\n ) {\n const prevSlots =\n 'slots' in prev && (prev.slots as Record<string | symbol, object>);\n\n const nextSlots =\n 'slots' in next && (next.slots as Record<string | symbol, object>);\n\n if (prevSlots && nextSlots) {\n merged = {\n ...prev,\n ...next,\n slots: {\n ...prevSlots,\n ...nextSlots,\n ...Reflect.ownKeys(nextSlots).reduce<\n Record<string | symbol, object>\n >((acc, key) => {\n const value = nextSlots[key];\n\n if (Object.hasOwn(prevSlots, key)) {\n acc[key] = mergeProps(prevSlots[key], value);\n }\n\n return acc;\n }, {}),\n },\n } as T;\n } else if (!prevSlots && !nextSlots) {\n merged = mergeProps(prev as object, next as object) as T;\n }\n }\n\n return <context.Provider value={merged}>{children}</context.Provider>;\n };\n}\n\n/**\n * Merges provided contexts with parent contexts, if available and of the same structure\n * If parent context doesn't exist or differs in structure (slotted vs non-slotted) from\n * the context being provided, the provided context will override the parent context\n *\n * This is typically used in conjunction with React Aria Component's contexts, where a\n * RAC may provide a slotted context (ex: ButtonContext, with a slot of \"remove\") where\n * that slot has a number of attributes and event listeners, but we want to merge in our\n * own to supplement things for stylistic or additional functionality purposes\n *\n * See tests for examples\n */\nexport function MergeProvider<A, B, C, D, E, F, G, H, I, J, K>({\n values,\n children,\n}: MergeProviderProps<A, B, C, D, E, F, G, H, I, J, K>) {\n for (let [context, next] of values) {\n children = (\n <context.Consumer>\n {merge(context as Context<typeof next>, next, children)}\n </context.Consumer>\n );\n }\n\n return <>{children}</>;\n}\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { ProviderValues } from '../../types/react-aria.js';
|
|
3
|
+
|
|
4
|
+
type MergeProviderProps<A = any, B = any, C = any, D = any, E = any, F = any, G = any, H = any, I = any, J = any, K = any> = PropsWithChildren<{
|
|
5
|
+
values: ProviderValues<A, B, C, D, E, F, G, H, I, J, K>;
|
|
6
|
+
}>;
|
|
7
|
+
|
|
8
|
+
export type { MergeProviderProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"types.js"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { NumberField, NumberFieldContext } from './number-field.js';
|
|
2
|
+
export { numberFieldClassNames, numberFieldColorVars, numberFieldContainer, numberFieldSpaceVars, numberFieldStateVars } from './number-field.css.js';
|
|
3
|
+
export { NumberFieldClassNames, NumberFieldMapping, NumberFieldProps, NumberFieldSizes, NumberFieldState } from './types.js';
|
|
4
|
+
import 'react-aria-components';
|
|
5
|
+
import 'react';
|
|
6
|
+
import 'type-fest';
|
|
7
|
+
import '../button/types.js';
|
|
8
|
+
import '../../types/props.js';
|
|
9
|
+
import '../../types/react-aria.js';
|
|
10
|
+
import '../icon/types.js';
|
|
11
|
+
import '../input/types.js';
|
|
12
|
+
import '../../types/generic.js';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import '../../chunk-PZ5AY32C.js';
|
|
2
|
+
export { NumberField, NumberFieldContext } from './number-field.js';
|
|
3
|
+
export { numberFieldClassNames, numberFieldColorVars, numberFieldContainer, numberFieldSpaceVars, numberFieldStateVars } from './number-field.css.js';
|
|
4
|
+
//# sourceMappingURL=index.js.map
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js","sourcesContent":[]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { NumberFieldClassNames } from './types.js';
|
|
2
|
+
import 'react-aria-components';
|
|
3
|
+
import 'type-fest';
|
|
4
|
+
import '../button/types.js';
|
|
5
|
+
import '../../types/props.js';
|
|
6
|
+
import '../../types/react-aria.js';
|
|
7
|
+
import 'react';
|
|
8
|
+
import '../icon/types.js';
|
|
9
|
+
import '../input/types.js';
|
|
10
|
+
import '../../types/generic.js';
|
|
11
|
+
|
|
12
|
+
declare const numberFieldContainer: string;
|
|
13
|
+
declare const numberFieldColorVars: {
|
|
14
|
+
description: {
|
|
15
|
+
color: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
16
|
+
};
|
|
17
|
+
error: {
|
|
18
|
+
color: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
declare const numberFieldSpaceVars: {
|
|
22
|
+
group: {
|
|
23
|
+
gap: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
24
|
+
x: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
25
|
+
y: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
26
|
+
};
|
|
27
|
+
numberField: {
|
|
28
|
+
gap: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
declare const numberFieldStateVars: {
|
|
32
|
+
size: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
33
|
+
isDisabled: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
34
|
+
isInvalid: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
35
|
+
isReadOnly: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
36
|
+
isRequired: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
|
|
37
|
+
};
|
|
38
|
+
declare const numberFieldClassNames: NumberFieldClassNames;
|
|
39
|
+
|
|
40
|
+
export { numberFieldClassNames, numberFieldColorVars, numberFieldContainer, numberFieldSpaceVars, numberFieldStateVars };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import '../../chunk-PZ5AY32C.js';
|
|
2
|
+
|
|
3
|
+
// src/components/number-field/number-field.css.ts
|
|
4
|
+
var numberFieldClassNames = { container: "number-field_numberFieldClassNames_container__15l4s2dc", numberField: "number-field_numberFieldClassNames_numberField__15l4s2dd", description: "number-field_numberFieldClassNames_description__15l4s2de", error: "number-field_numberFieldClassNames_error__15l4s2df", group: "number-field_numberFieldClassNames_group__15l4s2dg", label: "typography_label__j8fgabg" };
|
|
5
|
+
var numberFieldColorVars = { description: { color: "var(--description-color__15l4s2d1)" }, error: { color: "var(--error-color__15l4s2d2)" } };
|
|
6
|
+
var numberFieldContainer = "number-field_numberFieldContainer__15l4s2d0";
|
|
7
|
+
var numberFieldSpaceVars = { group: { gap: "var(--group-gap__15l4s2d3)", x: "var(--group-x__15l4s2d4)", y: "var(--group-y__15l4s2d5)" }, numberField: { gap: "var(--numberField-gap__15l4s2d6)" } };
|
|
8
|
+
var numberFieldStateVars = { size: "var(--size__15l4s2d7)", isDisabled: "var(--isDisabled__15l4s2d8)", isInvalid: "var(--isInvalid__15l4s2d9)", isReadOnly: "var(--isReadOnly__15l4s2da)", isRequired: "var(--isRequired__15l4s2db)" };
|
|
9
|
+
|
|
10
|
+
export { numberFieldClassNames, numberFieldColorVars, numberFieldContainer, numberFieldSpaceVars, numberFieldStateVars };
|
|
11
|
+
//# sourceMappingURL=number-field.css.js.map
|
|
12
|
+
//# sourceMappingURL=number-field.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/number-field/number-field.css.ts"],"names":[],"mappings":";;;AAAO,IAAI,qBAAwB,GAAA,EAAC,SAAU,EAAA,wDAAA,EAAyD,WAAY,EAAA,0DAAA,EAA2D,WAAY,EAAA,0DAAA,EAA2D,KAAM,EAAA,oDAAA,EAAqD,KAAM,EAAA,oDAAA,EAAqD,OAAM,2BAA2B;AACjY,IAAA,oBAAA,GAAuB,EAAC,WAAA,EAAY,EAAC,KAAA,EAAM,oCAAoC,EAAA,EAAE,KAAM,EAAA,EAAC,KAAM,EAAA,8BAAA,EAA+B;AACjI,IAAI,oBAAuB,GAAA;AAC3B,IAAI,oBAAuB,GAAA,EAAC,KAAM,EAAA,EAAC,KAAI,4BAA6B,EAAA,CAAA,EAAE,0BAA2B,EAAA,CAAA,EAAE,4BAA4B,EAAA,WAAA,EAAY,EAAC,GAAA,EAAI,oCAAmC;AAC/K,IAAA,oBAAA,GAAuB,EAAC,IAAA,EAAK,uBAAwB,EAAA,UAAA,EAAW,6BAA8B,EAAA,SAAA,EAAU,4BAA6B,EAAA,UAAA,EAAW,6BAA8B,EAAA,UAAA,EAAW,6BAA6B","file":"number-field.css.js","sourcesContent":["export var numberFieldClassNames = {container:'number-field_numberFieldClassNames_container__15l4s2dc',numberField:'number-field_numberFieldClassNames_numberField__15l4s2dd',description:'number-field_numberFieldClassNames_description__15l4s2de',error:'number-field_numberFieldClassNames_error__15l4s2df',group:'number-field_numberFieldClassNames_group__15l4s2dg',label:'typography_label__j8fgabg'};\nexport var numberFieldColorVars = {description:{color:'var(--description-color__15l4s2d1)'},error:{color:'var(--error-color__15l4s2d2)'}};\nexport var numberFieldContainer = 'number-field_numberFieldContainer__15l4s2d0';\nexport var numberFieldSpaceVars = {group:{gap:'var(--group-gap__15l4s2d3)',x:'var(--group-x__15l4s2d4)',y:'var(--group-y__15l4s2d5)'},numberField:{gap:'var(--numberField-gap__15l4s2d6)'}};\nexport var numberFieldStateVars = {size:'var(--size__15l4s2d7)',isDisabled:'var(--isDisabled__15l4s2d8)',isInvalid:'var(--isInvalid__15l4s2d9)',isReadOnly:'var(--isReadOnly__15l4s2da)',isRequired:'var(--isRequired__15l4s2db)'};"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { NumberFieldProps, NumberFieldClassNames, NumberFieldMapping, NumberFieldSizes } from './types.js';
|
|
2
|
+
import * as react_aria_components from 'react-aria-components';
|
|
3
|
+
import { ContextValue } from 'react-aria-components';
|
|
4
|
+
import * as react from 'react';
|
|
5
|
+
import 'type-fest';
|
|
6
|
+
import '../button/types.js';
|
|
7
|
+
import '../../types/props.js';
|
|
8
|
+
import '../../types/react-aria.js';
|
|
9
|
+
import '../icon/types.js';
|
|
10
|
+
import '../input/types.js';
|
|
11
|
+
import '../../types/generic.js';
|
|
12
|
+
|
|
13
|
+
declare const NumberFieldContext: react.Context<ContextValue<NumberFieldProps, HTMLDivElement>>;
|
|
14
|
+
declare const NumberField: (props: Omit<react_aria_components.NumberFieldProps, "className" | "style"> & {
|
|
15
|
+
classNames?: NumberFieldClassNames;
|
|
16
|
+
mapping?: Partial<NumberFieldMapping>;
|
|
17
|
+
size?: NumberFieldSizes;
|
|
18
|
+
} & react.RefAttributes<HTMLDivElement>) => react.ReactElement | null;
|
|
19
|
+
|
|
20
|
+
export { NumberField, NumberFieldContext };
|