@arobo/react 1.0.1 → 1.1.1
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 +26 -0
- package/dist/components/carousel/carousel.js +170 -0
- package/dist/components/carousel/index.d.ts +17 -0
- package/dist/components/carousel/index.js +10 -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 +111 -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,13 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { TagRemoveButton, TagRoot } from "./tag";
|
|
3
|
+
export declare const Tag: (({ children, className, ...restProps }: import("./tag").TagRootProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
4
|
+
Root: ({ children, className, ...restProps }: import("./tag").TagRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
RemoveButton: ({ children, className, ...restProps }: import("./tag").TagRemoveButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
};
|
|
7
|
+
export type Tag = {
|
|
8
|
+
Props: ComponentProps<typeof TagRoot>;
|
|
9
|
+
RootProps: ComponentProps<typeof TagRoot>;
|
|
10
|
+
RemoveButtonProps: ComponentProps<typeof TagRemoveButton>;
|
|
11
|
+
};
|
|
12
|
+
export { TagRoot, TagRemoveButton };
|
|
13
|
+
export type { TagRootProps, TagRemoveButtonProps } from "./tag";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TagRoot, TagRemoveButton } from './tag.js';
|
|
2
|
+
|
|
3
|
+
/* -------------------------------------------------------------------------------------------------
|
|
4
|
+
* Compound Component
|
|
5
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
6
|
+
const Tag = Object.assign(TagRoot, {
|
|
7
|
+
Root: TagRoot,
|
|
8
|
+
RemoveButton: TagRemoveButton
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export { Tag, TagRemoveButton, TagRoot };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from "react";
|
|
2
|
+
import type { Button as ButtonPrimitive } from "react-aria-components";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { Tag as TagPrimitive } from "react-aria-components";
|
|
5
|
+
import { type TagVariants } from "@arobo/styles";
|
|
6
|
+
interface TagRootProps extends ComponentPropsWithRef<typeof TagPrimitive>, TagVariants {
|
|
7
|
+
}
|
|
8
|
+
declare const TagRoot: ({ children, className, ...restProps }: TagRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
type TagRemoveButtonProps = ComponentPropsWithRef<typeof ButtonPrimitive> & {
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
};
|
|
12
|
+
declare const TagRemoveButton: ({ children, className, ...restProps }: TagRemoveButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export { TagRoot, TagRemoveButton };
|
|
14
|
+
export type { TagRootProps, TagRemoveButtonProps };
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { useContext, useMemo, Children, createContext } from 'react';
|
|
2
|
+
import { Tag } from 'react-aria-components';
|
|
3
|
+
import { composeTwRenderProps } from '../../utils/compose.js';
|
|
4
|
+
import { CloseButton } from '../close-button/index.js';
|
|
5
|
+
import '../tag-group/index.js';
|
|
6
|
+
import { pickChildren } from '../../utils/children.js';
|
|
7
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
8
|
+
import { TagGroupContext } from '../tag-group/tag-group.js';
|
|
9
|
+
import { tagVariants } from '../../packages/styles/src/components/tag/tag.styles.js';
|
|
10
|
+
|
|
11
|
+
const TagContext = /*#__PURE__*/createContext({});
|
|
12
|
+
|
|
13
|
+
/* -------------------------------------------------------------------------------------------------
|
|
14
|
+
* Tag Root
|
|
15
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
16
|
+
|
|
17
|
+
const TagRoot = ({
|
|
18
|
+
children,
|
|
19
|
+
className,
|
|
20
|
+
...restProps
|
|
21
|
+
}) => {
|
|
22
|
+
const {
|
|
23
|
+
size,
|
|
24
|
+
variant
|
|
25
|
+
} = useContext(TagGroupContext);
|
|
26
|
+
const slots = useMemo(() => tagVariants({
|
|
27
|
+
size,
|
|
28
|
+
variant
|
|
29
|
+
}), [size, variant]);
|
|
30
|
+
const textValue = useMemo(() => {
|
|
31
|
+
if (typeof children === "string") {
|
|
32
|
+
return children;
|
|
33
|
+
}
|
|
34
|
+
if (typeof children === "object") {
|
|
35
|
+
return Children.toArray(children).filter(node => typeof node === "string").at(0);
|
|
36
|
+
}
|
|
37
|
+
return undefined;
|
|
38
|
+
}, [children]);
|
|
39
|
+
|
|
40
|
+
// Extract custom RemoveButton from children if present
|
|
41
|
+
const [childrenWithoutRemoveButton, removeButtonChildren] = useMemo(() => {
|
|
42
|
+
if (typeof children === "function") {
|
|
43
|
+
return [children, undefined];
|
|
44
|
+
}
|
|
45
|
+
return pickChildren(children, TagRemoveButton);
|
|
46
|
+
}, [children]);
|
|
47
|
+
return /*#__PURE__*/jsx(Tag, {
|
|
48
|
+
className: composeTwRenderProps(className, slots.base()),
|
|
49
|
+
"data-slot": "tag",
|
|
50
|
+
textValue: textValue,
|
|
51
|
+
...restProps,
|
|
52
|
+
children: renderProps => /*#__PURE__*/jsx(TagContext, {
|
|
53
|
+
value: {
|
|
54
|
+
slots
|
|
55
|
+
},
|
|
56
|
+
children: typeof children === "function" ? children(renderProps) : /*#__PURE__*/jsxs(Fragment, {
|
|
57
|
+
children: [childrenWithoutRemoveButton, !!renderProps.allowsRemoving && (removeButtonChildren && removeButtonChildren.length > 0 ? removeButtonChildren : /*#__PURE__*/jsx(TagRemoveButton, {}))]
|
|
58
|
+
})
|
|
59
|
+
})
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
/* -------------------------------------------------------------------------------------------------
|
|
64
|
+
* Tag Remove Button
|
|
65
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
66
|
+
|
|
67
|
+
const TagRemoveButton = ({
|
|
68
|
+
children,
|
|
69
|
+
className,
|
|
70
|
+
...restProps
|
|
71
|
+
}) => {
|
|
72
|
+
const {
|
|
73
|
+
slots
|
|
74
|
+
} = useContext(TagContext);
|
|
75
|
+
return /*#__PURE__*/jsx(CloseButton, {
|
|
76
|
+
className: composeTwRenderProps(className, slots?.removeButton()),
|
|
77
|
+
"data-slot": "tag-remove-button",
|
|
78
|
+
slot: "remove",
|
|
79
|
+
...restProps,
|
|
80
|
+
children: children
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export { TagRemoveButton, TagRoot };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { TagGroupContext, TagGroupList, TagGroupRoot } from "./tag-group";
|
|
3
|
+
export declare const TagGroup: (({ children, className, size, variant, ...restProps }: import("./tag-group").TagGroupRootProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
4
|
+
Root: ({ children, className, size, variant, ...restProps }: import("./tag-group").TagGroupRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
List: <T extends object>({ children, className, ...restProps }: import("./tag-group").TagGroupListProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
};
|
|
7
|
+
export type TagGroup = {
|
|
8
|
+
Props: ComponentProps<typeof TagGroupRoot>;
|
|
9
|
+
RootProps: ComponentProps<typeof TagGroupRoot>;
|
|
10
|
+
ListProps: ComponentProps<typeof TagGroupList>;
|
|
11
|
+
};
|
|
12
|
+
export { TagGroupRoot, TagGroupList, TagGroupContext };
|
|
13
|
+
export type { TagGroupRootProps, TagGroupRootProps as TagGroupProps, TagGroupListProps, } from "./tag-group";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TagGroupRoot, TagGroupList } from './tag-group.js';
|
|
2
|
+
export { TagGroupContext } from './tag-group.js';
|
|
3
|
+
|
|
4
|
+
/* -------------------------------------------------------------------------------------------------
|
|
5
|
+
* Compound Component
|
|
6
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
7
|
+
const TagGroup = Object.assign(TagGroupRoot, {
|
|
8
|
+
Root: TagGroupRoot,
|
|
9
|
+
List: TagGroupList
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export { TagGroup, TagGroupList, TagGroupRoot };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from "react";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { TagGroup as TagGroupPrimitive, TagList as TagListPrimitive } from "react-aria-components";
|
|
4
|
+
import { tagGroupVariants, type TagVariants } from "@arobo/styles";
|
|
5
|
+
type TagGroupContext = {
|
|
6
|
+
slots?: ReturnType<typeof tagGroupVariants>;
|
|
7
|
+
size?: TagVariants["size"];
|
|
8
|
+
variant?: TagVariants["variant"];
|
|
9
|
+
};
|
|
10
|
+
declare const TagGroupContext: React.Context<TagGroupContext>;
|
|
11
|
+
type TagGroupRootProps = ComponentPropsWithRef<typeof TagGroupPrimitive> & {
|
|
12
|
+
size?: TagVariants["size"];
|
|
13
|
+
variant?: TagVariants["variant"];
|
|
14
|
+
};
|
|
15
|
+
declare const TagGroupRoot: ({ children, className, size, variant, ...restProps }: TagGroupRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
type TagGroupListProps<T extends object> = ComponentPropsWithRef<typeof TagListPrimitive<T>> & {};
|
|
17
|
+
declare const TagGroupList: <T extends object>({ children, className, ...restProps }: TagGroupListProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export { TagGroupRoot, TagGroupList, TagGroupContext };
|
|
19
|
+
export type { TagGroupRootProps, TagGroupListProps };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { useMemo, createContext, useContext } from 'react';
|
|
2
|
+
import { TagGroup, TagList } from 'react-aria-components';
|
|
3
|
+
import { composeTwRenderProps } from '../../utils/compose.js';
|
|
4
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
|
+
import { tagGroupVariants } from '../../packages/styles/src/components/tag-group/tag-group.styles.js';
|
|
6
|
+
|
|
7
|
+
const TagGroupContext = /*#__PURE__*/createContext({});
|
|
8
|
+
|
|
9
|
+
/* -------------------------------------------------------------------------------------------------
|
|
10
|
+
* TagGroup Root
|
|
11
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
12
|
+
|
|
13
|
+
const TagGroupRoot = ({
|
|
14
|
+
children,
|
|
15
|
+
className,
|
|
16
|
+
size,
|
|
17
|
+
variant,
|
|
18
|
+
...restProps
|
|
19
|
+
}) => {
|
|
20
|
+
const slots = useMemo(() => tagGroupVariants(), []);
|
|
21
|
+
return /*#__PURE__*/jsx(TagGroupContext, {
|
|
22
|
+
value: {
|
|
23
|
+
slots,
|
|
24
|
+
size,
|
|
25
|
+
variant
|
|
26
|
+
},
|
|
27
|
+
children: /*#__PURE__*/jsx(TagGroup, {
|
|
28
|
+
className: slots.base({
|
|
29
|
+
className
|
|
30
|
+
}),
|
|
31
|
+
"data-slot": "tag-group",
|
|
32
|
+
...restProps,
|
|
33
|
+
children: children
|
|
34
|
+
})
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/* -------------------------------------------------------------------------------------------------
|
|
39
|
+
* TagGroup List
|
|
40
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
41
|
+
|
|
42
|
+
const TagGroupList = ({
|
|
43
|
+
children,
|
|
44
|
+
className,
|
|
45
|
+
...restProps
|
|
46
|
+
}) => {
|
|
47
|
+
const {
|
|
48
|
+
slots
|
|
49
|
+
} = useContext(TagGroupContext);
|
|
50
|
+
return /*#__PURE__*/jsx(TagList, {
|
|
51
|
+
className: composeTwRenderProps(className, slots?.list()),
|
|
52
|
+
"data-slot": "tag-group-list",
|
|
53
|
+
...restProps,
|
|
54
|
+
children: children
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export { TagGroupContext, TagGroupList, TagGroupRoot };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TextFieldRoot } from './text-field.js';
|
|
2
2
|
export { TextFieldContext } from './text-field.js';
|
|
3
|
-
export { textFieldVariants } from '../../styles/src/components/text-field/text-field.styles.js';
|
|
3
|
+
export { textFieldVariants } from '../../packages/styles/src/components/text-field/text-field.styles.js';
|
|
4
4
|
|
|
5
5
|
/* -------------------------------------------------------------------------------------------------
|
|
6
6
|
* Compound Component
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default, { createContext } from 'react';
|
|
2
2
|
import { TextField } from 'react-aria-components';
|
|
3
3
|
import { composeTwRenderProps } from '../../utils/compose.js';
|
|
4
4
|
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
5
|
-
import { textFieldVariants } from '../../styles/src/components/text-field/text-field.styles.js';
|
|
5
|
+
import { textFieldVariants } from '../../packages/styles/src/components/text-field/text-field.styles.js';
|
|
6
6
|
|
|
7
7
|
const TextFieldContext = /*#__PURE__*/createContext({});
|
|
8
8
|
|
|
@@ -17,7 +17,7 @@ const TextFieldRoot = ({
|
|
|
17
17
|
variant,
|
|
18
18
|
...props
|
|
19
19
|
}) => {
|
|
20
|
-
const styles =
|
|
20
|
+
const styles = React__default.useMemo(() => textFieldVariants({
|
|
21
21
|
fullWidth
|
|
22
22
|
}), [fullWidth]);
|
|
23
23
|
return /*#__PURE__*/jsx(TextField, {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { TextAreaRoot } from "./textarea";
|
|
3
|
+
export declare const TextArea: (({ className, fullWidth, variant, ...rest }: import("./textarea").TextAreaRootProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
4
|
+
Root: ({ className, fullWidth, variant, ...rest }: import("./textarea").TextAreaRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
};
|
|
6
|
+
export type TextArea = {
|
|
7
|
+
Props: ComponentProps<typeof TextAreaRoot>;
|
|
8
|
+
RootProps: ComponentProps<typeof TextAreaRoot>;
|
|
9
|
+
};
|
|
10
|
+
export { TextAreaRoot };
|
|
11
|
+
export type { TextAreaRootProps, TextAreaRootProps as TextAreaProps } from "./textarea";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TextAreaRoot } from './textarea.js';
|
|
2
|
+
|
|
3
|
+
/* -------------------------------------------------------------------------------------------------
|
|
4
|
+
* Compound Component
|
|
5
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
6
|
+
const TextArea = Object.assign(TextAreaRoot, {
|
|
7
|
+
Root: TextAreaRoot
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export { TextArea, TextAreaRoot };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from "react";
|
|
2
|
+
import { TextArea as TextAreaPrimitive } from "react-aria-components";
|
|
3
|
+
import { type TextAreaVariants } from "@arobo/styles";
|
|
4
|
+
interface TextAreaRootProps extends ComponentPropsWithRef<typeof TextAreaPrimitive>, TextAreaVariants {
|
|
5
|
+
}
|
|
6
|
+
declare const TextAreaRoot: ({ className, fullWidth, variant, ...rest }: TextAreaRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export { TextAreaRoot };
|
|
8
|
+
export type { TextAreaRootProps };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { useContext } from 'react';
|
|
2
|
+
import { TextArea } from 'react-aria-components';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import { TextFieldContext } from '../text-field/text-field.js';
|
|
5
|
+
import { textAreaVariants } from '../../packages/styles/src/components/textarea/textarea.styles.js';
|
|
6
|
+
import { composeTwRenderProps } from '../../utils/compose.js';
|
|
7
|
+
|
|
8
|
+
const TextAreaRoot = ({
|
|
9
|
+
className,
|
|
10
|
+
fullWidth,
|
|
11
|
+
variant,
|
|
12
|
+
...rest
|
|
13
|
+
}) => {
|
|
14
|
+
const textFieldContext = useContext(TextFieldContext);
|
|
15
|
+
const resolvedVariant = variant ?? textFieldContext?.variant;
|
|
16
|
+
return /*#__PURE__*/jsx(TextArea, {
|
|
17
|
+
"data-slot": "textarea",
|
|
18
|
+
className: composeTwRenderProps(className, textAreaVariants({
|
|
19
|
+
fullWidth,
|
|
20
|
+
variant: resolvedVariant
|
|
21
|
+
})),
|
|
22
|
+
...rest
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export { TextAreaRoot };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// Default gap between toasts
|
|
2
|
+
const DEFAULT_GAP = 8;
|
|
3
|
+
// The default maximum number of visible toasts.
|
|
4
|
+
const DEFAULT_MAX_VISIBLE_TOAST = 3;
|
|
5
|
+
// The default scale factor for toasts.
|
|
6
|
+
const DEFAULT_SCALE_FACTOR = 0.05;
|
|
7
|
+
|
|
8
|
+
export { DEFAULT_GAP, DEFAULT_MAX_VISIBLE_TOAST, DEFAULT_SCALE_FACTOR };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { ToastActionButton, ToastCloseButton, ToastContainer, ToastContent, ToastDescription, ToastIndicator, Toast as ToastRoot, ToastTitle } from "./toast";
|
|
3
|
+
import { ToastQueue, toast, toastQueue } from "./toast-queue";
|
|
4
|
+
export declare const Toast: {
|
|
5
|
+
<T extends object = import("./toast-queue").ToastContentValue>({ children, className, placement, scaleFactor, toast, variant, ...rest }: import("./toast").ToastProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
displayName: string;
|
|
7
|
+
} & {
|
|
8
|
+
Container: {
|
|
9
|
+
<T extends object = import("./toast-queue").ToastContentValue>({ children, className, gap, maxVisibleToasts, placement, queue: queueProp, scaleFactor, ...rest }: import("./toast").ToastContainerProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|
|
12
|
+
Content: ({ children, className, ...rest }: import("./toast").ToastContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
Indicator: {
|
|
14
|
+
({ children, className, variant, ...rest }: import("./toast").ToastIndicatorProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
displayName: string;
|
|
16
|
+
};
|
|
17
|
+
Title: {
|
|
18
|
+
({ children, className, ...rest }: import("./toast").ToastTitleProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
displayName: string;
|
|
20
|
+
};
|
|
21
|
+
Description: {
|
|
22
|
+
({ children, className, ...rest }: import("./toast").ToastDescriptionProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
displayName: string;
|
|
24
|
+
};
|
|
25
|
+
ActionButton: {
|
|
26
|
+
({ children, className, ...rest }: import("./toast").ToastActionButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
displayName: string;
|
|
28
|
+
};
|
|
29
|
+
CloseButton: {
|
|
30
|
+
({ className, ...rest }: import("./toast").ToastCloseButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
displayName: string;
|
|
32
|
+
};
|
|
33
|
+
Queue: typeof ToastQueue;
|
|
34
|
+
toast: {
|
|
35
|
+
(message: import("react").ReactNode, options?: import("./toast-queue").HeroUIToastOptions): string;
|
|
36
|
+
success(message: import("react").ReactNode, options?: Omit<import("./toast-queue").HeroUIToastOptions, "variant">): string;
|
|
37
|
+
danger(message: import("react").ReactNode, options?: Omit<import("./toast-queue").HeroUIToastOptions, "variant">): string;
|
|
38
|
+
info(message: import("react").ReactNode, options?: Omit<import("./toast-queue").HeroUIToastOptions, "variant">): string;
|
|
39
|
+
warning(message: import("react").ReactNode, options?: Omit<import("./toast-queue").HeroUIToastOptions, "variant">): string;
|
|
40
|
+
promise<T>(promise: Promise<T> | (() => Promise<T>), options: import("./toast-queue").ToastPromiseOptions<T>): string;
|
|
41
|
+
getQueue(): import("react-aria-components").UNSTABLE_ToastQueue<import("./toast-queue").ToastContentValue>;
|
|
42
|
+
close(key: string): void;
|
|
43
|
+
pauseAll(): void;
|
|
44
|
+
resumeAll(): void;
|
|
45
|
+
clear(): void;
|
|
46
|
+
} & {
|
|
47
|
+
success: (message: import("react").ReactNode, options?: Omit<import("./toast-queue").HeroUIToastOptions, "variant">) => string;
|
|
48
|
+
danger: (message: import("react").ReactNode, options?: Omit<import("./toast-queue").HeroUIToastOptions, "variant">) => string;
|
|
49
|
+
info: (message: import("react").ReactNode, options?: Omit<import("./toast-queue").HeroUIToastOptions, "variant">) => string;
|
|
50
|
+
warning: (message: import("react").ReactNode, options?: Omit<import("./toast-queue").HeroUIToastOptions, "variant">) => string;
|
|
51
|
+
promise: <T>(promise: Promise<T> | (() => Promise<T>), options: import("./toast-queue").ToastPromiseOptions<T>) => string;
|
|
52
|
+
getQueue: () => ReturnType<() => import("react-aria-components").UNSTABLE_ToastQueue<import("./toast-queue").ToastContentValue>>;
|
|
53
|
+
close: (key: string) => void;
|
|
54
|
+
pauseAll: () => void;
|
|
55
|
+
resumeAll: () => void;
|
|
56
|
+
clear: () => void;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
export type Toast = {
|
|
60
|
+
Props: ComponentProps<typeof ToastRoot>;
|
|
61
|
+
ContainerProps: ComponentProps<typeof ToastContainer>;
|
|
62
|
+
ContentProps: ComponentProps<typeof ToastContent>;
|
|
63
|
+
IndicatorProps: ComponentProps<typeof ToastIndicator>;
|
|
64
|
+
TitleProps: ComponentProps<typeof ToastTitle>;
|
|
65
|
+
DescriptionProps: ComponentProps<typeof ToastDescription>;
|
|
66
|
+
ActionProps: ComponentProps<typeof ToastActionButton>;
|
|
67
|
+
CloseButtonProps: ComponentProps<typeof ToastCloseButton>;
|
|
68
|
+
};
|
|
69
|
+
export { ToastContainer, ToastContent, ToastIndicator, ToastTitle, ToastDescription, ToastActionButton, ToastCloseButton, };
|
|
70
|
+
export type { ToastCloseButtonProps, ToastContainerProps, ToastContentProps, ToastDescriptionProps, ToastIndicatorProps, ToastProps, ToastTitleProps, } from "./toast";
|
|
71
|
+
export { ToastQueue, toast, toastQueue };
|
|
72
|
+
export { DEFAULT_MAX_VISIBLE_TOAST, DEFAULT_GAP } from "./constants";
|
|
73
|
+
export type { ToastQueueOptions, ToastContentValue } from "./toast-queue";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Toast as Toast$1, ToastCloseButton, ToastActionButton, ToastDescription, ToastTitle, ToastIndicator, ToastContent, ToastContainer } from './toast.js';
|
|
2
|
+
import { toast, ToastQueue } from './toast-queue.js';
|
|
3
|
+
export { toastQueue } from './toast-queue.js';
|
|
4
|
+
export { DEFAULT_GAP, DEFAULT_MAX_VISIBLE_TOAST } from './constants.js';
|
|
5
|
+
|
|
6
|
+
/* -------------------------------------------------------------------------------------------------
|
|
7
|
+
* Compound Component
|
|
8
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
9
|
+
const Toast = Object.assign(Toast$1, {
|
|
10
|
+
Container: ToastContainer,
|
|
11
|
+
Content: ToastContent,
|
|
12
|
+
Indicator: ToastIndicator,
|
|
13
|
+
Title: ToastTitle,
|
|
14
|
+
Description: ToastDescription,
|
|
15
|
+
ActionButton: ToastActionButton,
|
|
16
|
+
CloseButton: ToastCloseButton,
|
|
17
|
+
Queue: ToastQueue,
|
|
18
|
+
toast
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export { Toast, ToastActionButton, ToastCloseButton, ToastContainer, ToastContent, ToastDescription, ToastIndicator, ToastQueue, ToastTitle, toast };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { ButtonProps } from "../button";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
import type { ToastOptions as RACToastOptions, UNSTABLE_ToastQueue as ToastQueuePrimitiveType } from "react-aria-components";
|
|
4
|
+
export interface ToastQueueOptions {
|
|
5
|
+
/** The maximum number of toasts to display at a time. */
|
|
6
|
+
maxVisibleToasts?: number;
|
|
7
|
+
/** Function to wrap updates in (i.e. document.startViewTransition()). */
|
|
8
|
+
wrapUpdate?: (fn: () => void) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare class ToastQueue<T extends object = ToastContentValue> {
|
|
11
|
+
private queue;
|
|
12
|
+
constructor(options?: ToastQueueOptions);
|
|
13
|
+
add(content: T, options?: RACToastOptions): string;
|
|
14
|
+
close(key: string): void;
|
|
15
|
+
pauseAll(): void;
|
|
16
|
+
resumeAll(): void;
|
|
17
|
+
clear(): void;
|
|
18
|
+
subscribe(fn: () => void): () => void;
|
|
19
|
+
get visibleToasts(): import("react-aria-components").QueuedToast<T>[];
|
|
20
|
+
getQueue(): ToastQueuePrimitiveType<T>;
|
|
21
|
+
}
|
|
22
|
+
export interface ToastContentValue {
|
|
23
|
+
indicator?: ReactNode | undefined;
|
|
24
|
+
title?: ReactNode | undefined;
|
|
25
|
+
description?: ReactNode | undefined;
|
|
26
|
+
variant?: "default" | "accent" | "success" | "warning" | "danger" | undefined;
|
|
27
|
+
actionProps?: ButtonProps | undefined;
|
|
28
|
+
}
|
|
29
|
+
export interface HeroUIToastOptions {
|
|
30
|
+
description?: ReactNode;
|
|
31
|
+
indicator?: ReactNode;
|
|
32
|
+
variant?: ToastContentValue["variant"];
|
|
33
|
+
actionProps?: ButtonProps;
|
|
34
|
+
timeout?: number;
|
|
35
|
+
onClose?: () => void;
|
|
36
|
+
}
|
|
37
|
+
export interface ToastPromiseOptions<T = unknown> {
|
|
38
|
+
loading: ReactNode;
|
|
39
|
+
success: ((data: T) => ReactNode) | ReactNode;
|
|
40
|
+
error: ((error: Error) => ReactNode) | ReactNode;
|
|
41
|
+
}
|
|
42
|
+
declare const toastQueue: ToastQueue<ToastContentValue>;
|
|
43
|
+
export declare const toast: {
|
|
44
|
+
(message: ReactNode, options?: HeroUIToastOptions): string;
|
|
45
|
+
success(message: ReactNode, options?: Omit<HeroUIToastOptions, "variant">): string;
|
|
46
|
+
danger(message: ReactNode, options?: Omit<HeroUIToastOptions, "variant">): string;
|
|
47
|
+
info(message: ReactNode, options?: Omit<HeroUIToastOptions, "variant">): string;
|
|
48
|
+
warning(message: ReactNode, options?: Omit<HeroUIToastOptions, "variant">): string;
|
|
49
|
+
promise<T>(promise: Promise<T> | (() => Promise<T>), options: ToastPromiseOptions<T>): string;
|
|
50
|
+
getQueue(): ToastQueuePrimitiveType<ToastContentValue>;
|
|
51
|
+
close(key: string): void;
|
|
52
|
+
pauseAll(): void;
|
|
53
|
+
resumeAll(): void;
|
|
54
|
+
clear(): void;
|
|
55
|
+
} & {
|
|
56
|
+
success: (message: ReactNode, options?: Omit<HeroUIToastOptions, "variant">) => string;
|
|
57
|
+
danger: (message: ReactNode, options?: Omit<HeroUIToastOptions, "variant">) => string;
|
|
58
|
+
info: (message: ReactNode, options?: Omit<HeroUIToastOptions, "variant">) => string;
|
|
59
|
+
warning: (message: ReactNode, options?: Omit<HeroUIToastOptions, "variant">) => string;
|
|
60
|
+
promise: <T>(promise: Promise<T> | (() => Promise<T>), options: ToastPromiseOptions<T>) => string;
|
|
61
|
+
getQueue: () => ReturnType<() => ToastQueuePrimitiveType<ToastContentValue>>;
|
|
62
|
+
close: (key: string) => void;
|
|
63
|
+
pauseAll: () => void;
|
|
64
|
+
resumeAll: () => void;
|
|
65
|
+
clear: () => void;
|
|
66
|
+
};
|
|
67
|
+
export { toastQueue };
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { UNSTABLE_ToastQueue } from 'react-aria-components';
|
|
2
|
+
import { flushSync } from 'react-dom';
|
|
3
|
+
import { DEFAULT_MAX_VISIBLE_TOAST } from './constants.js';
|
|
4
|
+
|
|
5
|
+
/* ------------------------------------------------------------------------------------------------
|
|
6
|
+
* Toast Queue Options
|
|
7
|
+
* --------------------------------------------------------------------------------------------- */
|
|
8
|
+
|
|
9
|
+
/* ------------------------------------------------------------------------------------------------
|
|
10
|
+
* Toast Queue
|
|
11
|
+
* --------------------------------------------------------------------------------------------- */
|
|
12
|
+
class ToastQueue {
|
|
13
|
+
constructor(options) {
|
|
14
|
+
this.queue = new UNSTABLE_ToastQueue({
|
|
15
|
+
maxVisibleToasts: options?.maxVisibleToasts,
|
|
16
|
+
wrapUpdate: options?.wrapUpdate ? options.wrapUpdate : fn => {
|
|
17
|
+
if ("startViewTransition" in document) {
|
|
18
|
+
document.startViewTransition(() => {
|
|
19
|
+
flushSync(fn);
|
|
20
|
+
});
|
|
21
|
+
} else {
|
|
22
|
+
fn();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
add(content, options) {
|
|
28
|
+
return this.queue.add(content, options);
|
|
29
|
+
}
|
|
30
|
+
close(key) {
|
|
31
|
+
this.queue.close(key);
|
|
32
|
+
}
|
|
33
|
+
pauseAll() {
|
|
34
|
+
this.queue.pauseAll();
|
|
35
|
+
}
|
|
36
|
+
resumeAll() {
|
|
37
|
+
this.queue.resumeAll();
|
|
38
|
+
}
|
|
39
|
+
clear() {
|
|
40
|
+
this.queue.clear();
|
|
41
|
+
}
|
|
42
|
+
subscribe(fn) {
|
|
43
|
+
return this.queue.subscribe(fn);
|
|
44
|
+
}
|
|
45
|
+
get visibleToasts() {
|
|
46
|
+
return this.queue.visibleToasts;
|
|
47
|
+
}
|
|
48
|
+
getQueue() {
|
|
49
|
+
return this.queue;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* ------------------------------------------------------------------------------------------------
|
|
54
|
+
* Toast Queue Instance
|
|
55
|
+
* --------------------------------------------------------------------------------------------- */
|
|
56
|
+
|
|
57
|
+
// Helper function to create toast
|
|
58
|
+
function createToastFunction(queue) {
|
|
59
|
+
const toastFn = (message, options) => {
|
|
60
|
+
return queue.add({
|
|
61
|
+
title: message,
|
|
62
|
+
description: options?.description,
|
|
63
|
+
indicator: options?.indicator,
|
|
64
|
+
variant: options?.variant || "default",
|
|
65
|
+
actionProps: options?.actionProps
|
|
66
|
+
}, {
|
|
67
|
+
timeout: options?.timeout,
|
|
68
|
+
onClose: options?.onClose
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
// Variant methods
|
|
73
|
+
toastFn.success = (message, options) => {
|
|
74
|
+
return toastFn(message, {
|
|
75
|
+
...options,
|
|
76
|
+
variant: "success"
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
toastFn.danger = (message, options) => {
|
|
80
|
+
return toastFn(message, {
|
|
81
|
+
...options,
|
|
82
|
+
variant: "danger"
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
toastFn.info = (message, options) => {
|
|
86
|
+
return toastFn(message, {
|
|
87
|
+
...options,
|
|
88
|
+
variant: "accent"
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
toastFn.warning = (message, options) => {
|
|
92
|
+
return toastFn(message, {
|
|
93
|
+
...options,
|
|
94
|
+
variant: "warning"
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
// Promise support
|
|
99
|
+
toastFn.promise = (promise, options) => {
|
|
100
|
+
const promiseFn = typeof promise === "function" ? promise() : promise;
|
|
101
|
+
const loadingId = toastFn(options.loading, {
|
|
102
|
+
variant: "default"
|
|
103
|
+
});
|
|
104
|
+
promiseFn.then(data => {
|
|
105
|
+
const successMessage = typeof options.success === "function" ? options.success(data) : options.success;
|
|
106
|
+
queue.close(loadingId);
|
|
107
|
+
return toastFn.success(successMessage);
|
|
108
|
+
}).catch(error => {
|
|
109
|
+
const errorMessage = typeof options.error === "function" ? options.error(error) : options.error;
|
|
110
|
+
queue.close(loadingId);
|
|
111
|
+
return toastFn.danger(errorMessage);
|
|
112
|
+
});
|
|
113
|
+
return loadingId;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
// Expose queue methods for advanced usage
|
|
117
|
+
toastFn.getQueue = () => queue.getQueue();
|
|
118
|
+
toastFn.close = key => queue.close(key);
|
|
119
|
+
toastFn.pauseAll = () => queue.pauseAll();
|
|
120
|
+
toastFn.resumeAll = () => queue.resumeAll();
|
|
121
|
+
toastFn.clear = () => queue.clear();
|
|
122
|
+
return toastFn;
|
|
123
|
+
}
|
|
124
|
+
const toastQueue = new ToastQueue({
|
|
125
|
+
maxVisibleToasts: DEFAULT_MAX_VISIBLE_TOAST
|
|
126
|
+
});
|
|
127
|
+
const toast = createToastFunction(toastQueue);
|
|
128
|
+
|
|
129
|
+
export { ToastQueue, toast, toastQueue };
|