@telus-uds/components-base 1.66.0 → 1.67.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (486) hide show
  1. package/CHANGELOG.md +23 -3
  2. package/lib/A11yInfoProvider/index.js +5 -20
  3. package/lib/A11yText/index.js +3 -17
  4. package/lib/ActivityIndicator/Spinner.js +2 -9
  5. package/lib/ActivityIndicator/Spinner.native.js +4 -27
  6. package/lib/ActivityIndicator/index.js +1 -13
  7. package/lib/ActivityIndicator/shared.js +0 -3
  8. package/lib/Autocomplete/Autocomplete.js +34 -85
  9. package/lib/Autocomplete/Loading.js +0 -10
  10. package/lib/Autocomplete/Suggestions.js +0 -11
  11. package/lib/Autocomplete/index.js +0 -3
  12. package/lib/BaseProvider/HydrationContext.js +4 -18
  13. package/lib/BaseProvider/index.js +0 -12
  14. package/lib/Box/Box.js +10 -35
  15. package/lib/Box/index.js +0 -3
  16. package/lib/Button/Button.js +4 -13
  17. package/lib/Button/ButtonBase.js +23 -55
  18. package/lib/Button/ButtonDropdown.js +7 -32
  19. package/lib/Button/ButtonGroup.js +15 -48
  20. package/lib/Button/ButtonLink.js +3 -17
  21. package/lib/Button/index.js +0 -5
  22. package/lib/Button/propTypes.js +0 -15
  23. package/lib/Card/Card.js +3 -14
  24. package/lib/Card/CardBase.js +5 -16
  25. package/lib/Card/PressableCardBase.js +7 -30
  26. package/lib/Card/index.js +0 -7
  27. package/lib/Carousel/Carousel.js +22 -115
  28. package/lib/Carousel/CarouselContext.js +0 -14
  29. package/lib/Carousel/CarouselFirstFocus/CarouselFirstFocus.js +6 -18
  30. package/lib/Carousel/CarouselItem/CarouselItem.js +5 -20
  31. package/lib/Carousel/CarouselItem/index.js +0 -3
  32. package/lib/Carousel/CarouselStepTracker/CarouselStepTracker.js +0 -9
  33. package/lib/Carousel/CarouselStepTracker/index.js +0 -3
  34. package/lib/Carousel/CarouselTabs/CarouselTabs.js +5 -15
  35. package/lib/Carousel/CarouselTabs/CarouselTabsPanel.js +7 -16
  36. package/lib/Carousel/CarouselTabs/CarouselTabsPanelItem.js +2 -22
  37. package/lib/Carousel/CarouselTabs/index.js +0 -3
  38. package/lib/Carousel/CarouselThumbnail.js +1 -16
  39. package/lib/Carousel/CarouselThumbnailNavigation.js +0 -15
  40. package/lib/Carousel/index.js +0 -5
  41. package/lib/Checkbox/Checkbox.js +5 -44
  42. package/lib/Checkbox/CheckboxButton.js +7 -33
  43. package/lib/Checkbox/CheckboxGroup.js +14 -45
  44. package/lib/Checkbox/CheckboxInput.js +1 -11
  45. package/lib/Checkbox/CheckboxInput.native.js +0 -2
  46. package/lib/Checkbox/index.js +0 -4
  47. package/lib/CheckboxCard/CheckboxCard.js +4 -37
  48. package/lib/CheckboxCard/index.js +0 -3
  49. package/lib/CheckboxCardGroup/CheckboxCardGroup.js +216 -0
  50. package/lib/CheckboxCardGroup/index.js +10 -0
  51. package/lib/Divider/Divider.js +13 -24
  52. package/lib/Divider/index.js +0 -3
  53. package/lib/ExpandCollapse/Accordion.js +1 -9
  54. package/lib/ExpandCollapse/Control.js +10 -32
  55. package/lib/ExpandCollapse/ExpandCollapse.js +3 -19
  56. package/lib/ExpandCollapse/Panel.js +13 -38
  57. package/lib/ExpandCollapse/index.js +0 -5
  58. package/lib/Feedback/Feedback.js +13 -30
  59. package/lib/Feedback/index.js +0 -3
  60. package/lib/Fieldset/Fieldset.js +6 -37
  61. package/lib/Fieldset/FieldsetContainer.js +1 -10
  62. package/lib/Fieldset/FieldsetContainer.native.js +0 -8
  63. package/lib/Fieldset/Legend.js +1 -10
  64. package/lib/Fieldset/Legend.native.js +1 -13
  65. package/lib/Fieldset/index.js +0 -3
  66. package/lib/FlexGrid/Col/Col.js +10 -53
  67. package/lib/FlexGrid/Col/index.js +0 -3
  68. package/lib/FlexGrid/FlexGrid.js +3 -34
  69. package/lib/FlexGrid/Row/Row.js +0 -38
  70. package/lib/FlexGrid/Row/index.js +0 -3
  71. package/lib/FlexGrid/helpers/index.js +0 -4
  72. package/lib/FlexGrid/index.js +0 -3
  73. package/lib/FlexGrid/providers/GutterContext.js +0 -4
  74. package/lib/HorizontalScroll/HorizontalScroll.js +17 -45
  75. package/lib/HorizontalScroll/HorizontalScrollButton.js +1 -17
  76. package/lib/HorizontalScroll/ScrollViewEnd.js +5 -13
  77. package/lib/HorizontalScroll/ScrollViewEnd.native.js +1 -10
  78. package/lib/HorizontalScroll/index.js +0 -7
  79. package/lib/HorizontalScroll/itemPositions.js +8 -19
  80. package/lib/Icon/Icon.js +4 -17
  81. package/lib/Icon/IconText.js +5 -25
  82. package/lib/Icon/index.js +0 -6
  83. package/lib/IconButton/IconButton.js +5 -37
  84. package/lib/IconButton/index.js +0 -3
  85. package/lib/InputLabel/InputLabel.js +4 -28
  86. package/lib/InputLabel/LabelContent.js +2 -8
  87. package/lib/InputLabel/LabelContent.native.js +0 -8
  88. package/lib/InputLabel/index.js +0 -3
  89. package/lib/InputSupports/InputSupports.js +0 -21
  90. package/lib/InputSupports/index.js +0 -3
  91. package/lib/InputSupports/useInputSupports.js +2 -6
  92. package/lib/Link/ChevronLink.js +7 -18
  93. package/lib/Link/InlinePressable.js +0 -10
  94. package/lib/Link/InlinePressable.native.js +5 -18
  95. package/lib/Link/Link.js +0 -8
  96. package/lib/Link/LinkBase.js +17 -47
  97. package/lib/Link/TextButton.js +3 -16
  98. package/lib/Link/index.js +0 -5
  99. package/lib/List/List.js +5 -21
  100. package/lib/List/ListItem.js +1 -11
  101. package/lib/List/ListItemBase.js +5 -34
  102. package/lib/List/ListItemContent.js +1 -14
  103. package/lib/List/ListItemMark.js +3 -23
  104. package/lib/List/PressableListItemBase.js +2 -28
  105. package/lib/List/index.js +0 -4
  106. package/lib/Listbox/GroupControl.js +0 -14
  107. package/lib/Listbox/Listbox.js +15 -40
  108. package/lib/Listbox/ListboxContext.js +0 -7
  109. package/lib/Listbox/ListboxGroup.js +7 -19
  110. package/lib/Listbox/ListboxItem.js +3 -17
  111. package/lib/Listbox/ListboxOverlay.js +4 -20
  112. package/lib/Listbox/PressableItem.js +3 -18
  113. package/lib/Listbox/index.js +0 -3
  114. package/lib/Modal/Modal.js +94 -45
  115. package/lib/Modal/ModalContent.js +184 -0
  116. package/lib/Modal/index.js +0 -3
  117. package/lib/MultiSelectFilter/ModalOverlay.js +1 -20
  118. package/lib/MultiSelectFilter/MultiSelectFilter.js +20 -69
  119. package/lib/MultiSelectFilter/index.js +0 -3
  120. package/lib/Notification/Notification.js +11 -38
  121. package/lib/Notification/index.js +0 -3
  122. package/lib/Pagination/PageButton.js +2 -22
  123. package/lib/Pagination/Pagination.js +21 -42
  124. package/lib/Pagination/SideButton.js +0 -24
  125. package/lib/Pagination/index.js +0 -3
  126. package/lib/Pagination/usePagination.js +4 -9
  127. package/lib/Progress/Progress.js +3 -17
  128. package/lib/Progress/ProgressBar.js +3 -25
  129. package/lib/Progress/ProgressBarBackground.js +0 -12
  130. package/lib/Progress/index.js +0 -4
  131. package/lib/QuickLinks/QuickLinks.js +1 -18
  132. package/lib/QuickLinks/QuickLinksCard.js +1 -11
  133. package/lib/QuickLinks/QuickLinksItem.js +3 -17
  134. package/lib/QuickLinks/index.js +0 -4
  135. package/lib/QuickLinksFeature/QuickLinksFeature.js +3 -20
  136. package/lib/QuickLinksFeature/QuickLinksFeatureItem.js +7 -30
  137. package/lib/QuickLinksFeature/index.js +0 -4
  138. package/lib/Radio/Radio.js +5 -39
  139. package/lib/Radio/RadioButton.js +7 -26
  140. package/lib/Radio/RadioGroup.js +6 -39
  141. package/lib/Radio/RadioInput.js +1 -11
  142. package/lib/Radio/RadioInput.native.js +0 -2
  143. package/lib/Radio/index.js +0 -4
  144. package/lib/RadioCard/RadioCard.js +5 -38
  145. package/lib/RadioCard/RadioCardGroup.js +25 -40
  146. package/lib/RadioCard/index.js +0 -4
  147. package/lib/Responsive/Responsive.js +1 -14
  148. package/lib/Responsive/index.js +0 -3
  149. package/lib/Search/Search.js +22 -45
  150. package/lib/Search/index.js +0 -3
  151. package/lib/Select/Group.js +0 -8
  152. package/lib/Select/Group.native.js +0 -6
  153. package/lib/Select/Item.js +0 -7
  154. package/lib/Select/Item.native.js +0 -2
  155. package/lib/Select/Picker.js +0 -8
  156. package/lib/Select/Picker.native.js +6 -22
  157. package/lib/Select/Select.js +9 -52
  158. package/lib/Select/index.js +0 -5
  159. package/lib/SideNav/Item.js +5 -29
  160. package/lib/SideNav/ItemContent.js +1 -14
  161. package/lib/SideNav/ItemsGroup.js +9 -31
  162. package/lib/SideNav/SideNav.js +9 -33
  163. package/lib/SideNav/index.js +0 -2
  164. package/lib/Skeleton/Skeleton.js +10 -42
  165. package/lib/Skeleton/index.js +0 -3
  166. package/lib/Skeleton/skeletonWebAnimation.js +0 -2
  167. package/lib/Skeleton/useSkeletonNativeAnimation.js +1 -9
  168. package/lib/SkipLink/SkipLink.js +7 -27
  169. package/lib/SkipLink/index.js +0 -3
  170. package/lib/Spacer/Spacer.js +4 -20
  171. package/lib/Spacer/index.js +0 -3
  172. package/lib/StackView/StackView.js +3 -21
  173. package/lib/StackView/StackWrap.js +11 -21
  174. package/lib/StackView/StackWrap.native.js +0 -3
  175. package/lib/StackView/StackWrapBox.js +5 -21
  176. package/lib/StackView/StackWrapGap.js +1 -14
  177. package/lib/StackView/common.js +0 -6
  178. package/lib/StackView/getStackedContent.js +10 -21
  179. package/lib/StackView/index.js +0 -5
  180. package/lib/StepTracker/Step.js +3 -27
  181. package/lib/StepTracker/StepTracker.js +5 -32
  182. package/lib/StepTracker/index.js +0 -3
  183. package/lib/Tabs/Tabs.js +7 -30
  184. package/lib/Tabs/TabsItem.js +13 -38
  185. package/lib/Tabs/index.js +0 -3
  186. package/lib/Tags/Tags.js +9 -42
  187. package/lib/Tags/index.js +0 -3
  188. package/lib/TextInput/TextArea.js +11 -20
  189. package/lib/TextInput/TextInput.js +7 -16
  190. package/lib/TextInput/TextInputBase.js +12 -58
  191. package/lib/TextInput/index.js +0 -3
  192. package/lib/TextInput/propTypes.js +0 -8
  193. package/lib/ThemeProvider/ThemeProvider.js +10 -18
  194. package/lib/ThemeProvider/index.js +0 -9
  195. package/lib/ThemeProvider/useSetTheme.js +6 -9
  196. package/lib/ThemeProvider/useTheme.js +2 -7
  197. package/lib/ThemeProvider/useThemeTokens.js +1 -9
  198. package/lib/ThemeProvider/utils/index.js +0 -4
  199. package/lib/ThemeProvider/utils/styles.js +14 -35
  200. package/lib/ThemeProvider/utils/theme-tokens.js +15 -43
  201. package/lib/Timeline/Timeline.js +11 -27
  202. package/lib/Timeline/index.js +0 -3
  203. package/lib/ToggleSwitch/ToggleSwitch.js +12 -43
  204. package/lib/ToggleSwitch/ToggleSwitchGroup.js +4 -38
  205. package/lib/ToggleSwitch/index.js +0 -3
  206. package/lib/Tooltip/Backdrop.js +4 -11
  207. package/lib/Tooltip/Backdrop.native.js +1 -14
  208. package/lib/Tooltip/Tooltip.js +9 -37
  209. package/lib/Tooltip/Tooltip.native.js +14 -45
  210. package/lib/Tooltip/getTooltipPosition.js +26 -31
  211. package/lib/Tooltip/index.js +0 -5
  212. package/lib/Tooltip/shared.js +0 -10
  213. package/lib/TooltipButton/TooltipButton.js +5 -20
  214. package/lib/TooltipButton/index.js +0 -3
  215. package/lib/Typography/Typography.js +15 -38
  216. package/lib/Typography/index.js +0 -3
  217. package/lib/Validator/Validator.js +10 -58
  218. package/lib/Validator/index.js +0 -3
  219. package/lib/ViewportProvider/ViewportProvider.js +1 -13
  220. package/lib/ViewportProvider/index.js +0 -5
  221. package/lib/ViewportProvider/useViewport.js +0 -4
  222. package/lib/ViewportProvider/useViewportListener.js +3 -12
  223. package/lib/index.js +8 -71
  224. package/lib/utils/BaseView/BaseView.js +3 -17
  225. package/lib/utils/BaseView/BaseView.native.js +0 -3
  226. package/lib/utils/BaseView/index.js +0 -3
  227. package/lib/utils/a11y/index.js +0 -4
  228. package/lib/utils/a11y/semantics.js +14 -32
  229. package/lib/utils/a11y/textSize.js +1 -8
  230. package/lib/utils/animation/index.js +0 -2
  231. package/lib/utils/animation/useVerticalExpandAnimation.js +5 -18
  232. package/lib/utils/children.js +16 -28
  233. package/lib/utils/containUniqueFields.js +2 -5
  234. package/lib/utils/floating-ui/index.js +0 -1
  235. package/lib/utils/floating-ui/index.native.js +0 -1
  236. package/lib/utils/hasOwnProperty.js +0 -1
  237. package/lib/utils/htmlAttrs.js +2 -4
  238. package/lib/utils/index.js +0 -31
  239. package/lib/utils/info/index.js +0 -4
  240. package/lib/utils/info/platform/index.js +0 -4
  241. package/lib/utils/info/versions.js +0 -3
  242. package/lib/utils/input.js +12 -24
  243. package/lib/utils/pressability.js +7 -21
  244. package/lib/utils/props/a11yProps.js +19 -25
  245. package/lib/utils/props/clickProps.js +0 -4
  246. package/lib/utils/props/componentPropType.js +0 -14
  247. package/lib/utils/props/copyPropTypes.js +0 -4
  248. package/lib/utils/props/getPropSelector.js +11 -12
  249. package/lib/utils/props/handlerProps.js +2 -23
  250. package/lib/utils/props/hrefAttrsProp.js +0 -4
  251. package/lib/utils/props/index.js +0 -22
  252. package/lib/utils/props/inputSupportsProps.js +0 -9
  253. package/lib/utils/props/linkProps.js +2 -12
  254. package/lib/utils/props/paddingProp.js +0 -3
  255. package/lib/utils/props/pressProps.js +2 -8
  256. package/lib/utils/props/rectProp.js +0 -3
  257. package/lib/utils/props/responsiveProps.js +1 -5
  258. package/lib/utils/props/selectSystemProps.js +4 -6
  259. package/lib/utils/props/spacingProps.js +3 -10
  260. package/lib/utils/props/textInputProps.js +10 -31
  261. package/lib/utils/props/textProps.js +6 -11
  262. package/lib/utils/props/tokens.js +7 -26
  263. package/lib/utils/props/variantProp.js +0 -3
  264. package/lib/utils/props/viewProps.js +0 -5
  265. package/lib/utils/ssr.js +13 -33
  266. package/lib/utils/useCopy.js +3 -6
  267. package/lib/utils/useHash.js +5 -10
  268. package/lib/utils/useHash.native.js +0 -2
  269. package/lib/utils/useOverlaidPosition.js +6 -29
  270. package/lib/utils/useResponsiveProp.js +6 -13
  271. package/lib/utils/useSafeLayoutEffect.js +5 -10
  272. package/lib/utils/useScrollBlocking.js +3 -11
  273. package/lib/utils/useScrollBlocking.native.js +0 -2
  274. package/lib/utils/useSpacingScale.js +5 -8
  275. package/lib/utils/useUniqueId.js +0 -4
  276. package/lib/utils/withLinkRouter.js +13 -18
  277. package/lib-module/A11yInfoProvider/index.js +5 -9
  278. package/lib-module/A11yText/index.js +3 -4
  279. package/lib-module/ActivityIndicator/Spinner.js +2 -2
  280. package/lib-module/ActivityIndicator/Spinner.native.js +4 -6
  281. package/lib-module/ActivityIndicator/index.js +1 -5
  282. package/lib-module/ActivityIndicator/shared.js +2 -1
  283. package/lib-module/Autocomplete/Autocomplete.js +34 -59
  284. package/lib-module/Autocomplete/Loading.js +0 -2
  285. package/lib-module/BaseProvider/HydrationContext.js +4 -7
  286. package/lib-module/BaseProvider/index.js +0 -3
  287. package/lib-module/Box/Box.js +10 -24
  288. package/lib-module/Button/Button.js +4 -2
  289. package/lib-module/Button/ButtonBase.js +23 -35
  290. package/lib-module/Button/ButtonDropdown.js +7 -16
  291. package/lib-module/Button/ButtonGroup.js +15 -32
  292. package/lib-module/Button/ButtonLink.js +3 -2
  293. package/lib-module/Button/propTypes.js +0 -7
  294. package/lib-module/Card/Card.js +3 -2
  295. package/lib-module/Card/CardBase.js +5 -4
  296. package/lib-module/Card/PressableCardBase.js +7 -11
  297. package/lib-module/Carousel/Carousel.js +22 -60
  298. package/lib-module/Carousel/CarouselContext.js +0 -5
  299. package/lib-module/Carousel/CarouselFirstFocus/CarouselFirstFocus.js +7 -5
  300. package/lib-module/Carousel/CarouselItem/CarouselItem.js +5 -11
  301. package/lib-module/Carousel/CarouselStepTracker/CarouselStepTracker.js +0 -2
  302. package/lib-module/Carousel/CarouselTabs/CarouselTabs.js +3 -4
  303. package/lib-module/Carousel/CarouselTabs/CarouselTabsPanel.js +7 -6
  304. package/lib-module/Carousel/CarouselTabs/CarouselTabsPanelItem.js +2 -10
  305. package/lib-module/Carousel/CarouselThumbnail.js +1 -7
  306. package/lib-module/Carousel/CarouselThumbnailNavigation.js +0 -2
  307. package/lib-module/Checkbox/Checkbox.js +5 -23
  308. package/lib-module/Checkbox/CheckboxButton.js +7 -17
  309. package/lib-module/Checkbox/CheckboxGroup.js +14 -31
  310. package/lib-module/Checkbox/CheckboxInput.js +1 -3
  311. package/lib-module/Checkbox/CheckboxInput.native.js +0 -1
  312. package/lib-module/CheckboxCard/CheckboxCard.js +4 -21
  313. package/lib-module/CheckboxCardGroup/CheckboxCardGroup.js +206 -0
  314. package/lib-module/CheckboxCardGroup/index.js +2 -0
  315. package/lib-module/Divider/Divider.js +13 -11
  316. package/lib-module/ExpandCollapse/Accordion.js +1 -1
  317. package/lib-module/ExpandCollapse/Control.js +10 -17
  318. package/lib-module/ExpandCollapse/ExpandCollapse.js +3 -9
  319. package/lib-module/ExpandCollapse/Panel.js +13 -23
  320. package/lib-module/Feedback/Feedback.js +13 -16
  321. package/lib-module/Fieldset/Fieldset.js +6 -25
  322. package/lib-module/Fieldset/FieldsetContainer.js +1 -1
  323. package/lib-module/Fieldset/FieldsetContainer.native.js +0 -1
  324. package/lib-module/Fieldset/Legend.js +1 -1
  325. package/lib-module/Fieldset/Legend.native.js +1 -1
  326. package/lib-module/FlexGrid/Col/Col.js +10 -37
  327. package/lib-module/FlexGrid/FlexGrid.js +3 -17
  328. package/lib-module/FlexGrid/Row/Row.js +0 -25
  329. package/lib-module/FlexGrid/helpers/index.js +0 -3
  330. package/lib-module/HorizontalScroll/HorizontalScroll.js +17 -27
  331. package/lib-module/HorizontalScroll/HorizontalScrollButton.js +1 -3
  332. package/lib-module/HorizontalScroll/ScrollViewEnd.js +5 -4
  333. package/lib-module/HorizontalScroll/ScrollViewEnd.native.js +0 -1
  334. package/lib-module/HorizontalScroll/itemPositions.js +11 -10
  335. package/lib-module/Icon/Icon.js +4 -8
  336. package/lib-module/Icon/IconText.js +6 -17
  337. package/lib-module/IconButton/IconButton.js +7 -20
  338. package/lib-module/InputLabel/InputLabel.js +4 -13
  339. package/lib-module/InputLabel/LabelContent.js +2 -1
  340. package/lib-module/InputLabel/LabelContent.native.js +0 -1
  341. package/lib-module/InputSupports/InputSupports.js +0 -9
  342. package/lib-module/InputSupports/useInputSupports.js +2 -4
  343. package/lib-module/Link/ChevronLink.js +7 -7
  344. package/lib-module/Link/InlinePressable.js +0 -2
  345. package/lib-module/Link/InlinePressable.native.js +4 -12
  346. package/lib-module/Link/LinkBase.js +17 -25
  347. package/lib-module/Link/TextButton.js +3 -5
  348. package/lib-module/List/List.js +5 -9
  349. package/lib-module/List/ListItem.js +1 -1
  350. package/lib-module/List/ListItemBase.js +5 -17
  351. package/lib-module/List/ListItemContent.js +1 -4
  352. package/lib-module/List/ListItemMark.js +3 -16
  353. package/lib-module/List/PressableListItemBase.js +2 -6
  354. package/lib-module/Listbox/GroupControl.js +0 -2
  355. package/lib-module/Listbox/Listbox.js +15 -23
  356. package/lib-module/Listbox/ListboxContext.js +0 -2
  357. package/lib-module/Listbox/ListboxGroup.js +6 -4
  358. package/lib-module/Listbox/ListboxItem.js +2 -1
  359. package/lib-module/Listbox/ListboxOverlay.js +3 -4
  360. package/lib-module/Listbox/PressableItem.js +2 -7
  361. package/lib-module/Modal/Modal.js +94 -25
  362. package/lib-module/Modal/ModalContent.js +175 -0
  363. package/lib-module/MultiSelectFilter/ModalOverlay.js +1 -4
  364. package/lib-module/MultiSelectFilter/MultiSelectFilter.js +20 -42
  365. package/lib-module/Notification/Notification.js +11 -22
  366. package/lib-module/Pagination/PageButton.js +2 -6
  367. package/lib-module/Pagination/Pagination.js +21 -21
  368. package/lib-module/Pagination/SideButton.js +3 -8
  369. package/lib-module/Pagination/usePagination.js +4 -8
  370. package/lib-module/Progress/Progress.js +3 -7
  371. package/lib-module/Progress/ProgressBar.js +3 -11
  372. package/lib-module/Progress/ProgressBarBackground.js +0 -2
  373. package/lib-module/QuickLinks/QuickLinks.js +1 -6
  374. package/lib-module/QuickLinks/QuickLinksCard.js +1 -3
  375. package/lib-module/QuickLinks/QuickLinksItem.js +3 -2
  376. package/lib-module/QuickLinksFeature/QuickLinksFeature.js +5 -9
  377. package/lib-module/QuickLinksFeature/QuickLinksFeatureItem.js +9 -13
  378. package/lib-module/Radio/Radio.js +5 -22
  379. package/lib-module/Radio/RadioButton.js +8 -10
  380. package/lib-module/Radio/RadioGroup.js +6 -25
  381. package/lib-module/Radio/RadioInput.js +1 -3
  382. package/lib-module/Radio/RadioInput.native.js +0 -1
  383. package/lib-module/RadioCard/RadioCard.js +5 -21
  384. package/lib-module/RadioCard/RadioCardGroup.js +25 -27
  385. package/lib-module/Responsive/Responsive.js +1 -6
  386. package/lib-module/Search/Search.js +22 -31
  387. package/lib-module/Select/Group.js +0 -3
  388. package/lib-module/Select/Group.native.js +0 -3
  389. package/lib-module/Select/Item.js +0 -3
  390. package/lib-module/Select/Item.native.js +0 -1
  391. package/lib-module/Select/Picker.native.js +8 -10
  392. package/lib-module/Select/Select.js +10 -35
  393. package/lib-module/SideNav/Item.js +5 -16
  394. package/lib-module/SideNav/ItemContent.js +1 -2
  395. package/lib-module/SideNav/ItemsGroup.js +9 -19
  396. package/lib-module/SideNav/SideNav.js +9 -22
  397. package/lib-module/Skeleton/Skeleton.js +10 -25
  398. package/lib-module/Skeleton/skeletonWebAnimation.js +0 -1
  399. package/lib-module/Skeleton/useSkeletonNativeAnimation.js +1 -3
  400. package/lib-module/SkipLink/SkipLink.js +7 -9
  401. package/lib-module/Spacer/Spacer.js +4 -7
  402. package/lib-module/StackView/StackView.js +3 -7
  403. package/lib-module/StackView/StackWrap.js +13 -13
  404. package/lib-module/StackView/StackWrap.native.js +2 -1
  405. package/lib-module/StackView/StackWrapBox.js +5 -8
  406. package/lib-module/StackView/StackWrapGap.js +1 -1
  407. package/lib-module/StackView/getStackedContent.js +10 -10
  408. package/lib-module/StepTracker/Step.js +3 -14
  409. package/lib-module/StepTracker/StepTracker.js +5 -13
  410. package/lib-module/Tabs/Tabs.js +7 -16
  411. package/lib-module/Tabs/TabsItem.js +13 -16
  412. package/lib-module/Tags/Tags.js +9 -26
  413. package/lib-module/TextInput/TextArea.js +11 -8
  414. package/lib-module/TextInput/TextInput.js +7 -5
  415. package/lib-module/TextInput/TextInputBase.js +13 -39
  416. package/lib-module/TextInput/propTypes.js +3 -7
  417. package/lib-module/ThemeProvider/ThemeProvider.js +10 -9
  418. package/lib-module/ThemeProvider/useSetTheme.js +6 -7
  419. package/lib-module/ThemeProvider/useTheme.js +2 -5
  420. package/lib-module/ThemeProvider/useThemeTokens.js +1 -2
  421. package/lib-module/ThemeProvider/utils/styles.js +15 -27
  422. package/lib-module/ThemeProvider/utils/theme-tokens.js +15 -20
  423. package/lib-module/Timeline/Timeline.js +11 -17
  424. package/lib-module/ToggleSwitch/ToggleSwitch.js +13 -26
  425. package/lib-module/ToggleSwitch/ToggleSwitchGroup.js +4 -23
  426. package/lib-module/Tooltip/Backdrop.js +4 -7
  427. package/lib-module/Tooltip/Backdrop.native.js +1 -4
  428. package/lib-module/Tooltip/Tooltip.js +9 -18
  429. package/lib-module/Tooltip/Tooltip.native.js +14 -23
  430. package/lib-module/Tooltip/getTooltipPosition.js +26 -30
  431. package/lib-module/Tooltip/shared.js +0 -6
  432. package/lib-module/TooltipButton/TooltipButton.js +5 -8
  433. package/lib-module/Typography/Typography.js +14 -22
  434. package/lib-module/Validator/Validator.js +10 -42
  435. package/lib-module/ViewportProvider/ViewportProvider.js +1 -3
  436. package/lib-module/ViewportProvider/useViewportListener.js +6 -8
  437. package/lib-module/index.js +1 -0
  438. package/lib-module/utils/BaseView/BaseView.js +3 -4
  439. package/lib-module/utils/BaseView/BaseView.native.js +0 -1
  440. package/lib-module/utils/a11y/semantics.js +14 -27
  441. package/lib-module/utils/a11y/textSize.js +1 -2
  442. package/lib-module/utils/animation/useVerticalExpandAnimation.js +8 -11
  443. package/lib-module/utils/children.js +17 -19
  444. package/lib-module/utils/containUniqueFields.js +2 -4
  445. package/lib-module/utils/htmlAttrs.js +2 -1
  446. package/lib-module/utils/info/index.js +2 -1
  447. package/lib-module/utils/info/platform/index.js +4 -1
  448. package/lib-module/utils/info/versions.js +2 -1
  449. package/lib-module/utils/input.js +11 -19
  450. package/lib-module/utils/pressability.js +8 -7
  451. package/lib-module/utils/props/a11yProps.js +22 -20
  452. package/lib-module/utils/props/clickProps.js +0 -1
  453. package/lib-module/utils/props/componentPropType.js +0 -13
  454. package/lib-module/utils/props/getPropSelector.js +12 -8
  455. package/lib-module/utils/props/handlerProps.js +2 -19
  456. package/lib-module/utils/props/hrefAttrsProp.js +2 -2
  457. package/lib-module/utils/props/inputSupportsProps.js +0 -6
  458. package/lib-module/utils/props/linkProps.js +2 -3
  459. package/lib-module/utils/props/pressProps.js +2 -2
  460. package/lib-module/utils/props/responsiveProps.js +1 -3
  461. package/lib-module/utils/props/selectSystemProps.js +4 -5
  462. package/lib-module/utils/props/spacingProps.js +4 -3
  463. package/lib-module/utils/props/textInputProps.js +13 -27
  464. package/lib-module/utils/props/textProps.js +9 -7
  465. package/lib-module/utils/props/tokens.js +10 -13
  466. package/lib-module/utils/props/variantProp.js +1 -1
  467. package/lib-module/utils/props/viewProps.js +0 -1
  468. package/lib-module/utils/ssr.js +14 -18
  469. package/lib-module/utils/useCopy.js +3 -5
  470. package/lib-module/utils/useHash.js +5 -9
  471. package/lib-module/utils/useHash.native.js +0 -1
  472. package/lib-module/utils/useOverlaidPosition.js +6 -25
  473. package/lib-module/utils/useResponsiveProp.js +6 -7
  474. package/lib-module/utils/useSafeLayoutEffect.js +5 -7
  475. package/lib-module/utils/useScrollBlocking.js +3 -10
  476. package/lib-module/utils/useSpacingScale.js +4 -4
  477. package/lib-module/utils/useUniqueId.js +0 -2
  478. package/lib-module/utils/withLinkRouter.js +13 -10
  479. package/package.json +2 -2
  480. package/src/Checkbox/CheckboxGroup.jsx +10 -8
  481. package/src/CheckboxCardGroup/CheckboxCardGroup.jsx +231 -0
  482. package/src/CheckboxCardGroup/index.js +3 -0
  483. package/src/Modal/Modal.jsx +98 -5
  484. package/src/Modal/ModalContent.jsx +171 -0
  485. package/src/RadioCard/RadioCardGroup.jsx +23 -2
  486. package/src/index.js +1 -0
@@ -29,9 +29,10 @@ const staticStyles = StyleSheet.create({
29
29
  flexShrink: 0
30
30
  }
31
31
  });
32
- const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs, inputSupportsProps, textInputHandlerProps, textInputProps]); // Returns JSX to display a bold string `str` with unbolded occurrences of the
33
- // `substring` based in the array of `matchIndexes` provided
32
+ const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs, inputSupportsProps, textInputHandlerProps, textInputProps]);
34
33
 
34
+ // Returns JSX to display a bold string `str` with unbolded occurrences of the
35
+ // `substring` based in the array of `matchIndexes` provided
35
36
  const highlightAllMatches = function (str) {
36
37
  let substring = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
37
38
  let matchIndexes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
@@ -46,7 +47,8 @@ const highlightAllMatches = function (str) {
46
47
  tokens: {
47
48
  color: resultsTextColor
48
49
  },
49
- children: matchIndexes.reduce((acc, matchIndex, index) => [...acc, // Add a piece of the string up to the first occurrence of the substring
50
+ children: matchIndexes.reduce((acc, matchIndex, index) => [...acc,
51
+ // Add a piece of the string up to the first occurrence of the substring
50
52
  index === 0 && (str.slice(0, matchIndex) ?? ''),
51
53
  /*#__PURE__*/
52
54
  // Unbold the occurrence of the substring (while keeping the original casing)
@@ -58,39 +60,35 @@ const highlightAllMatches = function (str) {
58
60
  color: resultsTextColor
59
61
  },
60
62
  children: str.slice(matchIndex, matchIndex + substring.length)
61
- }, matchIndex), // Add the rest of the string until the next occurrence or the end of it
63
+ }, matchIndex),
64
+ // Add the rest of the string until the next occurrence or the end of it
62
65
  str.slice(matchIndex + substring.length, matchIndexes[index + 1] ?? str.length)], [])
63
66
  })
64
67
  );
65
68
  };
66
-
67
69
  const highlight = function () {
68
70
  let items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
69
71
  let text = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
70
72
  let color = arguments.length > 2 ? arguments[2] : undefined;
71
73
  return items.reduce((acc, item) => {
72
74
  var _Array$from;
73
-
74
75
  const matches = (_Array$from = Array.from(matchAll(item.label.toLowerCase(), text.toLowerCase().replace(/[/\-\\^$*+?.()|[\]{}]/g, '\\$&')))) === null || _Array$from === void 0 ? void 0 : _Array$from.map(_ref => {
75
76
  let {
76
77
  index
77
78
  } = _ref;
78
79
  return index;
79
80
  });
80
-
81
81
  if (matches !== null && matches !== void 0 && matches.length) {
82
- return [...acc, { ...item,
82
+ return [...acc, {
83
+ ...item,
83
84
  label: highlightAllMatches(item.label, text, matches, color)
84
85
  }];
85
86
  }
86
-
87
87
  return [...acc, item];
88
88
  }, []);
89
89
  };
90
-
91
90
  const Autocomplete = /*#__PURE__*/forwardRef((_ref2, ref) => {
92
91
  var _ref3;
93
-
94
92
  let {
95
93
  children,
96
94
  copy = 'en',
@@ -115,27 +113,31 @@ const Autocomplete = /*#__PURE__*/forwardRef((_ref2, ref) => {
115
113
  color: resultsTextColor
116
114
  } = useThemeTokens('Search', {}, {
117
115
  focus: true
118
- }); // The wrapped input is mostly responsible for controlled vs uncontrolled handling,
116
+ });
117
+ // The wrapped input is mostly responsible for controlled vs uncontrolled handling,
119
118
  // but we also need to adjust suggestions based on the mode:
120
119
  // - in controlled mode we rely entirely on the suggestions passed via the `items` prop,
121
120
  // - in uncontrolled mode we filter the suggestions ourselves based on the `initialItems`
122
121
  // prop and the text entered
122
+ const isControlled = value !== undefined;
123
123
 
124
- const isControlled = value !== undefined; // We need to store current items for uncontrolled usage
125
-
124
+ // We need to store current items for uncontrolled usage
126
125
  const [currentItems, setCurrentItems] = useState(initialItems);
127
- const [otherItems, setOtherItems] = useState(items); // We need to store the current value as well to be able to highlight it
126
+ const [otherItems, setOtherItems] = useState(items);
128
127
 
128
+ // We need to store the current value as well to be able to highlight it
129
129
  const [currentValue, setCurrentValue] = useState(value ?? initialValue);
130
130
  const inputTokens = {
131
131
  paddingLeft: INPUT_LEFT_PADDING
132
- }; // Setting up the overlay
132
+ };
133
133
 
134
+ // Setting up the overlay
134
135
  const openOverlayRef = useRef();
135
136
  const [isExpanded, setIsExpanded] = useState(((_ref3 = value ?? initialValue) === null || _ref3 === void 0 ? void 0 : _ref3.length) >= minToSuggestion);
136
137
  const [isFocused, setisFocused] = useState(false);
137
- const [sourceLayout, setSourceLayout] = useState(null); // When it's nested, selected value
138
+ const [sourceLayout, setSourceLayout] = useState(null);
138
139
 
140
+ // When it's nested, selected value
139
141
  const [nestedSelectedValue, setNestedSelectedValue] = useState(null);
140
142
  const {
141
143
  supportsProps,
@@ -158,28 +160,25 @@ const Autocomplete = /*#__PURE__*/forwardRef((_ref2, ref) => {
158
160
  vertical: Platform.OS !== 'web' && (hint || inputLabel) ? 28 : 4
159
161
  }
160
162
  });
161
- const targetRef = useRef(null); // We limit the number of suggestions displayed to avoid huge lists
163
+ const targetRef = useRef(null);
164
+ // We limit the number of suggestions displayed to avoid huge lists
162
165
  // TODO: add a way to make the `Listbox` occupy fixed height and be scrollable
163
166
  // within that height, which will unlock similar behaviour for `AutoComplete` as well
164
-
165
167
  const itemsToSuggest = function () {
166
168
  let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
167
169
  return maxSuggestions ? data.slice(0, maxSuggestions) : [...data];
168
170
  };
169
-
170
171
  const getCopy = useCopy({
171
172
  dictionary,
172
173
  copy
173
- }); // Tracking input width changes to resize the listbox overlay accordingly
174
-
174
+ });
175
+ // Tracking input width changes to resize the listbox overlay accordingly
175
176
  const [inputWidth, setInputWidth] = useState();
176
177
  useSafeLayoutEffect(() => {
177
178
  if (Platform.OS === 'web') {
178
179
  const updateInputWidth = () => {
179
180
  var _inputRef$current;
180
-
181
181
  setInputWidth((inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.clientWidth) + 4); // adding back all the input borders / outlines
182
-
183
182
  setIsExpanded(false); // close the suggestions while the input is changing
184
183
  };
185
184
 
@@ -192,32 +191,25 @@ const Autocomplete = /*#__PURE__*/forwardRef((_ref2, ref) => {
192
191
  Dimensions.removeEventListener('change', throttledUpdateInputWidth);
193
192
  };
194
193
  }
195
-
196
194
  setInputWidth(sourceLayout === null || sourceLayout === void 0 ? void 0 : sourceLayout.width);
197
195
  return () => {};
198
196
  }, [inputRef, sourceLayout]);
199
-
200
197
  const handleMeasure = event => {
201
198
  onTargetLayout(event);
202
-
203
199
  if (Platform.OS !== 'web') {
204
200
  var _inputRef$current2;
205
-
206
201
  inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : _inputRef$current2.measureInWindow((x, y, width) => {
207
202
  setInputWidth(width);
208
203
  });
209
204
  }
210
205
  };
211
-
212
206
  const handleChange = newValue => {
213
207
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue || '');
214
208
  setCurrentValue(newValue);
215
209
  setIsExpanded((newValue === null || newValue === void 0 ? void 0 : newValue.length) >= minToSuggestion);
216
-
217
210
  if (!isControlled && initialItems !== undefined) {
218
211
  setCurrentItems(initialItems.filter(_ref4 => {
219
212
  var _label$toLowerCase;
220
-
221
213
  let {
222
214
  label
223
215
  } = _ref4;
@@ -225,10 +217,8 @@ const Autocomplete = /*#__PURE__*/forwardRef((_ref2, ref) => {
225
217
  }));
226
218
  }
227
219
  };
228
-
229
220
  const handleSelect = selectedId => {
230
221
  var _ref5;
231
-
232
222
  onSelect === null || onSelect === void 0 ? void 0 : onSelect(selectedId);
233
223
  const {
234
224
  label: newValue,
@@ -241,25 +231,22 @@ const Autocomplete = /*#__PURE__*/forwardRef((_ref2, ref) => {
241
231
  return id === selectedId;
242
232
  });
243
233
  if (title) return;
244
-
245
234
  if (!nested) {
246
235
  setNestedSelectedValue(null);
247
236
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
248
237
  setIsExpanded(false);
249
238
  }
250
-
251
239
  setCurrentValue(newValue);
252
240
  if (!isControlled && inputRef !== null && inputRef !== void 0 && inputRef.current) inputRef.current.value = newValue;
253
241
  if (nested) setNestedSelectedValue(newValue);
254
242
  };
243
+
255
244
  /**
256
245
  * When an item that is nested equal "true" is selected this useEffect is executed.
257
246
  * The nested item is added to the item list at the top, the if validates it doesn't exist
258
247
  * within the list, if doesn't exist the nested item is added to the top of the list,
259
248
  * the nested item is added with an id equal "0"
260
249
  */
261
-
262
-
263
250
  useEffect(() => {
264
251
  if (nestedSelectedValue && !items.find(item => item.id === 0)) {
265
252
  const tmpItems = [...items];
@@ -269,16 +256,15 @@ const Autocomplete = /*#__PURE__*/forwardRef((_ref2, ref) => {
269
256
  id: 0
270
257
  });
271
258
  setOtherItems(tmpItems.map(item => {
272
- return { ...item,
259
+ return {
260
+ ...item,
273
261
  nestedChild: item.id !== 0
274
262
  };
275
263
  }));
276
264
  }
277
265
  }, [nestedSelectedValue, items]);
278
-
279
266
  const handleClose = event => {
280
267
  var _openOverlayRef$curre, _openOverlayRef$curre2;
281
-
282
268
  if (event.type === 'keydown') {
283
269
  if (event.key === 'Escape' || event.key === 27) {
284
270
  setIsExpanded(false);
@@ -296,12 +282,12 @@ const Autocomplete = /*#__PURE__*/forwardRef((_ref2, ref) => {
296
282
  setNestedSelectedValue(null);
297
283
  }
298
284
  };
299
-
300
285
  const itemsToShow = currentValue ? itemsToSuggest(highlight(isControlled ? items : currentItems, currentValue, resultsTextColor)) : [];
301
286
  const helpTextToShow = isFocused && !currentValue ? helpText : noResults ?? getCopy('noResults');
302
287
  return /*#__PURE__*/_jsxs(View, {
303
288
  style: staticStyles.container,
304
- children: [/*#__PURE__*/_jsx(InputSupports, { ...supportsProps,
289
+ children: [/*#__PURE__*/_jsx(InputSupports, {
290
+ ...supportsProps,
305
291
  accessibilityAutoComplete: "list",
306
292
  accessibilityControls: "autocomplete",
307
293
  accessibilityExpanded: isExpanded,
@@ -375,11 +361,11 @@ const Autocomplete = /*#__PURE__*/forwardRef((_ref2, ref) => {
375
361
  parentRef: inputRef,
376
362
  ref: targetRef
377
363
  })
378
- }), (targetRef === null || targetRef === void 0 ? void 0 : targetRef.current) && /*#__PURE__*/_jsx(View // This catches and shifts focus to other interactive elements.
364
+ }), (targetRef === null || targetRef === void 0 ? void 0 : targetRef.current) && /*#__PURE__*/_jsx(View
365
+ // This catches and shifts focus to other interactive elements.
379
366
  , {
380
367
  onFocus: () => {
381
368
  var _targetRef$current;
382
-
383
369
  return targetRef === null || targetRef === void 0 ? void 0 : (_targetRef$current = targetRef.current) === null || _targetRef$current === void 0 ? void 0 : _targetRef$current.focus();
384
370
  },
385
371
  tabIndex: 0
@@ -387,15 +373,16 @@ const Autocomplete = /*#__PURE__*/forwardRef((_ref2, ref) => {
387
373
  })]
388
374
  });
389
375
  });
390
- Autocomplete.displayName = 'Autocomplete'; // If a language dictionary entry is provided, it must contain every key
376
+ Autocomplete.displayName = 'Autocomplete';
391
377
 
378
+ // If a language dictionary entry is provided, it must contain every key
392
379
  const dictionaryContentShape = PropTypes.shape({
393
380
  hasResults: PropTypes.string.isRequired,
394
381
  loading: PropTypes.string.isRequired,
395
382
  noResults: PropTypes.string.isRequired
396
383
  });
397
- Autocomplete.propTypes = { ...selectedSystemPropTypes,
398
-
384
+ Autocomplete.propTypes = {
385
+ ...selectedSystemPropTypes,
399
386
  /**
400
387
  * Can be used to provide a function that renders a custom input:
401
388
  * <Autocomplete items={items} value={currentValue}>
@@ -413,17 +400,14 @@ Autocomplete.propTypes = { ...selectedSystemPropTypes,
413
400
  * </Autocomplete>
414
401
  */
415
402
  children: PropTypes.func,
416
-
417
403
  /**
418
404
  * Copy language identifier
419
405
  */
420
406
  copy: PropTypes.oneOfType([PropTypes.oneOf(['en', 'fr']), dictionaryContentShape]),
421
-
422
407
  /**
423
408
  * Set to true in order to display the loading indicator instead of results
424
409
  */
425
410
  isLoading: PropTypes.bool,
426
-
427
411
  /**
428
412
  * List of items to display as suggestions
429
413
  */
@@ -431,47 +415,38 @@ Autocomplete.propTypes = { ...selectedSystemPropTypes,
431
415
  id: PropTypes.string,
432
416
  label: PropTypes.string
433
417
  })),
434
-
435
418
  /**
436
419
  * Label to display alongside the spinner when in a loading state
437
420
  */
438
421
  loadingLabel: PropTypes.string,
439
-
440
422
  /**
441
423
  * Minimum number of characters typed for a list of suggestions to appear
442
424
  */
443
425
  minToSuggestion: PropTypes.number,
444
-
445
426
  /**
446
427
  * Maximum number of suggestions provided at the same time
447
428
  */
448
429
  maxSuggestions: PropTypes.number,
449
-
450
430
  /**
451
431
  * Text or JSX to render when no results are available
452
432
  */
453
433
  noResults: PropTypes.node,
454
-
455
434
  /**
456
435
  * Help text to display when the input is focused and empty
457
436
  */
458
437
  helpText: PropTypes.string,
459
-
460
438
  /**
461
439
  * Handler function to be called when the input value changes
462
440
  */
463
441
  onChange: PropTypes.func,
464
-
465
442
  /**
466
443
  * Handler function to be called when the clear button (appears if the handler is passed) is pressed
467
444
  */
468
445
  onClear: PropTypes.func,
469
-
470
446
  /**
471
447
  * Callback function to be called when an item is selected from the list
472
448
  */
473
449
  onSelect: PropTypes.func,
474
-
475
450
  /**
476
451
  * Input value for controlled usage
477
452
  */
@@ -6,7 +6,6 @@ import Box from '../Box';
6
6
  import StackView from '../StackView';
7
7
  import { jsx as _jsx } from "react/jsx-runtime";
8
8
  import { jsxs as _jsxs } from "react/jsx-runtime";
9
-
10
9
  const Loading = _ref => {
11
10
  let {
12
11
  label
@@ -29,7 +28,6 @@ const Loading = _ref => {
29
28
  })
30
29
  });
31
30
  };
32
-
33
31
  Loading.propTypes = {
34
32
  label: PropTypes.string
35
33
  };
@@ -4,16 +4,14 @@ import Platform from "react-native-web/dist/exports/Platform";
4
4
  import { jsx as _jsx } from "react/jsx-runtime";
5
5
  const HydrationContext = /*#__PURE__*/createContext();
6
6
  const isSSR = typeof window === 'undefined';
7
-
8
7
  const hasWebStyleTag = () => {
9
8
  var _document;
10
-
11
9
  if (isSSR || Platform.OS !== 'web' || typeof document !== 'object') {
12
10
  return false;
13
11
  }
14
-
15
12
  return Boolean((_document = document) === null || _document === void 0 ? void 0 : _document.getElementById('react-native-stylesheet'));
16
13
  };
14
+
17
15
  /**
18
16
  * Returns true if this render cycle is the hydration of existing SSR content.
19
17
  *
@@ -21,14 +19,12 @@ const hasWebStyleTag = () => {
21
19
  * during the very first client-side render or hydration, but not available on the server,
22
20
  * to ensure no changes happen until the original SSR DOM has been hydrated.
23
21
  */
24
-
25
-
26
22
  export const useHydrationContext = () => useContext(HydrationContext);
23
+
27
24
  /**
28
25
  * Allows components and hooks to observe if SSR hydration is currently in progress
29
26
  * and if so, to re-render with content that differs to the server when it is complete.
30
27
  */
31
-
32
28
  export const HydrationProvider = _ref => {
33
29
  let {
34
30
  children
@@ -36,8 +32,9 @@ export const HydrationProvider = _ref => {
36
32
  const [hasMounted, setHasMounted] = useState(false);
37
33
  useEffect(() => {
38
34
  setHasMounted(true);
39
- }, []); // If we've got a HydrationProvider inside a HydrationProvider somehow, defer to the top one
35
+ }, []);
40
36
 
37
+ // If we've got a HydrationProvider inside a HydrationProvider somehow, defer to the top one
41
38
  const valueFromAncestor = useHydrationContext();
42
39
  const isHydrating = valueFromAncestor ?? Boolean(!hasMounted && hasWebStyleTag());
43
40
  return /*#__PURE__*/_jsx(HydrationContext.Provider, {
@@ -1,5 +1,4 @@
1
1
  var _ThemeProvider$propTy;
2
-
3
2
  import React from 'react';
4
3
  import PropTypes from 'prop-types';
5
4
  import { PortalProvider } from '@gorhom/portal';
@@ -8,7 +7,6 @@ import ViewportProvider from '../ViewportProvider';
8
7
  import ThemeProvider from '../ThemeProvider';
9
8
  import { HydrationProvider } from './HydrationContext';
10
9
  import { jsx as _jsx } from "react/jsx-runtime";
11
-
12
10
  const BaseProvider = _ref => {
13
11
  let {
14
12
  defaultTheme,
@@ -29,7 +27,6 @@ const BaseProvider = _ref => {
29
27
  })
30
28
  });
31
29
  };
32
-
33
30
  BaseProvider.propTypes = {
34
31
  children: PropTypes.node.isRequired,
35
32
  defaultTheme: (_ThemeProvider$propTy = ThemeProvider.propTypes) === null || _ThemeProvider$propTy === void 0 ? void 0 : _ThemeProvider$propTy.defaultTheme,
@@ -6,6 +6,7 @@ import { useThemeTokens } from '../ThemeProvider';
6
6
  import { a11yProps, getA11yPropsFromHtmlTag, getTokensPropType, layoutTags, selectSystemProps, spacingProps, useSpacingScale, variantProp, viewProps } from '../utils';
7
7
  import { jsx as _jsx } from "react/jsx-runtime";
8
8
  const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, viewProps]);
9
+
9
10
  /**
10
11
  * @typedef {import('../utils/props/spacingProps.js').SpacingValue} SpacingValue
11
12
  * @typedef {import('../utils/props/spacingProps.js').SpacingIndex} SpacingIndex
@@ -34,7 +35,6 @@ const selectBoxStyles = _ref => {
34
35
  borderBottomLeftRadius,
35
36
  borderBottomRightRadius
36
37
  };
37
-
38
38
  if (gradient) {
39
39
  const {
40
40
  angle,
@@ -42,9 +42,8 @@ const selectBoxStyles = _ref => {
42
42
  } = gradient;
43
43
  styles.backgroundImage = `linear-gradient(${angle}deg, ${stopOne.color}, 75% , ${stopTwo.color})`;
44
44
  }
45
-
46
- const paddings = ['paddingLeft', 'paddingRight', 'paddingTop', 'paddingBottom']; // Only set on styles if token provided because we spread this object after the spacing scale values
47
-
45
+ const paddings = ['paddingLeft', 'paddingRight', 'paddingTop', 'paddingBottom'];
46
+ // Only set on styles if token provided because we spread this object after the spacing scale values
48
47
  paddings.forEach(side => {
49
48
  if (rest[side]) {
50
49
  styles[side] = rest[side];
@@ -52,6 +51,7 @@ const selectBoxStyles = _ref => {
52
51
  });
53
52
  return styles;
54
53
  };
54
+
55
55
  /**
56
56
  * A layout utility component. Use Box to create space (padding) around content.
57
57
  *
@@ -117,8 +117,6 @@ const selectBoxStyles = _ref => {
117
117
  * text content is inside a scrollable box, as screens are not scrollable by default and even very
118
118
  * short text will require scrolling on small devices at the highest accessibility text scaling settings.
119
119
  */
120
-
121
-
122
120
  const Box = /*#__PURE__*/forwardRef((_ref2, ref) => {
123
121
  let {
124
122
  space,
@@ -153,11 +151,11 @@ const Box = /*#__PURE__*/forwardRef((_ref2, ref) => {
153
151
  paddingBottom: useSpacingScale(bottom),
154
152
  ...selectBoxStyles(themeTokens)
155
153
  };
156
-
157
154
  if (scroll) {
158
155
  const scrollProps = typeof scroll === 'object' ? scroll : {};
159
156
  scrollProps.contentContainerStyle = [styles, scrollProps.contentContainerStyle];
160
- return /*#__PURE__*/_jsx(ScrollView, { ...scrollProps,
157
+ return /*#__PURE__*/_jsx(ScrollView, {
158
+ ...scrollProps,
161
159
  ...props,
162
160
  testID: testID,
163
161
  dataSet: dataSet,
@@ -165,8 +163,8 @@ const Box = /*#__PURE__*/forwardRef((_ref2, ref) => {
165
163
  children: children
166
164
  });
167
165
  }
168
-
169
- return /*#__PURE__*/_jsx(View, { ...props,
166
+ return /*#__PURE__*/_jsx(View, {
167
+ ...props,
170
168
  style: styles,
171
169
  testID: testID,
172
170
  dataSet: dataSet,
@@ -175,59 +173,52 @@ const Box = /*#__PURE__*/forwardRef((_ref2, ref) => {
175
173
  });
176
174
  });
177
175
  Box.displayName = 'Box';
178
- Box.propTypes = { ...selectedSystemPropTypes,
176
+ Box.propTypes = {
177
+ ...selectedSystemPropTypes,
179
178
  variant: variantProp.propType,
180
179
  tokens: getTokensPropType('Box'),
181
-
182
180
  /**
183
181
  * Sets default padding on all sides of the box using the theme's spacing scale.
184
182
  *
185
183
  * @see {@link SpacingValue}
186
184
  */
187
185
  space: spacingProps.types.spacingValue,
188
-
189
186
  /**
190
187
  * Sets top and bottom padding using the theme's spacing scale.
191
188
  *
192
189
  * @see {@link SpacingValue}
193
190
  */
194
191
  vertical: spacingProps.types.spacingValue,
195
-
196
192
  /**
197
193
  * Sets left and right padding using the theme's spacing scale.
198
194
  *
199
195
  * @see {@link SpacingValue}
200
196
  */
201
197
  horizontal: spacingProps.types.spacingValue,
202
-
203
198
  /**
204
199
  * Sets bottom padding using the theme's spacing scale.
205
200
  *
206
201
  * @see {@link SpacingValue}
207
202
  */
208
203
  bottom: spacingProps.types.spacingValue,
209
-
210
204
  /**
211
205
  * Sets left padding using the theme's spacing scale.
212
206
  *
213
207
  * @see {@link SpacingValue}
214
208
  */
215
209
  left: spacingProps.types.spacingValue,
216
-
217
210
  /**
218
211
  * Sets right padding using the theme's spacing scale.
219
212
  *
220
213
  * @see {@link SpacingValue}
221
214
  */
222
215
  right: spacingProps.types.spacingValue,
223
-
224
216
  /**
225
217
  * Sets top padding using the theme's spacing scale.
226
218
  *
227
219
  * @see {@link SpacingValue}
228
220
  */
229
221
  top: spacingProps.types.spacingValue,
230
-
231
222
  /**
232
223
  * Sets the `flex` style, which controls `flexGrow`, `flexShrink` and `flexBasis` styles.
233
224
  *
@@ -237,14 +228,12 @@ Box.propTypes = { ...selectedSystemPropTypes,
237
228
  * With the default `0`, the box takes its minimum width from its content.
238
229
  */
239
230
  flex: PropTypes.number,
240
-
241
231
  /**
242
232
  * Renders a scrollable ScrollView instead of an unscrollable View.
243
233
  *
244
234
  * May take an object of ScrollView props which are passed to the rendered ScrollView.
245
235
  */
246
236
  scroll: PropTypes.oneOfType([PropTypes.bool, ScrollView.propTypes ? PropTypes.shape(ScrollView.propTypes) : PropTypes.object]),
247
-
248
237
  /**
249
238
  * Optional semantic HTML tag, to apply to the container on web. Does not change styling.
250
239
  *
@@ -252,18 +241,15 @@ Box.propTypes = { ...selectedSystemPropTypes,
252
241
  * is not defined, the accessibilityRole will default to "heading".
253
242
  */
254
243
  tag: PropTypes.oneOf(layoutTags),
255
-
256
244
  /**
257
245
  * Use in tests if the box itself needs to be targetted and no other way of selecting the
258
246
  * box is available (e.g. it cannot be targetted using an appropriate `accessibilityRole`).
259
247
  */
260
248
  testID: PropTypes.string,
261
-
262
249
  /**
263
250
  * @ignore
264
251
  */
265
252
  dataSet: PropTypes.object,
266
-
267
253
  /**
268
254
  * Box accepts any content as children.
269
255
  */
@@ -18,14 +18,16 @@ const Button = /*#__PURE__*/forwardRef((_ref, ref) => {
18
18
  ...variant
19
19
  };
20
20
  const getTokens = useThemeTokensCallback('Button', tokens, buttonVariant);
21
- return /*#__PURE__*/_jsx(ButtonBase, { ...props,
21
+ return /*#__PURE__*/_jsx(ButtonBase, {
22
+ ...props,
22
23
  tokens: getTokens,
23
24
  accessibilityRole: accessibilityRole,
24
25
  ref: ref
25
26
  });
26
27
  });
27
28
  Button.displayName = 'Button';
28
- Button.propTypes = { ...a11yProps.types,
29
+ Button.propTypes = {
30
+ ...a11yProps.types,
29
31
  ...buttonPropTypes,
30
32
  children: textAndA11yText
31
33
  };