@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.
- package/CHANGELOG.md +12 -1
- package/jest.config.cjs +1 -0
- package/lib/cjs/ActionCard/ActionCard.js +4 -4
- package/lib/cjs/ActivityIndicator/Dots.native.js +1 -2
- package/lib/cjs/ActivityIndicator/Spinner.native.js +1 -2
- package/lib/cjs/Box/Box.js +1 -2
- package/lib/cjs/Button/Button.js +1 -2
- package/lib/cjs/Button/ButtonBase.js +8 -8
- package/lib/cjs/Button/ButtonDropdown.js +1 -2
- package/lib/cjs/Button/ButtonGroup.js +1 -2
- package/lib/cjs/Button/ButtonLink.js +1 -2
- package/lib/cjs/Card/Card.js +1 -2
- package/lib/cjs/Card/PressableCardBase.js +1 -2
- package/lib/cjs/Card/index.js +1 -2
- package/lib/cjs/CardGroup/CardGroup.js +1 -2
- package/lib/cjs/Carousel/Carousel.js +6 -6
- package/lib/cjs/CheckboxCard/CheckboxCard.js +1 -2
- package/lib/cjs/CheckboxCardGroup/CheckboxCardGroup.js +1 -2
- package/lib/cjs/HorizontalScroll/index.js +1 -2
- package/lib/cjs/Icon/IconText.js +1 -2
- package/lib/cjs/Icon/index.js +1 -2
- package/lib/cjs/InputSupports/InputSupports.js +1 -2
- package/lib/cjs/InputSupports/useInputSupports.js +1 -3
- package/lib/cjs/Link/MobileIconTextContent.js +1 -2
- package/lib/cjs/Listbox/Listbox.js +1 -2
- package/lib/cjs/Modal/Modal.js +1 -1
- package/lib/cjs/Pagination/PageButton.js +1 -2
- package/lib/cjs/Pagination/Pagination.js +1 -2
- package/lib/cjs/QuickLinks/QuickLinks.js +7 -0
- package/lib/cjs/Radio/Radio.js +1 -2
- package/lib/cjs/RadioCard/RadioCard.js +1 -2
- package/lib/cjs/RadioCard/RadioCardGroup.js +1 -2
- package/lib/cjs/Shortcuts/Shortcuts.js +1 -2
- package/lib/cjs/SideNav/SideNav.js +1 -2
- package/lib/cjs/StackView/StackWrapBox.js +9 -1
- package/lib/cjs/StackView/StackWrapGap.js +3 -1
- package/lib/cjs/StackView/getStackedContent.js +21 -12
- package/lib/cjs/Tabs/Tabs.js +1 -2
- package/lib/cjs/Tooltip/Tooltip.native.js +2 -2
- package/lib/cjs/index.js +1 -2
- package/lib/cjs/utils/index.js +1 -2
- package/lib/esm/ActionCard/ActionCard.js +4 -4
- package/lib/esm/Button/ButtonBase.js +8 -8
- package/lib/esm/Carousel/Carousel.js +6 -6
- package/lib/esm/InputSupports/InputSupports.js +1 -2
- package/lib/esm/InputSupports/useInputSupports.js +1 -3
- package/lib/esm/Modal/Modal.js +1 -1
- package/lib/esm/QuickLinks/QuickLinks.js +7 -0
- package/lib/esm/StackView/StackWrapBox.js +9 -1
- package/lib/esm/StackView/StackWrapGap.js +3 -1
- package/lib/esm/StackView/getStackedContent.js +20 -10
- package/lib/esm/Tooltip/Tooltip.native.js +2 -2
- package/lib/package.json +1 -1
- package/package.json +1 -1
- package/src/InputSupports/InputSupports.jsx +1 -6
- package/src/InputSupports/useInputSupports.js +1 -1
- package/src/Modal/Modal.jsx +1 -1
- package/src/QuickLinks/QuickLinks.jsx +8 -0
- package/src/StackView/StackWrapBox.jsx +13 -1
- package/src/StackView/StackWrapGap.jsx +2 -1
- 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
|
-
|
|
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
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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}`
|