@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,33 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { ModalBackdrop, ModalBody, ModalCloseTrigger, ModalContainer, ModalDialog, ModalFooter, ModalHeader, ModalHeading, ModalIcon, ModalRoot, ModalTrigger } from "./modal";
|
|
3
|
+
export declare const Modal: (({ children, state, ...props }: import("./modal").ModalRootProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
4
|
+
Root: ({ children, state, ...props }: import("./modal").ModalRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
Trigger: ({ children, className, ...props }: import("./modal").ModalTriggerProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
Backdrop: ({ children, className, isDismissable, onClick, variant, ...props }: import("./modal").ModalBackdropProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
Container: ({ children, className, placement, scroll, size, ...props }: import("./modal").ModalContainerProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
Dialog: ({ children, className, ...props }: import("./modal").ModalDialogProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
Header: ({ children, className, ...props }: import("./modal").ModalHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
Icon: ({ children, className, ...props }: import("./modal").ModalIconProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
Heading: ({ children, className, ...props }: import("./modal").ModalHeadingProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
Body: ({ children, className, ...props }: import("./modal").ModalBodyProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
Footer: ({ children, className, ...props }: import("./modal").ModalFooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
CloseTrigger: ({ className, ...rest }: import("./modal").ModalCloseTriggerProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
};
|
|
16
|
+
export type Modal = {
|
|
17
|
+
Props: ComponentProps<typeof ModalRoot>;
|
|
18
|
+
RootProps: ComponentProps<typeof ModalRoot>;
|
|
19
|
+
TriggerProps: ComponentProps<typeof ModalTrigger>;
|
|
20
|
+
BackdropProps: ComponentProps<typeof ModalBackdrop>;
|
|
21
|
+
ContainerProps: ComponentProps<typeof ModalContainer>;
|
|
22
|
+
DialogProps: ComponentProps<typeof ModalDialog>;
|
|
23
|
+
HeaderProps: ComponentProps<typeof ModalHeader>;
|
|
24
|
+
IconProps: ComponentProps<typeof ModalIcon>;
|
|
25
|
+
HeadingProps: ComponentProps<typeof ModalHeading>;
|
|
26
|
+
BodyProps: ComponentProps<typeof ModalBody>;
|
|
27
|
+
FooterProps: ComponentProps<typeof ModalFooter>;
|
|
28
|
+
CloseTriggerProps: ComponentProps<typeof ModalCloseTrigger>;
|
|
29
|
+
};
|
|
30
|
+
export { ModalRoot, ModalTrigger, ModalBackdrop, ModalContainer, ModalDialog, ModalHeader, ModalIcon, ModalHeading, ModalBody, ModalFooter, ModalCloseTrigger, };
|
|
31
|
+
export type { ModalRootProps, ModalRootProps as ModalProps, ModalTriggerProps, ModalBackdropProps, ModalContainerProps, ModalDialogProps, ModalHeaderProps, ModalIconProps, ModalHeadingProps, ModalBodyProps, ModalFooterProps, ModalCloseTriggerProps, } from "./modal";
|
|
32
|
+
export { modalVariants } from "@masaraxui/styles";
|
|
33
|
+
export type { ModalVariants } from "@masaraxui/styles";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { ModalRoot, ModalCloseTrigger, ModalFooter, ModalBody, ModalHeading, ModalIcon, ModalHeader, ModalDialog, ModalContainer, ModalBackdrop, ModalTrigger } from './modal.js';
|
|
3
|
+
export { modalVariants } from '@masaraxui/styles';
|
|
4
|
+
|
|
5
|
+
/* -------------------------------------------------------------------------------------------------
|
|
6
|
+
* Compound Component
|
|
7
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
8
|
+
const Modal = Object.assign(ModalRoot, {
|
|
9
|
+
Root: ModalRoot,
|
|
10
|
+
Trigger: ModalTrigger,
|
|
11
|
+
Backdrop: ModalBackdrop,
|
|
12
|
+
Container: ModalContainer,
|
|
13
|
+
Dialog: ModalDialog,
|
|
14
|
+
Header: ModalHeader,
|
|
15
|
+
Icon: ModalIcon,
|
|
16
|
+
Heading: ModalHeading,
|
|
17
|
+
Body: ModalBody,
|
|
18
|
+
Footer: ModalFooter,
|
|
19
|
+
CloseTrigger: ModalCloseTrigger
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export { Modal, ModalBackdrop, ModalBody, ModalCloseTrigger, ModalContainer, ModalDialog, ModalFooter, ModalHeader, ModalHeading, ModalIcon, ModalRoot, ModalTrigger };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { UseOverlayStateReturn } from "../../hooks/use-overlay-state";
|
|
2
|
+
import type { ModalVariants } from "@masaraxui/styles";
|
|
3
|
+
import type { ComponentPropsWithRef, ReactNode } from "react";
|
|
4
|
+
import type { Button as ButtonPrimitive, DialogProps as DialogPrimitiveProps } from "react-aria-components";
|
|
5
|
+
import { Heading as HeadingPrimitive, ModalOverlay as ModalOverlayPrimitive, Modal as ModalPrimitive, DialogTrigger as ModalTriggerPrimitive } from "react-aria-components";
|
|
6
|
+
type ModalPlacement = "auto" | "top" | "center" | "bottom";
|
|
7
|
+
interface ModalRootProps extends ComponentPropsWithRef<typeof ModalTriggerPrimitive> {
|
|
8
|
+
state?: UseOverlayStateReturn;
|
|
9
|
+
}
|
|
10
|
+
declare const ModalRoot: ({ children, state, ...props }: ModalRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
interface ModalTriggerProps extends ComponentPropsWithRef<"div"> {
|
|
12
|
+
}
|
|
13
|
+
declare const ModalTrigger: ({ children, className, ...props }: ModalTriggerProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
interface ModalBackdropProps extends ComponentPropsWithRef<typeof ModalOverlayPrimitive> {
|
|
15
|
+
variant?: ModalVariants["variant"];
|
|
16
|
+
/**
|
|
17
|
+
* Whether to close the modal when the user interacts outside it.
|
|
18
|
+
* @default true
|
|
19
|
+
*/
|
|
20
|
+
isDismissable?: boolean;
|
|
21
|
+
}
|
|
22
|
+
declare const ModalBackdrop: ({ children, className, isDismissable, onClick, variant, ...props }: ModalBackdropProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
interface ModalContainerProps extends Omit<ComponentPropsWithRef<typeof ModalPrimitive>, Exclude<keyof ModalBackdropProps, "children" | "className">> {
|
|
24
|
+
placement?: ModalPlacement;
|
|
25
|
+
scroll?: ModalVariants["scroll"];
|
|
26
|
+
size?: ModalVariants["size"];
|
|
27
|
+
}
|
|
28
|
+
declare const ModalContainer: ({ children, className, placement, scroll, size, ...props }: ModalContainerProps) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
interface ModalDialogProps extends DialogPrimitiveProps {
|
|
30
|
+
}
|
|
31
|
+
declare const ModalDialog: ({ children, className, ...props }: ModalDialogProps) => import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
interface ModalHeaderProps extends ComponentPropsWithRef<"div"> {
|
|
33
|
+
}
|
|
34
|
+
declare const ModalHeader: ({ children, className, ...props }: ModalHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
interface ModalBodyProps extends ComponentPropsWithRef<"div"> {
|
|
36
|
+
}
|
|
37
|
+
declare const ModalBody: ({ children, className, ...props }: ModalBodyProps) => import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
interface ModalFooterProps extends ComponentPropsWithRef<"div"> {
|
|
39
|
+
}
|
|
40
|
+
declare const ModalFooter: ({ children, className, ...props }: ModalFooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
interface ModalHeadingProps extends ComponentPropsWithRef<typeof HeadingPrimitive> {
|
|
42
|
+
}
|
|
43
|
+
declare const ModalHeading: ({ children, className, ...props }: ModalHeadingProps) => import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
interface ModalIconProps extends ComponentPropsWithRef<"div"> {
|
|
45
|
+
}
|
|
46
|
+
declare const ModalIcon: ({ children, className, ...props }: ModalIconProps) => import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
interface ModalCloseTriggerProps extends ComponentPropsWithRef<typeof ButtonPrimitive> {
|
|
48
|
+
className?: string;
|
|
49
|
+
children?: ReactNode;
|
|
50
|
+
}
|
|
51
|
+
declare const ModalCloseTrigger: ({ className, ...rest }: ModalCloseTriggerProps) => import("react/jsx-runtime").JSX.Element;
|
|
52
|
+
export { ModalRoot, ModalTrigger, ModalBackdrop, ModalContainer, ModalDialog, ModalHeader, ModalIcon, ModalHeading, ModalBody, ModalFooter, ModalCloseTrigger, };
|
|
53
|
+
export type { ModalRootProps, ModalTriggerProps, ModalBackdropProps, ModalContainerProps, ModalDialogProps, ModalHeaderProps, ModalIconProps, ModalHeadingProps, ModalBodyProps, ModalFooterProps, ModalCloseTriggerProps, };
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { modalVariants } from '@masaraxui/styles';
|
|
3
|
+
import { mergeProps } from '@react-aria/utils';
|
|
4
|
+
import { useMemo, createContext, useContext } from 'react';
|
|
5
|
+
import { DialogTrigger, Heading, Dialog, Modal, ModalOverlay, Pressable } from 'react-aria-components';
|
|
6
|
+
import { composeTwRenderProps, composeSlotClassName } from '../../utils/compose.js';
|
|
7
|
+
import { CloseButton } from '../close-button/index.js';
|
|
8
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
9
|
+
import { SurfaceContext } from '../surface/surface.js';
|
|
10
|
+
|
|
11
|
+
const ModalContext = /*#__PURE__*/createContext({});
|
|
12
|
+
|
|
13
|
+
/* -------------------------------------------------------------------------------------------------
|
|
14
|
+
* Modal Root
|
|
15
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
16
|
+
|
|
17
|
+
const ModalRoot = ({
|
|
18
|
+
children,
|
|
19
|
+
state,
|
|
20
|
+
...props
|
|
21
|
+
}) => {
|
|
22
|
+
const modalContext = useMemo(() => ({
|
|
23
|
+
slots: modalVariants(),
|
|
24
|
+
placement: undefined
|
|
25
|
+
}), []);
|
|
26
|
+
const controlledProps = useMemo(() => state ? {
|
|
27
|
+
isOpen: state.isOpen,
|
|
28
|
+
onOpenChange: state.setOpen
|
|
29
|
+
} : {}, [state]);
|
|
30
|
+
return /*#__PURE__*/jsx(ModalContext, {
|
|
31
|
+
value: modalContext,
|
|
32
|
+
children: /*#__PURE__*/jsx(DialogTrigger, {
|
|
33
|
+
"data-slot": "modal-root",
|
|
34
|
+
...mergeProps(props, controlledProps),
|
|
35
|
+
children: children
|
|
36
|
+
})
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/* -------------------------------------------------------------------------------------------------
|
|
41
|
+
* Modal Trigger
|
|
42
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
43
|
+
|
|
44
|
+
const ModalTrigger = ({
|
|
45
|
+
children,
|
|
46
|
+
className,
|
|
47
|
+
...props
|
|
48
|
+
}) => {
|
|
49
|
+
const {
|
|
50
|
+
slots
|
|
51
|
+
} = useContext(ModalContext);
|
|
52
|
+
return /*#__PURE__*/jsx(Pressable, {
|
|
53
|
+
children: /*#__PURE__*/jsx("div", {
|
|
54
|
+
className: composeSlotClassName(slots?.trigger, className),
|
|
55
|
+
"data-slot": "modal-trigger",
|
|
56
|
+
role: "button",
|
|
57
|
+
...props,
|
|
58
|
+
children: children
|
|
59
|
+
})
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
/* -------------------------------------------------------------------------------------------------
|
|
64
|
+
* Modal Backdrop
|
|
65
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
66
|
+
|
|
67
|
+
const ModalBackdrop = ({
|
|
68
|
+
children,
|
|
69
|
+
className,
|
|
70
|
+
isDismissable = true,
|
|
71
|
+
onClick,
|
|
72
|
+
variant,
|
|
73
|
+
...props
|
|
74
|
+
}) => {
|
|
75
|
+
const {
|
|
76
|
+
slots: contextSlots
|
|
77
|
+
} = useContext(ModalContext);
|
|
78
|
+
const updatedSlots = useMemo(() => modalVariants({
|
|
79
|
+
variant
|
|
80
|
+
}), [variant]);
|
|
81
|
+
const updatedModalContext = useMemo(() => ({
|
|
82
|
+
slots: {
|
|
83
|
+
...contextSlots,
|
|
84
|
+
...updatedSlots
|
|
85
|
+
}
|
|
86
|
+
}), [contextSlots, updatedSlots]);
|
|
87
|
+
return /*#__PURE__*/jsx(ModalOverlay, {
|
|
88
|
+
className: composeTwRenderProps(className, updatedSlots?.backdrop()),
|
|
89
|
+
"data-slot": "modal-backdrop",
|
|
90
|
+
isDismissable: isDismissable,
|
|
91
|
+
onClick: e => {
|
|
92
|
+
e.stopPropagation();
|
|
93
|
+
onClick?.(e);
|
|
94
|
+
},
|
|
95
|
+
...props,
|
|
96
|
+
children: renderProps => /*#__PURE__*/jsxs(ModalContext, {
|
|
97
|
+
value: updatedModalContext,
|
|
98
|
+
children: [typeof children === "function" ? children(renderProps) : children, " "]
|
|
99
|
+
})
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
/* -------------------------------------------------------------------------------------------------
|
|
104
|
+
* Modal Container
|
|
105
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
106
|
+
|
|
107
|
+
const ModalContainer = ({
|
|
108
|
+
children,
|
|
109
|
+
className,
|
|
110
|
+
placement = "auto",
|
|
111
|
+
scroll,
|
|
112
|
+
size,
|
|
113
|
+
...props
|
|
114
|
+
}) => {
|
|
115
|
+
const {
|
|
116
|
+
slots: contextSlots
|
|
117
|
+
} = useContext(ModalContext);
|
|
118
|
+
const updatedSlots = useMemo(() => modalVariants({
|
|
119
|
+
scroll,
|
|
120
|
+
size
|
|
121
|
+
}), [scroll, size]);
|
|
122
|
+
const updatedModalContext = useMemo(() => ({
|
|
123
|
+
placement,
|
|
124
|
+
slots: {
|
|
125
|
+
...contextSlots,
|
|
126
|
+
...updatedSlots
|
|
127
|
+
}
|
|
128
|
+
}), [contextSlots, placement, updatedSlots]);
|
|
129
|
+
return /*#__PURE__*/jsx(Modal, {
|
|
130
|
+
className: composeTwRenderProps(className, updatedSlots?.container()),
|
|
131
|
+
"data-placement": placement,
|
|
132
|
+
"data-slot": "modal-container",
|
|
133
|
+
...props,
|
|
134
|
+
children: renderProps => /*#__PURE__*/jsx(ModalContext, {
|
|
135
|
+
value: updatedModalContext,
|
|
136
|
+
children: typeof children === "function" ? children(renderProps) : children
|
|
137
|
+
})
|
|
138
|
+
});
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
/* -------------------------------------------------------------------------------------------------
|
|
142
|
+
* Modal Dialog
|
|
143
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
144
|
+
|
|
145
|
+
const ModalDialog = ({
|
|
146
|
+
children,
|
|
147
|
+
className,
|
|
148
|
+
...props
|
|
149
|
+
}) => {
|
|
150
|
+
const {
|
|
151
|
+
placement,
|
|
152
|
+
slots
|
|
153
|
+
} = useContext(ModalContext);
|
|
154
|
+
return /*#__PURE__*/jsx(SurfaceContext, {
|
|
155
|
+
value: {
|
|
156
|
+
variant: "default"
|
|
157
|
+
},
|
|
158
|
+
children: /*#__PURE__*/jsx(Dialog, {
|
|
159
|
+
className: composeSlotClassName(slots?.dialog, className),
|
|
160
|
+
"data-placement": placement,
|
|
161
|
+
"data-slot": "modal-dialog",
|
|
162
|
+
...props,
|
|
163
|
+
children: children
|
|
164
|
+
})
|
|
165
|
+
});
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
/* -------------------------------------------------------------------------------------------------
|
|
169
|
+
* Modal Header
|
|
170
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
171
|
+
|
|
172
|
+
const ModalHeader = ({
|
|
173
|
+
children,
|
|
174
|
+
className,
|
|
175
|
+
...props
|
|
176
|
+
}) => {
|
|
177
|
+
const {
|
|
178
|
+
slots
|
|
179
|
+
} = useContext(ModalContext);
|
|
180
|
+
return /*#__PURE__*/jsx("div", {
|
|
181
|
+
className: composeSlotClassName(slots?.header, className),
|
|
182
|
+
"data-slot": "modal-header",
|
|
183
|
+
...props,
|
|
184
|
+
children: children
|
|
185
|
+
});
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
/* -------------------------------------------------------------------------------------------------
|
|
189
|
+
* Modal Body
|
|
190
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
191
|
+
|
|
192
|
+
const ModalBody = ({
|
|
193
|
+
children,
|
|
194
|
+
className,
|
|
195
|
+
...props
|
|
196
|
+
}) => {
|
|
197
|
+
const {
|
|
198
|
+
slots
|
|
199
|
+
} = useContext(ModalContext);
|
|
200
|
+
return /*#__PURE__*/jsx("div", {
|
|
201
|
+
className: composeSlotClassName(slots?.body, className),
|
|
202
|
+
"data-slot": "modal-body",
|
|
203
|
+
...props,
|
|
204
|
+
children: children
|
|
205
|
+
});
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
/* -------------------------------------------------------------------------------------------------
|
|
209
|
+
* Modal Footer
|
|
210
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
211
|
+
|
|
212
|
+
const ModalFooter = ({
|
|
213
|
+
children,
|
|
214
|
+
className,
|
|
215
|
+
...props
|
|
216
|
+
}) => {
|
|
217
|
+
const {
|
|
218
|
+
slots
|
|
219
|
+
} = useContext(ModalContext);
|
|
220
|
+
return /*#__PURE__*/jsx("div", {
|
|
221
|
+
className: composeSlotClassName(slots?.footer, className),
|
|
222
|
+
"data-slot": "modal-footer",
|
|
223
|
+
...props,
|
|
224
|
+
children: children
|
|
225
|
+
});
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
/* -------------------------------------------------------------------------------------------------
|
|
229
|
+
* Modal Heading
|
|
230
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
231
|
+
|
|
232
|
+
const ModalHeading = ({
|
|
233
|
+
children,
|
|
234
|
+
className,
|
|
235
|
+
...props
|
|
236
|
+
}) => {
|
|
237
|
+
const {
|
|
238
|
+
slots
|
|
239
|
+
} = useContext(ModalContext);
|
|
240
|
+
return /*#__PURE__*/jsx(Heading, {
|
|
241
|
+
className: composeSlotClassName(slots?.heading, className),
|
|
242
|
+
"data-slot": "modal-heading",
|
|
243
|
+
slot: "title",
|
|
244
|
+
...props,
|
|
245
|
+
children: children
|
|
246
|
+
});
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
/* -------------------------------------------------------------------------------------------------
|
|
250
|
+
* AlertDialog Icon
|
|
251
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
252
|
+
|
|
253
|
+
const ModalIcon = ({
|
|
254
|
+
children,
|
|
255
|
+
className,
|
|
256
|
+
...props
|
|
257
|
+
}) => {
|
|
258
|
+
const {
|
|
259
|
+
slots
|
|
260
|
+
} = useContext(ModalContext);
|
|
261
|
+
return /*#__PURE__*/jsx("div", {
|
|
262
|
+
className: composeSlotClassName(slots?.icon, className),
|
|
263
|
+
"data-slot": "modal-icon",
|
|
264
|
+
...props,
|
|
265
|
+
children: children
|
|
266
|
+
});
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
/* -------------------------------------------------------------------------------------------------
|
|
270
|
+
* Modal Close Trigger
|
|
271
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
272
|
+
|
|
273
|
+
const ModalCloseTrigger = ({
|
|
274
|
+
className,
|
|
275
|
+
...rest
|
|
276
|
+
}) => {
|
|
277
|
+
const {
|
|
278
|
+
slots
|
|
279
|
+
} = useContext(ModalContext);
|
|
280
|
+
return /*#__PURE__*/jsx(CloseButton, {
|
|
281
|
+
className: composeTwRenderProps(className, slots?.closeTrigger()),
|
|
282
|
+
"data-slot": "modal-close-trigger",
|
|
283
|
+
slot: "close",
|
|
284
|
+
...rest
|
|
285
|
+
});
|
|
286
|
+
};
|
|
287
|
+
|
|
288
|
+
export { ModalBackdrop, ModalBody, ModalCloseTrigger, ModalContainer, ModalDialog, ModalFooter, ModalHeader, ModalHeading, ModalIcon, ModalRoot, ModalTrigger };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { NumberFieldDecrementButton, NumberFieldGroup, NumberFieldIncrementButton, NumberFieldInput, NumberFieldRoot } from "./number-field";
|
|
3
|
+
export declare const NumberField: (({ children, className, fullWidth, variant, ...props }: import("./number-field").NumberFieldRootProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
4
|
+
Root: ({ children, className, fullWidth, variant, ...props }: import("./number-field").NumberFieldRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
Group: ({ children, className, ...props }: import("./number-field").NumberFieldGroupProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
Input: ({ className, ...props }: import("./number-field").NumberFieldInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
IncrementButton: ({ children, className, ...props }: import("./number-field").NumberFieldIncrementButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
DecrementButton: ({ children, className, ...props }: import("./number-field").NumberFieldDecrementButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
};
|
|
10
|
+
export type NumberField = {
|
|
11
|
+
Props: ComponentProps<typeof NumberFieldRoot>;
|
|
12
|
+
RootProps: ComponentProps<typeof NumberFieldRoot>;
|
|
13
|
+
GroupProps: ComponentProps<typeof NumberFieldGroup>;
|
|
14
|
+
InputProps: ComponentProps<typeof NumberFieldInput>;
|
|
15
|
+
IncrementButtonProps: ComponentProps<typeof NumberFieldIncrementButton>;
|
|
16
|
+
DecrementButtonProps: ComponentProps<typeof NumberFieldDecrementButton>;
|
|
17
|
+
};
|
|
18
|
+
export { NumberFieldDecrementButton, NumberFieldGroup, NumberFieldIncrementButton, NumberFieldInput, NumberFieldRoot, };
|
|
19
|
+
export type { NumberFieldRootProps, NumberFieldRootProps as NumberFieldProps, NumberFieldGroupProps, NumberFieldInputProps, NumberFieldIncrementButtonProps, NumberFieldDecrementButtonProps, } from "./number-field";
|
|
20
|
+
export { numberFieldVariants } from "@masaraxui/styles";
|
|
21
|
+
export type { NumberFieldVariants } from "@masaraxui/styles";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { NumberFieldRoot, NumberFieldDecrementButton, NumberFieldIncrementButton, NumberFieldInput, NumberFieldGroup } from './number-field.js';
|
|
3
|
+
export { numberFieldVariants } from '@masaraxui/styles';
|
|
4
|
+
|
|
5
|
+
/* -------------------------------------------------------------------------------------------------
|
|
6
|
+
* Compound Component
|
|
7
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
8
|
+
const NumberField = Object.assign(NumberFieldRoot, {
|
|
9
|
+
Root: NumberFieldRoot,
|
|
10
|
+
Group: NumberFieldGroup,
|
|
11
|
+
Input: NumberFieldInput,
|
|
12
|
+
IncrementButton: NumberFieldIncrementButton,
|
|
13
|
+
DecrementButton: NumberFieldDecrementButton
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export { NumberField, NumberFieldDecrementButton, NumberFieldGroup, NumberFieldIncrementButton, NumberFieldInput, NumberFieldRoot };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { NumberFieldVariants } from "@masaraxui/styles";
|
|
2
|
+
import type { ComponentPropsWithRef } from "react";
|
|
3
|
+
import { Button as ButtonPrimitive, Group as GroupPrimitive, Input as InputPrimitive, NumberField as NumberFieldPrimitive } from "react-aria-components";
|
|
4
|
+
interface NumberFieldRootProps extends ComponentPropsWithRef<typeof NumberFieldPrimitive>, NumberFieldVariants {
|
|
5
|
+
}
|
|
6
|
+
declare const NumberFieldRoot: ({ children, className, fullWidth, variant, ...props }: NumberFieldRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
interface NumberFieldGroupProps extends ComponentPropsWithRef<typeof GroupPrimitive> {
|
|
8
|
+
}
|
|
9
|
+
declare const NumberFieldGroup: ({ children, className, ...props }: NumberFieldGroupProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
interface NumberFieldInputProps extends ComponentPropsWithRef<typeof InputPrimitive> {
|
|
11
|
+
}
|
|
12
|
+
declare const NumberFieldInput: ({ className, ...props }: NumberFieldInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
interface NumberFieldIncrementButtonProps extends ComponentPropsWithRef<typeof ButtonPrimitive> {
|
|
14
|
+
}
|
|
15
|
+
declare const NumberFieldIncrementButton: ({ children, className, ...props }: NumberFieldIncrementButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
interface NumberFieldDecrementButtonProps extends ComponentPropsWithRef<typeof ButtonPrimitive> {
|
|
17
|
+
}
|
|
18
|
+
declare const NumberFieldDecrementButton: ({ children, className, ...props }: NumberFieldDecrementButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export { NumberFieldRoot, NumberFieldGroup, NumberFieldInput, NumberFieldIncrementButton, NumberFieldDecrementButton, };
|
|
20
|
+
export type { NumberFieldRootProps, NumberFieldGroupProps, NumberFieldInputProps, NumberFieldIncrementButtonProps, NumberFieldDecrementButtonProps, };
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { numberFieldVariants } from '@masaraxui/styles';
|
|
3
|
+
import React__default, { createContext, useContext } from 'react';
|
|
4
|
+
import { NumberField, Button, Input, Group } from 'react-aria-components';
|
|
5
|
+
import { composeTwRenderProps } from '../../utils/compose.js';
|
|
6
|
+
import { IconMinus, IconPlus } from '../icons.js';
|
|
7
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
8
|
+
|
|
9
|
+
const NumberFieldContext = /*#__PURE__*/createContext({});
|
|
10
|
+
|
|
11
|
+
/* -------------------------------------------------------------------------------------------------
|
|
12
|
+
* NumberField Root
|
|
13
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
14
|
+
|
|
15
|
+
const NumberFieldRoot = ({
|
|
16
|
+
children,
|
|
17
|
+
className,
|
|
18
|
+
fullWidth,
|
|
19
|
+
variant,
|
|
20
|
+
...props
|
|
21
|
+
}) => {
|
|
22
|
+
const slots = React__default.useMemo(() => numberFieldVariants({
|
|
23
|
+
fullWidth,
|
|
24
|
+
variant
|
|
25
|
+
}), [fullWidth, variant]);
|
|
26
|
+
return /*#__PURE__*/jsx(NumberFieldContext, {
|
|
27
|
+
value: {
|
|
28
|
+
slots
|
|
29
|
+
},
|
|
30
|
+
children: /*#__PURE__*/jsx(NumberField, {
|
|
31
|
+
"data-slot": "number-field",
|
|
32
|
+
...props,
|
|
33
|
+
className: composeTwRenderProps(className, slots?.base()),
|
|
34
|
+
children: values => /*#__PURE__*/jsx(Fragment, {
|
|
35
|
+
children: typeof children === "function" ? children(values) : children
|
|
36
|
+
})
|
|
37
|
+
})
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
/* -------------------------------------------------------------------------------------------------
|
|
42
|
+
* NumberField Group
|
|
43
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
44
|
+
|
|
45
|
+
const NumberFieldGroup = ({
|
|
46
|
+
children,
|
|
47
|
+
className,
|
|
48
|
+
...props
|
|
49
|
+
}) => {
|
|
50
|
+
const {
|
|
51
|
+
slots
|
|
52
|
+
} = useContext(NumberFieldContext);
|
|
53
|
+
return /*#__PURE__*/jsx(Group, {
|
|
54
|
+
className: composeTwRenderProps(className, slots?.group()),
|
|
55
|
+
"data-slot": "number-field-group",
|
|
56
|
+
...props,
|
|
57
|
+
children: values => /*#__PURE__*/jsx(Fragment, {
|
|
58
|
+
children: typeof children === "function" ? children(values) : children
|
|
59
|
+
})
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
/* -------------------------------------------------------------------------------------------------
|
|
64
|
+
* NumberField Input
|
|
65
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
66
|
+
|
|
67
|
+
const NumberFieldInput = ({
|
|
68
|
+
className,
|
|
69
|
+
...props
|
|
70
|
+
}) => {
|
|
71
|
+
const {
|
|
72
|
+
slots
|
|
73
|
+
} = useContext(NumberFieldContext);
|
|
74
|
+
return /*#__PURE__*/jsx(Input, {
|
|
75
|
+
className: composeTwRenderProps(className, slots?.input()),
|
|
76
|
+
"data-slot": "number-field-input",
|
|
77
|
+
...props
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
/* -------------------------------------------------------------------------------------------------
|
|
82
|
+
* NumberField Increment Button
|
|
83
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
84
|
+
|
|
85
|
+
const NumberFieldIncrementButton = ({
|
|
86
|
+
children,
|
|
87
|
+
className,
|
|
88
|
+
...props
|
|
89
|
+
}) => {
|
|
90
|
+
const {
|
|
91
|
+
slots
|
|
92
|
+
} = useContext(NumberFieldContext);
|
|
93
|
+
return /*#__PURE__*/jsx(Button, {
|
|
94
|
+
className: composeTwRenderProps(className, slots?.incrementButton()),
|
|
95
|
+
"data-slot": "number-field-increment-button",
|
|
96
|
+
slot: "increment",
|
|
97
|
+
...props,
|
|
98
|
+
children: children && /*#__PURE__*/React__default.isValidElement(children) ? children : /*#__PURE__*/jsx(IconPlus, {
|
|
99
|
+
"data-slot": "number-field-increment-button-icon"
|
|
100
|
+
})
|
|
101
|
+
});
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
/* -------------------------------------------------------------------------------------------------
|
|
105
|
+
* NumberField Decrement Button
|
|
106
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
107
|
+
|
|
108
|
+
const NumberFieldDecrementButton = ({
|
|
109
|
+
children,
|
|
110
|
+
className,
|
|
111
|
+
...props
|
|
112
|
+
}) => {
|
|
113
|
+
const {
|
|
114
|
+
slots
|
|
115
|
+
} = useContext(NumberFieldContext);
|
|
116
|
+
return /*#__PURE__*/jsx(Button, {
|
|
117
|
+
className: composeTwRenderProps(className, slots?.decrementButton()),
|
|
118
|
+
"data-slot": "number-field-decrement-button",
|
|
119
|
+
slot: "decrement",
|
|
120
|
+
...props,
|
|
121
|
+
children: children && /*#__PURE__*/React__default.isValidElement(children) ? children : /*#__PURE__*/jsx(IconMinus, {
|
|
122
|
+
"data-slot": "number-field-decrement-button-icon"
|
|
123
|
+
})
|
|
124
|
+
});
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
export { NumberFieldDecrementButton, NumberFieldGroup, NumberFieldIncrementButton, NumberFieldInput, NumberFieldRoot };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationNextIcon, PaginationPrevious, PaginationPreviousIcon, PaginationRoot, PaginationSummary } from "./pagination";
|
|
3
|
+
export declare const Pagination: {
|
|
4
|
+
({ children, className, size, ...props }: import("./pagination").PaginationRootProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
displayName: string;
|
|
6
|
+
} & {
|
|
7
|
+
Content: {
|
|
8
|
+
({ children, className, ...props }: import("./pagination").PaginationContentProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
displayName: string;
|
|
10
|
+
};
|
|
11
|
+
Ellipsis: {
|
|
12
|
+
({ className, ...props }: import("./pagination").PaginationEllipsisProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
displayName: string;
|
|
14
|
+
};
|
|
15
|
+
Item: {
|
|
16
|
+
({ children, className, ...props }: import("./pagination").PaginationItemProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
displayName: string;
|
|
18
|
+
};
|
|
19
|
+
Link: {
|
|
20
|
+
({ children, className, isActive, ...props }: import("./pagination").PaginationLinkProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
displayName: string;
|
|
22
|
+
};
|
|
23
|
+
Next: {
|
|
24
|
+
({ children, className, ...props }: import("./pagination").PaginationNextProps): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
displayName: string;
|
|
26
|
+
};
|
|
27
|
+
NextIcon: {
|
|
28
|
+
({ children, className, ...props }: import("./pagination").PaginationNextIconProps): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
displayName: string;
|
|
30
|
+
};
|
|
31
|
+
Previous: {
|
|
32
|
+
({ children, className, ...props }: import("./pagination").PaginationPreviousProps): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
displayName: string;
|
|
34
|
+
};
|
|
35
|
+
PreviousIcon: {
|
|
36
|
+
({ children, className, ...props }: import("./pagination").PaginationPreviousIconProps): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
displayName: string;
|
|
38
|
+
};
|
|
39
|
+
Root: {
|
|
40
|
+
({ children, className, size, ...props }: import("./pagination").PaginationRootProps): import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
displayName: string;
|
|
42
|
+
};
|
|
43
|
+
Summary: {
|
|
44
|
+
({ children, className, ...props }: import("./pagination").PaginationSummaryProps): import("react/jsx-runtime").JSX.Element;
|
|
45
|
+
displayName: string;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
export type Pagination = {
|
|
49
|
+
ContentProps: ComponentProps<typeof PaginationContent>;
|
|
50
|
+
EllipsisProps: ComponentProps<typeof PaginationEllipsis>;
|
|
51
|
+
ItemProps: ComponentProps<typeof PaginationItem>;
|
|
52
|
+
LinkProps: ComponentProps<typeof PaginationLink>;
|
|
53
|
+
NextIconProps: ComponentProps<typeof PaginationNextIcon>;
|
|
54
|
+
NextProps: ComponentProps<typeof PaginationNext>;
|
|
55
|
+
PreviousIconProps: ComponentProps<typeof PaginationPreviousIcon>;
|
|
56
|
+
PreviousProps: ComponentProps<typeof PaginationPrevious>;
|
|
57
|
+
Props: ComponentProps<typeof PaginationRoot>;
|
|
58
|
+
RootProps: ComponentProps<typeof PaginationRoot>;
|
|
59
|
+
SummaryProps: ComponentProps<typeof PaginationSummary>;
|
|
60
|
+
};
|
|
61
|
+
export { PaginationRoot, PaginationSummary, PaginationContent, PaginationItem, PaginationLink, PaginationPrevious, PaginationPreviousIcon, PaginationNext, PaginationNextIcon, PaginationEllipsis, };
|
|
62
|
+
export type { PaginationRootProps, PaginationRootProps as PaginationProps, PaginationSummaryProps, PaginationContentProps, PaginationItemProps, PaginationLinkProps, PaginationPreviousProps, PaginationPreviousIconProps, PaginationNextProps, PaginationNextIconProps, PaginationEllipsisProps, } from "./pagination";
|
|
63
|
+
export { paginationVariants } from "@masaraxui/styles";
|
|
64
|
+
export type { PaginationVariants } from "@masaraxui/styles";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { PaginationRoot, PaginationSummary, PaginationPreviousIcon, PaginationPrevious, PaginationNextIcon, PaginationNext, PaginationLink, PaginationItem, PaginationEllipsis, PaginationContent } from './pagination.js';
|
|
3
|
+
export { paginationVariants } from '@masaraxui/styles';
|
|
4
|
+
|
|
5
|
+
/* -------------------------------------------------------------------------------------------------
|
|
6
|
+
* Compound Component
|
|
7
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
8
|
+
const Pagination = Object.assign(PaginationRoot, {
|
|
9
|
+
Content: PaginationContent,
|
|
10
|
+
Ellipsis: PaginationEllipsis,
|
|
11
|
+
Item: PaginationItem,
|
|
12
|
+
Link: PaginationLink,
|
|
13
|
+
Next: PaginationNext,
|
|
14
|
+
NextIcon: PaginationNextIcon,
|
|
15
|
+
Previous: PaginationPrevious,
|
|
16
|
+
PreviousIcon: PaginationPreviousIcon,
|
|
17
|
+
Root: PaginationRoot,
|
|
18
|
+
Summary: PaginationSummary
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export { Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationNextIcon, PaginationPrevious, PaginationPreviousIcon, PaginationRoot, PaginationSummary };
|