@telus-uds/components-base 2.0.2 → 2.2.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/CHANGELOG.md +40 -2
- package/lib/A11yInfoProvider/index.js +0 -0
- package/lib/A11yText/index.js +0 -0
- package/lib/ActionCard/ActionCard.js +0 -0
- package/lib/ActionCard/index.js +0 -0
- package/lib/ActivityIndicator/Spinner.js +0 -0
- package/lib/ActivityIndicator/Spinner.native.js +0 -0
- package/lib/ActivityIndicator/index.js +0 -0
- package/lib/ActivityIndicator/shared.js +0 -0
- package/lib/Autocomplete/Autocomplete.js +0 -0
- package/lib/Autocomplete/Loading.js +0 -0
- package/lib/Autocomplete/Suggestions.js +0 -0
- package/lib/Autocomplete/constants.js +0 -0
- package/lib/Autocomplete/dictionary.js +0 -0
- package/lib/Autocomplete/index.js +0 -0
- package/lib/Badge/Badge.js +0 -0
- package/lib/Badge/index.js +0 -0
- package/lib/BaseProvider/HydrationContext.js +0 -0
- package/lib/BaseProvider/index.js +0 -0
- package/lib/Box/Box.js +0 -0
- package/lib/Box/backgroundImageStylesMap.js +0 -0
- package/lib/Box/index.js +0 -0
- package/lib/Button/Button.js +0 -0
- package/lib/Button/ButtonBase.js +0 -0
- package/lib/Button/ButtonDropdown.js +0 -0
- package/lib/Button/ButtonGroup.js +0 -0
- package/lib/Button/ButtonLink.js +0 -0
- package/lib/Button/index.js +0 -0
- package/lib/Button/propTypes.js +0 -0
- package/lib/Card/Card.js +0 -0
- package/lib/Card/CardBase.js +0 -0
- package/lib/Card/PressableCardBase.js +2 -1
- package/lib/Card/index.js +0 -0
- package/lib/CardGroup/CardGroup.js +0 -0
- package/lib/CardGroup/dictionary.js +0 -0
- package/lib/CardGroup/index.js +0 -0
- package/lib/Carousel/Carousel.js +121 -33
- package/lib/Carousel/CarouselContext.js +0 -0
- package/lib/Carousel/CarouselFirstFocus/CarouselFirstFocus.js +0 -0
- package/lib/Carousel/CarouselItem/CarouselItem.js +39 -24
- package/lib/Carousel/CarouselItem/index.js +0 -0
- package/lib/Carousel/CarouselStepTracker/CarouselStepTracker.js +41 -4
- package/lib/Carousel/CarouselStepTracker/index.js +0 -0
- package/lib/Carousel/CarouselTabs/CarouselTabs.js +0 -0
- package/lib/Carousel/CarouselTabs/CarouselTabsPanel.js +0 -0
- package/lib/Carousel/CarouselTabs/CarouselTabsPanelItem.js +0 -0
- package/lib/Carousel/CarouselTabs/index.js +0 -0
- package/lib/Carousel/CarouselThumbnail.js +0 -0
- package/lib/Carousel/CarouselThumbnailNavigation.js +0 -0
- package/lib/Carousel/Constants.js +3 -0
- package/lib/Carousel/dictionary.js +0 -0
- package/lib/Carousel/index.js +0 -0
- package/lib/Checkbox/Checkbox.js +0 -0
- package/lib/Checkbox/CheckboxButton.js +0 -0
- package/lib/Checkbox/CheckboxGroup.js +4 -2
- package/lib/Checkbox/CheckboxInput.js +0 -0
- package/lib/Checkbox/CheckboxInput.native.js +0 -0
- package/lib/Checkbox/index.js +0 -0
- package/lib/CheckboxCard/CheckboxCard.js +0 -0
- package/lib/CheckboxCard/index.js +0 -0
- package/lib/CheckboxCardGroup/CheckboxCardGroup.js +0 -0
- package/lib/CheckboxCardGroup/index.js +0 -0
- package/lib/ColourToggle/ColourBubble.js +0 -0
- package/lib/ColourToggle/ColourToggle.js +0 -0
- package/lib/ColourToggle/index.js +0 -0
- package/lib/Divider/Divider.js +0 -0
- package/lib/Divider/index.js +0 -0
- package/lib/DownloadApp/DownloadApp.js +0 -0
- package/lib/DownloadApp/dictionary.js +0 -0
- package/lib/DownloadApp/index.js +0 -0
- package/lib/ExpandCollapse/Accordion.js +0 -0
- package/lib/ExpandCollapse/Control.js +0 -0
- package/lib/ExpandCollapse/ExpandCollapse.js +0 -0
- package/lib/ExpandCollapse/Panel.js +0 -0
- package/lib/ExpandCollapse/dictionary.js +0 -0
- package/lib/ExpandCollapse/index.js +0 -0
- package/lib/Feedback/Feedback.js +0 -0
- package/lib/Feedback/index.js +0 -0
- package/lib/Fieldset/Fieldset.js +0 -0
- package/lib/Fieldset/FieldsetContainer.js +0 -0
- package/lib/Fieldset/FieldsetContainer.native.js +0 -0
- package/lib/Fieldset/Legend.js +0 -0
- package/lib/Fieldset/Legend.native.js +0 -0
- package/lib/Fieldset/cssReset.js +0 -0
- package/lib/Fieldset/index.js +0 -0
- package/lib/FileUpload/FileUpload.js +0 -0
- package/lib/FileUpload/NotificationContent.js +0 -0
- package/lib/FileUpload/dictionary.js +0 -0
- package/lib/FileUpload/index.js +0 -0
- package/lib/FlexGrid/Col/Col.js +0 -0
- package/lib/FlexGrid/Col/index.js +0 -0
- package/lib/FlexGrid/FlexGrid.js +0 -0
- package/lib/FlexGrid/Row/Row.js +0 -0
- package/lib/FlexGrid/Row/index.js +0 -0
- package/lib/FlexGrid/helpers/index.js +0 -0
- package/lib/FlexGrid/index.js +0 -0
- package/lib/FlexGrid/providers/GutterContext.js +0 -0
- package/lib/Footnote/Footnote.js +0 -0
- package/lib/Footnote/FootnoteLink.js +0 -0
- package/lib/Footnote/dictionary.js +0 -0
- package/lib/Footnote/index.js +0 -0
- package/lib/HorizontalScroll/HorizontalScroll.js +17 -13
- package/lib/HorizontalScroll/HorizontalScrollButton.js +0 -0
- package/lib/HorizontalScroll/ScrollViewEnd.js +0 -0
- package/lib/HorizontalScroll/ScrollViewEnd.native.js +0 -0
- package/lib/HorizontalScroll/dictionary.js +0 -0
- package/lib/HorizontalScroll/index.js +0 -0
- package/lib/HorizontalScroll/itemPositions.js +0 -0
- package/lib/Icon/Icon.js +1 -0
- package/lib/Icon/IconText.js +0 -0
- package/lib/Icon/index.js +0 -0
- package/lib/IconButton/IconButton.js +0 -0
- package/lib/IconButton/index.js +0 -0
- package/lib/InputLabel/InputLabel.js +0 -0
- package/lib/InputLabel/LabelContent.js +0 -0
- package/lib/InputLabel/LabelContent.native.js +0 -0
- package/lib/InputLabel/index.js +0 -0
- package/lib/InputSupports/InputSupports.js +3 -0
- package/lib/InputSupports/index.js +0 -0
- package/lib/InputSupports/useInputSupports.js +0 -0
- package/lib/Link/ChevronLink.js +0 -0
- package/lib/Link/InlinePressable.js +0 -0
- package/lib/Link/InlinePressable.native.js +0 -0
- package/lib/Link/Link.js +0 -0
- package/lib/Link/LinkBase.js +2 -2
- package/lib/Link/TextButton.js +0 -0
- package/lib/Link/index.js +0 -0
- package/lib/List/List.js +0 -0
- package/lib/List/ListItem.js +0 -0
- package/lib/List/ListItemBase.js +0 -0
- package/lib/List/ListItemContent.js +0 -0
- package/lib/List/ListItemMark.js +0 -0
- package/lib/List/PressableListItemBase.js +0 -0
- package/lib/List/index.js +0 -0
- package/lib/Listbox/GroupControl.js +0 -0
- package/lib/Listbox/Listbox.js +0 -0
- package/lib/Listbox/ListboxContext.js +0 -0
- package/lib/Listbox/ListboxGroup.js +0 -0
- package/lib/Listbox/ListboxItem.js +0 -0
- package/lib/Listbox/ListboxOverlay.js +0 -0
- package/lib/Listbox/PressableItem.js +2 -2
- package/lib/Listbox/index.js +0 -0
- package/lib/Modal/Modal.js +4 -0
- package/lib/Modal/ModalContent.js +27 -8
- package/lib/Modal/WebModal.js +0 -0
- package/lib/Modal/dictionary.js +0 -0
- package/lib/Modal/index.js +0 -0
- package/lib/MultiSelectFilter/ModalOverlay.js +0 -0
- package/lib/MultiSelectFilter/MultiSelectFilter.js +0 -0
- package/lib/MultiSelectFilter/dictionary.js +0 -0
- package/lib/MultiSelectFilter/index.js +0 -0
- package/lib/Notification/Notification.js +0 -0
- package/lib/Notification/dictionary.js +0 -0
- package/lib/Notification/index.js +0 -0
- package/lib/OrderedList/Item.js +0 -0
- package/lib/OrderedList/ItemBase.js +0 -0
- package/lib/OrderedList/OrderedList.js +0 -0
- package/lib/OrderedList/OrderedListBase.js +0 -0
- package/lib/OrderedList/index.js +0 -0
- package/lib/Pagination/PageButton.js +0 -0
- package/lib/Pagination/Pagination.js +0 -0
- package/lib/Pagination/SideButton.js +0 -0
- package/lib/Pagination/constants.js +0 -0
- package/lib/Pagination/dictionary.js +0 -0
- package/lib/Pagination/index.js +0 -0
- package/lib/Pagination/usePagination.js +0 -0
- package/lib/Portal/Portal.js +0 -0
- package/lib/Portal/Portal.native.js +0 -0
- package/lib/Portal/index.js +0 -0
- package/lib/PriceLockup/PriceLockup.js +0 -0
- package/lib/PriceLockup/index.js +0 -0
- package/lib/PriceLockup/utils/renderFootnoteContent.js +0 -0
- package/lib/PriceLockup/utils/renderFootnoteLinks.js +0 -0
- package/lib/PriceLockup/utils/renderPrice.js +0 -0
- package/lib/PriceLockup/utils/renderTypography.js +0 -0
- package/lib/ProductCard/ProductCard.js +0 -0
- package/lib/ProductCard/dictionary.js +0 -0
- package/lib/ProductCard/index.js +0 -0
- package/lib/ProductCardGroup/ProductCardGroup.js +0 -0
- package/lib/ProductCardGroup/index.js +0 -0
- package/lib/Progress/Progress.js +8 -2
- package/lib/Progress/ProgressBar.js +40 -12
- package/lib/Progress/ProgressBarBackground.js +4 -2
- package/lib/Progress/constants.js +4 -0
- package/lib/Progress/index.js +0 -0
- package/lib/QuickLinks/QuickLinks.js +0 -0
- package/lib/QuickLinks/QuickLinksCard.js +0 -0
- package/lib/QuickLinks/QuickLinksItem.js +0 -0
- package/lib/QuickLinks/index.js +0 -0
- package/lib/QuickLinksFeature/QuickLinksFeature.js +0 -0
- package/lib/QuickLinksFeature/QuickLinksFeatureItem.js +0 -0
- package/lib/QuickLinksFeature/index.js +0 -0
- package/lib/Radio/Radio.js +0 -0
- package/lib/Radio/RadioButton.js +0 -0
- package/lib/Radio/RadioGroup.js +0 -0
- package/lib/Radio/RadioInput.js +0 -0
- package/lib/Radio/RadioInput.native.js +0 -0
- package/lib/Radio/index.js +0 -0
- package/lib/RadioCard/RadioCard.js +0 -0
- package/lib/RadioCard/RadioCardGroup.js +0 -0
- package/lib/RadioCard/index.js +0 -0
- package/lib/Responsive/Responsive.js +0 -0
- package/lib/Responsive/ResponsiveProp.js +0 -0
- package/lib/Responsive/ResponsiveWithMediaQueryStyleSheet.js +0 -0
- package/lib/Responsive/index.js +0 -0
- package/lib/Search/Search.js +4 -2
- package/lib/Search/dictionary.js +0 -0
- package/lib/Search/index.js +0 -0
- package/lib/Select/Group.js +0 -0
- package/lib/Select/Group.native.js +0 -0
- package/lib/Select/Item.js +0 -0
- package/lib/Select/Item.native.js +0 -0
- package/lib/Select/Picker.js +0 -0
- package/lib/Select/Picker.native.js +1 -0
- package/lib/Select/Select.js +1 -4
- package/lib/Select/constants.js +0 -0
- package/lib/Select/index.js +0 -0
- package/lib/SideNav/Item.js +0 -0
- package/lib/SideNav/ItemContent.js +0 -0
- package/lib/SideNav/ItemsGroup.js +0 -0
- package/lib/SideNav/SideNav.js +0 -0
- package/lib/SideNav/index.js +0 -0
- package/lib/Skeleton/Skeleton.js +0 -0
- package/lib/Skeleton/index.js +0 -0
- package/lib/Skeleton/skeleton.constant.js +0 -0
- package/lib/Skeleton/skeletonWebAnimation.js +0 -0
- package/lib/Skeleton/useSkeletonNativeAnimation.js +0 -0
- package/lib/SkipLink/SkipLink.js +0 -0
- package/lib/SkipLink/index.js +0 -0
- package/lib/Spacer/Spacer.js +0 -0
- package/lib/Spacer/index.js +0 -0
- package/lib/StackView/StackView.js +0 -0
- package/lib/StackView/StackWrap.js +0 -0
- package/lib/StackView/StackWrap.native.js +0 -0
- package/lib/StackView/StackWrapBox.js +0 -0
- package/lib/StackView/StackWrapGap.js +0 -0
- package/lib/StackView/common.js +0 -0
- package/lib/StackView/getStackedContent.js +0 -0
- package/lib/StackView/index.js +0 -0
- package/lib/Status/Status.js +6 -2
- package/lib/Status/index.js +0 -0
- package/lib/StepTracker/Step.js +0 -0
- package/lib/StepTracker/StepTracker.js +0 -0
- package/lib/StepTracker/dictionary.js +0 -0
- package/lib/StepTracker/index.js +0 -0
- package/lib/TabBar/TabBar.js +0 -0
- package/lib/TabBar/TabBarItem.js +0 -0
- package/lib/TabBar/index.js +0 -0
- package/lib/Tabs/Tabs.js +0 -0
- package/lib/Tabs/TabsItem.js +0 -0
- package/lib/Tabs/index.js +0 -0
- package/lib/Tags/Tags.js +0 -0
- package/lib/Tags/index.js +0 -0
- package/lib/TextInput/TextArea.js +0 -0
- package/lib/TextInput/TextInput.js +0 -0
- package/lib/TextInput/TextInputBase.js +2 -2
- package/lib/TextInput/dictionary.js +0 -0
- package/lib/TextInput/index.js +0 -0
- package/lib/TextInput/propTypes.js +0 -0
- package/lib/ThemeProvider/ThemeProvider.js +0 -0
- package/lib/ThemeProvider/index.js +0 -0
- package/lib/ThemeProvider/useResponsiveThemeTokens.js +0 -0
- package/lib/ThemeProvider/useSetTheme.js +0 -0
- package/lib/ThemeProvider/useTheme.js +0 -0
- package/lib/ThemeProvider/useThemeTokens.js +0 -0
- package/lib/ThemeProvider/utils/index.js +0 -0
- package/lib/ThemeProvider/utils/styles.js +0 -0
- package/lib/ThemeProvider/utils/theme-tokens.js +0 -0
- package/lib/Timeline/Timeline.js +0 -0
- package/lib/Timeline/index.js +0 -0
- package/lib/ToggleSwitch/ToggleSwitch.js +0 -0
- package/lib/ToggleSwitch/ToggleSwitchGroup.js +0 -0
- package/lib/ToggleSwitch/index.js +0 -0
- package/lib/Tooltip/Backdrop.js +0 -0
- package/lib/Tooltip/Backdrop.native.js +0 -0
- package/lib/Tooltip/Tooltip.js +22 -13
- package/lib/Tooltip/Tooltip.native.js +24 -15
- package/lib/Tooltip/dictionary.js +0 -0
- package/lib/Tooltip/getTooltipPosition.js +0 -0
- package/lib/Tooltip/index.js +0 -0
- package/lib/Tooltip/shared.js +0 -0
- package/lib/TooltipButton/TooltipButton.js +0 -0
- package/lib/TooltipButton/index.js +0 -0
- package/lib/Typography/Typography.js +12 -0
- package/lib/Typography/index.js +0 -0
- package/lib/Validator/Validator.js +4 -0
- package/lib/Validator/index.js +0 -0
- package/lib/ViewportProvider/ViewportProvider.js +0 -0
- package/lib/ViewportProvider/index.js +0 -0
- package/lib/ViewportProvider/useViewport.js +0 -0
- package/lib/ViewportProvider/useViewportListener.js +0 -0
- package/lib/index.js +0 -0
- package/lib/server.js +0 -0
- package/lib/utils/BaseView/BaseView.js +0 -0
- package/lib/utils/BaseView/BaseView.native.js +0 -0
- package/lib/utils/BaseView/index.js +0 -0
- package/lib/utils/a11y/index.js +0 -0
- package/lib/utils/a11y/semantics.js +0 -0
- package/lib/utils/a11y/textSize.js +0 -0
- package/lib/utils/animation/index.js +0 -0
- package/lib/utils/animation/useVerticalExpandAnimation.js +0 -0
- package/lib/utils/children.js +0 -0
- package/lib/utils/containUniqueFields.js +0 -0
- package/lib/utils/convertFromMegaByteToByte.js +0 -0
- package/lib/utils/floating-ui/index.js +0 -0
- package/lib/utils/floating-ui/index.native.js +0 -0
- package/lib/utils/formatImageSource.js +0 -0
- package/lib/utils/hasOwnProperty.js +0 -0
- package/lib/utils/htmlAttrs.js +0 -0
- package/lib/utils/index.js +0 -0
- package/lib/utils/info/index.js +0 -0
- package/lib/utils/info/platform/index.js +0 -0
- package/lib/utils/info/platform/platform.android.js +0 -0
- package/lib/utils/info/platform/platform.ios.js +0 -0
- package/lib/utils/info/platform/platform.js +0 -0
- package/lib/utils/info/platform/platform.native.js +0 -0
- package/lib/utils/info/versions.js +0 -0
- package/lib/utils/input.js +0 -0
- package/lib/utils/pressability.js +0 -0
- package/lib/utils/props/a11yProps.js +0 -0
- package/lib/utils/props/clickProps.js +0 -0
- package/lib/utils/props/componentPropType.js +0 -0
- package/lib/utils/props/contentfulProps.js +22 -0
- package/lib/utils/props/copyPropTypes.js +0 -0
- package/lib/utils/props/getPropSelector.js +0 -0
- package/lib/utils/props/handlerProps.js +0 -0
- package/lib/utils/props/hrefAttrsProp.js +0 -0
- package/lib/utils/props/index.js +2 -1
- package/lib/utils/props/inputSupportsProps.js +0 -0
- package/lib/utils/props/linkProps.js +0 -0
- package/lib/utils/props/paddingProp.js +0 -0
- package/lib/utils/props/pressProps.js +0 -0
- package/lib/utils/props/rectProp.js +0 -0
- package/lib/utils/props/responsiveProps.js +0 -0
- package/lib/utils/props/selectSystemProps.js +0 -0
- package/lib/utils/props/spacingProps.js +0 -0
- package/lib/utils/props/textInputProps.js +0 -0
- package/lib/utils/props/textProps.js +0 -0
- package/lib/utils/props/tokens.js +0 -0
- package/lib/utils/props/variantProp.js +0 -0
- package/lib/utils/props/viewProps.js +0 -0
- package/lib/utils/ssr-media-query/create-stylesheet/create-stylesheet-mobile.js +0 -0
- package/lib/utils/ssr-media-query/create-stylesheet/index.android.js +0 -0
- package/lib/utils/ssr-media-query/create-stylesheet/index.ios.js +0 -0
- package/lib/utils/ssr-media-query/create-stylesheet/index.js +0 -0
- package/lib/utils/ssr-media-query/hash.js +0 -0
- package/lib/utils/ssr-media-query/index.js +0 -0
- package/lib/utils/ssr-media-query/utils/common.js +0 -0
- package/lib/utils/ssr-media-query/utils/create-declaration-block.js +0 -0
- package/lib/utils/ssr-media-query/utils/create-media-query-styles.js +0 -0
- package/lib/utils/ssr-media-query/utils/hyphenate-style-name.js +0 -0
- package/lib/utils/ssr-media-query/utils/inject.js +0 -0
- package/lib/utils/ssr.js +0 -0
- package/lib/utils/transformGradient.js +0 -0
- package/lib/utils/useCopy.js +0 -0
- package/lib/utils/useHash.js +0 -0
- package/lib/utils/useHash.native.js +0 -0
- package/lib/utils/useOverlaidPosition.js +0 -0
- package/lib/utils/useResponsiveProp.js +0 -0
- package/lib/utils/useSafeLayoutEffect.js +0 -0
- package/lib/utils/useScrollBlocking.js +0 -0
- package/lib/utils/useScrollBlocking.native.js +0 -0
- package/lib/utils/useSpacingScale.js +0 -0
- package/lib/utils/useUniqueId.js +0 -0
- package/lib/utils/withLinkRouter.js +0 -0
- package/package.json +2 -2
- package/src/Card/PressableCardBase.jsx +1 -1
- package/src/Carousel/Carousel.jsx +166 -34
- package/src/Carousel/CarouselItem/CarouselItem.jsx +56 -26
- package/src/Carousel/CarouselStepTracker/CarouselStepTracker.jsx +71 -37
- package/src/Carousel/Constants.js +3 -0
- package/src/Checkbox/CheckboxGroup.jsx +7 -3
- package/src/HorizontalScroll/HorizontalScroll.jsx +19 -15
- package/src/Icon/Icon.jsx +1 -0
- package/src/InputSupports/InputSupports.jsx +1 -0
- package/src/Link/LinkBase.jsx +8 -2
- package/src/Listbox/PressableItem.jsx +2 -2
- package/src/Modal/Modal.jsx +4 -0
- package/src/Modal/ModalContent.jsx +23 -7
- package/src/Progress/Progress.jsx +12 -2
- package/src/Progress/ProgressBar.jsx +48 -13
- package/src/Progress/ProgressBarBackground.jsx +4 -2
- package/src/Progress/constants.js +4 -0
- package/src/Search/Search.jsx +9 -3
- package/src/Select/Picker.native.jsx +1 -0
- package/src/Select/Select.jsx +8 -9
- package/src/Status/Status.jsx +2 -2
- package/src/TextInput/TextInputBase.jsx +2 -2
- package/src/Tooltip/Tooltip.jsx +6 -1
- package/src/Tooltip/Tooltip.native.jsx +7 -1
- package/src/Typography/Typography.jsx +12 -0
- package/src/Validator/Validator.jsx +7 -1
- package/src/utils/props/contentfulProps.js +24 -0
- package/src/utils/props/index.js +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,50 @@
|
|
|
1
1
|
# Change Log - @telus-uds/components-base
|
|
2
2
|
|
|
3
|
-
<!-- This log was last generated on
|
|
3
|
+
<!-- This log was last generated on Fri, 06 Dec 2024 02:03:26 GMT and should not be manually modified. -->
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 2.2.0
|
|
8
|
+
|
|
9
|
+
Fri, 06 Dec 2024 02:03:26 GMT
|
|
10
|
+
|
|
11
|
+
### Minor changes
|
|
12
|
+
|
|
13
|
+
- `PressableItem`: pass event to on-press function (guillermo.peitzner@telus.com)
|
|
14
|
+
- `ChevronLink`, `Search` & `ResponsiveImage`: new `dataSet` prop added to the components to allow the capability to pass data (35577399+JoshHC@users.noreply.github.com)
|
|
15
|
+
|
|
16
|
+
### Patches
|
|
17
|
+
|
|
18
|
+
- `Typography`: fix gradient when enableMediaQueryStyleSheet is true (Mauricio.BatresMontejo@telus.com)
|
|
19
|
+
|
|
20
|
+
## 2.1.0
|
|
21
|
+
|
|
22
|
+
Mon, 02 Dec 2024 20:29:26 GMT
|
|
23
|
+
|
|
24
|
+
### Minor changes
|
|
25
|
+
|
|
26
|
+
- `Validator`: feedback icon added in the validation of the component (35577399+JoshHC@users.noreply.github.com)
|
|
27
|
+
- `Carousel`: add enableDisplayMultipleItemsPerSlide prop (guillermo.peitzner@telus.com)
|
|
28
|
+
- `InputLabel`: Implemented/Updated storybook InputLabel theme-casa (shivam.gupta3@telus.com)
|
|
29
|
+
- `CheckBoxGroup`: `inactive` prop added for the items to be able to set inactive any item of the `CheckBoxGroup` component (35577399+JoshHC@users.noreply.github.com)
|
|
30
|
+
- `ChevronLink`, `Search` & `ResponsiveImage`: new contentful props data-contentful-field-id and data-contentful-entry-id added to the components (35577399+JoshHC@users.noreply.github.com)
|
|
31
|
+
- `Progress`: Added rules for `subtle` and `inverse` variants. Deprecated `inactive` and `negative` appearances and moved them to `style` appearances. Enabled `offset` object for controlling the position of the `ProgressBar` component. (jaime.tuyuc@telus.com)
|
|
32
|
+
- Customized/optional props implemented `Status` and `Icon` components (shivam.gupta3@telus.com)
|
|
33
|
+
- `Tooltip`: Customized/optional props implemented, max width and min width (shivam.gupta3@telus.com)
|
|
34
|
+
- `Modal`: update component to enable heading bottom border and content spacing (eduardo.pereira1@telus.com)
|
|
35
|
+
- Bump @telus-uds/system-theme-tokens to v3.1.0
|
|
36
|
+
|
|
37
|
+
### Patches
|
|
38
|
+
|
|
39
|
+
- `Select`: fixing tokens for Android (Mauricio.BatresMontejo@telus.com)
|
|
40
|
+
- `Tabs`: fixed the problem of not displaying the lower border that encloses the items in Android (35577399+JoshHC@users.noreply.github.com)
|
|
41
|
+
- `Card`: fix console log warnings (guillermo.peitzner@telus.com)
|
|
42
|
+
- `TextInput`: Remove mask interactivity when input is inactive (jaime.tuyuc@telus.com)
|
|
43
|
+
- `TextInput`: Arial-label fixed in correct order - Password variant (sergio.ramirez@telus.com)
|
|
44
|
+
|
|
7
45
|
## 2.0.2
|
|
8
46
|
|
|
9
|
-
Sat, 23 Nov 2024 01:
|
|
47
|
+
Sat, 23 Nov 2024 01:40:21 GMT
|
|
10
48
|
|
|
11
49
|
### Patches
|
|
12
50
|
|
|
File without changes
|
package/lib/A11yText/index.js
CHANGED
|
File without changes
|
|
File without changes
|
package/lib/ActionCard/index.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/Badge/Badge.js
CHANGED
|
File without changes
|
package/lib/Badge/index.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/Box/Box.js
CHANGED
|
File without changes
|
|
File without changes
|
package/lib/Box/index.js
CHANGED
|
File without changes
|
package/lib/Button/Button.js
CHANGED
|
File without changes
|
package/lib/Button/ButtonBase.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/Button/ButtonLink.js
CHANGED
|
File without changes
|
package/lib/Button/index.js
CHANGED
|
File without changes
|
package/lib/Button/propTypes.js
CHANGED
|
File without changes
|
package/lib/Card/Card.js
CHANGED
|
File without changes
|
package/lib/Card/CardBase.js
CHANGED
|
File without changes
|
|
@@ -45,7 +45,8 @@ const PressableCardBase = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
45
45
|
};
|
|
46
46
|
const getCardState = pressableState => resolvePressableState(pressableState, additionalState);
|
|
47
47
|
const getTokens = pressableState => validateThemeTokens(resolvePressableTokens(tokens, pressableState, additionalState), getTokensSetPropType(tokenKeys, {
|
|
48
|
-
|
|
48
|
+
partial: true,
|
|
49
|
+
allowFunction: true
|
|
49
50
|
}), 'PressableCard');
|
|
50
51
|
const getCardTokens = pressableState => selectTokens('Card', getTokens(pressableState));
|
|
51
52
|
const getOuterBorderStyle = pressableState => {
|
package/lib/Card/index.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/CardGroup/index.js
CHANGED
|
File without changes
|
package/lib/Carousel/Carousel.js
CHANGED
|
@@ -20,6 +20,7 @@ import CarouselThumbnailNavigation from './CarouselThumbnailNavigation';
|
|
|
20
20
|
import CarouselTabsPanel from './CarouselTabs/CarouselTabsPanel';
|
|
21
21
|
import CarouselTabsPanelItem from './CarouselTabs/CarouselTabsPanelItem';
|
|
22
22
|
import dictionary from './dictionary';
|
|
23
|
+
import { ITEMS_PER_VIEWPORT_MD, ITEMS_PER_VIEWPORT_LG_XL } from './Constants';
|
|
23
24
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
25
|
const TRANSITION_MODES = {
|
|
25
26
|
MANUAL: 'manual',
|
|
@@ -47,9 +48,9 @@ const selectContainerStyles = width => ({
|
|
|
47
48
|
overflow: 'hidden',
|
|
48
49
|
width
|
|
49
50
|
});
|
|
50
|
-
const selectSwipeAreaStyles = (count, width, enablePeeking) => ({
|
|
51
|
+
const selectSwipeAreaStyles = (count, width, enablePeeking, enableDisplayMultipleItemsPerSlide) => ({
|
|
51
52
|
width: width * count,
|
|
52
|
-
justifyContent: enablePeeking ? 'flex-start' : 'space-between',
|
|
53
|
+
justifyContent: enablePeeking || enableDisplayMultipleItemsPerSlide ? 'flex-start' : 'space-between',
|
|
53
54
|
flexDirection: 'row'
|
|
54
55
|
});
|
|
55
56
|
const getDynamicPositionProperty = areStylesAppliedOnPreviousButton => areStylesAppliedOnPreviousButton ? 'left' : 'right';
|
|
@@ -59,7 +60,8 @@ const selectControlButtonPositionStyles = _ref => {
|
|
|
59
60
|
buttonWidth,
|
|
60
61
|
positionProperty = getDynamicPositionProperty(),
|
|
61
62
|
spaceBetweenSlideAndButton,
|
|
62
|
-
enablePeeking
|
|
63
|
+
enablePeeking,
|
|
64
|
+
enableDisplayMultipleItemsPerSlide
|
|
63
65
|
} = _ref;
|
|
64
66
|
const styles = {};
|
|
65
67
|
if (positionVariant === 'edge') {
|
|
@@ -67,7 +69,7 @@ const selectControlButtonPositionStyles = _ref => {
|
|
|
67
69
|
} else if (positionVariant === 'inside') {
|
|
68
70
|
styles[positionProperty] = 0;
|
|
69
71
|
} else if (positionVariant === 'outside') {
|
|
70
|
-
if (enablePeeking) {
|
|
72
|
+
if (enablePeeking || enableDisplayMultipleItemsPerSlide) {
|
|
71
73
|
styles[positionProperty] = 0;
|
|
72
74
|
} else {
|
|
73
75
|
styles[positionProperty] = -1 * (spaceBetweenSlideAndButton + buttonWidth);
|
|
@@ -75,7 +77,7 @@ const selectControlButtonPositionStyles = _ref => {
|
|
|
75
77
|
}
|
|
76
78
|
return styles;
|
|
77
79
|
};
|
|
78
|
-
const selectPreviousNextNavigationButtonStyles = (previousNextNavigationButtonWidth, previousNextNavigationPosition, spaceBetweenSlideAndPreviousNextNavigation, isFirstSlide, isLastSlide, areStylesAppliedOnPreviousButton, enablePeeking) => {
|
|
80
|
+
const selectPreviousNextNavigationButtonStyles = (previousNextNavigationButtonWidth, previousNextNavigationPosition, spaceBetweenSlideAndPreviousNextNavigation, isFirstSlide, isLastSlide, areStylesAppliedOnPreviousButton, enablePeeking, enableDisplayMultipleItemsPerSlide) => {
|
|
79
81
|
const styles = {
|
|
80
82
|
zIndex: 1,
|
|
81
83
|
position: 'absolute'
|
|
@@ -94,7 +96,8 @@ const selectPreviousNextNavigationButtonStyles = (previousNextNavigationButtonWi
|
|
|
94
96
|
buttonWidth: previousNextNavigationButtonWidth,
|
|
95
97
|
positionProperty: getDynamicPositionProperty(areStylesAppliedOnPreviousButton),
|
|
96
98
|
spaceBetweenSlideAndButton: spaceBetweenSlideAndPreviousNextNavigation,
|
|
97
|
-
enablePeeking
|
|
99
|
+
enablePeeking,
|
|
100
|
+
enableDisplayMultipleItemsPerSlide
|
|
98
101
|
})
|
|
99
102
|
};
|
|
100
103
|
};
|
|
@@ -118,6 +121,79 @@ const getPeekingProps = viewport => {
|
|
|
118
121
|
peekingMiddleSpace: 24
|
|
119
122
|
};
|
|
120
123
|
};
|
|
124
|
+
const getTotalItems = (enableDisplayMultipleItemsPerSlide, childrenArray, viewport) => {
|
|
125
|
+
if (enableDisplayMultipleItemsPerSlide) {
|
|
126
|
+
switch (viewport) {
|
|
127
|
+
case 'xs':
|
|
128
|
+
case 'sm':
|
|
129
|
+
return childrenArray.length;
|
|
130
|
+
case 'md':
|
|
131
|
+
return Math.ceil(childrenArray.length / ITEMS_PER_VIEWPORT_MD);
|
|
132
|
+
case 'lg':
|
|
133
|
+
case 'xl':
|
|
134
|
+
return Math.ceil(childrenArray.length / ITEMS_PER_VIEWPORT_LG_XL);
|
|
135
|
+
default:
|
|
136
|
+
break;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return childrenArray.length;
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Calculates the final width of the carousel container for displacement purposes based on various conditions.
|
|
144
|
+
*
|
|
145
|
+
* @param {number} containerWidth - The initial width of the container.
|
|
146
|
+
* @param {boolean} enablePeeking - Flag indicating if peeking is enabled.
|
|
147
|
+
* @param {object} viewport - The viewport properties.
|
|
148
|
+
* @param {object} activeIndexRef - A ref object holding the current active index.
|
|
149
|
+
* @param {number} totalItems - The total number of items in the carousel.
|
|
150
|
+
* @param {number} calcDelta - The delta value used for calculations.
|
|
151
|
+
* @returns {number} - The final calculated width of the container.
|
|
152
|
+
*
|
|
153
|
+
* The function adjusts the container width for displacement purposes based on the peeking properties and the position
|
|
154
|
+
* of the active item (first, middle, or last). It considers different peeking spaces and gaps
|
|
155
|
+
* to ensure the correct width is calculated for the carousel to display properly.
|
|
156
|
+
*/
|
|
157
|
+
const calculateFinalWidth = (containerWidth, enablePeeking, viewport, activeIndexRef, totalItems, calcDelta) => {
|
|
158
|
+
let finalWidth = containerWidth;
|
|
159
|
+
if (enablePeeking) {
|
|
160
|
+
const {
|
|
161
|
+
peekingFirstSpace,
|
|
162
|
+
peekingGap,
|
|
163
|
+
peekingLastSpace,
|
|
164
|
+
peekingMiddleSpace
|
|
165
|
+
} = getPeekingProps(viewport);
|
|
166
|
+
const isFirst = activeIndexRef.current === 0;
|
|
167
|
+
const isLast = activeIndexRef.current + 1 >= totalItems;
|
|
168
|
+
const isMiddle = !isFirst && !isLast;
|
|
169
|
+
const basePeekingSpace = peekingFirstSpace + peekingGap + peekingMiddleSpace;
|
|
170
|
+
const middlePeekingSpace = peekingMiddleSpace * 2 + peekingGap;
|
|
171
|
+
if (isFirst) {
|
|
172
|
+
finalWidth -= basePeekingSpace;
|
|
173
|
+
if (activeIndexRef.current + 1 === totalItems - 1) {
|
|
174
|
+
finalWidth -= peekingLastSpace - peekingMiddleSpace;
|
|
175
|
+
}
|
|
176
|
+
} else if (isMiddle) {
|
|
177
|
+
if (calcDelta > 0) {
|
|
178
|
+
finalWidth -= basePeekingSpace + middlePeekingSpace * activeIndexRef.current;
|
|
179
|
+
if (activeIndexRef.current + 1 === totalItems - 1) {
|
|
180
|
+
finalWidth -= peekingLastSpace - peekingMiddleSpace;
|
|
181
|
+
}
|
|
182
|
+
} else {
|
|
183
|
+
finalWidth += basePeekingSpace + middlePeekingSpace * (activeIndexRef.current - 2);
|
|
184
|
+
if (activeIndexRef.current - 1 === 0) {
|
|
185
|
+
finalWidth -= peekingFirstSpace - peekingMiddleSpace;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
} else if (isLast) {
|
|
189
|
+
finalWidth += basePeekingSpace + middlePeekingSpace * (activeIndexRef.current - 2);
|
|
190
|
+
if (activeIndexRef.current - 1 === 0) {
|
|
191
|
+
finalWidth -= peekingLastSpace - peekingMiddleSpace;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
return finalWidth;
|
|
196
|
+
};
|
|
121
197
|
const selectIconStyles = _ref2 => {
|
|
122
198
|
let {
|
|
123
199
|
iconBackgroundColor
|
|
@@ -202,10 +278,12 @@ const Carousel = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
|
202
278
|
title = 'carousel',
|
|
203
279
|
springConfig = undefined,
|
|
204
280
|
thumbnails = undefined,
|
|
281
|
+
enableDisplayMultipleItemsPerSlide = false,
|
|
205
282
|
panelNavigation = thumbnails ? /*#__PURE__*/_jsx(CarouselThumbnailNavigation, {
|
|
206
283
|
thumbnails: thumbnails
|
|
207
284
|
}) : /*#__PURE__*/_jsx(CarouselStepTracker, {
|
|
208
|
-
variant: stepTrackerVariant
|
|
285
|
+
variant: stepTrackerVariant,
|
|
286
|
+
enableDisplayMultipleItemsPerSlide: enableDisplayMultipleItemsPerSlide
|
|
209
287
|
}),
|
|
210
288
|
tag = 'ul',
|
|
211
289
|
accessibilityRole,
|
|
@@ -219,7 +297,9 @@ const Carousel = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
|
219
297
|
...rest
|
|
220
298
|
} = _ref3;
|
|
221
299
|
let childrenArray = unpackFragment(children);
|
|
222
|
-
const
|
|
300
|
+
const viewport = useViewport();
|
|
301
|
+
const totalItems = getTotalItems(enableDisplayMultipleItemsPerSlide, childrenArray, viewport);
|
|
302
|
+
const autoPlayFeatureEnabled = autoPlay && slideDuration > 0 && transitionDuration > 0 && totalItems > 1;
|
|
223
303
|
// if `Carousel` only has one `Carousel.Item`, convert this to a single-item array
|
|
224
304
|
if (!Array.isArray(childrenArray)) {
|
|
225
305
|
childrenArray = [childrenArray];
|
|
@@ -228,7 +308,6 @@ const Carousel = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
|
228
308
|
dictionary,
|
|
229
309
|
copy
|
|
230
310
|
});
|
|
231
|
-
const viewport = useViewport();
|
|
232
311
|
const themeTokens = useThemeTokens('Carousel', tokens, variant, {
|
|
233
312
|
viewport
|
|
234
313
|
});
|
|
@@ -271,7 +350,7 @@ const Carousel = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
|
271
350
|
const isSwiping = React.useRef(false);
|
|
272
351
|
const autoPlayRef = React.useRef(null);
|
|
273
352
|
const isFirstSlide = !activeIndex;
|
|
274
|
-
const isLastSlide = activeIndex + 1 >=
|
|
353
|
+
const isLastSlide = activeIndex + 1 >= totalItems;
|
|
275
354
|
const handleAnimationStart = React.useCallback(function () {
|
|
276
355
|
if (typeof onAnimationStart === 'function') onAnimationStart(...arguments);
|
|
277
356
|
setIsAnimating(true);
|
|
@@ -312,7 +391,7 @@ const Carousel = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
|
312
391
|
useNativeDriver: false,
|
|
313
392
|
duration: transitionDuration * 1000
|
|
314
393
|
}).start(handleAnimationEndToIndex);
|
|
315
|
-
} else if (enablePeeking) {
|
|
394
|
+
} else if (enablePeeking || enableDisplayMultipleItemsPerSlide) {
|
|
316
395
|
Animated.timing(pan, {
|
|
317
396
|
...springConfig,
|
|
318
397
|
toValue,
|
|
@@ -326,7 +405,7 @@ const Carousel = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
|
326
405
|
useNativeDriver: false
|
|
327
406
|
}).start(handleAnimationEndToIndex);
|
|
328
407
|
}
|
|
329
|
-
}, [pan, springConfig, handleAnimationEnd, transitionDuration, isAutoPlayEnabled, enablePeeking]);
|
|
408
|
+
}, [pan, springConfig, handleAnimationEnd, transitionDuration, isAutoPlayEnabled, enablePeeking, enableDisplayMultipleItemsPerSlide]);
|
|
330
409
|
const stopAutoplay = React.useCallback(() => {
|
|
331
410
|
if (autoPlayRef !== null && autoPlayRef !== void 0 && autoPlayRef.current) {
|
|
332
411
|
clearTimeout(autoPlayRef === null || autoPlayRef === void 0 ? void 0 : autoPlayRef.current);
|
|
@@ -352,8 +431,8 @@ const Carousel = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
|
352
431
|
let calcDelta = delta;
|
|
353
432
|
if (activeIndexRef.current <= 0 && delta < 0) {
|
|
354
433
|
skipChanges = transitionMode !== TRANSITION_MODES.AUTOMATIC;
|
|
355
|
-
calcDelta =
|
|
356
|
-
} else if (activeIndexRef.current + 1 >=
|
|
434
|
+
calcDelta = totalItems + delta;
|
|
435
|
+
} else if (activeIndexRef.current + 1 >= totalItems && delta > 0) {
|
|
357
436
|
skipChanges = transitionMode !== TRANSITION_MODES.AUTOMATIC;
|
|
358
437
|
calcDelta = -1 * activeIndexRef.current + delta - 1;
|
|
359
438
|
}
|
|
@@ -364,11 +443,12 @@ const Carousel = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
|
364
443
|
}
|
|
365
444
|
stopAutoplay();
|
|
366
445
|
setActiveIndex(index);
|
|
367
|
-
|
|
446
|
+
const finalWidth = calculateFinalWidth(containerLayoutRef.current.width, enablePeeking, viewport, activeIndexRef, totalItems, calcDelta);
|
|
447
|
+
toValue.x = finalWidth * -1 * calcDelta;
|
|
368
448
|
animate(toValue, index);
|
|
369
449
|
if (isCarouselPlaying) {
|
|
370
450
|
stopAutoplay();
|
|
371
|
-
if (index === 0 && activeIndexRef.current + 1 ===
|
|
451
|
+
if (index === 0 && activeIndexRef.current + 1 === totalItems && transitionMode === TRANSITION_MODES.AUTOMATIC) {
|
|
372
452
|
setisCarouselPlaying(false);
|
|
373
453
|
} else if (isAutoPlayEnabled) {
|
|
374
454
|
autoPlayRef.current = setTimeout(() => {
|
|
@@ -381,7 +461,7 @@ const Carousel = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
|
381
461
|
}
|
|
382
462
|
if (onIndexChanged) onIndexChanged(calcDelta, index);
|
|
383
463
|
return calcDelta;
|
|
384
|
-
}, [handleAnimationStart, triggerRefocus, slideDuration, updateOffset, animate,
|
|
464
|
+
}, [handleAnimationStart, triggerRefocus, slideDuration, updateOffset, animate, totalItems, onIndexChanged, isCarouselPlaying, stopAutoplay, isAutoPlayEnabled, viewport, enablePeeking]);
|
|
385
465
|
const startAutoplay = React.useCallback(() => {
|
|
386
466
|
stopAutoplay();
|
|
387
467
|
if (isAutoPlayEnabled) {
|
|
@@ -448,8 +528,8 @@ const Carousel = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
|
448
528
|
};
|
|
449
529
|
}, [updateOffset]);
|
|
450
530
|
React.useEffect(() => {
|
|
451
|
-
setIsAutoPlayEnabled(autoPlay && slideDuration > 0 && transitionDuration > 0 &&
|
|
452
|
-
}, [autoPlay, slideDuration, transitionDuration,
|
|
531
|
+
setIsAutoPlayEnabled(autoPlay && slideDuration > 0 && transitionDuration > 0 && totalItems > 1);
|
|
532
|
+
}, [autoPlay, slideDuration, transitionDuration, totalItems]);
|
|
453
533
|
React.useEffect(() => {
|
|
454
534
|
return () => {
|
|
455
535
|
stopAutoplay();
|
|
@@ -483,14 +563,14 @@ const Carousel = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
|
483
563
|
return setPreviousNextNavigationButtonWidth(width);
|
|
484
564
|
};
|
|
485
565
|
const isSwipeAllowed = React.useCallback(() => {
|
|
486
|
-
if (
|
|
566
|
+
if (totalItems === 1) {
|
|
487
567
|
return false;
|
|
488
568
|
}
|
|
489
569
|
if (Platform.OS === 'web') {
|
|
490
570
|
return !!(viewport === 'xs' || viewport === 'sm');
|
|
491
571
|
}
|
|
492
572
|
return true;
|
|
493
|
-
}, [viewport,
|
|
573
|
+
}, [viewport, totalItems]);
|
|
494
574
|
const panResponder = React.useMemo(() => PanResponder.create({
|
|
495
575
|
onPanResponderTerminationRequest: () => false,
|
|
496
576
|
onMoveShouldSetResponderCapture: () => true,
|
|
@@ -554,11 +634,11 @@ const Carousel = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
|
554
634
|
inverse: variant === null || variant === void 0 ? void 0 : variant.inverse
|
|
555
635
|
};
|
|
556
636
|
const getCopyWithPlaceholders = React.useCallback(copyKey => {
|
|
557
|
-
const copyText = getCopy(copyKey).replace(/%\{title\}/g, title).replace(/%\{itemLabel\}/g, itemLabel).replace(/%\{stepNumber\}/g, activeIndex + 1).replace(/%\{stepCount\}/g,
|
|
637
|
+
const copyText = getCopy(copyKey).replace(/%\{title\}/g, title).replace(/%\{itemLabel\}/g, itemLabel).replace(/%\{stepNumber\}/g, activeIndex + 1).replace(/%\{stepCount\}/g, totalItems);
|
|
558
638
|
|
|
559
639
|
// First word might be a lowercase placeholder: capitalize the first letter
|
|
560
640
|
return `${copyText[0].toUpperCase()}${copyText.slice(1)}`;
|
|
561
|
-
}, [activeIndex,
|
|
641
|
+
}, [activeIndex, itemLabel, getCopy, title, totalItems]);
|
|
562
642
|
const activePanelNavigation = tabs && showPanelTabs ? /*#__PURE__*/_jsx(CarouselTabsPanel, {
|
|
563
643
|
items: tabs
|
|
564
644
|
}) : panelNavigation;
|
|
@@ -606,7 +686,7 @@ const Carousel = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
|
606
686
|
goTo: goTo,
|
|
607
687
|
getCopyWithPlaceholders: getCopyWithPlaceholders,
|
|
608
688
|
itemLabel: itemLabel,
|
|
609
|
-
totalItems:
|
|
689
|
+
totalItems: totalItems,
|
|
610
690
|
themeTokens: themeTokens,
|
|
611
691
|
firstFocusRef: firstFocusRef,
|
|
612
692
|
refocus: refocus,
|
|
@@ -629,7 +709,8 @@ const Carousel = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
|
629
709
|
buttonWidth: previousNextNavigationButtonWidth,
|
|
630
710
|
positionProperty: getDynamicPositionProperty(),
|
|
631
711
|
spaceBetweenSlideAndButton: spaceBetweenSlideAndPreviousNextNavigation,
|
|
632
|
-
enablePeeking
|
|
712
|
+
enablePeeking,
|
|
713
|
+
enableDisplayMultipleItemsPerSlide
|
|
633
714
|
})],
|
|
634
715
|
children: /*#__PURE__*/_jsx(IconButton, {
|
|
635
716
|
icon: isCarouselPlaying ? pauseIcon : playIcon,
|
|
@@ -637,8 +718,8 @@ const Carousel = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
|
637
718
|
variant: previousNextIconButtonVariants,
|
|
638
719
|
onPress: onAnimationControlButtonPress
|
|
639
720
|
})
|
|
640
|
-
}) : null, showPreviousNextNavigation &&
|
|
641
|
-
style: selectPreviousNextNavigationButtonStyles(previousNextNavigationButtonWidth, previousNextNavigationPosition, spaceBetweenSlideAndPreviousNextNavigation, isFirstSlide, isLastSlide, true, enablePeeking),
|
|
721
|
+
}) : null, showPreviousNextNavigation && totalItems > 1 ? /*#__PURE__*/_jsx(View, {
|
|
722
|
+
style: selectPreviousNextNavigationButtonStyles(previousNextNavigationButtonWidth, previousNextNavigationPosition, spaceBetweenSlideAndPreviousNextNavigation, isFirstSlide, isLastSlide, true, enablePeeking, enableDisplayMultipleItemsPerSlide),
|
|
642
723
|
testID: "previous-button-container",
|
|
643
724
|
children: /*#__PURE__*/_jsx(IconButton, {
|
|
644
725
|
onLayout: onPreviousNextNavigationButtonLayout,
|
|
@@ -661,7 +742,7 @@ const Carousel = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
|
661
742
|
}), /*#__PURE__*/_jsx(View, {
|
|
662
743
|
style: selectContainerStyles(containerLayout.width),
|
|
663
744
|
children: /*#__PURE__*/_jsx(Animated.View, {
|
|
664
|
-
style: StyleSheet.flatten([selectSwipeAreaStyles(
|
|
745
|
+
style: StyleSheet.flatten([selectSwipeAreaStyles(totalItems, containerLayout.width, enablePeeking, enableDisplayMultipleItemsPerSlide), {
|
|
665
746
|
transform: [{
|
|
666
747
|
translateX: pan.x
|
|
667
748
|
}, {
|
|
@@ -677,17 +758,19 @@ const Carousel = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
|
677
758
|
const hidden = !isAnimating && index !== activeIndex;
|
|
678
759
|
const clonedElement = /*#__PURE__*/React.cloneElement(element, {
|
|
679
760
|
elementIndex: index,
|
|
680
|
-
hidden: enablePeeking ? false : hidden,
|
|
761
|
+
hidden: enablePeeking || enableDisplayMultipleItemsPerSlide ? false : hidden,
|
|
681
762
|
enablePeeking,
|
|
682
|
-
peekingProps: getPeekingProps(viewport)
|
|
763
|
+
peekingProps: getPeekingProps(viewport),
|
|
764
|
+
enableDisplayMultipleItemsPerSlide,
|
|
765
|
+
viewport
|
|
683
766
|
});
|
|
684
767
|
return /*#__PURE__*/_jsx(React.Fragment, {
|
|
685
768
|
children: clonedElement
|
|
686
769
|
}, index.toFixed(2));
|
|
687
770
|
})
|
|
688
771
|
})
|
|
689
|
-
}), showPreviousNextNavigation &&
|
|
690
|
-
style: selectPreviousNextNavigationButtonStyles(previousNextNavigationButtonWidth, previousNextNavigationPosition, spaceBetweenSlideAndPreviousNextNavigation, isFirstSlide, isLastSlide, false, enablePeeking),
|
|
772
|
+
}), showPreviousNextNavigation && totalItems > 1 ? /*#__PURE__*/_jsx(View, {
|
|
773
|
+
style: selectPreviousNextNavigationButtonStyles(previousNextNavigationButtonWidth, previousNextNavigationPosition, spaceBetweenSlideAndPreviousNextNavigation, isFirstSlide, isLastSlide, false, enablePeeking, enableDisplayMultipleItemsPerSlide),
|
|
691
774
|
testID: "next-button-container",
|
|
692
775
|
children: /*#__PURE__*/_jsx(IconButton, {
|
|
693
776
|
onLayout: onPreviousNextNavigationButtonLayout,
|
|
@@ -886,7 +969,12 @@ Carousel.propTypes = {
|
|
|
886
969
|
* If set to `true`, the Carousel will show the previous and next slides
|
|
887
970
|
* - Default value is `false`
|
|
888
971
|
*/
|
|
889
|
-
enablePeeking: PropTypes.bool
|
|
972
|
+
enablePeeking: PropTypes.bool,
|
|
973
|
+
/**
|
|
974
|
+
* If set to `true`, the Carousel will show multiple slides at once
|
|
975
|
+
* - Default value is `false`
|
|
976
|
+
*/
|
|
977
|
+
enableDisplayMultipleItemsPerSlide: PropTypes.bool
|
|
890
978
|
};
|
|
891
979
|
Carousel.Item = CarouselItem;
|
|
892
980
|
Carousel.displayName = 'Carousel';
|
|
File without changes
|
|
File without changes
|
|
@@ -4,47 +4,61 @@ import View from "react-native-web/dist/exports/View";
|
|
|
4
4
|
import Platform from "react-native-web/dist/exports/Platform";
|
|
5
5
|
import { layoutTags, getA11yPropsFromHtmlTag, selectSystemProps, a11yProps, viewProps, variantProp } from '../../utils';
|
|
6
6
|
import { useCarousel } from '../CarouselContext';
|
|
7
|
+
import { ITEMS_PER_VIEWPORT_MD, ITEMS_PER_VIEWPORT_LG_XL, GAP_BETWEEN_ITEMS } from '../Constants';
|
|
7
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
9
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, viewProps]);
|
|
9
10
|
const selectContainerStyle = _ref => {
|
|
10
11
|
let {
|
|
11
12
|
width,
|
|
12
|
-
activeIndex,
|
|
13
13
|
elementIndex,
|
|
14
|
-
totalItems,
|
|
15
14
|
enablePeeking,
|
|
16
15
|
peekingMarginLeft,
|
|
17
16
|
peekingFirstSpace,
|
|
18
|
-
peekingLastSpace,
|
|
19
|
-
peekingMiddleSpace,
|
|
20
17
|
peekingGap,
|
|
21
|
-
hidden
|
|
18
|
+
hidden,
|
|
19
|
+
enableDisplayMultipleItemsPerSlide,
|
|
20
|
+
viewport
|
|
22
21
|
} = _ref;
|
|
23
22
|
let adjustedWidth = width;
|
|
24
23
|
let marginLeft = 0;
|
|
25
24
|
const marginRight = 0;
|
|
26
25
|
if (enablePeeking) {
|
|
27
|
-
adjustedWidth = width - (peekingMarginLeft + peekingGap + peekingFirstSpace);
|
|
28
26
|
const isFirst = elementIndex === 0;
|
|
29
|
-
|
|
30
|
-
if (
|
|
31
|
-
|
|
32
|
-
marginLeft = peekingMarginLeft;
|
|
33
|
-
} else {
|
|
34
|
-
marginLeft = peekingGap;
|
|
35
|
-
}
|
|
36
|
-
} else if (isFirst) {
|
|
37
|
-
marginLeft = peekingMarginLeft + peekingGap + peekingFirstSpace + peekingMiddleSpace;
|
|
38
|
-
if (activeIndex > 1) {
|
|
39
|
-
marginLeft += (peekingGap + peekingMiddleSpace * 2) * (activeIndex - 1);
|
|
40
|
-
}
|
|
41
|
-
if (activeIndex === totalItems - 1) {
|
|
42
|
-
marginLeft += peekingLastSpace - peekingMiddleSpace;
|
|
43
|
-
}
|
|
27
|
+
adjustedWidth = width - (peekingMarginLeft + peekingGap + peekingFirstSpace);
|
|
28
|
+
if (isFirst) {
|
|
29
|
+
marginLeft = peekingMarginLeft;
|
|
44
30
|
} else {
|
|
45
31
|
marginLeft = peekingGap;
|
|
46
32
|
}
|
|
47
33
|
}
|
|
34
|
+
|
|
35
|
+
// Adjust width and margins for multiple items per slide.
|
|
36
|
+
if (enableDisplayMultipleItemsPerSlide) {
|
|
37
|
+
switch (viewport) {
|
|
38
|
+
case 'xs':
|
|
39
|
+
case 'sm':
|
|
40
|
+
break;
|
|
41
|
+
case 'md':
|
|
42
|
+
if (enablePeeking) {
|
|
43
|
+
adjustedWidth = adjustedWidth / ITEMS_PER_VIEWPORT_MD - peekingGap * 1 / ITEMS_PER_VIEWPORT_MD;
|
|
44
|
+
} else {
|
|
45
|
+
adjustedWidth = width / ITEMS_PER_VIEWPORT_MD - GAP_BETWEEN_ITEMS * 2 / ITEMS_PER_VIEWPORT_MD;
|
|
46
|
+
marginLeft = GAP_BETWEEN_ITEMS;
|
|
47
|
+
}
|
|
48
|
+
break;
|
|
49
|
+
case 'lg':
|
|
50
|
+
case 'xl':
|
|
51
|
+
if (enablePeeking) {
|
|
52
|
+
adjustedWidth = adjustedWidth / ITEMS_PER_VIEWPORT_LG_XL - peekingGap * 2 / ITEMS_PER_VIEWPORT_LG_XL;
|
|
53
|
+
} else {
|
|
54
|
+
adjustedWidth = width / ITEMS_PER_VIEWPORT_LG_XL - GAP_BETWEEN_ITEMS * 3 / ITEMS_PER_VIEWPORT_LG_XL;
|
|
55
|
+
marginLeft = GAP_BETWEEN_ITEMS;
|
|
56
|
+
}
|
|
57
|
+
break;
|
|
58
|
+
default:
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
48
62
|
const style = {
|
|
49
63
|
width: adjustedWidth,
|
|
50
64
|
marginLeft,
|
|
@@ -68,12 +82,13 @@ const CarouselItem = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
|
68
82
|
hidden,
|
|
69
83
|
enablePeeking,
|
|
70
84
|
peekingProps,
|
|
85
|
+
enableDisplayMultipleItemsPerSlide,
|
|
86
|
+
viewport,
|
|
71
87
|
...rest
|
|
72
88
|
} = _ref2;
|
|
73
89
|
const {
|
|
74
90
|
width,
|
|
75
91
|
activeIndex,
|
|
76
|
-
totalItems,
|
|
77
92
|
height
|
|
78
93
|
} = useCarousel();
|
|
79
94
|
const selectedProps = selectProps({
|
|
@@ -84,12 +99,12 @@ const CarouselItem = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
|
84
99
|
return /*#__PURE__*/_jsx(View, {
|
|
85
100
|
style: selectContainerStyle({
|
|
86
101
|
width,
|
|
87
|
-
activeIndex,
|
|
88
102
|
elementIndex,
|
|
89
|
-
totalItems,
|
|
90
103
|
hidden,
|
|
91
104
|
height,
|
|
92
105
|
enablePeeking,
|
|
106
|
+
enableDisplayMultipleItemsPerSlide,
|
|
107
|
+
viewport,
|
|
93
108
|
...peekingProps
|
|
94
109
|
}),
|
|
95
110
|
...selectedProps,
|
|
File without changes
|