@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,177 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { sliderVariants } from '@masaraxui/styles';
|
|
3
|
+
import React__default, { createContext, useContext } from 'react';
|
|
4
|
+
import { Slider, SliderThumb as SliderThumb$1, SliderTrack as SliderTrack$1, SliderOutput as SliderOutput$1 } from 'react-aria-components';
|
|
5
|
+
import { dataAttr } from '../../utils/assertion.js';
|
|
6
|
+
import { composeTwRenderProps, composeSlotClassName } from '../../utils/compose.js';
|
|
7
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
8
|
+
|
|
9
|
+
const SliderContext = /*#__PURE__*/createContext({});
|
|
10
|
+
|
|
11
|
+
/* -------------------------------------------------------------------------------------------------
|
|
12
|
+
* Slider Root
|
|
13
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
14
|
+
|
|
15
|
+
const SliderRoot = ({
|
|
16
|
+
children,
|
|
17
|
+
className,
|
|
18
|
+
orientation = "horizontal",
|
|
19
|
+
...props
|
|
20
|
+
}) => {
|
|
21
|
+
const slots = React__default.useMemo(() => sliderVariants({}), []);
|
|
22
|
+
return /*#__PURE__*/jsx(Slider, {
|
|
23
|
+
"data-slot": "slider",
|
|
24
|
+
orientation: orientation,
|
|
25
|
+
...props,
|
|
26
|
+
className: composeTwRenderProps(className, slots.base()),
|
|
27
|
+
children: values => /*#__PURE__*/jsx(SliderContext, {
|
|
28
|
+
value: {
|
|
29
|
+
slots,
|
|
30
|
+
state: values
|
|
31
|
+
},
|
|
32
|
+
children: typeof children === "function" ? children(values) : children
|
|
33
|
+
})
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/* -------------------------------------------------------------------------------------------------
|
|
38
|
+
* Slider Output
|
|
39
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
40
|
+
|
|
41
|
+
const SliderOutput = ({
|
|
42
|
+
children,
|
|
43
|
+
className,
|
|
44
|
+
...props
|
|
45
|
+
}) => {
|
|
46
|
+
const {
|
|
47
|
+
slots
|
|
48
|
+
} = useContext(SliderContext);
|
|
49
|
+
return /*#__PURE__*/jsx(SliderOutput$1, {
|
|
50
|
+
className: composeTwRenderProps(className, slots?.output()),
|
|
51
|
+
"data-slot": "slider-output",
|
|
52
|
+
...props,
|
|
53
|
+
children: children ? values => /*#__PURE__*/jsx(Fragment, {
|
|
54
|
+
children: typeof children === "function" ? children(values) : children
|
|
55
|
+
}) : ({
|
|
56
|
+
state
|
|
57
|
+
}) => state.values.map((_, i) => state.getThumbValueLabel(i)).join(" – ")
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
/* -------------------------------------------------------------------------------------------------
|
|
62
|
+
* Slider Track
|
|
63
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
64
|
+
|
|
65
|
+
const SliderTrack = ({
|
|
66
|
+
children,
|
|
67
|
+
className,
|
|
68
|
+
...props
|
|
69
|
+
}) => {
|
|
70
|
+
const {
|
|
71
|
+
slots,
|
|
72
|
+
state
|
|
73
|
+
} = useContext(SliderContext);
|
|
74
|
+
const {
|
|
75
|
+
getThumbPercent,
|
|
76
|
+
values
|
|
77
|
+
} = state?.state || {};
|
|
78
|
+
const singleThumb = values?.length && values.length === 1;
|
|
79
|
+
const [startOffset, endOffset] = [values?.length && values.length > 1 ? getThumbPercent?.(0) : 0, getThumbPercent?.(values?.length ? values.length - 1 : 0)].sort();
|
|
80
|
+
const fillWidth = (endOffset - startOffset) * 100;
|
|
81
|
+
return /*#__PURE__*/jsx(SliderTrack$1, {
|
|
82
|
+
className: composeTwRenderProps(className, slots?.track()),
|
|
83
|
+
"data-disabled": dataAttr(state?.isDisabled),
|
|
84
|
+
"data-slot": "slider-track",
|
|
85
|
+
...(singleThumb ? {
|
|
86
|
+
"data-fill-start": dataAttr(fillWidth > 0),
|
|
87
|
+
"data-fill-end": dataAttr(fillWidth == 100)
|
|
88
|
+
} : {
|
|
89
|
+
"data-fill-start": dataAttr(startOffset == 0),
|
|
90
|
+
"data-fill-end": dataAttr(startOffset * 100 + fillWidth == 100)
|
|
91
|
+
}),
|
|
92
|
+
...props,
|
|
93
|
+
children: values => /*#__PURE__*/jsx(Fragment, {
|
|
94
|
+
children: typeof children === "function" ? children(values) : children
|
|
95
|
+
})
|
|
96
|
+
});
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
/* -------------------------------------------------------------------------------------------------
|
|
100
|
+
* Slider Fill
|
|
101
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
102
|
+
|
|
103
|
+
const SliderFill = ({
|
|
104
|
+
className,
|
|
105
|
+
style,
|
|
106
|
+
...props
|
|
107
|
+
}) => {
|
|
108
|
+
const {
|
|
109
|
+
slots,
|
|
110
|
+
state
|
|
111
|
+
} = useContext(SliderContext);
|
|
112
|
+
const {
|
|
113
|
+
getThumbPercent,
|
|
114
|
+
orientation,
|
|
115
|
+
values
|
|
116
|
+
} = state?.state || {};
|
|
117
|
+
const [startOffset, endOffset] = [values?.length && values.length > 1 ? getThumbPercent?.(0) : 0, getThumbPercent?.(values?.length ? values.length - 1 : 0)].sort();
|
|
118
|
+
const isVertical = orientation === "vertical";
|
|
119
|
+
return /*#__PURE__*/jsx("div", {
|
|
120
|
+
className: composeSlotClassName(slots?.fill, className),
|
|
121
|
+
"data-disabled": dataAttr(state?.isDisabled),
|
|
122
|
+
"data-slot": "slider-fill",
|
|
123
|
+
style: {
|
|
124
|
+
...style,
|
|
125
|
+
// TODO: rtl support
|
|
126
|
+
[isVertical ? "bottom" : "left"]: `${startOffset * 100}%`,
|
|
127
|
+
...(isVertical ? {
|
|
128
|
+
height: `${(endOffset - startOffset) * 100}%`
|
|
129
|
+
} : {
|
|
130
|
+
width: `${(endOffset - startOffset) * 100}%`
|
|
131
|
+
})
|
|
132
|
+
},
|
|
133
|
+
...props
|
|
134
|
+
});
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
/* -------------------------------------------------------------------------------------------------
|
|
138
|
+
* Slider Thumb
|
|
139
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
140
|
+
|
|
141
|
+
const SliderThumb = ({
|
|
142
|
+
children,
|
|
143
|
+
className,
|
|
144
|
+
...props
|
|
145
|
+
}) => {
|
|
146
|
+
const {
|
|
147
|
+
slots
|
|
148
|
+
} = useContext(SliderContext);
|
|
149
|
+
return /*#__PURE__*/jsx(SliderThumb$1, {
|
|
150
|
+
className: composeTwRenderProps(className, slots?.thumb()),
|
|
151
|
+
"data-slot": "slider-thumb",
|
|
152
|
+
...props,
|
|
153
|
+
children: values => /*#__PURE__*/jsx(Fragment, {
|
|
154
|
+
children: typeof children === "function" ? children(values) : children
|
|
155
|
+
})
|
|
156
|
+
});
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
/* -------------------------------------------------------------------------------------------------
|
|
160
|
+
* TODO: Slider Marks
|
|
161
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
162
|
+
|
|
163
|
+
const SliderMarks = ({
|
|
164
|
+
className,
|
|
165
|
+
...props
|
|
166
|
+
}) => {
|
|
167
|
+
const {
|
|
168
|
+
slots
|
|
169
|
+
} = useContext(SliderContext);
|
|
170
|
+
return /*#__PURE__*/jsx("div", {
|
|
171
|
+
className: composeSlotClassName(slots?.marks, className),
|
|
172
|
+
"data-slot": "slider-marks",
|
|
173
|
+
...props
|
|
174
|
+
});
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
export { SliderFill, SliderMarks, SliderOutput, SliderRoot, SliderThumb, SliderTrack };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { SpinnerRoot } from "./spinner";
|
|
3
|
+
export declare const Spinner: (({ className, color, size, ...props }: import("./spinner").SpinnerRootProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
4
|
+
Root: ({ className, color, size, ...props }: import("./spinner").SpinnerRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
};
|
|
6
|
+
export type Spinner = {
|
|
7
|
+
Props: ComponentProps<typeof SpinnerRoot>;
|
|
8
|
+
RootProps: ComponentProps<typeof SpinnerRoot>;
|
|
9
|
+
};
|
|
10
|
+
export { SpinnerRoot };
|
|
11
|
+
export type { SpinnerRootProps, SpinnerRootProps as SpinnerProps } from "./spinner";
|
|
12
|
+
export { spinnerVariants } from "@masaraxui/styles";
|
|
13
|
+
export type { SpinnerVariants } from "@masaraxui/styles";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { SpinnerRoot } from './spinner.js';
|
|
3
|
+
export { spinnerVariants } from '@masaraxui/styles';
|
|
4
|
+
|
|
5
|
+
/* -------------------------------------------------------------------------------------------------
|
|
6
|
+
* Compound Component
|
|
7
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
8
|
+
const Spinner = Object.assign(SpinnerRoot, {
|
|
9
|
+
Root: SpinnerRoot
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export { Spinner, SpinnerRoot };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SpinnerVariants } from "@masaraxui/styles";
|
|
2
|
+
import type { ComponentPropsWithRef } from "react";
|
|
3
|
+
interface SpinnerRootProps extends Omit<ComponentPropsWithRef<"svg">, "display" | "opacity" | "color">, SpinnerVariants {
|
|
4
|
+
}
|
|
5
|
+
declare const SpinnerRoot: ({ className, color, size, ...props }: SpinnerRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export { SpinnerRoot };
|
|
7
|
+
export type { SpinnerRootProps };
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { spinnerVariants } from '@masaraxui/styles';
|
|
3
|
+
import { useId } from 'react';
|
|
4
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
const SpinnerPrimitive = ({
|
|
7
|
+
...props
|
|
8
|
+
}) => {
|
|
9
|
+
const id = useId();
|
|
10
|
+
return /*#__PURE__*/jsxs("svg", {
|
|
11
|
+
"data-slot": "spinner-icon",
|
|
12
|
+
viewBox: "0 0 24 24",
|
|
13
|
+
...props,
|
|
14
|
+
children: [/*#__PURE__*/jsxs("defs", {
|
|
15
|
+
children: [/*#__PURE__*/jsxs("linearGradient", {
|
|
16
|
+
id: `«data-slot-icon-def-1»-${id}`,
|
|
17
|
+
x1: "50%",
|
|
18
|
+
x2: "50%",
|
|
19
|
+
y1: "5.271%",
|
|
20
|
+
y2: "91.793%",
|
|
21
|
+
children: [/*#__PURE__*/jsx("stop", {
|
|
22
|
+
offset: "0%",
|
|
23
|
+
stopColor: "currentColor"
|
|
24
|
+
}), /*#__PURE__*/jsx("stop", {
|
|
25
|
+
offset: "100%",
|
|
26
|
+
stopColor: "currentColor",
|
|
27
|
+
stopOpacity: 0.55
|
|
28
|
+
})]
|
|
29
|
+
}), /*#__PURE__*/jsxs("linearGradient", {
|
|
30
|
+
id: `«data-slot-icon-def-2»-${id}`,
|
|
31
|
+
x1: "50%",
|
|
32
|
+
x2: "50%",
|
|
33
|
+
y1: "15.24%",
|
|
34
|
+
y2: "87.15%",
|
|
35
|
+
children: [/*#__PURE__*/jsx("stop", {
|
|
36
|
+
offset: "0%",
|
|
37
|
+
stopColor: "currentColor",
|
|
38
|
+
stopOpacity: 0
|
|
39
|
+
}), /*#__PURE__*/jsx("stop", {
|
|
40
|
+
offset: "100%",
|
|
41
|
+
stopColor: "currentColor",
|
|
42
|
+
stopOpacity: 0.55
|
|
43
|
+
})]
|
|
44
|
+
})]
|
|
45
|
+
}), /*#__PURE__*/jsxs("g", {
|
|
46
|
+
fill: "none",
|
|
47
|
+
children: [/*#__PURE__*/jsx("path", {
|
|
48
|
+
d: "m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"
|
|
49
|
+
}), /*#__PURE__*/jsx("path", {
|
|
50
|
+
d: "M8.749.021a1.5 1.5 0 0 1 .497 2.958A7.5 7.5 0 0 0 3 10.375a7.5 7.5 0 0 0 7.5 7.5v3c-5.799 0-10.5-4.7-10.5-10.5C0 5.23 3.726.865 8.749.021",
|
|
51
|
+
fill: `url(#«data-slot-icon-def-1»-${id})`,
|
|
52
|
+
transform: "translate(1.5 1.625)"
|
|
53
|
+
}), /*#__PURE__*/jsx("path", {
|
|
54
|
+
d: "M15.392 2.673a1.5 1.5 0 0 1 2.119-.115A10.48 10.48 0 0 1 21 10.375c0 5.8-4.701 10.5-10.5 10.5v-3a7.5 7.5 0 0 0 5.007-13.084a1.5 1.5 0 0 1-.115-2.118",
|
|
55
|
+
fill: `url(#«data-slot-icon-def-2»-${id})`,
|
|
56
|
+
transform: "translate(1.5 1.625)"
|
|
57
|
+
})]
|
|
58
|
+
})]
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
/* -------------------------------------------------------------------------------------------------
|
|
63
|
+
* Spinner Root
|
|
64
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
65
|
+
|
|
66
|
+
const SpinnerRoot = ({
|
|
67
|
+
className,
|
|
68
|
+
color,
|
|
69
|
+
size,
|
|
70
|
+
...props
|
|
71
|
+
}) => {
|
|
72
|
+
return /*#__PURE__*/jsx("span", {
|
|
73
|
+
"data-slot": "spinner",
|
|
74
|
+
className: spinnerVariants({
|
|
75
|
+
className,
|
|
76
|
+
color,
|
|
77
|
+
size
|
|
78
|
+
}),
|
|
79
|
+
children: /*#__PURE__*/jsx(SpinnerPrimitive, {
|
|
80
|
+
"aria-hidden": true,
|
|
81
|
+
"aria-label": "Loading",
|
|
82
|
+
role: "presentation",
|
|
83
|
+
...props
|
|
84
|
+
})
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export { SpinnerRoot };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { SurfaceRoot } from "./surface";
|
|
3
|
+
export declare const Surface: (({ children, className, variant, ...rest }: import("./surface").SurfaceRootProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
4
|
+
Root: ({ children, className, variant, ...rest }: import("./surface").SurfaceRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
};
|
|
6
|
+
export type Surface = {
|
|
7
|
+
Props: ComponentProps<typeof SurfaceRoot>;
|
|
8
|
+
RootProps: ComponentProps<typeof SurfaceRoot>;
|
|
9
|
+
};
|
|
10
|
+
export { SurfaceRoot } from "./surface";
|
|
11
|
+
export type { SurfaceRootProps, SurfaceRootProps as SurfaceProps } from "./surface";
|
|
12
|
+
export { SurfaceContext } from "./surface";
|
|
13
|
+
export { surfaceVariants } from "@masaraxui/styles";
|
|
14
|
+
export type { SurfaceVariants } from "@masaraxui/styles";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { SurfaceRoot } from './surface.js';
|
|
3
|
+
export { SurfaceContext } from './surface.js';
|
|
4
|
+
export { surfaceVariants } from '@masaraxui/styles';
|
|
5
|
+
|
|
6
|
+
/* -------------------------------------------------------------------------------------------------
|
|
7
|
+
* Compound Component
|
|
8
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
9
|
+
const Surface = Object.assign(SurfaceRoot, {
|
|
10
|
+
Root: SurfaceRoot
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export { Surface, SurfaceRoot };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SurfaceVariants } from "@masaraxui/styles";
|
|
2
|
+
import type { ComponentPropsWithRef } from "react";
|
|
3
|
+
import React from "react";
|
|
4
|
+
type SurfaceContext = {
|
|
5
|
+
variant?: SurfaceVariants["variant"];
|
|
6
|
+
};
|
|
7
|
+
declare const SurfaceContext: React.Context<SurfaceContext>;
|
|
8
|
+
interface SurfaceRootProps extends ComponentPropsWithRef<"div">, SurfaceVariants {
|
|
9
|
+
}
|
|
10
|
+
declare const SurfaceRoot: ({ children, className, variant, ...rest }: SurfaceRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export { SurfaceRoot, SurfaceContext };
|
|
12
|
+
export type { SurfaceRootProps };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { surfaceVariants } from '@masaraxui/styles';
|
|
3
|
+
import { createContext } from 'react';
|
|
4
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
const SurfaceContext = /*#__PURE__*/createContext({});
|
|
7
|
+
|
|
8
|
+
/* ------------------------------------------------------------------------------------------------
|
|
9
|
+
* Surface Root
|
|
10
|
+
* --------------------------------------------------------------------------------------------- */
|
|
11
|
+
|
|
12
|
+
const SurfaceRoot = ({
|
|
13
|
+
children,
|
|
14
|
+
className,
|
|
15
|
+
variant = "default",
|
|
16
|
+
...rest
|
|
17
|
+
}) => {
|
|
18
|
+
return /*#__PURE__*/jsx(SurfaceContext, {
|
|
19
|
+
value: {
|
|
20
|
+
variant
|
|
21
|
+
},
|
|
22
|
+
children: /*#__PURE__*/jsx("div", {
|
|
23
|
+
className: surfaceVariants({
|
|
24
|
+
variant,
|
|
25
|
+
className
|
|
26
|
+
}),
|
|
27
|
+
"data-slot": "surface",
|
|
28
|
+
...rest,
|
|
29
|
+
children: children
|
|
30
|
+
})
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export { SurfaceContext, SurfaceRoot };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { SwitchContent, SwitchControl, SwitchIcon, SwitchRoot, SwitchThumb } from "./switch";
|
|
3
|
+
export declare const Switch: (({ children, className, size, ...props }: import("./switch").SwitchRootProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
4
|
+
Root: ({ children, className, size, ...props }: import("./switch").SwitchRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
Content: ({ children, className, ...props }: import("./switch").SwitchContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
Control: ({ children, className, ...props }: import("./switch").SwitchControlProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
Thumb: ({ children, className, ...props }: import("./switch").SwitchThumbProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
Icon: ({ children, className, ...props }: import("./switch").SwitchIconProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
};
|
|
10
|
+
export type Switch = {
|
|
11
|
+
Props: ComponentProps<typeof SwitchRoot>;
|
|
12
|
+
RootProps: ComponentProps<typeof SwitchRoot>;
|
|
13
|
+
ContentProps: ComponentProps<typeof SwitchContent>;
|
|
14
|
+
ControlProps: ComponentProps<typeof SwitchControl>;
|
|
15
|
+
ThumbProps: ComponentProps<typeof SwitchThumb>;
|
|
16
|
+
IconProps: ComponentProps<typeof SwitchIcon>;
|
|
17
|
+
};
|
|
18
|
+
export { SwitchRoot, SwitchContent, SwitchControl, SwitchIcon, SwitchThumb };
|
|
19
|
+
export type { SwitchRootProps, SwitchRootProps as SwitchProps, SwitchContentProps, SwitchControlProps, SwitchThumbProps, SwitchIconProps, } from "./switch";
|
|
20
|
+
export { switchVariants } from "@masaraxui/styles";
|
|
21
|
+
export type { SwitchVariants } from "@masaraxui/styles";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { SwitchRoot, SwitchIcon, SwitchThumb, SwitchControl, SwitchContent } from './switch.js';
|
|
3
|
+
export { switchVariants } from '@masaraxui/styles';
|
|
4
|
+
|
|
5
|
+
/* -------------------------------------------------------------------------------------------------
|
|
6
|
+
* Compound Component
|
|
7
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
8
|
+
const Switch = Object.assign(SwitchRoot, {
|
|
9
|
+
Root: SwitchRoot,
|
|
10
|
+
Content: SwitchContent,
|
|
11
|
+
Control: SwitchControl,
|
|
12
|
+
Thumb: SwitchThumb,
|
|
13
|
+
Icon: SwitchIcon
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export { Switch, SwitchContent, SwitchControl, SwitchIcon, SwitchRoot, SwitchThumb };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { SwitchVariants } from "@masaraxui/styles";
|
|
2
|
+
import type { ComponentPropsWithRef } from "react";
|
|
3
|
+
import { Switch as SwitchPrimitive } from "react-aria-components";
|
|
4
|
+
interface SwitchRootProps extends ComponentPropsWithRef<typeof SwitchPrimitive>, SwitchVariants {
|
|
5
|
+
}
|
|
6
|
+
declare const SwitchRoot: ({ children, className, size, ...props }: SwitchRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
interface SwitchControlProps extends ComponentPropsWithRef<"span"> {
|
|
8
|
+
}
|
|
9
|
+
declare const SwitchControl: ({ children, className, ...props }: SwitchControlProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
interface SwitchThumbProps extends ComponentPropsWithRef<"span"> {
|
|
11
|
+
}
|
|
12
|
+
declare const SwitchThumb: ({ children, className, ...props }: SwitchThumbProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
interface SwitchIconProps extends ComponentPropsWithRef<"span"> {
|
|
14
|
+
}
|
|
15
|
+
declare const SwitchIcon: ({ children, className, ...props }: SwitchIconProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
interface SwitchContentProps extends ComponentPropsWithRef<"div"> {
|
|
17
|
+
}
|
|
18
|
+
declare const SwitchContent: ({ children, className, ...props }: SwitchContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export { SwitchRoot, SwitchControl, SwitchThumb, SwitchIcon, SwitchContent };
|
|
20
|
+
export type { SwitchRootProps, SwitchControlProps, SwitchThumbProps, SwitchIconProps, SwitchContentProps, };
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { switchVariants } from '@masaraxui/styles';
|
|
3
|
+
import React__default, { createContext, useContext } from 'react';
|
|
4
|
+
import { Switch } from 'react-aria-components';
|
|
5
|
+
import { composeTwRenderProps, composeSlotClassName } from '../../utils/compose.js';
|
|
6
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
const SwitchContext = /*#__PURE__*/createContext({});
|
|
9
|
+
|
|
10
|
+
/* -------------------------------------------------------------------------------------------------
|
|
11
|
+
* Switch Root
|
|
12
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
13
|
+
|
|
14
|
+
const SwitchRoot = ({
|
|
15
|
+
children,
|
|
16
|
+
className,
|
|
17
|
+
size,
|
|
18
|
+
...props
|
|
19
|
+
}) => {
|
|
20
|
+
const slots = React__default.useMemo(() => switchVariants({
|
|
21
|
+
size
|
|
22
|
+
}), [size]);
|
|
23
|
+
return /*#__PURE__*/jsx(SwitchContext, {
|
|
24
|
+
value: {
|
|
25
|
+
slots
|
|
26
|
+
},
|
|
27
|
+
children: /*#__PURE__*/jsx(Switch, {
|
|
28
|
+
"data-slot": "switch",
|
|
29
|
+
...props,
|
|
30
|
+
className: composeTwRenderProps(className, slots.base()),
|
|
31
|
+
children: values => /*#__PURE__*/jsx(Fragment, {
|
|
32
|
+
children: typeof children === "function" ? children(values) : children
|
|
33
|
+
})
|
|
34
|
+
})
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/* -------------------------------------------------------------------------------------------------
|
|
39
|
+
* Switch Control
|
|
40
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
41
|
+
|
|
42
|
+
const SwitchControl = ({
|
|
43
|
+
children,
|
|
44
|
+
className,
|
|
45
|
+
...props
|
|
46
|
+
}) => {
|
|
47
|
+
const {
|
|
48
|
+
slots
|
|
49
|
+
} = useContext(SwitchContext);
|
|
50
|
+
return /*#__PURE__*/jsx("span", {
|
|
51
|
+
className: composeSlotClassName(slots?.control, className),
|
|
52
|
+
"data-slot": "switch-control",
|
|
53
|
+
...props,
|
|
54
|
+
children: children
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
/* -------------------------------------------------------------------------------------------------
|
|
59
|
+
* Switch Thumb
|
|
60
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
61
|
+
|
|
62
|
+
const SwitchThumb = ({
|
|
63
|
+
children,
|
|
64
|
+
className,
|
|
65
|
+
...props
|
|
66
|
+
}) => {
|
|
67
|
+
const {
|
|
68
|
+
slots
|
|
69
|
+
} = useContext(SwitchContext);
|
|
70
|
+
return /*#__PURE__*/jsx("span", {
|
|
71
|
+
className: composeSlotClassName(slots?.thumb, className),
|
|
72
|
+
"data-slot": "switch-thumb",
|
|
73
|
+
...props,
|
|
74
|
+
children: children
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
/* -------------------------------------------------------------------------------------------------
|
|
79
|
+
* Switch Icon
|
|
80
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
81
|
+
|
|
82
|
+
const SwitchIcon = ({
|
|
83
|
+
children,
|
|
84
|
+
className,
|
|
85
|
+
...props
|
|
86
|
+
}) => {
|
|
87
|
+
const {
|
|
88
|
+
slots
|
|
89
|
+
} = useContext(SwitchContext);
|
|
90
|
+
return /*#__PURE__*/jsx("span", {
|
|
91
|
+
className: composeSlotClassName(slots?.icon, className),
|
|
92
|
+
"data-slot": "switch-icon",
|
|
93
|
+
...props,
|
|
94
|
+
children: children
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
/* -------------------------------------------------------------------------------------------------
|
|
99
|
+
* Switch Content
|
|
100
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
101
|
+
|
|
102
|
+
const SwitchContent = ({
|
|
103
|
+
children,
|
|
104
|
+
className,
|
|
105
|
+
...props
|
|
106
|
+
}) => {
|
|
107
|
+
const {
|
|
108
|
+
slots
|
|
109
|
+
} = useContext(SwitchContext);
|
|
110
|
+
return /*#__PURE__*/jsx("div", {
|
|
111
|
+
className: composeSlotClassName(slots?.content, className),
|
|
112
|
+
"data-slot": "switch-content",
|
|
113
|
+
...props,
|
|
114
|
+
children: children
|
|
115
|
+
});
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
export { SwitchContent, SwitchControl, SwitchIcon, SwitchRoot, SwitchThumb };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { SwitchGroupRoot } from "./switch-group";
|
|
3
|
+
export declare const SwitchGroup: (({ children, className, orientation, ...props }: import("./switch-group").SwitchGroupRootProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
4
|
+
Root: ({ children, className, orientation, ...props }: import("./switch-group").SwitchGroupRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
};
|
|
6
|
+
export type SwitchGroup = {
|
|
7
|
+
Props: ComponentProps<typeof SwitchGroupRoot>;
|
|
8
|
+
RootProps: ComponentProps<typeof SwitchGroupRoot>;
|
|
9
|
+
};
|
|
10
|
+
export { SwitchGroupRoot };
|
|
11
|
+
export type { SwitchGroupRootProps, SwitchGroupRootProps as SwitchGroupProps } from "./switch-group";
|
|
12
|
+
export { switchGroupVariants } from "@masaraxui/styles";
|
|
13
|
+
export type { SwitchGroupVariants } from "@masaraxui/styles";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { SwitchGroupRoot } from './switch-group.js';
|
|
3
|
+
export { switchGroupVariants } from '@masaraxui/styles';
|
|
4
|
+
|
|
5
|
+
/* -------------------------------------------------------------------------------------------------
|
|
6
|
+
* Compound Component
|
|
7
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
8
|
+
const SwitchGroup = Object.assign(SwitchGroupRoot, {
|
|
9
|
+
Root: SwitchGroupRoot
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export { SwitchGroup, SwitchGroupRoot };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SwitchGroupVariants } from "@masaraxui/styles";
|
|
2
|
+
import type { ComponentPropsWithRef } from "react";
|
|
3
|
+
interface SwitchGroupRootProps extends ComponentPropsWithRef<"div">, SwitchGroupVariants {
|
|
4
|
+
}
|
|
5
|
+
declare const SwitchGroupRoot: ({ children, className, orientation, ...props }: SwitchGroupRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export { SwitchGroupRoot };
|
|
7
|
+
export type { SwitchGroupRootProps };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { switchGroupVariants } from '@masaraxui/styles';
|
|
3
|
+
import React__default from 'react';
|
|
4
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
const SwitchGroupRoot = ({
|
|
7
|
+
children,
|
|
8
|
+
className,
|
|
9
|
+
orientation,
|
|
10
|
+
...props
|
|
11
|
+
}) => {
|
|
12
|
+
const slots = React__default.useMemo(() => switchGroupVariants({
|
|
13
|
+
orientation
|
|
14
|
+
}), [orientation]);
|
|
15
|
+
return /*#__PURE__*/jsx("div", {
|
|
16
|
+
"data-slot": "switch-group",
|
|
17
|
+
...props,
|
|
18
|
+
className: slots.base({
|
|
19
|
+
className
|
|
20
|
+
}),
|
|
21
|
+
children: children
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export { SwitchGroupRoot };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { TableBody, TableCell, TableCollection, TableColumn, TableColumnResizer, TableContent, TableFooter, TableHeader, TableLoadMoreContent, TableLoadMoreItem, TableResizableContainer, TableRoot, TableRow, TableScrollContainer } from "./table";
|
|
3
|
+
export declare const Table: import("react").ForwardRefExoticComponent<Omit<import("./table").TableRootProps, "ref"> & import("react").RefAttributes<HTMLDivElement>> & {
|
|
4
|
+
Body: typeof TableBody;
|
|
5
|
+
Cell: import("react").ForwardRefExoticComponent<Omit<import("./table").TableCellProps, "ref"> & import("react").RefAttributes<HTMLTableCellElement>>;
|
|
6
|
+
Collection: typeof import("react-aria-components").Collection;
|
|
7
|
+
Column: import("react").ForwardRefExoticComponent<Omit<import("./table").TableColumnProps, "ref"> & import("react").RefAttributes<HTMLTableCellElement>>;
|
|
8
|
+
ColumnResizer: import("react").ForwardRefExoticComponent<Omit<import("./table").TableColumnResizerProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
9
|
+
Content: typeof TableContent;
|
|
10
|
+
Footer: import("react").ForwardRefExoticComponent<Omit<import("./table").TableFooterProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
11
|
+
Header: typeof TableHeader;
|
|
12
|
+
LoadMore: import("react").ForwardRefExoticComponent<Omit<import("./table").TableLoadMoreItemProps, "ref"> & import("react").RefAttributes<HTMLTableRowElement>>;
|
|
13
|
+
LoadMoreContent: import("react").ForwardRefExoticComponent<Omit<import("./table").TableLoadMoreContentProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
14
|
+
ResizableContainer: import("react").ForwardRefExoticComponent<Omit<import("./table").TableResizableContainerProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
15
|
+
Root: import("react").ForwardRefExoticComponent<Omit<import("./table").TableRootProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
16
|
+
Row: typeof TableRow;
|
|
17
|
+
ScrollContainer: import("react").ForwardRefExoticComponent<Omit<import("./table").TableScrollContainerProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
18
|
+
};
|
|
19
|
+
export type Table = {
|
|
20
|
+
Props: ComponentProps<typeof TableRoot>;
|
|
21
|
+
RootProps: ComponentProps<typeof TableRoot>;
|
|
22
|
+
ScrollContainerProps: ComponentProps<typeof TableScrollContainer>;
|
|
23
|
+
ContentProps: ComponentProps<typeof TableContent>;
|
|
24
|
+
HeaderProps: ComponentProps<typeof TableHeader>;
|
|
25
|
+
ColumnProps: ComponentProps<typeof TableColumn>;
|
|
26
|
+
ColumnResizerProps: ComponentProps<typeof TableColumnResizer>;
|
|
27
|
+
BodyProps: ComponentProps<typeof TableBody>;
|
|
28
|
+
RowProps: ComponentProps<typeof TableRow>;
|
|
29
|
+
CellProps: ComponentProps<typeof TableCell>;
|
|
30
|
+
FooterProps: ComponentProps<typeof TableFooter>;
|
|
31
|
+
LoadMoreProps: ComponentProps<typeof TableLoadMoreItem>;
|
|
32
|
+
LoadMoreContentProps: ComponentProps<typeof TableLoadMoreContent>;
|
|
33
|
+
ResizableContainerProps: ComponentProps<typeof TableResizableContainer>;
|
|
34
|
+
};
|
|
35
|
+
export { TableRoot, TableScrollContainer, TableContent, TableHeader, TableColumn, TableColumnResizer, TableBody, TableRow, TableCell, TableFooter, TableCollection, TableLoadMoreItem, TableLoadMoreContent, TableResizableContainer, };
|
|
36
|
+
export type { TableRootProps, TableRootProps as TableProps, TableScrollContainerProps, TableContentProps, TableHeaderProps, TableColumnProps, TableColumnResizerProps, TableBodyProps, TableRowProps, TableCellProps, TableFooterProps, TableLoadMoreItemProps, TableLoadMoreContentProps, TableResizableContainerProps, } from "./table";
|
|
37
|
+
export { tableVariants } from "@masaraxui/styles";
|
|
38
|
+
export type { TableVariants } from "@masaraxui/styles";
|