@telus-uds/components-base 2.5.0 → 3.0.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 (744) hide show
  1. package/CHANGELOG.md +20 -2
  2. package/lib/cjs/A11yInfoProvider/index.js +73 -0
  3. package/lib/cjs/A11yText/index.js +75 -0
  4. package/lib/cjs/ActionCard/ActionCard.js +349 -0
  5. package/lib/cjs/ActionCard/index.js +9 -0
  6. package/lib/cjs/ActivityIndicator/Spinner.js +85 -0
  7. package/lib/cjs/ActivityIndicator/Spinner.native.js +151 -0
  8. package/lib/cjs/ActivityIndicator/index.js +51 -0
  9. package/lib/cjs/ActivityIndicator/shared.js +20 -0
  10. package/lib/cjs/Autocomplete/Autocomplete.js +480 -0
  11. package/lib/cjs/Autocomplete/Loading.js +42 -0
  12. package/lib/cjs/Autocomplete/Suggestions.js +71 -0
  13. package/lib/cjs/Autocomplete/constants.js +10 -0
  14. package/lib/cjs/Autocomplete/dictionary.js +18 -0
  15. package/lib/cjs/Autocomplete/index.js +9 -0
  16. package/lib/cjs/Badge/Badge.js +109 -0
  17. package/lib/cjs/Badge/index.js +9 -0
  18. package/lib/cjs/BaseProvider/HydrationContext.js +56 -0
  19. package/lib/cjs/BaseProvider/index.js +46 -0
  20. package/lib/cjs/Box/Box.js +385 -0
  21. package/lib/cjs/Box/backgroundImageStylesMap.js +100 -0
  22. package/lib/cjs/Box/index.js +9 -0
  23. package/lib/cjs/Button/Button.js +43 -0
  24. package/lib/cjs/Button/ButtonBase.js +353 -0
  25. package/lib/cjs/Button/ButtonDropdown.js +182 -0
  26. package/lib/cjs/Button/ButtonGroup.js +279 -0
  27. package/lib/cjs/Button/ButtonLink.js +57 -0
  28. package/lib/cjs/Button/index.js +34 -0
  29. package/lib/cjs/Button/propTypes.js +53 -0
  30. package/lib/cjs/Card/Card.js +334 -0
  31. package/lib/cjs/Card/CardBase.js +127 -0
  32. package/lib/cjs/Card/PressableCardBase.js +121 -0
  33. package/lib/cjs/Card/index.js +32 -0
  34. package/lib/cjs/CardGroup/CardGroup.js +219 -0
  35. package/lib/cjs/CardGroup/dictionary.js +14 -0
  36. package/lib/cjs/CardGroup/index.js +9 -0
  37. package/lib/cjs/Carousel/Carousel.js +1046 -0
  38. package/lib/cjs/Carousel/CarouselContext.js +59 -0
  39. package/lib/cjs/Carousel/CarouselFirstFocus/CarouselFirstFocus.js +57 -0
  40. package/lib/cjs/Carousel/CarouselItem/CarouselItem.js +185 -0
  41. package/lib/cjs/Carousel/CarouselItem/index.js +9 -0
  42. package/lib/cjs/Carousel/CarouselStepTracker/CarouselStepTracker.js +101 -0
  43. package/lib/cjs/Carousel/CarouselStepTracker/index.js +9 -0
  44. package/lib/cjs/Carousel/CarouselTabs/CarouselTabs.js +54 -0
  45. package/lib/cjs/Carousel/CarouselTabs/CarouselTabsPanel.js +95 -0
  46. package/lib/cjs/Carousel/CarouselTabs/CarouselTabsPanelItem.js +125 -0
  47. package/lib/cjs/Carousel/CarouselTabs/index.js +9 -0
  48. package/lib/cjs/Carousel/CarouselThumbnail.js +120 -0
  49. package/lib/cjs/Carousel/CarouselThumbnailNavigation.js +78 -0
  50. package/lib/cjs/Carousel/Constants.js +13 -0
  51. package/lib/cjs/Carousel/dictionary.js +28 -0
  52. package/lib/cjs/Carousel/index.js +36 -0
  53. package/lib/cjs/Checkbox/Checkbox.js +349 -0
  54. package/lib/cjs/Checkbox/CheckboxButton.js +171 -0
  55. package/lib/cjs/Checkbox/CheckboxGroup.js +249 -0
  56. package/lib/cjs/Checkbox/CheckboxInput.js +55 -0
  57. package/lib/cjs/Checkbox/CheckboxInput.native.js +11 -0
  58. package/lib/cjs/Checkbox/index.js +16 -0
  59. package/lib/cjs/CheckboxCard/CheckboxCard.js +191 -0
  60. package/lib/cjs/CheckboxCard/index.js +9 -0
  61. package/lib/cjs/CheckboxCardGroup/CheckboxCardGroup.js +215 -0
  62. package/lib/cjs/CheckboxCardGroup/index.js +9 -0
  63. package/lib/cjs/ColourToggle/ColourBubble.js +133 -0
  64. package/lib/cjs/ColourToggle/ColourToggle.js +98 -0
  65. package/lib/cjs/ColourToggle/index.js +9 -0
  66. package/lib/cjs/Divider/Divider.js +138 -0
  67. package/lib/cjs/Divider/index.js +9 -0
  68. package/lib/cjs/DownloadApp/DownloadApp.js +167 -0
  69. package/lib/cjs/DownloadApp/dictionary.js +16 -0
  70. package/lib/cjs/DownloadApp/index.js +9 -0
  71. package/lib/cjs/ExpandCollapse/Accordion.js +20 -0
  72. package/lib/cjs/ExpandCollapse/Control.js +170 -0
  73. package/lib/cjs/ExpandCollapse/ExpandCollapse.js +105 -0
  74. package/lib/cjs/ExpandCollapse/Panel.js +248 -0
  75. package/lib/cjs/ExpandCollapse/dictionary.js +16 -0
  76. package/lib/cjs/ExpandCollapse/index.js +19 -0
  77. package/lib/cjs/ExpandCollapseMini/ExpandCollapseMini.js +84 -0
  78. package/lib/cjs/ExpandCollapseMini/ExpandCollapseMiniControl.js +133 -0
  79. package/lib/cjs/ExpandCollapseMini/index.js +9 -0
  80. package/lib/cjs/Feedback/Feedback.js +167 -0
  81. package/lib/cjs/Feedback/index.js +9 -0
  82. package/lib/cjs/Fieldset/Fieldset.js +198 -0
  83. package/lib/cjs/Fieldset/FieldsetContainer.js +55 -0
  84. package/lib/cjs/Fieldset/FieldsetContainer.native.js +39 -0
  85. package/lib/cjs/Fieldset/Legend.js +29 -0
  86. package/lib/cjs/Fieldset/Legend.native.js +36 -0
  87. package/lib/cjs/Fieldset/cssReset.js +20 -0
  88. package/lib/cjs/Fieldset/index.js +9 -0
  89. package/lib/cjs/FileUpload/FileUpload.js +370 -0
  90. package/lib/cjs/FileUpload/NotificationContent.js +59 -0
  91. package/lib/cjs/FileUpload/dictionary.js +50 -0
  92. package/lib/cjs/FileUpload/index.js +9 -0
  93. package/lib/cjs/FlexGrid/Col/Col.js +264 -0
  94. package/lib/cjs/FlexGrid/Col/index.js +9 -0
  95. package/lib/cjs/FlexGrid/FlexGrid.js +165 -0
  96. package/lib/cjs/FlexGrid/Row/Row.js +188 -0
  97. package/lib/cjs/FlexGrid/Row/index.js +9 -0
  98. package/lib/cjs/FlexGrid/helpers/index.js +21 -0
  99. package/lib/cjs/FlexGrid/index.js +9 -0
  100. package/lib/cjs/FlexGrid/providers/GutterContext.js +10 -0
  101. package/lib/cjs/Footnote/Footnote.js +323 -0
  102. package/lib/cjs/Footnote/FootnoteLink.js +114 -0
  103. package/lib/cjs/Footnote/dictionary.js +18 -0
  104. package/lib/cjs/Footnote/index.js +11 -0
  105. package/lib/cjs/HorizontalScroll/HorizontalScroll.js +175 -0
  106. package/lib/cjs/HorizontalScroll/HorizontalScrollButton.js +86 -0
  107. package/lib/cjs/HorizontalScroll/ScrollViewEnd.js +53 -0
  108. package/lib/cjs/HorizontalScroll/ScrollViewEnd.native.js +32 -0
  109. package/lib/cjs/HorizontalScroll/dictionary.js +17 -0
  110. package/lib/cjs/HorizontalScroll/index.js +26 -0
  111. package/lib/cjs/HorizontalScroll/itemPositions.js +122 -0
  112. package/lib/cjs/Icon/Icon.js +101 -0
  113. package/lib/cjs/Icon/IconText.js +117 -0
  114. package/lib/cjs/Icon/index.js +24 -0
  115. package/lib/cjs/IconButton/IconButton.js +208 -0
  116. package/lib/cjs/IconButton/index.js +9 -0
  117. package/lib/cjs/InputLabel/InputLabel.js +184 -0
  118. package/lib/cjs/InputLabel/LabelContent.js +35 -0
  119. package/lib/cjs/InputLabel/LabelContent.native.js +26 -0
  120. package/lib/cjs/InputLabel/index.js +9 -0
  121. package/lib/cjs/InputSupports/InputSupports.js +140 -0
  122. package/lib/cjs/InputSupports/dictionary.js +18 -0
  123. package/lib/cjs/InputSupports/index.js +9 -0
  124. package/lib/cjs/InputSupports/useInputSupports.js +47 -0
  125. package/lib/cjs/Link/ChevronLink.js +73 -0
  126. package/lib/cjs/Link/InlinePressable.js +53 -0
  127. package/lib/cjs/Link/InlinePressable.native.js +93 -0
  128. package/lib/cjs/Link/Link.js +35 -0
  129. package/lib/cjs/Link/LinkBase.js +283 -0
  130. package/lib/cjs/Link/TextButton.js +48 -0
  131. package/lib/cjs/Link/index.js +34 -0
  132. package/lib/cjs/List/List.js +83 -0
  133. package/lib/cjs/List/ListItem.js +37 -0
  134. package/lib/cjs/List/ListItemBase.js +171 -0
  135. package/lib/cjs/List/ListItemContent.js +80 -0
  136. package/lib/cjs/List/ListItemMark.js +132 -0
  137. package/lib/cjs/List/PressableListItemBase.js +117 -0
  138. package/lib/cjs/List/index.js +23 -0
  139. package/lib/cjs/Listbox/GroupControl.js +112 -0
  140. package/lib/cjs/Listbox/Listbox.js +177 -0
  141. package/lib/cjs/Listbox/ListboxContext.js +11 -0
  142. package/lib/cjs/Listbox/ListboxGroup.js +133 -0
  143. package/lib/cjs/Listbox/ListboxItem.js +83 -0
  144. package/lib/cjs/Listbox/ListboxOverlay.js +87 -0
  145. package/lib/cjs/Listbox/PressableItem.js +146 -0
  146. package/lib/cjs/Listbox/index.js +9 -0
  147. package/lib/cjs/Modal/Modal.js +377 -0
  148. package/lib/cjs/Modal/ModalContent.js +205 -0
  149. package/lib/cjs/Modal/WebModal.js +83 -0
  150. package/lib/cjs/Modal/dictionary.js +15 -0
  151. package/lib/cjs/Modal/index.js +9 -0
  152. package/lib/cjs/MultiSelectFilter/ModalOverlay.js +162 -0
  153. package/lib/cjs/MultiSelectFilter/MultiSelectFilter.js +544 -0
  154. package/lib/cjs/MultiSelectFilter/dictionary.js +18 -0
  155. package/lib/cjs/MultiSelectFilter/index.js +9 -0
  156. package/lib/cjs/Notification/Notification.js +437 -0
  157. package/lib/cjs/Notification/dictionary.js +14 -0
  158. package/lib/cjs/Notification/index.js +9 -0
  159. package/lib/cjs/OrderedList/Item.js +166 -0
  160. package/lib/cjs/OrderedList/ItemBase.js +51 -0
  161. package/lib/cjs/OrderedList/OrderedList.js +70 -0
  162. package/lib/cjs/OrderedList/OrderedListBase.js +44 -0
  163. package/lib/cjs/OrderedList/index.js +9 -0
  164. package/lib/cjs/Pagination/PageButton.js +82 -0
  165. package/lib/cjs/Pagination/Pagination.js +226 -0
  166. package/lib/cjs/Pagination/SideButton.js +119 -0
  167. package/lib/cjs/Pagination/constants.js +9 -0
  168. package/lib/cjs/Pagination/dictionary.js +24 -0
  169. package/lib/cjs/Pagination/index.js +9 -0
  170. package/lib/cjs/Pagination/usePagination.js +83 -0
  171. package/lib/cjs/Portal/Portal.js +56 -0
  172. package/lib/cjs/Portal/Portal.native.js +8 -0
  173. package/lib/cjs/Portal/index.js +9 -0
  174. package/lib/cjs/PriceLockup/PriceLockup.js +230 -0
  175. package/lib/cjs/PriceLockup/index.js +9 -0
  176. package/lib/cjs/PriceLockup/utils/renderFootnoteContent.js +92 -0
  177. package/lib/cjs/PriceLockup/utils/renderFootnoteLinks.js +35 -0
  178. package/lib/cjs/PriceLockup/utils/renderPrice.js +146 -0
  179. package/lib/cjs/PriceLockup/utils/renderTypography.js +30 -0
  180. package/lib/cjs/ProductCard/ProductCard.js +237 -0
  181. package/lib/cjs/ProductCard/dictionary.js +44 -0
  182. package/lib/cjs/ProductCard/index.js +9 -0
  183. package/lib/cjs/ProductCardGroup/ProductCardGroup.js +77 -0
  184. package/lib/cjs/ProductCardGroup/index.js +9 -0
  185. package/lib/cjs/Progress/Progress.js +101 -0
  186. package/lib/cjs/Progress/ProgressBar.js +168 -0
  187. package/lib/cjs/Progress/ProgressBarBackground.js +49 -0
  188. package/lib/cjs/Progress/constants.js +10 -0
  189. package/lib/cjs/Progress/index.js +11 -0
  190. package/lib/cjs/QuickLinks/QuickLinks.js +83 -0
  191. package/lib/cjs/QuickLinks/QuickLinksCard.js +38 -0
  192. package/lib/cjs/QuickLinks/QuickLinksItem.js +56 -0
  193. package/lib/cjs/QuickLinks/index.js +11 -0
  194. package/lib/cjs/QuickLinksFeature/QuickLinksFeature.js +74 -0
  195. package/lib/cjs/QuickLinksFeature/QuickLinksFeatureItem.js +152 -0
  196. package/lib/cjs/QuickLinksFeature/index.js +11 -0
  197. package/lib/cjs/Radio/Radio.js +291 -0
  198. package/lib/cjs/Radio/RadioButton.js +191 -0
  199. package/lib/cjs/Radio/RadioGroup.js +262 -0
  200. package/lib/cjs/Radio/RadioInput.js +55 -0
  201. package/lib/cjs/Radio/RadioInput.native.js +11 -0
  202. package/lib/cjs/Radio/index.js +16 -0
  203. package/lib/cjs/RadioCard/RadioCard.js +219 -0
  204. package/lib/cjs/RadioCard/RadioCardGroup.js +266 -0
  205. package/lib/cjs/RadioCard/index.js +16 -0
  206. package/lib/cjs/Responsive/Responsive.js +70 -0
  207. package/lib/cjs/Responsive/ResponsiveProp.js +45 -0
  208. package/lib/cjs/Responsive/ResponsiveWithMediaQueryStyleSheet.js +75 -0
  209. package/lib/cjs/Responsive/index.js +9 -0
  210. package/lib/cjs/Search/Search.js +281 -0
  211. package/lib/cjs/Search/dictionary.js +18 -0
  212. package/lib/cjs/Search/index.js +9 -0
  213. package/lib/cjs/Select/Group.js +31 -0
  214. package/lib/cjs/Select/Group.native.js +23 -0
  215. package/lib/cjs/Select/Item.js +30 -0
  216. package/lib/cjs/Select/Item.native.js +8 -0
  217. package/lib/cjs/Select/Picker.js +103 -0
  218. package/lib/cjs/Select/Picker.native.js +130 -0
  219. package/lib/cjs/Select/Select.js +339 -0
  220. package/lib/cjs/Select/constants.js +13 -0
  221. package/lib/cjs/Select/index.js +13 -0
  222. package/lib/cjs/SideNav/Item.js +150 -0
  223. package/lib/cjs/SideNav/ItemContent.js +56 -0
  224. package/lib/cjs/SideNav/ItemsGroup.js +125 -0
  225. package/lib/cjs/SideNav/SideNav.js +139 -0
  226. package/lib/cjs/SideNav/index.js +13 -0
  227. package/lib/cjs/Skeleton/Skeleton.js +184 -0
  228. package/lib/cjs/Skeleton/index.js +9 -0
  229. package/lib/cjs/Skeleton/skeleton.constant.js +8 -0
  230. package/lib/cjs/Skeleton/skeletonWebAnimation.js +20 -0
  231. package/lib/cjs/Skeleton/useSkeletonNativeAnimation.js +35 -0
  232. package/lib/cjs/SkipLink/SkipLink.js +196 -0
  233. package/lib/cjs/SkipLink/index.js +9 -0
  234. package/lib/cjs/Spacer/Spacer.js +100 -0
  235. package/lib/cjs/Spacer/index.js +9 -0
  236. package/lib/cjs/StackView/StackView.js +133 -0
  237. package/lib/cjs/StackView/StackWrap.js +54 -0
  238. package/lib/cjs/StackView/StackWrap.native.js +10 -0
  239. package/lib/cjs/StackView/StackWrapBox.js +121 -0
  240. package/lib/cjs/StackView/StackWrapGap.js +68 -0
  241. package/lib/cjs/StackView/common.js +43 -0
  242. package/lib/cjs/StackView/getStackedContent.js +128 -0
  243. package/lib/cjs/StackView/index.js +23 -0
  244. package/lib/cjs/Status/Status.js +176 -0
  245. package/lib/cjs/Status/index.js +9 -0
  246. package/lib/cjs/StepTracker/Step.js +271 -0
  247. package/lib/cjs/StepTracker/StepTracker.js +220 -0
  248. package/lib/cjs/StepTracker/dictionary.js +36 -0
  249. package/lib/cjs/StepTracker/index.js +9 -0
  250. package/lib/cjs/TabBar/TabBar.js +132 -0
  251. package/lib/cjs/TabBar/TabBarItem.js +182 -0
  252. package/lib/cjs/TabBar/index.js +9 -0
  253. package/lib/cjs/Tabs/Tabs.js +188 -0
  254. package/lib/cjs/Tabs/TabsItem.js +245 -0
  255. package/lib/cjs/Tabs/index.js +9 -0
  256. package/lib/cjs/Tags/Tags.js +252 -0
  257. package/lib/cjs/Tags/index.js +9 -0
  258. package/lib/cjs/TextInput/TextArea.js +105 -0
  259. package/lib/cjs/TextInput/TextInput.js +86 -0
  260. package/lib/cjs/TextInput/TextInputBase.js +502 -0
  261. package/lib/cjs/TextInput/dictionary.js +18 -0
  262. package/lib/cjs/TextInput/index.js +20 -0
  263. package/lib/cjs/TextInput/propTypes.js +40 -0
  264. package/lib/cjs/ThemeProvider/ThemeProvider.js +91 -0
  265. package/lib/cjs/ThemeProvider/index.js +59 -0
  266. package/lib/cjs/ThemeProvider/useResponsiveThemeTokens.js +88 -0
  267. package/lib/cjs/ThemeProvider/useSetTheme.js +30 -0
  268. package/lib/cjs/ThemeProvider/useTheme.js +17 -0
  269. package/lib/cjs/ThemeProvider/useThemeTokens.js +118 -0
  270. package/lib/cjs/ThemeProvider/utils/index.js +27 -0
  271. package/lib/cjs/ThemeProvider/utils/styles.js +208 -0
  272. package/lib/cjs/ThemeProvider/utils/theme-tokens.js +173 -0
  273. package/lib/cjs/Timeline/Timeline.js +175 -0
  274. package/lib/cjs/Timeline/index.js +9 -0
  275. package/lib/cjs/ToggleSwitch/ToggleSwitch.js +286 -0
  276. package/lib/cjs/ToggleSwitch/ToggleSwitchGroup.js +215 -0
  277. package/lib/cjs/ToggleSwitch/index.js +20 -0
  278. package/lib/cjs/Tooltip/Backdrop.js +57 -0
  279. package/lib/cjs/Tooltip/Backdrop.native.js +46 -0
  280. package/lib/cjs/Tooltip/Tooltip.js +295 -0
  281. package/lib/cjs/Tooltip/Tooltip.native.js +370 -0
  282. package/lib/cjs/Tooltip/dictionary.js +14 -0
  283. package/lib/cjs/Tooltip/getTooltipPosition.js +175 -0
  284. package/lib/cjs/Tooltip/index.js +12 -0
  285. package/lib/cjs/Tooltip/shared.js +48 -0
  286. package/lib/cjs/TooltipButton/TooltipButton.js +97 -0
  287. package/lib/cjs/TooltipButton/index.js +9 -0
  288. package/lib/cjs/Typography/Typography.js +271 -0
  289. package/lib/cjs/Typography/index.js +9 -0
  290. package/lib/cjs/Validator/Validator.js +228 -0
  291. package/lib/cjs/Validator/index.js +9 -0
  292. package/lib/cjs/ViewportProvider/ViewportProvider.js +32 -0
  293. package/lib/cjs/ViewportProvider/index.js +22 -0
  294. package/lib/cjs/ViewportProvider/useViewport.js +10 -0
  295. package/lib/cjs/ViewportProvider/useViewportListener.js +43 -0
  296. package/lib/cjs/index.js +781 -0
  297. package/lib/cjs/server.js +40 -0
  298. package/lib/cjs/utils/BaseView/BaseView.js +47 -0
  299. package/lib/cjs/utils/BaseView/BaseView.native.js +12 -0
  300. package/lib/cjs/utils/BaseView/index.js +9 -0
  301. package/lib/cjs/utils/a11y/index.js +27 -0
  302. package/lib/cjs/utils/a11y/semantics.js +145 -0
  303. package/lib/cjs/utils/a11y/textSize.js +44 -0
  304. package/lib/cjs/utils/animation/index.js +13 -0
  305. package/lib/cjs/utils/animation/useVerticalExpandAnimation.js +92 -0
  306. package/lib/cjs/utils/children.js +121 -0
  307. package/lib/cjs/utils/containUniqueFields.js +30 -0
  308. package/lib/cjs/utils/convertFromMegaByteToByte.js +16 -0
  309. package/lib/cjs/utils/floating-ui/index.js +42 -0
  310. package/lib/cjs/utils/floating-ui/index.native.js +42 -0
  311. package/lib/cjs/utils/formatImageSource.js +33 -0
  312. package/lib/cjs/utils/hasOwnProperty.js +17 -0
  313. package/lib/cjs/utils/htmlAttrs.js +30 -0
  314. package/lib/cjs/utils/index.js +245 -0
  315. package/lib/cjs/utils/info/index.js +14 -0
  316. package/lib/cjs/utils/info/platform/index.js +18 -0
  317. package/lib/cjs/utils/info/platform/platform.android.js +7 -0
  318. package/lib/cjs/utils/info/platform/platform.ios.js +7 -0
  319. package/lib/cjs/utils/info/platform/platform.js +7 -0
  320. package/lib/cjs/utils/info/platform/platform.native.js +10 -0
  321. package/lib/cjs/utils/info/versions.js +12 -0
  322. package/lib/cjs/utils/input.js +193 -0
  323. package/lib/cjs/utils/pressability.js +122 -0
  324. package/lib/cjs/utils/props/a11yProps.js +315 -0
  325. package/lib/cjs/utils/props/clickProps.js +32 -0
  326. package/lib/cjs/utils/props/componentPropType.js +55 -0
  327. package/lib/cjs/utils/props/contentfulProps.js +29 -0
  328. package/lib/cjs/utils/props/copyPropTypes.js +9 -0
  329. package/lib/cjs/utils/props/getPropSelector.js +58 -0
  330. package/lib/cjs/utils/props/handlerProps.js +111 -0
  331. package/lib/cjs/utils/props/hrefAttrsProp.js +39 -0
  332. package/lib/cjs/utils/props/index.js +176 -0
  333. package/lib/cjs/utils/props/inputSupportsProps.js +87 -0
  334. package/lib/cjs/utils/props/linkProps.js +50 -0
  335. package/lib/cjs/utils/props/paddingProp.js +16 -0
  336. package/lib/cjs/utils/props/pressProps.js +49 -0
  337. package/lib/cjs/utils/props/rectProp.js +16 -0
  338. package/lib/cjs/utils/props/responsiveProps.js +35 -0
  339. package/lib/cjs/utils/props/selectSystemProps.js +29 -0
  340. package/lib/cjs/utils/props/spacingProps.js +63 -0
  341. package/lib/cjs/utils/props/textInputProps.js +194 -0
  342. package/lib/cjs/utils/props/textProps.js +67 -0
  343. package/lib/cjs/utils/props/tokens.js +140 -0
  344. package/lib/cjs/utils/props/variantProp.js +24 -0
  345. package/lib/cjs/utils/props/viewProps.js +28 -0
  346. package/lib/cjs/utils/ssr-media-query/create-stylesheet/create-stylesheet-mobile.js +55 -0
  347. package/lib/cjs/utils/ssr-media-query/create-stylesheet/index.android.js +9 -0
  348. package/lib/cjs/utils/ssr-media-query/create-stylesheet/index.ios.js +9 -0
  349. package/lib/cjs/utils/ssr-media-query/create-stylesheet/index.js +42 -0
  350. package/lib/cjs/utils/ssr-media-query/hash.js +19 -0
  351. package/lib/cjs/utils/ssr-media-query/index.js +18 -0
  352. package/lib/cjs/utils/ssr-media-query/utils/common.js +44 -0
  353. package/lib/cjs/utils/ssr-media-query/utils/create-declaration-block.js +23 -0
  354. package/lib/cjs/utils/ssr-media-query/utils/create-media-query-styles.js +66 -0
  355. package/lib/cjs/utils/ssr-media-query/utils/hyphenate-style-name.js +18 -0
  356. package/lib/cjs/utils/ssr-media-query/utils/inject.js +47 -0
  357. package/lib/cjs/utils/ssr.js +150 -0
  358. package/lib/cjs/utils/transformGradient.js +22 -0
  359. package/lib/cjs/utils/useCopy.js +48 -0
  360. package/lib/cjs/utils/useHash.js +44 -0
  361. package/lib/cjs/utils/useHash.native.js +12 -0
  362. package/lib/cjs/utils/useOverlaidPosition.js +242 -0
  363. package/lib/cjs/utils/useResponsiveProp.js +53 -0
  364. package/lib/cjs/utils/useSafeLayoutEffect.js +34 -0
  365. package/lib/cjs/utils/useScrollBlocking.js +55 -0
  366. package/lib/cjs/utils/useScrollBlocking.native.js +9 -0
  367. package/lib/cjs/utils/useSpacingScale.js +129 -0
  368. package/lib/cjs/utils/useUniqueId.js +17 -0
  369. package/lib/cjs/utils/withLinkRouter.js +89 -0
  370. package/lib/{Carousel → esm/Carousel}/Carousel.js +166 -107
  371. package/lib/{Carousel → esm/Carousel}/CarouselItem/CarouselItem.js +23 -6
  372. package/lib/esm/Carousel/Constants.js +7 -0
  373. package/lib/{TextInput → esm/TextInput}/TextInputBase.js +30 -1
  374. package/lib/package.json +88 -0
  375. package/package.json +13 -11
  376. package/src/Carousel/Carousel.jsx +228 -155
  377. package/src/Carousel/CarouselItem/CarouselItem.jsx +14 -4
  378. package/src/Carousel/Constants.js +4 -0
  379. package/src/TextInput/TextInputBase.jsx +30 -1
  380. package/lib/Carousel/Constants.js +0 -3
  381. /package/lib/{A11yInfoProvider → esm/A11yInfoProvider}/index.js +0 -0
  382. /package/lib/{A11yText → esm/A11yText}/index.js +0 -0
  383. /package/lib/{ActionCard → esm/ActionCard}/ActionCard.js +0 -0
  384. /package/lib/{ActionCard → esm/ActionCard}/index.js +0 -0
  385. /package/lib/{ActivityIndicator → esm/ActivityIndicator}/Spinner.js +0 -0
  386. /package/lib/{ActivityIndicator → esm/ActivityIndicator}/Spinner.native.js +0 -0
  387. /package/lib/{ActivityIndicator → esm/ActivityIndicator}/index.js +0 -0
  388. /package/lib/{ActivityIndicator → esm/ActivityIndicator}/shared.js +0 -0
  389. /package/lib/{Autocomplete → esm/Autocomplete}/Autocomplete.js +0 -0
  390. /package/lib/{Autocomplete → esm/Autocomplete}/Loading.js +0 -0
  391. /package/lib/{Autocomplete → esm/Autocomplete}/Suggestions.js +0 -0
  392. /package/lib/{Autocomplete → esm/Autocomplete}/constants.js +0 -0
  393. /package/lib/{Autocomplete → esm/Autocomplete}/dictionary.js +0 -0
  394. /package/lib/{Autocomplete → esm/Autocomplete}/index.js +0 -0
  395. /package/lib/{Badge → esm/Badge}/Badge.js +0 -0
  396. /package/lib/{Badge → esm/Badge}/index.js +0 -0
  397. /package/lib/{BaseProvider → esm/BaseProvider}/HydrationContext.js +0 -0
  398. /package/lib/{BaseProvider → esm/BaseProvider}/index.js +0 -0
  399. /package/lib/{Box → esm/Box}/Box.js +0 -0
  400. /package/lib/{Box → esm/Box}/backgroundImageStylesMap.js +0 -0
  401. /package/lib/{Box → esm/Box}/index.js +0 -0
  402. /package/lib/{Button → esm/Button}/Button.js +0 -0
  403. /package/lib/{Button → esm/Button}/ButtonBase.js +0 -0
  404. /package/lib/{Button → esm/Button}/ButtonDropdown.js +0 -0
  405. /package/lib/{Button → esm/Button}/ButtonGroup.js +0 -0
  406. /package/lib/{Button → esm/Button}/ButtonLink.js +0 -0
  407. /package/lib/{Button → esm/Button}/index.js +0 -0
  408. /package/lib/{Button → esm/Button}/propTypes.js +0 -0
  409. /package/lib/{Card → esm/Card}/Card.js +0 -0
  410. /package/lib/{Card → esm/Card}/CardBase.js +0 -0
  411. /package/lib/{Card → esm/Card}/PressableCardBase.js +0 -0
  412. /package/lib/{Card → esm/Card}/index.js +0 -0
  413. /package/lib/{CardGroup → esm/CardGroup}/CardGroup.js +0 -0
  414. /package/lib/{CardGroup → esm/CardGroup}/dictionary.js +0 -0
  415. /package/lib/{CardGroup → esm/CardGroup}/index.js +0 -0
  416. /package/lib/{Carousel → esm/Carousel}/CarouselContext.js +0 -0
  417. /package/lib/{Carousel → esm/Carousel}/CarouselFirstFocus/CarouselFirstFocus.js +0 -0
  418. /package/lib/{Carousel → esm/Carousel}/CarouselItem/index.js +0 -0
  419. /package/lib/{Carousel → esm/Carousel}/CarouselStepTracker/CarouselStepTracker.js +0 -0
  420. /package/lib/{Carousel → esm/Carousel}/CarouselStepTracker/index.js +0 -0
  421. /package/lib/{Carousel → esm/Carousel}/CarouselTabs/CarouselTabs.js +0 -0
  422. /package/lib/{Carousel → esm/Carousel}/CarouselTabs/CarouselTabsPanel.js +0 -0
  423. /package/lib/{Carousel → esm/Carousel}/CarouselTabs/CarouselTabsPanelItem.js +0 -0
  424. /package/lib/{Carousel → esm/Carousel}/CarouselTabs/index.js +0 -0
  425. /package/lib/{Carousel → esm/Carousel}/CarouselThumbnail.js +0 -0
  426. /package/lib/{Carousel → esm/Carousel}/CarouselThumbnailNavigation.js +0 -0
  427. /package/lib/{Carousel → esm/Carousel}/dictionary.js +0 -0
  428. /package/lib/{Carousel → esm/Carousel}/index.js +0 -0
  429. /package/lib/{Checkbox → esm/Checkbox}/Checkbox.js +0 -0
  430. /package/lib/{Checkbox → esm/Checkbox}/CheckboxButton.js +0 -0
  431. /package/lib/{Checkbox → esm/Checkbox}/CheckboxGroup.js +0 -0
  432. /package/lib/{Checkbox → esm/Checkbox}/CheckboxInput.js +0 -0
  433. /package/lib/{Checkbox → esm/Checkbox}/CheckboxInput.native.js +0 -0
  434. /package/lib/{Checkbox → esm/Checkbox}/index.js +0 -0
  435. /package/lib/{CheckboxCard → esm/CheckboxCard}/CheckboxCard.js +0 -0
  436. /package/lib/{CheckboxCard → esm/CheckboxCard}/index.js +0 -0
  437. /package/lib/{CheckboxCardGroup → esm/CheckboxCardGroup}/CheckboxCardGroup.js +0 -0
  438. /package/lib/{CheckboxCardGroup → esm/CheckboxCardGroup}/index.js +0 -0
  439. /package/lib/{ColourToggle → esm/ColourToggle}/ColourBubble.js +0 -0
  440. /package/lib/{ColourToggle → esm/ColourToggle}/ColourToggle.js +0 -0
  441. /package/lib/{ColourToggle → esm/ColourToggle}/index.js +0 -0
  442. /package/lib/{Divider → esm/Divider}/Divider.js +0 -0
  443. /package/lib/{Divider → esm/Divider}/index.js +0 -0
  444. /package/lib/{DownloadApp → esm/DownloadApp}/DownloadApp.js +0 -0
  445. /package/lib/{DownloadApp → esm/DownloadApp}/dictionary.js +0 -0
  446. /package/lib/{DownloadApp → esm/DownloadApp}/index.js +0 -0
  447. /package/lib/{ExpandCollapse → esm/ExpandCollapse}/Accordion.js +0 -0
  448. /package/lib/{ExpandCollapse → esm/ExpandCollapse}/Control.js +0 -0
  449. /package/lib/{ExpandCollapse → esm/ExpandCollapse}/ExpandCollapse.js +0 -0
  450. /package/lib/{ExpandCollapse → esm/ExpandCollapse}/Panel.js +0 -0
  451. /package/lib/{ExpandCollapse → esm/ExpandCollapse}/dictionary.js +0 -0
  452. /package/lib/{ExpandCollapse → esm/ExpandCollapse}/index.js +0 -0
  453. /package/lib/{ExpandCollapseMini → esm/ExpandCollapseMini}/ExpandCollapseMini.js +0 -0
  454. /package/lib/{ExpandCollapseMini → esm/ExpandCollapseMini}/ExpandCollapseMiniControl.js +0 -0
  455. /package/lib/{ExpandCollapseMini → esm/ExpandCollapseMini}/index.js +0 -0
  456. /package/lib/{Feedback → esm/Feedback}/Feedback.js +0 -0
  457. /package/lib/{Feedback → esm/Feedback}/index.js +0 -0
  458. /package/lib/{Fieldset → esm/Fieldset}/Fieldset.js +0 -0
  459. /package/lib/{Fieldset → esm/Fieldset}/FieldsetContainer.js +0 -0
  460. /package/lib/{Fieldset → esm/Fieldset}/FieldsetContainer.native.js +0 -0
  461. /package/lib/{Fieldset → esm/Fieldset}/Legend.js +0 -0
  462. /package/lib/{Fieldset → esm/Fieldset}/Legend.native.js +0 -0
  463. /package/lib/{Fieldset → esm/Fieldset}/cssReset.js +0 -0
  464. /package/lib/{Fieldset → esm/Fieldset}/index.js +0 -0
  465. /package/lib/{FileUpload → esm/FileUpload}/FileUpload.js +0 -0
  466. /package/lib/{FileUpload → esm/FileUpload}/NotificationContent.js +0 -0
  467. /package/lib/{FileUpload → esm/FileUpload}/dictionary.js +0 -0
  468. /package/lib/{FileUpload → esm/FileUpload}/index.js +0 -0
  469. /package/lib/{FlexGrid → esm/FlexGrid}/Col/Col.js +0 -0
  470. /package/lib/{FlexGrid → esm/FlexGrid}/Col/index.js +0 -0
  471. /package/lib/{FlexGrid → esm/FlexGrid}/FlexGrid.js +0 -0
  472. /package/lib/{FlexGrid → esm/FlexGrid}/Row/Row.js +0 -0
  473. /package/lib/{FlexGrid → esm/FlexGrid}/Row/index.js +0 -0
  474. /package/lib/{FlexGrid → esm/FlexGrid}/helpers/index.js +0 -0
  475. /package/lib/{FlexGrid → esm/FlexGrid}/index.js +0 -0
  476. /package/lib/{FlexGrid → esm/FlexGrid}/providers/GutterContext.js +0 -0
  477. /package/lib/{Footnote → esm/Footnote}/Footnote.js +0 -0
  478. /package/lib/{Footnote → esm/Footnote}/FootnoteLink.js +0 -0
  479. /package/lib/{Footnote → esm/Footnote}/dictionary.js +0 -0
  480. /package/lib/{Footnote → esm/Footnote}/index.js +0 -0
  481. /package/lib/{HorizontalScroll → esm/HorizontalScroll}/HorizontalScroll.js +0 -0
  482. /package/lib/{HorizontalScroll → esm/HorizontalScroll}/HorizontalScrollButton.js +0 -0
  483. /package/lib/{HorizontalScroll → esm/HorizontalScroll}/ScrollViewEnd.js +0 -0
  484. /package/lib/{HorizontalScroll → esm/HorizontalScroll}/ScrollViewEnd.native.js +0 -0
  485. /package/lib/{HorizontalScroll → esm/HorizontalScroll}/dictionary.js +0 -0
  486. /package/lib/{HorizontalScroll → esm/HorizontalScroll}/index.js +0 -0
  487. /package/lib/{HorizontalScroll → esm/HorizontalScroll}/itemPositions.js +0 -0
  488. /package/lib/{Icon → esm/Icon}/Icon.js +0 -0
  489. /package/lib/{Icon → esm/Icon}/IconText.js +0 -0
  490. /package/lib/{Icon → esm/Icon}/index.js +0 -0
  491. /package/lib/{IconButton → esm/IconButton}/IconButton.js +0 -0
  492. /package/lib/{IconButton → esm/IconButton}/index.js +0 -0
  493. /package/lib/{InputLabel → esm/InputLabel}/InputLabel.js +0 -0
  494. /package/lib/{InputLabel → esm/InputLabel}/LabelContent.js +0 -0
  495. /package/lib/{InputLabel → esm/InputLabel}/LabelContent.native.js +0 -0
  496. /package/lib/{InputLabel → esm/InputLabel}/index.js +0 -0
  497. /package/lib/{InputSupports → esm/InputSupports}/InputSupports.js +0 -0
  498. /package/lib/{InputSupports → esm/InputSupports}/dictionary.js +0 -0
  499. /package/lib/{InputSupports → esm/InputSupports}/index.js +0 -0
  500. /package/lib/{InputSupports → esm/InputSupports}/useInputSupports.js +0 -0
  501. /package/lib/{Link → esm/Link}/ChevronLink.js +0 -0
  502. /package/lib/{Link → esm/Link}/InlinePressable.js +0 -0
  503. /package/lib/{Link → esm/Link}/InlinePressable.native.js +0 -0
  504. /package/lib/{Link → esm/Link}/Link.js +0 -0
  505. /package/lib/{Link → esm/Link}/LinkBase.js +0 -0
  506. /package/lib/{Link → esm/Link}/TextButton.js +0 -0
  507. /package/lib/{Link → esm/Link}/index.js +0 -0
  508. /package/lib/{List → esm/List}/List.js +0 -0
  509. /package/lib/{List → esm/List}/ListItem.js +0 -0
  510. /package/lib/{List → esm/List}/ListItemBase.js +0 -0
  511. /package/lib/{List → esm/List}/ListItemContent.js +0 -0
  512. /package/lib/{List → esm/List}/ListItemMark.js +0 -0
  513. /package/lib/{List → esm/List}/PressableListItemBase.js +0 -0
  514. /package/lib/{List → esm/List}/index.js +0 -0
  515. /package/lib/{Listbox → esm/Listbox}/GroupControl.js +0 -0
  516. /package/lib/{Listbox → esm/Listbox}/Listbox.js +0 -0
  517. /package/lib/{Listbox → esm/Listbox}/ListboxContext.js +0 -0
  518. /package/lib/{Listbox → esm/Listbox}/ListboxGroup.js +0 -0
  519. /package/lib/{Listbox → esm/Listbox}/ListboxItem.js +0 -0
  520. /package/lib/{Listbox → esm/Listbox}/ListboxOverlay.js +0 -0
  521. /package/lib/{Listbox → esm/Listbox}/PressableItem.js +0 -0
  522. /package/lib/{Listbox → esm/Listbox}/index.js +0 -0
  523. /package/lib/{Modal → esm/Modal}/Modal.js +0 -0
  524. /package/lib/{Modal → esm/Modal}/ModalContent.js +0 -0
  525. /package/lib/{Modal → esm/Modal}/WebModal.js +0 -0
  526. /package/lib/{Modal → esm/Modal}/dictionary.js +0 -0
  527. /package/lib/{Modal → esm/Modal}/index.js +0 -0
  528. /package/lib/{MultiSelectFilter → esm/MultiSelectFilter}/ModalOverlay.js +0 -0
  529. /package/lib/{MultiSelectFilter → esm/MultiSelectFilter}/MultiSelectFilter.js +0 -0
  530. /package/lib/{MultiSelectFilter → esm/MultiSelectFilter}/dictionary.js +0 -0
  531. /package/lib/{MultiSelectFilter → esm/MultiSelectFilter}/index.js +0 -0
  532. /package/lib/{Notification → esm/Notification}/Notification.js +0 -0
  533. /package/lib/{Notification → esm/Notification}/dictionary.js +0 -0
  534. /package/lib/{Notification → esm/Notification}/index.js +0 -0
  535. /package/lib/{OrderedList → esm/OrderedList}/Item.js +0 -0
  536. /package/lib/{OrderedList → esm/OrderedList}/ItemBase.js +0 -0
  537. /package/lib/{OrderedList → esm/OrderedList}/OrderedList.js +0 -0
  538. /package/lib/{OrderedList → esm/OrderedList}/OrderedListBase.js +0 -0
  539. /package/lib/{OrderedList → esm/OrderedList}/index.js +0 -0
  540. /package/lib/{Pagination → esm/Pagination}/PageButton.js +0 -0
  541. /package/lib/{Pagination → esm/Pagination}/Pagination.js +0 -0
  542. /package/lib/{Pagination → esm/Pagination}/SideButton.js +0 -0
  543. /package/lib/{Pagination → esm/Pagination}/constants.js +0 -0
  544. /package/lib/{Pagination → esm/Pagination}/dictionary.js +0 -0
  545. /package/lib/{Pagination → esm/Pagination}/index.js +0 -0
  546. /package/lib/{Pagination → esm/Pagination}/usePagination.js +0 -0
  547. /package/lib/{Portal → esm/Portal}/Portal.js +0 -0
  548. /package/lib/{Portal → esm/Portal}/Portal.native.js +0 -0
  549. /package/lib/{Portal → esm/Portal}/index.js +0 -0
  550. /package/lib/{PriceLockup → esm/PriceLockup}/PriceLockup.js +0 -0
  551. /package/lib/{PriceLockup → esm/PriceLockup}/index.js +0 -0
  552. /package/lib/{PriceLockup → esm/PriceLockup}/utils/renderFootnoteContent.js +0 -0
  553. /package/lib/{PriceLockup → esm/PriceLockup}/utils/renderFootnoteLinks.js +0 -0
  554. /package/lib/{PriceLockup → esm/PriceLockup}/utils/renderPrice.js +0 -0
  555. /package/lib/{PriceLockup → esm/PriceLockup}/utils/renderTypography.js +0 -0
  556. /package/lib/{ProductCard → esm/ProductCard}/ProductCard.js +0 -0
  557. /package/lib/{ProductCard → esm/ProductCard}/dictionary.js +0 -0
  558. /package/lib/{ProductCard → esm/ProductCard}/index.js +0 -0
  559. /package/lib/{ProductCardGroup → esm/ProductCardGroup}/ProductCardGroup.js +0 -0
  560. /package/lib/{ProductCardGroup → esm/ProductCardGroup}/index.js +0 -0
  561. /package/lib/{Progress → esm/Progress}/Progress.js +0 -0
  562. /package/lib/{Progress → esm/Progress}/ProgressBar.js +0 -0
  563. /package/lib/{Progress → esm/Progress}/ProgressBarBackground.js +0 -0
  564. /package/lib/{Progress → esm/Progress}/constants.js +0 -0
  565. /package/lib/{Progress → esm/Progress}/index.js +0 -0
  566. /package/lib/{QuickLinks → esm/QuickLinks}/QuickLinks.js +0 -0
  567. /package/lib/{QuickLinks → esm/QuickLinks}/QuickLinksCard.js +0 -0
  568. /package/lib/{QuickLinks → esm/QuickLinks}/QuickLinksItem.js +0 -0
  569. /package/lib/{QuickLinks → esm/QuickLinks}/index.js +0 -0
  570. /package/lib/{QuickLinksFeature → esm/QuickLinksFeature}/QuickLinksFeature.js +0 -0
  571. /package/lib/{QuickLinksFeature → esm/QuickLinksFeature}/QuickLinksFeatureItem.js +0 -0
  572. /package/lib/{QuickLinksFeature → esm/QuickLinksFeature}/index.js +0 -0
  573. /package/lib/{Radio → esm/Radio}/Radio.js +0 -0
  574. /package/lib/{Radio → esm/Radio}/RadioButton.js +0 -0
  575. /package/lib/{Radio → esm/Radio}/RadioGroup.js +0 -0
  576. /package/lib/{Radio → esm/Radio}/RadioInput.js +0 -0
  577. /package/lib/{Radio → esm/Radio}/RadioInput.native.js +0 -0
  578. /package/lib/{Radio → esm/Radio}/index.js +0 -0
  579. /package/lib/{RadioCard → esm/RadioCard}/RadioCard.js +0 -0
  580. /package/lib/{RadioCard → esm/RadioCard}/RadioCardGroup.js +0 -0
  581. /package/lib/{RadioCard → esm/RadioCard}/index.js +0 -0
  582. /package/lib/{Responsive → esm/Responsive}/Responsive.js +0 -0
  583. /package/lib/{Responsive → esm/Responsive}/ResponsiveProp.js +0 -0
  584. /package/lib/{Responsive → esm/Responsive}/ResponsiveWithMediaQueryStyleSheet.js +0 -0
  585. /package/lib/{Responsive → esm/Responsive}/index.js +0 -0
  586. /package/lib/{Search → esm/Search}/Search.js +0 -0
  587. /package/lib/{Search → esm/Search}/dictionary.js +0 -0
  588. /package/lib/{Search → esm/Search}/index.js +0 -0
  589. /package/lib/{Select → esm/Select}/Group.js +0 -0
  590. /package/lib/{Select → esm/Select}/Group.native.js +0 -0
  591. /package/lib/{Select → esm/Select}/Item.js +0 -0
  592. /package/lib/{Select → esm/Select}/Item.native.js +0 -0
  593. /package/lib/{Select → esm/Select}/Picker.js +0 -0
  594. /package/lib/{Select → esm/Select}/Picker.native.js +0 -0
  595. /package/lib/{Select → esm/Select}/Select.js +0 -0
  596. /package/lib/{Select → esm/Select}/constants.js +0 -0
  597. /package/lib/{Select → esm/Select}/index.js +0 -0
  598. /package/lib/{SideNav → esm/SideNav}/Item.js +0 -0
  599. /package/lib/{SideNav → esm/SideNav}/ItemContent.js +0 -0
  600. /package/lib/{SideNav → esm/SideNav}/ItemsGroup.js +0 -0
  601. /package/lib/{SideNav → esm/SideNav}/SideNav.js +0 -0
  602. /package/lib/{SideNav → esm/SideNav}/index.js +0 -0
  603. /package/lib/{Skeleton → esm/Skeleton}/Skeleton.js +0 -0
  604. /package/lib/{Skeleton → esm/Skeleton}/index.js +0 -0
  605. /package/lib/{Skeleton → esm/Skeleton}/skeleton.constant.js +0 -0
  606. /package/lib/{Skeleton → esm/Skeleton}/skeletonWebAnimation.js +0 -0
  607. /package/lib/{Skeleton → esm/Skeleton}/useSkeletonNativeAnimation.js +0 -0
  608. /package/lib/{SkipLink → esm/SkipLink}/SkipLink.js +0 -0
  609. /package/lib/{SkipLink → esm/SkipLink}/index.js +0 -0
  610. /package/lib/{Spacer → esm/Spacer}/Spacer.js +0 -0
  611. /package/lib/{Spacer → esm/Spacer}/index.js +0 -0
  612. /package/lib/{StackView → esm/StackView}/StackView.js +0 -0
  613. /package/lib/{StackView → esm/StackView}/StackWrap.js +0 -0
  614. /package/lib/{StackView → esm/StackView}/StackWrap.native.js +0 -0
  615. /package/lib/{StackView → esm/StackView}/StackWrapBox.js +0 -0
  616. /package/lib/{StackView → esm/StackView}/StackWrapGap.js +0 -0
  617. /package/lib/{StackView → esm/StackView}/common.js +0 -0
  618. /package/lib/{StackView → esm/StackView}/getStackedContent.js +0 -0
  619. /package/lib/{StackView → esm/StackView}/index.js +0 -0
  620. /package/lib/{Status → esm/Status}/Status.js +0 -0
  621. /package/lib/{Status → esm/Status}/index.js +0 -0
  622. /package/lib/{StepTracker → esm/StepTracker}/Step.js +0 -0
  623. /package/lib/{StepTracker → esm/StepTracker}/StepTracker.js +0 -0
  624. /package/lib/{StepTracker → esm/StepTracker}/dictionary.js +0 -0
  625. /package/lib/{StepTracker → esm/StepTracker}/index.js +0 -0
  626. /package/lib/{TabBar → esm/TabBar}/TabBar.js +0 -0
  627. /package/lib/{TabBar → esm/TabBar}/TabBarItem.js +0 -0
  628. /package/lib/{TabBar → esm/TabBar}/index.js +0 -0
  629. /package/lib/{Tabs → esm/Tabs}/Tabs.js +0 -0
  630. /package/lib/{Tabs → esm/Tabs}/TabsItem.js +0 -0
  631. /package/lib/{Tabs → esm/Tabs}/index.js +0 -0
  632. /package/lib/{Tags → esm/Tags}/Tags.js +0 -0
  633. /package/lib/{Tags → esm/Tags}/index.js +0 -0
  634. /package/lib/{TextInput → esm/TextInput}/TextArea.js +0 -0
  635. /package/lib/{TextInput → esm/TextInput}/TextInput.js +0 -0
  636. /package/lib/{TextInput → esm/TextInput}/dictionary.js +0 -0
  637. /package/lib/{TextInput → esm/TextInput}/index.js +0 -0
  638. /package/lib/{TextInput → esm/TextInput}/propTypes.js +0 -0
  639. /package/lib/{ThemeProvider → esm/ThemeProvider}/ThemeProvider.js +0 -0
  640. /package/lib/{ThemeProvider → esm/ThemeProvider}/index.js +0 -0
  641. /package/lib/{ThemeProvider → esm/ThemeProvider}/useResponsiveThemeTokens.js +0 -0
  642. /package/lib/{ThemeProvider → esm/ThemeProvider}/useSetTheme.js +0 -0
  643. /package/lib/{ThemeProvider → esm/ThemeProvider}/useTheme.js +0 -0
  644. /package/lib/{ThemeProvider → esm/ThemeProvider}/useThemeTokens.js +0 -0
  645. /package/lib/{ThemeProvider → esm/ThemeProvider}/utils/index.js +0 -0
  646. /package/lib/{ThemeProvider → esm/ThemeProvider}/utils/styles.js +0 -0
  647. /package/lib/{ThemeProvider → esm/ThemeProvider}/utils/theme-tokens.js +0 -0
  648. /package/lib/{Timeline → esm/Timeline}/Timeline.js +0 -0
  649. /package/lib/{Timeline → esm/Timeline}/index.js +0 -0
  650. /package/lib/{ToggleSwitch → esm/ToggleSwitch}/ToggleSwitch.js +0 -0
  651. /package/lib/{ToggleSwitch → esm/ToggleSwitch}/ToggleSwitchGroup.js +0 -0
  652. /package/lib/{ToggleSwitch → esm/ToggleSwitch}/index.js +0 -0
  653. /package/lib/{Tooltip → esm/Tooltip}/Backdrop.js +0 -0
  654. /package/lib/{Tooltip → esm/Tooltip}/Backdrop.native.js +0 -0
  655. /package/lib/{Tooltip → esm/Tooltip}/Tooltip.js +0 -0
  656. /package/lib/{Tooltip → esm/Tooltip}/Tooltip.native.js +0 -0
  657. /package/lib/{Tooltip → esm/Tooltip}/dictionary.js +0 -0
  658. /package/lib/{Tooltip → esm/Tooltip}/getTooltipPosition.js +0 -0
  659. /package/lib/{Tooltip → esm/Tooltip}/index.js +0 -0
  660. /package/lib/{Tooltip → esm/Tooltip}/shared.js +0 -0
  661. /package/lib/{TooltipButton → esm/TooltipButton}/TooltipButton.js +0 -0
  662. /package/lib/{TooltipButton → esm/TooltipButton}/index.js +0 -0
  663. /package/lib/{Typography → esm/Typography}/Typography.js +0 -0
  664. /package/lib/{Typography → esm/Typography}/index.js +0 -0
  665. /package/lib/{Validator → esm/Validator}/Validator.js +0 -0
  666. /package/lib/{Validator → esm/Validator}/index.js +0 -0
  667. /package/lib/{ViewportProvider → esm/ViewportProvider}/ViewportProvider.js +0 -0
  668. /package/lib/{ViewportProvider → esm/ViewportProvider}/index.js +0 -0
  669. /package/lib/{ViewportProvider → esm/ViewportProvider}/useViewport.js +0 -0
  670. /package/lib/{ViewportProvider → esm/ViewportProvider}/useViewportListener.js +0 -0
  671. /package/lib/{index.js → esm/index.js} +0 -0
  672. /package/lib/{server.js → esm/server.js} +0 -0
  673. /package/lib/{utils → esm/utils}/BaseView/BaseView.js +0 -0
  674. /package/lib/{utils → esm/utils}/BaseView/BaseView.native.js +0 -0
  675. /package/lib/{utils → esm/utils}/BaseView/index.js +0 -0
  676. /package/lib/{utils → esm/utils}/a11y/index.js +0 -0
  677. /package/lib/{utils → esm/utils}/a11y/semantics.js +0 -0
  678. /package/lib/{utils → esm/utils}/a11y/textSize.js +0 -0
  679. /package/lib/{utils → esm/utils}/animation/index.js +0 -0
  680. /package/lib/{utils → esm/utils}/animation/useVerticalExpandAnimation.js +0 -0
  681. /package/lib/{utils → esm/utils}/children.js +0 -0
  682. /package/lib/{utils → esm/utils}/containUniqueFields.js +0 -0
  683. /package/lib/{utils → esm/utils}/convertFromMegaByteToByte.js +0 -0
  684. /package/lib/{utils → esm/utils}/floating-ui/index.js +0 -0
  685. /package/lib/{utils → esm/utils}/floating-ui/index.native.js +0 -0
  686. /package/lib/{utils → esm/utils}/formatImageSource.js +0 -0
  687. /package/lib/{utils → esm/utils}/hasOwnProperty.js +0 -0
  688. /package/lib/{utils → esm/utils}/htmlAttrs.js +0 -0
  689. /package/lib/{utils → esm/utils}/index.js +0 -0
  690. /package/lib/{utils → esm/utils}/info/index.js +0 -0
  691. /package/lib/{utils → esm/utils}/info/platform/index.js +0 -0
  692. /package/lib/{utils → esm/utils}/info/platform/platform.android.js +0 -0
  693. /package/lib/{utils → esm/utils}/info/platform/platform.ios.js +0 -0
  694. /package/lib/{utils → esm/utils}/info/platform/platform.js +0 -0
  695. /package/lib/{utils → esm/utils}/info/platform/platform.native.js +0 -0
  696. /package/lib/{utils → esm/utils}/info/versions.js +0 -0
  697. /package/lib/{utils → esm/utils}/input.js +0 -0
  698. /package/lib/{utils → esm/utils}/pressability.js +0 -0
  699. /package/lib/{utils → esm/utils}/props/a11yProps.js +0 -0
  700. /package/lib/{utils → esm/utils}/props/clickProps.js +0 -0
  701. /package/lib/{utils → esm/utils}/props/componentPropType.js +0 -0
  702. /package/lib/{utils → esm/utils}/props/contentfulProps.js +0 -0
  703. /package/lib/{utils → esm/utils}/props/copyPropTypes.js +0 -0
  704. /package/lib/{utils → esm/utils}/props/getPropSelector.js +0 -0
  705. /package/lib/{utils → esm/utils}/props/handlerProps.js +0 -0
  706. /package/lib/{utils → esm/utils}/props/hrefAttrsProp.js +0 -0
  707. /package/lib/{utils → esm/utils}/props/index.js +0 -0
  708. /package/lib/{utils → esm/utils}/props/inputSupportsProps.js +0 -0
  709. /package/lib/{utils → esm/utils}/props/linkProps.js +0 -0
  710. /package/lib/{utils → esm/utils}/props/paddingProp.js +0 -0
  711. /package/lib/{utils → esm/utils}/props/pressProps.js +0 -0
  712. /package/lib/{utils → esm/utils}/props/rectProp.js +0 -0
  713. /package/lib/{utils → esm/utils}/props/responsiveProps.js +0 -0
  714. /package/lib/{utils → esm/utils}/props/selectSystemProps.js +0 -0
  715. /package/lib/{utils → esm/utils}/props/spacingProps.js +0 -0
  716. /package/lib/{utils → esm/utils}/props/textInputProps.js +0 -0
  717. /package/lib/{utils → esm/utils}/props/textProps.js +0 -0
  718. /package/lib/{utils → esm/utils}/props/tokens.js +0 -0
  719. /package/lib/{utils → esm/utils}/props/variantProp.js +0 -0
  720. /package/lib/{utils → esm/utils}/props/viewProps.js +0 -0
  721. /package/lib/{utils → esm/utils}/ssr-media-query/create-stylesheet/create-stylesheet-mobile.js +0 -0
  722. /package/lib/{utils → esm/utils}/ssr-media-query/create-stylesheet/index.android.js +0 -0
  723. /package/lib/{utils → esm/utils}/ssr-media-query/create-stylesheet/index.ios.js +0 -0
  724. /package/lib/{utils → esm/utils}/ssr-media-query/create-stylesheet/index.js +0 -0
  725. /package/lib/{utils → esm/utils}/ssr-media-query/hash.js +0 -0
  726. /package/lib/{utils → esm/utils}/ssr-media-query/index.js +0 -0
  727. /package/lib/{utils → esm/utils}/ssr-media-query/utils/common.js +0 -0
  728. /package/lib/{utils → esm/utils}/ssr-media-query/utils/create-declaration-block.js +0 -0
  729. /package/lib/{utils → esm/utils}/ssr-media-query/utils/create-media-query-styles.js +0 -0
  730. /package/lib/{utils → esm/utils}/ssr-media-query/utils/hyphenate-style-name.js +0 -0
  731. /package/lib/{utils → esm/utils}/ssr-media-query/utils/inject.js +0 -0
  732. /package/lib/{utils → esm/utils}/ssr.js +0 -0
  733. /package/lib/{utils → esm/utils}/transformGradient.js +0 -0
  734. /package/lib/{utils → esm/utils}/useCopy.js +0 -0
  735. /package/lib/{utils → esm/utils}/useHash.js +0 -0
  736. /package/lib/{utils → esm/utils}/useHash.native.js +0 -0
  737. /package/lib/{utils → esm/utils}/useOverlaidPosition.js +0 -0
  738. /package/lib/{utils → esm/utils}/useResponsiveProp.js +0 -0
  739. /package/lib/{utils → esm/utils}/useSafeLayoutEffect.js +0 -0
  740. /package/lib/{utils → esm/utils}/useScrollBlocking.js +0 -0
  741. /package/lib/{utils → esm/utils}/useScrollBlocking.native.js +0 -0
  742. /package/lib/{utils → esm/utils}/useSpacingScale.js +0 -0
  743. /package/lib/{utils → esm/utils}/useUniqueId.js +0 -0
  744. /package/lib/{utils → esm/utils}/withLinkRouter.js +0 -0
@@ -0,0 +1,1046 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _View = _interopRequireDefault(require("react-native-web/dist/cjs/exports/View"));
9
+ var _Animated = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Animated"));
10
+ var _PanResponder = _interopRequireDefault(require("react-native-web/dist/cjs/exports/PanResponder"));
11
+ var _StyleSheet = _interopRequireDefault(require("react-native-web/dist/cjs/exports/StyleSheet"));
12
+ var _Platform = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Platform"));
13
+ var _Dimensions = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Dimensions"));
14
+ var _propTypes = _interopRequireDefault(require("prop-types"));
15
+ var _ThemeProvider = require("../ThemeProvider");
16
+ var _ViewportProvider = require("../ViewportProvider");
17
+ var _utils = require("../utils");
18
+ var _A11yInfoProvider = require("../A11yInfoProvider");
19
+ var _CarouselContext = require("./CarouselContext");
20
+ var _CarouselItem = _interopRequireDefault(require("./CarouselItem"));
21
+ var _IconButton = _interopRequireDefault(require("../IconButton"));
22
+ var _SkipLink = _interopRequireDefault(require("../SkipLink"));
23
+ var _A11yText = _interopRequireDefault(require("../A11yText"));
24
+ var _CarouselStepTracker = _interopRequireDefault(require("./CarouselStepTracker"));
25
+ var _CarouselThumbnailNavigation = _interopRequireDefault(require("./CarouselThumbnailNavigation"));
26
+ var _CarouselTabsPanel = _interopRequireDefault(require("./CarouselTabs/CarouselTabsPanel"));
27
+ var _CarouselTabsPanelItem = _interopRequireDefault(require("./CarouselTabs/CarouselTabsPanelItem"));
28
+ var _dictionary = _interopRequireDefault(require("./dictionary"));
29
+ var _Constants = require("./Constants");
30
+ var _jsxRuntime = require("react/jsx-runtime");
31
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
32
+ const TRANSITION_MODES = {
33
+ MANUAL: 'manual',
34
+ AUTOMATIC: 'automatic',
35
+ SWIPE: 'swipe'
36
+ };
37
+ const staticStyles = _StyleSheet.default.create({
38
+ root: {
39
+ backgroundColor: 'transparent',
40
+ justifyContent: 'center',
41
+ alignItems: 'center',
42
+ position: 'relative',
43
+ top: 0,
44
+ left: 0,
45
+ ..._Platform.default.select({
46
+ web: {
47
+ outline: 'none'
48
+ }
49
+ })
50
+ },
51
+ animationControlButton: {
52
+ position: 'absolute',
53
+ zIndex: 1,
54
+ right: _Platform.default.OS === 'web' ? undefined : 40,
55
+ top: 40
56
+ }
57
+ });
58
+ const selectContainerStyles = width => ({
59
+ backgroundColor: 'transparent',
60
+ overflow: 'hidden',
61
+ width
62
+ });
63
+ const selectSwipeAreaStyles = (count, width, enablePeeking, enableDisplayMultipleItemsPerSlide) => ({
64
+ width: width * count,
65
+ justifyContent: enablePeeking || enableDisplayMultipleItemsPerSlide ? 'flex-start' : 'space-between',
66
+ flexDirection: 'row'
67
+ });
68
+ const getDynamicPositionProperty = areStylesAppliedOnPreviousButton => areStylesAppliedOnPreviousButton ? 'left' : 'right';
69
+ const selectControlButtonPositionStyles = _ref => {
70
+ let {
71
+ positionVariant,
72
+ buttonWidth,
73
+ positionProperty = getDynamicPositionProperty(),
74
+ spaceBetweenSlideAndButton,
75
+ enablePeeking,
76
+ enableDisplayMultipleItemsPerSlide,
77
+ enableHero,
78
+ viewport
79
+ } = _ref;
80
+ const styles = {};
81
+ if (positionVariant === 'edge') {
82
+ styles[positionProperty] = -1 * (buttonWidth / 2);
83
+ } else if (positionVariant === 'inside') {
84
+ if (enableHero && viewport === 'xl') {
85
+ styles[positionProperty] = _Constants.HERO_POSITION_OFFSET;
86
+ } else {
87
+ styles[positionProperty] = _Constants.DEFAULT_POSITION_OFFSET;
88
+ }
89
+ } else if (positionVariant === 'outside') {
90
+ if (enablePeeking || enableDisplayMultipleItemsPerSlide) {
91
+ styles[positionProperty] = 0;
92
+ } else {
93
+ styles[positionProperty] = -1 * (spaceBetweenSlideAndButton + buttonWidth);
94
+ }
95
+ }
96
+ return styles;
97
+ };
98
+ const selectPreviousNextNavigationButtonStyles = (previousNextNavigationButtonWidth, previousNextNavigationPosition, spaceBetweenSlideAndPreviousNextNavigation, isFirstSlide, isLastSlide, areStylesAppliedOnPreviousButton, enablePeeking, enableDisplayMultipleItemsPerSlide, enableHero, viewport) => {
99
+ const styles = {
100
+ zIndex: 1,
101
+ position: 'absolute'
102
+ };
103
+ if (isFirstSlide) {
104
+ styles.visibility = areStylesAppliedOnPreviousButton ? 'hidden' : 'visible';
105
+ } else if (isLastSlide) {
106
+ styles.visibility = areStylesAppliedOnPreviousButton ? 'visible' : 'hidden';
107
+ } else {
108
+ styles.visibility = 'visible';
109
+ }
110
+ return {
111
+ ...styles,
112
+ ...selectControlButtonPositionStyles({
113
+ positionVariant: previousNextNavigationPosition,
114
+ buttonWidth: previousNextNavigationButtonWidth,
115
+ positionProperty: getDynamicPositionProperty(areStylesAppliedOnPreviousButton),
116
+ spaceBetweenSlideAndButton: spaceBetweenSlideAndPreviousNextNavigation,
117
+ enablePeeking,
118
+ enableDisplayMultipleItemsPerSlide,
119
+ enableHero,
120
+ viewport
121
+ })
122
+ };
123
+ };
124
+ const getPeekingProps = viewport => {
125
+ if (viewport === 'xs' || viewport === 'sm' || viewport === 'md') {
126
+ return {
127
+ peekingFirstSpace: 48,
128
+ peekingGap: 16,
129
+ peekingLastSpace: 48,
130
+ peekingMarginLeft: 24,
131
+ peekingMarginRight: 24,
132
+ peekingMiddleSpace: 28
133
+ };
134
+ }
135
+ return {
136
+ peekingFirstSpace: 48,
137
+ peekingGap: 16,
138
+ peekingLastSpace: 48,
139
+ peekingMarginLeft: 16,
140
+ peekingMarginRight: 16,
141
+ peekingMiddleSpace: 24
142
+ };
143
+ };
144
+ const getTotalItems = (enableDisplayMultipleItemsPerSlide, childrenArray, viewport) => {
145
+ if (enableDisplayMultipleItemsPerSlide) {
146
+ switch (viewport) {
147
+ case 'xs':
148
+ case 'sm':
149
+ return childrenArray.length;
150
+ case 'md':
151
+ return Math.ceil(childrenArray.length / _Constants.ITEMS_PER_VIEWPORT_MD);
152
+ case 'lg':
153
+ case 'xl':
154
+ return Math.ceil(childrenArray.length / _Constants.ITEMS_PER_VIEWPORT_LG_XL);
155
+ default:
156
+ break;
157
+ }
158
+ }
159
+ return childrenArray.length;
160
+ };
161
+ const selectRootContainerStyles = (enableHero, viewport) => {
162
+ if (enableHero && viewport === 'xl' && _Platform.default.OS === 'web') {
163
+ return {
164
+ alignItems: 'center'
165
+ };
166
+ }
167
+ return {};
168
+ };
169
+ const selectMainContainerStyles = (enableHero, viewport) => {
170
+ if (enableHero && viewport === 'xl' && _Platform.default.OS === 'web') {
171
+ return {
172
+ width: '100%',
173
+ maxWidth: 1200
174
+ };
175
+ }
176
+ return {};
177
+ };
178
+ const selectNavigationStyles = (tabs, tabsPanelHeight, enableHero, viewport) => {
179
+ let marginTop = 0;
180
+ let marginHorizontal = 0;
181
+ if (enableHero && tabs) {
182
+ marginTop = -tabsPanelHeight;
183
+ marginHorizontal = viewport === 'xl' ? _Constants.LARGE_VIEWPORT_MARGIN : _Constants.DEFAULT_VIEWPORT_MARGIN;
184
+ }
185
+ return {
186
+ marginTop,
187
+ marginHorizontal
188
+ };
189
+ };
190
+
191
+ /**
192
+ * Calculates the final width of the carousel container for displacement purposes based on various conditions.
193
+ *
194
+ * @param {number} containerWidth - The initial width of the container.
195
+ * @param {boolean} enablePeeking - Flag indicating if peeking is enabled.
196
+ * @param {object} viewport - The viewport properties.
197
+ * @param {object} activeIndexRef - A ref object holding the current active index.
198
+ * @param {number} totalItems - The total number of items in the carousel.
199
+ * @param {number} calcDelta - The delta value used for calculations.
200
+ * @returns {number} - The final calculated width of the container.
201
+ *
202
+ * The function adjusts the container width for displacement purposes based on the peeking properties and the position
203
+ * of the active item (first, middle, or last). It considers different peeking spaces and gaps
204
+ * to ensure the correct width is calculated for the carousel to display properly.
205
+ */
206
+ const calculateFinalWidth = (containerWidth, enablePeeking, viewport, activeIndexRef, totalItems, calcDelta) => {
207
+ let finalWidth = containerWidth;
208
+ if (enablePeeking) {
209
+ const {
210
+ peekingFirstSpace,
211
+ peekingGap,
212
+ peekingLastSpace,
213
+ peekingMiddleSpace
214
+ } = getPeekingProps(viewport);
215
+ const isFirst = activeIndexRef.current === 0;
216
+ const isLast = activeIndexRef.current + 1 >= totalItems;
217
+ const isMiddle = !isFirst && !isLast;
218
+ const basePeekingSpace = peekingFirstSpace + peekingGap + peekingMiddleSpace;
219
+ const middlePeekingSpace = peekingMiddleSpace * 2 + peekingGap;
220
+ if (isFirst) {
221
+ finalWidth -= basePeekingSpace;
222
+ if (activeIndexRef.current + 1 === totalItems - 1) {
223
+ finalWidth -= peekingLastSpace - peekingMiddleSpace;
224
+ }
225
+ } else if (isMiddle) {
226
+ if (calcDelta > 0) {
227
+ finalWidth -= basePeekingSpace + middlePeekingSpace * activeIndexRef.current;
228
+ if (activeIndexRef.current + 1 === totalItems - 1) {
229
+ finalWidth -= peekingLastSpace - peekingMiddleSpace;
230
+ }
231
+ } else {
232
+ finalWidth += basePeekingSpace + middlePeekingSpace * (activeIndexRef.current - 2);
233
+ if (activeIndexRef.current - 1 === 0) {
234
+ finalWidth -= peekingFirstSpace - peekingMiddleSpace;
235
+ }
236
+ }
237
+ } else if (isLast) {
238
+ finalWidth += basePeekingSpace + middlePeekingSpace * (activeIndexRef.current - 2);
239
+ if (activeIndexRef.current - 1 === 0) {
240
+ finalWidth -= peekingLastSpace - peekingMiddleSpace;
241
+ }
242
+ }
243
+ }
244
+ return finalWidth;
245
+ };
246
+ const selectIconStyles = _ref2 => {
247
+ let {
248
+ iconBackgroundColor
249
+ } = _ref2;
250
+ return {
251
+ backgroundColor: iconBackgroundColor
252
+ };
253
+ };
254
+ const [selectProps, selectedSystemPropTypes] = (0, _utils.selectSystemProps)([_utils.a11yProps, _utils.viewProps]);
255
+
256
+ /**
257
+ * Carousel is a general-purpose content slider that can be used to render content in terms of slides.
258
+
259
+ ## Usage
260
+ - `Carousel` is a top-level export from `@telus-uds/components-base` which is used to render a Carousel
261
+ - Immediately within `Carousel`, individual slides are wrapped in `Carousel.Item` for the top-level `Carousel` to know how to identify an individual slide
262
+ - You can use any UDS component or other platform-specific component, (based on the platform you're rendering) to achieve any desired layout
263
+ - By default, Carousel takea all the `width` available to it and the `height` is determined based on the content in the slide with more content
264
+ - You may want to wrap Carousel in other layout components like `Box`, `FlexGrid` etc, to achieve a responsive layout of your need
265
+
266
+ ## `useCarousel` custom hook
267
+
268
+ ```jsx
269
+ import { useCarousel } from '@telus-uds/components-base'
270
+
271
+ const SomeComponentWithinCarouselItem = () => {
272
+ const {
273
+ activeIndex,
274
+ totalItems,
275
+ width,
276
+ goTo
277
+ } = useCarousel()
278
+ return <Text>Hi!</Text>
279
+ }
280
+ ```
281
+
282
+ You can use `useCarousel` to hook into internal state of the Carousel component like:
283
+ - `activeIndex`: Index of the current slide
284
+ - `totalItems`: Total number of items/slides passed to the Carousel
285
+ - `width`: Width of the individual carousel slide
286
+ - `goTo`: A function to go to a particular slide by passing the index of that slide, e.g: goTo(0) where `0` is the index of the first slide
287
+
288
+ ## Accessibility
289
+
290
+ - Top-level `Carousel` and `Carousel.Item` can take all possible React Native's `View` and `a11y` props
291
+ - If your slide contains input elements like buttons, you may want to configure them to be only focusable when `activeIndex` is equal to the current slide index in order to avoid tabbing going between slides
292
+
293
+ ## Platform considerations
294
+ The component is available on both native platforms and web.
295
+
296
+ ## Other considerations
297
+ - You may want to use the same kind of layout in all your slides to avoid visual and height differences
298
+ - `previous` and `next` navigation buttons are automatically removed in `sm` and `xs` viewports, as these smaller viewports offers swipe functionality
299
+
300
+ ## Tokens
301
+
302
+ You can override the following tokens in exceptional circumstances:
303
+ - `previousIcon` - Icon of the previous button
304
+ - `nextIcon` - Icon of the next button
305
+ - `showPreviousNextNavigation` - If you want to show/hide the previous/next navigation
306
+ - `showPanelNavigation` - If you want to show/hide the panel navigation
307
+ - `spaceBetweenSlideAndPreviousNextNavigation` - Horizontal space between slide and previous/next navigational buttons
308
+ - `spaceBetweenSlideAndPanelNavigation` - Vertical space between slide area and panel navigation area
309
+ */
310
+ const Carousel = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) => {
311
+ let {
312
+ tokens,
313
+ variant,
314
+ children,
315
+ itemLabel = 'item',
316
+ previousNextNavigationPosition = 'inside',
317
+ stepTrackerVariant,
318
+ previousNextIconSize = 'default',
319
+ minDistanceToCapture = 5,
320
+ minDistanceForAction = 0.2,
321
+ onAnimationStart,
322
+ onAnimationEnd,
323
+ onIndexChanged,
324
+ skipLinkHref,
325
+ tabs,
326
+ refocus = Boolean(tabs),
327
+ title = 'carousel',
328
+ springConfig = undefined,
329
+ thumbnails = undefined,
330
+ enableDisplayMultipleItemsPerSlide = false,
331
+ enableHero = false,
332
+ panelNavigation = thumbnails ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_CarouselThumbnailNavigation.default, {
333
+ thumbnails: thumbnails
334
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_CarouselStepTracker.default, {
335
+ variant: stepTrackerVariant,
336
+ enableDisplayMultipleItemsPerSlide: enableDisplayMultipleItemsPerSlide
337
+ }),
338
+ tag = 'ul',
339
+ accessibilityRole,
340
+ accessibilityLabel,
341
+ accessibilityLiveRegion = 'polite',
342
+ copy,
343
+ slideDuration = 0,
344
+ transitionDuration = 0,
345
+ autoPlay = false,
346
+ enablePeeking = false,
347
+ ...rest
348
+ } = _ref3;
349
+ let childrenArray = (0, _utils.unpackFragment)(children);
350
+ const viewport = (0, _ViewportProvider.useViewport)();
351
+ const totalItems = getTotalItems(enableDisplayMultipleItemsPerSlide, childrenArray, viewport);
352
+ const autoPlayFeatureEnabled = autoPlay && slideDuration > 0 && transitionDuration > 0 && totalItems > 1;
353
+ // if `Carousel` only has one `Carousel.Item`, convert this to a single-item array
354
+ if (!Array.isArray(childrenArray)) {
355
+ childrenArray = [childrenArray];
356
+ }
357
+ const getCopy = (0, _utils.useCopy)({
358
+ dictionary: _dictionary.default,
359
+ copy
360
+ });
361
+ const themeTokens = (0, _ThemeProvider.useThemeTokens)('Carousel', tokens, variant, {
362
+ viewport
363
+ });
364
+ const {
365
+ previousIcon,
366
+ nextIcon,
367
+ playIcon,
368
+ pauseIcon,
369
+ showPreviousNextNavigation,
370
+ showPanelNavigation,
371
+ showPanelTabs,
372
+ spaceBetweenSlideAndPreviousNextNavigation
373
+ } = themeTokens;
374
+ const [activeIndex, setActiveIndex] = _react.default.useState(0);
375
+ const activeIndexRef = _react.default.useRef(activeIndex);
376
+ const {
377
+ reduceMotionEnabled
378
+ } = (0, _A11yInfoProvider.useA11yInfo)();
379
+ const reduceMotionRef = _react.default.useRef(reduceMotionEnabled);
380
+ const [containerLayout, setContainerLayout] = _react.default.useState({
381
+ x: 0,
382
+ y: 0,
383
+ width: 0,
384
+ height: 0
385
+ });
386
+ const containerLayoutRef = _react.default.useRef(containerLayout);
387
+ const [previousNextNavigationButtonWidth, setPreviousNextNavigationButtonWidth] = _react.default.useState(0);
388
+ const firstFocusRef = _react.default.useRef(null);
389
+ const pan = _react.default.useRef(new _Animated.default.ValueXY()).current;
390
+ const animatedX = _react.default.useRef(0);
391
+ const animatedY = _react.default.useRef(0);
392
+ const [isAnimating, setIsAnimating] = _react.default.useState(false);
393
+ /**
394
+ * While having the same starting point, `isAutoPlayEnabled` and `isCarouselPlaying` are different states
395
+ *
396
+ * `isAutoPlayEnabled` is a state to determine if the autoplay feature is enabled or disabled
397
+ * `isCarouselPlaying` is a state to determine if the carousel is currently playing or paused
398
+ */
399
+ const [isAutoPlayEnabled, setIsAutoPlayEnabled] = _react.default.useState(autoPlayFeatureEnabled);
400
+ const [isCarouselPlaying, setisCarouselPlaying] = _react.default.useState(autoPlayFeatureEnabled);
401
+ const isSwiping = _react.default.useRef(false);
402
+ const autoPlayRef = _react.default.useRef(null);
403
+ const isFirstSlide = !activeIndex;
404
+ const isLastSlide = activeIndex + 1 >= totalItems;
405
+ const handleAnimationStart = _react.default.useCallback(function () {
406
+ if (typeof onAnimationStart === 'function') onAnimationStart(...arguments);
407
+ setIsAnimating(true);
408
+ }, [onAnimationStart]);
409
+ const handleAnimationEnd = _react.default.useCallback(function () {
410
+ if (typeof onAnimationEnd === 'function') onAnimationEnd(...arguments);
411
+ setIsAnimating(false);
412
+ }, [onAnimationEnd]);
413
+ const updateOffset = _react.default.useCallback(() => {
414
+ animatedX.current = containerLayoutRef.current.width * activeIndexRef.current * -1;
415
+ animatedY.current = 0;
416
+ pan.setOffset({
417
+ x: animatedX.current,
418
+ y: animatedY.current
419
+ });
420
+ pan.setValue({
421
+ x: 0,
422
+ y: 0
423
+ });
424
+ }, [pan, animatedX]);
425
+ const animate = _react.default.useCallback((toValue, toIndex) => {
426
+ const handleAnimationEndToIndex = function () {
427
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
428
+ args[_key] = arguments[_key];
429
+ }
430
+ return handleAnimationEnd(toIndex, ...args);
431
+ };
432
+ if (reduceMotionRef.current || isSwiping.current) {
433
+ _Animated.default.timing(pan, {
434
+ toValue,
435
+ duration: 1,
436
+ useNativeDriver: false
437
+ }).start(handleAnimationEndToIndex);
438
+ } else if (isAutoPlayEnabled) {
439
+ _Animated.default.timing(pan, {
440
+ ...springConfig,
441
+ toValue,
442
+ useNativeDriver: false,
443
+ duration: transitionDuration * 1000
444
+ }).start(handleAnimationEndToIndex);
445
+ } else if (enablePeeking || enableDisplayMultipleItemsPerSlide) {
446
+ _Animated.default.timing(pan, {
447
+ ...springConfig,
448
+ toValue,
449
+ useNativeDriver: false,
450
+ duration: transitionDuration ? transitionDuration * 1000 : 1000
451
+ }).start(handleAnimationEndToIndex);
452
+ } else {
453
+ _Animated.default.spring(pan, {
454
+ ...springConfig,
455
+ toValue,
456
+ useNativeDriver: false
457
+ }).start(handleAnimationEndToIndex);
458
+ }
459
+ }, [pan, springConfig, handleAnimationEnd, transitionDuration, isAutoPlayEnabled, enablePeeking, enableDisplayMultipleItemsPerSlide]);
460
+ const stopAutoplay = _react.default.useCallback(() => {
461
+ if (autoPlayRef?.current) {
462
+ clearTimeout(autoPlayRef?.current);
463
+ }
464
+ }, []);
465
+ const triggerRefocus = _react.default.useCallback(() => {
466
+ if (refocus && _Platform.default.OS === 'web') {
467
+ firstFocusRef.current?.focus({
468
+ preventScroll: true,
469
+ focusVisible: false
470
+ });
471
+ }
472
+ }, [refocus, firstFocusRef]);
473
+ const updateIndex = _react.default.useCallback(function () {
474
+ let delta = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
475
+ let transitionMode = arguments.length > 1 ? arguments[1] : undefined;
476
+ const toValue = {
477
+ x: 0,
478
+ y: 0
479
+ };
480
+ let skipChanges = !delta;
481
+ let calcDelta = delta;
482
+ if (activeIndexRef.current <= 0 && delta < 0) {
483
+ skipChanges = transitionMode !== TRANSITION_MODES.AUTOMATIC;
484
+ calcDelta = totalItems + delta;
485
+ } else if (activeIndexRef.current + 1 >= totalItems && delta > 0) {
486
+ skipChanges = transitionMode !== TRANSITION_MODES.AUTOMATIC;
487
+ calcDelta = -1 * activeIndexRef.current + delta - 1;
488
+ }
489
+ const index = activeIndexRef.current + calcDelta;
490
+ if (skipChanges) {
491
+ animate(toValue, index);
492
+ return calcDelta;
493
+ }
494
+ stopAutoplay();
495
+ setActiveIndex(index);
496
+ const finalWidth = calculateFinalWidth(containerLayoutRef.current.width, enablePeeking, viewport, activeIndexRef, totalItems, calcDelta);
497
+ toValue.x = finalWidth * -1 * calcDelta;
498
+ animate(toValue, index);
499
+ if (isCarouselPlaying) {
500
+ stopAutoplay();
501
+ if (index === 0 && activeIndexRef.current + 1 === totalItems && transitionMode === TRANSITION_MODES.AUTOMATIC) {
502
+ setisCarouselPlaying(false);
503
+ } else if (isAutoPlayEnabled) {
504
+ autoPlayRef.current = setTimeout(() => {
505
+ updateOffset();
506
+ handleAnimationStart(activeIndexRef.current);
507
+ updateIndex(slideDuration < 0 ? -1 : 1, TRANSITION_MODES.AUTOMATIC);
508
+ triggerRefocus();
509
+ }, Math.abs(slideDuration) * 1000);
510
+ }
511
+ }
512
+ if (onIndexChanged) onIndexChanged(calcDelta, index);
513
+ return calcDelta;
514
+ }, [handleAnimationStart, triggerRefocus, slideDuration, updateOffset, animate, totalItems, onIndexChanged, isCarouselPlaying, stopAutoplay, isAutoPlayEnabled, viewport, enablePeeking]);
515
+ const startAutoplay = _react.default.useCallback(() => {
516
+ stopAutoplay();
517
+ if (isAutoPlayEnabled) {
518
+ autoPlayRef.current = setTimeout(() => {
519
+ updateOffset();
520
+ handleAnimationStart(activeIndexRef.current);
521
+ updateIndex(slideDuration < 0 ? -1 : 1, TRANSITION_MODES.AUTOMATIC);
522
+ triggerRefocus();
523
+ }, Math.abs(slideDuration) * 1000);
524
+ }
525
+ }, [handleAnimationStart, triggerRefocus, updateIndex, updateOffset, slideDuration, stopAutoplay, isAutoPlayEnabled]);
526
+ const fixOffsetAndGo = _react.default.useCallback((delta, transitionMode) => {
527
+ updateOffset();
528
+ handleAnimationStart(activeIndexRef.current);
529
+ updateIndex(delta, transitionMode);
530
+ triggerRefocus();
531
+ }, [updateIndex, updateOffset, handleAnimationStart, triggerRefocus]);
532
+ const goToNeighboring = _react.default.useCallback(function () {
533
+ let toPrev = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
534
+ let transitionMode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : TRANSITION_MODES.MANUAL;
535
+ fixOffsetAndGo(toPrev ? -1 : 1, transitionMode);
536
+ }, [fixOffsetAndGo]);
537
+ const [tabsPanelHeight, setTabsPanelHeight] = _react.default.useState(0);
538
+ _react.default.useEffect(() => {
539
+ activeIndexRef.current = activeIndex;
540
+ }, [activeIndex]);
541
+ _react.default.useEffect(() => {
542
+ reduceMotionRef.current = reduceMotionEnabled;
543
+ }, [reduceMotionEnabled]);
544
+ _react.default.useEffect(() => {
545
+ containerLayoutRef.current = containerLayout;
546
+ }, [containerLayout]);
547
+ _react.default.useEffect(() => {
548
+ pan.x.addListener(_ref4 => {
549
+ let {
550
+ value
551
+ } = _ref4;
552
+ animatedX.current = value;
553
+ });
554
+ pan.y.addListener(_ref5 => {
555
+ let {
556
+ value
557
+ } = _ref5;
558
+ animatedY.current = value;
559
+ });
560
+ if (isCarouselPlaying) {
561
+ startAutoplay();
562
+ }
563
+ return () => {
564
+ stopAutoplay();
565
+ pan.x.removeAllListeners();
566
+ pan.y.removeAllListeners();
567
+ };
568
+ }, [pan.x, pan.y, startAutoplay, stopAutoplay, isCarouselPlaying]);
569
+ _react.default.useEffect(() => {
570
+ const subscription = _Dimensions.default.addEventListener('change', () => {
571
+ updateOffset();
572
+ });
573
+ return () => {
574
+ if (subscription.remove) {
575
+ subscription.remove();
576
+ } else {
577
+ _Dimensions.default.removeEventListener('change', updateOffset);
578
+ }
579
+ };
580
+ }, [updateOffset]);
581
+ _react.default.useEffect(() => {
582
+ setIsAutoPlayEnabled(autoPlay && slideDuration > 0 && transitionDuration > 0 && totalItems > 1);
583
+ }, [autoPlay, slideDuration, transitionDuration, totalItems]);
584
+ _react.default.useEffect(() => {
585
+ return () => {
586
+ stopAutoplay();
587
+ };
588
+ }, [stopAutoplay]);
589
+ const onTabsPanelLayout = event => {
590
+ setTabsPanelHeight(event.nativeEvent.layout.height);
591
+ };
592
+ const onContainerLayout = _ref6 => {
593
+ let {
594
+ nativeEvent: {
595
+ layout: {
596
+ x,
597
+ y,
598
+ width,
599
+ height
600
+ }
601
+ }
602
+ } = _ref6;
603
+ return setContainerLayout(prevState => ({
604
+ ...prevState,
605
+ x,
606
+ y,
607
+ width,
608
+ height
609
+ }));
610
+ };
611
+ const onPreviousNextNavigationButtonLayout = _ref7 => {
612
+ let {
613
+ nativeEvent: {
614
+ layout: {
615
+ width
616
+ }
617
+ }
618
+ } = _ref7;
619
+ return setPreviousNextNavigationButtonWidth(width);
620
+ };
621
+ const isSwipeAllowed = _react.default.useCallback(() => {
622
+ if (totalItems === 1) {
623
+ return false;
624
+ }
625
+ if (_Platform.default.OS === 'web') {
626
+ return !!(viewport === 'xs' || viewport === 'sm');
627
+ }
628
+ return true;
629
+ }, [viewport, totalItems]);
630
+ const panResponder = _react.default.useMemo(() => _PanResponder.default.create({
631
+ onPanResponderTerminationRequest: () => false,
632
+ onMoveShouldSetResponderCapture: () => true,
633
+ onMoveShouldSetPanResponderCapture: (_, gestureState) => {
634
+ if (!isSwipeAllowed()) {
635
+ return false;
636
+ }
637
+ handleAnimationStart(activeIndexRef.current);
638
+ const allow = Math.abs(gestureState.dx) > minDistanceToCapture;
639
+ if (allow) {
640
+ isSwiping.current = true;
641
+ stopAutoplay();
642
+ }
643
+ return allow;
644
+ },
645
+ onPanResponderGrant: () => {
646
+ updateOffset();
647
+ },
648
+ onPanResponderMove: _Animated.default.event([null, {
649
+ dx: pan.x
650
+ }], {
651
+ useNativeDriver: false
652
+ }),
653
+ onPanResponderRelease: (_, gesture) => {
654
+ if (isCarouselPlaying) {
655
+ startAutoplay();
656
+ }
657
+ const correction = gesture.moveX - gesture.x0;
658
+ if (Math.abs(correction) < containerLayoutRef.current.width * minDistanceForAction) {
659
+ animate({
660
+ x: 0,
661
+ y: 0
662
+ }, 0);
663
+ } else {
664
+ const delta = correction > 0 ? -1 : 1;
665
+ updateIndex(delta, TRANSITION_MODES.SWIPE);
666
+ }
667
+ isSwiping.current = false;
668
+ }
669
+ }), [updateIndex, updateOffset, animate, isSwipeAllowed, minDistanceForAction, handleAnimationStart, minDistanceToCapture, pan.x, startAutoplay, stopAutoplay, isCarouselPlaying]);
670
+ const goToNext = _react.default.useCallback(() => {
671
+ goToNeighboring();
672
+ }, [goToNeighboring]);
673
+ const goToPrev = _react.default.useCallback(() => {
674
+ goToNeighboring(true);
675
+ }, [goToNeighboring]);
676
+ const goTo = _react.default.useCallback(function () {
677
+ let index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
678
+ const delta = index - activeIndexRef.current;
679
+ if (delta) {
680
+ fixOffsetAndGo(delta, TRANSITION_MODES.MANUAL);
681
+ }
682
+ }, [fixOffsetAndGo]);
683
+
684
+ // @TODO: - these are Allium-theme variants and won't have any effect in themes that don't implement them.
685
+ // Normally we avoid setting variants of subcomponents, however this could be re-considered.
686
+ // Related discussion - https://github.com/telus/universal-design-system/issues/1549
687
+ const previousNextIconButtonVariants = {
688
+ size: previousNextIconSize,
689
+ raised: !variant?.inverse && true,
690
+ inverse: variant?.inverse
691
+ };
692
+ const getCopyWithPlaceholders = _react.default.useCallback(copyKey => {
693
+ const copyText = getCopy(copyKey).replace(/%\{title\}/g, title).replace(/%\{itemLabel\}/g, itemLabel).replace(/%\{stepNumber\}/g, activeIndex + 1).replace(/%\{stepCount\}/g, totalItems);
694
+
695
+ // First word might be a lowercase placeholder: capitalize the first letter
696
+ return `${copyText[0].toUpperCase()}${copyText.slice(1)}`;
697
+ }, [activeIndex, itemLabel, getCopy, title, totalItems]);
698
+ const activePanelNavigation = tabs && showPanelTabs ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_CarouselTabsPanel.default, {
699
+ items: tabs
700
+ }) : panelNavigation;
701
+ const isFirstFocusContainer = Boolean(refocus && !skipLinkHref);
702
+ const containerRef = element => {
703
+ // Apply both firstFocusRef to the container
704
+ firstFocusRef.current = element;
705
+ // Also apply forwarded ref if there is one (which could be a function ref)
706
+ if (ref) {
707
+ if (typeof ref === 'object') {
708
+ // eslint-disable-next-line no-param-reassign
709
+ ref.current = element;
710
+ } else if (typeof ref === 'function') {
711
+ ref(element);
712
+ }
713
+ }
714
+ };
715
+ const systemProps = selectProps({
716
+ ...rest,
717
+ accessibilityRole,
718
+ accessibilityLabel
719
+ });
720
+
721
+ // If container isn't used for focus, give it a label of title if none is passed in,
722
+ // otherwise read the current position on focus
723
+ const containerAccessibilityLabel = systemProps.accessibilityLabel ?? isFirstFocusContainer ? `${title ? `${title} ` : ''}${getCopyWithPlaceholders('stepTrackerLabel')}` : title;
724
+ const containerProps = {
725
+ accessibilityLabel: containerAccessibilityLabel,
726
+ // If used for focus, attach the ref and draw a focus box around the whole carousel
727
+ ...(isFirstFocusContainer && {
728
+ ref: containerRef,
729
+ focusable: true
730
+ })
731
+ };
732
+ const onAnimationControlButtonPress = _react.default.useCallback(() => {
733
+ if (isCarouselPlaying) {
734
+ stopAutoplay();
735
+ } else {
736
+ startAutoplay();
737
+ }
738
+ setisCarouselPlaying(prevState => !prevState);
739
+ }, [isCarouselPlaying, stopAutoplay, startAutoplay]);
740
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
741
+ style: selectRootContainerStyles(enableHero, viewport),
742
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
743
+ style: selectMainContainerStyles(enableHero, viewport),
744
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_CarouselContext.CarouselProvider, {
745
+ activeIndex: activeIndex,
746
+ goTo: goTo,
747
+ getCopyWithPlaceholders: getCopyWithPlaceholders,
748
+ itemLabel: itemLabel,
749
+ totalItems: totalItems,
750
+ themeTokens: themeTokens,
751
+ firstFocusRef: firstFocusRef,
752
+ refocus: refocus,
753
+ width: containerLayout.width,
754
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, {
755
+ style: [staticStyles.root],
756
+ onLayout: onContainerLayout,
757
+ ref: ref,
758
+ ...systemProps,
759
+ ...containerProps,
760
+ children: [isAutoPlayEnabled ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
761
+ style: [staticStyles.animationControlButton, selectControlButtonPositionStyles({
762
+ positionVariant: previousNextNavigationPosition,
763
+ buttonWidth: previousNextNavigationButtonWidth,
764
+ positionProperty: getDynamicPositionProperty(),
765
+ spaceBetweenSlideAndButton: spaceBetweenSlideAndPreviousNextNavigation,
766
+ enablePeeking,
767
+ enableDisplayMultipleItemsPerSlide,
768
+ enableHero,
769
+ viewport
770
+ })],
771
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
772
+ icon: isCarouselPlaying ? pauseIcon : playIcon,
773
+ accessibilityLabel: isCarouselPlaying ? getCopy('pauseButtonLabel') : getCopy('playButtonLabel'),
774
+ variant: previousNextIconButtonVariants,
775
+ onPress: onAnimationControlButtonPress
776
+ })
777
+ }) : null, showPreviousNextNavigation && totalItems > 1 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
778
+ style: selectPreviousNextNavigationButtonStyles(previousNextNavigationButtonWidth, previousNextNavigationPosition, spaceBetweenSlideAndPreviousNextNavigation, isFirstSlide, isLastSlide, true, enablePeeking, enableDisplayMultipleItemsPerSlide, enableHero, viewport),
779
+ testID: "previous-button-container",
780
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
781
+ onLayout: onPreviousNextNavigationButtonLayout,
782
+ icon: previousIcon,
783
+ onPress: goToPrev,
784
+ variant: previousNextIconButtonVariants,
785
+ accessibilityLabel: getCopyWithPlaceholders('iconButtonLabel').replace('%{targetStep}', activeIndex),
786
+ tokens: selectIconStyles(themeTokens)
787
+ })
788
+ }) : null, Boolean(skipLinkHref) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_SkipLink.default, {
789
+ ref: firstFocusRef,
790
+ href: skipLinkHref,
791
+ children: getCopyWithPlaceholders('skipLink')
792
+ }), !isFirstFocusContainer && /*#__PURE__*/(0, _jsxRuntime.jsx)(_A11yText.default
793
+ // Read the current slide position to screen readers on slide.
794
+ // If it's set to refocus and doesn't have a SkipLink to focus to, focus this.
795
+ , {
796
+ accessibilityLiveRegion: !skipLinkHref && refocus ? undefined : 'polite',
797
+ text: getCopyWithPlaceholders('stepTrackerLabel')
798
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
799
+ style: selectContainerStyles(containerLayout.width),
800
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Animated.default.View, {
801
+ style: _StyleSheet.default.flatten([selectSwipeAreaStyles(totalItems, containerLayout.width, enablePeeking, enableDisplayMultipleItemsPerSlide), {
802
+ transform: [{
803
+ translateX: pan.x
804
+ }, {
805
+ translateY: pan.y
806
+ }]
807
+ }]),
808
+ ...panResponder.panHandlers,
809
+ ...(0, _utils.getA11yPropsFromHtmlTag)(tag),
810
+ // In iframes on Mac (e.g. in Storybook), this content may be misread or read twice.
811
+ // This is a known Voiceover bug: https://github.com/phetsims/a11y-research/issues/132
812
+ accessibilityLiveRegion: accessibilityLiveRegion,
813
+ children: childrenArray.map((element, index) => {
814
+ const hidden = !isAnimating && index !== activeIndex;
815
+ const clonedElement = /*#__PURE__*/_react.default.cloneElement(element, {
816
+ elementIndex: index,
817
+ hidden: enablePeeking || enableDisplayMultipleItemsPerSlide ? false : hidden,
818
+ enablePeeking,
819
+ peekingProps: getPeekingProps(viewport),
820
+ enableDisplayMultipleItemsPerSlide,
821
+ viewport,
822
+ backgroundColor: element.props.backgroundColor,
823
+ enableHero,
824
+ tabsPanelHeight
825
+ });
826
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.default.Fragment, {
827
+ children: clonedElement
828
+ }, index.toFixed(2));
829
+ })
830
+ })
831
+ }), showPreviousNextNavigation && totalItems > 1 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
832
+ style: selectPreviousNextNavigationButtonStyles(previousNextNavigationButtonWidth, previousNextNavigationPosition, spaceBetweenSlideAndPreviousNextNavigation, isFirstSlide, isLastSlide, false, enablePeeking, enableDisplayMultipleItemsPerSlide, enableHero, viewport),
833
+ testID: "next-button-container",
834
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
835
+ onLayout: onPreviousNextNavigationButtonLayout,
836
+ icon: nextIcon,
837
+ onPress: goToNext,
838
+ variant: previousNextIconButtonVariants,
839
+ accessibilityLabel: getCopyWithPlaceholders('iconButtonLabel').replace('%{targetStep}', activeIndex + 2),
840
+ tokens: selectIconStyles(themeTokens)
841
+ })
842
+ }) : null]
843
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
844
+ style: selectNavigationStyles(tabs, tabsPanelHeight, enableHero, viewport),
845
+ onLayout: tabs && onTabsPanelLayout,
846
+ children: showPanelNavigation ? activePanelNavigation : null
847
+ })]
848
+ })
849
+ })
850
+ });
851
+ });
852
+ Carousel.propTypes = {
853
+ ...selectedSystemPropTypes,
854
+ tokens: (0, _utils.getTokensPropType)('Carousel'),
855
+ variant: _utils.variantProp.propType,
856
+ /**
857
+ * Prop related to StepTracker Variants
858
+ */
859
+ stepTrackerVariant: _utils.variantProp.propType,
860
+ /**
861
+ * Slides to render in Carousel. Wrap individual slides in `Carousel.Item`
862
+ */
863
+ children: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.node), _propTypes.default.node]).isRequired,
864
+ /**
865
+ * Lowercase language-appropriate user-facing description of what each Carousel slide represents.
866
+ * This is used when generating item labels. For example, if a carousel contains offers,
867
+ * pass itemLabel="summer offer" (or copy="fr" and an appropriate French translation) to genereate
868
+ * accessible labels such as "Summer offer 1 of 3" and "Show summer offer 2 of 3".
869
+ */
870
+ itemLabel: _propTypes.default.string,
871
+ /**
872
+ * `inside` renders the previous and next buttons inside the slide
873
+ * `outside` renders the previous and next buttons outside the slide
874
+ * `edge` renders the previous and next buttons at the edge of the slide
875
+ */
876
+ previousNextNavigationPosition: _propTypes.default.oneOf(['inside', 'outside', 'edge']),
877
+ /**
878
+ * Defines the size of the `IconButton` which is being used to render next and previous buttons
879
+ */
880
+ previousNextIconSize: _propTypes.default.oneOf(['default', 'small', 'large']),
881
+ /**
882
+ * Carousel uses `Animated.spring` to animate slide changes, use this option to pass custom animation configuration
883
+ */
884
+ springConfig: _propTypes.default.object,
885
+ /**
886
+ * An array of objects containing information on the thumbnails to be rendered as navigation panel
887
+ */
888
+ thumbnails: _propTypes.default.arrayOf(_propTypes.default.shape({
889
+ accessibilityLabel: _propTypes.default.string,
890
+ alt: _propTypes.default.string,
891
+ src: _propTypes.default.string
892
+ })),
893
+ /**
894
+ * Minimal part of slide width must be swiped for changing index.
895
+ * Otherwise animation restore current slide. Default value 0.2 means that 20% must be swiped for change index
896
+ */
897
+ minDistanceForAction: _propTypes.default.number,
898
+ /**
899
+ * Initiate animation after swipe this distance.
900
+ */
901
+ minDistanceToCapture: _propTypes.default.number,
902
+ /**
903
+ * Called when active index changed
904
+ * This function is also provided with a parameter indicating changed index (either 1, or -1)
905
+ * Use it as follows:
906
+ * ```js
907
+ * const onIndexChangedCallback = React.useCallback((changedIndex, currentActiveIndex) => {
908
+ * console.log(changedIndex)
909
+ * }, []) // pass local dependencies as per your component
910
+ * <Carousel
911
+ * onIndexChanged={onIndexChangedCallback}
912
+ * >
913
+ * <Carousel.Item>First Slide</Carousel.Item>
914
+ * </Carousel>
915
+ * ```
916
+ * Caution: Always consider wrapping your callback for `onIndexChanged` in `React.useCallback` in order to avoid bugs and performance issues
917
+ */
918
+ onIndexChanged: _propTypes.default.func,
919
+ /**
920
+ * If this is a complex carousel with a lot of focusable content, pass a href for a skip link. Typically, this will be an anchor link
921
+ * with the ID of a focusable element immediately after the Carousel, e.g. `'#section-2-heading'`.
922
+ */
923
+ skipLinkHref: _propTypes.default.string,
924
+ /**
925
+ * If provided, defaults the navigation panel to a CarouselTabsPanel element passing each item as props for one tab.
926
+ *
927
+ * Be careful to ensure that the order of each element in the items array matches the order of each child in the Carousel.
928
+ */
929
+ tabs: _propTypes.default.arrayOf(_propTypes.default.shape(_CarouselTabsPanelItem.default.propTypes || {})),
930
+ /**
931
+ * If true, whenever a new slide comes into view, the focus of the Carousel switches to the start.
932
+ *
933
+ * Pass this as true when using carousel items that contain interactive content, so a user can easily tab into that content.
934
+ *
935
+ * If skipLinkHref is passed, the focus target will be the SkipLink; if not, it'll be an empty element before the slide content.
936
+ */
937
+ refocus: _propTypes.default.bool,
938
+ /**
939
+ * Use this to render a custom panel navigation element instead of the default StepTracker's based navigation
940
+ * You can make use of `useCarousel` within your custom panel navigation component to hook into various Carousel states such as:
941
+ * - activeIndex: index of current slide
942
+ * - totalItems: total number of slides
943
+ * Use it as follows:
944
+ * ```js
945
+ * <Carousel
946
+ * panelNavigation={<CustomPanelNavigation />}
947
+ * >
948
+ * <Carousel.Item>First Slide</Carousel.Item>
949
+ * </Carousel>
950
+ * ```
951
+ */
952
+ panelNavigation: _propTypes.default.element,
953
+ /**
954
+ * When slide animation start
955
+ * This function is also provided with a parameter indicating the current slide index before animation starts
956
+ * Use it as follows:
957
+ * ```js
958
+ * const onAnimationStartCallback = React.useCallback((currentIndex) => {
959
+ * console.log(currentIndex)
960
+ * }, []) // pass local dependencies as per your component
961
+ * <Carousel
962
+ * onAnimationStart={onAnimationStartCallback}
963
+ * >
964
+ * <Carousel.Item>First Slide</Carousel.Item>
965
+ * </Carousel>
966
+ * ```
967
+ * Caution: Always consider wrapping your callback for `onAnimationStart` in `React.useCallback` in order to avoid bugs and performance issues
968
+ */
969
+ onAnimationStart: _propTypes.default.func,
970
+ /**
971
+ * When slide animation end with parameter of current index (after animation ends)
972
+ * This function is also provided with a parameter indicating the updated slide index after animation ends
973
+ * Use it as follows:
974
+ * ```js
975
+ * const onAnimationEndCallback = React.useCallback((changedIndex) => {
976
+ * console.log(changedIndex)
977
+ * }, []) // pass local dependencies as per your component
978
+ * <Carousel
979
+ * onAnimationEnd={onAnimationEndCallback}
980
+ * >
981
+ * <Carousel.Item>First Slide</Carousel.Item>
982
+ * </Carousel>
983
+ * ```
984
+ * Caution: Always consider wrapping your callback for `onAnimationEnd` in `React.useCallback` in order to avoid bugs and performance issues
985
+ */
986
+ onAnimationEnd: _propTypes.default.func,
987
+ /**
988
+ * Use this to override the default text for panel navigation
989
+ */
990
+ panelNavigationTextDictionary: _propTypes.default.shape({
991
+ en: _propTypes.default.shape({
992
+ stepTrackerLabel: _propTypes.default.string.isRequired
993
+ }),
994
+ fr: _propTypes.default.shape({
995
+ stepTrackerLabel: _propTypes.default.string.isRequired
996
+ })
997
+ }),
998
+ /**
999
+ * Provide custom accessibilityRole for Carousel container
1000
+ */
1001
+ accessibilityRole: _propTypes.default.string,
1002
+ /**
1003
+ * Provide custom accessibilityLabel for Carousel container
1004
+ */
1005
+ accessibilityLabel: _propTypes.default.string,
1006
+ /**
1007
+ * HTML tag to use for the Carousel item's immediate parent. Defaults to `'ul'` so that
1008
+ * assistive technology tools know to intepret the carousel as a list.
1009
+ *
1010
+ * Note that if the immediate Carousel children do not all render as `'li'` elements,
1011
+ * this should be changed (e.g. pass tag="div") because only 'li' is a valid child of 'ul'.
1012
+ */
1013
+ tag: _propTypes.default.oneOf(_utils.layoutTags),
1014
+ /**
1015
+ * If set to `true`, the Carousel will automatically transition between slides
1016
+ * and show the play/pause button
1017
+ * - Default value is `false`
1018
+ * - `slideDuration` and `transitionDuration` are required to be set for this to work
1019
+ */
1020
+ autoPlay: _propTypes.default.bool,
1021
+ /**
1022
+ * Duration of the time in seconds spent on each slide
1023
+ * - Default value is `0`
1024
+ * - `autoPlay` and `transitionDuration` are required to be set for this to work
1025
+ */
1026
+ slideDuration: _propTypes.default.number,
1027
+ /**
1028
+ * Duration of the time in seconds between each slide transition
1029
+ * - Default value is `0`
1030
+ * - `autoPlay` and `slideDuration` are required to be set for this to work
1031
+ */
1032
+ transitionDuration: _propTypes.default.number,
1033
+ /**
1034
+ * If set to `true`, the Carousel will show the previous and next slides
1035
+ * - Default value is `false`
1036
+ */
1037
+ enablePeeking: _propTypes.default.bool,
1038
+ /**
1039
+ * If set to `true`, the Carousel will show multiple slides at once
1040
+ * - Default value is `false`
1041
+ */
1042
+ enableDisplayMultipleItemsPerSlide: _propTypes.default.bool
1043
+ };
1044
+ Carousel.Item = _CarouselItem.default;
1045
+ Carousel.displayName = 'Carousel';
1046
+ var _default = exports.default = Carousel;