@alma-oss/spirit-web-react 4.2.0 → 4.3.0
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/README.md +11 -11
- package/bundles/web-react.umd.js +33199 -32811
- package/bundles/web-react.umd.js.map +1 -1
- package/bundles/web-react.umd.min.js +3 -3
- package/bundles/web-react.umd.min.js.map +1 -1
- package/common/common.cjs.map +1 -1
- package/common/utilities/utilities.cjs.map +1 -1
- package/components/Accordion/Accordion.cjs +33 -25
- package/components/Accordion/Accordion.cjs.map +1 -1
- package/components/Accordion/Accordion.d.ts +2 -8
- package/components/Accordion/Accordion.js +8 -7
- package/components/Accordion/Accordion.js.map +1 -1
- package/components/Accordion/AccordionContext.d.ts +5 -5
- package/components/Accordion/AccordionContext.js.map +1 -1
- package/components/Accordion/AccordionHeader.d.ts +2 -8
- package/components/Accordion/AccordionHeader.js +8 -7
- package/components/Accordion/AccordionHeader.js.map +1 -1
- package/components/Accordion/AccordionItem.d.ts +2 -8
- package/components/Accordion/AccordionItem.js +8 -7
- package/components/Accordion/AccordionItem.js.map +1 -1
- package/components/Accordion/UncontrolledAccordion.d.ts +2 -3
- package/components/Accordion/UncontrolledAccordion.js +1 -2
- package/components/Accordion/UncontrolledAccordion.js.map +1 -1
- package/components/Accordion/useAccordion.d.ts +2 -2
- package/components/Accordion/useAccordion.js.map +1 -1
- package/components/Accordion/useAccordionStyleProps.d.ts +2 -3
- package/components/Accordion/useAccordionStyleProps.js.map +1 -1
- package/components/ActionGroup/ActionGroup.cjs +17 -11
- package/components/ActionGroup/ActionGroup.cjs.map +1 -1
- package/components/Alert/Alert.cjs +17 -7
- package/components/Alert/Alert.cjs.map +1 -1
- package/components/Alert/Alert.d.ts +2 -6
- package/components/Alert/Alert.js +9 -5
- package/components/Alert/Alert.js.map +1 -1
- package/components/Alert/useAlertIcon.d.ts +1 -1
- package/components/Alert/useAlertStyleProps.d.ts +4 -5
- package/components/Alert/useAlertStyleProps.js.map +1 -1
- package/components/Avatar/Avatar.cjs +41 -16
- package/components/Avatar/Avatar.cjs.map +1 -1
- package/components/Avatar/Avatar.d.ts +2 -5
- package/components/Avatar/Avatar.js +6 -6
- package/components/Avatar/Avatar.js.map +1 -1
- package/components/Avatar/useAvatarStyleProps.d.ts +4 -4
- package/components/Avatar/useAvatarStyleProps.js +5 -5
- package/components/Avatar/useAvatarStyleProps.js.map +1 -1
- package/components/Box/Box.cjs +15 -9
- package/components/Box/Box.cjs.map +1 -1
- package/components/Box/Box.d.ts +3 -8
- package/components/Box/Box.js +8 -7
- package/components/Box/Box.js.map +1 -1
- package/components/Box/useBoxStyleProps.d.ts +2 -2
- package/components/Breadcrumbs/Breadcrumbs.cjs +14 -6
- package/components/Breadcrumbs/Breadcrumbs.cjs.map +1 -1
- package/components/Breadcrumbs/Breadcrumbs.d.ts +1 -1
- package/components/Button/Button.cjs +68 -21
- package/components/Button/Button.cjs.map +1 -1
- package/components/Button/Button.d.ts +2 -2
- package/components/Button/Button.js +5 -3
- package/components/Button/Button.js.map +1 -1
- package/components/Button/useButtonStyleProps.d.ts +19 -6
- package/components/Button/useButtonStyleProps.js +6 -6
- package/components/Button/useButtonStyleProps.js.map +1 -1
- package/components/ButtonLink/ButtonLink.d.ts +2 -2
- package/components/ButtonLink/ButtonLink.js +5 -3
- package/components/ButtonLink/ButtonLink.js.map +1 -1
- package/components/ButtonLink/useButtonLinkProps.d.ts +10 -4
- package/components/ButtonLink/useButtonLinkProps.js.map +1 -1
- package/components/ButtonLink/useButtonLinkStyleProps.d.ts +19 -6
- package/components/ButtonLink/useButtonLinkStyleProps.js +6 -6
- package/components/ButtonLink/useButtonLinkStyleProps.js.map +1 -1
- package/components/Card/Card.cjs +13 -6
- package/components/Card/Card.cjs.map +1 -1
- package/components/Card/Card.d.ts +1 -1
- package/components/Card/Card.js +2 -2
- package/components/Card/Card.js.map +1 -1
- package/components/Card/CardLink.d.ts +2 -4
- package/components/Card/CardLink.js +1 -0
- package/components/Card/CardLink.js.map +1 -1
- package/components/Card/CardTitle.d.ts +1 -1
- package/components/Card/useCardStyleProps.d.ts +2 -1
- package/components/Card/useCardStyleProps.js +2 -1
- package/components/Card/useCardStyleProps.js.map +1 -1
- package/components/Checkbox/Checkbox.cjs +56 -5
- package/components/Checkbox/Checkbox.cjs.map +1 -1
- package/components/Checkbox/Checkbox.d.ts +2 -3
- package/components/Checkbox/Checkbox.js +1 -0
- package/components/Checkbox/Checkbox.js.map +1 -1
- package/components/Checkbox/useCheckboxStyleProps.js +5 -2
- package/components/Checkbox/useCheckboxStyleProps.js.map +1 -1
- package/components/Collapse/Collapse.cjs +10 -5
- package/components/Collapse/Collapse.cjs.map +1 -1
- package/components/Container/Container.cjs +4 -2
- package/components/Container/Container.cjs.map +1 -1
- package/components/ControlButton/ControlButton.d.ts +2 -2
- package/components/ControlButton/ControlButton.js +5 -3
- package/components/ControlButton/ControlButton.js.map +1 -1
- package/components/ControlButton/useControlButtonStyleProps.d.ts +19 -6
- package/components/ControlButton/useControlButtonStyleProps.js +3 -4
- package/components/ControlButton/useControlButtonStyleProps.js.map +1 -1
- package/components/Dialog/Dialog.cjs +42 -11
- package/components/Dialog/Dialog.cjs.map +1 -1
- package/components/Dialog/Dialog.d.ts +3 -4
- package/components/Dialog/Dialog.js +4 -2
- package/components/Dialog/Dialog.js.map +1 -1
- package/components/Dialog/constants.d.ts +1 -0
- package/components/Dialog/constants.js +2 -0
- package/components/Dialog/constants.js.map +1 -0
- package/components/Dialog/useDialog.js +38 -9
- package/components/Dialog/useDialog.js.map +1 -1
- package/components/Divider/Divider.cjs +4 -2
- package/components/Divider/Divider.cjs.map +1 -1
- package/components/Drawer/Drawer.cjs +175 -38
- package/components/Drawer/Drawer.cjs.map +1 -1
- package/components/Drawer/DrawerCloseButton.js +4 -4
- package/components/Drawer/DrawerCloseButton.js.map +1 -1
- package/components/Drawer/DrawerPanel.d.ts +3 -3
- package/components/Drawer/DrawerPanel.js +5 -3
- package/components/Drawer/DrawerPanel.js.map +1 -1
- package/components/Drawer/constants.d.ts +0 -1
- package/components/Drawer/constants.js +0 -1
- package/components/Drawer/constants.js.map +1 -1
- package/components/Dropdown/Dropdown.cjs +8 -3
- package/components/Dropdown/Dropdown.cjs.map +1 -1
- package/components/Dropdown/DropdownTrigger.d.ts +1 -1
- package/components/EmptyState/EmptyState.cjs +43 -17
- package/components/EmptyState/EmptyState.cjs.map +1 -1
- package/components/Field/Field.cjs +10 -4
- package/components/Field/Field.cjs.map +1 -1
- package/components/Field/HelperText.d.ts +1 -1
- package/components/Field/Label.d.ts +1 -1
- package/components/Field/ValidationText.d.ts +1 -1
- package/components/Field/ValidationText.js +1 -1
- package/components/Field/ValidationText.js.map +1 -1
- package/components/Field/types.d.ts +3 -3
- package/components/FieldGroup/FieldGroup.cjs +10 -4
- package/components/FieldGroup/FieldGroup.cjs.map +1 -1
- package/components/FileUploader/FileUploader.cjs +77 -15
- package/components/FileUploader/FileUploader.cjs.map +1 -1
- package/components/FileUploader/FileUploaderAttachment.js +8 -5
- package/components/FileUploader/FileUploaderAttachment.js.map +1 -1
- package/components/FileUploader/FileUploaderList.js +5 -4
- package/components/FileUploader/FileUploaderList.js.map +1 -1
- package/components/FileUploader/constants.d.ts +0 -3
- package/components/FileUploader/constants.js +0 -3
- package/components/FileUploader/constants.js.map +1 -1
- package/components/FileUploader/useFileUploaderInput.js.map +1 -1
- package/components/Flex/Flex.cjs +17 -11
- package/components/Flex/Flex.cjs.map +1 -1
- package/components/Flex/Flex.d.ts +2 -8
- package/components/Flex/Flex.js +8 -7
- package/components/Flex/Flex.js.map +1 -1
- package/components/Flex/useFlexStyleProps.d.ts +3 -3
- package/components/Flex/useFlexStyleProps.js.map +1 -1
- package/components/Footer/Footer.cjs +17 -9
- package/components/Footer/Footer.cjs.map +1 -1
- package/components/Footer/Footer.d.ts +2 -6
- package/components/Footer/Footer.js +10 -7
- package/components/Footer/Footer.js.map +1 -1
- package/components/Grid/Grid.cjs +34 -22
- package/components/Grid/Grid.cjs.map +1 -1
- package/components/Grid/Grid.d.ts +2 -8
- package/components/Grid/Grid.js +8 -7
- package/components/Grid/Grid.js.map +1 -1
- package/components/Grid/GridItem.d.ts +2 -8
- package/components/Grid/GridItem.js +11 -7
- package/components/Grid/GridItem.js.map +1 -1
- package/components/Grid/useGridItemStyleProps.js +7 -5
- package/components/Grid/useGridItemStyleProps.js.map +1 -1
- package/components/Header/Header.cjs +120 -38
- package/components/Header/Header.cjs.map +1 -1
- package/components/Header/HeaderDialogContext.d.ts +2 -2
- package/components/Header/HeaderDialogContext.js.map +1 -1
- package/components/Header/HeaderDialogLink.d.ts +2 -3
- package/components/Header/HeaderDialogLink.js +5 -3
- package/components/Header/HeaderDialogLink.js.map +1 -1
- package/components/Header/HeaderLink.d.ts +2 -3
- package/components/Header/HeaderLink.js +5 -3
- package/components/Header/HeaderLink.js.map +1 -1
- package/components/Heading/Heading.cjs +8 -3
- package/components/Heading/Heading.cjs.map +1 -1
- package/components/Heading/Heading.d.ts +1 -1
- package/components/Heading/Heading.js.map +1 -1
- package/components/Heading/useHeadingStyleProps.d.ts +3 -3
- package/components/Heading/useHeadingStyleProps.js.map +1 -1
- package/components/Hidden/Hidden.d.ts +3 -0
- package/components/Hidden/Hidden.js +32 -0
- package/components/Hidden/Hidden.js.map +1 -0
- package/components/Hidden/index.d.ts +1 -0
- package/components/Hidden/index.js +2 -0
- package/components/Hidden/index.js.map +1 -0
- package/components/Icon/Icon.cjs +5 -2
- package/components/Icon/Icon.cjs.map +1 -1
- package/components/Icon/Icon.d.ts +2 -3
- package/components/Icon/Icon.js +1 -0
- package/components/Icon/Icon.js.map +1 -1
- package/components/Icon/useIconStyleProps.d.ts +6 -1322
- package/components/Icon/useIconStyleProps.js.map +1 -1
- package/components/IconBox/IconBox.cjs +21 -11
- package/components/IconBox/IconBox.cjs.map +1 -1
- package/components/IconBox/IconBox.d.ts +2 -6
- package/components/IconBox/IconBox.js +6 -3
- package/components/IconBox/IconBox.js.map +1 -1
- package/components/IconBox/useIconBoxStyleProps.d.ts +2 -2
- package/components/Item/Item.cjs +9 -3
- package/components/Item/Item.cjs.map +1 -1
- package/components/Item/Item.d.ts +1 -1
- package/components/Link/Link.cjs +13 -6
- package/components/Link/Link.cjs.map +1 -1
- package/components/Link/Link.d.ts +2 -3
- package/components/Link/Link.js +5 -3
- package/components/Link/Link.js.map +1 -1
- package/components/Link/useLinkStyleProps.d.ts +5 -7
- package/components/Link/useLinkStyleProps.js.map +1 -1
- package/components/Matrix/Matrix.cjs +8 -3
- package/components/Matrix/Matrix.cjs.map +1 -1
- package/components/Matrix/Matrix.d.ts +1 -1
- package/components/Matrix/Matrix.js +3 -3
- package/components/Matrix/Matrix.js.map +1 -1
- package/components/Matrix/{constant.js → constants.js} +1 -1
- package/components/Matrix/constants.js.map +1 -0
- package/components/Matrix/useMatrixStyleProps.d.ts +1 -1
- package/components/Matrix/useMatrixStyleProps.js +1 -1
- package/components/Matrix/useMatrixStyleProps.js.map +1 -1
- package/components/Modal/Modal.cjs +184 -46
- package/components/Modal/Modal.cjs.map +1 -1
- package/components/Modal/ModalCloseButton.js +5 -3
- package/components/Modal/ModalCloseButton.js.map +1 -1
- package/components/Modal/ModalDialog.d.ts +4 -3
- package/components/Modal/ModalDialog.js +8 -5
- package/components/Modal/ModalDialog.js.map +1 -1
- package/components/Modal/ModalHeader.js +5 -4
- package/components/Modal/ModalHeader.js.map +1 -1
- package/components/Modal/useModalDialogStyleProps.d.ts +11 -833
- package/components/Modal/useModalDialogStyleProps.js +1 -2
- package/components/Modal/useModalDialogStyleProps.js.map +1 -1
- package/components/Navigation/Navigation.cjs +47 -19
- package/components/Navigation/Navigation.cjs.map +1 -1
- package/components/Navigation/NavigationAction.d.ts +3 -3
- package/components/Navigation/NavigationAction.js +1 -0
- package/components/Navigation/NavigationAction.js.map +1 -1
- package/components/Navigation/NavigationAvatar.d.ts +3 -3
- package/components/Navigation/NavigationAvatar.js +5 -3
- package/components/Navigation/NavigationAvatar.js.map +1 -1
- package/components/NoSsr/NoSsr.cjs.map +1 -1
- package/components/Pagination/Pagination.cjs +155 -44
- package/components/Pagination/Pagination.cjs.map +1 -1
- package/components/Pagination/PaginationButtonLink.d.ts +2 -3
- package/components/Pagination/PaginationButtonLink.js +6 -5
- package/components/Pagination/PaginationButtonLink.js.map +1 -1
- package/components/Pagination/PaginationLink.d.ts +3 -3
- package/components/Pagination/PaginationLink.js +8 -6
- package/components/Pagination/PaginationLink.js.map +1 -1
- package/components/Pagination/PaginationLinkNext.d.ts +2 -3
- package/components/Pagination/PaginationLinkNext.js +6 -3
- package/components/Pagination/PaginationLinkNext.js.map +1 -1
- package/components/Pagination/PaginationLinkPrevious.d.ts +2 -3
- package/components/Pagination/PaginationLinkPrevious.js +6 -3
- package/components/Pagination/PaginationLinkPrevious.js.map +1 -1
- package/components/Pagination/UncontrolledPagination.js +9 -5
- package/components/Pagination/UncontrolledPagination.js.map +1 -1
- package/components/Pagination/index.d.ts +0 -1
- package/components/Pagination/index.js +0 -1
- package/components/Pagination/index.js.map +1 -1
- package/components/PartnerLogo/PartnerLogo.cjs +4 -2
- package/components/PartnerLogo/PartnerLogo.cjs.map +1 -1
- package/components/Pill/Pill.cjs +8 -3
- package/components/Pill/Pill.cjs.map +1 -1
- package/components/Pill/Pill.d.ts +1 -1
- package/components/Pill/usePillStyleProps.d.ts +1 -1
- package/components/PricingPlan/PricingPlan.cjs +196 -53
- package/components/PricingPlan/PricingPlan.cjs.map +1 -1
- package/components/PricingPlan/PricingPlan.d.ts +1 -1
- package/components/PricingPlan/PricingPlanBody.d.ts +1 -1
- package/components/PricingPlan/PricingPlanFooter.d.ts +1 -1
- package/components/PricingPlan/PricingPlanHeader.d.ts +1 -1
- package/components/ProductLogo/ProductLogo.cjs +4 -2
- package/components/ProductLogo/ProductLogo.cjs.map +1 -1
- package/components/Radio/Radio.cjs +55 -4
- package/components/Radio/Radio.cjs.map +1 -1
- package/components/Radio/Radio.d.ts +2 -3
- package/components/Radio/Radio.js +1 -0
- package/components/Radio/Radio.js.map +1 -1
- package/components/Radio/useRadioStyleProps.js +5 -2
- package/components/Radio/useRadioStyleProps.js.map +1 -1
- package/components/ScrollView/ScrollView.cjs +53 -9
- package/components/ScrollView/ScrollView.cjs.map +1 -1
- package/components/ScrollView/useScrollPosition.js.map +1 -1
- package/components/Section/Section.cjs +16 -9
- package/components/Section/Section.cjs.map +1 -1
- package/components/Section/Section.d.ts +2 -6
- package/components/Section/Section.js +8 -6
- package/components/Section/Section.js.map +1 -1
- package/components/Section/useSectionSizeProps.d.ts +4 -6
- package/components/Section/useSectionSizeProps.js +1 -1
- package/components/Section/useSectionSizeProps.js.map +1 -1
- package/components/Section/useSectionStyleProps.d.ts +3 -5
- package/components/Section/useSectionStyleProps.js.map +1 -1
- package/components/SegmentedControl/SegmentedControl.cjs +13 -6
- package/components/SegmentedControl/SegmentedControl.cjs.map +1 -1
- package/components/SegmentedControl/SegmentedControlContext.js.map +1 -1
- package/components/SegmentedControl/SegmentedControlItem.d.ts +2 -3
- package/components/SegmentedControl/SegmentedControlItem.js +5 -3
- package/components/SegmentedControl/SegmentedControlItem.js.map +1 -1
- package/components/Select/Select.cjs +11 -4
- package/components/Select/Select.cjs.map +1 -1
- package/components/Select/Select.d.ts +2 -3
- package/components/Select/Select.js +1 -0
- package/components/Select/Select.js.map +1 -1
- package/components/Skeleton/Skeleton.cjs +8 -3
- package/components/Skeleton/Skeleton.cjs.map +1 -1
- package/components/Skeleton/SkeletonHeading.d.ts +1 -1
- package/components/Skeleton/SkeletonShape.d.ts +1 -1
- package/components/Skeleton/SkeletonText.d.ts +1 -1
- package/components/Skeleton/useSkeletonShapeStyleProps.d.ts +10 -848
- package/components/Skeleton/useSkeletonShapeStyleProps.js.map +1 -1
- package/components/Skeleton/useSkeletonStyleProps.d.ts +1 -1
- package/components/SkipLink/SkipLink.cjs +5 -2
- package/components/SkipLink/SkipLink.cjs.map +1 -1
- package/components/SkipLink/SkipLink.d.ts +3 -3
- package/components/SkipLink/SkipLink.js +1 -0
- package/components/SkipLink/SkipLink.js.map +1 -1
- package/components/Slider/Slider.cjs +11 -4
- package/components/Slider/Slider.cjs.map +1 -1
- package/components/Slider/Slider.d.ts +2 -3
- package/components/Slider/Slider.js +1 -0
- package/components/Slider/Slider.js.map +1 -1
- package/components/Spinner/Spinner.cjs +5 -2
- package/components/Spinner/Spinner.cjs.map +1 -1
- package/components/Spinner/Spinner.js.map +1 -1
- package/components/SplitButton/SplitButton.cjs +130 -27
- package/components/SplitButton/SplitButton.cjs.map +1 -1
- package/components/SplitButton/UncontrolledSplitButton.js +6 -5
- package/components/SplitButton/UncontrolledSplitButton.js.map +1 -1
- package/components/Stack/Stack.cjs +27 -13
- package/components/Stack/Stack.cjs.map +1 -1
- package/components/Stack/Stack.d.ts +2 -6
- package/components/Stack/Stack.js +8 -5
- package/components/Stack/Stack.js.map +1 -1
- package/components/Stack/StackItem.d.ts +2 -6
- package/components/Stack/StackItem.js +11 -5
- package/components/Stack/StackItem.js.map +1 -1
- package/components/Stack/useStackStyleProps.d.ts +19 -10
- package/components/Stack/useStackStyleProps.js.map +1 -1
- package/components/Tabs/TabContext.js.map +1 -1
- package/components/Tabs/TabLink.d.ts +2 -3
- package/components/Tabs/TabLink.js +5 -3
- package/components/Tabs/TabLink.js.map +1 -1
- package/components/Tabs/Tabs.cjs +13 -6
- package/components/Tabs/Tabs.cjs.map +1 -1
- package/components/Tag/Tag.cjs +13 -6
- package/components/Tag/Tag.cjs.map +1 -1
- package/components/Tag/Tag.d.ts +3 -3
- package/components/Tag/Tag.js +5 -3
- package/components/Tag/Tag.js.map +1 -1
- package/components/Tag/useTagStyleProps.d.ts +1 -1
- package/components/Text/Text.cjs +8 -3
- package/components/Text/Text.cjs.map +1 -1
- package/components/Text/Text.d.ts +1 -1
- package/components/Text/Text.js.map +1 -1
- package/components/Text/useTextStyleProps.d.ts +3 -3
- package/components/Text/useTextStyleProps.js.map +1 -1
- package/components/TextArea/TextArea.cjs +74 -12
- package/components/TextArea/TextArea.cjs.map +1 -1
- package/components/TextArea/TextArea.d.ts +2 -3
- package/components/TextArea/TextArea.js +1 -0
- package/components/TextArea/TextArea.js.map +1 -1
- package/components/TextArea/useAdjustHeight.js.map +1 -1
- package/components/TextField/TextField.cjs +74 -12
- package/components/TextField/TextField.cjs.map +1 -1
- package/components/TextField/TextField.d.ts +2 -3
- package/components/TextField/TextField.js +1 -0
- package/components/TextField/TextField.js.map +1 -1
- package/components/TextFieldBase/TextFieldBase.cjs +73 -12
- package/components/TextFieldBase/TextFieldBase.cjs.map +1 -1
- package/components/TextFieldBase/TextFieldBase.d.ts +2 -6
- package/components/TextFieldBase/TextFieldBase.js +1 -0
- package/components/TextFieldBase/TextFieldBase.js.map +1 -1
- package/components/TextFieldBase/TextFieldBaseInput.d.ts +2 -3
- package/components/TextFieldBase/TextFieldBaseInput.js +3 -2
- package/components/TextFieldBase/TextFieldBaseInput.js.map +1 -1
- package/components/TextFieldBase/TextFieldBasePasswordToggle.js +3 -4
- package/components/TextFieldBase/TextFieldBasePasswordToggle.js.map +1 -1
- package/components/Timeline/Timeline.cjs +8 -3
- package/components/Timeline/Timeline.cjs.map +1 -1
- package/components/Timeline/Timeline.d.ts +1 -1
- package/components/Timeline/TimelineStep.d.ts +1 -1
- package/components/Toast/Toast.cjs +79 -12
- package/components/Toast/Toast.cjs.map +1 -1
- package/components/Toast/ToastBar.js +6 -4
- package/components/Toast/ToastBar.js.map +1 -1
- package/components/Toast/ToastBarLink.d.ts +2 -3
- package/components/Toast/ToastBarLink.js +5 -3
- package/components/Toast/ToastBarLink.js.map +1 -1
- package/components/Toast/ToastContext.js +2 -2
- package/components/Toast/ToastContext.js.map +1 -1
- package/components/Toast/UncontrolledToast.js +5 -3
- package/components/Toast/UncontrolledToast.js.map +1 -1
- package/components/Toast/constants.d.ts +0 -1
- package/components/Toast/constants.js +0 -1
- package/components/Toast/constants.js.map +1 -1
- package/components/Toggle/Toggle.cjs +57 -5
- package/components/Toggle/Toggle.cjs.map +1 -1
- package/components/Toggle/Toggle.d.ts +2 -3
- package/components/Toggle/Toggle.js +1 -0
- package/components/Toggle/Toggle.js.map +1 -1
- package/components/Toggle/useToggleStyleProps.js +5 -2
- package/components/Toggle/useToggleStyleProps.js.map +1 -1
- package/components/Tooltip/Tooltip.cjs +78 -10
- package/components/Tooltip/Tooltip.cjs.map +1 -1
- package/components/Tooltip/Tooltip.d.ts +2 -6
- package/components/Tooltip/Tooltip.js +9 -6
- package/components/Tooltip/Tooltip.js.map +1 -1
- package/components/Tooltip/TooltipCloseButton.js +5 -3
- package/components/Tooltip/TooltipCloseButton.js.map +1 -1
- package/components/Tooltip/useTooltipStyleProps.d.ts +20 -8
- package/components/Tooltip/useTooltipStyleProps.js.map +1 -1
- package/components/Truncate/Truncate.cjs +8 -3
- package/components/Truncate/Truncate.cjs.map +1 -1
- package/components/Truncate/Truncate.d.ts +1 -1
- package/components/Truncate/useTruncateStyleProps.d.ts +3 -3
- package/components/UNSTABLE_Header/UNSTABLE_Header.cjs +13 -6
- package/components/UNSTABLE_Header/UNSTABLE_Header.cjs.map +1 -1
- package/components/UNSTABLE_Header/UNSTABLE_HeaderLogo.d.ts +2 -3
- package/components/UNSTABLE_Header/UNSTABLE_HeaderLogo.js +5 -3
- package/components/UNSTABLE_Header/UNSTABLE_HeaderLogo.js.map +1 -1
- package/components/VisuallyHidden/VisuallyHidden.cjs +8 -3
- package/components/VisuallyHidden/VisuallyHidden.cjs.map +1 -1
- package/components/VisuallyHidden/VisuallyHidden.d.ts +1 -1
- package/components/VisuallyHidden/useVisuallyHiddenProps.d.ts +3 -3
- package/components/components.cjs +715 -457
- package/components/components.cjs.map +1 -1
- package/components/index.d.ts +1 -0
- package/components/index.js +1 -0
- package/components/index.js.map +1 -1
- package/constants/constants.cjs +6 -0
- package/constants/constants.cjs.map +1 -1
- package/constants/index.d.ts +1 -0
- package/constants/index.js +1 -0
- package/constants/index.js.map +1 -1
- package/constants/inputs.d.ts +4 -0
- package/constants/inputs.js +5 -0
- package/constants/inputs.js.map +1 -0
- package/hooks/hooks.cjs +110 -9
- package/hooks/hooks.cjs.map +1 -1
- package/hooks/index.d.ts +3 -1
- package/hooks/index.js +3 -1
- package/hooks/index.js.map +1 -1
- package/hooks/useDeprecationMessage.js +2 -2
- package/hooks/useDeprecationMessage.js.map +1 -1
- package/hooks/useI18n.d.ts +6 -0
- package/hooks/useI18n.js +9 -0
- package/hooks/useI18n.js.map +1 -0
- package/hooks/useInputPositionClass.d.ts +2 -0
- package/hooks/useInputPositionClass.js +8 -0
- package/hooks/useInputPositionClass.js.map +1 -0
- package/hooks/useStyleUtilities.js +4 -2
- package/hooks/useStyleUtilities.js.map +1 -1
- package/hooks/useSymmetry.d.ts +7 -0
- package/hooks/useSymmetry.js +39 -0
- package/hooks/useSymmetry.js.map +1 -0
- package/index.cjs +722 -462
- package/index.cjs.map +1 -1
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/index.js.map +1 -1
- package/package.json +29 -36
- package/spirit-web-react.cjs +723 -463
- package/spirit-web-react.cjs.map +1 -1
- package/spirit-web-react.min.cjs +1 -1
- package/translations/defaults.d.ts +29 -0
- package/translations/defaults.js +30 -0
- package/translations/defaults.js.map +1 -0
- package/translations/index.d.ts +3 -0
- package/translations/index.js +4 -0
- package/translations/index.js.map +1 -0
- package/translations/replaceTranslationParams.d.ts +1 -0
- package/translations/replaceTranslationParams.js +5 -0
- package/translations/replaceTranslationParams.js.map +1 -0
- package/translations/resolveTranslationKey.d.ts +10 -0
- package/translations/resolveTranslationKey.js +14 -0
- package/translations/resolveTranslationKey.js.map +1 -0
- package/types/accordion.d.ts +18 -18
- package/types/alert.d.ts +4 -6
- package/types/avatar.d.ts +6 -6
- package/types/box.d.ts +4 -6
- package/types/breadcrumbs.d.ts +2 -2
- package/types/button.d.ts +10 -12
- package/types/card.d.ts +9 -9
- package/types/card.js.map +1 -1
- package/types/checkbox.d.ts +2 -1
- package/types/controlButton.d.ts +9 -8
- package/types/drawer.d.ts +3 -3
- package/types/flex.d.ts +7 -8
- package/types/footer.d.ts +6 -7
- package/types/grid.d.ts +14 -12
- package/types/header.d.ts +16 -18
- package/types/heading.d.ts +4 -4
- package/types/hidden.d.ts +11 -0
- package/types/hidden.js +2 -0
- package/types/hidden.js.map +1 -0
- package/types/icon.d.ts +5 -3
- package/types/iconBox.d.ts +7 -6
- package/types/index.d.ts +1 -0
- package/types/index.js +1 -0
- package/types/index.js.map +1 -1
- package/types/item.d.ts +4 -4
- package/types/link.d.ts +9 -8
- package/types/link.js.map +1 -1
- package/types/matrix.d.ts +3 -3
- package/types/modal.d.ts +7 -5
- package/types/navigation.d.ts +10 -5
- package/types/pill.d.ts +3 -3
- package/types/pricingPlan.d.ts +3 -3
- package/types/radio.d.ts +2 -1
- package/types/section.d.ts +6 -5
- package/types/shared/dialogs.d.ts +6 -3
- package/types/shared/element.d.ts +5 -7
- package/types/shared/index.d.ts +4 -3
- package/types/shared/index.js +1 -0
- package/types/shared/index.js.map +1 -1
- package/types/shared/inputs.d.ts +3 -0
- package/types/shared/polymorphic.d.ts +13 -0
- package/types/shared/polymorphic.js +2 -0
- package/types/shared/polymorphic.js.map +1 -0
- package/types/shared/shared.cjs.map +1 -1
- package/types/skeleton.d.ts +9 -6
- package/types/slider.d.ts +2 -2
- package/types/spinner.d.ts +1 -1
- package/types/stack.d.ts +12 -10
- package/types/tabs.d.ts +6 -5
- package/types/tag.d.ts +3 -3
- package/types/text.d.ts +3 -3
- package/types/toggle.d.ts +2 -1
- package/types/tooltip.d.ts +23 -21
- package/types/tooltip.js.map +1 -1
- package/types/types.cjs.map +1 -1
- package/types/unstableHeader.d.ts +9 -7
- package/types/visuallyHidden.d.ts +4 -4
- package/utils/mergeStyleProps.js +4 -1
- package/utils/mergeStyleProps.js.map +1 -1
- package/utils/utils.cjs +4 -1
- package/utils/utils.cjs.map +1 -1
- package/components/Matrix/constant.js.map +0 -1
- package/components/Modal/constants.d.ts +0 -1
- package/components/Modal/constants.js +0 -2
- package/components/Modal/constants.js.map +0 -1
- package/components/Pagination/constants.d.ts +0 -3
- package/components/Pagination/constants.js +0 -4
- package/components/Pagination/constants.js.map +0 -1
- package/components/SplitButton/constants.d.ts +0 -1
- package/components/SplitButton/constants.js +0 -2
- package/components/SplitButton/constants.js.map +0 -1
- package/components/TextFieldBase/constants.d.ts +0 -2
- package/components/TextFieldBase/constants.js +0 -3
- package/components/TextFieldBase/constants.js.map +0 -1
- package/hooks/useDirectionClass.d.ts +0 -2
- package/hooks/useDirectionClass.js +0 -5
- package/hooks/useDirectionClass.js.map +0 -1
- /package/components/Matrix/{constant.d.ts → constants.d.ts} +0 -0
|
@@ -158,8 +158,11 @@ const htmlReactParser = (html) => {
|
|
|
158
158
|
return domToReact(htmlToDOM(html));
|
|
159
159
|
};
|
|
160
160
|
|
|
161
|
+
function hasSpiritComponent(elementTag) {
|
|
162
|
+
return typeof elementTag !== 'string' && elementTag !== null && 'spiritComponent' in elementTag;
|
|
163
|
+
}
|
|
161
164
|
function mergeStyleProps(ElementTag, styleProps) {
|
|
162
|
-
const isSpiritComponent =
|
|
165
|
+
const isSpiritComponent = hasSpiritComponent(ElementTag);
|
|
163
166
|
const isNonNullableObject = (styleProp) => typeof styleProp === 'object' && styleProp !== null;
|
|
164
167
|
const extractClassNames = (styleProp) => {
|
|
165
168
|
if (typeof styleProp === 'string') {
|
|
@@ -249,8 +252,10 @@ const processProperties = (utilityKey, utilityName, propValue, prefix) => {
|
|
|
249
252
|
};
|
|
250
253
|
const isStylePropProcessable = (styleProps, stylePropKey, stylePropValue, options = { includesKey: true }) => {
|
|
251
254
|
const isStylePropKeyIncluded = isKeyIncluded(styleProps, stylePropKey);
|
|
252
|
-
|
|
253
|
-
|
|
255
|
+
if (options.includesKey) {
|
|
256
|
+
return isStylePropKeyIncluded && !isEmpty(stylePropValue);
|
|
257
|
+
}
|
|
258
|
+
return !isStylePropKeyIncluded;
|
|
254
259
|
};
|
|
255
260
|
const useStyleUtilities = (props, prefix = '', additionalProps = {}) => {
|
|
256
261
|
const styleProps = Object.assign(Object.assign(Object.assign(Object.assign({}, SpacingStyleProp), DisplayStyleProps), ThemeStyleProps), additionalProps);
|
|
@@ -339,11 +344,11 @@ const useClick = (isDisabled, onClick) => React.useCallback((event) => {
|
|
|
339
344
|
}, [isDisabled, onClick]);
|
|
340
345
|
|
|
341
346
|
const useDeprecationMessage = ({ method = 'component', trigger, componentName, componentProps, propertyProps, customText, }) => {
|
|
342
|
-
let message;
|
|
343
|
-
let hasProps;
|
|
344
347
|
const messageBase = `Deprecation warning (${componentName}):`;
|
|
345
348
|
React.useEffect(() => {
|
|
346
349
|
const isExecutable = trigger && componentName && process.env.NODE_ENV === 'development';
|
|
350
|
+
let message;
|
|
351
|
+
let hasProps;
|
|
347
352
|
switch (method) {
|
|
348
353
|
case 'property':
|
|
349
354
|
if (propertyProps === null || propertyProps === void 0 ? void 0 : propertyProps.delete) {
|
|
@@ -378,6 +383,63 @@ const useDeprecationMessage = ({ method = 'component', trigger, componentName, c
|
|
|
378
383
|
}, []);
|
|
379
384
|
};
|
|
380
385
|
|
|
386
|
+
const defaultLabels = {
|
|
387
|
+
common: {
|
|
388
|
+
close: 'Close',
|
|
389
|
+
edit: 'Edit',
|
|
390
|
+
remove: 'Remove',
|
|
391
|
+
},
|
|
392
|
+
breadcrumbs: {
|
|
393
|
+
back: 'Go back',
|
|
394
|
+
},
|
|
395
|
+
fileUploader: {
|
|
396
|
+
edit: 'Edit',
|
|
397
|
+
remove: 'Remove',
|
|
398
|
+
attachments: 'Attachments',
|
|
399
|
+
},
|
|
400
|
+
pagination: {
|
|
401
|
+
next: 'Next',
|
|
402
|
+
previous: 'Previous',
|
|
403
|
+
goToPage: 'Go to page',
|
|
404
|
+
},
|
|
405
|
+
textField: {
|
|
406
|
+
password: {
|
|
407
|
+
show: 'Show password',
|
|
408
|
+
hide: 'Hide password',
|
|
409
|
+
},
|
|
410
|
+
},
|
|
411
|
+
splitButton: {
|
|
412
|
+
dropdown: 'More',
|
|
413
|
+
},
|
|
414
|
+
};
|
|
415
|
+
|
|
416
|
+
const replaceTranslationParams = (translation, params) => Object.entries(params).reduce((result, [paramKey, value]) => {
|
|
417
|
+
const safeParamKey = paramKey.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
418
|
+
return result.replace(new RegExp(`\\{${safeParamKey}\\}`, 'g'), String(value));
|
|
419
|
+
}, translation);
|
|
420
|
+
|
|
421
|
+
const resolveTranslationKey = (obj, path) => {
|
|
422
|
+
const keys = path.split('.');
|
|
423
|
+
let current = obj;
|
|
424
|
+
for (const key of keys) {
|
|
425
|
+
if (typeof current === 'object' && current !== null && key in current) {
|
|
426
|
+
current = current[key];
|
|
427
|
+
}
|
|
428
|
+
else {
|
|
429
|
+
return path;
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
return typeof current === 'string' ? current : path;
|
|
433
|
+
};
|
|
434
|
+
|
|
435
|
+
const useI18n = () => {
|
|
436
|
+
const t = (key, params) => {
|
|
437
|
+
const translation = resolveTranslationKey(defaultLabels, key);
|
|
438
|
+
return !params ? translation : replaceTranslationParams(translation, params);
|
|
439
|
+
};
|
|
440
|
+
return { t };
|
|
441
|
+
};
|
|
442
|
+
|
|
381
443
|
const defaultContext = undefined;
|
|
382
444
|
const IconsContext = React.createContext(defaultContext);
|
|
383
445
|
IconsContext.Provider;
|
|
@@ -392,6 +454,43 @@ const useIcon = (name) => {
|
|
|
392
454
|
return '';
|
|
393
455
|
};
|
|
394
456
|
|
|
457
|
+
const SYMMETRICAL_CLASS_SUFFIX = '--symmetrical';
|
|
458
|
+
const NON_SYMMETRICAL_CLASS_SUFFIX = '--asymmetrical';
|
|
459
|
+
function getSymmetryClassNamesReducer(componentClass, isSymmetrical) {
|
|
460
|
+
return (acc, breakpoint) => {
|
|
461
|
+
if (breakpoint in isSymmetrical) {
|
|
462
|
+
const value = isSymmetrical[breakpoint];
|
|
463
|
+
const infix = breakpoint === BREAKPOINT_MOBILE ? '' : `--${breakpoint}`;
|
|
464
|
+
if (value) {
|
|
465
|
+
return {
|
|
466
|
+
classes: [...acc.classes, `${componentClass}${infix}${SYMMETRICAL_CLASS_SUFFIX}`],
|
|
467
|
+
wasSymmetrical: true,
|
|
468
|
+
};
|
|
469
|
+
}
|
|
470
|
+
if (acc.wasSymmetrical) {
|
|
471
|
+
return {
|
|
472
|
+
classes: [...acc.classes, `${componentClass}${infix}${NON_SYMMETRICAL_CLASS_SUFFIX}`],
|
|
473
|
+
wasSymmetrical: acc.wasSymmetrical,
|
|
474
|
+
};
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
return acc;
|
|
478
|
+
};
|
|
479
|
+
}
|
|
480
|
+
function useSymmetry(componentClass, isSymmetrical) {
|
|
481
|
+
if (typeof isSymmetrical !== 'object' || isSymmetrical === null) {
|
|
482
|
+
return {
|
|
483
|
+
isSymmetricalActive: isSymmetrical === true,
|
|
484
|
+
symmetricalClassName: isSymmetrical ? `${componentClass}${SYMMETRICAL_CLASS_SUFFIX}` : '',
|
|
485
|
+
};
|
|
486
|
+
}
|
|
487
|
+
const { classes } = Object.keys(spiritDesignTokens.breakpoints).reduce(getSymmetryClassNamesReducer(componentClass, isSymmetrical), { classes: [], wasSymmetrical: false });
|
|
488
|
+
return {
|
|
489
|
+
isSymmetricalActive: Object.values(isSymmetrical).includes(true),
|
|
490
|
+
symmetricalClassName: classes.join(' '),
|
|
491
|
+
};
|
|
492
|
+
}
|
|
493
|
+
|
|
395
494
|
const usePaginationStyleProps = (props) => {
|
|
396
495
|
const paginationRootClass = useClassNamePrefix('Pagination');
|
|
397
496
|
const paginationItemClass = `${paginationRootClass}__item`;
|
|
@@ -464,16 +563,16 @@ function useButtonStyleProps(props) {
|
|
|
464
563
|
const buttonBlockClass = `${buttonClass}--block`;
|
|
465
564
|
const buttonDisabledClass = `${buttonClass}--disabled`;
|
|
466
565
|
const buttonLoadingClass = `${buttonClass}--loading`;
|
|
467
|
-
const
|
|
468
|
-
if (isBlock &&
|
|
566
|
+
const { isSymmetricalActive, symmetricalClassName } = useSymmetry(buttonClass, isSymmetrical);
|
|
567
|
+
if (isBlock && isSymmetricalActive) {
|
|
469
568
|
warning(false, 'isBlock and isSymmetrical props are mutually exclusive');
|
|
470
569
|
}
|
|
570
|
+
const shouldApplyBlock = () => isBlock && !isSymmetricalActive;
|
|
471
571
|
const classProps = classNames(buttonClass, getButtonColorClassname(buttonClass, color), getButtonSizeClassname(buttonClass, size), {
|
|
472
|
-
[buttonBlockClass]:
|
|
572
|
+
[buttonBlockClass]: shouldApplyBlock(),
|
|
473
573
|
[buttonDisabledClass]: isDisabled || isLoading,
|
|
474
574
|
[buttonLoadingClass]: isLoading,
|
|
475
|
-
|
|
476
|
-
});
|
|
575
|
+
}, symmetricalClassName);
|
|
477
576
|
return {
|
|
478
577
|
classProps,
|
|
479
578
|
props: restProps,
|
|
@@ -565,6 +664,7 @@ const _Icon = (props, ref) => {
|
|
|
565
664
|
};
|
|
566
665
|
const Icon = React.forwardRef(_Icon);
|
|
567
666
|
Icon.spiritComponent = 'Icon';
|
|
667
|
+
Icon.displayName = 'Icon';
|
|
568
668
|
|
|
569
669
|
var __rest$b = (undefined && undefined.__rest) || function (s, e) {
|
|
570
670
|
var t = {};
|
|
@@ -620,17 +720,19 @@ const defaultProps$1 = {
|
|
|
620
720
|
const _Button = (props, ref) => {
|
|
621
721
|
const propsWithContext = usePropsContext();
|
|
622
722
|
const propsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaultProps$1), props), propsWithContext);
|
|
623
|
-
const { elementType
|
|
723
|
+
const { elementType = defaultProps$1.elementType, children } = propsWithDefaults, restProps = __rest$a(propsWithDefaults, ["elementType", "children"]);
|
|
724
|
+
const Component = elementType;
|
|
624
725
|
const { buttonProps } = useButtonProps(restProps);
|
|
625
726
|
const { classProps, props: modifiedProps } = useButtonStyleProps(restProps);
|
|
626
727
|
const { styleProps, props: otherProps } = useStyleProps(modifiedProps);
|
|
627
|
-
const mergedStyleProps = mergeStyleProps(
|
|
628
|
-
return (React.createElement(
|
|
728
|
+
const mergedStyleProps = mergeStyleProps(Component, { classProps, styleProps, otherProps });
|
|
729
|
+
return (React.createElement(Component, Object.assign({}, otherProps, buttonProps, { ref: ref }, mergedStyleProps),
|
|
629
730
|
children,
|
|
630
731
|
restProps.isLoading && React.createElement(Spinner, null)));
|
|
631
732
|
};
|
|
632
733
|
const Button = React.forwardRef(_Button);
|
|
633
734
|
Button.spiritComponent = 'Button';
|
|
735
|
+
Button.displayName = 'Button';
|
|
634
736
|
|
|
635
737
|
const useButtonLinkProps = (props) => {
|
|
636
738
|
const { elementType, isDisabled, isLoading, onClick, href, target, rel } = props;
|
|
@@ -672,16 +774,16 @@ function useButtonLinkStyleProps(props) {
|
|
|
672
774
|
const buttonBlockClass = `${buttonClass}--block`;
|
|
673
775
|
const buttonDisabledClass = `${buttonClass}--disabled`;
|
|
674
776
|
const buttonLoadingClass = `${buttonClass}--loading`;
|
|
675
|
-
const
|
|
676
|
-
if (isBlock &&
|
|
777
|
+
const { isSymmetricalActive, symmetricalClassName } = useSymmetry(buttonClass, isSymmetrical);
|
|
778
|
+
if (isBlock && isSymmetricalActive) {
|
|
677
779
|
warning(false, 'isBlock and isSymmetrical props are mutually exclusive');
|
|
678
780
|
}
|
|
781
|
+
const shouldApplyBlock = () => isBlock && !isSymmetricalActive;
|
|
679
782
|
const classProps = classNames(buttonClass, getButtonLinkColorClassname(buttonClass, color), getButtonLinkSizeClassname(buttonClass, size), {
|
|
680
|
-
[buttonBlockClass]:
|
|
783
|
+
[buttonBlockClass]: shouldApplyBlock(),
|
|
681
784
|
[buttonDisabledClass]: isDisabled || isLoading,
|
|
682
785
|
[buttonLoadingClass]: isLoading,
|
|
683
|
-
|
|
684
|
-
});
|
|
786
|
+
}, symmetricalClassName);
|
|
685
787
|
return {
|
|
686
788
|
classProps,
|
|
687
789
|
props: restProps,
|
|
@@ -710,17 +812,19 @@ const defaultProps = {
|
|
|
710
812
|
};
|
|
711
813
|
const _ButtonLink = (props, ref) => {
|
|
712
814
|
const propsWithDefaults = Object.assign(Object.assign({}, defaultProps), props);
|
|
713
|
-
const { elementType
|
|
815
|
+
const { elementType = defaultProps.elementType, children } = propsWithDefaults, restProps = __rest$8(propsWithDefaults, ["elementType", "children"]);
|
|
816
|
+
const Component = elementType;
|
|
714
817
|
const { buttonLinkProps } = useButtonLinkProps(propsWithDefaults);
|
|
715
818
|
const { classProps, props: modifiedProps } = useButtonLinkStyleProps(restProps);
|
|
716
819
|
const { styleProps, props: otherProps } = useStyleProps(modifiedProps);
|
|
717
|
-
const mergedStyleProps = mergeStyleProps(
|
|
718
|
-
return (React.createElement(
|
|
820
|
+
const mergedStyleProps = mergeStyleProps(Component, { classProps, styleProps, otherProps });
|
|
821
|
+
return (React.createElement(Component, Object.assign({}, otherProps, buttonLinkProps, mergedStyleProps, { ref: ref }),
|
|
719
822
|
children,
|
|
720
823
|
restProps.isLoading && React.createElement(Spinner, null)));
|
|
721
824
|
};
|
|
722
825
|
const ButtonLink = React.forwardRef(_ButtonLink);
|
|
723
826
|
ButtonLink.spiritComponent = 'ButtonLink';
|
|
827
|
+
ButtonLink.displayName = 'ButtonLink';
|
|
724
828
|
|
|
725
829
|
var __rest$7 = (undefined && undefined.__rest) || function (s, e) {
|
|
726
830
|
var t = {};
|
|
@@ -762,10 +866,6 @@ const VisuallyHidden = (props) => {
|
|
|
762
866
|
};
|
|
763
867
|
VisuallyHidden.spiritComponent = 'VisuallyHidden';
|
|
764
868
|
|
|
765
|
-
const PAGINATION_PREVIOUS_LINK_DEFAULT_ACCESSIBILITY_LABEL = 'Previous';
|
|
766
|
-
const PAGINATION_NEXT_LINK_DEFAULT_ACCESSIBILITY_LABEL = 'Next';
|
|
767
|
-
const PAGINATION_LINK_DEFAULT_ACCESSIBILITY_LABEL_PREFIX = 'Go to page';
|
|
768
|
-
|
|
769
869
|
var __rest$5 = (undefined && undefined.__rest) || function (s, e) {
|
|
770
870
|
var t = {};
|
|
771
871
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -778,19 +878,20 @@ var __rest$5 = (undefined && undefined.__rest) || function (s, e) {
|
|
|
778
878
|
return t;
|
|
779
879
|
};
|
|
780
880
|
const _PaginationButtonLink = (props, ref) => {
|
|
781
|
-
const
|
|
782
|
-
|
|
783
|
-
|
|
881
|
+
const { t } = useI18n();
|
|
882
|
+
const _a = props, { direction, accessibilityLabel } = _a, restProps = __rest$5(_a, ["direction", "accessibilityLabel"]);
|
|
883
|
+
const directionLabel = accessibilityLabel !== null && accessibilityLabel !== void 0 ? accessibilityLabel : (direction === 'previous' ? t('pagination.previous') : t('pagination.next'));
|
|
784
884
|
const iconType = {
|
|
785
885
|
previous: 'chevron-left',
|
|
786
886
|
next: 'chevron-right',
|
|
787
887
|
};
|
|
788
888
|
return (React.createElement(ButtonLink, Object.assign({ color: "secondary", isSymmetrical: true }, restProps, { ref: ref }),
|
|
789
889
|
React.createElement(Icon, { name: iconType[direction] }),
|
|
790
|
-
React.createElement(VisuallyHidden, null,
|
|
890
|
+
React.createElement(VisuallyHidden, null, directionLabel)));
|
|
791
891
|
};
|
|
792
892
|
const PaginationButtonLink = React.forwardRef(_PaginationButtonLink);
|
|
793
893
|
PaginationButtonLink.spiritComponent = 'PaginationButtonLink';
|
|
894
|
+
PaginationButtonLink.displayName = 'PaginationButtonLink';
|
|
794
895
|
|
|
795
896
|
var __rest$4 = (undefined && undefined.__rest) || function (s, e) {
|
|
796
897
|
var t = {};
|
|
@@ -823,17 +924,20 @@ var __rest$3 = (undefined && undefined.__rest) || function (s, e) {
|
|
|
823
924
|
return t;
|
|
824
925
|
};
|
|
825
926
|
const _PaginationLink = (props, ref) => {
|
|
826
|
-
const {
|
|
827
|
-
const
|
|
927
|
+
const { t } = useI18n();
|
|
928
|
+
const { elementType = 'a', accessibilityLabel, isCurrent, pageNumber } = props, restProps = __rest$3(props, ["elementType", "accessibilityLabel", "isCurrent", "pageNumber"]);
|
|
929
|
+
const visuallyHiddenLabel = accessibilityLabel || `${t('pagination.goToPage')} ${pageNumber}`;
|
|
930
|
+
const Component = elementType;
|
|
828
931
|
const { classProps } = usePaginationStyleProps({ isCurrent });
|
|
829
932
|
const { styleProps, props: otherProps } = useStyleProps(restProps);
|
|
830
|
-
const mergedStyleProps = mergeStyleProps(
|
|
831
|
-
return (React.createElement(
|
|
933
|
+
const mergedStyleProps = mergeStyleProps(Component, { classProps: classProps.link, styleProps, otherProps });
|
|
934
|
+
return (React.createElement(Component, Object.assign({}, (isCurrent && { 'aria-current': 'page' }), otherProps, mergedStyleProps, { ref: ref }),
|
|
832
935
|
React.createElement(VisuallyHidden, null, visuallyHiddenLabel),
|
|
833
936
|
React.createElement("span", { "aria-hidden": "true" }, pageNumber)));
|
|
834
937
|
};
|
|
835
938
|
const PaginationLink = React.forwardRef(_PaginationLink);
|
|
836
939
|
PaginationLink.spiritComponent = 'PaginationLink';
|
|
940
|
+
PaginationLink.displayName = 'PaginationLink';
|
|
837
941
|
|
|
838
942
|
var __rest$2 = (undefined && undefined.__rest) || function (s, e) {
|
|
839
943
|
var t = {};
|
|
@@ -847,11 +951,14 @@ var __rest$2 = (undefined && undefined.__rest) || function (s, e) {
|
|
|
847
951
|
return t;
|
|
848
952
|
};
|
|
849
953
|
const _PaginationLinkNext = (_a, ref) => {
|
|
850
|
-
var { accessibilityLabel
|
|
851
|
-
|
|
954
|
+
var { accessibilityLabel } = _a, restProps = __rest$2(_a, ["accessibilityLabel"]);
|
|
955
|
+
const { t } = useI18n();
|
|
956
|
+
const nextLabel = accessibilityLabel !== null && accessibilityLabel !== void 0 ? accessibilityLabel : t('pagination.next');
|
|
957
|
+
return React.createElement(PaginationButtonLink, Object.assign({ direction: "next", accessibilityLabel: nextLabel }, restProps, { ref: ref }));
|
|
852
958
|
};
|
|
853
959
|
const PaginationLinkNext = React.forwardRef(_PaginationLinkNext);
|
|
854
960
|
PaginationLinkNext.spiritComponent = 'PaginationLinkNext';
|
|
961
|
+
PaginationLinkNext.displayName = 'PaginationLinkNext';
|
|
855
962
|
|
|
856
963
|
var __rest$1 = (undefined && undefined.__rest) || function (s, e) {
|
|
857
964
|
var t = {};
|
|
@@ -865,11 +972,14 @@ var __rest$1 = (undefined && undefined.__rest) || function (s, e) {
|
|
|
865
972
|
return t;
|
|
866
973
|
};
|
|
867
974
|
const _PaginationLinkPrevious = (_a, ref) => {
|
|
868
|
-
var { accessibilityLabel
|
|
869
|
-
|
|
975
|
+
var { accessibilityLabel } = _a, restProps = __rest$1(_a, ["accessibilityLabel"]);
|
|
976
|
+
const { t } = useI18n();
|
|
977
|
+
const previousLabel = accessibilityLabel !== null && accessibilityLabel !== void 0 ? accessibilityLabel : t('pagination.previous');
|
|
978
|
+
return React.createElement(PaginationButtonLink, Object.assign({ direction: "previous", accessibilityLabel: previousLabel }, restProps, { ref: ref }));
|
|
870
979
|
};
|
|
871
980
|
const PaginationLinkPrevious = React.forwardRef(_PaginationLinkPrevious);
|
|
872
981
|
PaginationLinkPrevious.spiritComponent = 'PaginationLinkPrevious';
|
|
982
|
+
PaginationLinkPrevious.displayName = 'PaginationLinkPrevious';
|
|
873
983
|
|
|
874
984
|
const usePagination = ({ totalPages, onChange, defaultPage, visiblePages }) => {
|
|
875
985
|
const [currentPage, setCurrentPage] = React.useState(defaultPage <= 0 || defaultPage > totalPages ? 1 : (defaultPage !== null && defaultPage !== void 0 ? defaultPage : 1));
|
|
@@ -916,7 +1026,11 @@ var __rest = (undefined && undefined.__rest) || function (s, e) {
|
|
|
916
1026
|
return t;
|
|
917
1027
|
};
|
|
918
1028
|
const UncontrolledPagination = (props) => {
|
|
919
|
-
const {
|
|
1029
|
+
const { t } = useI18n();
|
|
1030
|
+
const { accessibilityLabel, accessibilityLabelPrevious, accessibilityLabelNext, defaultPage = 1, onChange, totalPages = 0, visiblePages = 5 } = props, rest = __rest(props, ["accessibilityLabel", "accessibilityLabelPrevious", "accessibilityLabelNext", "defaultPage", "onChange", "totalPages", "visiblePages"]);
|
|
1031
|
+
const resolvedAccessibilityLabel = accessibilityLabel !== null && accessibilityLabel !== void 0 ? accessibilityLabel : t('pagination.goToPage');
|
|
1032
|
+
const resolvedAccessibilityLabelPrevious = accessibilityLabelPrevious !== null && accessibilityLabelPrevious !== void 0 ? accessibilityLabelPrevious : t('pagination.previous');
|
|
1033
|
+
const resolvedAccessibilityLabelNext = accessibilityLabelNext !== null && accessibilityLabelNext !== void 0 ? accessibilityLabelNext : t('pagination.next');
|
|
920
1034
|
const { currentPage, pages, handlePageChange } = usePagination({
|
|
921
1035
|
defaultPage,
|
|
922
1036
|
onChange,
|
|
@@ -924,25 +1038,22 @@ const UncontrolledPagination = (props) => {
|
|
|
924
1038
|
visiblePages,
|
|
925
1039
|
});
|
|
926
1040
|
return (React.createElement(Pagination, Object.assign({}, rest),
|
|
927
|
-
currentPage !== 1 && (React.createElement(PaginationLinkPrevious, { accessibilityLabel:
|
|
1041
|
+
currentPage !== 1 && (React.createElement(PaginationLinkPrevious, { accessibilityLabel: resolvedAccessibilityLabelPrevious, onClick: (event) => {
|
|
928
1042
|
event.preventDefault();
|
|
929
1043
|
handlePageChange(currentPage - 1);
|
|
930
1044
|
} })), pages === null || pages === void 0 ? void 0 :
|
|
931
1045
|
pages.map((pageNumber) => (React.createElement(PaginationItem, { key: pageNumber },
|
|
932
|
-
React.createElement(PaginationLink, { accessibilityLabel: `${
|
|
1046
|
+
React.createElement(PaginationLink, { accessibilityLabel: `${resolvedAccessibilityLabel} ${pageNumber}`, href: "#", isCurrent: currentPage === pageNumber, pageNumber: pageNumber, onClick: (event) => {
|
|
933
1047
|
event.preventDefault();
|
|
934
1048
|
handlePageChange(pageNumber);
|
|
935
1049
|
} })))),
|
|
936
|
-
currentPage !== totalPages && (React.createElement(PaginationLinkNext, { accessibilityLabel:
|
|
1050
|
+
currentPage !== totalPages && (React.createElement(PaginationLinkNext, { accessibilityLabel: resolvedAccessibilityLabelNext, onClick: (event) => {
|
|
937
1051
|
event.preventDefault();
|
|
938
1052
|
handlePageChange(currentPage + 1);
|
|
939
1053
|
} }))));
|
|
940
1054
|
};
|
|
941
1055
|
UncontrolledPagination.spiritComponent = 'UncontrolledPagination';
|
|
942
1056
|
|
|
943
|
-
exports.PAGINATION_LINK_DEFAULT_ACCESSIBILITY_LABEL_PREFIX = PAGINATION_LINK_DEFAULT_ACCESSIBILITY_LABEL_PREFIX;
|
|
944
|
-
exports.PAGINATION_NEXT_LINK_DEFAULT_ACCESSIBILITY_LABEL = PAGINATION_NEXT_LINK_DEFAULT_ACCESSIBILITY_LABEL;
|
|
945
|
-
exports.PAGINATION_PREVIOUS_LINK_DEFAULT_ACCESSIBILITY_LABEL = PAGINATION_PREVIOUS_LINK_DEFAULT_ACCESSIBILITY_LABEL;
|
|
946
1057
|
exports.Pagination = Pagination;
|
|
947
1058
|
exports.PaginationButtonLink = PaginationButtonLink;
|
|
948
1059
|
exports.PaginationItem = PaginationItem;
|