@telus-uds/components-base 1.96.0 → 1.97.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/CHANGELOG.md +30 -2
- package/babel.config.cjs +35 -0
- package/{jest.config-android.js → jest.config-android.cjs} +1 -1
- package/{jest.config-ios.js → jest.config-ios.cjs} +1 -1
- package/{jest.config-web.js → jest.config-web.cjs} +1 -1
- package/jest.config.cjs +40 -0
- package/lib/A11yInfoProvider/index.js +29 -35
- package/lib/A11yText/index.js +16 -24
- package/lib/ActionCard/ActionCard.js +47 -55
- package/lib/ActionCard/index.js +2 -10
- package/lib/ActivityIndicator/Spinner.js +20 -28
- package/lib/ActivityIndicator/Spinner.native.js +32 -40
- package/lib/ActivityIndicator/index.js +18 -22
- package/lib/ActivityIndicator/shared.js +12 -23
- package/lib/Autocomplete/Autocomplete.js +90 -99
- package/lib/Autocomplete/Loading.js +14 -22
- package/lib/Autocomplete/Suggestions.js +23 -31
- package/lib/Autocomplete/constants.js +4 -14
- package/lib/Autocomplete/dictionary.js +2 -9
- package/lib/Autocomplete/index.js +2 -10
- package/lib/Badge/Badge.js +18 -26
- package/lib/Badge/index.js +2 -10
- package/lib/BaseProvider/HydrationContext.js +13 -23
- package/lib/BaseProvider/index.js +24 -29
- package/lib/Box/Box.js +60 -68
- package/lib/Box/backgroundImageStylesMap.js +2 -9
- package/lib/Box/index.js +2 -10
- package/lib/Button/Button.js +15 -25
- package/lib/Button/ButtonBase.js +37 -46
- package/lib/Button/ButtonDropdown.js +37 -47
- package/lib/Button/ButtonGroup.js +53 -61
- package/lib/Button/ButtonLink.js +21 -29
- package/lib/Button/index.js +5 -34
- package/lib/Button/propTypes.js +16 -25
- package/lib/Card/Card.js +47 -55
- package/lib/Card/CardBase.js +27 -35
- package/lib/Card/PressableCardBase.js +26 -35
- package/lib/Card/index.js +4 -33
- package/lib/CardGroup/CardGroup.js +45 -55
- package/lib/CardGroup/dictionary.js +2 -9
- package/lib/CardGroup/index.js +2 -10
- package/lib/Carousel/Carousel.js +138 -146
- package/lib/Carousel/CarouselContext.js +19 -27
- package/lib/Carousel/CarouselFirstFocus/CarouselFirstFocus.js +15 -22
- package/lib/Carousel/CarouselItem/CarouselItem.js +44 -56
- package/lib/Carousel/CarouselItem/index.js +2 -10
- package/lib/Carousel/CarouselStepTracker/CarouselStepTracker.js +12 -20
- package/lib/Carousel/CarouselStepTracker/index.js +2 -10
- package/lib/Carousel/CarouselTabs/CarouselTabs.js +16 -23
- package/lib/Carousel/CarouselTabs/CarouselTabsPanel.js +20 -28
- package/lib/Carousel/CarouselTabs/CarouselTabsPanelItem.js +23 -31
- package/lib/Carousel/CarouselTabs/index.js +2 -10
- package/lib/Carousel/CarouselThumbnail.js +19 -27
- package/lib/Carousel/CarouselThumbnailNavigation.js +22 -30
- package/lib/Carousel/dictionary.js +2 -9
- package/lib/Carousel/index.js +3 -36
- package/lib/Checkbox/Checkbox.js +52 -60
- package/lib/Checkbox/CheckboxButton.js +32 -41
- package/lib/Checkbox/CheckboxGroup.js +41 -49
- package/lib/Checkbox/CheckboxInput.js +15 -21
- package/lib/Checkbox/CheckboxInput.native.js +1 -8
- package/lib/Checkbox/index.js +3 -17
- package/lib/CheckboxCard/CheckboxCard.js +45 -55
- package/lib/CheckboxCard/index.js +2 -10
- package/lib/CheckboxCardGroup/CheckboxCardGroup.js +42 -52
- package/lib/CheckboxCardGroup/index.js +2 -10
- package/lib/ColourToggle/ColourBubble.js +23 -31
- package/lib/ColourToggle/ColourToggle.js +27 -35
- package/lib/ColourToggle/index.js +2 -10
- package/lib/Divider/Divider.js +23 -31
- package/lib/Divider/index.js +2 -10
- package/lib/DownloadApp/DownloadApp.js +32 -40
- package/lib/DownloadApp/dictionary.js +2 -9
- package/lib/DownloadApp/index.js +2 -10
- package/lib/ExpandCollapse/Accordion.js +7 -13
- package/lib/ExpandCollapse/Control.js +26 -34
- package/lib/ExpandCollapse/ExpandCollapse.js +22 -30
- package/lib/ExpandCollapse/Panel.js +43 -51
- package/lib/ExpandCollapse/dictionary.js +2 -9
- package/lib/ExpandCollapse/index.js +7 -20
- package/lib/Feedback/Feedback.js +33 -41
- package/lib/Feedback/index.js +2 -10
- package/lib/Fieldset/Fieldset.js +37 -43
- package/lib/Fieldset/FieldsetContainer.js +17 -25
- package/lib/Fieldset/FieldsetContainer.native.js +12 -20
- package/lib/Fieldset/Legend.js +10 -16
- package/lib/Fieldset/Legend.native.js +11 -17
- package/lib/Fieldset/cssReset.js +2 -9
- package/lib/Fieldset/index.js +2 -10
- package/lib/FileUpload/FileUpload.js +50 -58
- package/lib/FileUpload/NotificationContent.js +12 -18
- package/lib/FileUpload/dictionary.js +2 -9
- package/lib/FileUpload/index.js +2 -10
- package/lib/FlexGrid/Col/Col.js +35 -43
- package/lib/FlexGrid/Col/index.js +2 -10
- package/lib/FlexGrid/FlexGrid.js +38 -46
- package/lib/FlexGrid/Row/Row.js +24 -32
- package/lib/FlexGrid/Row/index.js +2 -10
- package/lib/FlexGrid/helpers/index.js +1 -8
- package/lib/FlexGrid/index.js +2 -10
- package/lib/FlexGrid/providers/GutterContext.js +3 -11
- package/lib/Footnote/Footnote.js +63 -71
- package/lib/Footnote/FootnoteLink.js +30 -38
- package/lib/Footnote/dictionary.js +2 -9
- package/lib/Footnote/index.js +4 -12
- package/lib/HorizontalScroll/HorizontalScroll.js +32 -41
- package/lib/HorizontalScroll/HorizontalScrollButton.js +25 -33
- package/lib/HorizontalScroll/ScrollViewEnd.js +12 -20
- package/lib/HorizontalScroll/ScrollViewEnd.native.js +9 -16
- package/lib/HorizontalScroll/dictionary.js +2 -9
- package/lib/HorizontalScroll/index.js +11 -28
- package/lib/HorizontalScroll/itemPositions.js +17 -27
- package/lib/Icon/Icon.js +21 -30
- package/lib/Icon/IconText.js +29 -39
- package/lib/Icon/index.js +4 -25
- package/lib/IconButton/IconButton.js +35 -42
- package/lib/IconButton/index.js +2 -10
- package/lib/InputLabel/InputLabel.js +38 -47
- package/lib/InputLabel/LabelContent.js +8 -16
- package/lib/InputLabel/LabelContent.native.js +8 -17
- package/lib/InputLabel/index.js +2 -10
- package/lib/InputSupports/InputSupports.js +27 -35
- package/lib/InputSupports/index.js +2 -10
- package/lib/InputSupports/useInputSupports.js +5 -13
- package/lib/Link/ChevronLink.js +22 -28
- package/lib/Link/InlinePressable.js +13 -19
- package/lib/Link/InlinePressable.native.js +14 -23
- package/lib/Link/Link.js +9 -17
- package/lib/Link/LinkBase.js +40 -48
- package/lib/Link/TextButton.js +16 -22
- package/lib/Link/index.js +5 -34
- package/lib/List/List.js +22 -30
- package/lib/List/ListItem.js +12 -18
- package/lib/List/ListItemBase.js +33 -40
- package/lib/List/ListItemContent.js +22 -31
- package/lib/List/ListItemMark.js +24 -33
- package/lib/List/PressableListItemBase.js +32 -40
- package/lib/List/index.js +5 -24
- package/lib/Listbox/GroupControl.js +29 -33
- package/lib/Listbox/Listbox.js +40 -50
- package/lib/Listbox/ListboxContext.js +4 -12
- package/lib/Listbox/ListboxGroup.js +31 -40
- package/lib/Listbox/ListboxItem.js +23 -31
- package/lib/Listbox/ListboxOverlay.js +26 -35
- package/lib/Listbox/PressableItem.js +22 -30
- package/lib/Listbox/index.js +2 -10
- package/lib/Modal/Modal.js +75 -85
- package/lib/Modal/ModalContent.js +51 -58
- package/lib/Modal/WebModal.js +15 -23
- package/lib/Modal/dictionary.js +2 -9
- package/lib/Modal/index.js +2 -10
- package/lib/MultiSelectFilter/ModalOverlay.js +45 -53
- package/lib/MultiSelectFilter/MultiSelectFilter.js +110 -118
- package/lib/MultiSelectFilter/dictionary.js +2 -9
- package/lib/MultiSelectFilter/index.js +2 -10
- package/lib/Notification/Notification.js +59 -67
- package/lib/Notification/dictionary.js +2 -9
- package/lib/Notification/index.js +2 -10
- package/lib/OrderedList/Item.js +31 -39
- package/lib/OrderedList/ItemBase.js +13 -22
- package/lib/OrderedList/OrderedList.js +17 -25
- package/lib/OrderedList/OrderedListBase.js +12 -21
- package/lib/OrderedList/index.js +2 -10
- package/lib/Pagination/PageButton.js +22 -32
- package/lib/Pagination/Pagination.js +48 -51
- package/lib/Pagination/SideButton.js +25 -32
- package/lib/Pagination/constants.js +3 -0
- package/lib/Pagination/dictionary.js +2 -9
- package/lib/Pagination/index.js +2 -10
- package/lib/Pagination/usePagination.js +14 -12
- package/lib/Portal/Portal.js +8 -15
- package/lib/Portal/Portal.native.js +2 -9
- package/lib/Portal/index.js +2 -10
- package/lib/PriceLockup/PriceLockup.js +37 -45
- package/lib/PriceLockup/index.js +2 -10
- package/lib/PriceLockup/utils/renderFootnoteContent.js +20 -28
- package/lib/PriceLockup/utils/renderFootnoteLinks.js +5 -13
- package/lib/PriceLockup/utils/renderPrice.js +30 -38
- package/lib/PriceLockup/utils/renderTypography.js +5 -13
- package/lib/ProductCard/ProductCard.js +62 -70
- package/lib/ProductCard/dictionary.js +2 -9
- package/lib/ProductCard/index.js +2 -10
- package/lib/ProductCardGroup/ProductCardGroup.js +20 -28
- package/lib/ProductCardGroup/index.js +2 -10
- package/lib/Progress/Progress.js +15 -23
- package/lib/Progress/ProgressBar.js +23 -31
- package/lib/Progress/ProgressBarBackground.js +10 -18
- package/lib/Progress/index.js +4 -12
- package/lib/QuickLinks/QuickLinks.js +23 -29
- package/lib/QuickLinks/QuickLinksCard.js +14 -20
- package/lib/QuickLinks/QuickLinksItem.js +22 -28
- package/lib/QuickLinks/index.js +4 -12
- package/lib/QuickLinksFeature/QuickLinksFeature.js +20 -27
- package/lib/QuickLinksFeature/QuickLinksFeatureItem.js +31 -38
- package/lib/QuickLinksFeature/index.js +4 -12
- package/lib/Radio/Radio.js +43 -53
- package/lib/Radio/RadioButton.js +34 -43
- package/lib/Radio/RadioGroup.js +43 -51
- package/lib/Radio/RadioInput.js +15 -21
- package/lib/Radio/RadioInput.native.js +1 -8
- package/lib/Radio/index.js +3 -17
- package/lib/RadioCard/RadioCard.js +43 -53
- package/lib/RadioCard/RadioCardGroup.js +42 -52
- package/lib/RadioCard/index.js +3 -17
- package/lib/Responsive/Responsive.js +16 -22
- package/lib/Responsive/ResponsiveProp.js +13 -21
- package/lib/Responsive/ResponsiveWithMediaQueryStyleSheet.js +15 -23
- package/lib/Responsive/index.js +2 -10
- package/lib/Search/Search.js +47 -55
- package/lib/Search/dictionary.js +2 -9
- package/lib/Search/index.js +2 -10
- package/lib/Select/Group.js +9 -17
- package/lib/Select/Group.native.js +5 -13
- package/lib/Select/Item.js +8 -16
- package/lib/Select/Item.native.js +1 -8
- package/lib/Select/Picker.js +27 -35
- package/lib/Select/Picker.native.js +34 -41
- package/lib/Select/Select.js +45 -54
- package/lib/Select/constants.js +4 -14
- package/lib/Select/index.js +6 -14
- package/lib/SideNav/Item.js +29 -37
- package/lib/SideNav/ItemContent.js +17 -26
- package/lib/SideNav/ItemsGroup.js +25 -32
- package/lib/SideNav/SideNav.js +28 -38
- package/lib/SideNav/index.js +1 -13
- package/lib/Skeleton/Skeleton.js +32 -40
- package/lib/Skeleton/index.js +2 -10
- package/lib/Skeleton/skeleton.constant.js +2 -10
- package/lib/Skeleton/skeletonWebAnimation.js +1 -8
- package/lib/Skeleton/useSkeletonNativeAnimation.js +14 -22
- package/lib/SkipLink/SkipLink.js +24 -33
- package/lib/SkipLink/index.js +2 -10
- package/lib/Spacer/Spacer.js +15 -21
- package/lib/Spacer/index.js +2 -10
- package/lib/StackView/StackView.js +28 -36
- package/lib/StackView/StackWrap.js +14 -21
- package/lib/StackView/StackWrap.native.js +2 -9
- package/lib/StackView/StackWrapBox.js +27 -35
- package/lib/StackView/StackWrapGap.js +22 -30
- package/lib/StackView/common.js +4 -13
- package/lib/StackView/getStackedContent.js +14 -22
- package/lib/StackView/index.js +5 -24
- package/lib/Status/Status.js +27 -35
- package/lib/Status/index.js +2 -10
- package/lib/StepTracker/Step.js +35 -43
- package/lib/StepTracker/StepTracker.js +38 -46
- package/lib/StepTracker/dictionary.js +2 -9
- package/lib/StepTracker/index.js +2 -10
- package/lib/TabBar/TabBar.js +28 -36
- package/lib/TabBar/TabBarItem.js +33 -42
- package/lib/TabBar/index.js +2 -10
- package/lib/Tabs/Tabs.js +38 -48
- package/lib/Tabs/TabsItem.js +45 -53
- package/lib/Tabs/index.js +2 -10
- package/lib/Tags/Tags.js +47 -55
- package/lib/Tags/index.js +2 -10
- package/lib/TextInput/TextArea.js +19 -27
- package/lib/TextInput/TextInput.js +18 -26
- package/lib/TextInput/TextInputBase.js +64 -73
- package/lib/TextInput/dictionary.js +2 -9
- package/lib/TextInput/index.js +3 -20
- package/lib/TextInput/propTypes.js +8 -15
- package/lib/ThemeProvider/ThemeProvider.js +25 -36
- package/lib/ThemeProvider/index.js +7 -60
- package/lib/ThemeProvider/useResponsiveThemeTokens.js +10 -18
- package/lib/ThemeProvider/useSetTheme.js +5 -12
- package/lib/ThemeProvider/useTheme.js +4 -11
- package/lib/ThemeProvider/useThemeTokens.js +15 -24
- package/lib/ThemeProvider/utils/index.js +2 -27
- package/lib/ThemeProvider/utils/styles.js +12 -24
- package/lib/ThemeProvider/utils/theme-tokens.js +19 -34
- package/lib/Timeline/Timeline.js +28 -34
- package/lib/Timeline/index.js +2 -10
- package/lib/ToggleSwitch/ToggleSwitch.js +40 -48
- package/lib/ToggleSwitch/ToggleSwitchGroup.js +43 -51
- package/lib/ToggleSwitch/index.js +3 -20
- package/lib/Tooltip/Backdrop.js +8 -16
- package/lib/Tooltip/Backdrop.native.js +16 -22
- package/lib/Tooltip/Tooltip.js +42 -50
- package/lib/Tooltip/Tooltip.native.js +80 -61
- package/lib/Tooltip/dictionary.js +2 -9
- package/lib/Tooltip/getTooltipPosition.js +1 -9
- package/lib/Tooltip/index.js +5 -13
- package/lib/Tooltip/shared.js +17 -20
- package/lib/TooltipButton/TooltipButton.js +25 -33
- package/lib/TooltipButton/index.js +2 -10
- package/lib/Typography/Typography.js +39 -46
- package/lib/Typography/index.js +2 -10
- package/lib/Validator/Validator.js +42 -50
- package/lib/Validator/index.js +2 -10
- package/lib/ViewportProvider/ViewportProvider.js +13 -19
- package/lib/ViewportProvider/index.js +3 -23
- package/lib/ViewportProvider/useViewport.js +3 -11
- package/lib/ViewportProvider/useViewportListener.js +10 -17
- package/lib/index.js +71 -772
- package/lib/server.js +4 -40
- package/lib/utils/BaseView/BaseView.js +14 -20
- package/lib/utils/BaseView/BaseView.native.js +2 -10
- package/lib/utils/BaseView/index.js +2 -10
- package/lib/utils/a11y/index.js +2 -27
- package/lib/utils/a11y/semantics.js +11 -35
- package/lib/utils/a11y/textSize.js +7 -16
- package/lib/utils/animation/index.js +2 -13
- package/lib/utils/animation/useVerticalExpandAnimation.js +19 -26
- package/lib/utils/children.js +12 -20
- package/lib/utils/containUniqueFields.js +1 -8
- package/lib/utils/convertFromMegaByteToByte.js +1 -7
- package/lib/utils/floating-ui/index.js +1 -42
- package/lib/utils/floating-ui/index.native.js +1 -42
- package/lib/utils/formatImageSource.js +1 -8
- package/lib/utils/hasOwnProperty.js +1 -7
- package/lib/utils/htmlAttrs.js +11 -19
- package/lib/utils/index.js +25 -245
- package/lib/utils/info/index.js +6 -13
- package/lib/utils/info/platform/index.js +8 -13
- package/lib/utils/info/platform/platform.android.js +1 -8
- package/lib/utils/info/platform/platform.ios.js +1 -8
- package/lib/utils/info/platform/platform.js +1 -8
- package/lib/utils/info/platform/platform.native.js +1 -8
- package/lib/utils/info/versions.js +4 -11
- package/lib/utils/input.js +13 -21
- package/lib/utils/pressability.js +14 -22
- package/lib/utils/props/a11yProps.js +90 -98
- package/lib/utils/props/clickProps.js +4 -12
- package/lib/utils/props/componentPropType.js +1 -7
- package/lib/utils/props/copyPropTypes.js +2 -10
- package/lib/utils/props/getPropSelector.js +6 -11
- package/lib/utils/props/handlerProps.js +23 -31
- package/lib/utils/props/hrefAttrsProp.js +6 -13
- package/lib/utils/props/index.js +19 -168
- package/lib/utils/props/inputSupportsProps.js +12 -20
- package/lib/utils/props/linkProps.js +16 -24
- package/lib/utils/props/paddingProp.js +8 -16
- package/lib/utils/props/pressProps.js +22 -31
- package/lib/utils/props/rectProp.js +8 -16
- package/lib/utils/props/responsiveProps.js +5 -13
- package/lib/utils/props/selectSystemProps.js +1 -7
- package/lib/utils/props/spacingProps.js +12 -19
- package/lib/utils/props/textInputProps.js +56 -62
- package/lib/utils/props/textProps.js +18 -24
- package/lib/utils/props/tokens.js +16 -26
- package/lib/utils/props/variantProp.js +4 -11
- package/lib/utils/props/viewProps.js +10 -18
- package/lib/utils/ssr-media-query/create-stylesheet/create-stylesheet-mobile.js +8 -16
- package/lib/utils/ssr-media-query/create-stylesheet/index.android.js +2 -10
- package/lib/utils/ssr-media-query/create-stylesheet/index.ios.js +2 -10
- package/lib/utils/ssr-media-query/create-stylesheet/index.js +12 -20
- package/lib/utils/ssr-media-query/hash.js +1 -7
- package/lib/utils/ssr-media-query/index.js +4 -17
- package/lib/utils/ssr-media-query/utils/common.js +1 -12
- package/lib/utils/ssr-media-query/utils/create-declaration-block.js +6 -14
- package/lib/utils/ssr-media-query/utils/create-media-query-styles.js +5 -12
- package/lib/utils/ssr-media-query/utils/hyphenate-style-name.js +1 -8
- package/lib/utils/ssr-media-query/utils/inject.js +8 -18
- package/lib/utils/ssr.js +19 -28
- package/lib/utils/transformGradient.js +3 -11
- package/lib/utils/useCopy.js +2 -10
- package/lib/utils/useHash.js +7 -14
- package/lib/utils/useHash.native.js +1 -8
- package/lib/utils/useOverlaidPosition.js +17 -25
- package/lib/utils/useResponsiveProp.js +10 -19
- package/lib/utils/useSafeLayoutEffect.js +6 -13
- package/lib/utils/useScrollBlocking.js +10 -17
- package/lib/utils/useScrollBlocking.native.js +1 -8
- package/lib/utils/useSpacingScale.js +7 -14
- package/lib/utils/useUniqueId.js +3 -10
- package/lib/utils/withLinkRouter.js +13 -19
- package/package.json +20 -25
- package/src/A11yInfoProvider/index.jsx +5 -2
- package/src/ActivityIndicator/index.jsx +12 -3
- package/src/BaseProvider/index.jsx +5 -2
- package/src/Carousel/Carousel.jsx +1 -1
- package/src/Carousel/CarouselItem/CarouselItem.jsx +16 -22
- package/src/Icon/IconText.jsx +0 -1
- package/src/InputLabel/InputLabel.jsx +2 -3
- package/src/List/ListItemBase.jsx +6 -1
- package/src/Listbox/GroupControl.jsx +6 -1
- package/src/Modal/ModalContent.jsx +3 -2
- package/src/Pagination/Pagination.jsx +9 -2
- package/src/Pagination/constants.js +3 -0
- package/src/Pagination/usePagination.js +14 -3
- package/src/TextInput/TextInputBase.jsx +1 -1
- package/src/Timeline/Timeline.jsx +6 -2
- package/src/Tooltip/Tooltip.native.jsx +31 -3
- package/src/Tooltip/shared.js +5 -0
- package/src/index.js +9 -10
- package/src/utils/a11y/semantics.js +0 -7
- package/types/FileUpload.d.ts +40 -0
- package/types/index.d.ts +3 -0
- package/lib-module/A11yInfoProvider/index.js +0 -62
- package/lib-module/A11yText/index.js +0 -68
- package/lib-module/ActionCard/ActionCard.js +0 -343
- package/lib-module/ActionCard/index.js +0 -2
- package/lib-module/ActivityIndicator/Spinner.js +0 -80
- package/lib-module/ActivityIndicator/Spinner.native.js +0 -144
- package/lib-module/ActivityIndicator/index.js +0 -44
- package/lib-module/ActivityIndicator/shared.js +0 -14
- package/lib-module/Autocomplete/Autocomplete.js +0 -481
- package/lib-module/Autocomplete/Loading.js +0 -36
- package/lib-module/Autocomplete/Suggestions.js +0 -66
- package/lib-module/Autocomplete/constants.js +0 -4
- package/lib-module/Autocomplete/dictionary.js +0 -12
- package/lib-module/Autocomplete/index.js +0 -2
- package/lib-module/Badge/Badge.js +0 -102
- package/lib-module/Badge/index.js +0 -2
- package/lib-module/BaseProvider/HydrationContext.js +0 -48
- package/lib-module/BaseProvider/index.js +0 -38
- package/lib-module/Box/Box.js +0 -379
- package/lib-module/Box/backgroundImageStylesMap.js +0 -94
- package/lib-module/Box/index.js +0 -2
- package/lib-module/Button/Button.js +0 -34
- package/lib-module/Button/ButtonBase.js +0 -347
- package/lib-module/Button/ButtonDropdown.js +0 -173
- package/lib-module/Button/ButtonGroup.js +0 -272
- package/lib-module/Button/ButtonLink.js +0 -50
- package/lib-module/Button/index.js +0 -5
- package/lib-module/Button/propTypes.js +0 -46
- package/lib-module/Card/Card.js +0 -330
- package/lib-module/Card/CardBase.js +0 -114
- package/lib-module/Card/PressableCardBase.js +0 -112
- package/lib-module/Card/index.js +0 -4
- package/lib-module/CardGroup/CardGroup.js +0 -210
- package/lib-module/CardGroup/dictionary.js +0 -8
- package/lib-module/CardGroup/index.js +0 -2
- package/lib-module/Carousel/Carousel.js +0 -894
- package/lib-module/Carousel/CarouselContext.js +0 -51
- package/lib-module/Carousel/CarouselFirstFocus/CarouselFirstFocus.js +0 -53
- package/lib-module/Carousel/CarouselItem/CarouselItem.js +0 -150
- package/lib-module/Carousel/CarouselItem/index.js +0 -2
- package/lib-module/Carousel/CarouselStepTracker/CarouselStepTracker.js +0 -54
- package/lib-module/Carousel/CarouselStepTracker/index.js +0 -2
- package/lib-module/Carousel/CarouselTabs/CarouselTabs.js +0 -50
- package/lib-module/Carousel/CarouselTabs/CarouselTabsPanel.js +0 -89
- package/lib-module/Carousel/CarouselTabs/CarouselTabsPanelItem.js +0 -118
- package/lib-module/Carousel/CarouselTabs/index.js +0 -2
- package/lib-module/Carousel/CarouselThumbnail.js +0 -113
- package/lib-module/Carousel/CarouselThumbnailNavigation.js +0 -71
- package/lib-module/Carousel/dictionary.js +0 -22
- package/lib-module/Carousel/index.js +0 -3
- package/lib-module/Checkbox/Checkbox.js +0 -343
- package/lib-module/Checkbox/CheckboxButton.js +0 -164
- package/lib-module/Checkbox/CheckboxGroup.js +0 -240
- package/lib-module/Checkbox/CheckboxInput.js +0 -50
- package/lib-module/Checkbox/CheckboxInput.native.js +0 -5
- package/lib-module/Checkbox/index.js +0 -3
- package/lib-module/CheckboxCard/CheckboxCard.js +0 -183
- package/lib-module/CheckboxCard/index.js +0 -2
- package/lib-module/CheckboxCardGroup/CheckboxCardGroup.js +0 -206
- package/lib-module/CheckboxCardGroup/index.js +0 -2
- package/lib-module/ColourToggle/ColourBubble.js +0 -126
- package/lib-module/ColourToggle/ColourToggle.js +0 -92
- package/lib-module/ColourToggle/index.js +0 -2
- package/lib-module/Divider/Divider.js +0 -133
- package/lib-module/Divider/index.js +0 -2
- package/lib-module/DownloadApp/DownloadApp.js +0 -160
- package/lib-module/DownloadApp/dictionary.js +0 -10
- package/lib-module/DownloadApp/index.js +0 -2
- package/lib-module/ExpandCollapse/Accordion.js +0 -15
- package/lib-module/ExpandCollapse/Control.js +0 -165
- package/lib-module/ExpandCollapse/ExpandCollapse.js +0 -98
- package/lib-module/ExpandCollapse/Panel.js +0 -242
- package/lib-module/ExpandCollapse/dictionary.js +0 -10
- package/lib-module/ExpandCollapse/index.js +0 -7
- package/lib-module/Feedback/Feedback.js +0 -161
- package/lib-module/Feedback/index.js +0 -2
- package/lib-module/Fieldset/Fieldset.js +0 -194
- package/lib-module/Fieldset/FieldsetContainer.js +0 -48
- package/lib-module/Fieldset/FieldsetContainer.native.js +0 -32
- package/lib-module/Fieldset/Legend.js +0 -24
- package/lib-module/Fieldset/Legend.native.js +0 -31
- package/lib-module/Fieldset/cssReset.js +0 -14
- package/lib-module/Fieldset/index.js +0 -2
- package/lib-module/FileUpload/FileUpload.js +0 -329
- package/lib-module/FileUpload/NotificationContent.js +0 -55
- package/lib-module/FileUpload/dictionary.js +0 -40
- package/lib-module/FileUpload/index.js +0 -2
- package/lib-module/FlexGrid/Col/Col.js +0 -257
- package/lib-module/FlexGrid/Col/index.js +0 -2
- package/lib-module/FlexGrid/FlexGrid.js +0 -158
- package/lib-module/FlexGrid/Row/Row.js +0 -181
- package/lib-module/FlexGrid/Row/index.js +0 -2
- package/lib-module/FlexGrid/helpers/index.js +0 -15
- package/lib-module/FlexGrid/index.js +0 -2
- package/lib-module/FlexGrid/providers/GutterContext.js +0 -3
- package/lib-module/Footnote/Footnote.js +0 -317
- package/lib-module/Footnote/FootnoteLink.js +0 -107
- package/lib-module/Footnote/dictionary.js +0 -12
- package/lib-module/Footnote/index.js +0 -4
- package/lib-module/HorizontalScroll/HorizontalScroll.js +0 -165
- package/lib-module/HorizontalScroll/HorizontalScrollButton.js +0 -79
- package/lib-module/HorizontalScroll/ScrollViewEnd.js +0 -46
- package/lib-module/HorizontalScroll/ScrollViewEnd.native.js +0 -26
- package/lib-module/HorizontalScroll/dictionary.js +0 -11
- package/lib-module/HorizontalScroll/index.js +0 -11
- package/lib-module/HorizontalScroll/itemPositions.js +0 -113
- package/lib-module/Icon/Icon.js +0 -93
- package/lib-module/Icon/IconText.js +0 -114
- package/lib-module/Icon/index.js +0 -4
- package/lib-module/IconButton/IconButton.js +0 -203
- package/lib-module/IconButton/index.js +0 -2
- package/lib-module/InputLabel/InputLabel.js +0 -146
- package/lib-module/InputLabel/LabelContent.js +0 -28
- package/lib-module/InputLabel/LabelContent.native.js +0 -18
- package/lib-module/InputLabel/index.js +0 -2
- package/lib-module/InputSupports/InputSupports.js +0 -108
- package/lib-module/InputSupports/index.js +0 -2
- package/lib-module/InputSupports/useInputSupports.js +0 -31
- package/lib-module/Link/ChevronLink.js +0 -68
- package/lib-module/Link/InlinePressable.js +0 -48
- package/lib-module/Link/InlinePressable.native.js +0 -87
- package/lib-module/Link/Link.js +0 -28
- package/lib-module/Link/LinkBase.js +0 -269
- package/lib-module/Link/TextButton.js +0 -43
- package/lib-module/Link/index.js +0 -5
- package/lib-module/List/List.js +0 -77
- package/lib-module/List/ListItem.js +0 -32
- package/lib-module/List/ListItemBase.js +0 -164
- package/lib-module/List/ListItemContent.js +0 -73
- package/lib-module/List/ListItemMark.js +0 -126
- package/lib-module/List/PressableListItemBase.js +0 -112
- package/lib-module/List/index.js +0 -5
- package/lib-module/Listbox/GroupControl.js +0 -102
- package/lib-module/Listbox/Listbox.js +0 -172
- package/lib-module/Listbox/ListboxContext.js +0 -4
- package/lib-module/Listbox/ListboxGroup.js +0 -125
- package/lib-module/Listbox/ListboxItem.js +0 -76
- package/lib-module/Listbox/ListboxOverlay.js +0 -78
- package/lib-module/Listbox/PressableItem.js +0 -140
- package/lib-module/Listbox/index.js +0 -2
- package/lib-module/Modal/Modal.js +0 -373
- package/lib-module/Modal/ModalContent.js +0 -179
- package/lib-module/Modal/WebModal.js +0 -76
- package/lib-module/Modal/dictionary.js +0 -9
- package/lib-module/Modal/index.js +0 -2
- package/lib-module/MultiSelectFilter/ModalOverlay.js +0 -156
- package/lib-module/MultiSelectFilter/MultiSelectFilter.js +0 -526
- package/lib-module/MultiSelectFilter/dictionary.js +0 -12
- package/lib-module/MultiSelectFilter/index.js +0 -2
- package/lib-module/Notification/Notification.js +0 -429
- package/lib-module/Notification/dictionary.js +0 -8
- package/lib-module/Notification/index.js +0 -2
- package/lib-module/OrderedList/Item.js +0 -160
- package/lib-module/OrderedList/ItemBase.js +0 -43
- package/lib-module/OrderedList/OrderedList.js +0 -64
- package/lib-module/OrderedList/OrderedListBase.js +0 -36
- package/lib-module/OrderedList/index.js +0 -2
- package/lib-module/Pagination/PageButton.js +0 -74
- package/lib-module/Pagination/Pagination.js +0 -211
- package/lib-module/Pagination/SideButton.js +0 -113
- package/lib-module/Pagination/dictionary.js +0 -18
- package/lib-module/Pagination/index.js +0 -2
- package/lib-module/Pagination/usePagination.js +0 -69
- package/lib-module/Portal/Portal.js +0 -50
- package/lib-module/Portal/Portal.native.js +0 -2
- package/lib-module/Portal/index.js +0 -2
- package/lib-module/PriceLockup/PriceLockup.js +0 -225
- package/lib-module/PriceLockup/index.js +0 -2
- package/lib-module/PriceLockup/utils/renderFootnoteContent.js +0 -87
- package/lib-module/PriceLockup/utils/renderFootnoteLinks.js +0 -28
- package/lib-module/PriceLockup/utils/renderPrice.js +0 -141
- package/lib-module/PriceLockup/utils/renderTypography.js +0 -23
- package/lib-module/ProductCard/ProductCard.js +0 -232
- package/lib-module/ProductCard/dictionary.js +0 -38
- package/lib-module/ProductCard/index.js +0 -2
- package/lib-module/ProductCardGroup/ProductCardGroup.js +0 -70
- package/lib-module/ProductCardGroup/index.js +0 -2
- package/lib-module/Progress/Progress.js +0 -88
- package/lib-module/Progress/ProgressBar.js +0 -133
- package/lib-module/Progress/ProgressBarBackground.js +0 -40
- package/lib-module/Progress/index.js +0 -4
- package/lib-module/QuickLinks/QuickLinks.js +0 -78
- package/lib-module/QuickLinks/QuickLinksCard.js +0 -33
- package/lib-module/QuickLinks/QuickLinksItem.js +0 -51
- package/lib-module/QuickLinks/index.js +0 -4
- package/lib-module/QuickLinksFeature/QuickLinksFeature.js +0 -69
- package/lib-module/QuickLinksFeature/QuickLinksFeatureItem.js +0 -147
- package/lib-module/QuickLinksFeature/index.js +0 -4
- package/lib-module/Radio/Radio.js +0 -283
- package/lib-module/Radio/RadioButton.js +0 -184
- package/lib-module/Radio/RadioGroup.js +0 -255
- package/lib-module/Radio/RadioInput.js +0 -50
- package/lib-module/Radio/RadioInput.native.js +0 -5
- package/lib-module/Radio/index.js +0 -3
- package/lib-module/RadioCard/RadioCard.js +0 -211
- package/lib-module/RadioCard/RadioCardGroup.js +0 -257
- package/lib-module/RadioCard/index.js +0 -3
- package/lib-module/Responsive/Responsive.js +0 -65
- package/lib-module/Responsive/ResponsiveProp.js +0 -39
- package/lib-module/Responsive/ResponsiveWithMediaQueryStyleSheet.js +0 -68
- package/lib-module/Responsive/index.js +0 -2
- package/lib-module/Search/Search.js +0 -242
- package/lib-module/Search/dictionary.js +0 -12
- package/lib-module/Search/index.js +0 -2
- package/lib-module/Select/Group.js +0 -24
- package/lib-module/Select/Group.native.js +0 -16
- package/lib-module/Select/Item.js +0 -23
- package/lib-module/Select/Item.native.js +0 -2
- package/lib-module/Select/Picker.js +0 -97
- package/lib-module/Select/Picker.native.js +0 -120
- package/lib-module/Select/Select.js +0 -337
- package/lib-module/Select/constants.js +0 -5
- package/lib-module/Select/index.js +0 -6
- package/lib-module/SideNav/Item.js +0 -143
- package/lib-module/SideNav/ItemContent.js +0 -50
- package/lib-module/SideNav/ItemsGroup.js +0 -121
- package/lib-module/SideNav/SideNav.js +0 -131
- package/lib-module/SideNav/index.js +0 -1
- package/lib-module/Skeleton/Skeleton.js +0 -177
- package/lib-module/Skeleton/index.js +0 -2
- package/lib-module/Skeleton/skeleton.constant.js +0 -2
- package/lib-module/Skeleton/skeletonWebAnimation.js +0 -14
- package/lib-module/Skeleton/useSkeletonNativeAnimation.js +0 -28
- package/lib-module/SkipLink/SkipLink.js +0 -190
- package/lib-module/SkipLink/index.js +0 -2
- package/lib-module/Spacer/Spacer.js +0 -95
- package/lib-module/Spacer/index.js +0 -2
- package/lib-module/StackView/StackView.js +0 -126
- package/lib-module/StackView/StackWrap.js +0 -51
- package/lib-module/StackView/StackWrap.native.js +0 -4
- package/lib-module/StackView/StackWrapBox.js +0 -114
- package/lib-module/StackView/StackWrapGap.js +0 -61
- package/lib-module/StackView/common.js +0 -35
- package/lib-module/StackView/getStackedContent.js +0 -123
- package/lib-module/StackView/index.js +0 -5
- package/lib-module/Status/Status.js +0 -167
- package/lib-module/Status/index.js +0 -2
- package/lib-module/StepTracker/Step.js +0 -265
- package/lib-module/StepTracker/StepTracker.js +0 -208
- package/lib-module/StepTracker/dictionary.js +0 -30
- package/lib-module/StepTracker/index.js +0 -2
- package/lib-module/TabBar/TabBar.js +0 -125
- package/lib-module/TabBar/TabBarItem.js +0 -177
- package/lib-module/TabBar/index.js +0 -2
- package/lib-module/Tabs/Tabs.js +0 -179
- package/lib-module/Tabs/TabsItem.js +0 -239
- package/lib-module/Tabs/index.js +0 -2
- package/lib-module/Tags/Tags.js +0 -245
- package/lib-module/Tags/index.js +0 -2
- package/lib-module/TextInput/TextArea.js +0 -97
- package/lib-module/TextInput/TextInput.js +0 -80
- package/lib-module/TextInput/TextInputBase.js +0 -436
- package/lib-module/TextInput/dictionary.js +0 -12
- package/lib-module/TextInput/index.js +0 -3
- package/lib-module/TextInput/propTypes.js +0 -34
- package/lib-module/ThemeProvider/ThemeProvider.js +0 -84
- package/lib-module/ThemeProvider/index.js +0 -7
- package/lib-module/ThemeProvider/useResponsiveThemeTokens.js +0 -81
- package/lib-module/ThemeProvider/useSetTheme.js +0 -24
- package/lib-module/ThemeProvider/useTheme.js +0 -11
- package/lib-module/ThemeProvider/useThemeTokens.js +0 -109
- package/lib-module/ThemeProvider/utils/index.js +0 -2
- package/lib-module/ThemeProvider/utils/styles.js +0 -198
- package/lib-module/ThemeProvider/utils/theme-tokens.js +0 -160
- package/lib-module/Timeline/Timeline.js +0 -168
- package/lib-module/Timeline/index.js +0 -2
- package/lib-module/ToggleSwitch/ToggleSwitch.js +0 -280
- package/lib-module/ToggleSwitch/ToggleSwitchGroup.js +0 -208
- package/lib-module/ToggleSwitch/index.js +0 -3
- package/lib-module/Tooltip/Backdrop.js +0 -50
- package/lib-module/Tooltip/Backdrop.native.js +0 -41
- package/lib-module/Tooltip/Tooltip.js +0 -280
- package/lib-module/Tooltip/Tooltip.native.js +0 -328
- package/lib-module/Tooltip/dictionary.js +0 -8
- package/lib-module/Tooltip/getTooltipPosition.js +0 -170
- package/lib-module/Tooltip/index.js +0 -5
- package/lib-module/Tooltip/shared.js +0 -36
- package/lib-module/TooltipButton/TooltipButton.js +0 -90
- package/lib-module/TooltipButton/index.js +0 -2
- package/lib-module/Typography/Typography.js +0 -254
- package/lib-module/Typography/index.js +0 -2
- package/lib-module/Validator/Validator.js +0 -222
- package/lib-module/Validator/index.js +0 -2
- package/lib-module/ViewportProvider/ViewportProvider.js +0 -27
- package/lib-module/ViewportProvider/index.js +0 -3
- package/lib-module/ViewportProvider/useViewport.js +0 -3
- package/lib-module/ViewportProvider/useViewportListener.js +0 -37
- package/lib-module/index.js +0 -76
- package/lib-module/server.js +0 -4
- package/lib-module/utils/BaseView/BaseView.js +0 -42
- package/lib-module/utils/BaseView/BaseView.native.js +0 -5
- package/lib-module/utils/BaseView/index.js +0 -2
- package/lib-module/utils/a11y/index.js +0 -2
- package/lib-module/utils/a11y/semantics.js +0 -144
- package/lib-module/utils/a11y/textSize.js +0 -35
- package/lib-module/utils/animation/index.js +0 -2
- package/lib-module/utils/animation/useVerticalExpandAnimation.js +0 -86
- package/lib-module/utils/children.js +0 -117
- package/lib-module/utils/containUniqueFields.js +0 -24
- package/lib-module/utils/convertFromMegaByteToByte.js +0 -10
- package/lib-module/utils/floating-ui/index.js +0 -1
- package/lib-module/utils/floating-ui/index.native.js +0 -1
- package/lib-module/utils/formatImageSource.js +0 -27
- package/lib-module/utils/hasOwnProperty.js +0 -11
- package/lib-module/utils/htmlAttrs.js +0 -23
- package/lib-module/utils/index.js +0 -25
- package/lib-module/utils/info/index.js +0 -8
- package/lib-module/utils/info/platform/index.js +0 -14
- package/lib-module/utils/info/platform/platform.android.js +0 -1
- package/lib-module/utils/info/platform/platform.ios.js +0 -1
- package/lib-module/utils/info/platform/platform.js +0 -1
- package/lib-module/utils/info/platform/platform.native.js +0 -4
- package/lib-module/utils/info/versions.js +0 -6
- package/lib-module/utils/input.js +0 -185
- package/lib-module/utils/pressability.js +0 -112
- package/lib-module/utils/props/a11yProps.js +0 -310
- package/lib-module/utils/props/clickProps.js +0 -25
- package/lib-module/utils/props/componentPropType.js +0 -50
- package/lib-module/utils/props/copyPropTypes.js +0 -2
- package/lib-module/utils/props/getPropSelector.js +0 -52
- package/lib-module/utils/props/handlerProps.js +0 -105
- package/lib-module/utils/props/hrefAttrsProp.js +0 -33
- package/lib-module/utils/props/index.js +0 -19
- package/lib-module/utils/props/inputSupportsProps.js +0 -68
- package/lib-module/utils/props/linkProps.js +0 -43
- package/lib-module/utils/props/paddingProp.js +0 -9
- package/lib-module/utils/props/pressProps.js +0 -42
- package/lib-module/utils/props/rectProp.js +0 -9
- package/lib-module/utils/props/responsiveProps.js +0 -28
- package/lib-module/utils/props/selectSystemProps.js +0 -23
- package/lib-module/utils/props/spacingProps.js +0 -57
- package/lib-module/utils/props/textInputProps.js +0 -188
- package/lib-module/utils/props/textProps.js +0 -61
- package/lib-module/utils/props/tokens.js +0 -130
- package/lib-module/utils/props/variantProp.js +0 -18
- package/lib-module/utils/props/viewProps.js +0 -21
- package/lib-module/utils/ssr-media-query/create-stylesheet/create-stylesheet-mobile.js +0 -48
- package/lib-module/utils/ssr-media-query/create-stylesheet/index.android.js +0 -2
- package/lib-module/utils/ssr-media-query/create-stylesheet/index.ios.js +0 -2
- package/lib-module/utils/ssr-media-query/create-stylesheet/index.js +0 -36
- package/lib-module/utils/ssr-media-query/hash.js +0 -13
- package/lib-module/utils/ssr-media-query/index.js +0 -6
- package/lib-module/utils/ssr-media-query/utils/common.js +0 -33
- package/lib-module/utils/ssr-media-query/utils/create-declaration-block.js +0 -16
- package/lib-module/utils/ssr-media-query/utils/create-media-query-styles.js +0 -60
- package/lib-module/utils/ssr-media-query/utils/hyphenate-style-name.js +0 -12
- package/lib-module/utils/ssr-media-query/utils/inject.js +0 -39
- package/lib-module/utils/ssr.js +0 -142
- package/lib-module/utils/transformGradient.js +0 -15
- package/lib-module/utils/useCopy.js +0 -42
- package/lib-module/utils/useHash.js +0 -41
- package/lib-module/utils/useHash.native.js +0 -6
- package/lib-module/utils/useOverlaidPosition.js +0 -214
- package/lib-module/utils/useResponsiveProp.js +0 -45
- package/lib-module/utils/useSafeLayoutEffect.js +0 -28
- package/lib-module/utils/useScrollBlocking.js +0 -51
- package/lib-module/utils/useScrollBlocking.native.js +0 -2
- package/lib-module/utils/useSpacingScale.js +0 -123
- package/lib-module/utils/useUniqueId.js +0 -11
- package/lib-module/utils/withLinkRouter.js +0 -84
package/lib/Carousel/Carousel.js
CHANGED
|
@@ -1,39 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
var _CarouselStepTracker = _interopRequireDefault(require("./CarouselStepTracker"));
|
|
25
|
-
var _CarouselThumbnailNavigation = _interopRequireDefault(require("./CarouselThumbnailNavigation"));
|
|
26
|
-
var _CarouselTabsPanel = _interopRequireDefault(require("./CarouselTabs/CarouselTabsPanel"));
|
|
27
|
-
var _CarouselTabsPanelItem = _interopRequireDefault(require("./CarouselTabs/CarouselTabsPanelItem"));
|
|
28
|
-
var _dictionary = _interopRequireDefault(require("./dictionary"));
|
|
29
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
30
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import View from "react-native-web/dist/exports/View";
|
|
3
|
+
import Animated from "react-native-web/dist/exports/Animated";
|
|
4
|
+
import PanResponder from "react-native-web/dist/exports/PanResponder";
|
|
5
|
+
import StyleSheet from "react-native-web/dist/exports/StyleSheet";
|
|
6
|
+
import Platform from "react-native-web/dist/exports/Platform";
|
|
7
|
+
import Dimensions from "react-native-web/dist/exports/Dimensions";
|
|
8
|
+
import PropTypes from 'prop-types';
|
|
9
|
+
import { useThemeTokens } from '../ThemeProvider';
|
|
10
|
+
import { useViewport } from '../ViewportProvider';
|
|
11
|
+
import { getTokensPropType, getA11yPropsFromHtmlTag, layoutTags, variantProp, selectSystemProps, a11yProps, viewProps, useCopy, unpackFragment } from '../utils';
|
|
12
|
+
import { useA11yInfo } from '../A11yInfoProvider';
|
|
13
|
+
import { CarouselProvider } from './CarouselContext';
|
|
14
|
+
import CarouselItem from './CarouselItem';
|
|
15
|
+
import IconButton from '../IconButton';
|
|
16
|
+
import SkipLink from '../SkipLink';
|
|
17
|
+
import A11yText from '../A11yText';
|
|
18
|
+
import CarouselStepTracker from './CarouselStepTracker';
|
|
19
|
+
import CarouselThumbnailNavigation from './CarouselThumbnailNavigation';
|
|
20
|
+
import CarouselTabsPanel from './CarouselTabs/CarouselTabsPanel';
|
|
21
|
+
import CarouselTabsPanelItem from './CarouselTabs/CarouselTabsPanelItem';
|
|
22
|
+
import dictionary from './dictionary';
|
|
23
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
31
24
|
const TRANSITION_MODES = {
|
|
32
25
|
MANUAL: 'manual',
|
|
33
26
|
AUTOMATIC: 'automatic',
|
|
34
27
|
SWIPE: 'swipe'
|
|
35
28
|
};
|
|
36
|
-
const staticStyles =
|
|
29
|
+
const staticStyles = StyleSheet.create({
|
|
37
30
|
root: {
|
|
38
31
|
backgroundColor: 'transparent',
|
|
39
32
|
justifyContent: 'center',
|
|
@@ -45,7 +38,7 @@ const staticStyles = _StyleSheet.default.create({
|
|
|
45
38
|
animationControlButton: {
|
|
46
39
|
position: 'absolute',
|
|
47
40
|
zIndex: 1,
|
|
48
|
-
right:
|
|
41
|
+
right: Platform.OS === 'web' ? undefined : 40,
|
|
49
42
|
top: 40
|
|
50
43
|
}
|
|
51
44
|
});
|
|
@@ -106,7 +99,7 @@ const selectPreviousNextNavigationButtonStyles = (previousNextNavigationButtonWi
|
|
|
106
99
|
};
|
|
107
100
|
};
|
|
108
101
|
const getPeekingProps = viewport => {
|
|
109
|
-
if (viewport === 'xs' || viewport === 'sm') {
|
|
102
|
+
if (viewport === 'xs' || viewport === 'sm' || viewport === 'md') {
|
|
110
103
|
return {
|
|
111
104
|
peekingFirstSpace: 48,
|
|
112
105
|
peekingGap: 16,
|
|
@@ -133,7 +126,7 @@ const selectIconStyles = _ref2 => {
|
|
|
133
126
|
backgroundColor: iconBackgroundColor
|
|
134
127
|
};
|
|
135
128
|
};
|
|
136
|
-
const [selectProps, selectedSystemPropTypes] =
|
|
129
|
+
const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, viewProps]);
|
|
137
130
|
|
|
138
131
|
/**
|
|
139
132
|
* Carousel is a general-purpose content slider that can be used to render content in terms of slides.
|
|
@@ -189,7 +182,7 @@ const [selectProps, selectedSystemPropTypes] = (0, _utils.selectSystemProps)([_u
|
|
|
189
182
|
- `spaceBetweenSlideAndPreviousNextNavigation` - Horizontal space between slide and previous/next navigational buttons
|
|
190
183
|
- `spaceBetweenSlideAndPanelNavigation` - Vertical space between slide area and panel navigation area
|
|
191
184
|
*/
|
|
192
|
-
const Carousel = /*#__PURE__*/
|
|
185
|
+
const Carousel = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
193
186
|
let {
|
|
194
187
|
tokens,
|
|
195
188
|
variant,
|
|
@@ -209,9 +202,9 @@ const Carousel = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) => {
|
|
|
209
202
|
title = 'carousel',
|
|
210
203
|
springConfig = undefined,
|
|
211
204
|
thumbnails = undefined,
|
|
212
|
-
panelNavigation = thumbnails ? /*#__PURE__*/(
|
|
205
|
+
panelNavigation = thumbnails ? /*#__PURE__*/_jsx(CarouselThumbnailNavigation, {
|
|
213
206
|
thumbnails: thumbnails
|
|
214
|
-
}) : /*#__PURE__*/(
|
|
207
|
+
}) : /*#__PURE__*/_jsx(CarouselStepTracker, {
|
|
215
208
|
variant: stepTrackerVariant
|
|
216
209
|
}),
|
|
217
210
|
tag = 'ul',
|
|
@@ -225,18 +218,18 @@ const Carousel = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) => {
|
|
|
225
218
|
enablePeeking = false,
|
|
226
219
|
...rest
|
|
227
220
|
} = _ref3;
|
|
228
|
-
let childrenArray =
|
|
221
|
+
let childrenArray = unpackFragment(children);
|
|
229
222
|
const autoPlayFeatureEnabled = autoPlay && slideDuration > 0 && transitionDuration > 0 && childrenArray.length > 1;
|
|
230
223
|
// if `Carousel` only has one `Carousel.Item`, convert this to a single-item array
|
|
231
224
|
if (!Array.isArray(childrenArray)) {
|
|
232
225
|
childrenArray = [childrenArray];
|
|
233
226
|
}
|
|
234
|
-
const getCopy =
|
|
235
|
-
dictionary
|
|
227
|
+
const getCopy = useCopy({
|
|
228
|
+
dictionary,
|
|
236
229
|
copy
|
|
237
230
|
});
|
|
238
|
-
const viewport =
|
|
239
|
-
const themeTokens =
|
|
231
|
+
const viewport = useViewport();
|
|
232
|
+
const themeTokens = useThemeTokens('Carousel', tokens, variant, {
|
|
240
233
|
viewport
|
|
241
234
|
});
|
|
242
235
|
const {
|
|
@@ -249,45 +242,45 @@ const Carousel = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) => {
|
|
|
249
242
|
showPanelTabs,
|
|
250
243
|
spaceBetweenSlideAndPreviousNextNavigation
|
|
251
244
|
} = themeTokens;
|
|
252
|
-
const [activeIndex, setActiveIndex] =
|
|
253
|
-
const activeIndexRef =
|
|
245
|
+
const [activeIndex, setActiveIndex] = React.useState(0);
|
|
246
|
+
const activeIndexRef = React.useRef(activeIndex);
|
|
254
247
|
const {
|
|
255
248
|
reduceMotionEnabled
|
|
256
|
-
} =
|
|
257
|
-
const reduceMotionRef =
|
|
258
|
-
const [containerLayout, setContainerLayout] =
|
|
249
|
+
} = useA11yInfo();
|
|
250
|
+
const reduceMotionRef = React.useRef(reduceMotionEnabled);
|
|
251
|
+
const [containerLayout, setContainerLayout] = React.useState({
|
|
259
252
|
x: 0,
|
|
260
253
|
y: 0,
|
|
261
254
|
width: 0
|
|
262
255
|
});
|
|
263
|
-
const containerLayoutRef =
|
|
264
|
-
const [previousNextNavigationButtonWidth, setPreviousNextNavigationButtonWidth] =
|
|
265
|
-
const firstFocusRef =
|
|
266
|
-
const pan =
|
|
267
|
-
const animatedX =
|
|
268
|
-
const animatedY =
|
|
269
|
-
const [isAnimating, setIsAnimating] =
|
|
256
|
+
const containerLayoutRef = React.useRef(containerLayout);
|
|
257
|
+
const [previousNextNavigationButtonWidth, setPreviousNextNavigationButtonWidth] = React.useState(0);
|
|
258
|
+
const firstFocusRef = React.useRef(null);
|
|
259
|
+
const pan = React.useRef(new Animated.ValueXY()).current;
|
|
260
|
+
const animatedX = React.useRef(0);
|
|
261
|
+
const animatedY = React.useRef(0);
|
|
262
|
+
const [isAnimating, setIsAnimating] = React.useState(false);
|
|
270
263
|
/**
|
|
271
264
|
* While having the same starting point, `isAutoPlayEnabled` and `isCarouselPlaying` are different states
|
|
272
265
|
*
|
|
273
266
|
* `isAutoPlayEnabled` is a state to determine if the autoplay feature is enabled or disabled
|
|
274
267
|
* `isCarouselPlaying` is a state to determine if the carousel is currently playing or paused
|
|
275
268
|
*/
|
|
276
|
-
const [isAutoPlayEnabled, setIsAutoPlayEnabled] =
|
|
277
|
-
const [isCarouselPlaying, setisCarouselPlaying] =
|
|
278
|
-
const isSwiping =
|
|
279
|
-
const autoPlayRef =
|
|
269
|
+
const [isAutoPlayEnabled, setIsAutoPlayEnabled] = React.useState(autoPlayFeatureEnabled);
|
|
270
|
+
const [isCarouselPlaying, setisCarouselPlaying] = React.useState(autoPlayFeatureEnabled);
|
|
271
|
+
const isSwiping = React.useRef(false);
|
|
272
|
+
const autoPlayRef = React.useRef(null);
|
|
280
273
|
const isFirstSlide = !activeIndex;
|
|
281
274
|
const isLastSlide = activeIndex + 1 >= childrenArray.length;
|
|
282
|
-
const handleAnimationStart =
|
|
275
|
+
const handleAnimationStart = React.useCallback(function () {
|
|
283
276
|
if (typeof onAnimationStart === 'function') onAnimationStart(...arguments);
|
|
284
277
|
setIsAnimating(true);
|
|
285
278
|
}, [onAnimationStart]);
|
|
286
|
-
const handleAnimationEnd =
|
|
279
|
+
const handleAnimationEnd = React.useCallback(function () {
|
|
287
280
|
if (typeof onAnimationEnd === 'function') onAnimationEnd(...arguments);
|
|
288
281
|
setIsAnimating(false);
|
|
289
282
|
}, [onAnimationEnd]);
|
|
290
|
-
const updateOffset =
|
|
283
|
+
const updateOffset = React.useCallback(() => {
|
|
291
284
|
animatedX.current = containerLayoutRef.current.width * activeIndexRef.current * -1;
|
|
292
285
|
animatedY.current = 0;
|
|
293
286
|
pan.setOffset({
|
|
@@ -299,7 +292,7 @@ const Carousel = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) => {
|
|
|
299
292
|
y: 0
|
|
300
293
|
});
|
|
301
294
|
}, [pan, animatedX]);
|
|
302
|
-
const animate =
|
|
295
|
+
const animate = React.useCallback((toValue, toIndex) => {
|
|
303
296
|
const handleAnimationEndToIndex = function () {
|
|
304
297
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
305
298
|
args[_key] = arguments[_key];
|
|
@@ -307,48 +300,48 @@ const Carousel = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) => {
|
|
|
307
300
|
return handleAnimationEnd(toIndex, ...args);
|
|
308
301
|
};
|
|
309
302
|
if (reduceMotionRef.current || isSwiping.current) {
|
|
310
|
-
|
|
303
|
+
Animated.timing(pan, {
|
|
311
304
|
toValue,
|
|
312
305
|
duration: 1,
|
|
313
306
|
useNativeDriver: false
|
|
314
307
|
}).start(handleAnimationEndToIndex);
|
|
315
308
|
} else if (isAutoPlayEnabled) {
|
|
316
|
-
|
|
309
|
+
Animated.timing(pan, {
|
|
317
310
|
...springConfig,
|
|
318
311
|
toValue,
|
|
319
312
|
useNativeDriver: false,
|
|
320
313
|
duration: transitionDuration * 1000
|
|
321
314
|
}).start(handleAnimationEndToIndex);
|
|
322
315
|
} else if (enablePeeking) {
|
|
323
|
-
|
|
316
|
+
Animated.timing(pan, {
|
|
324
317
|
...springConfig,
|
|
325
318
|
toValue,
|
|
326
319
|
useNativeDriver: false,
|
|
327
320
|
duration: transitionDuration ? transitionDuration * 1000 : 1000
|
|
328
321
|
}).start(handleAnimationEndToIndex);
|
|
329
322
|
} else {
|
|
330
|
-
|
|
323
|
+
Animated.spring(pan, {
|
|
331
324
|
...springConfig,
|
|
332
325
|
toValue,
|
|
333
326
|
useNativeDriver: false
|
|
334
327
|
}).start(handleAnimationEndToIndex);
|
|
335
328
|
}
|
|
336
329
|
}, [pan, springConfig, handleAnimationEnd, transitionDuration, isAutoPlayEnabled, enablePeeking]);
|
|
337
|
-
const stopAutoplay =
|
|
330
|
+
const stopAutoplay = React.useCallback(() => {
|
|
338
331
|
if (autoPlayRef !== null && autoPlayRef !== void 0 && autoPlayRef.current) {
|
|
339
332
|
clearTimeout(autoPlayRef === null || autoPlayRef === void 0 ? void 0 : autoPlayRef.current);
|
|
340
333
|
}
|
|
341
334
|
}, []);
|
|
342
|
-
const triggerRefocus =
|
|
343
|
-
if (refocus &&
|
|
335
|
+
const triggerRefocus = React.useCallback(() => {
|
|
336
|
+
if (refocus && Platform.OS === 'web') {
|
|
344
337
|
var _firstFocusRef$curren;
|
|
345
|
-
(_firstFocusRef$curren = firstFocusRef.current) === null || _firstFocusRef$curren === void 0
|
|
338
|
+
(_firstFocusRef$curren = firstFocusRef.current) === null || _firstFocusRef$curren === void 0 || _firstFocusRef$curren.focus({
|
|
346
339
|
preventScroll: true,
|
|
347
340
|
focusVisible: false
|
|
348
341
|
});
|
|
349
342
|
}
|
|
350
343
|
}, [refocus, firstFocusRef]);
|
|
351
|
-
const updateIndex =
|
|
344
|
+
const updateIndex = React.useCallback(function () {
|
|
352
345
|
let delta = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
353
346
|
let transitionMode = arguments.length > 1 ? arguments[1] : undefined;
|
|
354
347
|
const toValue = {
|
|
@@ -389,7 +382,7 @@ const Carousel = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) => {
|
|
|
389
382
|
if (onIndexChanged) onIndexChanged(calcDelta, index);
|
|
390
383
|
return calcDelta;
|
|
391
384
|
}, [handleAnimationStart, triggerRefocus, slideDuration, updateOffset, animate, childrenArray.length, onIndexChanged, isCarouselPlaying, stopAutoplay, isAutoPlayEnabled]);
|
|
392
|
-
const startAutoplay =
|
|
385
|
+
const startAutoplay = React.useCallback(() => {
|
|
393
386
|
stopAutoplay();
|
|
394
387
|
if (isAutoPlayEnabled) {
|
|
395
388
|
autoPlayRef.current = setTimeout(() => {
|
|
@@ -400,27 +393,27 @@ const Carousel = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) => {
|
|
|
400
393
|
}, Math.abs(slideDuration) * 1000);
|
|
401
394
|
}
|
|
402
395
|
}, [handleAnimationStart, triggerRefocus, updateIndex, updateOffset, slideDuration, stopAutoplay, isAutoPlayEnabled]);
|
|
403
|
-
const fixOffsetAndGo =
|
|
396
|
+
const fixOffsetAndGo = React.useCallback((delta, transitionMode) => {
|
|
404
397
|
updateOffset();
|
|
405
398
|
handleAnimationStart(activeIndexRef.current);
|
|
406
399
|
updateIndex(delta, transitionMode);
|
|
407
400
|
triggerRefocus();
|
|
408
401
|
}, [updateIndex, updateOffset, handleAnimationStart, triggerRefocus]);
|
|
409
|
-
const goToNeighboring =
|
|
402
|
+
const goToNeighboring = React.useCallback(function () {
|
|
410
403
|
let toPrev = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
411
404
|
let transitionMode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : TRANSITION_MODES.MANUAL;
|
|
412
405
|
fixOffsetAndGo(toPrev ? -1 : 1, transitionMode);
|
|
413
406
|
}, [fixOffsetAndGo]);
|
|
414
|
-
|
|
407
|
+
React.useEffect(() => {
|
|
415
408
|
activeIndexRef.current = activeIndex;
|
|
416
409
|
}, [activeIndex]);
|
|
417
|
-
|
|
410
|
+
React.useEffect(() => {
|
|
418
411
|
reduceMotionRef.current = reduceMotionEnabled;
|
|
419
412
|
}, [reduceMotionEnabled]);
|
|
420
|
-
|
|
413
|
+
React.useEffect(() => {
|
|
421
414
|
containerLayoutRef.current = containerLayout;
|
|
422
415
|
}, [containerLayout]);
|
|
423
|
-
|
|
416
|
+
React.useEffect(() => {
|
|
424
417
|
pan.x.addListener(_ref4 => {
|
|
425
418
|
let {
|
|
426
419
|
value
|
|
@@ -442,22 +435,22 @@ const Carousel = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) => {
|
|
|
442
435
|
pan.y.removeAllListeners();
|
|
443
436
|
};
|
|
444
437
|
}, [pan.x, pan.y, startAutoplay, stopAutoplay, isCarouselPlaying]);
|
|
445
|
-
|
|
446
|
-
const subscription =
|
|
438
|
+
React.useEffect(() => {
|
|
439
|
+
const subscription = Dimensions.addEventListener('change', () => {
|
|
447
440
|
updateOffset();
|
|
448
441
|
});
|
|
449
442
|
return () => {
|
|
450
443
|
if (subscription.remove) {
|
|
451
444
|
subscription.remove();
|
|
452
445
|
} else {
|
|
453
|
-
|
|
446
|
+
Dimensions.removeEventListener('change', updateOffset);
|
|
454
447
|
}
|
|
455
448
|
};
|
|
456
449
|
}, [updateOffset]);
|
|
457
|
-
|
|
450
|
+
React.useEffect(() => {
|
|
458
451
|
setIsAutoPlayEnabled(autoPlay && slideDuration > 0 && transitionDuration > 0 && childrenArray.length > 1);
|
|
459
452
|
}, [autoPlay, slideDuration, transitionDuration, childrenArray.length]);
|
|
460
|
-
|
|
453
|
+
React.useEffect(() => {
|
|
461
454
|
return () => {
|
|
462
455
|
stopAutoplay();
|
|
463
456
|
};
|
|
@@ -489,16 +482,16 @@ const Carousel = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) => {
|
|
|
489
482
|
} = _ref7;
|
|
490
483
|
return setPreviousNextNavigationButtonWidth(width);
|
|
491
484
|
};
|
|
492
|
-
const isSwipeAllowed =
|
|
485
|
+
const isSwipeAllowed = React.useCallback(() => {
|
|
493
486
|
if (childrenArray.length === 1) {
|
|
494
487
|
return false;
|
|
495
488
|
}
|
|
496
|
-
if (
|
|
489
|
+
if (Platform.OS === 'web') {
|
|
497
490
|
return !!(viewport === 'xs' || viewport === 'sm');
|
|
498
491
|
}
|
|
499
492
|
return true;
|
|
500
493
|
}, [viewport, childrenArray.length]);
|
|
501
|
-
const panResponder =
|
|
494
|
+
const panResponder = React.useMemo(() => PanResponder.create({
|
|
502
495
|
onPanResponderTerminationRequest: () => false,
|
|
503
496
|
onMoveShouldSetResponderCapture: () => true,
|
|
504
497
|
onMoveShouldSetPanResponderCapture: (_, gestureState) => {
|
|
@@ -516,7 +509,7 @@ const Carousel = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) => {
|
|
|
516
509
|
onPanResponderGrant: () => {
|
|
517
510
|
updateOffset();
|
|
518
511
|
},
|
|
519
|
-
onPanResponderMove:
|
|
512
|
+
onPanResponderMove: Animated.event([null, {
|
|
520
513
|
dx: pan.x
|
|
521
514
|
}], {
|
|
522
515
|
useNativeDriver: false
|
|
@@ -538,13 +531,13 @@ const Carousel = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) => {
|
|
|
538
531
|
isSwiping.current = false;
|
|
539
532
|
}
|
|
540
533
|
}), [updateIndex, updateOffset, animate, isSwipeAllowed, minDistanceForAction, handleAnimationStart, minDistanceToCapture, pan.x, startAutoplay, stopAutoplay, isCarouselPlaying]);
|
|
541
|
-
const goToNext =
|
|
534
|
+
const goToNext = React.useCallback(() => {
|
|
542
535
|
goToNeighboring();
|
|
543
536
|
}, [goToNeighboring]);
|
|
544
|
-
const goToPrev =
|
|
537
|
+
const goToPrev = React.useCallback(() => {
|
|
545
538
|
goToNeighboring(true);
|
|
546
539
|
}, [goToNeighboring]);
|
|
547
|
-
const goTo =
|
|
540
|
+
const goTo = React.useCallback(function () {
|
|
548
541
|
let index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
549
542
|
const delta = index - activeIndexRef.current;
|
|
550
543
|
if (delta) {
|
|
@@ -560,13 +553,13 @@ const Carousel = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) => {
|
|
|
560
553
|
raised: !(variant !== null && variant !== void 0 && variant.inverse) && true,
|
|
561
554
|
inverse: variant === null || variant === void 0 ? void 0 : variant.inverse
|
|
562
555
|
};
|
|
563
|
-
const getCopyWithPlaceholders =
|
|
556
|
+
const getCopyWithPlaceholders = React.useCallback(copyKey => {
|
|
564
557
|
const copyText = getCopy(copyKey).replace(/%\{title\}/g, title).replace(/%\{itemLabel\}/g, itemLabel).replace(/%\{stepNumber\}/g, activeIndex + 1).replace(/%\{stepCount\}/g, childrenArray.length);
|
|
565
558
|
|
|
566
559
|
// First word might be a lowercase placeholder: capitalize the first letter
|
|
567
560
|
return `${copyText[0].toUpperCase()}${copyText.slice(1)}`;
|
|
568
561
|
}, [activeIndex, childrenArray.length, itemLabel, getCopy, title]);
|
|
569
|
-
const activePanelNavigation = tabs && showPanelTabs ? /*#__PURE__*/(
|
|
562
|
+
const activePanelNavigation = tabs && showPanelTabs ? /*#__PURE__*/_jsx(CarouselTabsPanel, {
|
|
570
563
|
items: tabs
|
|
571
564
|
}) : panelNavigation;
|
|
572
565
|
const isFirstFocusContainer = Boolean(refocus && !skipLinkHref);
|
|
@@ -600,7 +593,7 @@ const Carousel = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) => {
|
|
|
600
593
|
focusable: true
|
|
601
594
|
})
|
|
602
595
|
};
|
|
603
|
-
const onAnimationControlButtonPress =
|
|
596
|
+
const onAnimationControlButtonPress = React.useCallback(() => {
|
|
604
597
|
if (isCarouselPlaying) {
|
|
605
598
|
stopAutoplay();
|
|
606
599
|
} else {
|
|
@@ -608,7 +601,7 @@ const Carousel = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) => {
|
|
|
608
601
|
}
|
|
609
602
|
setisCarouselPlaying(prevState => !prevState);
|
|
610
603
|
}, [isCarouselPlaying, stopAutoplay, startAutoplay]);
|
|
611
|
-
return /*#__PURE__*/(
|
|
604
|
+
return /*#__PURE__*/_jsxs(CarouselProvider, {
|
|
612
605
|
activeIndex: activeIndex,
|
|
613
606
|
goTo: goTo,
|
|
614
607
|
getCopyWithPlaceholders: getCopyWithPlaceholders,
|
|
@@ -618,9 +611,9 @@ const Carousel = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) => {
|
|
|
618
611
|
firstFocusRef: firstFocusRef,
|
|
619
612
|
refocus: refocus,
|
|
620
613
|
width: containerLayout.width,
|
|
621
|
-
children: [/*#__PURE__*/(
|
|
614
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
622
615
|
style: [staticStyles.root, {
|
|
623
|
-
...
|
|
616
|
+
...Platform.select({
|
|
624
617
|
web: {
|
|
625
618
|
outline: 'none'
|
|
626
619
|
}
|
|
@@ -630,7 +623,7 @@ const Carousel = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) => {
|
|
|
630
623
|
ref: ref,
|
|
631
624
|
...systemProps,
|
|
632
625
|
...containerProps,
|
|
633
|
-
children: [isAutoPlayEnabled ? /*#__PURE__*/(
|
|
626
|
+
children: [isAutoPlayEnabled ? /*#__PURE__*/_jsx(View, {
|
|
634
627
|
style: [staticStyles.animationControlButton, selectControlButtonPositionStyles({
|
|
635
628
|
positionVariant: previousNextNavigationPosition,
|
|
636
629
|
buttonWidth: previousNextNavigationButtonWidth,
|
|
@@ -638,16 +631,16 @@ const Carousel = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) => {
|
|
|
638
631
|
spaceBetweenSlideAndButton: spaceBetweenSlideAndPreviousNextNavigation,
|
|
639
632
|
enablePeeking
|
|
640
633
|
})],
|
|
641
|
-
children: /*#__PURE__*/(
|
|
634
|
+
children: /*#__PURE__*/_jsx(IconButton, {
|
|
642
635
|
icon: isCarouselPlaying ? pauseIcon : playIcon,
|
|
643
636
|
accessibilityLabel: isCarouselPlaying ? getCopy('pauseButtonLabel') : getCopy('playButtonLabel'),
|
|
644
637
|
variant: previousNextIconButtonVariants,
|
|
645
638
|
onPress: onAnimationControlButtonPress
|
|
646
639
|
})
|
|
647
|
-
}) : null, showPreviousNextNavigation && childrenArray.length > 1 ? /*#__PURE__*/(
|
|
640
|
+
}) : null, showPreviousNextNavigation && childrenArray.length > 1 ? /*#__PURE__*/_jsx(View, {
|
|
648
641
|
style: selectPreviousNextNavigationButtonStyles(previousNextNavigationButtonWidth, previousNextNavigationPosition, spaceBetweenSlideAndPreviousNextNavigation, isFirstSlide, isLastSlide, true, enablePeeking),
|
|
649
642
|
testID: "previous-button-container",
|
|
650
|
-
children: /*#__PURE__*/(
|
|
643
|
+
children: /*#__PURE__*/_jsx(IconButton, {
|
|
651
644
|
onLayout: onPreviousNextNavigationButtonLayout,
|
|
652
645
|
icon: previousIcon,
|
|
653
646
|
onPress: goToPrev,
|
|
@@ -655,20 +648,20 @@ const Carousel = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) => {
|
|
|
655
648
|
accessibilityLabel: getCopyWithPlaceholders('iconButtonLabel').replace('%{targetStep}', activeIndex),
|
|
656
649
|
tokens: selectIconStyles(themeTokens)
|
|
657
650
|
})
|
|
658
|
-
}) : null, Boolean(skipLinkHref) && /*#__PURE__*/(
|
|
651
|
+
}) : null, Boolean(skipLinkHref) && /*#__PURE__*/_jsx(SkipLink, {
|
|
659
652
|
ref: firstFocusRef,
|
|
660
653
|
href: skipLinkHref,
|
|
661
654
|
children: getCopyWithPlaceholders('skipLink')
|
|
662
|
-
}), !isFirstFocusContainer && /*#__PURE__*/(
|
|
655
|
+
}), !isFirstFocusContainer && /*#__PURE__*/_jsx(A11yText
|
|
663
656
|
// Read the current slide position to screen readers on slide.
|
|
664
657
|
// If it's set to refocus and doesn't have a SkipLink to focus to, focus this.
|
|
665
658
|
, {
|
|
666
659
|
accessibilityLiveRegion: !skipLinkHref && refocus ? undefined : 'polite',
|
|
667
660
|
text: getCopyWithPlaceholders('stepTrackerLabel')
|
|
668
|
-
}), /*#__PURE__*/(
|
|
661
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
669
662
|
style: selectContainerStyles(containerLayout.width),
|
|
670
|
-
children: /*#__PURE__*/(
|
|
671
|
-
style:
|
|
663
|
+
children: /*#__PURE__*/_jsx(Animated.View, {
|
|
664
|
+
style: StyleSheet.flatten([selectSwipeAreaStyles(childrenArray.length, containerLayout.width, enablePeeking), {
|
|
672
665
|
transform: [{
|
|
673
666
|
translateX: pan.x
|
|
674
667
|
}, {
|
|
@@ -676,27 +669,27 @@ const Carousel = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) => {
|
|
|
676
669
|
}]
|
|
677
670
|
}]),
|
|
678
671
|
...panResponder.panHandlers,
|
|
679
|
-
...
|
|
672
|
+
...getA11yPropsFromHtmlTag(tag),
|
|
680
673
|
// In iframes on Mac (e.g. in Storybook), this content may be misread or read twice.
|
|
681
674
|
// This is a known Voiceover bug: https://github.com/phetsims/a11y-research/issues/132
|
|
682
675
|
accessibilityLiveRegion: accessibilityLiveRegion,
|
|
683
676
|
children: childrenArray.map((element, index) => {
|
|
684
677
|
const hidden = !isAnimating && index !== activeIndex;
|
|
685
|
-
const clonedElement = /*#__PURE__*/
|
|
678
|
+
const clonedElement = /*#__PURE__*/React.cloneElement(element, {
|
|
686
679
|
elementIndex: index,
|
|
687
680
|
hidden: enablePeeking ? false : hidden,
|
|
688
681
|
enablePeeking,
|
|
689
682
|
peekingProps: getPeekingProps(viewport)
|
|
690
683
|
});
|
|
691
|
-
return /*#__PURE__*/(
|
|
684
|
+
return /*#__PURE__*/_jsx(React.Fragment, {
|
|
692
685
|
children: clonedElement
|
|
693
686
|
}, index.toFixed(2));
|
|
694
687
|
})
|
|
695
688
|
})
|
|
696
|
-
}), showPreviousNextNavigation && childrenArray.length > 1 ? /*#__PURE__*/(
|
|
689
|
+
}), showPreviousNextNavigation && childrenArray.length > 1 ? /*#__PURE__*/_jsx(View, {
|
|
697
690
|
style: selectPreviousNextNavigationButtonStyles(previousNextNavigationButtonWidth, previousNextNavigationPosition, spaceBetweenSlideAndPreviousNextNavigation, isFirstSlide, isLastSlide, false, enablePeeking),
|
|
698
691
|
testID: "next-button-container",
|
|
699
|
-
children: /*#__PURE__*/(
|
|
692
|
+
children: /*#__PURE__*/_jsx(IconButton, {
|
|
700
693
|
onLayout: onPreviousNextNavigationButtonLayout,
|
|
701
694
|
icon: nextIcon,
|
|
702
695
|
onPress: goToNext,
|
|
@@ -710,54 +703,54 @@ const Carousel = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) => {
|
|
|
710
703
|
});
|
|
711
704
|
Carousel.propTypes = {
|
|
712
705
|
...selectedSystemPropTypes,
|
|
713
|
-
tokens:
|
|
714
|
-
variant:
|
|
706
|
+
tokens: getTokensPropType('Carousel'),
|
|
707
|
+
variant: variantProp.propType,
|
|
715
708
|
/**
|
|
716
709
|
* Prop related to StepTracker Variants
|
|
717
710
|
*/
|
|
718
|
-
stepTrackerVariant:
|
|
711
|
+
stepTrackerVariant: variantProp.propType,
|
|
719
712
|
/**
|
|
720
713
|
* Slides to render in Carousel. Wrap individual slides in `Carousel.Item`
|
|
721
714
|
*/
|
|
722
|
-
children:
|
|
715
|
+
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired,
|
|
723
716
|
/**
|
|
724
717
|
* Lowercase language-appropriate user-facing description of what each Carousel slide represents.
|
|
725
718
|
* This is used when generating item labels. For example, if a carousel contains offers,
|
|
726
719
|
* pass itemLabel="summer offer" (or copy="fr" and an appropriate French translation) to genereate
|
|
727
720
|
* accessible labels such as "Summer offer 1 of 3" and "Show summer offer 2 of 3".
|
|
728
721
|
*/
|
|
729
|
-
itemLabel:
|
|
722
|
+
itemLabel: PropTypes.string,
|
|
730
723
|
/**
|
|
731
724
|
* `inside` renders the previous and next buttons inside the slide
|
|
732
725
|
* `outside` renders the previous and next buttons outside the slide
|
|
733
726
|
* `edge` renders the previous and next buttons at the edge of the slide
|
|
734
727
|
*/
|
|
735
|
-
previousNextNavigationPosition:
|
|
728
|
+
previousNextNavigationPosition: PropTypes.oneOf(['inside', 'outside', 'edge']),
|
|
736
729
|
/**
|
|
737
730
|
* Defines the size of the `IconButton` which is being used to render next and previous buttons
|
|
738
731
|
*/
|
|
739
|
-
previousNextIconSize:
|
|
732
|
+
previousNextIconSize: PropTypes.oneOf(['default', 'small', 'large']),
|
|
740
733
|
/**
|
|
741
734
|
* Carousel uses `Animated.spring` to animate slide changes, use this option to pass custom animation configuration
|
|
742
735
|
*/
|
|
743
|
-
springConfig:
|
|
736
|
+
springConfig: PropTypes.object,
|
|
744
737
|
/**
|
|
745
738
|
* An array of objects containing information on the thumbnails to be rendered as navigation panel
|
|
746
739
|
*/
|
|
747
|
-
thumbnails:
|
|
748
|
-
accessibilityLabel:
|
|
749
|
-
alt:
|
|
750
|
-
src:
|
|
740
|
+
thumbnails: PropTypes.arrayOf(PropTypes.shape({
|
|
741
|
+
accessibilityLabel: PropTypes.string,
|
|
742
|
+
alt: PropTypes.string,
|
|
743
|
+
src: PropTypes.string
|
|
751
744
|
})),
|
|
752
745
|
/**
|
|
753
746
|
* Minimal part of slide width must be swiped for changing index.
|
|
754
747
|
* Otherwise animation restore current slide. Default value 0.2 means that 20% must be swiped for change index
|
|
755
748
|
*/
|
|
756
|
-
minDistanceForAction:
|
|
749
|
+
minDistanceForAction: PropTypes.number,
|
|
757
750
|
/**
|
|
758
751
|
* Initiate animation after swipe this distance.
|
|
759
752
|
*/
|
|
760
|
-
minDistanceToCapture:
|
|
753
|
+
minDistanceToCapture: PropTypes.number,
|
|
761
754
|
/**
|
|
762
755
|
* Called when active index changed
|
|
763
756
|
* This function is also provided with a parameter indicating changed index (either 1, or -1)
|
|
@@ -774,18 +767,18 @@ Carousel.propTypes = {
|
|
|
774
767
|
* ```
|
|
775
768
|
* Caution: Always consider wrapping your callback for `onIndexChanged` in `React.useCallback` in order to avoid bugs and performance issues
|
|
776
769
|
*/
|
|
777
|
-
onIndexChanged:
|
|
770
|
+
onIndexChanged: PropTypes.func,
|
|
778
771
|
/**
|
|
779
772
|
* If this is a complex carousel with a lot of focusable content, pass a href for a skip link. Typically, this will be an anchor link
|
|
780
773
|
* with the ID of a focusable element immediately after the Carousel, e.g. `'#section-2-heading'`.
|
|
781
774
|
*/
|
|
782
|
-
skipLinkHref:
|
|
775
|
+
skipLinkHref: PropTypes.string,
|
|
783
776
|
/**
|
|
784
777
|
* If provided, defaults the navigation panel to a CarouselTabsPanel element passing each item as props for one tab.
|
|
785
778
|
*
|
|
786
779
|
* Be careful to ensure that the order of each element in the items array matches the order of each child in the Carousel.
|
|
787
780
|
*/
|
|
788
|
-
tabs:
|
|
781
|
+
tabs: PropTypes.arrayOf(PropTypes.shape(CarouselTabsPanelItem.propTypes || {})),
|
|
789
782
|
/**
|
|
790
783
|
* If true, whenever a new slide comes into view, the focus of the Carousel switches to the start.
|
|
791
784
|
*
|
|
@@ -793,7 +786,7 @@ Carousel.propTypes = {
|
|
|
793
786
|
*
|
|
794
787
|
* If skipLinkHref is passed, the focus target will be the SkipLink; if not, it'll be an empty element before the slide content.
|
|
795
788
|
*/
|
|
796
|
-
refocus:
|
|
789
|
+
refocus: PropTypes.bool,
|
|
797
790
|
/**
|
|
798
791
|
* Use this to render a custom panel navigation element instead of the default StepTracker's based navigation
|
|
799
792
|
* You can make use of `useCarousel` within your custom panel navigation component to hook into various Carousel states such as:
|
|
@@ -808,7 +801,7 @@ Carousel.propTypes = {
|
|
|
808
801
|
* </Carousel>
|
|
809
802
|
* ```
|
|
810
803
|
*/
|
|
811
|
-
panelNavigation:
|
|
804
|
+
panelNavigation: PropTypes.element,
|
|
812
805
|
/**
|
|
813
806
|
* When slide animation start
|
|
814
807
|
* This function is also provided with a parameter indicating the current slide index before animation starts
|
|
@@ -825,7 +818,7 @@ Carousel.propTypes = {
|
|
|
825
818
|
* ```
|
|
826
819
|
* Caution: Always consider wrapping your callback for `onAnimationStart` in `React.useCallback` in order to avoid bugs and performance issues
|
|
827
820
|
*/
|
|
828
|
-
onAnimationStart:
|
|
821
|
+
onAnimationStart: PropTypes.func,
|
|
829
822
|
/**
|
|
830
823
|
* When slide animation end with parameter of current index (after animation ends)
|
|
831
824
|
* This function is also provided with a parameter indicating the updated slide index after animation ends
|
|
@@ -842,26 +835,26 @@ Carousel.propTypes = {
|
|
|
842
835
|
* ```
|
|
843
836
|
* Caution: Always consider wrapping your callback for `onAnimationEnd` in `React.useCallback` in order to avoid bugs and performance issues
|
|
844
837
|
*/
|
|
845
|
-
onAnimationEnd:
|
|
838
|
+
onAnimationEnd: PropTypes.func,
|
|
846
839
|
/**
|
|
847
840
|
* Use this to override the default text for panel navigation
|
|
848
841
|
*/
|
|
849
|
-
panelNavigationTextDictionary:
|
|
850
|
-
en:
|
|
851
|
-
stepTrackerLabel:
|
|
842
|
+
panelNavigationTextDictionary: PropTypes.shape({
|
|
843
|
+
en: PropTypes.shape({
|
|
844
|
+
stepTrackerLabel: PropTypes.string.isRequired
|
|
852
845
|
}),
|
|
853
|
-
fr:
|
|
854
|
-
stepTrackerLabel:
|
|
846
|
+
fr: PropTypes.shape({
|
|
847
|
+
stepTrackerLabel: PropTypes.string.isRequired
|
|
855
848
|
})
|
|
856
849
|
}),
|
|
857
850
|
/**
|
|
858
851
|
* Provide custom accessibilityRole for Carousel container
|
|
859
852
|
*/
|
|
860
|
-
accessibilityRole:
|
|
853
|
+
accessibilityRole: PropTypes.string,
|
|
861
854
|
/**
|
|
862
855
|
* Provide custom accessibilityLabel for Carousel container
|
|
863
856
|
*/
|
|
864
|
-
accessibilityLabel:
|
|
857
|
+
accessibilityLabel: PropTypes.string,
|
|
865
858
|
/**
|
|
866
859
|
* HTML tag to use for the Carousel item's immediate parent. Defaults to `'ul'` so that
|
|
867
860
|
* assistive technology tools know to intepret the carousel as a list.
|
|
@@ -869,33 +862,32 @@ Carousel.propTypes = {
|
|
|
869
862
|
* Note that if the immediate Carousel children do not all render as `'li'` elements,
|
|
870
863
|
* this should be changed (e.g. pass tag="div") because only 'li' is a valid child of 'ul'.
|
|
871
864
|
*/
|
|
872
|
-
tag:
|
|
865
|
+
tag: PropTypes.oneOf(layoutTags),
|
|
873
866
|
/**
|
|
874
867
|
* If set to `true`, the Carousel will automatically transition between slides
|
|
875
868
|
* and show the play/pause button
|
|
876
869
|
* - Default value is `false`
|
|
877
870
|
* - `slideDuration` and `transitionDuration` are required to be set for this to work
|
|
878
871
|
*/
|
|
879
|
-
autoPlay:
|
|
872
|
+
autoPlay: PropTypes.bool,
|
|
880
873
|
/**
|
|
881
874
|
* Duration of the time in seconds spent on each slide
|
|
882
875
|
* - Default value is `0`
|
|
883
876
|
* - `autoPlay` and `transitionDuration` are required to be set for this to work
|
|
884
877
|
*/
|
|
885
|
-
slideDuration:
|
|
878
|
+
slideDuration: PropTypes.number,
|
|
886
879
|
/**
|
|
887
880
|
* Duration of the time in seconds between each slide transition
|
|
888
881
|
* - Default value is `0`
|
|
889
882
|
* - `autoPlay` and `slideDuration` are required to be set for this to work
|
|
890
883
|
*/
|
|
891
|
-
transitionDuration:
|
|
884
|
+
transitionDuration: PropTypes.number,
|
|
892
885
|
/**
|
|
893
886
|
* If set to `true`, the Carousel will show the previous and next slides
|
|
894
887
|
* - Default value is `false`
|
|
895
888
|
*/
|
|
896
|
-
enablePeeking:
|
|
889
|
+
enablePeeking: PropTypes.bool
|
|
897
890
|
};
|
|
898
|
-
Carousel.Item =
|
|
891
|
+
Carousel.Item = CarouselItem;
|
|
899
892
|
Carousel.displayName = 'Carousel';
|
|
900
|
-
|
|
901
|
-
exports.default = _default;
|
|
893
|
+
export default Carousel;
|