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