@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
|
@@ -3,7 +3,7 @@ import { Calendar, CalendarGrid as CalendarGrid$1, CalendarGridBody, CalendarCel
|
|
|
3
3
|
import { tv } from 'tailwind-variants';
|
|
4
4
|
import { Button } from '../button/index.js';
|
|
5
5
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
6
|
-
import { calendarVariants } from '../../styles/src/components/calendar/calendar.styles.js';
|
|
6
|
+
import { calendarVariants } from '../../packages/styles/src/components/calendar/calendar.styles.js';
|
|
7
7
|
import { focusRing } from '../../utils/styles.js';
|
|
8
8
|
import { composeTwRenderProps } from '../../utils/compose.js';
|
|
9
9
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CalendarRoot } from './calendar.js';
|
|
2
2
|
export { CalendarCell, CalendarGrid, CalendarGridHeader, CalendarHeader } from './calendar.js';
|
|
3
|
-
export { calendarVariants } from '../../styles/src/components/calendar/calendar.styles.js';
|
|
3
|
+
export { calendarVariants } from '../../packages/styles/src/components/calendar/calendar.styles.js';
|
|
4
4
|
|
|
5
5
|
/* -------------------------------------------------------------------------------------------------
|
|
6
6
|
* Compound Component
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default, { createContext, useContext } from 'react';
|
|
2
2
|
import { composeSlotClassName } from '../../utils/compose.js';
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
|
-
import { cardVariants } from '../../styles/src/components/card/card.styles.js';
|
|
4
|
+
import { cardVariants } from '../../packages/styles/src/components/card/card.styles.js';
|
|
5
5
|
import { SurfaceContext } from '../surface/surface.js';
|
|
6
6
|
|
|
7
7
|
const CardContext = /*#__PURE__*/createContext({});
|
|
@@ -16,7 +16,7 @@ const CardRoot = ({
|
|
|
16
16
|
variant = "default",
|
|
17
17
|
...props
|
|
18
18
|
}) => {
|
|
19
|
-
const slots =
|
|
19
|
+
const slots = React__default.useMemo(() => cardVariants({
|
|
20
20
|
variant
|
|
21
21
|
}), [variant]);
|
|
22
22
|
const content = /*#__PURE__*/jsx("div", {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CardRoot, CardFooter, CardContent, CardDescription, CardTitle, CardHeader } from './card.js';
|
|
2
|
-
export { cardVariants } from '../../styles/src/components/card/card.styles.js';
|
|
2
|
+
export { cardVariants } from '../../packages/styles/src/components/card/card.styles.js';
|
|
3
3
|
|
|
4
4
|
/* -------------------------------------------------------------------------------------------------
|
|
5
5
|
* Compound Component
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { UseEmblaCarouselType } from "embla-carousel-react";
|
|
2
|
+
import useEmblaCarousel from "embla-carousel-react";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Button } from "../button";
|
|
5
|
+
export type CarouselApi = UseEmblaCarouselType[1];
|
|
6
|
+
type UseCarouselParameters = Parameters<typeof useEmblaCarousel>;
|
|
7
|
+
type CarouselOptions = UseCarouselParameters[0];
|
|
8
|
+
type CarouselPlugin = UseCarouselParameters[1];
|
|
9
|
+
type CarouselProps = {
|
|
10
|
+
opts?: CarouselOptions;
|
|
11
|
+
plugins?: CarouselPlugin;
|
|
12
|
+
orientation?: "horizontal" | "vertical";
|
|
13
|
+
setApi?: (api: CarouselApi) => void;
|
|
14
|
+
};
|
|
15
|
+
type CarouselRootProps = React.ComponentProps<"div"> & CarouselProps;
|
|
16
|
+
declare function Carousel({ children, className, opts, orientation, plugins, setApi, ...props }: CarouselRootProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
type CarouselContentProps = React.ComponentProps<"div">;
|
|
18
|
+
declare function CarouselContent({ className, ...props }: CarouselContentProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
type CarouselItemProps = React.ComponentProps<"div">;
|
|
20
|
+
declare function CarouselItem({ className, ...props }: CarouselItemProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
type CarouselPreviousProps = React.ComponentProps<typeof Button>;
|
|
22
|
+
declare function CarouselPrevious({ className, size, variant, ...props }: CarouselPreviousProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
type CarouselNextProps = React.ComponentProps<typeof Button>;
|
|
24
|
+
declare function CarouselNext({ className, size, variant, ...props }: CarouselNextProps): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export { Carousel as CarouselRoot, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext, };
|
|
26
|
+
export type { CarouselProps as CarouselRootProps, CarouselContentProps, CarouselItemProps, CarouselPreviousProps, CarouselNextProps, };
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import useEmblaCarousel from 'embla-carousel-react';
|
|
2
|
+
import { ArrowRight, ArrowLeft } from 'lucide-react';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { cn } from 'tailwind-variants';
|
|
5
|
+
import { Button } from '../button/index.js';
|
|
6
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
const CarouselContext = /*#__PURE__*/React.createContext(null);
|
|
9
|
+
function useCarousel() {
|
|
10
|
+
const context = React.useContext(CarouselContext);
|
|
11
|
+
if (!context) {
|
|
12
|
+
throw new Error("useCarousel must be used within a <Carousel />");
|
|
13
|
+
}
|
|
14
|
+
return context;
|
|
15
|
+
}
|
|
16
|
+
function Carousel({
|
|
17
|
+
children,
|
|
18
|
+
className,
|
|
19
|
+
opts,
|
|
20
|
+
orientation = "horizontal",
|
|
21
|
+
plugins,
|
|
22
|
+
setApi,
|
|
23
|
+
...props
|
|
24
|
+
}) {
|
|
25
|
+
const [carouselRef, api] = useEmblaCarousel({
|
|
26
|
+
...opts,
|
|
27
|
+
axis: orientation === "horizontal" ? "x" : "y"
|
|
28
|
+
}, plugins);
|
|
29
|
+
const [canScrollPrev, setCanScrollPrev] = React.useState(false);
|
|
30
|
+
const [canScrollNext, setCanScrollNext] = React.useState(false);
|
|
31
|
+
const onSelect = React.useCallback(api => {
|
|
32
|
+
if (!api) return;
|
|
33
|
+
setCanScrollPrev(api.canScrollPrev());
|
|
34
|
+
setCanScrollNext(api.canScrollNext());
|
|
35
|
+
}, []);
|
|
36
|
+
const scrollPrev = React.useCallback(() => {
|
|
37
|
+
api?.scrollPrev();
|
|
38
|
+
}, [api]);
|
|
39
|
+
const scrollNext = React.useCallback(() => {
|
|
40
|
+
api?.scrollNext();
|
|
41
|
+
}, [api]);
|
|
42
|
+
const handleKeyDown = React.useCallback(event => {
|
|
43
|
+
if (event.key === "ArrowLeft") {
|
|
44
|
+
event.preventDefault();
|
|
45
|
+
scrollPrev();
|
|
46
|
+
} else if (event.key === "ArrowRight") {
|
|
47
|
+
event.preventDefault();
|
|
48
|
+
scrollNext();
|
|
49
|
+
}
|
|
50
|
+
}, [scrollPrev, scrollNext]);
|
|
51
|
+
React.useEffect(() => {
|
|
52
|
+
if (!api || !setApi) return;
|
|
53
|
+
setApi(api);
|
|
54
|
+
}, [api, setApi]);
|
|
55
|
+
React.useEffect(() => {
|
|
56
|
+
if (!api) return;
|
|
57
|
+
onSelect(api);
|
|
58
|
+
api.on("reInit", onSelect);
|
|
59
|
+
api.on("select", onSelect);
|
|
60
|
+
return () => {
|
|
61
|
+
api?.off("select", onSelect);
|
|
62
|
+
};
|
|
63
|
+
}, [api, onSelect]);
|
|
64
|
+
return /*#__PURE__*/jsx(CarouselContext.Provider, {
|
|
65
|
+
value: {
|
|
66
|
+
carouselRef,
|
|
67
|
+
api: api,
|
|
68
|
+
opts,
|
|
69
|
+
orientation: orientation || (opts?.axis === "y" ? "vertical" : "horizontal"),
|
|
70
|
+
scrollPrev,
|
|
71
|
+
scrollNext,
|
|
72
|
+
canScrollPrev,
|
|
73
|
+
canScrollNext
|
|
74
|
+
},
|
|
75
|
+
children: /*#__PURE__*/jsx("div", {
|
|
76
|
+
"aria-roledescription": "carousel",
|
|
77
|
+
className: cn("relative", className),
|
|
78
|
+
"data-slot": "carousel",
|
|
79
|
+
role: "region",
|
|
80
|
+
onKeyDownCapture: handleKeyDown,
|
|
81
|
+
...props,
|
|
82
|
+
children: children
|
|
83
|
+
})
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
function CarouselContent({
|
|
87
|
+
className,
|
|
88
|
+
...props
|
|
89
|
+
}) {
|
|
90
|
+
const {
|
|
91
|
+
carouselRef,
|
|
92
|
+
orientation
|
|
93
|
+
} = useCarousel();
|
|
94
|
+
return /*#__PURE__*/jsx("div", {
|
|
95
|
+
ref: carouselRef,
|
|
96
|
+
className: "overflow-hidden",
|
|
97
|
+
"data-slot": "carousel-content",
|
|
98
|
+
children: /*#__PURE__*/jsx("div", {
|
|
99
|
+
className: cn("flex", orientation === "horizontal" ? "-ml-4" : "-mt-4 flex-col", className),
|
|
100
|
+
...props
|
|
101
|
+
})
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
function CarouselItem({
|
|
105
|
+
className,
|
|
106
|
+
...props
|
|
107
|
+
}) {
|
|
108
|
+
const {
|
|
109
|
+
orientation
|
|
110
|
+
} = useCarousel();
|
|
111
|
+
return /*#__PURE__*/jsx("div", {
|
|
112
|
+
"aria-roledescription": "slide",
|
|
113
|
+
"data-slot": "carousel-item",
|
|
114
|
+
role: "group",
|
|
115
|
+
className: cn("min-w-0 shrink-0 grow-0 basis-full", orientation === "horizontal" ? "pl-4" : "pt-4", className),
|
|
116
|
+
...props
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
function CarouselPrevious({
|
|
120
|
+
className,
|
|
121
|
+
size = "md",
|
|
122
|
+
variant = "outline",
|
|
123
|
+
...props
|
|
124
|
+
}) {
|
|
125
|
+
const {
|
|
126
|
+
orientation,
|
|
127
|
+
scrollPrev,
|
|
128
|
+
canScrollPrev
|
|
129
|
+
} = useCarousel();
|
|
130
|
+
return /*#__PURE__*/jsxs(Button, {
|
|
131
|
+
"data-slot": "carousel-previous",
|
|
132
|
+
isDisabled: !canScrollPrev,
|
|
133
|
+
size: size,
|
|
134
|
+
variant: variant,
|
|
135
|
+
className: cn("absolute size-8 rounded-full", orientation === "horizontal" ? "top-1/2 -left-12 -translate-y-1/2" : "-top-12 left-1/2 -translate-x-1/2 rotate-90", className),
|
|
136
|
+
onClick: scrollPrev,
|
|
137
|
+
...props,
|
|
138
|
+
children: [/*#__PURE__*/jsx(ArrowLeft, {}), /*#__PURE__*/jsx("span", {
|
|
139
|
+
className: "sr-only",
|
|
140
|
+
children: "Previous slide"
|
|
141
|
+
})]
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
function CarouselNext({
|
|
145
|
+
className,
|
|
146
|
+
size = "md",
|
|
147
|
+
variant = "outline",
|
|
148
|
+
...props
|
|
149
|
+
}) {
|
|
150
|
+
const {
|
|
151
|
+
orientation,
|
|
152
|
+
scrollNext,
|
|
153
|
+
canScrollNext
|
|
154
|
+
} = useCarousel();
|
|
155
|
+
return /*#__PURE__*/jsxs(Button, {
|
|
156
|
+
"data-slot": "carousel-next",
|
|
157
|
+
isDisabled: !canScrollNext,
|
|
158
|
+
size: size,
|
|
159
|
+
variant: variant,
|
|
160
|
+
className: cn("absolute size-8 rounded-full", orientation === "horizontal" ? "top-1/2 -right-12 -translate-y-1/2" : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90", className),
|
|
161
|
+
onClick: scrollNext,
|
|
162
|
+
...props,
|
|
163
|
+
children: [/*#__PURE__*/jsx(ArrowRight, {}), /*#__PURE__*/jsx("span", {
|
|
164
|
+
className: "sr-only",
|
|
165
|
+
children: "Next slide"
|
|
166
|
+
})]
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export { CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, Carousel as CarouselRoot };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, CarouselRoot } from "./carousel";
|
|
2
|
+
export declare const Carousel: typeof CarouselRoot & {
|
|
3
|
+
Content: typeof CarouselContent;
|
|
4
|
+
Item: typeof CarouselItem;
|
|
5
|
+
Previous: typeof CarouselPrevious;
|
|
6
|
+
Next: typeof CarouselNext;
|
|
7
|
+
};
|
|
8
|
+
export type Carousel = {
|
|
9
|
+
Props: React.ComponentProps<typeof CarouselRoot>;
|
|
10
|
+
RootProps: React.ComponentProps<typeof CarouselRoot>;
|
|
11
|
+
ContentProps: React.ComponentProps<typeof CarouselContent>;
|
|
12
|
+
ItemProps: React.ComponentProps<typeof CarouselItem>;
|
|
13
|
+
PreviousProps: React.ComponentProps<typeof CarouselPrevious>;
|
|
14
|
+
NextProps: React.ComponentProps<typeof CarouselNext>;
|
|
15
|
+
};
|
|
16
|
+
export { CarouselRoot, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext, };
|
|
17
|
+
export type { CarouselApi, CarouselRootProps, CarouselContentProps, CarouselItemProps, CarouselPreviousProps, CarouselNextProps, } from "./carousel";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CarouselRoot as Carousel$1, CarouselNext, CarouselPrevious, CarouselItem, CarouselContent } from './carousel.js';
|
|
2
|
+
|
|
3
|
+
const Carousel = Object.assign(Carousel$1, {
|
|
4
|
+
Content: CarouselContent,
|
|
5
|
+
Item: CarouselItem,
|
|
6
|
+
Previous: CarouselPrevious,
|
|
7
|
+
Next: CarouselNext
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, Carousel$1 as CarouselRoot };
|
|
@@ -3,11 +3,14 @@ import type { ComponentPropsWithRef } from "react";
|
|
|
3
3
|
import type { CheckboxRenderProps } from "react-aria-components";
|
|
4
4
|
import React from "react";
|
|
5
5
|
import { Checkbox as CheckboxPrimitive } from "react-aria-components";
|
|
6
|
+
type CheckboxRenderable = React.ReactNode | ((props: CheckboxRenderProps) => React.ReactNode);
|
|
6
7
|
interface CheckboxRootProps extends ComponentPropsWithRef<typeof CheckboxPrimitive>, CheckboxVariants {
|
|
7
|
-
/** The name of the checkbox, used when submitting an HTML form. */
|
|
8
8
|
name?: string;
|
|
9
|
+
checked?: boolean;
|
|
10
|
+
defaultChecked?: boolean;
|
|
11
|
+
isPreventLabelClick?: boolean;
|
|
9
12
|
}
|
|
10
|
-
declare const CheckboxRoot: ({ children, className, variant, ...props }: CheckboxRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare const CheckboxRoot: ({ children, className, checked, defaultChecked, isPreventLabelClick, isSelected, defaultSelected, variant, ...props }: CheckboxRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
14
|
interface CheckboxControlProps extends ComponentPropsWithRef<"span"> {
|
|
12
15
|
}
|
|
13
16
|
declare const CheckboxControl: ({ children, className, ...props }: CheckboxControlProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -18,5 +21,15 @@ declare const CheckboxIndicator: ({ children, className, ...props }: CheckboxInd
|
|
|
18
21
|
interface CheckboxContentProps extends ComponentPropsWithRef<"div"> {
|
|
19
22
|
}
|
|
20
23
|
declare const CheckboxContent: ({ children, className, ...props }: CheckboxContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
interface CheckboxProps extends Omit<CheckboxRootProps, "children"> {
|
|
25
|
+
label?: CheckboxRenderable;
|
|
26
|
+
description?: CheckboxRenderable;
|
|
27
|
+
indicator?: CheckboxRenderable;
|
|
28
|
+
controlClassName?: string;
|
|
29
|
+
contentClassName?: string;
|
|
30
|
+
}
|
|
31
|
+
export declare const Checkbox: (({ contentClassName, controlClassName, description, indicator, label, ...props }: CheckboxProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
32
|
+
Root: ({ children, className, checked, defaultChecked, isPreventLabelClick, isSelected, defaultSelected, variant, ...props }: CheckboxRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
};
|
|
21
34
|
export { CheckboxRoot, CheckboxControl, CheckboxIndicator, CheckboxContent };
|
|
22
|
-
export type { CheckboxRootProps, CheckboxControlProps, CheckboxIndicatorProps, CheckboxContentProps, };
|
|
35
|
+
export type { CheckboxProps, CheckboxRootProps, CheckboxControlProps, CheckboxIndicatorProps, CheckboxContentProps, };
|
|
@@ -1,30 +1,60 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Checkbox } from 'react-aria-components';
|
|
1
|
+
import React__default, { useContext, createContext } from 'react';
|
|
2
|
+
import { Checkbox as Checkbox$1 } from 'react-aria-components';
|
|
3
3
|
import { composeTwRenderProps, composeSlotClassName } from '../../utils/compose.js';
|
|
4
4
|
import { CheckboxGroupContext } from '../checkbox-group/checkbox-group.js';
|
|
5
|
-
import { jsx } from 'react/jsx-runtime';
|
|
6
|
-
import { checkboxVariants } from '../../styles/src/components/checkbox/checkbox.styles.js';
|
|
5
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
6
|
+
import { checkboxVariants } from '../../packages/styles/src/components/checkbox/checkbox.styles.js';
|
|
7
7
|
|
|
8
8
|
const CheckboxContext = /*#__PURE__*/createContext({});
|
|
9
|
+
const resolveRenderProp = (renderable, values) => typeof renderable === "function" ? renderable(values) : renderable;
|
|
10
|
+
const resolveSelectionProps = ({
|
|
11
|
+
checked,
|
|
12
|
+
defaultChecked,
|
|
13
|
+
defaultSelected,
|
|
14
|
+
isSelected
|
|
15
|
+
}) => {
|
|
16
|
+
const isControlled = checked !== undefined || isSelected !== undefined;
|
|
17
|
+
return {
|
|
18
|
+
defaultSelected: isControlled ? undefined : defaultChecked ?? defaultSelected,
|
|
19
|
+
isSelected: checked ?? isSelected
|
|
20
|
+
};
|
|
21
|
+
};
|
|
9
22
|
const CheckboxRoot = ({
|
|
10
23
|
children,
|
|
11
24
|
className,
|
|
25
|
+
checked,
|
|
26
|
+
defaultChecked,
|
|
27
|
+
isPreventLabelClick = true,
|
|
28
|
+
isSelected,
|
|
29
|
+
defaultSelected,
|
|
12
30
|
variant,
|
|
13
31
|
...props
|
|
14
32
|
}) => {
|
|
15
33
|
const checkboxGroupContext = useContext(CheckboxGroupContext);
|
|
16
34
|
const effectiveVariant = variant ?? checkboxGroupContext.variant;
|
|
17
|
-
const slots =
|
|
35
|
+
const slots = React__default.useMemo(() => checkboxVariants({
|
|
18
36
|
variant: effectiveVariant
|
|
19
37
|
}), [effectiveVariant]);
|
|
20
|
-
|
|
38
|
+
const {
|
|
39
|
+
defaultSelected: resolvedDefaultSelected,
|
|
40
|
+
isSelected: resolvedSelected
|
|
41
|
+
} = resolveSelectionProps({
|
|
42
|
+
checked,
|
|
43
|
+
defaultChecked,
|
|
44
|
+
defaultSelected,
|
|
45
|
+
isSelected
|
|
46
|
+
});
|
|
47
|
+
return /*#__PURE__*/jsx(Checkbox$1, {
|
|
21
48
|
"data-slot": "checkbox",
|
|
49
|
+
defaultSelected: resolvedDefaultSelected,
|
|
50
|
+
isSelected: resolvedSelected,
|
|
22
51
|
...props,
|
|
23
52
|
className: composeTwRenderProps(className, slots.base()),
|
|
24
53
|
children: values => /*#__PURE__*/jsx(CheckboxContext, {
|
|
25
54
|
value: {
|
|
26
55
|
slots,
|
|
27
|
-
state: values
|
|
56
|
+
state: values,
|
|
57
|
+
isPreventLabelClick
|
|
28
58
|
},
|
|
29
59
|
children: typeof children === "function" ? children(values) : children
|
|
30
60
|
})
|
|
@@ -51,33 +81,29 @@ const CheckboxControl = ({
|
|
|
51
81
|
|
|
52
82
|
/* -----------------------------------------------------------------------------------------------*/
|
|
53
83
|
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
...props
|
|
84
|
+
const getDefaultIndicator = ({
|
|
85
|
+
isIndeterminate,
|
|
86
|
+
isSelected
|
|
58
87
|
}) => {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
y2: "12"
|
|
79
|
-
})
|
|
80
|
-
}) : /*#__PURE__*/jsx("svg", {
|
|
88
|
+
if (isIndeterminate) {
|
|
89
|
+
return /*#__PURE__*/jsx("svg", {
|
|
90
|
+
"aria-hidden": "true",
|
|
91
|
+
"data-slot": "checkbox-default-indicator--indeterminate",
|
|
92
|
+
fill: "none",
|
|
93
|
+
role: "presentation",
|
|
94
|
+
stroke: "currentColor",
|
|
95
|
+
strokeLinecap: "round",
|
|
96
|
+
strokeWidth: 3,
|
|
97
|
+
viewBox: "0 0 24 24",
|
|
98
|
+
children: /*#__PURE__*/jsx("line", {
|
|
99
|
+
x1: "21",
|
|
100
|
+
x2: "3",
|
|
101
|
+
y1: "12",
|
|
102
|
+
y2: "12"
|
|
103
|
+
})
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
return /*#__PURE__*/jsx("svg", {
|
|
81
107
|
"aria-hidden": "true",
|
|
82
108
|
"data-slot": "checkbox-default-indicator--checkmark",
|
|
83
109
|
fill: "none",
|
|
@@ -93,6 +119,22 @@ const CheckboxIndicator = ({
|
|
|
93
119
|
points: "1 9 7 14 15 4"
|
|
94
120
|
})
|
|
95
121
|
});
|
|
122
|
+
};
|
|
123
|
+
const CheckboxIndicator = ({
|
|
124
|
+
children,
|
|
125
|
+
className,
|
|
126
|
+
...props
|
|
127
|
+
}) => {
|
|
128
|
+
const {
|
|
129
|
+
slots,
|
|
130
|
+
state
|
|
131
|
+
} = useContext(CheckboxContext);
|
|
132
|
+
const isSelected = state?.isSelected;
|
|
133
|
+
const isIndeterminate = state?.isIndeterminate;
|
|
134
|
+
const content = typeof children === "function" ? children(state ?? {}) : children ? children : getDefaultIndicator({
|
|
135
|
+
isIndeterminate,
|
|
136
|
+
isSelected
|
|
137
|
+
});
|
|
96
138
|
return /*#__PURE__*/jsx("span", {
|
|
97
139
|
"aria-hidden": "true",
|
|
98
140
|
className: composeSlotClassName(slots?.indicator, className),
|
|
@@ -110,14 +152,86 @@ const CheckboxContent = ({
|
|
|
110
152
|
...props
|
|
111
153
|
}) => {
|
|
112
154
|
const {
|
|
113
|
-
slots
|
|
155
|
+
slots,
|
|
156
|
+
isPreventLabelClick
|
|
114
157
|
} = useContext(CheckboxContext);
|
|
158
|
+
const handlePrevent = event => {
|
|
159
|
+
if (event.defaultPrevented || !isPreventLabelClick) return;
|
|
160
|
+
event.preventDefault();
|
|
161
|
+
event.stopPropagation();
|
|
162
|
+
};
|
|
163
|
+
const handlePointerDown = event => {
|
|
164
|
+
props.onPointerDown?.(event);
|
|
165
|
+
handlePrevent(event);
|
|
166
|
+
};
|
|
167
|
+
const handleClick = event => {
|
|
168
|
+
props.onClick?.(event);
|
|
169
|
+
handlePrevent(event);
|
|
170
|
+
};
|
|
115
171
|
return /*#__PURE__*/jsx("div", {
|
|
116
172
|
className: composeSlotClassName(slots?.content, className),
|
|
117
173
|
"data-slot": "checkbox-content",
|
|
118
174
|
...props,
|
|
175
|
+
onPointerDown: handlePointerDown,
|
|
176
|
+
onClick: handleClick,
|
|
119
177
|
children: children
|
|
120
178
|
});
|
|
121
179
|
};
|
|
122
180
|
|
|
123
|
-
|
|
181
|
+
/* ----------------------------------------------------------------------------------------------*/
|
|
182
|
+
|
|
183
|
+
const renderContent = ({
|
|
184
|
+
description,
|
|
185
|
+
label,
|
|
186
|
+
values
|
|
187
|
+
}) => {
|
|
188
|
+
const resolvedLabel = resolveRenderProp(label, values);
|
|
189
|
+
const resolvedDescription = resolveRenderProp(description, values);
|
|
190
|
+
const hasLabel = !!resolvedLabel;
|
|
191
|
+
const hasDescription = !!resolvedDescription;
|
|
192
|
+
if (!hasLabel && !hasDescription) return null;
|
|
193
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
194
|
+
children: [hasLabel && /*#__PURE__*/jsx("span", {
|
|
195
|
+
"data-slot": "label",
|
|
196
|
+
children: resolvedLabel
|
|
197
|
+
}), hasDescription && /*#__PURE__*/jsx("span", {
|
|
198
|
+
"data-slot": "description",
|
|
199
|
+
children: resolvedDescription
|
|
200
|
+
})]
|
|
201
|
+
});
|
|
202
|
+
};
|
|
203
|
+
const CheckboxBase = ({
|
|
204
|
+
contentClassName,
|
|
205
|
+
controlClassName,
|
|
206
|
+
description,
|
|
207
|
+
indicator,
|
|
208
|
+
label,
|
|
209
|
+
...props
|
|
210
|
+
}) => {
|
|
211
|
+
return /*#__PURE__*/jsx(CheckboxRoot, {
|
|
212
|
+
...props,
|
|
213
|
+
children: values => {
|
|
214
|
+
const content = renderContent({
|
|
215
|
+
description,
|
|
216
|
+
label,
|
|
217
|
+
values
|
|
218
|
+
});
|
|
219
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
220
|
+
children: [/*#__PURE__*/jsx(CheckboxControl, {
|
|
221
|
+
className: controlClassName,
|
|
222
|
+
children: /*#__PURE__*/jsx(CheckboxIndicator, {
|
|
223
|
+
children: indicator
|
|
224
|
+
})
|
|
225
|
+
}), content && /*#__PURE__*/jsx(CheckboxContent, {
|
|
226
|
+
className: contentClassName,
|
|
227
|
+
children: content
|
|
228
|
+
})]
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
};
|
|
233
|
+
const Checkbox = Object.assign(CheckboxBase, {
|
|
234
|
+
Root: CheckboxRoot
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
export { Checkbox, CheckboxContent, CheckboxControl, CheckboxIndicator, CheckboxRoot };
|
|
@@ -1,19 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export declare const Checkbox: (({ children, className, variant, ...props }: import("./checkbox").CheckboxRootProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
4
|
-
Root: ({ children, className, variant, ...props }: import("./checkbox").CheckboxRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
Control: ({ children, className, ...props }: import("./checkbox").CheckboxControlProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
Indicator: ({ children, className, ...props }: import("./checkbox").CheckboxIndicatorProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
Content: ({ children, className, ...props }: import("./checkbox").CheckboxContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
export declare const Checkbox: (({ contentClassName, controlClassName, description, indicator, label, ...props }: import("./checkbox").CheckboxProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
2
|
+
Root: ({ children, className, checked, defaultChecked, isPreventLabelClick, isSelected, defaultSelected, variant, ...props }: import("./checkbox").CheckboxRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
3
|
};
|
|
9
|
-
export type
|
|
10
|
-
Props: ComponentProps<typeof CheckboxRoot>;
|
|
11
|
-
RootProps: ComponentProps<typeof CheckboxRoot>;
|
|
12
|
-
ControlProps: ComponentProps<typeof CheckboxControl>;
|
|
13
|
-
IndicatorProps: ComponentProps<typeof CheckboxIndicator>;
|
|
14
|
-
ContentProps: ComponentProps<typeof CheckboxContent>;
|
|
15
|
-
};
|
|
16
|
-
export { CheckboxRoot, CheckboxControl, CheckboxIndicator, CheckboxContent, } from "./checkbox";
|
|
17
|
-
export type { CheckboxRootProps, CheckboxRootProps as CheckboxProps, CheckboxControlProps, CheckboxIndicatorProps, CheckboxContentProps, } from "./checkbox";
|
|
4
|
+
export type { CheckboxProps, } from "./checkbox";
|
|
18
5
|
export { checkboxVariants } from "@arobo/styles";
|
|
19
6
|
export type { CheckboxVariants } from "@arobo/styles";
|
|
@@ -1,14 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { checkboxVariants } from '../../styles/src/components/checkbox/checkbox.styles.js';
|
|
1
|
+
import { Checkbox as Checkbox$1 } from './checkbox.js';
|
|
2
|
+
export { checkboxVariants } from '../../packages/styles/src/components/checkbox/checkbox.styles.js';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
* Compound Component
|
|
6
|
-
* -----------------------------------------------------------------------------------------------*/
|
|
7
|
-
const Checkbox = Object.assign(CheckboxRoot, {
|
|
8
|
-
Root: CheckboxRoot,
|
|
9
|
-
Control: CheckboxControl,
|
|
10
|
-
Indicator: CheckboxIndicator,
|
|
11
|
-
Content: CheckboxContent
|
|
12
|
-
});
|
|
4
|
+
const Checkbox = Checkbox$1;
|
|
13
5
|
|
|
14
|
-
export { Checkbox
|
|
6
|
+
export { Checkbox };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default, { createContext } from 'react';
|
|
2
2
|
import { CheckboxGroup as CheckboxGroup$1 } from 'react-aria-components';
|
|
3
3
|
import { composeTwRenderProps } from '../../utils/compose.js';
|
|
4
4
|
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
5
|
-
import { checkboxGroupVariants } from '../../styles/src/components/checkbox-group/checkbox-group.styles.js';
|
|
5
|
+
import { checkboxGroupVariants } from '../../packages/styles/src/components/checkbox-group/checkbox-group.styles.js';
|
|
6
6
|
|
|
7
7
|
const CheckboxGroupContext = /*#__PURE__*/createContext({});
|
|
8
8
|
const CheckboxGroup = ({
|
|
@@ -11,7 +11,7 @@ const CheckboxGroup = ({
|
|
|
11
11
|
variant,
|
|
12
12
|
...props
|
|
13
13
|
}) => {
|
|
14
|
-
const styles =
|
|
14
|
+
const styles = React__default.useMemo(() => checkboxGroupVariants({
|
|
15
15
|
variant
|
|
16
16
|
}), [variant]);
|
|
17
17
|
return /*#__PURE__*/jsx(CheckboxGroupContext.Provider, {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { CheckboxGroup } from './checkbox-group.js';
|
|
2
|
-
export { checkboxGroupVariants } from '../../styles/src/components/checkbox-group/checkbox-group.styles.js';
|
|
2
|
+
export { checkboxGroupVariants } from '../../packages/styles/src/components/checkbox-group/checkbox-group.styles.js';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ChipVariants } from "@arobo/styles";
|
|
2
|
+
import type { ComponentPropsWithRef } from "react";
|
|
3
|
+
interface ChipRootProps extends Omit<ComponentPropsWithRef<"div">, "type" | "color">, ChipVariants {
|
|
4
|
+
className?: string;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
declare const ChipRoot: ({ children, className, color, size, variant, ...props }: ChipRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export { ChipRoot };
|
|
9
|
+
export type { ChipRootProps };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { chipVariants } from '../../packages/styles/src/components/chip/chip.styles.js';
|
|
3
|
+
|
|
4
|
+
const ChipRoot = ({
|
|
5
|
+
children,
|
|
6
|
+
className,
|
|
7
|
+
color,
|
|
8
|
+
size,
|
|
9
|
+
variant,
|
|
10
|
+
...props
|
|
11
|
+
}) => {
|
|
12
|
+
return /*#__PURE__*/jsx("span", {
|
|
13
|
+
...props,
|
|
14
|
+
className: chipVariants({
|
|
15
|
+
className,
|
|
16
|
+
size,
|
|
17
|
+
color,
|
|
18
|
+
variant
|
|
19
|
+
}),
|
|
20
|
+
children: children
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export { ChipRoot };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { ChipRoot } from "./chip";
|
|
3
|
+
export declare const Chip: (({ children, className, color, size, variant, ...props }: import("./chip").ChipRootProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
4
|
+
Root: ({ children, className, color, size, variant, ...props }: import("./chip").ChipRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
};
|
|
6
|
+
export type Chip = {
|
|
7
|
+
Props: ComponentProps<typeof ChipRoot>;
|
|
8
|
+
RootProps: ComponentProps<typeof ChipRoot>;
|
|
9
|
+
};
|
|
10
|
+
export { ChipRoot };
|
|
11
|
+
export type { ChipRootProps, ChipRootProps as ChipProps } from "./chip";
|