@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.
- package/CHANGELOG.md +35 -2
- package/component-docs.json +711 -669
- package/lib/A11yInfoProvider/index.js +4 -3
- package/lib/A11yText/index.js +6 -5
- package/lib/ActivityIndicator/Spinner.js +14 -13
- package/lib/ActivityIndicator/Spinner.native.js +10 -8
- package/lib/ActivityIndicator/index.js +6 -5
- package/lib/ActivityIndicator/shared.js +1 -1
- package/lib/BaseProvider/index.js +13 -10
- package/lib/Box/Box.js +20 -19
- package/lib/Button/Button.js +7 -6
- package/lib/Button/ButtonBase.js +97 -79
- package/lib/Button/ButtonGroup.js +34 -32
- package/lib/Button/ButtonLink.js +9 -7
- package/lib/Button/index.js +4 -4
- package/lib/Button/propTypes.js +1 -1
- package/lib/Card/Card.js +8 -7
- package/lib/Card/CardBase.js +35 -31
- package/lib/Card/PressableCardBase.js +14 -12
- package/lib/Checkbox/Checkbox.js +97 -83
- package/lib/Checkbox/CheckboxGroup.js +29 -27
- package/lib/Checkbox/CheckboxInput.js +12 -10
- package/lib/Divider/Divider.js +10 -9
- package/lib/ExpandCollapse/Control.js +42 -36
- package/lib/ExpandCollapse/ExpandCollapse.js +11 -10
- package/lib/ExpandCollapse/Panel.js +29 -40
- package/lib/Feedback/Feedback.js +48 -35
- package/lib/Fieldset/Fieldset.js +16 -15
- package/lib/Fieldset/FieldsetContainer.js +16 -13
- package/lib/Fieldset/FieldsetContainer.native.js +11 -8
- package/lib/Fieldset/Legend.js +10 -7
- package/lib/Fieldset/Legend.native.js +10 -7
- package/lib/FlexGrid/Col/Col.js +18 -17
- package/lib/FlexGrid/FlexGrid.js +15 -14
- package/lib/FlexGrid/Row/Row.js +13 -12
- package/lib/HorizontalScroll/HorizontalScroll.js +25 -20
- package/lib/HorizontalScroll/HorizontalScrollButton.js +18 -14
- package/lib/HorizontalScroll/ScrollViewEnd.js +6 -5
- package/lib/HorizontalScroll/ScrollViewEnd.native.js +12 -9
- package/lib/HorizontalScroll/itemPositions.js +19 -13
- package/lib/Icon/Icon.js +11 -10
- package/lib/Icon/IconText.js +8 -7
- package/lib/Icon/index.js +5 -5
- package/lib/IconButton/IconButton.js +50 -42
- package/lib/InputLabel/InputLabel.js +37 -30
- package/lib/InputLabel/LabelContent.js +12 -9
- package/lib/InputLabel/LabelContent.native.js +9 -6
- package/lib/InputSupports/InputSupports.js +11 -10
- package/lib/InputSupports/useInputSupports.js +7 -6
- package/lib/Link/ChevronLink.js +9 -8
- package/lib/Link/InlinePressable.js +13 -10
- package/lib/Link/InlinePressable.native.js +20 -16
- package/lib/Link/Link.js +10 -9
- package/lib/Link/LinkBase.js +96 -78
- package/lib/Link/TextButton.js +9 -8
- package/lib/List/List.js +20 -13
- package/lib/List/ListItem.js +103 -79
- package/lib/Modal/Modal.js +74 -60
- package/lib/Notification/Notification.js +46 -33
- package/lib/Pagination/PageButton.js +13 -12
- package/lib/Pagination/Pagination.js +43 -30
- package/lib/Pagination/SideButton.js +21 -18
- package/lib/Pagination/usePagination.js +7 -6
- package/lib/Progress/Progress.js +23 -19
- package/lib/Progress/ProgressBar.js +25 -21
- package/lib/Progress/ProgressBarBackground.js +7 -6
- package/lib/Radio/Radio.js +80 -69
- package/lib/Radio/RadioButton.js +63 -53
- package/lib/Radio/RadioGroup.js +30 -28
- package/lib/Radio/RadioInput.js +12 -10
- package/lib/RadioCard/RadioCard.js +16 -15
- package/lib/RadioCard/RadioCardGroup.js +30 -28
- package/lib/Search/Search.js +52 -32
- package/lib/Select/Group.js +5 -4
- package/lib/Select/Group.native.js +4 -3
- package/lib/Select/Item.js +10 -7
- package/lib/Select/Item.native.js +1 -9
- package/lib/Select/Picker.js +16 -15
- package/lib/Select/Picker.native.js +49 -38
- package/lib/Select/Select.js +134 -113
- package/lib/SideNav/Item.js +39 -33
- package/lib/SideNav/ItemContent.js +15 -12
- package/lib/SideNav/ItemsGroup.js +13 -11
- package/lib/SideNav/SideNav.js +21 -18
- package/lib/Skeleton/Skeleton.js +60 -44
- package/lib/Skeleton/skeleton.constant.js +1 -1
- package/lib/Skeleton/skeletonWebAnimation.js +1 -1
- package/lib/Spacer/Spacer.js +6 -5
- package/lib/StackView/StackView.js +12 -11
- package/lib/StackView/StackWrap.js +5 -3
- package/lib/StackView/StackWrapBox.js +12 -11
- package/lib/StackView/StackWrapGap.js +11 -10
- package/lib/StackView/common.js +14 -11
- package/lib/StackView/getStackedContent.js +10 -9
- package/lib/StackView/index.js +1 -1
- package/lib/StepTracker/Step.js +122 -103
- package/lib/StepTracker/StepTracker.js +48 -38
- package/lib/Tabs/Tabs.js +57 -27
- package/lib/Tabs/TabsItem.js +78 -68
- package/lib/Tags/Tags.js +68 -62
- package/lib/TextInput/TextArea.js +26 -20
- package/lib/TextInput/TextInput.js +20 -15
- package/lib/TextInput/TextInputBase.js +74 -62
- package/lib/TextInput/index.js +4 -4
- package/lib/ThemeProvider/ThemeProvider.js +6 -5
- package/lib/ThemeProvider/index.js +5 -5
- package/lib/ThemeProvider/useSetTheme.js +6 -3
- package/lib/ThemeProvider/useThemeTokens.js +7 -2
- package/lib/ThemeProvider/utils/styles.js +50 -43
- package/lib/ThemeProvider/utils/theme-tokens.js +33 -21
- package/lib/ToggleSwitch/ToggleSwitch.js +90 -74
- package/lib/ToggleSwitch/ToggleSwitchGroup.js +37 -35
- package/lib/Tooltip/Backdrop.js +6 -13
- package/lib/Tooltip/Backdrop.native.js +5 -4
- package/lib/Tooltip/Tooltip.js +81 -65
- package/lib/Tooltip/getTooltipPosition.js +29 -18
- package/lib/TooltipButton/TooltipButton.js +28 -21
- package/lib/Typography/Typography.js +37 -33
- package/lib/ViewportProvider/ViewportProvider.js +4 -3
- package/lib/ViewportProvider/useViewportListener.js +6 -3
- package/lib/index.js +54 -54
- package/lib/utils/a11y/semantics.js +5 -2
- package/lib/utils/a11y/textSize.js +8 -6
- package/lib/utils/animation/useVerticalExpandAnimation.js +46 -19
- package/lib/utils/children.js +4 -3
- package/lib/utils/index.js +10 -10
- package/lib/utils/input.js +28 -29
- package/lib/utils/pressability.js +36 -22
- package/lib/utils/props/clickProps.js +2 -1
- package/lib/utils/props/componentPropType.js +3 -3
- package/lib/utils/props/getPropSelector.js +6 -3
- package/lib/utils/props/handlerProps.js +25 -19
- package/lib/utils/props/hrefAttrsProp.js +14 -11
- package/lib/utils/props/index.js +12 -12
- package/lib/utils/props/inputSupportsProps.js +15 -12
- package/lib/utils/props/linkProps.js +7 -6
- package/lib/utils/props/pressProps.js +1 -1
- package/lib/utils/props/selectSystemProps.js +2 -2
- package/lib/utils/props/tokens.js +29 -15
- package/lib/utils/ssr.js +6 -2
- package/lib/utils/useCopy.js +6 -4
- package/lib/utils/useHash.js +2 -1
- package/lib/utils/useResponsiveProp.js +1 -1
- package/lib/utils/useSpacingScale.js +3 -1
- package/lib/utils/useUniqueId.js +3 -2
- package/lib/utils/withLinkRouter.js +6 -5
- package/lib-module/A11yInfoProvider/index.js +4 -3
- package/lib-module/A11yText/index.js +6 -5
- package/lib-module/ActivityIndicator/Spinner.js +14 -13
- package/lib-module/ActivityIndicator/Spinner.native.js +9 -8
- package/lib-module/ActivityIndicator/index.js +6 -5
- package/lib-module/BaseProvider/index.js +13 -10
- package/lib-module/Box/Box.js +20 -19
- package/lib-module/Button/Button.js +7 -6
- package/lib-module/Button/ButtonBase.js +96 -79
- package/lib-module/Button/ButtonGroup.js +34 -32
- package/lib-module/Button/ButtonLink.js +8 -7
- package/lib-module/Card/Card.js +8 -7
- package/lib-module/Card/CardBase.js +35 -31
- package/lib-module/Card/PressableCardBase.js +12 -11
- package/lib-module/Checkbox/Checkbox.js +97 -83
- package/lib-module/Checkbox/CheckboxGroup.js +29 -27
- package/lib-module/Checkbox/CheckboxInput.js +12 -10
- package/lib-module/Divider/Divider.js +10 -9
- package/lib-module/ExpandCollapse/Control.js +42 -36
- package/lib-module/ExpandCollapse/ExpandCollapse.js +11 -10
- package/lib-module/ExpandCollapse/Panel.js +29 -37
- package/lib-module/Feedback/Feedback.js +46 -33
- package/lib-module/Fieldset/Fieldset.js +16 -15
- package/lib-module/Fieldset/FieldsetContainer.js +16 -13
- package/lib-module/Fieldset/FieldsetContainer.native.js +11 -8
- package/lib-module/Fieldset/Legend.js +10 -7
- package/lib-module/Fieldset/Legend.native.js +10 -7
- package/lib-module/FlexGrid/Col/Col.js +18 -17
- package/lib-module/FlexGrid/FlexGrid.js +15 -14
- package/lib-module/FlexGrid/Row/Row.js +13 -12
- package/lib-module/HorizontalScroll/HorizontalScroll.js +24 -19
- package/lib-module/HorizontalScroll/HorizontalScrollButton.js +18 -14
- package/lib-module/HorizontalScroll/ScrollViewEnd.js +6 -5
- package/lib-module/HorizontalScroll/ScrollViewEnd.native.js +12 -9
- package/lib-module/HorizontalScroll/itemPositions.js +18 -12
- package/lib-module/Icon/Icon.js +10 -9
- package/lib-module/Icon/IconText.js +9 -7
- package/lib-module/IconButton/IconButton.js +48 -41
- package/lib-module/InputLabel/InputLabel.js +37 -30
- package/lib-module/InputLabel/LabelContent.js +12 -9
- package/lib-module/InputLabel/LabelContent.native.js +9 -6
- package/lib-module/InputSupports/InputSupports.js +11 -10
- package/lib-module/InputSupports/useInputSupports.js +7 -6
- package/lib-module/Link/ChevronLink.js +9 -8
- package/lib-module/Link/InlinePressable.js +13 -10
- package/lib-module/Link/InlinePressable.native.js +20 -16
- package/lib-module/Link/Link.js +10 -9
- package/lib-module/Link/LinkBase.js +94 -77
- package/lib-module/Link/TextButton.js +9 -8
- package/lib-module/List/List.js +20 -13
- package/lib-module/List/ListItem.js +103 -78
- package/lib-module/Modal/Modal.js +74 -60
- package/lib-module/Notification/Notification.js +46 -33
- package/lib-module/Pagination/PageButton.js +13 -12
- package/lib-module/Pagination/Pagination.js +43 -30
- package/lib-module/Pagination/SideButton.js +21 -18
- package/lib-module/Pagination/usePagination.js +7 -6
- package/lib-module/Progress/Progress.js +23 -19
- package/lib-module/Progress/ProgressBar.js +25 -21
- package/lib-module/Progress/ProgressBarBackground.js +7 -6
- package/lib-module/Radio/Radio.js +80 -69
- package/lib-module/Radio/RadioButton.js +62 -52
- package/lib-module/Radio/RadioGroup.js +30 -28
- package/lib-module/Radio/RadioInput.js +12 -10
- package/lib-module/RadioCard/RadioCard.js +16 -15
- package/lib-module/RadioCard/RadioCardGroup.js +30 -28
- package/lib-module/Search/Search.js +52 -32
- package/lib-module/Select/Group.js +5 -4
- package/lib-module/Select/Group.native.js +4 -3
- package/lib-module/Select/Item.js +10 -7
- package/lib-module/Select/Item.native.js +1 -7
- package/lib-module/Select/Picker.js +16 -15
- package/lib-module/Select/Picker.native.js +46 -36
- package/lib-module/Select/Select.js +134 -113
- package/lib-module/SideNav/Item.js +39 -33
- package/lib-module/SideNav/ItemContent.js +14 -11
- package/lib-module/SideNav/ItemsGroup.js +13 -11
- package/lib-module/SideNav/SideNav.js +21 -18
- package/lib-module/Skeleton/Skeleton.js +60 -44
- package/lib-module/Skeleton/skeletonWebAnimation.js +1 -1
- package/lib-module/Spacer/Spacer.js +6 -5
- package/lib-module/StackView/StackView.js +12 -11
- package/lib-module/StackView/StackWrap.js +5 -3
- package/lib-module/StackView/StackWrapBox.js +12 -11
- package/lib-module/StackView/StackWrapGap.js +11 -10
- package/lib-module/StackView/common.js +14 -11
- package/lib-module/StackView/getStackedContent.js +10 -9
- package/lib-module/StepTracker/Step.js +122 -103
- package/lib-module/StepTracker/StepTracker.js +48 -38
- package/lib-module/Tabs/Tabs.js +57 -27
- package/lib-module/Tabs/TabsItem.js +77 -68
- package/lib-module/Tags/Tags.js +68 -62
- package/lib-module/TextInput/TextArea.js +26 -20
- package/lib-module/TextInput/TextInput.js +19 -15
- package/lib-module/TextInput/TextInputBase.js +74 -62
- package/lib-module/ThemeProvider/ThemeProvider.js +5 -4
- package/lib-module/ThemeProvider/useSetTheme.js +6 -3
- package/lib-module/ThemeProvider/useThemeTokens.js +7 -2
- package/lib-module/ThemeProvider/utils/styles.js +48 -41
- package/lib-module/ThemeProvider/utils/theme-tokens.js +32 -20
- package/lib-module/ToggleSwitch/ToggleSwitch.js +90 -74
- package/lib-module/ToggleSwitch/ToggleSwitchGroup.js +37 -35
- package/lib-module/Tooltip/Backdrop.js +6 -13
- package/lib-module/Tooltip/Backdrop.native.js +5 -4
- package/lib-module/Tooltip/Tooltip.js +81 -65
- package/lib-module/Tooltip/getTooltipPosition.js +29 -18
- package/lib-module/TooltipButton/TooltipButton.js +28 -21
- package/lib-module/Typography/Typography.js +35 -31
- package/lib-module/ViewportProvider/ViewportProvider.js +4 -3
- package/lib-module/ViewportProvider/useViewportListener.js +6 -3
- package/lib-module/utils/a11y/semantics.js +4 -1
- package/lib-module/utils/a11y/textSize.js +7 -5
- package/lib-module/utils/animation/useVerticalExpandAnimation.js +47 -20
- package/lib-module/utils/children.js +4 -3
- package/lib-module/utils/input.js +28 -29
- package/lib-module/utils/pressability.js +35 -21
- package/lib-module/utils/props/clickProps.js +2 -1
- package/lib-module/utils/props/componentPropType.js +3 -3
- package/lib-module/utils/props/getPropSelector.js +6 -3
- package/lib-module/utils/props/handlerProps.js +24 -18
- package/lib-module/utils/props/hrefAttrsProp.js +14 -11
- package/lib-module/utils/props/inputSupportsProps.js +15 -12
- package/lib-module/utils/props/linkProps.js +7 -6
- package/lib-module/utils/props/selectSystemProps.js +2 -2
- package/lib-module/utils/props/tokens.js +27 -14
- package/lib-module/utils/ssr.js +5 -2
- package/lib-module/utils/useCopy.js +6 -4
- package/lib-module/utils/useHash.js +2 -1
- package/lib-module/utils/useSpacingScale.js +3 -1
- package/lib-module/utils/useUniqueId.js +3 -2
- package/lib-module/utils/withLinkRouter.js +6 -5
- package/package.json +13 -11
- package/src/ExpandCollapse/Panel.jsx +2 -19
- package/src/List/List.jsx +34 -19
- package/src/List/ListItem.jsx +12 -2
- package/src/Modal/Modal.jsx +2 -1
- package/src/Pagination/Pagination.jsx +3 -0
- package/src/Search/Search.jsx +11 -0
- package/src/Select/Item.native.jsx +0 -7
- package/src/Tabs/Tabs.jsx +24 -2
- package/src/Tabs/TabsItem.jsx +6 -5
- package/src/utils/animation/useVerticalExpandAnimation.js +47 -13
package/lib/Skeleton/Skeleton.js
CHANGED
|
@@ -33,48 +33,61 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
33
33
|
|
|
34
34
|
const [selectProps, selectedSystemPropTypes] = (0, _utils.selectSystemProps)([_utils.a11yProps, _utils.viewProps]);
|
|
35
35
|
|
|
36
|
-
const selectSkeletonStyles =
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
36
|
+
const selectSkeletonStyles = _ref => {
|
|
37
|
+
let {
|
|
38
|
+
color,
|
|
39
|
+
radius,
|
|
40
|
+
fadeAnimation
|
|
41
|
+
} = _ref;
|
|
42
|
+
return {
|
|
43
|
+
backgroundColor: color,
|
|
44
|
+
borderRadius: radius,
|
|
45
|
+
...fadeAnimation
|
|
46
|
+
};
|
|
47
|
+
};
|
|
45
48
|
|
|
46
|
-
const selectLineStyles =
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
const selectLineStyles = _ref2 => {
|
|
50
|
+
let {
|
|
51
|
+
skeletonHeight,
|
|
52
|
+
lineWidth
|
|
53
|
+
} = _ref2;
|
|
54
|
+
return {
|
|
55
|
+
width: lineWidth,
|
|
56
|
+
height: skeletonHeight
|
|
57
|
+
};
|
|
58
|
+
};
|
|
53
59
|
|
|
54
|
-
const selectShapeStyles =
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
+
const selectShapeStyles = _ref3 => {
|
|
61
|
+
let {
|
|
62
|
+
skeletonHeight
|
|
63
|
+
} = _ref3;
|
|
64
|
+
return {
|
|
65
|
+
height: skeletonHeight,
|
|
66
|
+
width: skeletonHeight
|
|
67
|
+
};
|
|
68
|
+
};
|
|
60
69
|
|
|
61
|
-
const selectSquareStyles =
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
70
|
+
const selectSquareStyles = _ref4 => {
|
|
71
|
+
let {
|
|
72
|
+
radius
|
|
73
|
+
} = _ref4;
|
|
74
|
+
return {
|
|
75
|
+
borderRadius: radius
|
|
76
|
+
};
|
|
77
|
+
};
|
|
66
78
|
|
|
67
|
-
const Skeleton = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
79
|
+
const Skeleton = /*#__PURE__*/(0, _react.forwardRef)((_ref5, ref) => {
|
|
80
|
+
let {
|
|
81
|
+
tokens,
|
|
82
|
+
variant,
|
|
83
|
+
size,
|
|
84
|
+
sizeIndex = size,
|
|
85
|
+
sizePixels,
|
|
86
|
+
characters,
|
|
87
|
+
lines,
|
|
88
|
+
shape = 'line',
|
|
89
|
+
...rest
|
|
90
|
+
} = _ref5;
|
|
78
91
|
const themeTokens = (0, _ThemeProvider.useThemeTokens)('Skeleton', tokens, variant);
|
|
79
92
|
const pixels = (0, _utils.useResponsiveProp)(sizePixels);
|
|
80
93
|
const spacingScaleValue = typeof pixels === 'number' ? // Size by an exact number of pixels
|
|
@@ -124,12 +137,15 @@ const Skeleton = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
124
137
|
});
|
|
125
138
|
};
|
|
126
139
|
|
|
127
|
-
const renderSkeleton =
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
140
|
+
const renderSkeleton = function () {
|
|
141
|
+
let index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
142
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Animated.default.View, {
|
|
143
|
+
testID: "skeleton",
|
|
144
|
+
style: [selectSkeletonStyles({ ...themeTokens,
|
|
145
|
+
fadeAnimation: getAnimationBaseOnPlatform()
|
|
146
|
+
}), getStyledBasedOnShape()]
|
|
147
|
+
}, "skeleton-".concat(index + 1));
|
|
148
|
+
};
|
|
133
149
|
|
|
134
150
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_StackView.default, {
|
|
135
151
|
space: themeTokens.spaceBetweenLines,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.OPACITY_STOP = exports.DEFAULT_OPACITY = exports.ANIMATION_DURATION = void 0;
|
|
7
7
|
const DEFAULT_OPACITY = 1;
|
|
8
8
|
exports.DEFAULT_OPACITY = DEFAULT_OPACITY;
|
|
9
9
|
const OPACITY_STOP = 0.4;
|
|
@@ -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',
|
package/lib/Spacer/Spacer.js
CHANGED
|
@@ -76,11 +76,12 @@ const selectSizeStyle = (size, direction) => ({
|
|
|
76
76
|
*/
|
|
77
77
|
|
|
78
78
|
|
|
79
|
-
const Spacer = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
79
|
+
const Spacer = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
80
|
+
let {
|
|
81
|
+
space = 1,
|
|
82
|
+
direction = 'column',
|
|
83
|
+
...rest
|
|
84
|
+
} = _ref;
|
|
84
85
|
const size = (0, _utils.useSpacingScale)(space);
|
|
85
86
|
const sizeStyle = selectSizeStyle(size, direction);
|
|
86
87
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
@@ -75,17 +75,18 @@ const [selectProps, selectedSystemPropTypes] = (0, _utils.selectSystemProps)([_u
|
|
|
75
75
|
* semantic role but only on web, not within native apps).
|
|
76
76
|
*/
|
|
77
77
|
|
|
78
|
-
const StackView = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
78
|
+
const StackView = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
79
|
+
let {
|
|
80
|
+
space = 1,
|
|
81
|
+
divider,
|
|
82
|
+
direction: directionProp = 'column',
|
|
83
|
+
children,
|
|
84
|
+
variant,
|
|
85
|
+
tokens,
|
|
86
|
+
tag,
|
|
87
|
+
accessibilityRole,
|
|
88
|
+
...rest
|
|
89
|
+
} = _ref;
|
|
89
90
|
const viewport = (0, _ViewportProvider.useViewport)();
|
|
90
91
|
const direction = (0, _utils.useResponsiveProp)(directionProp, 'column');
|
|
91
92
|
const selectedProps = selectProps({ ...(0, _utils.getA11yPropsFromHtmlTag)(tag, accessibilityRole),
|
|
@@ -22,10 +22,10 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
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
24
|
// In Jest/CI/SSR, global CSS isn't always available and doesn't always have .supports method
|
|
25
|
-
const cssSupports = (
|
|
25
|
+
const cssSupports = function () {
|
|
26
26
|
var _window$CSS;
|
|
27
27
|
|
|
28
|
-
return typeof window !== 'undefined' && typeof ((_window$CSS = window.CSS) === null || _window$CSS === void 0 ? void 0 : _window$CSS.supports) === 'function' && window.CSS.supports(...
|
|
28
|
+
return typeof window !== 'undefined' && typeof ((_window$CSS = window.CSS) === null || _window$CSS === void 0 ? void 0 : _window$CSS.supports) === 'function' && window.CSS.supports(...arguments);
|
|
29
29
|
}; // CSS.supports needs an example of the type of value you intend to use.
|
|
30
30
|
// Will be an integer appended `px` after hooks and JSX styles are resolved.
|
|
31
31
|
|
|
@@ -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__*/
|
|
@@ -55,17 +55,18 @@ const spaceSides = {
|
|
|
55
55
|
* between the container and the stacked children, and requires a negative margin on the container.
|
|
56
56
|
*/
|
|
57
57
|
|
|
58
|
-
const StackWrapBox = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
58
|
+
const StackWrapBox = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
59
|
+
let {
|
|
60
|
+
space = 1,
|
|
61
|
+
gap = space,
|
|
62
|
+
direction: directionProp = 'row',
|
|
63
|
+
children,
|
|
64
|
+
tokens,
|
|
65
|
+
variant,
|
|
66
|
+
tag,
|
|
67
|
+
accessibilityRole,
|
|
68
|
+
...rest
|
|
69
|
+
} = _ref;
|
|
69
70
|
const viewport = (0, _ViewportProvider.useViewport)();
|
|
70
71
|
const direction = (0, _utils.useResponsiveProp)(directionProp, 'row');
|
|
71
72
|
const themeTokens = (0, _ThemeProvider.useThemeTokens)('StackView', tokens, variant, {
|
|
@@ -41,16 +41,17 @@ const [selectProps] = (0, _utils.selectSystemProps)([_utils.a11yProps, _utils.vi
|
|
|
41
41
|
* default if `gap` prop is undefined)
|
|
42
42
|
*/
|
|
43
43
|
|
|
44
|
-
const StackWrapGap = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
44
|
+
const StackWrapGap = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
45
|
+
let {
|
|
46
|
+
space = 1,
|
|
47
|
+
tokens,
|
|
48
|
+
variant,
|
|
49
|
+
direction: directionProp = 'row',
|
|
50
|
+
children,
|
|
51
|
+
tag,
|
|
52
|
+
accessibilityRole,
|
|
53
|
+
...rest
|
|
54
|
+
} = _ref;
|
|
54
55
|
const viewport = (0, _ViewportProvider.useViewport)();
|
|
55
56
|
const direction = (0, _utils.useResponsiveProp)(directionProp, 'row');
|
|
56
57
|
const themeTokens = (0, _ThemeProvider.useThemeTokens)('StackView', tokens, variant, {
|
package/lib/StackView/common.js
CHANGED
|
@@ -9,17 +9,20 @@ var _StyleSheet = _interopRequireDefault(require("react-native-web/dist/cjs/expo
|
|
|
9
9
|
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
11
|
|
|
12
|
-
const selectFlexStyles =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
12
|
+
const selectFlexStyles = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
alignItems,
|
|
15
|
+
justifyContent,
|
|
16
|
+
flexGrow,
|
|
17
|
+
flexShrink
|
|
18
|
+
} = _ref;
|
|
19
|
+
return {
|
|
20
|
+
alignItems,
|
|
21
|
+
justifyContent,
|
|
22
|
+
flexGrow,
|
|
23
|
+
flexShrink
|
|
24
|
+
};
|
|
25
|
+
};
|
|
23
26
|
|
|
24
27
|
exports.selectFlexStyles = selectFlexStyles;
|
|
25
28
|
|
|
@@ -47,13 +47,14 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
47
47
|
* @param {boolean} [options.preserveFragments]
|
|
48
48
|
* @returns {ReactElement[]}
|
|
49
49
|
*/
|
|
50
|
-
const getStackedContent = (children, {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
50
|
+
const getStackedContent = (children, _ref) => {
|
|
51
|
+
let {
|
|
52
|
+
divider,
|
|
53
|
+
space,
|
|
54
|
+
direction = 'column',
|
|
55
|
+
box,
|
|
56
|
+
preserveFragments = false
|
|
57
|
+
} = _ref;
|
|
57
58
|
const boxProps = box && typeof box === 'object' ? box : {
|
|
58
59
|
space
|
|
59
60
|
};
|
|
@@ -64,7 +65,7 @@ const getStackedContent = (children, {
|
|
|
64
65
|
const validChildren = _react.Children.toArray(topLevelChildren).filter(Boolean);
|
|
65
66
|
|
|
66
67
|
const content = validChildren.reduce((newChildren, child, index) => {
|
|
67
|
-
const boxID =
|
|
68
|
+
const boxID = "Stack-Box-".concat(index);
|
|
68
69
|
const item = box ?
|
|
69
70
|
/*#__PURE__*/
|
|
70
71
|
// If wrapped in Box, that Box needs a key.
|
|
@@ -74,7 +75,7 @@ const getStackedContent = (children, {
|
|
|
74
75
|
testID: boxID
|
|
75
76
|
}, child) : child;
|
|
76
77
|
if (!index || !space && !divider) return [...newChildren, item];
|
|
77
|
-
const testID =
|
|
78
|
+
const testID = "Stack-".concat(divider ? 'Divider' : 'Spacer', "-").concat(index);
|
|
78
79
|
const commonProps = {
|
|
79
80
|
testID,
|
|
80
81
|
key: testID,
|
package/lib/StackView/index.js
CHANGED
|
@@ -9,13 +9,13 @@ Object.defineProperty(exports, "StackWrap", {
|
|
|
9
9
|
return _StackWrap.default;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
+
exports.default = void 0;
|
|
12
13
|
Object.defineProperty(exports, "getStackedContent", {
|
|
13
14
|
enumerable: true,
|
|
14
15
|
get: function () {
|
|
15
16
|
return _getStackedContent.default;
|
|
16
17
|
}
|
|
17
18
|
});
|
|
18
|
-
exports.default = void 0;
|
|
19
19
|
|
|
20
20
|
var _StackView = _interopRequireDefault(require("./StackView"));
|
|
21
21
|
|
package/lib/StepTracker/Step.js
CHANGED
|
@@ -29,105 +29,123 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
29
29
|
|
|
30
30
|
const [selectProps, selectedSystemPropTypes] = (0, _utils.selectSystemProps)([_utils.a11yProps, _utils.viewProps]);
|
|
31
31
|
|
|
32
|
-
const selectCompletedIconTokens =
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
32
|
+
const selectCompletedIconTokens = _ref => {
|
|
33
|
+
let {
|
|
34
|
+
completedIconColor,
|
|
35
|
+
completedIconSize
|
|
36
|
+
} = _ref;
|
|
37
|
+
return {
|
|
38
|
+
size: completedIconSize,
|
|
39
|
+
color: completedIconColor
|
|
40
|
+
};
|
|
41
|
+
};
|
|
39
42
|
|
|
40
|
-
const selectConnectorStyles = ({
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
43
|
+
const selectConnectorStyles = (_ref2, isCompleted) => {
|
|
44
|
+
let {
|
|
45
|
+
connectorColor,
|
|
46
|
+
connectorHeight,
|
|
47
|
+
connectorMinWidth,
|
|
48
|
+
connectorCompletedHeight,
|
|
49
|
+
connectorCompletedColor
|
|
50
|
+
} = _ref2;
|
|
51
|
+
return {
|
|
52
|
+
backgroundColor: connectorColor,
|
|
53
|
+
height: connectorHeight,
|
|
54
|
+
minWidth: connectorMinWidth,
|
|
55
|
+
...(isCompleted && {
|
|
56
|
+
height: connectorCompletedHeight,
|
|
57
|
+
backgroundColor: connectorCompletedColor
|
|
58
|
+
})
|
|
59
|
+
};
|
|
60
|
+
};
|
|
55
61
|
|
|
56
|
-
const selectCurrentInnerStyles =
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
const selectCurrentInnerStyles = _ref3 => {
|
|
63
|
+
let {
|
|
64
|
+
knobCurrentInnerColor,
|
|
65
|
+
knobCurrentInnerSize
|
|
66
|
+
} = _ref3;
|
|
67
|
+
return {
|
|
68
|
+
backgroundColor: knobCurrentInnerColor,
|
|
69
|
+
borderRadius: knobCurrentInnerSize / 2,
|
|
70
|
+
height: knobCurrentInnerSize,
|
|
71
|
+
width: knobCurrentInnerSize
|
|
72
|
+
};
|
|
73
|
+
};
|
|
65
74
|
|
|
66
|
-
const selectKnobStyles = ({
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
75
|
+
const selectKnobStyles = (_ref4, isCompleted, isCurrent) => {
|
|
76
|
+
let {
|
|
77
|
+
knobBackgroundColor,
|
|
78
|
+
knobBorderColor,
|
|
79
|
+
knobBorderWidth,
|
|
80
|
+
knobCompletedBackgroundColor,
|
|
81
|
+
knobCompletedBorderColor,
|
|
82
|
+
knobCompletedPaddingLeft,
|
|
83
|
+
knobCompletedPaddingTop,
|
|
84
|
+
knobCurrentBackgroundColor,
|
|
85
|
+
knobCurrentBorderColor,
|
|
86
|
+
knobCurrentBorderWidth,
|
|
87
|
+
knobCurrentPaddingLeft,
|
|
88
|
+
knobCurrentPaddingTop,
|
|
89
|
+
knobSize
|
|
90
|
+
} = _ref4;
|
|
91
|
+
return {
|
|
92
|
+
backgroundColor: knobBackgroundColor,
|
|
93
|
+
borderColor: knobBorderColor,
|
|
94
|
+
borderRadius: knobSize / 2,
|
|
95
|
+
borderWidth: knobBorderWidth,
|
|
96
|
+
height: knobSize,
|
|
97
|
+
width: knobSize,
|
|
98
|
+
...(isCompleted && {
|
|
99
|
+
backgroundColor: knobCompletedBackgroundColor,
|
|
100
|
+
borderColor: knobCompletedBorderColor,
|
|
101
|
+
paddingLeft: knobCompletedPaddingLeft,
|
|
102
|
+
paddingTop: knobCompletedPaddingTop
|
|
103
|
+
}),
|
|
104
|
+
...(isCurrent && {
|
|
105
|
+
backgroundColor: knobCurrentBackgroundColor,
|
|
106
|
+
borderColor: knobCurrentBorderColor,
|
|
107
|
+
borderWidth: knobCurrentBorderWidth,
|
|
108
|
+
paddingLeft: knobCurrentPaddingLeft,
|
|
109
|
+
paddingTop: knobCurrentPaddingTop
|
|
110
|
+
})
|
|
111
|
+
};
|
|
112
|
+
};
|
|
101
113
|
|
|
102
|
-
const selectLabelContainerStyles =
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
114
|
+
const selectLabelContainerStyles = _ref5 => {
|
|
115
|
+
let {
|
|
116
|
+
labelDirection,
|
|
117
|
+
labelGap,
|
|
118
|
+
labelMarginTop,
|
|
119
|
+
labelPaddingLeft,
|
|
120
|
+
labelPaddingRight
|
|
121
|
+
} = _ref5;
|
|
122
|
+
return {
|
|
123
|
+
marginTop: labelMarginTop,
|
|
124
|
+
paddingLeft: labelPaddingLeft,
|
|
125
|
+
paddingRight: labelPaddingRight,
|
|
126
|
+
flexDirection: labelDirection,
|
|
127
|
+
gap: labelGap
|
|
128
|
+
};
|
|
129
|
+
};
|
|
115
130
|
|
|
116
|
-
const selectLabelStyles = ({
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
+
const selectLabelStyles = (_ref6, isCurrent) => {
|
|
132
|
+
let {
|
|
133
|
+
labelColor,
|
|
134
|
+
labelCurrentColor,
|
|
135
|
+
labelCurrentFontWeight,
|
|
136
|
+
labelFontSize,
|
|
137
|
+
labelFontWeight,
|
|
138
|
+
labelFontName,
|
|
139
|
+
labelLineHeight
|
|
140
|
+
} = _ref6;
|
|
141
|
+
return (0, _ThemeProvider.applyTextStyles)({
|
|
142
|
+
color: isCurrent ? labelCurrentColor : labelColor,
|
|
143
|
+
fontSize: labelFontSize,
|
|
144
|
+
lineHeight: labelLineHeight,
|
|
145
|
+
fontWeight: isCurrent ? labelCurrentFontWeight : labelFontWeight,
|
|
146
|
+
fontName: labelFontName
|
|
147
|
+
});
|
|
148
|
+
};
|
|
131
149
|
|
|
132
150
|
const getStepTestID = (isCompleted, isCurrent) => {
|
|
133
151
|
let testID = 'StepTracker-Step';
|
|
@@ -145,15 +163,16 @@ const getStepTestID = (isCompleted, isCurrent) => {
|
|
|
145
163
|
*/
|
|
146
164
|
|
|
147
165
|
|
|
148
|
-
const Step =
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
166
|
+
const Step = _ref7 => {
|
|
167
|
+
let {
|
|
168
|
+
label,
|
|
169
|
+
name,
|
|
170
|
+
status = 0,
|
|
171
|
+
stepCount = 0,
|
|
172
|
+
stepIndex = 0,
|
|
173
|
+
tokens,
|
|
174
|
+
...rest
|
|
175
|
+
} = _ref7;
|
|
157
176
|
const {
|
|
158
177
|
completedIcon,
|
|
159
178
|
showStepLabel,
|