@telus-uds/components-base 1.8.3 → 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.
- package/CHANGELOG.md +14 -2
- package/component-docs.json +1 -1
- package/lib/ActivityIndicator/Spinner.js +7 -7
- package/lib/ActivityIndicator/Spinner.native.js +2 -2
- package/lib/Button/ButtonBase.js +2 -2
- package/lib/Button/ButtonGroup.js +1 -1
- package/lib/Checkbox/Checkbox.js +1 -1
- package/lib/Checkbox/CheckboxGroup.js +2 -2
- package/lib/Divider/Divider.js +2 -2
- package/lib/ExpandCollapse/Panel.js +2 -17
- package/lib/FlexGrid/Col/Col.js +1 -1
- package/lib/Icon/Icon.js +1 -1
- package/lib/List/List.js +8 -2
- package/lib/Pagination/PageButton.js +2 -2
- package/lib/Pagination/Pagination.js +5 -3
- package/lib/Pagination/usePagination.js +2 -2
- package/lib/Progress/ProgressBar.js +3 -3
- package/lib/Progress/ProgressBarBackground.js +3 -3
- package/lib/Radio/Radio.js +2 -2
- package/lib/Radio/RadioGroup.js +2 -2
- package/lib/RadioCard/RadioCard.js +1 -1
- package/lib/RadioCard/RadioCardGroup.js +2 -2
- package/lib/Search/Search.js +1 -1
- package/lib/SideNav/SideNav.js +2 -2
- package/lib/Skeleton/Skeleton.js +1 -1
- package/lib/Skeleton/skeletonWebAnimation.js +1 -1
- package/lib/StackView/StackWrap.js +3 -1
- package/lib/StackView/getStackedContent.js +2 -2
- package/lib/Tabs/Tabs.js +28 -3
- package/lib/Tabs/TabsItem.js +5 -6
- package/lib/Tags/Tags.js +1 -1
- package/lib/ThemeProvider/utils/styles.js +2 -2
- package/lib/ThemeProvider/utils/theme-tokens.js +7 -9
- package/lib/ToggleSwitch/ToggleSwitch.js +1 -1
- package/lib/ToggleSwitch/ToggleSwitchGroup.js +1 -1
- package/lib/Tooltip/Backdrop.js +2 -10
- package/lib/utils/animation/useVerticalExpandAnimation.js +40 -14
- package/lib/utils/children.js +2 -2
- package/lib/utils/input.js +6 -12
- package/lib/utils/props/componentPropType.js +3 -3
- package/lib/utils/props/selectSystemProps.js +2 -2
- package/lib/utils/props/tokens.js +2 -2
- package/lib/utils/useSpacingScale.js +3 -1
- package/lib/utils/useUniqueId.js +1 -1
- package/lib-module/A11yInfoProvider/index.js +63 -0
- package/lib-module/A11yText/index.js +56 -0
- package/lib-module/ActivityIndicator/Spinner.js +77 -0
- package/lib-module/ActivityIndicator/Spinner.native.js +144 -0
- package/lib-module/ActivityIndicator/index.js +41 -0
- package/lib-module/ActivityIndicator/shared.js +12 -0
- package/lib-module/BaseProvider/index.js +29 -0
- package/lib-module/Box/Box.js +244 -0
- package/lib-module/Box/index.js +2 -0
- package/lib-module/Button/Button.js +26 -0
- package/lib-module/Button/ButtonBase.js +271 -0
- package/lib-module/Button/ButtonGroup.js +247 -0
- package/lib-module/Button/ButtonLink.js +40 -0
- package/lib-module/Button/index.js +4 -0
- package/lib-module/Button/propTypes.js +36 -0
- package/lib-module/Card/Card.js +84 -0
- package/lib-module/Card/CardBase.js +66 -0
- package/lib-module/Card/PressableCardBase.js +114 -0
- package/lib-module/Card/index.js +4 -0
- package/lib-module/Checkbox/Checkbox.js +346 -0
- package/lib-module/Checkbox/CheckboxGroup.js +233 -0
- package/lib-module/Checkbox/CheckboxInput.js +60 -0
- package/lib-module/Checkbox/CheckboxInput.native.js +6 -0
- package/lib-module/Checkbox/index.js +3 -0
- package/lib-module/Divider/Divider.js +124 -0
- package/lib-module/Divider/index.js +2 -0
- package/lib-module/ExpandCollapse/Accordion.js +15 -0
- package/lib-module/ExpandCollapse/Control.js +136 -0
- package/lib-module/ExpandCollapse/ExpandCollapse.js +95 -0
- package/lib-module/ExpandCollapse/Panel.js +151 -0
- package/lib-module/ExpandCollapse/index.js +7 -0
- package/lib-module/Feedback/Feedback.js +157 -0
- package/lib-module/Feedback/index.js +2 -0
- package/lib-module/Fieldset/Fieldset.js +153 -0
- package/lib-module/Fieldset/FieldsetContainer.js +32 -0
- package/lib-module/Fieldset/FieldsetContainer.native.js +23 -0
- package/lib-module/Fieldset/Legend.js +24 -0
- package/lib-module/Fieldset/Legend.native.js +31 -0
- package/lib-module/Fieldset/cssReset.js +14 -0
- package/lib-module/Fieldset/index.js +2 -0
- package/lib-module/FlexGrid/Col/Col.js +276 -0
- package/lib-module/FlexGrid/Col/index.js +2 -0
- package/lib-module/FlexGrid/FlexGrid.js +148 -0
- package/lib-module/FlexGrid/Row/Row.js +184 -0
- package/lib-module/FlexGrid/Row/index.js +2 -0
- package/lib-module/FlexGrid/helpers/index.js +18 -0
- package/lib-module/FlexGrid/index.js +2 -0
- package/lib-module/FlexGrid/providers/GutterContext.js +3 -0
- package/lib-module/HorizontalScroll/HorizontalScroll.js +175 -0
- package/lib-module/HorizontalScroll/HorizontalScrollButton.js +81 -0
- package/lib-module/HorizontalScroll/ScrollViewEnd.js +48 -0
- package/lib-module/HorizontalScroll/ScrollViewEnd.native.js +27 -0
- package/lib-module/HorizontalScroll/dictionary.js +11 -0
- package/lib-module/HorizontalScroll/index.js +11 -0
- package/lib-module/HorizontalScroll/itemPositions.js +112 -0
- package/lib-module/Icon/Icon.js +62 -0
- package/lib-module/Icon/IconText.js +83 -0
- package/lib-module/Icon/index.js +4 -0
- package/lib-module/IconButton/IconButton.js +122 -0
- package/lib-module/IconButton/index.js +2 -0
- package/lib-module/InputLabel/InputLabel.js +148 -0
- package/lib-module/InputLabel/LabelContent.js +27 -0
- package/lib-module/InputLabel/LabelContent.native.js +19 -0
- package/lib-module/InputLabel/index.js +2 -0
- package/lib-module/InputSupports/InputSupports.js +96 -0
- package/lib-module/InputSupports/index.js +2 -0
- package/lib-module/InputSupports/useInputSupports.js +32 -0
- package/lib-module/Link/ChevronLink.js +52 -0
- package/lib-module/Link/InlinePressable.js +40 -0
- package/lib-module/Link/InlinePressable.native.js +89 -0
- package/lib-module/Link/Link.js +28 -0
- package/lib-module/Link/LinkBase.js +240 -0
- package/lib-module/Link/TextButton.js +35 -0
- package/lib-module/Link/index.js +5 -0
- package/lib-module/List/List.js +62 -0
- package/lib-module/List/ListItem.js +248 -0
- package/lib-module/List/index.js +5 -0
- package/lib-module/Modal/Modal.js +222 -0
- package/lib-module/Modal/dictionary.js +9 -0
- package/lib-module/Modal/index.js +2 -0
- package/lib-module/Notification/Notification.js +209 -0
- package/lib-module/Notification/dictionary.js +8 -0
- package/lib-module/Notification/index.js +2 -0
- package/lib-module/Pagination/PageButton.js +66 -0
- package/lib-module/Pagination/Pagination.js +153 -0
- package/lib-module/Pagination/SideButton.js +106 -0
- package/lib-module/Pagination/dictionary.js +18 -0
- package/lib-module/Pagination/index.js +2 -0
- package/lib-module/Pagination/usePagination.js +73 -0
- package/lib-module/Progress/Progress.js +89 -0
- package/lib-module/Progress/ProgressBar.js +138 -0
- package/lib-module/Progress/ProgressBarBackground.js +42 -0
- package/lib-module/Progress/index.js +4 -0
- package/lib-module/Radio/Radio.js +285 -0
- package/lib-module/Radio/RadioButton.js +138 -0
- package/lib-module/Radio/RadioGroup.js +243 -0
- package/lib-module/Radio/RadioInput.js +62 -0
- package/lib-module/Radio/RadioInput.native.js +6 -0
- package/lib-module/Radio/index.js +3 -0
- package/lib-module/RadioCard/RadioCard.js +219 -0
- package/lib-module/RadioCard/RadioCardGroup.js +250 -0
- package/lib-module/RadioCard/index.js +3 -0
- package/lib-module/Search/Search.js +261 -0
- package/lib-module/Search/dictionary.js +12 -0
- package/lib-module/Search/index.js +2 -0
- package/lib-module/Select/Group.js +21 -0
- package/lib-module/Select/Group.native.js +15 -0
- package/lib-module/Select/Item.js +20 -0
- package/lib-module/Select/Item.native.js +3 -0
- package/lib-module/Select/Picker.js +68 -0
- package/lib-module/Select/Picker.native.js +120 -0
- package/lib-module/Select/Select.js +337 -0
- package/lib-module/Select/index.js +6 -0
- package/lib-module/SideNav/Item.js +145 -0
- package/lib-module/SideNav/ItemContent.js +48 -0
- package/lib-module/SideNav/ItemsGroup.js +117 -0
- package/lib-module/SideNav/SideNav.js +136 -0
- package/lib-module/SideNav/index.js +1 -0
- package/lib-module/Skeleton/Skeleton.js +179 -0
- package/lib-module/Skeleton/index.js +2 -0
- package/lib-module/Skeleton/skeleton.constant.js +3 -0
- package/lib-module/Skeleton/skeletonWebAnimation.js +18 -0
- package/lib-module/Skeleton/useSkeletonNativeAnimation.js +24 -0
- package/lib-module/Spacer/Spacer.js +98 -0
- package/lib-module/Spacer/index.js +2 -0
- package/lib-module/StackView/StackView.js +125 -0
- package/lib-module/StackView/StackWrap.js +50 -0
- package/lib-module/StackView/StackWrap.native.js +3 -0
- package/lib-module/StackView/StackWrapBox.js +115 -0
- package/lib-module/StackView/StackWrapGap.js +59 -0
- package/lib-module/StackView/common.js +35 -0
- package/lib-module/StackView/getStackedContent.js +124 -0
- package/lib-module/StackView/index.js +5 -0
- package/lib-module/StepTracker/Step.js +248 -0
- package/lib-module/StepTracker/StepTracker.js +185 -0
- package/lib-module/StepTracker/dictionary.js +10 -0
- package/lib-module/StepTracker/index.js +2 -0
- package/lib-module/Tabs/Tabs.js +143 -0
- package/lib-module/Tabs/TabsItem.js +224 -0
- package/lib-module/Tabs/index.js +2 -0
- package/lib-module/Tags/Tags.js +251 -0
- package/lib-module/Tags/index.js +2 -0
- package/lib-module/TextInput/TextArea.js +94 -0
- package/lib-module/TextInput/TextInput.js +72 -0
- package/lib-module/TextInput/TextInputBase.js +245 -0
- package/lib-module/TextInput/index.js +3 -0
- package/lib-module/TextInput/propTypes.js +37 -0
- package/lib-module/ThemeProvider/ThemeProvider.js +36 -0
- package/lib-module/ThemeProvider/index.js +6 -0
- package/lib-module/ThemeProvider/useSetTheme.js +25 -0
- package/lib-module/ThemeProvider/useTheme.js +14 -0
- package/lib-module/ThemeProvider/useThemeTokens.js +110 -0
- package/lib-module/ThemeProvider/utils/index.js +2 -0
- package/lib-module/ThemeProvider/utils/styles.js +181 -0
- package/lib-module/ThemeProvider/utils/theme-tokens.js +163 -0
- package/lib-module/ToggleSwitch/ToggleSwitch.js +250 -0
- package/lib-module/ToggleSwitch/ToggleSwitchGroup.js +220 -0
- package/lib-module/ToggleSwitch/index.js +3 -0
- package/lib-module/Tooltip/Backdrop.js +45 -0
- package/lib-module/Tooltip/Backdrop.native.js +44 -0
- package/lib-module/Tooltip/Tooltip.js +348 -0
- package/lib-module/Tooltip/dictionary.js +8 -0
- package/lib-module/Tooltip/getTooltipPosition.js +175 -0
- package/lib-module/Tooltip/index.js +2 -0
- package/lib-module/TooltipButton/TooltipButton.js +78 -0
- package/lib-module/TooltipButton/index.js +2 -0
- package/lib-module/Typography/Typography.js +124 -0
- package/lib-module/Typography/index.js +2 -0
- package/lib-module/ViewportProvider/ViewportProvider.js +29 -0
- package/lib-module/ViewportProvider/index.js +3 -0
- package/lib-module/ViewportProvider/useViewport.js +3 -0
- package/lib-module/ViewportProvider/useViewportListener.js +46 -0
- package/lib-module/index.js +48 -0
- package/lib-module/utils/a11y/index.js +2 -0
- package/lib-module/utils/a11y/semantics.js +157 -0
- package/lib-module/utils/a11y/textSize.js +36 -0
- package/lib-module/utils/animation/index.js +2 -0
- package/lib-module/utils/animation/useVerticalExpandAnimation.js +88 -0
- package/lib-module/utils/children.js +119 -0
- package/lib-module/utils/containUniqueFields.js +26 -0
- package/lib-module/utils/index.js +16 -0
- package/lib-module/utils/info/index.js +7 -0
- package/lib-module/utils/info/platform/index.js +11 -0
- package/lib-module/utils/info/platform/platform.android.js +1 -0
- package/lib-module/utils/info/platform/platform.ios.js +1 -0
- package/lib-module/utils/info/platform/platform.js +1 -0
- package/lib-module/utils/info/platform/platform.native.js +4 -0
- package/lib-module/utils/info/versions.js +5 -0
- package/lib-module/utils/input.js +179 -0
- package/lib-module/utils/pressability.js +111 -0
- package/lib-module/utils/props/a11yProps.js +140 -0
- package/lib-module/utils/props/clickProps.js +26 -0
- package/lib-module/utils/props/componentPropType.js +63 -0
- package/lib-module/utils/props/copyPropTypes.js +2 -0
- package/lib-module/utils/props/getPropSelector.js +9 -0
- package/lib-module/utils/props/handlerProps.js +65 -0
- package/lib-module/utils/props/hrefAttrsProp.js +33 -0
- package/lib-module/utils/props/index.js +19 -0
- package/lib-module/utils/props/inputSupportsProps.js +62 -0
- package/lib-module/utils/props/linkProps.js +44 -0
- package/lib-module/utils/props/paddingProp.js +9 -0
- package/lib-module/utils/props/pressProps.js +42 -0
- package/lib-module/utils/props/rectProp.js +9 -0
- package/lib-module/utils/props/responsiveProps.js +30 -0
- package/lib-module/utils/props/selectSystemProps.js +24 -0
- package/lib-module/utils/props/spacingProps.js +56 -0
- package/lib-module/utils/props/textInputProps.js +194 -0
- package/lib-module/utils/props/textProps.js +59 -0
- package/lib-module/utils/props/tokens.js +133 -0
- package/lib-module/utils/props/variantProp.js +18 -0
- package/lib-module/utils/props/viewProps.js +22 -0
- package/lib-module/utils/ssr.js +38 -0
- package/lib-module/utils/useCopy.js +44 -0
- package/lib-module/utils/useHash.js +45 -0
- package/lib-module/utils/useHash.native.js +7 -0
- package/lib-module/utils/useResponsiveProp.js +47 -0
- package/lib-module/utils/useSpacingScale.js +125 -0
- package/lib-module/utils/useUniqueId.js +13 -0
- package/lib-module/utils/withLinkRouter.js +83 -0
- package/package.json +2 -2
- package/src/ExpandCollapse/Panel.jsx +2 -19
- package/src/List/List.jsx +6 -2
- package/src/Tabs/Tabs.jsx +24 -2
- package/src/Tabs/TabsItem.jsx +6 -5
- package/src/utils/animation/useVerticalExpandAnimation.js +47 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,24 @@
|
|
|
1
1
|
# Change Log - @telus-uds/components-base
|
|
2
2
|
|
|
3
|
-
This log was last generated on Wed,
|
|
3
|
+
This log was last generated on Wed, 22 Jun 2022 15:03:03 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 1.8.4
|
|
8
|
+
|
|
9
|
+
Wed, 22 Jun 2022 15:03:03 GMT
|
|
10
|
+
|
|
11
|
+
### Patches
|
|
12
|
+
|
|
13
|
+
- fix published lib-modules (cody.zuschlag@nearform.com)
|
|
14
|
+
- don't override List.Item props with less-specific List props (alan.slater@nearform.com)
|
|
15
|
+
- better tabs roles for tablist/navigation usage (simon.lawrence@nearform.com)
|
|
16
|
+
- better ExpandCollapse style timing (alan.slater@nearform.com)
|
|
17
|
+
- Bump @telus-uds/browserslist-config to v1.0.4
|
|
18
|
+
|
|
7
19
|
## 1.8.3
|
|
8
20
|
|
|
9
|
-
Wed, 15 Jun 2022 19:23:
|
|
21
|
+
Wed, 15 Jun 2022 19:23:57 GMT
|
|
10
22
|
|
|
11
23
|
### Patches
|
|
12
24
|
|
package/component-docs.json
CHANGED
|
@@ -7043,7 +7043,7 @@
|
|
|
7043
7043
|
},
|
|
7044
7044
|
"Tabs": {
|
|
7045
7045
|
"docs": {
|
|
7046
|
-
"description": "Tabs renders a horizontally-scrolling menu of selectable buttons which may link\nto a page or control what content is displayed on this page.",
|
|
7046
|
+
"description": "Tabs renders a horizontally-scrolling menu of selectable buttons which may link\nto a page or control what content is displayed on this page.\n\nIf you are using Tabs to navigate to a new page (web-only) you should pass\n`navigation`as the `accessibilityRole` to te Tabs component, this will cause\nTabItems to default to a role of link and obtain aria-current behaviour.",
|
|
7047
7047
|
"props": {
|
|
7048
7048
|
"items": {
|
|
7049
7049
|
"defaultValue": {
|
|
@@ -23,14 +23,14 @@ const MIN_SVG_LENGTH = _shared.MIN_STROKE_ANGLE / 360 * SVG_CIRCUMFERENCE;
|
|
|
23
23
|
const MAX_SVG_LENGTH = (1 - _shared.MIN_EMPTY_ANGLE / 360) * SVG_CIRCUMFERENCE;
|
|
24
24
|
const animationProps = {
|
|
25
25
|
begin: '0s',
|
|
26
|
-
dur:
|
|
26
|
+
dur: "".concat(_shared.DURATION, "ms"),
|
|
27
27
|
fill: 'freeze',
|
|
28
28
|
repeatCount: 'indefinite'
|
|
29
29
|
};
|
|
30
30
|
const bezierProps = {
|
|
31
31
|
calcMode: 'spline',
|
|
32
32
|
keyTimes: '0; 0.5; 1',
|
|
33
|
-
keySplines:
|
|
33
|
+
keySplines: "".concat(_shared.BEZIER.join(', '), " ; ").concat(_shared.BEZIER.join(', '))
|
|
34
34
|
}; // We're using svg rather than css here to define the animation to avoid needing to introduce css injection mechanism
|
|
35
35
|
// It's possible to replicate this functionality with RNW animations, but it snags on chrome at least, see https://github.com/telus/universal-design-system/pull/477 for details.
|
|
36
36
|
|
|
@@ -46,8 +46,8 @@ const Spinner = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
46
46
|
} = (0, _A11yInfoProvider.useA11yInfo)();
|
|
47
47
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("svg", {
|
|
48
48
|
ref: ref,
|
|
49
|
-
width:
|
|
50
|
-
height:
|
|
49
|
+
width: "".concat(size, "px"),
|
|
50
|
+
height: "".concat(size, "px"),
|
|
51
51
|
viewBox: "0 0 48 48",
|
|
52
52
|
"aria-valuetext": label,
|
|
53
53
|
role: "progressbar",
|
|
@@ -56,7 +56,7 @@ const Spinner = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
56
56
|
children: [reduceMotionEnabled ? null : /*#__PURE__*/(0, _jsxRuntime.jsx)("animateTransform", {
|
|
57
57
|
attributeName: "transform",
|
|
58
58
|
type: "rotate",
|
|
59
|
-
values:
|
|
59
|
+
values: "-180 24 24;".concat(360 + _shared.MIN_STROKE_ANGLE - 180, " 24 24"),
|
|
60
60
|
...animationProps
|
|
61
61
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("circle", {
|
|
62
62
|
fill: "none",
|
|
@@ -71,12 +71,12 @@ const Spinner = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
71
71
|
children: reduceMotionEnabled ? null : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
72
72
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("animate", {
|
|
73
73
|
attributeName: "stroke-dashoffset",
|
|
74
|
-
values:
|
|
74
|
+
values: "0;-10;".concat(MIN_SVG_LENGTH - SVG_CIRCUMFERENCE),
|
|
75
75
|
...animationProps,
|
|
76
76
|
...bezierProps
|
|
77
77
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("animate", {
|
|
78
78
|
attributeName: "stroke-dasharray",
|
|
79
|
-
values:
|
|
79
|
+
values: "".concat(MIN_SVG_LENGTH, ", 200;").concat(MAX_SVG_LENGTH, ", 200;").concat(MIN_SVG_LENGTH, ", 200"),
|
|
80
80
|
...animationProps,
|
|
81
81
|
...bezierProps
|
|
82
82
|
})]
|
|
@@ -95,7 +95,7 @@ const Spinner = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
const direction = index ? -1 : +1;
|
|
98
|
-
return
|
|
98
|
+
return "".concat(direction * (180 - (sa + ea)) * easing(progress) + rotation, "deg");
|
|
99
99
|
});
|
|
100
100
|
const layerStyle = {
|
|
101
101
|
width: size,
|
|
@@ -110,7 +110,7 @@ const Spinner = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
110
110
|
layerStyle.transform = [{
|
|
111
111
|
rotate: timer.interpolate({
|
|
112
112
|
inputRange: [0, 1],
|
|
113
|
-
outputRange: [
|
|
113
|
+
outputRange: ["".concat(0 + ea + sa, "deg"), "".concat(2 * 360 + ea + sa, "deg")]
|
|
114
114
|
})
|
|
115
115
|
}];
|
|
116
116
|
viewportStyle.transform = [{
|
package/lib/Button/ButtonBase.js
CHANGED
|
@@ -98,7 +98,7 @@ const selectOuterWidthStyles = _ref3 => {
|
|
|
98
98
|
|
|
99
99
|
|
|
100
100
|
if (_Platform.default.OS === 'web') {
|
|
101
|
-
widthStyles.width =
|
|
101
|
+
widthStyles.width = "calc(".concat(width, " + ").concat(outerBorderOffset * 2, "px)");
|
|
102
102
|
return widthStyles;
|
|
103
103
|
} // Can't use calc() on native but (unlike on web) flexGrow fills the container width here
|
|
104
104
|
|
|
@@ -180,7 +180,7 @@ const selectWebOnlyStyles = (inactive, themeTokens, _ref7) => {
|
|
|
180
180
|
return _Platform.default.select({
|
|
181
181
|
web: {
|
|
182
182
|
// if it would overflow the container, wraps instead
|
|
183
|
-
maxWidth:
|
|
183
|
+
maxWidth: "calc(100% + ".concat(getOuterBorderOffset(themeTokens) * 2, "px)"),
|
|
184
184
|
outline: 'none',
|
|
185
185
|
// removes the default browser :focus outline
|
|
186
186
|
...(0, _utils2.getCursorStyle)(inactive, accessibilityRole)
|
|
@@ -91,7 +91,7 @@ const ButtonGroup = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
91
91
|
const uniqueFields = ['id', 'label'];
|
|
92
92
|
|
|
93
93
|
if (!(0, _utils.containUniqueFields)(items, uniqueFields)) {
|
|
94
|
-
throw new Error(
|
|
94
|
+
throw new Error("ButtonGroup items must have unique ".concat(uniqueFields.join(', ')));
|
|
95
95
|
} // Some web screenreaders e.g. MacOS Voiceover don't handle radiogroups properly unless radio is direct child of radiogroup
|
|
96
96
|
|
|
97
97
|
|
package/lib/Checkbox/Checkbox.js
CHANGED
|
@@ -214,7 +214,7 @@ const Checkbox = /*#__PURE__*/(0, _react.forwardRef)((_ref5, ref) => {
|
|
|
214
214
|
};
|
|
215
215
|
|
|
216
216
|
const uniqueId = (0, _useUniqueId.default)('checkbox');
|
|
217
|
-
const inputId = id
|
|
217
|
+
const inputId = id !== null && id !== void 0 ? id : uniqueId;
|
|
218
218
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
219
219
|
style: staticStyles.wrapper,
|
|
220
220
|
ref: ref,
|
|
@@ -119,7 +119,7 @@ const CheckboxGroup = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
119
119
|
const uniqueFields = ['id', 'label'];
|
|
120
120
|
|
|
121
121
|
if (!(0, _utils.containUniqueFields)(items, uniqueFields)) {
|
|
122
|
-
throw new Error(
|
|
122
|
+
throw new Error("CheckboxGroup items must have unique ".concat(uniqueFields.join(', ')));
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
const checkboxes = items.map((_ref2, index) => {
|
|
@@ -130,7 +130,7 @@ const CheckboxGroup = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
130
130
|
ref: itemRef,
|
|
131
131
|
...itemRest
|
|
132
132
|
} = _ref2;
|
|
133
|
-
const checkboxId = id ||
|
|
133
|
+
const checkboxId = id || "Checkbox[".concat(index, "]");
|
|
134
134
|
|
|
135
135
|
const handleChange = (newCheckedState, event) => {
|
|
136
136
|
if (typeof itemOnChange === 'function') itemOnChange(newCheckedState, event);
|
package/lib/Divider/Divider.js
CHANGED
|
@@ -116,9 +116,9 @@ const Divider = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
116
116
|
};
|
|
117
117
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
118
118
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Spacer.default, { ...spacerProps,
|
|
119
|
-
testID: testID ?
|
|
119
|
+
testID: testID ? "".concat(testID, "-Spacer-before") : undefined
|
|
120
120
|
}), divider, /*#__PURE__*/(0, _jsxRuntime.jsx)(_Spacer.default, { ...spacerProps,
|
|
121
|
-
testID: testID ?
|
|
121
|
+
testID: testID ? "".concat(testID, "-Spacer-after") : undefined
|
|
122
122
|
})]
|
|
123
123
|
});
|
|
124
124
|
});
|
|
@@ -11,8 +11,6 @@ var _Animated = _interopRequireDefault(require("react-native-web/dist/cjs/export
|
|
|
11
11
|
|
|
12
12
|
var _Platform = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Platform"));
|
|
13
13
|
|
|
14
|
-
var _StyleSheet = _interopRequireDefault(require("react-native-web/dist/cjs/exports/StyleSheet"));
|
|
15
|
-
|
|
16
14
|
var _View = _interopRequireDefault(require("react-native-web/dist/cjs/exports/View"));
|
|
17
15
|
|
|
18
16
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
@@ -105,13 +103,7 @@ const ExpandCollapsePanel = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
|
|
|
105
103
|
containerHeight,
|
|
106
104
|
isExpanded,
|
|
107
105
|
tokens: themeTokens
|
|
108
|
-
});
|
|
109
|
-
// this won't work on native platforms
|
|
110
|
-
|
|
111
|
-
const overflowContainerStyles = containerHeight === null && _Platform.default.OS === 'web' ? {
|
|
112
|
-
height: 0,
|
|
113
|
-
visibility: 'hidden'
|
|
114
|
-
} : undefined;
|
|
106
|
+
});
|
|
115
107
|
const focusabilityProps = isExpanded ? {} : _utils.a11yProps.nonFocusableProps;
|
|
116
108
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, {
|
|
117
109
|
ref: ref,
|
|
@@ -123,7 +115,7 @@ const ExpandCollapsePanel = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
|
|
|
123
115
|
children: control
|
|
124
116
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Animated.default.View, {
|
|
125
117
|
ref: animatedRef,
|
|
126
|
-
style:
|
|
118
|
+
style: animatedStyles,
|
|
127
119
|
...focusabilityProps,
|
|
128
120
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
129
121
|
onLayout: onContainerLayout,
|
|
@@ -177,12 +169,5 @@ ExpandCollapsePanel.propTypes = { ...selectedSystemPropTypes,
|
|
|
177
169
|
*/
|
|
178
170
|
controlTokens: (0, _utils.getTokensPropType)('ExpandCollapseControl')
|
|
179
171
|
};
|
|
180
|
-
|
|
181
|
-
const staticStyles = _StyleSheet.default.create({
|
|
182
|
-
itemsContainer: {
|
|
183
|
-
overflow: 'hidden'
|
|
184
|
-
}
|
|
185
|
-
});
|
|
186
|
-
|
|
187
172
|
var _default = ExpandCollapsePanel;
|
|
188
173
|
exports.default = _default;
|
package/lib/FlexGrid/Col/Col.js
CHANGED
|
@@ -69,7 +69,7 @@ const Col = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
69
69
|
const horizontalAlignLevel = getHorizontalAlignLevel();
|
|
70
70
|
|
|
71
71
|
const toPercent = num => {
|
|
72
|
-
return
|
|
72
|
+
return "".concat(num / 12 * 100, "%");
|
|
73
73
|
};
|
|
74
74
|
|
|
75
75
|
const calculateWidth = value => {
|
package/lib/Icon/Icon.js
CHANGED
|
@@ -48,7 +48,7 @@ const Icon = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
48
48
|
// TODO: systematise animations.
|
|
49
49
|
// https://github.com/telus/universal-design-system/issues/487
|
|
50
50
|
transition: 'transform 200ms, color 200ms',
|
|
51
|
-
transform: [themeTokens.scale ?
|
|
51
|
+
transform: [themeTokens.scale ? "scale(".concat(themeTokens.scale, ")") : '', themeTokens.translateX ? "translateX(".concat(themeTokens.translateX, "px)") : '', themeTokens.translateY ? "translateY(".concat(themeTokens.translateY, "px)") : ''].filter(exists => exists).join(' ')
|
|
52
52
|
},
|
|
53
53
|
dataSet: dataSet,
|
|
54
54
|
children: iconContent
|
package/lib/List/List.js
CHANGED
|
@@ -45,12 +45,18 @@ const List = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
45
45
|
} = _ref;
|
|
46
46
|
|
|
47
47
|
const items = _react.Children.map(children, (child, index) => {
|
|
48
|
-
|
|
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)) {
|
|
49
54
|
return /*#__PURE__*/(0, _react.cloneElement)(child, {
|
|
50
55
|
showDivider,
|
|
51
56
|
isLastItem: index + 1 === _react.Children.count(children),
|
|
52
57
|
tokens,
|
|
53
|
-
variant
|
|
58
|
+
variant,
|
|
59
|
+
...child.props
|
|
54
60
|
});
|
|
55
61
|
}
|
|
56
62
|
|
|
@@ -54,8 +54,8 @@ const PageButton = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
54
54
|
key: 'active-item'
|
|
55
55
|
} : {};
|
|
56
56
|
const accessibilityRole = href !== undefined ? 'link' : 'button';
|
|
57
|
-
const activeLabel = isActive ?
|
|
58
|
-
const accessibilityLabel =
|
|
57
|
+
const activeLabel = isActive ? " ".concat(getCopy('currentLabel')) : '';
|
|
58
|
+
const accessibilityLabel = "".concat(getCopy('goToLabel'), " ").concat(label).concat(activeLabel);
|
|
59
59
|
|
|
60
60
|
const {
|
|
61
61
|
hrefAttrs,
|
|
@@ -106,9 +106,11 @@ const Pagination = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
|
|
|
106
106
|
LinkRouter: LinkRouter,
|
|
107
107
|
linkRouterProps: linkRouterProps
|
|
108
108
|
}), ...items.map((_child, itemIndex) => {
|
|
109
|
-
|
|
109
|
+
var _itemProps$LinkRouter;
|
|
110
|
+
|
|
111
|
+
const buttonLabel = "".concat(itemIndex + 1);
|
|
110
112
|
const itemProps = getItemProps(itemIndex);
|
|
111
|
-
const ItemLinkRouter = itemProps.LinkRouter
|
|
113
|
+
const ItemLinkRouter = (_itemProps$LinkRouter = itemProps.LinkRouter) !== null && _itemProps$LinkRouter !== void 0 ? _itemProps$LinkRouter : LinkRouter;
|
|
112
114
|
const itemLinkRouterProps = { ...linkRouterProps,
|
|
113
115
|
...itemProps.linkRouterProps
|
|
114
116
|
};
|
|
@@ -144,7 +146,7 @@ const Pagination = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
|
|
|
144
146
|
ref: ref,
|
|
145
147
|
...selectProps(rest),
|
|
146
148
|
children: buttons // keep the keys in-line with the page numbers regardless of which buttons are actually rendered
|
|
147
|
-
.map((element, index) => [element,
|
|
149
|
+
.map((element, index) => [element, "page-".concat(index + 1)]).filter(_ref3 => {
|
|
148
150
|
let [element] = _ref3;
|
|
149
151
|
return element !== null;
|
|
150
152
|
}).map(_ref4 => {
|
|
@@ -21,7 +21,7 @@ function usePagination(_ref) {
|
|
|
21
21
|
);
|
|
22
22
|
|
|
23
23
|
const getItemProps = index => {
|
|
24
|
-
var _items$index;
|
|
24
|
+
var _items$index$props, _items$index;
|
|
25
25
|
|
|
26
26
|
const {
|
|
27
27
|
onPress,
|
|
@@ -29,7 +29,7 @@ function usePagination(_ref) {
|
|
|
29
29
|
hrefAttrs,
|
|
30
30
|
variant,
|
|
31
31
|
tokens
|
|
32
|
-
} = ((_items$index = items[index]) === null || _items$index === void 0 ? void 0 : _items$index.props)
|
|
32
|
+
} = (_items$index$props = (_items$index = items[index]) === null || _items$index === void 0 ? void 0 : _items$index.props) !== null && _items$index$props !== void 0 ? _items$index$props : {};
|
|
33
33
|
return {
|
|
34
34
|
onPress,
|
|
35
35
|
href,
|
|
@@ -43,7 +43,7 @@ const selectBarStyles = (_ref, percentage) => {
|
|
|
43
43
|
borderRadius,
|
|
44
44
|
outlineWidth,
|
|
45
45
|
outlineColor,
|
|
46
|
-
width:
|
|
46
|
+
width: "".concat(percentage, "%")
|
|
47
47
|
};
|
|
48
48
|
};
|
|
49
49
|
/**
|
|
@@ -104,7 +104,7 @@ const ProgressBar = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
|
|
|
104
104
|
min: 0,
|
|
105
105
|
max: 100,
|
|
106
106
|
now: percentage,
|
|
107
|
-
text:
|
|
107
|
+
text: "".concat(percentage, "%")
|
|
108
108
|
},
|
|
109
109
|
...rest
|
|
110
110
|
});
|
|
@@ -112,7 +112,7 @@ const ProgressBar = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
|
|
|
112
112
|
ref: ref,
|
|
113
113
|
style: [staticStyles.bar, selectBarStyles(themeTokens, percentage)],
|
|
114
114
|
...selectedProps,
|
|
115
|
-
children: children
|
|
115
|
+
children: children !== null && children !== void 0 ? children : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBarBackground.default, {
|
|
116
116
|
variant: variant
|
|
117
117
|
})
|
|
118
118
|
}) : null;
|
|
@@ -21,8 +21,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
21
21
|
|
|
22
22
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
23
|
|
|
24
|
-
const inactiveBackground =
|
|
25
|
-
const negativeBackground =
|
|
24
|
+
const inactiveBackground = "%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='24'%3E%3Cdefs%3E%3Cpattern id='DisabledProgress7' patternUnits='userSpaceOnUse' width='8' height='8'%3E%3Crect width='8' height='8' fill='%23B2B9BF'%3E%3C/rect%3E%3Ccircle cx='4' cy='4' r='2' fill='%23676E73' stroke='%23676E73' stroke-width='0'%3E%3C/circle%3E%3Ccircle cx='0' cy='0' r='2' fill='%23676E73' stroke='%23676E73' stroke-width='0'%3E%3C/circle%3E%3Ccircle cx='0' cy='8' r='2' fill='%23676E73' stroke='%23676E73' stroke-width='0'%3E%3C/circle%3E%3Ccircle cx='8' cy='0' r='2' fill='%23676E73' stroke='%23676E73' stroke-width='0'%3E%3C/circle%3E%3Ccircle cx='8' cy='8' r='2' fill='%23676E73' stroke='%23676E73' stroke-width='0'%3E%3C/circle%3E%3C/pattern%3E%3C/defs%3E%3Cpath d='M 0 0 L 0 140 L 2000 2000 L 2000 0 Z' style='fill: url("%23DisabledProgress7");'%3E%3C/path%3E%3C/svg%3E";
|
|
25
|
+
const negativeBackground = "%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='24'%3E%3Cdefs%3E%3Cpattern id='NegativeProgress6' patternUnits='userSpaceOnUse' width='8' height='8'%3E%3Crect width='8' height='8' fill='%23C12335'%3E%3C/rect%3E%3Cpath d='M 0,8 l 8,-8 M -2,2 l 4,-4 M 6,10 l 4,-4' stroke-width='2' shape-rendering='auto' stroke='%23e7adb4' stroke-linecap='square'%3E%3C/path%3E%3C/pattern%3E%3C/defs%3E%3Cpath d='M 0 0 L 0 140 L 2000 2000 L 2000 0 Z' style='fill: url("%23NegativeProgress6");'%3E%3C/path%3E%3C/svg%3E";
|
|
26
26
|
const ProgressBarBackground = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
27
27
|
let {
|
|
28
28
|
variant
|
|
@@ -40,7 +40,7 @@ const ProgressBarBackground = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) =>
|
|
|
40
40
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ImageBackground.default, {
|
|
41
41
|
ref: ref,
|
|
42
42
|
source: {
|
|
43
|
-
uri:
|
|
43
|
+
uri: "data:image/svg+xml,".concat(source)
|
|
44
44
|
},
|
|
45
45
|
style: staticStyles.imageBackground
|
|
46
46
|
});
|
package/lib/Radio/Radio.js
CHANGED
|
@@ -70,7 +70,7 @@ const selectDescriptionStyles = _ref2 => {
|
|
|
70
70
|
labelMarginLeft = 0
|
|
71
71
|
} = _ref2;
|
|
72
72
|
return {
|
|
73
|
-
marginLeft: descriptionMarginLeft
|
|
73
|
+
marginLeft: descriptionMarginLeft !== null && descriptionMarginLeft !== void 0 ? descriptionMarginLeft : containerPaddingLeft + inputSize + labelMarginLeft,
|
|
74
74
|
...(0, _ThemeProvider.applyTextStyles)({
|
|
75
75
|
fontSize: descriptionFontSize,
|
|
76
76
|
lineHeight: descriptionLineHeight
|
|
@@ -174,7 +174,7 @@ const Radio = /*#__PURE__*/(0, _react.forwardRef)((_ref4, ref) => {
|
|
|
174
174
|
};
|
|
175
175
|
|
|
176
176
|
const uniqueId = (0, _utils.useUniqueId)('radio');
|
|
177
|
-
const inputId = id
|
|
177
|
+
const inputId = id !== null && id !== void 0 ? id : uniqueId;
|
|
178
178
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Pressable.default, {
|
|
179
179
|
ref: ref,
|
|
180
180
|
disabled: inactive,
|
package/lib/Radio/RadioGroup.js
CHANGED
|
@@ -121,7 +121,7 @@ const RadioGroup = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
121
121
|
const uniqueFields = ['id', 'label'];
|
|
122
122
|
|
|
123
123
|
if (!(0, _utils.containUniqueFields)(items, uniqueFields)) {
|
|
124
|
-
throw new Error(
|
|
124
|
+
throw new Error("RadioGroup items must have unique ".concat(uniqueFields.join(', ')));
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
const radios = items.map((_ref2, index) => {
|
|
@@ -132,7 +132,7 @@ const RadioGroup = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
132
132
|
ref: itemRef,
|
|
133
133
|
...itemRest
|
|
134
134
|
} = _ref2;
|
|
135
|
-
const radioId = id ||
|
|
135
|
+
const radioId = id || "Radio[".concat(index, "]");
|
|
136
136
|
const isChecked = currentValue === radioId;
|
|
137
137
|
|
|
138
138
|
const handleChange = (newCheckedState, event) => {
|
|
@@ -102,7 +102,7 @@ const RadioCard = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
102
102
|
};
|
|
103
103
|
|
|
104
104
|
const uniqueId = (0, _utils.useUniqueId)('RadioCard');
|
|
105
|
-
const inputId = id
|
|
105
|
+
const inputId = id !== null && id !== void 0 ? id : uniqueId;
|
|
106
106
|
const getTokens = (0, _ThemeProvider.useThemeTokensCallback)('RadioCard', tokens, variant);
|
|
107
107
|
|
|
108
108
|
const getCardTokens = cardState => (0, _Card.selectPressableCardTokens)(getTokens(cardState));
|
|
@@ -126,7 +126,7 @@ const RadioCardGroup = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
126
126
|
const uniqueFields = ['id'];
|
|
127
127
|
|
|
128
128
|
if (!(0, _utils.containUniqueFields)(items, uniqueFields)) {
|
|
129
|
-
throw new Error(
|
|
129
|
+
throw new Error("RadioCardGroup items must have unique ".concat(uniqueFields.join(', ')));
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Fieldset.default, {
|
|
@@ -153,7 +153,7 @@ const RadioCardGroup = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
153
153
|
onChange: itemOnChange,
|
|
154
154
|
...itemRest
|
|
155
155
|
} = _ref2;
|
|
156
|
-
const cardId = id ||
|
|
156
|
+
const cardId = id || "RadioCard[".concat(index, "]");
|
|
157
157
|
|
|
158
158
|
const handleChange = (newCheckedState, event) => {
|
|
159
159
|
if (typeof itemOnChange === 'function') itemOnChange(newCheckedState, event);
|
package/lib/Search/Search.js
CHANGED
|
@@ -158,7 +158,7 @@ const Search = /*#__PURE__*/(0, _react.forwardRef)((_ref4, ref) => {
|
|
|
158
158
|
|
|
159
159
|
const a11yLabelText = accessibilityLabel || getCopy('accessibilityLabel'); // Placeholder is optional and may be unset by passing an empty string
|
|
160
160
|
|
|
161
|
-
const placeholderText = placeholder
|
|
161
|
+
const placeholderText = placeholder !== null && placeholder !== void 0 ? placeholder : a11yLabelText;
|
|
162
162
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, {
|
|
163
163
|
style: staticStyles.container,
|
|
164
164
|
...selectContainerProps(rest),
|
package/lib/SideNav/SideNav.js
CHANGED
|
@@ -82,7 +82,7 @@ const SideNav = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
82
82
|
|
|
83
83
|
const renderItem = (item, index, groupId) => {
|
|
84
84
|
const {
|
|
85
|
-
itemId =
|
|
85
|
+
itemId = "item-".concat(index),
|
|
86
86
|
onPress
|
|
87
87
|
} = item.props;
|
|
88
88
|
|
|
@@ -110,7 +110,7 @@ const SideNav = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
110
110
|
|
|
111
111
|
if (child.type === _ItemsGroup.default) {
|
|
112
112
|
const {
|
|
113
|
-
groupId =
|
|
113
|
+
groupId = "group-".concat(index)
|
|
114
114
|
} = child.props;
|
|
115
115
|
const isGroupActive = active.itemId !== undefined && active.groupId === groupId;
|
|
116
116
|
|
package/lib/Skeleton/Skeleton.js
CHANGED
|
@@ -144,7 +144,7 @@ const Skeleton = /*#__PURE__*/(0, _react.forwardRef)((_ref5, ref) => {
|
|
|
144
144
|
style: [selectSkeletonStyles({ ...themeTokens,
|
|
145
145
|
fadeAnimation: getAnimationBaseOnPlatform()
|
|
146
146
|
}), getStyledBasedOnShape()]
|
|
147
|
-
},
|
|
147
|
+
}, "skeleton-".concat(index + 1));
|
|
148
148
|
};
|
|
149
149
|
|
|
150
150
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_StackView.default, {
|
|
@@ -8,7 +8,7 @@ exports.default = void 0;
|
|
|
8
8
|
var _skeleton = require("./skeleton.constant");
|
|
9
9
|
|
|
10
10
|
var _default = {
|
|
11
|
-
animationDuration:
|
|
11
|
+
animationDuration: "".concat(_skeleton.ANIMATION_DURATION, "ms"),
|
|
12
12
|
animationTimingFunction: 'ease-in-out',
|
|
13
13
|
animationDelay: '0.5s',
|
|
14
14
|
animationIterationCount: 'infinite',
|
|
@@ -40,11 +40,13 @@ const exampleGapValue = '1px';
|
|
|
40
40
|
*/
|
|
41
41
|
|
|
42
42
|
const StackWrap = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
43
|
+
var _props$gap;
|
|
44
|
+
|
|
43
45
|
const {
|
|
44
46
|
space
|
|
45
47
|
} = props; // Don't apply separate gap if `null` or `undefined`, so can be unset in Storybook etc
|
|
46
48
|
|
|
47
|
-
const gap = props.gap
|
|
49
|
+
const gap = (_props$gap = props.gap) !== null && _props$gap !== void 0 ? _props$gap : space;
|
|
48
50
|
const canUseCSSGap = _Platform.default.OS === 'web' && gap === space && cssSupports('gap', exampleGapValue);
|
|
49
51
|
return canUseCSSGap ?
|
|
50
52
|
/*#__PURE__*/
|
|
@@ -65,7 +65,7 @@ const getStackedContent = (children, _ref) => {
|
|
|
65
65
|
const validChildren = _react.Children.toArray(topLevelChildren).filter(Boolean);
|
|
66
66
|
|
|
67
67
|
const content = validChildren.reduce((newChildren, child, index) => {
|
|
68
|
-
const boxID =
|
|
68
|
+
const boxID = "Stack-Box-".concat(index);
|
|
69
69
|
const item = box ?
|
|
70
70
|
/*#__PURE__*/
|
|
71
71
|
// If wrapped in Box, that Box needs a key.
|
|
@@ -75,7 +75,7 @@ const getStackedContent = (children, _ref) => {
|
|
|
75
75
|
testID: boxID
|
|
76
76
|
}, child) : child;
|
|
77
77
|
if (!index || !space && !divider) return [...newChildren, item];
|
|
78
|
-
const testID =
|
|
78
|
+
const testID = "Stack-".concat(divider ? 'Divider' : 'Spacer', "-").concat(index);
|
|
79
79
|
const commonProps = {
|
|
80
80
|
testID,
|
|
81
81
|
key: testID,
|
package/lib/Tabs/Tabs.js
CHANGED
|
@@ -34,12 +34,32 @@ const {
|
|
|
34
34
|
selectHorizontalScrollTokens,
|
|
35
35
|
useItemPositions
|
|
36
36
|
} = _HorizontalScroll.horizontalScrollUtils;
|
|
37
|
+
|
|
38
|
+
const getDefaultTabItemAccessibilityRole = parentRole => {
|
|
39
|
+
switch (parentRole) {
|
|
40
|
+
case 'tablist':
|
|
41
|
+
return 'tab';
|
|
42
|
+
|
|
43
|
+
case 'navigation':
|
|
44
|
+
return 'link';
|
|
45
|
+
|
|
46
|
+
default:
|
|
47
|
+
return undefined;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
37
50
|
/**
|
|
38
51
|
* Tabs renders a horizontally-scrolling menu of selectable buttons which may link
|
|
39
52
|
* to a page or control what content is displayed on this page.
|
|
53
|
+
*
|
|
54
|
+
* If you are using Tabs to navigate to a new page (web-only) you should pass
|
|
55
|
+
* `navigation`as the `accessibilityRole` to te Tabs component, this will cause
|
|
56
|
+
* TabItems to default to a role of link and obtain aria-current behaviour.
|
|
40
57
|
*/
|
|
41
58
|
|
|
59
|
+
|
|
42
60
|
const Tabs = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
61
|
+
var _restProps$accessibil;
|
|
62
|
+
|
|
43
63
|
let {
|
|
44
64
|
tokens,
|
|
45
65
|
itemTokens,
|
|
@@ -76,14 +96,17 @@ const Tabs = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
76
96
|
const hashId = hashItem && (hashItem.id || hashItem.label);
|
|
77
97
|
if (hashId) setTimeout(setValue(hashId, event), 500);
|
|
78
98
|
}, [items, setValue]), isPositioningReady);
|
|
99
|
+
const restProps = selectProps(rest);
|
|
100
|
+
const parentAccessibilityRole = (_restProps$accessibil = restProps.accessibilityRole) !== null && _restProps$accessibil !== void 0 ? _restProps$accessibil : 'tablist';
|
|
101
|
+
const defaultTabItemAccessibiltyRole = getDefaultTabItemAccessibilityRole(parentAccessibilityRole);
|
|
79
102
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_HorizontalScroll.default, {
|
|
80
103
|
ref: ref,
|
|
81
104
|
ScrollButton: _HorizontalScroll.HorizontalScrollButton,
|
|
82
105
|
itemPositions: itemPositions,
|
|
83
106
|
tokens: selectHorizontalScrollTokens(themeTokens),
|
|
84
107
|
scrollButtonTokens: scrollButtonTokens,
|
|
85
|
-
accessibilityRole:
|
|
86
|
-
...
|
|
108
|
+
accessibilityRole: parentAccessibilityRole,
|
|
109
|
+
...restProps,
|
|
87
110
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_StackView.default, {
|
|
88
111
|
space: space,
|
|
89
112
|
direction: "row",
|
|
@@ -92,11 +115,12 @@ const Tabs = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
92
115
|
href,
|
|
93
116
|
label,
|
|
94
117
|
id,
|
|
118
|
+
accessibilityRole = defaultTabItemAccessibiltyRole,
|
|
95
119
|
ref: itemRef,
|
|
96
120
|
LinkRouter: ItemLinkRouter = LinkRouter,
|
|
97
121
|
linkRouterProps: itemLinkRouterProps
|
|
98
122
|
} = _ref3;
|
|
99
|
-
const itemId = id
|
|
123
|
+
const itemId = id !== null && id !== void 0 ? id : label;
|
|
100
124
|
const isSelected = Boolean(currentValue && currentValue === itemId);
|
|
101
125
|
|
|
102
126
|
const handlePress = event => setValue(itemId, event);
|
|
@@ -110,6 +134,7 @@ const Tabs = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
110
134
|
selected: isSelected,
|
|
111
135
|
itemPositions: itemPositions,
|
|
112
136
|
index: index,
|
|
137
|
+
accessibilityRole: accessibilityRole,
|
|
113
138
|
LinkRouter: ItemLinkRouter,
|
|
114
139
|
linkRouterProps: { ...linkRouterProps,
|
|
115
140
|
...itemLinkRouterProps
|
package/lib/Tabs/TabsItem.js
CHANGED
|
@@ -117,13 +117,11 @@ const TabsItem = /*#__PURE__*/(0, _react.forwardRef)((_ref4, ref) => {
|
|
|
117
117
|
itemPositions,
|
|
118
118
|
index,
|
|
119
119
|
children,
|
|
120
|
-
accessibilityRole
|
|
121
|
-
|
|
122
|
-
{
|
|
123
|
-
current: selected ? 'page' : false
|
|
124
|
-
} : {
|
|
120
|
+
accessibilityRole,
|
|
121
|
+
accessibilityCurrent = _Platform.default.OS === 'web' && accessibilityRole === 'link' && selected ? 'page' : undefined,
|
|
122
|
+
accessibilityState = accessibilityRole === 'tab' ? {
|
|
125
123
|
selected
|
|
126
|
-
},
|
|
124
|
+
} : undefined,
|
|
127
125
|
...rawRest
|
|
128
126
|
} = _ref4;
|
|
129
127
|
|
|
@@ -162,6 +160,7 @@ const TabsItem = /*#__PURE__*/(0, _react.forwardRef)((_ref4, ref) => {
|
|
|
162
160
|
} : undefined;
|
|
163
161
|
const selectedProps = selectProps({
|
|
164
162
|
accessibilityRole,
|
|
163
|
+
accessibilityCurrent,
|
|
165
164
|
accessibilityState,
|
|
166
165
|
...rest
|
|
167
166
|
});
|