@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/Link/LinkBase.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
58
|
-
//
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
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
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
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
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
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
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
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
|
package/lib/Link/TextButton.js
CHANGED
|
@@ -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
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
-
|
|
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
|
|
package/lib/List/ListItem.js
CHANGED
|
@@ -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
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
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
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
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
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
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
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
105
|
+
const selectItemBlockStyles = _ref7 => {
|
|
106
|
+
let {
|
|
107
|
+
interItemMargin
|
|
108
|
+
} = _ref7;
|
|
109
|
+
return {
|
|
110
|
+
marginBottom: interItemMargin
|
|
111
|
+
};
|
|
112
|
+
};
|
|
92
113
|
|
|
93
|
-
const selectDividerStyles =
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
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
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
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, {
|
package/lib/Modal/Modal.js
CHANGED
|
@@ -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
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
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
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
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
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
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
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
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
|
});
|