@arobo/react 1.0.1 → 1.1.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/dist/components/accordion/accordion.d.ts +30 -0
- package/dist/components/accordion/accordion.js +190 -0
- package/dist/components/accordion/index.d.ts +23 -0
- package/dist/components/accordion/index.js +16 -0
- package/dist/components/alert/alert.d.ts +15 -0
- package/dist/components/alert/alert.js +151 -0
- package/dist/components/alert/index.d.ts +19 -0
- package/dist/components/alert/index.js +14 -0
- package/dist/components/alert-dialog/alert-dialog.d.ts +65 -0
- package/dist/components/alert-dialog/alert-dialog.js +303 -0
- package/dist/components/alert-dialog/index.d.ts +31 -0
- package/dist/components/alert-dialog/index.js +20 -0
- package/dist/components/avatar/avatar.d.ts +15 -0
- package/dist/components/avatar/avatar.js +92 -0
- package/dist/components/avatar/index.d.ts +15 -0
- package/dist/components/avatar/index.js +12 -0
- package/dist/components/breadcrumbs/breadcrumbs.d.ts +14 -0
- package/dist/components/breadcrumbs/breadcrumbs.js +82 -0
- package/dist/components/breadcrumbs/index.d.ts +13 -0
- package/dist/components/breadcrumbs/index.js +11 -0
- package/dist/components/button/button.js +1 -1
- package/dist/components/button/index.js +1 -1
- package/dist/components/button-group/button-group.js +3 -3
- package/dist/components/button-group/index.js +1 -1
- package/dist/components/calendar/calendar.js +1 -1
- package/dist/components/calendar/index.js +1 -1
- package/dist/components/card/card.js +3 -3
- package/dist/components/card/index.js +1 -1
- package/dist/components/carousel/carousel.d.ts +30 -0
- package/dist/components/carousel/carousel.js +176 -0
- package/dist/components/carousel/index.d.ts +2 -0
- package/dist/components/carousel/index.js +1 -0
- package/dist/components/checkbox/checkbox.d.ts +16 -3
- package/dist/components/checkbox/checkbox.js +149 -35
- package/dist/components/checkbox/index.d.ts +3 -16
- package/dist/components/checkbox/index.js +4 -12
- package/dist/components/checkbox-group/checkbox-group.js +3 -3
- package/dist/components/checkbox-group/index.js +1 -1
- package/dist/components/chip/chip.d.ts +9 -0
- package/dist/components/chip/chip.js +24 -0
- package/dist/components/chip/index.d.ts +11 -0
- package/dist/components/chip/index.js +10 -0
- package/dist/components/close-button/close-button.d.ts +1 -1
- package/dist/components/close-button/close-button.js +1 -1
- package/dist/components/close-button/index.d.ts +1 -3
- package/dist/components/close-button/index.js +0 -1
- package/dist/components/combobox/combobox.js +3 -3
- package/dist/components/combobox/index.js +1 -1
- package/dist/components/container/container.d.ts +9 -0
- package/dist/components/container/container.js +23 -0
- package/dist/components/container/index.d.ts +13 -0
- package/dist/components/container/index.js +11 -0
- package/dist/components/date-field/date-field.js +3 -3
- package/dist/components/date-field/index.js +1 -1
- package/dist/components/date-input-group/date-input-group.js +3 -3
- package/dist/components/date-input-group/index.js +1 -1
- package/dist/components/date-picker/date-picker.js +4 -4
- package/dist/components/date-picker/index.d.ts +0 -2
- package/dist/components/date-picker/index.js +0 -1
- package/dist/components/date-range-picker/date-range-picker.d.ts +0 -1
- package/dist/components/date-range-picker/date-range-picker.js +4 -4
- package/dist/components/date-range-picker/index.js +1 -1
- package/dist/components/description/description.js +1 -1
- package/dist/components/description/index.d.ts +1 -3
- package/dist/components/description/index.js +0 -1
- package/dist/components/drawer/drawer.d.ts +33 -0
- package/dist/components/drawer/index.d.ts +1 -0
- package/dist/components/drawer/index.js +1 -0
- package/dist/components/dropdown/dropdown.d.ts +38 -0
- package/dist/components/dropdown/dropdown.js +155 -0
- package/dist/components/dropdown/index.d.ts +41 -0
- package/dist/components/dropdown/index.js +18 -0
- package/dist/components/empty/empty.d.ts +34 -0
- package/dist/components/empty/empty.js +151 -0
- package/dist/components/empty/index.d.ts +2 -0
- package/dist/components/empty/index.js +1 -0
- package/dist/components/empty-state/empty-state.d.ts +7 -0
- package/dist/components/empty-state/empty-state.js +19 -0
- package/dist/components/empty-state/index.d.ts +11 -0
- package/dist/components/empty-state/index.js +10 -0
- package/dist/components/error-message/error-message.js +1 -1
- package/dist/components/error-message/index.js +1 -1
- package/dist/components/field-error/field-error.js +1 -1
- package/dist/components/field-error/index.js +1 -1
- package/dist/components/fieldset/fieldset.d.ts +16 -0
- package/dist/components/fieldset/fieldset.js +87 -0
- package/dist/components/fieldset/index.d.ts +19 -0
- package/dist/components/fieldset/index.js +14 -0
- package/dist/components/header/header.d.ts +7 -0
- package/dist/components/header/header.js +20 -0
- package/dist/components/header/index.d.ts +8 -0
- package/dist/components/header/index.js +8 -0
- package/dist/components/heading/heading.d.ts +12 -0
- package/dist/components/heading/heading.js +29 -0
- package/dist/components/heading/index.d.ts +13 -0
- package/dist/components/heading/index.js +11 -0
- package/dist/components/icons.js +169 -1
- package/dist/components/index.d.ts +45 -1
- package/dist/components/input/index.js +1 -1
- package/dist/components/input/input.js +1 -1
- package/dist/components/input-group/index.d.ts +21 -0
- package/dist/components/input-group/index.js +15 -0
- package/dist/components/input-group/input-group.d.ts +20 -0
- package/dist/components/input-group/input-group.js +128 -0
- package/dist/components/input-otp/index.d.ts +22 -0
- package/dist/components/input-otp/index.js +20 -0
- package/dist/components/input-otp/input-otp.d.ts +26 -0
- package/dist/components/input-otp/input-otp.js +138 -0
- package/dist/components/kbd/index.d.ts +17 -0
- package/dist/components/kbd/index.js +13 -0
- package/dist/components/kbd/kbd.constants.d.ts +3 -0
- package/dist/components/kbd/kbd.constants.js +50 -0
- package/dist/components/kbd/kbd.d.ts +24 -0
- package/dist/components/kbd/kbd.js +75 -0
- package/dist/components/label/index.js +1 -1
- package/dist/components/label/label.js +1 -1
- package/dist/components/link/index.d.ts +13 -0
- package/dist/components/link/index.js +11 -0
- package/dist/components/link/link.d.ts +10 -0
- package/dist/components/link/link.js +58 -0
- package/dist/components/listbox/index.d.ts +21 -0
- package/dist/components/listbox/index.js +16 -0
- package/dist/components/listbox/listbox.d.ts +9 -0
- package/dist/components/listbox/listbox.js +22 -0
- package/dist/components/listbox/listbox.type.d.ts +34 -0
- package/dist/components/listbox-item/index.d.ts +13 -0
- package/dist/components/listbox-item/index.js +11 -0
- package/dist/components/listbox-item/listbox-item.d.ts +15 -0
- package/dist/components/listbox-item/listbox-item.js +76 -0
- package/dist/components/listbox-section/index.d.ts +8 -0
- package/dist/components/listbox-section/index.js +8 -0
- package/dist/components/listbox-section/listbox-section.d.ts +8 -0
- package/dist/components/listbox-section/listbox-section.js +21 -0
- package/dist/components/menu/index.d.ts +22 -0
- package/dist/components/menu/index.js +16 -0
- package/dist/components/menu/menu.d.ts +9 -0
- package/dist/components/menu/menu.js +19 -0
- package/dist/components/menu-item/index.d.ts +15 -0
- package/dist/components/menu-item/index.js +12 -0
- package/dist/components/menu-item/menu-item.d.ts +20 -0
- package/dist/components/menu-item/menu-item.js +122 -0
- package/dist/components/menu-section/index.d.ts +8 -0
- package/dist/components/menu-section/index.js +8 -0
- package/dist/components/menu-section/menu-section.d.ts +8 -0
- package/dist/components/menu-section/menu-section.js +21 -0
- package/dist/components/modal/index.d.ts +31 -0
- package/dist/components/modal/index.js +20 -0
- package/dist/components/modal/modal.d.ts +53 -0
- package/dist/components/modal/modal.js +283 -0
- package/dist/components/number-field/index.d.ts +21 -0
- package/dist/components/number-field/index.js +15 -0
- package/dist/components/number-field/number-field.d.ts +20 -0
- package/dist/components/number-field/number-field.js +126 -0
- package/dist/components/pagination/index.d.ts +19 -0
- package/dist/components/pagination/index.js +11 -0
- package/dist/components/pagination/pagination-ellipsis.d.ts +6 -0
- package/dist/components/pagination/pagination-ellipsis.js +11 -0
- package/dist/components/pagination/pagination-item.d.ts +15 -0
- package/dist/components/pagination/pagination-item.js +34 -0
- package/dist/components/pagination/pagination.d.ts +28 -0
- package/dist/components/pagination/pagination.js +128 -0
- package/dist/components/popover/index.js +1 -1
- package/dist/components/popover/popover.js +4 -4
- package/dist/components/rac/components.d.ts +1 -0
- package/dist/components/rac/index.d.ts +3 -0
- package/dist/components/rac/index.js +2 -0
- package/dist/components/rac/types.d.ts +2 -0
- package/dist/components/radio/index.d.ts +17 -0
- package/dist/components/radio/index.js +13 -0
- package/dist/components/radio/radio.d.ts +21 -0
- package/dist/components/radio/radio.js +96 -0
- package/dist/components/radio-group/index.d.ts +11 -0
- package/dist/components/radio-group/index.js +10 -0
- package/dist/components/radio-group/radio-group.d.ts +8 -0
- package/dist/components/radio-group/radio-group.js +26 -0
- package/dist/components/range-calendar/index.js +1 -1
- package/dist/components/range-calendar/range-calendar.js +1 -1
- package/dist/components/scroll-shadow/index.d.ts +19 -0
- package/dist/components/scroll-shadow/index.js +11 -0
- package/dist/components/scroll-shadow/scroll-shadow.d.ts +32 -0
- package/dist/components/scroll-shadow/scroll-shadow.js +75 -0
- package/dist/components/scroll-shadow/use-scroll-shadow.d.ts +11 -0
- package/dist/components/scroll-shadow/use-scroll-shadow.js +120 -0
- package/dist/components/select/index.d.ts +19 -0
- package/dist/components/select/index.js +14 -0
- package/dist/components/select/select.d.ts +24 -0
- package/dist/components/select/select.js +139 -0
- package/dist/components/separator/index.d.ts +11 -0
- package/dist/components/separator/index.js +10 -0
- package/dist/components/separator/separator.d.ts +8 -0
- package/dist/components/separator/separator.js +22 -0
- package/dist/components/slider/index.d.ts +21 -0
- package/dist/components/slider/index.js +15 -0
- package/dist/components/slider/slider.d.ts +23 -0
- package/dist/components/slider/slider.js +176 -0
- package/dist/components/spinner/index.d.ts +11 -0
- package/dist/components/spinner/index.js +10 -0
- package/dist/components/spinner/spinner.d.ts +7 -0
- package/dist/components/spinner/spinner.js +87 -0
- package/dist/components/surface/index.js +1 -1
- package/dist/components/surface/surface.js +1 -1
- package/dist/components/switch/index.d.ts +17 -0
- package/dist/components/switch/index.js +13 -0
- package/dist/components/switch/switch.d.ts +17 -0
- package/dist/components/switch/switch.js +97 -0
- package/dist/components/tabs/index.d.ts +21 -0
- package/dist/components/tabs/index.js +15 -0
- package/dist/components/tabs/tabs.d.ts +34 -0
- package/dist/components/tabs/tabs.js +140 -0
- package/dist/components/tag/index.d.ts +13 -0
- package/dist/components/tag/index.js +11 -0
- package/dist/components/tag/tag.d.ts +14 -0
- package/dist/components/tag/tag.js +84 -0
- package/dist/components/tag-group/index.d.ts +13 -0
- package/dist/components/tag-group/index.js +12 -0
- package/dist/components/tag-group/tag-group.d.ts +19 -0
- package/dist/components/tag-group/tag-group.js +58 -0
- package/dist/components/text-field/index.js +1 -1
- package/dist/components/text-field/text-field.js +3 -3
- package/dist/components/textarea/index.d.ts +11 -0
- package/dist/components/textarea/index.js +10 -0
- package/dist/components/textarea/textarea.d.ts +8 -0
- package/dist/components/textarea/textarea.js +26 -0
- package/dist/components/toast/constants.d.ts +3 -0
- package/dist/components/toast/constants.js +8 -0
- package/dist/components/toast/index.d.ts +73 -0
- package/dist/components/toast/index.js +21 -0
- package/dist/components/toast/toast-queue.d.ts +67 -0
- package/dist/components/toast/toast-queue.js +129 -0
- package/dist/components/toast/toast.d.ts +67 -0
- package/dist/components/toast/toast.js +295 -0
- package/dist/components/toggle-button/index.d.ts +2 -0
- package/dist/components/toggle-button/index.js +1 -0
- package/dist/components/toggle-button/toggle-button.d.ts +10 -0
- package/dist/components/toggle-button/toggle-button.js +26 -0
- package/dist/components/toggle-button-group/index.d.ts +2 -0
- package/dist/components/toggle-button-group/index.js +1 -0
- package/dist/components/toggle-button-group/toggle-button-group.d.ts +15 -0
- package/dist/components/toggle-button-group/toggle-button-group.js +61 -0
- package/dist/components/tooltip/index.d.ts +17 -0
- package/dist/components/tooltip/index.js +13 -0
- package/dist/components/tooltip/tooltip.d.ts +20 -0
- package/dist/components/tooltip/tooltip.js +105 -0
- package/dist/hooks/index.d.ts +6 -0
- package/dist/hooks/use-isomorphic-layout-effect.d.ts +2 -0
- package/dist/hooks/use-isomorphic-layout-effect.js +5 -0
- package/dist/hooks/use-list-data.d.ts +111 -0
- package/dist/hooks/use-media-query.d.ts +6 -0
- package/dist/hooks/use-media-query.js +49 -0
- package/dist/hooks/use-overlay-state.d.ts +52 -0
- package/dist/hooks/use-pagination.d.ts +48 -0
- package/dist/hooks/use-pagination.js +114 -0
- package/dist/hooks/use-safe-layout-effect.d.ts +2 -0
- package/dist/hooks/use-safe-layout-effect.js +5 -0
- package/dist/index.js +109 -26
- package/dist/node_modules/.pnpm/@internationalized_string@3.2.7/node_modules/@internationalized/string/dist/LocalizedStringDictionary.js +74 -0
- package/dist/node_modules/.pnpm/react-aria-components@1.14.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-aria-components/i18n/ar-AE.js +3 -0
- package/dist/node_modules/.pnpm/react-aria-components@1.14.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-aria-components/i18n/bg-BG.js +3 -0
- package/dist/node_modules/.pnpm/react-aria-components@1.14.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-aria-components/i18n/cs-CZ.js +3 -0
- package/dist/node_modules/.pnpm/react-aria-components@1.14.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-aria-components/i18n/da-DK.js +3 -0
- package/dist/node_modules/.pnpm/react-aria-components@1.14.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-aria-components/i18n/de-DE.js +3 -0
- package/dist/node_modules/.pnpm/react-aria-components@1.14.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-aria-components/i18n/el-GR.js +3 -0
- package/dist/node_modules/.pnpm/react-aria-components@1.14.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-aria-components/i18n/en-US.js +3 -0
- package/dist/node_modules/.pnpm/react-aria-components@1.14.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-aria-components/i18n/es-ES.js +3 -0
- package/dist/node_modules/.pnpm/react-aria-components@1.14.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-aria-components/i18n/et-EE.js +3 -0
- package/dist/node_modules/.pnpm/react-aria-components@1.14.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-aria-components/i18n/fi-FI.js +3 -0
- package/dist/node_modules/.pnpm/react-aria-components@1.14.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-aria-components/i18n/fr-FR.js +3 -0
- package/dist/node_modules/.pnpm/react-aria-components@1.14.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-aria-components/i18n/he-IL.js +3 -0
- package/dist/node_modules/.pnpm/react-aria-components@1.14.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-aria-components/i18n/hr-HR.js +3 -0
- package/dist/node_modules/.pnpm/react-aria-components@1.14.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-aria-components/i18n/hu-HU.js +3 -0
- package/dist/node_modules/.pnpm/react-aria-components@1.14.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-aria-components/i18n/index.js +80 -0
- package/dist/node_modules/.pnpm/react-aria-components@1.14.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-aria-components/i18n/it-IT.js +3 -0
- package/dist/node_modules/.pnpm/react-aria-components@1.14.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-aria-components/i18n/ja-JP.js +3 -0
- package/dist/node_modules/.pnpm/react-aria-components@1.14.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-aria-components/i18n/ko-KR.js +3 -0
- package/dist/node_modules/.pnpm/react-aria-components@1.14.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-aria-components/i18n/lt-LT.js +3 -0
- package/dist/node_modules/.pnpm/react-aria-components@1.14.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-aria-components/i18n/lv-LV.js +3 -0
- package/dist/node_modules/.pnpm/react-aria-components@1.14.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-aria-components/i18n/nb-NO.js +3 -0
- package/dist/node_modules/.pnpm/react-aria-components@1.14.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-aria-components/i18n/nl-NL.js +3 -0
- package/dist/node_modules/.pnpm/react-aria-components@1.14.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-aria-components/i18n/pl-PL.js +3 -0
- package/dist/node_modules/.pnpm/react-aria-components@1.14.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-aria-components/i18n/pt-BR.js +3 -0
- package/dist/node_modules/.pnpm/react-aria-components@1.14.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-aria-components/i18n/pt-PT.js +3 -0
- package/dist/node_modules/.pnpm/react-aria-components@1.14.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-aria-components/i18n/ro-RO.js +3 -0
- package/dist/node_modules/.pnpm/react-aria-components@1.14.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-aria-components/i18n/ru-RU.js +3 -0
- package/dist/node_modules/.pnpm/react-aria-components@1.14.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-aria-components/i18n/sk-SK.js +3 -0
- package/dist/node_modules/.pnpm/react-aria-components@1.14.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-aria-components/i18n/sl-SI.js +3 -0
- package/dist/node_modules/.pnpm/react-aria-components@1.14.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-aria-components/i18n/sr-SP.js +3 -0
- package/dist/node_modules/.pnpm/react-aria-components@1.14.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-aria-components/i18n/sv-SE.js +3 -0
- package/dist/node_modules/.pnpm/react-aria-components@1.14.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-aria-components/i18n/tr-TR.js +3 -0
- package/dist/node_modules/.pnpm/react-aria-components@1.14.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-aria-components/i18n/uk-UA.js +3 -0
- package/dist/node_modules/.pnpm/react-aria-components@1.14.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-aria-components/i18n/zh-CN.js +3 -0
- package/dist/node_modules/.pnpm/react-aria-components@1.14.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/react-aria-components/i18n/zh-TW.js +3 -0
- package/dist/packages/styles/src/components/accordion/accordion.styles.js +26 -0
- package/dist/packages/styles/src/components/alert/alert.styles.js +35 -0
- package/dist/packages/styles/src/components/alert-dialog/alert-dialog.styles.js +70 -0
- package/dist/packages/styles/src/components/avatar/avatar.styles.js +51 -0
- package/dist/packages/styles/src/components/breadcrumbs/breadcrumbs.styles.js +12 -0
- package/dist/packages/styles/src/components/chip/chip.styles.js +31 -0
- package/dist/packages/styles/src/components/container/container.styles.js +18 -0
- package/dist/packages/styles/src/components/dropdown/dropdown.styles.js +12 -0
- package/dist/packages/styles/src/components/empty/empty.styles.js +30 -0
- package/dist/packages/styles/src/components/empty-state/empty-state.styles.js +7 -0
- package/dist/packages/styles/src/components/fieldset/fieldset.styles.js +13 -0
- package/dist/packages/styles/src/components/header/header.styles.js +7 -0
- package/dist/packages/styles/src/components/heading/heading.styles.js +19 -0
- package/dist/packages/styles/src/components/input-group/input-group.styles.js +32 -0
- package/dist/packages/styles/src/components/input-otp/input-otp.styles.js +28 -0
- package/dist/packages/styles/src/components/kbd/kbd.styles.js +18 -0
- package/dist/packages/styles/src/components/link/link.styles.js +12 -0
- package/dist/packages/styles/src/components/listbox/listbox.styles.js +16 -0
- package/dist/packages/styles/src/components/listbox-item/listbox-item.styles.js +23 -0
- package/dist/packages/styles/src/components/listbox-section/listbox-section.styles.js +7 -0
- package/dist/packages/styles/src/components/menu/menu.styles.js +7 -0
- package/dist/packages/styles/src/components/menu-item/menu-item.styles.js +24 -0
- package/dist/packages/styles/src/components/menu-section/menu-section.styles.js +7 -0
- package/dist/packages/styles/src/components/modal/modal.styles.js +68 -0
- package/dist/packages/styles/src/components/number-field/number-field.styles.js +34 -0
- package/dist/packages/styles/src/components/pagination/pagination.styles.js +33 -0
- package/dist/packages/styles/src/components/radio/radio.styles.js +12 -0
- package/dist/packages/styles/src/components/radio-group/radio-group.styles.js +16 -0
- package/dist/packages/styles/src/components/scroll-shadow/scroll-shadow.styles.js +35 -0
- package/dist/packages/styles/src/components/select/select.styles.js +34 -0
- package/dist/packages/styles/src/components/separator/separator.styles.js +16 -0
- package/dist/packages/styles/src/components/slider/slider.styles.js +14 -0
- package/dist/packages/styles/src/components/spinner/spinner.styles.js +26 -0
- package/dist/packages/styles/src/components/switch/switch.styles.js +28 -0
- package/dist/packages/styles/src/components/tabs/tabs.styles.js +27 -0
- package/dist/packages/styles/src/components/tag/tag.styles.js +35 -0
- package/dist/packages/styles/src/components/tag-group/tag-group.styles.js +10 -0
- package/dist/packages/styles/src/components/textarea/textarea.styles.js +21 -0
- package/dist/packages/styles/src/components/toast/toast.styles.js +65 -0
- package/dist/packages/styles/src/components/toggle-button/toggle-button.styles.js +36 -0
- package/dist/packages/styles/src/components/toggle-button-group/toggle-button-group.styles.js +36 -0
- package/dist/packages/styles/src/components/tooltip/tooltip.styles.js +10 -0
- package/dist/utils/children.d.ts +9 -0
- package/dist/utils/children.js +17 -0
- package/dist/utils/compose.js +1 -1
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/merge-props.d.ts +26 -0
- package/dist/utils/merge-props.js +72 -0
- package/dist/utils/merge-refs.d.ts +5 -0
- package/dist/utils/merge-refs.js +48 -0
- package/package.json +13 -7
- package/dist/components/field-group/field-group.d.ts +0 -11
- package/dist/components/field-group/field-group.js +0 -18
- package/dist/components/field-group/index.d.ts +0 -13
- package/dist/components/field-group/index.js +0 -11
- package/dist/styles/src/components/field-group/field-group.styles.js +0 -25
- package/dist/styles/src/utils/state.js +0 -13
- /package/dist/{styles → packages/styles}/src/components/button/button.styles.js +0 -0
- /package/dist/{styles → packages/styles}/src/components/button-group/button-group.styles.js +0 -0
- /package/dist/{styles → packages/styles}/src/components/calendar/calendar.styles.js +0 -0
- /package/dist/{styles → packages/styles}/src/components/card/card.styles.js +0 -0
- /package/dist/{styles → packages/styles}/src/components/checkbox/checkbox.styles.js +0 -0
- /package/dist/{styles → packages/styles}/src/components/checkbox-group/checkbox-group.styles.js +0 -0
- /package/dist/{styles → packages/styles}/src/components/close-button/close-button.styles.js +0 -0
- /package/dist/{styles → packages/styles}/src/components/combobox/combobox.styles.js +0 -0
- /package/dist/{styles → packages/styles}/src/components/date-field/date-field.styles.js +0 -0
- /package/dist/{styles → packages/styles}/src/components/date-input-group/date-input-group.styles.js +0 -0
- /package/dist/{styles → packages/styles}/src/components/date-picker/date-picker.styles.js +0 -0
- /package/dist/{styles → packages/styles}/src/components/date-range-picker/date-range-picker.styles.js +0 -0
- /package/dist/{styles → packages/styles}/src/components/description/description.styles.js +0 -0
- /package/dist/{styles → packages/styles}/src/components/error-message/error-message.styles.js +0 -0
- /package/dist/{styles → packages/styles}/src/components/field-error/field-error.styles.js +0 -0
- /package/dist/{styles → packages/styles}/src/components/input/input.styles.js +0 -0
- /package/dist/{styles → packages/styles}/src/components/label/label.styles.js +0 -0
- /package/dist/{styles → packages/styles}/src/components/popover/popover.styles.js +0 -0
- /package/dist/{styles → packages/styles}/src/components/range-calendar/range-calendar.styles.js +0 -0
- /package/dist/{styles → packages/styles}/src/components/surface/surface.styles.js +0 -0
- /package/dist/{styles → packages/styles}/src/components/text-field/text-field.styles.js +0 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { Menu } from 'react-aria-components';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import { menuVariants } from '../../packages/styles/src/components/menu/menu.styles.js';
|
|
5
|
+
import { composeTwRenderProps } from '../../utils/compose.js';
|
|
6
|
+
|
|
7
|
+
function MenuRoot({
|
|
8
|
+
className,
|
|
9
|
+
...props
|
|
10
|
+
}) {
|
|
11
|
+
const styles = React__default.useMemo(() => menuVariants(), []);
|
|
12
|
+
return /*#__PURE__*/jsx(Menu, {
|
|
13
|
+
className: composeTwRenderProps(className, styles),
|
|
14
|
+
"data-slot": "menu",
|
|
15
|
+
...props
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { MenuRoot };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { MenuItemIndicator, MenuItemRoot, MenuItemSubmenuIndicator } from "./menu-item";
|
|
3
|
+
export declare const MenuItem: (({ children, className, variant, ...props }: import("./menu-item").MenuItemRootProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
4
|
+
Root: ({ children, className, variant, ...props }: import("./menu-item").MenuItemRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
Indicator: ({ children, className, type, ...props }: import("./menu-item").MenuItemIndicatorProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
SubmenuIndicator: ({ children, className, ...props }: import("./menu-item").MenuItemSubmenuIndicatorProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
7
|
+
};
|
|
8
|
+
export type MenuItem = {
|
|
9
|
+
Props: ComponentProps<typeof MenuItemRoot>;
|
|
10
|
+
RootProps: ComponentProps<typeof MenuItemRoot>;
|
|
11
|
+
IndicatorProps: ComponentProps<typeof MenuItemIndicator>;
|
|
12
|
+
SubmenuIndicatorProps: ComponentProps<typeof MenuItemSubmenuIndicator>;
|
|
13
|
+
};
|
|
14
|
+
export { MenuItemRoot, MenuItemIndicator, MenuItemSubmenuIndicator };
|
|
15
|
+
export type { MenuItemRootProps, MenuItemRootProps as MenuItemProps, MenuItemIndicatorProps, MenuItemSubmenuIndicatorProps, } from "./menu-item";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MenuItemRoot, MenuItemSubmenuIndicator, MenuItemIndicator } from './menu-item.js';
|
|
2
|
+
|
|
3
|
+
/* -------------------------------------------------------------------------------------------------
|
|
4
|
+
* Compound Component
|
|
5
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
6
|
+
const MenuItem = Object.assign(MenuItemRoot, {
|
|
7
|
+
Root: MenuItemRoot,
|
|
8
|
+
Indicator: MenuItemIndicator,
|
|
9
|
+
SubmenuIndicator: MenuItemSubmenuIndicator
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export { MenuItem, MenuItemIndicator, MenuItemRoot, MenuItemSubmenuIndicator };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from "react";
|
|
2
|
+
import type { MenuItemRenderProps } from "react-aria-components";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { MenuItem as MenuItemPrimitive } from "react-aria-components";
|
|
5
|
+
import { type MenuItemVariants } from "@arobo/styles";
|
|
6
|
+
interface MenuItemRootProps extends ComponentPropsWithRef<typeof MenuItemPrimitive>, MenuItemVariants {
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
declare const MenuItemRoot: ({ children, className, variant, ...props }: MenuItemRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
interface MenuItemIndicatorProps extends Omit<ComponentPropsWithRef<"span">, "children"> {
|
|
11
|
+
children?: React.ReactNode | ((props: MenuItemRenderProps) => React.ReactNode);
|
|
12
|
+
type?: "checkmark" | "dot";
|
|
13
|
+
}
|
|
14
|
+
declare const MenuItemIndicator: ({ children, className, type, ...props }: MenuItemIndicatorProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
interface MenuItemSubmenuIndicatorProps extends Omit<ComponentPropsWithRef<"span">, "children"> {
|
|
16
|
+
children?: React.ReactNode;
|
|
17
|
+
}
|
|
18
|
+
declare const MenuItemSubmenuIndicator: ({ children, className, ...props }: MenuItemSubmenuIndicatorProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
19
|
+
export { MenuItemRoot, MenuItemIndicator, MenuItemSubmenuIndicator };
|
|
20
|
+
export type { MenuItemRootProps, MenuItemIndicatorProps, MenuItemSubmenuIndicatorProps };
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import React__default, { createContext, useContext } from 'react';
|
|
2
|
+
import { MenuItem } from 'react-aria-components';
|
|
3
|
+
import { IconChevronRight } from '../icons.js';
|
|
4
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
|
+
import { menuItemVariants } from '../../packages/styles/src/components/menu-item/menu-item.styles.js';
|
|
6
|
+
import { composeTwRenderProps, composeSlotClassName } from '../../utils/compose.js';
|
|
7
|
+
|
|
8
|
+
const MenuItemContext = /*#__PURE__*/createContext({});
|
|
9
|
+
|
|
10
|
+
/* -------------------------------------------------------------------------------------------------
|
|
11
|
+
* Menu Item Root
|
|
12
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
13
|
+
|
|
14
|
+
const MenuItemRoot = ({
|
|
15
|
+
children,
|
|
16
|
+
className,
|
|
17
|
+
variant,
|
|
18
|
+
...props
|
|
19
|
+
}) => {
|
|
20
|
+
const slots = React__default.useMemo(() => menuItemVariants({
|
|
21
|
+
variant
|
|
22
|
+
}), [variant]);
|
|
23
|
+
return /*#__PURE__*/jsx(MenuItem, {
|
|
24
|
+
className: composeTwRenderProps(className, slots.item()),
|
|
25
|
+
"data-slot": "menu-item",
|
|
26
|
+
...props,
|
|
27
|
+
children: values => /*#__PURE__*/jsx(MenuItemContext, {
|
|
28
|
+
value: {
|
|
29
|
+
slots,
|
|
30
|
+
state: values
|
|
31
|
+
},
|
|
32
|
+
children: typeof children === "function" ? children(values) : children
|
|
33
|
+
})
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/* -------------------------------------------------------------------------------------------------
|
|
38
|
+
* Menu Item Indicator
|
|
39
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
40
|
+
|
|
41
|
+
const MenuItemIndicator = ({
|
|
42
|
+
children,
|
|
43
|
+
className,
|
|
44
|
+
type = "checkmark",
|
|
45
|
+
...props
|
|
46
|
+
}) => {
|
|
47
|
+
const {
|
|
48
|
+
slots,
|
|
49
|
+
state
|
|
50
|
+
} = useContext(MenuItemContext);
|
|
51
|
+
const isSelected = state?.isSelected;
|
|
52
|
+
const content = typeof children === "function" ? children(state ?? {}) : children ? children : type === "dot" ? /*#__PURE__*/jsx("svg", {
|
|
53
|
+
"aria-hidden": "true",
|
|
54
|
+
"data-slot": "menu-item-indicator--dot",
|
|
55
|
+
fill: "currentColor",
|
|
56
|
+
fillRule: "evenodd",
|
|
57
|
+
role: "presentation",
|
|
58
|
+
viewBox: "0 0 16 16",
|
|
59
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
60
|
+
children: /*#__PURE__*/jsx("path", {
|
|
61
|
+
clipRule: "evenodd",
|
|
62
|
+
d: "M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14",
|
|
63
|
+
fillRule: "evenodd"
|
|
64
|
+
})
|
|
65
|
+
}) : /*#__PURE__*/jsx("svg", {
|
|
66
|
+
"aria-hidden": "true",
|
|
67
|
+
"data-slot": "menu-item-indicator--checkmark",
|
|
68
|
+
fill: "none",
|
|
69
|
+
role: "presentation",
|
|
70
|
+
stroke: "currentColor",
|
|
71
|
+
strokeDasharray: 22,
|
|
72
|
+
strokeDashoffset: isSelected ? 44 : 66,
|
|
73
|
+
strokeLinecap: "round",
|
|
74
|
+
strokeLinejoin: "round",
|
|
75
|
+
strokeWidth: 2,
|
|
76
|
+
viewBox: "0 0 17 18",
|
|
77
|
+
children: /*#__PURE__*/jsx("polyline", {
|
|
78
|
+
points: "1 9 7 14 15 4"
|
|
79
|
+
})
|
|
80
|
+
});
|
|
81
|
+
return /*#__PURE__*/jsx("span", {
|
|
82
|
+
"aria-hidden": "true",
|
|
83
|
+
className: composeSlotClassName(slots?.indicator, className),
|
|
84
|
+
"data-slot": "menu-item-indicator",
|
|
85
|
+
"data-type": type,
|
|
86
|
+
"data-visible": isSelected || undefined,
|
|
87
|
+
...props,
|
|
88
|
+
children: content
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
/* -------------------------------------------------------------------------------------------------
|
|
93
|
+
* Menu Item Submenu Indicator
|
|
94
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
95
|
+
|
|
96
|
+
const MenuItemSubmenuIndicator = ({
|
|
97
|
+
children,
|
|
98
|
+
className,
|
|
99
|
+
...props
|
|
100
|
+
}) => {
|
|
101
|
+
const {
|
|
102
|
+
slots,
|
|
103
|
+
state
|
|
104
|
+
} = useContext(MenuItemContext);
|
|
105
|
+
const hasSubmenu = state?.hasSubmenu;
|
|
106
|
+
|
|
107
|
+
// Only render if hasSubmenu is true
|
|
108
|
+
if (!hasSubmenu) {
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
const defaultContent = /*#__PURE__*/jsx(IconChevronRight, {});
|
|
112
|
+
const content = children ?? defaultContent;
|
|
113
|
+
return /*#__PURE__*/jsx("span", {
|
|
114
|
+
"aria-hidden": "true",
|
|
115
|
+
className: composeSlotClassName(slots?.submenuIndicator, className),
|
|
116
|
+
"data-slot": "submenu-indicator",
|
|
117
|
+
...props,
|
|
118
|
+
children: content
|
|
119
|
+
});
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
export { MenuItemIndicator, MenuItemRoot, MenuItemSubmenuIndicator };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { MenuSectionRoot } from "./menu-section";
|
|
3
|
+
export declare const MenuSection: ({ children, className, ...props }: import("./menu-section").MenuSectionRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export type MenuSection = {
|
|
5
|
+
Props: ComponentProps<typeof MenuSectionRoot>;
|
|
6
|
+
};
|
|
7
|
+
export { MenuSectionRoot };
|
|
8
|
+
export type { MenuSectionRootProps, MenuSectionRootProps as MenuSectionProps } from "./menu-section";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { MenuSectionRoot } from './menu-section.js';
|
|
2
|
+
|
|
3
|
+
/* -------------------------------------------------------------------------------------------------
|
|
4
|
+
* Compound Component
|
|
5
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
6
|
+
const MenuSection = MenuSectionRoot;
|
|
7
|
+
|
|
8
|
+
export { MenuSection, MenuSectionRoot };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from "react";
|
|
2
|
+
import { MenuSection as MenuSectionPrimitive } from "react-aria-components";
|
|
3
|
+
interface MenuSectionRootProps extends ComponentPropsWithRef<typeof MenuSectionPrimitive> {
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
declare const MenuSectionRoot: ({ children, className, ...props }: MenuSectionRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export { MenuSectionRoot };
|
|
8
|
+
export type { MenuSectionRootProps };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { MenuSection } from 'react-aria-components';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import { menuSectionVariants } from '../../packages/styles/src/components/menu-section/menu-section.styles.js';
|
|
5
|
+
|
|
6
|
+
const MenuSectionRoot = ({
|
|
7
|
+
children,
|
|
8
|
+
className,
|
|
9
|
+
...props
|
|
10
|
+
}) => {
|
|
11
|
+
const styles = React__default.useMemo(() => menuSectionVariants({
|
|
12
|
+
class: typeof className === "string" ? className : undefined
|
|
13
|
+
}), [className]);
|
|
14
|
+
return /*#__PURE__*/jsx(MenuSection, {
|
|
15
|
+
className: styles,
|
|
16
|
+
...props,
|
|
17
|
+
children: children
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export { MenuSectionRoot };
|
|
@@ -0,0 +1,31 @@
|
|
|
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, 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";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ModalRoot, ModalCloseTrigger, ModalFooter, ModalBody, ModalHeading, ModalIcon, ModalHeader, ModalDialog, ModalContainer, ModalBackdrop, ModalTrigger } from './modal.js';
|
|
2
|
+
|
|
3
|
+
/* -------------------------------------------------------------------------------------------------
|
|
4
|
+
* Compound Component
|
|
5
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
6
|
+
const Modal = Object.assign(ModalRoot, {
|
|
7
|
+
Root: ModalRoot,
|
|
8
|
+
Trigger: ModalTrigger,
|
|
9
|
+
Backdrop: ModalBackdrop,
|
|
10
|
+
Container: ModalContainer,
|
|
11
|
+
Dialog: ModalDialog,
|
|
12
|
+
Header: ModalHeader,
|
|
13
|
+
Icon: ModalIcon,
|
|
14
|
+
Heading: ModalHeading,
|
|
15
|
+
Body: ModalBody,
|
|
16
|
+
Footer: ModalFooter,
|
|
17
|
+
CloseTrigger: ModalCloseTrigger
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
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 { ComponentPropsWithRef, ReactNode } from "react";
|
|
3
|
+
import type { Button as ButtonPrimitive, DialogProps as DialogPrimitiveProps } from "react-aria-components";
|
|
4
|
+
import { Heading as HeadingPrimitive, ModalOverlay as ModalOverlayPrimitive, Modal as ModalPrimitive, DialogTrigger as ModalTriggerPrimitive } from "react-aria-components";
|
|
5
|
+
import type { ModalVariants } from "@arobo/styles";
|
|
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, 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,283 @@
|
|
|
1
|
+
import { useMemo, createContext, useContext } from 'react';
|
|
2
|
+
import { DialogTrigger, Heading, Dialog, Modal, ModalOverlay, Pressable } from 'react-aria-components';
|
|
3
|
+
import { composeTwRenderProps, composeSlotClassName } from '../../utils/compose.js';
|
|
4
|
+
import { CloseButton } from '../close-button/index.js';
|
|
5
|
+
import { mergeProps } from '../../utils/merge-props.js';
|
|
6
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
|
+
import { modalVariants } from '../../packages/styles/src/components/modal/modal.styles.js';
|
|
8
|
+
import { SurfaceContext } from '../surface/surface.js';
|
|
9
|
+
|
|
10
|
+
const ModalContext = /*#__PURE__*/createContext({});
|
|
11
|
+
|
|
12
|
+
/* -------------------------------------------------------------------------------------------------
|
|
13
|
+
* Modal Root
|
|
14
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
15
|
+
|
|
16
|
+
const ModalRoot = ({
|
|
17
|
+
children,
|
|
18
|
+
state,
|
|
19
|
+
...props
|
|
20
|
+
}) => {
|
|
21
|
+
const modalContext = useMemo(() => ({
|
|
22
|
+
slots: modalVariants(),
|
|
23
|
+
placement: undefined
|
|
24
|
+
}), []);
|
|
25
|
+
const controlledProps = useMemo(() => state ? {
|
|
26
|
+
isOpen: state.isOpen,
|
|
27
|
+
onOpenChange: state.setOpen
|
|
28
|
+
} : {}, [state]);
|
|
29
|
+
return /*#__PURE__*/jsx(ModalContext, {
|
|
30
|
+
value: modalContext,
|
|
31
|
+
children: /*#__PURE__*/jsx(DialogTrigger, {
|
|
32
|
+
"data-slot": "modal-root",
|
|
33
|
+
...props,
|
|
34
|
+
...mergeProps(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
|
+
variant,
|
|
72
|
+
...props
|
|
73
|
+
}) => {
|
|
74
|
+
const {
|
|
75
|
+
slots: contextSlots
|
|
76
|
+
} = useContext(ModalContext);
|
|
77
|
+
const updatedSlots = useMemo(() => modalVariants({
|
|
78
|
+
variant
|
|
79
|
+
}), [variant]);
|
|
80
|
+
const updatedModalContext = useMemo(() => ({
|
|
81
|
+
slots: {
|
|
82
|
+
...contextSlots,
|
|
83
|
+
...updatedSlots
|
|
84
|
+
}
|
|
85
|
+
}), [contextSlots, updatedSlots]);
|
|
86
|
+
return /*#__PURE__*/jsx(ModalOverlay, {
|
|
87
|
+
className: composeTwRenderProps(className, updatedSlots?.backdrop()),
|
|
88
|
+
"data-slot": "modal-backdrop",
|
|
89
|
+
isDismissable: isDismissable,
|
|
90
|
+
...props,
|
|
91
|
+
children: renderProps => /*#__PURE__*/jsxs(ModalContext, {
|
|
92
|
+
value: updatedModalContext,
|
|
93
|
+
children: [typeof children === "function" ? children(renderProps) : children, " "]
|
|
94
|
+
})
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
/* -------------------------------------------------------------------------------------------------
|
|
99
|
+
* Modal Container
|
|
100
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
101
|
+
|
|
102
|
+
const ModalContainer = ({
|
|
103
|
+
children,
|
|
104
|
+
className,
|
|
105
|
+
placement = "auto",
|
|
106
|
+
scroll,
|
|
107
|
+
size,
|
|
108
|
+
...props
|
|
109
|
+
}) => {
|
|
110
|
+
const {
|
|
111
|
+
slots: contextSlots
|
|
112
|
+
} = useContext(ModalContext);
|
|
113
|
+
const updatedSlots = useMemo(() => modalVariants({
|
|
114
|
+
scroll,
|
|
115
|
+
size
|
|
116
|
+
}), [scroll, size]);
|
|
117
|
+
const updatedModalContext = useMemo(() => ({
|
|
118
|
+
placement,
|
|
119
|
+
slots: {
|
|
120
|
+
...contextSlots,
|
|
121
|
+
...updatedSlots
|
|
122
|
+
}
|
|
123
|
+
}), [contextSlots, placement, updatedSlots]);
|
|
124
|
+
return /*#__PURE__*/jsx(Modal, {
|
|
125
|
+
className: composeTwRenderProps(className, updatedSlots?.container()),
|
|
126
|
+
"data-placement": placement,
|
|
127
|
+
"data-slot": "modal-container",
|
|
128
|
+
...props,
|
|
129
|
+
children: renderProps => /*#__PURE__*/jsx(ModalContext, {
|
|
130
|
+
value: updatedModalContext,
|
|
131
|
+
children: typeof children === "function" ? children(renderProps) : children
|
|
132
|
+
})
|
|
133
|
+
});
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
/* -------------------------------------------------------------------------------------------------
|
|
137
|
+
* Modal Dialog
|
|
138
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
139
|
+
|
|
140
|
+
const ModalDialog = ({
|
|
141
|
+
children,
|
|
142
|
+
className,
|
|
143
|
+
...props
|
|
144
|
+
}) => {
|
|
145
|
+
const {
|
|
146
|
+
placement,
|
|
147
|
+
slots
|
|
148
|
+
} = useContext(ModalContext);
|
|
149
|
+
return /*#__PURE__*/jsx(SurfaceContext, {
|
|
150
|
+
value: {
|
|
151
|
+
variant: "default"
|
|
152
|
+
},
|
|
153
|
+
children: /*#__PURE__*/jsx(Dialog, {
|
|
154
|
+
className: composeSlotClassName(slots?.dialog, className),
|
|
155
|
+
"data-placement": placement,
|
|
156
|
+
"data-slot": "modal-dialog",
|
|
157
|
+
...props,
|
|
158
|
+
children: children
|
|
159
|
+
})
|
|
160
|
+
});
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
/* -------------------------------------------------------------------------------------------------
|
|
164
|
+
* Modal Header
|
|
165
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
166
|
+
|
|
167
|
+
const ModalHeader = ({
|
|
168
|
+
children,
|
|
169
|
+
className,
|
|
170
|
+
...props
|
|
171
|
+
}) => {
|
|
172
|
+
const {
|
|
173
|
+
slots
|
|
174
|
+
} = useContext(ModalContext);
|
|
175
|
+
return /*#__PURE__*/jsx("div", {
|
|
176
|
+
className: composeSlotClassName(slots?.header, className),
|
|
177
|
+
"data-slot": "modal-header",
|
|
178
|
+
...props,
|
|
179
|
+
children: children
|
|
180
|
+
});
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
/* -------------------------------------------------------------------------------------------------
|
|
184
|
+
* Modal Body
|
|
185
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
186
|
+
|
|
187
|
+
const ModalBody = ({
|
|
188
|
+
children,
|
|
189
|
+
className,
|
|
190
|
+
...props
|
|
191
|
+
}) => {
|
|
192
|
+
const {
|
|
193
|
+
slots
|
|
194
|
+
} = useContext(ModalContext);
|
|
195
|
+
return /*#__PURE__*/jsx("div", {
|
|
196
|
+
className: composeSlotClassName(slots?.body, className),
|
|
197
|
+
"data-slot": "modal-body",
|
|
198
|
+
...props,
|
|
199
|
+
children: children
|
|
200
|
+
});
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
/* -------------------------------------------------------------------------------------------------
|
|
204
|
+
* Modal Footer
|
|
205
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
206
|
+
|
|
207
|
+
const ModalFooter = ({
|
|
208
|
+
children,
|
|
209
|
+
className,
|
|
210
|
+
...props
|
|
211
|
+
}) => {
|
|
212
|
+
const {
|
|
213
|
+
slots
|
|
214
|
+
} = useContext(ModalContext);
|
|
215
|
+
return /*#__PURE__*/jsx("div", {
|
|
216
|
+
className: composeSlotClassName(slots?.footer, className),
|
|
217
|
+
"data-slot": "modal-footer",
|
|
218
|
+
...props,
|
|
219
|
+
children: children
|
|
220
|
+
});
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
/* -------------------------------------------------------------------------------------------------
|
|
224
|
+
* Modal Heading
|
|
225
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
226
|
+
|
|
227
|
+
const ModalHeading = ({
|
|
228
|
+
children,
|
|
229
|
+
className,
|
|
230
|
+
...props
|
|
231
|
+
}) => {
|
|
232
|
+
const {
|
|
233
|
+
slots
|
|
234
|
+
} = useContext(ModalContext);
|
|
235
|
+
return /*#__PURE__*/jsx(Heading, {
|
|
236
|
+
className: composeSlotClassName(slots?.heading, className),
|
|
237
|
+
"data-slot": "modal-heading",
|
|
238
|
+
slot: "title",
|
|
239
|
+
...props,
|
|
240
|
+
children: children
|
|
241
|
+
});
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
/* -------------------------------------------------------------------------------------------------
|
|
245
|
+
* AlertDialog Icon
|
|
246
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
247
|
+
|
|
248
|
+
const ModalIcon = ({
|
|
249
|
+
children,
|
|
250
|
+
className,
|
|
251
|
+
...props
|
|
252
|
+
}) => {
|
|
253
|
+
const {
|
|
254
|
+
slots
|
|
255
|
+
} = useContext(ModalContext);
|
|
256
|
+
return /*#__PURE__*/jsx("div", {
|
|
257
|
+
className: composeSlotClassName(slots?.icon, className),
|
|
258
|
+
"data-slot": "modal-icon",
|
|
259
|
+
...props,
|
|
260
|
+
children: children
|
|
261
|
+
});
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
/* -------------------------------------------------------------------------------------------------
|
|
265
|
+
* Modal Close Trigger
|
|
266
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
267
|
+
|
|
268
|
+
const ModalCloseTrigger = ({
|
|
269
|
+
className,
|
|
270
|
+
...rest
|
|
271
|
+
}) => {
|
|
272
|
+
const {
|
|
273
|
+
slots
|
|
274
|
+
} = useContext(ModalContext);
|
|
275
|
+
return /*#__PURE__*/jsx(CloseButton, {
|
|
276
|
+
className: composeTwRenderProps(className, slots?.closeTrigger()),
|
|
277
|
+
"data-slot": "modal-close-trigger",
|
|
278
|
+
slot: "close",
|
|
279
|
+
...rest
|
|
280
|
+
});
|
|
281
|
+
};
|
|
282
|
+
|
|
283
|
+
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 "@arobo/styles";
|
|
21
|
+
export type { NumberFieldVariants } from "@arobo/styles";
|