@strapi/design-system 0.0.0-599b75fb-test
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/dist/Accordion/Accordion.cjs +23 -0
- package/dist/Accordion/Accordion.js +96 -0
- package/dist/Accordion/AccordionContent.cjs +1 -0
- package/dist/Accordion/AccordionContent.js +26 -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 +130 -0
- package/dist/Accordion/AccordionToggle.cjs +28 -0
- package/dist/Accordion/AccordionToggle.js +143 -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 +118 -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 +83 -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 +43 -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 +50 -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 +123 -0
- package/dist/BaseCheckbox/assets/checkmark-black.cjs +1 -0
- package/dist/BaseCheckbox/assets/checkmark-black.js +4 -0
- package/dist/BaseCheckbox/assets/checkmark.cjs +1 -0
- package/dist/BaseCheckbox/assets/checkmark.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 +3 -0
- package/dist/BaseLink/BaseLink.js +24 -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 +84 -0
- package/dist/BaseRadio/RadioGroup.cjs +1 -0
- package/dist/BaseRadio/RadioGroup.js +37 -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 +221 -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 +63 -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 +98 -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 +32 -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 +48 -0
- package/dist/Card/CardBadge.cjs +6 -0
- package/dist/Card/CardBadge.js +18 -0
- package/dist/Card/CardBody.cjs +1 -0
- package/dist/Card/CardBody.js +16 -0
- package/dist/Card/CardCheckbox.cjs +1 -0
- package/dist/Card/CardCheckbox.js +19 -0
- package/dist/Card/CardContent.cjs +3 -0
- package/dist/Card/CardContent.js +15 -0
- package/dist/Card/CardContext.cjs +1 -0
- package/dist/Card/CardContext.js +8 -0
- package/dist/Card/CardHeader.cjs +3 -0
- package/dist/Card/CardHeader.js +15 -0
- package/dist/Card/CardTimer.cjs +1 -0
- package/dist/Card/CardTimer.js +25 -0
- package/dist/Card/CardTitle.cjs +1 -0
- package/dist/Card/CardTitle.js +25 -0
- package/dist/Card/index.cjs +1 -0
- package/dist/Card/index.js +23 -0
- package/dist/CarouselInput/Carousel.cjs +14 -0
- package/dist/CarouselInput/Carousel.js +85 -0
- package/dist/CarouselInput/CarouselActions.cjs +1 -0
- package/dist/CarouselInput/CarouselActions.js +18 -0
- package/dist/CarouselInput/CarouselImage.cjs +4 -0
- package/dist/CarouselInput/CarouselImage.js +26 -0
- package/dist/CarouselInput/CarouselInput.cjs +1 -0
- package/dist/CarouselInput/CarouselInput.js +75 -0
- package/dist/CarouselInput/CarouselSlide.cjs +3 -0
- package/dist/CarouselInput/CarouselSlide.js +30 -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 +45 -0
- package/dist/Checkbox/index.cjs +1 -0
- package/dist/Checkbox/index.js +4 -0
- package/dist/Combobox/Combobox.cjs +1 -0
- package/dist/Combobox/Combobox.js +287 -0
- package/dist/Combobox/ComboboxList.cjs +1 -0
- package/dist/Combobox/ComboboxList.js +8 -0
- package/dist/Combobox/ComboboxOption.cjs +1 -0
- package/dist/Combobox/ComboboxOption.js +31 -0
- package/dist/Combobox/components.cjs +53 -0
- package/dist/Combobox/components.js +64 -0
- package/dist/Combobox/index.cjs +1 -0
- package/dist/Combobox/index.js +7 -0
- package/dist/Combobox/utils.cjs +1 -0
- package/dist/Combobox/utils.js +78 -0
- package/dist/DatePicker/DatePicker.cjs +8 -0
- package/dist/DatePicker/DatePicker.js +83 -0
- package/dist/DatePicker/DatePickerCalendar.cjs +1 -0
- package/dist/DatePicker/DatePickerCalendar.js +142 -0
- package/dist/DatePicker/DatePickerTd.cjs +19 -0
- package/dist/DatePicker/DatePickerTd.js +61 -0
- package/dist/DatePicker/DatePickerTh.cjs +9 -0
- package/dist/DatePicker/DatePickerTh.js +42 -0
- package/dist/DatePicker/compareDates.cjs +1 -0
- package/dist/DatePicker/compareDates.js +4 -0
- package/dist/DatePicker/components.cjs +33 -0
- package/dist/DatePicker/components.js +43 -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 +1 -0
- package/dist/DateTimePicker/DateTimePicker.js +107 -0
- package/dist/DateTimePicker/index.cjs +1 -0
- package/dist/DateTimePicker/index.js +4 -0
- package/dist/Dialog/Dialog.cjs +11 -0
- package/dist/Dialog/Dialog.js +56 -0
- package/dist/Dialog/DialogBody.cjs +10 -0
- package/dist/Dialog/DialogBody.js +26 -0
- package/dist/Dialog/DialogFooter.cjs +9 -0
- package/dist/Dialog/DialogFooter.js +26 -0
- package/dist/Dialog/index.cjs +1 -0
- package/dist/Dialog/index.js +8 -0
- package/dist/DismissibleLayer/DismissibleLayer.cjs +1 -0
- package/dist/DismissibleLayer/DismissibleLayer.js +30 -0
- package/dist/DismissibleLayer/index.cjs +1 -0
- package/dist/DismissibleLayer/index.js +4 -0
- package/dist/Divider/Divider.cjs +7 -0
- package/dist/Divider/Divider.js +22 -0
- package/dist/Divider/index.cjs +1 -0
- package/dist/Divider/index.js +4 -0
- package/dist/EmptyStateLayout/EmptyStateLayout.cjs +10 -0
- package/dist/EmptyStateLayout/EmptyStateLayout.js +30 -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 +64 -0
- package/dist/Field/Field.cjs +1 -0
- package/dist/Field/Field.js +33 -0
- package/dist/Field/FieldAction.cjs +4 -0
- package/dist/Field/FieldAction.js +31 -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 +20 -0
- package/dist/Field/FieldHint.cjs +1 -0
- package/dist/Field/FieldHint.js +20 -0
- package/dist/Field/FieldInput.cjs +41 -0
- package/dist/Field/FieldInput.js +130 -0
- package/dist/Field/FieldLabel.cjs +12 -0
- package/dist/Field/FieldLabel.js +50 -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 +34 -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 +41 -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 +25 -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 +33 -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 +30 -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 +152 -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 +109 -0
- package/dist/JSONInput/JSONInputContainer.cjs +33 -0
- package/dist/JSONInput/JSONInputContainer.js +46 -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 +24 -0
- package/dist/KeyboardNavigable/KeyboardNavigable.cjs +1 -0
- package/dist/KeyboardNavigable/KeyboardNavigable.js +53 -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 +25 -0
- package/dist/Layout/ContentLayout.cjs +1 -0
- package/dist/Layout/ContentLayout.js +10 -0
- package/dist/Layout/GridLayout.cjs +5 -0
- package/dist/Layout/GridLayout.js +13 -0
- package/dist/Layout/HeaderLayout.cjs +3 -0
- package/dist/Layout/HeaderLayout.js +103 -0
- package/dist/Layout/Layout.cjs +6 -0
- package/dist/Layout/Layout.js +20 -0
- package/dist/Layout/TwoColsLayout.cjs +1 -0
- package/dist/Layout/TwoColsLayout.js +13 -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 +88 -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 +72 -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 +24 -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 +39 -0
- package/dist/Loader/assets/loader.cjs +1 -0
- package/dist/Loader/assets/loader.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 +21 -0
- package/dist/Main/SkipToContent.cjs +11 -0
- package/dist/Main/SkipToContent.js +33 -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 +32 -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 +33 -0
- package/dist/MainNav/NavCondense.cjs +20 -0
- package/dist/MainNav/NavCondense.js +36 -0
- package/dist/MainNav/NavFooter.cjs +1 -0
- package/dist/MainNav/NavFooter.js +11 -0
- package/dist/MainNav/NavLink.cjs +69 -0
- package/dist/MainNav/NavLink.js +93 -0
- package/dist/MainNav/NavSection.cjs +1 -0
- package/dist/MainNav/NavSection.js +36 -0
- package/dist/MainNav/NavSections.cjs +4 -0
- package/dist/MainNav/NavSections.js +25 -0
- package/dist/MainNav/NavUser.cjs +3 -0
- package/dist/MainNav/NavUser.js +29 -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 +6 -0
- package/dist/ModalLayout/ModalFooter.cjs +8 -0
- package/dist/ModalLayout/ModalFooter.js +24 -0
- package/dist/ModalLayout/ModalHeader.cjs +4 -0
- package/dist/ModalLayout/ModalHeader.js +25 -0
- package/dist/ModalLayout/ModalLayout.cjs +6 -0
- package/dist/ModalLayout/ModalLayout.js +35 -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 +172 -0
- package/dist/NumberInput/index.cjs +1 -0
- package/dist/NumberInput/index.js +4 -0
- package/dist/Pagination/Pagination.cjs +5 -0
- package/dist/Pagination/Pagination.js +25 -0
- package/dist/Pagination/PaginationContext.cjs +1 -0
- package/dist/Pagination/PaginationContext.js +6 -0
- package/dist/Pagination/assets/next.cjs +1 -0
- package/dist/Pagination/assets/next.js +4 -0
- package/dist/Pagination/assets/previous.cjs +1 -0
- package/dist/Pagination/assets/previous.js +4 -0
- package/dist/Pagination/components.cjs +36 -0
- package/dist/Pagination/components.js +103 -0
- package/dist/Pagination/index.cjs +1 -0
- package/dist/Pagination/index.js +9 -0
- package/dist/Popover/Popover.cjs +26 -0
- package/dist/Popover/Popover.js +132 -0
- package/dist/Popover/index.cjs +1 -0
- package/dist/Popover/index.js +11 -0
- package/dist/Portal/Portal.cjs +1 -0
- package/dist/Portal/Portal.js +13 -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 +47 -0
- package/dist/ProgressBar/index.cjs +1 -0
- package/dist/ProgressBar/index.js +4 -0
- package/dist/Radio/Radio.cjs +4 -0
- package/dist/Radio/Radio.js +17 -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 +83 -0
- package/dist/RawTable/RawTable.cjs +1 -0
- package/dist/RawTable/RawTable.js +77 -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 +17 -0
- package/dist/RawTable/RawThead.cjs +1 -0
- package/dist/RawTable/RawThead.js +17 -0
- package/dist/RawTable/RawTr.cjs +1 -0
- package/dist/RawTable/RawTr.js +23 -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 +29 -0
- package/dist/Searchbar/Searchbar.js +75 -0
- package/dist/Searchbar/index.cjs +1 -0
- package/dist/Searchbar/index.js +6 -0
- package/dist/Select/MultiSelectNested.cjs +1 -0
- package/dist/Select/MultiSelectNested.js +14 -0
- package/dist/Select/OptGroup.cjs +1 -0
- package/dist/Select/OptGroup.js +24 -0
- package/dist/Select/Option.cjs +45 -0
- package/dist/Select/Option.js +102 -0
- package/dist/Select/Select.cjs +3 -0
- package/dist/Select/Select.js +209 -0
- package/dist/Select/SelectButton.cjs +19 -0
- package/dist/Select/SelectButton.js +69 -0
- package/dist/Select/SelectList.cjs +1 -0
- package/dist/Select/SelectList.js +87 -0
- package/dist/Select/SelectTags.cjs +6 -0
- package/dist/Select/SelectTags.js +38 -0
- package/dist/Select/components.cjs +39 -0
- package/dist/Select/components.js +48 -0
- package/dist/Select/constants.cjs +1 -0
- package/dist/Select/constants.js +8 -0
- package/dist/Select/hooks/useButtonRef.cjs +1 -0
- package/dist/Select/hooks/useButtonRef.js +13 -0
- package/dist/Select/hooks/useListRef.cjs +1 -0
- package/dist/Select/hooks/useListRef.js +18 -0
- package/dist/Select/index.cjs +1 -0
- package/dist/Select/index.js +12 -0
- package/dist/Select/utils.cjs +1 -0
- package/dist/Select/utils.js +17 -0
- package/dist/SimpleMenu/SimpleMenu.cjs +35 -0
- package/dist/SimpleMenu/SimpleMenu.js +179 -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 +56 -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 +48 -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 +76 -0
- package/dist/SubNav/SubNavLink.cjs +39 -0
- package/dist/SubNav/SubNavLink.js +75 -0
- package/dist/SubNav/SubNavLinkSection.cjs +19 -0
- package/dist/SubNav/SubNavLinkSection.js +44 -0
- package/dist/SubNav/SubNavSection.cjs +8 -0
- package/dist/SubNav/SubNavSection.js +57 -0
- package/dist/SubNav/SubNavSectionLabel.cjs +9 -0
- package/dist/SubNav/SubNavSectionLabel.js +44 -0
- package/dist/SubNav/SubNavSections.cjs +1 -0
- package/dist/SubNav/SubNavSections.js +21 -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 +79 -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 +34 -0
- package/dist/Table/TFooter.cjs +22 -0
- package/dist/Table/TFooter.js +36 -0
- package/dist/Table/Table.cjs +34 -0
- package/dist/Table/Table.js +66 -0
- package/dist/Table/Tbody.cjs +5 -0
- package/dist/Table/Tbody.js +11 -0
- package/dist/Table/Thead.cjs +3 -0
- package/dist/Table/Thead.js +9 -0
- package/dist/Table/Tr.cjs +20 -0
- package/dist/Table/Tr.js +26 -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 +39 -0
- package/dist/Tabs/TabPanels.cjs +1 -0
- package/dist/Tabs/TabPanels.js +24 -0
- package/dist/Tabs/Tabs.cjs +5 -0
- package/dist/Tabs/Tabs.js +126 -0
- package/dist/Tabs/TabsContext.cjs +1 -0
- package/dist/Tabs/TabsContext.js +6 -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/Tabs/useTabsFocus.cjs +1 -0
- package/dist/Tabs/useTabsFocus.js +17 -0
- package/dist/Tag/Tag.cjs +14 -0
- package/dist/Tag/Tag.js +60 -0
- package/dist/Tag/index.cjs +1 -0
- package/dist/Tag/index.js +4 -0
- package/dist/TextButton/TextButton.cjs +32 -0
- package/dist/TextButton/TextButton.js +83 -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 +52 -0
- package/dist/TextInput/index.cjs +1 -0
- package/dist/TextInput/index.js +4 -0
- package/dist/Textarea/Textarea.cjs +15 -0
- package/dist/Textarea/Textarea.js +58 -0
- package/dist/Textarea/TextareaInput.cjs +30 -0
- package/dist/Textarea/TextareaInput.js +70 -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 +187 -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 +10 -0
- package/dist/TimePicker/TimePicker.js +58 -0
- package/dist/TimePicker/index.cjs +1 -0
- package/dist/TimePicker/index.js +4 -0
- package/dist/ToggleCheckbox/ToggleCheckbox.cjs +36 -0
- package/dist/ToggleCheckbox/ToggleCheckbox.js +154 -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 +70 -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 +69 -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 +40 -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/arrays.cjs +1 -0
- package/dist/helpers/arrays.js +6 -0
- package/dist/helpers/deprecations.cjs +1 -0
- package/dist/helpers/deprecations.js +13 -0
- package/dist/helpers/escapeSelector.cjs +1 -0
- package/dist/helpers/escapeSelector.js +4 -0
- package/dist/helpers/getDefaultLocale.cjs +1 -0
- package/dist/helpers/getDefaultLocale.js +4 -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 +26 -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/theme.cjs +1 -0
- package/dist/helpers/theme.js +7 -0
- package/dist/helpers/useElementOnScreen.cjs +1 -0
- package/dist/helpers/useElementOnScreen.js +6 -0
- package/dist/helpers/useId.cjs +1 -0
- package/dist/helpers/useId.js +6 -0
- package/dist/helpers/useIntersection.cjs +1 -0
- package/dist/helpers/useIntersection.js +6 -0
- package/dist/helpers/useLockScroll.cjs +1 -0
- package/dist/helpers/useLockScroll.js +6 -0
- package/dist/helpers/usePrevious.cjs +1 -0
- package/dist/helpers/usePrevious.js +6 -0
- package/dist/helpers/useResizeObserver.cjs +1 -0
- package/dist/helpers/useResizeObserver.js +6 -0
- package/dist/hooks/useControllableState.cjs +1 -0
- package/dist/hooks/useControllableState.js +22 -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 +299 -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 +28 -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 +46 -0
- package/dist/v2/Breadcrumbs/Breadcrumbs.cjs +9 -0
- package/dist/v2/Breadcrumbs/Breadcrumbs.js +29 -0
- package/dist/v2/Breadcrumbs/Crumb.cjs +1 -0
- package/dist/v2/Breadcrumbs/Crumb.js +26 -0
- package/dist/v2/Breadcrumbs/CrumbLink.cjs +14 -0
- package/dist/v2/Breadcrumbs/CrumbLink.js +29 -0
- package/dist/v2/Breadcrumbs/CrumbSimpleMenu.cjs +8 -0
- package/dist/v2/Breadcrumbs/CrumbSimpleMenu.js +22 -0
- package/dist/v2/Breadcrumbs/Divider.cjs +1 -0
- package/dist/v2/Breadcrumbs/Divider.js +8 -0
- package/dist/v2/Breadcrumbs/index.cjs +1 -0
- package/dist/v2/Breadcrumbs/index.js +10 -0
- package/dist/v2/Link/Link.cjs +23 -0
- package/dist/v2/Link/Link.js +50 -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 +73 -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 +32 -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 +34 -0
- package/dist/v2/MainNav/NavCondense.cjs +20 -0
- package/dist/v2/MainNav/NavCondense.js +36 -0
- package/dist/v2/MainNav/NavFooter.cjs +1 -0
- package/dist/v2/MainNav/NavFooter.js +11 -0
- package/dist/v2/MainNav/NavLink.cjs +69 -0
- package/dist/v2/MainNav/NavLink.js +93 -0
- package/dist/v2/MainNav/NavSection.cjs +1 -0
- package/dist/v2/MainNav/NavSection.js +36 -0
- package/dist/v2/MainNav/NavSections.cjs +4 -0
- package/dist/v2/MainNav/NavSections.js +25 -0
- package/dist/v2/MainNav/NavUser.cjs +3 -0
- package/dist/v2/MainNav/NavUser.js +29 -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 +25 -0
- package/dist/v2/Pagination/PaginationContext.cjs +1 -0
- package/dist/v2/Pagination/PaginationContext.js +6 -0
- package/dist/v2/Pagination/assets/next.cjs +1 -0
- package/dist/v2/Pagination/assets/next.js +4 -0
- package/dist/v2/Pagination/assets/previous.cjs +1 -0
- package/dist/v2/Pagination/assets/previous.js +4 -0
- package/dist/v2/Pagination/components.cjs +36 -0
- package/dist/v2/Pagination/components.js +82 -0
- package/dist/v2/Pagination/index.cjs +1 -0
- package/dist/v2/Pagination/index.js +9 -0
- package/dist/v2/SimpleMenu/SimpleMenu.cjs +33 -0
- package/dist/v2/SimpleMenu/SimpleMenu.js +179 -0
- package/dist/v2/SimpleMenu/index.cjs +1 -0
- package/dist/v2/SimpleMenu/index.js +5 -0
- package/dist/v2/SimpleMenu/utils.cjs +12 -0
- package/dist/v2/SimpleMenu/utils.js +15 -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 +76 -0
- package/dist/v2/SubNav/SubNavLink.cjs +39 -0
- package/dist/v2/SubNav/SubNavLink.js +78 -0
- package/dist/v2/SubNav/SubNavLinkSection.cjs +19 -0
- package/dist/v2/SubNav/SubNavLinkSection.js +43 -0
- package/dist/v2/SubNav/SubNavSection.cjs +8 -0
- package/dist/v2/SubNav/SubNavSection.js +56 -0
- package/dist/v2/SubNav/SubNavSectionLabel.cjs +9 -0
- package/dist/v2/SubNav/SubNavSectionLabel.js +44 -0
- package/dist/v2/SubNav/SubNavSections.cjs +1 -0
- package/dist/v2/SubNav/SubNavSections.js +21 -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 +53 -0
- package/package.json +81 -0
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
import o, { useState as y, useRef as C, useEffect as _, useLayoutEffect as xe, Children as j, cloneElement as ye } from "react";
|
|
2
|
+
import { Cross as Ie, CarretDown as Oe } from "@strapi/icons";
|
|
3
|
+
import e from "prop-types";
|
|
4
|
+
import { ComboboxOption as ke } from "./ComboboxOption.js";
|
|
5
|
+
import { MainRow as Me, InputContainer as $e, ValueContainer as we, Input as Le } from "./components.js";
|
|
6
|
+
import { filterOptions as q, maintainScrollVisibility as De, getActionFromKey as Re, MenuActions as b, getUpdatedIndex as R } from "./utils.js";
|
|
7
|
+
import { Box as Be } from "../Box/Box.js";
|
|
8
|
+
import { Field as Fe } from "../Field/Field.js";
|
|
9
|
+
import { FieldLabel as Se } from "../Field/FieldLabel.js";
|
|
10
|
+
import "../Field/FieldInput.js";
|
|
11
|
+
import { FieldHint as Te } from "../Field/FieldHint.js";
|
|
12
|
+
import { FieldError as Ae } from "../Field/FieldError.js";
|
|
13
|
+
import "../Field/FieldContext.js";
|
|
14
|
+
import "../Field/FieldAction.js";
|
|
15
|
+
import { Flex as B } from "../Flex/Flex.js";
|
|
16
|
+
import { KeyboardKeys as Pe } from "../helpers/keyboardKeys.js";
|
|
17
|
+
import { useId as Ve } from "../hooks/useId.js";
|
|
18
|
+
import { Loader as Ke } from "../Loader/Loader.js";
|
|
19
|
+
import { Popover as Ne } from "../Popover/Popover.js";
|
|
20
|
+
import { IconBox as He, CaretBox as Ue } from "../Select/components.js";
|
|
21
|
+
import { Typography as z } from "../Typography/Typography.js";
|
|
22
|
+
import { VisuallyHidden as _e } from "../VisuallyHidden/VisuallyHidden.js";
|
|
23
|
+
const I = ({
|
|
24
|
+
children: s,
|
|
25
|
+
clearLabel: G,
|
|
26
|
+
creatable: h,
|
|
27
|
+
createMessage: J,
|
|
28
|
+
disabled: c,
|
|
29
|
+
error: O,
|
|
30
|
+
hasMoreItems: Q,
|
|
31
|
+
hint: $,
|
|
32
|
+
id: X,
|
|
33
|
+
label: E,
|
|
34
|
+
labelAction: Y,
|
|
35
|
+
loading: w,
|
|
36
|
+
loadingMessage: Z,
|
|
37
|
+
noOptionsMessage: ee,
|
|
38
|
+
onChange: F,
|
|
39
|
+
onClear: S,
|
|
40
|
+
onCreateOption: te,
|
|
41
|
+
onInputChange: T,
|
|
42
|
+
onLoadMore: oe,
|
|
43
|
+
placeholder: ne,
|
|
44
|
+
required: A,
|
|
45
|
+
value: d,
|
|
46
|
+
...re
|
|
47
|
+
}) => {
|
|
48
|
+
const ae = () => s.find((t) => t.props?.value.toLowerCase() === d.toLowerCase()).props?.children, [i, P] = y(0), [ie, le] = y(null), [l, V] = y(s), [u, se] = y(!1), [r, k] = y(""), v = C(), M = C(!1), x = C(), K = C(), ce = C(), N = C(!0), a = Ve(X), pe = `${a}-label`;
|
|
49
|
+
if (!E && !re["aria-label"])
|
|
50
|
+
throw new Error('The Combobox component needs a "label" or an "aria-label" props');
|
|
51
|
+
_(() => {
|
|
52
|
+
V(q(s, r));
|
|
53
|
+
}, [r, s]), _(() => {
|
|
54
|
+
u && v.current && De(v.current);
|
|
55
|
+
}, [i, u]), xe(() => {
|
|
56
|
+
N.current && (N.current = !1);
|
|
57
|
+
}, [d]);
|
|
58
|
+
const de = u ? `${a}-${i}` : "", H = () => {
|
|
59
|
+
F(null), k("");
|
|
60
|
+
}, fe = (t) => {
|
|
61
|
+
T && T(t);
|
|
62
|
+
const n = x.current.value;
|
|
63
|
+
V(q(s, n)), P(0), le(null), r !== n && k(n), u || f(!0, !1);
|
|
64
|
+
}, ue = (t) => {
|
|
65
|
+
const { key: n } = t, p = h && r ? l.length : l.length - 1, g = Re(n, u);
|
|
66
|
+
switch (d && !r && n === Pe.BACKSPACE && H(), g) {
|
|
67
|
+
case b.Next: {
|
|
68
|
+
if (i === p) {
|
|
69
|
+
m(0);
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
m(R(i, p, g));
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
case b.Previous: {
|
|
76
|
+
if (i === 0) {
|
|
77
|
+
m(p);
|
|
78
|
+
break;
|
|
79
|
+
}
|
|
80
|
+
m(R(i, p, g));
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
case b.Last:
|
|
84
|
+
case b.First: {
|
|
85
|
+
if (i === p) {
|
|
86
|
+
m(0);
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
89
|
+
m(R(i, p, g));
|
|
90
|
+
break;
|
|
91
|
+
}
|
|
92
|
+
case b.CloseSelect:
|
|
93
|
+
t.preventDefault(), L(i);
|
|
94
|
+
break;
|
|
95
|
+
case b.Close:
|
|
96
|
+
t.preventDefault(), f(!1);
|
|
97
|
+
break;
|
|
98
|
+
case b.Open:
|
|
99
|
+
f(!0);
|
|
100
|
+
break;
|
|
101
|
+
}
|
|
102
|
+
}, me = (t) => {
|
|
103
|
+
if (t.preventDefault(), d && !M.current && k(""), M.current) {
|
|
104
|
+
M.current = !1;
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
f(!1, !1);
|
|
108
|
+
}, m = (t) => {
|
|
109
|
+
P(t);
|
|
110
|
+
}, be = (t) => {
|
|
111
|
+
m(t), L(t);
|
|
112
|
+
}, U = () => {
|
|
113
|
+
M.current = !0;
|
|
114
|
+
}, L = (t) => {
|
|
115
|
+
const n = l[t];
|
|
116
|
+
if (k(""), n) {
|
|
117
|
+
F(n.props.value), f(!1);
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
h && (te(r), f(!1));
|
|
121
|
+
}, f = (t, n = !0) => {
|
|
122
|
+
se(t), n && x.current.focus();
|
|
123
|
+
}, ge = j.toArray(l).map((t, n) => {
|
|
124
|
+
const p = i === n;
|
|
125
|
+
return ye(t, {
|
|
126
|
+
id: `${a}-${n}`,
|
|
127
|
+
"aria-selected": ie === n,
|
|
128
|
+
"aria-posinset": n + 1,
|
|
129
|
+
"aria-setsize": j.toArray(l).length,
|
|
130
|
+
ref(g) {
|
|
131
|
+
p && (v.current = g);
|
|
132
|
+
},
|
|
133
|
+
onClick: () => be(n),
|
|
134
|
+
onMouseDown: U,
|
|
135
|
+
isSelected: p
|
|
136
|
+
});
|
|
137
|
+
}), Ce = () => {
|
|
138
|
+
x.current.focus(), S && S(), H();
|
|
139
|
+
}, he = () => {
|
|
140
|
+
x.current.focus(), f(!0);
|
|
141
|
+
}, Ee = () => {
|
|
142
|
+
const t = l.findIndex((n) => n.props?.children === r);
|
|
143
|
+
return r && t === -1;
|
|
144
|
+
}, ve = (t) => {
|
|
145
|
+
t.preventDefault(), f(t, !0);
|
|
146
|
+
};
|
|
147
|
+
let D;
|
|
148
|
+
return O ? D = `${a}-error` : $ && (D = `${a}-hint`), /* @__PURE__ */ o.createElement(Fe, { hint: $, error: O, id: a, required: A }, /* @__PURE__ */ o.createElement(_e, { "aria-live": "polite", "aria-atomic": "false", "aria-relevant": "additions text" }, d), /* @__PURE__ */ o.createElement(B, { direction: "column", alignItems: "stretch", gap: E || $ || O ? 1 : 0 }, E && /* @__PURE__ */ o.createElement(Se, { action: Y }, E), /* @__PURE__ */ o.createElement(Me, { ref: K, $disabled: c, hasError: O }, /* @__PURE__ */ o.createElement($e, { wrap: "wrap" }, !r && d && /* @__PURE__ */ o.createElement(we, { id: `${a}-selected-value` }, /* @__PURE__ */ o.createElement(z, null, ae())), /* @__PURE__ */ o.createElement(
|
|
149
|
+
Le,
|
|
150
|
+
{
|
|
151
|
+
"aria-activedescendant": de,
|
|
152
|
+
"aria-autocomplete": "list",
|
|
153
|
+
"aria-controls": `${a}-listbox`,
|
|
154
|
+
"aria-disabled": c,
|
|
155
|
+
"aria-expanded": u,
|
|
156
|
+
"aria-haspopup": "listbox",
|
|
157
|
+
"aria-describedby": D,
|
|
158
|
+
autoComplete: "off",
|
|
159
|
+
autoCorrect: "off",
|
|
160
|
+
id: a,
|
|
161
|
+
onBlur: c ? void 0 : me,
|
|
162
|
+
onClick: c ? void 0 : ve,
|
|
163
|
+
onInput: c ? void 0 : fe,
|
|
164
|
+
onKeyDown: c ? void 0 : ue,
|
|
165
|
+
placeholder: d ? "" : ne,
|
|
166
|
+
readOnly: c,
|
|
167
|
+
ref: x,
|
|
168
|
+
required: A,
|
|
169
|
+
role: "combobox",
|
|
170
|
+
spellCheck: "off",
|
|
171
|
+
type: "text",
|
|
172
|
+
value: r
|
|
173
|
+
}
|
|
174
|
+
)), /* @__PURE__ */ o.createElement(B, null, (d || r) && /* @__PURE__ */ o.createElement(
|
|
175
|
+
He,
|
|
176
|
+
{
|
|
177
|
+
id: `${a}-clear`,
|
|
178
|
+
"aria-label": G,
|
|
179
|
+
disabled: c,
|
|
180
|
+
paddingLeft: 3,
|
|
181
|
+
as: "button",
|
|
182
|
+
onClick: Ce,
|
|
183
|
+
type: "button"
|
|
184
|
+
},
|
|
185
|
+
/* @__PURE__ */ o.createElement(Ie, null)
|
|
186
|
+
), /* @__PURE__ */ o.createElement(
|
|
187
|
+
Ue,
|
|
188
|
+
{
|
|
189
|
+
disabled: c,
|
|
190
|
+
paddingLeft: 3,
|
|
191
|
+
"aria-hidden": !0,
|
|
192
|
+
as: "button",
|
|
193
|
+
onClick: he,
|
|
194
|
+
tabIndex: -1,
|
|
195
|
+
type: "button"
|
|
196
|
+
},
|
|
197
|
+
/* @__PURE__ */ o.createElement(Oe, null)
|
|
198
|
+
))), /* @__PURE__ */ o.createElement(Te, null), /* @__PURE__ */ o.createElement(Ae, null)), u && /* @__PURE__ */ o.createElement(
|
|
199
|
+
Ne,
|
|
200
|
+
{
|
|
201
|
+
id: `${a}-popover`,
|
|
202
|
+
source: K,
|
|
203
|
+
spacing: 4,
|
|
204
|
+
fullWidth: !0,
|
|
205
|
+
intersectionId: `${a}-listbox-popover-intersection`,
|
|
206
|
+
onReachEnd: Q && !w ? oe : void 0
|
|
207
|
+
},
|
|
208
|
+
/* @__PURE__ */ o.createElement(
|
|
209
|
+
"div",
|
|
210
|
+
{
|
|
211
|
+
role: "listbox",
|
|
212
|
+
ref: ce,
|
|
213
|
+
id: `${a}-listbox`,
|
|
214
|
+
"aria-labelledby": E ? pe : void 0
|
|
215
|
+
},
|
|
216
|
+
(Boolean(l.length) || h) && /* @__PURE__ */ o.createElement(o.Fragment, null, ge, Ee() && h && /* @__PURE__ */ o.createElement(
|
|
217
|
+
ke,
|
|
218
|
+
{
|
|
219
|
+
isSelected: i === l.length,
|
|
220
|
+
ref: (t) => {
|
|
221
|
+
i === l.length && (v.current = t);
|
|
222
|
+
},
|
|
223
|
+
onMouseDown: U,
|
|
224
|
+
onClick: () => L(),
|
|
225
|
+
taindex: 0
|
|
226
|
+
},
|
|
227
|
+
J(r)
|
|
228
|
+
)),
|
|
229
|
+
!l.length && !h && !w && /* @__PURE__ */ o.createElement(Be, { paddingLeft: 4, paddingRight: 4, paddingTop: 2, paddingBottom: 2, ref: v }, /* @__PURE__ */ o.createElement(z, { textColor: "neutral800" }, ee(r))),
|
|
230
|
+
w && /* @__PURE__ */ o.createElement(B, { justifyContent: "center", alignItems: "center", paddingTop: 2, paddingBottom: 2 }, /* @__PURE__ */ o.createElement(Ke, { small: !0 }, Z))
|
|
231
|
+
)
|
|
232
|
+
));
|
|
233
|
+
}, W = (s) => /* @__PURE__ */ o.createElement(I, { ...s, creatable: !0 });
|
|
234
|
+
I.defaultProps = {
|
|
235
|
+
"aria-label": void 0,
|
|
236
|
+
clearLabel: "clear",
|
|
237
|
+
creatable: !1,
|
|
238
|
+
createMessage: (s) => `Create "${s}"`,
|
|
239
|
+
disabled: !1,
|
|
240
|
+
error: void 0,
|
|
241
|
+
hasMoreItems: !1,
|
|
242
|
+
hint: void 0,
|
|
243
|
+
id: void 0,
|
|
244
|
+
label: void 0,
|
|
245
|
+
loading: !1,
|
|
246
|
+
loadingMessage: "Loading content...",
|
|
247
|
+
noOptionsMessage: () => "No results found",
|
|
248
|
+
onClear: void 0,
|
|
249
|
+
onCreateOption: void 0,
|
|
250
|
+
onInputChange: void 0,
|
|
251
|
+
onLoadMore: void 0,
|
|
252
|
+
placeholder: "Select or enter a value",
|
|
253
|
+
value: void 0
|
|
254
|
+
};
|
|
255
|
+
W.defaultProps = I.defaultProps;
|
|
256
|
+
I.propTypes = {
|
|
257
|
+
"aria-label": e.string,
|
|
258
|
+
children: e.oneOfType([e.arrayOf(e.node), e.node]),
|
|
259
|
+
clearLabel: e.string,
|
|
260
|
+
creatable: e.bool,
|
|
261
|
+
createMessage: e.func,
|
|
262
|
+
disabled: e.bool,
|
|
263
|
+
error: e.string,
|
|
264
|
+
hasMoreItems: e.bool,
|
|
265
|
+
id: e.string,
|
|
266
|
+
hint: e.oneOfType([e.string, e.node, e.arrayOf(e.node)]),
|
|
267
|
+
label: e.string,
|
|
268
|
+
labelAction: e.element,
|
|
269
|
+
loading: e.bool,
|
|
270
|
+
loadingMessage: e.string,
|
|
271
|
+
noOptionsMessage: e.func,
|
|
272
|
+
onChange: e.func.isRequired,
|
|
273
|
+
onClear: e.func,
|
|
274
|
+
onCreateOption: e.func,
|
|
275
|
+
onInputChange: e.func,
|
|
276
|
+
onLoadMore: e.func,
|
|
277
|
+
placeholder: e.string,
|
|
278
|
+
value: e.string
|
|
279
|
+
};
|
|
280
|
+
W.propTypes = {
|
|
281
|
+
...I.propTypes,
|
|
282
|
+
onCreateOption: e.func.isRequired
|
|
283
|
+
};
|
|
284
|
+
export {
|
|
285
|
+
I as Combobox,
|
|
286
|
+
W as CreatableCombobox
|
|
287
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("prop-types"),r=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},s=r(t),o=({options:e})=>e;o.propTypes={options:s.default.array.isRequired};exports.ComboboxList=o;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react"),d=require("prop-types"),i=require("./components.cjs"),s=require("../Typography/Typography.cjs"),n=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},r=n(a),o=n(d),t=a.forwardRef(({isSelected:e,children:p,...u},l)=>r.default.createElement(i.OptionBox,{hasRadius:!0,paddingLeft:4,paddingRight:4,paddingTop:2,paddingBottom:2,role:"option",background:"neutral0",isSelected:e,ref:l,...u},r.default.createElement(s.Typography,{textColor:e?"primary600":"neutral800",fontWeight:e?"bold":null},p)));t.defaultProps={isSelected:!1};t.propTypes={children:o.default.oneOfType([o.default.string,o.default.number]).isRequired,isSelected:o.default.bool};t.displayName="ComboboxOption";exports.ComboboxOption=t;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import t, { forwardRef as a } from "react";
|
|
2
|
+
import o from "prop-types";
|
|
3
|
+
import { OptionBox as d } from "./components.js";
|
|
4
|
+
import { Typography as m } from "../Typography/Typography.js";
|
|
5
|
+
const r = a(({ isSelected: e, children: p, ...i }, n) => /* @__PURE__ */ t.createElement(
|
|
6
|
+
d,
|
|
7
|
+
{
|
|
8
|
+
hasRadius: !0,
|
|
9
|
+
paddingLeft: 4,
|
|
10
|
+
paddingRight: 4,
|
|
11
|
+
paddingTop: 2,
|
|
12
|
+
paddingBottom: 2,
|
|
13
|
+
role: "option",
|
|
14
|
+
background: "neutral0",
|
|
15
|
+
isSelected: e,
|
|
16
|
+
ref: n,
|
|
17
|
+
...i
|
|
18
|
+
},
|
|
19
|
+
/* @__PURE__ */ t.createElement(m, { textColor: e ? "primary600" : "neutral800", fontWeight: e ? "bold" : null }, p)
|
|
20
|
+
));
|
|
21
|
+
r.defaultProps = {
|
|
22
|
+
isSelected: !1
|
|
23
|
+
};
|
|
24
|
+
r.propTypes = {
|
|
25
|
+
children: o.oneOfType([o.string, o.number]).isRequired,
|
|
26
|
+
isSelected: o.bool
|
|
27
|
+
};
|
|
28
|
+
r.displayName = "ComboboxOption";
|
|
29
|
+
export {
|
|
30
|
+
r as ComboboxOption
|
|
31
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("styled-components"),i=require("../Box/Box.cjs"),n=require("../Flex/Flex.cjs"),l=require("../themes/utils.cjs"),a=o=>o&&typeof o=="object"&&"default"in o?o:{default:o},t=a(r),s=t.default(n.Flex)`
|
|
2
|
+
position: relative;
|
|
3
|
+
border: 1px solid ${({theme:o,hasError:e})=>e?o.colors.danger600:o.colors.neutral200};
|
|
4
|
+
padding-right: ${({theme:o})=>o.spaces[3]};
|
|
5
|
+
padding-left: ${({theme:o})=>o.spaces[3]};
|
|
6
|
+
border-radius: ${({theme:o})=>o.borderRadius};
|
|
7
|
+
background: ${({theme:o})=>o.colors.neutral0};
|
|
8
|
+
|
|
9
|
+
${({theme:o,$disabled:e})=>e?`
|
|
10
|
+
color: ${o.colors.neutral600};
|
|
11
|
+
background: ${o.colors.neutral150};
|
|
12
|
+
`:void 0}
|
|
13
|
+
|
|
14
|
+
${l.inputFocusStyle()}
|
|
15
|
+
`,u=t.default.div`
|
|
16
|
+
padding: 1px 2px;
|
|
17
|
+
grid-area: 1 / 1 / 2 / 3;
|
|
18
|
+
`,d=t.default(n.Flex)`
|
|
19
|
+
display: grid;
|
|
20
|
+
flex: 1 1 0%;
|
|
21
|
+
position: relative;
|
|
22
|
+
`,c=t.default.input`
|
|
23
|
+
display: inline-grid;
|
|
24
|
+
grid-area: 1 / 1 / 2 / 3;
|
|
25
|
+
grid-template-columns: 0px min-content;
|
|
26
|
+
background: transparent;
|
|
27
|
+
min-height: ${40/16}rem;
|
|
28
|
+
border: none;
|
|
29
|
+
flex: 1;
|
|
30
|
+
font-size: ${14/16}rem;
|
|
31
|
+
color: ${({theme:o})=>o.colors.neutral800};
|
|
32
|
+
outline: none;
|
|
33
|
+
&:focus-visible {
|
|
34
|
+
outline: none;
|
|
35
|
+
box-shadow: none;
|
|
36
|
+
outline-offset: 0;
|
|
37
|
+
}
|
|
38
|
+
&[aria-disabled='true'] {
|
|
39
|
+
background: inherit;
|
|
40
|
+
color: inherit;
|
|
41
|
+
cursor: not-allowed;
|
|
42
|
+
}
|
|
43
|
+
`,p=t.default(i.Box)`
|
|
44
|
+
width: 100%;
|
|
45
|
+
border: none;
|
|
46
|
+
text-align: left;
|
|
47
|
+
outline-offset: -3px;
|
|
48
|
+
${({isSelected:o,theme:e})=>o&&`background: ${e.colors.primary100};`}
|
|
49
|
+
|
|
50
|
+
&:hover {
|
|
51
|
+
background: ${({theme:o})=>o.colors.primary100};
|
|
52
|
+
}
|
|
53
|
+
`;exports.Input=c;exports.InputContainer=d;exports.MainRow=s;exports.OptionBox=p;exports.ValueContainer=u;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import n from "styled-components";
|
|
2
|
+
import { Box as i } from "../Box/Box.js";
|
|
3
|
+
import { Flex as e } from "../Flex/Flex.js";
|
|
4
|
+
import { inputFocusStyle as t } from "../themes/utils.js";
|
|
5
|
+
const c = n(e)`
|
|
6
|
+
position: relative;
|
|
7
|
+
border: 1px solid ${({ theme: o, hasError: r }) => r ? o.colors.danger600 : o.colors.neutral200};
|
|
8
|
+
padding-right: ${({ theme: o }) => o.spaces[3]};
|
|
9
|
+
padding-left: ${({ theme: o }) => o.spaces[3]};
|
|
10
|
+
border-radius: ${({ theme: o }) => o.borderRadius};
|
|
11
|
+
background: ${({ theme: o }) => o.colors.neutral0};
|
|
12
|
+
|
|
13
|
+
${({ theme: o, $disabled: r }) => r ? `
|
|
14
|
+
color: ${o.colors.neutral600};
|
|
15
|
+
background: ${o.colors.neutral150};
|
|
16
|
+
` : void 0}
|
|
17
|
+
|
|
18
|
+
${t()}
|
|
19
|
+
`, p = n.div`
|
|
20
|
+
padding: 1px 2px;
|
|
21
|
+
grid-area: 1 / 1 / 2 / 3;
|
|
22
|
+
`, u = n(e)`
|
|
23
|
+
display: grid;
|
|
24
|
+
flex: 1 1 0%;
|
|
25
|
+
position: relative;
|
|
26
|
+
`, g = n.input`
|
|
27
|
+
display: inline-grid;
|
|
28
|
+
grid-area: 1 / 1 / 2 / 3;
|
|
29
|
+
grid-template-columns: 0px min-content;
|
|
30
|
+
background: transparent;
|
|
31
|
+
min-height: ${40 / 16}rem;
|
|
32
|
+
border: none;
|
|
33
|
+
flex: 1;
|
|
34
|
+
font-size: ${14 / 16}rem;
|
|
35
|
+
color: ${({ theme: o }) => o.colors.neutral800};
|
|
36
|
+
outline: none;
|
|
37
|
+
&:focus-visible {
|
|
38
|
+
outline: none;
|
|
39
|
+
box-shadow: none;
|
|
40
|
+
outline-offset: 0;
|
|
41
|
+
}
|
|
42
|
+
&[aria-disabled='true'] {
|
|
43
|
+
background: inherit;
|
|
44
|
+
color: inherit;
|
|
45
|
+
cursor: not-allowed;
|
|
46
|
+
}
|
|
47
|
+
`, $ = n(i)`
|
|
48
|
+
width: 100%;
|
|
49
|
+
border: none;
|
|
50
|
+
text-align: left;
|
|
51
|
+
outline-offset: -3px;
|
|
52
|
+
${({ isSelected: o, theme: r }) => o && `background: ${r.colors.primary100};`}
|
|
53
|
+
|
|
54
|
+
&:hover {
|
|
55
|
+
background: ${({ theme: o }) => o.colors.primary100};
|
|
56
|
+
}
|
|
57
|
+
`;
|
|
58
|
+
export {
|
|
59
|
+
g as Input,
|
|
60
|
+
u as InputContainer,
|
|
61
|
+
c as MainRow,
|
|
62
|
+
$ as OptionBox,
|
|
63
|
+
p as ValueContainer
|
|
64
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[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 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("compute-scroll-into-view"),r=require("../helpers/keyboardKeys.cjs"),a=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},c=a(l),t={Close:"Close",CloseSelect:"CloseSelect",First:"First",Last:"Last",Next:"Next",Open:"Open",PageDown:"PageDown",PageUp:"PageUp",Previous:"Previous",Select:"Select",Space:"Space",Type:"Type"},u={Close:"Close",First:"First",Last:"Last",Next:"Next",Open:"Open",Previous:"Previous",Select:"Select",UpLevel:"UpLevel"};function d(e=[],o=null,s=[]){const n=String(o??"").toLowerCase();return n?e.filter(i=>i.props.children.toString().toLowerCase().includes(n)&&s.indexOf(i)<0):e}function p(e,o){if(!o&&e===r.KeyboardKeys.DOWN)return t.Open;if(e===r.KeyboardKeys.DOWN)return t.Next;if(e===r.KeyboardKeys.UP)return t.Previous;if(e===r.KeyboardKeys.HOME)return t.First;if(e===r.KeyboardKeys.END)return t.Last;if(e===r.KeyboardKeys.ESCAPE)return t.Close;if(e===r.KeyboardKeys.ENTER)return t.CloseSelect;if(e===r.KeyboardKeys.BACKSPACE||e===r.KeyboardKeys.CLEAR||e.length===1)return t.Type}function f(e,o,s){switch(s){case t.First:return 0;case t.Last:return o;case t.Previous:return Math.max(0,e-1);case t.Next:return Math.min(o,e+1);default:return e}}function y(e){c.default(e,{scrollMode:"if-needed",block:"nearest",inline:"nearest"}).forEach(({el:s,top:n,left:i})=>{s.scrollTop=n,s.scrollLeft=i})}exports.MenuActions=t;exports.TreeActions=u;exports.filterOptions=d;exports.getActionFromKey=p;exports.getUpdatedIndex=f;exports.maintainScrollVisibility=y;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import l from "compute-scroll-into-view";
|
|
2
|
+
import { KeyboardKeys as r } from "../helpers/keyboardKeys.js";
|
|
3
|
+
const t = {
|
|
4
|
+
Close: "Close",
|
|
5
|
+
CloseSelect: "CloseSelect",
|
|
6
|
+
First: "First",
|
|
7
|
+
Last: "Last",
|
|
8
|
+
Next: "Next",
|
|
9
|
+
Open: "Open",
|
|
10
|
+
PageDown: "PageDown",
|
|
11
|
+
PageUp: "PageUp",
|
|
12
|
+
Previous: "Previous",
|
|
13
|
+
Select: "Select",
|
|
14
|
+
Space: "Space",
|
|
15
|
+
Type: "Type"
|
|
16
|
+
}, f = {
|
|
17
|
+
Close: "Close",
|
|
18
|
+
First: "First",
|
|
19
|
+
Last: "Last",
|
|
20
|
+
Next: "Next",
|
|
21
|
+
Open: "Open",
|
|
22
|
+
Previous: "Previous",
|
|
23
|
+
Select: "Select",
|
|
24
|
+
UpLevel: "UpLevel"
|
|
25
|
+
};
|
|
26
|
+
function d(e = [], n = null, i = []) {
|
|
27
|
+
const o = String(n ?? "").toLowerCase();
|
|
28
|
+
return o ? e.filter((s) => s.props.children.toString().toLowerCase().includes(o) && i.indexOf(s) < 0) : e;
|
|
29
|
+
}
|
|
30
|
+
function C(e, n) {
|
|
31
|
+
if (!n && e === r.DOWN)
|
|
32
|
+
return t.Open;
|
|
33
|
+
if (e === r.DOWN)
|
|
34
|
+
return t.Next;
|
|
35
|
+
if (e === r.UP)
|
|
36
|
+
return t.Previous;
|
|
37
|
+
if (e === r.HOME)
|
|
38
|
+
return t.First;
|
|
39
|
+
if (e === r.END)
|
|
40
|
+
return t.Last;
|
|
41
|
+
if (e === r.ESCAPE)
|
|
42
|
+
return t.Close;
|
|
43
|
+
if (e === r.ENTER)
|
|
44
|
+
return t.CloseSelect;
|
|
45
|
+
if (e === r.BACKSPACE || e === r.CLEAR || e.length === 1)
|
|
46
|
+
return t.Type;
|
|
47
|
+
}
|
|
48
|
+
function S(e, n, i) {
|
|
49
|
+
switch (i) {
|
|
50
|
+
case t.First:
|
|
51
|
+
return 0;
|
|
52
|
+
case t.Last:
|
|
53
|
+
return n;
|
|
54
|
+
case t.Previous:
|
|
55
|
+
return Math.max(0, e - 1);
|
|
56
|
+
case t.Next:
|
|
57
|
+
return Math.min(n, e + 1);
|
|
58
|
+
default:
|
|
59
|
+
return e;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
function P(e) {
|
|
63
|
+
l(e, {
|
|
64
|
+
scrollMode: "if-needed",
|
|
65
|
+
block: "nearest",
|
|
66
|
+
inline: "nearest"
|
|
67
|
+
}).forEach(({ el: i, top: o, left: s }) => {
|
|
68
|
+
i.scrollTop = o, i.scrollLeft = s;
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
export {
|
|
72
|
+
t as MenuActions,
|
|
73
|
+
f as TreeActions,
|
|
74
|
+
d as filterOptions,
|
|
75
|
+
C as getActionFromKey,
|
|
76
|
+
S as getUpdatedIndex,
|
|
77
|
+
P as maintainScrollVisibility
|
|
78
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),p=require("react"),f=require("@strapi/icons"),b=require("styled-components"),k=require("./components.cjs"),P=require("./DatePickerCalendar.cjs"),R=require("./utils/formatDate.cjs");require("../Field/Field.cjs");require("../Field/FieldLabel.cjs");require("../Field/FieldInput.cjs");require("../Field/FieldContext.cjs");require("../Typography/Typography.cjs");const T=require("../Field/FieldAction.cjs"),v=require("../helpers/getDefaultLocale.cjs"),A=require("../TextInput/TextInput.cjs"),I=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},L=I(b),S=({ariaLabel:e,onClear:i,clearLabel:j="Clear",initialDate:D,locale:h,maxDate:m,minDate:q,onChange:l,selectedDate:a,disabled:n=!1,...x})=>{const[o,c]=p.useState(!1),r=p.useRef(null),u=h||v.getDefaultLocale(),d=a?R.formatDate(a,u):"",g=()=>{n||c(s=>!s)},y=()=>{n||i&&(i(),r.current.inputWrapperRef.current.focus())},F=s=>{l&&l(s),c(!1)},C=()=>{c(!1)};return t.jsxs(k.DatePickerWrapper,{bold:o,children:[t.jsx(A.TextInput,{ref:r,onClick:g,onChange:()=>{},value:d,startAction:t.jsx(f.Calendar,{"aria-hidden":!0}),endAction:i&&d?t.jsx(T.FieldAction,{label:j,onClick:y,"aria-disabled":n||void 0,children:t.jsx(_,{})}):void 0,"aria-autocomplete":"none","aria-label":e,disabled:n,type:"text",...x}),r.current&&r.current.inputWrapperRef&&o&&t.jsx(P.DatePickerCalendar,{selectedDate:a,initialDate:D,onChange:F,onEscape:C,locale:u,popoverSource:r.current.inputWrapperRef,minDate:q,maxDate:m})]})},_=L.default(f.Cross)`
|
|
2
|
+
height: ${11/16}rem;
|
|
3
|
+
width: ${11/16}rem;
|
|
4
|
+
|
|
5
|
+
path {
|
|
6
|
+
fill: ${({theme:e})=>e.colors.neutral600};
|
|
7
|
+
}
|
|
8
|
+
`;exports.DatePicker=S;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { jsxs as R, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useState as y, useRef as W } from "react";
|
|
3
|
+
import { Cross as v, Calendar as A } from "@strapi/icons";
|
|
4
|
+
import P from "styled-components";
|
|
5
|
+
import { DatePickerWrapper as S } from "./components.js";
|
|
6
|
+
import { DatePickerCalendar as $ } from "./DatePickerCalendar.js";
|
|
7
|
+
import { formatDate as j } from "./utils/formatDate.js";
|
|
8
|
+
import "../Field/Field.js";
|
|
9
|
+
import "../Field/FieldLabel.js";
|
|
10
|
+
import "../Field/FieldInput.js";
|
|
11
|
+
import "../Field/FieldContext.js";
|
|
12
|
+
import "../Typography/Typography.js";
|
|
13
|
+
import { FieldAction as E } from "../Field/FieldAction.js";
|
|
14
|
+
import { getDefaultLocale as V } from "../helpers/getDefaultLocale.js";
|
|
15
|
+
import { TextInput as w } from "../TextInput/TextInput.js";
|
|
16
|
+
const X = ({
|
|
17
|
+
ariaLabel: o,
|
|
18
|
+
onClear: i,
|
|
19
|
+
clearLabel: s = "Clear",
|
|
20
|
+
initialDate: u,
|
|
21
|
+
locale: d,
|
|
22
|
+
maxDate: h,
|
|
23
|
+
minDate: C,
|
|
24
|
+
onChange: p,
|
|
25
|
+
selectedDate: a,
|
|
26
|
+
disabled: t = !1,
|
|
27
|
+
...D
|
|
28
|
+
}) => {
|
|
29
|
+
const [c, n] = y(!1), e = W(null), m = d || V(), f = a ? j(a, m) : "", g = () => {
|
|
30
|
+
t || n((l) => !l);
|
|
31
|
+
}, x = () => {
|
|
32
|
+
t || i && (i(), e.current.inputWrapperRef.current.focus());
|
|
33
|
+
}, b = (l) => {
|
|
34
|
+
p && p(l), n(!1);
|
|
35
|
+
}, k = () => {
|
|
36
|
+
n(!1);
|
|
37
|
+
};
|
|
38
|
+
return R(S, {
|
|
39
|
+
bold: c,
|
|
40
|
+
children: [r(w, {
|
|
41
|
+
ref: e,
|
|
42
|
+
onClick: g,
|
|
43
|
+
onChange: () => {
|
|
44
|
+
},
|
|
45
|
+
value: f,
|
|
46
|
+
startAction: r(A, {
|
|
47
|
+
"aria-hidden": !0
|
|
48
|
+
}),
|
|
49
|
+
endAction: i && f ? r(E, {
|
|
50
|
+
label: s,
|
|
51
|
+
onClick: x,
|
|
52
|
+
"aria-disabled": t || void 0,
|
|
53
|
+
children: r(F, {})
|
|
54
|
+
}) : void 0,
|
|
55
|
+
"aria-autocomplete": "none",
|
|
56
|
+
"aria-label": o,
|
|
57
|
+
disabled: t,
|
|
58
|
+
type: "text",
|
|
59
|
+
...D
|
|
60
|
+
}), e.current && e.current.inputWrapperRef && c && r($, {
|
|
61
|
+
selectedDate: a,
|
|
62
|
+
initialDate: u,
|
|
63
|
+
onChange: b,
|
|
64
|
+
onEscape: k,
|
|
65
|
+
locale: m,
|
|
66
|
+
popoverSource: e.current.inputWrapperRef,
|
|
67
|
+
minDate: C,
|
|
68
|
+
maxDate: h
|
|
69
|
+
})]
|
|
70
|
+
});
|
|
71
|
+
}, F = P(v)`
|
|
72
|
+
height: ${11 / 16}rem;
|
|
73
|
+
width: ${11 / 16}rem;
|
|
74
|
+
|
|
75
|
+
path {
|
|
76
|
+
fill: ${({
|
|
77
|
+
theme: o
|
|
78
|
+
}) => o.colors.neutral600};
|
|
79
|
+
}
|
|
80
|
+
`;
|
|
81
|
+
export {
|
|
82
|
+
X as DatePicker
|
|
83
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),T=require("react"),L=require("./components.cjs"),O=require("./DatePickerTd.cjs"),a=require("./DatePickerTh.cjs"),H=require("./utils/getDayOfWeek.cjs"),V=require("./utils/getMonths.cjs"),$=require("./utils/generateWeeks.cjs"),E=require("./utils/getYears.cjs"),I=require("./utils/formatDate.cjs"),h=require("../Box/Box.cjs"),_=require("../Flex/Flex.cjs"),z=require("../FocusTrap/FocusTrap.cjs"),A=require("../helpers/getDefaultLocale.cjs"),G=require("../RawTable/RawTable.cjs");require("../RawTable/RawTableContext.cjs");const J=require("../RawTable/RawThead.cjs"),K=require("../RawTable/RawTbody.cjs"),g=require("../RawTable/RawTr.cjs"),i=require("../SimpleMenu/SimpleMenu.cjs"),N=require("../VisuallyHidden/VisuallyHidden.cjs"),Q=({onEscape:s,popoverSource:l,...o})=>e.jsx(L.DatePickerPopover,{source:l,role:"dialog","aria-modal":"true",spacing:4,children:e.jsx(z.FocusTrap,{onEscape:s,children:e.jsx(D,{...o})})}),D=({selectedDate:s,initialDate:l=new Date,locale:o,onChange:j,minDate:p,maxDate:w})=>{const[c,d]=T.useState(l),[x,k,R]=$.generateWeeks(c,s),{sun:m,mon:q,tue:P,wed:f,thu:M,fri:b,sat:C}=H.getDayOfWeek(),u=V.getMonths(),y=E.getYears(p,w),F=o||A.getDefaultLocale();T.useEffect(()=>{s&&d(s)},[s]);const S=t=>{const r=new Date(c);r.setMonth(u.indexOf(t)),d(r)},B=t=>{const r=new Date(c);r.setFullYear(t),d(r)},Y=t=>()=>{j&&j(t)};return e.jsxs(h.Box,{padding:4,children:[e.jsx(h.Box,{paddingBottom:4,paddingLeft:2,paddingRight:2,children:e.jsxs(_.Flex,{children:[e.jsx(i.SimpleMenu,{label:u[c.getMonth()],children:u.map(t=>e.jsx(i.MenuItem,{onClick:()=>S(t),children:t},t))}),e.jsx(h.Box,{paddingLeft:2,children:e.jsx(i.SimpleMenu,{label:c.getFullYear(),children:y.map(t=>e.jsx(i.MenuItem,{onClick:()=>B(t),children:t},t))})})]})}),e.jsxs(G.RawTable,{colCount:7,rowCount:x.length+1,initialCol:R,initialRow:k,role:"grid",children:[e.jsx(J.RawThead,{children:e.jsxs(g.RawTr,{"aria-rowindex":1,children:[e.jsx(a.DatePickerTh,{children:m}),e.jsx(a.DatePickerTh,{children:q}),e.jsx(a.DatePickerTh,{children:P}),e.jsx(a.DatePickerTh,{children:f}),e.jsx(a.DatePickerTh,{children:M}),e.jsx(a.DatePickerTh,{children:b}),e.jsx(a.DatePickerTh,{children:C})]})}),e.jsx(K.RawTbody,{children:x.map((t,r)=>e.jsx(g.RawTr,{children:t.map(({date:n,outsideMonth:W,isSelected:v})=>e.jsxs(O.DatePickerTd,{outsideMonth:W,onSelectDay:Y(n),isSelected:v,children:[e.jsx("span",{"aria-hidden":!0,children:n.getDate()}),e.jsx(N.VisuallyHidden,{children:e.jsx("span",{children:I.formatDate(n,F)})})]},`${n.getFullYear()}-${n.getMonth()+1}-${n.getDate()}`))},r))})]})]})};exports.DatePickerCalendar=Q;exports.DatePickerCalendarContent=D;
|