@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,85 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { tagVariants } from '@masaraxui/styles';
|
|
3
|
+
import { useContext, useMemo, Children, createContext } from 'react';
|
|
4
|
+
import { Tag } from 'react-aria-components';
|
|
5
|
+
import { pickChildren } from '../../utils/children.js';
|
|
6
|
+
import { composeTwRenderProps } from '../../utils/compose.js';
|
|
7
|
+
import { CloseButton } from '../close-button/index.js';
|
|
8
|
+
import '../tag-group/index.js';
|
|
9
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
10
|
+
import { TagGroupContext } from '../tag-group/tag-group.js';
|
|
11
|
+
|
|
12
|
+
const TagContext = /*#__PURE__*/createContext({});
|
|
13
|
+
|
|
14
|
+
/* -------------------------------------------------------------------------------------------------
|
|
15
|
+
* Tag Root
|
|
16
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
17
|
+
|
|
18
|
+
const TagRoot = ({
|
|
19
|
+
children,
|
|
20
|
+
className,
|
|
21
|
+
...restProps
|
|
22
|
+
}) => {
|
|
23
|
+
const {
|
|
24
|
+
size,
|
|
25
|
+
variant
|
|
26
|
+
} = useContext(TagGroupContext);
|
|
27
|
+
const slots = useMemo(() => tagVariants({
|
|
28
|
+
size,
|
|
29
|
+
variant
|
|
30
|
+
}), [size, variant]);
|
|
31
|
+
const textValue = useMemo(() => {
|
|
32
|
+
if (typeof children === "string") {
|
|
33
|
+
return children;
|
|
34
|
+
}
|
|
35
|
+
if (typeof children === "object") {
|
|
36
|
+
return Children.toArray(children).filter(node => typeof node === "string").at(0);
|
|
37
|
+
}
|
|
38
|
+
return undefined;
|
|
39
|
+
}, [children]);
|
|
40
|
+
|
|
41
|
+
// Extract custom RemoveButton from children if present
|
|
42
|
+
const [childrenWithoutRemoveButton, removeButtonChildren] = useMemo(() => {
|
|
43
|
+
if (typeof children === "function") {
|
|
44
|
+
return [children, undefined];
|
|
45
|
+
}
|
|
46
|
+
return pickChildren(children, TagRemoveButton);
|
|
47
|
+
}, [children]);
|
|
48
|
+
return /*#__PURE__*/jsx(Tag, {
|
|
49
|
+
className: composeTwRenderProps(className, slots.base()),
|
|
50
|
+
"data-slot": "tag",
|
|
51
|
+
textValue: textValue,
|
|
52
|
+
...restProps,
|
|
53
|
+
children: renderProps => /*#__PURE__*/jsx(TagContext, {
|
|
54
|
+
value: {
|
|
55
|
+
slots
|
|
56
|
+
},
|
|
57
|
+
children: typeof children === "function" ? children(renderProps) : /*#__PURE__*/jsxs(Fragment, {
|
|
58
|
+
children: [childrenWithoutRemoveButton, !!renderProps.allowsRemoving && (removeButtonChildren && removeButtonChildren.length > 0 ? removeButtonChildren : /*#__PURE__*/jsx(TagRemoveButton, {}))]
|
|
59
|
+
})
|
|
60
|
+
})
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
/* -------------------------------------------------------------------------------------------------
|
|
65
|
+
* Tag Remove Button
|
|
66
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
67
|
+
|
|
68
|
+
const TagRemoveButton = ({
|
|
69
|
+
children,
|
|
70
|
+
className,
|
|
71
|
+
...restProps
|
|
72
|
+
}) => {
|
|
73
|
+
const {
|
|
74
|
+
slots
|
|
75
|
+
} = useContext(TagContext);
|
|
76
|
+
return /*#__PURE__*/jsx(CloseButton, {
|
|
77
|
+
className: composeTwRenderProps(className, slots?.removeButton()),
|
|
78
|
+
"data-slot": "tag-remove-button",
|
|
79
|
+
slot: "remove",
|
|
80
|
+
...restProps,
|
|
81
|
+
children: children
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export { TagRemoveButton, TagRoot };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { TagGroupContext, TagGroupList, TagGroupRoot } from "./tag-group";
|
|
3
|
+
export declare const TagGroup: (({ children, className, size, variant, ...restProps }: import("./tag-group").TagGroupRootProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
4
|
+
Root: ({ children, className, size, variant, ...restProps }: import("./tag-group").TagGroupRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
List: <T extends object>({ children, className, ...restProps }: import("./tag-group").TagGroupListProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
};
|
|
7
|
+
export type TagGroup = {
|
|
8
|
+
Props: ComponentProps<typeof TagGroupRoot>;
|
|
9
|
+
RootProps: ComponentProps<typeof TagGroupRoot>;
|
|
10
|
+
ListProps: ComponentProps<typeof TagGroupList>;
|
|
11
|
+
};
|
|
12
|
+
export { TagGroupRoot, TagGroupList, TagGroupContext };
|
|
13
|
+
export type { TagGroupRootProps, TagGroupRootProps as TagGroupProps, TagGroupListProps, } from "./tag-group";
|
|
14
|
+
export { tagGroupVariants } from "@masaraxui/styles";
|
|
15
|
+
export type { TagGroupVariants } from "@masaraxui/styles";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { TagGroupRoot, TagGroupList } from './tag-group.js';
|
|
3
|
+
export { TagGroupContext } from './tag-group.js';
|
|
4
|
+
export { tagGroupVariants } from '@masaraxui/styles';
|
|
5
|
+
|
|
6
|
+
/* -------------------------------------------------------------------------------------------------
|
|
7
|
+
* Compound Component
|
|
8
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
9
|
+
const TagGroup = Object.assign(TagGroupRoot, {
|
|
10
|
+
Root: TagGroupRoot,
|
|
11
|
+
List: TagGroupList
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export { TagGroup, TagGroupList, TagGroupRoot };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { TagVariants } from "../tag";
|
|
2
|
+
import type { ComponentPropsWithRef } from "react";
|
|
3
|
+
import { tagGroupVariants } from "@masaraxui/styles";
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { TagGroup as TagGroupPrimitive, TagList as TagListPrimitive } from "react-aria-components";
|
|
6
|
+
type TagGroupContext = {
|
|
7
|
+
slots?: ReturnType<typeof tagGroupVariants>;
|
|
8
|
+
size?: TagVariants["size"];
|
|
9
|
+
variant?: TagVariants["variant"];
|
|
10
|
+
};
|
|
11
|
+
declare const TagGroupContext: React.Context<TagGroupContext>;
|
|
12
|
+
type TagGroupRootProps = ComponentPropsWithRef<typeof TagGroupPrimitive> & {
|
|
13
|
+
size?: TagVariants["size"];
|
|
14
|
+
variant?: TagVariants["variant"];
|
|
15
|
+
};
|
|
16
|
+
declare const TagGroupRoot: ({ children, className, size, variant, ...restProps }: TagGroupRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
type TagGroupListProps<T extends object> = ComponentPropsWithRef<typeof TagListPrimitive<T>> & {};
|
|
18
|
+
declare const TagGroupList: <T extends object>({ children, className, ...restProps }: TagGroupListProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export { TagGroupRoot, TagGroupList, TagGroupContext };
|
|
20
|
+
export type { TagGroupRootProps, TagGroupListProps };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { tagGroupVariants } from '@masaraxui/styles';
|
|
3
|
+
import { useMemo, createContext, useContext } from 'react';
|
|
4
|
+
import { TagGroup, TagList } from 'react-aria-components';
|
|
5
|
+
import { composeTwRenderProps } from '../../utils/compose.js';
|
|
6
|
+
import { jsx } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
const TagGroupContext = /*#__PURE__*/createContext({});
|
|
9
|
+
|
|
10
|
+
/* -------------------------------------------------------------------------------------------------
|
|
11
|
+
* TagGroup Root
|
|
12
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
13
|
+
|
|
14
|
+
const TagGroupRoot = ({
|
|
15
|
+
children,
|
|
16
|
+
className,
|
|
17
|
+
size,
|
|
18
|
+
variant,
|
|
19
|
+
...restProps
|
|
20
|
+
}) => {
|
|
21
|
+
const slots = useMemo(() => tagGroupVariants(), []);
|
|
22
|
+
return /*#__PURE__*/jsx(TagGroupContext, {
|
|
23
|
+
value: {
|
|
24
|
+
slots,
|
|
25
|
+
size,
|
|
26
|
+
variant
|
|
27
|
+
},
|
|
28
|
+
children: /*#__PURE__*/jsx(TagGroup, {
|
|
29
|
+
className: slots.base({
|
|
30
|
+
className
|
|
31
|
+
}),
|
|
32
|
+
"data-slot": "tag-group",
|
|
33
|
+
...restProps,
|
|
34
|
+
children: children
|
|
35
|
+
})
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/* -------------------------------------------------------------------------------------------------
|
|
40
|
+
* TagGroup List
|
|
41
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
42
|
+
|
|
43
|
+
const TagGroupList = ({
|
|
44
|
+
children,
|
|
45
|
+
className,
|
|
46
|
+
...restProps
|
|
47
|
+
}) => {
|
|
48
|
+
const {
|
|
49
|
+
slots
|
|
50
|
+
} = useContext(TagGroupContext);
|
|
51
|
+
return /*#__PURE__*/jsx(TagList, {
|
|
52
|
+
className: composeTwRenderProps(className, slots?.list()),
|
|
53
|
+
"data-slot": "tag-group-list",
|
|
54
|
+
...restProps,
|
|
55
|
+
children: children
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export { TagGroupContext, TagGroupList, TagGroupRoot };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { TextRoot } from "./text";
|
|
3
|
+
export declare const Text: (({ children, className, size, variant, ...rest }: import("./text").TextRootProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
4
|
+
Root: ({ children, className, size, variant, ...rest }: import("./text").TextRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
};
|
|
6
|
+
export type Text = {
|
|
7
|
+
Props: ComponentProps<typeof TextRoot>;
|
|
8
|
+
RootProps: ComponentProps<typeof TextRoot>;
|
|
9
|
+
};
|
|
10
|
+
export { TextRoot };
|
|
11
|
+
export type { TextRootProps, TextRootProps as TextProps } from "./text";
|
|
12
|
+
export { textVariants } from "@masaraxui/styles";
|
|
13
|
+
export type { TextVariants } from "@masaraxui/styles";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { TextRoot } from './text.js';
|
|
3
|
+
export { textVariants } from '@masaraxui/styles';
|
|
4
|
+
|
|
5
|
+
/* -------------------------------------------------------------------------------------------------
|
|
6
|
+
* Compound Component
|
|
7
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
8
|
+
const Text = Object.assign(TextRoot, {
|
|
9
|
+
Root: TextRoot
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export { Text, TextRoot };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { TextVariants } from "@masaraxui/styles";
|
|
2
|
+
import type { ComponentPropsWithRef } from "react";
|
|
3
|
+
import { Text as TextPrimitive } from "react-aria-components";
|
|
4
|
+
interface TextRootProps extends ComponentPropsWithRef<typeof TextPrimitive>, TextVariants {
|
|
5
|
+
}
|
|
6
|
+
declare const TextRoot: ({ children, className, size, variant, ...rest }: TextRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export { TextRoot };
|
|
8
|
+
export type { TextRootProps };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { textVariants } from '@masaraxui/styles';
|
|
3
|
+
import { Text } from 'react-aria-components';
|
|
4
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
const TextRoot = ({
|
|
7
|
+
children,
|
|
8
|
+
className,
|
|
9
|
+
size,
|
|
10
|
+
variant,
|
|
11
|
+
...rest
|
|
12
|
+
}) => {
|
|
13
|
+
const styles = textVariants({
|
|
14
|
+
size,
|
|
15
|
+
variant,
|
|
16
|
+
className
|
|
17
|
+
});
|
|
18
|
+
return /*#__PURE__*/jsx(Text, {
|
|
19
|
+
className: styles,
|
|
20
|
+
...rest,
|
|
21
|
+
children: children
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export { TextRoot };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { TextAreaRoot } from "./textarea";
|
|
3
|
+
export declare const TextArea: (({ className, fullWidth, variant, ...rest }: import("./textarea").TextAreaRootProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
4
|
+
Root: ({ className, fullWidth, variant, ...rest }: import("./textarea").TextAreaRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
};
|
|
6
|
+
export type TextArea = {
|
|
7
|
+
Props: ComponentProps<typeof TextAreaRoot>;
|
|
8
|
+
RootProps: ComponentProps<typeof TextAreaRoot>;
|
|
9
|
+
};
|
|
10
|
+
export { TextAreaRoot };
|
|
11
|
+
export type { TextAreaRootProps, TextAreaRootProps as TextAreaProps } from "./textarea";
|
|
12
|
+
export { textAreaVariants } from "@masaraxui/styles";
|
|
13
|
+
export type { TextAreaVariants } from "@masaraxui/styles";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { TextAreaRoot } from './textarea.js';
|
|
3
|
+
export { textAreaVariants } from '@masaraxui/styles';
|
|
4
|
+
|
|
5
|
+
/* -------------------------------------------------------------------------------------------------
|
|
6
|
+
* Compound Component
|
|
7
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
8
|
+
const TextArea = Object.assign(TextAreaRoot, {
|
|
9
|
+
Root: TextAreaRoot
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export { TextArea, TextAreaRoot };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { TextAreaVariants } from "@masaraxui/styles";
|
|
2
|
+
import type { ComponentPropsWithRef } from "react";
|
|
3
|
+
import { TextArea as TextAreaPrimitive } from "react-aria-components";
|
|
4
|
+
interface TextAreaRootProps extends ComponentPropsWithRef<typeof TextAreaPrimitive>, TextAreaVariants {
|
|
5
|
+
}
|
|
6
|
+
declare const TextAreaRoot: ({ className, fullWidth, variant, ...rest }: TextAreaRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export { TextAreaRoot };
|
|
8
|
+
export type { TextAreaRootProps };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { textAreaVariants } from '@masaraxui/styles';
|
|
3
|
+
import { useContext } from 'react';
|
|
4
|
+
import { TextArea } from 'react-aria-components';
|
|
5
|
+
import { jsx } from 'react/jsx-runtime';
|
|
6
|
+
import { TextFieldContext } from '../textfield/textfield.js';
|
|
7
|
+
import { composeTwRenderProps } from '../../utils/compose.js';
|
|
8
|
+
|
|
9
|
+
const TextAreaRoot = ({
|
|
10
|
+
className,
|
|
11
|
+
fullWidth,
|
|
12
|
+
variant,
|
|
13
|
+
...rest
|
|
14
|
+
}) => {
|
|
15
|
+
const textFieldContext = useContext(TextFieldContext);
|
|
16
|
+
const resolvedVariant = variant ?? textFieldContext?.variant;
|
|
17
|
+
return /*#__PURE__*/jsx(TextArea, {
|
|
18
|
+
"data-slot": "textarea",
|
|
19
|
+
className: composeTwRenderProps(className, textAreaVariants({
|
|
20
|
+
fullWidth,
|
|
21
|
+
variant: resolvedVariant
|
|
22
|
+
})),
|
|
23
|
+
...rest
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export { TextAreaRoot };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { TextFieldRoot } from "./textfield";
|
|
3
|
+
export declare const TextField: (({ children, className, fullWidth, variant, ...props }: import("./textfield").TextFieldRootProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
4
|
+
Root: ({ children, className, fullWidth, variant, ...props }: import("./textfield").TextFieldRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
};
|
|
6
|
+
export type TextField = {
|
|
7
|
+
Props: ComponentProps<typeof TextFieldRoot>;
|
|
8
|
+
RootProps: ComponentProps<typeof TextFieldRoot>;
|
|
9
|
+
};
|
|
10
|
+
export { TextFieldRoot };
|
|
11
|
+
export type { TextFieldRootProps, TextFieldRootProps as TextFieldProps } from "./textfield";
|
|
12
|
+
export { TextFieldContext } from "./textfield";
|
|
13
|
+
export { textFieldVariants } from "@masaraxui/styles";
|
|
14
|
+
export type { TextFieldVariants } from "@masaraxui/styles";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { TextFieldRoot } from './textfield.js';
|
|
3
|
+
export { TextFieldContext } from './textfield.js';
|
|
4
|
+
export { textFieldVariants } from '@masaraxui/styles';
|
|
5
|
+
|
|
6
|
+
/* -------------------------------------------------------------------------------------------------
|
|
7
|
+
* Compound Component
|
|
8
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
9
|
+
const TextField = Object.assign(TextFieldRoot, {
|
|
10
|
+
Root: TextFieldRoot
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export { TextField, TextFieldRoot };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { TextFieldVariants } from "@masaraxui/styles";
|
|
2
|
+
import type { ComponentPropsWithRef } from "react";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { TextField as TextFieldPrimitive } from "react-aria-components";
|
|
5
|
+
type TextFieldContext = {
|
|
6
|
+
variant?: "primary" | "secondary";
|
|
7
|
+
};
|
|
8
|
+
declare const TextFieldContext: React.Context<TextFieldContext>;
|
|
9
|
+
interface TextFieldRootProps extends ComponentPropsWithRef<typeof TextFieldPrimitive>, TextFieldVariants {
|
|
10
|
+
/**
|
|
11
|
+
* The variant of the text field.
|
|
12
|
+
* @default "primary"
|
|
13
|
+
*/
|
|
14
|
+
variant?: "primary" | "secondary";
|
|
15
|
+
}
|
|
16
|
+
declare const TextFieldRoot: ({ children, className, fullWidth, variant, ...props }: TextFieldRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export { TextFieldRoot, TextFieldContext };
|
|
18
|
+
export type { TextFieldRootProps };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { textFieldVariants } from '@masaraxui/styles';
|
|
3
|
+
import React__default, { createContext } from 'react';
|
|
4
|
+
import { TextField } from 'react-aria-components';
|
|
5
|
+
import { composeTwRenderProps } from '../../utils/compose.js';
|
|
6
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
const TextFieldContext = /*#__PURE__*/createContext({});
|
|
9
|
+
|
|
10
|
+
/* -------------------------------------------------------------------------------------------------
|
|
11
|
+
* TextField Root
|
|
12
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
13
|
+
|
|
14
|
+
const TextFieldRoot = ({
|
|
15
|
+
children,
|
|
16
|
+
className,
|
|
17
|
+
fullWidth,
|
|
18
|
+
variant,
|
|
19
|
+
...props
|
|
20
|
+
}) => {
|
|
21
|
+
const styles = React__default.useMemo(() => textFieldVariants({
|
|
22
|
+
fullWidth
|
|
23
|
+
}), [fullWidth]);
|
|
24
|
+
return /*#__PURE__*/jsx(TextField, {
|
|
25
|
+
"data-slot": "textfield",
|
|
26
|
+
...props,
|
|
27
|
+
className: composeTwRenderProps(className, styles),
|
|
28
|
+
children: values => /*#__PURE__*/jsx(TextFieldContext, {
|
|
29
|
+
value: {
|
|
30
|
+
variant
|
|
31
|
+
},
|
|
32
|
+
children: /*#__PURE__*/jsx(Fragment, {
|
|
33
|
+
children: typeof children === "function" ? children(values) : children
|
|
34
|
+
})
|
|
35
|
+
})
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export { TextFieldContext, TextFieldRoot };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { DateInputGroupInput, DateInputGroupInputContainer, DateInputGroupPrefix, DateInputGroupRoot, DateInputGroupSegment, DateInputGroupSuffix } from "../date-input-group";
|
|
3
|
+
import { TimeFieldRoot } from "./time-field";
|
|
4
|
+
export declare const TimeField: typeof TimeFieldRoot & {
|
|
5
|
+
Root: typeof TimeFieldRoot;
|
|
6
|
+
Group: ({ children, className, fullWidth, variant, ...props }: import("../date-input-group").DateInputGroupRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
Input: ({ className, ...props }: import("../date-input-group").DateInputGroupInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
InputContainer: ({ children, className, ...props }: import("../date-input-group").DateInputGroupInputContainerProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
Segment: ({ className, segment, ...props }: import("../date-input-group").DateInputGroupSegmentProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
Prefix: ({ children, className, ...props }: import("../date-input-group").DateInputGroupPrefixProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
Suffix: ({ children, className, ...props }: import("../date-input-group").DateInputGroupSuffixProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
};
|
|
13
|
+
export type TimeField = {
|
|
14
|
+
Props: ComponentProps<typeof TimeFieldRoot>;
|
|
15
|
+
RootProps: ComponentProps<typeof TimeFieldRoot>;
|
|
16
|
+
GroupProps: ComponentProps<typeof DateInputGroupRoot>;
|
|
17
|
+
InputProps: ComponentProps<typeof DateInputGroupInput>;
|
|
18
|
+
InputContainerProps: ComponentProps<typeof DateInputGroupInputContainer>;
|
|
19
|
+
SegmentProps: ComponentProps<typeof DateInputGroupSegment>;
|
|
20
|
+
PrefixProps: ComponentProps<typeof DateInputGroupPrefix>;
|
|
21
|
+
SuffixProps: ComponentProps<typeof DateInputGroupSuffix>;
|
|
22
|
+
};
|
|
23
|
+
export { TimeFieldRoot };
|
|
24
|
+
export type { TimeFieldRootProps, TimeFieldRootProps as TimeFieldProps } from "./time-field";
|
|
25
|
+
export { timeFieldVariants } from "@masaraxui/styles";
|
|
26
|
+
export type { TimeFieldVariants } from "@masaraxui/styles";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import '../date-input-group/index.js';
|
|
3
|
+
import { TimeFieldRoot } from './time-field.js';
|
|
4
|
+
export { timeFieldVariants } from '@masaraxui/styles';
|
|
5
|
+
import { DateInputGroupSuffix, DateInputGroupPrefix, DateInputGroupSegment, DateInputGroupInputContainer, DateInputGroupInput, DateInputGroupRoot } from '../date-input-group/date-input-group.js';
|
|
6
|
+
|
|
7
|
+
/* -------------------------------------------------------------------------------------------------
|
|
8
|
+
* Compound Component
|
|
9
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
10
|
+
const TimeField = Object.assign(TimeFieldRoot, {
|
|
11
|
+
Root: TimeFieldRoot,
|
|
12
|
+
Group: DateInputGroupRoot,
|
|
13
|
+
Input: DateInputGroupInput,
|
|
14
|
+
InputContainer: DateInputGroupInputContainer,
|
|
15
|
+
Segment: DateInputGroupSegment,
|
|
16
|
+
Prefix: DateInputGroupPrefix,
|
|
17
|
+
Suffix: DateInputGroupSuffix
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export { TimeField, TimeFieldRoot };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { TimeFieldVariants } from "@masaraxui/styles";
|
|
2
|
+
import type { ComponentPropsWithRef } from "react";
|
|
3
|
+
import type { TimeValue } from "react-aria-components";
|
|
4
|
+
import { TimeField as TimeFieldPrimitive } from "react-aria-components";
|
|
5
|
+
interface TimeFieldRootProps<T extends TimeValue> extends ComponentPropsWithRef<typeof TimeFieldPrimitive<T>>, TimeFieldVariants {
|
|
6
|
+
}
|
|
7
|
+
declare function TimeFieldRoot<T extends TimeValue>({ children, className, fullWidth, ...props }: TimeFieldRootProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export { TimeFieldRoot };
|
|
9
|
+
export type { TimeFieldRootProps };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { timeFieldVariants } from '@masaraxui/styles';
|
|
3
|
+
import React__default from 'react';
|
|
4
|
+
import { TimeField } 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 TimeFieldRoot({
|
|
10
|
+
children,
|
|
11
|
+
className,
|
|
12
|
+
fullWidth,
|
|
13
|
+
...props
|
|
14
|
+
}) {
|
|
15
|
+
const styles = React__default.useMemo(() => timeFieldVariants({
|
|
16
|
+
fullWidth
|
|
17
|
+
}), [fullWidth]);
|
|
18
|
+
return /*#__PURE__*/jsx(TimeField, {
|
|
19
|
+
"data-required": dataAttr(props.isRequired),
|
|
20
|
+
"data-slot": "time-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 { TimeFieldRoot };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const DEFAULT_GAP = 12;
|
|
2
|
+
export declare const DEFAULT_MAX_VISIBLE_TOAST = 3;
|
|
3
|
+
export declare const DEFAULT_RAC_MAX_VISIBLE_TOAST: number;
|
|
4
|
+
export declare const DEFAULT_SCALE_FACTOR = 0.05;
|
|
5
|
+
export declare const DEFAULT_TOAST_WIDTH = 460;
|
|
6
|
+
export declare const DEFAULT_TOAST_TIMEOUT = 4000;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Default gap between toasts
|
|
3
|
+
const DEFAULT_GAP = 12;
|
|
4
|
+
// The default maximum number of visible toasts (visual only).
|
|
5
|
+
const DEFAULT_MAX_VISIBLE_TOAST = 3;
|
|
6
|
+
// The maximum number of toasts to render in the RAC queue.
|
|
7
|
+
const DEFAULT_RAC_MAX_VISIBLE_TOAST = Number.MAX_SAFE_INTEGER;
|
|
8
|
+
// The default scale factor for toasts.
|
|
9
|
+
const DEFAULT_SCALE_FACTOR = 0.05;
|
|
10
|
+
// The default width of the toast.
|
|
11
|
+
const DEFAULT_TOAST_WIDTH = 460;
|
|
12
|
+
// The default timeout for toasts in milliseconds (matches sonner's default).
|
|
13
|
+
const DEFAULT_TOAST_TIMEOUT = 4000;
|
|
14
|
+
|
|
15
|
+
export { DEFAULT_GAP, DEFAULT_MAX_VISIBLE_TOAST, DEFAULT_RAC_MAX_VISIBLE_TOAST, DEFAULT_SCALE_FACTOR, DEFAULT_TOAST_TIMEOUT, DEFAULT_TOAST_WIDTH };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { ToastActionButton, ToastCloseButton, ToastContent, ToastDescription, ToastIndicator, ToastProvider, Toast as ToastRoot, ToastTitle } from "./toast";
|
|
3
|
+
import { ToastQueue, toast, toastQueue } from "./toast-queue";
|
|
4
|
+
export declare const Toast: {
|
|
5
|
+
<T extends object = import("./toast-queue").ToastContentValue>({ children, className, placement, scaleFactor, toast, variant, ...rest }: import("./toast").ToastProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
displayName: string;
|
|
7
|
+
} & {
|
|
8
|
+
Provider: {
|
|
9
|
+
<T extends object = import("./toast-queue").ToastContentValue>({ children, className, gap, maxVisibleToasts, placement, queue: queueProp, scaleFactor, width, ...rest }: import("./toast").ToastProviderProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|
|
12
|
+
Content: ({ children, className, ...rest }: import("./toast").ToastContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
Indicator: {
|
|
14
|
+
({ children, className, variant, ...rest }: import("./toast").ToastIndicatorProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
displayName: string;
|
|
16
|
+
};
|
|
17
|
+
Title: {
|
|
18
|
+
({ children, className, ...rest }: import("./toast").ToastTitleProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
displayName: string;
|
|
20
|
+
};
|
|
21
|
+
Description: {
|
|
22
|
+
({ children, className, ...rest }: import("./toast").ToastDescriptionProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
displayName: string;
|
|
24
|
+
};
|
|
25
|
+
ActionButton: {
|
|
26
|
+
({ children, className, ...rest }: import("./toast").ToastActionButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
displayName: string;
|
|
28
|
+
};
|
|
29
|
+
CloseButton: {
|
|
30
|
+
({ className, ...rest }: import("./toast").ToastCloseButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
displayName: string;
|
|
32
|
+
};
|
|
33
|
+
Queue: typeof ToastQueue;
|
|
34
|
+
toast: {
|
|
35
|
+
(message: import("react").ReactNode, options?: import("./toast-queue").MasaraxUIToastOptions): string;
|
|
36
|
+
success(message: import("react").ReactNode, options?: Omit<import("./toast-queue").MasaraxUIToastOptions, "variant">): string;
|
|
37
|
+
danger(message: import("react").ReactNode, options?: Omit<import("./toast-queue").MasaraxUIToastOptions, "variant">): string;
|
|
38
|
+
info(message: import("react").ReactNode, options?: Omit<import("./toast-queue").MasaraxUIToastOptions, "variant">): string;
|
|
39
|
+
warning(message: import("react").ReactNode, options?: Omit<import("./toast-queue").MasaraxUIToastOptions, "variant">): string;
|
|
40
|
+
promise<T>(promise: Promise<T> | (() => Promise<T>), options: import("./toast-queue").ToastPromiseOptions<T>): string;
|
|
41
|
+
getQueue(): import("react-aria-components").UNSTABLE_ToastQueue<import("./toast-queue").ToastContentValue>;
|
|
42
|
+
close(key: string): void;
|
|
43
|
+
pauseAll(): void;
|
|
44
|
+
resumeAll(): void;
|
|
45
|
+
clear(): void;
|
|
46
|
+
} & {
|
|
47
|
+
success: (message: import("react").ReactNode, options?: Omit<import("./toast-queue").MasaraxUIToastOptions, "variant">) => string;
|
|
48
|
+
danger: (message: import("react").ReactNode, options?: Omit<import("./toast-queue").MasaraxUIToastOptions, "variant">) => string;
|
|
49
|
+
info: (message: import("react").ReactNode, options?: Omit<import("./toast-queue").MasaraxUIToastOptions, "variant">) => string;
|
|
50
|
+
warning: (message: import("react").ReactNode, options?: Omit<import("./toast-queue").MasaraxUIToastOptions, "variant">) => string;
|
|
51
|
+
promise: <T>(promise: Promise<T> | (() => Promise<T>), options: import("./toast-queue").ToastPromiseOptions<T>) => string;
|
|
52
|
+
getQueue: () => ReturnType<() => import("react-aria-components").UNSTABLE_ToastQueue<import("./toast-queue").ToastContentValue>>;
|
|
53
|
+
close: (key: string) => void;
|
|
54
|
+
pauseAll: () => void;
|
|
55
|
+
resumeAll: () => void;
|
|
56
|
+
clear: () => void;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
export type Toast = {
|
|
60
|
+
Props: ComponentProps<typeof ToastRoot>;
|
|
61
|
+
ProviderProps: ComponentProps<typeof ToastProvider>;
|
|
62
|
+
ContentProps: ComponentProps<typeof ToastContent>;
|
|
63
|
+
IndicatorProps: ComponentProps<typeof ToastIndicator>;
|
|
64
|
+
TitleProps: ComponentProps<typeof ToastTitle>;
|
|
65
|
+
DescriptionProps: ComponentProps<typeof ToastDescription>;
|
|
66
|
+
ActionProps: ComponentProps<typeof ToastActionButton>;
|
|
67
|
+
CloseButtonProps: ComponentProps<typeof ToastCloseButton>;
|
|
68
|
+
};
|
|
69
|
+
export { ToastProvider, ToastContent, ToastIndicator, ToastTitle, ToastDescription, ToastActionButton, ToastCloseButton, };
|
|
70
|
+
export type { ToastCloseButtonProps, ToastProviderProps, ToastContentProps, ToastDescriptionProps, ToastIndicatorProps, ToastProps, ToastTitleProps, } from "./toast";
|
|
71
|
+
export { toastVariants } from "@masaraxui/styles";
|
|
72
|
+
export type { ToastVariants } from "@masaraxui/styles";
|
|
73
|
+
export { ToastQueue, toast, toastQueue };
|
|
74
|
+
export { DEFAULT_MAX_VISIBLE_TOAST, DEFAULT_GAP, DEFAULT_TOAST_TIMEOUT } from "./constants";
|
|
75
|
+
export type { ToastQueueOptions, ToastContentValue } from "./toast-queue";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { Toast as Toast$1, ToastCloseButton, ToastActionButton, ToastDescription, ToastTitle, ToastIndicator, ToastContent, ToastProvider } from './toast.js';
|
|
3
|
+
import { toast, ToastQueue } from './toast-queue.js';
|
|
4
|
+
export { toastQueue } from './toast-queue.js';
|
|
5
|
+
export { toastVariants } from '@masaraxui/styles';
|
|
6
|
+
export { DEFAULT_GAP, DEFAULT_MAX_VISIBLE_TOAST, DEFAULT_TOAST_TIMEOUT } from './constants.js';
|
|
7
|
+
|
|
8
|
+
/* -------------------------------------------------------------------------------------------------
|
|
9
|
+
* Compound Component
|
|
10
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
11
|
+
const Toast = Object.assign(Toast$1, {
|
|
12
|
+
Provider: ToastProvider,
|
|
13
|
+
Content: ToastContent,
|
|
14
|
+
Indicator: ToastIndicator,
|
|
15
|
+
Title: ToastTitle,
|
|
16
|
+
Description: ToastDescription,
|
|
17
|
+
ActionButton: ToastActionButton,
|
|
18
|
+
CloseButton: ToastCloseButton,
|
|
19
|
+
Queue: ToastQueue,
|
|
20
|
+
toast
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export { Toast, ToastActionButton, ToastCloseButton, ToastContent, ToastDescription, ToastIndicator, ToastProvider, ToastQueue, ToastTitle, toast };
|