@strapi/design-system 0.0.0-3cf3ff39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +7 -0
- package/README.md +47 -0
- package/dist/Accordion/Accordion.cjs +23 -0
- package/dist/Accordion/Accordion.js +38 -0
- package/dist/Accordion/AccordionContent.cjs +1 -0
- package/dist/Accordion/AccordionContent.js +13 -0
- package/dist/Accordion/AccordionContext.cjs +1 -0
- package/dist/Accordion/AccordionContext.js +12 -0
- package/dist/Accordion/AccordionGroup.cjs +47 -0
- package/dist/Accordion/AccordionGroup.js +60 -0
- package/dist/Accordion/AccordionToggle.cjs +28 -0
- package/dist/Accordion/AccordionToggle.js +53 -0
- package/dist/Accordion/index.cjs +1 -0
- package/dist/Accordion/index.js +11 -0
- package/dist/Accordion/utils.cjs +1 -0
- package/dist/Accordion/utils.js +7 -0
- package/dist/Alert/Alert.cjs +35 -0
- package/dist/Alert/Alert.js +46 -0
- package/dist/Alert/index.cjs +1 -0
- package/dist/Alert/index.js +4 -0
- package/dist/Alert/utils.cjs +1 -0
- package/dist/Alert/utils.js +6 -0
- package/dist/Avatar/Avatar.cjs +18 -0
- package/dist/Avatar/Avatar.js +39 -0
- package/dist/Avatar/AvatarGroup.cjs +5 -0
- package/dist/Avatar/AvatarGroup.js +11 -0
- package/dist/Avatar/constants.cjs +1 -0
- package/dist/Avatar/constants.js +5 -0
- package/dist/Avatar/index.cjs +1 -0
- package/dist/Avatar/index.js +7 -0
- package/dist/Badge/Badge.cjs +4 -0
- package/dist/Badge/Badge.js +14 -0
- package/dist/Badge/index.cjs +1 -0
- package/dist/Badge/index.js +4 -0
- package/dist/BaseButton/BaseButton.cjs +17 -0
- package/dist/BaseButton/BaseButton.js +27 -0
- package/dist/BaseButton/index.cjs +1 -0
- package/dist/BaseButton/index.js +5 -0
- package/dist/BaseCheckbox/BaseCheckbox.cjs +62 -0
- package/dist/BaseCheckbox/BaseCheckbox.js +80 -0
- package/dist/BaseCheckbox/assets/checkmark-black.svg.cjs +1 -0
- package/dist/BaseCheckbox/assets/checkmark-black.svg.js +4 -0
- package/dist/BaseCheckbox/assets/checkmark.svg.cjs +1 -0
- package/dist/BaseCheckbox/assets/checkmark.svg.js +4 -0
- package/dist/BaseCheckbox/index.cjs +1 -0
- package/dist/BaseCheckbox/index.js +4 -0
- package/dist/BaseCheckbox/utils.cjs +1 -0
- package/dist/BaseCheckbox/utils.js +4 -0
- package/dist/BaseLink/BaseLink.cjs +1 -0
- package/dist/BaseLink/BaseLink.js +8 -0
- package/dist/BaseLink/index.cjs +1 -0
- package/dist/BaseLink/index.js +4 -0
- package/dist/BaseRadio/BaseRadio.cjs +31 -0
- package/dist/BaseRadio/BaseRadio.js +58 -0
- package/dist/BaseRadio/RadioGroup.cjs +1 -0
- package/dist/BaseRadio/RadioGroup.js +15 -0
- package/dist/BaseRadio/context.cjs +1 -0
- package/dist/BaseRadio/context.js +10 -0
- package/dist/BaseRadio/index.cjs +1 -0
- package/dist/BaseRadio/index.js +6 -0
- package/dist/BaseRadio/utils.cjs +1 -0
- package/dist/BaseRadio/utils.js +6 -0
- package/dist/Box/Box.cjs +79 -0
- package/dist/Box/Box.js +95 -0
- package/dist/Box/index.cjs +1 -0
- package/dist/Box/index.js +4 -0
- package/dist/Breadcrumbs/Breadcrumbs.cjs +16 -0
- package/dist/Breadcrumbs/Breadcrumbs.js +30 -0
- package/dist/Breadcrumbs/index.cjs +1 -0
- package/dist/Breadcrumbs/index.js +5 -0
- package/dist/Button/Button.cjs +31 -0
- package/dist/Button/Button.js +51 -0
- package/dist/Button/constants.cjs +1 -0
- package/dist/Button/constants.js +14 -0
- package/dist/Button/index.cjs +1 -0
- package/dist/Button/index.js +5 -0
- package/dist/Button/utils.cjs +87 -0
- package/dist/Button/utils.js +112 -0
- package/dist/Card/Card.cjs +1 -0
- package/dist/Card/Card.js +12 -0
- package/dist/Card/CardAction.cjs +6 -0
- package/dist/Card/CardAction.js +20 -0
- package/dist/Card/CardAsset.cjs +19 -0
- package/dist/Card/CardAsset.js +28 -0
- package/dist/Card/CardBadge.cjs +6 -0
- package/dist/Card/CardBadge.js +12 -0
- package/dist/Card/CardBody.cjs +1 -0
- package/dist/Card/CardBody.js +7 -0
- package/dist/Card/CardCheckbox.cjs +1 -0
- package/dist/Card/CardCheckbox.js +14 -0
- package/dist/Card/CardContent.cjs +3 -0
- package/dist/Card/CardContent.js +9 -0
- package/dist/Card/CardContext.cjs +1 -0
- package/dist/Card/CardContext.js +6 -0
- package/dist/Card/CardHeader.cjs +3 -0
- package/dist/Card/CardHeader.js +9 -0
- package/dist/Card/CardTimer.cjs +1 -0
- package/dist/Card/CardTimer.js +7 -0
- package/dist/Card/CardTitle.cjs +1 -0
- package/dist/Card/CardTitle.js +11 -0
- package/dist/Card/index.cjs +1 -0
- package/dist/Card/index.js +23 -0
- package/dist/CarouselInput/Carousel.cjs +13 -0
- package/dist/CarouselInput/Carousel.js +40 -0
- package/dist/CarouselInput/CarouselActions.cjs +1 -0
- package/dist/CarouselInput/CarouselActions.js +6 -0
- package/dist/CarouselInput/CarouselImage.cjs +3 -0
- package/dist/CarouselInput/CarouselImage.js +17 -0
- package/dist/CarouselInput/CarouselInput.cjs +1 -0
- package/dist/CarouselInput/CarouselInput.js +15 -0
- package/dist/CarouselInput/CarouselSlide.cjs +1 -0
- package/dist/CarouselInput/CarouselSlide.js +6 -0
- package/dist/CarouselInput/index.cjs +1 -0
- package/dist/CarouselInput/index.js +12 -0
- package/dist/Checkbox/Checkbox.cjs +7 -0
- package/dist/Checkbox/Checkbox.js +28 -0
- package/dist/Checkbox/index.cjs +1 -0
- package/dist/Checkbox/index.js +4 -0
- package/dist/Combobox/Combobox.cjs +107 -0
- package/dist/Combobox/Combobox.js +175 -0
- package/dist/Combobox/ComboboxList.cjs +5 -0
- package/dist/Combobox/ComboboxList.js +10 -0
- package/dist/Combobox/ComboboxOption.cjs +1 -0
- package/dist/Combobox/ComboboxOption.js +5 -0
- package/dist/Combobox/index.cjs +1 -0
- package/dist/Combobox/index.js +7 -0
- package/dist/DatePicker/DatePicker.cjs +88 -0
- package/dist/DatePicker/DatePicker.js +397 -0
- package/dist/DatePicker/DatePickerCalendar.cjs +1 -0
- package/dist/DatePicker/DatePickerCalendar.js +43 -0
- package/dist/DatePicker/DatePickerTd.cjs +19 -0
- package/dist/DatePicker/DatePickerTd.js +29 -0
- package/dist/DatePicker/DatePickerTh.cjs +9 -0
- package/dist/DatePicker/DatePickerTh.js +18 -0
- package/dist/DatePicker/compareDates.cjs +1 -0
- package/dist/DatePicker/compareDates.js +4 -0
- package/dist/DatePicker/components.cjs +39 -0
- package/dist/DatePicker/components.js +53 -0
- package/dist/DatePicker/index.cjs +1 -0
- package/dist/DatePicker/index.js +4 -0
- package/dist/DatePicker/utils/formatDate.cjs +1 -0
- package/dist/DatePicker/utils/formatDate.js +4 -0
- package/dist/DatePicker/utils/generateWeeks.cjs +1 -0
- package/dist/DatePicker/utils/generateWeeks.js +17 -0
- package/dist/DatePicker/utils/getDayOfWeek.cjs +1 -0
- package/dist/DatePicker/utils/getDayOfWeek.js +15 -0
- package/dist/DatePicker/utils/getMonths.cjs +1 -0
- package/dist/DatePicker/utils/getMonths.js +7 -0
- package/dist/DatePicker/utils/getYears.cjs +1 -0
- package/dist/DatePicker/utils/getYears.js +9 -0
- package/dist/DatePicker/utils/index.cjs +1 -0
- package/dist/DatePicker/utils/index.js +12 -0
- package/dist/DateTimePicker/DateTimePicker.cjs +5 -0
- package/dist/DateTimePicker/DateTimePicker.js +91 -0
- package/dist/DateTimePicker/index.cjs +1 -0
- package/dist/DateTimePicker/index.js +5 -0
- package/dist/DateTimePicker/parseDate.cjs +1 -0
- package/dist/DateTimePicker/parseDate.js +8 -0
- package/dist/DesignSystemProvider.cjs +1 -0
- package/dist/DesignSystemProvider.js +10 -0
- package/dist/Dialog/Dialog.cjs +11 -0
- package/dist/Dialog/Dialog.js +31 -0
- package/dist/Dialog/DialogBody.cjs +10 -0
- package/dist/Dialog/DialogBody.js +17 -0
- package/dist/Dialog/DialogFooter.cjs +9 -0
- package/dist/Dialog/DialogFooter.js +16 -0
- package/dist/Dialog/index.cjs +1 -0
- package/dist/Dialog/index.js +8 -0
- package/dist/DismissibleLayer/index.cjs +1 -0
- package/dist/DismissibleLayer/index.js +5 -0
- package/dist/Divider/Divider.cjs +7 -0
- package/dist/Divider/Divider.js +13 -0
- package/dist/Divider/index.cjs +1 -0
- package/dist/Divider/index.js +4 -0
- package/dist/EmptyStateLayout/EmptyStateLayout.cjs +5 -0
- package/dist/EmptyStateLayout/EmptyStateLayout.js +13 -0
- package/dist/EmptyStateLayout/index.cjs +1 -0
- package/dist/EmptyStateLayout/index.js +4 -0
- package/dist/EmptyStateLayout/story-assets/Illo.cjs +1 -0
- package/dist/EmptyStateLayout/story-assets/Illo.js +5 -0
- package/dist/Field/Field.cjs +1 -0
- package/dist/Field/Field.js +12 -0
- package/dist/Field/FieldAction.cjs +4 -0
- package/dist/Field/FieldAction.js +16 -0
- package/dist/Field/FieldContext.cjs +1 -0
- package/dist/Field/FieldContext.js +6 -0
- package/dist/Field/FieldError.cjs +1 -0
- package/dist/Field/FieldError.js +10 -0
- package/dist/Field/FieldHint.cjs +1 -0
- package/dist/Field/FieldHint.js +10 -0
- package/dist/Field/FieldInput.cjs +41 -0
- package/dist/Field/FieldInput.js +63 -0
- package/dist/Field/FieldLabel.cjs +12 -0
- package/dist/Field/FieldLabel.js +25 -0
- package/dist/Field/index.cjs +1 -0
- package/dist/Field/index.js +18 -0
- package/dist/Flex/Flex.cjs +9 -0
- package/dist/Flex/Flex.js +19 -0
- package/dist/Flex/index.cjs +1 -0
- package/dist/Flex/index.js +4 -0
- package/dist/FocusTrap/FocusTrap.cjs +1 -0
- package/dist/FocusTrap/FocusTrap.js +33 -0
- package/dist/FocusTrap/index.cjs +1 -0
- package/dist/FocusTrap/index.js +4 -0
- package/dist/Grid/Grid.cjs +5 -0
- package/dist/Grid/Grid.js +26 -0
- package/dist/Grid/GridContext.cjs +1 -0
- package/dist/Grid/GridContext.js +6 -0
- package/dist/Grid/GridItem.cjs +12 -0
- package/dist/Grid/GridItem.js +34 -0
- package/dist/Grid/index.cjs +1 -0
- package/dist/Grid/index.js +6 -0
- package/dist/Icon/Icon.cjs +6 -0
- package/dist/Icon/Icon.js +15 -0
- package/dist/Icon/index.cjs +1 -0
- package/dist/Icon/index.js +4 -0
- package/dist/IconButton/IconButton.cjs +81 -0
- package/dist/IconButton/IconButton.js +101 -0
- package/dist/IconButton/index.cjs +1 -0
- package/dist/IconButton/index.js +5 -0
- package/dist/JSONInput/JSONInput.cjs +1 -0
- package/dist/JSONInput/JSONInput.js +64 -0
- package/dist/JSONInput/JSONInputContainer.cjs +33 -0
- package/dist/JSONInput/JSONInputContainer.js +39 -0
- package/dist/JSONInput/index.cjs +1 -0
- package/dist/JSONInput/index.js +4 -0
- package/dist/JSONInput/utils/decorationExtension.cjs +1 -0
- package/dist/JSONInput/utils/decorationExtension.js +27 -0
- package/dist/KeyboardNavigable/KeyboardNavigable.cjs +1 -0
- package/dist/KeyboardNavigable/KeyboardNavigable.js +46 -0
- package/dist/KeyboardNavigable/index.cjs +1 -0
- package/dist/KeyboardNavigable/index.js +4 -0
- package/dist/Layout/ActionLayout.cjs +9 -0
- package/dist/Layout/ActionLayout.js +29 -0
- package/dist/Layout/ContentLayout.cjs +1 -0
- package/dist/Layout/ContentLayout.js +11 -0
- package/dist/Layout/GridLayout.cjs +5 -0
- package/dist/Layout/GridLayout.js +13 -0
- package/dist/Layout/HeaderLayout.cjs +4 -0
- package/dist/Layout/HeaderLayout.js +127 -0
- package/dist/Layout/Layout.cjs +6 -0
- package/dist/Layout/Layout.js +24 -0
- package/dist/Layout/TwoColsLayout.cjs +1 -0
- package/dist/Layout/TwoColsLayout.js +17 -0
- package/dist/Layout/index.cjs +1 -0
- package/dist/Layout/index.js +15 -0
- package/dist/Link/Link.cjs +33 -0
- package/dist/Link/Link.js +44 -0
- package/dist/Link/index.cjs +1 -0
- package/dist/Link/index.js +4 -0
- package/dist/LinkButton/LinkButton.cjs +15 -0
- package/dist/LinkButton/LinkButton.js +29 -0
- package/dist/LinkButton/index.cjs +1 -0
- package/dist/LinkButton/index.js +4 -0
- package/dist/LiveRegions/LiveRegions.cjs +1 -0
- package/dist/LiveRegions/LiveRegions.js +7 -0
- package/dist/LiveRegions/constants.cjs +1 -0
- package/dist/LiveRegions/constants.js +8 -0
- package/dist/LiveRegions/index.cjs +1 -0
- package/dist/LiveRegions/index.js +6 -0
- package/dist/LiveRegions/useNotifyAT.cjs +1 -0
- package/dist/LiveRegions/useNotifyAT.js +17 -0
- package/dist/Loader/Loader.cjs +12 -0
- package/dist/Loader/Loader.js +20 -0
- package/dist/Loader/assets/loader.svg.cjs +1 -0
- package/dist/Loader/assets/loader.svg.js +4 -0
- package/dist/Loader/index.cjs +1 -0
- package/dist/Loader/index.js +4 -0
- package/dist/Main/Main.cjs +6 -0
- package/dist/Main/Main.js +12 -0
- package/dist/Main/SkipToContent.cjs +8 -0
- package/dist/Main/SkipToContent.js +14 -0
- package/dist/Main/index.cjs +1 -0
- package/dist/Main/index.js +6 -0
- package/dist/MainNav/MainNav.cjs +4 -0
- package/dist/MainNav/MainNav.js +33 -0
- package/dist/MainNav/MainNavContext.cjs +1 -0
- package/dist/MainNav/MainNavContext.js +6 -0
- package/dist/MainNav/NavBrand.cjs +12 -0
- package/dist/MainNav/NavBrand.js +49 -0
- package/dist/MainNav/NavCondense.cjs +20 -0
- package/dist/MainNav/NavCondense.js +40 -0
- package/dist/MainNav/NavFooter.cjs +1 -0
- package/dist/MainNav/NavFooter.js +12 -0
- package/dist/MainNav/NavLink.cjs +69 -0
- package/dist/MainNav/NavLink.js +103 -0
- package/dist/MainNav/NavSection.cjs +1 -0
- package/dist/MainNav/NavSection.js +46 -0
- package/dist/MainNav/NavSections.cjs +4 -0
- package/dist/MainNav/NavSections.js +26 -0
- package/dist/MainNav/NavUser.cjs +3 -0
- package/dist/MainNav/NavUser.js +32 -0
- package/dist/MainNav/index.cjs +1 -0
- package/dist/MainNav/index.js +18 -0
- package/dist/ModalLayout/ModalBody.cjs +4 -0
- package/dist/ModalLayout/ModalBody.js +10 -0
- package/dist/ModalLayout/ModalContext.cjs +1 -0
- package/dist/ModalLayout/ModalContext.js +7 -0
- package/dist/ModalLayout/ModalFooter.cjs +4 -0
- package/dist/ModalLayout/ModalFooter.js +11 -0
- package/dist/ModalLayout/ModalHeader.cjs +4 -0
- package/dist/ModalLayout/ModalHeader.js +17 -0
- package/dist/ModalLayout/ModalLayout.cjs +4 -0
- package/dist/ModalLayout/ModalLayout.js +16 -0
- package/dist/ModalLayout/index.cjs +1 -0
- package/dist/ModalLayout/index.js +10 -0
- package/dist/NumberInput/NumberInput.cjs +12 -0
- package/dist/NumberInput/NumberInput.js +79 -0
- package/dist/NumberInput/index.cjs +1 -0
- package/dist/NumberInput/index.js +4 -0
- package/dist/Pagination/Pagination.cjs +1 -0
- package/dist/Pagination/Pagination.js +12 -0
- package/dist/Pagination/PaginationContext.cjs +1 -0
- package/dist/Pagination/PaginationContext.js +6 -0
- package/dist/Pagination/assets/next.svg.cjs +1 -0
- package/dist/Pagination/assets/next.svg.js +4 -0
- package/dist/Pagination/assets/previous.svg.cjs +1 -0
- package/dist/Pagination/assets/previous.svg.js +4 -0
- package/dist/Pagination/components.cjs +33 -0
- package/dist/Pagination/components.js +67 -0
- package/dist/Pagination/index.cjs +1 -0
- package/dist/Pagination/index.js +9 -0
- package/dist/Popover/Popover.cjs +25 -0
- package/dist/Popover/Popover.js +127 -0
- package/dist/Popover/index.cjs +1 -0
- package/dist/Popover/index.js +7 -0
- package/dist/Popover/primitives.cjs +1 -0
- package/dist/Popover/primitives.js +5 -0
- package/dist/Portal/Portal.cjs +1 -0
- package/dist/Portal/Portal.js +9 -0
- package/dist/Portal/index.cjs +1 -0
- package/dist/Portal/index.js +4 -0
- package/dist/ProgressBar/ProgressBar.cjs +11 -0
- package/dist/ProgressBar/ProgressBar.js +17 -0
- package/dist/ProgressBar/index.cjs +1 -0
- package/dist/ProgressBar/index.js +4 -0
- package/dist/Radio/Radio.cjs +1 -0
- package/dist/Radio/Radio.js +8 -0
- package/dist/Radio/index.cjs +1 -0
- package/dist/Radio/index.js +6 -0
- package/dist/RawTable/RawCell.cjs +1 -0
- package/dist/RawTable/RawCell.js +60 -0
- package/dist/RawTable/RawTable.cjs +1 -0
- package/dist/RawTable/RawTable.js +53 -0
- package/dist/RawTable/RawTableContext.cjs +1 -0
- package/dist/RawTable/RawTableContext.js +12 -0
- package/dist/RawTable/RawTbody.cjs +1 -0
- package/dist/RawTable/RawTbody.js +9 -0
- package/dist/RawTable/RawThead.cjs +1 -0
- package/dist/RawTable/RawThead.js +9 -0
- package/dist/RawTable/RawTr.cjs +1 -0
- package/dist/RawTable/RawTr.js +13 -0
- package/dist/RawTable/focusFocusable.cjs +1 -0
- package/dist/RawTable/focusFocusable.js +7 -0
- package/dist/RawTable/index.cjs +1 -0
- package/dist/RawTable/index.js +13 -0
- package/dist/Searchbar/SearchForm.cjs +1 -0
- package/dist/Searchbar/SearchForm.js +5 -0
- package/dist/Searchbar/Searchbar.cjs +28 -0
- package/dist/Searchbar/Searchbar.js +47 -0
- package/dist/Searchbar/index.cjs +1 -0
- package/dist/Searchbar/index.js +6 -0
- package/dist/Select/MultiSelect.cjs +30 -0
- package/dist/Select/MultiSelect.js +75 -0
- package/dist/Select/MultiSelectNested.cjs +3 -0
- package/dist/Select/MultiSelectNested.js +9 -0
- package/dist/Select/OptGroup.cjs +5 -0
- package/dist/Select/OptGroup.js +10 -0
- package/dist/Select/Option.cjs +5 -0
- package/dist/Select/Option.js +16 -0
- package/dist/Select/Select.cjs +6 -0
- package/dist/Select/Select.js +19 -0
- package/dist/Select/SelectList.cjs +5 -0
- package/dist/Select/SelectList.js +85 -0
- package/dist/Select/SelectParts.cjs +83 -0
- package/dist/Select/SelectParts.js +110 -0
- package/dist/Select/SingleSelect.cjs +1 -0
- package/dist/Select/SingleSelect.js +44 -0
- package/dist/Select/index.cjs +1 -0
- package/dist/Select/index.js +19 -0
- package/dist/SimpleMenu/SimpleMenu.cjs +35 -0
- package/dist/SimpleMenu/SimpleMenu.js +198 -0
- package/dist/SimpleMenu/index.cjs +1 -0
- package/dist/SimpleMenu/index.js +5 -0
- package/dist/SimpleMenu/utils.cjs +12 -0
- package/dist/SimpleMenu/utils.js +15 -0
- package/dist/Stack/Stack.cjs +19 -0
- package/dist/Stack/Stack.js +35 -0
- package/dist/Stack/index.cjs +1 -0
- package/dist/Stack/index.js +4 -0
- package/dist/Status/Status.cjs +11 -0
- package/dist/Status/Status.js +22 -0
- package/dist/Status/index.cjs +1 -0
- package/dist/Status/index.js +4 -0
- package/dist/SubNav/SubNav.cjs +10 -0
- package/dist/SubNav/SubNav.js +22 -0
- package/dist/SubNav/SubNavHeader.cjs +4 -0
- package/dist/SubNav/SubNavHeader.js +86 -0
- package/dist/SubNav/SubNavLink.cjs +39 -0
- package/dist/SubNav/SubNavLink.js +81 -0
- package/dist/SubNav/SubNavLinkSection.cjs +19 -0
- package/dist/SubNav/SubNavLinkSection.js +51 -0
- package/dist/SubNav/SubNavSection.cjs +8 -0
- package/dist/SubNav/SubNavSection.js +64 -0
- package/dist/SubNav/SubNavSectionLabel.cjs +9 -0
- package/dist/SubNav/SubNavSectionLabel.js +47 -0
- package/dist/SubNav/SubNavSections.cjs +1 -0
- package/dist/SubNav/SubNavSections.js +22 -0
- package/dist/SubNav/index.cjs +1 -0
- package/dist/SubNav/index.js +15 -0
- package/dist/Switch/Switch.cjs +42 -0
- package/dist/Switch/Switch.js +50 -0
- package/dist/Switch/index.cjs +1 -0
- package/dist/Switch/index.js +4 -0
- package/dist/Table/Cell.cjs +17 -0
- package/dist/Table/Cell.js +38 -0
- package/dist/Table/TFooter.cjs +22 -0
- package/dist/Table/TFooter.js +43 -0
- package/dist/Table/Table.cjs +34 -0
- package/dist/Table/Table.js +70 -0
- package/dist/Table/Tbody.cjs +5 -0
- package/dist/Table/Tbody.js +12 -0
- package/dist/Table/Thead.cjs +3 -0
- package/dist/Table/Thead.js +10 -0
- package/dist/Table/Tr.cjs +20 -0
- package/dist/Table/Tr.js +27 -0
- package/dist/Table/index.cjs +1 -0
- package/dist/Table/index.js +15 -0
- package/dist/Tabs/TabGroup.cjs +1 -0
- package/dist/Tabs/TabGroup.js +16 -0
- package/dist/Tabs/TabPanels.cjs +1 -0
- package/dist/Tabs/TabPanels.js +14 -0
- package/dist/Tabs/Tabs.cjs +5 -0
- package/dist/Tabs/Tabs.js +76 -0
- package/dist/Tabs/TabsContext.cjs +1 -0
- package/dist/Tabs/TabsContext.js +13 -0
- package/dist/Tabs/components.cjs +43 -0
- package/dist/Tabs/components.js +52 -0
- package/dist/Tabs/index.cjs +1 -0
- package/dist/Tabs/index.js +10 -0
- package/dist/Tag/Tag.cjs +14 -0
- package/dist/Tag/Tag.js +23 -0
- package/dist/Tag/index.cjs +1 -0
- package/dist/Tag/index.js +4 -0
- package/dist/TextButton/TextButton.cjs +26 -0
- package/dist/TextButton/TextButton.js +40 -0
- package/dist/TextButton/index.cjs +1 -0
- package/dist/TextButton/index.js +4 -0
- package/dist/TextInput/TextInput.cjs +1 -0
- package/dist/TextInput/TextInput.js +21 -0
- package/dist/TextInput/index.cjs +1 -0
- package/dist/TextInput/index.js +4 -0
- package/dist/Textarea/Textarea.cjs +17 -0
- package/dist/Textarea/Textarea.js +39 -0
- package/dist/Textarea/index.cjs +1 -0
- package/dist/Textarea/index.js +4 -0
- package/dist/ThemeProvider/ThemeProvider.cjs +173 -0
- package/dist/ThemeProvider/ThemeProvider.js +180 -0
- package/dist/ThemeProvider/hooks.cjs +1 -0
- package/dist/ThemeProvider/hooks.js +5 -0
- package/dist/ThemeProvider/index.cjs +1 -0
- package/dist/ThemeProvider/index.js +6 -0
- package/dist/TimePicker/TimePicker.cjs +8 -0
- package/dist/TimePicker/TimePicker.js +83 -0
- package/dist/TimePicker/index.cjs +1 -0
- package/dist/TimePicker/index.js +5 -0
- package/dist/ToggleCheckbox/ToggleCheckbox.cjs +36 -0
- package/dist/ToggleCheckbox/ToggleCheckbox.js +59 -0
- package/dist/ToggleCheckbox/index.cjs +1 -0
- package/dist/ToggleCheckbox/index.js +4 -0
- package/dist/ToggleInput/ToggleInput.cjs +6 -0
- package/dist/ToggleInput/ToggleInput.js +23 -0
- package/dist/ToggleInput/index.cjs +1 -0
- package/dist/ToggleInput/index.js +4 -0
- package/dist/Tooltip/Tooltip.cjs +5 -0
- package/dist/Tooltip/Tooltip.js +26 -0
- package/dist/Tooltip/hooks/useTooltipHandlers.cjs +1 -0
- package/dist/Tooltip/hooks/useTooltipHandlers.js +22 -0
- package/dist/Tooltip/hooks/useTooltipLayout.cjs +1 -0
- package/dist/Tooltip/hooks/useTooltipLayout.js +17 -0
- package/dist/Tooltip/index.cjs +1 -0
- package/dist/Tooltip/index.js +4 -0
- package/dist/Tooltip/utils/positionTooltip.cjs +1 -0
- package/dist/Tooltip/utils/positionTooltip.js +27 -0
- package/dist/Typography/Typography.cjs +14 -0
- package/dist/Typography/Typography.js +25 -0
- package/dist/Typography/constants.cjs +1 -0
- package/dist/Typography/constants.js +11 -0
- package/dist/Typography/index.cjs +1 -0
- package/dist/Typography/index.js +4 -0
- package/dist/Typography/utils.cjs +34 -0
- package/dist/Typography/utils.js +59 -0
- package/dist/VisuallyHidden/VisuallyHidden.cjs +10 -0
- package/dist/VisuallyHidden/VisuallyHidden.js +14 -0
- package/dist/VisuallyHidden/index.cjs +1 -0
- package/dist/VisuallyHidden/index.js +4 -0
- package/dist/helpers/context.cjs +1 -0
- package/dist/helpers/context.js +21 -0
- package/dist/helpers/deprecations.cjs +1 -0
- package/dist/helpers/deprecations.js +13 -0
- package/dist/helpers/getDefaultLocale.cjs +4 -0
- package/dist/helpers/getDefaultLocale.js +9 -0
- package/dist/helpers/getFocusableNodes.cjs +1 -0
- package/dist/helpers/getFocusableNodes.js +7 -0
- package/dist/helpers/handleResponsiveValues.cjs +1 -0
- package/dist/helpers/handleResponsiveValues.js +25 -0
- package/dist/helpers/keyboardKeys.cjs +1 -0
- package/dist/helpers/keyboardKeys.js +20 -0
- package/dist/helpers/objects.cjs +1 -0
- package/dist/helpers/objects.js +10 -0
- package/dist/helpers/setOpacity.cjs +1 -0
- package/dist/helpers/setOpacity.js +4 -0
- package/dist/helpers/setTabIndexOnFirstItem.cjs +1 -0
- package/dist/helpers/setTabIndexOnFirstItem.js +7 -0
- package/dist/helpers/strings.cjs +1 -0
- package/dist/helpers/strings.js +4 -0
- package/dist/helpers/theme.cjs +1 -0
- package/dist/helpers/theme.js +7 -0
- package/dist/helpers/useElementOnScreen.cjs +4 -0
- package/dist/helpers/useElementOnScreen.js +11 -0
- package/dist/helpers/useId.cjs +4 -0
- package/dist/helpers/useId.js +11 -0
- package/dist/helpers/useIntersection.cjs +4 -0
- package/dist/helpers/useIntersection.js +11 -0
- package/dist/helpers/useLockScroll.cjs +4 -0
- package/dist/helpers/useLockScroll.js +11 -0
- package/dist/helpers/usePrevious.cjs +4 -0
- package/dist/helpers/usePrevious.js +11 -0
- package/dist/helpers/useResizeObserver.cjs +4 -0
- package/dist/helpers/useResizeObserver.js +11 -0
- package/dist/hooks/useComposeRefs.cjs +1 -0
- package/dist/hooks/useComposeRefs.js +14 -0
- package/dist/hooks/useControllableState.cjs +1 -0
- package/dist/hooks/useControllableState.js +22 -0
- package/dist/hooks/useDateFormatter.cjs +1 -0
- package/dist/hooks/useDateFormatter.js +20 -0
- package/dist/hooks/useElementOnScreen.cjs +1 -0
- package/dist/hooks/useElementOnScreen.js +15 -0
- package/dist/hooks/useId.cjs +1 -0
- package/dist/hooks/useId.js +13 -0
- package/dist/hooks/useIntersection.cjs +1 -0
- package/dist/hooks/useIntersection.js +23 -0
- package/dist/hooks/useLockScroll.cjs +1 -0
- package/dist/hooks/useLockScroll.js +9 -0
- package/dist/hooks/usePrevious.cjs +1 -0
- package/dist/hooks/usePrevious.js +10 -0
- package/dist/hooks/useResizeObserver.cjs +1 -0
- package/dist/hooks/useResizeObserver.js +16 -0
- package/dist/index.cjs +1 -0
- package/dist/index.js +311 -0
- package/dist/themes/common-theme.cjs +1 -0
- package/dist/themes/common-theme.js +21 -0
- package/dist/themes/darkTheme/dark-colors.cjs +1 -0
- package/dist/themes/darkTheme/dark-colors.js +52 -0
- package/dist/themes/darkTheme/dark-shadows.cjs +1 -0
- package/dist/themes/darkTheme/dark-shadows.js +12 -0
- package/dist/themes/darkTheme/index.cjs +1 -0
- package/dist/themes/darkTheme/index.js +11 -0
- package/dist/themes/extendTheme.cjs +13 -0
- package/dist/themes/extendTheme.js +36 -0
- package/dist/themes/index.cjs +1 -0
- package/dist/themes/index.js +12 -0
- package/dist/themes/lightTheme/index.cjs +1 -0
- package/dist/themes/lightTheme/index.js +11 -0
- package/dist/themes/lightTheme/light-colors.cjs +1 -0
- package/dist/themes/lightTheme/light-colors.js +52 -0
- package/dist/themes/lightTheme/light-shadows.cjs +1 -0
- package/dist/themes/lightTheme/light-shadows.js +12 -0
- package/dist/themes/sizes.cjs +1 -0
- package/dist/themes/sizes.js +22 -0
- package/dist/themes/utils.cjs +41 -0
- package/dist/themes/utils.js +47 -0
- package/dist/v2/Breadcrumbs/Breadcrumbs.cjs +9 -0
- package/dist/v2/Breadcrumbs/Breadcrumbs.js +33 -0
- package/dist/v2/Breadcrumbs/Crumb.cjs +1 -0
- package/dist/v2/Breadcrumbs/Crumb.js +27 -0
- package/dist/v2/Breadcrumbs/CrumbLink.cjs +14 -0
- package/dist/v2/Breadcrumbs/CrumbLink.js +30 -0
- package/dist/v2/Breadcrumbs/CrumbSimpleMenu.cjs +8 -0
- package/dist/v2/Breadcrumbs/CrumbSimpleMenu.js +23 -0
- package/dist/v2/Breadcrumbs/Divider.cjs +1 -0
- package/dist/v2/Breadcrumbs/Divider.js +9 -0
- package/dist/v2/Breadcrumbs/index.cjs +1 -0
- package/dist/v2/Breadcrumbs/index.js +10 -0
- package/dist/v2/Link/Link.cjs +25 -0
- package/dist/v2/Link/Link.js +36 -0
- package/dist/v2/Link/index.cjs +1 -0
- package/dist/v2/Link/index.js +4 -0
- package/dist/v2/LinkButton/LinkButton.cjs +20 -0
- package/dist/v2/LinkButton/LinkButton.js +35 -0
- package/dist/v2/LinkButton/index.cjs +1 -0
- package/dist/v2/LinkButton/index.js +4 -0
- package/dist/v2/MainNav/MainNav.cjs +4 -0
- package/dist/v2/MainNav/MainNav.js +33 -0
- package/dist/v2/MainNav/MainNavContext.cjs +1 -0
- package/dist/v2/MainNav/MainNavContext.js +6 -0
- package/dist/v2/MainNav/NavBrand.cjs +12 -0
- package/dist/v2/MainNav/NavBrand.js +50 -0
- package/dist/v2/MainNav/NavCondense.cjs +20 -0
- package/dist/v2/MainNav/NavCondense.js +40 -0
- package/dist/v2/MainNav/NavFooter.cjs +1 -0
- package/dist/v2/MainNav/NavFooter.js +12 -0
- package/dist/v2/MainNav/NavLink.cjs +69 -0
- package/dist/v2/MainNav/NavLink.js +103 -0
- package/dist/v2/MainNav/NavSection.cjs +1 -0
- package/dist/v2/MainNav/NavSection.js +46 -0
- package/dist/v2/MainNav/NavSections.cjs +4 -0
- package/dist/v2/MainNav/NavSections.js +26 -0
- package/dist/v2/MainNav/NavUser.cjs +3 -0
- package/dist/v2/MainNav/NavUser.js +32 -0
- package/dist/v2/MainNav/index.cjs +1 -0
- package/dist/v2/MainNav/index.js +18 -0
- package/dist/v2/Pagination/Pagination.cjs +5 -0
- package/dist/v2/Pagination/Pagination.js +26 -0
- package/dist/v2/Pagination/PaginationContext.cjs +1 -0
- package/dist/v2/Pagination/PaginationContext.js +6 -0
- package/dist/v2/Pagination/assets/next.svg.cjs +1 -0
- package/dist/v2/Pagination/assets/next.svg.js +4 -0
- package/dist/v2/Pagination/assets/previous.svg.cjs +1 -0
- package/dist/v2/Pagination/assets/previous.svg.js +4 -0
- package/dist/v2/Pagination/components.cjs +36 -0
- package/dist/v2/Pagination/components.js +95 -0
- package/dist/v2/Pagination/index.cjs +1 -0
- package/dist/v2/Pagination/index.js +9 -0
- package/dist/v2/SimpleMenu/Menu.cjs +65 -0
- package/dist/v2/SimpleMenu/Menu.js +89 -0
- package/dist/v2/SimpleMenu/SimpleMenu.cjs +1 -0
- package/dist/v2/SimpleMenu/SimpleMenu.js +27 -0
- package/dist/v2/SimpleMenu/index.cjs +1 -0
- package/dist/v2/SimpleMenu/index.js +7 -0
- package/dist/v2/SubNav/SubNav.cjs +10 -0
- package/dist/v2/SubNav/SubNav.js +22 -0
- package/dist/v2/SubNav/SubNavHeader.cjs +4 -0
- package/dist/v2/SubNav/SubNavHeader.js +86 -0
- package/dist/v2/SubNav/SubNavLink.cjs +39 -0
- package/dist/v2/SubNav/SubNavLink.js +84 -0
- package/dist/v2/SubNav/SubNavLinkSection.cjs +19 -0
- package/dist/v2/SubNav/SubNavLinkSection.js +50 -0
- package/dist/v2/SubNav/SubNavSection.cjs +8 -0
- package/dist/v2/SubNav/SubNavSection.js +63 -0
- package/dist/v2/SubNav/SubNavSectionLabel.cjs +9 -0
- package/dist/v2/SubNav/SubNavSectionLabel.js +47 -0
- package/dist/v2/SubNav/SubNavSections.cjs +1 -0
- package/dist/v2/SubNav/SubNavSections.js +22 -0
- package/dist/v2/SubNav/index.cjs +1 -0
- package/dist/v2/SubNav/index.js +15 -0
- package/dist/v2/index.cjs +1 -0
- package/dist/v2/index.js +55 -0
- package/package.json +69 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import * as a from "react";
|
|
3
|
+
import { createPortal as e } from "react-dom";
|
|
4
|
+
import { Box as l } from "../Box/Box.js";
|
|
5
|
+
const f = a.forwardRef(({ container: o = globalThis?.document?.body, ...r }, t) => o ? e(m(l, { ref: t, ...r }), o) : null);
|
|
6
|
+
f.displayName = "Portal";
|
|
7
|
+
export {
|
|
8
|
+
f as Portal
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./Portal.cjs");exports.Portal=t.Portal;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),i=require("styled-components"),l=require("../Box/Box.cjs"),n=r=>r&&r.__esModule?r:{default:r},d=n(i),c=d.default(l.Box)`
|
|
2
|
+
&:before {
|
|
3
|
+
background-color: ${({theme:r})=>r.colors.neutral0};
|
|
4
|
+
border-radius: ${({theme:r})=>r.borderRadius};
|
|
5
|
+
bottom: 0;
|
|
6
|
+
content: '';
|
|
7
|
+
position: absolute;
|
|
8
|
+
top: 0;
|
|
9
|
+
width: ${({value:r})=>`${r}%`};
|
|
10
|
+
}
|
|
11
|
+
`,b=({min:r=0,max:t=100,value:e=0,children:a,size:o="M",...s})=>u.jsx(c,{background:"neutral600",hasRadius:!0,"aria-label":a,"aria-valuemax":t,"aria-valuemin":r,"aria-valuenow":e,height:o==="S"?1:2,position:"relative",role:"progressbar",value:e,width:o==="S"?"78px":"102px",...s});exports.ProgressBar=b;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import l from "styled-components";
|
|
3
|
+
import { Box as n } from "../Box/Box.js";
|
|
4
|
+
const u = l(n)`
|
|
5
|
+
&:before {
|
|
6
|
+
background-color: ${({ theme: r }) => r.colors.neutral0};
|
|
7
|
+
border-radius: ${({ theme: r }) => r.borderRadius};
|
|
8
|
+
bottom: 0;
|
|
9
|
+
content: '';
|
|
10
|
+
position: absolute;
|
|
11
|
+
top: 0;
|
|
12
|
+
width: ${({ value: r }) => `${r}%`};
|
|
13
|
+
}
|
|
14
|
+
`, m = ({ min: r = 0, max: e = 100, value: o = 0, children: t, size: a = "M", ...i }) => s(u, { background: "neutral600", hasRadius: !0, "aria-label": t, "aria-valuemax": e, "aria-valuemin": r, "aria-valuenow": o, height: a === "S" ? 1 : 2, position: "relative", role: "progressbar", value: o, width: a === "S" ? "78px" : "102px", ...i });
|
|
15
|
+
export {
|
|
16
|
+
m as ProgressBar
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./ProgressBar.cjs");exports.ProgressBar=r.ProgressBar;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("../BaseRadio/BaseRadio.cjs"),s=require("../Flex/Flex.cjs"),a=require("../Typography/Typography.cjs"),i=({children:r,...t})=>e.jsxs(s.Flex,{alignItems:"center",as:"label",gap:2,children:[e.jsx(o.BaseRadio,{...t}),e.jsx(a.Typography,{textColor:"neutral800",children:r})]});exports.Radio=i;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsxs as t, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { BaseRadio as a } from "../BaseRadio/BaseRadio.js";
|
|
3
|
+
import { Flex as i } from "../Flex/Flex.js";
|
|
4
|
+
import { Typography as m } from "../Typography/Typography.js";
|
|
5
|
+
const x = ({ children: o, ...e }) => t(i, { alignItems: "center", as: "label", gap: 2, children: [r(a, { ...e }), r(m, { textColor: "neutral800", children: o })] });
|
|
6
|
+
export {
|
|
7
|
+
x as Radio
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./Radio.cjs"),e=require("../BaseRadio/RadioGroup.cjs");exports.Radio=o.Radio;exports.RadioGroup=e.RadioGroup;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react/jsx-runtime"),l=require("react"),F=require("./RawTableContext.cjs"),s=require("../helpers/getFocusableNodes.cjs"),d=require("../helpers/keyboardKeys.cjs"),v=require("../Box/Box.cjs"),w=n=>g.jsx(y,{...n,as:"th"}),y=({coords:n={col:0,row:0},as:h="td",...x})=>{const a=l.useRef(null),{rowIndex:T,colIndex:E,setTableValues:N}=F.useTable(),[c,f]=l.useState(!1),K=e=>{const t=s.getFocusableNodes(a.current,!0);if(t.length===0||t.length===1&&s.getFocusableNodesWithKeyboardNav(t).length===0)return;if(t.length>1&&!t.find(u=>u.tagName!=="BUTTON")){e.preventDefault();const u=t.findIndex(r=>r===document.activeElement);if(e.key===d.KeyboardKeys.RIGHT){const r=t[u+1];r&&(e.stopPropagation(),r.focus())}else if(e.key===d.KeyboardKeys.LEFT){const r=t[u-1];r&&(e.stopPropagation(),r.focus())}return}const o=e.key===d.KeyboardKeys.ENTER;if(o&&!c)f(!0);else if((e.key===d.KeyboardKeys.ESCAPE||o)&&c){if(o&&document.activeElement?.tagName==="A")return;f(!1),a.current.focus()}else c&&e.stopPropagation()},i=T===n.row-1&&E===n.col-1;l.useLayoutEffect(()=>{const e=s.getFocusableNodes(a.current,!0);e.length===0||e.length===1&&s.getFocusableNodesWithKeyboardNav(e).length!==0||e.length>1&&e.find(t=>t.tagName!=="BUTTON")?(a.current.setAttribute("tabIndex",!c&&i?"0":"-1"),e.forEach((t,o)=>{t.setAttribute("tabIndex",c?"0":"-1"),c&&o===0&&t.focus()})):e.forEach(t=>{t.setAttribute("tabIndex",i?"0":"-1")})},[c,i]);const b=l.useCallback(()=>{const e=s.getFocusableNodes(a.current,!0);e.length>=1&&(s.getFocusableNodesWithKeyboardNav(e).length!==0||!e.find(t=>t.tagName!=="BUTTON"))&&f(!0),N({rowIndex:n.row-1,colIndex:n.col-1})},[n,N]);return l.useLayoutEffect(()=>{const e=a.current;return s.getFocusableNodes(e,!0).forEach(o=>{o.addEventListener("focus",b)}),()=>{s.getFocusableNodes(e,!0).forEach(u=>{u.removeEventListener("focus",b)})}},[b]),g.jsx(v.Box,{role:"gridcell",as:h,ref:a,onKeyDown:K,...x})};exports.RawTd=y;exports.RawTh=w;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { jsx as g } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as y, useState as I, useLayoutEffect as N, useCallback as v } from "react";
|
|
3
|
+
import { useTable as w } from "./RawTableContext.js";
|
|
4
|
+
import { getFocusableNodes as u, getFocusableNodesWithKeyboardNav as b } from "../helpers/getFocusableNodes.js";
|
|
5
|
+
import { KeyboardKeys as f } from "../helpers/keyboardKeys.js";
|
|
6
|
+
import { Box as A } from "../Box/Box.js";
|
|
7
|
+
const D = (n) => g(B, { ...n, as: "th" }), B = ({ coords: n = { col: 0, row: 0 }, as: h = "td", ...E }) => {
|
|
8
|
+
const s = y(null), { rowIndex: p, colIndex: x, setTableValues: m } = w(), [r, l] = I(!1), T = (e) => {
|
|
9
|
+
const t = u(s.current, !0);
|
|
10
|
+
if (t.length === 0 || t.length === 1 && b(t).length === 0)
|
|
11
|
+
return;
|
|
12
|
+
if (t.length > 1 && !t.find((a) => a.tagName !== "BUTTON")) {
|
|
13
|
+
e.preventDefault();
|
|
14
|
+
const a = t.findIndex((c) => c === document.activeElement);
|
|
15
|
+
if (e.key === f.RIGHT) {
|
|
16
|
+
const c = t[a + 1];
|
|
17
|
+
c && (e.stopPropagation(), c.focus());
|
|
18
|
+
} else if (e.key === f.LEFT) {
|
|
19
|
+
const c = t[a - 1];
|
|
20
|
+
c && (e.stopPropagation(), c.focus());
|
|
21
|
+
}
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const o = e.key === f.ENTER;
|
|
25
|
+
if (o && !r)
|
|
26
|
+
l(!0);
|
|
27
|
+
else if ((e.key === f.ESCAPE || o) && r) {
|
|
28
|
+
if (o && document.activeElement?.tagName === "A")
|
|
29
|
+
return;
|
|
30
|
+
l(!1), s.current.focus();
|
|
31
|
+
} else
|
|
32
|
+
r && e.stopPropagation();
|
|
33
|
+
}, i = p === n.row - 1 && x === n.col - 1;
|
|
34
|
+
N(() => {
|
|
35
|
+
const e = u(s.current, !0);
|
|
36
|
+
e.length === 0 || e.length === 1 && b(e).length !== 0 || e.length > 1 && e.find((t) => t.tagName !== "BUTTON") ? (s.current.setAttribute("tabIndex", !r && i ? "0" : "-1"), e.forEach((t, o) => {
|
|
37
|
+
t.setAttribute("tabIndex", r ? "0" : "-1"), r && o === 0 && t.focus();
|
|
38
|
+
})) : e.forEach((t) => {
|
|
39
|
+
t.setAttribute("tabIndex", i ? "0" : "-1");
|
|
40
|
+
});
|
|
41
|
+
}, [r, i]);
|
|
42
|
+
const d = v(() => {
|
|
43
|
+
const e = u(s.current, !0);
|
|
44
|
+
e.length >= 1 && (b(e).length !== 0 || !e.find((t) => t.tagName !== "BUTTON")) && l(!0), m({ rowIndex: n.row - 1, colIndex: n.col - 1 });
|
|
45
|
+
}, [n, m]);
|
|
46
|
+
return N(() => {
|
|
47
|
+
const e = s.current;
|
|
48
|
+
return u(e, !0).forEach((o) => {
|
|
49
|
+
o.addEventListener("focus", d);
|
|
50
|
+
}), () => {
|
|
51
|
+
u(e, !0).forEach((a) => {
|
|
52
|
+
a.removeEventListener("focus", d);
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
}, [d]), g(A, { role: "gridcell", as: h, ref: s, onKeyDown: T, ...E });
|
|
56
|
+
};
|
|
57
|
+
export {
|
|
58
|
+
B as RawTd,
|
|
59
|
+
D as RawTh
|
|
60
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),r=require("react"),P=require("./focusFocusable.cjs"),R=require("./RawTableContext.cjs"),t=require("../helpers/keyboardKeys.cjs"),q=({colCount:l,rowCount:c,jumpStep:b=3,initialCol:D=0,initialRow:k=0,...d})=>{const f=r.useRef(null),n=r.useRef(!1),[o,s]=r.useState(k),[y,u]=r.useState(D),K=r.useCallback(({colIndex:a,rowIndex:e})=>{u(a),s(e)},[]);r.useEffect(()=>{n.current&&P.focusFocusable(f.current),n.current||(n.current=!0)},[y,o]);const T=a=>{switch(a.key){case t.KeyboardKeys.RIGHT:{a.preventDefault(),u(e=>e<l-1?e+1:e);break}case t.KeyboardKeys.LEFT:{a.preventDefault(),u(e=>e>0?e-1:e);break}case t.KeyboardKeys.UP:{a.preventDefault(),s(e=>e>0?e-1:e);break}case t.KeyboardKeys.DOWN:{a.preventDefault(),s(e=>e<c-1?e+1:e);break}case t.KeyboardKeys.HOME:{a.preventDefault(),a.ctrlKey&&s(0),u(0);break}case t.KeyboardKeys.END:{a.preventDefault(),a.ctrlKey&&s(c-1),u(l-1);break}case t.KeyboardKeys.PAGE_DOWN:{a.preventDefault(),s(e=>e+b<c?e+b:c-1);break}case t.KeyboardKeys.PAGE_UP:{a.preventDefault(),s(e=>e-b>0?e-b:0);break}}},E=r.useMemo(()=>({rowIndex:o,colIndex:y,setTableValues:K}),[y,o,K]);return i.jsx(R.RawTableContext.Provider,{value:E,children:i.jsx("table",{role:"grid",ref:f,"aria-rowcount":c,"aria-colcount":l,onKeyDown:T,...d})})};exports.RawTable=q;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsx as D } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as k, useState as m, useCallback as h, useEffect as G, useMemo as N } from "react";
|
|
3
|
+
import { focusFocusable as O } from "./focusFocusable.js";
|
|
4
|
+
import { RawTableContext as A } from "./RawTableContext.js";
|
|
5
|
+
import { KeyboardKeys as a } from "../helpers/keyboardKeys.js";
|
|
6
|
+
const _ = ({ colCount: l, rowCount: c, jumpStep: f = 3, initialCol: y = 0, initialRow: E = 0, ...K }) => {
|
|
7
|
+
const b = k(null), n = k(!1), [u, r] = m(E), [o, s] = m(y), i = h(({ colIndex: t, rowIndex: e }) => {
|
|
8
|
+
s(t), r(e);
|
|
9
|
+
}, []);
|
|
10
|
+
G(() => {
|
|
11
|
+
n.current && O(b.current), n.current || (n.current = !0);
|
|
12
|
+
}, [o, u]);
|
|
13
|
+
const P = (t) => {
|
|
14
|
+
switch (t.key) {
|
|
15
|
+
case a.RIGHT: {
|
|
16
|
+
t.preventDefault(), s((e) => e < l - 1 ? e + 1 : e);
|
|
17
|
+
break;
|
|
18
|
+
}
|
|
19
|
+
case a.LEFT: {
|
|
20
|
+
t.preventDefault(), s((e) => e > 0 ? e - 1 : e);
|
|
21
|
+
break;
|
|
22
|
+
}
|
|
23
|
+
case a.UP: {
|
|
24
|
+
t.preventDefault(), r((e) => e > 0 ? e - 1 : e);
|
|
25
|
+
break;
|
|
26
|
+
}
|
|
27
|
+
case a.DOWN: {
|
|
28
|
+
t.preventDefault(), r((e) => e < c - 1 ? e + 1 : e);
|
|
29
|
+
break;
|
|
30
|
+
}
|
|
31
|
+
case a.HOME: {
|
|
32
|
+
t.preventDefault(), t.ctrlKey && r(0), s(0);
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
case a.END: {
|
|
36
|
+
t.preventDefault(), t.ctrlKey && r(c - 1), s(l - 1);
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
case a.PAGE_DOWN: {
|
|
40
|
+
t.preventDefault(), r((e) => e + f < c ? e + f : c - 1);
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
case a.PAGE_UP: {
|
|
44
|
+
t.preventDefault(), r((e) => e - f > 0 ? e - f : 0);
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}, T = N(() => ({ rowIndex: u, colIndex: o, setTableValues: i }), [o, u, i]);
|
|
49
|
+
return D(A.Provider, { value: T, children: D("table", { role: "grid", ref: b, "aria-rowcount": c, "aria-colcount": l, onKeyDown: P, ...K }) });
|
|
50
|
+
};
|
|
51
|
+
export {
|
|
52
|
+
_ as RawTable
|
|
53
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=e.createContext({rowIndex:0,colIndex:0,setTableValues(){throw new Error("setTableValues must be initialized via the RawTableContext.Provider")}}),a=()=>e.useContext(t);exports.RawTableContext=t;exports.useTable=a;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createContext as e, useContext as t } from "react";
|
|
2
|
+
const o = e({
|
|
3
|
+
rowIndex: 0,
|
|
4
|
+
colIndex: 0,
|
|
5
|
+
setTableValues() {
|
|
6
|
+
throw new Error("setTableValues must be initialized via the RawTableContext.Provider");
|
|
7
|
+
}
|
|
8
|
+
}), r = () => t(o);
|
|
9
|
+
export {
|
|
10
|
+
o as RawTableContext,
|
|
11
|
+
r as useTable
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),r=require("react"),l=({children:t,...n})=>{const o=r.Children.toArray(t).map((e,i)=>r.isValidElement(e)?r.cloneElement(e,{"aria-rowindex":i+2}):e);return a.jsx("tbody",{...n,children:o})};exports.RawTbody=l;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { Children as m, isValidElement as a, cloneElement as l } from "react";
|
|
3
|
+
const s = ({ children: e, ...n }) => {
|
|
4
|
+
const o = m.toArray(e).map((r, t) => a(r) ? l(r, { "aria-rowindex": t + 2 }) : r);
|
|
5
|
+
return i("tbody", { ...n, children: o });
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
s as RawTbody
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),r=require("react"),o=({children:t,...n})=>{const a=r.Children.toArray(t).map(e=>r.isValidElement(e)?r.cloneElement(e,{"aria-rowindex":1}):e);return i.jsx("thead",{...n,children:a})};exports.RawThead=o;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { Children as a, isValidElement as i, cloneElement as m } from "react";
|
|
3
|
+
const p = ({ children: e, ...n }) => {
|
|
4
|
+
const t = a.toArray(e).map((r) => i(r) ? m(r, { "aria-rowindex": 1 }) : r);
|
|
5
|
+
return o("thead", { ...n, children: t });
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
p as RawThead
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),r=require("react"),c=require("../Box/Box.cjs"),l=({children:o,...t})=>{const i=r.Children.toArray(o).map((e,n)=>r.isValidElement(e)?r.cloneElement(e,{"aria-colindex":n+1,coords:{col:n+1,row:t["aria-rowindex"]}}):e);return a.jsx(c.Box,{as:"tr",...t,children:i})};exports.RawTr=l;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { Children as a, isValidElement as m, cloneElement as l } from "react";
|
|
3
|
+
import { Box as c } from "../Box/Box.js";
|
|
4
|
+
const x = ({ children: n, ...o }) => {
|
|
5
|
+
const t = a.toArray(n).map((r, e) => m(r) ? l(r, {
|
|
6
|
+
"aria-colindex": e + 1,
|
|
7
|
+
coords: { col: e + 1, row: o["aria-rowindex"] }
|
|
8
|
+
}) : r);
|
|
9
|
+
return i(c, { as: "tr", ...o, children: t });
|
|
10
|
+
};
|
|
11
|
+
export {
|
|
12
|
+
x as RawTr
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=o=>{const e=o.querySelector('[tabindex="0"]');e&&e.focus()};exports.focusFocusable=t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./RawTable.cjs"),a=require("./RawCell.cjs"),r=require("./RawThead.cjs"),w=require("./RawTbody.cjs"),R=require("./RawTr.cjs");exports.RawTable=e.RawTable;exports.RawTd=a.RawTd;exports.RawTh=a.RawTh;exports.RawThead=r.RawThead;exports.RawTbody=w.RawTbody;exports.RawTr=R.RawTr;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { RawTable as a } from "./RawTable.js";
|
|
2
|
+
import { RawTd as w, RawTh as R } from "./RawCell.js";
|
|
3
|
+
import { RawThead as f } from "./RawThead.js";
|
|
4
|
+
import { RawTbody as p } from "./RawTbody.js";
|
|
5
|
+
import { RawTr as x } from "./RawTr.js";
|
|
6
|
+
export {
|
|
7
|
+
a as RawTable,
|
|
8
|
+
p as RawTbody,
|
|
9
|
+
w as RawTd,
|
|
10
|
+
R as RawTh,
|
|
11
|
+
f as RawThead,
|
|
12
|
+
x as RawTr
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),o=e=>r.jsx("form",{...e,role:"search"});exports.SearchForm=o;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),i=require("react"),l=require("@strapi/icons"),m=require("styled-components"),F=require("../hooks/useComposeRefs.cjs"),R=require("../themes/utils.cjs"),t=require("../Field/FieldInput.cjs"),S=require("../Field/FieldAction.cjs"),y=require("../Field/Field.cjs"),$=require("../VisuallyHidden/VisuallyHidden.cjs"),C=require("../Field/FieldLabel.cjs"),I=e=>e&&e.__esModule?e:{default:e},s=I(m),w=s.default(l.Cross)`
|
|
2
|
+
font-size: 0.5rem;
|
|
3
|
+
path {
|
|
4
|
+
fill: ${({theme:e})=>e.colors.neutral400};
|
|
5
|
+
}
|
|
6
|
+
`,c=s.default(l.Search)`
|
|
7
|
+
font-size: 0.8rem;
|
|
8
|
+
path {
|
|
9
|
+
fill: ${({theme:e})=>e.colors.neutral800};
|
|
10
|
+
}
|
|
11
|
+
`,_=s.default.div`
|
|
12
|
+
border-radius: ${({theme:e})=>e.borderRadius};
|
|
13
|
+
box-shadow: ${({theme:e})=>e.shadows.filterShadow};
|
|
14
|
+
|
|
15
|
+
&:focus-within {
|
|
16
|
+
${c} {
|
|
17
|
+
path {
|
|
18
|
+
fill: ${({theme:e})=>e.colors.primary600};
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
${t.InputWrapper} {
|
|
24
|
+
border: 1px solid transparent;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
${R.inputFocusStyle(t.InputWrapper)}
|
|
28
|
+
`,g=i.forwardRef(({name:e,size:a="M",children:u,value:n="",onClear:d,clearLabel:f,...p},h)=>{const o=i.useRef(null),b=n.length>0,q=j=>{d(j),o.current.focus()},x=F.composeRefs(h,o);return r.jsx(_,{children:r.jsxs(y.Field,{name:e,children:[r.jsx($.VisuallyHidden,{children:r.jsx(C.FieldLabel,{children:u})}),r.jsx(t.FieldInput,{ref:x,value:n,startAction:r.jsx(c,{"aria-hidden":!0}),size:a,endAction:b?r.jsx(S.FieldAction,{label:f,onClick:q,children:r.jsx(w,{})}):void 0,...p})]})})});exports.Searchbar=g;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx as o, jsxs as $ } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as R, useRef as S } from "react";
|
|
3
|
+
import { Cross as w, Search as x } from "@strapi/icons";
|
|
4
|
+
import e from "styled-components";
|
|
5
|
+
import { composeRefs as C } from "../hooks/useComposeRefs.js";
|
|
6
|
+
import { inputFocusStyle as F } from "../themes/utils.js";
|
|
7
|
+
import { InputWrapper as n, FieldInput as y } from "../Field/FieldInput.js";
|
|
8
|
+
import { FieldAction as I } from "../Field/FieldAction.js";
|
|
9
|
+
import { Field as z } from "../Field/Field.js";
|
|
10
|
+
import { VisuallyHidden as A } from "../VisuallyHidden/VisuallyHidden.js";
|
|
11
|
+
import { FieldLabel as g } from "../Field/FieldLabel.js";
|
|
12
|
+
const j = e(w)`
|
|
13
|
+
font-size: 0.5rem;
|
|
14
|
+
path {
|
|
15
|
+
fill: ${({ theme: r }) => r.colors.neutral400};
|
|
16
|
+
}
|
|
17
|
+
`, l = e(x)`
|
|
18
|
+
font-size: 0.8rem;
|
|
19
|
+
path {
|
|
20
|
+
fill: ${({ theme: r }) => r.colors.neutral800};
|
|
21
|
+
}
|
|
22
|
+
`, W = e.div`
|
|
23
|
+
border-radius: ${({ theme: r }) => r.borderRadius};
|
|
24
|
+
box-shadow: ${({ theme: r }) => r.shadows.filterShadow};
|
|
25
|
+
|
|
26
|
+
&:focus-within {
|
|
27
|
+
${l} {
|
|
28
|
+
path {
|
|
29
|
+
fill: ${({ theme: r }) => r.colors.primary600};
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
${n} {
|
|
35
|
+
border: 1px solid transparent;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
${F(n)}
|
|
39
|
+
`, J = R(({ name: r, size: s = "M", children: a, value: t = "", onClear: c, clearLabel: d, ...m }, p) => {
|
|
40
|
+
const i = S(null), f = t.length > 0, h = (b) => {
|
|
41
|
+
c(b), i.current.focus();
|
|
42
|
+
}, u = C(p, i);
|
|
43
|
+
return o(W, { children: $(z, { name: r, children: [o(A, { children: o(g, { children: a }) }), o(y, { ref: u, value: t, startAction: o(l, { "aria-hidden": !0 }), size: s, endAction: f ? o(I, { label: d, onClick: h, children: o(j, {}) }) : void 0, ...m })] }) });
|
|
44
|
+
});
|
|
45
|
+
export {
|
|
46
|
+
J as Searchbar
|
|
47
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./Searchbar.cjs"),e=require("./SearchForm.cjs");exports.Searchbar=r.Searchbar;exports.SearchForm=e.SearchForm;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),Y=require("react"),J=require("@strapi/icons"),I=require("styled-components"),o=require("./SelectParts.cjs"),K=require("../BaseCheckbox/assets/checkmark.svg.cjs"),Q=require("../helpers/strings.cjs"),w=require("../hooks/useId.cjs"),U=require("../hooks/useIntersection.cjs"),Z=require("../Tag/Tag.cjs"),j=require("../Box/Box.cjs"),C=require("../Typography/Typography.cjs"),ee=require("../Field/Field.cjs"),te=require("../Flex/Flex.cjs"),re=require("../Field/FieldLabel.cjs"),ne=require("../Field/FieldHint.cjs"),ie=require("../Field/FieldError.cjs"),oe=e=>e&&e.__esModule?e:{default:e};function le(e){if(e&&e.__esModule)return e;const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const l=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(i,r,l.get?l:{enumerable:!0,get:()=>e[r]})}}return i.default=e,Object.freeze(i)}const a=le(Y),se=oe(I),ce=({children:e,clearLabel:i="Clear",customizeContent:r,disabled:l,error:s,hint:d,id:u,label:p,labelAction:T,onChange:f,onClear:M,onReachEnd:b,placeholder:F,required:y,selectButtonTitle:ue,startIcon:_,size:B="M",value:h,withTags:q,...L})=>{const m=a.useRef(null),[$,S]=a.useState(),[P,V]=a.useState(!1),x=w.useId(u),z=`${x}-hint`,E=`${x}-error`,G=n=>{f?f(n):S(n)},A=n=>()=>{const O=Array.isArray(h)?h.filter(g=>g!==n):($??[]).filter(g=>g!==n);f?f(O):S(O)},D=n=>{V(n)},k=a.useRef(null),H=()=>{k.current.focus()},W=w.useId(),v=`intersection-${Q.stripReactIdOfColon(W)}`,N=n=>{b&&b(n)};U.useIntersection(m,N,{selectorToWatch:`#${v}`,skipWhen:!P});const c=typeof h<"u"&&h!==null?h:$,X=n=>n&&typeof n=="object"&&n.value?t.jsx(Z.Tag,{tabIndex:-1,disabled:l,icon:t.jsx(J.Cross,{}),onClick:A(n.value),children:n.textValue},n.value):null;return t.jsx(ee.Field,{hint:d,error:s,id:x,required:y,children:t.jsxs(te.Flex,{direction:"column",alignItems:"stretch",gap:1,children:[t.jsx(re.FieldLabel,{onClick:H,action:T,children:p}),t.jsxs(o.Root,{onOpenChange:D,disabled:l,required:y,onValueChange:G,value:c,...L,multi:!0,children:[t.jsx(o.Trigger,{ref:k,"aria-label":p,"aria-describedby":`${z} ${E}`,id:x,startIcon:_,size:B,hasError:!!s,disabled:l,clearLabel:i,onClear:c?.length?M:void 0,paddingLeft:q&&c?.length?1:3,children:t.jsx(o.Value,{placeholder:F,textColor:c?.length?"neutral800":"neutral600",children:c?.length?q?X:r?r(c):void 0:void 0})}),t.jsx(o.Portal,{children:t.jsx(o.Content,{position:"popper",sideOffset:4,children:t.jsxs(o.Viewport,{ref:m,children:[e,t.jsx(j.Box,{id:v,width:"100%",height:"1px"})]})})})]}),t.jsx(ne.FieldHint,{}),t.jsx(ie.FieldError,{})]})})},ae=a.forwardRef(({value:e,children:i,startIcon:r,...l},s)=>t.jsxs(o.Item,{ref:s,value:e.toString(),...l,children:[r&&t.jsx(j.Box,{as:"span","aria-hidden":!0,children:r}),t.jsx(o.ItemIndicator,{children:({isSelected:d,isIntermediate:u})=>t.jsx(R,{hasRadius:!0,overflow:"hidden",position:"relative",$indeterminate:u,$selected:d,zIndex:1,height:"18px",width:"18px"})}),t.jsx(C.Typography,{textColor:"neutral800",children:t.jsx(o.ItemText,{children:i})})]})),R=se.default(j.Box)`
|
|
2
|
+
border: 1px solid
|
|
3
|
+
${({theme:e,$selected:i,$indeterminate:r})=>i||r?e.colors.primary600:e.colors.neutral300};
|
|
4
|
+
background-color: ${({theme:e,$selected:i,$indeterminate:r})=>i||r?e.colors.primary600:e.colors.neutral0};
|
|
5
|
+
|
|
6
|
+
${({theme:e,$indeterminate:i})=>i&&I.css`
|
|
7
|
+
&::after {
|
|
8
|
+
content: '';
|
|
9
|
+
display: block;
|
|
10
|
+
position: relative;
|
|
11
|
+
color: white;
|
|
12
|
+
height: 2px;
|
|
13
|
+
width: 10px;
|
|
14
|
+
background-color: ${e.colors.neutral0};
|
|
15
|
+
left: 50%;
|
|
16
|
+
top: 50%;
|
|
17
|
+
transform: translateX(-50%) translateY(-50%);
|
|
18
|
+
}
|
|
19
|
+
`}
|
|
20
|
+
|
|
21
|
+
${({$selected:e})=>e&&I.css`
|
|
22
|
+
&::after {
|
|
23
|
+
content: '';
|
|
24
|
+
background: url(${K}) no-repeat no-repeat center center;
|
|
25
|
+
width: 100%;
|
|
26
|
+
height: 100%;
|
|
27
|
+
position: absolute;
|
|
28
|
+
}
|
|
29
|
+
`}
|
|
30
|
+
`,de=a.forwardRef(({children:e,label:i,startIcon:r,values:l=[],...s},d)=>t.jsxs(o.Group,{ref:d,children:[t.jsxs(o.Item,{value:l,...s,children:[r&&t.jsx(j.Box,{as:"span","aria-hidden":!0,children:r}),t.jsx(o.ItemIndicator,{children:({isSelected:u,isIntermediate:p})=>t.jsx(R,{hasRadius:!0,overflow:"hidden",position:"relative",$indeterminate:p,$selected:u,zIndex:1,height:"18px",width:"18px"})}),t.jsx(C.Typography,{textColor:"neutral800",children:i})]}),e]}));exports.MultiSelect=ce;exports.MultiSelectGroup=de;exports.MultiSelectOption=ae;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { jsxs as a, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import * as d from "react";
|
|
3
|
+
import { Cross as K } from "@strapi/icons";
|
|
4
|
+
import N, { css as T } from "styled-components";
|
|
5
|
+
import { Item as S, ItemIndicator as F, ItemText as Q, Group as U, Root as Z, Trigger as ee, Value as re, Portal as te, Content as ne, Viewport as oe } from "./SelectParts.js";
|
|
6
|
+
import ie from "../BaseCheckbox/assets/checkmark.svg.js";
|
|
7
|
+
import { stripReactIdOfColon as le } from "../helpers/strings.js";
|
|
8
|
+
import { useId as O } from "../hooks/useId.js";
|
|
9
|
+
import { useIntersection as ce } from "../hooks/useIntersection.js";
|
|
10
|
+
import { Tag as de } from "../Tag/Tag.js";
|
|
11
|
+
import { Box as g } from "../Box/Box.js";
|
|
12
|
+
import { Typography as M } from "../Typography/Typography.js";
|
|
13
|
+
import { Field as ae } from "../Field/Field.js";
|
|
14
|
+
import { Flex as se } from "../Flex/Flex.js";
|
|
15
|
+
import { FieldLabel as he } from "../Field/FieldLabel.js";
|
|
16
|
+
import { FieldHint as ue } from "../Field/FieldHint.js";
|
|
17
|
+
import { FieldError as pe } from "../Field/FieldError.js";
|
|
18
|
+
const Be = ({ children: t, clearLabel: o = "Clear", customizeContent: n, disabled: i, error: l, hint: s, id: h, label: p, labelAction: L, onChange: f, onClear: V, onReachEnd: I, placeholder: j, required: $, selectButtonTitle: fe, startIcon: E, size: z = "M", value: u, withTags: b, ...A }) => {
|
|
19
|
+
const k = d.useRef(null), [C, v] = d.useState(), [G, W] = d.useState(!1), m = O(h), q = `${m}-hint`, H = `${m}-error`, P = (r) => {
|
|
20
|
+
f ? f(r) : v(r);
|
|
21
|
+
}, X = (r) => () => {
|
|
22
|
+
const y = Array.isArray(u) ? u.filter((x) => x !== r) : (C ?? []).filter((x) => x !== r);
|
|
23
|
+
f ? f(y) : v(y);
|
|
24
|
+
}, Y = (r) => {
|
|
25
|
+
W(r);
|
|
26
|
+
}, w = d.useRef(null), _ = () => {
|
|
27
|
+
w.current.focus();
|
|
28
|
+
}, D = O(), R = `intersection-${le(D)}`;
|
|
29
|
+
ce(k, (r) => {
|
|
30
|
+
I && I(r);
|
|
31
|
+
}, {
|
|
32
|
+
selectorToWatch: `#${R}`,
|
|
33
|
+
/**
|
|
34
|
+
* We need to know when the select is open because only then will viewportRef
|
|
35
|
+
* not be null. Because it uses a portal that (sensibly) is not mounted 24/7.
|
|
36
|
+
*/
|
|
37
|
+
skipWhen: !G
|
|
38
|
+
});
|
|
39
|
+
const c = typeof u < "u" && u !== null ? u : C, J = (r) => r && typeof r == "object" && r.value ? e(de, { tabIndex: -1, disabled: i, icon: e(K, {}), onClick: X(r.value), children: r.textValue }, r.value) : null;
|
|
40
|
+
return e(ae, { hint: s, error: l, id: m, required: $, children: a(se, { direction: "column", alignItems: "stretch", gap: 1, children: [e(he, { onClick: _, action: L, children: p }), a(Z, { onOpenChange: Y, disabled: i, required: $, onValueChange: P, value: c, ...A, multi: !0, children: [e(ee, { ref: w, "aria-label": p, "aria-describedby": `${q} ${H}`, id: m, startIcon: E, size: z, hasError: !!l, disabled: i, clearLabel: o, onClear: c?.length ? V : void 0, paddingLeft: b && c?.length ? 1 : 3, children: e(re, { placeholder: j, textColor: c?.length ? "neutral800" : "neutral600", children: c?.length ? b ? J : n ? n(c) : void 0 : void 0 }) }), e(te, { children: e(ne, { position: "popper", sideOffset: 4, children: a(oe, { ref: k, children: [t, e(g, { id: R, width: "100%", height: "1px" })] }) }) })] }), e(ue, {}), e(pe, {})] }) });
|
|
41
|
+
}, Le = d.forwardRef(({ value: t, children: o, startIcon: n, ...i }, l) => a(S, { ref: l, value: t.toString(), ...i, children: [n && e(g, { as: "span", "aria-hidden": !0, children: n }), e(F, { children: ({ isSelected: s, isIntermediate: h }) => e(B, { hasRadius: !0, overflow: "hidden", position: "relative", $indeterminate: h, $selected: s, zIndex: 1, height: "18px", width: "18px" }) }), e(M, { textColor: "neutral800", children: e(Q, { children: o }) })] })), B = N(g)`
|
|
42
|
+
border: 1px solid
|
|
43
|
+
${({ theme: t, $selected: o, $indeterminate: n }) => o || n ? t.colors.primary600 : t.colors.neutral300};
|
|
44
|
+
background-color: ${({ theme: t, $selected: o, $indeterminate: n }) => o || n ? t.colors.primary600 : t.colors.neutral0};
|
|
45
|
+
|
|
46
|
+
${({ theme: t, $indeterminate: o }) => o && T`
|
|
47
|
+
&::after {
|
|
48
|
+
content: '';
|
|
49
|
+
display: block;
|
|
50
|
+
position: relative;
|
|
51
|
+
color: white;
|
|
52
|
+
height: 2px;
|
|
53
|
+
width: 10px;
|
|
54
|
+
background-color: ${t.colors.neutral0};
|
|
55
|
+
left: 50%;
|
|
56
|
+
top: 50%;
|
|
57
|
+
transform: translateX(-50%) translateY(-50%);
|
|
58
|
+
}
|
|
59
|
+
`}
|
|
60
|
+
|
|
61
|
+
${({ $selected: t }) => t && T`
|
|
62
|
+
&::after {
|
|
63
|
+
content: '';
|
|
64
|
+
background: url(${ie}) no-repeat no-repeat center center;
|
|
65
|
+
width: 100%;
|
|
66
|
+
height: 100%;
|
|
67
|
+
position: absolute;
|
|
68
|
+
}
|
|
69
|
+
`}
|
|
70
|
+
`, Ve = d.forwardRef(({ children: t, label: o, startIcon: n, values: i = [], ...l }, s) => a(U, { ref: s, children: [a(S, { value: i, ...l, children: [n && e(g, { as: "span", "aria-hidden": !0, children: n }), e(F, { children: ({ isSelected: h, isIntermediate: p }) => e(B, { hasRadius: !0, overflow: "hidden", position: "relative", $indeterminate: p, $selected: h, zIndex: 1, height: "18px", width: "18px" }) }), e(M, { textColor: "neutral800", children: o })] }), t] }));
|
|
71
|
+
export {
|
|
72
|
+
Be as MultiSelect,
|
|
73
|
+
Ve as MultiSelectGroup,
|
|
74
|
+
Le as MultiSelectOption
|
|
75
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),r=require("styled-components"),i=require("./MultiSelect.cjs"),a=e=>e&&e.__esModule?e:{default:e},s=a(r),c=({options:e,...n})=>u.jsx(i.MultiSelect,{...n,children:e.map(l=>"children"in l?u.jsx(i.MultiSelectGroup,{label:l.label,values:l.children.map(t=>t.value.toString()),children:l.children.map(t=>u.jsx(d,{value:t.value,children:t.label},t.value))},l.label):u.jsx(i.MultiSelectOption,{value:l.value,children:l.label},l.value))}),d=s.default(i.MultiSelectOption)`
|
|
2
|
+
padding-left: ${({theme:e})=>e.spaces[7]};
|
|
3
|
+
`;exports.MultiSelectNested=c;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import n from "styled-components";
|
|
3
|
+
import { MultiSelectOption as i, MultiSelect as u, MultiSelectGroup as c } from "./MultiSelect.js";
|
|
4
|
+
const o = ({ options: a, ...t }) => r(u, { ...t, children: a.map((e) => "children" in e ? r(c, { label: e.label, values: e.children.map((l) => l.value.toString()), children: e.children.map((l) => r(d, { value: l.value, children: l.label }, l.value)) }, e.label) : r(i, { value: e.value, children: e.label }, e.value)) }), d = n(i)`
|
|
5
|
+
padding-left: ${({ theme: a }) => a.spaces[7]};
|
|
6
|
+
`;
|
|
7
|
+
export {
|
|
8
|
+
o as MultiSelectNested
|
|
9
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./MultiSelect.cjs");/**
|
|
2
|
+
* @preserve
|
|
3
|
+
* @deprecated This component is only fit for the MultiSelect component.
|
|
4
|
+
* Therefore, you should import the MultiSelectGroup component instead.
|
|
5
|
+
*/const e=t.MultiSelectGroup;exports.OptGroup=e;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { MultiSelectGroup as o } from "./MultiSelect.js";
|
|
2
|
+
/**
|
|
3
|
+
* @preserve
|
|
4
|
+
* @deprecated This component is only fit for the MultiSelect component.
|
|
5
|
+
* Therefore, you should import the MultiSelectGroup component instead.
|
|
6
|
+
*/
|
|
7
|
+
const p = o;
|
|
8
|
+
export {
|
|
9
|
+
p as OptGroup
|
|
10
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),c=require("./MultiSelect.cjs"),o=require("./Select.cjs"),l=require("./SingleSelect.cjs");/**
|
|
2
|
+
* @preserve
|
|
3
|
+
* @deprecated You should import the specific type of option you want to render,
|
|
4
|
+
* e.g. `import { MultiSelectOption } from '@strapi/design-system';`
|
|
5
|
+
*/const u=({multi:n,...e})=>{const i=o.useSelectContext();return n||i.multi?t.jsx(c.MultiSelectOption,{...e}):t.jsx(l.SingleSelectOption,{...e})};exports.Option=u;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { MultiSelectOption as m } from "./MultiSelect.js";
|
|
3
|
+
import { useSelectContext as n } from "./Select.js";
|
|
4
|
+
import { SingleSelectOption as r } from "./SingleSelect.js";
|
|
5
|
+
/**
|
|
6
|
+
* @preserve
|
|
7
|
+
* @deprecated You should import the specific type of option you want to render,
|
|
8
|
+
* e.g. `import { MultiSelectOption } from '@strapi/design-system';`
|
|
9
|
+
*/
|
|
10
|
+
const u = ({ multi: e, ...t }) => {
|
|
11
|
+
const i = n();
|
|
12
|
+
return e || i.multi ? o(m, { ...t }) : o(r, { ...t });
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
u as Option
|
|
16
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),o=require("react"),r=require("./MultiSelect.cjs"),s=require("./SingleSelect.cjs");function a(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const u=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,u.get?u:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const l=a(o),i=l.createContext({multi:!1}),S=()=>l.useContext(i);/**
|
|
2
|
+
* @preserve
|
|
3
|
+
* @deprecated You should import the specific type of select you want to render
|
|
4
|
+
*
|
|
5
|
+
* e.g. `import { MultiSelect } from '@strapi/design-system';`
|
|
6
|
+
*/const g=e=>{const t=l.useMemo(()=>({multi:!!(e.multi||e.withTags)}),[e.multi,e.withTags]);return c.jsx(i.Provider,{value:t,children:e.multi||e.withTags?c.jsx(r.MultiSelect,{...e}):c.jsx(s.SingleSelect,{...e})})};exports.Select=g;exports.useSelectContext=S;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import * as l from "react";
|
|
3
|
+
import { MultiSelect as m } from "./MultiSelect.js";
|
|
4
|
+
import { SingleSelect as c } from "./SingleSelect.js";
|
|
5
|
+
const i = l.createContext({ multi: !1 }), r = () => l.useContext(i);
|
|
6
|
+
/**
|
|
7
|
+
* @preserve
|
|
8
|
+
* @deprecated You should import the specific type of select you want to render
|
|
9
|
+
*
|
|
10
|
+
* e.g. `import { MultiSelect } from '@strapi/design-system';`
|
|
11
|
+
*/
|
|
12
|
+
const x = (t) => {
|
|
13
|
+
const o = l.useMemo(() => ({ multi: !!(t.multi || t.withTags) }), [t.multi, t.withTags]);
|
|
14
|
+
return e(i.Provider, { value: o, children: t.multi || t.withTags ? e(m, { ...t }) : e(c, { ...t }) });
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
x as Select,
|
|
18
|
+
r as useSelectContext
|
|
19
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("react/jsx-runtime"),A=require("react"),m=require("compute-scroll-into-view"),a=require("../helpers/keyboardKeys.cjs"),v=require("../Flex/Flex.cjs");function q(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const c=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,c.get?c:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const p=q(A),g={Keyboard:"down:keyboard",Mouse:"down:mouse"},K={Keyboard:"up:keyboard",Mouse:"up:mouse"};/**
|
|
2
|
+
* @preserve
|
|
3
|
+
* @deprecated This component will be removed in the next major release.
|
|
4
|
+
* If you need a custom listbox I would recommend opening a new issue.
|
|
5
|
+
*/const h=({labelledBy:e,onSelectItem:t,children:n,multi:c=!1,onEscape:r,expanded:d})=>{const o=k(d),S=i=>{switch(i.key){case a.KeyboardKeys.ESCAPE:{i.stopPropagation(),r();break}case a.KeyboardKeys.DOWN:{i.preventDefault();const s=y(o.current);if(!s)return;const u=s.nextSibling;if(u)l(o.current,u);else{const b=o.current.querySelectorAll('[role="option"]')[0];l(o.current,b)}break}case a.KeyboardKeys.UP:{i.preventDefault();const s=y(o.current);if(!s)return;const u=s.previousSibling;if(u)l(o.current,u);else{const f=o.current.querySelectorAll('[role="option"]'),b=f[f.length-1];l(o.current,b)}break}case a.KeyboardKeys.SPACE:case a.KeyboardKeys.ENTER:{i.preventDefault();const s=y(o.current);s.getAttribute("data-opt-group")?t(s.getAttribute("data-opt-group-children").split(","),s.getAttribute("data-opt-group")):t(s.getAttribute("data-strapi-value")),c||r();break}}};return O.jsx(v.Flex,{as:"ul",gap:1,direction:"column",alignItems:"stretch",role:"listbox","aria-labelledby":e,tabIndex:-1,ref:o,onKeyDown:S,onBlur:r,children:n})},l=(e,t)=>{e.setAttribute("aria-activedescendant",t.getAttribute("id")),e.querySelectorAll('[role="option"]').forEach(r=>r.classList.remove("is-focused")),t.classList.add("is-focused"),m.compute(t,{scrollMode:"if-needed",block:"nearest",inline:"nearest"}).forEach(({el:r,top:d,left:o})=>{r.scrollTop=d,r.scrollLeft=o})},k=e=>{const t=p.useRef(null);return p.useEffect(()=>{t.current.focus()},[]),p.useEffect(()=>{if(!t.current)return;const n=t.current.querySelector('[aria-selected="true"]'),c=t.current.querySelectorAll('[role="option"]');let r;n?r=n:e===K.Keyboard?r=c[c.length-1]:e===g.Keyboard&&(r=c[0]),r&&(e===K.Keyboard||e===g.Keyboard)&&l(t.current,r)},[]),t},y=e=>{const t=e.getAttribute("aria-activedescendant");return e.querySelector(`#${t}`)};exports.SelectList=h;
|