@masaraxui/react 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/LICENSE +21 -0
- package/README.md +50 -0
- package/dist/components/accordion/accordion.d.ts +30 -0
- package/dist/components/accordion/accordion.js +191 -0
- package/dist/components/accordion/index.d.ts +25 -0
- package/dist/components/accordion/index.js +18 -0
- package/dist/components/alert/alert.d.ts +15 -0
- package/dist/components/alert/alert.js +152 -0
- package/dist/components/alert/index.d.ts +21 -0
- package/dist/components/alert/index.js +16 -0
- package/dist/components/alert-dialog/alert-dialog.d.ts +65 -0
- package/dist/components/alert-dialog/alert-dialog.js +309 -0
- package/dist/components/alert-dialog/index.d.ts +33 -0
- package/dist/components/alert-dialog/index.js +22 -0
- package/dist/components/autocomplete/autocomplete.d.ts +31 -0
- package/dist/components/autocomplete/autocomplete.js +241 -0
- package/dist/components/autocomplete/index.d.ts +25 -0
- package/dist/components/autocomplete/index.js +18 -0
- package/dist/components/avatar/avatar.d.ts +15 -0
- package/dist/components/avatar/avatar.js +93 -0
- package/dist/components/avatar/index.d.ts +17 -0
- package/dist/components/avatar/index.js +14 -0
- package/dist/components/badge/badge.d.ts +19 -0
- package/dist/components/badge/badge.js +87 -0
- package/dist/components/badge/index.d.ts +17 -0
- package/dist/components/badge/index.js +14 -0
- package/dist/components/breadcrumbs/breadcrumbs.d.ts +14 -0
- package/dist/components/breadcrumbs/breadcrumbs.js +84 -0
- package/dist/components/breadcrumbs/index.d.ts +15 -0
- package/dist/components/breadcrumbs/index.js +13 -0
- package/dist/components/button/button.d.ts +10 -0
- package/dist/components/button/button.js +49 -0
- package/dist/components/button/index.d.ts +15 -0
- package/dist/components/button/index.js +13 -0
- package/dist/components/button-group/button-group.d.ts +26 -0
- package/dist/components/button-group/button-group.js +82 -0
- package/dist/components/button-group/index.d.ts +16 -0
- package/dist/components/button-group/index.js +14 -0
- package/dist/components/calendar/calendar.d.ts +71 -0
- package/dist/components/calendar/calendar.js +283 -0
- package/dist/components/calendar/index.d.ts +91 -0
- package/dist/components/calendar/index.js +29 -0
- package/dist/components/calendar-year-picker/calendar-year-picker.d.ts +61 -0
- package/dist/components/calendar-year-picker/calendar-year-picker.js +411 -0
- package/dist/components/calendar-year-picker/index.d.ts +43 -0
- package/dist/components/calendar-year-picker/index.js +18 -0
- package/dist/components/calendar-year-picker/year-picker-context.d.ts +28 -0
- package/dist/components/calendar-year-picker/year-picker-context.js +39 -0
- package/dist/components/card/card.d.ts +22 -0
- package/dist/components/card/card.js +141 -0
- package/dist/components/card/index.d.ts +23 -0
- package/dist/components/card/index.js +17 -0
- package/dist/components/checkbox/checkbox.d.ts +22 -0
- package/dist/components/checkbox/checkbox.js +124 -0
- package/dist/components/checkbox/index.d.ts +19 -0
- package/dist/components/checkbox/index.js +15 -0
- package/dist/components/checkbox-group/checkbox-group.d.ts +14 -0
- package/dist/components/checkbox-group/checkbox-group.js +33 -0
- package/dist/components/checkbox-group/index.d.ts +3 -0
- package/dist/components/checkbox-group/index.js +3 -0
- package/dist/components/chip/chip.d.ts +14 -0
- package/dist/components/chip/chip.js +67 -0
- package/dist/components/chip/index.d.ts +15 -0
- package/dist/components/chip/index.js +13 -0
- package/dist/components/close-button/close-button.d.ts +8 -0
- package/dist/components/close-button/close-button.js +33 -0
- package/dist/components/close-button/index.d.ts +13 -0
- package/dist/components/close-button/index.js +12 -0
- package/dist/components/color-area/color-area.d.ts +11 -0
- package/dist/components/color-area/color-area.js +70 -0
- package/dist/components/color-area/index.d.ts +15 -0
- package/dist/components/color-area/index.js +13 -0
- package/dist/components/color-field/color-field.d.ts +9 -0
- package/dist/components/color-field/color-field.js +29 -0
- package/dist/components/color-field/index.d.ts +22 -0
- package/dist/components/color-field/index.js +18 -0
- package/dist/components/color-input-group/color-input-group.d.ts +19 -0
- package/dist/components/color-input-group/color-input-group.js +98 -0
- package/dist/components/color-input-group/index.d.ts +19 -0
- package/dist/components/color-input-group/index.js +15 -0
- package/dist/components/color-picker/color-picker.d.ts +21 -0
- package/dist/components/color-picker/color-picker.js +86 -0
- package/dist/components/color-picker/index.d.ts +17 -0
- package/dist/components/color-picker/index.js +14 -0
- package/dist/components/color-slider/color-slider.d.ts +50 -0
- package/dist/components/color-slider/color-slider.js +205 -0
- package/dist/components/color-slider/index.d.ts +19 -0
- package/dist/components/color-slider/index.js +15 -0
- package/dist/components/color-swatch/color-swatch.d.ts +8 -0
- package/dist/components/color-swatch/color-swatch.js +31 -0
- package/dist/components/color-swatch/index.d.ts +13 -0
- package/dist/components/color-swatch/index.js +12 -0
- package/dist/components/color-swatch-picker/color-swatch-picker.d.ts +20 -0
- package/dist/components/color-swatch-picker/color-swatch-picker.js +149 -0
- package/dist/components/color-swatch-picker/index.d.ts +19 -0
- package/dist/components/color-swatch-picker/index.js +15 -0
- package/dist/components/combo-box/combo-box.d.ts +34 -0
- package/dist/components/combo-box/combo-box.js +116 -0
- package/dist/components/combo-box/index.d.ts +20 -0
- package/dist/components/combo-box/index.js +16 -0
- package/dist/components/date-field/date-field.d.ts +9 -0
- package/dist/components/date-field/date-field.js +29 -0
- package/dist/components/date-field/index.d.ts +26 -0
- package/dist/components/date-field/index.js +20 -0
- package/dist/components/date-input-group/date-input-group.d.ts +25 -0
- package/dist/components/date-input-group/date-input-group.js +146 -0
- package/dist/components/date-input-group/index.d.ts +23 -0
- package/dist/components/date-input-group/index.js +17 -0
- package/dist/components/date-picker/date-picker.d.ts +30 -0
- package/dist/components/date-picker/date-picker.js +151 -0
- package/dist/components/date-picker/index.d.ts +31 -0
- package/dist/components/date-picker/index.js +15 -0
- package/dist/components/date-range-picker/date-range-picker.d.ts +36 -0
- package/dist/components/date-range-picker/date-range-picker.js +173 -0
- package/dist/components/date-range-picker/index.d.ts +36 -0
- package/dist/components/date-range-picker/index.js +16 -0
- package/dist/components/description/description.d.ts +9 -0
- package/dist/components/description/description.js +22 -0
- package/dist/components/description/index.d.ts +13 -0
- package/dist/components/description/index.js +12 -0
- package/dist/components/disclosure/disclosure.d.ts +27 -0
- package/dist/components/disclosure/disclosure.js +157 -0
- package/dist/components/disclosure/index.d.ts +23 -0
- package/dist/components/disclosure/index.js +17 -0
- package/dist/components/disclosure-group/disclosure-group.d.ts +8 -0
- package/dist/components/disclosure-group/disclosure-group.js +35 -0
- package/dist/components/disclosure-group/index.d.ts +15 -0
- package/dist/components/disclosure-group/index.js +13 -0
- package/dist/components/disclosure-group/use-disclosure-group-navigation.d.ts +14 -0
- package/dist/components/disclosure-group/use-disclosure-group-navigation.js +51 -0
- package/dist/components/drawer/drawer.d.ts +84 -0
- package/dist/components/drawer/drawer.js +439 -0
- package/dist/components/drawer/index.d.ts +69 -0
- package/dist/components/drawer/index.js +22 -0
- package/dist/components/dropdown/dropdown.d.ts +38 -0
- package/dist/components/dropdown/dropdown.js +156 -0
- package/dist/components/dropdown/index.d.ts +29 -0
- package/dist/components/dropdown/index.js +20 -0
- package/dist/components/empty-state/empty-state.d.ts +7 -0
- package/dist/components/empty-state/empty-state.js +20 -0
- package/dist/components/empty-state/index.d.ts +13 -0
- package/dist/components/empty-state/index.js +12 -0
- package/dist/components/error-message/error-message.d.ts +9 -0
- package/dist/components/error-message/error-message.js +22 -0
- package/dist/components/error-message/index.d.ts +13 -0
- package/dist/components/error-message/index.js +12 -0
- package/dist/components/field-error/field-error.d.ts +8 -0
- package/dist/components/field-error/field-error.js +21 -0
- package/dist/components/field-error/index.d.ts +13 -0
- package/dist/components/field-error/index.js +12 -0
- package/dist/components/fieldset/fieldset.d.ts +16 -0
- package/dist/components/fieldset/fieldset.js +88 -0
- package/dist/components/fieldset/index.d.ts +19 -0
- package/dist/components/fieldset/index.js +15 -0
- package/dist/components/form/form.d.ts +7 -0
- package/dist/components/form/form.js +13 -0
- package/dist/components/form/index.d.ts +11 -0
- package/dist/components/form/index.js +11 -0
- package/dist/components/header/header.d.ts +7 -0
- package/dist/components/header/header.js +21 -0
- package/dist/components/header/index.d.ts +9 -0
- package/dist/components/header/index.js +10 -0
- package/dist/components/icons.d.ts +18 -0
- package/dist/components/icons.js +243 -0
- package/dist/components/index.d.ts +84 -0
- package/dist/components/input/index.d.ts +13 -0
- package/dist/components/input/index.js +12 -0
- package/dist/components/input/input.d.ts +8 -0
- package/dist/components/input/input.js +31 -0
- package/dist/components/input-group/index.d.ts +21 -0
- package/dist/components/input-group/index.js +16 -0
- package/dist/components/input-group/input-group.d.ts +20 -0
- package/dist/components/input-group/input-group.js +129 -0
- package/dist/components/input-otp/index.d.ts +22 -0
- package/dist/components/input-otp/index.js +21 -0
- package/dist/components/input-otp/input-otp.d.ts +26 -0
- package/dist/components/input-otp/input-otp.js +139 -0
- package/dist/components/kbd/index.d.ts +19 -0
- package/dist/components/kbd/index.js +15 -0
- package/dist/components/kbd/kbd.constants.d.ts +3 -0
- package/dist/components/kbd/kbd.constants.js +51 -0
- package/dist/components/kbd/kbd.d.ts +24 -0
- package/dist/components/kbd/kbd.js +76 -0
- package/dist/components/label/index.d.ts +13 -0
- package/dist/components/label/index.js +12 -0
- package/dist/components/label/label.d.ts +8 -0
- package/dist/components/label/label.js +27 -0
- package/dist/components/link/index.d.ts +15 -0
- package/dist/components/link/index.js +13 -0
- package/dist/components/link/link.d.ts +10 -0
- package/dist/components/link/link.js +59 -0
- package/dist/components/list-box/index.d.ts +23 -0
- package/dist/components/list-box/index.js +18 -0
- package/dist/components/list-box/list-box.d.ts +9 -0
- package/dist/components/list-box/list-box.js +23 -0
- package/dist/components/list-box-item/index.d.ts +15 -0
- package/dist/components/list-box-item/index.js +13 -0
- package/dist/components/list-box-item/list-box-item.d.ts +15 -0
- package/dist/components/list-box-item/list-box-item.js +77 -0
- package/dist/components/list-box-section/index.d.ts +10 -0
- package/dist/components/list-box-section/index.js +10 -0
- package/dist/components/list-box-section/list-box-section.d.ts +8 -0
- package/dist/components/list-box-section/list-box-section.js +22 -0
- package/dist/components/menu/index.d.ts +24 -0
- package/dist/components/menu/index.js +18 -0
- package/dist/components/menu/menu.d.ts +9 -0
- package/dist/components/menu/menu.js +20 -0
- package/dist/components/menu-item/index.d.ts +17 -0
- package/dist/components/menu-item/index.js +14 -0
- package/dist/components/menu-item/menu-item.d.ts +20 -0
- package/dist/components/menu-item/menu-item.js +123 -0
- package/dist/components/menu-section/index.d.ts +10 -0
- package/dist/components/menu-section/index.js +10 -0
- package/dist/components/menu-section/menu-section.d.ts +8 -0
- package/dist/components/menu-section/menu-section.js +22 -0
- package/dist/components/meter/index.d.ts +34 -0
- package/dist/components/meter/index.js +15 -0
- package/dist/components/meter/meter.d.ts +29 -0
- package/dist/components/meter/meter.js +108 -0
- package/dist/components/modal/index.d.ts +33 -0
- package/dist/components/modal/index.js +22 -0
- package/dist/components/modal/modal.d.ts +53 -0
- package/dist/components/modal/modal.js +288 -0
- package/dist/components/number-field/index.d.ts +21 -0
- package/dist/components/number-field/index.js +16 -0
- package/dist/components/number-field/number-field.d.ts +20 -0
- package/dist/components/number-field/number-field.js +127 -0
- package/dist/components/pagination/index.d.ts +64 -0
- package/dist/components/pagination/index.js +21 -0
- package/dist/components/pagination/pagination.d.ts +84 -0
- package/dist/components/pagination/pagination.js +230 -0
- package/dist/components/popover/index.d.ts +23 -0
- package/dist/components/popover/index.js +17 -0
- package/dist/components/popover/popover.d.ts +24 -0
- package/dist/components/popover/popover.js +153 -0
- package/dist/components/progress-bar/index.d.ts +34 -0
- package/dist/components/progress-bar/index.js +15 -0
- package/dist/components/progress-bar/progress-bar.d.ts +29 -0
- package/dist/components/progress-bar/progress-bar.js +108 -0
- package/dist/components/progress-circle/index.d.ts +34 -0
- package/dist/components/progress-circle/index.js +15 -0
- package/dist/components/progress-circle/progress-circle.d.ts +29 -0
- package/dist/components/progress-circle/progress-circle.js +126 -0
- package/dist/components/rac/components.d.ts +1 -0
- package/dist/components/rac/index.d.ts +5 -0
- package/dist/components/rac/index.js +3 -0
- package/dist/components/rac/types.d.ts +3 -0
- package/dist/components/rac/utils.d.ts +1 -0
- package/dist/components/radio/index.d.ts +19 -0
- package/dist/components/radio/index.js +15 -0
- package/dist/components/radio/radio.d.ts +21 -0
- package/dist/components/radio/radio.js +97 -0
- package/dist/components/radio-group/index.d.ts +13 -0
- package/dist/components/radio-group/index.js +12 -0
- package/dist/components/radio-group/radio-group.d.ts +8 -0
- package/dist/components/radio-group/radio-group.js +27 -0
- package/dist/components/range-calendar/index.d.ts +91 -0
- package/dist/components/range-calendar/index.js +29 -0
- package/dist/components/range-calendar/range-calendar.d.ts +71 -0
- package/dist/components/range-calendar/range-calendar.js +298 -0
- package/dist/components/scroll-shadow/index.d.ts +21 -0
- package/dist/components/scroll-shadow/index.js +13 -0
- package/dist/components/scroll-shadow/scroll-shadow.d.ts +32 -0
- package/dist/components/scroll-shadow/scroll-shadow.js +76 -0
- package/dist/components/scroll-shadow/use-scroll-shadow.d.ts +11 -0
- package/dist/components/scroll-shadow/use-scroll-shadow.js +121 -0
- package/dist/components/search-field/index.d.ts +21 -0
- package/dist/components/search-field/index.js +16 -0
- package/dist/components/search-field/search-field.d.ts +23 -0
- package/dist/components/search-field/search-field.js +127 -0
- package/dist/components/select/index.d.ts +21 -0
- package/dist/components/select/index.js +16 -0
- package/dist/components/select/select.d.ts +24 -0
- package/dist/components/select/select.js +140 -0
- package/dist/components/separator/index.d.ts +13 -0
- package/dist/components/separator/index.js +12 -0
- package/dist/components/separator/separator.d.ts +8 -0
- package/dist/components/separator/separator.js +27 -0
- package/dist/components/skeleton/index.d.ts +13 -0
- package/dist/components/skeleton/index.js +12 -0
- package/dist/components/skeleton/skeleton.d.ts +7 -0
- package/dist/components/skeleton/skeleton.js +25 -0
- package/dist/components/slider/index.d.ts +23 -0
- package/dist/components/slider/index.js +17 -0
- package/dist/components/slider/slider.d.ts +23 -0
- package/dist/components/slider/slider.js +177 -0
- package/dist/components/spinner/index.d.ts +13 -0
- package/dist/components/spinner/index.js +12 -0
- package/dist/components/spinner/spinner.d.ts +7 -0
- package/dist/components/spinner/spinner.js +88 -0
- package/dist/components/surface/index.d.ts +14 -0
- package/dist/components/surface/index.js +13 -0
- package/dist/components/surface/surface.d.ts +12 -0
- package/dist/components/surface/surface.js +34 -0
- package/dist/components/switch/index.d.ts +21 -0
- package/dist/components/switch/index.js +16 -0
- package/dist/components/switch/switch.d.ts +20 -0
- package/dist/components/switch/switch.js +118 -0
- package/dist/components/switch-group/index.d.ts +13 -0
- package/dist/components/switch-group/index.js +12 -0
- package/dist/components/switch-group/switch-group.d.ts +7 -0
- package/dist/components/switch-group/switch-group.js +25 -0
- package/dist/components/table/index.d.ts +38 -0
- package/dist/components/table/index.js +25 -0
- package/dist/components/table/table.d.ts +50 -0
- package/dist/components/table/table.js +283 -0
- package/dist/components/tabs/index.d.ts +25 -0
- package/dist/components/tabs/index.js +18 -0
- package/dist/components/tabs/tabs.d.ts +37 -0
- package/dist/components/tabs/tabs.js +156 -0
- package/dist/components/tag/index.d.ts +15 -0
- package/dist/components/tag/index.js +13 -0
- package/dist/components/tag/tag.d.ts +14 -0
- package/dist/components/tag/tag.js +85 -0
- package/dist/components/tag-group/index.d.ts +15 -0
- package/dist/components/tag-group/index.js +14 -0
- package/dist/components/tag-group/tag-group.d.ts +20 -0
- package/dist/components/tag-group/tag-group.js +59 -0
- package/dist/components/text/index.d.ts +13 -0
- package/dist/components/text/index.js +12 -0
- package/dist/components/text/text.d.ts +8 -0
- package/dist/components/text/text.js +25 -0
- package/dist/components/textarea/index.d.ts +13 -0
- package/dist/components/textarea/index.js +12 -0
- package/dist/components/textarea/textarea.d.ts +8 -0
- package/dist/components/textarea/textarea.js +27 -0
- package/dist/components/textfield/index.d.ts +14 -0
- package/dist/components/textfield/index.js +13 -0
- package/dist/components/textfield/textfield.d.ts +18 -0
- package/dist/components/textfield/textfield.js +39 -0
- package/dist/components/time-field/index.d.ts +26 -0
- package/dist/components/time-field/index.js +20 -0
- package/dist/components/time-field/time-field.d.ts +9 -0
- package/dist/components/time-field/time-field.js +29 -0
- package/dist/components/toast/constants.d.ts +6 -0
- package/dist/components/toast/constants.js +15 -0
- package/dist/components/toast/index.d.ts +75 -0
- package/dist/components/toast/index.js +23 -0
- package/dist/components/toast/toast-queue.d.ts +70 -0
- package/dist/components/toast/toast-queue.js +147 -0
- package/dist/components/toast/toast.d.ts +69 -0
- package/dist/components/toast/toast.js +365 -0
- package/dist/components/toggle-button/index.d.ts +13 -0
- package/dist/components/toggle-button/index.js +12 -0
- package/dist/components/toggle-button/toggle-button.d.ts +8 -0
- package/dist/components/toggle-button/toggle-button.js +36 -0
- package/dist/components/toggle-button-group/index.d.ts +16 -0
- package/dist/components/toggle-button-group/index.js +14 -0
- package/dist/components/toggle-button-group/toggle-button-group.d.ts +25 -0
- package/dist/components/toggle-button-group/toggle-button-group.js +70 -0
- package/dist/components/toolbar/index.d.ts +19 -0
- package/dist/components/toolbar/index.js +12 -0
- package/dist/components/toolbar/toolbar.d.ts +11 -0
- package/dist/components/toolbar/toolbar.js +39 -0
- package/dist/components/tooltip/index.d.ts +19 -0
- package/dist/components/tooltip/index.js +15 -0
- package/dist/components/tooltip/tooltip.d.ts +20 -0
- package/dist/components/tooltip/tooltip.js +106 -0
- package/dist/hooks/index.d.ts +9 -0
- package/dist/hooks/use-css-variable.d.ts +36 -0
- package/dist/hooks/use-css-variable.js +72 -0
- package/dist/hooks/use-is-hydrated.d.ts +19 -0
- package/dist/hooks/use-is-hydrated.js +28 -0
- package/dist/hooks/use-isomorphic-layout-effect.d.ts +2 -0
- package/dist/hooks/use-isomorphic-layout-effect.js +6 -0
- package/dist/hooks/use-list-data.d.ts +111 -0
- package/dist/hooks/use-list-data.js +296 -0
- package/dist/hooks/use-measured-height.d.ts +4 -0
- package/dist/hooks/use-measured-height.js +47 -0
- package/dist/hooks/use-media-query.d.ts +6 -0
- package/dist/hooks/use-media-query.js +50 -0
- package/dist/hooks/use-mounted.d.ts +1 -0
- package/dist/hooks/use-mounted.js +15 -0
- package/dist/hooks/use-overlay-state.d.ts +52 -0
- package/dist/hooks/use-overlay-state.js +70 -0
- package/dist/hooks/use-safe-layout-effect.d.ts +2 -0
- package/dist/hooks/use-safe-layout-effect.js +6 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +190 -0
- package/dist/prerelease.d.ts +4 -0
- package/dist/prerelease.js +50 -0
- package/dist/styles.css +2 -0
- package/dist/utils/assertion.d.ts +9 -0
- package/dist/utils/assertion.js +3 -0
- package/dist/utils/calendar.d.ts +12 -0
- package/dist/utils/calendar.js +52 -0
- package/dist/utils/children.d.ts +9 -0
- package/dist/utils/children.js +17 -0
- package/dist/utils/compose.d.ts +7 -0
- package/dist/utils/compose.js +18 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/logger.d.ts +23 -0
- package/dist/utils/logger.js +78 -0
- package/dist/utils/tv.d.ts +3 -0
- package/dist/utils/variants.d.ts +73 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +5 -0
- package/package.json +406 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { listboxItemVariants } from '@masaraxui/styles';
|
|
3
|
+
import React__default, { createContext, useContext } from 'react';
|
|
4
|
+
import { ListBoxItem } from 'react-aria-components';
|
|
5
|
+
import { jsx } from 'react/jsx-runtime';
|
|
6
|
+
import { composeTwRenderProps, composeSlotClassName } from '../../utils/compose.js';
|
|
7
|
+
|
|
8
|
+
const ListBoxItemContext = /*#__PURE__*/createContext({});
|
|
9
|
+
|
|
10
|
+
/* -------------------------------------------------------------------------------------------------
|
|
11
|
+
* ListBox Item Root
|
|
12
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
13
|
+
|
|
14
|
+
const ListBoxItemRoot = ({
|
|
15
|
+
children,
|
|
16
|
+
className,
|
|
17
|
+
variant,
|
|
18
|
+
...props
|
|
19
|
+
}) => {
|
|
20
|
+
const slots = React__default.useMemo(() => listboxItemVariants({
|
|
21
|
+
variant
|
|
22
|
+
}), [variant]);
|
|
23
|
+
return /*#__PURE__*/jsx(ListBoxItem, {
|
|
24
|
+
className: composeTwRenderProps(className, slots.item()),
|
|
25
|
+
"data-slot": "list-box-item",
|
|
26
|
+
...props,
|
|
27
|
+
children: values => /*#__PURE__*/jsx(ListBoxItemContext, {
|
|
28
|
+
value: {
|
|
29
|
+
slots,
|
|
30
|
+
state: values
|
|
31
|
+
},
|
|
32
|
+
children: typeof children === "function" ? children(values) : children
|
|
33
|
+
})
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/* -------------------------------------------------------------------------------------------------
|
|
38
|
+
* ListBox Item Indicator
|
|
39
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
40
|
+
|
|
41
|
+
const ListBoxItemIndicator = ({
|
|
42
|
+
children,
|
|
43
|
+
className,
|
|
44
|
+
...props
|
|
45
|
+
}) => {
|
|
46
|
+
const {
|
|
47
|
+
slots,
|
|
48
|
+
state
|
|
49
|
+
} = useContext(ListBoxItemContext);
|
|
50
|
+
const isSelected = state?.isSelected;
|
|
51
|
+
const content = typeof children === "function" ? children(state ?? {}) : children ? children : /*#__PURE__*/jsx("svg", {
|
|
52
|
+
"aria-hidden": "true",
|
|
53
|
+
"data-slot": "list-box-item-indicator--checkmark",
|
|
54
|
+
fill: "none",
|
|
55
|
+
role: "presentation",
|
|
56
|
+
stroke: "currentColor",
|
|
57
|
+
strokeDasharray: 22,
|
|
58
|
+
strokeDashoffset: isSelected ? 44 : 66,
|
|
59
|
+
strokeLinecap: "round",
|
|
60
|
+
strokeLinejoin: "round",
|
|
61
|
+
strokeWidth: 2,
|
|
62
|
+
viewBox: "0 0 17 18",
|
|
63
|
+
children: /*#__PURE__*/jsx("polyline", {
|
|
64
|
+
points: "1 9 7 14 15 4"
|
|
65
|
+
})
|
|
66
|
+
});
|
|
67
|
+
return /*#__PURE__*/jsx("span", {
|
|
68
|
+
"aria-hidden": "true",
|
|
69
|
+
className: composeSlotClassName(slots?.indicator, className),
|
|
70
|
+
"data-slot": "list-box-item-indicator",
|
|
71
|
+
"data-visible": isSelected || undefined,
|
|
72
|
+
...props,
|
|
73
|
+
children: content
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export { ListBoxItemIndicator, ListBoxItemRoot };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { ListBoxSectionRoot } from "./list-box-section";
|
|
3
|
+
export declare const ListBoxSection: ({ children, className, ...props }: import("./list-box-section").ListBoxSectionRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export type ListBoxSection = {
|
|
5
|
+
Props: ComponentProps<typeof ListBoxSectionRoot>;
|
|
6
|
+
};
|
|
7
|
+
export { ListBoxSectionRoot };
|
|
8
|
+
export type { ListBoxSectionRootProps, ListBoxSectionRootProps as ListBoxSectionProps, } from "./list-box-section";
|
|
9
|
+
export { listboxSectionVariants } from "@masaraxui/styles";
|
|
10
|
+
export type { ListBoxSectionVariants } from "@masaraxui/styles";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { ListBoxSectionRoot } from './list-box-section.js';
|
|
3
|
+
export { listboxSectionVariants } from '@masaraxui/styles';
|
|
4
|
+
|
|
5
|
+
/* -------------------------------------------------------------------------------------------------
|
|
6
|
+
* Compound Component
|
|
7
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
8
|
+
const ListBoxSection = ListBoxSectionRoot;
|
|
9
|
+
|
|
10
|
+
export { ListBoxSection, ListBoxSectionRoot };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from "react";
|
|
2
|
+
import { ListBoxSection as ListBoxSectionPrimitive } from "react-aria-components";
|
|
3
|
+
interface ListBoxSectionRootProps extends ComponentPropsWithRef<typeof ListBoxSectionPrimitive> {
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
declare const ListBoxSectionRoot: ({ children, className, ...props }: ListBoxSectionRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export { ListBoxSectionRoot };
|
|
8
|
+
export type { ListBoxSectionRootProps };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { listboxSectionVariants } from '@masaraxui/styles';
|
|
3
|
+
import React__default from 'react';
|
|
4
|
+
import { ListBoxSection } from 'react-aria-components';
|
|
5
|
+
import { jsx } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
const ListBoxSectionRoot = ({
|
|
8
|
+
children,
|
|
9
|
+
className,
|
|
10
|
+
...props
|
|
11
|
+
}) => {
|
|
12
|
+
const styles = React__default.useMemo(() => listboxSectionVariants({
|
|
13
|
+
class: typeof className === "string" ? className : undefined
|
|
14
|
+
}), [className]);
|
|
15
|
+
return /*#__PURE__*/jsx(ListBoxSection, {
|
|
16
|
+
className: styles,
|
|
17
|
+
...props,
|
|
18
|
+
children: children
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export { ListBoxSectionRoot };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { MenuItemRoot } from "../menu-item";
|
|
2
|
+
import type { MenuSectionRoot } from "../menu-section";
|
|
3
|
+
import type { ComponentProps } from "react";
|
|
4
|
+
import { MenuRoot } from "./menu";
|
|
5
|
+
export declare const Menu: typeof MenuRoot & {
|
|
6
|
+
Root: typeof MenuRoot;
|
|
7
|
+
Item: (({ children, className, variant, ...props }: import("..").MenuItemRootProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
8
|
+
Root: ({ children, className, variant, ...props }: import("..").MenuItemRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
Indicator: ({ children, className, type, ...props }: import("..").MenuItemIndicatorProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
SubmenuIndicator: ({ children, className, ...props }: import("..").MenuItemSubmenuIndicatorProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
11
|
+
};
|
|
12
|
+
ItemIndicator: ({ children, className, type, ...props }: import("..").MenuItemIndicatorProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
Section: ({ children, className, ...props }: import("..").MenuSectionRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
};
|
|
15
|
+
export type Menu<T extends object = object> = {
|
|
16
|
+
Props: ComponentProps<typeof MenuRoot<T>>;
|
|
17
|
+
RootProps: ComponentProps<typeof MenuRoot<T>>;
|
|
18
|
+
ItemProps: ComponentProps<typeof MenuItemRoot>;
|
|
19
|
+
SectionProps: ComponentProps<typeof MenuSectionRoot>;
|
|
20
|
+
};
|
|
21
|
+
export { MenuRoot };
|
|
22
|
+
export type { MenuRootProps, MenuRootProps as MenuProps } from "./menu";
|
|
23
|
+
export { menuVariants } from "@masaraxui/styles";
|
|
24
|
+
export type { MenuVariants } from "@masaraxui/styles";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { MenuItem } from '../menu-item/index.js';
|
|
3
|
+
import { MenuSection } from '../menu-section/index.js';
|
|
4
|
+
import { MenuRoot } from './menu.js';
|
|
5
|
+
export { menuVariants } from '@masaraxui/styles';
|
|
6
|
+
import { MenuItemIndicator } from '../menu-item/menu-item.js';
|
|
7
|
+
|
|
8
|
+
/* -------------------------------------------------------------------------------------------------
|
|
9
|
+
* Compound Component
|
|
10
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
11
|
+
const Menu = Object.assign(MenuRoot, {
|
|
12
|
+
Root: MenuRoot,
|
|
13
|
+
Item: MenuItem,
|
|
14
|
+
ItemIndicator: MenuItemIndicator,
|
|
15
|
+
Section: MenuSection
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export { Menu, MenuRoot };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { MenuVariants } from "@masaraxui/styles";
|
|
2
|
+
import type { ComponentPropsWithRef } from "react";
|
|
3
|
+
import { Menu as MenuPrimitive } from "react-aria-components";
|
|
4
|
+
interface MenuRootProps<T extends object> extends ComponentPropsWithRef<typeof MenuPrimitive<T>>, MenuVariants {
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
declare function MenuRoot<T extends object>({ className, ...props }: MenuRootProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export { MenuRoot };
|
|
9
|
+
export type { MenuRootProps };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { menuVariants } from '@masaraxui/styles';
|
|
3
|
+
import React__default from 'react';
|
|
4
|
+
import { Menu } from 'react-aria-components';
|
|
5
|
+
import { jsx } from 'react/jsx-runtime';
|
|
6
|
+
import { composeTwRenderProps } from '../../utils/compose.js';
|
|
7
|
+
|
|
8
|
+
function MenuRoot({
|
|
9
|
+
className,
|
|
10
|
+
...props
|
|
11
|
+
}) {
|
|
12
|
+
const styles = React__default.useMemo(() => menuVariants(), []);
|
|
13
|
+
return /*#__PURE__*/jsx(Menu, {
|
|
14
|
+
className: composeTwRenderProps(className, styles),
|
|
15
|
+
"data-slot": "menu",
|
|
16
|
+
...props
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { MenuRoot };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { MenuItemIndicator, MenuItemRoot, MenuItemSubmenuIndicator } from "./menu-item";
|
|
3
|
+
export declare const MenuItem: (({ children, className, variant, ...props }: import("./menu-item").MenuItemRootProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
4
|
+
Root: ({ children, className, variant, ...props }: import("./menu-item").MenuItemRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
Indicator: ({ children, className, type, ...props }: import("./menu-item").MenuItemIndicatorProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
SubmenuIndicator: ({ children, className, ...props }: import("./menu-item").MenuItemSubmenuIndicatorProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
7
|
+
};
|
|
8
|
+
export type MenuItem = {
|
|
9
|
+
Props: ComponentProps<typeof MenuItemRoot>;
|
|
10
|
+
RootProps: ComponentProps<typeof MenuItemRoot>;
|
|
11
|
+
IndicatorProps: ComponentProps<typeof MenuItemIndicator>;
|
|
12
|
+
SubmenuIndicatorProps: ComponentProps<typeof MenuItemSubmenuIndicator>;
|
|
13
|
+
};
|
|
14
|
+
export { MenuItemRoot, MenuItemIndicator, MenuItemSubmenuIndicator };
|
|
15
|
+
export type { MenuItemRootProps, MenuItemRootProps as MenuItemProps, MenuItemIndicatorProps, MenuItemSubmenuIndicatorProps, } from "./menu-item";
|
|
16
|
+
export { menuItemVariants } from "@masaraxui/styles";
|
|
17
|
+
export type { MenuItemVariants } from "@masaraxui/styles";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { MenuItemRoot, MenuItemSubmenuIndicator, MenuItemIndicator } from './menu-item.js';
|
|
3
|
+
export { menuItemVariants } from '@masaraxui/styles';
|
|
4
|
+
|
|
5
|
+
/* -------------------------------------------------------------------------------------------------
|
|
6
|
+
* Compound Component
|
|
7
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
8
|
+
const MenuItem = Object.assign(MenuItemRoot, {
|
|
9
|
+
Root: MenuItemRoot,
|
|
10
|
+
Indicator: MenuItemIndicator,
|
|
11
|
+
SubmenuIndicator: MenuItemSubmenuIndicator
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export { MenuItem, MenuItemIndicator, MenuItemRoot, MenuItemSubmenuIndicator };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { MenuItemVariants } from "@masaraxui/styles";
|
|
2
|
+
import type { ComponentPropsWithRef } from "react";
|
|
3
|
+
import type { MenuItemRenderProps } from "react-aria-components";
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { MenuItem as MenuItemPrimitive } from "react-aria-components";
|
|
6
|
+
interface MenuItemRootProps extends ComponentPropsWithRef<typeof MenuItemPrimitive>, MenuItemVariants {
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
declare const MenuItemRoot: ({ children, className, variant, ...props }: MenuItemRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
interface MenuItemIndicatorProps extends Omit<ComponentPropsWithRef<"span">, "children"> {
|
|
11
|
+
children?: React.ReactNode | ((props: MenuItemRenderProps) => React.ReactNode);
|
|
12
|
+
type?: "checkmark" | "dot";
|
|
13
|
+
}
|
|
14
|
+
declare const MenuItemIndicator: ({ children, className, type, ...props }: MenuItemIndicatorProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
interface MenuItemSubmenuIndicatorProps extends Omit<ComponentPropsWithRef<"span">, "children"> {
|
|
16
|
+
children?: React.ReactNode;
|
|
17
|
+
}
|
|
18
|
+
declare const MenuItemSubmenuIndicator: ({ children, className, ...props }: MenuItemSubmenuIndicatorProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
19
|
+
export { MenuItemRoot, MenuItemIndicator, MenuItemSubmenuIndicator };
|
|
20
|
+
export type { MenuItemRootProps, MenuItemIndicatorProps, MenuItemSubmenuIndicatorProps };
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { menuItemVariants } from '@masaraxui/styles';
|
|
3
|
+
import React__default, { createContext, useContext } from 'react';
|
|
4
|
+
import { MenuItem } from 'react-aria-components';
|
|
5
|
+
import { IconChevronRight } from '../icons.js';
|
|
6
|
+
import { jsx } from 'react/jsx-runtime';
|
|
7
|
+
import { composeTwRenderProps, composeSlotClassName } from '../../utils/compose.js';
|
|
8
|
+
|
|
9
|
+
const MenuItemContext = /*#__PURE__*/createContext({});
|
|
10
|
+
|
|
11
|
+
/* -------------------------------------------------------------------------------------------------
|
|
12
|
+
* Menu Item Root
|
|
13
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
14
|
+
|
|
15
|
+
const MenuItemRoot = ({
|
|
16
|
+
children,
|
|
17
|
+
className,
|
|
18
|
+
variant,
|
|
19
|
+
...props
|
|
20
|
+
}) => {
|
|
21
|
+
const slots = React__default.useMemo(() => menuItemVariants({
|
|
22
|
+
variant
|
|
23
|
+
}), [variant]);
|
|
24
|
+
return /*#__PURE__*/jsx(MenuItem, {
|
|
25
|
+
className: composeTwRenderProps(className, slots.item()),
|
|
26
|
+
"data-slot": "menu-item",
|
|
27
|
+
...props,
|
|
28
|
+
children: values => /*#__PURE__*/jsx(MenuItemContext, {
|
|
29
|
+
value: {
|
|
30
|
+
slots,
|
|
31
|
+
state: values
|
|
32
|
+
},
|
|
33
|
+
children: typeof children === "function" ? children(values) : children
|
|
34
|
+
})
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/* -------------------------------------------------------------------------------------------------
|
|
39
|
+
* Menu Item Indicator
|
|
40
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
41
|
+
|
|
42
|
+
const MenuItemIndicator = ({
|
|
43
|
+
children,
|
|
44
|
+
className,
|
|
45
|
+
type = "checkmark",
|
|
46
|
+
...props
|
|
47
|
+
}) => {
|
|
48
|
+
const {
|
|
49
|
+
slots,
|
|
50
|
+
state
|
|
51
|
+
} = useContext(MenuItemContext);
|
|
52
|
+
const isSelected = state?.isSelected;
|
|
53
|
+
const content = typeof children === "function" ? children(state ?? {}) : children ? children : type === "dot" ? /*#__PURE__*/jsx("svg", {
|
|
54
|
+
"aria-hidden": "true",
|
|
55
|
+
"data-slot": "menu-item-indicator--dot",
|
|
56
|
+
fill: "currentColor",
|
|
57
|
+
fillRule: "evenodd",
|
|
58
|
+
role: "presentation",
|
|
59
|
+
viewBox: "0 0 16 16",
|
|
60
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
61
|
+
children: /*#__PURE__*/jsx("path", {
|
|
62
|
+
clipRule: "evenodd",
|
|
63
|
+
d: "M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14",
|
|
64
|
+
fillRule: "evenodd"
|
|
65
|
+
})
|
|
66
|
+
}) : /*#__PURE__*/jsx("svg", {
|
|
67
|
+
"aria-hidden": "true",
|
|
68
|
+
"data-slot": "menu-item-indicator--checkmark",
|
|
69
|
+
fill: "none",
|
|
70
|
+
role: "presentation",
|
|
71
|
+
stroke: "currentColor",
|
|
72
|
+
strokeDasharray: 22,
|
|
73
|
+
strokeDashoffset: isSelected ? 44 : 66,
|
|
74
|
+
strokeLinecap: "round",
|
|
75
|
+
strokeLinejoin: "round",
|
|
76
|
+
strokeWidth: 2,
|
|
77
|
+
viewBox: "0 0 17 18",
|
|
78
|
+
children: /*#__PURE__*/jsx("polyline", {
|
|
79
|
+
points: "1 9 7 14 15 4"
|
|
80
|
+
})
|
|
81
|
+
});
|
|
82
|
+
return /*#__PURE__*/jsx("span", {
|
|
83
|
+
"aria-hidden": "true",
|
|
84
|
+
className: composeSlotClassName(slots?.indicator, className),
|
|
85
|
+
"data-slot": "menu-item-indicator",
|
|
86
|
+
"data-type": type,
|
|
87
|
+
"data-visible": isSelected || undefined,
|
|
88
|
+
...props,
|
|
89
|
+
children: content
|
|
90
|
+
});
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
/* -------------------------------------------------------------------------------------------------
|
|
94
|
+
* Menu Item Submenu Indicator
|
|
95
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
96
|
+
|
|
97
|
+
const MenuItemSubmenuIndicator = ({
|
|
98
|
+
children,
|
|
99
|
+
className,
|
|
100
|
+
...props
|
|
101
|
+
}) => {
|
|
102
|
+
const {
|
|
103
|
+
slots,
|
|
104
|
+
state
|
|
105
|
+
} = useContext(MenuItemContext);
|
|
106
|
+
const hasSubmenu = state?.hasSubmenu;
|
|
107
|
+
|
|
108
|
+
// Only render if hasSubmenu is true
|
|
109
|
+
if (!hasSubmenu) {
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
const defaultContent = /*#__PURE__*/jsx(IconChevronRight, {});
|
|
113
|
+
const content = children ?? defaultContent;
|
|
114
|
+
return /*#__PURE__*/jsx("span", {
|
|
115
|
+
"aria-hidden": "true",
|
|
116
|
+
className: composeSlotClassName(slots?.submenuIndicator, className),
|
|
117
|
+
"data-slot": "submenu-indicator",
|
|
118
|
+
...props,
|
|
119
|
+
children: content
|
|
120
|
+
});
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
export { MenuItemIndicator, MenuItemRoot, MenuItemSubmenuIndicator };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { MenuSectionRoot } from "./menu-section";
|
|
3
|
+
export declare const MenuSection: ({ children, className, ...props }: import("./menu-section").MenuSectionRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export type MenuSection = {
|
|
5
|
+
Props: ComponentProps<typeof MenuSectionRoot>;
|
|
6
|
+
};
|
|
7
|
+
export { MenuSectionRoot };
|
|
8
|
+
export type { MenuSectionRootProps, MenuSectionRootProps as MenuSectionProps } from "./menu-section";
|
|
9
|
+
export { menuSectionVariants } from "@masaraxui/styles";
|
|
10
|
+
export type { MenuSectionVariants } from "@masaraxui/styles";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { MenuSectionRoot } from './menu-section.js';
|
|
3
|
+
export { menuSectionVariants } from '@masaraxui/styles';
|
|
4
|
+
|
|
5
|
+
/* -------------------------------------------------------------------------------------------------
|
|
6
|
+
* Compound Component
|
|
7
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
8
|
+
const MenuSection = MenuSectionRoot;
|
|
9
|
+
|
|
10
|
+
export { MenuSection, MenuSectionRoot };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from "react";
|
|
2
|
+
import { MenuSection as MenuSectionPrimitive } from "react-aria-components";
|
|
3
|
+
interface MenuSectionRootProps extends ComponentPropsWithRef<typeof MenuSectionPrimitive> {
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
declare const MenuSectionRoot: ({ children, className, ...props }: MenuSectionRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export { MenuSectionRoot };
|
|
8
|
+
export type { MenuSectionRootProps };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { menuSectionVariants } from '@masaraxui/styles';
|
|
3
|
+
import React__default from 'react';
|
|
4
|
+
import { MenuSection } from 'react-aria-components';
|
|
5
|
+
import { jsx } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
const MenuSectionRoot = ({
|
|
8
|
+
children,
|
|
9
|
+
className,
|
|
10
|
+
...props
|
|
11
|
+
}) => {
|
|
12
|
+
const styles = React__default.useMemo(() => menuSectionVariants({
|
|
13
|
+
class: typeof className === "string" ? className : undefined
|
|
14
|
+
}), [className]);
|
|
15
|
+
return /*#__PURE__*/jsx(MenuSection, {
|
|
16
|
+
className: styles,
|
|
17
|
+
...props,
|
|
18
|
+
children: children
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export { MenuSectionRoot };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { MeterFill, MeterOutput, MeterRoot, MeterTrack } from "./meter";
|
|
3
|
+
export declare const Meter: {
|
|
4
|
+
({ children, className, color, size, ...props }: import("./meter").MeterRootProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
displayName: string;
|
|
6
|
+
} & {
|
|
7
|
+
Root: {
|
|
8
|
+
({ children, className, color, size, ...props }: import("./meter").MeterRootProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
displayName: string;
|
|
10
|
+
};
|
|
11
|
+
Output: {
|
|
12
|
+
({ children, className, ...props }: import("./meter").MeterOutputProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
displayName: string;
|
|
14
|
+
};
|
|
15
|
+
Track: {
|
|
16
|
+
({ children, className, ...props }: import("./meter").MeterTrackProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
displayName: string;
|
|
18
|
+
};
|
|
19
|
+
Fill: {
|
|
20
|
+
({ className, style, ...props }: import("./meter").MeterFillProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
displayName: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export type Meter = {
|
|
25
|
+
Props: ComponentProps<typeof MeterRoot>;
|
|
26
|
+
RootProps: ComponentProps<typeof MeterRoot>;
|
|
27
|
+
OutputProps: ComponentProps<typeof MeterOutput>;
|
|
28
|
+
TrackProps: ComponentProps<typeof MeterTrack>;
|
|
29
|
+
FillProps: ComponentProps<typeof MeterFill>;
|
|
30
|
+
};
|
|
31
|
+
export { MeterRoot, MeterOutput, MeterTrack, MeterFill };
|
|
32
|
+
export type { MeterRootProps, MeterRootProps as MeterProps, MeterOutputProps, MeterTrackProps, MeterFillProps, } from "./meter";
|
|
33
|
+
export { meterVariants } from "@masaraxui/styles";
|
|
34
|
+
export type { MeterVariants } from "@masaraxui/styles";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { MeterRoot, MeterFill, MeterTrack, MeterOutput } from './meter.js';
|
|
3
|
+
export { meterVariants } from '@masaraxui/styles';
|
|
4
|
+
|
|
5
|
+
/* -------------------------------------------------------------------------------------------------
|
|
6
|
+
* Compound Component
|
|
7
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
8
|
+
const Meter = Object.assign(MeterRoot, {
|
|
9
|
+
Root: MeterRoot,
|
|
10
|
+
Output: MeterOutput,
|
|
11
|
+
Track: MeterTrack,
|
|
12
|
+
Fill: MeterFill
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export { Meter, MeterFill, MeterOutput, MeterRoot, MeterTrack };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { MeterVariants } from "@masaraxui/styles";
|
|
2
|
+
import type { ComponentPropsWithRef } from "react";
|
|
3
|
+
import { Meter as MeterPrimitive } from "react-aria-components";
|
|
4
|
+
interface MeterRootProps extends ComponentPropsWithRef<typeof MeterPrimitive>, MeterVariants {
|
|
5
|
+
}
|
|
6
|
+
declare const MeterRoot: {
|
|
7
|
+
({ children, className, color, size, ...props }: MeterRootProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
displayName: string;
|
|
9
|
+
};
|
|
10
|
+
interface MeterOutputProps extends ComponentPropsWithRef<"span"> {
|
|
11
|
+
}
|
|
12
|
+
declare const MeterOutput: {
|
|
13
|
+
({ children, className, ...props }: MeterOutputProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
displayName: string;
|
|
15
|
+
};
|
|
16
|
+
interface MeterTrackProps extends ComponentPropsWithRef<"div"> {
|
|
17
|
+
}
|
|
18
|
+
declare const MeterTrack: {
|
|
19
|
+
({ children, className, ...props }: MeterTrackProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
displayName: string;
|
|
21
|
+
};
|
|
22
|
+
interface MeterFillProps extends ComponentPropsWithRef<"div"> {
|
|
23
|
+
}
|
|
24
|
+
declare const MeterFill: {
|
|
25
|
+
({ className, style, ...props }: MeterFillProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
displayName: string;
|
|
27
|
+
};
|
|
28
|
+
export { MeterRoot, MeterOutput, MeterTrack, MeterFill };
|
|
29
|
+
export type { MeterRootProps, MeterOutputProps, MeterTrackProps, MeterFillProps };
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { meterVariants } from '@masaraxui/styles';
|
|
3
|
+
import React__default, { createContext, useContext } from 'react';
|
|
4
|
+
import { Meter } from 'react-aria-components';
|
|
5
|
+
import { composeTwRenderProps, composeSlotClassName } from '../../utils/compose.js';
|
|
6
|
+
import { jsx } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
const MeterContext = /*#__PURE__*/createContext({});
|
|
9
|
+
|
|
10
|
+
/* -------------------------------------------------------------------------------------------------
|
|
11
|
+
* Meter Root
|
|
12
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
13
|
+
|
|
14
|
+
const MeterRoot = ({
|
|
15
|
+
children,
|
|
16
|
+
className,
|
|
17
|
+
color,
|
|
18
|
+
size,
|
|
19
|
+
...props
|
|
20
|
+
}) => {
|
|
21
|
+
const slots = React__default.useMemo(() => meterVariants({
|
|
22
|
+
color,
|
|
23
|
+
size
|
|
24
|
+
}), [color, size]);
|
|
25
|
+
return /*#__PURE__*/jsx(Meter, {
|
|
26
|
+
"data-slot": "meter",
|
|
27
|
+
...props,
|
|
28
|
+
className: composeTwRenderProps(className, slots.base()),
|
|
29
|
+
children: values => /*#__PURE__*/jsx(MeterContext, {
|
|
30
|
+
value: {
|
|
31
|
+
slots,
|
|
32
|
+
state: values
|
|
33
|
+
},
|
|
34
|
+
children: typeof children === "function" ? children(values) : children
|
|
35
|
+
})
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
MeterRoot.displayName = "MasaraxUI.Meter";
|
|
39
|
+
|
|
40
|
+
/* -------------------------------------------------------------------------------------------------
|
|
41
|
+
* Meter Output
|
|
42
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
43
|
+
|
|
44
|
+
const MeterOutput = ({
|
|
45
|
+
children,
|
|
46
|
+
className,
|
|
47
|
+
...props
|
|
48
|
+
}) => {
|
|
49
|
+
const {
|
|
50
|
+
slots,
|
|
51
|
+
state
|
|
52
|
+
} = useContext(MeterContext);
|
|
53
|
+
return /*#__PURE__*/jsx("span", {
|
|
54
|
+
className: composeSlotClassName(slots?.output, className),
|
|
55
|
+
"data-slot": "meter-output",
|
|
56
|
+
...props,
|
|
57
|
+
children: children ?? state?.valueText
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
MeterOutput.displayName = "MasaraxUI.Meter.Output";
|
|
61
|
+
|
|
62
|
+
/* -------------------------------------------------------------------------------------------------
|
|
63
|
+
* Meter Track
|
|
64
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
65
|
+
|
|
66
|
+
const MeterTrack = ({
|
|
67
|
+
children,
|
|
68
|
+
className,
|
|
69
|
+
...props
|
|
70
|
+
}) => {
|
|
71
|
+
const {
|
|
72
|
+
slots
|
|
73
|
+
} = useContext(MeterContext);
|
|
74
|
+
return /*#__PURE__*/jsx("div", {
|
|
75
|
+
className: composeSlotClassName(slots?.track, className),
|
|
76
|
+
"data-slot": "meter-track",
|
|
77
|
+
...props,
|
|
78
|
+
children: children
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
MeterTrack.displayName = "MasaraxUI.Meter.Track";
|
|
82
|
+
|
|
83
|
+
/* -------------------------------------------------------------------------------------------------
|
|
84
|
+
* Meter Fill
|
|
85
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
86
|
+
|
|
87
|
+
const MeterFill = ({
|
|
88
|
+
className,
|
|
89
|
+
style,
|
|
90
|
+
...props
|
|
91
|
+
}) => {
|
|
92
|
+
const {
|
|
93
|
+
slots,
|
|
94
|
+
state
|
|
95
|
+
} = useContext(MeterContext);
|
|
96
|
+
return /*#__PURE__*/jsx("div", {
|
|
97
|
+
className: composeSlotClassName(slots?.fill, className),
|
|
98
|
+
"data-slot": "meter-fill",
|
|
99
|
+
style: {
|
|
100
|
+
...style,
|
|
101
|
+
width: `${state?.percentage ?? 0}%`
|
|
102
|
+
},
|
|
103
|
+
...props
|
|
104
|
+
});
|
|
105
|
+
};
|
|
106
|
+
MeterFill.displayName = "MasaraxUI.Meter.Fill";
|
|
107
|
+
|
|
108
|
+
export { MeterFill, MeterOutput, MeterRoot, MeterTrack };
|