asheeui 0.6.15 → 1.0.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/dist/AsheeUIProvider.d.ts.map +1 -1
- package/dist/AsheeUIProvider.js +29 -24
- package/dist/components/accordion/Accordion.d.ts.map +1 -1
- package/dist/components/accordion/Accordion.js +81 -173
- package/dist/components/accordion/accordion-config.js +12 -13
- package/dist/components/accordion/accordion-styles.js +21 -24
- package/dist/components/alert/Alert.d.ts +88 -0
- package/dist/components/alert/Alert.d.ts.map +1 -0
- package/dist/components/alert/Alert.js +61 -0
- package/dist/components/alert/alert-config.d.ts +56 -0
- package/dist/components/alert/alert-config.d.ts.map +1 -0
- package/dist/components/alert/alert-config.js +14 -0
- package/dist/components/alert/alert-styles.d.ts +32 -0
- package/dist/components/alert/alert-styles.d.ts.map +1 -0
- package/dist/components/alert/alert-styles.js +20 -0
- package/dist/components/alert/index.d.ts +3 -0
- package/dist/components/alert/index.d.ts.map +1 -0
- package/dist/components/alert/index.js +3 -0
- package/dist/components/autocomplete/Autocomplete.d.ts +6 -6
- package/dist/components/autocomplete/Autocomplete.d.ts.map +1 -1
- package/dist/components/autocomplete/Autocomplete.js +114 -136
- package/dist/components/autocomplete/autocomplete-config.d.ts +1 -1
- package/dist/components/autocomplete/autocomplete-config.d.ts.map +1 -1
- package/dist/components/autocomplete/autocomplete-config.js +7 -12
- package/dist/components/avatar/Avatar.d.ts +87 -0
- package/dist/components/avatar/Avatar.d.ts.map +1 -0
- package/dist/components/avatar/Avatar.js +43 -0
- package/dist/components/avatar/avatar-config.d.ts +48 -0
- package/dist/components/avatar/avatar-config.d.ts.map +1 -0
- package/dist/components/avatar/avatar-config.js +14 -0
- package/dist/components/avatar/avatar-styles.d.ts +21 -0
- package/dist/components/avatar/avatar-styles.d.ts.map +1 -0
- package/dist/components/avatar/avatar-styles.js +13 -0
- package/dist/components/avatar/avatar.helpers.d.ts +19 -0
- package/dist/components/avatar/avatar.helpers.d.ts.map +1 -0
- package/dist/components/avatar/avatar.helpers.js +11 -0
- package/dist/components/avatar/index.d.ts +3 -0
- package/dist/components/avatar/index.d.ts.map +1 -0
- package/dist/components/avatar/index.js +4 -0
- package/dist/components/badge/Badge.d.ts +69 -0
- package/dist/components/badge/Badge.d.ts.map +1 -0
- package/dist/components/badge/Badge.js +39 -0
- package/dist/components/badge/badge-config.d.ts +63 -0
- package/dist/components/badge/badge-config.d.ts.map +1 -0
- package/dist/components/badge/badge-config.js +15 -0
- package/dist/components/badge/badge-styles.d.ts +27 -0
- package/dist/components/badge/badge-styles.d.ts.map +1 -0
- package/dist/components/badge/badge-styles.js +25 -0
- package/dist/components/badge/index.d.ts +3 -0
- package/dist/components/badge/index.d.ts.map +1 -0
- package/dist/components/badge/index.js +3 -0
- package/dist/components/breadcrumb/Breadcrumb.d.ts +106 -0
- package/dist/components/breadcrumb/Breadcrumb.d.ts.map +1 -0
- package/dist/components/breadcrumb/Breadcrumb.js +52 -0
- package/dist/components/breadcrumb/breadcrumb-config.d.ts +41 -0
- package/dist/components/breadcrumb/breadcrumb-config.d.ts.map +1 -0
- package/dist/components/breadcrumb/breadcrumb-config.js +10 -0
- package/dist/components/breadcrumb/breadcrumb-styles.d.ts +28 -0
- package/dist/components/breadcrumb/breadcrumb-styles.d.ts.map +1 -0
- package/dist/components/breadcrumb/breadcrumb-styles.js +17 -0
- package/dist/components/breadcrumb/index.d.ts +3 -0
- package/dist/components/breadcrumb/index.d.ts.map +1 -0
- package/dist/components/breadcrumb/index.js +3 -0
- package/dist/components/button/Button.d.ts +29 -1
- package/dist/components/button/Button.d.ts.map +1 -1
- package/dist/components/button/Button.js +50 -108
- package/dist/components/button/button-config.js +16 -17
- package/dist/components/button/button-styles.js +10 -11
- package/dist/components/{date-picker/DatePicker.d.ts → calendar/Calendar.d.ts} +22 -22
- package/dist/components/calendar/Calendar.d.ts.map +1 -0
- package/dist/components/calendar/Calendar.js +123 -0
- package/dist/components/{date-picker/Calendar.d.ts → calendar/DateGrid.d.ts} +7 -7
- package/dist/components/calendar/DateGrid.d.ts.map +1 -0
- package/dist/components/calendar/DateGrid.js +194 -0
- package/dist/components/calendar/TimeSpinner.d.ts.map +1 -0
- package/dist/components/calendar/TimeSpinner.js +60 -0
- package/dist/components/{date-picker/date-picker-config.d.ts → calendar/calendar-config.d.ts} +17 -17
- package/dist/components/calendar/calendar-config.d.ts.map +1 -0
- package/dist/components/calendar/calendar-config.js +15 -0
- package/dist/components/{date-picker/date-picker-styles.d.ts → calendar/calendar-styles.d.ts} +1 -1
- package/dist/components/calendar/calendar-styles.d.ts.map +1 -0
- package/dist/components/calendar/calendar-styles.js +46 -0
- package/dist/components/{date-picker/date-picker.helpers.d.ts → calendar/calendar.helpers.d.ts} +9 -9
- package/dist/components/calendar/calendar.helpers.d.ts.map +1 -0
- package/dist/components/calendar/calendar.helpers.js +82 -0
- package/dist/components/calendar/index.d.ts +3 -0
- package/dist/components/calendar/index.d.ts.map +1 -0
- package/dist/components/calendar/index.js +6 -0
- package/dist/components/card/Card.d.ts +36 -16
- package/dist/components/card/Card.d.ts.map +1 -1
- package/dist/components/card/Card.js +115 -205
- package/dist/components/card/card-config.js +24 -21
- package/dist/components/card/card-styles.js +19 -22
- package/dist/components/carousel/Carousel.d.ts.map +1 -1
- package/dist/components/carousel/Carousel.js +125 -248
- package/dist/components/carousel/carousel-config.js +24 -25
- package/dist/components/carousel/carousel-styles.d.ts +1 -20
- package/dist/components/carousel/carousel-styles.d.ts.map +1 -1
- package/dist/components/carousel/carousel-styles.js +14 -16
- package/dist/components/chip/Chip.js +84 -191
- package/dist/components/chip/chip-config.js +13 -14
- package/dist/components/chip/chip-styles.js +22 -26
- package/dist/components/drawer/Drawer.d.ts +33 -11
- package/dist/components/drawer/Drawer.d.ts.map +1 -1
- package/dist/components/drawer/Drawer.js +70 -131
- package/dist/components/drawer/drawer-config.js +14 -15
- package/dist/components/drawer/drawer-styles.js +38 -42
- package/dist/components/{select/Select.d.ts → dropmenu/Dropmenu.d.ts} +22 -21
- package/dist/components/dropmenu/Dropmenu.d.ts.map +1 -0
- package/dist/components/dropmenu/Dropmenu.js +102 -0
- package/dist/components/{select/select-config.d.ts → dropmenu/dropmenu-config.d.ts} +8 -8
- package/dist/components/dropmenu/dropmenu-config.d.ts.map +1 -0
- package/dist/components/dropmenu/dropmenu-config.js +9 -0
- package/dist/components/{select/select-styles.d.ts → dropmenu/dropmenu-styles.d.ts} +1 -1
- package/dist/components/dropmenu/dropmenu-styles.d.ts.map +1 -0
- package/dist/components/dropmenu/dropmenu-styles.js +6 -0
- package/dist/components/dropmenu/index.d.ts +3 -0
- package/dist/components/dropmenu/index.d.ts.map +1 -0
- package/dist/components/dropmenu/index.js +3 -0
- package/dist/components/field/FieldShell.d.ts +13 -1
- package/dist/components/field/FieldShell.d.ts.map +1 -1
- package/dist/components/field/FieldShell.js +50 -56
- package/dist/components/field/field-config.js +17 -18
- package/dist/components/field/field-styles.js +8 -8
- package/dist/components/form/Form.d.ts +109 -0
- package/dist/components/form/Form.d.ts.map +1 -0
- package/dist/components/form/Form.js +42 -0
- package/dist/components/form/form-config.d.ts +57 -0
- package/dist/components/form/form-config.d.ts.map +1 -0
- package/dist/components/form/form-config.js +12 -0
- package/dist/components/form/form-styles.d.ts +27 -0
- package/dist/components/form/form-styles.d.ts.map +1 -0
- package/dist/components/form/form-styles.js +5 -0
- package/dist/components/form/index.d.ts +3 -0
- package/dist/components/form/index.d.ts.map +1 -0
- package/dist/components/form/index.js +3 -0
- package/dist/components/image/Image.d.ts +8 -9
- package/dist/components/image/Image.d.ts.map +1 -1
- package/dist/components/image/Image.js +65 -132
- package/dist/components/image/image-config.js +17 -18
- package/dist/components/image/image-styles.js +14 -15
- package/dist/components/input/Input.js +65 -150
- package/dist/components/input/PasswordInput.js +30 -49
- package/dist/components/input/input-config.js +7 -7
- package/dist/components/input/input-styles.js +9 -10
- package/dist/components/keyboard/KeyboardContext.js +10 -11
- package/dist/components/keyboard/KeyboardProvider.js +100 -181
- package/dist/components/keyboard/OnScreenKeyboard.d.ts.map +1 -1
- package/dist/components/keyboard/OnScreenKeyboard.js +159 -166
- package/dist/components/keyboard/keyboard-config.js +59 -57
- package/dist/components/keyboard/keyboard-styles.js +10 -11
- package/dist/components/keyboard/use-keyboard-field.js +29 -21
- package/dist/components/link/Link.d.ts +12 -10
- package/dist/components/link/Link.d.ts.map +1 -1
- package/dist/components/link/Link.js +47 -137
- package/dist/components/link/link-config.js +14 -15
- package/dist/components/link/link-styles.js +25 -29
- package/dist/components/marquee/Marquee.d.ts.map +1 -1
- package/dist/components/marquee/Marquee.js +58 -144
- package/dist/components/marquee/marquee-config.js +18 -19
- package/dist/components/marquee/marquee-styles.js +13 -15
- package/dist/components/{select-menu/SelectMenu.d.ts → menu/Menu.d.ts} +52 -19
- package/dist/components/menu/Menu.d.ts.map +1 -0
- package/dist/components/menu/Menu.js +161 -0
- package/dist/components/menu/index.d.ts +5 -0
- package/dist/components/menu/index.d.ts.map +1 -0
- package/dist/components/menu/index.js +4 -0
- package/dist/components/{select-menu/select-menu-config.d.ts → menu/menu-config.d.ts} +5 -5
- package/dist/components/menu/menu-config.d.ts.map +1 -0
- package/dist/components/menu/menu-config.js +14 -0
- package/dist/components/menu/menu-navigation.d.ts +38 -0
- package/dist/components/menu/menu-navigation.d.ts.map +1 -0
- package/dist/components/menu/menu-navigation.js +20 -0
- package/dist/components/{select-menu/use-select-floating.d.ts → menu/use-menu-floating.d.ts} +20 -10
- package/dist/components/menu/use-menu-floating.d.ts.map +1 -0
- package/dist/components/menu/use-menu-floating.js +43 -0
- package/dist/components/modal/Modal.d.ts +32 -11
- package/dist/components/modal/Modal.d.ts.map +1 -1
- package/dist/components/modal/Modal.js +74 -137
- package/dist/components/modal/modal-config.js +15 -16
- package/dist/components/modal/modal-styles.js +13 -14
- package/dist/components/multi-select/MultiSelect.d.ts +29 -12
- package/dist/components/multi-select/MultiSelect.d.ts.map +1 -1
- package/dist/components/multi-select/MultiSelect.js +162 -283
- package/dist/components/multi-select/multi-select-config.d.ts +24 -19
- package/dist/components/multi-select/multi-select-config.d.ts.map +1 -1
- package/dist/components/multi-select/multi-select-config.js +18 -21
- package/dist/components/multi-select/multi-select-styles.js +17 -20
- package/dist/components/pagination/Pagination.d.ts +91 -0
- package/dist/components/pagination/Pagination.d.ts.map +1 -0
- package/dist/components/pagination/Pagination.js +66 -0
- package/dist/components/pagination/index.d.ts +3 -0
- package/dist/components/pagination/index.d.ts.map +1 -0
- package/dist/components/pagination/index.js +4 -0
- package/dist/components/pagination/pagination-config.d.ts +66 -0
- package/dist/components/pagination/pagination-config.d.ts.map +1 -0
- package/dist/components/pagination/pagination-config.js +19 -0
- package/dist/components/pagination/pagination-styles.d.ts +19 -0
- package/dist/components/pagination/pagination-styles.d.ts.map +1 -0
- package/dist/components/pagination/pagination-styles.js +5 -0
- package/dist/components/pagination/pagination.helpers.d.ts +26 -0
- package/dist/components/pagination/pagination.helpers.d.ts.map +1 -0
- package/dist/components/pagination/pagination.helpers.js +12 -0
- package/dist/components/radio/Radio.d.ts +53 -107
- package/dist/components/radio/Radio.d.ts.map +1 -1
- package/dist/components/radio/Radio.js +56 -79
- package/dist/components/radio/RadioGroup.d.ts +107 -53
- package/dist/components/radio/RadioGroup.d.ts.map +1 -1
- package/dist/components/radio/RadioGroup.js +51 -155
- package/dist/components/radio/index.d.ts +0 -1
- package/dist/components/radio/index.d.ts.map +1 -1
- package/dist/components/radio/radio-config.js +15 -16
- package/dist/components/radio/radio-context.js +6 -6
- package/dist/components/radio/radio-styles.js +55 -60
- package/dist/components/resizable-screen/ResizableScreen.d.ts +4 -4
- package/dist/components/resizable-screen/ResizableScreen.js +87 -177
- package/dist/components/resizable-screen/resizable-screen-config.js +16 -17
- package/dist/components/scrollbar/index.js +1 -0
- package/dist/components/scrollbar/scrollbar-config.js +13 -0
- package/dist/components/sidebar/Sidebar.d.ts +43 -22
- package/dist/components/sidebar/Sidebar.d.ts.map +1 -1
- package/dist/components/sidebar/Sidebar.js +148 -331
- package/dist/components/sidebar/sidebar-config.d.ts +98 -31
- package/dist/components/sidebar/sidebar-config.d.ts.map +1 -1
- package/dist/components/sidebar/sidebar-config.js +47 -33
- package/dist/components/sidebar/sidebar-styles.js +27 -32
- package/dist/components/skeleton/Skeleton.d.ts +65 -0
- package/dist/components/skeleton/Skeleton.d.ts.map +1 -0
- package/dist/components/skeleton/Skeleton.js +29 -0
- package/dist/components/skeleton/index.d.ts +3 -0
- package/dist/components/skeleton/index.d.ts.map +1 -0
- package/dist/components/skeleton/index.js +3 -0
- package/dist/components/skeleton/skeleton-config.d.ts +40 -0
- package/dist/components/skeleton/skeleton-config.d.ts.map +1 -0
- package/dist/components/skeleton/skeleton-config.js +13 -0
- package/dist/components/skeleton/skeleton-styles.d.ts +19 -0
- package/dist/components/skeleton/skeleton-styles.d.ts.map +1 -0
- package/dist/components/skeleton/skeleton-styles.js +5 -0
- package/dist/components/spinner/spinner-config.js +12 -13
- package/dist/components/spinner/spinner-styles.js +13 -14
- package/dist/components/spinner/spinner.js +39 -82
- package/dist/components/switch/Switch.d.ts.map +1 -1
- package/dist/components/switch/Switch.js +64 -154
- package/dist/components/switch/switch-config.js +11 -12
- package/dist/components/switch/switch-styles.js +14 -16
- package/dist/components/table/Table.js +64 -186
- package/dist/components/table/table-config.js +17 -18
- package/dist/components/table/table-styles.js +48 -52
- package/dist/components/tabs/Tabs.d.ts +16 -8
- package/dist/components/tabs/Tabs.d.ts.map +1 -1
- package/dist/components/tabs/Tabs.js +93 -208
- package/dist/components/tabs/tabs-config.d.ts +42 -20
- package/dist/components/tabs/tabs-config.d.ts.map +1 -1
- package/dist/components/tabs/tabs-config.js +26 -18
- package/dist/components/tabs/tabs-styles.js +15 -17
- package/dist/components/textarea/Textarea.d.ts +10 -10
- package/dist/components/textarea/Textarea.js +52 -138
- package/dist/components/textarea/textarea-config.d.ts +2 -2
- package/dist/components/textarea/textarea-config.js +10 -11
- package/dist/components/textarea/textarea-styles.js +9 -10
- package/dist/components/toast/ToastContext.js +22 -26
- package/dist/components/toast/ToastItem.d.ts.map +1 -1
- package/dist/components/toast/ToastItem.js +83 -144
- package/dist/components/toast/ToastProvider.d.ts.map +1 -1
- package/dist/components/toast/ToastProvider.js +128 -190
- package/dist/components/toast/toast-config.js +23 -24
- package/dist/components/toast/toast-styles.js +50 -55
- package/dist/components/toast/use-pausable-timeout.js +17 -13
- package/dist/components/tooltip/Tooltip.d.ts +5 -0
- package/dist/components/tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/tooltip/Tooltip.js +68 -158
- package/dist/components/tooltip/tooltip-config.d.ts +25 -0
- package/dist/components/tooltip/tooltip-config.d.ts.map +1 -1
- package/dist/components/tooltip/tooltip-config.js +26 -22
- package/dist/components/tooltip/tooltip-styles.js +15 -17
- package/dist/components/typography/Typography.d.ts +60 -0
- package/dist/components/typography/Typography.d.ts.map +1 -0
- package/dist/components/typography/Typography.js +28 -0
- package/dist/components/typography/index.d.ts +3 -0
- package/dist/components/typography/index.d.ts.map +1 -0
- package/dist/components/typography/index.js +3 -0
- package/dist/components/typography/typography-config.d.ts +54 -0
- package/dist/components/typography/typography-config.d.ts.map +1 -0
- package/dist/components/typography/typography-config.js +12 -0
- package/dist/components/typography/typography-styles.d.ts +21 -0
- package/dist/components/typography/typography-styles.d.ts.map +1 -0
- package/dist/components/typography/typography-styles.js +19 -0
- package/dist/config/default-config.d.ts.map +1 -1
- package/dist/config/default-config.js +11 -34
- package/dist/config/index.js +1 -0
- package/dist/config/resolve-color.js +23 -23
- package/dist/config/resolve-config.d.ts.map +1 -1
- package/dist/config/resolve-config.js +14 -12
- package/dist/config/validate-config.d.ts +34 -0
- package/dist/config/validate-config.d.ts.map +1 -0
- package/dist/config/validate-config.js +190 -0
- package/dist/icons/ArrowLeftIcon.js +16 -19
- package/dist/icons/CalendarIcon.js +43 -24
- package/dist/icons/CheckIcon.js +16 -19
- package/dist/icons/ChevronDownIcon.js +15 -21
- package/dist/icons/ChevronLeftIcon.js +16 -19
- package/dist/icons/ChevronRightIcon.js +16 -19
- package/dist/icons/ChevronUpIcon.js +16 -19
- package/dist/icons/ClearIcon.js +26 -22
- package/dist/icons/ClockIcon.js +20 -22
- package/dist/icons/CloseIcon.js +26 -22
- package/dist/icons/ErrorIcon.js +16 -19
- package/dist/icons/ExternalLinkIcon.js +25 -23
- package/dist/icons/EyeIcon.js +20 -22
- package/dist/icons/EyeOffIcon.js +21 -22
- package/dist/icons/InfoIcon.js +16 -19
- package/dist/icons/SearchIcon.js +25 -22
- package/dist/icons/WarningIcon.js +16 -19
- package/dist/index.d.ts +15 -17
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +79 -163
- package/dist/libs/context.js +10 -13
- package/dist/libs/index.js +4 -0
- package/dist/libs/registry.js +10 -12
- package/dist/libs/use-body-scroll-lock.d.ts +21 -0
- package/dist/libs/use-body-scroll-lock.d.ts.map +1 -0
- package/dist/libs/use-body-scroll-lock.js +27 -0
- package/dist/libs/use-dialog-overlay.d.ts +21 -0
- package/dist/libs/use-dialog-overlay.d.ts.map +1 -0
- package/dist/libs/use-dialog-overlay.js +21 -0
- package/dist/libs/use-floating-z-index.d.ts +32 -0
- package/dist/libs/use-floating-z-index.d.ts.map +1 -0
- package/dist/libs/use-floating-z-index.js +16 -0
- package/dist/libs/use-isomorphic-layout-effect.js +5 -5
- package/dist/libs/use-prefers-reduced-motion.d.ts +23 -0
- package/dist/libs/use-prefers-reduced-motion.d.ts.map +1 -0
- package/dist/libs/use-prefers-reduced-motion.js +19 -0
- package/dist/scripts/AsheeThemeScript.js +70 -44
- package/dist/shared/index.d.ts +1 -0
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/radius.d.ts.map +1 -1
- package/dist/shared/radius.js +12 -13
- package/dist/shared/typography.d.ts +81 -0
- package/dist/shared/typography.d.ts.map +1 -0
- package/dist/shared/typography.js +137 -0
- package/dist/shared/variant.js +46 -134
- package/dist/theme/color.js +28 -28
- package/dist/theme/controller.d.ts.map +1 -1
- package/dist/theme/controller.js +65 -178
- package/dist/theme/useTheme.js +13 -44
- package/dist/utils/cn.js +7 -7
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/merge-object.js +13 -14
- package/dist/utils/resolve-token.js +11 -14
- package/dist/utils/stacking.d.ts +76 -0
- package/dist/utils/stacking.d.ts.map +1 -0
- package/dist/utils/stacking.js +34 -0
- package/package.json +22 -14
- package/dist/components/date-picker/Calendar.d.ts.map +0 -1
- package/dist/components/date-picker/Calendar.js +0 -224
- package/dist/components/date-picker/DatePicker.d.ts.map +0 -1
- package/dist/components/date-picker/DatePicker.js +0 -221
- package/dist/components/date-picker/TimeSpinner.d.ts.map +0 -1
- package/dist/components/date-picker/TimeSpinner.js +0 -84
- package/dist/components/date-picker/date-picker-config.d.ts.map +0 -1
- package/dist/components/date-picker/date-picker-config.js +0 -16
- package/dist/components/date-picker/date-picker-styles.d.ts.map +0 -1
- package/dist/components/date-picker/date-picker-styles.js +0 -47
- package/dist/components/date-picker/date-picker.helpers.d.ts.map +0 -1
- package/dist/components/date-picker/date-picker.helpers.js +0 -110
- package/dist/components/date-picker/index.d.ts +0 -3
- package/dist/components/date-picker/index.d.ts.map +0 -1
- package/dist/components/date-picker/index.js +0 -6
- package/dist/components/select/Select.d.ts.map +0 -1
- package/dist/components/select/Select.js +0 -196
- package/dist/components/select/index.d.ts +0 -3
- package/dist/components/select/index.d.ts.map +0 -1
- package/dist/components/select/index.js +0 -3
- package/dist/components/select/select-config.d.ts.map +0 -1
- package/dist/components/select/select-config.js +0 -10
- package/dist/components/select/select-styles.d.ts.map +0 -1
- package/dist/components/select/select-styles.js +0 -6
- package/dist/components/select-menu/SelectMenu.d.ts.map +0 -1
- package/dist/components/select-menu/SelectMenu.js +0 -198
- package/dist/components/select-menu/index.d.ts +0 -4
- package/dist/components/select-menu/index.d.ts.map +0 -1
- package/dist/components/select-menu/index.js +0 -3
- package/dist/components/select-menu/select-menu-config.d.ts.map +0 -1
- package/dist/components/select-menu/select-menu-config.js +0 -14
- package/dist/components/select-menu/use-select-floating.d.ts.map +0 -1
- package/dist/components/select-menu/use-select-floating.js +0 -50
- /package/dist/components/{date-picker → calendar}/TimeSpinner.d.ts +0 -0
|
@@ -1,10 +1,26 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import { ElementType, ReactNode } from 'react';
|
|
2
2
|
import { ButtonConfig } from './button-config';
|
|
3
3
|
/**
|
|
4
4
|
* Visual and behavioural options shared by button-like elements.
|
|
5
5
|
* This type combines the ButtonConfig with native button HTML attributes.
|
|
6
6
|
*/
|
|
7
7
|
type BaseButtonProps = ButtonConfig & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "color" | "disabled">;
|
|
8
|
+
/**
|
|
9
|
+
* Props for the button's link behaviour.
|
|
10
|
+
* Holds the instance-only link component and its props.
|
|
11
|
+
*/
|
|
12
|
+
export interface ButtonLinkProps {
|
|
13
|
+
/**
|
|
14
|
+
* Custom link component (e.g. `next/link`, TanStack Router `Link`).
|
|
15
|
+
* When provided, this component is used instead of the native `<a>` tag.
|
|
16
|
+
*/
|
|
17
|
+
component?: ElementType;
|
|
18
|
+
/**
|
|
19
|
+
* Additional props to pass to the link component (e.g. `{ prefetch: true }`).
|
|
20
|
+
* These take precedence over the button's own props.
|
|
21
|
+
*/
|
|
22
|
+
props?: Record<string, unknown>;
|
|
23
|
+
}
|
|
8
24
|
/**
|
|
9
25
|
* Configuration options for the Button component.
|
|
10
26
|
*
|
|
@@ -49,6 +65,16 @@ export interface ButtonProps extends BaseButtonProps {
|
|
|
49
65
|
* Typically an icon, badge, or adornment.
|
|
50
66
|
*/
|
|
51
67
|
endContent?: ReactNode;
|
|
68
|
+
/**
|
|
69
|
+
* Renders the button as a link to this URL.
|
|
70
|
+
* The root element becomes an `<a>`, or `link.component` when provided.
|
|
71
|
+
*/
|
|
72
|
+
href?: string;
|
|
73
|
+
/**
|
|
74
|
+
* Link configuration for the button.
|
|
75
|
+
* Provides the custom link component and props forwarded to it.
|
|
76
|
+
*/
|
|
77
|
+
link?: ButtonLinkProps;
|
|
52
78
|
}
|
|
53
79
|
/**
|
|
54
80
|
* A clickable element that triggers an action or event.
|
|
@@ -76,6 +102,8 @@ export interface ButtonProps extends BaseButtonProps {
|
|
|
76
102
|
* @param props.icon - Icon-only compact layout. Defaults to false.
|
|
77
103
|
* @param props.startContent - Content at the start of the button.
|
|
78
104
|
* @param props.endContent - Content at the end of the button.
|
|
105
|
+
* @param props.href - Renders the button as a link to this URL.
|
|
106
|
+
* @param props.link - Link configuration (custom component and props).
|
|
79
107
|
* @param props.children - Button label content.
|
|
80
108
|
* @param props.className - Extra CSS classes for the button.
|
|
81
109
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/button/Button.tsx"],"names":[],"mappings":"AAWA,OAAO,
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/button/Button.tsx"],"names":[],"mappings":"AAWA,OAAO,EACL,KAAK,WAAW,EAGhB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAiBf,OAAO,EAAE,KAAK,YAAY,EAA0B,MAAM,iBAAiB,CAAC;AAK5E;;;GAGG;AACH,KAAK,eAAe,GAAG,YAAY,GACjC,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC,CAAC;AAE5E;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,SAAS,CAAC,EAAE,WAAW,CAAC;IAExB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AAED;;;;GAIG;AACH,MAAM,WAAW,WAAY,SAAQ,eAAe;IAClD;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IAErC;;;;;OAKG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf;;;OAGG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IAEzB;;;OAGG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;IAEvB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,IAAI,CAAC,EAAE,eAAe,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4EG;AACH,eAAO,MAAM,MAAM,2GA0IlB,CAAC"}
|
|
@@ -1,109 +1,51 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
), O = r(
|
|
53
|
-
N,
|
|
54
|
-
e == null ? void 0 : e.animate,
|
|
55
|
-
s.animate,
|
|
56
|
-
s.animate
|
|
57
|
-
), U = r(
|
|
58
|
-
S,
|
|
59
|
-
e == null ? void 0 : e.fullWidth,
|
|
60
|
-
void 0,
|
|
61
|
-
s.fullWidth
|
|
62
|
-
), x = _ ? Z[n] : G[n], l = A || a, D = (m) => {
|
|
63
|
-
if (l) {
|
|
64
|
-
m.preventDefault();
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
i == null || i(m);
|
|
68
|
-
}, W = q(
|
|
69
|
-
"inline-flex items-center justify-center font-medium transition-colors select-none shrink-0",
|
|
70
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2",
|
|
71
|
-
"disabled:pointer-events-none disabled:opacity-50",
|
|
72
|
-
"aria-disabled:pointer-events-none aria-disabled:opacity-50",
|
|
73
|
-
U && "w-full",
|
|
74
|
-
O && "motion-safe:transition-transform motion-safe:duration-100 motion-safe:active:scale-[0.99]",
|
|
75
|
-
J(o, T),
|
|
76
|
-
x,
|
|
77
|
-
w(
|
|
78
|
-
c(o, z),
|
|
79
|
-
H,
|
|
80
|
-
c(o, s.radius)
|
|
81
|
-
),
|
|
82
|
-
L
|
|
83
|
-
);
|
|
84
|
-
return /* @__PURE__ */ j(
|
|
85
|
-
"button",
|
|
86
|
-
{
|
|
87
|
-
ref: v,
|
|
88
|
-
type: C,
|
|
89
|
-
disabled: l,
|
|
90
|
-
"aria-disabled": l,
|
|
91
|
-
"aria-busy": a,
|
|
92
|
-
onClick: D,
|
|
93
|
-
className: W,
|
|
94
|
-
...R,
|
|
95
|
-
children: [
|
|
96
|
-
a && /* @__PURE__ */ u(E, { className: n }),
|
|
97
|
-
a && /* @__PURE__ */ u("span", { className: "sr-only", children: "Loading" }),
|
|
98
|
-
!a && I,
|
|
99
|
-
!a && B,
|
|
100
|
-
!a && K
|
|
101
|
-
]
|
|
102
|
-
}
|
|
103
|
-
);
|
|
104
|
-
}
|
|
105
|
-
);
|
|
106
|
-
M.displayName = "Button";
|
|
107
|
-
export {
|
|
108
|
-
M as Button
|
|
109
|
-
};
|
|
2
|
+
"use client";
|
|
3
|
+
import { cn as e } from "../../utils/cn.js";
|
|
4
|
+
import { RADIUS_CLASS as t, UnderlineRadius as n } from "../../shared/radius.js";
|
|
5
|
+
import { resolveVariantClass as r } from "../../shared/variant.js";
|
|
6
|
+
import { useAsheeConfig as i } from "../../libs/context.js";
|
|
7
|
+
import { resolveCascade as a, resolveClassKey as o, resolveRadiusKey as s } from "../../utils/resolve-token.js";
|
|
8
|
+
import { Spinner as c } from "../spinner/spinner.js";
|
|
9
|
+
import { FALLBACK_BUTTON_CONFIG as l } from "./button-config.js";
|
|
10
|
+
import { BUTTON_ICON_SIZE_CLASS as u, BUTTON_SIZE_CLASS as d } from "./button-styles.js";
|
|
11
|
+
import { forwardRef as f } from "react";
|
|
12
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
13
|
+
//#region src/components/button/Button.tsx
|
|
14
|
+
var h = f((f, h) => {
|
|
15
|
+
let { variant: g, color: _, size: v, radius: y, animate: b, fullWidth: x, isDisabled: S, isLoading: C, icon: w, className: T, children: E, type: D = "button", onClick: O, startContent: k, endContent: A, href: j, link: M, ...N } = f, P = i(), F = P.components?.button, I = a(g, F?.variant, P.defaultVariant, l.variant), L = a(_, F?.color, P.defaultColor, l.color), R = a(v, F?.size, void 0, l.size), z = s(y, F?.radius, P.defaultRadius, l.radius), B = a(b, F?.animate, l.animate, l.animate), V = a(x, F?.fullWidth, void 0, l.fullWidth), H = w ? u[R] : d[R], U = S || C, W = !!(j || M), G = M?.component ?? (W ? "a" : "button"), { onClick: K, ...q } = M?.props ?? {}, J = (e) => {
|
|
16
|
+
if (U) {
|
|
17
|
+
e.preventDefault();
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
O?.(e), K?.(e);
|
|
21
|
+
}, Y = e("inline-flex items-center justify-center font-medium transition-colors select-none shrink-0", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2", "disabled:pointer-events-none disabled:opacity-50", "aria-disabled:pointer-events-none aria-disabled:opacity-50", V && "w-full", B && "motion-safe:transition-transform motion-safe:duration-100 motion-safe:active:scale-[0.99]", r(I, L), H, o(n(I, z), t, n(I, l.radius)), T);
|
|
22
|
+
return /* @__PURE__ */ m(G, {
|
|
23
|
+
ref: h,
|
|
24
|
+
...W ? { href: j } : {
|
|
25
|
+
type: D,
|
|
26
|
+
disabled: U
|
|
27
|
+
},
|
|
28
|
+
"aria-disabled": U,
|
|
29
|
+
"aria-busy": C,
|
|
30
|
+
onClick: J,
|
|
31
|
+
className: Y,
|
|
32
|
+
...N,
|
|
33
|
+
...q,
|
|
34
|
+
children: [
|
|
35
|
+
C && /* @__PURE__ */ p(c, { className: R }),
|
|
36
|
+
C && /* @__PURE__ */ p("span", {
|
|
37
|
+
className: "sr-only",
|
|
38
|
+
children: "Loading "
|
|
39
|
+
}),
|
|
40
|
+
C ? /* @__PURE__ */ p("span", {
|
|
41
|
+
className: "sr-only",
|
|
42
|
+
children: E
|
|
43
|
+
}) : E,
|
|
44
|
+
!C && k,
|
|
45
|
+
!C && A
|
|
46
|
+
]
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
h.displayName = "Button";
|
|
50
|
+
//#endregion
|
|
51
|
+
export { h as Button };
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { registerComponentDefaults as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
import { registerComponentDefaults as e } from "../../libs/registry.js";
|
|
3
|
+
//#region src/components/button/button-config.ts
|
|
4
|
+
var t = {
|
|
5
|
+
size: "md",
|
|
6
|
+
animate: !0,
|
|
7
|
+
fullWidth: !1
|
|
7
8
|
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
};
|
|
17
|
-
export {
|
|
18
|
-
i as FALLBACK_BUTTON_CONFIG,
|
|
19
|
-
e as defaultButtonConfig
|
|
9
|
+
e("button", t);
|
|
10
|
+
var n = {
|
|
11
|
+
size: "md",
|
|
12
|
+
variant: "bordered",
|
|
13
|
+
color: "primary",
|
|
14
|
+
radius: "md",
|
|
15
|
+
animate: !0,
|
|
16
|
+
fullWidth: !1
|
|
20
17
|
};
|
|
18
|
+
//#endregion
|
|
19
|
+
export { n as FALLBACK_BUTTON_CONFIG, t as defaultButtonConfig };
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
//#region src/components/button/button-styles.ts
|
|
3
|
+
var e = {
|
|
4
|
+
sm: "h-8 px-3 text-xs gap-1.5",
|
|
5
|
+
md: "h-9 px-3.5 text-xs sm:h-10 sm:px-4 sm:text-sm gap-2",
|
|
6
|
+
lg: "h-11 px-5 text-sm sm:h-12 sm:px-6 sm:text-base gap-2.5"
|
|
6
7
|
}, t = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
11
|
-
export {
|
|
12
|
-
t as BUTTON_ICON_SIZE_CLASS,
|
|
13
|
-
s as BUTTON_SIZE_CLASS
|
|
8
|
+
sm: "size-8 p-0 text-xs gap-0",
|
|
9
|
+
md: "size-9 sm:size-10 p-0 text-xs sm:text-sm gap-0",
|
|
10
|
+
lg: "size-11 sm:size-12 p-0 text-sm sm:text-base gap-0"
|
|
14
11
|
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { t as BUTTON_ICON_SIZE_CLASS, e as BUTTON_SIZE_CLASS };
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { InputProps } from '../input/Input';
|
|
2
|
-
import {
|
|
2
|
+
import { CalendarConfig, CalendarPickerConfig } from './calendar-config';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Props for the picker (calendar popover).
|
|
5
|
+
* Extends CalendarPickerConfig with instance-only props.
|
|
6
6
|
*/
|
|
7
|
-
export interface
|
|
7
|
+
export interface CalendarPickerProps extends CalendarPickerConfig {
|
|
8
8
|
/**
|
|
9
9
|
* Extra CSS classes for the calendar popover.
|
|
10
10
|
*/
|
|
11
11
|
className?: string;
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
|
-
* Base
|
|
15
|
-
* Combines
|
|
14
|
+
* Base Calendar props excluding the picker configuration.
|
|
15
|
+
* Combines CalendarConfig (minus picker) with InputProps (minus value-related props).
|
|
16
16
|
*/
|
|
17
|
-
export type
|
|
17
|
+
export type BaseCalendarProps = Omit<CalendarConfig, "picker"> & Omit<InputProps, "onChange" | "value" | "defaultValue" | "endContent" | "startContent">;
|
|
18
18
|
/**
|
|
19
|
-
* Configuration options for the
|
|
19
|
+
* Configuration options for the Calendar component.
|
|
20
20
|
* Extends InputProps but omits value-related props that are replaced
|
|
21
21
|
* with date-specific equivalents.
|
|
22
22
|
*/
|
|
23
|
-
export interface
|
|
23
|
+
export interface CalendarProps extends BaseCalendarProps {
|
|
24
24
|
/**
|
|
25
25
|
* The currently selected date.
|
|
26
26
|
* Pass null for no selection.
|
|
@@ -35,7 +35,7 @@ export interface DatePickerProps extends BaseDatePickerProps {
|
|
|
35
35
|
* Picker configuration overrides including portal, portalTarget, and className.
|
|
36
36
|
* All picker-related props should be passed through this object.
|
|
37
37
|
*/
|
|
38
|
-
picker?:
|
|
38
|
+
picker?: CalendarPickerProps;
|
|
39
39
|
/**
|
|
40
40
|
* Whether a clear button is shown in the input.
|
|
41
41
|
* When true, a clear button appears when a date is selected.
|
|
@@ -54,7 +54,7 @@ export interface DatePickerProps extends BaseDatePickerProps {
|
|
|
54
54
|
/**
|
|
55
55
|
* A date/time picker component with calendar popover and time selection.
|
|
56
56
|
*
|
|
57
|
-
*
|
|
57
|
+
* Calendar renders an input field with a calendar popover that allows
|
|
58
58
|
* selecting dates and/or times. It supports date, time, and datetime modes,
|
|
59
59
|
* clearable selection, and future date restrictions. The component integrates
|
|
60
60
|
* with Floating UI for popover positioning and follows the standard AsheeUI
|
|
@@ -64,10 +64,10 @@ export interface DatePickerProps extends BaseDatePickerProps {
|
|
|
64
64
|
* render at the document body level. This ensures the popover escapes CSS
|
|
65
65
|
* containment, overflow clipping, and stacking context issues. The portal
|
|
66
66
|
* can be disabled via the `picker.portal` prop or
|
|
67
|
-
* `components.
|
|
67
|
+
* `components.calendar.picker.portal` in the config if the popover needs
|
|
68
68
|
* to stay within a specific parent container.
|
|
69
69
|
*
|
|
70
|
-
* @param props -
|
|
70
|
+
* @param props - Calendar configuration options.
|
|
71
71
|
* @param props.selected - Currently selected date or null.
|
|
72
72
|
* @param props.onChange - Callback fired when the date changes.
|
|
73
73
|
* @param props.mode - Selection mode: "date", "time", or "datetime". Defaults to "date".
|
|
@@ -89,17 +89,17 @@ export interface DatePickerProps extends BaseDatePickerProps {
|
|
|
89
89
|
*
|
|
90
90
|
* @example
|
|
91
91
|
* ```tsx
|
|
92
|
-
* import {
|
|
92
|
+
* import { Calendar } from "asheeui";
|
|
93
93
|
* import { useState } from "react";
|
|
94
94
|
*
|
|
95
95
|
* export function Example() {
|
|
96
96
|
* const [selected, setSelected] = useState<Date | null>(null);
|
|
97
97
|
*
|
|
98
98
|
* return (
|
|
99
|
-
* <
|
|
99
|
+
* <Calendar
|
|
100
100
|
* selected={selected}
|
|
101
101
|
* onChange={setSelected}
|
|
102
|
-
* label="
|
|
102
|
+
* label="Dropmenu Date"
|
|
103
103
|
* isClearable
|
|
104
104
|
* />
|
|
105
105
|
* );
|
|
@@ -109,9 +109,9 @@ export interface DatePickerProps extends BaseDatePickerProps {
|
|
|
109
109
|
* @example
|
|
110
110
|
* ```tsx
|
|
111
111
|
* // With datetime mode and custom picker configuration
|
|
112
|
-
* <
|
|
112
|
+
* <Calendar
|
|
113
113
|
* mode="datetime"
|
|
114
|
-
* label="
|
|
114
|
+
* label="Dropmenu Date and Time"
|
|
115
115
|
* isClearable
|
|
116
116
|
* picker={{
|
|
117
117
|
* className: "custom-calendar",
|
|
@@ -120,9 +120,9 @@ export interface DatePickerProps extends BaseDatePickerProps {
|
|
|
120
120
|
* />
|
|
121
121
|
* ```
|
|
122
122
|
*
|
|
123
|
-
* @see
|
|
123
|
+
* @see CalendarConfig - The configuration type for component defaults.
|
|
124
124
|
* @see Input - The underlying input component.
|
|
125
|
-
* @see
|
|
125
|
+
* @see DateGrid - The calendar popover component.
|
|
126
126
|
*/
|
|
127
|
-
export declare const
|
|
128
|
-
//# sourceMappingURL=
|
|
127
|
+
export declare const Calendar: import('react').ForwardRefExoticComponent<CalendarProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
128
|
+
//# sourceMappingURL=Calendar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Calendar.d.ts","sourceRoot":"","sources":["../../../src/components/calendar/Calendar.tsx"],"names":[],"mappings":"AA+BA,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AASxD,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,oBAAoB,EAE1B,MAAM,mBAAmB,CAAC;AAE3B;;;GAGG;AACH,MAAM,WAAW,mBAAoB,SAAQ,oBAAoB;IAC/D;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAID;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,cAAc,EAAE,QAAQ,CAAC,GAC5D,IAAI,CACF,UAAU,EACV,UAAU,GAAG,OAAO,GAAG,cAAc,GAAG,YAAY,GAAG,cAAc,CACtE,CAAC;AAEJ;;;;GAIG;AACH,MAAM,WAAW,aAAc,SAAQ,iBAAiB;IACtD;;;OAGG;IACH,QAAQ,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAEvB;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,KAAK,IAAI,CAAC;IAEvC;;;OAGG;IACH,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAE7B;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwEG;AACH,eAAO,MAAM,QAAQ,4GA+VpB,CAAC"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
import { cn as e } from "../../utils/cn.js";
|
|
4
|
+
import { ASHEE_LAYER as t } from "../../utils/stacking.js";
|
|
5
|
+
import { RADIUS_CLASS as n } from "../../shared/radius.js";
|
|
6
|
+
import { useAsheeConfig as r } from "../../libs/context.js";
|
|
7
|
+
import { resolveCascade as i, resolveClassKey as a, resolveRadiusKey as o } from "../../utils/resolve-token.js";
|
|
8
|
+
import { Input as s } from "../input/Input.js";
|
|
9
|
+
import { FALLBACK_MENU_CONFIG as c } from "../menu/menu-config.js";
|
|
10
|
+
import { useMenuFloating as l } from "../menu/use-menu-floating.js";
|
|
11
|
+
import { CalendarIcon as u } from "../../icons/CalendarIcon.js";
|
|
12
|
+
import { ClearIcon as d } from "../../icons/ClearIcon.js";
|
|
13
|
+
import { ClockIcon as ee } from "../../icons/ClockIcon.js";
|
|
14
|
+
import { formatDisplay as f, getDefaultPlaceholder as p, getNewCursorPosition as m, parseDateString as h } from "./calendar.helpers.js";
|
|
15
|
+
import { DateGrid as g } from "./DateGrid.js";
|
|
16
|
+
import { FALLBACK_DATE_PICKER_CONFIG as _ } from "./calendar-config.js";
|
|
17
|
+
import { forwardRef as v, useCallback as y, useEffect as b, useId as x, useRef as S, useState as C } from "react";
|
|
18
|
+
import { Fragment as te, jsx as w, jsxs as T } from "react/jsx-runtime";
|
|
19
|
+
import { FloatingFocusManager as E, FloatingPortal as D } from "@floating-ui/react";
|
|
20
|
+
//#region src/components/calendar/Calendar.tsx
|
|
21
|
+
var O = v(({ selected: v, onChange: O, mode: k, isClearable: A = !1, disableFuture: j = !1, placeholder: ne, size: M, radius: N, color: P, disabled: F, picker: I, ...L }, R) => {
|
|
22
|
+
let z = r(), B = z.components?.calendar, V = x(), H = L.id ?? V, [U, W] = C(!1), [G, K] = C(""), q = S(null), J = i(k, B?.mode, void 0, _.mode), Y = i(I?.portal, B?.picker?.portal, void 0, c.portal), re = i(I?.portalTarget, B?.picker?.portalTarget, void 0, null), X = i(I?.lockScroll, B?.picker?.lockScroll, void 0, !0), ie = i(M, B?.size, void 0, _.size), ae = i(P, B?.color, z.defaultColor, _.color), Z = o(typeof N == "string" ? N : void 0, typeof B?.radius == "string" ? B.radius : void 0, z.defaultRadius, _.radius), oe = a(Z === "full" ? "xl" : Z, n, _.radius), { refs: Q, context: se, floatingStyles: ce, isPositioned: le, getReferenceProps: ue, getFloatingProps: de } = l({
|
|
23
|
+
isOpen: U,
|
|
24
|
+
onOpenChange: W,
|
|
25
|
+
disabled: F,
|
|
26
|
+
matchReferenceWidth: !1,
|
|
27
|
+
role: "dialog",
|
|
28
|
+
zIndex: t.popover
|
|
29
|
+
});
|
|
30
|
+
b(() => {
|
|
31
|
+
if (!U || !X) return;
|
|
32
|
+
let e = window.scrollY, t = document.body.style.position, n = document.body.style.top, r = document.body.style.left, i = document.body.style.right, a = document.body.style.width, o = document.body.style.overflow;
|
|
33
|
+
return document.body.style.position = "fixed", document.body.style.top = `-${e}px`, document.body.style.left = "0", document.body.style.right = "0", document.body.style.width = "100%", document.body.style.overflow = "hidden", () => {
|
|
34
|
+
document.body.style.position = t, document.body.style.top = n, document.body.style.left = r, document.body.style.right = i, document.body.style.width = a, document.body.style.overflow = o, window.scrollTo(0, e);
|
|
35
|
+
};
|
|
36
|
+
}, [U, X]), b(() => {
|
|
37
|
+
K(v ? f(v, J) : "");
|
|
38
|
+
}, [v, J]);
|
|
39
|
+
let fe = y((e) => {
|
|
40
|
+
O?.(e), K(e ? f(e, J) : ""), (J === "date" || e === null) && W(!1);
|
|
41
|
+
}, [O, J]), pe = y(() => W(!1), []), me = y((e) => {
|
|
42
|
+
e.stopPropagation(), O?.(null), K(""), W(!1), q.current?.focus();
|
|
43
|
+
}, [O]), he = y((e) => {
|
|
44
|
+
let t = e.target, n = t.value, r = G, i = t.selectionStart ?? 0, a = n.replace(/\D/g, "");
|
|
45
|
+
if (a.length === 0) {
|
|
46
|
+
K(""), O?.(null);
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
let o = h(a, J, v ?? void 0);
|
|
50
|
+
if (o) {
|
|
51
|
+
O?.(o);
|
|
52
|
+
let e = f(o, J);
|
|
53
|
+
K(e);
|
|
54
|
+
let n = m(r, e, i);
|
|
55
|
+
requestAnimationFrame(() => {
|
|
56
|
+
t.setSelectionRange(n, n);
|
|
57
|
+
});
|
|
58
|
+
} else K(v ? f(v, J) : "");
|
|
59
|
+
}, [
|
|
60
|
+
J,
|
|
61
|
+
v,
|
|
62
|
+
O,
|
|
63
|
+
G
|
|
64
|
+
]), ge = ne ?? p(J), _e = /* @__PURE__ */ T(te, { children: [A && v && !F && /* @__PURE__ */ w("button", {
|
|
65
|
+
type: "button",
|
|
66
|
+
onClick: me,
|
|
67
|
+
"aria-label": "Clear selection",
|
|
68
|
+
className: "p-0.5 rounded text-foreground/70 hover:text-foreground transition-colors",
|
|
69
|
+
children: /* @__PURE__ */ w(d, { className: "size-3.5" })
|
|
70
|
+
}), /* @__PURE__ */ w("span", {
|
|
71
|
+
className: "text-foreground/70 pointer-events-none",
|
|
72
|
+
children: w(J === "time" ? ee : u, {})
|
|
73
|
+
})] }), $ = U ? /* @__PURE__ */ w(E, {
|
|
74
|
+
context: se,
|
|
75
|
+
modal: !1,
|
|
76
|
+
initialFocus: -1,
|
|
77
|
+
returnFocus: !1,
|
|
78
|
+
children: /* @__PURE__ */ w("div", {
|
|
79
|
+
ref: Q.setFloating,
|
|
80
|
+
style: { ...ce },
|
|
81
|
+
className: e("outline-none w-max", "transition-none", le ? "animate-in fade-in-0 zoom-in-95 duration-150 ease-out" : "invisible opacity-0 pointer-events-none", I?.className),
|
|
82
|
+
...de(),
|
|
83
|
+
children: /* @__PURE__ */ w(g, {
|
|
84
|
+
selected: v,
|
|
85
|
+
mode: J,
|
|
86
|
+
isClearable: A,
|
|
87
|
+
resolvedSizeKey: ie,
|
|
88
|
+
onSelect: fe,
|
|
89
|
+
onClose: pe,
|
|
90
|
+
disableFuture: j,
|
|
91
|
+
resolvedColor: ae,
|
|
92
|
+
radiusClass: oe
|
|
93
|
+
})
|
|
94
|
+
})
|
|
95
|
+
}) : null, ve = re ?? (typeof document < "u" ? document.body : null), ye = y((e) => {
|
|
96
|
+
e && (Q.setReference(e), q.current = e, typeof R == "function" ? R(e) : R && (R.current = e));
|
|
97
|
+
}, [Q, R]);
|
|
98
|
+
return /* @__PURE__ */ T("div", {
|
|
99
|
+
className: "w-full relative inline-block",
|
|
100
|
+
children: [/* @__PURE__ */ w(s, {
|
|
101
|
+
...L,
|
|
102
|
+
ref: ye,
|
|
103
|
+
id: H,
|
|
104
|
+
size: M,
|
|
105
|
+
radius: N,
|
|
106
|
+
color: P,
|
|
107
|
+
placeholder: ge,
|
|
108
|
+
value: G,
|
|
109
|
+
onChange: he,
|
|
110
|
+
endContent: _e,
|
|
111
|
+
disabled: F,
|
|
112
|
+
"aria-expanded": U,
|
|
113
|
+
"aria-haspopup": "dialog",
|
|
114
|
+
...ue()
|
|
115
|
+
}), U && (Y ? /* @__PURE__ */ w(D, {
|
|
116
|
+
root: ve,
|
|
117
|
+
children: $
|
|
118
|
+
}) : $)]
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
O.displayName = "Calendar";
|
|
122
|
+
//#endregion
|
|
123
|
+
export { O as Calendar };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Color } from '../../shared';
|
|
2
2
|
import { FieldSizeKey } from '../field/field-config';
|
|
3
|
-
import {
|
|
4
|
-
interface
|
|
3
|
+
import { CalendarMode } from './calendar-config';
|
|
4
|
+
interface DateGridProps {
|
|
5
5
|
/**
|
|
6
6
|
* The currently selected date.
|
|
7
7
|
* Used to highlight the selected day and initialize time values.
|
|
@@ -11,7 +11,7 @@ interface CalendarProps {
|
|
|
11
11
|
* Selection mode of the picker.
|
|
12
12
|
* Controls whether the calendar, time spinners, or both are shown.
|
|
13
13
|
*/
|
|
14
|
-
mode:
|
|
14
|
+
mode: CalendarMode;
|
|
15
15
|
/**
|
|
16
16
|
* Whether a clear button is shown in the footer.
|
|
17
17
|
*/
|
|
@@ -50,13 +50,13 @@ interface CalendarProps {
|
|
|
50
50
|
disableFuture?: boolean;
|
|
51
51
|
}
|
|
52
52
|
/**
|
|
53
|
-
*
|
|
53
|
+
* DateGrid popover component with month navigation and date selection.
|
|
54
54
|
*
|
|
55
|
-
* Memoized so parent-driven renders (the
|
|
55
|
+
* Memoized so parent-driven renders (the Calendar popover's one-time
|
|
56
56
|
* `isPositioned` flip, input typing, open/close) do not rebuild the month
|
|
57
57
|
* grid. Every prop is a primitive or a stable callback, so React.memo can
|
|
58
58
|
* skip those renders.
|
|
59
59
|
*/
|
|
60
|
-
export declare const
|
|
60
|
+
export declare const DateGrid: import('react').MemoExoticComponent<({ selected, mode, isClearable, resolvedSizeKey, resolvedColor, radiusClass, onSelect, onClose, disableFuture, }: DateGridProps) => import("react").JSX.Element>;
|
|
61
61
|
export {};
|
|
62
|
-
//# sourceMappingURL=
|
|
62
|
+
//# sourceMappingURL=DateGrid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DateGrid.d.ts","sourceRoot":"","sources":["../../../src/components/calendar/DateGrid.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAStD,UAAU,aAAa;IACrB;;;OAGG;IACH,QAAQ,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC;IAClC;;;OAGG;IACH,IAAI,EAAE,YAAY,CAAC;IACnB;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,eAAe,EAAE,YAAY,CAAC;IAC9B;;;OAGG;IACH,aAAa,EAAE,KAAK,CAAC;IACrB;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,KAAK,IAAI,CAAC;IACtC;;;OAGG;IACH,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,wJAUlB,aAAa,iCA4Yd,CAAC"}
|