@strapi/design-system 1.7.0 → 1.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Accordion/Accordion.cjs +4 -4
- package/dist/Accordion/Accordion.js +13 -71
- package/dist/Accordion/AccordionContent.cjs +1 -1
- package/dist/Accordion/AccordionContent.js +3 -16
- package/dist/Accordion/AccordionContext.cjs +1 -1
- package/dist/Accordion/AccordionGroup.cjs +4 -4
- package/dist/Accordion/AccordionGroup.js +19 -89
- package/dist/Accordion/AccordionToggle.cjs +6 -6
- package/dist/Accordion/AccordionToggle.js +11 -101
- package/dist/Accordion/index.cjs +1 -1
- package/dist/Accordion/utils.cjs +1 -1
- package/dist/Alert/Alert.cjs +15 -15
- package/dist/Alert/Alert.js +8 -80
- package/dist/Alert/index.cjs +1 -1
- package/dist/Alert/utils.cjs +1 -1
- package/dist/Avatar/Avatar.cjs +5 -5
- package/dist/Avatar/Avatar.js +12 -56
- package/dist/Avatar/AvatarGroup.cjs +3 -3
- package/dist/Avatar/constants.cjs +1 -1
- package/dist/Avatar/index.cjs +1 -1
- package/dist/Badge/Badge.cjs +4 -4
- package/dist/Badge/Badge.js +4 -33
- package/dist/Badge/index.cjs +1 -1
- package/dist/BaseButton/BaseButton.cjs +3 -3
- package/dist/BaseButton/BaseButton.js +8 -32
- package/dist/BaseButton/index.cjs +1 -1
- package/dist/BaseCheckbox/BaseCheckbox.cjs +4 -4
- package/dist/BaseCheckbox/BaseCheckbox.js +19 -62
- package/dist/BaseCheckbox/index.cjs +1 -1
- package/dist/BaseCheckbox/utils.cjs +1 -1
- package/dist/BaseLink/BaseLink.cjs +1 -1
- package/dist/BaseLink/BaseLink.js +1 -17
- package/dist/BaseLink/index.cjs +1 -1
- package/dist/BaseRadio/BaseRadio.cjs +8 -8
- package/dist/BaseRadio/BaseRadio.js +12 -38
- package/dist/BaseRadio/RadioGroup.cjs +1 -1
- package/dist/BaseRadio/RadioGroup.js +3 -25
- package/dist/BaseRadio/context.cjs +1 -1
- package/dist/BaseRadio/index.cjs +1 -1
- package/dist/BaseRadio/utils.cjs +1 -1
- package/dist/Box/Box.cjs +1 -1
- package/dist/Box/Box.js +47 -173
- package/dist/Box/index.cjs +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.cjs +3 -3
- package/dist/Breadcrumbs/Breadcrumbs.js +10 -43
- package/dist/Breadcrumbs/index.cjs +1 -1
- package/dist/Button/Button.cjs +11 -11
- package/dist/Button/Button.js +7 -54
- package/dist/Button/constants.cjs +1 -1
- package/dist/Button/index.cjs +1 -1
- package/dist/Button/utils.cjs +1 -1
- package/dist/Card/Card.cjs +1 -1
- package/dist/Card/Card.js +5 -25
- package/dist/Card/CardAction.cjs +2 -2
- package/dist/Card/CardAsset.cjs +4 -4
- package/dist/Card/CardAsset.js +5 -25
- package/dist/Card/CardBadge.cjs +3 -3
- package/dist/Card/CardBadge.js +2 -8
- package/dist/Card/CardBody.cjs +1 -1
- package/dist/Card/CardBody.js +1 -10
- package/dist/Card/CardCheckbox.cjs +1 -1
- package/dist/Card/CardCheckbox.js +5 -10
- package/dist/Card/CardContent.cjs +2 -2
- package/dist/Card/CardContent.js +1 -7
- package/dist/Card/CardContext.cjs +1 -1
- package/dist/Card/CardContext.js +1 -3
- package/dist/Card/CardHeader.cjs +2 -2
- package/dist/Card/CardHeader.js +2 -8
- package/dist/Card/CardTimer.cjs +1 -1
- package/dist/Card/CardTimer.js +1 -19
- package/dist/Card/CardTitle.cjs +1 -1
- package/dist/Card/CardTitle.js +3 -17
- package/dist/Card/index.cjs +1 -1
- package/dist/CarouselInput/Carousel.cjs +6 -6
- package/dist/CarouselInput/Carousel.js +51 -42
- package/dist/CarouselInput/CarouselActions.cjs +1 -1
- package/dist/CarouselInput/CarouselActions.js +8 -7
- package/dist/CarouselInput/CarouselImage.cjs +3 -3
- package/dist/CarouselInput/CarouselImage.js +13 -12
- package/dist/CarouselInput/CarouselInput.cjs +1 -1
- package/dist/CarouselInput/CarouselInput.js +39 -36
- package/dist/CarouselInput/CarouselSlide.cjs +2 -2
- package/dist/CarouselInput/CarouselSlide.js +10 -9
- package/dist/CarouselInput/index.cjs +1 -1
- package/dist/Checkbox/Checkbox.cjs +3 -3
- package/dist/Checkbox/Checkbox.js +37 -32
- package/dist/Checkbox/index.cjs +1 -1
- package/dist/Combobox/Combobox.cjs +9 -9
- package/dist/Combobox/Combobox.js +52 -253
- package/dist/Combobox/ComboboxList.cjs +5 -1
- package/dist/Combobox/ComboboxList.js +6 -5
- package/dist/Combobox/ComboboxOption.cjs +1 -1
- package/dist/Combobox/index.cjs +1 -1
- package/dist/DatePicker/DatePicker.cjs +5 -5
- package/dist/DatePicker/DatePicker.js +38 -56
- package/dist/DatePicker/DatePickerCalendar.cjs +1 -1
- package/dist/DatePicker/DatePickerCalendar.js +20 -119
- package/dist/DatePicker/DatePickerTd.cjs +3 -3
- package/dist/DatePicker/DatePickerTd.js +13 -45
- package/dist/DatePicker/DatePickerTh.cjs +4 -4
- package/dist/DatePicker/DatePickerTh.js +9 -33
- package/dist/DatePicker/compareDates.cjs +1 -1
- package/dist/DatePicker/components.cjs +14 -8
- package/dist/DatePicker/components.js +17 -7
- package/dist/DatePicker/index.cjs +1 -1
- package/dist/DatePicker/utils/formatDate.cjs +1 -1
- package/dist/DatePicker/utils/generateWeeks.cjs +1 -1
- package/dist/DatePicker/utils/getDayOfWeek.cjs +1 -1
- package/dist/DatePicker/utils/getMonths.cjs +1 -1
- package/dist/DatePicker/utils/getYears.cjs +1 -1
- package/dist/DatePicker/utils/getYears.js +1 -1
- package/dist/DatePicker/utils/index.cjs +1 -1
- package/dist/DateTimePicker/DateTimePicker.cjs +1 -1
- package/dist/DateTimePicker/DateTimePicker.js +41 -92
- package/dist/DateTimePicker/index.cjs +1 -1
- package/dist/DateTimePicker/parseDate.cjs +1 -1
- package/dist/Dialog/Dialog.cjs +6 -6
- package/dist/Dialog/Dialog.js +41 -38
- package/dist/Dialog/DialogBody.cjs +2 -2
- package/dist/Dialog/DialogBody.js +19 -15
- package/dist/Dialog/DialogFooter.cjs +3 -3
- package/dist/Dialog/DialogFooter.js +10 -6
- package/dist/Dialog/index.cjs +1 -1
- package/dist/DismissibleLayer/index.cjs +1 -1
- package/dist/DismissibleLayer/index.js +3 -2
- package/dist/Divider/Divider.cjs +2 -2
- package/dist/Divider/Divider.js +11 -10
- package/dist/Divider/index.cjs +1 -1
- package/dist/EmptyStateLayout/EmptyStateLayout.cjs +3 -3
- package/dist/EmptyStateLayout/EmptyStateLayout.js +13 -8
- package/dist/EmptyStateLayout/index.cjs +1 -1
- package/dist/EmptyStateLayout/story-assets/Illo.cjs +1 -1
- package/dist/EmptyStateLayout/story-assets/Illo.js +71 -62
- package/dist/Field/Field.cjs +1 -1
- package/dist/Field/Field.js +5 -26
- package/dist/Field/FieldAction.cjs +2 -2
- package/dist/Field/FieldAction.js +5 -20
- package/dist/Field/FieldContext.cjs +1 -1
- package/dist/Field/FieldError.cjs +1 -1
- package/dist/Field/FieldError.js +2 -12
- package/dist/Field/FieldHint.cjs +1 -1
- package/dist/Field/FieldHint.js +2 -12
- package/dist/Field/FieldInput.cjs +7 -7
- package/dist/Field/FieldInput.js +19 -86
- package/dist/Field/FieldLabel.cjs +4 -4
- package/dist/Field/FieldLabel.js +7 -32
- package/dist/Field/index.cjs +1 -1
- package/dist/Flex/Flex.cjs +3 -3
- package/dist/Flex/Flex.js +10 -25
- package/dist/Flex/index.cjs +1 -1
- package/dist/FocusTrap/FocusTrap.cjs +1 -1
- package/dist/FocusTrap/FocusTrap.js +14 -22
- package/dist/FocusTrap/index.cjs +1 -1
- package/dist/Grid/Grid.cjs +3 -3
- package/dist/Grid/Grid.js +15 -14
- package/dist/Grid/GridContext.cjs +1 -1
- package/dist/Grid/GridItem.cjs +2 -2
- package/dist/Grid/GridItem.js +12 -11
- package/dist/Grid/index.cjs +1 -1
- package/dist/Icon/Icon.cjs +4 -4
- package/dist/Icon/Icon.js +6 -21
- package/dist/Icon/index.cjs +1 -1
- package/dist/IconButton/IconButton.cjs +4 -4
- package/dist/IconButton/IconButton.js +28 -81
- package/dist/IconButton/index.cjs +1 -1
- package/dist/JSONInput/JSONInput.cjs +1 -1
- package/dist/JSONInput/JSONInput.js +11 -56
- package/dist/JSONInput/JSONInputContainer.cjs +3 -3
- package/dist/JSONInput/JSONInputContainer.js +7 -14
- package/dist/JSONInput/index.cjs +1 -1
- package/dist/JSONInput/utils/decorationExtension.cjs +1 -1
- package/dist/JSONInput/utils/decorationExtension.js +3 -0
- package/dist/KeyboardNavigable/KeyboardNavigable.cjs +1 -1
- package/dist/KeyboardNavigable/KeyboardNavigable.js +32 -39
- package/dist/KeyboardNavigable/index.cjs +1 -1
- package/dist/Layout/ActionLayout.cjs +3 -3
- package/dist/Layout/ActionLayout.js +17 -13
- package/dist/Layout/ContentLayout.cjs +1 -1
- package/dist/Layout/ContentLayout.js +8 -7
- package/dist/Layout/GridLayout.cjs +3 -3
- package/dist/Layout/HeaderLayout.cjs +4 -4
- package/dist/Layout/HeaderLayout.js +83 -59
- package/dist/Layout/Layout.cjs +3 -3
- package/dist/Layout/Layout.js +14 -10
- package/dist/Layout/TwoColsLayout.cjs +1 -1
- package/dist/Layout/TwoColsLayout.js +12 -8
- package/dist/Layout/index.cjs +1 -1
- package/dist/Link/Link.cjs +5 -5
- package/dist/Link/Link.js +9 -53
- package/dist/Link/index.cjs +1 -1
- package/dist/LinkButton/LinkButton.cjs +7 -7
- package/dist/LinkButton/LinkButton.js +8 -51
- package/dist/LinkButton/index.cjs +1 -1
- package/dist/LiveRegions/LiveRegions.cjs +1 -1
- package/dist/LiveRegions/LiveRegions.js +1 -18
- package/dist/LiveRegions/constants.cjs +1 -1
- package/dist/LiveRegions/index.cjs +1 -1
- package/dist/LiveRegions/useNotifyAT.cjs +1 -1
- package/dist/Loader/Loader.cjs +5 -5
- package/dist/Loader/Loader.js +3 -22
- package/dist/Loader/index.cjs +1 -1
- package/dist/Main/Main.cjs +2 -2
- package/dist/Main/Main.js +7 -9
- package/dist/Main/SkipToContent.cjs +2 -2
- package/dist/Main/SkipToContent.js +10 -9
- package/dist/Main/index.cjs +1 -1
- package/dist/MainNav/MainNav.cjs +2 -2
- package/dist/MainNav/MainNav.js +16 -15
- package/dist/MainNav/MainNavContext.cjs +1 -1
- package/dist/MainNav/NavBrand.cjs +6 -6
- package/dist/MainNav/NavBrand.js +37 -21
- package/dist/MainNav/NavCondense.cjs +3 -3
- package/dist/MainNav/NavCondense.js +20 -16
- package/dist/MainNav/NavFooter.cjs +1 -1
- package/dist/MainNav/NavFooter.js +9 -8
- package/dist/MainNav/NavLink.cjs +10 -10
- package/dist/MainNav/NavLink.js +53 -43
- package/dist/MainNav/NavSection.cjs +1 -1
- package/dist/MainNav/NavSection.js +43 -33
- package/dist/MainNav/NavSections.cjs +2 -2
- package/dist/MainNav/NavSections.js +15 -14
- package/dist/MainNav/NavUser.cjs +3 -3
- package/dist/MainNav/NavUser.js +23 -20
- package/dist/MainNav/index.cjs +1 -1
- package/dist/ModalLayout/ModalBody.cjs +2 -2
- package/dist/ModalLayout/ModalBody.js +7 -6
- package/dist/ModalLayout/ModalContext.cjs +1 -1
- package/dist/ModalLayout/ModalFooter.cjs +3 -3
- package/dist/ModalLayout/ModalFooter.js +17 -13
- package/dist/ModalLayout/ModalHeader.cjs +2 -2
- package/dist/ModalLayout/ModalHeader.js +20 -16
- package/dist/ModalLayout/ModalLayout.cjs +4 -4
- package/dist/ModalLayout/ModalLayout.js +24 -23
- package/dist/ModalLayout/index.cjs +1 -1
- package/dist/NumberInput/NumberInput.cjs +6 -6
- package/dist/NumberInput/NumberInput.js +113 -106
- package/dist/NumberInput/index.cjs +1 -1
- package/dist/Pagination/Pagination.cjs +2 -2
- package/dist/Pagination/Pagination.js +16 -15
- package/dist/Pagination/PaginationContext.cjs +1 -1
- package/dist/Pagination/components.cjs +10 -10
- package/dist/Pagination/components.js +58 -47
- package/dist/Pagination/index.cjs +1 -1
- package/dist/Popover/Popover.cjs +3 -3
- package/dist/Popover/Popover.js +48 -100
- package/dist/Popover/index.cjs +1 -1
- package/dist/Portal/Portal.cjs +1 -1
- package/dist/Portal/Portal.js +7 -11
- package/dist/Portal/index.cjs +1 -1
- package/dist/ProgressBar/ProgressBar.cjs +2 -2
- package/dist/ProgressBar/ProgressBar.js +19 -18
- package/dist/ProgressBar/index.cjs +1 -1
- package/dist/Radio/Radio.cjs +2 -2
- package/dist/Radio/Radio.js +16 -12
- package/dist/Radio/index.cjs +1 -1
- package/dist/RawTable/RawCell.cjs +1 -1
- package/dist/RawTable/RawCell.js +6 -29
- package/dist/RawTable/RawTable.cjs +1 -1
- package/dist/RawTable/RawTable.js +4 -28
- package/dist/RawTable/RawTableContext.cjs +1 -1
- package/dist/RawTable/RawTbody.cjs +1 -1
- package/dist/RawTable/RawTbody.js +3 -11
- package/dist/RawTable/RawThead.cjs +1 -1
- package/dist/RawTable/RawThead.js +3 -11
- package/dist/RawTable/RawTr.cjs +1 -1
- package/dist/RawTable/RawTr.js +3 -13
- package/dist/RawTable/focusFocusable.cjs +1 -1
- package/dist/RawTable/index.cjs +1 -1
- package/dist/Searchbar/SearchForm.cjs +1 -1
- package/dist/Searchbar/SearchForm.js +3 -2
- package/dist/Searchbar/Searchbar.cjs +7 -7
- package/dist/Searchbar/Searchbar.js +51 -50
- package/dist/Searchbar/index.cjs +1 -1
- package/dist/Select/MultiSelect.cjs +7 -7
- package/dist/Select/MultiSelect.js +43 -206
- package/dist/Select/MultiSelectNested.cjs +3 -3
- package/dist/Select/MultiSelectNested.js +2 -20
- package/dist/Select/OptGroup.cjs +5 -1
- package/dist/Select/OptGroup.js +5 -0
- package/dist/Select/Option.cjs +5 -1
- package/dist/Select/Option.js +13 -11
- package/dist/Select/Select.cjs +6 -1
- package/dist/Select/Select.js +16 -8
- package/dist/Select/SelectList.cjs +5 -1
- package/dist/Select/SelectList.js +52 -72
- package/dist/Select/SelectParts.cjs +13 -13
- package/dist/Select/SelectParts.js +35 -153
- package/dist/Select/SingleSelect.cjs +1 -1
- package/dist/Select/SingleSelect.js +27 -117
- package/dist/Select/index.cjs +1 -1
- package/dist/SimpleMenu/SimpleMenu.cjs +11 -11
- package/dist/SimpleMenu/SimpleMenu.js +111 -92
- package/dist/SimpleMenu/index.cjs +1 -1
- package/dist/SimpleMenu/utils.cjs +1 -1
- package/dist/Stack/Stack.cjs +3 -3
- package/dist/Stack/Stack.js +7 -28
- package/dist/Stack/index.cjs +1 -1
- package/dist/Status/Status.cjs +7 -7
- package/dist/Status/Status.js +36 -24
- package/dist/Status/index.cjs +1 -1
- package/dist/SubNav/SubNav.cjs +5 -5
- package/dist/SubNav/SubNav.js +9 -9
- package/dist/SubNav/SubNavHeader.cjs +3 -3
- package/dist/SubNav/SubNavHeader.js +57 -47
- package/dist/SubNav/SubNavLink.cjs +5 -5
- package/dist/SubNav/SubNavLink.js +38 -32
- package/dist/SubNav/SubNavLinkSection.cjs +6 -6
- package/dist/SubNav/SubNavLinkSection.js +28 -21
- package/dist/SubNav/SubNavSection.cjs +3 -3
- package/dist/SubNav/SubNavSection.js +46 -39
- package/dist/SubNav/SubNavSectionLabel.cjs +4 -4
- package/dist/SubNav/SubNavSectionLabel.js +28 -25
- package/dist/SubNav/SubNavSections.cjs +1 -1
- package/dist/SubNav/SubNavSections.js +14 -13
- package/dist/SubNav/index.cjs +1 -1
- package/dist/Switch/Switch.cjs +5 -5
- package/dist/Switch/Switch.js +33 -26
- package/dist/Switch/index.cjs +1 -1
- package/dist/Table/Cell.cjs +3 -3
- package/dist/Table/Cell.js +17 -13
- package/dist/Table/TFooter.cjs +5 -5
- package/dist/Table/TFooter.js +23 -16
- package/dist/Table/Table.cjs +5 -5
- package/dist/Table/Table.js +28 -24
- package/dist/Table/Tbody.cjs +2 -2
- package/dist/Table/Tbody.js +7 -6
- package/dist/Table/Thead.cjs +2 -2
- package/dist/Table/Thead.js +8 -7
- package/dist/Table/Tr.cjs +2 -2
- package/dist/Table/Tr.js +6 -5
- package/dist/Table/index.cjs +1 -1
- package/dist/Tabs/TabGroup.cjs +1 -1
- package/dist/Tabs/TabGroup.js +26 -25
- package/dist/Tabs/TabPanels.cjs +1 -1
- package/dist/Tabs/TabPanels.js +15 -14
- package/dist/Tabs/Tabs.cjs +2 -2
- package/dist/Tabs/Tabs.js +64 -59
- package/dist/Tabs/TabsContext.cjs +1 -1
- package/dist/Tabs/components.cjs +12 -12
- package/dist/Tabs/index.cjs +1 -1
- package/dist/Tabs/useTabsFocus.cjs +1 -1
- package/dist/Tabs/useTabsFocus.js +1 -1
- package/dist/Tag/Tag.cjs +2 -2
- package/dist/Tag/Tag.js +6 -43
- package/dist/Tag/index.cjs +1 -1
- package/dist/TextButton/TextButton.cjs +6 -6
- package/dist/TextButton/TextButton.js +8 -37
- package/dist/TextButton/index.cjs +1 -1
- package/dist/TextInput/TextInput.cjs +1 -1
- package/dist/TextInput/TextInput.js +10 -41
- package/dist/TextInput/index.cjs +1 -1
- package/dist/Textarea/Textarea.cjs +2 -2
- package/dist/Textarea/Textarea.js +24 -21
- package/dist/Textarea/TextareaInput.cjs +4 -4
- package/dist/Textarea/TextareaInput.js +25 -30
- package/dist/Textarea/index.cjs +1 -1
- package/dist/ThemeProvider/ThemeProvider.cjs +1 -1
- package/dist/ThemeProvider/ThemeProvider.js +2 -10
- package/dist/ThemeProvider/hooks.cjs +1 -1
- package/dist/ThemeProvider/index.cjs +1 -1
- package/dist/TimePicker/TimePicker.cjs +3 -3
- package/dist/TimePicker/TimePicker.js +8 -30
- package/dist/TimePicker/index.cjs +1 -1
- package/dist/ToggleCheckbox/ToggleCheckbox.cjs +8 -8
- package/dist/ToggleCheckbox/ToggleCheckbox.js +111 -110
- package/dist/ToggleCheckbox/index.cjs +1 -1
- package/dist/ToggleInput/ToggleInput.cjs +3 -3
- package/dist/ToggleInput/ToggleInput.js +41 -35
- package/dist/ToggleInput/index.cjs +1 -1
- package/dist/Tooltip/Tooltip.cjs +2 -2
- package/dist/Tooltip/Tooltip.js +9 -52
- package/dist/Tooltip/hooks/useTooltipHandlers.cjs +1 -1
- package/dist/Tooltip/hooks/useTooltipLayout.cjs +1 -1
- package/dist/Tooltip/index.cjs +1 -1
- package/dist/Tooltip/utils/positionTooltip.cjs +1 -1
- package/dist/Typography/Typography.cjs +8 -8
- package/dist/Typography/Typography.js +6 -21
- package/dist/Typography/constants.cjs +1 -1
- package/dist/Typography/index.cjs +1 -1
- package/dist/Typography/utils.cjs +9 -9
- package/dist/VisuallyHidden/VisuallyHidden.cjs +2 -2
- package/dist/VisuallyHidden/index.cjs +1 -1
- package/dist/helpers/deprecations.cjs +1 -1
- package/dist/helpers/escapeSelector.cjs +1 -1
- package/dist/helpers/getDefaultLocale.cjs +1 -1
- package/dist/helpers/getFocusableNodes.cjs +1 -1
- package/dist/helpers/keyboardKeys.cjs +1 -1
- package/dist/helpers/objects.cjs +1 -1
- package/dist/helpers/setOpacity.cjs +1 -1
- package/dist/helpers/setTabIndexOnFirstItem.cjs +1 -1
- package/dist/helpers/theme.cjs +1 -1
- package/dist/helpers/useElementOnScreen.cjs +4 -1
- package/dist/helpers/useElementOnScreen.js +6 -1
- package/dist/helpers/useId.cjs +4 -1
- package/dist/helpers/useId.js +6 -1
- package/dist/helpers/useIntersection.cjs +4 -1
- package/dist/helpers/useIntersection.js +6 -1
- package/dist/helpers/useLockScroll.cjs +4 -1
- package/dist/helpers/useLockScroll.js +6 -1
- package/dist/helpers/usePrevious.cjs +4 -1
- package/dist/helpers/usePrevious.js +6 -1
- package/dist/helpers/useResizeObserver.cjs +4 -1
- package/dist/helpers/useResizeObserver.js +6 -1
- package/dist/hooks/useComposeRefs.cjs +1 -1
- package/dist/hooks/useControllableState.cjs +1 -1
- package/dist/hooks/useElementOnScreen.cjs +1 -1
- package/dist/hooks/useId.cjs +1 -1
- package/dist/hooks/useIntersection.cjs +1 -1
- package/dist/hooks/useLockScroll.cjs +1 -1
- package/dist/hooks/usePrevious.cjs +1 -1
- package/dist/hooks/useResizeObserver.cjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +209 -209
- package/dist/themes/common-theme.cjs +1 -1
- package/dist/themes/darkTheme/dark-colors.cjs +1 -1
- package/dist/themes/darkTheme/dark-shadows.cjs +1 -1
- package/dist/themes/darkTheme/index.cjs +1 -1
- package/dist/themes/extendTheme.cjs +2 -2
- package/dist/themes/index.cjs +1 -1
- package/dist/themes/lightTheme/index.cjs +1 -1
- package/dist/themes/lightTheme/light-colors.cjs +1 -1
- package/dist/themes/lightTheme/light-shadows.cjs +1 -1
- package/dist/themes/sizes.cjs +1 -1
- package/dist/themes/sizes.js +4 -4
- package/dist/themes/utils.cjs +5 -5
- package/dist/v2/Breadcrumbs/Breadcrumbs.cjs +3 -3
- package/dist/v2/Breadcrumbs/Breadcrumbs.js +19 -15
- package/dist/v2/Breadcrumbs/Crumb.cjs +1 -1
- package/dist/v2/Breadcrumbs/Crumb.js +13 -12
- package/dist/v2/Breadcrumbs/CrumbLink.cjs +2 -2
- package/dist/v2/Breadcrumbs/CrumbLink.js +5 -4
- package/dist/v2/Breadcrumbs/CrumbSimpleMenu.cjs +2 -2
- package/dist/v2/Breadcrumbs/CrumbSimpleMenu.js +16 -15
- package/dist/v2/Breadcrumbs/Divider.cjs +1 -1
- package/dist/v2/Breadcrumbs/Divider.js +6 -5
- package/dist/v2/Breadcrumbs/index.cjs +1 -1
- package/dist/v2/Link/Link.cjs +4 -4
- package/dist/v2/Link/Link.js +10 -39
- package/dist/v2/Link/index.cjs +1 -1
- package/dist/v2/LinkButton/LinkButton.cjs +7 -7
- package/dist/v2/LinkButton/LinkButton.js +11 -49
- package/dist/v2/LinkButton/index.cjs +1 -1
- package/dist/v2/MainNav/MainNav.cjs +2 -2
- package/dist/v2/MainNav/MainNav.js +16 -15
- package/dist/v2/MainNav/MainNavContext.cjs +1 -1
- package/dist/v2/MainNav/NavBrand.cjs +6 -6
- package/dist/v2/MainNav/NavBrand.js +38 -22
- package/dist/v2/MainNav/NavCondense.cjs +3 -3
- package/dist/v2/MainNav/NavCondense.js +20 -16
- package/dist/v2/MainNav/NavFooter.cjs +1 -1
- package/dist/v2/MainNav/NavFooter.js +9 -8
- package/dist/v2/MainNav/NavLink.cjs +10 -10
- package/dist/v2/MainNav/NavLink.js +55 -45
- package/dist/v2/MainNav/NavSection.cjs +1 -1
- package/dist/v2/MainNav/NavSection.js +43 -33
- package/dist/v2/MainNav/NavSections.cjs +2 -2
- package/dist/v2/MainNav/NavSections.js +15 -14
- package/dist/v2/MainNav/NavUser.cjs +3 -3
- package/dist/v2/MainNav/NavUser.js +22 -19
- package/dist/v2/MainNav/index.cjs +1 -1
- package/dist/v2/Pagination/Pagination.cjs +2 -2
- package/dist/v2/Pagination/Pagination.js +16 -15
- package/dist/v2/Pagination/PaginationContext.cjs +1 -1
- package/dist/v2/Pagination/components.cjs +10 -10
- package/dist/v2/Pagination/components.js +50 -37
- package/dist/v2/Pagination/index.cjs +1 -1
- package/dist/v2/SimpleMenu/Menu.cjs +13 -13
- package/dist/v2/SimpleMenu/Menu.js +15 -155
- package/dist/v2/SimpleMenu/SimpleMenu.cjs +1 -1
- package/dist/v2/SimpleMenu/SimpleMenu.js +17 -31
- package/dist/v2/SimpleMenu/index.cjs +1 -1
- package/dist/v2/SubNav/SubNav.cjs +5 -5
- package/dist/v2/SubNav/SubNav.js +9 -9
- package/dist/v2/SubNav/SubNavHeader.cjs +3 -3
- package/dist/v2/SubNav/SubNavHeader.js +57 -47
- package/dist/v2/SubNav/SubNavLink.cjs +5 -5
- package/dist/v2/SubNav/SubNavLink.js +40 -34
- package/dist/v2/SubNav/SubNavLinkSection.cjs +6 -6
- package/dist/v2/SubNav/SubNavLinkSection.js +28 -21
- package/dist/v2/SubNav/SubNavSection.cjs +3 -3
- package/dist/v2/SubNav/SubNavSection.js +48 -41
- package/dist/v2/SubNav/SubNavSectionLabel.cjs +4 -4
- package/dist/v2/SubNav/SubNavSectionLabel.js +28 -25
- package/dist/v2/SubNav/SubNavSections.cjs +1 -1
- package/dist/v2/SubNav/SubNavSections.js +14 -13
- package/dist/v2/SubNav/index.cjs +1 -1
- package/dist/v2/index.cjs +1 -1
- package/dist/v2/index.js +1 -1
- package/package.json +16 -19
- package/dist/DismissibleLayer/DismissibleLayer.cjs +0 -1
- package/dist/DismissibleLayer/DismissibleLayer.js +0 -30
- /package/dist/BaseCheckbox/assets/{checkmark-black.cjs → checkmark-black.svg.cjs} +0 -0
- /package/dist/BaseCheckbox/assets/{checkmark-black.js → checkmark-black.svg.js} +0 -0
- /package/dist/BaseCheckbox/assets/{checkmark.cjs → checkmark.svg.cjs} +0 -0
- /package/dist/BaseCheckbox/assets/{checkmark.js → checkmark.svg.js} +0 -0
- /package/dist/Loader/assets/{loader.cjs → loader.svg.cjs} +0 -0
- /package/dist/Loader/assets/{loader.js → loader.svg.js} +0 -0
- /package/dist/Pagination/assets/{next.cjs → next.svg.cjs} +0 -0
- /package/dist/Pagination/assets/{next.js → next.svg.js} +0 -0
- /package/dist/Pagination/assets/{previous.cjs → previous.svg.cjs} +0 -0
- /package/dist/Pagination/assets/{previous.js → previous.svg.js} +0 -0
- /package/dist/v2/Pagination/assets/{next.cjs → next.svg.cjs} +0 -0
- /package/dist/v2/Pagination/assets/{next.js → next.svg.js} +0 -0
- /package/dist/v2/Pagination/assets/{previous.cjs → previous.svg.cjs} +0 -0
- /package/dist/v2/Pagination/assets/{previous.js → previous.svg.js} +0 -0
|
@@ -1,129 +1,39 @@
|
|
|
1
1
|
import { jsxs as a, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import * as i from "react";
|
|
3
3
|
import { Item as q, ItemText as H, Root as M, Trigger as P, Value as _, Portal as z, Content as A, Viewport as D } from "./SelectParts.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import "../
|
|
8
|
-
import {
|
|
9
|
-
import { FieldError as Q } from "../Field/FieldError.js";
|
|
10
|
-
import "../Field/FieldContext.js";
|
|
11
|
-
import "../Field/FieldAction.js";
|
|
4
|
+
import { useId as G } from "../hooks/useId.js";
|
|
5
|
+
import { useIntersection as J } from "../hooks/useIntersection.js";
|
|
6
|
+
import { Box as C } from "../Box/Box.js";
|
|
7
|
+
import { Typography as K } from "../Typography/Typography.js";
|
|
8
|
+
import { Field as Q } from "../Field/Field.js";
|
|
12
9
|
import { Flex as U } from "../Flex/Flex.js";
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
customizeContent: l,
|
|
20
|
-
disabled: d,
|
|
21
|
-
error: c,
|
|
22
|
-
hint: C,
|
|
23
|
-
id: O,
|
|
24
|
-
label: m,
|
|
25
|
-
labelAction: B,
|
|
26
|
-
onChange: h,
|
|
27
|
-
onClear: p,
|
|
28
|
-
onReachEnd: u,
|
|
29
|
-
placeholder: F,
|
|
30
|
-
required: g,
|
|
31
|
-
selectButtonTitle: ee,
|
|
32
|
-
startIcon: T,
|
|
33
|
-
size: $ = "M",
|
|
34
|
-
value: f,
|
|
35
|
-
...y
|
|
36
|
-
}) => {
|
|
37
|
-
const [w, I] = i.useState(), [V, k] = i.useState(!1), t = X(O), v = `${t}-hint`, E = `${t}-error`, L = (r) => {
|
|
38
|
-
h ? h(typeof f == "number" ? Number(r) : r) : I(r);
|
|
10
|
+
import { FieldLabel as X } from "../Field/FieldLabel.js";
|
|
11
|
+
import { FieldHint as Y } from "../Field/FieldHint.js";
|
|
12
|
+
import { FieldError as Z } from "../Field/FieldError.js";
|
|
13
|
+
const ue = ({ children: s, clearLabel: o = "Clear", customizeContent: l, disabled: d, error: c, hint: R, id: O, label: u, labelAction: B, onChange: h, onClear: f, onReachEnd: m, placeholder: F, required: g, selectButtonTitle: ee, startIcon: T, size: $ = "M", value: p, ...y }) => {
|
|
14
|
+
const [w, I] = i.useState(), [V, k] = i.useState(!1), t = G(O), v = `${t}-hint`, E = `${t}-error`, L = (r) => {
|
|
15
|
+
h ? h(typeof p == "number" ? Number(r) : r) : I(r);
|
|
39
16
|
}, N = (r) => {
|
|
40
17
|
k(r);
|
|
41
18
|
}, j = (r) => {
|
|
42
|
-
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
|
|
19
|
+
f && f(r), h || I("");
|
|
20
|
+
}, S = i.useRef(null), W = () => {
|
|
21
|
+
S.current.focus();
|
|
22
|
+
}, b = i.useRef(null), x = `intersection-${CSS.escape(t)}`;
|
|
23
|
+
J(b, (r) => {
|
|
24
|
+
m && m(r);
|
|
48
25
|
}, {
|
|
49
|
-
selectorToWatch: `#${
|
|
26
|
+
selectorToWatch: `#${x}`,
|
|
27
|
+
/**
|
|
28
|
+
* We need to know when the select is open because only then will viewportRef
|
|
29
|
+
* not be null. Because it uses a portal that (sensibly) is not mounted 24/7.
|
|
30
|
+
*/
|
|
50
31
|
skipWhen: !V
|
|
51
32
|
});
|
|
52
|
-
const n = (typeof
|
|
53
|
-
return e(
|
|
54
|
-
|
|
55
|
-
error: c,
|
|
56
|
-
id: t,
|
|
57
|
-
required: g,
|
|
58
|
-
children: a(U, {
|
|
59
|
-
direction: "column",
|
|
60
|
-
alignItems: "stretch",
|
|
61
|
-
gap: 1,
|
|
62
|
-
children: [e(J, {
|
|
63
|
-
onClick: W,
|
|
64
|
-
action: B,
|
|
65
|
-
children: m
|
|
66
|
-
}), a(M, {
|
|
67
|
-
onOpenChange: N,
|
|
68
|
-
disabled: d,
|
|
69
|
-
required: g,
|
|
70
|
-
onValueChange: L,
|
|
71
|
-
value: n,
|
|
72
|
-
...y,
|
|
73
|
-
children: [e(P, {
|
|
74
|
-
ref: b,
|
|
75
|
-
"aria-label": m,
|
|
76
|
-
"aria-describedby": `${v} ${E}`,
|
|
77
|
-
id: t,
|
|
78
|
-
startIcon: T,
|
|
79
|
-
size: $,
|
|
80
|
-
hasError: Boolean(c),
|
|
81
|
-
disabled: d,
|
|
82
|
-
clearLabel: o,
|
|
83
|
-
onClear: n && p ? j : void 0,
|
|
84
|
-
children: e(_, {
|
|
85
|
-
placeholder: F,
|
|
86
|
-
textColor: n ? "neutral800" : "neutral600",
|
|
87
|
-
children: n && l ? l(n) : void 0
|
|
88
|
-
})
|
|
89
|
-
}), e(z, {
|
|
90
|
-
children: e(A, {
|
|
91
|
-
position: "popper",
|
|
92
|
-
sideOffset: 4,
|
|
93
|
-
children: a(D, {
|
|
94
|
-
ref: x,
|
|
95
|
-
children: [s, e(R, {
|
|
96
|
-
id: S,
|
|
97
|
-
width: "100%",
|
|
98
|
-
height: "1px"
|
|
99
|
-
})]
|
|
100
|
-
})
|
|
101
|
-
})
|
|
102
|
-
})]
|
|
103
|
-
}), e(K, {}), e(Q, {})]
|
|
104
|
-
})
|
|
105
|
-
});
|
|
106
|
-
}, be = i.forwardRef(({
|
|
107
|
-
value: s,
|
|
108
|
-
startIcon: o,
|
|
109
|
-
children: l,
|
|
110
|
-
...d
|
|
111
|
-
}, c) => a(q, {
|
|
112
|
-
ref: c,
|
|
113
|
-
value: s.toString(),
|
|
114
|
-
...d,
|
|
115
|
-
children: [o && e(R, {
|
|
116
|
-
as: "span",
|
|
117
|
-
"aria-hidden": !0,
|
|
118
|
-
children: o
|
|
119
|
-
}), e(Z, {
|
|
120
|
-
textColor: "neutral800",
|
|
121
|
-
children: e(H, {
|
|
122
|
-
children: l
|
|
123
|
-
})
|
|
124
|
-
})]
|
|
125
|
-
}));
|
|
33
|
+
const n = (typeof p < "u" ? p.toString() : w) ?? "";
|
|
34
|
+
return e(Q, { hint: R, error: c, id: t, required: g, children: a(U, { direction: "column", alignItems: "stretch", gap: 1, children: [e(X, { onClick: W, action: B, children: u }), a(M, { onOpenChange: N, disabled: d, required: g, onValueChange: L, value: n, ...y, children: [e(P, { ref: S, "aria-label": u, "aria-describedby": `${v} ${E}`, id: t, startIcon: T, size: $, hasError: !!c, disabled: d, clearLabel: o, onClear: n && f ? j : void 0, children: e(_, { placeholder: F, textColor: n ? "neutral800" : "neutral600", children: n && l ? l(n) : void 0 }) }), e(z, { children: e(A, { position: "popper", sideOffset: 4, children: a(D, { ref: b, children: [s, e(C, { id: x, width: "100%", height: "1px" })] }) }) })] }), e(Y, {}), e(Z, {})] }) });
|
|
35
|
+
}, me = i.forwardRef(({ value: s, startIcon: o, children: l, ...d }, c) => a(q, { ref: c, value: s.toString(), ...d, children: [o && e(C, { as: "span", "aria-hidden": !0, children: o }), e(K, { textColor: "neutral800", children: e(H, { children: l }) })] }));
|
|
126
36
|
export {
|
|
127
|
-
|
|
128
|
-
|
|
37
|
+
ue as SingleSelect,
|
|
38
|
+
me as SingleSelectOption
|
|
129
39
|
};
|
package/dist/Select/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./MultiSelectNested.cjs"),e=require("./MultiSelect.cjs"),t=require("./SingleSelect.cjs"),i=require("./Select.cjs"),c=require("./Option.cjs"),S=require("./OptGroup.cjs"),u=require("./SelectList.cjs");exports.MultiSelectNested=l.MultiSelectNested;exports.MultiSelect=e.MultiSelect;exports.MultiSelectGroup=e.MultiSelectGroup;exports.MultiSelectOption=e.MultiSelectOption;exports.SingleSelect=t.SingleSelect;exports.SingleSelectOption=t.SingleSelectOption;exports.Select=i.Select;exports.Option=c.Option;exports.OptGroup=S.OptGroup;exports.SelectList=u.SelectList;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
"use strict";Object.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),s=require("react"),D=require("@radix-ui/react-use-callback-ref"),z=require("@strapi/icons"),e=require("prop-types"),U=require("react-router-dom"),h=require("styled-components"),O=require("./utils.cjs"),i=require("../helpers/keyboardKeys.cjs"),H=require("../hooks/useId.cjs"),_=require("../Link/Link.cjs"),B=require("../Button/Button.cjs"),M=require("../Popover/Popover.cjs"),E=require("../Box/Box.cjs"),q=require("../Typography/Typography.cjs"),G=require("../Flex/Flex.cjs"),J=h.button`
|
|
2
2
|
border: none;
|
|
3
3
|
padding: 0;
|
|
4
4
|
background: transparent;
|
|
5
5
|
cursor: pointer;
|
|
6
|
-
${
|
|
7
|
-
`,
|
|
6
|
+
${O.getOptionStyle}
|
|
7
|
+
`,Q=h(U.NavLink)`
|
|
8
8
|
text-decoration: none;
|
|
9
|
-
${
|
|
10
|
-
`,
|
|
9
|
+
${O.getOptionStyle}
|
|
10
|
+
`,X=h(_.Link)`
|
|
11
11
|
/* Removing Link hover effect */
|
|
12
12
|
&:hover {
|
|
13
13
|
color: currentColor;
|
|
@@ -15,21 +15,21 @@
|
|
|
15
15
|
|
|
16
16
|
&:focus-visible {
|
|
17
17
|
/* Removing Link focus-visible after properties and reset to global outline */
|
|
18
|
-
outline: 2px solid ${({theme:
|
|
18
|
+
outline: 2px solid ${({theme:o})=>o.colors.primary600};
|
|
19
19
|
outline-offset: 2px;
|
|
20
20
|
&:after {
|
|
21
21
|
content: none;
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
${
|
|
26
|
-
`,
|
|
25
|
+
${O.getOptionStyle}
|
|
26
|
+
`,Y=h.span`
|
|
27
27
|
display: flex;
|
|
28
28
|
align-items: center;
|
|
29
29
|
svg {
|
|
30
30
|
height: 4px;
|
|
31
31
|
width: 6px;
|
|
32
32
|
}
|
|
33
|
-
`,
|
|
34
|
-
padding: ${({theme:
|
|
35
|
-
`,
|
|
33
|
+
`,Z=h(B.Button)`
|
|
34
|
+
padding: ${({theme:o})=>`${o.spaces[1]} ${o.spaces[3]}`};
|
|
35
|
+
`,P=({children:o,onClick:g,to:c,isFocused:u,href:a,...k})=>{const d=s.useRef();s.useEffect(()=>{u&&d.current&&d.current.focus()},[u]);const l={tabIndex:u?0:-1,ref:d,role:"menuitem",...k},p=v=>{(v.key===i.KeyboardKeys.SPACE||v.key===i.KeyboardKeys.ENTER)&&g()};return c&&!a?t.jsx(Q,{to:c,...l,children:t.jsx(E.Box,{padding:2,children:t.jsx(q.Typography,{children:o})})}):a&&!c?t.jsx(X,{isExternal:!0,href:a,...l,children:t.jsx(E.Box,{padding:2,children:t.jsx(q.Typography,{children:o})})}):t.jsx(J,{onKeyDown:p,onMouseDown:g,type:"button",...l,children:t.jsx(E.Box,{padding:2,children:t.jsx(q.Typography,{children:o})})})};P.defaultProps={as:void 0,href:void 0,isFocused:!1,onClick(){},to:void 0};P.propTypes={as:e.elementType,children:e.node.isRequired,href:e.string,isFocused:e.bool,onClick:e.func,to:e.string};const x=({label:o,children:g,id:c,as:u,onOpen:a=()=>{},onClose:k=()=>{},size:d,popoverPlacement:l,onReachEnd:p,...v})=>{const f=s.useRef(),R=H.useId(c),K=s.useRef(!1),[y,m]=s.useState(!1),[C,j]=s.useState(0),b=s.Children.toArray(g),w=d==="S"?Z:B.Button,L=u||w,S=!!p&&typeof p=="function";s.useEffect(()=>{if(["string","number"].includes(typeof o)){const n=b.findIndex(r=>r.props.children===o);n!==-1&&j(n)}},[o]);const I=D.useCallbackRef(a),T=D.useCallbackRef(k);s.useEffect(()=>{K?.current?y?I():T():K.current=!0},[K,T,I,y]),s.useEffect(()=>{s.isValidElement(o)&&C===-1&&f.current.focus()},[o,C]);const $=n=>{y&&(n.key===i.KeyboardKeys.ESCAPE&&(n.stopPropagation(),m(!1),f.current.focus()),n.key===i.KeyboardKeys.DOWN&&j(r=>r===b.length-1?0:r+1),n.key===i.KeyboardKeys.UP&&j(r=>r===0?b.length-1:r-1))},A=n=>{(n.key===i.KeyboardKeys.ENTER||n.key===i.KeyboardKeys.SPACE)&&m(r=>!r)},N=n=>{n.preventDefault(),n.currentTarget.contains(n.relatedTarget)||m(!1)},F=n=>{n.preventDefault(),m(r=>!r)},V=()=>{S&&p()},W=b.map((n,r)=>t.jsx(G.Flex,{as:"li",justifyContent:"center",role:"menuitem",children:s.cloneElement(n,{onClick(){n.props.onClick(),m(!1),f.current.focus()},isFocused:C===r})},r));return t.jsxs("div",{onKeyDown:$,children:[t.jsx(L,{label:s.isValidElement(o)?null:o,"aria-haspopup":!0,"aria-expanded":y,"aria-controls":R,onKeyDown:A,onMouseDown:F,ref:f,type:"button",variant:"ghost",endIcon:t.jsx(Y,{children:t.jsx(z.CarretDown,{"aria-hidden":!0})}),...v,children:o}),y&&t.jsx(M.Popover,{onBlur:N,placement:l,source:f,onReachEnd:V,intersectionId:S?`popover-${R}`:void 0,spacing:4,children:t.jsx(E.Box,{role:"menu",as:"ul",padding:1,id:R,children:W})})]})};x.defaultProps={as:void 0};x.displayName="SimpleMenu";x.defaultProps={id:void 0,onOpen:void 0,onClose:void 0,onReachEnd:void 0,popoverPlacement:"bottom-start",size:"M"};x.propTypes={as:e.any,children:e.oneOfType([e.arrayOf(e.node),e.node]).isRequired,id:e.string,label:e.oneOfType([e.string,e.number,e.element]).isRequired,onClose:e.func,onOpen:e.func,onReachEnd:e.func,popoverPlacement:e.oneOf(M.POPOVER_PLACEMENTS),size:e.oneOf(["S","M"])};exports.MenuItem=P;exports.SimpleMenu=x;
|
|
@@ -1,28 +1,29 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { jsx as t, jsxs as z } from "react/jsx-runtime";
|
|
2
|
+
import B, { useRef as T, useEffect as E, useState as K, Children as H, cloneElement as U } from "react";
|
|
3
|
+
import { useCallbackRef as $ } from "@radix-ui/react-use-callback-ref";
|
|
4
|
+
import { CarretDown as G } from "@strapi/icons";
|
|
4
5
|
import e from "prop-types";
|
|
5
|
-
import { NavLink as
|
|
6
|
+
import { NavLink as J } from "react-router-dom";
|
|
6
7
|
import y from "styled-components";
|
|
7
8
|
import { getOptionStyle as b } from "./utils.js";
|
|
8
|
-
import { Box as k } from "../Box/Box.js";
|
|
9
|
-
import { Button as $ } from "../Button/Button.js";
|
|
10
|
-
import { Flex as G } from "../Flex/Flex.js";
|
|
11
9
|
import { KeyboardKeys as i } from "../helpers/keyboardKeys.js";
|
|
12
|
-
import { useId as
|
|
13
|
-
import { Link as
|
|
14
|
-
import {
|
|
10
|
+
import { useId as Q } from "../hooks/useId.js";
|
|
11
|
+
import { Link as X } from "../Link/Link.js";
|
|
12
|
+
import { Button as L } from "../Button/Button.js";
|
|
13
|
+
import { POPOVER_PLACEMENTS as Y, Popover as Z } from "../Popover/Popover.js";
|
|
14
|
+
import { Box as C } from "../Box/Box.js";
|
|
15
15
|
import { Typography as O } from "../Typography/Typography.js";
|
|
16
|
-
|
|
16
|
+
import { Flex as ee } from "../Flex/Flex.js";
|
|
17
|
+
const ne = y.button`
|
|
17
18
|
border: none;
|
|
18
19
|
padding: 0;
|
|
19
20
|
background: transparent;
|
|
20
21
|
cursor: pointer;
|
|
21
22
|
${b}
|
|
22
|
-
`,
|
|
23
|
+
`, oe = y(J)`
|
|
23
24
|
text-decoration: none;
|
|
24
25
|
${b}
|
|
25
|
-
`,
|
|
26
|
+
`, te = y(X)`
|
|
26
27
|
/* Removing Link hover effect */
|
|
27
28
|
&:hover {
|
|
28
29
|
color: currentColor;
|
|
@@ -38,31 +39,31 @@ const Z = y.button`
|
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
${b}
|
|
41
|
-
`,
|
|
42
|
+
`, re = y.span`
|
|
42
43
|
display: flex;
|
|
43
44
|
align-items: center;
|
|
44
45
|
svg {
|
|
45
46
|
height: 4px;
|
|
46
47
|
width: 6px;
|
|
47
48
|
}
|
|
48
|
-
`,
|
|
49
|
+
`, ie = y(L)`
|
|
49
50
|
padding: ${({ theme: o }) => `${o.spaces[1]} ${o.spaces[3]}`};
|
|
50
|
-
`,
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}, [
|
|
55
|
-
const
|
|
56
|
-
tabIndex:
|
|
57
|
-
ref:
|
|
51
|
+
`, A = ({ children: o, onClick: h, to: s, isFocused: c, href: a, ...x }) => {
|
|
52
|
+
const d = T();
|
|
53
|
+
E(() => {
|
|
54
|
+
c && d.current && d.current.focus();
|
|
55
|
+
}, [c]);
|
|
56
|
+
const l = {
|
|
57
|
+
tabIndex: c ? 0 : -1,
|
|
58
|
+
ref: d,
|
|
58
59
|
role: "menuitem",
|
|
59
|
-
...
|
|
60
|
-
},
|
|
61
|
-
(g.key === i.SPACE || g.key === i.ENTER) &&
|
|
60
|
+
...x
|
|
61
|
+
}, p = (g) => {
|
|
62
|
+
(g.key === i.SPACE || g.key === i.ENTER) && h();
|
|
62
63
|
};
|
|
63
|
-
return s && !
|
|
64
|
+
return s && !a ? /* @__PURE__ */ t(oe, { to: s, ...l, children: /* @__PURE__ */ t(C, { padding: 2, children: /* @__PURE__ */ t(O, { children: o }) }) }) : a && !s ? /* @__PURE__ */ t(te, { isExternal: !0, href: a, ...l, children: /* @__PURE__ */ t(C, { padding: 2, children: /* @__PURE__ */ t(O, { children: o }) }) }) : /* @__PURE__ */ t(ne, { onKeyDown: p, onMouseDown: h, type: "button", ...l, children: /* @__PURE__ */ t(C, { padding: 2, children: /* @__PURE__ */ t(O, { children: o }) }) });
|
|
64
65
|
};
|
|
65
|
-
|
|
66
|
+
A.defaultProps = {
|
|
66
67
|
as: void 0,
|
|
67
68
|
href: void 0,
|
|
68
69
|
isFocused: !1,
|
|
@@ -70,7 +71,7 @@ L.defaultProps = {
|
|
|
70
71
|
},
|
|
71
72
|
to: void 0
|
|
72
73
|
};
|
|
73
|
-
|
|
74
|
+
A.propTypes = {
|
|
74
75
|
as: e.elementType,
|
|
75
76
|
children: e.node.isRequired,
|
|
76
77
|
href: e.string,
|
|
@@ -78,83 +79,93 @@ L.propTypes = {
|
|
|
78
79
|
onClick: e.func,
|
|
79
80
|
to: e.string
|
|
80
81
|
};
|
|
81
|
-
const
|
|
82
|
+
const k = ({
|
|
82
83
|
label: o,
|
|
83
|
-
children:
|
|
84
|
+
children: h,
|
|
84
85
|
id: s,
|
|
85
|
-
as:
|
|
86
|
-
onOpen:
|
|
86
|
+
as: c,
|
|
87
|
+
onOpen: a = () => {
|
|
87
88
|
},
|
|
88
|
-
onClose:
|
|
89
|
+
onClose: x = () => {
|
|
89
90
|
},
|
|
90
|
-
size:
|
|
91
|
-
popoverPlacement:
|
|
92
|
-
onReachEnd:
|
|
91
|
+
size: d,
|
|
92
|
+
popoverPlacement: l,
|
|
93
|
+
onReachEnd: p,
|
|
93
94
|
...g
|
|
94
95
|
}) => {
|
|
95
|
-
const
|
|
96
|
-
|
|
96
|
+
const u = T(), P = Q(s), R = T(!1), [f, m] = K(!1), [D, I] = K(0), v = H.toArray(h), N = c || (d === "S" ? ie : L), S = !!p && typeof p == "function";
|
|
97
|
+
E(() => {
|
|
97
98
|
if (["string", "number"].includes(typeof o)) {
|
|
98
|
-
const n =
|
|
99
|
+
const n = v.findIndex((r) => r.props.children === o);
|
|
99
100
|
n !== -1 && I(n);
|
|
100
101
|
}
|
|
101
102
|
}, [o]);
|
|
102
|
-
const w =
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}, [
|
|
106
|
-
|
|
103
|
+
const w = $(a), M = $(x);
|
|
104
|
+
E(() => {
|
|
105
|
+
R?.current ? f ? w() : M() : R.current = !0;
|
|
106
|
+
}, [R, M, w, f]), E(() => {
|
|
107
|
+
B.isValidElement(o) && D === -1 && u.current.focus();
|
|
107
108
|
}, [o, D]);
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
}, F = (n) => {
|
|
111
|
-
(n.key === i.ENTER || n.key === i.SPACE) && f((r) => !r);
|
|
109
|
+
const F = (n) => {
|
|
110
|
+
f && (n.key === i.ESCAPE && (n.stopPropagation(), m(!1), u.current.focus()), n.key === i.DOWN && I((r) => r === v.length - 1 ? 0 : r + 1), n.key === i.UP && I((r) => r === 0 ? v.length - 1 : r - 1));
|
|
112
111
|
}, V = (n) => {
|
|
113
|
-
n.
|
|
112
|
+
(n.key === i.ENTER || n.key === i.SPACE) && m((r) => !r);
|
|
113
|
+
}, j = (n) => {
|
|
114
|
+
n.preventDefault(), n.currentTarget.contains(n.relatedTarget) || m(!1);
|
|
114
115
|
}, q = (n) => {
|
|
115
|
-
n.preventDefault(),
|
|
116
|
+
n.preventDefault(), m((r) => !r);
|
|
116
117
|
}, W = () => {
|
|
117
|
-
S &&
|
|
118
|
-
}, _ =
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
{
|
|
127
|
-
label: t.isValidElement(o) ? null : o,
|
|
128
|
-
"aria-haspopup": !0,
|
|
129
|
-
"aria-expanded": m,
|
|
130
|
-
"aria-controls": R,
|
|
131
|
-
onKeyDown: F,
|
|
132
|
-
onMouseDown: q,
|
|
133
|
-
ref: d,
|
|
134
|
-
type: "button",
|
|
135
|
-
variant: "ghost",
|
|
136
|
-
endIcon: /* @__PURE__ */ t.createElement(te, null, /* @__PURE__ */ t.createElement(H, { "aria-hidden": !0 })),
|
|
137
|
-
...g
|
|
138
|
-
},
|
|
139
|
-
o
|
|
140
|
-
), m && /* @__PURE__ */ t.createElement(
|
|
141
|
-
Y,
|
|
142
|
-
{
|
|
143
|
-
onBlur: V,
|
|
144
|
-
placement: p,
|
|
145
|
-
source: d,
|
|
146
|
-
onReachEnd: W,
|
|
147
|
-
intersectionId: S ? `popover-${R}` : void 0,
|
|
148
|
-
spacing: 4
|
|
149
|
-
},
|
|
150
|
-
/* @__PURE__ */ t.createElement(k, { role: "menu", as: "ul", padding: 1, id: R }, _)
|
|
118
|
+
S && p();
|
|
119
|
+
}, _ = v.map((n, r) => (
|
|
120
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
121
|
+
/* @__PURE__ */ t(ee, { as: "li", justifyContent: "center", role: "menuitem", children: U(n, {
|
|
122
|
+
onClick() {
|
|
123
|
+
n.props.onClick(), m(!1), u.current.focus();
|
|
124
|
+
},
|
|
125
|
+
isFocused: D === r
|
|
126
|
+
}) }, r)
|
|
151
127
|
));
|
|
128
|
+
return (
|
|
129
|
+
// TODO: review why we need to eslint it and how to solve this issue.
|
|
130
|
+
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
131
|
+
/* @__PURE__ */ z("div", { onKeyDown: F, children: [
|
|
132
|
+
/* @__PURE__ */ t(
|
|
133
|
+
N,
|
|
134
|
+
{
|
|
135
|
+
label: B.isValidElement(o) ? null : o,
|
|
136
|
+
"aria-haspopup": !0,
|
|
137
|
+
"aria-expanded": f,
|
|
138
|
+
"aria-controls": P,
|
|
139
|
+
onKeyDown: V,
|
|
140
|
+
onMouseDown: q,
|
|
141
|
+
ref: u,
|
|
142
|
+
type: "button",
|
|
143
|
+
variant: "ghost",
|
|
144
|
+
endIcon: /* @__PURE__ */ t(re, { children: /* @__PURE__ */ t(G, { "aria-hidden": !0 }) }),
|
|
145
|
+
...g,
|
|
146
|
+
children: o
|
|
147
|
+
}
|
|
148
|
+
),
|
|
149
|
+
f && /* @__PURE__ */ t(
|
|
150
|
+
Z,
|
|
151
|
+
{
|
|
152
|
+
onBlur: j,
|
|
153
|
+
placement: l,
|
|
154
|
+
source: u,
|
|
155
|
+
onReachEnd: W,
|
|
156
|
+
intersectionId: S ? `popover-${P}` : void 0,
|
|
157
|
+
spacing: 4,
|
|
158
|
+
children: /* @__PURE__ */ t(C, { role: "menu", as: "ul", padding: 1, id: P, children: _ })
|
|
159
|
+
}
|
|
160
|
+
)
|
|
161
|
+
] })
|
|
162
|
+
);
|
|
152
163
|
};
|
|
153
|
-
|
|
164
|
+
k.defaultProps = {
|
|
154
165
|
as: void 0
|
|
155
166
|
};
|
|
156
|
-
|
|
157
|
-
|
|
167
|
+
k.displayName = "SimpleMenu";
|
|
168
|
+
k.defaultProps = {
|
|
158
169
|
id: void 0,
|
|
159
170
|
onOpen: void 0,
|
|
160
171
|
onClose: void 0,
|
|
@@ -162,18 +173,26 @@ C.defaultProps = {
|
|
|
162
173
|
popoverPlacement: "bottom-start",
|
|
163
174
|
size: "M"
|
|
164
175
|
};
|
|
165
|
-
|
|
176
|
+
k.propTypes = {
|
|
166
177
|
as: e.any,
|
|
167
178
|
children: e.oneOfType([e.arrayOf(e.node), e.node]).isRequired,
|
|
168
179
|
id: e.string,
|
|
169
180
|
label: e.oneOfType([e.string, e.number, e.element]).isRequired,
|
|
170
181
|
onClose: e.func,
|
|
171
182
|
onOpen: e.func,
|
|
183
|
+
/**
|
|
184
|
+
* Callback function to be called when the popover reaches the end of the scrollable content
|
|
185
|
+
*/
|
|
172
186
|
onReachEnd: e.func,
|
|
173
|
-
popoverPlacement: e.oneOf(
|
|
187
|
+
popoverPlacement: e.oneOf(Y),
|
|
188
|
+
/**
|
|
189
|
+
* Size of the trigger button.
|
|
190
|
+
* Note: in case a custom component is passed through the "as"
|
|
191
|
+
* prop, the size prop is passed along too, but needs to be handled there
|
|
192
|
+
*/
|
|
174
193
|
size: e.oneOf(["S", "M"])
|
|
175
194
|
};
|
|
176
195
|
export {
|
|
177
|
-
|
|
178
|
-
|
|
196
|
+
A as MenuItem,
|
|
197
|
+
k as SimpleMenu
|
|
179
198
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./SimpleMenu.cjs");exports.MenuItem=e.MenuItem;exports.SimpleMenu=e.SimpleMenu;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=({theme:o})=>`
|
|
2
2
|
text-align: left;
|
|
3
3
|
width: 100%;
|
|
4
4
|
color: ${o.colors.neutral800};
|
package/dist/Stack/Stack.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),d=require("react"),s=require("styled-components"),o=require("../helpers/theme.cjs"),c=require("../Flex/Flex.cjs"),l={size:!0,spacing:!0},u=s(c.Flex).withConfig({shouldForwardProp:(e,t)=>!l[e]&&t(e)})`
|
|
2
2
|
& > * {
|
|
3
3
|
margin-top: 0;
|
|
4
4
|
margin-bottom: 0;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
& > * + * {
|
|
8
8
|
margin-top: ${({theme:e,spacing:t})=>o.extractStyleFromTheme(e.spaces,t,void 0)};
|
|
9
9
|
}
|
|
10
|
-
`,
|
|
10
|
+
`,g=s(c.Flex).withConfig({shouldForwardProp:(e,t)=>!l[e]&&t(e)})`
|
|
11
11
|
& > * {
|
|
12
12
|
margin-left: 0;
|
|
13
13
|
margin-right: 0;
|
|
@@ -16,4 +16,4 @@
|
|
|
16
16
|
& > * + * {
|
|
17
17
|
margin-left: ${({theme:e,spacing:t})=>o.extractStyleFromTheme(e.spaces,t,void 0)};
|
|
18
18
|
}
|
|
19
|
-
`,
|
|
19
|
+
`,m=d.forwardRef(({horizontal:e=!1,spacing:t,size:r,...n},i)=>(r&&console.warn('Deprecation warning: Usage of "size" prop in Stack component is deprecated. This is discouraged and will be removed in the next major release. Please use "spacing" instead'),e?a.jsx(g,{ref:i,spacing:t||r,...n}):a.jsx(u,{direction:"column",alignItems:"stretch",ref:i,spacing:t||r,...n})));m.displayName="Stack";exports.Stack=m;
|
package/dist/Stack/Stack.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as d } from "react";
|
|
3
3
|
import a from "styled-components";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { extractStyleFromTheme as s } from "../helpers/theme.js";
|
|
5
|
+
import { Flex as m } from "../Flex/Flex.js";
|
|
6
6
|
const c = {
|
|
7
7
|
size: !0,
|
|
8
8
|
spacing: !0
|
|
9
|
-
}, f = a(
|
|
9
|
+
}, f = a(m).withConfig({
|
|
10
10
|
shouldForwardProp: (e, r) => !c[e] && r(e)
|
|
11
11
|
})`
|
|
12
12
|
& > * {
|
|
@@ -15,12 +15,9 @@ const c = {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
& > * + * {
|
|
18
|
-
margin-top: ${({
|
|
19
|
-
theme: e,
|
|
20
|
-
spacing: r
|
|
21
|
-
}) => m(e.spaces, r, void 0)};
|
|
18
|
+
margin-top: ${({ theme: e, spacing: r }) => s(e.spaces, r, void 0)};
|
|
22
19
|
}
|
|
23
|
-
`, g = a(
|
|
20
|
+
`, g = a(m).withConfig({
|
|
24
21
|
shouldForwardProp: (e, r) => !c[e] && r(e)
|
|
25
22
|
})`
|
|
26
23
|
& > * {
|
|
@@ -29,27 +26,9 @@ const c = {
|
|
|
29
26
|
}
|
|
30
27
|
|
|
31
28
|
& > * + * {
|
|
32
|
-
margin-left: ${({
|
|
33
|
-
theme: e,
|
|
34
|
-
spacing: r
|
|
35
|
-
}) => m(e.spaces, r, void 0)};
|
|
29
|
+
margin-left: ${({ theme: e, spacing: r }) => s(e.spaces, r, void 0)};
|
|
36
30
|
}
|
|
37
|
-
`, l = d(({
|
|
38
|
-
horizontal: e = !1,
|
|
39
|
-
spacing: r,
|
|
40
|
-
size: t,
|
|
41
|
-
...o
|
|
42
|
-
}, i) => (t && console.warn('Deprecation warning: Usage of "size" prop in Stack component is deprecated. This is discouraged and will be removed in the next major release. Please use "spacing" instead'), e ? n(g, {
|
|
43
|
-
ref: i,
|
|
44
|
-
spacing: r || t,
|
|
45
|
-
...o
|
|
46
|
-
}) : n(f, {
|
|
47
|
-
direction: "column",
|
|
48
|
-
alignItems: "stretch",
|
|
49
|
-
ref: i,
|
|
50
|
-
spacing: r || t,
|
|
51
|
-
...o
|
|
52
|
-
})));
|
|
31
|
+
`, l = d(({ horizontal: e = !1, spacing: r, size: t, ...o }, i) => (t && console.warn('Deprecation warning: Usage of "size" prop in Stack component is deprecated. This is discouraged and will be removed in the next major release. Please use "spacing" instead'), e ? n(g, { ref: i, spacing: r || t, ...o }) : n(f, { direction: "column", alignItems: "stretch", ref: i, spacing: r || t, ...o })));
|
|
53
32
|
l.displayName = "Stack";
|
|
54
33
|
export {
|
|
55
34
|
l as Stack
|
package/dist/Stack/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./Stack.cjs");exports.Stack=t.Stack;
|
package/dist/Status/Status.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";Object.
|
|
2
|
-
margin-right: ${({theme:
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime");require("react");const e=require("prop-types"),a=require("styled-components"),y=require("../Box/Box.cjs"),b=require("../Typography/Typography.cjs"),$=require("../Flex/Flex.cjs"),x=a.div`
|
|
2
|
+
margin-right: ${({theme:r})=>r.spaces[3]};
|
|
3
3
|
width: ${6/16}rem;
|
|
4
4
|
height: ${6/16}rem;
|
|
5
5
|
border-radius: 50%;
|
|
6
|
-
background: ${({theme:
|
|
7
|
-
`,
|
|
8
|
-
${
|
|
9
|
-
color: ${({theme:
|
|
6
|
+
background: ${({theme:r,backgroundColor:o})=>r.colors[o]};
|
|
7
|
+
`,m=a(y.Box)`
|
|
8
|
+
${b.Typography} {
|
|
9
|
+
color: ${({theme:r,textColor:o})=>r.colors[o]};
|
|
10
10
|
}
|
|
11
|
-
`,s=({variant:
|
|
11
|
+
`,s=({variant:r,showBullet:o,size:n,children:i,...c})=>{const l=`${r}100`,p=`${r}200`,g=`${r}600`,h=`${r}600`,d=n==="S"?2:5,u=n==="S"?1:4;return t.jsx(m,{borderColor:p,textColor:h,background:l,hasRadius:!0,paddingTop:u,paddingBottom:u,paddingLeft:d,paddingRight:d,...c,children:o?t.jsxs($.Flex,{children:[t.jsx(x,{backgroundColor:g}),i]}):i})};s.defaultProps={showBullet:!0,size:"M",variant:"primary"};s.propTypes={children:e.node.isRequired,showBullet:e.bool,size:e.oneOf(["S","M"]),variant:e.oneOf(["alternative","danger","neutral","primary","secondary","success","warning"])};exports.Status=s;
|