@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
|
@@ -11,26 +11,28 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
11
11
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
12
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, inputSupportsProps, viewProps]);
|
|
13
13
|
|
|
14
|
-
const selectInputStyles = ({
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
14
|
+
const selectInputStyles = (_ref, inactive) => {
|
|
15
|
+
let {
|
|
16
|
+
backgroundColor,
|
|
17
|
+
color,
|
|
18
|
+
borderWidth = 0,
|
|
19
|
+
borderColor,
|
|
20
|
+
borderRadius,
|
|
21
|
+
paddingTop,
|
|
22
|
+
paddingBottom,
|
|
23
|
+
paddingLeft = 0,
|
|
24
|
+
paddingRight,
|
|
25
|
+
fontName,
|
|
26
|
+
fontSize,
|
|
27
|
+
fontWeight,
|
|
28
|
+
lineHeight,
|
|
29
|
+
icon,
|
|
30
|
+
iconSize = 0,
|
|
31
|
+
validationIcon,
|
|
32
|
+
validationIconSize = 0,
|
|
33
|
+
height
|
|
34
|
+
} = _ref;
|
|
35
|
+
|
|
34
36
|
// Subtract border width from padding so overall input width/height doesn't
|
|
35
37
|
// jump around if the border width changes (avoiding NaN and negative padding)
|
|
36
38
|
const offsetBorder = value => typeof value === 'number' ? Math.max(0, value - borderWidth) : value;
|
|
@@ -80,53 +82,68 @@ const selectInputStyles = ({
|
|
|
80
82
|
};
|
|
81
83
|
};
|
|
82
84
|
|
|
83
|
-
const selectOuterBorderStyles =
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
outerBorderColor,
|
|
87
|
-
borderRadius
|
|
88
|
-
}) => ({
|
|
89
|
-
background: outerBackgroundColor,
|
|
90
|
-
...applyOuterBorder({
|
|
91
|
-
outerBorderColor,
|
|
85
|
+
const selectOuterBorderStyles = _ref2 => {
|
|
86
|
+
let {
|
|
87
|
+
outerBackgroundColor,
|
|
92
88
|
outerBorderWidth,
|
|
89
|
+
outerBorderColor,
|
|
93
90
|
borderRadius
|
|
94
|
-
}
|
|
95
|
-
|
|
91
|
+
} = _ref2;
|
|
92
|
+
return {
|
|
93
|
+
background: outerBackgroundColor,
|
|
94
|
+
...applyOuterBorder({
|
|
95
|
+
outerBorderColor,
|
|
96
|
+
outerBorderWidth,
|
|
97
|
+
borderRadius
|
|
98
|
+
})
|
|
99
|
+
};
|
|
100
|
+
};
|
|
96
101
|
|
|
97
|
-
const selectIconTokens =
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
const selectIconTokens = _ref3 => {
|
|
103
|
+
let {
|
|
104
|
+
iconSize,
|
|
105
|
+
iconColor
|
|
106
|
+
} = _ref3;
|
|
107
|
+
return {
|
|
108
|
+
size: iconSize,
|
|
109
|
+
color: iconColor
|
|
110
|
+
};
|
|
111
|
+
};
|
|
104
112
|
|
|
105
|
-
const selectIconContainerStyles =
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
113
|
+
const selectIconContainerStyles = _ref4 => {
|
|
114
|
+
let {
|
|
115
|
+
paddingRight,
|
|
116
|
+
paddingBottom
|
|
117
|
+
} = _ref4;
|
|
118
|
+
return {
|
|
119
|
+
paddingRight,
|
|
120
|
+
paddingBottom
|
|
121
|
+
};
|
|
122
|
+
};
|
|
112
123
|
|
|
113
|
-
const selectValidationIconTokens =
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
124
|
+
const selectValidationIconTokens = _ref5 => {
|
|
125
|
+
let {
|
|
126
|
+
validationIconSize,
|
|
127
|
+
validationIconColor
|
|
128
|
+
} = _ref5;
|
|
129
|
+
return {
|
|
130
|
+
size: validationIconSize,
|
|
131
|
+
color: validationIconColor
|
|
132
|
+
};
|
|
133
|
+
};
|
|
120
134
|
|
|
121
|
-
const selectValidationIconContainerStyles =
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
135
|
+
const selectValidationIconContainerStyles = _ref6 => {
|
|
136
|
+
let {
|
|
137
|
+
icon,
|
|
138
|
+
iconSize = 0,
|
|
139
|
+
paddingRight = 0,
|
|
140
|
+
paddingBottom
|
|
141
|
+
} = _ref6;
|
|
142
|
+
return {
|
|
143
|
+
paddingRight: icon ? paddingRight + iconSize : paddingRight,
|
|
144
|
+
paddingBottom
|
|
145
|
+
};
|
|
146
|
+
};
|
|
130
147
|
/**
|
|
131
148
|
* A basic form single-choice select component. Use in forms or individually to receive user's input.
|
|
132
149
|
*
|
|
@@ -161,20 +178,21 @@ const selectValidationIconContainerStyles = ({
|
|
|
161
178
|
*/
|
|
162
179
|
|
|
163
180
|
|
|
164
|
-
const Select = /*#__PURE__*/forwardRef(({
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
181
|
+
const Select = /*#__PURE__*/forwardRef((_ref7, ref) => {
|
|
182
|
+
let {
|
|
183
|
+
value,
|
|
184
|
+
initialValue,
|
|
185
|
+
onChange,
|
|
186
|
+
children,
|
|
187
|
+
inactive,
|
|
188
|
+
readOnly,
|
|
189
|
+
placeholder,
|
|
190
|
+
validation,
|
|
191
|
+
tokens,
|
|
192
|
+
variant,
|
|
193
|
+
testID,
|
|
194
|
+
...rest
|
|
195
|
+
} = _ref7;
|
|
178
196
|
const {
|
|
179
197
|
currentValue,
|
|
180
198
|
setValue
|
|
@@ -212,44 +230,47 @@ const Select = /*#__PURE__*/forwardRef(({
|
|
|
212
230
|
} = themeTokens;
|
|
213
231
|
return /*#__PURE__*/_jsx(InputSupports, { ...supportsProps,
|
|
214
232
|
...selectedProps,
|
|
215
|
-
children:
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
233
|
+
children: _ref8 => {
|
|
234
|
+
let {
|
|
235
|
+
inputId,
|
|
236
|
+
...props
|
|
237
|
+
} = _ref8;
|
|
238
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
239
|
+
style: selectOuterBorderStyles(themeTokens),
|
|
240
|
+
children: [/*#__PURE__*/_jsx(Picker, {
|
|
241
|
+
ref: ref,
|
|
242
|
+
style: selectInputStyles(themeTokens, inactive),
|
|
243
|
+
onFocus: handleFocus,
|
|
244
|
+
onBlur: handleBlur,
|
|
245
|
+
onMouseOver: handleMouseOver,
|
|
246
|
+
onMouseOut: handleMouseOut,
|
|
247
|
+
onChange: setValue,
|
|
248
|
+
value: currentValue,
|
|
249
|
+
inactive: inactive,
|
|
250
|
+
placeholder: placeholder !== undefined ? {
|
|
251
|
+
label: placeholder,
|
|
252
|
+
value: ''
|
|
253
|
+
} : undefined,
|
|
254
|
+
...props,
|
|
255
|
+
nativeID: inputId,
|
|
256
|
+
testID: testID,
|
|
257
|
+
children: children
|
|
258
|
+
}), ValidationIconComponent && /*#__PURE__*/_jsx(View, {
|
|
259
|
+
pointerEvents: "none",
|
|
260
|
+
style: [staticStyles.iconContainer, selectValidationIconContainerStyles(themeTokens)],
|
|
261
|
+
children: /*#__PURE__*/_jsx(ValidationIconComponent, { ...selectValidationIconTokens(themeTokens)
|
|
262
|
+
})
|
|
263
|
+
}), IconComponent && Platform.OS !== 'android' &&
|
|
264
|
+
/*#__PURE__*/
|
|
265
|
+
// we can't hide the default caret of a native picker on android
|
|
266
|
+
_jsx(View, {
|
|
267
|
+
pointerEvents: "none",
|
|
268
|
+
style: [staticStyles.iconContainer, selectIconContainerStyles(themeTokens)],
|
|
269
|
+
children: /*#__PURE__*/_jsx(IconComponent, { ...selectIconTokens(themeTokens)
|
|
270
|
+
})
|
|
271
|
+
})]
|
|
272
|
+
});
|
|
273
|
+
}
|
|
253
274
|
});
|
|
254
275
|
});
|
|
255
276
|
Select.displayName = 'Select';
|
|
@@ -7,18 +7,19 @@ import ItemContent from './ItemContent';
|
|
|
7
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
8
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, linkProps, viewProps]);
|
|
9
9
|
|
|
10
|
-
function selectItemStyles({
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
10
|
+
function selectItemStyles(_ref) {
|
|
11
|
+
let {
|
|
12
|
+
backgroundColor,
|
|
13
|
+
borderColor,
|
|
14
|
+
borderWidth,
|
|
15
|
+
borderStyle,
|
|
16
|
+
paddingLeft,
|
|
17
|
+
paddingRight,
|
|
18
|
+
paddingTop,
|
|
19
|
+
paddingBottom,
|
|
20
|
+
justifyContent,
|
|
21
|
+
verticalAlign
|
|
22
|
+
} = _ref;
|
|
22
23
|
return {
|
|
23
24
|
backgroundColor,
|
|
24
25
|
borderTopColor: borderColor,
|
|
@@ -39,20 +40,22 @@ function selectItemStyles({
|
|
|
39
40
|
*/
|
|
40
41
|
|
|
41
42
|
|
|
42
|
-
const Item = /*#__PURE__*/forwardRef(({
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
43
|
+
const Item = /*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
44
|
+
let {
|
|
45
|
+
children,
|
|
46
|
+
itemId,
|
|
47
|
+
groupId,
|
|
48
|
+
onPress,
|
|
49
|
+
isActive = false,
|
|
50
|
+
isExpanded = false,
|
|
51
|
+
tokens,
|
|
52
|
+
variant,
|
|
53
|
+
href,
|
|
54
|
+
accessibilityRole = 'link',
|
|
55
|
+
testID,
|
|
56
|
+
...props
|
|
57
|
+
} = _ref2;
|
|
58
|
+
|
|
56
59
|
const handlePress = () => onPress(itemId, groupId);
|
|
57
60
|
|
|
58
61
|
const {
|
|
@@ -68,13 +71,16 @@ const Item = /*#__PURE__*/forwardRef(({
|
|
|
68
71
|
});
|
|
69
72
|
const getTokens = useThemeTokensCallback('SideNavItem', tokens, variant);
|
|
70
73
|
|
|
71
|
-
const getAppearanceState =
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
const getAppearanceState = _ref3 => {
|
|
75
|
+
let {
|
|
76
|
+
hovered
|
|
77
|
+
} = _ref3;
|
|
78
|
+
return {
|
|
79
|
+
hover: hovered,
|
|
80
|
+
active: isActive,
|
|
81
|
+
expanded: isExpanded
|
|
82
|
+
};
|
|
83
|
+
};
|
|
78
84
|
|
|
79
85
|
const getPressableStyle = pressableState => selectItemStyles(getTokens(getAppearanceState(pressableState)));
|
|
80
86
|
|
|
@@ -21,17 +21,20 @@ export function selectAccentStyles(tokens) {
|
|
|
21
21
|
* Content inside an item or control in a SideNav, themed by the SideNavItem theme
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
|
-
const ItemContent =
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
children:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
24
|
+
const ItemContent = _ref => {
|
|
25
|
+
let {
|
|
26
|
+
children,
|
|
27
|
+
tokens
|
|
28
|
+
} = _ref;
|
|
29
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
30
|
+
children: [/*#__PURE__*/_jsx(Typography, {
|
|
31
|
+
tokens: selectTokens('Typography', tokens),
|
|
32
|
+
children: children
|
|
33
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
34
|
+
style: [staticStyles.absolute, selectAccentStyles(tokens)]
|
|
35
|
+
})]
|
|
36
|
+
});
|
|
37
|
+
};
|
|
35
38
|
|
|
36
39
|
ItemContent.propTypes = {
|
|
37
40
|
tokens: getTokensPropType('SideNavItem'),
|
|
@@ -16,17 +16,19 @@ import { useThemeTokensCallback } from '../ThemeProvider';
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
|
-
const ItemsGroup = /*#__PURE__*/forwardRef(({
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
19
|
+
const ItemsGroup = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
20
|
+
let {
|
|
21
|
+
children,
|
|
22
|
+
label,
|
|
23
|
+
openGroups,
|
|
24
|
+
groupId,
|
|
25
|
+
isActive = false,
|
|
26
|
+
variant,
|
|
27
|
+
tokens,
|
|
28
|
+
itemTokens,
|
|
29
|
+
onToggle
|
|
30
|
+
} = _ref;
|
|
31
|
+
|
|
30
32
|
// A SideNav control uses the same style and theme as SideNavItem, with a 'parent' variant,
|
|
31
33
|
// plus control-specific tokens from the SideNavItemsGroup theme (e.g. open/close icon, etc).
|
|
32
34
|
const getAppearance = appearance => ({ ...variant,
|
|
@@ -23,15 +23,16 @@ const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, vie
|
|
|
23
23
|
- Allow the user to navigate between options frequently and efficiently
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
|
-
const SideNav = /*#__PURE__*/forwardRef(({
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
26
|
+
const SideNav = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
27
|
+
let {
|
|
28
|
+
children,
|
|
29
|
+
variant = {},
|
|
30
|
+
tokens,
|
|
31
|
+
accordion = true,
|
|
32
|
+
itemTokens,
|
|
33
|
+
groupTokens,
|
|
34
|
+
...rest
|
|
35
|
+
} = _ref;
|
|
35
36
|
const themeTokens = useThemeTokens('SideNav', tokens, variant);
|
|
36
37
|
const [active, setActive] = useState({
|
|
37
38
|
groupId: undefined,
|
|
@@ -54,19 +55,21 @@ const SideNav = /*#__PURE__*/forwardRef(({
|
|
|
54
55
|
maxOpen: accordion ? 1 : null,
|
|
55
56
|
style: selectBorderStyles(themeTokens),
|
|
56
57
|
...selectProps(rest),
|
|
57
|
-
children:
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
children: _ref2 => {
|
|
59
|
+
let {
|
|
60
|
+
openIds,
|
|
61
|
+
onToggle
|
|
62
|
+
} = _ref2;
|
|
63
|
+
|
|
61
64
|
const renderItem = (item, index, groupId) => {
|
|
62
65
|
const {
|
|
63
|
-
itemId =
|
|
66
|
+
itemId = "item-".concat(index),
|
|
64
67
|
onPress
|
|
65
68
|
} = item.props;
|
|
66
69
|
|
|
67
|
-
const handlePress = (
|
|
68
|
-
onItemPress(...
|
|
69
|
-
if (onPress) onPress(...
|
|
70
|
+
const handlePress = function () {
|
|
71
|
+
onItemPress(...arguments);
|
|
72
|
+
if (onPress) onPress(...arguments);
|
|
70
73
|
};
|
|
71
74
|
|
|
72
75
|
return /*#__PURE__*/_createElement(Item, { ...item.props,
|
|
@@ -88,7 +91,7 @@ const SideNav = /*#__PURE__*/forwardRef(({
|
|
|
88
91
|
|
|
89
92
|
if (child.type === ItemsGroup) {
|
|
90
93
|
const {
|
|
91
|
-
groupId =
|
|
94
|
+
groupId = "group-".concat(index)
|
|
92
95
|
} = child.props;
|
|
93
96
|
const isGroupActive = active.itemId !== undefined && active.groupId === groupId;
|
|
94
97
|
|
|
@@ -10,48 +10,61 @@ import skeletonWebAnimation from './skeletonWebAnimation';
|
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
11
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, viewProps]);
|
|
12
12
|
|
|
13
|
-
const selectSkeletonStyles =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
const selectSkeletonStyles = _ref => {
|
|
14
|
+
let {
|
|
15
|
+
color,
|
|
16
|
+
radius,
|
|
17
|
+
fadeAnimation
|
|
18
|
+
} = _ref;
|
|
19
|
+
return {
|
|
20
|
+
backgroundColor: color,
|
|
21
|
+
borderRadius: radius,
|
|
22
|
+
...fadeAnimation
|
|
23
|
+
};
|
|
24
|
+
};
|
|
22
25
|
|
|
23
|
-
const selectLineStyles =
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
const selectLineStyles = _ref2 => {
|
|
27
|
+
let {
|
|
28
|
+
skeletonHeight,
|
|
29
|
+
lineWidth
|
|
30
|
+
} = _ref2;
|
|
31
|
+
return {
|
|
32
|
+
width: lineWidth,
|
|
33
|
+
height: skeletonHeight
|
|
34
|
+
};
|
|
35
|
+
};
|
|
30
36
|
|
|
31
|
-
const selectShapeStyles =
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
+
const selectShapeStyles = _ref3 => {
|
|
38
|
+
let {
|
|
39
|
+
skeletonHeight
|
|
40
|
+
} = _ref3;
|
|
41
|
+
return {
|
|
42
|
+
height: skeletonHeight,
|
|
43
|
+
width: skeletonHeight
|
|
44
|
+
};
|
|
45
|
+
};
|
|
37
46
|
|
|
38
|
-
const selectSquareStyles =
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
47
|
+
const selectSquareStyles = _ref4 => {
|
|
48
|
+
let {
|
|
49
|
+
radius
|
|
50
|
+
} = _ref4;
|
|
51
|
+
return {
|
|
52
|
+
borderRadius: radius
|
|
53
|
+
};
|
|
54
|
+
};
|
|
43
55
|
|
|
44
|
-
const Skeleton = /*#__PURE__*/forwardRef(({
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
56
|
+
const Skeleton = /*#__PURE__*/forwardRef((_ref5, ref) => {
|
|
57
|
+
let {
|
|
58
|
+
tokens,
|
|
59
|
+
variant,
|
|
60
|
+
size,
|
|
61
|
+
sizeIndex = size,
|
|
62
|
+
sizePixels,
|
|
63
|
+
characters,
|
|
64
|
+
lines,
|
|
65
|
+
shape = 'line',
|
|
66
|
+
...rest
|
|
67
|
+
} = _ref5;
|
|
55
68
|
const themeTokens = useThemeTokens('Skeleton', tokens, variant);
|
|
56
69
|
const pixels = useResponsiveProp(sizePixels);
|
|
57
70
|
const spacingScaleValue = typeof pixels === 'number' ? // Size by an exact number of pixels
|
|
@@ -101,12 +114,15 @@ const Skeleton = /*#__PURE__*/forwardRef(({
|
|
|
101
114
|
});
|
|
102
115
|
};
|
|
103
116
|
|
|
104
|
-
const renderSkeleton = (
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
117
|
+
const renderSkeleton = function () {
|
|
118
|
+
let index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
119
|
+
return /*#__PURE__*/_jsx(Animated.View, {
|
|
120
|
+
testID: "skeleton",
|
|
121
|
+
style: [selectSkeletonStyles({ ...themeTokens,
|
|
122
|
+
fadeAnimation: getAnimationBaseOnPlatform()
|
|
123
|
+
}), getStyledBasedOnShape()]
|
|
124
|
+
}, "skeleton-".concat(index + 1));
|
|
125
|
+
};
|
|
110
126
|
|
|
111
127
|
return /*#__PURE__*/_jsx(StackView, {
|
|
112
128
|
space: themeTokens.spaceBetweenLines,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ANIMATION_DURATION, DEFAULT_OPACITY, OPACITY_STOP } from './skeleton.constant';
|
|
2
2
|
export default {
|
|
3
|
-
animationDuration:
|
|
3
|
+
animationDuration: "".concat(ANIMATION_DURATION, "ms"),
|
|
4
4
|
animationTimingFunction: 'ease-in-out',
|
|
5
5
|
animationDelay: '0.5s',
|
|
6
6
|
animationIterationCount: 'infinite',
|
|
@@ -58,11 +58,12 @@ const selectSizeStyle = (size, direction) => ({
|
|
|
58
58
|
*/
|
|
59
59
|
|
|
60
60
|
|
|
61
|
-
const Spacer = /*#__PURE__*/forwardRef(({
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
const Spacer = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
62
|
+
let {
|
|
63
|
+
space = 1,
|
|
64
|
+
direction = 'column',
|
|
65
|
+
...rest
|
|
66
|
+
} = _ref;
|
|
66
67
|
const size = useSpacingScale(space);
|
|
67
68
|
const sizeStyle = selectSizeStyle(size, direction);
|
|
68
69
|
return /*#__PURE__*/_jsx(View, {
|