@telus-uds/components-base 3.29.0 → 3.29.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 (61) hide show
  1. package/CHANGELOG.md +12 -1
  2. package/jest.config.cjs +1 -0
  3. package/lib/cjs/ActionCard/ActionCard.js +4 -4
  4. package/lib/cjs/ActivityIndicator/Dots.native.js +1 -2
  5. package/lib/cjs/ActivityIndicator/Spinner.native.js +1 -2
  6. package/lib/cjs/Box/Box.js +1 -2
  7. package/lib/cjs/Button/Button.js +1 -2
  8. package/lib/cjs/Button/ButtonBase.js +8 -8
  9. package/lib/cjs/Button/ButtonDropdown.js +1 -2
  10. package/lib/cjs/Button/ButtonGroup.js +1 -2
  11. package/lib/cjs/Button/ButtonLink.js +1 -2
  12. package/lib/cjs/Card/Card.js +1 -2
  13. package/lib/cjs/Card/PressableCardBase.js +1 -2
  14. package/lib/cjs/Card/index.js +1 -2
  15. package/lib/cjs/CardGroup/CardGroup.js +1 -2
  16. package/lib/cjs/Carousel/Carousel.js +6 -6
  17. package/lib/cjs/CheckboxCard/CheckboxCard.js +1 -2
  18. package/lib/cjs/CheckboxCardGroup/CheckboxCardGroup.js +1 -2
  19. package/lib/cjs/HorizontalScroll/index.js +1 -2
  20. package/lib/cjs/Icon/IconText.js +1 -2
  21. package/lib/cjs/Icon/index.js +1 -2
  22. package/lib/cjs/InputSupports/InputSupports.js +1 -2
  23. package/lib/cjs/InputSupports/useInputSupports.js +1 -3
  24. package/lib/cjs/Link/MobileIconTextContent.js +1 -2
  25. package/lib/cjs/Listbox/Listbox.js +1 -2
  26. package/lib/cjs/Modal/Modal.js +1 -1
  27. package/lib/cjs/Pagination/PageButton.js +1 -2
  28. package/lib/cjs/Pagination/Pagination.js +1 -2
  29. package/lib/cjs/QuickLinks/QuickLinks.js +7 -0
  30. package/lib/cjs/Radio/Radio.js +1 -2
  31. package/lib/cjs/RadioCard/RadioCard.js +1 -2
  32. package/lib/cjs/RadioCard/RadioCardGroup.js +1 -2
  33. package/lib/cjs/Shortcuts/Shortcuts.js +1 -2
  34. package/lib/cjs/SideNav/SideNav.js +1 -2
  35. package/lib/cjs/StackView/StackWrapBox.js +9 -1
  36. package/lib/cjs/StackView/StackWrapGap.js +3 -1
  37. package/lib/cjs/StackView/getStackedContent.js +21 -12
  38. package/lib/cjs/Tabs/Tabs.js +1 -2
  39. package/lib/cjs/Tooltip/Tooltip.native.js +2 -2
  40. package/lib/cjs/index.js +1 -2
  41. package/lib/cjs/utils/index.js +1 -2
  42. package/lib/esm/ActionCard/ActionCard.js +4 -4
  43. package/lib/esm/Button/ButtonBase.js +8 -8
  44. package/lib/esm/Carousel/Carousel.js +6 -6
  45. package/lib/esm/InputSupports/InputSupports.js +1 -2
  46. package/lib/esm/InputSupports/useInputSupports.js +1 -3
  47. package/lib/esm/Modal/Modal.js +1 -1
  48. package/lib/esm/QuickLinks/QuickLinks.js +7 -0
  49. package/lib/esm/StackView/StackWrapBox.js +9 -1
  50. package/lib/esm/StackView/StackWrapGap.js +3 -1
  51. package/lib/esm/StackView/getStackedContent.js +20 -10
  52. package/lib/esm/Tooltip/Tooltip.native.js +2 -2
  53. package/lib/package.json +1 -1
  54. package/package.json +1 -1
  55. package/src/InputSupports/InputSupports.jsx +1 -6
  56. package/src/InputSupports/useInputSupports.js +1 -1
  57. package/src/Modal/Modal.jsx +1 -1
  58. package/src/QuickLinks/QuickLinks.jsx +8 -0
  59. package/src/StackView/StackWrapBox.jsx +13 -1
  60. package/src/StackView/StackWrapGap.jsx +2 -1
  61. package/src/StackView/getStackedContent.jsx +22 -8
@@ -32,7 +32,7 @@ import Spacer from '../Spacer'
32
32
  */
33
33
  const getStackedContent = (
34
34
  children,
35
- { divider, space, direction = 'column', box, preserveFragments = false }
35
+ { divider, space, direction = 'column', box, preserveFragments = false, itemAccessibilityRole }
36
36
  ) => {
37
37
  const boxProps = box && typeof box === 'object' ? box : { space }
38
38
  const dividerProps = divider && typeof divider === 'object' ? divider : {}
@@ -42,15 +42,29 @@ const getStackedContent = (
42
42
  const validChildren = React.Children.toArray(topLevelChildren).filter(Boolean)
43
43
  const content = validChildren.reduce((newChildren, child, index) => {
44
44
  const boxID = `Stack-Box-${index}`
45
- const item = box ? (
45
+
46
+ let item
47
+ if (box) {
46
48
  // If wrapped in Box, that Box needs a key.
47
49
  // If possible, use an existing content key; use an index-based key only if necessary.
48
- <Box {...boxProps} key={child.key || boxID} testID={boxID}>
49
- {child}
50
- </Box>
51
- ) : (
52
- child
53
- )
50
+ item = (
51
+ <Box
52
+ {...boxProps}
53
+ accessibilityRole={itemAccessibilityRole}
54
+ key={child.key || boxID}
55
+ testID={boxID}
56
+ >
57
+ {child}
58
+ </Box>
59
+ )
60
+ } else if (itemAccessibilityRole) {
61
+ item = React.cloneElement(child, {
62
+ accessibilityRole: itemAccessibilityRole,
63
+ key: child.key || boxID
64
+ })
65
+ } else {
66
+ item = child
67
+ }
54
68
  if (!index || (!space && !divider)) return [...newChildren, item]
55
69
 
56
70
  const testID = `Stack-${divider ? 'Divider' : 'Spacer'}-${index}`