@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,141 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cardVariants } from '@masaraxui/styles';
|
|
3
|
+
import React__default, { createContext, useContext } from 'react';
|
|
4
|
+
import { composeSlotClassName } from '../../utils/compose.js';
|
|
5
|
+
import { jsx } from 'react/jsx-runtime';
|
|
6
|
+
import { SurfaceContext } from '../surface/surface.js';
|
|
7
|
+
|
|
8
|
+
const CardContext = /*#__PURE__*/createContext({});
|
|
9
|
+
|
|
10
|
+
/* -------------------------------------------------------------------------------------------------
|
|
11
|
+
* Card Root
|
|
12
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
13
|
+
|
|
14
|
+
const CardRoot = ({
|
|
15
|
+
children,
|
|
16
|
+
className,
|
|
17
|
+
variant = "default",
|
|
18
|
+
...props
|
|
19
|
+
}) => {
|
|
20
|
+
const slots = React__default.useMemo(() => cardVariants({
|
|
21
|
+
variant
|
|
22
|
+
}), [variant]);
|
|
23
|
+
const content = /*#__PURE__*/jsx("div", {
|
|
24
|
+
className: slots.base({
|
|
25
|
+
className
|
|
26
|
+
}),
|
|
27
|
+
"data-slot": "card",
|
|
28
|
+
...props,
|
|
29
|
+
children: children
|
|
30
|
+
});
|
|
31
|
+
return /*#__PURE__*/jsx(CardContext, {
|
|
32
|
+
value: {
|
|
33
|
+
slots
|
|
34
|
+
},
|
|
35
|
+
children: variant === "transparent" ? content :
|
|
36
|
+
/*#__PURE__*/
|
|
37
|
+
// Allows inner components to apply "on-surface" colors for proper contrast
|
|
38
|
+
jsx(SurfaceContext, {
|
|
39
|
+
value: {
|
|
40
|
+
variant: variant
|
|
41
|
+
},
|
|
42
|
+
children: content
|
|
43
|
+
})
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/* -------------------------------------------------------------------------------------------------
|
|
48
|
+
* Card Header
|
|
49
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
50
|
+
|
|
51
|
+
const CardHeader = ({
|
|
52
|
+
className,
|
|
53
|
+
...props
|
|
54
|
+
}) => {
|
|
55
|
+
const {
|
|
56
|
+
slots
|
|
57
|
+
} = useContext(CardContext);
|
|
58
|
+
return /*#__PURE__*/jsx("div", {
|
|
59
|
+
className: composeSlotClassName(slots?.header, className),
|
|
60
|
+
"data-slot": "card-header",
|
|
61
|
+
...props
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
/* -------------------------------------------------------------------------------------------------
|
|
66
|
+
* Card Title
|
|
67
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
68
|
+
|
|
69
|
+
const CardTitle = ({
|
|
70
|
+
children,
|
|
71
|
+
className,
|
|
72
|
+
...props
|
|
73
|
+
}) => {
|
|
74
|
+
const {
|
|
75
|
+
slots
|
|
76
|
+
} = useContext(CardContext);
|
|
77
|
+
return /*#__PURE__*/jsx("h3", {
|
|
78
|
+
className: composeSlotClassName(slots?.title, className),
|
|
79
|
+
"data-slot": "card-title",
|
|
80
|
+
...props,
|
|
81
|
+
children: children
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
/* -------------------------------------------------------------------------------------------------
|
|
86
|
+
* Card Description
|
|
87
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
88
|
+
|
|
89
|
+
const CardDescription = ({
|
|
90
|
+
children,
|
|
91
|
+
className,
|
|
92
|
+
...props
|
|
93
|
+
}) => {
|
|
94
|
+
const {
|
|
95
|
+
slots
|
|
96
|
+
} = useContext(CardContext);
|
|
97
|
+
return /*#__PURE__*/jsx("p", {
|
|
98
|
+
className: composeSlotClassName(slots?.description, className),
|
|
99
|
+
"data-slot": "card-description",
|
|
100
|
+
...props,
|
|
101
|
+
children: children
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
/* -------------------------------------------------------------------------------------------------
|
|
106
|
+
* Card Content
|
|
107
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
108
|
+
|
|
109
|
+
const CardContent = ({
|
|
110
|
+
className,
|
|
111
|
+
...props
|
|
112
|
+
}) => {
|
|
113
|
+
const {
|
|
114
|
+
slots
|
|
115
|
+
} = useContext(CardContext);
|
|
116
|
+
return /*#__PURE__*/jsx("div", {
|
|
117
|
+
className: composeSlotClassName(slots?.content, className),
|
|
118
|
+
"data-slot": "card-content",
|
|
119
|
+
...props
|
|
120
|
+
});
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
/* -------------------------------------------------------------------------------------------------
|
|
124
|
+
* Card Footer
|
|
125
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
126
|
+
|
|
127
|
+
const CardFooter = ({
|
|
128
|
+
className,
|
|
129
|
+
...props
|
|
130
|
+
}) => {
|
|
131
|
+
const {
|
|
132
|
+
slots
|
|
133
|
+
} = useContext(CardContext);
|
|
134
|
+
return /*#__PURE__*/jsx("div", {
|
|
135
|
+
className: composeSlotClassName(slots?.footer, className),
|
|
136
|
+
"data-slot": "card-footer",
|
|
137
|
+
...props
|
|
138
|
+
});
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
export { CardContent, CardDescription, CardFooter, CardHeader, CardRoot, CardTitle };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { CardContent, CardDescription, CardFooter, CardHeader, CardRoot, CardTitle } from "./card";
|
|
3
|
+
export declare const Card: (({ children, className, variant, ...props }: import("./card").CardRootProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
4
|
+
Root: ({ children, className, variant, ...props }: import("./card").CardRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
Header: ({ className, ...props }: import("./card").CardHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
Title: ({ children, className, ...props }: import("./card").CardTitleProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
Description: ({ children, className, ...props }: import("./card").CardDescriptionProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
Content: ({ className, ...props }: import("./card").CardContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
Footer: ({ className, ...props }: import("./card").CardFooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
};
|
|
11
|
+
export type Card = {
|
|
12
|
+
Props: ComponentProps<typeof CardRoot>;
|
|
13
|
+
RootProps: ComponentProps<typeof CardRoot>;
|
|
14
|
+
HeaderProps: ComponentProps<typeof CardHeader>;
|
|
15
|
+
TitleProps: ComponentProps<typeof CardTitle>;
|
|
16
|
+
DescriptionProps: ComponentProps<typeof CardDescription>;
|
|
17
|
+
ContentProps: ComponentProps<typeof CardContent>;
|
|
18
|
+
FooterProps: ComponentProps<typeof CardFooter>;
|
|
19
|
+
};
|
|
20
|
+
export { CardRoot, CardHeader, CardTitle, CardDescription, CardContent, CardFooter };
|
|
21
|
+
export type { CardRootProps, CardRootProps as CardProps, CardHeaderProps, CardTitleProps, CardDescriptionProps, CardContentProps, CardFooterProps, } from "./card";
|
|
22
|
+
export { cardVariants } from "@masaraxui/styles";
|
|
23
|
+
export type { CardVariants } from "@masaraxui/styles";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { CardRoot, CardFooter, CardContent, CardDescription, CardTitle, CardHeader } from './card.js';
|
|
3
|
+
export { cardVariants } from '@masaraxui/styles';
|
|
4
|
+
|
|
5
|
+
/* -------------------------------------------------------------------------------------------------
|
|
6
|
+
* Compound Component
|
|
7
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
8
|
+
const Card = Object.assign(CardRoot, {
|
|
9
|
+
Root: CardRoot,
|
|
10
|
+
Header: CardHeader,
|
|
11
|
+
Title: CardTitle,
|
|
12
|
+
Description: CardDescription,
|
|
13
|
+
Content: CardContent,
|
|
14
|
+
Footer: CardFooter
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardRoot, CardTitle };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { CheckboxVariants } from "@masaraxui/styles";
|
|
2
|
+
import type { ComponentPropsWithRef } from "react";
|
|
3
|
+
import type { CheckboxRenderProps } from "react-aria-components";
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { Checkbox as CheckboxPrimitive } from "react-aria-components";
|
|
6
|
+
interface CheckboxRootProps extends ComponentPropsWithRef<typeof CheckboxPrimitive>, CheckboxVariants {
|
|
7
|
+
/** The name of the checkbox, used when submitting an HTML form. */
|
|
8
|
+
name?: string;
|
|
9
|
+
}
|
|
10
|
+
declare const CheckboxRoot: ({ children, className, variant, ...props }: CheckboxRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
interface CheckboxControlProps extends ComponentPropsWithRef<"span"> {
|
|
12
|
+
}
|
|
13
|
+
declare const CheckboxControl: ({ children, className, ...props }: CheckboxControlProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
interface CheckboxIndicatorProps extends Omit<ComponentPropsWithRef<"span">, "children"> {
|
|
15
|
+
children?: React.ReactNode | ((props: CheckboxRenderProps) => React.ReactNode);
|
|
16
|
+
}
|
|
17
|
+
declare const CheckboxIndicator: ({ children, className, ...props }: CheckboxIndicatorProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
interface CheckboxContentProps extends ComponentPropsWithRef<"div"> {
|
|
19
|
+
}
|
|
20
|
+
declare const CheckboxContent: ({ children, className, ...props }: CheckboxContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export { CheckboxRoot, CheckboxControl, CheckboxIndicator, CheckboxContent };
|
|
22
|
+
export type { CheckboxRootProps, CheckboxControlProps, CheckboxIndicatorProps, CheckboxContentProps };
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { checkboxVariants } from '@masaraxui/styles';
|
|
3
|
+
import React__default, { useContext, createContext } from 'react';
|
|
4
|
+
import { Checkbox } from 'react-aria-components';
|
|
5
|
+
import { composeTwRenderProps, composeSlotClassName } from '../../utils/compose.js';
|
|
6
|
+
import { CheckboxGroupContext } from '../checkbox-group/checkbox-group.js';
|
|
7
|
+
import { jsx } from 'react/jsx-runtime';
|
|
8
|
+
|
|
9
|
+
const CheckboxContext = /*#__PURE__*/createContext({});
|
|
10
|
+
const CheckboxRoot = ({
|
|
11
|
+
children,
|
|
12
|
+
className,
|
|
13
|
+
variant,
|
|
14
|
+
...props
|
|
15
|
+
}) => {
|
|
16
|
+
const checkboxGroupContext = useContext(CheckboxGroupContext);
|
|
17
|
+
const effectiveVariant = variant ?? checkboxGroupContext.variant;
|
|
18
|
+
const slots = React__default.useMemo(() => checkboxVariants({
|
|
19
|
+
variant: effectiveVariant
|
|
20
|
+
}), [effectiveVariant]);
|
|
21
|
+
return /*#__PURE__*/jsx(Checkbox, {
|
|
22
|
+
"data-slot": "checkbox",
|
|
23
|
+
...props,
|
|
24
|
+
className: composeTwRenderProps(className, slots.base()),
|
|
25
|
+
children: values => /*#__PURE__*/jsx(CheckboxContext, {
|
|
26
|
+
value: {
|
|
27
|
+
slots,
|
|
28
|
+
state: values
|
|
29
|
+
},
|
|
30
|
+
children: typeof children === "function" ? children(values) : children
|
|
31
|
+
})
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/* -----------------------------------------------------------------------------------------------*/
|
|
36
|
+
|
|
37
|
+
const CheckboxControl = ({
|
|
38
|
+
children,
|
|
39
|
+
className,
|
|
40
|
+
...props
|
|
41
|
+
}) => {
|
|
42
|
+
const {
|
|
43
|
+
slots
|
|
44
|
+
} = useContext(CheckboxContext);
|
|
45
|
+
return /*#__PURE__*/jsx("span", {
|
|
46
|
+
className: composeSlotClassName(slots?.control, className),
|
|
47
|
+
"data-slot": "checkbox-control",
|
|
48
|
+
...props,
|
|
49
|
+
children: children
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
/* -----------------------------------------------------------------------------------------------*/
|
|
54
|
+
|
|
55
|
+
const CheckboxIndicator = ({
|
|
56
|
+
children,
|
|
57
|
+
className,
|
|
58
|
+
...props
|
|
59
|
+
}) => {
|
|
60
|
+
const {
|
|
61
|
+
slots,
|
|
62
|
+
state
|
|
63
|
+
} = useContext(CheckboxContext);
|
|
64
|
+
const isSelected = state?.isSelected;
|
|
65
|
+
const isIndeterminate = state?.isIndeterminate;
|
|
66
|
+
const content = typeof children === "function" ? children(state ?? {}) : children ? children : isIndeterminate ? /*#__PURE__*/jsx("svg", {
|
|
67
|
+
"aria-hidden": "true",
|
|
68
|
+
"data-slot": "checkbox-default-indicator--indeterminate",
|
|
69
|
+
fill: "none",
|
|
70
|
+
role: "presentation",
|
|
71
|
+
stroke: "currentColor",
|
|
72
|
+
strokeLinecap: "round",
|
|
73
|
+
strokeWidth: 3,
|
|
74
|
+
viewBox: "0 0 24 24",
|
|
75
|
+
children: /*#__PURE__*/jsx("line", {
|
|
76
|
+
x1: "21",
|
|
77
|
+
x2: "3",
|
|
78
|
+
y1: "12",
|
|
79
|
+
y2: "12"
|
|
80
|
+
})
|
|
81
|
+
}) : /*#__PURE__*/jsx("svg", {
|
|
82
|
+
"aria-hidden": "true",
|
|
83
|
+
"data-slot": "checkbox-default-indicator--checkmark",
|
|
84
|
+
fill: "none",
|
|
85
|
+
role: "presentation",
|
|
86
|
+
stroke: "currentColor",
|
|
87
|
+
strokeDasharray: 22,
|
|
88
|
+
strokeDashoffset: isSelected ? 44 : 66,
|
|
89
|
+
strokeLinecap: "round",
|
|
90
|
+
strokeLinejoin: "round",
|
|
91
|
+
strokeWidth: 2,
|
|
92
|
+
viewBox: "0 0 17 18",
|
|
93
|
+
children: /*#__PURE__*/jsx("polyline", {
|
|
94
|
+
points: "1 9 7 14 15 4"
|
|
95
|
+
})
|
|
96
|
+
});
|
|
97
|
+
return /*#__PURE__*/jsx("span", {
|
|
98
|
+
"aria-hidden": "true",
|
|
99
|
+
className: composeSlotClassName(slots?.indicator, className),
|
|
100
|
+
"data-slot": "checkbox-indicator",
|
|
101
|
+
...props,
|
|
102
|
+
children: content
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
/* -----------------------------------------------------------------------------------------------*/
|
|
107
|
+
|
|
108
|
+
const CheckboxContent = ({
|
|
109
|
+
children,
|
|
110
|
+
className,
|
|
111
|
+
...props
|
|
112
|
+
}) => {
|
|
113
|
+
const {
|
|
114
|
+
slots
|
|
115
|
+
} = useContext(CheckboxContext);
|
|
116
|
+
return /*#__PURE__*/jsx("div", {
|
|
117
|
+
className: composeSlotClassName(slots?.content, className),
|
|
118
|
+
"data-slot": "checkbox-content",
|
|
119
|
+
...props,
|
|
120
|
+
children: children
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
export { CheckboxContent, CheckboxControl, CheckboxIndicator, CheckboxRoot };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { CheckboxContent, CheckboxControl, CheckboxIndicator, CheckboxRoot } from "./checkbox";
|
|
3
|
+
export declare const Checkbox: (({ children, className, variant, ...props }: import("./checkbox").CheckboxRootProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
4
|
+
Root: ({ children, className, variant, ...props }: import("./checkbox").CheckboxRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
Control: ({ children, className, ...props }: import("./checkbox").CheckboxControlProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
Indicator: ({ children, className, ...props }: import("./checkbox").CheckboxIndicatorProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
Content: ({ children, className, ...props }: import("./checkbox").CheckboxContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
};
|
|
9
|
+
export type Checkbox = {
|
|
10
|
+
Props: ComponentProps<typeof CheckboxRoot>;
|
|
11
|
+
RootProps: ComponentProps<typeof CheckboxRoot>;
|
|
12
|
+
ControlProps: ComponentProps<typeof CheckboxControl>;
|
|
13
|
+
IndicatorProps: ComponentProps<typeof CheckboxIndicator>;
|
|
14
|
+
ContentProps: ComponentProps<typeof CheckboxContent>;
|
|
15
|
+
};
|
|
16
|
+
export { CheckboxContent, CheckboxControl, CheckboxIndicator, CheckboxRoot };
|
|
17
|
+
export type { CheckboxRootProps, CheckboxRootProps as CheckboxProps, CheckboxControlProps, CheckboxIndicatorProps, CheckboxContentProps, } from "./checkbox";
|
|
18
|
+
export { checkboxVariants } from "@masaraxui/styles";
|
|
19
|
+
export type { CheckboxVariants } from "@masaraxui/styles";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { CheckboxRoot, CheckboxContent, CheckboxIndicator, CheckboxControl } from './checkbox.js';
|
|
3
|
+
export { checkboxVariants } from '@masaraxui/styles';
|
|
4
|
+
|
|
5
|
+
/* -------------------------------------------------------------------------------------------------
|
|
6
|
+
* Compound Component
|
|
7
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
8
|
+
const Checkbox = Object.assign(CheckboxRoot, {
|
|
9
|
+
Root: CheckboxRoot,
|
|
10
|
+
Control: CheckboxControl,
|
|
11
|
+
Indicator: CheckboxIndicator,
|
|
12
|
+
Content: CheckboxContent
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export { Checkbox, CheckboxContent, CheckboxControl, CheckboxIndicator, CheckboxRoot };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CheckboxVariants } from "../checkbox";
|
|
2
|
+
import type { CheckboxGroupVariants } from "@masaraxui/styles";
|
|
3
|
+
import type { ComponentPropsWithRef } from "react";
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { CheckboxGroup as CheckboxGroupPrimitive } from "react-aria-components";
|
|
6
|
+
interface CheckboxGroupContext {
|
|
7
|
+
variant?: CheckboxVariants["variant"];
|
|
8
|
+
}
|
|
9
|
+
declare const CheckboxGroupContext: React.Context<CheckboxGroupContext>;
|
|
10
|
+
interface CheckboxGroupProps extends ComponentPropsWithRef<typeof CheckboxGroupPrimitive>, CheckboxGroupVariants {
|
|
11
|
+
}
|
|
12
|
+
declare const CheckboxGroup: ({ children, className, variant, ...props }: CheckboxGroupProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export { CheckboxGroup, CheckboxGroupContext };
|
|
14
|
+
export type { CheckboxGroupProps };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { checkboxGroupVariants } from '@masaraxui/styles';
|
|
3
|
+
import React__default, { createContext } from 'react';
|
|
4
|
+
import { CheckboxGroup as CheckboxGroup$1 } from 'react-aria-components';
|
|
5
|
+
import { composeTwRenderProps } from '../../utils/compose.js';
|
|
6
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
const CheckboxGroupContext = /*#__PURE__*/createContext({});
|
|
9
|
+
const CheckboxGroup = ({
|
|
10
|
+
children,
|
|
11
|
+
className,
|
|
12
|
+
variant,
|
|
13
|
+
...props
|
|
14
|
+
}) => {
|
|
15
|
+
const styles = React__default.useMemo(() => checkboxGroupVariants({
|
|
16
|
+
variant
|
|
17
|
+
}), [variant]);
|
|
18
|
+
return /*#__PURE__*/jsx(CheckboxGroupContext.Provider, {
|
|
19
|
+
value: {
|
|
20
|
+
variant
|
|
21
|
+
},
|
|
22
|
+
children: /*#__PURE__*/jsx(CheckboxGroup$1, {
|
|
23
|
+
className: composeTwRenderProps(className, styles),
|
|
24
|
+
"data-slot": "checkbox-group",
|
|
25
|
+
...props,
|
|
26
|
+
children: values => /*#__PURE__*/jsx(Fragment, {
|
|
27
|
+
children: typeof children === "function" ? children(values) : children
|
|
28
|
+
})
|
|
29
|
+
})
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export { CheckboxGroup, CheckboxGroupContext };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ChipVariants } from "@masaraxui/styles";
|
|
2
|
+
import type { ComponentPropsWithRef } from "react";
|
|
3
|
+
import React from "react";
|
|
4
|
+
interface ChipRootProps extends Omit<ComponentPropsWithRef<"div">, "type" | "color">, ChipVariants {
|
|
5
|
+
className?: string;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
declare const ChipRoot: ({ children, className, color, size, variant, ...props }: ChipRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
interface ChipLabelProps extends ComponentPropsWithRef<"span"> {
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
declare const ChipLabel: ({ children, className, ...props }: ChipLabelProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export { ChipRoot, ChipLabel };
|
|
14
|
+
export type { ChipRootProps, ChipLabelProps };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { chipVariants } from '@masaraxui/styles';
|
|
3
|
+
import React__default, { createContext, useContext } from 'react';
|
|
4
|
+
import { composeSlotClassName } from '../../utils/compose.js';
|
|
5
|
+
import { jsx } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
const ChipContext = /*#__PURE__*/createContext({});
|
|
8
|
+
|
|
9
|
+
/* -------------------------------------------------------------------------------------------------
|
|
10
|
+
* Chip Root
|
|
11
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
12
|
+
|
|
13
|
+
const ChipRoot = ({
|
|
14
|
+
children,
|
|
15
|
+
className,
|
|
16
|
+
color,
|
|
17
|
+
size,
|
|
18
|
+
variant,
|
|
19
|
+
...props
|
|
20
|
+
}) => {
|
|
21
|
+
const slots = React__default.useMemo(() => chipVariants({
|
|
22
|
+
color,
|
|
23
|
+
size,
|
|
24
|
+
variant
|
|
25
|
+
}), [color, size, variant]);
|
|
26
|
+
const chipChildren = React__default.useMemo(() => {
|
|
27
|
+
if (typeof children === "string" || typeof children === "number") {
|
|
28
|
+
return /*#__PURE__*/jsx(ChipLabel, {
|
|
29
|
+
children: children
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
return children;
|
|
33
|
+
}, [children]);
|
|
34
|
+
return /*#__PURE__*/jsx(ChipContext, {
|
|
35
|
+
value: {
|
|
36
|
+
slots
|
|
37
|
+
},
|
|
38
|
+
children: /*#__PURE__*/jsx("span", {
|
|
39
|
+
...props,
|
|
40
|
+
className: composeSlotClassName(slots.base, className),
|
|
41
|
+
"data-slot": "chip",
|
|
42
|
+
children: chipChildren
|
|
43
|
+
})
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/* -------------------------------------------------------------------------------------------------
|
|
48
|
+
* Chip Label
|
|
49
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
50
|
+
|
|
51
|
+
const ChipLabel = ({
|
|
52
|
+
children,
|
|
53
|
+
className,
|
|
54
|
+
...props
|
|
55
|
+
}) => {
|
|
56
|
+
const {
|
|
57
|
+
slots
|
|
58
|
+
} = useContext(ChipContext);
|
|
59
|
+
return /*#__PURE__*/jsx("span", {
|
|
60
|
+
className: composeSlotClassName(slots?.label, className),
|
|
61
|
+
"data-slot": "chip-label",
|
|
62
|
+
...props,
|
|
63
|
+
children: children
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export { ChipLabel, ChipRoot };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { ChipLabel, ChipRoot } from "./chip";
|
|
3
|
+
export declare const Chip: (({ children, className, color, size, variant, ...props }: import("./chip").ChipRootProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
4
|
+
Root: ({ children, className, color, size, variant, ...props }: import("./chip").ChipRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
Label: ({ children, className, ...props }: import("./chip").ChipLabelProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
};
|
|
7
|
+
export type Chip = {
|
|
8
|
+
Props: ComponentProps<typeof ChipRoot>;
|
|
9
|
+
RootProps: ComponentProps<typeof ChipRoot>;
|
|
10
|
+
LabelProps: ComponentProps<typeof ChipLabel>;
|
|
11
|
+
};
|
|
12
|
+
export { ChipRoot, ChipLabel };
|
|
13
|
+
export type { ChipRootProps, ChipRootProps as ChipProps, ChipLabelProps } from "./chip";
|
|
14
|
+
export { chipVariants } from "@masaraxui/styles";
|
|
15
|
+
export type { ChipVariants } from "@masaraxui/styles";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { ChipRoot, ChipLabel } from './chip.js';
|
|
3
|
+
export { chipVariants } from '@masaraxui/styles';
|
|
4
|
+
|
|
5
|
+
/* -------------------------------------------------------------------------------------------------
|
|
6
|
+
* Compound Component
|
|
7
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
8
|
+
const Chip = Object.assign(ChipRoot, {
|
|
9
|
+
Root: ChipRoot,
|
|
10
|
+
Label: ChipLabel
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export { Chip, ChipLabel, ChipRoot };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CloseButtonVariants } from "@masaraxui/styles";
|
|
2
|
+
import type { ComponentPropsWithRef } from "react";
|
|
3
|
+
import { Button as ButtonPrimitive } from "react-aria-components";
|
|
4
|
+
interface CloseButtonRootProps extends ComponentPropsWithRef<typeof ButtonPrimitive>, CloseButtonVariants {
|
|
5
|
+
}
|
|
6
|
+
declare const CloseButtonRoot: ({ children, className, slot, style, variant, ...rest }: CloseButtonRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export { CloseButtonRoot };
|
|
8
|
+
export type { CloseButtonRootProps };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { closeButtonVariants } from '@masaraxui/styles';
|
|
3
|
+
import { useMemo } from 'react';
|
|
4
|
+
import { Button } from 'react-aria-components';
|
|
5
|
+
import { CloseIcon } from '../icons.js';
|
|
6
|
+
import { jsx } from 'react/jsx-runtime';
|
|
7
|
+
import { composeTwRenderProps } from '../../utils/compose.js';
|
|
8
|
+
|
|
9
|
+
const CloseButtonRoot = ({
|
|
10
|
+
children,
|
|
11
|
+
className,
|
|
12
|
+
slot,
|
|
13
|
+
style,
|
|
14
|
+
variant,
|
|
15
|
+
...rest
|
|
16
|
+
}) => {
|
|
17
|
+
const styles = useMemo(() => closeButtonVariants({
|
|
18
|
+
variant
|
|
19
|
+
}), [variant]);
|
|
20
|
+
return /*#__PURE__*/jsx(Button, {
|
|
21
|
+
"aria-label": "Close",
|
|
22
|
+
className: composeTwRenderProps(className, styles),
|
|
23
|
+
"data-slot": "close-button",
|
|
24
|
+
slot: slot,
|
|
25
|
+
style: style,
|
|
26
|
+
...rest,
|
|
27
|
+
children: renderProps => typeof children === "function" ? children(renderProps) : children ?? /*#__PURE__*/jsx(CloseIcon, {
|
|
28
|
+
"data-slot": "close-button-icon"
|
|
29
|
+
})
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export { CloseButtonRoot };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { CloseButtonRoot } from "./close-button";
|
|
3
|
+
export declare const CloseButton: (({ children, className, slot, style, variant, ...rest }: import("./close-button").CloseButtonRootProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
4
|
+
Root: ({ children, className, slot, style, variant, ...rest }: import("./close-button").CloseButtonRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
};
|
|
6
|
+
export type CloseButton = {
|
|
7
|
+
Props: ComponentProps<typeof CloseButtonRoot>;
|
|
8
|
+
RootProps: ComponentProps<typeof CloseButtonRoot>;
|
|
9
|
+
};
|
|
10
|
+
export { CloseButtonRoot };
|
|
11
|
+
export type { CloseButtonRootProps, CloseButtonRootProps as CloseButtonProps } from "./close-button";
|
|
12
|
+
export { closeButtonVariants } from "@masaraxui/styles";
|
|
13
|
+
export type { CloseButtonVariants } from "@masaraxui/styles";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { CloseButtonRoot } from './close-button.js';
|
|
3
|
+
export { closeButtonVariants } from '@masaraxui/styles';
|
|
4
|
+
|
|
5
|
+
/* -------------------------------------------------------------------------------------------------
|
|
6
|
+
* Compound Component
|
|
7
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
8
|
+
const CloseButton = Object.assign(CloseButtonRoot, {
|
|
9
|
+
Root: CloseButtonRoot
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export { CloseButton, CloseButtonRoot };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ColorAreaVariants } from "@masaraxui/styles";
|
|
2
|
+
import type { ComponentPropsWithRef } from "react";
|
|
3
|
+
import { ColorArea as ColorAreaPrimitive, ColorThumb as ColorThumbPrimitive } from "react-aria-components";
|
|
4
|
+
interface ColorAreaRootProps extends ComponentPropsWithRef<typeof ColorAreaPrimitive>, ColorAreaVariants {
|
|
5
|
+
}
|
|
6
|
+
declare const ColorAreaRoot: ({ children, className, showDots, style, ...props }: ColorAreaRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
interface ColorAreaThumbProps extends ComponentPropsWithRef<typeof ColorThumbPrimitive> {
|
|
8
|
+
}
|
|
9
|
+
declare const ColorAreaThumb: ({ className, style, ...props }: ColorAreaThumbProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export { ColorAreaRoot, ColorAreaThumb };
|
|
11
|
+
export type { ColorAreaRootProps, ColorAreaThumbProps };
|