@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,209 @@
|
|
|
1
|
+
import r, { useState as ee, useRef as te, Children as k, cloneElement as A } from "react";
|
|
2
|
+
import { Cross as re, CarretDown as oe } from "@strapi/icons";
|
|
3
|
+
import e from "prop-types";
|
|
4
|
+
import ne from "styled-components";
|
|
5
|
+
import { SelectButtonWrapper as ie, IconBox as le, CaretBox as se } from "./components.js";
|
|
6
|
+
import { DownState as ae } from "./constants.js";
|
|
7
|
+
import { useButtonRef as pe } from "./hooks/useButtonRef.js";
|
|
8
|
+
import { SelectButton as ce } from "./SelectButton.js";
|
|
9
|
+
import { SelectList as de } from "./SelectList.js";
|
|
10
|
+
import { SelectTags as me } from "./SelectTags.js";
|
|
11
|
+
import { Box as P } from "../Box/Box.js";
|
|
12
|
+
import { Field as fe } from "../Field/Field.js";
|
|
13
|
+
import { FieldLabel as ue } from "../Field/FieldLabel.js";
|
|
14
|
+
import "../Field/FieldInput.js";
|
|
15
|
+
import { FieldHint as he } from "../Field/FieldHint.js";
|
|
16
|
+
import { FieldError as Ee } from "../Field/FieldError.js";
|
|
17
|
+
import "../Field/FieldContext.js";
|
|
18
|
+
import "../Field/FieldAction.js";
|
|
19
|
+
import { Flex as g } from "../Flex/Flex.js";
|
|
20
|
+
import { escapeSelector as _ } from "../helpers/escapeSelector.js";
|
|
21
|
+
import { useId as be } from "../hooks/useId.js";
|
|
22
|
+
import { Popover as ge } from "../Popover/Popover.js";
|
|
23
|
+
import { sizes as ye } from "../themes/sizes.js";
|
|
24
|
+
import { Typography as q } from "../Typography/Typography.js";
|
|
25
|
+
import { VisuallyHidden as z } from "../VisuallyHidden/VisuallyHidden.js";
|
|
26
|
+
const Be = ne(g)`
|
|
27
|
+
width: 100%;
|
|
28
|
+
`, G = ({
|
|
29
|
+
label: m,
|
|
30
|
+
labelAction: H,
|
|
31
|
+
id: W,
|
|
32
|
+
children: N,
|
|
33
|
+
customizeContent: f,
|
|
34
|
+
placeholder: y,
|
|
35
|
+
onChange: B,
|
|
36
|
+
value: o,
|
|
37
|
+
hint: I,
|
|
38
|
+
error: d,
|
|
39
|
+
disabled: s,
|
|
40
|
+
clearLabel: C,
|
|
41
|
+
onClear: S,
|
|
42
|
+
onReachEnd: J,
|
|
43
|
+
multi: i,
|
|
44
|
+
required: x,
|
|
45
|
+
selectButtonTitle: K,
|
|
46
|
+
size: Q,
|
|
47
|
+
startIcon: $,
|
|
48
|
+
withTags: u,
|
|
49
|
+
...U
|
|
50
|
+
}) => {
|
|
51
|
+
const n = be(W), [h, E] = ee(void 0), R = pe(h), w = te(null), D = `${n}-label`, b = `${n}-content`, X = typeof d == "string";
|
|
52
|
+
let O;
|
|
53
|
+
if (d ? O = `${n}-error` : I && (O = `${n}-hint`), u && !i)
|
|
54
|
+
throw new Error('The "withTags" props can only be used when the "multi" prop is present');
|
|
55
|
+
const Y = () => {
|
|
56
|
+
E(void 0);
|
|
57
|
+
}, Z = () => {
|
|
58
|
+
s || (S(), R.current.focus());
|
|
59
|
+
}, L = (t) => {
|
|
60
|
+
t.preventDefault(), !s && (t.nativeEvent.which === 3 || t.nativeEvent.button === 2 || E(ae.Mouse));
|
|
61
|
+
}, T = (t, l = !0) => {
|
|
62
|
+
i ? B(o.includes(t) ? o.filter((a) => a !== t) : [...o, t]) : (B(t), l && E(void 0));
|
|
63
|
+
}, F = (t) => {
|
|
64
|
+
B(
|
|
65
|
+
o.includes(t[0]) ? o.filter((l, a, c) => c.indexOf(l) < 0, t) : [...o, ...t]
|
|
66
|
+
);
|
|
67
|
+
};
|
|
68
|
+
let v, M = [];
|
|
69
|
+
const j = (t, l) => {
|
|
70
|
+
const a = `${n}-option-${t.props.value}`, c = i ? o.includes(t.props.value) : t.props.value === o;
|
|
71
|
+
return c && (u ? M.push({ label: t.props.children, value: t.props.value }) : v = t.props.children), A(t, {
|
|
72
|
+
id: _(a),
|
|
73
|
+
onClick: () => T(t.props.value),
|
|
74
|
+
selected: c,
|
|
75
|
+
multi: i,
|
|
76
|
+
isChild: l
|
|
77
|
+
});
|
|
78
|
+
}, V = k.toArray(N).map((t) => {
|
|
79
|
+
if (t.type.displayName === "OptGroup") {
|
|
80
|
+
const l = `${n}-option-${t.props.label}`, a = t.props.children.every((p) => o.includes(p.props.value)), c = !a && t.props.children.some((p) => o.includes(p.props.value));
|
|
81
|
+
return A(t, {
|
|
82
|
+
id: _(l),
|
|
83
|
+
onClick: () => F(t.props.children.map((p) => p.props.value)),
|
|
84
|
+
selected: a,
|
|
85
|
+
indeterminate: c,
|
|
86
|
+
multi: i,
|
|
87
|
+
children: k.toArray(t.props.children).map((p) => j(p, !0)),
|
|
88
|
+
value: t.props.label
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
return j(t);
|
|
92
|
+
});
|
|
93
|
+
return /* @__PURE__ */ r.createElement(fe, { hint: I, error: d, id: n, required: x }, /* @__PURE__ */ r.createElement(g, { direction: "column", alignItems: "stretch", gap: m || I || X ? 1 : 0 }, m && /* @__PURE__ */ r.createElement(ue, { action: H }, m), /* @__PURE__ */ r.createElement(ie, { size: Q, hasError: Boolean(d), disabled: s, ref: w }, /* @__PURE__ */ r.createElement(
|
|
94
|
+
ce,
|
|
95
|
+
{
|
|
96
|
+
ref: R,
|
|
97
|
+
labelledBy: `${n} ${D} ${b}`,
|
|
98
|
+
"aria-describedby": O,
|
|
99
|
+
"aria-required": x,
|
|
100
|
+
expanded: Boolean(h),
|
|
101
|
+
onTrigger: E,
|
|
102
|
+
id: n,
|
|
103
|
+
hasError: Boolean(d),
|
|
104
|
+
disabled: s,
|
|
105
|
+
onMouseDown: L,
|
|
106
|
+
value: i ? o.join(",") : o,
|
|
107
|
+
...U
|
|
108
|
+
}
|
|
109
|
+
), /* @__PURE__ */ r.createElement(Be, { justifyContent: "space-between" }, /* @__PURE__ */ r.createElement(g, null, $ && /* @__PURE__ */ r.createElement(P, { paddingLeft: 3, "aria-hidden": !0 }, $), u && /* @__PURE__ */ r.createElement(me, { tags: M, onRemoveTag: T, disabled: s }), /* @__PURE__ */ r.createElement(P, { paddingLeft: 4, paddingRight: 4 }, u ? /* @__PURE__ */ r.createElement(r.Fragment, null, !o || o.length === 0 ? /* @__PURE__ */ r.createElement(q, { ellipsis: !0, id: b, textColor: "neutral600" }, y) : null, /* @__PURE__ */ r.createElement(z, { as: "span", id: b }, f ? f(o) : v || y, o.join(", "))) : /* @__PURE__ */ r.createElement(q, { ellipsis: !0, id: b, textColor: o ? "neutral800" : "neutral600" }, f ? f(o) : v || y, i && /* @__PURE__ */ r.createElement(z, { as: "span" }, o.join(", "))))), /* @__PURE__ */ r.createElement(g, null, (i && o && o.length || !i && o) && S && /* @__PURE__ */ r.createElement(
|
|
110
|
+
le,
|
|
111
|
+
{
|
|
112
|
+
as: "button",
|
|
113
|
+
type: "button",
|
|
114
|
+
onClick: Z,
|
|
115
|
+
"aria-label": C,
|
|
116
|
+
"aria-disabled": s,
|
|
117
|
+
title: C
|
|
118
|
+
},
|
|
119
|
+
/* @__PURE__ */ r.createElement(re, null)
|
|
120
|
+
), /* @__PURE__ */ r.createElement(
|
|
121
|
+
se,
|
|
122
|
+
{
|
|
123
|
+
paddingLeft: 3,
|
|
124
|
+
"aria-hidden": !0,
|
|
125
|
+
as: "button",
|
|
126
|
+
type: "button",
|
|
127
|
+
onMouseDown: L,
|
|
128
|
+
tabIndex: -1,
|
|
129
|
+
disabled: s,
|
|
130
|
+
title: K
|
|
131
|
+
},
|
|
132
|
+
/* @__PURE__ */ r.createElement(oe, null)
|
|
133
|
+
)))), /* @__PURE__ */ r.createElement(he, null), /* @__PURE__ */ r.createElement(Ee, null)), h && /* @__PURE__ */ r.createElement(
|
|
134
|
+
ge,
|
|
135
|
+
{
|
|
136
|
+
source: w,
|
|
137
|
+
spacing: 4,
|
|
138
|
+
fullWidth: !0,
|
|
139
|
+
intersectionId: `select-list-intersection-${n}`,
|
|
140
|
+
onReachEnd: J
|
|
141
|
+
},
|
|
142
|
+
/* @__PURE__ */ r.createElement(
|
|
143
|
+
de,
|
|
144
|
+
{
|
|
145
|
+
selectId: n,
|
|
146
|
+
labelledBy: m ? D : void 0,
|
|
147
|
+
onEscape: Y,
|
|
148
|
+
expanded: h,
|
|
149
|
+
onSelectItem: (t, l) => l ? F(t) : T(t, !1),
|
|
150
|
+
multi: i
|
|
151
|
+
},
|
|
152
|
+
V
|
|
153
|
+
)
|
|
154
|
+
));
|
|
155
|
+
};
|
|
156
|
+
G.defaultProps = {
|
|
157
|
+
"aria-label": void 0,
|
|
158
|
+
children: [],
|
|
159
|
+
clearLabel: "Clear",
|
|
160
|
+
customizeContent: void 0,
|
|
161
|
+
disabled: !1,
|
|
162
|
+
id: void 0,
|
|
163
|
+
label: void 0,
|
|
164
|
+
labelAction: void 0,
|
|
165
|
+
multi: !1,
|
|
166
|
+
onChange() {
|
|
167
|
+
},
|
|
168
|
+
onClear: void 0,
|
|
169
|
+
onReachEnd: void 0,
|
|
170
|
+
value: void 0,
|
|
171
|
+
hint: void 0,
|
|
172
|
+
error: void 0,
|
|
173
|
+
placeholder: "Select...",
|
|
174
|
+
required: !1,
|
|
175
|
+
selectButtonTitle: "Carret Down Button",
|
|
176
|
+
size: "M",
|
|
177
|
+
startIcon: void 0,
|
|
178
|
+
withTags: !1
|
|
179
|
+
};
|
|
180
|
+
G.propTypes = {
|
|
181
|
+
"aria-label": e.string,
|
|
182
|
+
children: e.oneOfType([e.arrayOf(e.node), e.node]),
|
|
183
|
+
clearLabel: e.string,
|
|
184
|
+
customizeContent: e.func,
|
|
185
|
+
disabled: e.bool,
|
|
186
|
+
error: e.oneOfType([e.string, e.bool]),
|
|
187
|
+
hint: e.oneOfType([e.string, e.bool, e.node, e.arrayOf(e.node)]),
|
|
188
|
+
id: e.oneOfType([e.string, e.number]),
|
|
189
|
+
label: e.string,
|
|
190
|
+
labelAction: e.element,
|
|
191
|
+
multi: e.bool,
|
|
192
|
+
onChange: e.func,
|
|
193
|
+
onClear: e.func,
|
|
194
|
+
onReachEnd: e.func,
|
|
195
|
+
placeholder: e.string,
|
|
196
|
+
required: e.bool,
|
|
197
|
+
selectButtonTitle: e.string,
|
|
198
|
+
size: e.oneOf(Object.keys(ye.input)),
|
|
199
|
+
startIcon: e.element,
|
|
200
|
+
value: e.oneOfType([
|
|
201
|
+
e.arrayOf(e.oneOfType([e.string, e.number])),
|
|
202
|
+
e.string,
|
|
203
|
+
e.number
|
|
204
|
+
]),
|
|
205
|
+
withTags: e.bool
|
|
206
|
+
};
|
|
207
|
+
export {
|
|
208
|
+
G as Select
|
|
209
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("react"),b=require("prop-types"),f=require("styled-components"),l=require("./constants.cjs"),t=require("../helpers/keyboardKeys.cjs"),n=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},K=n(u),o=n(b),h=n(f),S=h.default.button`
|
|
2
|
+
position: absolute;
|
|
3
|
+
left: 0;
|
|
4
|
+
right: 0;
|
|
5
|
+
bottom: 0;
|
|
6
|
+
top: 0;
|
|
7
|
+
width: 100%;
|
|
8
|
+
background: transparent;
|
|
9
|
+
border: none;
|
|
10
|
+
|
|
11
|
+
// The focus state is moved to the parent thanks to :focus-within
|
|
12
|
+
&:focus {
|
|
13
|
+
outline: none;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&[data-disabled] {
|
|
17
|
+
cursor: not-allowed;
|
|
18
|
+
}
|
|
19
|
+
`,a=u.forwardRef(({labelledBy:e,expanded:c,onTrigger:d,disabled:s,...i},y)=>{const p=r=>{if(!s)switch(r.key){case t.KeyboardKeys.DOWN:case t.KeyboardKeys.SPACE:case t.KeyboardKeys.ENTER:{r.preventDefault(),d(l.DownState.Keyboard);break}case t.KeyboardKeys.UP:{r.preventDefault(),d(l.UpState.Keyboard);break}}};return K.default.createElement(S,{ref:y,role:"combobox","aria-labelledby":e,"aria-haspopup":"listbox","aria-expanded":c,onKeyDown:p,disabled:s,"data-disabled":s?"":void 0,type:"button",...i})});a.displayName="SelectButton";a.defaultProps={expanded:!1,disabled:!1};a.propTypes={disabled:o.default.bool,expanded:o.default.bool,labelledBy:o.default.string.isRequired,onTrigger:o.default.func.isRequired};exports.SelectButton=a;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import u, { forwardRef as b } from "react";
|
|
2
|
+
import e from "prop-types";
|
|
3
|
+
import c from "styled-components";
|
|
4
|
+
import { UpState as f, DownState as m } from "./constants.js";
|
|
5
|
+
import { KeyboardKeys as t } from "../helpers/keyboardKeys.js";
|
|
6
|
+
const y = c.button`
|
|
7
|
+
position: absolute;
|
|
8
|
+
left: 0;
|
|
9
|
+
right: 0;
|
|
10
|
+
bottom: 0;
|
|
11
|
+
top: 0;
|
|
12
|
+
width: 100%;
|
|
13
|
+
background: transparent;
|
|
14
|
+
border: none;
|
|
15
|
+
|
|
16
|
+
// The focus state is moved to the parent thanks to :focus-within
|
|
17
|
+
&:focus {
|
|
18
|
+
outline: none;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&[data-disabled] {
|
|
22
|
+
cursor: not-allowed;
|
|
23
|
+
}
|
|
24
|
+
`, r = b(({ labelledBy: s, expanded: d, onTrigger: n, disabled: o, ...l }, i) => {
|
|
25
|
+
const p = (a) => {
|
|
26
|
+
if (!o)
|
|
27
|
+
switch (a.key) {
|
|
28
|
+
case t.DOWN:
|
|
29
|
+
case t.SPACE:
|
|
30
|
+
case t.ENTER: {
|
|
31
|
+
a.preventDefault(), n(m.Keyboard);
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
case t.UP: {
|
|
35
|
+
a.preventDefault(), n(f.Keyboard);
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
return /* @__PURE__ */ u.createElement(
|
|
41
|
+
y,
|
|
42
|
+
{
|
|
43
|
+
ref: i,
|
|
44
|
+
role: "combobox",
|
|
45
|
+
"aria-labelledby": s,
|
|
46
|
+
"aria-haspopup": "listbox",
|
|
47
|
+
"aria-expanded": d,
|
|
48
|
+
onKeyDown: p,
|
|
49
|
+
disabled: o,
|
|
50
|
+
"data-disabled": o ? "" : void 0,
|
|
51
|
+
type: "button",
|
|
52
|
+
...l
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
});
|
|
56
|
+
r.displayName = "SelectButton";
|
|
57
|
+
r.defaultProps = {
|
|
58
|
+
expanded: !1,
|
|
59
|
+
disabled: !1
|
|
60
|
+
};
|
|
61
|
+
r.propTypes = {
|
|
62
|
+
disabled: e.bool,
|
|
63
|
+
expanded: e.bool,
|
|
64
|
+
labelledBy: e.string.isRequired,
|
|
65
|
+
onTrigger: e.func.isRequired
|
|
66
|
+
};
|
|
67
|
+
export {
|
|
68
|
+
r as SelectButton
|
|
69
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const S=require("react"),q=require("prop-types"),i=require("./constants.cjs"),h=require("./hooks/useListRef.cjs"),n=require("./utils.cjs"),v=require("../Flex/Flex.cjs"),c=require("../helpers/keyboardKeys.cjs"),b=r=>r&&typeof r=="object"&&"default"in r?r:{default:r},A=b(S),s=b(q),p=({labelledBy:r,onSelectItem:f,children:g,multi:y,onEscape:u,expanded:D})=>{const e=h.useListRef(D),K=o=>{switch(o.key){case c.KeyboardKeys.ESCAPE:{o.stopPropagation(),u();break}case c.KeyboardKeys.DOWN:{o.preventDefault();const t=n.getActiveDescendant(e.current);if(!t)return;const a=t.nextSibling;if(a)n.changeDescendant(e.current,a);else{const d=e.current.querySelectorAll('[role="option"]')[0];n.changeDescendant(e.current,d)}break}case c.KeyboardKeys.UP:{o.preventDefault();const t=n.getActiveDescendant(e.current);if(!t)return;const a=t.previousSibling;if(a)n.changeDescendant(e.current,a);else{const l=e.current.querySelectorAll('[role="option"]'),d=l[l.length-1];n.changeDescendant(e.current,d)}break}case c.KeyboardKeys.SPACE:case c.KeyboardKeys.ENTER:{o.preventDefault();const t=n.getActiveDescendant(e.current);t.getAttribute("data-opt-group")?f(t.getAttribute("data-opt-group-children").split(","),t.getAttribute("data-opt-group")):f(t.getAttribute("data-strapi-value")),y||u();break}}};return A.default.createElement(v.Flex,{as:"ul",gap:1,direction:"column",alignItems:"stretch",role:"listbox","aria-labelledby":r,tabIndex:-1,ref:e,onKeyDown:K,onBlur:u,"aria-multiselectable":y},g)};p.defaultProps={labelledBy:void 0,multi:!1};p.propTypes={children:s.default.node.isRequired,expanded:s.default.oneOf([i.UpState.Keyboard,i.UpState.Mouse,i.DownState.Keyboard,i.DownState.Mouse]).isRequired,labelledBy:s.default.string,multi:s.default.bool,onEscape:s.default.func.isRequired,onSelectItem:s.default.func.isRequired};exports.SelectList=p;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import O from "react";
|
|
2
|
+
import r from "prop-types";
|
|
3
|
+
import { UpState as f, DownState as b } from "./constants.js";
|
|
4
|
+
import { useListRef as S } from "./hooks/useListRef.js";
|
|
5
|
+
import { getActiveDescendant as u, changeDescendant as s } from "./utils.js";
|
|
6
|
+
import { Flex as v } from "../Flex/Flex.js";
|
|
7
|
+
import { KeyboardKeys as i } from "../helpers/keyboardKeys.js";
|
|
8
|
+
const m = ({ labelledBy: g, onSelectItem: p, children: y, multi: d, onEscape: a, expanded: A }) => {
|
|
9
|
+
const e = S(A), D = (o) => {
|
|
10
|
+
switch (o.key) {
|
|
11
|
+
case i.ESCAPE: {
|
|
12
|
+
o.stopPropagation(), a();
|
|
13
|
+
break;
|
|
14
|
+
}
|
|
15
|
+
case i.DOWN: {
|
|
16
|
+
o.preventDefault();
|
|
17
|
+
const t = u(e.current);
|
|
18
|
+
if (!t)
|
|
19
|
+
return;
|
|
20
|
+
const n = t.nextSibling;
|
|
21
|
+
if (n)
|
|
22
|
+
s(e.current, n);
|
|
23
|
+
else {
|
|
24
|
+
const c = e.current.querySelectorAll('[role="option"]')[0];
|
|
25
|
+
s(e.current, c);
|
|
26
|
+
}
|
|
27
|
+
break;
|
|
28
|
+
}
|
|
29
|
+
case i.UP: {
|
|
30
|
+
o.preventDefault();
|
|
31
|
+
const t = u(e.current);
|
|
32
|
+
if (!t)
|
|
33
|
+
return;
|
|
34
|
+
const n = t.previousSibling;
|
|
35
|
+
if (n)
|
|
36
|
+
s(e.current, n);
|
|
37
|
+
else {
|
|
38
|
+
const l = e.current.querySelectorAll('[role="option"]'), c = l[l.length - 1];
|
|
39
|
+
s(e.current, c);
|
|
40
|
+
}
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
case i.SPACE:
|
|
44
|
+
case i.ENTER: {
|
|
45
|
+
o.preventDefault();
|
|
46
|
+
const t = u(e.current);
|
|
47
|
+
t.getAttribute("data-opt-group") ? p(
|
|
48
|
+
t.getAttribute("data-opt-group-children").split(","),
|
|
49
|
+
t.getAttribute("data-opt-group")
|
|
50
|
+
) : p(t.getAttribute("data-strapi-value")), d || a();
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
return /* @__PURE__ */ O.createElement(
|
|
56
|
+
v,
|
|
57
|
+
{
|
|
58
|
+
as: "ul",
|
|
59
|
+
gap: 1,
|
|
60
|
+
direction: "column",
|
|
61
|
+
alignItems: "stretch",
|
|
62
|
+
role: "listbox",
|
|
63
|
+
"aria-labelledby": g,
|
|
64
|
+
tabIndex: -1,
|
|
65
|
+
ref: e,
|
|
66
|
+
onKeyDown: D,
|
|
67
|
+
onBlur: a,
|
|
68
|
+
"aria-multiselectable": d
|
|
69
|
+
},
|
|
70
|
+
y
|
|
71
|
+
);
|
|
72
|
+
};
|
|
73
|
+
m.defaultProps = {
|
|
74
|
+
labelledBy: void 0,
|
|
75
|
+
multi: !1
|
|
76
|
+
};
|
|
77
|
+
m.propTypes = {
|
|
78
|
+
children: r.node.isRequired,
|
|
79
|
+
expanded: r.oneOf([f.Keyboard, f.Mouse, b.Keyboard, b.Mouse]).isRequired,
|
|
80
|
+
labelledBy: r.string,
|
|
81
|
+
multi: r.bool,
|
|
82
|
+
onEscape: r.func.isRequired,
|
|
83
|
+
onSelectItem: r.func.isRequired
|
|
84
|
+
};
|
|
85
|
+
export {
|
|
86
|
+
m as SelectList
|
|
87
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("react"),d=require("@strapi/icons"),i=require("prop-types"),f=require("styled-components"),p=require("../Flex/Flex.cjs"),g=require("../Tag/Tag.cjs"),s=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},a=s(c),t=s(i),o=s(f),T=o.default.div`
|
|
2
|
+
margin-bottom: ${({theme:e})=>e.spaces[1]};
|
|
3
|
+
`,m=o.default(g.Tag)`
|
|
4
|
+
margin-left: ${({theme:e})=>e.spaces[1]};
|
|
5
|
+
margin-top: ${({theme:e})=>e.spaces[1]};
|
|
6
|
+
`,r=({tags:e,onRemoveTag:n,disabled:u})=>a.default.createElement(T,null,a.default.createElement(p.Flex,{wrap:"wrap"},e.map(l=>a.default.createElement(m,{disabled:u,key:`tag-${l.value}`,icon:a.default.createElement(d.Cross,null),onClick:()=>n(l.value),position:"relative",tabIndex:-1,zIndex:1},l.label))));r.defaultProps={disabled:!1,tags:[]};r.propTypes={disabled:t.default.bool,onRemoveTag:t.default.func.isRequired,tags:t.default.arrayOf(t.default.shape({label:t.default.string,value:t.default.oneOfType([t.default.string,t.default.number])}))};exports.SelectTags=r;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import a from "react";
|
|
2
|
+
import { Cross as n } from "@strapi/icons";
|
|
3
|
+
import e from "prop-types";
|
|
4
|
+
import o from "styled-components";
|
|
5
|
+
import { Flex as m } from "../Flex/Flex.js";
|
|
6
|
+
import { Tag as i } from "../Tag/Tag.js";
|
|
7
|
+
const c = o.div`
|
|
8
|
+
margin-bottom: ${({ theme: r }) => r.spaces[1]};
|
|
9
|
+
`, f = o(i)`
|
|
10
|
+
margin-left: ${({ theme: r }) => r.spaces[1]};
|
|
11
|
+
margin-top: ${({ theme: r }) => r.spaces[1]};
|
|
12
|
+
`, l = ({ tags: r, onRemoveTag: s, disabled: p }) => /* @__PURE__ */ a.createElement(c, null, /* @__PURE__ */ a.createElement(m, { wrap: "wrap" }, r.map((t) => /* @__PURE__ */ a.createElement(
|
|
13
|
+
f,
|
|
14
|
+
{
|
|
15
|
+
disabled: p,
|
|
16
|
+
key: `tag-${t.value}`,
|
|
17
|
+
icon: /* @__PURE__ */ a.createElement(n, null),
|
|
18
|
+
onClick: () => s(t.value),
|
|
19
|
+
position: "relative",
|
|
20
|
+
tabIndex: -1,
|
|
21
|
+
zIndex: 1
|
|
22
|
+
},
|
|
23
|
+
t.label
|
|
24
|
+
))));
|
|
25
|
+
l.defaultProps = {
|
|
26
|
+
disabled: !1,
|
|
27
|
+
tags: []
|
|
28
|
+
};
|
|
29
|
+
l.propTypes = {
|
|
30
|
+
disabled: e.bool,
|
|
31
|
+
onRemoveTag: e.func.isRequired,
|
|
32
|
+
tags: e.arrayOf(
|
|
33
|
+
e.shape({ label: e.string, value: e.oneOfType([e.string, e.number]) })
|
|
34
|
+
)
|
|
35
|
+
};
|
|
36
|
+
export {
|
|
37
|
+
l as SelectTags
|
|
38
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("styled-components"),s=require("../Box/Box.cjs"),i=require("../Flex/Flex.cjs"),r=require("../themes/utils.cjs"),a=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},t=a(n),d=t.default(i.Flex)`
|
|
2
|
+
position: relative;
|
|
3
|
+
border: 1px solid ${({theme:e,hasError:o})=>o?e.colors.danger600:e.colors.neutral200};
|
|
4
|
+
padding-right: ${({theme:e})=>e.spaces[3]};
|
|
5
|
+
border-radius: ${({theme:e})=>e.borderRadius};
|
|
6
|
+
background: ${({theme:e})=>e.colors.neutral0};
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
min-height: ${r.getThemeSize("input")};
|
|
9
|
+
|
|
10
|
+
${({theme:e,disabled:o})=>o?`
|
|
11
|
+
color: ${e.colors.neutral600};
|
|
12
|
+
background: ${e.colors.neutral150};
|
|
13
|
+
`:void 0}
|
|
14
|
+
|
|
15
|
+
${r.inputFocusStyle()}
|
|
16
|
+
`,l=t.default(s.Box)`
|
|
17
|
+
background: transparent;
|
|
18
|
+
border: none;
|
|
19
|
+
position: relative;
|
|
20
|
+
z-index: 1;
|
|
21
|
+
|
|
22
|
+
svg {
|
|
23
|
+
height: ${11/16}rem;
|
|
24
|
+
width: ${11/16}rem;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
svg path {
|
|
28
|
+
fill: ${({theme:e})=>e.colors.neutral600};
|
|
29
|
+
}
|
|
30
|
+
`,u=t.default(l)`
|
|
31
|
+
display: flex;
|
|
32
|
+
background: none;
|
|
33
|
+
border: none;
|
|
34
|
+
cursor: ${({disabled:e})=>e?"not-allowed":void 0};
|
|
35
|
+
|
|
36
|
+
svg {
|
|
37
|
+
width: ${6/16}rem;
|
|
38
|
+
}
|
|
39
|
+
`;exports.CaretBox=u;exports.IconBox=l;exports.SelectButtonWrapper=d;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import e from "styled-components";
|
|
2
|
+
import { Box as t } from "../Box/Box.js";
|
|
3
|
+
import { Flex as n } from "../Flex/Flex.js";
|
|
4
|
+
import { getThemeSize as i, inputFocusStyle as l } from "../themes/utils.js";
|
|
5
|
+
const u = e(n)`
|
|
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
|
+
border-radius: ${({ theme: o }) => o.borderRadius};
|
|
10
|
+
background: ${({ theme: o }) => o.colors.neutral0};
|
|
11
|
+
overflow: hidden;
|
|
12
|
+
min-height: ${i("input")};
|
|
13
|
+
|
|
14
|
+
${({ theme: o, disabled: r }) => r ? `
|
|
15
|
+
color: ${o.colors.neutral600};
|
|
16
|
+
background: ${o.colors.neutral150};
|
|
17
|
+
` : void 0}
|
|
18
|
+
|
|
19
|
+
${l()}
|
|
20
|
+
`, d = e(t)`
|
|
21
|
+
background: transparent;
|
|
22
|
+
border: none;
|
|
23
|
+
position: relative;
|
|
24
|
+
z-index: 1;
|
|
25
|
+
|
|
26
|
+
svg {
|
|
27
|
+
height: ${11 / 16}rem;
|
|
28
|
+
width: ${11 / 16}rem;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
svg path {
|
|
32
|
+
fill: ${({ theme: o }) => o.colors.neutral600};
|
|
33
|
+
}
|
|
34
|
+
`, $ = e(d)`
|
|
35
|
+
display: flex;
|
|
36
|
+
background: none;
|
|
37
|
+
border: none;
|
|
38
|
+
cursor: ${({ disabled: o }) => o ? "not-allowed" : void 0};
|
|
39
|
+
|
|
40
|
+
svg {
|
|
41
|
+
width: ${6 / 16}rem;
|
|
42
|
+
}
|
|
43
|
+
`;
|
|
44
|
+
export {
|
|
45
|
+
$ as CaretBox,
|
|
46
|
+
d as IconBox,
|
|
47
|
+
u as SelectButtonWrapper
|
|
48
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={Keyboard:"down:keyboard",Mouse:"down:mouse"},o={Keyboard:"up:keyboard",Mouse:"up:mouse"};exports.DownState=e;exports.UpState=o;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react"),s=require("../constants.cjs"),c=t=>{const r=e.useRef(null),n=e.useRef(null),u=e.useRef();return t&&(u.current=t),e.useEffect(()=>{!n.current||t||(u.current===s.DownState.Keyboard||u.current===s.UpState.Keyboard)&&r.current.focus()},[t]),e.useEffect(()=>{n.current=!0},[]),r};exports.useButtonRef=c;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useRef as e, useEffect as n } from "react";
|
|
2
|
+
import { DownState as f, UpState as c } from "../constants.js";
|
|
3
|
+
const m = (t) => {
|
|
4
|
+
const u = e(null), o = e(null), r = e();
|
|
5
|
+
return t && (r.current = t), n(() => {
|
|
6
|
+
!o.current || t || (r.current === f.Keyboard || r.current === c.Keyboard) && u.current.focus();
|
|
7
|
+
}, [t]), n(() => {
|
|
8
|
+
o.current = !0;
|
|
9
|
+
}, []), u;
|
|
10
|
+
};
|
|
11
|
+
export {
|
|
12
|
+
m as useButtonRef
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react"),s=require("../constants.cjs"),u=require("../utils.cjs"),i=r=>{const e=o.useRef(null);return o.useEffect(()=>{e.current.focus()},[]),o.useEffect(()=>{if(!e.current)return;const n=e.current.querySelector('[aria-selected="true"]'),c=e.current.querySelectorAll('[role="option"]');let t;n?t=n:r===s.UpState.Keyboard?t=c[c.length-1]:r===s.DownState.Keyboard&&(t=c[0]),t&&(r===s.UpState.Keyboard||r===s.DownState.Keyboard)&&u.changeDescendant(e.current,t)},[]),e};exports.useListRef=i;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useRef as i, useEffect as c } from "react";
|
|
2
|
+
import { UpState as s, DownState as f } from "../constants.js";
|
|
3
|
+
import { changeDescendant as l } from "../utils.js";
|
|
4
|
+
const y = (r) => {
|
|
5
|
+
const e = i(null);
|
|
6
|
+
return c(() => {
|
|
7
|
+
e.current.focus();
|
|
8
|
+
}, []), c(() => {
|
|
9
|
+
if (!e.current)
|
|
10
|
+
return;
|
|
11
|
+
const n = e.current.querySelector('[aria-selected="true"]'), o = e.current.querySelectorAll('[role="option"]');
|
|
12
|
+
let t;
|
|
13
|
+
n ? t = n : r === s.Keyboard ? t = o[o.length - 1] : r === f.Keyboard && (t = o[0]), t && (r === s.Keyboard || r === f.Keyboard) && l(e.current, t);
|
|
14
|
+
}, []), e;
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
y as useListRef
|
|
18
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./Select.cjs"),t=require("./Option.cjs"),c=require("./OptGroup.cjs"),s=require("./MultiSelectNested.cjs"),i=require("./SelectList.cjs");exports.Select=e.Select;exports.Option=t.Option;exports.OptGroup=c.OptGroup;exports.MultiSelectNested=s.MultiSelectNested;exports.SelectList=i.SelectList;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Select as o } from "./Select.js";
|
|
2
|
+
import { Option as p } from "./Option.js";
|
|
3
|
+
import { OptGroup as m } from "./OptGroup.js";
|
|
4
|
+
import { MultiSelectNested as l } from "./MultiSelectNested.js";
|
|
5
|
+
import { SelectList as i } from "./SelectList.js";
|
|
6
|
+
export {
|
|
7
|
+
l as MultiSelectNested,
|
|
8
|
+
m as OptGroup,
|
|
9
|
+
p as Option,
|
|
10
|
+
o as Select,
|
|
11
|
+
i as SelectList
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("compute-scroll-into-view"),a=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},r=a(s),i=(e,t)=>{e.setAttribute("aria-activedescendant",t.getAttribute("id")),e.querySelectorAll('[role="option"]').forEach(c=>c.classList.remove("is-focused")),t.classList.add("is-focused"),r.default(t,{scrollMode:"if-needed",block:"nearest",inline:"nearest"}).forEach(({el:c,top:o,left:n})=>{c.scrollTop=o,c.scrollLeft=n})},l=e=>{const t=e.getAttribute("aria-activedescendant");return e.querySelector(`#${t}`)};exports.changeDescendant=i;exports.getActiveDescendant=l;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import n from "compute-scroll-into-view";
|
|
2
|
+
const d = (e, t) => {
|
|
3
|
+
e.setAttribute("aria-activedescendant", t.getAttribute("id")), e.querySelectorAll('[role="option"]').forEach((c) => c.classList.remove("is-focused")), t.classList.add("is-focused"), n(t, {
|
|
4
|
+
scrollMode: "if-needed",
|
|
5
|
+
block: "nearest",
|
|
6
|
+
inline: "nearest"
|
|
7
|
+
}).forEach(({ el: c, top: o, left: s }) => {
|
|
8
|
+
c.scrollTop = o, c.scrollLeft = s;
|
|
9
|
+
});
|
|
10
|
+
}, l = (e) => {
|
|
11
|
+
const t = e.getAttribute("aria-activedescendant");
|
|
12
|
+
return e.querySelector(`#${t}`);
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
d as changeDescendant,
|
|
16
|
+
l as getActiveDescendant
|
|
17
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react"),M=require("@radix-ui/react-use-callback-ref"),z=require("@strapi/icons"),U=require("prop-types"),H=require("react-router-dom"),G=require("styled-components"),q=require("./utils.cjs"),b=require("../Box/Box.cjs"),j=require("../Button/Button.cjs"),J=require("../Flex/Flex.cjs"),s=require("../helpers/keyboardKeys.cjs"),Q=require("../hooks/useId.cjs"),X=require("../Link/Link.cjs"),w=require("../Popover/Popover.cjs"),T=require("../Typography/Typography.cjs"),B=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},o=B(a),t=B(U),E=B(G),Y=E.default.button`
|
|
2
|
+
border: none;
|
|
3
|
+
padding: 0;
|
|
4
|
+
background: transparent;
|
|
5
|
+
cursor: pointer;
|
|
6
|
+
${q.getOptionStyle}
|
|
7
|
+
`,Z=E.default(H.NavLink)`
|
|
8
|
+
text-decoration: none;
|
|
9
|
+
${q.getOptionStyle}
|
|
10
|
+
`,ee=E.default(X.Link)`
|
|
11
|
+
/* Removing Link hover effect */
|
|
12
|
+
&:hover {
|
|
13
|
+
color: currentColor;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&:focus-visible {
|
|
17
|
+
/* Removing Link focus-visible after properties and reset to global outline */
|
|
18
|
+
outline: 2px solid ${({theme:e})=>e.colors.primary600};
|
|
19
|
+
outline-offset: 2px;
|
|
20
|
+
&:after {
|
|
21
|
+
content: none;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
${q.getOptionStyle}
|
|
26
|
+
`,te=E.default.span`
|
|
27
|
+
display: flex;
|
|
28
|
+
align-items: center;
|
|
29
|
+
svg {
|
|
30
|
+
height: 4px;
|
|
31
|
+
width: 6px;
|
|
32
|
+
}
|
|
33
|
+
`,ne=E.default(j.Button)`
|
|
34
|
+
padding: ${({theme:e})=>`${e.spaces[1]} ${e.spaces[3]}`};
|
|
35
|
+
`,I=({children:e,onClick:h,to:u,isFocused:l,href:c,...x})=>{const d=a.useRef();a.useEffect(()=>{l&&d.current&&d.current.focus()},[l]);const i={tabIndex:l?0:-1,ref:d,role:"menuitem",...x},f=v=>{(v.key===s.KeyboardKeys.SPACE||v.key===s.KeyboardKeys.ENTER)&&h()};return u&&!c?o.default.createElement(Z,{to:u,...i},o.default.createElement(b.Box,{padding:2},o.default.createElement(T.Typography,null,e))):c&&!u?o.default.createElement(ee,{isExternal:!0,href:c,...i},o.default.createElement(b.Box,{padding:2},o.default.createElement(T.Typography,null,e))):o.default.createElement(Y,{onKeyDown:f,onMouseDown:h,type:"button",...i},o.default.createElement(b.Box,{padding:2},o.default.createElement(T.Typography,null,e)))};I.defaultProps={as:void 0,href:void 0,isFocused:!1,onClick(){},to:void 0};I.propTypes={as:t.default.elementType,children:t.default.node.isRequired,href:t.default.string,isFocused:t.default.bool,onClick:t.default.func,to:t.default.string};const g=({label:e,children:h,id:u,as:l,onOpen:c=()=>{},onClose:x=()=>{},size:d,popoverPlacement:i,onReachEnd:f,...v})=>{const p=a.useRef(),K=Q.useId(u),R=a.useRef(!1),[y,m]=a.useState(!1),[P,C]=a.useState(0),k=a.Children.toArray(h),L=d==="S"?ne:j.Button,_=l||L,O=!!f&&typeof f=="function";a.useEffect(()=>{if(["string","number"].includes(typeof e)){const n=k.findIndex(r=>r.props.children===e);n!==-1&&C(n)}},[e]);const S=M.useCallbackRef(c),D=M.useCallbackRef(x);a.useEffect(()=>{R?.current?y?S():D():R.current=!0},[R,D,S,y]),a.useEffect(()=>{o.default.isValidElement(e)&&P===-1&&p.current.focus()},[e,P]);const $=n=>{y&&(n.key===s.KeyboardKeys.ESCAPE&&(n.stopPropagation(),m(!1),p.current.focus()),n.key===s.KeyboardKeys.DOWN&&C(r=>r===k.length-1?0:r+1),n.key===s.KeyboardKeys.UP&&C(r=>r===0?k.length-1:r-1))},F=n=>{(n.key===s.KeyboardKeys.ENTER||n.key===s.KeyboardKeys.SPACE)&&m(r=>!r)},A=n=>{n.preventDefault(),n.currentTarget.contains(n.relatedTarget)||m(!1)},N=n=>{n.preventDefault(),m(r=>!r)},V=()=>{O&&f()},W=k.map((n,r)=>o.default.createElement(J.Flex,{as:"li",key:r,justifyContent:"center",role:"menuitem"},a.cloneElement(n,{onClick(){n.props.onClick(),m(!1),p.current.focus()},isFocused:P===r})));return o.default.createElement("div",{onKeyDown:$},o.default.createElement(_,{label:o.default.isValidElement(e)?null:e,"aria-haspopup":!0,"aria-expanded":y,"aria-controls":K,onKeyDown:F,onMouseDown:N,ref:p,type:"button",variant:"ghost",endIcon:o.default.createElement(te,null,o.default.createElement(z.CarretDown,{"aria-hidden":!0})),...v},e),y&&o.default.createElement(w.Popover,{onBlur:A,placement:i,source:p,onReachEnd:V,intersectionId:O?`popover-${K}`:void 0,spacing:4},o.default.createElement(b.Box,{role:"menu",as:"ul",padding:1,id:K},W)))};g.defaultProps={as:void 0};g.displayName="SimpleMenu";g.defaultProps={id:void 0,onOpen:void 0,onClose:void 0,onReachEnd:void 0,popoverPlacement:"bottom-start",size:"M"};g.propTypes={as:t.default.any,children:t.default.oneOfType([t.default.arrayOf(t.default.node),t.default.node]).isRequired,id:t.default.string,label:t.default.oneOfType([t.default.string,t.default.number,t.default.element]).isRequired,onClose:t.default.func,onOpen:t.default.func,onReachEnd:t.default.func,popoverPlacement:t.default.oneOf(w.POPOVER_PLACEMENTS),size:t.default.oneOf(["S","M"])};exports.MenuItem=I;exports.SimpleMenu=g;
|