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
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Color } from '../../shared';
|
|
2
|
+
import { AlertType } from './alert-config';
|
|
3
|
+
/**
|
|
4
|
+
* Colour each intent is presented in.
|
|
5
|
+
* The colour resolves through the framework's colour engine, so an alert has
|
|
6
|
+
* no palette colour of its own.
|
|
7
|
+
*/
|
|
8
|
+
export declare const ALERT_TYPE_COLOR: Record<AlertType, Color>;
|
|
9
|
+
/**
|
|
10
|
+
* How urgently each intent is announced.
|
|
11
|
+
* `alert` interrupts what assistive technology is reading, so it is reserved
|
|
12
|
+
* for the two intents that need attention now.
|
|
13
|
+
*/
|
|
14
|
+
export declare const ALERT_TYPE_ROLE: Record<AlertType, "alert" | "status">;
|
|
15
|
+
/**
|
|
16
|
+
* Colour of the leading icon for each intent.
|
|
17
|
+
* The icon is decoration: the message text carries the information.
|
|
18
|
+
*/
|
|
19
|
+
export declare const ALERT_TYPE_ICON_CLASS: Record<AlertType, string>;
|
|
20
|
+
/**
|
|
21
|
+
* Base classes for the alert surface and its content layout.
|
|
22
|
+
*/
|
|
23
|
+
export declare const ALERT_BASE_CLASS = "relative flex items-start gap-3 w-full p-3 text-sm transition-colors";
|
|
24
|
+
/**
|
|
25
|
+
* Classes for the icon slot.
|
|
26
|
+
*/
|
|
27
|
+
export declare const ALERT_ICON_CLASS = "shrink-0 mt-0.5 [&_svg]:size-5";
|
|
28
|
+
/**
|
|
29
|
+
* Classes for the dismiss control.
|
|
30
|
+
*/
|
|
31
|
+
export declare const ALERT_DISMISS_CLASS = "shrink-0 inline-flex items-center justify-center size-6 rounded-sm text-current/70 hover:text-current transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-current";
|
|
32
|
+
//# sourceMappingURL=alert-styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert-styles.d.ts","sourceRoot":"","sources":["../../../src/components/alert/alert-styles.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,SAAS,EAAE,KAAK,CAKrD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,SAAS,EAAE,OAAO,GAAG,QAAQ,CAKjE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAK3D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,yEAC2C,CAAC;AAEzE;;GAEG;AACH,eAAO,MAAM,gBAAgB,mCAAmC,CAAC;AAEjE;;GAEG;AACH,eAAO,MAAM,mBAAmB,+LAC8J,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
//#region src/components/alert/alert-styles.ts
|
|
3
|
+
var e = {
|
|
4
|
+
info: "primary",
|
|
5
|
+
success: "success",
|
|
6
|
+
warning: "warning",
|
|
7
|
+
error: "danger"
|
|
8
|
+
}, t = {
|
|
9
|
+
info: "status",
|
|
10
|
+
success: "status",
|
|
11
|
+
warning: "alert",
|
|
12
|
+
error: "alert"
|
|
13
|
+
}, n = {
|
|
14
|
+
info: "text-primary",
|
|
15
|
+
success: "text-success",
|
|
16
|
+
warning: "text-warning",
|
|
17
|
+
error: "text-danger"
|
|
18
|
+
}, r = "relative flex items-start gap-3 w-full p-3 text-sm transition-colors", i = "shrink-0 mt-0.5 [&_svg]:size-5", a = "shrink-0 inline-flex items-center justify-center size-6 rounded-sm text-current/70 hover:text-current transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-current";
|
|
19
|
+
//#endregion
|
|
20
|
+
export { r as ALERT_BASE_CLASS, a as ALERT_DISMISS_CLASS, i as ALERT_ICON_CLASS, e as ALERT_TYPE_COLOR, n as ALERT_TYPE_ICON_CLASS, t as ALERT_TYPE_ROLE };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/alert/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { InputProps } from '../input/Input';
|
|
3
|
-
import {
|
|
4
|
-
import { MenuProps } from '../
|
|
3
|
+
import { MenuOption } from '../menu';
|
|
4
|
+
import { MenuProps } from '../menu/Menu';
|
|
5
5
|
import { AutocompleteConfig } from './autocomplete-config';
|
|
6
6
|
/**
|
|
7
7
|
* Configuration options for the Autocomplete component.
|
|
@@ -15,7 +15,7 @@ export interface AutocompleteProps extends Omit<InputProps, "value" | "onChange"
|
|
|
15
15
|
*
|
|
16
16
|
* @default []
|
|
17
17
|
*/
|
|
18
|
-
options:
|
|
18
|
+
options: MenuOption[];
|
|
19
19
|
/**
|
|
20
20
|
* Controlled selected value, shown as its option label.
|
|
21
21
|
* When allowCustomValue is true, this can be a free-form string.
|
|
@@ -25,7 +25,7 @@ export interface AutocompleteProps extends Omit<InputProps, "value" | "onChange"
|
|
|
25
25
|
* Callback fired with the selected value and option.
|
|
26
26
|
* Called when a suggestion is selected from the dropdown.
|
|
27
27
|
*/
|
|
28
|
-
onValueChange?: (value: string | number, option?:
|
|
28
|
+
onValueChange?: (value: string | number, option?: MenuOption) => void;
|
|
29
29
|
/**
|
|
30
30
|
* Callback fired whenever the raw input text changes.
|
|
31
31
|
* Called on every keystroke, providing the current input value.
|
|
@@ -56,7 +56,7 @@ export interface AutocompleteProps extends Omit<InputProps, "value" | "onChange"
|
|
|
56
56
|
* A text input with a filterable suggestion dropdown.
|
|
57
57
|
*
|
|
58
58
|
* Autocomplete combines an {@link Input} trigger with a floating
|
|
59
|
-
* {@link
|
|
59
|
+
* {@link Menu}. Suggestions are filtered as the user types, the
|
|
60
60
|
* selected value is reported through `onValueChange`, and free-form
|
|
61
61
|
* values are supported via `allowCustomValue`. Menu tokens resolve
|
|
62
62
|
* through the standard AsheeUI cascade.
|
|
@@ -134,7 +134,7 @@ export interface AutocompleteProps extends Omit<InputProps, "value" | "onChange"
|
|
|
134
134
|
*
|
|
135
135
|
* @see AutocompleteConfig - The configuration type for component defaults.
|
|
136
136
|
* @see Input - The underlying input component for the trigger.
|
|
137
|
-
* @see
|
|
137
|
+
* @see Menu - The dropdown component used for suggestions.
|
|
138
138
|
* @see useAsheeConfig - Hook for accessing the global configuration.
|
|
139
139
|
*/
|
|
140
140
|
export declare const Autocomplete: import('react').ForwardRefExoticComponent<AutocompleteProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Autocomplete.d.ts","sourceRoot":"","sources":["../../../src/components/autocomplete/Autocomplete.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAEL,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AAKf,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"Autocomplete.d.ts","sourceRoot":"","sources":["../../../src/components/autocomplete/Autocomplete.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAEL,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AAKf,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,KAAK,UAAU,EAAiC,MAAM,SAAS,CAAC;AAEzE,OAAO,EAAE,KAAK,SAAS,EAAQ,MAAM,cAAc,CAAC;AACpD,OAAO,EACL,KAAK,kBAAkB,EAExB,MAAM,uBAAuB,CAAC;AAI/B;;;;GAIG;AACH,MAAM,WAAW,iBACf,SAAQ,IAAI,CAAC,UAAU,EAAE,OAAO,GAAG,UAAU,GAAG,UAAU,CAAC,EACzD,IAAI,CAAC,kBAAkB,EAAE,MAAM,CAAC;IAClC;;;;;OAKG;IACH,OAAO,EAAE,UAAU,EAAE,CAAC;IAEtB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAExB;;;OAGG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,MAAM,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;IAEtE;;;OAGG;IACH,aAAa,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IAE7C;;;;;;;;OAQG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoFG;AACH,eAAO,MAAM,YAAY,gHA2RxB,CAAC"}
|
|
@@ -1,137 +1,115 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { FALLBACK_AUTOCOMPLETE_CONFIG as
|
|
10
|
-
import {
|
|
11
|
-
|
|
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
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
context: d,
|
|
117
|
-
getFloatingProps: Y,
|
|
118
|
-
setFloatingRef: x.setFloating,
|
|
119
|
-
isPositioned: q,
|
|
120
|
-
options: Z,
|
|
121
|
-
selectedValues: h,
|
|
122
|
-
onSelectMenuOption: k,
|
|
123
|
-
isSearch: !1,
|
|
124
|
-
belowList: M,
|
|
125
|
-
menuProps: P,
|
|
126
|
-
menuConfig: e == null ? void 0 : e.menu,
|
|
127
|
-
initialFocus: -1,
|
|
128
|
-
returnFocus: !1
|
|
129
|
-
}
|
|
130
|
-
)
|
|
131
|
-
] });
|
|
132
|
-
}
|
|
133
|
-
);
|
|
134
|
-
me.displayName = "Autocomplete";
|
|
135
|
-
export {
|
|
136
|
-
me as Autocomplete
|
|
137
|
-
};
|
|
2
|
+
"use client";
|
|
3
|
+
import { useAsheeConfig as e } from "../../libs/context.js";
|
|
4
|
+
import { resolveCascade as t, resolveRadiusKey as n } from "../../utils/resolve-token.js";
|
|
5
|
+
import { Input as r } from "../input/Input.js";
|
|
6
|
+
import { edgeOptionIndex as i, nextOptionIndex as a } from "../menu/menu-navigation.js";
|
|
7
|
+
import { Menu as o, menuOptionId as s } from "../menu/Menu.js";
|
|
8
|
+
import { useMenuFloating as c } from "../menu/use-menu-floating.js";
|
|
9
|
+
import { FALLBACK_AUTOCOMPLETE_CONFIG as l } from "./autocomplete-config.js";
|
|
10
|
+
import { forwardRef as u, useCallback as d, useEffect as f, useMemo as p, useState as m } from "react";
|
|
11
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
12
|
+
import { useDismiss as _, useFocus as ee, useInteractions as v, useRole as y } from "@floating-ui/react";
|
|
13
|
+
//#region src/components/autocomplete/Autocomplete.tsx
|
|
14
|
+
var b = u(({ options: u = [], value: b, onValueChange: x, onInputChange: S, allowCustomValue: C = !1, belowList: w, menu: T, variant: te, color: ne, radius: E, size: D, endContent: O, onClick: k, onKeyDown: A, disabled: j, placeholder: M = "Type to search...", className: N, ...P }, F) => {
|
|
15
|
+
let I = e(), L = I.components?.autocomplete, R = t(te, L?.variant, I.defaultVariant, l.variant), z = t(ne, L?.color, I.defaultColor, l.color), B = n(E, L?.radius, I.defaultRadius, l.radius), V = t(D, L?.size, void 0, l.size), H = p(() => u.find((e) => e.value === b), [u, b]), [U, W] = m(!1), [G, K] = m(() => H ? H.label : String(b ?? "")), [q, J] = m(null);
|
|
16
|
+
f(() => {
|
|
17
|
+
H ? K(H.label) : b != null && K(String(b));
|
|
18
|
+
}, [H, b]);
|
|
19
|
+
let { refs: Y, context: X, isPositioned: Z, floatingStyles: re } = c({
|
|
20
|
+
isOpen: U,
|
|
21
|
+
onOpenChange: W,
|
|
22
|
+
disabled: j
|
|
23
|
+
}), ie = ee(X), ae = _(X), oe = y(X, { role: "combobox" }), { getReferenceProps: se, getFloatingProps: ce } = v([
|
|
24
|
+
ie,
|
|
25
|
+
ae,
|
|
26
|
+
oe
|
|
27
|
+
]), Q = p(() => G.trim() ? u.filter((e) => e.label.toLowerCase().includes(G.toLowerCase())) : u, [u, G]), le = d((e) => {
|
|
28
|
+
let t = e.target.value;
|
|
29
|
+
K(t), S?.(t), W(!0), J(null), C && x?.(t);
|
|
30
|
+
}, [
|
|
31
|
+
C,
|
|
32
|
+
S,
|
|
33
|
+
x
|
|
34
|
+
]), $ = d((e) => {
|
|
35
|
+
K(e.label), x?.(e.value, e), W(!1), J(null);
|
|
36
|
+
}, [x]), ue = d((e) => {
|
|
37
|
+
if (A?.(e), e.defaultPrevented || j) return;
|
|
38
|
+
let t = e.key === "ArrowDown" ? 1 : e.key === "ArrowUp" ? -1 : 0;
|
|
39
|
+
if (t !== 0) {
|
|
40
|
+
if (e.preventDefault(), !U) {
|
|
41
|
+
W(!0);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
J((e) => a(Q, e, t));
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
if (e.key === "Home" || e.key === "End") {
|
|
48
|
+
if (!U) return;
|
|
49
|
+
e.preventDefault(), J(i(Q, e.key === "Home" ? "first" : "last"));
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
if (e.key === "Enter" && U) {
|
|
53
|
+
let t = q === null ? void 0 : Q[q];
|
|
54
|
+
t && !t.disabled && (e.preventDefault(), $(t));
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
e.key === "Escape" && U && (W(!1), J(null));
|
|
58
|
+
}, [
|
|
59
|
+
q,
|
|
60
|
+
A,
|
|
61
|
+
j,
|
|
62
|
+
Q,
|
|
63
|
+
$,
|
|
64
|
+
U
|
|
65
|
+
]), de = q === null ? void 0 : s(X.floatingId, q), fe = se({
|
|
66
|
+
...P,
|
|
67
|
+
onKeyDown: ue
|
|
68
|
+
}), pe = p(() => b == null ? [] : [b], [b]);
|
|
69
|
+
return /* @__PURE__ */ g("div", {
|
|
70
|
+
className: "w-full relative inline-block",
|
|
71
|
+
children: [/* @__PURE__ */ h(r, {
|
|
72
|
+
ref: (e) => {
|
|
73
|
+
Y.setReference(e), typeof F == "function" ? F(e) : F && (F.current = e);
|
|
74
|
+
},
|
|
75
|
+
variant: R,
|
|
76
|
+
radius: B,
|
|
77
|
+
color: z,
|
|
78
|
+
size: V,
|
|
79
|
+
disabled: j,
|
|
80
|
+
placeholder: M,
|
|
81
|
+
value: G,
|
|
82
|
+
onChange: le,
|
|
83
|
+
onClick: (e) => {
|
|
84
|
+
j || W(!0), k?.(e);
|
|
85
|
+
},
|
|
86
|
+
"aria-expanded": U,
|
|
87
|
+
"aria-autocomplete": "list",
|
|
88
|
+
"aria-activedescendant": de,
|
|
89
|
+
endContent: O,
|
|
90
|
+
className: N,
|
|
91
|
+
...fe
|
|
92
|
+
}), /* @__PURE__ */ h(o, {
|
|
93
|
+
isOpen: U,
|
|
94
|
+
floatingStyles: re,
|
|
95
|
+
context: X,
|
|
96
|
+
getFloatingProps: ce,
|
|
97
|
+
setFloatingRef: Y.setFloating,
|
|
98
|
+
isPositioned: Z,
|
|
99
|
+
activeIndex: q,
|
|
100
|
+
onActiveIndexChange: J,
|
|
101
|
+
options: Q,
|
|
102
|
+
selectedValues: pe,
|
|
103
|
+
onOptionSelect: $,
|
|
104
|
+
isSearch: !1,
|
|
105
|
+
belowList: w,
|
|
106
|
+
menuProps: T,
|
|
107
|
+
menuConfig: L?.menu,
|
|
108
|
+
initialFocus: -1,
|
|
109
|
+
returnFocus: !1
|
|
110
|
+
})]
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
b.displayName = "Autocomplete";
|
|
114
|
+
//#endregion
|
|
115
|
+
export { b as Autocomplete };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autocomplete-config.d.ts","sourceRoot":"","sources":["../../../src/components/autocomplete/autocomplete-config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAsB,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"autocomplete-config.d.ts","sourceRoot":"","sources":["../../../src/components/autocomplete/autocomplete-config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAsB,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C;;;;;;GAMG;AACH,MAAM,WAAW,kBAAmB,SAAQ,WAAW;IACrD;;;OAGG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB;AAED;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,EAAE,kBAEvC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;CAE/B,CAAC;AAEX,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,2BAA2B;QACnC,YAAY,EAAE,kBAAkB,CAAC;KAClC;CACF"}
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { registerComponentDefaults as
|
|
2
|
+
import { registerComponentDefaults as e } from "../../libs/registry.js";
|
|
3
3
|
import { FALLBACK_FIELD_CONFIG as t } from "../field/field-config.js";
|
|
4
|
-
import { defaultInputConfig as
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
10
|
-
o("autocomplete", m);
|
|
11
|
-
export {
|
|
12
|
-
p as FALLBACK_AUTOCOMPLETE_CONFIG,
|
|
13
|
-
m as defaultAutocompleteConfig
|
|
14
|
-
};
|
|
4
|
+
import { defaultInputConfig as n } from "../input/input-config.js";
|
|
5
|
+
//#region src/components/autocomplete/autocomplete-config.ts
|
|
6
|
+
var r = { ...n }, i = { ...t };
|
|
7
|
+
e("autocomplete", r);
|
|
8
|
+
//#endregion
|
|
9
|
+
export { i as FALLBACK_AUTOCOMPLETE_CONFIG, r as defaultAutocompleteConfig };
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { ElementType, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { AvatarConfig } from './avatar-config';
|
|
3
|
+
type BaseAvatarProps = AvatarConfig & Omit<HTMLAttributes<HTMLDivElement>, "color" | "children">;
|
|
4
|
+
/**
|
|
5
|
+
* Configuration options for the Avatar component.
|
|
6
|
+
*/
|
|
7
|
+
export interface AvatarProps extends BaseAvatarProps {
|
|
8
|
+
/**
|
|
9
|
+
* Name of the represented entity.
|
|
10
|
+
* Supplies the initials the avatar falls back to and, unless `alt` overrides
|
|
11
|
+
* it, the name assistive technology reads.
|
|
12
|
+
*/
|
|
13
|
+
name?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Picture of the represented entity.
|
|
16
|
+
* When it is missing or fails to load, the avatar shows its fallback.
|
|
17
|
+
*/
|
|
18
|
+
src?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Name assistive technology reads, instead of `name`.
|
|
21
|
+
* Use it when the entity's name is not the wording the avatar should carry.
|
|
22
|
+
*/
|
|
23
|
+
alt?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Component that replaces the picture inside the avatar, passed to
|
|
26
|
+
* {@link Image}. This is how a consumer keeps a framework image working
|
|
27
|
+
* inside an avatar.
|
|
28
|
+
*/
|
|
29
|
+
component?: ElementType;
|
|
30
|
+
/**
|
|
31
|
+
* Additional props for that component, passed to {@link Image}.
|
|
32
|
+
*/
|
|
33
|
+
componentProps?: Record<string, unknown>;
|
|
34
|
+
/**
|
|
35
|
+
* Content shown in place of the initials when there is no picture.
|
|
36
|
+
*/
|
|
37
|
+
fallback?: ReactNode;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* An entity representation with an initials fallback.
|
|
41
|
+
*
|
|
42
|
+
* Avatar shows the picture of a person or an entity, and falls back to that
|
|
43
|
+
* entity's initials when there is no picture or the picture fails to load. The
|
|
44
|
+
* fallback sits on the accent surface of the resolved colour, and the picture
|
|
45
|
+
* is rendered through the framework's {@link Image} primitive, so a consumer
|
|
46
|
+
* keeps its own image component by passing `component`.
|
|
47
|
+
*
|
|
48
|
+
* The avatar carries the entity's name as a single image role with a label, so
|
|
49
|
+
* assistive technology reads one name instead of the initials and the picture
|
|
50
|
+
* separately. With neither a name nor an alternative given, the avatar is
|
|
51
|
+
* decoration and is hidden from assistive technology: that is the right
|
|
52
|
+
* behaviour for a purely decorative picture beside text that already names the
|
|
53
|
+
* entity.
|
|
54
|
+
*
|
|
55
|
+
* Diameter, radius and colour resolve through the standard AsheeUI cascade:
|
|
56
|
+
* prop, component config, global theme defaults, and the built-in fallback.
|
|
57
|
+
*
|
|
58
|
+
* @param props - Avatar configuration options and div attributes.
|
|
59
|
+
* @param props.name - The represented entity's name.
|
|
60
|
+
* @param props.src - The picture's source.
|
|
61
|
+
* @param props.alt - Name for assistive technology, instead of `name`.
|
|
62
|
+
* @param props.component - Custom image component, passed to `Image`.
|
|
63
|
+
* @param props.componentProps - Additional props for that component.
|
|
64
|
+
* @param props.fallback - Content shown when there is no picture.
|
|
65
|
+
* @param props.size - Diameter scale. Defaults to "md".
|
|
66
|
+
* @param props.radius - Corner rounding. Defaults to "full".
|
|
67
|
+
* @param props.color - Accent colour of the fallback surface.
|
|
68
|
+
* @param props.className - Extra classes applied last, which is where a
|
|
69
|
+
* consumer overrides the diameter.
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```tsx
|
|
73
|
+
* <Avatar name="Ada Lovelace" src="/ada.png" />
|
|
74
|
+
* ```
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```tsx
|
|
78
|
+
* // No picture: the initials carry the identity.
|
|
79
|
+
* <Avatar name="Ada Lovelace" size="lg" />
|
|
80
|
+
* ```
|
|
81
|
+
*
|
|
82
|
+
* @see AvatarConfig - The configuration type for component defaults.
|
|
83
|
+
* @see Image - The framework's image primitive.
|
|
84
|
+
*/
|
|
85
|
+
export declare const Avatar: import('react').ForwardRefExoticComponent<AvatarProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
86
|
+
export {};
|
|
87
|
+
//# sourceMappingURL=Avatar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../src/components/avatar/Avatar.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EACL,KAAK,WAAW,EAEhB,KAAK,cAAc,EACnB,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AAOf,OAAO,EACL,KAAK,YAAY,EAElB,MAAM,iBAAiB,CAAC;AASzB,KAAK,eAAe,GAAG,YAAY,GACjC,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC,CAAC;AAE7D;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,eAAe;IAClD;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;;;OAIG;IACH,SAAS,CAAC,EAAE,WAAW,CAAC;IAExB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEzC;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,eAAO,MAAM,MAAM,wGAsGlB,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
import { cn as e } from "../../utils/cn.js";
|
|
4
|
+
import { RADIUS_CLASS as t } from "../../shared/radius.js";
|
|
5
|
+
import { resolveVariantClass as n } from "../../shared/variant.js";
|
|
6
|
+
import { useAsheeConfig as r } from "../../libs/context.js";
|
|
7
|
+
import { resolveCascade as i, resolveClassKey as a } from "../../utils/resolve-token.js";
|
|
8
|
+
import { Image as o } from "../image/Image.js";
|
|
9
|
+
import { FALLBACK_AVATAR_CONFIG as s } from "./avatar-config.js";
|
|
10
|
+
import { AVATAR_BASE_CLASS as c, AVATAR_FALLBACK_VARIANT as l, AVATAR_FONT_CLASS as u, AVATAR_SIZE_CLASS as d } from "./avatar-styles.js";
|
|
11
|
+
import { getInitials as f } from "./avatar.helpers.js";
|
|
12
|
+
import { forwardRef as p, useState as m } from "react";
|
|
13
|
+
import { jsx as h } from "react/jsx-runtime";
|
|
14
|
+
//#region src/components/avatar/Avatar.tsx
|
|
15
|
+
var g = p(({ name: p, src: g, alt: _, component: v, componentProps: y, fallback: b, size: x, radius: S, color: C, className: w, ...T }, E) => {
|
|
16
|
+
let D = r(), O = D.components?.avatar, [k, A] = m(!1), j = i(x, O?.size, void 0, s.size), M = i(S, O?.radius, D.defaultRadius, s.radius), N = i(C, O?.color, D.defaultColor, s.color), P = a(j, d, s.size), F = a(j, u, s.size), I = a(M, t, s.radius), L = _ ?? p, R = !!g && !k;
|
|
17
|
+
return /* @__PURE__ */ h("div", {
|
|
18
|
+
ref: E,
|
|
19
|
+
role: "img",
|
|
20
|
+
"aria-label": L,
|
|
21
|
+
"aria-hidden": !L || void 0,
|
|
22
|
+
className: e(c, P, I, w),
|
|
23
|
+
...T,
|
|
24
|
+
children: R ? /* @__PURE__ */ h(o, {
|
|
25
|
+
src: g,
|
|
26
|
+
alt: "",
|
|
27
|
+
component: v,
|
|
28
|
+
componentProps: y,
|
|
29
|
+
fit: "cover",
|
|
30
|
+
radius: M,
|
|
31
|
+
showSkeleton: !1,
|
|
32
|
+
onError: () => A(!0),
|
|
33
|
+
className: "size-full"
|
|
34
|
+
}) : /* @__PURE__ */ h("span", {
|
|
35
|
+
"aria-hidden": "true",
|
|
36
|
+
className: e("inline-flex items-center justify-center size-full", F, n(l, N)),
|
|
37
|
+
children: b ?? f(p ?? "")
|
|
38
|
+
})
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
g.displayName = "Avatar";
|
|
42
|
+
//#endregion
|
|
43
|
+
export { g as Avatar };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Color, Radius, Size } from '../../shared';
|
|
2
|
+
/**
|
|
3
|
+
* Theme configuration options for the Avatar component.
|
|
4
|
+
*
|
|
5
|
+
* Set under `components.avatar` in the AsheeUI config. Values feed the
|
|
6
|
+
* component-level fallback tier of the theme cascade.
|
|
7
|
+
*/
|
|
8
|
+
export interface AvatarConfig {
|
|
9
|
+
/**
|
|
10
|
+
* Diameter scale of the avatar.
|
|
11
|
+
*
|
|
12
|
+
* @default "md"
|
|
13
|
+
*/
|
|
14
|
+
size?: Size;
|
|
15
|
+
/**
|
|
16
|
+
* Corner rounding.
|
|
17
|
+
* The default makes a circular avatar; a smaller radius makes it square.
|
|
18
|
+
*
|
|
19
|
+
* @default "full"
|
|
20
|
+
*/
|
|
21
|
+
radius?: Radius;
|
|
22
|
+
/**
|
|
23
|
+
* Theme accent colour.
|
|
24
|
+
* Colours the surface the initials fall back to. It does not tint the image.
|
|
25
|
+
*
|
|
26
|
+
* @default "primary"
|
|
27
|
+
*/
|
|
28
|
+
color?: Color;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Default config values registered for the Avatar component.
|
|
32
|
+
*
|
|
33
|
+
* `color` is intentionally absent so it inherits from the global
|
|
34
|
+
* `defaultColor`.
|
|
35
|
+
*/
|
|
36
|
+
export declare const defaultAvatarConfig: AvatarConfig;
|
|
37
|
+
/**
|
|
38
|
+
* Hard fallback values used when no config tier provides a value.
|
|
39
|
+
* These values are used when instance props, component config,
|
|
40
|
+
* and global defaults are all undefined.
|
|
41
|
+
*/
|
|
42
|
+
export declare const FALLBACK_AVATAR_CONFIG: Required<AvatarConfig>;
|
|
43
|
+
declare module "../../libs/registry" {
|
|
44
|
+
interface ComponentTypeConfigRegistry {
|
|
45
|
+
avatar: AvatarConfig;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=avatar-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"avatar-config.d.ts","sourceRoot":"","sources":["../../../src/components/avatar/avatar-config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAExD;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B;;;;OAIG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;IAEZ;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAED;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,EAAE,YAGjC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,YAAY,CAIhD,CAAC;AAEX,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,2BAA2B;QACnC,MAAM,EAAE,YAAY,CAAC;KACtB;CACF"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { registerComponentDefaults as e } from "../../libs/registry.js";
|
|
3
|
+
//#region src/components/avatar/avatar-config.ts
|
|
4
|
+
var t = {
|
|
5
|
+
size: "md",
|
|
6
|
+
radius: "full"
|
|
7
|
+
}, n = {
|
|
8
|
+
size: "md",
|
|
9
|
+
radius: "full",
|
|
10
|
+
color: "primary"
|
|
11
|
+
};
|
|
12
|
+
e("avatar", t);
|
|
13
|
+
//#endregion
|
|
14
|
+
export { n as FALLBACK_AVATAR_CONFIG, t as defaultAvatarConfig };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Size, Variant } from '../../shared';
|
|
2
|
+
/**
|
|
3
|
+
* CSS classes for the avatar's diameter based on size.
|
|
4
|
+
*/
|
|
5
|
+
export declare const AVATAR_SIZE_CLASS: Record<Size, string>;
|
|
6
|
+
/**
|
|
7
|
+
* CSS classes for the initials' font size based on size.
|
|
8
|
+
*/
|
|
9
|
+
export declare const AVATAR_FONT_CLASS: Record<Size, string>;
|
|
10
|
+
/**
|
|
11
|
+
* Base classes for the avatar frame.
|
|
12
|
+
* The frame clips the picture to the resolved radius and centres a fallback.
|
|
13
|
+
*/
|
|
14
|
+
export declare const AVATAR_BASE_CLASS = "relative inline-flex items-center justify-center shrink-0 overflow-hidden select-none font-medium uppercase";
|
|
15
|
+
/**
|
|
16
|
+
* The variant the initials fall back to.
|
|
17
|
+
* An avatar shows an entity, so its fallback is a filled accent surface rather
|
|
18
|
+
* than an outline or a tint.
|
|
19
|
+
*/
|
|
20
|
+
export declare const AVATAR_FALLBACK_VARIANT: Variant;
|
|
21
|
+
//# sourceMappingURL=avatar-styles.d.ts.map
|