@boxcustodia/library 2.0.0-alpha.17 → 2.0.0-alpha.19
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/dist/components/accordion/accordion.cjs.js +2 -0
- package/dist/components/accordion/accordion.es.js +118 -0
- package/dist/components/alert/alert.cjs.js +2 -0
- package/dist/components/alert/alert.es.js +99 -0
- package/dist/components/alert-dialog/alert-dialog.cjs.js +2 -0
- package/dist/components/alert-dialog/alert-dialog.es.js +221 -0
- package/dist/components/auto-complete/auto-complete.cjs.js +2 -0
- package/dist/components/auto-complete/auto-complete.es.js +344 -0
- package/dist/components/avatar/avatar.cjs.js +2 -0
- package/dist/components/avatar/avatar.es.js +147 -0
- package/dist/components/button/button.cjs.js +2 -0
- package/dist/components/button/button.es.js +57 -0
- package/dist/components/button/components/base-button.cjs.js +2 -0
- package/dist/components/button/components/base-button.es.js +46 -0
- package/dist/components/calendar/calendar.cjs.js +2 -0
- package/dist/components/calendar/calendar.es.js +138 -0
- package/dist/components/card/card.cjs.js +2 -0
- package/dist/components/card/card.es.js +142 -0
- package/dist/components/center/center.cjs.js +2 -0
- package/dist/components/center/center.es.js +23 -0
- package/dist/components/checkbox/checkbox.cjs.js +2 -0
- package/dist/components/checkbox/checkbox.es.js +229 -0
- package/dist/components/checkbox-group/checkbox-group.cjs.js +2 -0
- package/dist/components/checkbox-group/checkbox-group.es.js +59 -0
- package/dist/components/combobox/combobox.cjs.js +2 -0
- package/dist/components/combobox/combobox.es.js +689 -0
- package/dist/components/date-picker/date-input.cjs.js +2 -0
- package/dist/components/date-picker/date-input.es.js +152 -0
- package/dist/components/date-picker/date-picker.cjs.js +2 -0
- package/dist/components/date-picker/date-picker.es.js +262 -0
- package/dist/components/date-picker/date-picker.utils.cjs.js +1 -0
- package/dist/components/date-picker/date-picker.utils.es.js +73 -0
- package/dist/components/date-picker/use-date-input-popover.cjs.js +1 -0
- package/dist/components/date-picker/use-date-input-popover.es.js +26 -0
- package/dist/components/date-picker/use-date-input.cjs.js +1 -0
- package/dist/components/date-picker/use-date-input.es.js +64 -0
- package/dist/components/dialog/dialog.cjs.js +2 -0
- package/dist/components/dialog/dialog.es.js +221 -0
- package/dist/components/divider/divider.cjs.js +2 -0
- package/dist/components/divider/divider.es.js +27 -0
- package/dist/components/dropzone/dropzone.cjs.js +2 -0
- package/dist/components/dropzone/dropzone.es.js +303 -0
- package/dist/components/dropzone/file-types.cjs.js +1 -0
- package/dist/components/dropzone/file-types.es.js +57 -0
- package/dist/components/empty/empty.cjs.js +2 -0
- package/dist/components/empty/empty.es.js +128 -0
- package/dist/components/field/field.cjs.js +2 -0
- package/dist/components/field/field.es.js +179 -0
- package/dist/components/form/form.cjs.js +2 -0
- package/dist/components/form/form.es.js +11 -0
- package/dist/components/input/input.cjs.js +2 -0
- package/dist/components/input/input.es.js +60 -0
- package/dist/components/kbd/kbd.cjs.js +2 -0
- package/dist/components/kbd/kbd.es.js +36 -0
- package/dist/components/label/label.cjs.js +2 -0
- package/dist/components/label/label.es.js +49 -0
- package/dist/components/loader/loader.cjs.js +2 -0
- package/dist/components/loader/loader.es.js +55 -0
- package/dist/components/menu/menu-primitives.cjs.js +2 -0
- package/dist/components/menu/menu-primitives.es.js +240 -0
- package/dist/components/menu/menu.cjs.js +2 -0
- package/dist/components/menu/menu.es.js +89 -0
- package/dist/components/number-input/number-input.cjs.js +2 -0
- package/dist/components/number-input/number-input.es.js +212 -0
- package/dist/components/pagination/pagination.cjs.js +2 -0
- package/dist/components/pagination/pagination.es.js +393 -0
- package/dist/components/pagination/pagination.model.cjs.js +1 -0
- package/dist/components/pagination/pagination.model.es.js +4 -0
- package/dist/components/password/password.cjs.js +2 -0
- package/dist/components/password/password.es.js +73 -0
- package/dist/components/popover/popover.cjs.js +2 -0
- package/dist/components/popover/popover.es.js +158 -0
- package/dist/components/progress/progress.cjs.js +2 -0
- package/dist/components/progress/progress.es.js +114 -0
- package/dist/components/scroll-area/scroll-area.cjs.js +2 -0
- package/dist/components/scroll-area/scroll-area.es.js +67 -0
- package/dist/components/select/select.cjs.js +2 -0
- package/dist/components/select/select.es.js +323 -0
- package/dist/components/skeleton/skeleton.cjs.js +2 -0
- package/dist/components/skeleton/skeleton.es.js +19 -0
- package/dist/components/stack/stack.cjs.js +2 -0
- package/dist/components/stack/stack.es.js +42 -0
- package/dist/components/stepper/stepper.cjs.js +2 -0
- package/dist/components/stepper/stepper.es.js +368 -0
- package/dist/components/switch/switch.cjs.js +2 -0
- package/dist/components/switch/switch.es.js +85 -0
- package/dist/components/table/table.cjs.js +2 -0
- package/dist/components/table/table.es.js +168 -0
- package/dist/components/tabs/tabs.cjs.js +2 -0
- package/dist/components/tabs/tabs.es.js +96 -0
- package/dist/components/tag/tag.cjs.js +2 -0
- package/dist/components/tag/tag.es.js +50 -0
- package/dist/components/textarea/textarea.cjs.js +2 -0
- package/dist/components/textarea/textarea.es.js +31 -0
- package/dist/components/timeline/timeline.cjs.js +2 -0
- package/dist/components/timeline/timeline.es.js +263 -0
- package/dist/components/toast/toast.cjs.js +2 -0
- package/dist/components/toast/toast.es.js +224 -0
- package/dist/components/tooltip/tooltip.cjs.js +2 -0
- package/dist/components/tooltip/tooltip.es.js +122 -0
- package/dist/components/tree/tree.cjs.js +2 -0
- package/dist/components/tree/tree.es.js +150 -0
- package/dist/hooks/internal/is-browser.cjs.js +1 -0
- package/dist/hooks/internal/is-browser.es.js +4 -0
- package/dist/hooks/internal/use-isomorphic-layout-effect.cjs.js +1 -0
- package/dist/hooks/internal/use-isomorphic-layout-effect.es.js +6 -0
- package/dist/hooks/use-array/use-array.cjs.js +1 -0
- package/dist/hooks/use-array/use-array.es.js +46 -0
- package/dist/hooks/use-async/use-async.cjs.js +1 -0
- package/dist/hooks/use-async/use-async.es.js +24 -0
- package/dist/hooks/use-click-outside/use-click-outside.cjs.js +1 -0
- package/dist/hooks/use-click-outside/use-click-outside.es.js +15 -0
- package/dist/hooks/use-clipboard/use-clipboard.cjs.js +1 -0
- package/dist/hooks/use-clipboard/use-clipboard.es.js +29 -0
- package/dist/hooks/use-debounce-callback/use-debounced-callback.cjs.js +1 -0
- package/dist/hooks/use-debounce-callback/use-debounced-callback.es.js +15 -0
- package/dist/hooks/use-debounce-value/use-debounced-value.cjs.js +1 -0
- package/dist/hooks/use-debounce-value/use-debounced-value.es.js +13 -0
- package/dist/hooks/use-disclosure/use-disclosure.cjs.js +1 -0
- package/dist/hooks/use-disclosure/use-disclosure.es.js +14 -0
- package/dist/hooks/use-document-title/use-document-title.cjs.js +1 -0
- package/dist/hooks/use-document-title/use-document-title.es.js +17 -0
- package/dist/hooks/use-event-listener/use-event-listener.cjs.js +1 -0
- package/dist/hooks/use-event-listener/use-event-listener.es.js +13 -0
- package/dist/hooks/use-focus-trap/scope-tab.cjs.js +1 -0
- package/dist/hooks/use-focus-trap/scope-tab.es.js +21 -0
- package/dist/hooks/use-focus-trap/tabbable.cjs.js +1 -0
- package/dist/hooks/use-focus-trap/tabbable.es.js +38 -0
- package/dist/hooks/use-focus-trap/use-focus-trap.cjs.js +1 -0
- package/dist/hooks/use-focus-trap/use-focus-trap.es.js +34 -0
- package/dist/hooks/use-hotkey/use-hotkey.cjs.js +1 -0
- package/dist/hooks/use-hotkey/use-hotkey.es.js +18 -0
- package/dist/hooks/use-hotkey/utils/create-hotkey-listener.cjs.js +1 -0
- package/dist/hooks/use-hotkey/utils/create-hotkey-listener.es.js +10 -0
- package/dist/hooks/use-hotkey/utils/is-input-field.cjs.js +1 -0
- package/dist/hooks/use-hotkey/utils/is-input-field.es.js +5 -0
- package/dist/hooks/use-hotkey/utils/match-key-modifiers.cjs.js +1 -0
- package/dist/hooks/use-hotkey/utils/match-key-modifiers.es.js +17 -0
- package/dist/hooks/use-hover/use-hover.cjs.js +1 -0
- package/dist/hooks/use-hover/use-hover.es.js +20 -0
- package/dist/hooks/use-is-visible/use-is-visible.cjs.js +1 -0
- package/dist/hooks/use-is-visible/use-is-visible.es.js +31 -0
- package/dist/hooks/use-local-storage/use-local-storage.cjs.js +1 -0
- package/dist/hooks/use-local-storage/use-local-storage.es.js +29 -0
- package/dist/hooks/use-media-query/use-media-query.cjs.js +1 -0
- package/dist/hooks/use-media-query/use-media-query.es.js +13 -0
- package/dist/hooks/use-memoized-fn/use-memoized-fn.cjs.js +1 -0
- package/dist/hooks/use-memoized-fn/use-memoized-fn.es.js +15 -0
- package/dist/hooks/use-mutation/use-mutation.cjs.js +1 -0
- package/dist/hooks/use-mutation/use-mutation.es.js +27 -0
- package/dist/hooks/use-object/use-object.cjs.js +1 -0
- package/dist/hooks/use-object/use-object.es.js +26 -0
- package/dist/hooks/use-on-mount/use-on-mount.cjs.js +1 -0
- package/dist/hooks/use-on-mount/use-on-mount.es.js +11 -0
- package/dist/hooks/use-pagination/use-pagination.cjs.js +1 -0
- package/dist/hooks/use-pagination/use-pagination.es.js +38 -0
- package/dist/hooks/use-portal/use-portal.cjs.js +1 -0
- package/dist/hooks/use-portal/use-portal.es.js +31 -0
- package/dist/hooks/use-prevent-close-window/use-prevent-close-window.cjs.js +1 -0
- package/dist/hooks/use-prevent-close-window/use-prevent-close-window.es.js +15 -0
- package/dist/hooks/use-range-pagination/use-range-pagination.cjs.js +1 -0
- package/dist/hooks/use-range-pagination/use-range-pagination.es.js +36 -0
- package/dist/hooks/use-selection/use-selection.cjs.js +1 -0
- package/dist/hooks/use-selection/use-selection.es.js +38 -0
- package/dist/hooks/use-step/use-step.cjs.js +1 -0
- package/dist/hooks/use-step/use-step.es.js +27 -0
- package/dist/hooks/use-toggle/use-toggle.cjs.js +1 -0
- package/dist/hooks/use-toggle/use-toggle.es.js +10 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +2 -2627
- package/dist/index.es.js +437 -7544
- package/dist/lib/cn.cjs.js +1 -0
- package/dist/lib/cn.es.js +10 -0
- package/dist/providers/library-provider.cjs.js +1 -0
- package/dist/providers/library-provider.es.js +13 -0
- package/dist/providers/theme/ThemeProvider.cjs.js +1 -0
- package/dist/providers/theme/ThemeProvider.es.js +10 -0
- package/dist/providers/theme/useThemeProps.cjs.js +1 -0
- package/dist/providers/theme/useThemeProps.es.js +12 -0
- package/dist/setupTests.d.ts +0 -0
- package/dist/src/__doc__/Examples.d.ts +7 -0
- package/dist/src/components/accordion/accordion.d.ts +28 -0
- package/dist/src/components/accordion/accordion.test.d.ts +1 -0
- package/dist/src/components/accordion/index.d.ts +1 -0
- package/dist/src/components/alert/alert.d.ts +26 -0
- package/dist/src/components/alert/alert.test.d.ts +1 -0
- package/dist/src/components/alert/index.d.ts +1 -0
- package/dist/src/components/alert-dialog/alert-dialog.d.ts +104 -0
- package/dist/src/components/alert-dialog/alert-dialog.test.d.ts +1 -0
- package/dist/src/components/alert-dialog/index.d.ts +1 -0
- package/dist/src/components/auto-complete/auto-complete.d.ts +95 -0
- package/dist/src/components/auto-complete/auto-complete.test.d.ts +1 -0
- package/dist/src/components/auto-complete/index.d.ts +1 -0
- package/dist/src/components/avatar/avatar.d.ts +31 -0
- package/dist/src/components/avatar/avatar.test.d.ts +1 -0
- package/dist/src/components/avatar/index.d.ts +1 -0
- package/dist/src/components/button/button.d.ts +11 -0
- package/dist/src/components/button/button.test.d.ts +1 -0
- package/dist/src/components/button/components/base-button.d.ts +7 -0
- package/dist/src/components/button/index.d.ts +2 -0
- package/dist/src/components/calendar/calendar.d.ts +3 -0
- package/dist/src/components/calendar/calendar.test.d.ts +1 -0
- package/dist/src/components/calendar/index.d.ts +1 -0
- package/dist/src/components/card/card.d.ts +35 -0
- package/dist/src/components/card/card.test.d.ts +1 -0
- package/dist/src/components/card/index.d.ts +1 -0
- package/dist/src/components/center/center.d.ts +7 -0
- package/dist/src/components/center/center.test.d.ts +1 -0
- package/dist/src/components/center/index.d.ts +1 -0
- package/dist/src/components/checkbox/checkbox.d.ts +74 -0
- package/dist/src/components/checkbox/checkbox.test.d.ts +1 -0
- package/dist/src/components/checkbox/index.d.ts +1 -0
- package/dist/src/components/checkbox-group/checkbox-group.d.ts +21 -0
- package/dist/src/components/checkbox-group/checkbox-group.test.d.ts +1 -0
- package/dist/src/components/checkbox-group/index.d.ts +1 -0
- package/dist/src/components/combobox/combobox.d.ts +112 -0
- package/dist/src/components/combobox/combobox.test.d.ts +1 -0
- package/dist/src/components/combobox/index.d.ts +1 -0
- package/dist/src/components/date-picker/date-input.d.ts +2 -0
- package/dist/src/components/date-picker/date-picker.d.ts +5 -0
- package/dist/src/components/date-picker/date-picker.model.d.ts +78 -0
- package/dist/src/components/date-picker/date-picker.test.d.ts +1 -0
- package/dist/src/components/date-picker/date-picker.utils.d.ts +12 -0
- package/dist/src/components/date-picker/date-picker.utils.test.d.ts +1 -0
- package/dist/src/components/date-picker/index.d.ts +3 -0
- package/dist/src/components/date-picker/use-date-input-popover.d.ts +12 -0
- package/dist/src/components/date-picker/use-date-input-popover.test.d.ts +1 -0
- package/dist/src/components/date-picker/use-date-input.d.ts +16 -0
- package/dist/src/components/dialog/dialog.d.ts +100 -0
- package/dist/src/components/dialog/dialog.test.d.ts +1 -0
- package/dist/src/components/dialog/index.d.ts +1 -0
- package/dist/src/components/divider/divider.d.ts +4 -0
- package/dist/src/components/divider/divider.test.d.ts +1 -0
- package/dist/src/components/divider/index.d.ts +1 -0
- package/dist/src/components/dropzone/dropzone.d.ts +67 -0
- package/dist/src/components/dropzone/dropzone.test.d.ts +1 -0
- package/dist/src/components/dropzone/file-types.d.ts +27 -0
- package/dist/src/components/dropzone/index.d.ts +2 -0
- package/dist/src/components/empty/empty.d.ts +33 -0
- package/dist/src/components/empty/empty.test.d.ts +1 -0
- package/dist/src/components/empty/index.d.ts +1 -0
- package/dist/src/components/field/field.d.ts +57 -0
- package/dist/src/components/field/field.test.d.ts +1 -0
- package/dist/src/components/field/index.d.ts +1 -0
- package/dist/src/components/form/form.d.ts +5 -0
- package/dist/src/components/form/form.test.d.ts +1 -0
- package/dist/src/components/form/index.d.ts +1 -0
- package/dist/src/components/index.d.ts +43 -0
- package/dist/src/components/input/index.d.ts +1 -0
- package/dist/src/components/input/input.d.ts +9 -0
- package/dist/src/components/input/input.test.d.ts +1 -0
- package/dist/src/components/kbd/index.d.ts +1 -0
- package/dist/src/components/kbd/kbd.d.ts +3 -0
- package/dist/src/components/kbd/kbd.test.d.ts +1 -0
- package/dist/src/components/label/index.d.ts +1 -0
- package/dist/src/components/label/label.d.ts +15 -0
- package/dist/src/components/label/label.test.d.ts +1 -0
- package/dist/src/components/loader/index.d.ts +1 -0
- package/dist/src/components/loader/loader.d.ts +18 -0
- package/dist/src/components/loader/loader.test.d.ts +1 -0
- package/dist/src/components/menu/index.d.ts +2 -0
- package/dist/src/components/menu/menu-primitives.d.ts +29 -0
- package/dist/src/components/menu/menu.d.ts +57 -0
- package/dist/src/components/menu/menu.test.d.ts +1 -0
- package/dist/src/components/number-input/index.d.ts +1 -0
- package/dist/src/components/number-input/number-input.d.ts +31 -0
- package/dist/src/components/number-input/number-input.test.d.ts +1 -0
- package/dist/src/components/otp/index.d.ts +1 -0
- package/dist/src/components/otp/otp.d.ts +16 -0
- package/dist/src/components/otp/otp.test.d.ts +1 -0
- package/dist/src/components/pagination/index.d.ts +2 -0
- package/dist/src/components/pagination/pagination.d.ts +131 -0
- package/dist/src/components/pagination/pagination.model.d.ts +2 -0
- package/dist/src/components/pagination/pagination.test.d.ts +1 -0
- package/dist/src/components/password/index.d.ts +1 -0
- package/dist/src/components/password/password.d.ts +19 -0
- package/dist/src/components/password/password.test.d.ts +1 -0
- package/dist/src/components/popover/index.d.ts +1 -0
- package/dist/src/components/popover/popover.d.ts +41 -0
- package/dist/src/components/popover/popover.test.d.ts +1 -0
- package/dist/src/components/progress/index.d.ts +1 -0
- package/dist/src/components/progress/progress.d.ts +22 -0
- package/dist/src/components/progress/progress.test.d.ts +1 -0
- package/dist/src/components/radio-group/index.d.ts +1 -0
- package/dist/src/components/radio-group/radio-group.d.ts +41 -0
- package/dist/src/components/radio-group/radio-group.test.d.ts +1 -0
- package/dist/src/components/scroll-area/index.d.ts +1 -0
- package/dist/src/components/scroll-area/scroll-area.d.ts +8 -0
- package/dist/src/components/scroll-area/scroll-area.test.d.ts +1 -0
- package/dist/src/components/select/index.d.ts +1 -0
- package/dist/src/components/select/select.d.ts +71 -0
- package/dist/src/components/select/select.test.d.ts +1 -0
- package/dist/src/components/skeleton/index.d.ts +1 -0
- package/dist/src/components/skeleton/skeleton.d.ts +2 -0
- package/dist/src/components/skeleton/skeleton.test.d.ts +1 -0
- package/dist/src/components/stack/index.d.ts +1 -0
- package/dist/src/components/stack/stack.d.ts +14 -0
- package/dist/src/components/stack/stack.test.d.ts +1 -0
- package/dist/src/components/stepper/index.d.ts +1 -0
- package/dist/src/components/stepper/stepper.d.ts +83 -0
- package/dist/src/components/stepper/stepper.test.d.ts +1 -0
- package/dist/src/components/switch/index.d.ts +1 -0
- package/dist/src/components/switch/switch.d.ts +21 -0
- package/dist/src/components/switch/switch.test.d.ts +1 -0
- package/dist/src/components/table/index.d.ts +1 -0
- package/dist/src/components/table/table.d.ts +50 -0
- package/dist/src/components/table/table.test.d.ts +1 -0
- package/dist/src/components/tabs/index.d.ts +1 -0
- package/dist/src/components/tabs/tabs.d.ts +11 -0
- package/dist/src/components/tabs/tabs.test.d.ts +1 -0
- package/dist/src/components/tag/index.d.ts +1 -0
- package/dist/src/components/tag/tag.d.ts +7 -0
- package/dist/src/components/tag/tag.test.d.ts +1 -0
- package/dist/src/components/textarea/index.d.ts +1 -0
- package/dist/src/components/textarea/textarea.d.ts +5 -0
- package/dist/src/components/textarea/textarea.test.d.ts +1 -0
- package/dist/src/components/timeline/index.d.ts +1 -0
- package/dist/src/components/timeline/timeline.d.ts +50 -0
- package/dist/src/components/timeline/timeline.test.d.ts +1 -0
- package/dist/src/components/toast/index.d.ts +1 -0
- package/dist/src/components/toast/toast.d.ts +101 -0
- package/dist/src/components/toast/toast.test.d.ts +1 -0
- package/dist/src/components/tooltip/index.d.ts +1 -0
- package/dist/src/components/tooltip/tooltip.d.ts +52 -0
- package/dist/src/components/tooltip/tooltip.test.d.ts +1 -0
- package/dist/src/components/tree/index.d.ts +1 -0
- package/dist/src/components/tree/tree.d.ts +18 -0
- package/dist/src/components/tree/tree.test.d.ts +1 -0
- package/dist/src/hooks/index.d.ts +27 -0
- package/dist/src/hooks/internal/index.d.ts +2 -0
- package/dist/src/hooks/internal/is-browser.d.ts +1 -0
- package/dist/src/hooks/internal/use-isomorphic-layout-effect.d.ts +2 -0
- package/dist/src/hooks/use-array/index.d.ts +1 -0
- package/dist/src/hooks/use-array/use-array.d.ts +11 -0
- package/dist/src/hooks/use-array/use-array.test.d.ts +1 -0
- package/dist/src/hooks/use-async/index.d.ts +1 -0
- package/dist/src/hooks/use-async/use-async.d.ts +18 -0
- package/dist/src/hooks/use-async/use-async.test.d.ts +1 -0
- package/dist/src/hooks/use-click-outside/index.d.ts +1 -0
- package/dist/src/hooks/use-click-outside/use-click-outside.d.ts +1 -0
- package/dist/src/hooks/use-click-outside/use-click-outside.test.d.ts +1 -0
- package/dist/src/hooks/use-clipboard/index.d.ts +1 -0
- package/dist/src/hooks/use-clipboard/use-clipboard.d.ts +15 -0
- package/dist/src/hooks/use-clipboard/use-clipboard.test.d.ts +1 -0
- package/dist/src/hooks/use-debounce-callback/index.d.ts +1 -0
- package/dist/src/hooks/use-debounce-callback/use-debounced-callback.d.ts +1 -0
- package/dist/src/hooks/use-debounce-callback/use-debounced-callback.test.d.ts +1 -0
- package/dist/src/hooks/use-debounce-value/index.d.ts +1 -0
- package/dist/src/hooks/use-debounce-value/use-debounced-value.d.ts +1 -0
- package/dist/src/hooks/use-debounce-value/use-debounced-value.test.d.ts +1 -0
- package/dist/src/hooks/use-disclosure/index.d.ts +1 -0
- package/dist/src/hooks/use-disclosure/use-disclosure.d.ts +8 -0
- package/dist/src/hooks/use-disclosure/use-disclosure.test.d.ts +1 -0
- package/dist/src/hooks/use-document-title/index.d.ts +1 -0
- package/dist/src/hooks/use-document-title/use-document-title.d.ts +5 -0
- package/dist/src/hooks/use-document-title/use-document-title.test.d.ts +1 -0
- package/dist/src/hooks/use-event-listener/index.d.ts +1 -0
- package/dist/src/hooks/use-event-listener/use-event-listener.d.ts +1 -0
- package/dist/src/hooks/use-event-listener/use-event-listener.test.d.ts +1 -0
- package/dist/src/hooks/use-focus-trap/index.d.ts +1 -0
- package/dist/src/hooks/use-focus-trap/scope-tab.d.ts +1 -0
- package/dist/src/hooks/use-focus-trap/tabbable.d.ts +4 -0
- package/dist/src/hooks/use-focus-trap/use-focus-trap.d.ts +1 -0
- package/dist/src/hooks/use-focus-trap/use-focus-trap.test.d.ts +1 -0
- package/dist/src/hooks/use-hotkey/index.d.ts +1 -0
- package/dist/src/hooks/use-hotkey/use-hotkey.d.ts +9 -0
- package/dist/src/hooks/use-hotkey/use-hotkey.test.d.ts +1 -0
- package/dist/src/hooks/use-hotkey/utils/create-hotkey-listener.d.ts +1 -0
- package/dist/src/hooks/use-hotkey/utils/index.d.ts +3 -0
- package/dist/src/hooks/use-hotkey/utils/is-input-field.d.ts +2 -0
- package/dist/src/hooks/use-hotkey/utils/match-key-modifiers.d.ts +8 -0
- package/dist/src/hooks/use-hover/index.d.ts +1 -0
- package/dist/src/hooks/use-hover/use-hover.d.ts +12 -0
- package/dist/src/hooks/use-hover/use-hover.test.d.ts +1 -0
- package/dist/src/hooks/use-is-visible/index.d.ts +1 -0
- package/dist/src/hooks/use-is-visible/use-is-visible.d.ts +10 -0
- package/dist/src/hooks/use-is-visible/use-is-visible.test.d.ts +1 -0
- package/dist/src/hooks/use-local-storage/index.d.ts +1 -0
- package/dist/src/hooks/use-local-storage/use-local-storage.d.ts +2 -0
- package/dist/src/hooks/use-local-storage/use-local-storage.test.d.ts +1 -0
- package/dist/src/hooks/use-media-query/index.d.ts +1 -0
- package/dist/src/hooks/use-media-query/use-media-query.d.ts +1 -0
- package/dist/src/hooks/use-memoized-fn/index.d.ts +1 -0
- package/dist/src/hooks/use-memoized-fn/use-memoized-fn.d.ts +3 -0
- package/dist/src/hooks/use-memoized-fn/use-memoized-fn.test.d.ts +1 -0
- package/dist/src/hooks/use-mutation/index.d.ts +1 -0
- package/dist/src/hooks/use-mutation/use-mutation.d.ts +15 -0
- package/dist/src/hooks/use-mutation/use-mutation.test.d.ts +1 -0
- package/dist/src/hooks/use-object/index.d.ts +1 -0
- package/dist/src/hooks/use-object/use-object.d.ts +6 -0
- package/dist/src/hooks/use-object/use-object.test.d.ts +1 -0
- package/dist/src/hooks/use-on-mount/index.d.ts +1 -0
- package/dist/src/hooks/use-on-mount/use-on-mount.d.ts +2 -0
- package/dist/src/hooks/use-on-mount/use-on-mount.test.d.ts +1 -0
- package/dist/src/hooks/use-pagination/index.d.ts +1 -0
- package/dist/src/hooks/use-pagination/use-pagination.d.ts +46 -0
- package/dist/src/hooks/use-pagination/use-pagination.test.d.ts +1 -0
- package/dist/src/hooks/use-portal/index.d.ts +1 -0
- package/dist/src/hooks/use-portal/use-portal.d.ts +4 -0
- package/dist/src/hooks/use-portal/use-portal.test.d.ts +1 -0
- package/dist/src/hooks/use-prevent-close-window/index.d.ts +1 -0
- package/dist/src/hooks/use-prevent-close-window/use-prevent-close-window.d.ts +13 -0
- package/dist/src/hooks/use-prevent-close-window/use-prevent-close-window.test.d.ts +1 -0
- package/dist/src/hooks/use-range-pagination/index.d.ts +1 -0
- package/dist/src/hooks/use-range-pagination/use-range-pagination.d.ts +22 -0
- package/dist/src/hooks/use-range-pagination/use-range-pagination.test.d.ts +1 -0
- package/dist/src/hooks/use-selection/index.d.ts +1 -0
- package/dist/src/hooks/use-selection/use-selection.d.ts +54 -0
- package/dist/src/hooks/use-selection/use-selection.test.d.ts +1 -0
- package/dist/src/hooks/use-step/index.d.ts +1 -0
- package/dist/src/hooks/use-step/use-step.d.ts +14 -0
- package/dist/src/hooks/use-step/use-step.test.d.ts +1 -0
- package/dist/src/hooks/use-toggle/index.d.ts +1 -0
- package/dist/src/hooks/use-toggle/use-toggle.d.ts +3 -0
- package/dist/src/hooks/use-toggle/use-toggle.test.d.ts +1 -0
- package/dist/src/index.d.ts +6 -0
- package/dist/src/lib/cn.d.ts +3 -0
- package/dist/src/lib/index.d.ts +1 -0
- package/dist/src/models/Generic.model.d.ts +37 -0
- package/dist/src/models/index.d.ts +1 -0
- package/dist/src/providers/index.d.ts +2 -0
- package/dist/src/providers/library-provider.d.ts +28 -0
- package/dist/src/providers/theme/ThemeProvider.d.ts +11 -0
- package/dist/src/providers/theme/index.d.ts +3 -0
- package/dist/src/providers/theme/types.d.ts +10 -0
- package/dist/src/providers/theme/useThemeProps.d.ts +10 -0
- package/dist/src/stores/theme.store.d.ts +10 -0
- package/dist/src/utils/dates/parseDateRange.utility.d.ts +14 -0
- package/dist/src/utils/form.d.ts +32 -0
- package/dist/src/utils/form.test.d.ts +1 -0
- package/dist/src/utils/functions/createSafeContext.d.ts +2 -0
- package/dist/src/utils/functions/createSafeContext.test.d.ts +1 -0
- package/dist/src/utils/functions/ensureReactElement.d.ts +9 -0
- package/dist/src/utils/functions/ensureReactElement.test.d.ts +1 -0
- package/dist/src/utils/functions/getFormData.d.ts +2 -0
- package/dist/src/utils/functions/getFormData.test.d.ts +1 -0
- package/dist/src/utils/functions/index.d.ts +4 -0
- package/dist/src/utils/functions/mergeRefs.d.ts +2 -0
- package/dist/src/utils/functions/mergeRefs.test.d.ts +1 -0
- package/dist/src/utils/index.d.ts +3 -0
- package/dist/src/utils/strings/extractInitials.utility.d.ts +6 -0
- package/dist/src/utils/strings/index.d.ts +1 -0
- package/dist/src/utils/tests/click.d.ts +1 -0
- package/dist/src/utils/tests/index.d.ts +2 -0
- package/dist/src/utils/tests/keyboard.d.ts +10 -0
- package/dist/src/utils/tests/type.d.ts +1 -0
- package/dist/utils/form.cjs.js +1 -0
- package/dist/utils/form.es.js +62 -0
- package/dist/utils/functions/createSafeContext.cjs.js +1 -0
- package/dist/utils/functions/createSafeContext.es.js +13 -0
- package/dist/utils/functions/ensureReactElement.cjs.js +1 -0
- package/dist/utils/functions/ensureReactElement.es.js +13 -0
- package/dist/utils/functions/getFormData.cjs.js +1 -0
- package/dist/utils/functions/getFormData.es.js +11 -0
- package/dist/utils/functions/mergeRefs.cjs.js +1 -0
- package/dist/utils/functions/mergeRefs.es.js +10 -0
- package/dist/utils/strings/extractInitials.utility.cjs.js +1 -0
- package/dist/utils/strings/extractInitials.utility.es.js +4 -0
- package/package.json +6 -10
- package/src/components/accordion/accordion.test.tsx +117 -0
- package/src/components/accordion/accordion.tsx +2 -0
- package/src/components/alert/alert.test.tsx +185 -0
- package/src/components/alert/alert.tsx +2 -0
- package/src/components/alert-dialog/alert-dialog.test.tsx +208 -22
- package/src/components/alert-dialog/alert-dialog.tsx +6 -4
- package/src/components/auto-complete/auto-complete.test.tsx +709 -0
- package/src/components/auto-complete/auto-complete.tsx +8 -10
- package/src/components/avatar/avatar.test.tsx +307 -27
- package/src/components/avatar/avatar.tsx +2 -0
- package/src/components/button/button.test.tsx +206 -10
- package/src/components/button/button.tsx +2 -0
- package/src/components/button/components/base-button.tsx +2 -0
- package/src/components/calendar/calendar.test.tsx +174 -5
- package/src/components/card/card.test.tsx +207 -0
- package/src/components/card/card.tsx +2 -0
- package/src/components/center/center.test.tsx +63 -0
- package/src/components/center/center.tsx +2 -0
- package/src/components/checkbox/checkbox.test.tsx +388 -0
- package/src/components/checkbox/checkbox.tsx +2 -0
- package/src/components/checkbox-group/checkbox-group.test.tsx +156 -0
- package/src/components/checkbox-group/checkbox-group.tsx +2 -0
- package/src/components/combobox/combobox.test.tsx +458 -0
- package/src/components/combobox/combobox.tsx +14 -12
- package/src/components/date-picker/date-input.tsx +2 -0
- package/src/components/date-picker/date-picker.test.tsx +546 -2
- package/src/components/date-picker/date-picker.tsx +2 -0
- package/src/components/date-picker/date-picker.utils.test.ts +251 -0
- package/src/components/date-picker/use-date-input-popover.test.ts +61 -0
- package/src/components/dialog/dialog.test.tsx +302 -3
- package/src/components/dialog/dialog.tsx +3 -1
- package/src/components/divider/divider.test.tsx +41 -1
- package/src/components/divider/divider.tsx +3 -1
- package/src/components/dropzone/dropzone.test.tsx +355 -0
- package/src/components/dropzone/dropzone.tsx +2 -0
- package/src/components/empty/empty.test.tsx +219 -0
- package/src/components/empty/empty.tsx +2 -0
- package/src/components/field/field.test.tsx +324 -0
- package/src/components/field/field.tsx +2 -0
- package/src/components/form/form.test.tsx +44 -0
- package/src/components/form/form.tsx +2 -0
- package/src/components/index.ts +1 -0
- package/src/components/input/input.stories.tsx +2 -3
- package/src/components/input/input.test.tsx +109 -0
- package/src/components/input/input.tsx +2 -0
- package/src/components/kbd/kbd.test.tsx +66 -0
- package/src/components/kbd/kbd.tsx +2 -0
- package/src/components/label/label.test.tsx +46 -0
- package/src/components/label/label.tsx +3 -1
- package/src/components/loader/loader.test.tsx +63 -1
- package/src/components/loader/loader.tsx +2 -0
- package/src/components/menu/menu.test.tsx +167 -0
- package/src/components/number-input/number-input.test.tsx +216 -47
- package/src/components/otp/otp.test.tsx +103 -0
- package/src/components/otp/otp.tsx +2 -0
- package/src/components/pagination/pagination.test.tsx +61 -1
- package/src/components/pagination/pagination.tsx +2 -0
- package/src/components/password/password.test.tsx +115 -0
- package/src/components/password/password.tsx +2 -0
- package/src/components/popover/popover.test.tsx +175 -0
- package/src/components/progress/progress.test.tsx +102 -1
- package/src/components/progress/progress.tsx +2 -0
- package/src/components/radio-group/radio-group.test.tsx +169 -0
- package/src/components/radio-group/radio-group.tsx +2 -0
- package/src/components/scroll-area/scroll-area.test.tsx +140 -0
- package/src/components/select/select.test.tsx +357 -0
- package/src/components/select/select.tsx +1 -1
- package/src/components/skeleton/skeleton.test.tsx +37 -0
- package/src/components/skeleton/skeleton.tsx +2 -0
- package/src/components/stack/stack.test.tsx +134 -0
- package/src/components/stack/stack.tsx +2 -0
- package/src/components/stepper/stepper.test.tsx +378 -23
- package/src/components/switch/switch.test.tsx +68 -2
- package/src/components/switch/switch.tsx +2 -0
- package/src/components/table/table.test.tsx +168 -1
- package/src/components/table/table.tsx +2 -0
- package/src/components/tabs/tabs.test.tsx +138 -1
- package/src/components/tag/tag.test.tsx +40 -1
- package/src/components/tag/tag.tsx +2 -0
- package/src/components/textarea/textarea.test.tsx +57 -0
- package/src/components/timeline/timeline.test.tsx +202 -0
- package/src/components/timeline/timeline.tsx +2 -0
- package/src/components/toast/toast.test.tsx +287 -3
- package/src/components/toast/toast.tsx +3 -1
- package/src/components/tooltip/tooltip.test.tsx +120 -7
- package/src/components/tooltip/tooltip.tsx +2 -0
- package/src/components/tree/tree.test.tsx +146 -5
- package/src/hooks/index.ts +26 -25
- package/src/hooks/internal/index.ts +2 -0
- package/src/hooks/internal/is-browser.ts +1 -0
- package/src/hooks/internal/use-isomorphic-layout-effect.ts +4 -0
- package/src/hooks/use-array/index.ts +1 -0
- package/src/hooks/{useArray/__doc__/useArray.stories.tsx → use-array/use-array.stories.tsx} +2 -2
- package/src/hooks/{useArray/__test__/useArray.test.tsx → use-array/use-array.test.tsx} +25 -1
- package/src/hooks/{useArray/useArray.ts → use-array/use-array.ts} +4 -6
- package/src/hooks/use-async/index.ts +1 -0
- package/src/hooks/{useAsync/__doc__/useAsync.stories.tsx → use-async/use-async.stories.tsx} +5 -6
- package/src/hooks/{useAsync/__test__/useAsync.test.tsx → use-async/use-async.test.tsx} +1 -1
- package/src/hooks/{useAsync/useAsync.ts → use-async/use-async.ts} +1 -2
- package/src/hooks/use-click-outside/index.ts +1 -0
- package/src/hooks/{useClickOutside/__doc__/useClickOutside.stories.tsx → use-click-outside/use-click-outside.stories.tsx} +2 -2
- package/src/hooks/use-click-outside/use-click-outside.test.tsx +39 -0
- package/src/hooks/{useClickOutside/useClickOutside.ts → use-click-outside/use-click-outside.ts} +1 -2
- package/src/hooks/use-clipboard/index.ts +1 -0
- package/src/hooks/use-clipboard/use-clipboard.stories.tsx +168 -0
- package/src/hooks/use-clipboard/use-clipboard.test.tsx +114 -0
- package/src/hooks/use-clipboard/use-clipboard.tsx +70 -0
- package/src/hooks/use-debounce-callback/index.ts +1 -0
- package/src/hooks/{useDebounceCallback/__doc__/useDebouncedCallback.stories.tsx → use-debounce-callback/use-debounced-callback.stories.tsx} +3 -3
- package/src/hooks/use-debounce-callback/use-debounced-callback.test.ts +88 -0
- package/src/hooks/{useDebounceCallback/useDebouncedCallback.ts → use-debounce-callback/use-debounced-callback.ts} +1 -2
- package/src/hooks/use-debounce-value/index.ts +1 -0
- package/src/hooks/{useDebounceValue/__doc__/useDebouncedValue.stories.tsx → use-debounce-value/use-debounced-value.stories.tsx} +2 -2
- package/src/hooks/use-debounce-value/use-debounced-value.test.ts +101 -0
- package/src/hooks/{useDebounceValue/useDebouncedValue.ts → use-debounce-value/use-debounced-value.ts} +1 -2
- package/src/hooks/use-disclosure/index.ts +1 -0
- package/src/hooks/{useDisclosure/__doc__/useDisclosure.stories.tsx → use-disclosure/use-disclosure.stories.tsx} +3 -3
- package/src/hooks/use-disclosure/use-disclosure.test.ts +72 -0
- package/src/hooks/{useDisclosure/useDisclosure.ts → use-disclosure/use-disclosure.ts} +1 -2
- package/src/hooks/use-document-title/index.ts +1 -0
- package/src/hooks/use-document-title/use-document-title.stories.tsx +72 -0
- package/src/hooks/use-document-title/use-document-title.test.tsx +75 -0
- package/src/hooks/use-document-title/use-document-title.tsx +32 -0
- package/src/hooks/use-event-listener/index.ts +1 -0
- package/src/hooks/{useEventListener/__doc__/useEventListener.stories.tsx → use-event-listener/use-event-listener.stories.tsx} +2 -2
- package/src/hooks/{useEventListener/__test__/useEventListener.test.tsx → use-event-listener/use-event-listener.test.tsx} +6 -3
- package/src/hooks/{useEventListener/useEventListener.ts → use-event-listener/use-event-listener.ts} +3 -4
- package/src/hooks/use-focus-trap/index.ts +1 -0
- package/src/hooks/{useFocusTrap/__doc__/useFocusTrap.stories.tsx → use-focus-trap/use-focus-trap.stories.tsx} +2 -2
- package/src/hooks/use-focus-trap/use-focus-trap.test.ts +330 -0
- package/src/hooks/{useFocusTrap/useFocusTrap.ts → use-focus-trap/use-focus-trap.ts} +2 -3
- package/src/hooks/use-hotkey/index.ts +1 -0
- package/src/hooks/{useHotkey/__docs__/useHotkey.stories.tsx → use-hotkey/use-hotkey.stories.tsx} +2 -2
- package/src/hooks/{useHotkey/__test__/useHotkey.test.tsx → use-hotkey/use-hotkey.test.tsx} +34 -3
- package/src/hooks/{useHotkey/useHotkey.ts → use-hotkey/use-hotkey.ts} +3 -4
- package/src/hooks/use-hover/index.ts +1 -0
- package/src/hooks/use-hover/use-hover.stories.tsx +90 -0
- package/src/hooks/use-hover/use-hover.test.tsx +93 -0
- package/src/hooks/use-hover/use-hover.tsx +45 -0
- package/src/hooks/use-is-visible/index.ts +1 -0
- package/src/hooks/{useIsVisible/__doc__/useIsVisible.stories.tsx → use-is-visible/use-is-visible.stories.tsx} +2 -2
- package/src/hooks/use-is-visible/use-is-visible.test.tsx +135 -0
- package/src/hooks/{useIsVisible/useIsVisible.tsx → use-is-visible/use-is-visible.tsx} +1 -2
- package/src/hooks/use-local-storage/index.ts +1 -0
- package/src/hooks/{useLocalStorage/__doc__/useLocalStorage.stories.tsx → use-local-storage/use-local-storage.stories.tsx} +2 -2
- package/src/hooks/{useLocalStorage/__test__/useLocalStorage.test.ts → use-local-storage/use-local-storage.test.ts} +47 -1
- package/src/hooks/{useLocalStorage/useLocalStorage.ts → use-local-storage/use-local-storage.ts} +3 -4
- package/src/hooks/use-media-query/index.ts +1 -0
- package/src/hooks/{useMediaQuery/__doc__/useMediaQuery.stories.tsx → use-media-query/use-media-query.stories.tsx} +1 -1
- package/src/hooks/{useMediaQuery/useMediaQuery.ts → use-media-query/use-media-query.ts} +1 -3
- package/src/hooks/use-memoized-fn/index.ts +1 -0
- package/src/hooks/use-memoized-fn/use-memoized-fn.test.ts +52 -0
- package/src/hooks/{useMemoizedFn/useMemoizedFn.ts → use-memoized-fn/use-memoized-fn.ts} +2 -4
- package/src/hooks/use-mutation/index.ts +1 -0
- package/src/hooks/{useMutation/__doc__/useMutation.stories.tsx → use-mutation/use-mutation.stories.tsx} +4 -4
- package/src/hooks/{useMutation/__test__/useMutation.test.tsx → use-mutation/use-mutation.test.tsx} +1 -1
- package/src/hooks/{useMutation/useMutation.tsx → use-mutation/use-mutation.tsx} +3 -4
- package/src/hooks/use-object/index.ts +1 -0
- package/src/hooks/{useObject/__doc__/useObject.stories.tsx → use-object/use-object.stories.tsx} +2 -2
- package/src/hooks/{useObject/__test__/useObject.test.tsx → use-object/use-object.test.tsx} +18 -3
- package/src/hooks/{useObject/useObject.tsx → use-object/use-object.tsx} +6 -8
- package/src/hooks/use-on-mount/index.ts +1 -0
- package/src/hooks/use-on-mount/use-on-mount.stories.tsx +85 -0
- package/src/hooks/use-on-mount/use-on-mount.test.tsx +51 -0
- package/src/hooks/use-on-mount/use-on-mount.tsx +13 -0
- package/src/hooks/use-pagination/index.ts +1 -0
- package/src/hooks/{usePagination/__doc__/usePagination.stories.tsx → use-pagination/use-pagination.stories.tsx} +2 -2
- package/src/hooks/{usePagination/__test__/usePagination.test.tsx → use-pagination/use-pagination.test.tsx} +1 -1
- package/src/hooks/{usePagination/usePagination.tsx → use-pagination/use-pagination.tsx} +1 -2
- package/src/hooks/use-portal/index.ts +1 -0
- package/src/hooks/{usePortal/__doc__/usePortal.stories.tsx → use-portal/use-portal.stories.tsx} +1 -1
- package/src/hooks/use-portal/use-portal.test.tsx +77 -0
- package/src/hooks/use-portal/use-portal.ts +59 -0
- package/src/hooks/use-prevent-close-window/index.ts +1 -0
- package/src/hooks/{usePreventCloseWindow/__doc__/usePreventCloseWindow.stories.tsx → use-prevent-close-window/use-prevent-close-window.stories.tsx} +1 -1
- package/src/hooks/use-prevent-close-window/use-prevent-close-window.test.ts +79 -0
- package/src/hooks/{usePreventCloseWindow/usePreventCloseWindow.ts → use-prevent-close-window/use-prevent-close-window.ts} +4 -4
- package/src/hooks/use-range-pagination/index.ts +1 -0
- package/src/hooks/{useRangePagination/__test__/useRangePagination.test.tsx → use-range-pagination/use-range-pagination.test.tsx} +1 -1
- package/src/hooks/{useRangePagination/useRangePagination.tsx → use-range-pagination/use-range-pagination.tsx} +4 -3
- package/src/hooks/use-selection/index.ts +1 -0
- package/src/hooks/{useSelection/__doc__/useSelection.stories.tsx → use-selection/use-selection.stories.tsx} +3 -3
- package/src/hooks/use-selection/use-selection.test.tsx +79 -0
- package/src/hooks/{useSelection/useSelection.ts → use-selection/use-selection.ts} +1 -2
- package/src/hooks/use-step/index.ts +1 -0
- package/src/hooks/{useStep/__doc__/useStep.stories.tsx → use-step/use-step.stories.tsx} +3 -3
- package/src/hooks/use-step/use-step.test.ts +73 -0
- package/src/hooks/{useStep/useStep.ts → use-step/use-step.ts} +4 -6
- package/src/hooks/use-toggle/index.ts +1 -0
- package/src/hooks/{useToggle/__doc__/useToggle.stories.tsx → use-toggle/use-toggle.stories.tsx} +2 -2
- package/src/hooks/{useToggle/__test__/useToggle.test.tsx → use-toggle/use-toggle.test.tsx} +22 -1
- package/src/hooks/{useToggle/useToggle.ts → use-toggle/use-toggle.ts} +2 -4
- package/src/utils/form.test.tsx +138 -0
- package/src/utils/form.tsx +0 -2
- package/src/utils/functions/createSafeContext.test.tsx +37 -0
- package/src/utils/functions/ensureReactElement.test.tsx +49 -0
- package/src/utils/functions/getFormData.test.ts +57 -0
- package/src/utils/functions/mergeRefs.test.ts +56 -0
- package/src/__doc__/Changelog.mdx +0 -6
- package/src/__doc__/Components.mdx +0 -73
- package/src/__doc__/Examples.tsx +0 -69
- package/src/__doc__/Icons.mdx +0 -41
- package/src/__doc__/Intro.mdx +0 -138
- package/src/__doc__/MCP.mdx +0 -71
- package/src/__doc__/Tabs.mdx +0 -112
- package/src/__doc__/Theme.mdx +0 -132
- package/src/__doc__/Types.mdx +0 -252
- package/src/__doc__/V2.mdx +0 -1245
- package/src/components/calendar/calendar.model.ts +0 -86
- package/src/components/calendar/components/calendar-navigation.tsx +0 -141
- package/src/components/calendar/components/day.tsx +0 -61
- package/src/components/calendar/components/decade-view.tsx +0 -45
- package/src/components/calendar/components/index.ts +0 -6
- package/src/components/calendar/components/month-view.tsx +0 -58
- package/src/components/calendar/components/week-days.tsx +0 -27
- package/src/components/calendar/components/year-view.tsx +0 -29
- package/src/components/calendar/hooks/index.ts +0 -4
- package/src/components/calendar/hooks/use-calendar-navigation.ts +0 -79
- package/src/components/calendar/hooks/use-calendar.ts +0 -90
- package/src/components/calendar/hooks/use-multiple-calendar.ts +0 -34
- package/src/components/calendar/hooks/use-range-calendar.ts +0 -91
- package/src/components/calendar/hooks/use-single-calendar.ts +0 -18
- package/src/components/calendar/utils/typeguards.ts +0 -7
- package/src/hooks/useArray/index.ts +0 -1
- package/src/hooks/useAsync/index.ts +0 -1
- package/src/hooks/useClickOutside/__test__/useClickOutside.test.tsx +0 -33
- package/src/hooks/useClickOutside/index.ts +0 -1
- package/src/hooks/useClipboard/__doc__/useClipboard.stories.tsx +0 -43
- package/src/hooks/useClipboard/__test__/useClipboard.test.tsx +0 -19
- package/src/hooks/useClipboard/index.ts +0 -1
- package/src/hooks/useClipboard/useClipboard.tsx +0 -28
- package/src/hooks/useDebounceCallback/index.ts +0 -1
- package/src/hooks/useDebounceValue/index.ts +0 -1
- package/src/hooks/useDisclosure/__test__/useDisclosure.test.ts +0 -43
- package/src/hooks/useDisclosure/index.ts +0 -1
- package/src/hooks/useDocumentTitle/__doc__/useDocumentTitle.stories.tsx +0 -26
- package/src/hooks/useDocumentTitle/index.ts +0 -1
- package/src/hooks/useDocumentTitle/useDocumentTitle.tsx +0 -11
- package/src/hooks/useEventListener/index.ts +0 -1
- package/src/hooks/useFocusTrap/index.ts +0 -1
- package/src/hooks/useHotkey/index.ts +0 -1
- package/src/hooks/useHover/__doc__/useHover.stories.tsx +0 -41
- package/src/hooks/useHover/__test__/useHover.test.tsx +0 -45
- package/src/hooks/useHover/index.ts +0 -1
- package/src/hooks/useHover/useHover.tsx +0 -40
- package/src/hooks/useIsVisible/index.ts +0 -1
- package/src/hooks/useLocalStorage/index.ts +0 -1
- package/src/hooks/useMediaQuery/index.ts +0 -1
- package/src/hooks/useMemoizedFn/index.ts +0 -1
- package/src/hooks/useMutation/index.ts +0 -1
- package/src/hooks/useObject/index.ts +0 -1
- package/src/hooks/usePagination/index.ts +0 -2
- package/src/hooks/usePortal/__test__/usePortal.test.tsx +0 -20
- package/src/hooks/usePortal/index.ts +0 -1
- package/src/hooks/usePortal/usePortal.ts +0 -40
- package/src/hooks/usePreventCloseWindow/index.ts +0 -1
- package/src/hooks/useRangePagination/index.ts +0 -2
- package/src/hooks/useSelection/__test__/useSelection.test.tsx +0 -57
- package/src/hooks/useSelection/index.ts +0 -1
- package/src/hooks/useStep/__test__/useStep.test.ts +0 -51
- package/src/hooks/useStep/index.ts +0 -1
- package/src/hooks/useToggle/index.ts +0 -1
- /package/src/hooks/{useFocusTrap/scopeTab.ts → use-focus-trap/scope-tab.ts} +0 -0
- /package/src/hooks/{useFocusTrap → use-focus-trap}/tabbable.ts +0 -0
- /package/src/hooks/{useHotkey/__utils__ → use-hotkey/utils}/create-hotkey-listener.ts +0 -0
- /package/src/hooks/{useHotkey/__utils__ → use-hotkey/utils}/index.ts +0 -0
- /package/src/hooks/{useHotkey/__utils__ → use-hotkey/utils}/is-input-field.ts +0 -0
- /package/src/hooks/{useHotkey/__utils__ → use-hotkey/utils}/match-key-modifiers.ts +0 -0
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as n, jsx as o } from "react/jsx-runtime";
|
|
3
|
+
import { useControllableState as j } from "@radix-ui/react-use-controllable-state";
|
|
4
|
+
import { isDate as m } from "date-fns";
|
|
5
|
+
import { CalendarIcon as F } from "lucide-react";
|
|
6
|
+
import { useDateInput as V } from "./use-date-input.es.js";
|
|
7
|
+
import { useDateInputPopover as k } from "./use-date-input-popover.es.js";
|
|
8
|
+
import { PopoverRoot as O, PopoverTrigger as R, PopoverPopup as E } from "../popover/popover.es.js";
|
|
9
|
+
import { FieldControl as q } from "../field/field.es.js";
|
|
10
|
+
import { Calendar as z } from "../calendar/calendar.es.js";
|
|
11
|
+
import { cn as A } from "../../lib/cn.es.js";
|
|
12
|
+
import { inputBaseClasses as G } from "../input/input.es.js";
|
|
13
|
+
const oe = (f) => {
|
|
14
|
+
const {
|
|
15
|
+
placeholder: s,
|
|
16
|
+
value: h,
|
|
17
|
+
onValueChange: g,
|
|
18
|
+
defaultValue: v,
|
|
19
|
+
autoComplete: C,
|
|
20
|
+
className: b,
|
|
21
|
+
disabledDate: a,
|
|
22
|
+
renderFooter: D,
|
|
23
|
+
disabled: l,
|
|
24
|
+
onBlur: y,
|
|
25
|
+
...w
|
|
26
|
+
} = f, [r, i] = j({
|
|
27
|
+
prop: h,
|
|
28
|
+
onChange: (e) => g?.(e ?? null),
|
|
29
|
+
defaultProp: v ?? null
|
|
30
|
+
}), {
|
|
31
|
+
inputValue: P,
|
|
32
|
+
handleChange: x,
|
|
33
|
+
handleBlur: N,
|
|
34
|
+
handleKeyDown: I,
|
|
35
|
+
clear: K,
|
|
36
|
+
setFromExternalDate: t
|
|
37
|
+
} = V({
|
|
38
|
+
date: r ?? null,
|
|
39
|
+
onDateChange: (e) => i(e),
|
|
40
|
+
disabledDate: a
|
|
41
|
+
}), {
|
|
42
|
+
open: S,
|
|
43
|
+
setOpen: d,
|
|
44
|
+
handleInputKeyDown: B,
|
|
45
|
+
inputRef: u
|
|
46
|
+
} = k({ disabled: l }), T = (e) => {
|
|
47
|
+
I(e), B(e);
|
|
48
|
+
}, c = D?.({
|
|
49
|
+
value: r ?? null,
|
|
50
|
+
clear: () => {
|
|
51
|
+
t(null), K();
|
|
52
|
+
},
|
|
53
|
+
selectToday: () => {
|
|
54
|
+
const e = /* @__PURE__ */ new Date();
|
|
55
|
+
a?.(e) || t(e);
|
|
56
|
+
},
|
|
57
|
+
setValue: (e) => {
|
|
58
|
+
const p = e && m(e) ? e : null;
|
|
59
|
+
i(p), t(p);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
return /* @__PURE__ */ n(O, { "data-slot": "date-input", open: S, onOpenChange: d, children: [
|
|
63
|
+
/* @__PURE__ */ n(
|
|
64
|
+
"div",
|
|
65
|
+
{
|
|
66
|
+
className: A(
|
|
67
|
+
G,
|
|
68
|
+
"flex items-center gap-2 h-8",
|
|
69
|
+
"has-[:focus-visible]:border-ring",
|
|
70
|
+
"aria-invalid:border-error has-[:focus-visible]:aria-invalid:ring-error/20",
|
|
71
|
+
"has-aria-invalid:border-error has-[:focus-visible]:has-aria-invalid:ring-error/20",
|
|
72
|
+
"has-[:disabled]:cursor-not-allowed has-[:disabled]:opacity-50",
|
|
73
|
+
!r && "text-muted-foreground",
|
|
74
|
+
b,
|
|
75
|
+
"field-error"
|
|
76
|
+
),
|
|
77
|
+
onClick: (e) => {
|
|
78
|
+
e.target === e.currentTarget && u.current?.focus();
|
|
79
|
+
},
|
|
80
|
+
children: [
|
|
81
|
+
/* @__PURE__ */ n(
|
|
82
|
+
R,
|
|
83
|
+
{
|
|
84
|
+
type: "button",
|
|
85
|
+
disabled: l,
|
|
86
|
+
"data-slot": "date-input-trigger",
|
|
87
|
+
className: "flex shrink-0 items-center justify-center text-muted-foreground hover:text-foreground",
|
|
88
|
+
children: [
|
|
89
|
+
/* @__PURE__ */ o(F, { "data-slot": "date-input-icon" }),
|
|
90
|
+
/* @__PURE__ */ o("span", { className: "sr-only", children: "Seleccionar fecha" })
|
|
91
|
+
]
|
|
92
|
+
}
|
|
93
|
+
),
|
|
94
|
+
/* @__PURE__ */ o(
|
|
95
|
+
q,
|
|
96
|
+
{
|
|
97
|
+
render: /* @__PURE__ */ o(
|
|
98
|
+
"input",
|
|
99
|
+
{
|
|
100
|
+
type: "text",
|
|
101
|
+
value: P,
|
|
102
|
+
onChange: x,
|
|
103
|
+
onBlur: (e) => {
|
|
104
|
+
N(), y?.(e);
|
|
105
|
+
},
|
|
106
|
+
onKeyDown: T,
|
|
107
|
+
placeholder: s ?? "dd/mm/aaaa",
|
|
108
|
+
autoComplete: C ?? "off",
|
|
109
|
+
disabled: l,
|
|
110
|
+
className: "flex-1 min-w-0 bg-transparent outline-none text-start truncate pt-px",
|
|
111
|
+
"aria-label": s,
|
|
112
|
+
ref: u,
|
|
113
|
+
...w
|
|
114
|
+
}
|
|
115
|
+
)
|
|
116
|
+
}
|
|
117
|
+
)
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
),
|
|
121
|
+
/* @__PURE__ */ n(
|
|
122
|
+
E,
|
|
123
|
+
{
|
|
124
|
+
className: "w-auto p-0",
|
|
125
|
+
align: "start",
|
|
126
|
+
"data-slot": "date-input-content",
|
|
127
|
+
children: [
|
|
128
|
+
/* @__PURE__ */ o(
|
|
129
|
+
z,
|
|
130
|
+
{
|
|
131
|
+
className: "border-none",
|
|
132
|
+
mode: "single",
|
|
133
|
+
selected: r ?? void 0,
|
|
134
|
+
onSelect: (e) => {
|
|
135
|
+
if (!e || !m(e)) {
|
|
136
|
+
t(null);
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
a?.(e) || (t(e), d(!1));
|
|
140
|
+
},
|
|
141
|
+
disabled: a
|
|
142
|
+
}
|
|
143
|
+
),
|
|
144
|
+
c && /* @__PURE__ */ o("div", { className: "p-2", "data-slot": "date-input-footer", children: c })
|
|
145
|
+
]
|
|
146
|
+
}
|
|
147
|
+
)
|
|
148
|
+
] });
|
|
149
|
+
};
|
|
150
|
+
export {
|
|
151
|
+
oe as DateInput
|
|
152
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),C=require("@radix-ui/react-use-controllable-state"),q=require("lucide-react"),P=require("react"),j=require("./date-picker.utils.cjs.js"),V=require("../calendar/calendar.cjs.js"),x=require("../../lib/cn.cjs.js"),S=require("../popover/popover.cjs.js"),y=require("../input/input.cjs.js"),R=require("../field/field.cjs.js");function O(a){return a.mode==="range"?r.jsx(D,{...a}):a.mode==="multiple"?r.jsx(N,{...a}):r.jsx(T,{...a})}const k=({open:a,onOpenChange:d,displayText:p,hasValue:f,disabled:g,className:s,classNames:i,children:m,footer:l,slot:c,formValue:v,required:u})=>{const t=P.useRef(null);return r.jsxs(S.PopoverRoot,{"data-slot":c,open:a,onOpenChange:d,children:[r.jsxs(S.PopoverTrigger,{render:r.jsx("button",{ref:t,disabled:g,className:x.cn(y.inputBaseClasses,"inline-flex items-center gap-2 h-8 cursor-pointer text-left","focus-visible:border-ring","aria-invalid:border-error focus-visible:aria-invalid:ring-error/20","group-data-[invalid]:border-error focus-visible:group-data-[invalid]:ring-error/20","disabled:cursor-not-allowed disabled:opacity-50",!f&&"text-muted-foreground",s)}),children:[r.jsx(q.CalendarIcon,{className:"shrink-0"}),r.jsx("span",{className:"truncate",children:p})]}),r.jsx(R.FieldControl,{render:r.jsx("input",{type:"text",tabIndex:-1,"aria-hidden":"true",className:"sr-only",value:v,onChange:()=>{},required:u,onFocus:()=>t.current?.focus()})}),r.jsxs(S.PopoverPopup,{className:x.cn("w-auto p-0",i?.popup),align:"start","data-slot":`${c}-content`,children:[m,l&&r.jsx("div",{className:x.cn("p-2",i?.footer),"data-slot":`${c}-footer`,children:l})]})]})},T=({value:a,defaultValue:d,onValueChange:p,placeholder:f="Seleccionar fecha",disabled:g,disabledDate:s,renderFooter:i,className:m,classNames:l,required:c})=>{const[v,u]=P.useState(!1),[t,o]=C.useControllableState({prop:a,onChange:e=>p?.(e??null),defaultProp:d??null}),n={mode:"single",value:t??null,clear:()=>o(null),selectToday:()=>{const e=new Date;s?.(e)||o(e)},setValue:e=>o(e)};return r.jsx(k,{slot:"date-picker",open:v,onOpenChange:u,displayText:j.formatSingleDate(t,f),hasValue:!!t,disabled:g,className:m,classNames:l,footer:i?.(n),formValue:j.formatSingleDate(t,""),required:c,children:r.jsx(V.Calendar,{className:x.cn("border-none",l?.calendar),mode:"single",selected:t??void 0,onSelect:e=>{s&&e&&s(e)||(o(e??null),u(!1))},disabled:s})})},b={start:null,end:null},D=({value:a,defaultValue:d,onValueChange:p,placeholder:f="Seleccionar rango",disabled:g,disabledDate:s,renderFooter:i,className:m,classNames:l,required:c})=>{const[v,u]=P.useState(!1),[t,o]=C.useControllableState({prop:a,onChange:h=>p?.(h??b),defaultProp:d??b}),n=t??b,e={mode:"range",value:n,clear:()=>o(b),setValue:h=>o(h)};return r.jsx(k,{slot:"date-picker",open:v,onOpenChange:u,displayText:j.formatRangeDate(n.start||n.end?n:void 0,f),hasValue:!!(n.start||n.end),disabled:g,className:m,classNames:l,footer:i?.(e),formValue:j.formatRangeDate(n.start||n.end?n:void 0,""),required:c,children:r.jsx(V.Calendar,{className:x.cn("border-none",l?.calendar),mode:"range",selected:{from:n.start??void 0,to:n.end??void 0},onSelect:h=>{o({start:h?.from??null,end:h?.to??null})},disabled:s})})},N=({value:a,defaultValue:d,onValueChange:p,placeholder:f="Seleccionar fechas",disabled:g,disabledDate:s,renderFooter:i,className:m,classNames:l,required:c})=>{const[v,u]=P.useState(!1),[t,o]=C.useControllableState({prop:a,onChange:e=>p?.(e??[]),defaultProp:d??[]}),n={mode:"multiple",value:t??[],clear:()=>o([]),setValue:e=>o(e)};return r.jsx(k,{slot:"date-picker",open:v,onOpenChange:u,displayText:j.formatMultipleDates(t,f),hasValue:(t?.length??0)>0,disabled:g,className:m,classNames:l,footer:i?.(n),formValue:j.formatMultipleDates(t,""),required:c,children:r.jsx(V.Calendar,{className:x.cn("border-none",l?.calendar),mode:"multiple",selected:t??[],onSelect:e=>{o(e??[])},disabled:s})})};exports.DatePicker=O;
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as t, jsxs as C } from "react/jsx-runtime";
|
|
3
|
+
import { useControllableState as V } from "@radix-ui/react-use-controllable-state";
|
|
4
|
+
import { CalendarIcon as R } from "lucide-react";
|
|
5
|
+
import { useState as S, useRef as T } from "react";
|
|
6
|
+
import { formatRangeDate as y, formatMultipleDates as N, formatSingleDate as O } from "./date-picker.utils.es.js";
|
|
7
|
+
import { Calendar as k } from "../calendar/calendar.es.js";
|
|
8
|
+
import { cn as P } from "../../lib/cn.es.js";
|
|
9
|
+
import { PopoverRoot as w, PopoverTrigger as M, PopoverPopup as j } from "../popover/popover.es.js";
|
|
10
|
+
import { inputBaseClasses as D } from "../input/input.es.js";
|
|
11
|
+
import { FieldControl as E } from "../field/field.es.js";
|
|
12
|
+
function L(n) {
|
|
13
|
+
return n.mode === "range" ? /* @__PURE__ */ t(I, { ...n }) : n.mode === "multiple" ? /* @__PURE__ */ t($, { ...n }) : /* @__PURE__ */ t(F, { ...n });
|
|
14
|
+
}
|
|
15
|
+
const x = ({
|
|
16
|
+
open: n,
|
|
17
|
+
onOpenChange: u,
|
|
18
|
+
displayText: p,
|
|
19
|
+
hasValue: f,
|
|
20
|
+
disabled: m,
|
|
21
|
+
className: i,
|
|
22
|
+
classNames: d,
|
|
23
|
+
children: g,
|
|
24
|
+
footer: l,
|
|
25
|
+
slot: s,
|
|
26
|
+
formValue: v,
|
|
27
|
+
required: c
|
|
28
|
+
}) => {
|
|
29
|
+
const r = T(null);
|
|
30
|
+
return /* @__PURE__ */ C(w, { "data-slot": s, open: n, onOpenChange: u, children: [
|
|
31
|
+
/* @__PURE__ */ C(
|
|
32
|
+
M,
|
|
33
|
+
{
|
|
34
|
+
render: /* @__PURE__ */ t(
|
|
35
|
+
"button",
|
|
36
|
+
{
|
|
37
|
+
ref: r,
|
|
38
|
+
disabled: m,
|
|
39
|
+
className: P(
|
|
40
|
+
D,
|
|
41
|
+
"inline-flex items-center gap-2 h-8 cursor-pointer text-left",
|
|
42
|
+
"focus-visible:border-ring",
|
|
43
|
+
"aria-invalid:border-error focus-visible:aria-invalid:ring-error/20",
|
|
44
|
+
"group-data-[invalid]:border-error focus-visible:group-data-[invalid]:ring-error/20",
|
|
45
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
46
|
+
!f && "text-muted-foreground",
|
|
47
|
+
i
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
),
|
|
51
|
+
children: [
|
|
52
|
+
/* @__PURE__ */ t(R, { className: "shrink-0" }),
|
|
53
|
+
/* @__PURE__ */ t("span", { className: "truncate", children: p })
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
),
|
|
57
|
+
/* @__PURE__ */ t(
|
|
58
|
+
E,
|
|
59
|
+
{
|
|
60
|
+
render: /* @__PURE__ */ t(
|
|
61
|
+
"input",
|
|
62
|
+
{
|
|
63
|
+
type: "text",
|
|
64
|
+
tabIndex: -1,
|
|
65
|
+
"aria-hidden": "true",
|
|
66
|
+
className: "sr-only",
|
|
67
|
+
value: v,
|
|
68
|
+
onChange: () => {
|
|
69
|
+
},
|
|
70
|
+
required: c,
|
|
71
|
+
onFocus: () => r.current?.focus()
|
|
72
|
+
}
|
|
73
|
+
)
|
|
74
|
+
}
|
|
75
|
+
),
|
|
76
|
+
/* @__PURE__ */ C(
|
|
77
|
+
j,
|
|
78
|
+
{
|
|
79
|
+
className: P("w-auto p-0", d?.popup),
|
|
80
|
+
align: "start",
|
|
81
|
+
"data-slot": `${s}-content`,
|
|
82
|
+
children: [
|
|
83
|
+
g,
|
|
84
|
+
l && /* @__PURE__ */ t(
|
|
85
|
+
"div",
|
|
86
|
+
{
|
|
87
|
+
className: P("p-2", d?.footer),
|
|
88
|
+
"data-slot": `${s}-footer`,
|
|
89
|
+
children: l
|
|
90
|
+
}
|
|
91
|
+
)
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
)
|
|
95
|
+
] });
|
|
96
|
+
}, F = ({
|
|
97
|
+
value: n,
|
|
98
|
+
defaultValue: u,
|
|
99
|
+
onValueChange: p,
|
|
100
|
+
placeholder: f = "Seleccionar fecha",
|
|
101
|
+
disabled: m,
|
|
102
|
+
disabledDate: i,
|
|
103
|
+
renderFooter: d,
|
|
104
|
+
className: g,
|
|
105
|
+
classNames: l,
|
|
106
|
+
required: s
|
|
107
|
+
}) => {
|
|
108
|
+
const [v, c] = S(!1), [r, a] = V({
|
|
109
|
+
prop: n,
|
|
110
|
+
onChange: (e) => p?.(e ?? null),
|
|
111
|
+
defaultProp: u ?? null
|
|
112
|
+
}), o = {
|
|
113
|
+
mode: "single",
|
|
114
|
+
value: r ?? null,
|
|
115
|
+
clear: () => a(null),
|
|
116
|
+
selectToday: () => {
|
|
117
|
+
const e = /* @__PURE__ */ new Date();
|
|
118
|
+
i?.(e) || a(e);
|
|
119
|
+
},
|
|
120
|
+
setValue: (e) => a(e)
|
|
121
|
+
};
|
|
122
|
+
return /* @__PURE__ */ t(
|
|
123
|
+
x,
|
|
124
|
+
{
|
|
125
|
+
slot: "date-picker",
|
|
126
|
+
open: v,
|
|
127
|
+
onOpenChange: c,
|
|
128
|
+
displayText: O(r, f),
|
|
129
|
+
hasValue: !!r,
|
|
130
|
+
disabled: m,
|
|
131
|
+
className: g,
|
|
132
|
+
classNames: l,
|
|
133
|
+
footer: d?.(o),
|
|
134
|
+
formValue: O(r, ""),
|
|
135
|
+
required: s,
|
|
136
|
+
children: /* @__PURE__ */ t(
|
|
137
|
+
k,
|
|
138
|
+
{
|
|
139
|
+
className: P("border-none", l?.calendar),
|
|
140
|
+
mode: "single",
|
|
141
|
+
selected: r ?? void 0,
|
|
142
|
+
onSelect: (e) => {
|
|
143
|
+
i && e && i(e) || (a(e ?? null), c(!1));
|
|
144
|
+
},
|
|
145
|
+
disabled: i
|
|
146
|
+
}
|
|
147
|
+
)
|
|
148
|
+
}
|
|
149
|
+
);
|
|
150
|
+
}, b = { start: null, end: null }, I = ({
|
|
151
|
+
value: n,
|
|
152
|
+
defaultValue: u,
|
|
153
|
+
onValueChange: p,
|
|
154
|
+
placeholder: f = "Seleccionar rango",
|
|
155
|
+
disabled: m,
|
|
156
|
+
disabledDate: i,
|
|
157
|
+
renderFooter: d,
|
|
158
|
+
className: g,
|
|
159
|
+
classNames: l,
|
|
160
|
+
required: s
|
|
161
|
+
}) => {
|
|
162
|
+
const [v, c] = S(!1), [r, a] = V({
|
|
163
|
+
prop: n,
|
|
164
|
+
onChange: (h) => p?.(h ?? b),
|
|
165
|
+
defaultProp: u ?? b
|
|
166
|
+
}), o = r ?? b, e = {
|
|
167
|
+
mode: "range",
|
|
168
|
+
value: o,
|
|
169
|
+
clear: () => a(b),
|
|
170
|
+
setValue: (h) => a(h)
|
|
171
|
+
};
|
|
172
|
+
return /* @__PURE__ */ t(
|
|
173
|
+
x,
|
|
174
|
+
{
|
|
175
|
+
slot: "date-picker",
|
|
176
|
+
open: v,
|
|
177
|
+
onOpenChange: c,
|
|
178
|
+
displayText: y(
|
|
179
|
+
o.start || o.end ? o : void 0,
|
|
180
|
+
f
|
|
181
|
+
),
|
|
182
|
+
hasValue: !!(o.start || o.end),
|
|
183
|
+
disabled: m,
|
|
184
|
+
className: g,
|
|
185
|
+
classNames: l,
|
|
186
|
+
footer: d?.(e),
|
|
187
|
+
formValue: y(
|
|
188
|
+
o.start || o.end ? o : void 0,
|
|
189
|
+
""
|
|
190
|
+
),
|
|
191
|
+
required: s,
|
|
192
|
+
children: /* @__PURE__ */ t(
|
|
193
|
+
k,
|
|
194
|
+
{
|
|
195
|
+
className: P("border-none", l?.calendar),
|
|
196
|
+
mode: "range",
|
|
197
|
+
selected: {
|
|
198
|
+
from: o.start ?? void 0,
|
|
199
|
+
to: o.end ?? void 0
|
|
200
|
+
},
|
|
201
|
+
onSelect: (h) => {
|
|
202
|
+
a({ start: h?.from ?? null, end: h?.to ?? null });
|
|
203
|
+
},
|
|
204
|
+
disabled: i
|
|
205
|
+
}
|
|
206
|
+
)
|
|
207
|
+
}
|
|
208
|
+
);
|
|
209
|
+
}, $ = ({
|
|
210
|
+
value: n,
|
|
211
|
+
defaultValue: u,
|
|
212
|
+
onValueChange: p,
|
|
213
|
+
placeholder: f = "Seleccionar fechas",
|
|
214
|
+
disabled: m,
|
|
215
|
+
disabledDate: i,
|
|
216
|
+
renderFooter: d,
|
|
217
|
+
className: g,
|
|
218
|
+
classNames: l,
|
|
219
|
+
required: s
|
|
220
|
+
}) => {
|
|
221
|
+
const [v, c] = S(!1), [r, a] = V({
|
|
222
|
+
prop: n,
|
|
223
|
+
onChange: (e) => p?.(e ?? []),
|
|
224
|
+
defaultProp: u ?? []
|
|
225
|
+
}), o = {
|
|
226
|
+
mode: "multiple",
|
|
227
|
+
value: r ?? [],
|
|
228
|
+
clear: () => a([]),
|
|
229
|
+
setValue: (e) => a(e)
|
|
230
|
+
};
|
|
231
|
+
return /* @__PURE__ */ t(
|
|
232
|
+
x,
|
|
233
|
+
{
|
|
234
|
+
slot: "date-picker",
|
|
235
|
+
open: v,
|
|
236
|
+
onOpenChange: c,
|
|
237
|
+
displayText: N(r, f),
|
|
238
|
+
hasValue: (r?.length ?? 0) > 0,
|
|
239
|
+
disabled: m,
|
|
240
|
+
className: g,
|
|
241
|
+
classNames: l,
|
|
242
|
+
footer: d?.(o),
|
|
243
|
+
formValue: N(r, ""),
|
|
244
|
+
required: s,
|
|
245
|
+
children: /* @__PURE__ */ t(
|
|
246
|
+
k,
|
|
247
|
+
{
|
|
248
|
+
className: P("border-none", l?.calendar),
|
|
249
|
+
mode: "multiple",
|
|
250
|
+
selected: r ?? [],
|
|
251
|
+
onSelect: (e) => {
|
|
252
|
+
a(e ?? []);
|
|
253
|
+
},
|
|
254
|
+
disabled: i
|
|
255
|
+
}
|
|
256
|
+
)
|
|
257
|
+
}
|
|
258
|
+
);
|
|
259
|
+
};
|
|
260
|
+
export {
|
|
261
|
+
L as DatePicker
|
|
262
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("date-fns"),g="dd/MM/yyyy",S=(e,a)=>!e||!o.isDate(e)?a:o.format(e,g),$=(e,a)=>{if(!e)return a;const{start:i,end:u}=e;if(!i&&!u)return a;const N=i&&o.isDate(i)?o.format(i,g):"...",h=u&&o.isDate(u)?o.format(u,g):"...";return`${N} → ${h}`},M=(e,a)=>!e||e.length===0?a:e.length===1?o.format(e[0],g):`${e.length} fechas seleccionadas`,T=e=>o.isDate(e)?o.format(e,g):"",A=e=>{const a=e.trim();if(!a)return null;const i=/^(\d{1,2})\/(\d{1,2})\/(\d{1,4})$/.exec(a);if(!i)return null;const[,u,N,h]=i,n=Number(u),m=Number(N),l=h;let f=Number(l);if(Number.isNaN(n)||Number.isNaN(m)||Number.isNaN(f)||(l.length<=2&&(f=2e3+f),n<1||n>31||m<1||m>12))return null;const s=new Date(f,m-1,n);return s.getFullYear()!==f||s.getMonth()!==m-1||s.getDate()!==n?null:s},P=(e,a)=>{const i=(a.lastKey==="Backspace"||a.lastKey==="Delete")&&e.length<a.previousValue.length,u=e.includes("/"),N=e.trim().endsWith("/");if((e.match(/\//g)??[]).length>=2){const r=e.split("/"),t=(r[0]??"").replace(/\D/g,"").slice(0,2),b=(r[1]??"").replace(/\D/g,"").slice(0,2),p=(r[2]??"").replace(/\D/g,"").slice(0,4);return!t&&!b&&!p?"":`${t}/${b}/${p}`}const n=e.replace(/\D/g,"").slice(0,8);if(!n)return"";if(n.length<=2){let r=n;if(n.length===1&&(u||N)&&!i){let t=Number(r);Number.isNaN(t)&&(t=1),t<1&&(t=1),t>31&&(t=31),r=t.toString().padStart(2,"0"),r+="/"}else if(n.length===2&&!i){let t=Number(r);Number.isNaN(t)&&(t=1),t<1&&(t=1),t>31&&(t=31),r=t.toString().padStart(2,"0"),r+="/"}return r}const m=n.slice(0,2);let l=Number(m);Number.isNaN(l)&&(l=1),l<1&&(l=1),l>31&&(l=31);const f=l.toString().padStart(2,"0"),s=n.slice(2,4),d=n.slice(4);let c="";if(s.length===0)c="";else if(s.length===1&&d.length===0){const r=N&&!i&&s.length===1;if(s==="0"||s==="1")if(r){let t=Number(s);Number.isNaN(t)&&(t=1),t<1&&(t=1),t>12&&(t=12),c=t.toString().padStart(2,"0")}else c=s;else{let t=Number(s);Number.isNaN(t)&&(t=1),t<1&&(t=1),t>12&&(t=12),c=t.toString().padStart(2,"0")}}else{let r=Number(s);Number.isNaN(r)&&(r=1),r<1&&(r=1),r>12&&(r=12),c=r.toString().padStart(2,"0")}const D=`${f}/${c}`,y=!d&&c.length===2&&!i;return d?`${D}/${d}`:y?`${D}/`:D};exports.DISPLAY_DATE_FORMAT=g;exports.formatDate=T;exports.formatMultipleDates=M;exports.formatRangeDate=$;exports.formatSingleDate=S;exports.maskDateInput=P;exports.parseInputToDate=A;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { isDate as b, format as N } from "date-fns";
|
|
2
|
+
const g = "dd/MM/yyyy", k = (e, i) => !e || !b(e) ? i : N(e, g), P = (e, i) => {
|
|
3
|
+
if (!e) return i;
|
|
4
|
+
const { start: a, end: o } = e;
|
|
5
|
+
if (!a && !o) return i;
|
|
6
|
+
const f = a && b(a) ? N(a, g) : "...", h = o && b(o) ? N(o, g) : "...";
|
|
7
|
+
return `${f} → ${h}`;
|
|
8
|
+
}, A = (e, i) => !e || e.length === 0 ? i : e.length === 1 ? N(e[0], g) : `${e.length} fechas seleccionadas`, R = (e) => b(e) ? N(e, g) : "", T = (e) => {
|
|
9
|
+
const i = e.trim();
|
|
10
|
+
if (!i) return null;
|
|
11
|
+
const a = /^(\d{1,2})\/(\d{1,2})\/(\d{1,4})$/.exec(i);
|
|
12
|
+
if (!a) return null;
|
|
13
|
+
const [, o, f, h] = a, n = Number(o), u = Number(f), l = h;
|
|
14
|
+
let c = Number(l);
|
|
15
|
+
if (Number.isNaN(n) || Number.isNaN(u) || Number.isNaN(c) || (l.length <= 2 && (c = 2e3 + c), n < 1 || n > 31 || u < 1 || u > 12))
|
|
16
|
+
return null;
|
|
17
|
+
const s = new Date(c, u - 1, n);
|
|
18
|
+
return s.getFullYear() !== c || s.getMonth() !== u - 1 || s.getDate() !== n ? null : s;
|
|
19
|
+
}, Y = (e, i) => {
|
|
20
|
+
const a = (i.lastKey === "Backspace" || i.lastKey === "Delete") && e.length < i.previousValue.length, o = e.includes("/"), f = e.trim().endsWith("/");
|
|
21
|
+
if ((e.match(/\//g) ?? []).length >= 2) {
|
|
22
|
+
const r = e.split("/"), t = (r[0] ?? "").replace(/\D/g, "").slice(0, 2), D = (r[1] ?? "").replace(/\D/g, "").slice(0, 2), p = (r[2] ?? "").replace(/\D/g, "").slice(0, 4);
|
|
23
|
+
return !t && !D && !p ? "" : `${t}/${D}/${p}`;
|
|
24
|
+
}
|
|
25
|
+
const n = e.replace(/\D/g, "").slice(0, 8);
|
|
26
|
+
if (!n)
|
|
27
|
+
return "";
|
|
28
|
+
if (n.length <= 2) {
|
|
29
|
+
let r = n;
|
|
30
|
+
if (n.length === 1 && (o || f) && !a) {
|
|
31
|
+
let t = Number(r);
|
|
32
|
+
Number.isNaN(t) && (t = 1), t < 1 && (t = 1), t > 31 && (t = 31), r = t.toString().padStart(2, "0"), r += "/";
|
|
33
|
+
} else if (n.length === 2 && !a) {
|
|
34
|
+
let t = Number(r);
|
|
35
|
+
Number.isNaN(t) && (t = 1), t < 1 && (t = 1), t > 31 && (t = 31), r = t.toString().padStart(2, "0"), r += "/";
|
|
36
|
+
}
|
|
37
|
+
return r;
|
|
38
|
+
}
|
|
39
|
+
const u = n.slice(0, 2);
|
|
40
|
+
let l = Number(u);
|
|
41
|
+
Number.isNaN(l) && (l = 1), l < 1 && (l = 1), l > 31 && (l = 31);
|
|
42
|
+
const c = l.toString().padStart(2, "0"), s = n.slice(2, 4), d = n.slice(4);
|
|
43
|
+
let m = "";
|
|
44
|
+
if (s.length === 0)
|
|
45
|
+
m = "";
|
|
46
|
+
else if (s.length === 1 && d.length === 0) {
|
|
47
|
+
const r = f && !a && s.length === 1;
|
|
48
|
+
if (s === "0" || s === "1")
|
|
49
|
+
if (r) {
|
|
50
|
+
let t = Number(s);
|
|
51
|
+
Number.isNaN(t) && (t = 1), t < 1 && (t = 1), t > 12 && (t = 12), m = t.toString().padStart(2, "0");
|
|
52
|
+
} else
|
|
53
|
+
m = s;
|
|
54
|
+
else {
|
|
55
|
+
let t = Number(s);
|
|
56
|
+
Number.isNaN(t) && (t = 1), t < 1 && (t = 1), t > 12 && (t = 12), m = t.toString().padStart(2, "0");
|
|
57
|
+
}
|
|
58
|
+
} else {
|
|
59
|
+
let r = Number(s);
|
|
60
|
+
Number.isNaN(r) && (r = 1), r < 1 && (r = 1), r > 12 && (r = 12), m = r.toString().padStart(2, "0");
|
|
61
|
+
}
|
|
62
|
+
const y = `${c}/${m}`, S = !d && m.length === 2 && !a;
|
|
63
|
+
return d ? `${y}/${d}` : S ? `${y}/` : y;
|
|
64
|
+
};
|
|
65
|
+
export {
|
|
66
|
+
g as DISPLAY_DATE_FORMAT,
|
|
67
|
+
R as formatDate,
|
|
68
|
+
A as formatMultipleDates,
|
|
69
|
+
P as formatRangeDate,
|
|
70
|
+
k as formatSingleDate,
|
|
71
|
+
Y as maskDateInput,
|
|
72
|
+
T as parseInputToDate
|
|
73
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react"),c=(s={})=>{const{disabled:n}=s,[a,t]=u.useState(!1),r=u.useRef(null),o=u.useCallback(e=>{if(!n){if(e.key===" "||e.key==="Spacebar"){e.preventDefault(),t(!0);return}e.key==="Escape"&&(t(!1),requestAnimationFrame(()=>{r.current?.focus()}))}},[n]);return{open:a,setOpen:t,handleInputKeyDown:o,inputRef:r}};exports.useDateInputPopover=c;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { useState as o, useRef as p, useCallback as c } from "react";
|
|
2
|
+
const l = (s = {}) => {
|
|
3
|
+
const { disabled: n } = s, [u, t] = o(!1), r = p(null), a = c(
|
|
4
|
+
(e) => {
|
|
5
|
+
if (!n) {
|
|
6
|
+
if (e.key === " " || e.key === "Spacebar") {
|
|
7
|
+
e.preventDefault(), t(!0);
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
e.key === "Escape" && (t(!1), requestAnimationFrame(() => {
|
|
11
|
+
r.current?.focus();
|
|
12
|
+
}));
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
[n]
|
|
16
|
+
);
|
|
17
|
+
return {
|
|
18
|
+
open: u,
|
|
19
|
+
setOpen: t,
|
|
20
|
+
handleInputKeyDown: a,
|
|
21
|
+
inputRef: r
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export {
|
|
25
|
+
l as useDateInputPopover
|
|
26
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react"),a=require("./date-picker.utils.cjs.js"),p=d=>{const{date:o,onDateChange:u,disabledDate:m}=d,[f,r]=s.useState(""),i=s.useRef(null),n=s.useRef("");s.useEffect(()=>{const t=a.formatDate(o??null);r(t),n.current=t},[o]);const D=()=>{const t=f.trim();if(!t){u(null),r(""),n.current="";return}const e=a.parseInputToDate(t);if(!e){u(null),r(""),n.current="";return}if(m?.(e)){const c=a.formatDate(o??null);r(c),n.current=c;return}u(e);const l=a.formatDate(e);r(l),n.current=l};return{inputValue:f,handleChange:t=>{const e=t.target.value,l={lastKey:i.current,previousValue:n.current},c=a.maskDateInput(e,l);r(c),n.current=c},handleBlur:()=>{D()},handleKeyDown:t=>{if(i.current=t.key,t.key==="Enter"){t.preventDefault(),D();return}if(t.key==="Escape"){t.preventDefault();const e=a.formatDate(o??null);r(e),n.current=e}},clear:()=>{u(null),r(""),n.current=""},setFromExternalDate:t=>{u(t);const e=a.formatDate(t??null);r(e),n.current=e}}};exports.useDateInput=p;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { useState as D, useRef as p, useEffect as h } from "react";
|
|
2
|
+
import { formatDate as c, maskDateInput as y, parseInputToDate as k } from "./date-picker.utils.es.js";
|
|
3
|
+
const C = (d) => {
|
|
4
|
+
const { date: l, onDateChange: a, disabledDate: i } = d, [s, r] = D(""), f = p(null), n = p("");
|
|
5
|
+
h(() => {
|
|
6
|
+
const t = c(l ?? null);
|
|
7
|
+
r(t), n.current = t;
|
|
8
|
+
}, [l]);
|
|
9
|
+
const m = () => {
|
|
10
|
+
const t = s.trim();
|
|
11
|
+
if (!t) {
|
|
12
|
+
a(null), r(""), n.current = "";
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
const e = k(t);
|
|
16
|
+
if (!e) {
|
|
17
|
+
a(null), r(""), n.current = "";
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
if (i?.(e)) {
|
|
21
|
+
const u = c(l ?? null);
|
|
22
|
+
r(u), n.current = u;
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
a(e);
|
|
26
|
+
const o = c(e);
|
|
27
|
+
r(o), n.current = o;
|
|
28
|
+
};
|
|
29
|
+
return {
|
|
30
|
+
inputValue: s,
|
|
31
|
+
handleChange: (t) => {
|
|
32
|
+
const e = t.target.value, o = {
|
|
33
|
+
lastKey: f.current,
|
|
34
|
+
previousValue: n.current
|
|
35
|
+
}, u = y(e, o);
|
|
36
|
+
r(u), n.current = u;
|
|
37
|
+
},
|
|
38
|
+
handleBlur: () => {
|
|
39
|
+
m();
|
|
40
|
+
},
|
|
41
|
+
handleKeyDown: (t) => {
|
|
42
|
+
if (f.current = t.key, t.key === "Enter") {
|
|
43
|
+
t.preventDefault(), m();
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
if (t.key === "Escape") {
|
|
47
|
+
t.preventDefault();
|
|
48
|
+
const e = c(l ?? null);
|
|
49
|
+
r(e), n.current = e;
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
clear: () => {
|
|
53
|
+
a(null), r(""), n.current = "";
|
|
54
|
+
},
|
|
55
|
+
setFromExternalDate: (t) => {
|
|
56
|
+
a(t);
|
|
57
|
+
const e = c(t ?? null);
|
|
58
|
+
r(e), n.current = e;
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
export {
|
|
63
|
+
C as useDateInput
|
|
64
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),t=require("@base-ui/react/dialog"),N=require("lucide-react"),i=require("../../lib/cn.cjs.js"),B=require("../button/button.cjs.js");function d(a){return o.jsx(t.Dialog.Root,{...a})}function u({className:a,...e}){return o.jsx(t.Dialog.Trigger,{"data-slot":"dialog-trigger",className:i.cn(a),...e})}function p({className:a,...e}){return o.jsx(t.Dialog.Backdrop,{"data-slot":"dialog-backdrop",forceRender:!0,className:i.cn("fixed inset-0 z-overlay bg-black/50","transition-opacity duration-200","data-starting-style:opacity-0 data-ending-style:opacity-0",a),...e})}function x({className:a,...e}){return o.jsx(t.Dialog.Viewport,{"data-slot":"dialog-viewport",className:i.cn("fixed inset-0 z-overlay flex items-center justify-center p-4",a),...e})}function D({className:a,classNames:e,children:r,hideClose:s,portalProps:n,...c}){return o.jsxs(t.Dialog.Portal,{...n,children:[o.jsx(p,{className:e?.backdrop}),o.jsx(x,{className:e?.viewport,children:o.jsxs(t.Dialog.Popup,{"data-slot":"dialog-popup",className:i.cn("relative flex w-full max-w-lg flex-col gap-4 rounded-lg border bg-background p-6 shadow-lg","transition-[scale,opacity] duration-200 ease-out","data-starting-style:scale-95 data-starting-style:opacity-0","data-ending-style:scale-95 data-ending-style:opacity-0",a),...c,children:[r,!s&&o.jsx(t.Dialog.Close,{"aria-label":"Cerrar",className:i.cn("absolute right-2 top-2",e?.closeButton),render:o.jsx(B.Button,{size:"icon",variant:"ghost"}),children:o.jsx(N.X,{className:"size-4"})})]})})]})}function P({className:a,...e}){return o.jsx(t.Dialog.Close,{"data-slot":"dialog-close",className:i.cn(a),...e})}function f({className:a,...e}){return o.jsx(t.Dialog.Title,{"data-slot":"dialog-title",className:i.cn("text-lg font-semibold leading-none tracking-tight",a),...e})}function j({className:a,...e}){return o.jsx(t.Dialog.Description,{"data-slot":"dialog-description",className:i.cn("text-sm text-muted-foreground",a),...e})}function m({className:a,...e}){return o.jsx("div",{"data-slot":"dialog-header",className:i.cn("flex flex-col gap-2",a),...e})}function y({className:a,...e}){return o.jsx("div",{"data-slot":"dialog-footer",className:i.cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",a),...e})}function T({trigger:a,title:e,description:r,children:s,footer:n,onClose:c,hideClose:b,className:h,classNames:l,onOpenChange:v,...w}){return o.jsxs(d,{onOpenChange:(g,k)=>{g||c?.(),v?.(g,k)},...w,children:[a&&o.jsx(u,{render:a}),o.jsxs(D,{className:h,hideClose:b,classNames:{backdrop:l?.backdrop,viewport:l?.viewport,closeButton:l?.closeButton},children:[(e||r)&&o.jsxs(m,{className:l?.header,children:[e&&o.jsx(f,{className:l?.title,children:e}),r&&o.jsx(j,{className:l?.description,children:r})]}),s,n&&o.jsx(y,{className:l?.footer,children:n})]})]})}Object.defineProperty(exports,"DialogPrimitive",{enumerable:!0,get:()=>t.Dialog});exports.Dialog=T;exports.DialogBackdrop=p;exports.DialogClose=P;exports.DialogDescription=j;exports.DialogFooter=y;exports.DialogHeader=m;exports.DialogPopup=D;exports.DialogRoot=d;exports.DialogTitle=f;exports.DialogTrigger=u;exports.DialogViewport=x;
|