@strapi/design-system 0.0.0-3cf3ff39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +7 -0
- package/README.md +47 -0
- package/dist/Accordion/Accordion.cjs +23 -0
- package/dist/Accordion/Accordion.js +38 -0
- package/dist/Accordion/AccordionContent.cjs +1 -0
- package/dist/Accordion/AccordionContent.js +13 -0
- package/dist/Accordion/AccordionContext.cjs +1 -0
- package/dist/Accordion/AccordionContext.js +12 -0
- package/dist/Accordion/AccordionGroup.cjs +47 -0
- package/dist/Accordion/AccordionGroup.js +60 -0
- package/dist/Accordion/AccordionToggle.cjs +28 -0
- package/dist/Accordion/AccordionToggle.js +53 -0
- package/dist/Accordion/index.cjs +1 -0
- package/dist/Accordion/index.js +11 -0
- package/dist/Accordion/utils.cjs +1 -0
- package/dist/Accordion/utils.js +7 -0
- package/dist/Alert/Alert.cjs +35 -0
- package/dist/Alert/Alert.js +46 -0
- package/dist/Alert/index.cjs +1 -0
- package/dist/Alert/index.js +4 -0
- package/dist/Alert/utils.cjs +1 -0
- package/dist/Alert/utils.js +6 -0
- package/dist/Avatar/Avatar.cjs +18 -0
- package/dist/Avatar/Avatar.js +39 -0
- package/dist/Avatar/AvatarGroup.cjs +5 -0
- package/dist/Avatar/AvatarGroup.js +11 -0
- package/dist/Avatar/constants.cjs +1 -0
- package/dist/Avatar/constants.js +5 -0
- package/dist/Avatar/index.cjs +1 -0
- package/dist/Avatar/index.js +7 -0
- package/dist/Badge/Badge.cjs +4 -0
- package/dist/Badge/Badge.js +14 -0
- package/dist/Badge/index.cjs +1 -0
- package/dist/Badge/index.js +4 -0
- package/dist/BaseButton/BaseButton.cjs +17 -0
- package/dist/BaseButton/BaseButton.js +27 -0
- package/dist/BaseButton/index.cjs +1 -0
- package/dist/BaseButton/index.js +5 -0
- package/dist/BaseCheckbox/BaseCheckbox.cjs +62 -0
- package/dist/BaseCheckbox/BaseCheckbox.js +80 -0
- package/dist/BaseCheckbox/assets/checkmark-black.svg.cjs +1 -0
- package/dist/BaseCheckbox/assets/checkmark-black.svg.js +4 -0
- package/dist/BaseCheckbox/assets/checkmark.svg.cjs +1 -0
- package/dist/BaseCheckbox/assets/checkmark.svg.js +4 -0
- package/dist/BaseCheckbox/index.cjs +1 -0
- package/dist/BaseCheckbox/index.js +4 -0
- package/dist/BaseCheckbox/utils.cjs +1 -0
- package/dist/BaseCheckbox/utils.js +4 -0
- package/dist/BaseLink/BaseLink.cjs +1 -0
- package/dist/BaseLink/BaseLink.js +8 -0
- package/dist/BaseLink/index.cjs +1 -0
- package/dist/BaseLink/index.js +4 -0
- package/dist/BaseRadio/BaseRadio.cjs +31 -0
- package/dist/BaseRadio/BaseRadio.js +58 -0
- package/dist/BaseRadio/RadioGroup.cjs +1 -0
- package/dist/BaseRadio/RadioGroup.js +15 -0
- package/dist/BaseRadio/context.cjs +1 -0
- package/dist/BaseRadio/context.js +10 -0
- package/dist/BaseRadio/index.cjs +1 -0
- package/dist/BaseRadio/index.js +6 -0
- package/dist/BaseRadio/utils.cjs +1 -0
- package/dist/BaseRadio/utils.js +6 -0
- package/dist/Box/Box.cjs +79 -0
- package/dist/Box/Box.js +95 -0
- package/dist/Box/index.cjs +1 -0
- package/dist/Box/index.js +4 -0
- package/dist/Breadcrumbs/Breadcrumbs.cjs +16 -0
- package/dist/Breadcrumbs/Breadcrumbs.js +30 -0
- package/dist/Breadcrumbs/index.cjs +1 -0
- package/dist/Breadcrumbs/index.js +5 -0
- package/dist/Button/Button.cjs +31 -0
- package/dist/Button/Button.js +51 -0
- package/dist/Button/constants.cjs +1 -0
- package/dist/Button/constants.js +14 -0
- package/dist/Button/index.cjs +1 -0
- package/dist/Button/index.js +5 -0
- package/dist/Button/utils.cjs +87 -0
- package/dist/Button/utils.js +112 -0
- package/dist/Card/Card.cjs +1 -0
- package/dist/Card/Card.js +12 -0
- package/dist/Card/CardAction.cjs +6 -0
- package/dist/Card/CardAction.js +20 -0
- package/dist/Card/CardAsset.cjs +19 -0
- package/dist/Card/CardAsset.js +28 -0
- package/dist/Card/CardBadge.cjs +6 -0
- package/dist/Card/CardBadge.js +12 -0
- package/dist/Card/CardBody.cjs +1 -0
- package/dist/Card/CardBody.js +7 -0
- package/dist/Card/CardCheckbox.cjs +1 -0
- package/dist/Card/CardCheckbox.js +14 -0
- package/dist/Card/CardContent.cjs +3 -0
- package/dist/Card/CardContent.js +9 -0
- package/dist/Card/CardContext.cjs +1 -0
- package/dist/Card/CardContext.js +6 -0
- package/dist/Card/CardHeader.cjs +3 -0
- package/dist/Card/CardHeader.js +9 -0
- package/dist/Card/CardTimer.cjs +1 -0
- package/dist/Card/CardTimer.js +7 -0
- package/dist/Card/CardTitle.cjs +1 -0
- package/dist/Card/CardTitle.js +11 -0
- package/dist/Card/index.cjs +1 -0
- package/dist/Card/index.js +23 -0
- package/dist/CarouselInput/Carousel.cjs +13 -0
- package/dist/CarouselInput/Carousel.js +40 -0
- package/dist/CarouselInput/CarouselActions.cjs +1 -0
- package/dist/CarouselInput/CarouselActions.js +6 -0
- package/dist/CarouselInput/CarouselImage.cjs +3 -0
- package/dist/CarouselInput/CarouselImage.js +17 -0
- package/dist/CarouselInput/CarouselInput.cjs +1 -0
- package/dist/CarouselInput/CarouselInput.js +15 -0
- package/dist/CarouselInput/CarouselSlide.cjs +1 -0
- package/dist/CarouselInput/CarouselSlide.js +6 -0
- package/dist/CarouselInput/index.cjs +1 -0
- package/dist/CarouselInput/index.js +12 -0
- package/dist/Checkbox/Checkbox.cjs +7 -0
- package/dist/Checkbox/Checkbox.js +28 -0
- package/dist/Checkbox/index.cjs +1 -0
- package/dist/Checkbox/index.js +4 -0
- package/dist/Combobox/Combobox.cjs +107 -0
- package/dist/Combobox/Combobox.js +175 -0
- package/dist/Combobox/ComboboxList.cjs +5 -0
- package/dist/Combobox/ComboboxList.js +10 -0
- package/dist/Combobox/ComboboxOption.cjs +1 -0
- package/dist/Combobox/ComboboxOption.js +5 -0
- package/dist/Combobox/index.cjs +1 -0
- package/dist/Combobox/index.js +7 -0
- package/dist/DatePicker/DatePicker.cjs +88 -0
- package/dist/DatePicker/DatePicker.js +397 -0
- package/dist/DatePicker/DatePickerCalendar.cjs +1 -0
- package/dist/DatePicker/DatePickerCalendar.js +43 -0
- package/dist/DatePicker/DatePickerTd.cjs +19 -0
- package/dist/DatePicker/DatePickerTd.js +29 -0
- package/dist/DatePicker/DatePickerTh.cjs +9 -0
- package/dist/DatePicker/DatePickerTh.js +18 -0
- package/dist/DatePicker/compareDates.cjs +1 -0
- package/dist/DatePicker/compareDates.js +4 -0
- package/dist/DatePicker/components.cjs +39 -0
- package/dist/DatePicker/components.js +53 -0
- package/dist/DatePicker/index.cjs +1 -0
- package/dist/DatePicker/index.js +4 -0
- package/dist/DatePicker/utils/formatDate.cjs +1 -0
- package/dist/DatePicker/utils/formatDate.js +4 -0
- package/dist/DatePicker/utils/generateWeeks.cjs +1 -0
- package/dist/DatePicker/utils/generateWeeks.js +17 -0
- package/dist/DatePicker/utils/getDayOfWeek.cjs +1 -0
- package/dist/DatePicker/utils/getDayOfWeek.js +15 -0
- package/dist/DatePicker/utils/getMonths.cjs +1 -0
- package/dist/DatePicker/utils/getMonths.js +7 -0
- package/dist/DatePicker/utils/getYears.cjs +1 -0
- package/dist/DatePicker/utils/getYears.js +9 -0
- package/dist/DatePicker/utils/index.cjs +1 -0
- package/dist/DatePicker/utils/index.js +12 -0
- package/dist/DateTimePicker/DateTimePicker.cjs +5 -0
- package/dist/DateTimePicker/DateTimePicker.js +91 -0
- package/dist/DateTimePicker/index.cjs +1 -0
- package/dist/DateTimePicker/index.js +5 -0
- package/dist/DateTimePicker/parseDate.cjs +1 -0
- package/dist/DateTimePicker/parseDate.js +8 -0
- package/dist/DesignSystemProvider.cjs +1 -0
- package/dist/DesignSystemProvider.js +10 -0
- package/dist/Dialog/Dialog.cjs +11 -0
- package/dist/Dialog/Dialog.js +31 -0
- package/dist/Dialog/DialogBody.cjs +10 -0
- package/dist/Dialog/DialogBody.js +17 -0
- package/dist/Dialog/DialogFooter.cjs +9 -0
- package/dist/Dialog/DialogFooter.js +16 -0
- package/dist/Dialog/index.cjs +1 -0
- package/dist/Dialog/index.js +8 -0
- package/dist/DismissibleLayer/index.cjs +1 -0
- package/dist/DismissibleLayer/index.js +5 -0
- package/dist/Divider/Divider.cjs +7 -0
- package/dist/Divider/Divider.js +13 -0
- package/dist/Divider/index.cjs +1 -0
- package/dist/Divider/index.js +4 -0
- package/dist/EmptyStateLayout/EmptyStateLayout.cjs +5 -0
- package/dist/EmptyStateLayout/EmptyStateLayout.js +13 -0
- package/dist/EmptyStateLayout/index.cjs +1 -0
- package/dist/EmptyStateLayout/index.js +4 -0
- package/dist/EmptyStateLayout/story-assets/Illo.cjs +1 -0
- package/dist/EmptyStateLayout/story-assets/Illo.js +5 -0
- package/dist/Field/Field.cjs +1 -0
- package/dist/Field/Field.js +12 -0
- package/dist/Field/FieldAction.cjs +4 -0
- package/dist/Field/FieldAction.js +16 -0
- package/dist/Field/FieldContext.cjs +1 -0
- package/dist/Field/FieldContext.js +6 -0
- package/dist/Field/FieldError.cjs +1 -0
- package/dist/Field/FieldError.js +10 -0
- package/dist/Field/FieldHint.cjs +1 -0
- package/dist/Field/FieldHint.js +10 -0
- package/dist/Field/FieldInput.cjs +41 -0
- package/dist/Field/FieldInput.js +63 -0
- package/dist/Field/FieldLabel.cjs +12 -0
- package/dist/Field/FieldLabel.js +25 -0
- package/dist/Field/index.cjs +1 -0
- package/dist/Field/index.js +18 -0
- package/dist/Flex/Flex.cjs +9 -0
- package/dist/Flex/Flex.js +19 -0
- package/dist/Flex/index.cjs +1 -0
- package/dist/Flex/index.js +4 -0
- package/dist/FocusTrap/FocusTrap.cjs +1 -0
- package/dist/FocusTrap/FocusTrap.js +33 -0
- package/dist/FocusTrap/index.cjs +1 -0
- package/dist/FocusTrap/index.js +4 -0
- package/dist/Grid/Grid.cjs +5 -0
- package/dist/Grid/Grid.js +26 -0
- package/dist/Grid/GridContext.cjs +1 -0
- package/dist/Grid/GridContext.js +6 -0
- package/dist/Grid/GridItem.cjs +12 -0
- package/dist/Grid/GridItem.js +34 -0
- package/dist/Grid/index.cjs +1 -0
- package/dist/Grid/index.js +6 -0
- package/dist/Icon/Icon.cjs +6 -0
- package/dist/Icon/Icon.js +15 -0
- package/dist/Icon/index.cjs +1 -0
- package/dist/Icon/index.js +4 -0
- package/dist/IconButton/IconButton.cjs +81 -0
- package/dist/IconButton/IconButton.js +101 -0
- package/dist/IconButton/index.cjs +1 -0
- package/dist/IconButton/index.js +5 -0
- package/dist/JSONInput/JSONInput.cjs +1 -0
- package/dist/JSONInput/JSONInput.js +64 -0
- package/dist/JSONInput/JSONInputContainer.cjs +33 -0
- package/dist/JSONInput/JSONInputContainer.js +39 -0
- package/dist/JSONInput/index.cjs +1 -0
- package/dist/JSONInput/index.js +4 -0
- package/dist/JSONInput/utils/decorationExtension.cjs +1 -0
- package/dist/JSONInput/utils/decorationExtension.js +27 -0
- package/dist/KeyboardNavigable/KeyboardNavigable.cjs +1 -0
- package/dist/KeyboardNavigable/KeyboardNavigable.js +46 -0
- package/dist/KeyboardNavigable/index.cjs +1 -0
- package/dist/KeyboardNavigable/index.js +4 -0
- package/dist/Layout/ActionLayout.cjs +9 -0
- package/dist/Layout/ActionLayout.js +29 -0
- package/dist/Layout/ContentLayout.cjs +1 -0
- package/dist/Layout/ContentLayout.js +11 -0
- package/dist/Layout/GridLayout.cjs +5 -0
- package/dist/Layout/GridLayout.js +13 -0
- package/dist/Layout/HeaderLayout.cjs +4 -0
- package/dist/Layout/HeaderLayout.js +127 -0
- package/dist/Layout/Layout.cjs +6 -0
- package/dist/Layout/Layout.js +24 -0
- package/dist/Layout/TwoColsLayout.cjs +1 -0
- package/dist/Layout/TwoColsLayout.js +17 -0
- package/dist/Layout/index.cjs +1 -0
- package/dist/Layout/index.js +15 -0
- package/dist/Link/Link.cjs +33 -0
- package/dist/Link/Link.js +44 -0
- package/dist/Link/index.cjs +1 -0
- package/dist/Link/index.js +4 -0
- package/dist/LinkButton/LinkButton.cjs +15 -0
- package/dist/LinkButton/LinkButton.js +29 -0
- package/dist/LinkButton/index.cjs +1 -0
- package/dist/LinkButton/index.js +4 -0
- package/dist/LiveRegions/LiveRegions.cjs +1 -0
- package/dist/LiveRegions/LiveRegions.js +7 -0
- package/dist/LiveRegions/constants.cjs +1 -0
- package/dist/LiveRegions/constants.js +8 -0
- package/dist/LiveRegions/index.cjs +1 -0
- package/dist/LiveRegions/index.js +6 -0
- package/dist/LiveRegions/useNotifyAT.cjs +1 -0
- package/dist/LiveRegions/useNotifyAT.js +17 -0
- package/dist/Loader/Loader.cjs +12 -0
- package/dist/Loader/Loader.js +20 -0
- package/dist/Loader/assets/loader.svg.cjs +1 -0
- package/dist/Loader/assets/loader.svg.js +4 -0
- package/dist/Loader/index.cjs +1 -0
- package/dist/Loader/index.js +4 -0
- package/dist/Main/Main.cjs +6 -0
- package/dist/Main/Main.js +12 -0
- package/dist/Main/SkipToContent.cjs +8 -0
- package/dist/Main/SkipToContent.js +14 -0
- package/dist/Main/index.cjs +1 -0
- package/dist/Main/index.js +6 -0
- package/dist/MainNav/MainNav.cjs +4 -0
- package/dist/MainNav/MainNav.js +33 -0
- package/dist/MainNav/MainNavContext.cjs +1 -0
- package/dist/MainNav/MainNavContext.js +6 -0
- package/dist/MainNav/NavBrand.cjs +12 -0
- package/dist/MainNav/NavBrand.js +49 -0
- package/dist/MainNav/NavCondense.cjs +20 -0
- package/dist/MainNav/NavCondense.js +40 -0
- package/dist/MainNav/NavFooter.cjs +1 -0
- package/dist/MainNav/NavFooter.js +12 -0
- package/dist/MainNav/NavLink.cjs +69 -0
- package/dist/MainNav/NavLink.js +103 -0
- package/dist/MainNav/NavSection.cjs +1 -0
- package/dist/MainNav/NavSection.js +46 -0
- package/dist/MainNav/NavSections.cjs +4 -0
- package/dist/MainNav/NavSections.js +26 -0
- package/dist/MainNav/NavUser.cjs +3 -0
- package/dist/MainNav/NavUser.js +32 -0
- package/dist/MainNav/index.cjs +1 -0
- package/dist/MainNav/index.js +18 -0
- package/dist/ModalLayout/ModalBody.cjs +4 -0
- package/dist/ModalLayout/ModalBody.js +10 -0
- package/dist/ModalLayout/ModalContext.cjs +1 -0
- package/dist/ModalLayout/ModalContext.js +7 -0
- package/dist/ModalLayout/ModalFooter.cjs +4 -0
- package/dist/ModalLayout/ModalFooter.js +11 -0
- package/dist/ModalLayout/ModalHeader.cjs +4 -0
- package/dist/ModalLayout/ModalHeader.js +17 -0
- package/dist/ModalLayout/ModalLayout.cjs +4 -0
- package/dist/ModalLayout/ModalLayout.js +16 -0
- package/dist/ModalLayout/index.cjs +1 -0
- package/dist/ModalLayout/index.js +10 -0
- package/dist/NumberInput/NumberInput.cjs +12 -0
- package/dist/NumberInput/NumberInput.js +79 -0
- package/dist/NumberInput/index.cjs +1 -0
- package/dist/NumberInput/index.js +4 -0
- package/dist/Pagination/Pagination.cjs +1 -0
- package/dist/Pagination/Pagination.js +12 -0
- package/dist/Pagination/PaginationContext.cjs +1 -0
- package/dist/Pagination/PaginationContext.js +6 -0
- package/dist/Pagination/assets/next.svg.cjs +1 -0
- package/dist/Pagination/assets/next.svg.js +4 -0
- package/dist/Pagination/assets/previous.svg.cjs +1 -0
- package/dist/Pagination/assets/previous.svg.js +4 -0
- package/dist/Pagination/components.cjs +33 -0
- package/dist/Pagination/components.js +67 -0
- package/dist/Pagination/index.cjs +1 -0
- package/dist/Pagination/index.js +9 -0
- package/dist/Popover/Popover.cjs +25 -0
- package/dist/Popover/Popover.js +127 -0
- package/dist/Popover/index.cjs +1 -0
- package/dist/Popover/index.js +7 -0
- package/dist/Popover/primitives.cjs +1 -0
- package/dist/Popover/primitives.js +5 -0
- package/dist/Portal/Portal.cjs +1 -0
- package/dist/Portal/Portal.js +9 -0
- package/dist/Portal/index.cjs +1 -0
- package/dist/Portal/index.js +4 -0
- package/dist/ProgressBar/ProgressBar.cjs +11 -0
- package/dist/ProgressBar/ProgressBar.js +17 -0
- package/dist/ProgressBar/index.cjs +1 -0
- package/dist/ProgressBar/index.js +4 -0
- package/dist/Radio/Radio.cjs +1 -0
- package/dist/Radio/Radio.js +8 -0
- package/dist/Radio/index.cjs +1 -0
- package/dist/Radio/index.js +6 -0
- package/dist/RawTable/RawCell.cjs +1 -0
- package/dist/RawTable/RawCell.js +60 -0
- package/dist/RawTable/RawTable.cjs +1 -0
- package/dist/RawTable/RawTable.js +53 -0
- package/dist/RawTable/RawTableContext.cjs +1 -0
- package/dist/RawTable/RawTableContext.js +12 -0
- package/dist/RawTable/RawTbody.cjs +1 -0
- package/dist/RawTable/RawTbody.js +9 -0
- package/dist/RawTable/RawThead.cjs +1 -0
- package/dist/RawTable/RawThead.js +9 -0
- package/dist/RawTable/RawTr.cjs +1 -0
- package/dist/RawTable/RawTr.js +13 -0
- package/dist/RawTable/focusFocusable.cjs +1 -0
- package/dist/RawTable/focusFocusable.js +7 -0
- package/dist/RawTable/index.cjs +1 -0
- package/dist/RawTable/index.js +13 -0
- package/dist/Searchbar/SearchForm.cjs +1 -0
- package/dist/Searchbar/SearchForm.js +5 -0
- package/dist/Searchbar/Searchbar.cjs +28 -0
- package/dist/Searchbar/Searchbar.js +47 -0
- package/dist/Searchbar/index.cjs +1 -0
- package/dist/Searchbar/index.js +6 -0
- package/dist/Select/MultiSelect.cjs +30 -0
- package/dist/Select/MultiSelect.js +75 -0
- package/dist/Select/MultiSelectNested.cjs +3 -0
- package/dist/Select/MultiSelectNested.js +9 -0
- package/dist/Select/OptGroup.cjs +5 -0
- package/dist/Select/OptGroup.js +10 -0
- package/dist/Select/Option.cjs +5 -0
- package/dist/Select/Option.js +16 -0
- package/dist/Select/Select.cjs +6 -0
- package/dist/Select/Select.js +19 -0
- package/dist/Select/SelectList.cjs +5 -0
- package/dist/Select/SelectList.js +85 -0
- package/dist/Select/SelectParts.cjs +83 -0
- package/dist/Select/SelectParts.js +110 -0
- package/dist/Select/SingleSelect.cjs +1 -0
- package/dist/Select/SingleSelect.js +44 -0
- package/dist/Select/index.cjs +1 -0
- package/dist/Select/index.js +19 -0
- package/dist/SimpleMenu/SimpleMenu.cjs +35 -0
- package/dist/SimpleMenu/SimpleMenu.js +198 -0
- package/dist/SimpleMenu/index.cjs +1 -0
- package/dist/SimpleMenu/index.js +5 -0
- package/dist/SimpleMenu/utils.cjs +12 -0
- package/dist/SimpleMenu/utils.js +15 -0
- package/dist/Stack/Stack.cjs +19 -0
- package/dist/Stack/Stack.js +35 -0
- package/dist/Stack/index.cjs +1 -0
- package/dist/Stack/index.js +4 -0
- package/dist/Status/Status.cjs +11 -0
- package/dist/Status/Status.js +22 -0
- package/dist/Status/index.cjs +1 -0
- package/dist/Status/index.js +4 -0
- package/dist/SubNav/SubNav.cjs +10 -0
- package/dist/SubNav/SubNav.js +22 -0
- package/dist/SubNav/SubNavHeader.cjs +4 -0
- package/dist/SubNav/SubNavHeader.js +86 -0
- package/dist/SubNav/SubNavLink.cjs +39 -0
- package/dist/SubNav/SubNavLink.js +81 -0
- package/dist/SubNav/SubNavLinkSection.cjs +19 -0
- package/dist/SubNav/SubNavLinkSection.js +51 -0
- package/dist/SubNav/SubNavSection.cjs +8 -0
- package/dist/SubNav/SubNavSection.js +64 -0
- package/dist/SubNav/SubNavSectionLabel.cjs +9 -0
- package/dist/SubNav/SubNavSectionLabel.js +47 -0
- package/dist/SubNav/SubNavSections.cjs +1 -0
- package/dist/SubNav/SubNavSections.js +22 -0
- package/dist/SubNav/index.cjs +1 -0
- package/dist/SubNav/index.js +15 -0
- package/dist/Switch/Switch.cjs +42 -0
- package/dist/Switch/Switch.js +50 -0
- package/dist/Switch/index.cjs +1 -0
- package/dist/Switch/index.js +4 -0
- package/dist/Table/Cell.cjs +17 -0
- package/dist/Table/Cell.js +38 -0
- package/dist/Table/TFooter.cjs +22 -0
- package/dist/Table/TFooter.js +43 -0
- package/dist/Table/Table.cjs +34 -0
- package/dist/Table/Table.js +70 -0
- package/dist/Table/Tbody.cjs +5 -0
- package/dist/Table/Tbody.js +12 -0
- package/dist/Table/Thead.cjs +3 -0
- package/dist/Table/Thead.js +10 -0
- package/dist/Table/Tr.cjs +20 -0
- package/dist/Table/Tr.js +27 -0
- package/dist/Table/index.cjs +1 -0
- package/dist/Table/index.js +15 -0
- package/dist/Tabs/TabGroup.cjs +1 -0
- package/dist/Tabs/TabGroup.js +16 -0
- package/dist/Tabs/TabPanels.cjs +1 -0
- package/dist/Tabs/TabPanels.js +14 -0
- package/dist/Tabs/Tabs.cjs +5 -0
- package/dist/Tabs/Tabs.js +76 -0
- package/dist/Tabs/TabsContext.cjs +1 -0
- package/dist/Tabs/TabsContext.js +13 -0
- package/dist/Tabs/components.cjs +43 -0
- package/dist/Tabs/components.js +52 -0
- package/dist/Tabs/index.cjs +1 -0
- package/dist/Tabs/index.js +10 -0
- package/dist/Tag/Tag.cjs +14 -0
- package/dist/Tag/Tag.js +23 -0
- package/dist/Tag/index.cjs +1 -0
- package/dist/Tag/index.js +4 -0
- package/dist/TextButton/TextButton.cjs +26 -0
- package/dist/TextButton/TextButton.js +40 -0
- package/dist/TextButton/index.cjs +1 -0
- package/dist/TextButton/index.js +4 -0
- package/dist/TextInput/TextInput.cjs +1 -0
- package/dist/TextInput/TextInput.js +21 -0
- package/dist/TextInput/index.cjs +1 -0
- package/dist/TextInput/index.js +4 -0
- package/dist/Textarea/Textarea.cjs +17 -0
- package/dist/Textarea/Textarea.js +39 -0
- package/dist/Textarea/index.cjs +1 -0
- package/dist/Textarea/index.js +4 -0
- package/dist/ThemeProvider/ThemeProvider.cjs +173 -0
- package/dist/ThemeProvider/ThemeProvider.js +180 -0
- package/dist/ThemeProvider/hooks.cjs +1 -0
- package/dist/ThemeProvider/hooks.js +5 -0
- package/dist/ThemeProvider/index.cjs +1 -0
- package/dist/ThemeProvider/index.js +6 -0
- package/dist/TimePicker/TimePicker.cjs +8 -0
- package/dist/TimePicker/TimePicker.js +83 -0
- package/dist/TimePicker/index.cjs +1 -0
- package/dist/TimePicker/index.js +5 -0
- package/dist/ToggleCheckbox/ToggleCheckbox.cjs +36 -0
- package/dist/ToggleCheckbox/ToggleCheckbox.js +59 -0
- package/dist/ToggleCheckbox/index.cjs +1 -0
- package/dist/ToggleCheckbox/index.js +4 -0
- package/dist/ToggleInput/ToggleInput.cjs +6 -0
- package/dist/ToggleInput/ToggleInput.js +23 -0
- package/dist/ToggleInput/index.cjs +1 -0
- package/dist/ToggleInput/index.js +4 -0
- package/dist/Tooltip/Tooltip.cjs +5 -0
- package/dist/Tooltip/Tooltip.js +26 -0
- package/dist/Tooltip/hooks/useTooltipHandlers.cjs +1 -0
- package/dist/Tooltip/hooks/useTooltipHandlers.js +22 -0
- package/dist/Tooltip/hooks/useTooltipLayout.cjs +1 -0
- package/dist/Tooltip/hooks/useTooltipLayout.js +17 -0
- package/dist/Tooltip/index.cjs +1 -0
- package/dist/Tooltip/index.js +4 -0
- package/dist/Tooltip/utils/positionTooltip.cjs +1 -0
- package/dist/Tooltip/utils/positionTooltip.js +27 -0
- package/dist/Typography/Typography.cjs +14 -0
- package/dist/Typography/Typography.js +25 -0
- package/dist/Typography/constants.cjs +1 -0
- package/dist/Typography/constants.js +11 -0
- package/dist/Typography/index.cjs +1 -0
- package/dist/Typography/index.js +4 -0
- package/dist/Typography/utils.cjs +34 -0
- package/dist/Typography/utils.js +59 -0
- package/dist/VisuallyHidden/VisuallyHidden.cjs +10 -0
- package/dist/VisuallyHidden/VisuallyHidden.js +14 -0
- package/dist/VisuallyHidden/index.cjs +1 -0
- package/dist/VisuallyHidden/index.js +4 -0
- package/dist/helpers/context.cjs +1 -0
- package/dist/helpers/context.js +21 -0
- package/dist/helpers/deprecations.cjs +1 -0
- package/dist/helpers/deprecations.js +13 -0
- package/dist/helpers/getDefaultLocale.cjs +4 -0
- package/dist/helpers/getDefaultLocale.js +9 -0
- package/dist/helpers/getFocusableNodes.cjs +1 -0
- package/dist/helpers/getFocusableNodes.js +7 -0
- package/dist/helpers/handleResponsiveValues.cjs +1 -0
- package/dist/helpers/handleResponsiveValues.js +25 -0
- package/dist/helpers/keyboardKeys.cjs +1 -0
- package/dist/helpers/keyboardKeys.js +20 -0
- package/dist/helpers/objects.cjs +1 -0
- package/dist/helpers/objects.js +10 -0
- package/dist/helpers/setOpacity.cjs +1 -0
- package/dist/helpers/setOpacity.js +4 -0
- package/dist/helpers/setTabIndexOnFirstItem.cjs +1 -0
- package/dist/helpers/setTabIndexOnFirstItem.js +7 -0
- package/dist/helpers/strings.cjs +1 -0
- package/dist/helpers/strings.js +4 -0
- package/dist/helpers/theme.cjs +1 -0
- package/dist/helpers/theme.js +7 -0
- package/dist/helpers/useElementOnScreen.cjs +4 -0
- package/dist/helpers/useElementOnScreen.js +11 -0
- package/dist/helpers/useId.cjs +4 -0
- package/dist/helpers/useId.js +11 -0
- package/dist/helpers/useIntersection.cjs +4 -0
- package/dist/helpers/useIntersection.js +11 -0
- package/dist/helpers/useLockScroll.cjs +4 -0
- package/dist/helpers/useLockScroll.js +11 -0
- package/dist/helpers/usePrevious.cjs +4 -0
- package/dist/helpers/usePrevious.js +11 -0
- package/dist/helpers/useResizeObserver.cjs +4 -0
- package/dist/helpers/useResizeObserver.js +11 -0
- package/dist/hooks/useComposeRefs.cjs +1 -0
- package/dist/hooks/useComposeRefs.js +14 -0
- package/dist/hooks/useControllableState.cjs +1 -0
- package/dist/hooks/useControllableState.js +22 -0
- package/dist/hooks/useDateFormatter.cjs +1 -0
- package/dist/hooks/useDateFormatter.js +20 -0
- package/dist/hooks/useElementOnScreen.cjs +1 -0
- package/dist/hooks/useElementOnScreen.js +15 -0
- package/dist/hooks/useId.cjs +1 -0
- package/dist/hooks/useId.js +13 -0
- package/dist/hooks/useIntersection.cjs +1 -0
- package/dist/hooks/useIntersection.js +23 -0
- package/dist/hooks/useLockScroll.cjs +1 -0
- package/dist/hooks/useLockScroll.js +9 -0
- package/dist/hooks/usePrevious.cjs +1 -0
- package/dist/hooks/usePrevious.js +10 -0
- package/dist/hooks/useResizeObserver.cjs +1 -0
- package/dist/hooks/useResizeObserver.js +16 -0
- package/dist/index.cjs +1 -0
- package/dist/index.js +311 -0
- package/dist/themes/common-theme.cjs +1 -0
- package/dist/themes/common-theme.js +21 -0
- package/dist/themes/darkTheme/dark-colors.cjs +1 -0
- package/dist/themes/darkTheme/dark-colors.js +52 -0
- package/dist/themes/darkTheme/dark-shadows.cjs +1 -0
- package/dist/themes/darkTheme/dark-shadows.js +12 -0
- package/dist/themes/darkTheme/index.cjs +1 -0
- package/dist/themes/darkTheme/index.js +11 -0
- package/dist/themes/extendTheme.cjs +13 -0
- package/dist/themes/extendTheme.js +36 -0
- package/dist/themes/index.cjs +1 -0
- package/dist/themes/index.js +12 -0
- package/dist/themes/lightTheme/index.cjs +1 -0
- package/dist/themes/lightTheme/index.js +11 -0
- package/dist/themes/lightTheme/light-colors.cjs +1 -0
- package/dist/themes/lightTheme/light-colors.js +52 -0
- package/dist/themes/lightTheme/light-shadows.cjs +1 -0
- package/dist/themes/lightTheme/light-shadows.js +12 -0
- package/dist/themes/sizes.cjs +1 -0
- package/dist/themes/sizes.js +22 -0
- package/dist/themes/utils.cjs +41 -0
- package/dist/themes/utils.js +47 -0
- package/dist/v2/Breadcrumbs/Breadcrumbs.cjs +9 -0
- package/dist/v2/Breadcrumbs/Breadcrumbs.js +33 -0
- package/dist/v2/Breadcrumbs/Crumb.cjs +1 -0
- package/dist/v2/Breadcrumbs/Crumb.js +27 -0
- package/dist/v2/Breadcrumbs/CrumbLink.cjs +14 -0
- package/dist/v2/Breadcrumbs/CrumbLink.js +30 -0
- package/dist/v2/Breadcrumbs/CrumbSimpleMenu.cjs +8 -0
- package/dist/v2/Breadcrumbs/CrumbSimpleMenu.js +23 -0
- package/dist/v2/Breadcrumbs/Divider.cjs +1 -0
- package/dist/v2/Breadcrumbs/Divider.js +9 -0
- package/dist/v2/Breadcrumbs/index.cjs +1 -0
- package/dist/v2/Breadcrumbs/index.js +10 -0
- package/dist/v2/Link/Link.cjs +25 -0
- package/dist/v2/Link/Link.js +36 -0
- package/dist/v2/Link/index.cjs +1 -0
- package/dist/v2/Link/index.js +4 -0
- package/dist/v2/LinkButton/LinkButton.cjs +20 -0
- package/dist/v2/LinkButton/LinkButton.js +35 -0
- package/dist/v2/LinkButton/index.cjs +1 -0
- package/dist/v2/LinkButton/index.js +4 -0
- package/dist/v2/MainNav/MainNav.cjs +4 -0
- package/dist/v2/MainNav/MainNav.js +33 -0
- package/dist/v2/MainNav/MainNavContext.cjs +1 -0
- package/dist/v2/MainNav/MainNavContext.js +6 -0
- package/dist/v2/MainNav/NavBrand.cjs +12 -0
- package/dist/v2/MainNav/NavBrand.js +50 -0
- package/dist/v2/MainNav/NavCondense.cjs +20 -0
- package/dist/v2/MainNav/NavCondense.js +40 -0
- package/dist/v2/MainNav/NavFooter.cjs +1 -0
- package/dist/v2/MainNav/NavFooter.js +12 -0
- package/dist/v2/MainNav/NavLink.cjs +69 -0
- package/dist/v2/MainNav/NavLink.js +103 -0
- package/dist/v2/MainNav/NavSection.cjs +1 -0
- package/dist/v2/MainNav/NavSection.js +46 -0
- package/dist/v2/MainNav/NavSections.cjs +4 -0
- package/dist/v2/MainNav/NavSections.js +26 -0
- package/dist/v2/MainNav/NavUser.cjs +3 -0
- package/dist/v2/MainNav/NavUser.js +32 -0
- package/dist/v2/MainNav/index.cjs +1 -0
- package/dist/v2/MainNav/index.js +18 -0
- package/dist/v2/Pagination/Pagination.cjs +5 -0
- package/dist/v2/Pagination/Pagination.js +26 -0
- package/dist/v2/Pagination/PaginationContext.cjs +1 -0
- package/dist/v2/Pagination/PaginationContext.js +6 -0
- package/dist/v2/Pagination/assets/next.svg.cjs +1 -0
- package/dist/v2/Pagination/assets/next.svg.js +4 -0
- package/dist/v2/Pagination/assets/previous.svg.cjs +1 -0
- package/dist/v2/Pagination/assets/previous.svg.js +4 -0
- package/dist/v2/Pagination/components.cjs +36 -0
- package/dist/v2/Pagination/components.js +95 -0
- package/dist/v2/Pagination/index.cjs +1 -0
- package/dist/v2/Pagination/index.js +9 -0
- package/dist/v2/SimpleMenu/Menu.cjs +65 -0
- package/dist/v2/SimpleMenu/Menu.js +89 -0
- package/dist/v2/SimpleMenu/SimpleMenu.cjs +1 -0
- package/dist/v2/SimpleMenu/SimpleMenu.js +27 -0
- package/dist/v2/SimpleMenu/index.cjs +1 -0
- package/dist/v2/SimpleMenu/index.js +7 -0
- package/dist/v2/SubNav/SubNav.cjs +10 -0
- package/dist/v2/SubNav/SubNav.js +22 -0
- package/dist/v2/SubNav/SubNavHeader.cjs +4 -0
- package/dist/v2/SubNav/SubNavHeader.js +86 -0
- package/dist/v2/SubNav/SubNavLink.cjs +39 -0
- package/dist/v2/SubNav/SubNavLink.js +84 -0
- package/dist/v2/SubNav/SubNavLinkSection.cjs +19 -0
- package/dist/v2/SubNav/SubNavLinkSection.js +50 -0
- package/dist/v2/SubNav/SubNavSection.cjs +8 -0
- package/dist/v2/SubNav/SubNavSection.js +63 -0
- package/dist/v2/SubNav/SubNavSectionLabel.cjs +9 -0
- package/dist/v2/SubNav/SubNavSectionLabel.js +47 -0
- package/dist/v2/SubNav/SubNavSections.cjs +1 -0
- package/dist/v2/SubNav/SubNavSections.js +22 -0
- package/dist/v2/SubNav/index.cjs +1 -0
- package/dist/v2/SubNav/index.js +15 -0
- package/dist/v2/index.cjs +1 -0
- package/dist/v2/index.js +55 -0
- package/package.json +69 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),l=require("react"),u=require("styled-components"),n=require("../Typography/utils.cjs"),a=require("../Box/Box.cjs"),c=require("../Tooltip/Tooltip.cjs"),d=e=>e&&e.__esModule?e:{default:e},g=d(u),r=g.default(a.Box)`
|
|
2
|
+
${n.ellipsisStyle({ellipsis:!0})}
|
|
3
|
+
`,m=e=>{const[s,o]=l.useState(!1),i=()=>{o(!0)};return s?t.jsx(c.Tooltip,{description:e.alt??"",children:t.jsx(r,{as:"img",height:"100%",...e})}):t.jsx(r,{as:"img",height:"100%",...e,onError:i})};exports.CarouselImage=m;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useState as s } from "react";
|
|
3
|
+
import l from "styled-components";
|
|
4
|
+
import { ellipsisStyle as a } from "../Typography/utils.js";
|
|
5
|
+
import { Box as n } from "../Box/Box.js";
|
|
6
|
+
import { Tooltip as f } from "../Tooltip/Tooltip.js";
|
|
7
|
+
const o = l(n)`
|
|
8
|
+
${a({ ellipsis: !0 })}
|
|
9
|
+
`, E = (r) => {
|
|
10
|
+
const [e, i] = s(!1), m = () => {
|
|
11
|
+
i(!0);
|
|
12
|
+
};
|
|
13
|
+
return e ? t(f, { description: r.alt ?? "", children: t(o, { as: "img", height: "100%", ...r }) }) : t(o, { as: "img", height: "100%", ...r, onError: m });
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
E as CarouselImage
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),h=require("./Carousel.cjs"),I=require("../hooks/useId.cjs"),g=require("../Field/Field.cjs"),p=require("../Field/FieldLabel.cjs"),L=require("../Field/FieldHint.cjs"),m=require("../Field/FieldError.cjs"),C=require("../Flex/Flex.cjs"),v=({actions:n,children:s,error:t,hint:o,label:r,labelAction:l,nextLabel:d,onNext:u,onPrevious:c,previousLabel:a,required:x,secondaryLabel:F,selectedSlide:q,id:j,...b})=>{const i=I.useId(j);return e.jsx(g.Field,{hint:o,error:t,id:i,required:x,children:e.jsxs(C.Flex,{direction:"column",alignItems:"stretch",gap:1,children:[r&&e.jsx(p.FieldLabel,{action:l,children:r}),e.jsx(h.Carousel,{actions:n,label:r,nextLabel:d,onNext:u,onPrevious:c,previousLabel:a,secondaryLabel:F,selectedSlide:q,id:i,...b,children:s}),e.jsx(L.FieldHint,{}),e.jsx(m.FieldError,{})]})})};exports.CarouselInput=v;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as r, jsxs as F } from "react/jsx-runtime";
|
|
2
|
+
import { Carousel as I } from "./Carousel.js";
|
|
3
|
+
import { useId as L } from "../hooks/useId.js";
|
|
4
|
+
import { Field as b } from "../Field/Field.js";
|
|
5
|
+
import { FieldLabel as g } from "../Field/FieldLabel.js";
|
|
6
|
+
import { FieldHint as j } from "../Field/FieldHint.js";
|
|
7
|
+
import { FieldError as v } from "../Field/FieldError.js";
|
|
8
|
+
import { Flex as C } from "../Flex/Flex.js";
|
|
9
|
+
const w = ({ actions: i, children: t, error: n, hint: d, label: e, labelAction: m, nextLabel: l, onNext: s, onPrevious: c, previousLabel: p, required: a, secondaryLabel: u, selectedSlide: f, id: h, ...x }) => {
|
|
10
|
+
const o = L(h);
|
|
11
|
+
return r(b, { hint: d, error: n, id: o, required: a, children: F(C, { direction: "column", alignItems: "stretch", gap: 1, children: [e && r(g, { action: m, children: e }), r(I, { actions: i, label: e, nextLabel: l, onNext: s, onPrevious: c, previousLabel: p, secondaryLabel: u, selectedSlide: f, id: o, ...x, children: t }), r(j, {}), r(v, {})] }) });
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
w as CarouselInput
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),o=require("../Flex/Flex.cjs"),s=({label:e,children:l,selected:r=!1,...i})=>t.jsx(o.Flex,{display:r?"flex":"none",role:"group","aria-roledescription":"slide","aria-label":e,justifyContent:"center",height:"124px",...i,children:l});exports.CarouselSlide=s;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { Flex as t } from "../Flex/Flex.js";
|
|
3
|
+
const s = ({ label: e, children: r, selected: o = !1, ...i }) => l(t, { display: o ? "flex" : "none", role: "group", "aria-roledescription": "slide", "aria-label": e, justifyContent: "center", height: "124px", ...i, children: r });
|
|
4
|
+
export {
|
|
5
|
+
s as CarouselSlide
|
|
6
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./Carousel.cjs"),r=require("./CarouselInput.cjs"),o=require("./CarouselActions.cjs"),u=require("./CarouselImage.cjs"),s=require("./CarouselSlide.cjs");exports.Carousel=e.Carousel;exports.CarouselInput=r.CarouselInput;exports.CarouselActions=o.CarouselActions;exports.CarouselImage=u.CarouselImage;exports.CarouselSlide=s.CarouselSlide;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Carousel as e } from "./Carousel.js";
|
|
2
|
+
import { CarouselInput as a } from "./CarouselInput.js";
|
|
3
|
+
import { CarouselActions as m } from "./CarouselActions.js";
|
|
4
|
+
import { CarouselImage as s } from "./CarouselImage.js";
|
|
5
|
+
import { CarouselSlide as f } from "./CarouselSlide.js";
|
|
6
|
+
export {
|
|
7
|
+
e as Carousel,
|
|
8
|
+
m as CarouselActions,
|
|
9
|
+
s as CarouselImage,
|
|
10
|
+
a as CarouselInput,
|
|
11
|
+
f as CarouselSlide
|
|
12
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),d=require("styled-components"),a=require("../hooks/useId.cjs"),u=require("../Field/FieldContext.cjs"),x=require("../Typography/Typography.cjs"),h=require("../Field/Field.cjs"),b=require("../Flex/Flex.cjs"),f=require("../Box/Box.cjs"),p=require("../Field/FieldHint.cjs"),q=require("../Field/FieldError.cjs"),j=require("../BaseCheckbox/BaseCheckbox.cjs"),y=e=>e&&e.__esModule?e:{default:e},F=y(d),g=F.default(x.Typography)`
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: flex-start;
|
|
4
|
+
* {
|
|
5
|
+
cursor: ${({disabled:e})=>e?"not-allowed":"pointer"};
|
|
6
|
+
}
|
|
7
|
+
`,C=e=>{const{id:t}=u.useField();return r.jsx(j.BaseCheckbox,{id:t,...e})},k=({children:e,disabled:t=!1,id:l,hint:o,error:n,...c})=>{const i=a.useId(l);let s;return n?s=`${i}-error`:o&&(s=`${i}-hint`),r.jsx(h.Field,{id:i,hint:o,error:n,children:r.jsxs(b.Flex,{direction:"column",alignItems:"stretch",gap:1,children:[r.jsxs(g,{as:"label",textColor:"neutral800",disabled:t,children:[r.jsx(C,{disabled:t,"aria-describedby":s,...c}),r.jsx(f.Box,{paddingLeft:2,children:e})]}),r.jsx(p.FieldHint,{}),r.jsx(q.FieldError,{})]})})};exports.Checkbox=k;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as r, jsxs as d } from "react/jsx-runtime";
|
|
2
|
+
import a from "styled-components";
|
|
3
|
+
import { useId as c } from "../hooks/useId.js";
|
|
4
|
+
import { useField as p } from "../Field/FieldContext.js";
|
|
5
|
+
import { Typography as f } from "../Typography/Typography.js";
|
|
6
|
+
import { Field as x } from "../Field/Field.js";
|
|
7
|
+
import { Flex as h } from "../Flex/Flex.js";
|
|
8
|
+
import { Box as b } from "../Box/Box.js";
|
|
9
|
+
import { FieldHint as u } from "../Field/FieldHint.js";
|
|
10
|
+
import { FieldError as g } from "../Field/FieldError.js";
|
|
11
|
+
import { BaseCheckbox as k } from "../BaseCheckbox/BaseCheckbox.js";
|
|
12
|
+
const y = a(f)`
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: flex-start;
|
|
15
|
+
* {
|
|
16
|
+
cursor: ${({ disabled: e }) => e ? "not-allowed" : "pointer"};
|
|
17
|
+
}
|
|
18
|
+
`, C = (e) => {
|
|
19
|
+
const { id: o } = p();
|
|
20
|
+
return r(k, { id: o, ...e });
|
|
21
|
+
}, q = ({ children: e, disabled: o = !1, id: s, hint: l, error: m, ...n }) => {
|
|
22
|
+
const i = c(s);
|
|
23
|
+
let t;
|
|
24
|
+
return m ? t = `${i}-error` : l && (t = `${i}-hint`), r(x, { id: i, hint: l, error: m, children: d(h, { direction: "column", alignItems: "stretch", gap: 1, children: [d(y, { as: "label", textColor: "neutral800", disabled: o, children: [r(C, { disabled: o, "aria-describedby": t, ...n }), r(b, { paddingLeft: 2, children: e })] }), r(u, {}), r(g, {})] }) });
|
|
25
|
+
};
|
|
26
|
+
export {
|
|
27
|
+
q as Checkbox
|
|
28
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./Checkbox.cjs");exports.Checkbox=e.Checkbox;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),me=require("react"),M=require("@strapi/icons"),n=require("@strapi/ui-primitives"),Ce=require("styled-components"),$e=require("../helpers/strings.cjs"),j=require("../hooks/useControllableState.cjs"),I=require("../hooks/useId.cjs"),je=require("../hooks/useIntersection.cjs"),N=require("../themes/utils.cjs"),Ie=require("../Loader/Loader.cjs"),y=require("../Box/Box.cjs"),u=require("../Typography/Typography.cjs"),b=require("../Flex/Flex.cjs"),ye=require("../Field/Field.cjs"),we=require("../Field/FieldLabel.cjs"),qe=require("../Field/FieldHint.cjs"),Fe=require("../Field/FieldError.cjs"),Te=e=>e&&e.__esModule?e:{default:e};function ve(e){if(e&&e.__esModule)return e;const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const i=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(r,s,i.get?i:{enumerable:!0,get:()=>e[s]})}}return r.default=e,Object.freeze(r)}const p=ve(me),a=Te(Ce),H=({allowCustomValue:e,autocomplete:r,children:s,className:i,clearLabel:d="clear",creatable:l=!1,createMessage:g=$=>`Create "${$}"`,defaultFilterValue:h,defaultTextValue:w,defaultOpen:W=!1,open:U,onOpenChange:A,disabled:f=!1,error:q,filterValue:G,hasMoreItems:J=!1,id:F,isPrintableCharacter:K,loading:m=!1,loadingMessage:Q="Loading content...",noOptionsMessage:X=()=>"No results found",onChange:T,onClear:C,onCreateOption:v,onFilterValueChange:Y,onInputChange:R,onTextValueChange:Z,onLoadMore:k,placeholder:ee="Select or enter a value",required:oe=!1,size:re="M",startIcon:O,textValue:te,value:V,...ne})=>{const[$,se]=j.useControllableState({prop:U,defaultProp:W,onChange:A}),[c,S]=j.useControllableState({prop:te,defaultProp:e&&!w?V:w,onChange:Z}),[le,B]=j.useControllableState({prop:G,defaultProp:h,onChange:Y}),P=p.useRef(null),_=p.useRef(null),ie=p.useRef(null),ae=t=>{C&&!f&&(S(""),B(""),C(t),_.current.focus())},de=t=>{se(t)},ce=t=>{S(t)},ue=t=>{B(t)},he=t=>{R&&R(t)},be=t=>{T&&T(t)},pe=t=>{k&&J&&!m&&k(t)},z=()=>{v&&c&&v(c)},E=I.useId(F),xe=I.useId(),D=`intersection-${$e.stripReactIdOfColon(xe)}`;je.useIntersection(P,pe,{selectorToWatch:`#${D}`,skipWhen:!$});const ge=`${E}-hint`,fe=`${E}-error`;return o.jsxs(n.Combobox.Root,{autocomplete:r||(l?"list":"both"),onOpenChange:de,onTextValueChange:ce,textValue:c,allowCustomValue:l||e,disabled:f,required:oe,value:V,onValueChange:be,filterValue:le,onFilterValueChange:ue,isPrintableCharacter:K,children:[o.jsxs(Oe,{$hasError:!!q,$size:re,className:i,children:[o.jsxs(b.Flex,{flex:"1",as:"span",gap:3,children:[O?o.jsx(y.Box,{as:"span","aria-hidden":!0,children:O}):null,o.jsx(Ve,{placeholder:ee,id:F,"aria-invalid":!!q,"aria-describedby":`${ge} ${fe}`,onChange:he,ref:_,...ne})]}),o.jsxs(b.Flex,{as:"span",gap:3,children:[c&&C?o.jsx(ke,{as:"button",hasRadius:!0,background:"transparent",type:"button",onClick:ae,"aria-disabled":f,"aria-label":d,title:d,ref:ie,children:o.jsx(M.Cross,{})}):null,o.jsx(Se,{children:o.jsx(M.CarretDown,{})})]})]}),o.jsx(n.Combobox.Portal,{children:o.jsx(Be,{sideOffset:4,children:o.jsxs(Pe,{ref:P,children:[s,l?o.jsx(n.Combobox.CreateItem,{onPointerUp:z,onClick:z,asChild:!0,children:o.jsx(x,{children:o.jsx(u.Typography,{children:g(c??"")})})}):null,!l&&!m?o.jsx(n.Combobox.NoValueFound,{asChild:!0,children:o.jsx(x,{$hasHover:!1,children:o.jsx(u.Typography,{children:X(c??"")})})}):null,m?o.jsx(b.Flex,{justifyContent:"center",alignItems:"center",paddingTop:2,paddingBottom:2,children:o.jsx(Ie.Loader,{small:!0,children:Q})}):null,o.jsx(y.Box,{id:D,width:"100%",height:"1px"})]})})})]})},L=({error:e,hint:r,id:s,label:i,labelAction:d,required:l=!1,...g})=>{const h=I.useId(s);return o.jsx(ye.Field,{hint:r,error:e,id:h,required:l,children:o.jsxs(b.Flex,{direction:"column",alignItems:"stretch",gap:1,children:[o.jsx(we.FieldLabel,{action:d,children:i}),o.jsx(H,{id:h,error:e,required:l,...g}),o.jsx(qe.FieldHint,{}),o.jsx(Fe.FieldError,{})]})})},Re=e=>o.jsx(L,{...e,creatable:!0}),ke=a.default(y.Box)`
|
|
2
|
+
border: none;
|
|
3
|
+
|
|
4
|
+
svg {
|
|
5
|
+
height: ${11/16}rem;
|
|
6
|
+
width: ${11/16}rem;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
svg path {
|
|
10
|
+
fill: ${({theme:e})=>e.colors.neutral600};
|
|
11
|
+
}
|
|
12
|
+
`,Oe=a.default(n.Combobox.Trigger)`
|
|
13
|
+
position: relative;
|
|
14
|
+
border: 1px solid ${({theme:e,$hasError:r})=>r?e.colors.danger600:e.colors.neutral200};
|
|
15
|
+
padding-right: ${({theme:e})=>e.spaces[3]};
|
|
16
|
+
padding-left: ${({theme:e})=>e.spaces[3]};
|
|
17
|
+
border-radius: ${({theme:e})=>e.borderRadius};
|
|
18
|
+
background: ${({theme:e})=>e.colors.neutral0};
|
|
19
|
+
overflow: hidden;
|
|
20
|
+
display: flex;
|
|
21
|
+
align-items: center;
|
|
22
|
+
justify-content: space-between;
|
|
23
|
+
gap: ${({theme:e})=>e.spaces[4]};
|
|
24
|
+
min-height: ${({theme:e,$size:r})=>N.getThemeSize("input")({theme:e,size:r})};
|
|
25
|
+
|
|
26
|
+
&[data-disabled] {
|
|
27
|
+
color: ${({theme:e})=>e.colors.neutral600};
|
|
28
|
+
background: ${({theme:e})=>e.colors.neutral150};
|
|
29
|
+
cursor: not-allowed;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* Required to ensure the below inputFocusStyles are adhered too */
|
|
33
|
+
&:focus-visible {
|
|
34
|
+
outline: none;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
${({theme:e,$hasError:r})=>N.inputFocusStyle()({theme:e,hasError:r})};
|
|
38
|
+
`,Ve=a.default(n.Combobox.TextInput)`
|
|
39
|
+
width: 100%;
|
|
40
|
+
font-size: ${14/16}rem;
|
|
41
|
+
color: ${({theme:e})=>e.colors.neutral800};
|
|
42
|
+
padding: 0;
|
|
43
|
+
border: none;
|
|
44
|
+
background-color: transparent;
|
|
45
|
+
|
|
46
|
+
&:focus-visible {
|
|
47
|
+
outline: none;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&[aria-disabled='true'] {
|
|
51
|
+
cursor: inherit;
|
|
52
|
+
}
|
|
53
|
+
`,Se=a.default(n.Combobox.Icon)`
|
|
54
|
+
& > svg {
|
|
55
|
+
width: ${6/16}rem;
|
|
56
|
+
|
|
57
|
+
& > path {
|
|
58
|
+
fill: ${({theme:e})=>e.colors.neutral600};
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
&[aria-disabled='true'] {
|
|
63
|
+
cursor: inherit;
|
|
64
|
+
}
|
|
65
|
+
`,Be=a.default(n.Combobox.Content)`
|
|
66
|
+
background: ${({theme:e})=>e.colors.neutral0};
|
|
67
|
+
box-shadow: ${({theme:e})=>e.shadows.filterShadow};
|
|
68
|
+
border: 1px solid ${({theme:e})=>e.colors.neutral150};
|
|
69
|
+
border-radius: ${({theme:e})=>e.borderRadius};
|
|
70
|
+
width: var(--radix-combobox-trigger-width);
|
|
71
|
+
/* This is from the design-system figma file. */
|
|
72
|
+
max-height: 15rem;
|
|
73
|
+
z-index: ${({theme:e})=>e.zIndices[1]};
|
|
74
|
+
`,Pe=a.default(n.Combobox.Viewport)`
|
|
75
|
+
padding: ${({theme:e})=>e.spaces[1]};
|
|
76
|
+
`,_e=p.forwardRef(({children:e,value:r,disabled:s,textValue:i,...d},l)=>o.jsx(n.Combobox.ComboboxItem,{asChild:!0,value:r,disabled:s,textValue:i,children:o.jsx(x,{ref:l,...d,children:o.jsx(n.Combobox.ItemText,{asChild:!0,children:o.jsx(u.Typography,{children:e})})})})),x=a.default.div`
|
|
77
|
+
width: 100%;
|
|
78
|
+
border: none;
|
|
79
|
+
text-align: left;
|
|
80
|
+
outline-offset: -3px;
|
|
81
|
+
padding: ${({theme:e})=>e.spaces[2]} ${({theme:e})=>e.spaces[4]};
|
|
82
|
+
background-color: ${({theme:e})=>e.colors.neutral0};
|
|
83
|
+
border-radius: ${({theme:e})=>e.borderRadius};
|
|
84
|
+
user-select: none;
|
|
85
|
+
|
|
86
|
+
&[data-state='checked'] {
|
|
87
|
+
background-color: ${({theme:e})=>e.colors.primary100};
|
|
88
|
+
|
|
89
|
+
${u.Typography} {
|
|
90
|
+
color: ${({theme:e})=>e.colors.primary600};
|
|
91
|
+
font-weight: bold;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
&:hover,
|
|
96
|
+
&[data-highlighted] {
|
|
97
|
+
outline: none;
|
|
98
|
+
background-color: ${({theme:e,$hasHover:r=!0})=>r?e.colors.primary100:e.colors.neutral0};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
&[data-highlighted] {
|
|
102
|
+
${u.Typography} {
|
|
103
|
+
color: ${({theme:e})=>e.colors.primary600};
|
|
104
|
+
font-weight: bold;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
`;exports.Combobox=L;exports.ComboboxInput=H;exports.CreatableCombobox=Re;exports.Option=_e;exports.OptionBox=x;
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { jsx as r, jsxs as d } from "react/jsx-runtime";
|
|
2
|
+
import * as f from "react";
|
|
3
|
+
import { Cross as me, CarretDown as ge } from "@strapi/icons";
|
|
4
|
+
import { Combobox as n } from "@strapi/ui-primitives";
|
|
5
|
+
import l from "styled-components";
|
|
6
|
+
import { stripReactIdOfColon as be } from "../helpers/strings.js";
|
|
7
|
+
import { useControllableState as I } from "../hooks/useControllableState.js";
|
|
8
|
+
import { useId as w } from "../hooks/useId.js";
|
|
9
|
+
import { useIntersection as $e } from "../hooks/useIntersection.js";
|
|
10
|
+
import { getThemeSize as Ce, inputFocusStyle as xe } from "../themes/utils.js";
|
|
11
|
+
import { Loader as Ie } from "../Loader/Loader.js";
|
|
12
|
+
import { Box as R } from "../Box/Box.js";
|
|
13
|
+
import { Typography as h } from "../Typography/Typography.js";
|
|
14
|
+
import { Flex as m } from "../Flex/Flex.js";
|
|
15
|
+
import { Field as we } from "../Field/Field.js";
|
|
16
|
+
import { FieldLabel as Re } from "../Field/FieldLabel.js";
|
|
17
|
+
import { FieldHint as ve } from "../Field/FieldHint.js";
|
|
18
|
+
import { FieldError as ye } from "../Field/FieldError.js";
|
|
19
|
+
const ke = ({ allowCustomValue: e, autocomplete: o, children: c, className: u, clearLabel: a = "clear", creatable: i = !1, createMessage: g = (x) => `Create "${x}"`, defaultFilterValue: p, defaultTextValue: y, defaultOpen: W = !1, open: L, onOpenChange: U, disabled: b = !1, error: k, filterValue: A, hasMoreItems: G = !1, id: V, isPrintableCharacter: J, loading: $ = !1, loadingMessage: K = "Loading content...", noOptionsMessage: M = () => "No results found", onChange: T, onClear: C, onCreateOption: F, onFilterValueChange: Q, onInputChange: O, onTextValueChange: X, onLoadMore: z, placeholder: Y = "Select or enter a value", required: Z = !1, size: _ = "M", startIcon: B, textValue: ee, value: P, ...re }) => {
|
|
20
|
+
const [x, oe] = I({
|
|
21
|
+
prop: L,
|
|
22
|
+
defaultProp: W,
|
|
23
|
+
onChange: U
|
|
24
|
+
}), [s, S] = I({
|
|
25
|
+
prop: ee,
|
|
26
|
+
defaultProp: e && !y ? P : y,
|
|
27
|
+
onChange: X
|
|
28
|
+
}), [te, j] = I({
|
|
29
|
+
prop: A,
|
|
30
|
+
defaultProp: p,
|
|
31
|
+
onChange: Q
|
|
32
|
+
}), E = f.useRef(null), q = f.useRef(null), ne = f.useRef(null), ie = (t) => {
|
|
33
|
+
C && !b && (S(""), j(""), C(t), q.current.focus());
|
|
34
|
+
}, le = (t) => {
|
|
35
|
+
oe(t);
|
|
36
|
+
}, ae = (t) => {
|
|
37
|
+
S(t);
|
|
38
|
+
}, se = (t) => {
|
|
39
|
+
j(t);
|
|
40
|
+
}, de = (t) => {
|
|
41
|
+
O && O(t);
|
|
42
|
+
}, ce = (t) => {
|
|
43
|
+
T && T(t);
|
|
44
|
+
}, ue = (t) => {
|
|
45
|
+
z && G && !$ && z(t);
|
|
46
|
+
}, N = () => {
|
|
47
|
+
F && s && F(s);
|
|
48
|
+
}, D = w(V), he = w(), H = `intersection-${be(he)}`;
|
|
49
|
+
$e(E, ue, {
|
|
50
|
+
selectorToWatch: `#${H}`,
|
|
51
|
+
/**
|
|
52
|
+
* We need to know when the select is open because only then will viewportRef
|
|
53
|
+
* not be null. Because it uses a portal that (sensibly) is not mounted 24/7.
|
|
54
|
+
*/
|
|
55
|
+
skipWhen: !x
|
|
56
|
+
});
|
|
57
|
+
const pe = `${D}-hint`, fe = `${D}-error`;
|
|
58
|
+
return d(n.Root, { autocomplete: o || (i ? "list" : "both"), onOpenChange: le, onTextValueChange: ae, textValue: s, allowCustomValue: i || e, disabled: b, required: Z, value: P, onValueChange: ce, filterValue: te, onFilterValueChange: se, isPrintableCharacter: J, children: [d(Fe, { $hasError: !!k, $size: _, className: u, children: [d(m, { flex: "1", as: "span", gap: 3, children: [B ? r(R, { as: "span", "aria-hidden": !0, children: B }) : null, r(Oe, { placeholder: Y, id: V, "aria-invalid": !!k, "aria-describedby": `${pe} ${fe}`, onChange: de, ref: q, ...re })] }), d(m, { as: "span", gap: 3, children: [s && C ? r(Te, { as: "button", hasRadius: !0, background: "transparent", type: "button", onClick: ie, "aria-disabled": b, "aria-label": a, title: a, ref: ne, children: r(me, {}) }) : null, r(ze, { children: r(ge, {}) })] })] }), r(n.Portal, { children: r(Be, { sideOffset: 4, children: d(Pe, { ref: E, children: [c, i ? r(n.CreateItem, { onPointerUp: N, onClick: N, asChild: !0, children: r(v, { children: r(h, { children: g(s ?? "") }) }) }) : null, !i && !$ ? r(n.NoValueFound, { asChild: !0, children: r(v, { $hasHover: !1, children: r(h, { children: M(s ?? "") }) }) }) : null, $ ? r(m, { justifyContent: "center", alignItems: "center", paddingTop: 2, paddingBottom: 2, children: r(Ie, { small: !0, children: K }) }) : null, r(R, { id: H, width: "100%", height: "1px" })] }) }) })] });
|
|
59
|
+
}, Ve = ({ error: e, hint: o, id: c, label: u, labelAction: a, required: i = !1, ...g }) => {
|
|
60
|
+
const p = w(c);
|
|
61
|
+
return r(we, { hint: o, error: e, id: p, required: i, children: d(m, { direction: "column", alignItems: "stretch", gap: 1, children: [r(Re, { action: a, children: u }), r(ke, { id: p, error: e, required: i, ...g }), r(ve, {}), r(ye, {})] }) });
|
|
62
|
+
}, Ye = (e) => r(Ve, { ...e, creatable: !0 }), Te = l(R)`
|
|
63
|
+
border: none;
|
|
64
|
+
|
|
65
|
+
svg {
|
|
66
|
+
height: ${11 / 16}rem;
|
|
67
|
+
width: ${11 / 16}rem;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
svg path {
|
|
71
|
+
fill: ${({ theme: e }) => e.colors.neutral600};
|
|
72
|
+
}
|
|
73
|
+
`, Fe = l(n.Trigger)`
|
|
74
|
+
position: relative;
|
|
75
|
+
border: 1px solid ${({ theme: e, $hasError: o }) => o ? e.colors.danger600 : e.colors.neutral200};
|
|
76
|
+
padding-right: ${({ theme: e }) => e.spaces[3]};
|
|
77
|
+
padding-left: ${({ theme: e }) => e.spaces[3]};
|
|
78
|
+
border-radius: ${({ theme: e }) => e.borderRadius};
|
|
79
|
+
background: ${({ theme: e }) => e.colors.neutral0};
|
|
80
|
+
overflow: hidden;
|
|
81
|
+
display: flex;
|
|
82
|
+
align-items: center;
|
|
83
|
+
justify-content: space-between;
|
|
84
|
+
gap: ${({ theme: e }) => e.spaces[4]};
|
|
85
|
+
min-height: ${({ theme: e, $size: o }) => Ce("input")({ theme: e, size: o })};
|
|
86
|
+
|
|
87
|
+
&[data-disabled] {
|
|
88
|
+
color: ${({ theme: e }) => e.colors.neutral600};
|
|
89
|
+
background: ${({ theme: e }) => e.colors.neutral150};
|
|
90
|
+
cursor: not-allowed;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/* Required to ensure the below inputFocusStyles are adhered too */
|
|
94
|
+
&:focus-visible {
|
|
95
|
+
outline: none;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
${({ theme: e, $hasError: o }) => xe()({ theme: e, hasError: o })};
|
|
99
|
+
`, Oe = l(n.TextInput)`
|
|
100
|
+
width: 100%;
|
|
101
|
+
font-size: ${14 / 16}rem;
|
|
102
|
+
color: ${({ theme: e }) => e.colors.neutral800};
|
|
103
|
+
padding: 0;
|
|
104
|
+
border: none;
|
|
105
|
+
background-color: transparent;
|
|
106
|
+
|
|
107
|
+
&:focus-visible {
|
|
108
|
+
outline: none;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
&[aria-disabled='true'] {
|
|
112
|
+
cursor: inherit;
|
|
113
|
+
}
|
|
114
|
+
`, ze = l(n.Icon)`
|
|
115
|
+
& > svg {
|
|
116
|
+
width: ${6 / 16}rem;
|
|
117
|
+
|
|
118
|
+
& > path {
|
|
119
|
+
fill: ${({ theme: e }) => e.colors.neutral600};
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
&[aria-disabled='true'] {
|
|
124
|
+
cursor: inherit;
|
|
125
|
+
}
|
|
126
|
+
`, Be = l(n.Content)`
|
|
127
|
+
background: ${({ theme: e }) => e.colors.neutral0};
|
|
128
|
+
box-shadow: ${({ theme: e }) => e.shadows.filterShadow};
|
|
129
|
+
border: 1px solid ${({ theme: e }) => e.colors.neutral150};
|
|
130
|
+
border-radius: ${({ theme: e }) => e.borderRadius};
|
|
131
|
+
width: var(--radix-combobox-trigger-width);
|
|
132
|
+
/* This is from the design-system figma file. */
|
|
133
|
+
max-height: 15rem;
|
|
134
|
+
z-index: ${({ theme: e }) => e.zIndices[1]};
|
|
135
|
+
`, Pe = l(n.Viewport)`
|
|
136
|
+
padding: ${({ theme: e }) => e.spaces[1]};
|
|
137
|
+
`, Ze = f.forwardRef(({ children: e, value: o, disabled: c, textValue: u, ...a }, i) => r(n.ComboboxItem, { asChild: !0, value: o, disabled: c, textValue: u, children: r(v, { ref: i, ...a, children: r(n.ItemText, { asChild: !0, children: r(h, { children: e }) }) }) })), v = l.div`
|
|
138
|
+
width: 100%;
|
|
139
|
+
border: none;
|
|
140
|
+
text-align: left;
|
|
141
|
+
outline-offset: -3px;
|
|
142
|
+
padding: ${({ theme: e }) => e.spaces[2]} ${({ theme: e }) => e.spaces[4]};
|
|
143
|
+
background-color: ${({ theme: e }) => e.colors.neutral0};
|
|
144
|
+
border-radius: ${({ theme: e }) => e.borderRadius};
|
|
145
|
+
user-select: none;
|
|
146
|
+
|
|
147
|
+
&[data-state='checked'] {
|
|
148
|
+
background-color: ${({ theme: e }) => e.colors.primary100};
|
|
149
|
+
|
|
150
|
+
${h} {
|
|
151
|
+
color: ${({ theme: e }) => e.colors.primary600};
|
|
152
|
+
font-weight: bold;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
&:hover,
|
|
157
|
+
&[data-highlighted] {
|
|
158
|
+
outline: none;
|
|
159
|
+
background-color: ${({ theme: e, $hasHover: o = !0 }) => o ? e.colors.primary100 : e.colors.neutral0};
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
&[data-highlighted] {
|
|
163
|
+
${h} {
|
|
164
|
+
color: ${({ theme: e }) => e.colors.primary600};
|
|
165
|
+
font-weight: bold;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
`;
|
|
169
|
+
export {
|
|
170
|
+
Ve as Combobox,
|
|
171
|
+
ke as ComboboxInput,
|
|
172
|
+
Ye as CreatableCombobox,
|
|
173
|
+
Ze as Option,
|
|
174
|
+
v as OptionBox
|
|
175
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime");/**
|
|
2
|
+
* @preserve
|
|
3
|
+
* @deprecated
|
|
4
|
+
* This component was deprecated in 1.6.2. It will be removed in the next major release 2.0.0.
|
|
5
|
+
*/const o=({options:t})=>e.jsx(e.Fragment,{children:t});exports.ComboboxList=o;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as r, Fragment as t } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* @preserve
|
|
4
|
+
* @deprecated
|
|
5
|
+
* This component was deprecated in 1.6.2. It will be removed in the next major release 2.0.0.
|
|
6
|
+
*/
|
|
7
|
+
const m = ({ options: o }) => r(t, { children: o });
|
|
8
|
+
export {
|
|
9
|
+
m as ComboboxList
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./Combobox.cjs"),t=o.Option;exports.ComboboxOption=t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./Combobox.cjs"),b=require("./ComboboxOption.cjs");exports.Combobox=o.Combobox;exports.CreatableCombobox=o.CreatableCombobox;exports.ComboboxOption=b.ComboboxOption;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),xe=require("react"),O=require("@floating-ui/react-dom"),g=require("@internationalized/date"),Ce=require("@radix-ui/react-focus-guards"),ye=require("@radix-ui/react-focus-scope"),ee=require("@strapi/icons"),R=require("@strapi/ui-primitives"),be=require("react-dom"),we=require("react-remove-scroll"),ke=require("styled-components"),Te=require("../DesignSystemProvider.cjs"),Se=require("../DismissibleLayer/index.cjs"),je=require("../helpers/context.cjs"),U=require("../hooks/useComposeRefs.cjs"),Ee=require("../hooks/useControllableState.cjs"),L=require("../hooks/useDateFormatter.cjs"),te=require("../hooks/useId.cjs"),N=require("../Select/SingleSelect.cjs"),Pe=require("../Portal/Portal.cjs"),V=require("../Flex/Flex.cjs"),X=require("../themes/utils.cjs"),z=require("../Box/Box.cjs"),Y=require("../Typography/Typography.cjs"),Ie=require("../Field/Field.cjs"),Re=require("../Field/FieldLabel.cjs"),ve=require("../Field/FieldHint.cjs"),Fe=require("../Field/FieldError.cjs"),Ae=e=>e&&e.__esModule?e:{default:e};function Me(e){if(e&&e.__esModule)return e;const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const t=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,t.get?t:{enumerable:!0,get:()=>e[n]})}}return r.default=e,Object.freeze(r)}const u=Me(xe),j=Ae(ke),qe=200,J=15,[_e,v]=je.createContext("DatePicker"),ne=u.forwardRef(({calendarLabel:e,className:r,initialDate:n,locale:t,maxDate:o,minDate:c,monthSelectLabel:p="Month",onChange:d,selectedDate:i,yearSelectLabel:m="Year",error:y,id:C,disabled:s=!1,placeholder:f,required:b=!1,onClear:x,clearLabel:T="Clear",size:w,ariaLabel:S,selectedDateLabel:l,...h},k)=>{const F=Te.useDesignSystem("DatePicker"),P=t??F.locale,B=L.useDateFormatter(P,{dateStyle:"short"}),A=u.useMemo(()=>{const D=B.formatToParts(new Date),{value:I}=D.find(_=>_.type==="literal");return I},[B]),[ae,oe]=u.useState(!1),[se,le]=u.useState(null),[W,ie]=u.useState(null),[ce,ue]=u.useState(null),[$,M]=u.useState(),[q,H]=Ee.useControllableState({defaultProp:n?E(n):void 0,prop:i&&E(i),onChange(D){d&&d(D?.toDate("UTC"))}}),[G,K]=u.useMemo(()=>{const D=n?E(n):g.today("UTC"),I=c?E(c):D.set({day:1,month:1,year:D.year-qe});let _=o?E(o):D.set({day:31,month:12,year:D.year+J});return _.compare(I)<0&&(_=I.set({day:31,month:12,year:I.year+J})),[I,_]},[c,o,n]),[de,Z]=u.useState(Oe({currentValue:q,minDate:G,maxDate:K})),fe=te.useId(),he=u.useRef(null),pe=D=>{x&&!s&&(M(""),H(void 0),x(D),W?.focus())},ge=u.useCallback(D=>{D&&q&&Z(q),oe(D)},[q]);u.useLayoutEffect(()=>{if(i){const D=E(i);M(D.toString().split("-").reverse().join(A))}else M("")},[A,i]),u.useLayoutEffect(()=>{if(n&&$===void 0){const D=E(n);M(D.toString().split("-").reverse().join(A))}},[A,n,$]);const me=`${C}-hint`,De=`${C}-error`;return a.jsxs(_e,{calendarDate:de,content:ce,contentId:fe,disabled:s,locale:P,minDate:G,maxDate:K,open:ae,onCalendarDateChange:Z,onContentChange:ue,onOpenChange:ge,onTextInputChange:ie,onTextValueChange:M,onTriggerChange:le,onValueChange:H,required:b,separator:A,textInput:W,textValue:$,timeZone:"UTC",trigger:se,value:q,children:[a.jsxs($e,{className:r,size:w,hasError:!!y,children:[a.jsx(ze,{"aria-hidden":!0}),a.jsx(Ue,{ref:k,placeholder:f,"aria-describedby":`${me} ${De}`,id:C,...h}),$&&x?a.jsx(Ve,{as:"button",hasRadius:!0,background:"transparent",type:"button",onClick:pe,"aria-disabled":s,"aria-label":T,title:T,ref:he,children:a.jsx(ee.Cross,{})}):null]}),a.jsx(Pe.Portal,{children:a.jsx(Ge,{label:e,children:a.jsx(Qe,{monthSelectLabel:p,yearSelectLabel:m})})})]})}),Q=e=>!!e.match(/^[^a-zA-Z]*$/),Oe=({currentValue:e,minDate:r,maxDate:n})=>{const t=g.today("UTC");return e||(g.minDate(r,t)===r&&g.maxDate(n,t)===n?t:g.minDate(r,t)===t?r:g.maxDate(n,t)===t?n:t)},Le="DatePickerTrigger",$e=u.forwardRef(({hasError:e,size:r="M",...n},t)=>{const o=v(Le),c=U.useComposedRefs(t,d=>o.onTriggerChange(d)),p=()=>{o.disabled||o.onOpenChange(!0)};return a.jsx(ye.FocusScope,{asChild:!0,trapped:o.open,onMountAutoFocus:d=>{d.preventDefault()},onUnmountAutoFocus:d=>{document.getSelection()?.empty(),d.preventDefault()},children:a.jsx(Ne,{ref:c,$hasError:e,$size:r,...n,paddingLeft:3,paddingRight:3,hasRadius:!0,gap:3,overflow:"hidden",background:o.disabled?"neutral150":"neutral0",onClick:R.composeEventHandlers(n.onClick,()=>{o.textInput?.focus()}),onPointerDown:R.composeEventHandlers(n.onPointerDown,d=>{const i=d.target;i.hasPointerCapture(d.pointerId)&&i.releasePointerCapture(d.pointerId),(i.closest("button")??i.closest("div"))===d.currentTarget&&d.button===0&&d.ctrlKey===!1&&(p(),o.textInput?.focus())})})})}),Ne=j.default(V.Flex)`
|
|
2
|
+
border: 1px solid ${({theme:e,$hasError:r})=>r?e.colors.danger600:e.colors.neutral200};
|
|
3
|
+
min-height: ${({theme:e,$size:r})=>X.getThemeSize("input")({theme:e,size:r})};
|
|
4
|
+
|
|
5
|
+
&[data-disabled] {
|
|
6
|
+
color: ${({theme:e})=>e.colors.neutral600};
|
|
7
|
+
background: ${({theme:e})=>e.colors.neutral150};
|
|
8
|
+
cursor: not-allowed;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/* Required to ensure the below inputFocusStyles are adhered too */
|
|
12
|
+
&:focus-visible {
|
|
13
|
+
outline: none;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
${({theme:e,$hasError:r})=>X.inputFocusStyle()({theme:e,hasError:r})};
|
|
17
|
+
`,Ve=j.default(z.Box)`
|
|
18
|
+
border: none;
|
|
19
|
+
|
|
20
|
+
svg {
|
|
21
|
+
height: ${11/16}rem;
|
|
22
|
+
width: ${11/16}rem;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
svg path {
|
|
26
|
+
fill: ${({theme:e})=>e.colors.neutral600};
|
|
27
|
+
}
|
|
28
|
+
`,ze=j.default(ee.Calendar)`
|
|
29
|
+
& > path {
|
|
30
|
+
fill: ${({theme:e})=>e.colors.neutral500};
|
|
31
|
+
}
|
|
32
|
+
`,Ye="DatePickerTextInput",Ue=u.forwardRef(({placeholder:e,...r},n)=>{const t=v(Ye),{onTextValueChange:o,textValue:c,onTextInputChange:p,onOpenChange:d,disabled:i,separator:m}=t,y=U.useComposedRefs(n,s=>p(s)),C=()=>{i||d(!0)};return a.jsx(We,{role:"combobox",type:"text",inputMode:"numeric",ref:y,"aria-autocomplete":"none","aria-controls":t.contentId,"aria-disabled":t.disabled,"aria-expanded":t.open,"aria-required":t.required,"aria-haspopup":"dialog","data-state":t.open?"open":"closed",disabled:i,"data-disabled":i?"":void 0,pattern:`\\d{2}${m}\\d{2}${m}\\d{4}`,placeholder:e??`DD${m}MM${m}YYYY`,...r,value:c??"",onBlur:R.composeEventHandlers(r.onBlur,()=>{if(!t.textValue){t.onValueChange(void 0);return}t.onTextValueChange(t.calendarDate.toString().split("-").reverse().join(m)),t.onValueChange(t.calendarDate)}),onChange:R.composeEventHandlers(r.onChange,s=>{if(Q(s.target.value)){const[f,b,x]=s.target.value.split(m),T=t.calendarDate.year;let w=t.calendarDate.year;if(x){let P=x.length===1?`0${x}`:x;w=x.length<3?Number(`${T}`.slice(0,4-P.length)+P):Number(P)}x&&x.length<3&&w>t.maxDate.year&&(w-=100);const S=t.calendarDate.set({year:w}),l=S.calendar.getMonthsInYear(S),h=S.set({month:b&&Number(b)<=l?Number(b):void 0}),k=h.calendar.getDaysInMonth(h),F=h.set({day:f&&Number(f)<=k?Number(f):void 0});t.onCalendarDateChange(Be(F,t.minDate,t.maxDate)),t.onTextValueChange(s.target.value)}}),onKeyDown:R.composeEventHandlers(r.onKeyDown,s=>{if(!t.open&&(Q(s.key)||["ArrowDown","Backspace"].includes(s.key)))C();else if(["Tab"].includes(s.key)&&t.open)s.preventDefault();else if(["Escape"].includes(s.key))t.open?t.onOpenChange(!1):(t.onValueChange(void 0),t.onTextValueChange("")),s.preventDefault();else if(t.open&&["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"].includes(s.key))switch(s.preventDefault(),s.key){case"ArrowDown":{const f=t.calendarDate.add({weeks:1});if(t.maxDate&&f.compare(t.maxDate)>0)return;t.onCalendarDateChange(f);return}case"ArrowRight":{const f=t.calendarDate.add({days:1});if(t.maxDate&&f.compare(t.maxDate)>0)return;t.onCalendarDateChange(f);return}case"ArrowUp":{const f=t.calendarDate.subtract({weeks:1});if(t.minDate&&f.compare(t.minDate)<0)return;t.onCalendarDateChange(f);return}case"ArrowLeft":{const f=t.calendarDate.subtract({days:1});if(t.minDate&&f.compare(t.minDate)<0)return;t.onCalendarDateChange(f)}}else t.open&&["Enter"].includes(s.key)&&(o(t.calendarDate.toString().split("-").reverse().join(m)),t.onValueChange(t.calendarDate),t.onOpenChange(!1))})})});function Be(e,r,n){return r&&(e=g.maxDate(e,r)),n&&(e=g.minDate(e,n)),e}const We=j.default.input`
|
|
33
|
+
width: 100%;
|
|
34
|
+
font-size: ${14/16}rem;
|
|
35
|
+
color: ${({theme:e})=>e.colors.neutral800};
|
|
36
|
+
height: 100%;
|
|
37
|
+
border: none;
|
|
38
|
+
background-color: transparent;
|
|
39
|
+
|
|
40
|
+
&:focus-visible {
|
|
41
|
+
outline: none;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&[aria-disabled='true'] {
|
|
45
|
+
cursor: inherit;
|
|
46
|
+
}
|
|
47
|
+
`,He="DatePickerContent",Ge=u.forwardRef((e,r)=>{const[n,t]=u.useState(),o=v(He);if(u.useLayoutEffect(()=>{t(new DocumentFragment)},[]),!o.open){const c=n;return c?be.createPortal(a.jsx("div",{children:e.children}),c):null}return a.jsx(Ze,{...e,ref:r})}),Ke="DatePickerContent",Ze=u.forwardRef((e,r)=>{const{label:n="Choose date",...t}=e,{onOpenChange:o,...c}=v(Ke),{x:p,y:d,reference:i,floating:m,strategy:y}=O.useFloating({strategy:"fixed",placement:"bottom-start",middleware:[O.offset({mainAxis:4}),O.shift(),O.flip()],whileElementsMounted:O.autoUpdate});u.useEffect(()=>{const s=()=>{o(!1)};return window.addEventListener("blur",s),window.addEventListener("resize",s),()=>{window.removeEventListener("blur",s),window.removeEventListener("resize",s)}},[o]),u.useLayoutEffect(()=>{i(c.trigger)},[i,c.trigger]);const C=U.useComposedRefs(r,s=>c.onContentChange(s),m);return Ce.useFocusGuards(),a.jsx(we.RemoveScroll,{allowPinchZoom:!0,children:a.jsx(Se.DismissibleLayer,{asChild:!0,onFocusOutside:s=>{s.preventDefault()},onDismiss:()=>{o(!1)},children:a.jsx(Xe,{ref:C,"data-state":c.open?"open":"closed",onContextMenu:s=>s.preventDefault(),id:c.contentId,role:"dialog","aria-modal":"true","aria-label":n,style:{left:p,top:d,position:y},hasRadius:!0,background:"neutral0",padding:1,...t})})})}),Xe=j.default(z.Box)`
|
|
48
|
+
box-shadow: ${({theme:e})=>e.shadows.filterShadow};
|
|
49
|
+
z-index: ${({theme:e})=>e.zIndices[0]};
|
|
50
|
+
border: 1px solid ${({theme:e})=>e.colors.neutral150};
|
|
51
|
+
`,Je="DatePickerCalendar",Qe=u.forwardRef(({monthSelectLabel:e,yearSelectLabel:r,...n},t)=>{const{locale:o,timeZone:c,minDate:p,maxDate:d,calendarDate:i,onCalendarDateChange:m}=v(Je),y=g.startOfMonth(i),C=u.useMemo(()=>{const l=p.year,h=d.year;return[...Array(h-l+1).keys()].map(k=>(l+k).toString())},[p,d]),s=L.useDateFormatter(o,{month:"long"}),f=u.useMemo(()=>[...Array(i.calendar.getMonthsInYear(i)).keys()].map(l=>s.format(i.set({month:l+1}).toDate(c))),[i,s,c]),b=L.useDateFormatter(o,{weekday:"short"}),x=u.useMemo(()=>{let l=g.startOfWeek(g.today(c),o);return[...new Array(7).keys()].map(h=>{let F=l.add({days:h}).toDate(c);return b.format(F)})},[c,o,b]),T=l=>{if(typeof l=="number")return;const h=i.set({month:f.indexOf(l)+1});m(h)},w=l=>{if(typeof l=="number")return;const h=i.set({year:parseInt(l,10)});m(h)},S=et(y,o);return a.jsxs(V.Flex,{ref:t,direction:"column",alignItems:"stretch",padding:4,...n,children:[a.jsxs(tt,{justifyContent:"flex-start",paddingBottom:4,paddingLeft:2,paddingRight:2,gap:2,children:[a.jsx(N.SingleSelectInput,{label:e,size:"S",value:f[i.month-1],onChange:T,children:f.map(l=>a.jsx(N.SingleSelectOption,{value:l,children:l},l))}),a.jsx(N.SingleSelectInput,{size:"S",value:i.year.toString(),label:r,onChange:w,children:C.map(l=>a.jsx(N.SingleSelectOption,{value:l,children:l},l))})]}),a.jsxs("table",{role:"grid",children:[a.jsx("thead",{"aria-hidden":!0,children:a.jsx("tr",{"aria-rowindex":0,children:x.map((l,h)=>a.jsx(nt,{"aria-colindex":h,children:l},l))})}),a.jsx("tbody",{children:[...new Array(6).keys()].map(l=>a.jsx("tr",{"aria-rowindex":l+2,children:S(l).map((h,k)=>h?a.jsx(ot,{"aria-colindex":k+1,date:h,startDate:y},h.toString()):a.jsx(re,{"aria-colindex":k+1}))},l))})]})]})}),et=(e,r)=>n=>{let t=e.add({weeks:n}),o=[];t=g.startOfWeek(t,r);let c=g.getDayOfWeek(t,r);for(let p=0;p<c;p++)o.push(null);for(;o.length<7;){o.push(t);let p=t.add({days:1});if(g.isSameDay(t,p))break;t=p}for(;o.length<7;)o.push(null);return o},tt=j.default(V.Flex)`
|
|
52
|
+
div[role='combobox'] {
|
|
53
|
+
border: 1px solid transparent;
|
|
54
|
+
background: transparent;
|
|
55
|
+
font-weight: ${e=>e.theme.fontWeights.bold};
|
|
56
|
+
|
|
57
|
+
${Y.Typography} {
|
|
58
|
+
color: ${({theme:e})=>e.colors.neutral800};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
svg {
|
|
62
|
+
> g,
|
|
63
|
+
path {
|
|
64
|
+
fill: ${({theme:e})=>e.colors.neutral500};
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&:hover {
|
|
69
|
+
background-color: ${({theme:e})=>e.colors.neutral100};
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
`,nt=u.forwardRef(({children:e,...r},n)=>a.jsx(rt,{as:"th",role:"gridcell",ref:n,...r,height:`${24/16}rem`,width:`${32/16}rem`,children:a.jsx(Y.Typography,{variant:"pi",fontWeight:"bold",color:"neutral800",children:e.slice(0,2)})})),rt=j.default(z.Box)`
|
|
73
|
+
border-radius: ${({theme:e})=>e.borderRadius};
|
|
74
|
+
text-transform: capitalize;
|
|
75
|
+
`,at="DatePickerCalendarCell",ot=u.forwardRef(({date:e,startDate:r,...n},t)=>{const{timeZone:o,locale:c,calendarDate:p,onValueChange:d,onOpenChange:i,onTextValueChange:m,separator:y,onCalendarDateChange:C}=v(at),s=g.isSameDay(p,e),f=L.useDateFormatter(c,{weekday:"long",day:"numeric",month:"long",year:"numeric"}),b=u.useMemo(()=>f.format(e.toDate(o)),[f,e,o]),x=L.useDateFormatter(c,{day:"numeric",calendar:e.calendar.identifier}),T=u.useMemo(()=>x.formatToParts(e.toDate(o)).find(h=>h.type==="day").value,[x,e,o]),w=g.endOfMonth(r),S=e.compare(r)<0||e.compare(w)>0;let l="neutral900";return s?l="primary600":S&&(l="neutral600"),a.jsx(re,{as:"td",role:"gridcell",ref:t,"aria-selected":s,...n,hasRadius:!0,"aria-label":b,tabIndex:s?0:-1,background:s?"primary100":"neutral0",cursor:"pointer",onPointerDown:R.composeEventHandlers(n.onPointerDown,h=>{h.preventDefault(),C(e),d(e),m(e.toString().split("-").reverse().join(y)),i(!1)}),children:a.jsx(Y.Typography,{variant:"pi",textColor:l,children:T})})}),re=j.default(z.Box)`
|
|
76
|
+
text-align: center;
|
|
77
|
+
padding: ${7/16}rem;
|
|
78
|
+
// Trick to prevent the outline from overflowing because of the general outline-offset
|
|
79
|
+
outline-offset: -2px !important;
|
|
80
|
+
|
|
81
|
+
&:hover {
|
|
82
|
+
background: ${({theme:e})=>e.colors.primary100};
|
|
83
|
+
|
|
84
|
+
& > ${Y.Typography} {
|
|
85
|
+
color: ${({theme:e})=>e.colors.primary600};
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
`,st=u.forwardRef((e,r)=>{const{error:n,hint:t,id:o,required:c,label:p,...d}=e,i=te.useId(o);return a.jsx(Ie.Field,{error:n,hint:t,required:c,ref:r,id:i,children:a.jsxs(V.Flex,{direction:"column",alignItems:"stretch",gap:1,children:[a.jsx(Re.FieldLabel,{children:p}),a.jsx(ne,{id:i,error:n,required:c,...d}),a.jsx(ve.FieldHint,{}),a.jsx(Fe.FieldError,{})]})})}),E=e=>{const r=e.toISOString(),n=g.parseAbsoluteToLocal(r);return g.toCalendarDate(n)},lt=st;exports.DatePicker=lt;exports.DatePickerInput=ne;
|