@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/Radio/RadioButton.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.selectRadioButtonTokens = exports.default = void 0;
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
|
|
@@ -40,69 +40,79 @@ exports.selectRadioButtonTokens = selectRadioButtonTokens;
|
|
|
40
40
|
|
|
41
41
|
const getBorderRadius = inputSize => inputSize / 2;
|
|
42
42
|
|
|
43
|
-
const selectCheckedStyles =
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
43
|
+
const selectCheckedStyles = _ref => {
|
|
44
|
+
let {
|
|
45
|
+
checkedBackgroundColor,
|
|
46
|
+
checkedSize
|
|
47
|
+
} = _ref;
|
|
48
|
+
return {
|
|
49
|
+
backgroundColor: checkedBackgroundColor,
|
|
50
|
+
borderRadius: checkedSize / 2,
|
|
51
|
+
height: checkedSize,
|
|
52
|
+
width: checkedSize
|
|
53
|
+
};
|
|
54
|
+
};
|
|
52
55
|
|
|
53
|
-
const selectInputStyles =
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
56
|
+
const selectInputStyles = _ref2 => {
|
|
57
|
+
let {
|
|
58
|
+
inputBackgroundColor,
|
|
59
|
+
inputBorderColor,
|
|
60
|
+
inputBorderWidth,
|
|
61
|
+
inputOutlineColor,
|
|
62
|
+
inputOutlineWidth,
|
|
63
|
+
inputSize
|
|
64
|
+
} = _ref2;
|
|
65
|
+
return {
|
|
66
|
+
borderColor: inputBorderColor,
|
|
67
|
+
borderRadius: getBorderRadius(inputSize),
|
|
68
|
+
borderWidth: inputBorderWidth,
|
|
69
|
+
backgroundColor: inputBackgroundColor,
|
|
70
|
+
height: inputSize,
|
|
71
|
+
width: inputSize,
|
|
72
|
+
..._Platform.default.select({
|
|
73
|
+
web: {
|
|
74
|
+
outlineStyle: 'solid',
|
|
75
|
+
outlineColor: inputOutlineColor,
|
|
76
|
+
outlineWidth: inputOutlineWidth
|
|
77
|
+
}
|
|
78
|
+
})
|
|
79
|
+
};
|
|
80
|
+
};
|
|
75
81
|
|
|
76
|
-
const selectOuterBorderStyles =
|
|
77
|
-
|
|
78
|
-
outerBorderWidth,
|
|
79
|
-
outerBorderGap,
|
|
80
|
-
inputSize
|
|
81
|
-
}) => ({ ...(0, _ThemeProvider.applyOuterBorder)({
|
|
82
|
+
const selectOuterBorderStyles = _ref3 => {
|
|
83
|
+
let {
|
|
82
84
|
outerBorderColor,
|
|
83
85
|
outerBorderWidth,
|
|
84
86
|
outerBorderGap,
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
|
|
87
|
+
inputSize
|
|
88
|
+
} = _ref3;
|
|
89
|
+
return { ...(0, _ThemeProvider.applyOuterBorder)({
|
|
90
|
+
outerBorderColor,
|
|
91
|
+
outerBorderWidth,
|
|
92
|
+
outerBorderGap,
|
|
93
|
+
borderRadius: getBorderRadius(inputSize)
|
|
94
|
+
})
|
|
95
|
+
};
|
|
96
|
+
};
|
|
88
97
|
/**
|
|
89
98
|
* The visual toggle of a radio input. Is not interactive on its own, should be used inside
|
|
90
99
|
* an interactive parent that passes down props when interacted with.
|
|
91
100
|
*/
|
|
92
101
|
|
|
93
102
|
|
|
94
|
-
const RadioButton = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
103
|
+
const RadioButton = /*#__PURE__*/(0, _react.forwardRef)((_ref4, ref) => {
|
|
104
|
+
let {
|
|
105
|
+
isChecked,
|
|
106
|
+
tokens,
|
|
107
|
+
inactive,
|
|
108
|
+
defaultChecked,
|
|
109
|
+
inputId,
|
|
110
|
+
isControlled,
|
|
111
|
+
handleChange,
|
|
112
|
+
name: inputName,
|
|
113
|
+
value,
|
|
114
|
+
...rest
|
|
115
|
+
} = _ref4;
|
|
106
116
|
const themeTokens = (0, _ThemeProvider.validateThemeTokens)((0, _ThemeProvider.resolveThemeTokens)(tokens, {
|
|
107
117
|
checked: isChecked
|
|
108
118
|
}), (0, _utils.getTokensSetPropType)(tokenKeys), 'RadioButton');
|
package/lib/Radio/RadioGroup.js
CHANGED
|
@@ -82,25 +82,26 @@ const [selectItemProps, selectedItemPropTypes] = (0, _utils.selectSystemProps)([
|
|
|
82
82
|
* ```
|
|
83
83
|
*/
|
|
84
84
|
|
|
85
|
-
const RadioGroup = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
85
|
+
const RadioGroup = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
86
|
+
let {
|
|
87
|
+
copy = 'en',
|
|
88
|
+
tokens,
|
|
89
|
+
radioTokens,
|
|
90
|
+
variant,
|
|
91
|
+
items = [],
|
|
92
|
+
legend,
|
|
93
|
+
tooltip,
|
|
94
|
+
hint,
|
|
95
|
+
validation,
|
|
96
|
+
feedback,
|
|
97
|
+
initialCheckedId,
|
|
98
|
+
checkedId,
|
|
99
|
+
onChange,
|
|
100
|
+
readOnly,
|
|
101
|
+
name: inputGroupName,
|
|
102
|
+
inactive,
|
|
103
|
+
...rest
|
|
104
|
+
} = _ref;
|
|
104
105
|
const viewport = (0, _ViewportProvider.useViewport)();
|
|
105
106
|
const {
|
|
106
107
|
space,
|
|
@@ -120,17 +121,18 @@ const RadioGroup = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
120
121
|
const uniqueFields = ['id', 'label'];
|
|
121
122
|
|
|
122
123
|
if (!(0, _utils.containUniqueFields)(items, uniqueFields)) {
|
|
123
|
-
throw new Error(
|
|
124
|
+
throw new Error("RadioGroup items must have unique ".concat(uniqueFields.join(', ')));
|
|
124
125
|
}
|
|
125
126
|
|
|
126
|
-
const radios = items.map(({
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
127
|
+
const radios = items.map((_ref2, index) => {
|
|
128
|
+
let {
|
|
129
|
+
label,
|
|
130
|
+
id,
|
|
131
|
+
onChange: itemOnChange,
|
|
132
|
+
ref: itemRef,
|
|
133
|
+
...itemRest
|
|
134
|
+
} = _ref2;
|
|
135
|
+
const radioId = id || "Radio[".concat(index, "]");
|
|
134
136
|
const isChecked = currentValue === radioId;
|
|
135
137
|
|
|
136
138
|
const handleChange = (newCheckedState, event) => {
|
package/lib/Radio/RadioInput.js
CHANGED
|
@@ -20,16 +20,18 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
20
20
|
/**
|
|
21
21
|
* On Web we need to include an actual input but hide it.
|
|
22
22
|
*/
|
|
23
|
-
const RadioInput = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
23
|
+
const RadioInput = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
24
|
+
let {
|
|
25
|
+
checked,
|
|
26
|
+
defaultChecked,
|
|
27
|
+
disabled,
|
|
28
|
+
id,
|
|
29
|
+
isControlled,
|
|
30
|
+
name,
|
|
31
|
+
onChange,
|
|
32
|
+
value
|
|
33
|
+
} = _ref;
|
|
34
|
+
|
|
33
35
|
const handleClick = event => {
|
|
34
36
|
// Cancel the click dispatched via the label tag, since it's already wrapped
|
|
35
37
|
// in <Pressable>
|
|
@@ -70,20 +70,21 @@ const [selectProps, selectedSystemPropTypes] = (0, _utils.selectSystemProps)([_u
|
|
|
70
70
|
* or the internal state in case of uncontrolled radio button.
|
|
71
71
|
*/
|
|
72
72
|
|
|
73
|
-
const RadioCard = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
73
|
+
const RadioCard = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
74
|
+
let {
|
|
75
|
+
tokens,
|
|
76
|
+
variant,
|
|
77
|
+
title,
|
|
78
|
+
children,
|
|
79
|
+
inactive,
|
|
80
|
+
defaultChecked,
|
|
81
|
+
checked,
|
|
82
|
+
name: inputName,
|
|
83
|
+
value,
|
|
84
|
+
id,
|
|
85
|
+
onChange,
|
|
86
|
+
...rest
|
|
87
|
+
} = _ref;
|
|
87
88
|
const {
|
|
88
89
|
currentValue: isChecked,
|
|
89
90
|
setValue: setIsChecked,
|
|
@@ -101,7 +102,7 @@ const RadioCard = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
101
102
|
};
|
|
102
103
|
|
|
103
104
|
const uniqueId = (0, _utils.useUniqueId)('RadioCard');
|
|
104
|
-
const inputId = id
|
|
105
|
+
const inputId = id !== null && id !== void 0 ? id : uniqueId;
|
|
105
106
|
const getTokens = (0, _ThemeProvider.useThemeTokensCallback)('RadioCard', tokens, variant);
|
|
106
107
|
|
|
107
108
|
const getCardTokens = cardState => (0, _Card.selectPressableCardTokens)(getTokens(cardState));
|
|
@@ -82,25 +82,26 @@ const [selectItemProps, selectedItemPropTypes] = (0, _utils.selectSystemProps)([
|
|
|
82
82
|
* ```
|
|
83
83
|
*/
|
|
84
84
|
|
|
85
|
-
const RadioCardGroup = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
85
|
+
const RadioCardGroup = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
86
|
+
let {
|
|
87
|
+
copy = 'en',
|
|
88
|
+
tokens,
|
|
89
|
+
radioCardTokens,
|
|
90
|
+
variant,
|
|
91
|
+
items = [],
|
|
92
|
+
legend,
|
|
93
|
+
tooltip,
|
|
94
|
+
hint,
|
|
95
|
+
validation,
|
|
96
|
+
feedback,
|
|
97
|
+
initialCheckedId,
|
|
98
|
+
checkedId,
|
|
99
|
+
onChange,
|
|
100
|
+
readOnly,
|
|
101
|
+
name: inputGroupName,
|
|
102
|
+
inactive,
|
|
103
|
+
...rest
|
|
104
|
+
} = _ref;
|
|
104
105
|
const viewport = (0, _ViewportProvider.useViewport)();
|
|
105
106
|
const {
|
|
106
107
|
space,
|
|
@@ -125,7 +126,7 @@ const RadioCardGroup = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
125
126
|
const uniqueFields = ['id'];
|
|
126
127
|
|
|
127
128
|
if (!(0, _utils.containUniqueFields)(items, uniqueFields)) {
|
|
128
|
-
throw new Error(
|
|
129
|
+
throw new Error("RadioCardGroup items must have unique ".concat(uniqueFields.join(', ')));
|
|
129
130
|
}
|
|
130
131
|
|
|
131
132
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Fieldset.default, {
|
|
@@ -144,14 +145,15 @@ const RadioCardGroup = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
144
145
|
children: props => /*#__PURE__*/(0, _jsxRuntime.jsx)(StackContainer, {
|
|
145
146
|
space: space,
|
|
146
147
|
accessibilityRole: "radiogroup",
|
|
147
|
-
children: items.map(({
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
148
|
+
children: items.map((_ref2, index) => {
|
|
149
|
+
let {
|
|
150
|
+
title,
|
|
151
|
+
content,
|
|
152
|
+
id,
|
|
153
|
+
onChange: itemOnChange,
|
|
154
|
+
...itemRest
|
|
155
|
+
} = _ref2;
|
|
156
|
+
const cardId = id || "RadioCard[".concat(index, "]");
|
|
155
157
|
|
|
156
158
|
const handleChange = (newCheckedState, event) => {
|
|
157
159
|
if (typeof itemOnChange === 'function') itemOnChange(newCheckedState, event);
|
package/lib/Search/Search.js
CHANGED
|
@@ -38,11 +38,12 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
38
38
|
const [selectContainerProps, selectedContainerPropTypes] = (0, _utils.selectSystemProps)([_utils.a11yProps, _utils.viewProps]);
|
|
39
39
|
const [selectInputProps, selectedInputPropTypes] = (0, _utils.selectSystemProps)([_utils.textInputHandlerProps, _utils.textInputProps]);
|
|
40
40
|
|
|
41
|
-
const selectInputTokens =
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
const selectInputTokens = _ref => {
|
|
42
|
+
let {
|
|
43
|
+
searchTokens,
|
|
44
|
+
buttonTokens,
|
|
45
|
+
buttonsGapSize
|
|
46
|
+
} = _ref;
|
|
46
47
|
const {
|
|
47
48
|
paddingRight: inputPaddingRight,
|
|
48
49
|
clearButtonIcon,
|
|
@@ -62,19 +63,25 @@ const selectInputTokens = ({
|
|
|
62
63
|
|
|
63
64
|
const selectButtonTokens = tokens => (0, _utils.selectTokens)('Button', tokens);
|
|
64
65
|
|
|
65
|
-
const selectIconsContainerStyle =
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
const selectIconsContainerStyle = _ref2 => {
|
|
67
|
+
let {
|
|
68
|
+
paddingRight
|
|
69
|
+
} = _ref2;
|
|
70
|
+
return {
|
|
71
|
+
paddingRight
|
|
72
|
+
};
|
|
73
|
+
};
|
|
70
74
|
|
|
71
|
-
const selectIconTokens =
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
const selectIconTokens = _ref3 => {
|
|
76
|
+
let {
|
|
77
|
+
iconSize,
|
|
78
|
+
iconColor
|
|
79
|
+
} = _ref3;
|
|
80
|
+
return {
|
|
81
|
+
color: iconColor,
|
|
82
|
+
size: iconSize
|
|
83
|
+
};
|
|
84
|
+
};
|
|
78
85
|
/**
|
|
79
86
|
* The `Search` component is a combination of a `TextInput` and 2 different kinds of custom buttons.
|
|
80
87
|
* Use `Search` to feature autocomplete interactions.
|
|
@@ -90,20 +97,22 @@ const selectIconTokens = ({
|
|
|
90
97
|
*/
|
|
91
98
|
|
|
92
99
|
|
|
93
|
-
const Search = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
100
|
+
const Search = /*#__PURE__*/(0, _react.forwardRef)((_ref4, ref) => {
|
|
101
|
+
let {
|
|
102
|
+
initialValue,
|
|
103
|
+
value,
|
|
104
|
+
placeholder,
|
|
105
|
+
inactive,
|
|
106
|
+
onChange,
|
|
107
|
+
onSubmit,
|
|
108
|
+
onClear,
|
|
109
|
+
onFocus,
|
|
110
|
+
accessibilityLabel,
|
|
111
|
+
copy = 'en',
|
|
112
|
+
tokens,
|
|
113
|
+
variant,
|
|
114
|
+
...rest
|
|
115
|
+
} = _ref4;
|
|
107
116
|
const {
|
|
108
117
|
currentValue = '',
|
|
109
118
|
setValue
|
|
@@ -141,11 +150,15 @@ const Search = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
141
150
|
if (onClear !== undefined) onClear('', event);
|
|
142
151
|
};
|
|
143
152
|
|
|
153
|
+
const handleFocus = event => {
|
|
154
|
+
if (onFocus !== undefined) onFocus(event);
|
|
155
|
+
};
|
|
156
|
+
|
|
144
157
|
const isEmpty = currentValue === ''; // Accessibility label should always be present and correctly localised
|
|
145
158
|
|
|
146
159
|
const a11yLabelText = accessibilityLabel || getCopy('accessibilityLabel'); // Placeholder is optional and may be unset by passing an empty string
|
|
147
160
|
|
|
148
|
-
const placeholderText = placeholder
|
|
161
|
+
const placeholderText = placeholder !== null && placeholder !== void 0 ? placeholder : a11yLabelText;
|
|
149
162
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, {
|
|
150
163
|
style: staticStyles.container,
|
|
151
164
|
...selectContainerProps(rest),
|
|
@@ -165,6 +178,7 @@ const Search = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
165
178
|
value: currentValue,
|
|
166
179
|
onChange: setValue,
|
|
167
180
|
onSubmitEditing: handleSubmit,
|
|
181
|
+
onFocus: handleFocus,
|
|
168
182
|
accessibilityLabel: a11yLabelText
|
|
169
183
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
170
184
|
style: [staticStyles.iconsContainer, selectIconsContainerStyle(themeTokens)],
|
|
@@ -235,6 +249,12 @@ Search.propTypes = { ...selectedContainerPropTypes,
|
|
|
235
249
|
onClear: _propTypes.default.func,
|
|
236
250
|
|
|
237
251
|
/**
|
|
252
|
+
* Triggered when the search input is focused.
|
|
253
|
+
*/
|
|
254
|
+
onFocus: _propTypes.default.func,
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
*
|
|
238
258
|
* Use to provide an accessible label for the input (visually hidden).
|
|
239
259
|
*/
|
|
240
260
|
accessibilityLabel: _propTypes.default.string,
|
package/lib/Select/Group.js
CHANGED
|
@@ -15,10 +15,11 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
15
15
|
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
17
|
|
|
18
|
-
const Group =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
const Group = _ref => {
|
|
19
|
+
let {
|
|
20
|
+
children,
|
|
21
|
+
label
|
|
22
|
+
} = _ref;
|
|
22
23
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("optgroup", {
|
|
23
24
|
label: label,
|
|
24
25
|
children: children
|
|
@@ -11,9 +11,10 @@ var _utils = require("../utils");
|
|
|
11
11
|
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
|
|
14
|
-
const Group =
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
const Group = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
children
|
|
17
|
+
} = _ref;
|
|
17
18
|
return children;
|
|
18
19
|
};
|
|
19
20
|
|
package/lib/Select/Item.js
CHANGED
|
@@ -13,13 +13,16 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
13
13
|
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
|
|
16
|
-
const Item =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
const Item = _ref => {
|
|
17
|
+
let {
|
|
18
|
+
children,
|
|
19
|
+
value
|
|
20
|
+
} = _ref;
|
|
21
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
22
|
+
value: value,
|
|
23
|
+
children: children
|
|
24
|
+
});
|
|
25
|
+
};
|
|
23
26
|
|
|
24
27
|
var _default = Item;
|
|
25
28
|
exports.default = _default;
|
|
@@ -5,15 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
|
|
10
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
|
|
12
8
|
const Item = () => null;
|
|
13
9
|
|
|
14
10
|
var _default = Item;
|
|
15
|
-
exports.default = _default;
|
|
16
|
-
Item.propTypes = {
|
|
17
|
-
children: _propTypes.default.string.isRequired,
|
|
18
|
-
value: _propTypes.default.string.isRequired
|
|
19
|
-
};
|
|
11
|
+
exports.default = _default;
|
package/lib/Select/Picker.js
CHANGED
|
@@ -19,21 +19,22 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
19
19
|
|
|
20
20
|
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; }
|
|
21
21
|
|
|
22
|
-
const Picker = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
22
|
+
const Picker = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
23
|
+
let {
|
|
24
|
+
value,
|
|
25
|
+
onChange,
|
|
26
|
+
onFocus,
|
|
27
|
+
onBlur,
|
|
28
|
+
onMouseOver,
|
|
29
|
+
onMouseOut,
|
|
30
|
+
style,
|
|
31
|
+
inactive,
|
|
32
|
+
children,
|
|
33
|
+
placeholder,
|
|
34
|
+
nativeID,
|
|
35
|
+
testID,
|
|
36
|
+
...rest
|
|
37
|
+
} = _ref;
|
|
37
38
|
const {
|
|
38
39
|
accessibilityLabel,
|
|
39
40
|
accessibilityDescribedBy,
|