@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,70 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { colorAreaVariants } from '@masaraxui/styles';
|
|
3
|
+
import React__default, { createContext, useContext } from 'react';
|
|
4
|
+
import { ColorArea, ColorThumb } from 'react-aria-components';
|
|
5
|
+
import { composeTwRenderProps } from '../../utils/compose.js';
|
|
6
|
+
import { jsx } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
const ColorAreaContext = /*#__PURE__*/createContext({});
|
|
9
|
+
|
|
10
|
+
/* -------------------------------------------------------------------------------------------------
|
|
11
|
+
* ColorArea Root
|
|
12
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
13
|
+
|
|
14
|
+
const ColorAreaRoot = ({
|
|
15
|
+
children,
|
|
16
|
+
className,
|
|
17
|
+
showDots,
|
|
18
|
+
style,
|
|
19
|
+
...props
|
|
20
|
+
}) => {
|
|
21
|
+
const slots = React__default.useMemo(() => colorAreaVariants({
|
|
22
|
+
showDots
|
|
23
|
+
}), [showDots]);
|
|
24
|
+
return /*#__PURE__*/jsx(ColorAreaContext, {
|
|
25
|
+
value: {
|
|
26
|
+
slots
|
|
27
|
+
},
|
|
28
|
+
children: /*#__PURE__*/jsx(ColorArea, {
|
|
29
|
+
...props,
|
|
30
|
+
className: composeTwRenderProps(className, slots.base()),
|
|
31
|
+
"data-slot": "color-area",
|
|
32
|
+
style: renderProps => {
|
|
33
|
+
const userStyle = typeof style === "function" ? style(renderProps) : style;
|
|
34
|
+
return {
|
|
35
|
+
"--color-area-background": renderProps.defaultStyle.background,
|
|
36
|
+
...userStyle
|
|
37
|
+
};
|
|
38
|
+
},
|
|
39
|
+
children: children
|
|
40
|
+
})
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/* -------------------------------------------------------------------------------------------------
|
|
45
|
+
* ColorArea Thumb
|
|
46
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
47
|
+
|
|
48
|
+
const ColorAreaThumb = ({
|
|
49
|
+
className,
|
|
50
|
+
style,
|
|
51
|
+
...props
|
|
52
|
+
}) => {
|
|
53
|
+
const {
|
|
54
|
+
slots
|
|
55
|
+
} = useContext(ColorAreaContext);
|
|
56
|
+
return /*#__PURE__*/jsx(ColorThumb, {
|
|
57
|
+
className: composeTwRenderProps(className, slots?.thumb()),
|
|
58
|
+
"data-slot": "color-area-thumb",
|
|
59
|
+
style: renderProps => {
|
|
60
|
+
const userStyle = typeof style === "function" ? style(renderProps) : style;
|
|
61
|
+
return {
|
|
62
|
+
"--color-area-thumb-color": renderProps.defaultStyle.backgroundColor,
|
|
63
|
+
...userStyle
|
|
64
|
+
};
|
|
65
|
+
},
|
|
66
|
+
...props
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export { ColorAreaRoot, ColorAreaThumb };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { ColorAreaRoot, ColorAreaThumb } from "./color-area";
|
|
3
|
+
export declare const ColorArea: (({ children, className, showDots, style, ...props }: import("./color-area").ColorAreaRootProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
4
|
+
Root: ({ children, className, showDots, style, ...props }: import("./color-area").ColorAreaRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
Thumb: ({ className, style, ...props }: import("./color-area").ColorAreaThumbProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
};
|
|
7
|
+
export type ColorArea = {
|
|
8
|
+
Props: ComponentProps<typeof ColorAreaRoot>;
|
|
9
|
+
RootProps: ComponentProps<typeof ColorAreaRoot>;
|
|
10
|
+
ThumbProps: ComponentProps<typeof ColorAreaThumb>;
|
|
11
|
+
};
|
|
12
|
+
export { ColorAreaRoot, ColorAreaThumb };
|
|
13
|
+
export type { ColorAreaRootProps, ColorAreaRootProps as ColorAreaProps, ColorAreaThumbProps, } from "./color-area";
|
|
14
|
+
export { colorAreaVariants } from "@masaraxui/styles";
|
|
15
|
+
export type { ColorAreaVariants } from "@masaraxui/styles";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { ColorAreaRoot, ColorAreaThumb } from './color-area.js';
|
|
3
|
+
export { colorAreaVariants } from '@masaraxui/styles';
|
|
4
|
+
|
|
5
|
+
/* -------------------------------------------------------------------------------------------------
|
|
6
|
+
* Compound Component
|
|
7
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
8
|
+
const ColorArea = Object.assign(ColorAreaRoot, {
|
|
9
|
+
Root: ColorAreaRoot,
|
|
10
|
+
Thumb: ColorAreaThumb
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export { ColorArea, ColorAreaRoot, ColorAreaThumb };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ColorFieldVariants } from "@masaraxui/styles";
|
|
2
|
+
import type { ComponentPropsWithRef } from "react";
|
|
3
|
+
import type { Color } from "react-aria-components";
|
|
4
|
+
import { ColorField as ColorFieldPrimitive } from "react-aria-components";
|
|
5
|
+
interface ColorFieldRootProps extends ComponentPropsWithRef<typeof ColorFieldPrimitive>, ColorFieldVariants {
|
|
6
|
+
}
|
|
7
|
+
declare function ColorFieldRoot({ children, className, fullWidth, ...props }: ColorFieldRootProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export { ColorFieldRoot };
|
|
9
|
+
export type { ColorFieldRootProps, Color as ColorValue };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { colorFieldVariants } from '@masaraxui/styles';
|
|
3
|
+
import React__default from 'react';
|
|
4
|
+
import { ColorField } from 'react-aria-components';
|
|
5
|
+
import { dataAttr } from '../../utils/assertion.js';
|
|
6
|
+
import { composeTwRenderProps } from '../../utils/compose.js';
|
|
7
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
8
|
+
|
|
9
|
+
function ColorFieldRoot({
|
|
10
|
+
children,
|
|
11
|
+
className,
|
|
12
|
+
fullWidth,
|
|
13
|
+
...props
|
|
14
|
+
}) {
|
|
15
|
+
const styles = React__default.useMemo(() => colorFieldVariants({
|
|
16
|
+
fullWidth
|
|
17
|
+
}), [fullWidth]);
|
|
18
|
+
return /*#__PURE__*/jsx(ColorField, {
|
|
19
|
+
"data-required": dataAttr(props.isRequired),
|
|
20
|
+
"data-slot": "color-field",
|
|
21
|
+
...props,
|
|
22
|
+
className: composeTwRenderProps(className, styles),
|
|
23
|
+
children: values => /*#__PURE__*/jsx(Fragment, {
|
|
24
|
+
children: typeof children === "function" ? children(values) : children
|
|
25
|
+
})
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export { ColorFieldRoot };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { ColorInputGroupInput, ColorInputGroupPrefix, ColorInputGroupRoot, ColorInputGroupSuffix } from "../color-input-group";
|
|
3
|
+
import { ColorFieldRoot } from "./color-field";
|
|
4
|
+
export declare const ColorField: typeof ColorFieldRoot & {
|
|
5
|
+
Root: typeof ColorFieldRoot;
|
|
6
|
+
Group: ({ children, className, fullWidth, variant, ...props }: import("../color-input-group").ColorInputGroupRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
Input: ({ className, ...props }: import("../color-input-group").ColorInputGroupInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
Prefix: ({ children, className, ...props }: import("../color-input-group").ColorInputGroupPrefixProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
Suffix: ({ children, className, ...props }: import("../color-input-group").ColorInputGroupSuffixProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
};
|
|
11
|
+
export type ColorField = {
|
|
12
|
+
Props: ComponentProps<typeof ColorFieldRoot>;
|
|
13
|
+
RootProps: ComponentProps<typeof ColorFieldRoot>;
|
|
14
|
+
GroupProps: ComponentProps<typeof ColorInputGroupRoot>;
|
|
15
|
+
InputProps: ComponentProps<typeof ColorInputGroupInput>;
|
|
16
|
+
PrefixProps: ComponentProps<typeof ColorInputGroupPrefix>;
|
|
17
|
+
SuffixProps: ComponentProps<typeof ColorInputGroupSuffix>;
|
|
18
|
+
};
|
|
19
|
+
export { ColorFieldRoot };
|
|
20
|
+
export type { ColorFieldRootProps, ColorFieldRootProps as ColorFieldProps, ColorValue, } from "./color-field";
|
|
21
|
+
export { colorFieldVariants } from "@masaraxui/styles";
|
|
22
|
+
export type { ColorFieldVariants } from "@masaraxui/styles";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import '../color-input-group/index.js';
|
|
3
|
+
import { ColorFieldRoot } from './color-field.js';
|
|
4
|
+
export { colorFieldVariants } from '@masaraxui/styles';
|
|
5
|
+
import { ColorInputGroupSuffix, ColorInputGroupPrefix, ColorInputGroupInput, ColorInputGroupRoot } from '../color-input-group/color-input-group.js';
|
|
6
|
+
|
|
7
|
+
/* -------------------------------------------------------------------------------------------------
|
|
8
|
+
* Compound Component
|
|
9
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
10
|
+
const ColorField = Object.assign(ColorFieldRoot, {
|
|
11
|
+
Root: ColorFieldRoot,
|
|
12
|
+
Group: ColorInputGroupRoot,
|
|
13
|
+
Input: ColorInputGroupInput,
|
|
14
|
+
Prefix: ColorInputGroupPrefix,
|
|
15
|
+
Suffix: ColorInputGroupSuffix
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export { ColorField, ColorFieldRoot };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ColorInputGroupVariants } from "@masaraxui/styles";
|
|
2
|
+
import type { ComponentPropsWithRef } from "react";
|
|
3
|
+
import type { InputProps as InputPrimitiveProps } from "react-aria-components";
|
|
4
|
+
import { Group as GroupPrimitive } from "react-aria-components";
|
|
5
|
+
interface ColorInputGroupRootProps extends ComponentPropsWithRef<typeof GroupPrimitive>, ColorInputGroupVariants {
|
|
6
|
+
}
|
|
7
|
+
declare const ColorInputGroupRoot: ({ children, className, fullWidth, variant, ...props }: ColorInputGroupRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
interface ColorInputGroupPrefixProps extends ComponentPropsWithRef<"div"> {
|
|
9
|
+
}
|
|
10
|
+
declare const ColorInputGroupPrefix: ({ children, className, ...props }: ColorInputGroupPrefixProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
interface ColorInputGroupInputProps extends InputPrimitiveProps {
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
declare const ColorInputGroupInput: ({ className, ...props }: ColorInputGroupInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
interface ColorInputGroupSuffixProps extends ComponentPropsWithRef<"div"> {
|
|
16
|
+
}
|
|
17
|
+
declare const ColorInputGroupSuffix: ({ children, className, ...props }: ColorInputGroupSuffixProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export { ColorInputGroupRoot, ColorInputGroupInput, ColorInputGroupPrefix, ColorInputGroupSuffix };
|
|
19
|
+
export type { ColorInputGroupRootProps, ColorInputGroupInputProps, ColorInputGroupPrefixProps, ColorInputGroupSuffixProps, };
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { colorInputGroupVariants } from '@masaraxui/styles';
|
|
3
|
+
import React__default, { createContext, useContext } from 'react';
|
|
4
|
+
import { Group, Input } from 'react-aria-components';
|
|
5
|
+
import { composeTwRenderProps, composeSlotClassName } from '../../utils/compose.js';
|
|
6
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
const ColorInputGroupContext = /*#__PURE__*/createContext({});
|
|
9
|
+
|
|
10
|
+
/* -------------------------------------------------------------------------------------------------
|
|
11
|
+
* ColorInputGroup Root
|
|
12
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
13
|
+
|
|
14
|
+
const ColorInputGroupRoot = ({
|
|
15
|
+
children,
|
|
16
|
+
className,
|
|
17
|
+
fullWidth,
|
|
18
|
+
variant,
|
|
19
|
+
...props
|
|
20
|
+
}) => {
|
|
21
|
+
const slots = React__default.useMemo(() => colorInputGroupVariants({
|
|
22
|
+
fullWidth,
|
|
23
|
+
variant
|
|
24
|
+
}), [fullWidth, variant]);
|
|
25
|
+
return /*#__PURE__*/jsx(ColorInputGroupContext, {
|
|
26
|
+
value: {
|
|
27
|
+
slots
|
|
28
|
+
},
|
|
29
|
+
children: /*#__PURE__*/jsx(Group, {
|
|
30
|
+
className: composeTwRenderProps(className, slots?.base()),
|
|
31
|
+
"data-slot": "color-input-group",
|
|
32
|
+
...props,
|
|
33
|
+
children: values => /*#__PURE__*/jsx(Fragment, {
|
|
34
|
+
children: typeof children === "function" ? children(values) : children
|
|
35
|
+
})
|
|
36
|
+
})
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/* -------------------------------------------------------------------------------------------------
|
|
41
|
+
* ColorInputGroup Prefix
|
|
42
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
43
|
+
|
|
44
|
+
const ColorInputGroupPrefix = ({
|
|
45
|
+
children,
|
|
46
|
+
className,
|
|
47
|
+
...props
|
|
48
|
+
}) => {
|
|
49
|
+
const {
|
|
50
|
+
slots
|
|
51
|
+
} = useContext(ColorInputGroupContext);
|
|
52
|
+
return /*#__PURE__*/jsx("div", {
|
|
53
|
+
className: composeSlotClassName(slots?.prefix, className),
|
|
54
|
+
"data-slot": "color-input-group-prefix",
|
|
55
|
+
...props,
|
|
56
|
+
children: children
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
/* -------------------------------------------------------------------------------------------------
|
|
61
|
+
* ColorInputGroup Input
|
|
62
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
63
|
+
|
|
64
|
+
const ColorInputGroupInput = ({
|
|
65
|
+
className,
|
|
66
|
+
...props
|
|
67
|
+
}) => {
|
|
68
|
+
const {
|
|
69
|
+
slots
|
|
70
|
+
} = useContext(ColorInputGroupContext);
|
|
71
|
+
return /*#__PURE__*/jsx(Input, {
|
|
72
|
+
className: composeTwRenderProps(className, slots?.input()),
|
|
73
|
+
"data-slot": "color-input-group-input",
|
|
74
|
+
...props
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
/* -------------------------------------------------------------------------------------------------
|
|
79
|
+
* ColorInputGroup Suffix
|
|
80
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
81
|
+
|
|
82
|
+
const ColorInputGroupSuffix = ({
|
|
83
|
+
children,
|
|
84
|
+
className,
|
|
85
|
+
...props
|
|
86
|
+
}) => {
|
|
87
|
+
const {
|
|
88
|
+
slots
|
|
89
|
+
} = useContext(ColorInputGroupContext);
|
|
90
|
+
return /*#__PURE__*/jsx("div", {
|
|
91
|
+
className: composeSlotClassName(slots?.suffix, className),
|
|
92
|
+
"data-slot": "color-input-group-suffix",
|
|
93
|
+
...props,
|
|
94
|
+
children: children
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
export { ColorInputGroupInput, ColorInputGroupPrefix, ColorInputGroupRoot, ColorInputGroupSuffix };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { ColorInputGroupInput, ColorInputGroupPrefix, ColorInputGroupRoot, ColorInputGroupSuffix } from "./color-input-group";
|
|
3
|
+
export declare const ColorInputGroup: (({ children, className, fullWidth, variant, ...props }: import("./color-input-group").ColorInputGroupRootProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
4
|
+
Root: ({ children, className, fullWidth, variant, ...props }: import("./color-input-group").ColorInputGroupRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
Input: ({ className, ...props }: import("./color-input-group").ColorInputGroupInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
Prefix: ({ children, className, ...props }: import("./color-input-group").ColorInputGroupPrefixProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
Suffix: ({ children, className, ...props }: import("./color-input-group").ColorInputGroupSuffixProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
};
|
|
9
|
+
export type ColorInputGroup = {
|
|
10
|
+
Props: ComponentProps<typeof ColorInputGroupRoot>;
|
|
11
|
+
RootProps: ComponentProps<typeof ColorInputGroupRoot>;
|
|
12
|
+
InputProps: ComponentProps<typeof ColorInputGroupInput>;
|
|
13
|
+
PrefixProps: ComponentProps<typeof ColorInputGroupPrefix>;
|
|
14
|
+
SuffixProps: ComponentProps<typeof ColorInputGroupSuffix>;
|
|
15
|
+
};
|
|
16
|
+
export { ColorInputGroupInput, ColorInputGroupPrefix, ColorInputGroupRoot, ColorInputGroupSuffix };
|
|
17
|
+
export type { ColorInputGroupRootProps, ColorInputGroupRootProps as ColorInputGroupProps, ColorInputGroupInputProps, ColorInputGroupPrefixProps, ColorInputGroupSuffixProps, } from "./color-input-group";
|
|
18
|
+
export { colorInputGroupVariants } from "@masaraxui/styles";
|
|
19
|
+
export type { ColorInputGroupVariants } from "@masaraxui/styles";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { ColorInputGroupRoot, ColorInputGroupSuffix, ColorInputGroupPrefix, ColorInputGroupInput } from './color-input-group.js';
|
|
3
|
+
export { colorInputGroupVariants } from '@masaraxui/styles';
|
|
4
|
+
|
|
5
|
+
/* -------------------------------------------------------------------------------------------------
|
|
6
|
+
* Compound Component
|
|
7
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
8
|
+
const ColorInputGroup = Object.assign(ColorInputGroupRoot, {
|
|
9
|
+
Root: ColorInputGroupRoot,
|
|
10
|
+
Input: ColorInputGroupInput,
|
|
11
|
+
Prefix: ColorInputGroupPrefix,
|
|
12
|
+
Suffix: ColorInputGroupSuffix
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export { ColorInputGroup, ColorInputGroupInput, ColorInputGroupPrefix, ColorInputGroupRoot, ColorInputGroupSuffix };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ColorPickerVariants } from "@masaraxui/styles";
|
|
2
|
+
import type { ComponentPropsWithRef } from "react";
|
|
3
|
+
import type { ColorPickerProps as ColorPickerPrimitiveProps } from "react-aria-components";
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { Button as ButtonPrimitive, Popover as PopoverPrimitive } from "react-aria-components";
|
|
6
|
+
interface ColorPickerRootProps extends Omit<ColorPickerPrimitiveProps, "children">, ColorPickerVariants {
|
|
7
|
+
/** Additional class name for the wrapper element */
|
|
8
|
+
className?: string;
|
|
9
|
+
/** Content of the color picker (Trigger, Popover, etc.) */
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
declare const ColorPickerRoot: ({ children, className, ...props }: ColorPickerRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
interface ColorPickerTriggerProps extends ComponentPropsWithRef<typeof ButtonPrimitive> {
|
|
14
|
+
}
|
|
15
|
+
declare const ColorPickerTrigger: ({ children, className, ...props }: ColorPickerTriggerProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
interface ColorPickerPopoverProps extends Omit<ComponentPropsWithRef<typeof PopoverPrimitive>, "children"> {
|
|
17
|
+
children: React.ReactNode;
|
|
18
|
+
}
|
|
19
|
+
declare const ColorPickerPopover: ({ children, className, placement, ...props }: ColorPickerPopoverProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export { ColorPickerRoot, ColorPickerTrigger, ColorPickerPopover };
|
|
21
|
+
export type { ColorPickerRootProps, ColorPickerTriggerProps, ColorPickerPopoverProps };
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { colorPickerVariants } from '@masaraxui/styles';
|
|
3
|
+
import React__default, { createContext, useContext } from 'react';
|
|
4
|
+
import { ColorPicker, DialogTrigger, Popover, Button } from 'react-aria-components';
|
|
5
|
+
import { composeSlotClassName, composeTwRenderProps } from '../../utils/compose.js';
|
|
6
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
7
|
+
import { SurfaceContext } from '../surface/surface.js';
|
|
8
|
+
|
|
9
|
+
const ColorPickerContext = /*#__PURE__*/createContext({});
|
|
10
|
+
|
|
11
|
+
/* -------------------------------------------------------------------------------------------------
|
|
12
|
+
* ColorPicker Root
|
|
13
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
14
|
+
|
|
15
|
+
const ColorPickerRoot = ({
|
|
16
|
+
children,
|
|
17
|
+
className,
|
|
18
|
+
...props
|
|
19
|
+
}) => {
|
|
20
|
+
const slots = React__default.useMemo(() => colorPickerVariants(), []);
|
|
21
|
+
return /*#__PURE__*/jsx(ColorPickerContext, {
|
|
22
|
+
value: {
|
|
23
|
+
slots
|
|
24
|
+
},
|
|
25
|
+
children: /*#__PURE__*/jsx(ColorPicker, {
|
|
26
|
+
...props,
|
|
27
|
+
children: /*#__PURE__*/jsx(DialogTrigger, {
|
|
28
|
+
children: /*#__PURE__*/jsx("div", {
|
|
29
|
+
className: composeSlotClassName(slots?.base, className),
|
|
30
|
+
"data-slot": "color-picker",
|
|
31
|
+
children: children
|
|
32
|
+
})
|
|
33
|
+
})
|
|
34
|
+
})
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/* -------------------------------------------------------------------------------------------------
|
|
39
|
+
* ColorPicker Trigger
|
|
40
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
41
|
+
|
|
42
|
+
const ColorPickerTrigger = ({
|
|
43
|
+
children,
|
|
44
|
+
className,
|
|
45
|
+
...props
|
|
46
|
+
}) => {
|
|
47
|
+
const {
|
|
48
|
+
slots
|
|
49
|
+
} = useContext(ColorPickerContext);
|
|
50
|
+
return /*#__PURE__*/jsx(Button, {
|
|
51
|
+
className: composeTwRenderProps(className, slots?.trigger()),
|
|
52
|
+
"data-slot": "color-picker-trigger",
|
|
53
|
+
...props,
|
|
54
|
+
children: values => /*#__PURE__*/jsx(Fragment, {
|
|
55
|
+
children: typeof children === "function" ? children(values) : children
|
|
56
|
+
})
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
/* -------------------------------------------------------------------------------------------------
|
|
61
|
+
* ColorPicker Popover
|
|
62
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
63
|
+
|
|
64
|
+
const ColorPickerPopover = ({
|
|
65
|
+
children,
|
|
66
|
+
className,
|
|
67
|
+
placement = "bottom left",
|
|
68
|
+
...props
|
|
69
|
+
}) => {
|
|
70
|
+
const {
|
|
71
|
+
slots
|
|
72
|
+
} = useContext(ColorPickerContext);
|
|
73
|
+
return /*#__PURE__*/jsx(SurfaceContext, {
|
|
74
|
+
value: {
|
|
75
|
+
variant: "default"
|
|
76
|
+
},
|
|
77
|
+
children: /*#__PURE__*/jsx(Popover, {
|
|
78
|
+
...props,
|
|
79
|
+
className: composeTwRenderProps(className, slots?.popover()),
|
|
80
|
+
placement: placement,
|
|
81
|
+
children: children
|
|
82
|
+
})
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export { ColorPickerPopover, ColorPickerRoot, ColorPickerTrigger };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { ColorPickerPopover, ColorPickerRoot, ColorPickerTrigger } from "./color-picker";
|
|
3
|
+
export declare const ColorPicker: (({ children, className, ...props }: import("./color-picker").ColorPickerRootProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
4
|
+
Root: ({ children, className, ...props }: import("./color-picker").ColorPickerRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
Trigger: ({ children, className, ...props }: import("./color-picker").ColorPickerTriggerProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
Popover: ({ children, className, placement, ...props }: import("./color-picker").ColorPickerPopoverProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
};
|
|
8
|
+
export type ColorPicker = {
|
|
9
|
+
Props: ComponentProps<typeof ColorPickerRoot>;
|
|
10
|
+
RootProps: ComponentProps<typeof ColorPickerRoot>;
|
|
11
|
+
TriggerProps: ComponentProps<typeof ColorPickerTrigger>;
|
|
12
|
+
PopoverProps: ComponentProps<typeof ColorPickerPopover>;
|
|
13
|
+
};
|
|
14
|
+
export { ColorPickerPopover, ColorPickerRoot, ColorPickerTrigger };
|
|
15
|
+
export type { ColorPickerRootProps, ColorPickerRootProps as ColorPickerProps, ColorPickerTriggerProps, ColorPickerPopoverProps, } from "./color-picker";
|
|
16
|
+
export { colorPickerVariants } from "@masaraxui/styles";
|
|
17
|
+
export type { ColorPickerVariants } from "@masaraxui/styles";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { ColorPickerRoot, ColorPickerPopover, ColorPickerTrigger } from './color-picker.js';
|
|
3
|
+
export { colorPickerVariants } from '@masaraxui/styles';
|
|
4
|
+
|
|
5
|
+
/* -------------------------------------------------------------------------------------------------
|
|
6
|
+
* Compound Component
|
|
7
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
8
|
+
const ColorPicker = Object.assign(ColorPickerRoot, {
|
|
9
|
+
Root: ColorPickerRoot,
|
|
10
|
+
Trigger: ColorPickerTrigger,
|
|
11
|
+
Popover: ColorPickerPopover
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export { ColorPicker, ColorPickerPopover, ColorPickerRoot, ColorPickerTrigger };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { ColorSliderVariants } from "@masaraxui/styles";
|
|
2
|
+
import type { ComponentPropsWithRef } from "react";
|
|
3
|
+
import type { ColorSpace } from "react-aria-components";
|
|
4
|
+
import { ColorSlider as ColorSliderPrimitive, ColorThumb as ColorThumbPrimitive, SliderOutput as SliderOutputPrimitive, SliderTrack as SliderTrackPrimitive } from "react-aria-components";
|
|
5
|
+
/** Channels available in HSL color space */
|
|
6
|
+
type HSLChannel = "hue" | "saturation" | "lightness" | "alpha";
|
|
7
|
+
/** Channels available in HSB color space */
|
|
8
|
+
type HSBChannel = "hue" | "saturation" | "brightness" | "alpha";
|
|
9
|
+
/** Channels available in RGB color space */
|
|
10
|
+
type RGBChannel = "red" | "green" | "blue" | "alpha";
|
|
11
|
+
/** Channels shared between HSL and HSB (but NOT RGB) */
|
|
12
|
+
type HSLHSBSharedChannel = "hue" | "saturation";
|
|
13
|
+
/** Alpha channel works across ALL color spaces */
|
|
14
|
+
type AlphaChannel = "alpha";
|
|
15
|
+
/**
|
|
16
|
+
* Discriminated union type for valid channel/colorSpace combinations.
|
|
17
|
+
* This ensures TypeScript will error on invalid combinations like
|
|
18
|
+
* `channel="red"` with `colorSpace="hsl"` or `channel="saturation"` with `colorSpace="rgb"`.
|
|
19
|
+
*/
|
|
20
|
+
type ColorSliderChannelProps = {
|
|
21
|
+
channel: HSLChannel;
|
|
22
|
+
colorSpace?: "hsl";
|
|
23
|
+
} | {
|
|
24
|
+
channel: HSBChannel;
|
|
25
|
+
colorSpace?: "hsb";
|
|
26
|
+
} | {
|
|
27
|
+
channel: RGBChannel;
|
|
28
|
+
colorSpace?: "rgb";
|
|
29
|
+
} | {
|
|
30
|
+
channel: HSLHSBSharedChannel;
|
|
31
|
+
colorSpace?: "hsl" | "hsb";
|
|
32
|
+
} | {
|
|
33
|
+
channel: AlphaChannel;
|
|
34
|
+
colorSpace?: ColorSpace;
|
|
35
|
+
};
|
|
36
|
+
interface ColorSliderRootBaseProps extends Omit<ComponentPropsWithRef<typeof ColorSliderPrimitive>, "channel" | "colorSpace">, ColorSliderVariants {
|
|
37
|
+
}
|
|
38
|
+
type ColorSliderRootProps = ColorSliderRootBaseProps & ColorSliderChannelProps;
|
|
39
|
+
declare const ColorSliderRoot: ({ channel, children, className, colorSpace, orientation, ...props }: ColorSliderRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
interface ColorSliderOutputProps extends ComponentPropsWithRef<typeof SliderOutputPrimitive> {
|
|
41
|
+
}
|
|
42
|
+
declare const ColorSliderOutput: ({ children, className, ...props }: ColorSliderOutputProps) => import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
interface ColorSliderTrackProps extends ComponentPropsWithRef<typeof SliderTrackPrimitive> {
|
|
44
|
+
}
|
|
45
|
+
declare const ColorSliderTrack: ({ children, className, style, ...props }: ColorSliderTrackProps) => import("react/jsx-runtime").JSX.Element;
|
|
46
|
+
interface ColorSliderThumbProps extends ComponentPropsWithRef<typeof ColorThumbPrimitive> {
|
|
47
|
+
}
|
|
48
|
+
declare const ColorSliderThumb: ({ children, className, style, ...props }: ColorSliderThumbProps) => import("react/jsx-runtime").JSX.Element;
|
|
49
|
+
export { ColorSliderRoot, ColorSliderOutput, ColorSliderTrack, ColorSliderThumb };
|
|
50
|
+
export type { ColorSliderRootProps, ColorSliderOutputProps, ColorSliderTrackProps, ColorSliderThumbProps, HSLChannel, HSBChannel, RGBChannel, HSLHSBSharedChannel, AlphaChannel, ColorSliderChannelProps, };
|