@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.
Files changed (394) hide show
  1. package/CHANGELOG.md +40 -2
  2. package/lib/A11yInfoProvider/index.js +0 -0
  3. package/lib/A11yText/index.js +0 -0
  4. package/lib/ActionCard/ActionCard.js +0 -0
  5. package/lib/ActionCard/index.js +0 -0
  6. package/lib/ActivityIndicator/Spinner.js +0 -0
  7. package/lib/ActivityIndicator/Spinner.native.js +0 -0
  8. package/lib/ActivityIndicator/index.js +0 -0
  9. package/lib/ActivityIndicator/shared.js +0 -0
  10. package/lib/Autocomplete/Autocomplete.js +0 -0
  11. package/lib/Autocomplete/Loading.js +0 -0
  12. package/lib/Autocomplete/Suggestions.js +0 -0
  13. package/lib/Autocomplete/constants.js +0 -0
  14. package/lib/Autocomplete/dictionary.js +0 -0
  15. package/lib/Autocomplete/index.js +0 -0
  16. package/lib/Badge/Badge.js +0 -0
  17. package/lib/Badge/index.js +0 -0
  18. package/lib/BaseProvider/HydrationContext.js +0 -0
  19. package/lib/BaseProvider/index.js +0 -0
  20. package/lib/Box/Box.js +0 -0
  21. package/lib/Box/backgroundImageStylesMap.js +0 -0
  22. package/lib/Box/index.js +0 -0
  23. package/lib/Button/Button.js +0 -0
  24. package/lib/Button/ButtonBase.js +0 -0
  25. package/lib/Button/ButtonDropdown.js +0 -0
  26. package/lib/Button/ButtonGroup.js +0 -0
  27. package/lib/Button/ButtonLink.js +0 -0
  28. package/lib/Button/index.js +0 -0
  29. package/lib/Button/propTypes.js +0 -0
  30. package/lib/Card/Card.js +0 -0
  31. package/lib/Card/CardBase.js +0 -0
  32. package/lib/Card/PressableCardBase.js +2 -1
  33. package/lib/Card/index.js +0 -0
  34. package/lib/CardGroup/CardGroup.js +0 -0
  35. package/lib/CardGroup/dictionary.js +0 -0
  36. package/lib/CardGroup/index.js +0 -0
  37. package/lib/Carousel/Carousel.js +121 -33
  38. package/lib/Carousel/CarouselContext.js +0 -0
  39. package/lib/Carousel/CarouselFirstFocus/CarouselFirstFocus.js +0 -0
  40. package/lib/Carousel/CarouselItem/CarouselItem.js +39 -24
  41. package/lib/Carousel/CarouselItem/index.js +0 -0
  42. package/lib/Carousel/CarouselStepTracker/CarouselStepTracker.js +41 -4
  43. package/lib/Carousel/CarouselStepTracker/index.js +0 -0
  44. package/lib/Carousel/CarouselTabs/CarouselTabs.js +0 -0
  45. package/lib/Carousel/CarouselTabs/CarouselTabsPanel.js +0 -0
  46. package/lib/Carousel/CarouselTabs/CarouselTabsPanelItem.js +0 -0
  47. package/lib/Carousel/CarouselTabs/index.js +0 -0
  48. package/lib/Carousel/CarouselThumbnail.js +0 -0
  49. package/lib/Carousel/CarouselThumbnailNavigation.js +0 -0
  50. package/lib/Carousel/Constants.js +3 -0
  51. package/lib/Carousel/dictionary.js +0 -0
  52. package/lib/Carousel/index.js +0 -0
  53. package/lib/Checkbox/Checkbox.js +0 -0
  54. package/lib/Checkbox/CheckboxButton.js +0 -0
  55. package/lib/Checkbox/CheckboxGroup.js +4 -2
  56. package/lib/Checkbox/CheckboxInput.js +0 -0
  57. package/lib/Checkbox/CheckboxInput.native.js +0 -0
  58. package/lib/Checkbox/index.js +0 -0
  59. package/lib/CheckboxCard/CheckboxCard.js +0 -0
  60. package/lib/CheckboxCard/index.js +0 -0
  61. package/lib/CheckboxCardGroup/CheckboxCardGroup.js +0 -0
  62. package/lib/CheckboxCardGroup/index.js +0 -0
  63. package/lib/ColourToggle/ColourBubble.js +0 -0
  64. package/lib/ColourToggle/ColourToggle.js +0 -0
  65. package/lib/ColourToggle/index.js +0 -0
  66. package/lib/Divider/Divider.js +0 -0
  67. package/lib/Divider/index.js +0 -0
  68. package/lib/DownloadApp/DownloadApp.js +0 -0
  69. package/lib/DownloadApp/dictionary.js +0 -0
  70. package/lib/DownloadApp/index.js +0 -0
  71. package/lib/ExpandCollapse/Accordion.js +0 -0
  72. package/lib/ExpandCollapse/Control.js +0 -0
  73. package/lib/ExpandCollapse/ExpandCollapse.js +0 -0
  74. package/lib/ExpandCollapse/Panel.js +0 -0
  75. package/lib/ExpandCollapse/dictionary.js +0 -0
  76. package/lib/ExpandCollapse/index.js +0 -0
  77. package/lib/Feedback/Feedback.js +0 -0
  78. package/lib/Feedback/index.js +0 -0
  79. package/lib/Fieldset/Fieldset.js +0 -0
  80. package/lib/Fieldset/FieldsetContainer.js +0 -0
  81. package/lib/Fieldset/FieldsetContainer.native.js +0 -0
  82. package/lib/Fieldset/Legend.js +0 -0
  83. package/lib/Fieldset/Legend.native.js +0 -0
  84. package/lib/Fieldset/cssReset.js +0 -0
  85. package/lib/Fieldset/index.js +0 -0
  86. package/lib/FileUpload/FileUpload.js +0 -0
  87. package/lib/FileUpload/NotificationContent.js +0 -0
  88. package/lib/FileUpload/dictionary.js +0 -0
  89. package/lib/FileUpload/index.js +0 -0
  90. package/lib/FlexGrid/Col/Col.js +0 -0
  91. package/lib/FlexGrid/Col/index.js +0 -0
  92. package/lib/FlexGrid/FlexGrid.js +0 -0
  93. package/lib/FlexGrid/Row/Row.js +0 -0
  94. package/lib/FlexGrid/Row/index.js +0 -0
  95. package/lib/FlexGrid/helpers/index.js +0 -0
  96. package/lib/FlexGrid/index.js +0 -0
  97. package/lib/FlexGrid/providers/GutterContext.js +0 -0
  98. package/lib/Footnote/Footnote.js +0 -0
  99. package/lib/Footnote/FootnoteLink.js +0 -0
  100. package/lib/Footnote/dictionary.js +0 -0
  101. package/lib/Footnote/index.js +0 -0
  102. package/lib/HorizontalScroll/HorizontalScroll.js +17 -13
  103. package/lib/HorizontalScroll/HorizontalScrollButton.js +0 -0
  104. package/lib/HorizontalScroll/ScrollViewEnd.js +0 -0
  105. package/lib/HorizontalScroll/ScrollViewEnd.native.js +0 -0
  106. package/lib/HorizontalScroll/dictionary.js +0 -0
  107. package/lib/HorizontalScroll/index.js +0 -0
  108. package/lib/HorizontalScroll/itemPositions.js +0 -0
  109. package/lib/Icon/Icon.js +1 -0
  110. package/lib/Icon/IconText.js +0 -0
  111. package/lib/Icon/index.js +0 -0
  112. package/lib/IconButton/IconButton.js +0 -0
  113. package/lib/IconButton/index.js +0 -0
  114. package/lib/InputLabel/InputLabel.js +0 -0
  115. package/lib/InputLabel/LabelContent.js +0 -0
  116. package/lib/InputLabel/LabelContent.native.js +0 -0
  117. package/lib/InputLabel/index.js +0 -0
  118. package/lib/InputSupports/InputSupports.js +3 -0
  119. package/lib/InputSupports/index.js +0 -0
  120. package/lib/InputSupports/useInputSupports.js +0 -0
  121. package/lib/Link/ChevronLink.js +0 -0
  122. package/lib/Link/InlinePressable.js +0 -0
  123. package/lib/Link/InlinePressable.native.js +0 -0
  124. package/lib/Link/Link.js +0 -0
  125. package/lib/Link/LinkBase.js +2 -2
  126. package/lib/Link/TextButton.js +0 -0
  127. package/lib/Link/index.js +0 -0
  128. package/lib/List/List.js +0 -0
  129. package/lib/List/ListItem.js +0 -0
  130. package/lib/List/ListItemBase.js +0 -0
  131. package/lib/List/ListItemContent.js +0 -0
  132. package/lib/List/ListItemMark.js +0 -0
  133. package/lib/List/PressableListItemBase.js +0 -0
  134. package/lib/List/index.js +0 -0
  135. package/lib/Listbox/GroupControl.js +0 -0
  136. package/lib/Listbox/Listbox.js +0 -0
  137. package/lib/Listbox/ListboxContext.js +0 -0
  138. package/lib/Listbox/ListboxGroup.js +0 -0
  139. package/lib/Listbox/ListboxItem.js +0 -0
  140. package/lib/Listbox/ListboxOverlay.js +0 -0
  141. package/lib/Listbox/PressableItem.js +2 -2
  142. package/lib/Listbox/index.js +0 -0
  143. package/lib/Modal/Modal.js +4 -0
  144. package/lib/Modal/ModalContent.js +27 -8
  145. package/lib/Modal/WebModal.js +0 -0
  146. package/lib/Modal/dictionary.js +0 -0
  147. package/lib/Modal/index.js +0 -0
  148. package/lib/MultiSelectFilter/ModalOverlay.js +0 -0
  149. package/lib/MultiSelectFilter/MultiSelectFilter.js +0 -0
  150. package/lib/MultiSelectFilter/dictionary.js +0 -0
  151. package/lib/MultiSelectFilter/index.js +0 -0
  152. package/lib/Notification/Notification.js +0 -0
  153. package/lib/Notification/dictionary.js +0 -0
  154. package/lib/Notification/index.js +0 -0
  155. package/lib/OrderedList/Item.js +0 -0
  156. package/lib/OrderedList/ItemBase.js +0 -0
  157. package/lib/OrderedList/OrderedList.js +0 -0
  158. package/lib/OrderedList/OrderedListBase.js +0 -0
  159. package/lib/OrderedList/index.js +0 -0
  160. package/lib/Pagination/PageButton.js +0 -0
  161. package/lib/Pagination/Pagination.js +0 -0
  162. package/lib/Pagination/SideButton.js +0 -0
  163. package/lib/Pagination/constants.js +0 -0
  164. package/lib/Pagination/dictionary.js +0 -0
  165. package/lib/Pagination/index.js +0 -0
  166. package/lib/Pagination/usePagination.js +0 -0
  167. package/lib/Portal/Portal.js +0 -0
  168. package/lib/Portal/Portal.native.js +0 -0
  169. package/lib/Portal/index.js +0 -0
  170. package/lib/PriceLockup/PriceLockup.js +0 -0
  171. package/lib/PriceLockup/index.js +0 -0
  172. package/lib/PriceLockup/utils/renderFootnoteContent.js +0 -0
  173. package/lib/PriceLockup/utils/renderFootnoteLinks.js +0 -0
  174. package/lib/PriceLockup/utils/renderPrice.js +0 -0
  175. package/lib/PriceLockup/utils/renderTypography.js +0 -0
  176. package/lib/ProductCard/ProductCard.js +0 -0
  177. package/lib/ProductCard/dictionary.js +0 -0
  178. package/lib/ProductCard/index.js +0 -0
  179. package/lib/ProductCardGroup/ProductCardGroup.js +0 -0
  180. package/lib/ProductCardGroup/index.js +0 -0
  181. package/lib/Progress/Progress.js +8 -2
  182. package/lib/Progress/ProgressBar.js +40 -12
  183. package/lib/Progress/ProgressBarBackground.js +4 -2
  184. package/lib/Progress/constants.js +4 -0
  185. package/lib/Progress/index.js +0 -0
  186. package/lib/QuickLinks/QuickLinks.js +0 -0
  187. package/lib/QuickLinks/QuickLinksCard.js +0 -0
  188. package/lib/QuickLinks/QuickLinksItem.js +0 -0
  189. package/lib/QuickLinks/index.js +0 -0
  190. package/lib/QuickLinksFeature/QuickLinksFeature.js +0 -0
  191. package/lib/QuickLinksFeature/QuickLinksFeatureItem.js +0 -0
  192. package/lib/QuickLinksFeature/index.js +0 -0
  193. package/lib/Radio/Radio.js +0 -0
  194. package/lib/Radio/RadioButton.js +0 -0
  195. package/lib/Radio/RadioGroup.js +0 -0
  196. package/lib/Radio/RadioInput.js +0 -0
  197. package/lib/Radio/RadioInput.native.js +0 -0
  198. package/lib/Radio/index.js +0 -0
  199. package/lib/RadioCard/RadioCard.js +0 -0
  200. package/lib/RadioCard/RadioCardGroup.js +0 -0
  201. package/lib/RadioCard/index.js +0 -0
  202. package/lib/Responsive/Responsive.js +0 -0
  203. package/lib/Responsive/ResponsiveProp.js +0 -0
  204. package/lib/Responsive/ResponsiveWithMediaQueryStyleSheet.js +0 -0
  205. package/lib/Responsive/index.js +0 -0
  206. package/lib/Search/Search.js +4 -2
  207. package/lib/Search/dictionary.js +0 -0
  208. package/lib/Search/index.js +0 -0
  209. package/lib/Select/Group.js +0 -0
  210. package/lib/Select/Group.native.js +0 -0
  211. package/lib/Select/Item.js +0 -0
  212. package/lib/Select/Item.native.js +0 -0
  213. package/lib/Select/Picker.js +0 -0
  214. package/lib/Select/Picker.native.js +1 -0
  215. package/lib/Select/Select.js +1 -4
  216. package/lib/Select/constants.js +0 -0
  217. package/lib/Select/index.js +0 -0
  218. package/lib/SideNav/Item.js +0 -0
  219. package/lib/SideNav/ItemContent.js +0 -0
  220. package/lib/SideNav/ItemsGroup.js +0 -0
  221. package/lib/SideNav/SideNav.js +0 -0
  222. package/lib/SideNav/index.js +0 -0
  223. package/lib/Skeleton/Skeleton.js +0 -0
  224. package/lib/Skeleton/index.js +0 -0
  225. package/lib/Skeleton/skeleton.constant.js +0 -0
  226. package/lib/Skeleton/skeletonWebAnimation.js +0 -0
  227. package/lib/Skeleton/useSkeletonNativeAnimation.js +0 -0
  228. package/lib/SkipLink/SkipLink.js +0 -0
  229. package/lib/SkipLink/index.js +0 -0
  230. package/lib/Spacer/Spacer.js +0 -0
  231. package/lib/Spacer/index.js +0 -0
  232. package/lib/StackView/StackView.js +0 -0
  233. package/lib/StackView/StackWrap.js +0 -0
  234. package/lib/StackView/StackWrap.native.js +0 -0
  235. package/lib/StackView/StackWrapBox.js +0 -0
  236. package/lib/StackView/StackWrapGap.js +0 -0
  237. package/lib/StackView/common.js +0 -0
  238. package/lib/StackView/getStackedContent.js +0 -0
  239. package/lib/StackView/index.js +0 -0
  240. package/lib/Status/Status.js +6 -2
  241. package/lib/Status/index.js +0 -0
  242. package/lib/StepTracker/Step.js +0 -0
  243. package/lib/StepTracker/StepTracker.js +0 -0
  244. package/lib/StepTracker/dictionary.js +0 -0
  245. package/lib/StepTracker/index.js +0 -0
  246. package/lib/TabBar/TabBar.js +0 -0
  247. package/lib/TabBar/TabBarItem.js +0 -0
  248. package/lib/TabBar/index.js +0 -0
  249. package/lib/Tabs/Tabs.js +0 -0
  250. package/lib/Tabs/TabsItem.js +0 -0
  251. package/lib/Tabs/index.js +0 -0
  252. package/lib/Tags/Tags.js +0 -0
  253. package/lib/Tags/index.js +0 -0
  254. package/lib/TextInput/TextArea.js +0 -0
  255. package/lib/TextInput/TextInput.js +0 -0
  256. package/lib/TextInput/TextInputBase.js +2 -2
  257. package/lib/TextInput/dictionary.js +0 -0
  258. package/lib/TextInput/index.js +0 -0
  259. package/lib/TextInput/propTypes.js +0 -0
  260. package/lib/ThemeProvider/ThemeProvider.js +0 -0
  261. package/lib/ThemeProvider/index.js +0 -0
  262. package/lib/ThemeProvider/useResponsiveThemeTokens.js +0 -0
  263. package/lib/ThemeProvider/useSetTheme.js +0 -0
  264. package/lib/ThemeProvider/useTheme.js +0 -0
  265. package/lib/ThemeProvider/useThemeTokens.js +0 -0
  266. package/lib/ThemeProvider/utils/index.js +0 -0
  267. package/lib/ThemeProvider/utils/styles.js +0 -0
  268. package/lib/ThemeProvider/utils/theme-tokens.js +0 -0
  269. package/lib/Timeline/Timeline.js +0 -0
  270. package/lib/Timeline/index.js +0 -0
  271. package/lib/ToggleSwitch/ToggleSwitch.js +0 -0
  272. package/lib/ToggleSwitch/ToggleSwitchGroup.js +0 -0
  273. package/lib/ToggleSwitch/index.js +0 -0
  274. package/lib/Tooltip/Backdrop.js +0 -0
  275. package/lib/Tooltip/Backdrop.native.js +0 -0
  276. package/lib/Tooltip/Tooltip.js +22 -13
  277. package/lib/Tooltip/Tooltip.native.js +24 -15
  278. package/lib/Tooltip/dictionary.js +0 -0
  279. package/lib/Tooltip/getTooltipPosition.js +0 -0
  280. package/lib/Tooltip/index.js +0 -0
  281. package/lib/Tooltip/shared.js +0 -0
  282. package/lib/TooltipButton/TooltipButton.js +0 -0
  283. package/lib/TooltipButton/index.js +0 -0
  284. package/lib/Typography/Typography.js +12 -0
  285. package/lib/Typography/index.js +0 -0
  286. package/lib/Validator/Validator.js +4 -0
  287. package/lib/Validator/index.js +0 -0
  288. package/lib/ViewportProvider/ViewportProvider.js +0 -0
  289. package/lib/ViewportProvider/index.js +0 -0
  290. package/lib/ViewportProvider/useViewport.js +0 -0
  291. package/lib/ViewportProvider/useViewportListener.js +0 -0
  292. package/lib/index.js +0 -0
  293. package/lib/server.js +0 -0
  294. package/lib/utils/BaseView/BaseView.js +0 -0
  295. package/lib/utils/BaseView/BaseView.native.js +0 -0
  296. package/lib/utils/BaseView/index.js +0 -0
  297. package/lib/utils/a11y/index.js +0 -0
  298. package/lib/utils/a11y/semantics.js +0 -0
  299. package/lib/utils/a11y/textSize.js +0 -0
  300. package/lib/utils/animation/index.js +0 -0
  301. package/lib/utils/animation/useVerticalExpandAnimation.js +0 -0
  302. package/lib/utils/children.js +0 -0
  303. package/lib/utils/containUniqueFields.js +0 -0
  304. package/lib/utils/convertFromMegaByteToByte.js +0 -0
  305. package/lib/utils/floating-ui/index.js +0 -0
  306. package/lib/utils/floating-ui/index.native.js +0 -0
  307. package/lib/utils/formatImageSource.js +0 -0
  308. package/lib/utils/hasOwnProperty.js +0 -0
  309. package/lib/utils/htmlAttrs.js +0 -0
  310. package/lib/utils/index.js +0 -0
  311. package/lib/utils/info/index.js +0 -0
  312. package/lib/utils/info/platform/index.js +0 -0
  313. package/lib/utils/info/platform/platform.android.js +0 -0
  314. package/lib/utils/info/platform/platform.ios.js +0 -0
  315. package/lib/utils/info/platform/platform.js +0 -0
  316. package/lib/utils/info/platform/platform.native.js +0 -0
  317. package/lib/utils/info/versions.js +0 -0
  318. package/lib/utils/input.js +0 -0
  319. package/lib/utils/pressability.js +0 -0
  320. package/lib/utils/props/a11yProps.js +0 -0
  321. package/lib/utils/props/clickProps.js +0 -0
  322. package/lib/utils/props/componentPropType.js +0 -0
  323. package/lib/utils/props/contentfulProps.js +22 -0
  324. package/lib/utils/props/copyPropTypes.js +0 -0
  325. package/lib/utils/props/getPropSelector.js +0 -0
  326. package/lib/utils/props/handlerProps.js +0 -0
  327. package/lib/utils/props/hrefAttrsProp.js +0 -0
  328. package/lib/utils/props/index.js +2 -1
  329. package/lib/utils/props/inputSupportsProps.js +0 -0
  330. package/lib/utils/props/linkProps.js +0 -0
  331. package/lib/utils/props/paddingProp.js +0 -0
  332. package/lib/utils/props/pressProps.js +0 -0
  333. package/lib/utils/props/rectProp.js +0 -0
  334. package/lib/utils/props/responsiveProps.js +0 -0
  335. package/lib/utils/props/selectSystemProps.js +0 -0
  336. package/lib/utils/props/spacingProps.js +0 -0
  337. package/lib/utils/props/textInputProps.js +0 -0
  338. package/lib/utils/props/textProps.js +0 -0
  339. package/lib/utils/props/tokens.js +0 -0
  340. package/lib/utils/props/variantProp.js +0 -0
  341. package/lib/utils/props/viewProps.js +0 -0
  342. package/lib/utils/ssr-media-query/create-stylesheet/create-stylesheet-mobile.js +0 -0
  343. package/lib/utils/ssr-media-query/create-stylesheet/index.android.js +0 -0
  344. package/lib/utils/ssr-media-query/create-stylesheet/index.ios.js +0 -0
  345. package/lib/utils/ssr-media-query/create-stylesheet/index.js +0 -0
  346. package/lib/utils/ssr-media-query/hash.js +0 -0
  347. package/lib/utils/ssr-media-query/index.js +0 -0
  348. package/lib/utils/ssr-media-query/utils/common.js +0 -0
  349. package/lib/utils/ssr-media-query/utils/create-declaration-block.js +0 -0
  350. package/lib/utils/ssr-media-query/utils/create-media-query-styles.js +0 -0
  351. package/lib/utils/ssr-media-query/utils/hyphenate-style-name.js +0 -0
  352. package/lib/utils/ssr-media-query/utils/inject.js +0 -0
  353. package/lib/utils/ssr.js +0 -0
  354. package/lib/utils/transformGradient.js +0 -0
  355. package/lib/utils/useCopy.js +0 -0
  356. package/lib/utils/useHash.js +0 -0
  357. package/lib/utils/useHash.native.js +0 -0
  358. package/lib/utils/useOverlaidPosition.js +0 -0
  359. package/lib/utils/useResponsiveProp.js +0 -0
  360. package/lib/utils/useSafeLayoutEffect.js +0 -0
  361. package/lib/utils/useScrollBlocking.js +0 -0
  362. package/lib/utils/useScrollBlocking.native.js +0 -0
  363. package/lib/utils/useSpacingScale.js +0 -0
  364. package/lib/utils/useUniqueId.js +0 -0
  365. package/lib/utils/withLinkRouter.js +0 -0
  366. package/package.json +2 -2
  367. package/src/Card/PressableCardBase.jsx +1 -1
  368. package/src/Carousel/Carousel.jsx +166 -34
  369. package/src/Carousel/CarouselItem/CarouselItem.jsx +56 -26
  370. package/src/Carousel/CarouselStepTracker/CarouselStepTracker.jsx +71 -37
  371. package/src/Carousel/Constants.js +3 -0
  372. package/src/Checkbox/CheckboxGroup.jsx +7 -3
  373. package/src/HorizontalScroll/HorizontalScroll.jsx +19 -15
  374. package/src/Icon/Icon.jsx +1 -0
  375. package/src/InputSupports/InputSupports.jsx +1 -0
  376. package/src/Link/LinkBase.jsx +8 -2
  377. package/src/Listbox/PressableItem.jsx +2 -2
  378. package/src/Modal/Modal.jsx +4 -0
  379. package/src/Modal/ModalContent.jsx +23 -7
  380. package/src/Progress/Progress.jsx +12 -2
  381. package/src/Progress/ProgressBar.jsx +48 -13
  382. package/src/Progress/ProgressBarBackground.jsx +4 -2
  383. package/src/Progress/constants.js +4 -0
  384. package/src/Search/Search.jsx +9 -3
  385. package/src/Select/Picker.native.jsx +1 -0
  386. package/src/Select/Select.jsx +8 -9
  387. package/src/Status/Status.jsx +2 -2
  388. package/src/TextInput/TextInputBase.jsx +2 -2
  389. package/src/Tooltip/Tooltip.jsx +6 -1
  390. package/src/Tooltip/Tooltip.native.jsx +7 -1
  391. package/src/Typography/Typography.jsx +12 -0
  392. package/src/Validator/Validator.jsx +7 -1
  393. package/src/utils/props/contentfulProps.js +24 -0
  394. 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 Sat, 23 Nov 2024 01:38:59 GMT and should not be manually modified. -->
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:38:59 GMT
47
+ Sat, 23 Nov 2024 01:40:21 GMT
10
48
 
11
49
  ### Patches
12
50
 
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
File without changes
File without changes
File without changes
File without changes
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
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/lib/Card/Card.js CHANGED
File without changes
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
- requireAll: true
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
File without changes
@@ -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 autoPlayFeatureEnabled = autoPlay && slideDuration > 0 && transitionDuration > 0 && childrenArray.length > 1;
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 >= childrenArray.length;
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 = childrenArray.length + delta;
356
- } else if (activeIndexRef.current + 1 >= childrenArray.length && delta > 0) {
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
- toValue.x = containerLayoutRef.current.width * -1 * calcDelta;
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 === childrenArray.length && transitionMode === TRANSITION_MODES.AUTOMATIC) {
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, childrenArray.length, onIndexChanged, isCarouselPlaying, stopAutoplay, isAutoPlayEnabled]);
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 && childrenArray.length > 1);
452
- }, [autoPlay, slideDuration, transitionDuration, childrenArray.length]);
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 (childrenArray.length === 1) {
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, childrenArray.length]);
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, childrenArray.length);
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, childrenArray.length, itemLabel, getCopy, title]);
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: childrenArray.length,
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 && childrenArray.length > 1 ? /*#__PURE__*/_jsx(View, {
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(childrenArray.length, containerLayout.width, enablePeeking), {
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 && childrenArray.length > 1 ? /*#__PURE__*/_jsx(View, {
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
@@ -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
- const isActive = activeIndex === elementIndex;
30
- if (isActive) {
31
- if (isFirst) {
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