@telus-uds/components-base 1.8.1 → 1.8.4

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 (288) hide show
  1. package/CHANGELOG.md +35 -2
  2. package/component-docs.json +711 -669
  3. package/lib/A11yInfoProvider/index.js +4 -3
  4. package/lib/A11yText/index.js +6 -5
  5. package/lib/ActivityIndicator/Spinner.js +14 -13
  6. package/lib/ActivityIndicator/Spinner.native.js +10 -8
  7. package/lib/ActivityIndicator/index.js +6 -5
  8. package/lib/ActivityIndicator/shared.js +1 -1
  9. package/lib/BaseProvider/index.js +13 -10
  10. package/lib/Box/Box.js +20 -19
  11. package/lib/Button/Button.js +7 -6
  12. package/lib/Button/ButtonBase.js +97 -79
  13. package/lib/Button/ButtonGroup.js +34 -32
  14. package/lib/Button/ButtonLink.js +9 -7
  15. package/lib/Button/index.js +4 -4
  16. package/lib/Button/propTypes.js +1 -1
  17. package/lib/Card/Card.js +8 -7
  18. package/lib/Card/CardBase.js +35 -31
  19. package/lib/Card/PressableCardBase.js +14 -12
  20. package/lib/Checkbox/Checkbox.js +97 -83
  21. package/lib/Checkbox/CheckboxGroup.js +29 -27
  22. package/lib/Checkbox/CheckboxInput.js +12 -10
  23. package/lib/Divider/Divider.js +10 -9
  24. package/lib/ExpandCollapse/Control.js +42 -36
  25. package/lib/ExpandCollapse/ExpandCollapse.js +11 -10
  26. package/lib/ExpandCollapse/Panel.js +29 -40
  27. package/lib/Feedback/Feedback.js +48 -35
  28. package/lib/Fieldset/Fieldset.js +16 -15
  29. package/lib/Fieldset/FieldsetContainer.js +16 -13
  30. package/lib/Fieldset/FieldsetContainer.native.js +11 -8
  31. package/lib/Fieldset/Legend.js +10 -7
  32. package/lib/Fieldset/Legend.native.js +10 -7
  33. package/lib/FlexGrid/Col/Col.js +18 -17
  34. package/lib/FlexGrid/FlexGrid.js +15 -14
  35. package/lib/FlexGrid/Row/Row.js +13 -12
  36. package/lib/HorizontalScroll/HorizontalScroll.js +25 -20
  37. package/lib/HorizontalScroll/HorizontalScrollButton.js +18 -14
  38. package/lib/HorizontalScroll/ScrollViewEnd.js +6 -5
  39. package/lib/HorizontalScroll/ScrollViewEnd.native.js +12 -9
  40. package/lib/HorizontalScroll/itemPositions.js +19 -13
  41. package/lib/Icon/Icon.js +11 -10
  42. package/lib/Icon/IconText.js +8 -7
  43. package/lib/Icon/index.js +5 -5
  44. package/lib/IconButton/IconButton.js +50 -42
  45. package/lib/InputLabel/InputLabel.js +37 -30
  46. package/lib/InputLabel/LabelContent.js +12 -9
  47. package/lib/InputLabel/LabelContent.native.js +9 -6
  48. package/lib/InputSupports/InputSupports.js +11 -10
  49. package/lib/InputSupports/useInputSupports.js +7 -6
  50. package/lib/Link/ChevronLink.js +9 -8
  51. package/lib/Link/InlinePressable.js +13 -10
  52. package/lib/Link/InlinePressable.native.js +20 -16
  53. package/lib/Link/Link.js +10 -9
  54. package/lib/Link/LinkBase.js +96 -78
  55. package/lib/Link/TextButton.js +9 -8
  56. package/lib/List/List.js +20 -13
  57. package/lib/List/ListItem.js +103 -79
  58. package/lib/Modal/Modal.js +74 -60
  59. package/lib/Notification/Notification.js +46 -33
  60. package/lib/Pagination/PageButton.js +13 -12
  61. package/lib/Pagination/Pagination.js +43 -30
  62. package/lib/Pagination/SideButton.js +21 -18
  63. package/lib/Pagination/usePagination.js +7 -6
  64. package/lib/Progress/Progress.js +23 -19
  65. package/lib/Progress/ProgressBar.js +25 -21
  66. package/lib/Progress/ProgressBarBackground.js +7 -6
  67. package/lib/Radio/Radio.js +80 -69
  68. package/lib/Radio/RadioButton.js +63 -53
  69. package/lib/Radio/RadioGroup.js +30 -28
  70. package/lib/Radio/RadioInput.js +12 -10
  71. package/lib/RadioCard/RadioCard.js +16 -15
  72. package/lib/RadioCard/RadioCardGroup.js +30 -28
  73. package/lib/Search/Search.js +52 -32
  74. package/lib/Select/Group.js +5 -4
  75. package/lib/Select/Group.native.js +4 -3
  76. package/lib/Select/Item.js +10 -7
  77. package/lib/Select/Item.native.js +1 -9
  78. package/lib/Select/Picker.js +16 -15
  79. package/lib/Select/Picker.native.js +49 -38
  80. package/lib/Select/Select.js +134 -113
  81. package/lib/SideNav/Item.js +39 -33
  82. package/lib/SideNav/ItemContent.js +15 -12
  83. package/lib/SideNav/ItemsGroup.js +13 -11
  84. package/lib/SideNav/SideNav.js +21 -18
  85. package/lib/Skeleton/Skeleton.js +60 -44
  86. package/lib/Skeleton/skeleton.constant.js +1 -1
  87. package/lib/Skeleton/skeletonWebAnimation.js +1 -1
  88. package/lib/Spacer/Spacer.js +6 -5
  89. package/lib/StackView/StackView.js +12 -11
  90. package/lib/StackView/StackWrap.js +5 -3
  91. package/lib/StackView/StackWrapBox.js +12 -11
  92. package/lib/StackView/StackWrapGap.js +11 -10
  93. package/lib/StackView/common.js +14 -11
  94. package/lib/StackView/getStackedContent.js +10 -9
  95. package/lib/StackView/index.js +1 -1
  96. package/lib/StepTracker/Step.js +122 -103
  97. package/lib/StepTracker/StepTracker.js +48 -38
  98. package/lib/Tabs/Tabs.js +57 -27
  99. package/lib/Tabs/TabsItem.js +78 -68
  100. package/lib/Tags/Tags.js +68 -62
  101. package/lib/TextInput/TextArea.js +26 -20
  102. package/lib/TextInput/TextInput.js +20 -15
  103. package/lib/TextInput/TextInputBase.js +74 -62
  104. package/lib/TextInput/index.js +4 -4
  105. package/lib/ThemeProvider/ThemeProvider.js +6 -5
  106. package/lib/ThemeProvider/index.js +5 -5
  107. package/lib/ThemeProvider/useSetTheme.js +6 -3
  108. package/lib/ThemeProvider/useThemeTokens.js +7 -2
  109. package/lib/ThemeProvider/utils/styles.js +50 -43
  110. package/lib/ThemeProvider/utils/theme-tokens.js +33 -21
  111. package/lib/ToggleSwitch/ToggleSwitch.js +90 -74
  112. package/lib/ToggleSwitch/ToggleSwitchGroup.js +37 -35
  113. package/lib/Tooltip/Backdrop.js +6 -13
  114. package/lib/Tooltip/Backdrop.native.js +5 -4
  115. package/lib/Tooltip/Tooltip.js +81 -65
  116. package/lib/Tooltip/getTooltipPosition.js +29 -18
  117. package/lib/TooltipButton/TooltipButton.js +28 -21
  118. package/lib/Typography/Typography.js +37 -33
  119. package/lib/ViewportProvider/ViewportProvider.js +4 -3
  120. package/lib/ViewportProvider/useViewportListener.js +6 -3
  121. package/lib/index.js +54 -54
  122. package/lib/utils/a11y/semantics.js +5 -2
  123. package/lib/utils/a11y/textSize.js +8 -6
  124. package/lib/utils/animation/useVerticalExpandAnimation.js +46 -19
  125. package/lib/utils/children.js +4 -3
  126. package/lib/utils/index.js +10 -10
  127. package/lib/utils/input.js +28 -29
  128. package/lib/utils/pressability.js +36 -22
  129. package/lib/utils/props/clickProps.js +2 -1
  130. package/lib/utils/props/componentPropType.js +3 -3
  131. package/lib/utils/props/getPropSelector.js +6 -3
  132. package/lib/utils/props/handlerProps.js +25 -19
  133. package/lib/utils/props/hrefAttrsProp.js +14 -11
  134. package/lib/utils/props/index.js +12 -12
  135. package/lib/utils/props/inputSupportsProps.js +15 -12
  136. package/lib/utils/props/linkProps.js +7 -6
  137. package/lib/utils/props/pressProps.js +1 -1
  138. package/lib/utils/props/selectSystemProps.js +2 -2
  139. package/lib/utils/props/tokens.js +29 -15
  140. package/lib/utils/ssr.js +6 -2
  141. package/lib/utils/useCopy.js +6 -4
  142. package/lib/utils/useHash.js +2 -1
  143. package/lib/utils/useResponsiveProp.js +1 -1
  144. package/lib/utils/useSpacingScale.js +3 -1
  145. package/lib/utils/useUniqueId.js +3 -2
  146. package/lib/utils/withLinkRouter.js +6 -5
  147. package/lib-module/A11yInfoProvider/index.js +4 -3
  148. package/lib-module/A11yText/index.js +6 -5
  149. package/lib-module/ActivityIndicator/Spinner.js +14 -13
  150. package/lib-module/ActivityIndicator/Spinner.native.js +9 -8
  151. package/lib-module/ActivityIndicator/index.js +6 -5
  152. package/lib-module/BaseProvider/index.js +13 -10
  153. package/lib-module/Box/Box.js +20 -19
  154. package/lib-module/Button/Button.js +7 -6
  155. package/lib-module/Button/ButtonBase.js +96 -79
  156. package/lib-module/Button/ButtonGroup.js +34 -32
  157. package/lib-module/Button/ButtonLink.js +8 -7
  158. package/lib-module/Card/Card.js +8 -7
  159. package/lib-module/Card/CardBase.js +35 -31
  160. package/lib-module/Card/PressableCardBase.js +12 -11
  161. package/lib-module/Checkbox/Checkbox.js +97 -83
  162. package/lib-module/Checkbox/CheckboxGroup.js +29 -27
  163. package/lib-module/Checkbox/CheckboxInput.js +12 -10
  164. package/lib-module/Divider/Divider.js +10 -9
  165. package/lib-module/ExpandCollapse/Control.js +42 -36
  166. package/lib-module/ExpandCollapse/ExpandCollapse.js +11 -10
  167. package/lib-module/ExpandCollapse/Panel.js +29 -37
  168. package/lib-module/Feedback/Feedback.js +46 -33
  169. package/lib-module/Fieldset/Fieldset.js +16 -15
  170. package/lib-module/Fieldset/FieldsetContainer.js +16 -13
  171. package/lib-module/Fieldset/FieldsetContainer.native.js +11 -8
  172. package/lib-module/Fieldset/Legend.js +10 -7
  173. package/lib-module/Fieldset/Legend.native.js +10 -7
  174. package/lib-module/FlexGrid/Col/Col.js +18 -17
  175. package/lib-module/FlexGrid/FlexGrid.js +15 -14
  176. package/lib-module/FlexGrid/Row/Row.js +13 -12
  177. package/lib-module/HorizontalScroll/HorizontalScroll.js +24 -19
  178. package/lib-module/HorizontalScroll/HorizontalScrollButton.js +18 -14
  179. package/lib-module/HorizontalScroll/ScrollViewEnd.js +6 -5
  180. package/lib-module/HorizontalScroll/ScrollViewEnd.native.js +12 -9
  181. package/lib-module/HorizontalScroll/itemPositions.js +18 -12
  182. package/lib-module/Icon/Icon.js +10 -9
  183. package/lib-module/Icon/IconText.js +9 -7
  184. package/lib-module/IconButton/IconButton.js +48 -41
  185. package/lib-module/InputLabel/InputLabel.js +37 -30
  186. package/lib-module/InputLabel/LabelContent.js +12 -9
  187. package/lib-module/InputLabel/LabelContent.native.js +9 -6
  188. package/lib-module/InputSupports/InputSupports.js +11 -10
  189. package/lib-module/InputSupports/useInputSupports.js +7 -6
  190. package/lib-module/Link/ChevronLink.js +9 -8
  191. package/lib-module/Link/InlinePressable.js +13 -10
  192. package/lib-module/Link/InlinePressable.native.js +20 -16
  193. package/lib-module/Link/Link.js +10 -9
  194. package/lib-module/Link/LinkBase.js +94 -77
  195. package/lib-module/Link/TextButton.js +9 -8
  196. package/lib-module/List/List.js +20 -13
  197. package/lib-module/List/ListItem.js +103 -78
  198. package/lib-module/Modal/Modal.js +74 -60
  199. package/lib-module/Notification/Notification.js +46 -33
  200. package/lib-module/Pagination/PageButton.js +13 -12
  201. package/lib-module/Pagination/Pagination.js +43 -30
  202. package/lib-module/Pagination/SideButton.js +21 -18
  203. package/lib-module/Pagination/usePagination.js +7 -6
  204. package/lib-module/Progress/Progress.js +23 -19
  205. package/lib-module/Progress/ProgressBar.js +25 -21
  206. package/lib-module/Progress/ProgressBarBackground.js +7 -6
  207. package/lib-module/Radio/Radio.js +80 -69
  208. package/lib-module/Radio/RadioButton.js +62 -52
  209. package/lib-module/Radio/RadioGroup.js +30 -28
  210. package/lib-module/Radio/RadioInput.js +12 -10
  211. package/lib-module/RadioCard/RadioCard.js +16 -15
  212. package/lib-module/RadioCard/RadioCardGroup.js +30 -28
  213. package/lib-module/Search/Search.js +52 -32
  214. package/lib-module/Select/Group.js +5 -4
  215. package/lib-module/Select/Group.native.js +4 -3
  216. package/lib-module/Select/Item.js +10 -7
  217. package/lib-module/Select/Item.native.js +1 -7
  218. package/lib-module/Select/Picker.js +16 -15
  219. package/lib-module/Select/Picker.native.js +46 -36
  220. package/lib-module/Select/Select.js +134 -113
  221. package/lib-module/SideNav/Item.js +39 -33
  222. package/lib-module/SideNav/ItemContent.js +14 -11
  223. package/lib-module/SideNav/ItemsGroup.js +13 -11
  224. package/lib-module/SideNav/SideNav.js +21 -18
  225. package/lib-module/Skeleton/Skeleton.js +60 -44
  226. package/lib-module/Skeleton/skeletonWebAnimation.js +1 -1
  227. package/lib-module/Spacer/Spacer.js +6 -5
  228. package/lib-module/StackView/StackView.js +12 -11
  229. package/lib-module/StackView/StackWrap.js +5 -3
  230. package/lib-module/StackView/StackWrapBox.js +12 -11
  231. package/lib-module/StackView/StackWrapGap.js +11 -10
  232. package/lib-module/StackView/common.js +14 -11
  233. package/lib-module/StackView/getStackedContent.js +10 -9
  234. package/lib-module/StepTracker/Step.js +122 -103
  235. package/lib-module/StepTracker/StepTracker.js +48 -38
  236. package/lib-module/Tabs/Tabs.js +57 -27
  237. package/lib-module/Tabs/TabsItem.js +77 -68
  238. package/lib-module/Tags/Tags.js +68 -62
  239. package/lib-module/TextInput/TextArea.js +26 -20
  240. package/lib-module/TextInput/TextInput.js +19 -15
  241. package/lib-module/TextInput/TextInputBase.js +74 -62
  242. package/lib-module/ThemeProvider/ThemeProvider.js +5 -4
  243. package/lib-module/ThemeProvider/useSetTheme.js +6 -3
  244. package/lib-module/ThemeProvider/useThemeTokens.js +7 -2
  245. package/lib-module/ThemeProvider/utils/styles.js +48 -41
  246. package/lib-module/ThemeProvider/utils/theme-tokens.js +32 -20
  247. package/lib-module/ToggleSwitch/ToggleSwitch.js +90 -74
  248. package/lib-module/ToggleSwitch/ToggleSwitchGroup.js +37 -35
  249. package/lib-module/Tooltip/Backdrop.js +6 -13
  250. package/lib-module/Tooltip/Backdrop.native.js +5 -4
  251. package/lib-module/Tooltip/Tooltip.js +81 -65
  252. package/lib-module/Tooltip/getTooltipPosition.js +29 -18
  253. package/lib-module/TooltipButton/TooltipButton.js +28 -21
  254. package/lib-module/Typography/Typography.js +35 -31
  255. package/lib-module/ViewportProvider/ViewportProvider.js +4 -3
  256. package/lib-module/ViewportProvider/useViewportListener.js +6 -3
  257. package/lib-module/utils/a11y/semantics.js +4 -1
  258. package/lib-module/utils/a11y/textSize.js +7 -5
  259. package/lib-module/utils/animation/useVerticalExpandAnimation.js +47 -20
  260. package/lib-module/utils/children.js +4 -3
  261. package/lib-module/utils/input.js +28 -29
  262. package/lib-module/utils/pressability.js +35 -21
  263. package/lib-module/utils/props/clickProps.js +2 -1
  264. package/lib-module/utils/props/componentPropType.js +3 -3
  265. package/lib-module/utils/props/getPropSelector.js +6 -3
  266. package/lib-module/utils/props/handlerProps.js +24 -18
  267. package/lib-module/utils/props/hrefAttrsProp.js +14 -11
  268. package/lib-module/utils/props/inputSupportsProps.js +15 -12
  269. package/lib-module/utils/props/linkProps.js +7 -6
  270. package/lib-module/utils/props/selectSystemProps.js +2 -2
  271. package/lib-module/utils/props/tokens.js +27 -14
  272. package/lib-module/utils/ssr.js +5 -2
  273. package/lib-module/utils/useCopy.js +6 -4
  274. package/lib-module/utils/useHash.js +2 -1
  275. package/lib-module/utils/useSpacingScale.js +3 -1
  276. package/lib-module/utils/useUniqueId.js +3 -2
  277. package/lib-module/utils/withLinkRouter.js +6 -5
  278. package/package.json +13 -11
  279. package/src/ExpandCollapse/Panel.jsx +2 -19
  280. package/src/List/List.jsx +34 -19
  281. package/src/List/ListItem.jsx +12 -2
  282. package/src/Modal/Modal.jsx +2 -1
  283. package/src/Pagination/Pagination.jsx +3 -0
  284. package/src/Search/Search.jsx +11 -0
  285. package/src/Select/Item.native.jsx +0 -7
  286. package/src/Tabs/Tabs.jsx +24 -2
  287. package/src/Tabs/TabsItem.jsx +6 -5
  288. package/src/utils/animation/useVerticalExpandAnimation.js +47 -13
@@ -37,79 +37,95 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
37
37
 
38
38
  const [selectProps, selectedSystemPropTypes] = (0, _props.selectSystemProps)([_props.a11yProps, _props.linkProps, _props.viewProps]);
39
39
 
40
- const selectOuterBorderStyles = ({
41
- outerBorderColor,
42
- outerBorderWidth,
43
- outerBorderGap,
44
- borderRadius,
45
- outerBorderOutline
46
- }) => // A view wrapper with a border on native messes up inline text alignment
47
- // so for now make focus styles strictly web-only
48
- _Platform.default.OS === 'web' ? {
49
- // Allow theme to define outline, or, turn off outline and use border if rounded corners required
50
- outline: outerBorderOutline,
51
- ...(0, _ThemeProvider.applyOuterBorder)({
40
+ const selectOuterBorderStyles = _ref => {
41
+ let {
52
42
  outerBorderColor,
53
43
  outerBorderWidth,
54
44
  outerBorderGap,
55
- borderRadius
56
- }),
57
- // Stops focus ring stretching horizontally if parent has display: block
58
- // width: fit-content isn't supported on Firefox; can't cascade props like CSS `width: fit-content; width: --moz-fit-content;`
59
- display: 'inline-flex'
60
- } : {};
61
-
62
- const selectTextStyles = ({
63
- color
64
- }) => ({
65
- color,
66
- ..._Platform.default.select({
67
- web: {
68
- // TODO: https://github.com/telus/universal-design-system/issues/487
69
- transition: 'color 200ms'
70
- }
71
- })
72
- });
45
+ borderRadius,
46
+ outerBorderOutline
47
+ } = _ref;
48
+ return (// A view wrapper with a border on native messes up inline text alignment
49
+ // so for now make focus styles strictly web-only
50
+ _Platform.default.OS === 'web' ? {
51
+ // Allow theme to define outline, or, turn off outline and use border if rounded corners required
52
+ outline: outerBorderOutline,
53
+ ...(0, _ThemeProvider.applyOuterBorder)({
54
+ outerBorderColor,
55
+ outerBorderWidth,
56
+ outerBorderGap,
57
+ borderRadius
58
+ }),
59
+ // Stops focus ring stretching horizontally if parent has display: block
60
+ // width: fit-content isn't supported on Firefox; can't cascade props like CSS `width: fit-content; width: --moz-fit-content;`
61
+ display: 'inline-flex'
62
+ } : {}
63
+ );
64
+ };
73
65
 
74
- const selectBlockStyles = ({
75
- blockFontWeight,
76
- blockFontSize,
77
- blockLineHeight,
78
- blockFontName
79
- }) => (0, _ThemeProvider.applyTextStyles)({
80
- fontWeight: blockFontWeight,
81
- fontSize: blockFontSize,
82
- lineHeight: blockLineHeight,
83
- fontName: blockFontName
84
- });
66
+ const selectTextStyles = _ref2 => {
67
+ let {
68
+ color
69
+ } = _ref2;
70
+ return {
71
+ color,
72
+ ..._Platform.default.select({
73
+ web: {
74
+ // TODO: https://github.com/telus/universal-design-system/issues/487
75
+ transition: 'color 200ms'
76
+ }
77
+ })
78
+ };
79
+ };
85
80
 
86
- const selectDecorationStyles = ({
87
- color,
88
- textLine,
89
- textLineStyle
90
- }) => ({
91
- color,
92
- textDecorationLine: textLine,
93
- textDecorationStyle: textLineStyle,
94
- ..._Platform.default.select({
95
- web: {
96
- // TODO: https://github.com/telus/universal-design-system/issues/487
97
- transition: 'color 200ms'
98
- }
99
- })
100
- });
81
+ const selectBlockStyles = _ref3 => {
82
+ let {
83
+ blockFontWeight,
84
+ blockFontSize,
85
+ blockLineHeight,
86
+ blockFontName
87
+ } = _ref3;
88
+ return (0, _ThemeProvider.applyTextStyles)({
89
+ fontWeight: blockFontWeight,
90
+ fontSize: blockFontSize,
91
+ lineHeight: blockLineHeight,
92
+ fontName: blockFontName
93
+ });
94
+ };
101
95
 
102
- const selectIconTokens = ({
103
- color,
104
- iconSize,
105
- iconTranslateX,
106
- iconTranslateY
107
- }) => ({
108
- color,
109
- translateX: iconTranslateX,
110
- translateY: iconTranslateY,
111
- size: iconSize
112
- });
96
+ const selectDecorationStyles = _ref4 => {
97
+ let {
98
+ color,
99
+ textLine,
100
+ textLineStyle
101
+ } = _ref4;
102
+ return {
103
+ color,
104
+ textDecorationLine: textLine,
105
+ textDecorationStyle: textLineStyle,
106
+ ..._Platform.default.select({
107
+ web: {
108
+ // TODO: https://github.com/telus/universal-design-system/issues/487
109
+ transition: 'color 200ms'
110
+ }
111
+ })
112
+ };
113
+ };
114
+
115
+ const selectIconTokens = _ref5 => {
116
+ let {
117
+ color,
118
+ iconSize,
119
+ iconTranslateX,
120
+ iconTranslateY
121
+ } = _ref5;
122
+ return {
123
+ color,
124
+ translateX: iconTranslateX,
125
+ translateY: iconTranslateY,
126
+ size: iconSize
127
+ };
128
+ };
113
129
  /**
114
130
  * Renders a pressable text link, with optional icon. This is rendered as a block element
115
131
  * only (see 'Current Limitations'). On Web, renders an `<a>` anchor tag if `href` is provided.
@@ -134,17 +150,19 @@ const selectIconTokens = ({
134
150
  */
135
151
 
136
152
 
137
- const LinkBase = /*#__PURE__*/(0, _react.forwardRef)(({
138
- href,
139
- icon,
140
- iconPosition = icon ? 'left' : undefined,
141
- iconProps,
142
- variant,
143
- tokens = {},
144
- children,
145
- accessibilityRole = 'link',
146
- ...rawRest
147
- }, ref) => {
153
+ const LinkBase = /*#__PURE__*/(0, _react.forwardRef)((_ref6, ref) => {
154
+ let {
155
+ href,
156
+ icon,
157
+ iconPosition = icon ? 'left' : undefined,
158
+ iconProps,
159
+ variant,
160
+ tokens = {},
161
+ children,
162
+ accessibilityRole = 'link',
163
+ ...rawRest
164
+ } = _ref6;
165
+
148
166
  const {
149
167
  onPress,
150
168
  ...props
@@ -26,14 +26,15 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
26
26
  * Link but has the accessibility role of a `Button`. It should be used for actions that
27
27
  * take place on the current page, or for navigation within an app.
28
28
  */
29
- const TextButton = /*#__PURE__*/(0, _react.forwardRef)(({
30
- onPress,
31
- children,
32
- variant,
33
- tokens,
34
- accessibilityRole = 'button',
35
- ...linkProps
36
- }, ref) => {
29
+ const TextButton = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
30
+ let {
31
+ onPress,
32
+ children,
33
+ variant,
34
+ tokens,
35
+ accessibilityRole = 'button',
36
+ ...linkProps
37
+ } = _ref;
37
38
  const getTokens = (0, _ThemeProvider.useThemeTokensCallback)('Link', tokens, variant);
38
39
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_LinkBase.default, {
39
40
  onPress: onPress,
package/lib/List/List.js CHANGED
@@ -31,25 +31,32 @@ const [selectProps, selectedSystemPropTypes] = (0, _utils.selectSystemProps)([_u
31
31
  * allows icon, dividers and customized typography
32
32
  */
33
33
 
34
- const List = /*#__PURE__*/(0, _react.forwardRef)(({
35
- children,
36
- showDivider,
37
- tokens,
38
- variant,
39
- ...rest
40
- }, ref) => {
41
- const accessibilityRole = _Platform.default.select({
42
- web: 'list',
43
- default: 'none'
44
- });
34
+ const List = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
35
+ let {
36
+ children,
37
+ showDivider,
38
+ tokens,
39
+ variant,
40
+ accessibilityRole = _Platform.default.select({
41
+ web: 'list',
42
+ default: undefined
43
+ }),
44
+ ...rest
45
+ } = _ref;
45
46
 
46
47
  const items = _react.Children.map(children, (child, index) => {
47
- if (child.type.name === _ListItem.default.name) {
48
+ var _child$type, _child$type2;
49
+
50
+ // Pass ListItem-specific props to children (by name so teams can add their own ListItems)
51
+ const isListItem = componentName => Boolean(componentName === _ListItem.default.displayName);
52
+
53
+ if (isListItem(child === null || child === void 0 ? void 0 : (_child$type = child.type) === null || _child$type === void 0 ? void 0 : _child$type.displayName) || isListItem(child === null || child === void 0 ? void 0 : (_child$type2 = child.type) === null || _child$type2 === void 0 ? void 0 : _child$type2.name)) {
48
54
  return /*#__PURE__*/(0, _react.cloneElement)(child, {
49
55
  showDivider,
50
56
  isLastItem: index + 1 === _react.Children.count(children),
51
57
  tokens,
52
- variant
58
+ variant,
59
+ ...child.props
53
60
  });
54
61
  }
55
62
 
@@ -29,93 +29,122 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
29
29
 
30
30
  const [selectProps, selectedSystemPropTypes] = (0, _utils.selectSystemProps)([_utils.a11yProps, _utils.viewProps]);
31
31
 
32
- const selectBulletStyles = ({
33
- itemBulletWidth,
34
- itemBulletHeight,
35
- itemBulletColor
36
- }) => ({
37
- width: itemBulletWidth,
38
- height: itemBulletHeight,
39
- borderRadius: itemBulletHeight / 2,
40
- backgroundColor: itemBulletColor
41
- });
32
+ const selectBulletStyles = _ref => {
33
+ let {
34
+ itemBulletWidth,
35
+ itemBulletHeight,
36
+ itemBulletColor
37
+ } = _ref;
38
+ return {
39
+ width: itemBulletWidth,
40
+ height: itemBulletHeight,
41
+ borderRadius: itemBulletHeight / 2,
42
+ backgroundColor: itemBulletColor
43
+ };
44
+ };
42
45
 
43
- const selectBulletContainerStyles = ({
44
- itemBulletContainerWidth,
45
- itemBulletContainerAlign
46
- }) => ({
47
- width: itemBulletContainerWidth,
48
- alignItems: itemBulletContainerAlign
49
- });
46
+ const selectBulletContainerStyles = _ref2 => {
47
+ let {
48
+ itemBulletContainerWidth,
49
+ itemBulletContainerAlign
50
+ } = _ref2;
51
+ return {
52
+ width: itemBulletContainerWidth,
53
+ alignItems: itemBulletContainerAlign
54
+ };
55
+ };
50
56
 
51
- const selectItemIconTokens = ({
52
- itemIconSize,
53
- itemIconColor
54
- }) => ({
55
- size: itemIconSize,
56
- color: itemIconColor
57
- });
57
+ const selectItemIconTokens = _ref3 => {
58
+ let {
59
+ itemIconSize,
60
+ itemIconColor
61
+ } = _ref3;
62
+ return {
63
+ size: itemIconSize,
64
+ color: itemIconColor
65
+ };
66
+ };
58
67
 
59
- const selectSideItemContainerStyles = ({
60
- listGutter,
61
- iconMarginTop
62
- }) => ({
63
- marginTop: iconMarginTop,
64
- marginRight: listGutter
65
- }); // Align bullets with the top line of text the same way icons are aligned
68
+ const selectSideItemContainerStyles = _ref4 => {
69
+ let {
70
+ listGutter,
71
+ iconMarginTop
72
+ } = _ref4;
73
+ return {
74
+ marginTop: iconMarginTop,
75
+ marginRight: listGutter
76
+ };
77
+ }; // Align bullets with the top line of text the same way icons are aligned
66
78
 
67
79
 
68
- const selectBulletPositioningStyles = ({
69
- itemIconSize
70
- }) => ({
71
- width: itemIconSize,
72
- height: itemIconSize
73
- });
80
+ const selectBulletPositioningStyles = _ref5 => {
81
+ let {
82
+ itemIconSize
83
+ } = _ref5;
84
+ return {
85
+ width: itemIconSize,
86
+ height: itemIconSize
87
+ };
88
+ };
74
89
 
75
- const selectItemStyles = ({
76
- itemFontWeight,
77
- itemFontSize,
78
- itemLineHeight,
79
- itemFontName
80
- }) => (0, _ThemeProvider.applyTextStyles)({
81
- fontWeight: itemFontWeight,
82
- fontSize: itemFontSize,
83
- lineHeight: itemLineHeight,
84
- fontName: itemFontName
85
- });
90
+ const selectItemStyles = _ref6 => {
91
+ let {
92
+ itemFontWeight,
93
+ itemFontSize,
94
+ itemLineHeight,
95
+ itemFontName
96
+ } = _ref6;
97
+ return (0, _ThemeProvider.applyTextStyles)({
98
+ fontWeight: itemFontWeight,
99
+ fontSize: itemFontSize,
100
+ lineHeight: itemLineHeight,
101
+ fontName: itemFontName
102
+ });
103
+ };
86
104
 
87
- const selectItemBlockStyles = ({
88
- interItemMargin
89
- }) => ({
90
- marginBottom: interItemMargin
91
- });
105
+ const selectItemBlockStyles = _ref7 => {
106
+ let {
107
+ interItemMargin
108
+ } = _ref7;
109
+ return {
110
+ marginBottom: interItemMargin
111
+ };
112
+ };
92
113
 
93
- const selectDividerStyles = ({
94
- dividerColor,
95
- dividerSize,
96
- interItemMarginWithDivider
97
- }) => ({
98
- borderBottomWidth: dividerSize,
99
- borderColor: dividerColor,
100
- marginBottom: interItemMarginWithDivider,
101
- paddingBottom: interItemMarginWithDivider
102
- });
114
+ const selectDividerStyles = _ref8 => {
115
+ let {
116
+ dividerColor,
117
+ dividerSize,
118
+ interItemMarginWithDivider
119
+ } = _ref8;
120
+ return {
121
+ borderBottomWidth: dividerSize,
122
+ borderColor: dividerColor,
123
+ marginBottom: interItemMarginWithDivider,
124
+ paddingBottom: interItemMarginWithDivider
125
+ };
126
+ };
103
127
  /**
104
128
  * ListItem is responsible for rendering icon or a bullet as side item
105
129
  */
106
130
 
107
131
 
108
- const ListItem = /*#__PURE__*/(0, _react.forwardRef)(({
109
- tokens,
110
- variant,
111
- icon,
112
- iconColor,
113
- iconSize,
114
- showDivider,
115
- children,
116
- isLastItem,
117
- ...rest
118
- }, ref) => {
132
+ const ListItem = /*#__PURE__*/(0, _react.forwardRef)((_ref9, ref) => {
133
+ let {
134
+ tokens,
135
+ variant,
136
+ icon,
137
+ iconColor,
138
+ iconSize,
139
+ showDivider,
140
+ children,
141
+ isLastItem,
142
+ accessibilityRole = _Platform.default.select({
143
+ web: 'listitem',
144
+ default: undefined
145
+ }),
146
+ ...rest
147
+ } = _ref9;
119
148
  const themeTokens = (0, _ThemeProvider.useThemeTokens)('List', tokens, variant);
120
149
  const itemStyles = selectItemStyles(themeTokens);
121
150
  const itemBlockStyles = selectItemBlockStyles(themeTokens);
@@ -126,11 +155,6 @@ const ListItem = /*#__PURE__*/(0, _react.forwardRef)(({
126
155
  const iconTokens = selectItemIconTokens(themeTokens);
127
156
  const sideItemContainerStyles = selectSideItemContainerStyles(themeTokens);
128
157
 
129
- const accessibilityRole = _Platform.default.select({
130
- web: 'listitem',
131
- default: 'item'
132
- });
133
-
134
158
  const renderItem = () => /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
135
159
  style: staticStyles.wrap,
136
160
  children: (0, _utils.wrapStringsInText)(children, {
@@ -39,57 +39,69 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
39
39
 
40
40
  const [selectProps, selectedSystemPropTypes] = (0, _utils.selectSystemProps)([_utils.a11yProps, _utils.viewProps]);
41
41
 
42
- const selectContainerStyles = ({
43
- containerPaddingLeft,
44
- containerPaddingRight,
45
- containerPaddingTop,
46
- containerPaddingBottom,
47
- maxWidth,
48
- height
49
- }) => ({
50
- height,
51
- maxWidth,
52
- paddingLeft: containerPaddingLeft,
53
- paddingRight: containerPaddingRight,
54
- paddingTop: containerPaddingTop,
55
- paddingBottom: containerPaddingBottom
56
- });
42
+ const selectContainerStyles = _ref => {
43
+ let {
44
+ containerPaddingLeft,
45
+ containerPaddingRight,
46
+ containerPaddingTop,
47
+ containerPaddingBottom,
48
+ maxWidth,
49
+ height
50
+ } = _ref;
51
+ return {
52
+ height,
53
+ maxWidth,
54
+ paddingLeft: containerPaddingLeft,
55
+ paddingRight: containerPaddingRight,
56
+ paddingTop: containerPaddingTop,
57
+ paddingBottom: containerPaddingBottom
58
+ };
59
+ };
57
60
 
58
- const selectModalStyles = ({
59
- backgroundColor,
60
- borderRadius,
61
- height,
62
- paddingLeft,
63
- paddingRight,
64
- paddingTop,
65
- paddingBottom,
66
- shadow
67
- }) => ({
68
- backgroundColor,
69
- borderRadius,
70
- height,
71
- paddingLeft,
72
- paddingRight,
73
- paddingTop,
74
- paddingBottom,
75
- ...(0, _ThemeProvider.applyShadowToken)(shadow)
76
- });
61
+ const selectModalStyles = _ref2 => {
62
+ let {
63
+ backgroundColor,
64
+ borderRadius,
65
+ height,
66
+ paddingLeft,
67
+ paddingRight,
68
+ paddingTop,
69
+ paddingBottom,
70
+ shadow
71
+ } = _ref2;
72
+ return {
73
+ backgroundColor,
74
+ borderRadius,
75
+ height,
76
+ paddingLeft,
77
+ paddingRight,
78
+ paddingTop,
79
+ paddingBottom,
80
+ ...(0, _ThemeProvider.applyShadowToken)(shadow)
81
+ };
82
+ };
77
83
 
78
- const selectBackdropStyles = ({
79
- backdropColor,
80
- backdropOpacity
81
- }) => ({
82
- backgroundColor: backdropColor,
83
- opacity: backdropOpacity
84
- });
84
+ const selectBackdropStyles = _ref3 => {
85
+ let {
86
+ backdropColor,
87
+ backdropOpacity
88
+ } = _ref3;
89
+ return {
90
+ backgroundColor: backdropColor,
91
+ opacity: backdropOpacity
92
+ };
93
+ };
85
94
 
86
- const selectCloseButtonContainerStyles = ({
87
- paddingRight,
88
- paddingTop
89
- }) => ({
90
- paddingRight,
91
- paddingTop
92
- });
95
+ const selectCloseButtonContainerStyles = _ref4 => {
96
+ let {
97
+ paddingRight,
98
+ paddingTop
99
+ } = _ref4;
100
+ return {
101
+ paddingRight,
102
+ paddingTop
103
+ };
104
+ };
93
105
  /**
94
106
  * A modal window is a secondary window that opens on top of the main one.
95
107
  * Users have to interact with it before they can carry out their task and return to the main window.
@@ -106,17 +118,18 @@ const selectCloseButtonContainerStyles = ({
106
118
  */
107
119
 
108
120
 
109
- const Modal = /*#__PURE__*/(0, _react.forwardRef)(({
110
- children,
111
- isOpen,
112
- onClose,
113
- maxWidth,
114
- tokens,
115
- variant,
116
- copy,
117
- closeButton,
118
- ...rest
119
- }, ref) => {
121
+ const Modal = /*#__PURE__*/(0, _react.forwardRef)((_ref5, ref) => {
122
+ let {
123
+ children,
124
+ isOpen,
125
+ onClose,
126
+ maxWidth,
127
+ tokens,
128
+ variant,
129
+ copy,
130
+ closeButton,
131
+ ...rest
132
+ } = _ref5;
120
133
  const viewport = (0, _ViewportProvider.useViewport)();
121
134
  const themeTokens = (0, _ThemeProvider.useThemeTokens)('Modal', tokens, variant, {
122
135
  viewport,
@@ -230,6 +243,7 @@ const staticStyles = _StyleSheet.default.create({
230
243
  closeButtonContainer: {
231
244
  position: 'absolute',
232
245
  top: 0,
233
- right: 0
246
+ right: 0,
247
+ zIndex: 1
234
248
  }
235
249
  });