@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
|
@@ -38,33 +38,45 @@ const selectContainerStyles = tokens => ({ ...tokens
|
|
|
38
38
|
|
|
39
39
|
const selectTextStyles = tokens => (0, _ThemeProvider.applyTextStyles)((0, _utils.selectTokens)('Typography', tokens));
|
|
40
40
|
|
|
41
|
-
const selectIconProps =
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
41
|
+
const selectIconProps = _ref => {
|
|
42
|
+
let {
|
|
43
|
+
iconSize,
|
|
44
|
+
iconColor
|
|
45
|
+
} = _ref;
|
|
46
|
+
return {
|
|
47
|
+
size: iconSize,
|
|
48
|
+
color: iconColor
|
|
49
|
+
};
|
|
50
|
+
};
|
|
48
51
|
|
|
49
|
-
const selectIconContainerStyles =
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
const selectIconContainerStyles = _ref2 => {
|
|
53
|
+
let {
|
|
54
|
+
iconGap
|
|
55
|
+
} = _ref2;
|
|
56
|
+
return {
|
|
57
|
+
paddingRight: iconGap
|
|
58
|
+
};
|
|
59
|
+
};
|
|
54
60
|
|
|
55
|
-
const selectDismissIconProps =
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
const selectDismissIconProps = _ref3 => {
|
|
62
|
+
let {
|
|
63
|
+
dismissIconSize,
|
|
64
|
+
dismissIconColor
|
|
65
|
+
} = _ref3;
|
|
66
|
+
return {
|
|
67
|
+
size: dismissIconSize,
|
|
68
|
+
color: dismissIconColor
|
|
69
|
+
};
|
|
70
|
+
};
|
|
62
71
|
|
|
63
|
-
const selectDismissButtonContainerStyles =
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
72
|
+
const selectDismissButtonContainerStyles = _ref4 => {
|
|
73
|
+
let {
|
|
74
|
+
dismissButtonGap
|
|
75
|
+
} = _ref4;
|
|
76
|
+
return {
|
|
77
|
+
paddingLeft: dismissButtonGap
|
|
78
|
+
};
|
|
79
|
+
};
|
|
68
80
|
/**
|
|
69
81
|
* A banner that highlights important messages:
|
|
70
82
|
* - Status message to show there is an error or outage of services
|
|
@@ -118,15 +130,16 @@ const selectDismissButtonContainerStyles = ({
|
|
|
118
130
|
*/
|
|
119
131
|
|
|
120
132
|
|
|
121
|
-
const Notification = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
133
|
+
const Notification = /*#__PURE__*/(0, _react.forwardRef)((_ref5, ref) => {
|
|
134
|
+
let {
|
|
135
|
+
children,
|
|
136
|
+
system,
|
|
137
|
+
dismissible,
|
|
138
|
+
copy = 'en',
|
|
139
|
+
tokens,
|
|
140
|
+
variant,
|
|
141
|
+
...rest
|
|
142
|
+
} = _ref5;
|
|
130
143
|
const [isDismissed, setIsDismissed] = (0, _react.useState)(false);
|
|
131
144
|
const themeTokens = (0, _ThemeProvider.useThemeTokens)('Notification', tokens, variant, {
|
|
132
145
|
system
|
|
@@ -27,16 +27,17 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
27
27
|
|
|
28
28
|
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; }
|
|
29
29
|
|
|
30
|
-
const PageButton = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
30
|
+
const PageButton = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
31
|
+
let {
|
|
32
|
+
label,
|
|
33
|
+
onPress,
|
|
34
|
+
href,
|
|
35
|
+
isActive,
|
|
36
|
+
copy,
|
|
37
|
+
variant,
|
|
38
|
+
tokens,
|
|
39
|
+
...props
|
|
40
|
+
} = _ref;
|
|
40
41
|
const getTokens = (0, _ThemeProvider.useThemeTokensCallback)('PaginationPageButton', tokens, variant);
|
|
41
42
|
const getCopy = (0, _useCopy.default)({
|
|
42
43
|
dictionary: _dictionary.default,
|
|
@@ -53,8 +54,8 @@ const PageButton = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
53
54
|
key: 'active-item'
|
|
54
55
|
} : {};
|
|
55
56
|
const accessibilityRole = href !== undefined ? 'link' : 'button';
|
|
56
|
-
const activeLabel = isActive ?
|
|
57
|
-
const accessibilityLabel =
|
|
57
|
+
const activeLabel = isActive ? " ".concat(getCopy('currentLabel')) : '';
|
|
58
|
+
const accessibilityLabel = "".concat(getCopy('goToLabel'), " ").concat(label).concat(activeLabel);
|
|
58
59
|
|
|
59
60
|
const {
|
|
60
61
|
hrefAttrs,
|
|
@@ -37,31 +37,35 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
37
37
|
|
|
38
38
|
const [selectProps, selectedSystemPropTypes] = (0, _utils.selectSystemProps)([_utils.a11yProps, _utils.viewProps]);
|
|
39
39
|
|
|
40
|
-
const selectTextStyles =
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
40
|
+
const selectTextStyles = _ref => {
|
|
41
|
+
let {
|
|
42
|
+
color,
|
|
43
|
+
fontName,
|
|
44
|
+
fontSize,
|
|
45
|
+
fontWeight,
|
|
46
|
+
lineHeight
|
|
47
|
+
} = _ref;
|
|
48
|
+
return (0, _ThemeProvider.applyTextStyles)({
|
|
49
|
+
color,
|
|
50
|
+
fontName,
|
|
51
|
+
fontSize,
|
|
52
|
+
fontWeight,
|
|
53
|
+
lineHeight
|
|
54
|
+
});
|
|
55
|
+
};
|
|
53
56
|
|
|
54
|
-
const Pagination = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
57
|
+
const Pagination = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
|
|
58
|
+
let {
|
|
59
|
+
children,
|
|
60
|
+
copy = 'en',
|
|
61
|
+
variant,
|
|
62
|
+
tokens,
|
|
63
|
+
sideButtonVariant,
|
|
64
|
+
sideButtonTokens,
|
|
65
|
+
LinkRouter,
|
|
66
|
+
linkRouterProps,
|
|
67
|
+
...rest
|
|
68
|
+
} = _ref2;
|
|
65
69
|
const viewport = (0, _ViewportProvider.useViewport)();
|
|
66
70
|
const {
|
|
67
71
|
truncateAbove,
|
|
@@ -102,9 +106,11 @@ const Pagination = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
102
106
|
LinkRouter: LinkRouter,
|
|
103
107
|
linkRouterProps: linkRouterProps
|
|
104
108
|
}), ...items.map((_child, itemIndex) => {
|
|
105
|
-
|
|
109
|
+
var _itemProps$LinkRouter;
|
|
110
|
+
|
|
111
|
+
const buttonLabel = "".concat(itemIndex + 1);
|
|
106
112
|
const itemProps = getItemProps(itemIndex);
|
|
107
|
-
const ItemLinkRouter = itemProps.LinkRouter
|
|
113
|
+
const ItemLinkRouter = (_itemProps$LinkRouter = itemProps.LinkRouter) !== null && _itemProps$LinkRouter !== void 0 ? _itemProps$LinkRouter : LinkRouter;
|
|
108
114
|
const itemLinkRouterProps = { ...linkRouterProps,
|
|
109
115
|
...itemProps.linkRouterProps
|
|
110
116
|
};
|
|
@@ -140,12 +146,19 @@ const Pagination = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
140
146
|
ref: ref,
|
|
141
147
|
...selectProps(rest),
|
|
142
148
|
children: buttons // keep the keys in-line with the page numbers regardless of which buttons are actually rendered
|
|
143
|
-
.map((element, index) => [element,
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
}
|
|
149
|
+
.map((element, index) => [element, "page-".concat(index + 1)]).filter(_ref3 => {
|
|
150
|
+
let [element] = _ref3;
|
|
151
|
+
return element !== null;
|
|
152
|
+
}).map(_ref4 => {
|
|
153
|
+
let [element, key] = _ref4;
|
|
154
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
155
|
+
right: gap,
|
|
156
|
+
children: element
|
|
157
|
+
}, key);
|
|
158
|
+
})
|
|
147
159
|
});
|
|
148
160
|
});
|
|
161
|
+
Pagination.displayName = 'Pagination';
|
|
149
162
|
_PageButton.default.displayName = 'PageButton';
|
|
150
163
|
Pagination.PageButton = _PageButton.default;
|
|
151
164
|
Pagination.propTypes = { ...selectedSystemPropTypes,
|
|
@@ -33,11 +33,12 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
33
33
|
|
|
34
34
|
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; }
|
|
35
35
|
|
|
36
|
-
const selectIconTokens = ({
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
const selectIconTokens = (_ref, direction) => {
|
|
37
|
+
let {
|
|
38
|
+
color,
|
|
39
|
+
iconSize,
|
|
40
|
+
iconDisplace
|
|
41
|
+
} = _ref;
|
|
41
42
|
return {
|
|
42
43
|
color,
|
|
43
44
|
size: iconSize,
|
|
@@ -49,15 +50,16 @@ const directionToSide = {
|
|
|
49
50
|
previous: 'left',
|
|
50
51
|
next: 'right'
|
|
51
52
|
};
|
|
52
|
-
const SideButton = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
53
|
+
const SideButton = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
|
|
54
|
+
let {
|
|
55
|
+
direction = 'previous',
|
|
56
|
+
onPress,
|
|
57
|
+
href,
|
|
58
|
+
copy,
|
|
59
|
+
variant,
|
|
60
|
+
tokens,
|
|
61
|
+
...props
|
|
62
|
+
} = _ref2;
|
|
61
63
|
const viewport = (0, _ViewportProvider.useViewport)();
|
|
62
64
|
const buttonVariant = {
|
|
63
65
|
direction,
|
|
@@ -99,10 +101,11 @@ const SideButton = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
99
101
|
ref: ref,
|
|
100
102
|
...buttonProps,
|
|
101
103
|
tokens: getButtonTokens,
|
|
102
|
-
children:
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
104
|
+
children: _ref3 => {
|
|
105
|
+
let {
|
|
106
|
+
textStyles,
|
|
107
|
+
...buttonState
|
|
108
|
+
} = _ref3;
|
|
106
109
|
const iconProps = {
|
|
107
110
|
tokens: getIconTokens(buttonState)
|
|
108
111
|
};
|
|
@@ -12,15 +12,16 @@ exports.default = void 0;
|
|
|
12
12
|
* @param {React.Element[]} items
|
|
13
13
|
* @param {number} truncateAbove
|
|
14
14
|
*/
|
|
15
|
-
function usePagination({
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
function usePagination(_ref) {
|
|
16
|
+
let {
|
|
17
|
+
items,
|
|
18
|
+
truncateAbove
|
|
19
|
+
} = _ref;
|
|
19
20
|
const activeItemIndex = Math.max(items.findIndex(item => item.props.isActive), 0 // default to the first item if none is marked as active
|
|
20
21
|
);
|
|
21
22
|
|
|
22
23
|
const getItemProps = index => {
|
|
23
|
-
var _items$index;
|
|
24
|
+
var _items$index$props, _items$index;
|
|
24
25
|
|
|
25
26
|
const {
|
|
26
27
|
onPress,
|
|
@@ -28,7 +29,7 @@ function usePagination({
|
|
|
28
29
|
hrefAttrs,
|
|
29
30
|
variant,
|
|
30
31
|
tokens
|
|
31
|
-
} = ((_items$index = items[index]) === null || _items$index === void 0 ? void 0 : _items$index.props)
|
|
32
|
+
} = (_items$index$props = (_items$index = items[index]) === null || _items$index === void 0 ? void 0 : _items$index.props) !== null && _items$index$props !== void 0 ? _items$index$props : {};
|
|
32
33
|
return {
|
|
33
34
|
onPress,
|
|
34
35
|
href,
|
package/lib/Progress/Progress.js
CHANGED
|
@@ -25,19 +25,22 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
25
25
|
|
|
26
26
|
const [selectProps, selectedSystemPropTypes] = (0, _utils.selectSystemProps)([_utils.a11yProps, _utils.viewProps]);
|
|
27
27
|
|
|
28
|
-
const selectProgressStyles =
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
28
|
+
const selectProgressStyles = _ref => {
|
|
29
|
+
let {
|
|
30
|
+
backgroundColor,
|
|
31
|
+
borderWidth,
|
|
32
|
+
borderColor,
|
|
33
|
+
borderRadius,
|
|
34
|
+
height
|
|
35
|
+
} = _ref;
|
|
36
|
+
return {
|
|
37
|
+
backgroundColor,
|
|
38
|
+
borderWidth,
|
|
39
|
+
borderColor,
|
|
40
|
+
borderRadius,
|
|
41
|
+
height
|
|
42
|
+
};
|
|
43
|
+
};
|
|
41
44
|
/**
|
|
42
45
|
* The `Progress` is a container for displaying one or several `ProgressBar`s.
|
|
43
46
|
*
|
|
@@ -69,12 +72,13 @@ const selectProgressStyles = ({
|
|
|
69
72
|
*/
|
|
70
73
|
|
|
71
74
|
|
|
72
|
-
const Progress = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
const Progress = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
|
|
76
|
+
let {
|
|
77
|
+
children,
|
|
78
|
+
tokens,
|
|
79
|
+
variant,
|
|
80
|
+
...rest
|
|
81
|
+
} = _ref2;
|
|
78
82
|
const themeTokens = (0, _ThemeProvider.useThemeTokens)('Progress', tokens, variant);
|
|
79
83
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
80
84
|
ref: ref,
|
|
@@ -31,18 +31,21 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
31
31
|
|
|
32
32
|
const [selectProps, selectedSystemPropTypes] = (0, _utils.selectSystemProps)([_utils.a11yProps, _utils.viewProps]);
|
|
33
33
|
|
|
34
|
-
const selectBarStyles = ({
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
34
|
+
const selectBarStyles = (_ref, percentage) => {
|
|
35
|
+
let {
|
|
36
|
+
backgroundColor,
|
|
37
|
+
borderRadius,
|
|
38
|
+
outlineWidth,
|
|
39
|
+
outlineColor
|
|
40
|
+
} = _ref;
|
|
41
|
+
return {
|
|
42
|
+
backgroundColor,
|
|
43
|
+
borderRadius,
|
|
44
|
+
outlineWidth,
|
|
45
|
+
outlineColor,
|
|
46
|
+
width: "".concat(percentage, "%")
|
|
47
|
+
};
|
|
48
|
+
};
|
|
46
49
|
/**
|
|
47
50
|
* The `ProgressBar` is a visual representation of linear progression.
|
|
48
51
|
* It provides simple but important information at a quick glance.
|
|
@@ -79,13 +82,14 @@ const selectBarStyles = ({
|
|
|
79
82
|
*/
|
|
80
83
|
|
|
81
84
|
|
|
82
|
-
const ProgressBar = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
85
|
+
const ProgressBar = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
|
|
86
|
+
let {
|
|
87
|
+
children = null,
|
|
88
|
+
percentage = 0,
|
|
89
|
+
tokens,
|
|
90
|
+
variant,
|
|
91
|
+
...rest
|
|
92
|
+
} = _ref2;
|
|
89
93
|
const themeTokens = (0, _ThemeProvider.useThemeTokens)('ProgressBar', tokens, variant);
|
|
90
94
|
|
|
91
95
|
if (percentage < 0) {
|
|
@@ -100,7 +104,7 @@ const ProgressBar = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
100
104
|
min: 0,
|
|
101
105
|
max: 100,
|
|
102
106
|
now: percentage,
|
|
103
|
-
text:
|
|
107
|
+
text: "".concat(percentage, "%")
|
|
104
108
|
},
|
|
105
109
|
...rest
|
|
106
110
|
});
|
|
@@ -108,7 +112,7 @@ const ProgressBar = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
108
112
|
ref: ref,
|
|
109
113
|
style: [staticStyles.bar, selectBarStyles(themeTokens, percentage)],
|
|
110
114
|
...selectedProps,
|
|
111
|
-
children: children
|
|
115
|
+
children: children !== null && children !== void 0 ? children : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBarBackground.default, {
|
|
112
116
|
variant: variant
|
|
113
117
|
})
|
|
114
118
|
}) : null;
|
|
@@ -21,11 +21,12 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
21
21
|
|
|
22
22
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
23
|
|
|
24
|
-
const inactiveBackground =
|
|
25
|
-
const negativeBackground =
|
|
26
|
-
const ProgressBarBackground = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
const inactiveBackground = "%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='24'%3E%3Cdefs%3E%3Cpattern id='DisabledProgress7' patternUnits='userSpaceOnUse' width='8' height='8'%3E%3Crect width='8' height='8' fill='%23B2B9BF'%3E%3C/rect%3E%3Ccircle cx='4' cy='4' r='2' fill='%23676E73' stroke='%23676E73' stroke-width='0'%3E%3C/circle%3E%3Ccircle cx='0' cy='0' r='2' fill='%23676E73' stroke='%23676E73' stroke-width='0'%3E%3C/circle%3E%3Ccircle cx='0' cy='8' r='2' fill='%23676E73' stroke='%23676E73' stroke-width='0'%3E%3C/circle%3E%3Ccircle cx='8' cy='0' r='2' fill='%23676E73' stroke='%23676E73' stroke-width='0'%3E%3C/circle%3E%3Ccircle cx='8' cy='8' r='2' fill='%23676E73' stroke='%23676E73' stroke-width='0'%3E%3C/circle%3E%3C/pattern%3E%3C/defs%3E%3Cpath d='M 0 0 L 0 140 L 2000 2000 L 2000 0 Z' style='fill: url("%23DisabledProgress7");'%3E%3C/path%3E%3C/svg%3E";
|
|
25
|
+
const negativeBackground = "%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='24'%3E%3Cdefs%3E%3Cpattern id='NegativeProgress6' patternUnits='userSpaceOnUse' width='8' height='8'%3E%3Crect width='8' height='8' fill='%23C12335'%3E%3C/rect%3E%3Cpath d='M 0,8 l 8,-8 M -2,2 l 4,-4 M 6,10 l 4,-4' stroke-width='2' shape-rendering='auto' stroke='%23e7adb4' stroke-linecap='square'%3E%3C/path%3E%3C/pattern%3E%3C/defs%3E%3Cpath d='M 0 0 L 0 140 L 2000 2000 L 2000 0 Z' style='fill: url("%23NegativeProgress6");'%3E%3C/path%3E%3C/svg%3E";
|
|
26
|
+
const ProgressBarBackground = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
27
|
+
let {
|
|
28
|
+
variant
|
|
29
|
+
} = _ref;
|
|
29
30
|
let source = null;
|
|
30
31
|
|
|
31
32
|
if (variant !== null && variant !== void 0 && variant.inactive) {
|
|
@@ -39,7 +40,7 @@ const ProgressBarBackground = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
39
40
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ImageBackground.default, {
|
|
40
41
|
ref: ref,
|
|
41
42
|
source: {
|
|
42
|
-
uri:
|
|
43
|
+
uri: "data:image/svg+xml,".concat(source)
|
|
43
44
|
},
|
|
44
45
|
style: staticStyles.imageBackground
|
|
45
46
|
});
|
package/lib/Radio/Radio.js
CHANGED
|
@@ -37,56 +37,65 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
37
37
|
|
|
38
38
|
const [selectProps, selectedSystemPropTypes] = (0, _utils.selectSystemProps)([_utils.a11yProps, _utils.focusHandlerProps, _utils.viewProps]);
|
|
39
39
|
|
|
40
|
-
const selectContainerStyles =
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
40
|
+
const selectContainerStyles = _ref => {
|
|
41
|
+
let {
|
|
42
|
+
containerBackgroundColor,
|
|
43
|
+
containerBorderRadius,
|
|
44
|
+
containerOpacity,
|
|
45
|
+
containerPaddingBottom,
|
|
46
|
+
containerPaddingLeft,
|
|
47
|
+
containerPaddingRight,
|
|
48
|
+
containerPaddingTop,
|
|
49
|
+
containerShadow
|
|
50
|
+
} = _ref;
|
|
51
|
+
return {
|
|
52
|
+
backgroundColor: containerBackgroundColor,
|
|
53
|
+
borderRadius: containerBorderRadius,
|
|
54
|
+
opacity: containerOpacity,
|
|
55
|
+
paddingBottom: containerPaddingBottom,
|
|
56
|
+
paddingLeft: containerPaddingLeft,
|
|
57
|
+
paddingRight: containerPaddingRight,
|
|
58
|
+
paddingTop: containerPaddingTop,
|
|
59
|
+
...(0, _ThemeProvider.applyShadowToken)(containerShadow)
|
|
60
|
+
};
|
|
61
|
+
};
|
|
59
62
|
|
|
60
|
-
const selectDescriptionStyles =
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
63
|
+
const selectDescriptionStyles = _ref2 => {
|
|
64
|
+
let {
|
|
65
|
+
containerPaddingLeft = 0,
|
|
66
|
+
descriptionFontSize,
|
|
67
|
+
descriptionLineHeight,
|
|
68
|
+
descriptionMarginLeft,
|
|
69
|
+
inputSize,
|
|
70
|
+
labelMarginLeft = 0
|
|
71
|
+
} = _ref2;
|
|
72
|
+
return {
|
|
73
|
+
marginLeft: descriptionMarginLeft !== null && descriptionMarginLeft !== void 0 ? descriptionMarginLeft : containerPaddingLeft + inputSize + labelMarginLeft,
|
|
74
|
+
...(0, _ThemeProvider.applyTextStyles)({
|
|
75
|
+
fontSize: descriptionFontSize,
|
|
76
|
+
lineHeight: descriptionLineHeight
|
|
77
|
+
})
|
|
78
|
+
};
|
|
79
|
+
};
|
|
74
80
|
|
|
75
|
-
const selectLabelStyles =
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
81
|
+
const selectLabelStyles = _ref3 => {
|
|
82
|
+
let {
|
|
83
|
+
labelColor,
|
|
84
|
+
labelFontName,
|
|
85
|
+
labelFontSize,
|
|
86
|
+
labelFontWeight,
|
|
87
|
+
labelMarginLeft,
|
|
88
|
+
labelLineHeight
|
|
89
|
+
} = _ref3;
|
|
90
|
+
return (0, _ThemeProvider.applyTextStyles)({
|
|
91
|
+
color: labelColor,
|
|
92
|
+
fontName: labelFontName,
|
|
93
|
+
fontWeight: labelFontWeight,
|
|
94
|
+
fontSize: labelFontSize,
|
|
95
|
+
lineHeight: labelLineHeight,
|
|
96
|
+
marginLeft: labelMarginLeft
|
|
97
|
+
});
|
|
98
|
+
};
|
|
90
99
|
/**
|
|
91
100
|
* Basic Radio component.
|
|
92
101
|
*
|
|
@@ -121,21 +130,22 @@ const selectLabelStyles = ({
|
|
|
121
130
|
*/
|
|
122
131
|
|
|
123
132
|
|
|
124
|
-
const Radio = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
133
|
+
const Radio = /*#__PURE__*/(0, _react.forwardRef)((_ref4, ref) => {
|
|
134
|
+
let {
|
|
135
|
+
checked,
|
|
136
|
+
defaultChecked,
|
|
137
|
+
description,
|
|
138
|
+
error = false,
|
|
139
|
+
id,
|
|
140
|
+
inactive,
|
|
141
|
+
label,
|
|
142
|
+
name: inputName,
|
|
143
|
+
onChange,
|
|
144
|
+
tokens,
|
|
145
|
+
value,
|
|
146
|
+
variant,
|
|
147
|
+
...rest
|
|
148
|
+
} = _ref4;
|
|
139
149
|
const {
|
|
140
150
|
currentValue: isChecked,
|
|
141
151
|
setValue: setIsChecked,
|
|
@@ -164,7 +174,7 @@ const Radio = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
164
174
|
};
|
|
165
175
|
|
|
166
176
|
const uniqueId = (0, _utils.useUniqueId)('radio');
|
|
167
|
-
const inputId = id
|
|
177
|
+
const inputId = id !== null && id !== void 0 ? id : uniqueId;
|
|
168
178
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Pressable.default, {
|
|
169
179
|
ref: ref,
|
|
170
180
|
disabled: inactive,
|
|
@@ -176,11 +186,12 @@ const Radio = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
176
186
|
disabled: inactive
|
|
177
187
|
},
|
|
178
188
|
...selectProps(rest),
|
|
179
|
-
children:
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
189
|
+
children: _ref5 => {
|
|
190
|
+
let {
|
|
191
|
+
focused: focus,
|
|
192
|
+
hovered: hover,
|
|
193
|
+
pressed
|
|
194
|
+
} = _ref5;
|
|
184
195
|
const stateTokens = getTokens({
|
|
185
196
|
focus,
|
|
186
197
|
hover,
|