@telus-uds/components-base 1.7.0 → 1.8.1
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 +38 -2
- package/component-docs.json +264 -18
- package/lib/Button/ButtonGroup.js +118 -45
- package/lib/Checkbox/CheckboxGroup.js +3 -3
- package/lib/ExpandCollapse/Panel.js +2 -1
- package/lib/Fieldset/Fieldset.js +7 -0
- package/lib/InputLabel/InputLabel.js +8 -1
- package/lib/InputSupports/InputSupports.js +7 -0
- package/lib/Notification/Notification.js +1 -1
- package/lib/Radio/RadioGroup.js +12 -5
- package/lib/RadioCard/RadioCardGroup.js +7 -0
- package/lib/Search/Search.js +1 -1
- package/lib/Skeleton/Skeleton.js +48 -2
- package/lib/ToggleSwitch/ToggleSwitch.js +7 -0
- package/lib/ToggleSwitch/ToggleSwitchGroup.js +7 -0
- package/lib/Tooltip/Tooltip.js +1 -1
- package/lib/utils/animation/useVerticalExpandAnimation.js +26 -13
- package/lib/utils/props/inputSupportsProps.js +7 -0
- package/lib/utils/props/textInputProps.js +2 -1
- package/lib-module/Button/ButtonGroup.js +117 -45
- package/lib-module/Checkbox/CheckboxGroup.js +3 -3
- package/lib-module/ExpandCollapse/Panel.js +2 -1
- package/lib-module/Fieldset/Fieldset.js +7 -0
- package/lib-module/InputLabel/InputLabel.js +8 -1
- package/lib-module/InputSupports/InputSupports.js +7 -0
- package/lib-module/Notification/Notification.js +1 -1
- package/lib-module/Radio/RadioGroup.js +12 -5
- package/lib-module/RadioCard/RadioCardGroup.js +7 -0
- package/lib-module/Search/Search.js +1 -1
- package/lib-module/Skeleton/Skeleton.js +49 -3
- package/lib-module/ToggleSwitch/ToggleSwitch.js +7 -0
- package/lib-module/ToggleSwitch/ToggleSwitchGroup.js +7 -0
- package/lib-module/Tooltip/Tooltip.js +1 -1
- package/lib-module/utils/animation/useVerticalExpandAnimation.js +26 -14
- package/lib-module/utils/props/inputSupportsProps.js +7 -0
- package/lib-module/utils/props/textInputProps.js +2 -1
- package/package.json +11 -6
- package/src/Button/ButtonGroup.jsx +106 -41
- package/src/Checkbox/Checkbox.jsx +7 -4
- package/src/Checkbox/CheckboxGroup.jsx +3 -3
- package/src/ExpandCollapse/Panel.jsx +3 -1
- package/src/Fieldset/Fieldset.jsx +6 -0
- package/src/InputLabel/InputLabel.jsx +17 -2
- package/src/InputSupports/InputSupports.jsx +9 -1
- package/src/Notification/Notification.jsx +1 -1
- package/src/Radio/Radio.jsx +5 -1
- package/src/Radio/RadioGroup.jsx +11 -5
- package/src/RadioCard/RadioCard.jsx +5 -1
- package/src/RadioCard/RadioCardGroup.jsx +6 -0
- package/src/Search/Search.jsx +1 -1
- package/src/Skeleton/Skeleton.jsx +56 -3
- package/src/ToggleSwitch/ToggleSwitch.jsx +6 -0
- package/src/ToggleSwitch/ToggleSwitchGroup.jsx +6 -0
- package/src/Tooltip/Tooltip.jsx +1 -1
- package/src/utils/animation/useVerticalExpandAnimation.js +25 -12
- package/src/utils/props/inputSupportsProps.js +6 -1
- package/src/utils/props/textInputProps.js +2 -1
- package/src/utils/props/tokens.js +21 -19
- package/.storybook/main.js +0 -4
- package/.storybook/preview.js +0 -37
- package/.turbo/turbo-build.log +0 -8
- package/.turbo/turbo-lint.log +0 -13
- package/CHANGELOG.json +0 -235
- package/__fixtures__/Accessible.js +0 -35
- package/__fixtures__/Accessible.native.js +0 -35
- package/__fixtures__/Theme.jsx +0 -13
- package/__fixtures__/Viewport.jsx +0 -17
- package/__fixtures__/test-utils.js +0 -25
- package/__fixtures__/testTheme.js +0 -1830
- package/__tests__/A11yText/A11yText.test.jsx +0 -34
- package/__tests__/ActivityIndicator/ActivityIndicator.test.jsx +0 -68
- package/__tests__/ActivityIndicator/__snapshots__/ActivityIndicator.test.jsx.snap +0 -287
- package/__tests__/Box/Box.test.jsx +0 -111
- package/__tests__/Button/Button.test.jsx +0 -86
- package/__tests__/Button/ButtonBase.test.jsx +0 -82
- package/__tests__/Button/ButtonGroup.test.jsx +0 -347
- package/__tests__/Button/ButtonLink.test.jsx +0 -61
- package/__tests__/Card/Card.test.jsx +0 -63
- package/__tests__/Checkbox/Checkbox.test.jsx +0 -94
- package/__tests__/Checkbox/CheckboxGroup.test.jsx +0 -246
- package/__tests__/Divider/Divider.test.jsx +0 -91
- package/__tests__/ExpandCollapse/ExpandCollapse.test.jsx +0 -109
- package/__tests__/Feedback/Feedback.test.jsx +0 -42
- package/__tests__/FlexGrid/Col.test.jsx +0 -256
- package/__tests__/FlexGrid/FlexGrid.test.jsx +0 -136
- package/__tests__/FlexGrid/Row.test.jsx +0 -273
- package/__tests__/HorizontalScroll/HorizontalScroll.test.jsx +0 -165
- package/__tests__/Icon/Icon.test.jsx +0 -61
- package/__tests__/IconButton/IconButton.test.jsx +0 -52
- package/__tests__/InputSupports/InputSupports.test.jsx +0 -50
- package/__tests__/Link/Link.test.jsx +0 -63
- package/__tests__/Link/TextButton.test.jsx +0 -35
- package/__tests__/List/List.test.jsx +0 -60
- package/__tests__/Modal/Modal.test.jsx +0 -47
- package/__tests__/Notification/Notification.test.jsx +0 -20
- package/__tests__/Pagination/Pagination.test.jsx +0 -160
- package/__tests__/Progress/Progress.test.jsx +0 -79
- package/__tests__/Radio/Radio.test.jsx +0 -87
- package/__tests__/Radio/RadioGroup.test.jsx +0 -220
- package/__tests__/RadioCard/RadioCard.test.jsx +0 -87
- package/__tests__/RadioCard/RadioCardGroup.test.jsx +0 -246
- package/__tests__/Search/Search.test.jsx +0 -73
- package/__tests__/Select/Select.test.jsx +0 -94
- package/__tests__/SideNav/SideNav.test.jsx +0 -110
- package/__tests__/Skeleton/Skeleton.test.jsx +0 -61
- package/__tests__/Spacer/Spacer.test.jsx +0 -63
- package/__tests__/StackView/StackView.test.jsx +0 -216
- package/__tests__/StackView/StackWrap.test.jsx +0 -47
- package/__tests__/StackView/getStackedContent.test.jsx +0 -295
- package/__tests__/StepTracker/StepTracker.test.jsx +0 -94
- package/__tests__/Tabs/Tabs.test.jsx +0 -40
- package/__tests__/Tags/Tags.test.jsx +0 -327
- package/__tests__/TextInput/TextArea.test.jsx +0 -35
- package/__tests__/TextInput/TextInputBase.test.jsx +0 -125
- package/__tests__/ThemeProvider/ThemeProvider.test.jsx +0 -77
- package/__tests__/ThemeProvider/useThemeTokens.test.jsx +0 -514
- package/__tests__/ThemeProvider/utils/theme-tokens.test.js +0 -41
- package/__tests__/ToggleSwitch/ToggleSwitch.test.jsx +0 -82
- package/__tests__/ToggleSwitch/ToggleSwitchGroup.test.jsx +0 -192
- package/__tests__/Tooltip/Tooltip.test.jsx +0 -65
- package/__tests__/Tooltip/getTooltipPosition.test.js +0 -79
- package/__tests__/Typography/typography.test.jsx +0 -90
- package/__tests__/utils/children.test.jsx +0 -128
- package/__tests__/utils/containUniqueFields.test.js +0 -25
- package/__tests__/utils/input.test.js +0 -375
- package/__tests__/utils/props.test.js +0 -36
- package/__tests__/utils/semantics.test.jsx +0 -34
- package/__tests__/utils/useCopy.test.js +0 -42
- package/__tests__/utils/useResponsiveProp.test.jsx +0 -202
- package/__tests__/utils/useSpacingScale.test.jsx +0 -273
- package/__tests__/utils/useUniqueId.test.js +0 -31
- package/babel.config.js +0 -35
- package/generate-component-docs.js +0 -72
- package/jest.config.js +0 -32
- package/stories/A11yText/A11yText.stories.jsx +0 -71
- package/stories/ActivityIndicator/ActivityIndicator.stories.jsx +0 -22
- package/stories/Box/Box.stories.jsx +0 -143
- package/stories/Button/Button.stories.jsx +0 -72
- package/stories/Button/ButtonGroup.stories.jsx +0 -81
- package/stories/Button/ButtonLink.stories.jsx +0 -30
- package/stories/Card/Card.stories.jsx +0 -62
- package/stories/Checkbox/Checkbox.stories.jsx +0 -94
- package/stories/Divider/Divider.stories.jsx +0 -68
- package/stories/ExpandCollapse/ExpandCollapse.stories.jsx +0 -112
- package/stories/Feedback/Feedback.stories.jsx +0 -96
- package/stories/FlexGrid/01 FlexGrid.stories.jsx +0 -54
- package/stories/FlexGrid/02 Row.stories.jsx +0 -41
- package/stories/FlexGrid/03 Col.stories.jsx +0 -141
- package/stories/Icon/Icon.stories.jsx +0 -79
- package/stories/IconButton/IconButton.stories.jsx +0 -50
- package/stories/InputLabel/InputLabel.stories.jsx +0 -39
- package/stories/Link/ChevronLink.stories.jsx +0 -48
- package/stories/Link/Link.stories.jsx +0 -90
- package/stories/Link/TextButton.stories.jsx +0 -79
- package/stories/List/List.stories.jsx +0 -117
- package/stories/Modal/Modal.stories.jsx +0 -54
- package/stories/Notification/Notification.stories.jsx +0 -82
- package/stories/Pagination/Pagination.stories.jsx +0 -64
- package/stories/Progress/Progress.stories.jsx +0 -93
- package/stories/Radio/Radio.stories.jsx +0 -100
- package/stories/RadioCard/RadioCard.stories.jsx +0 -98
- package/stories/Search/Search.stories.jsx +0 -66
- package/stories/Select/Select.stories.jsx +0 -55
- package/stories/SideNav/SideNav.stories.jsx +0 -42
- package/stories/SideNav/SideNavItem.stories.jsx +0 -9
- package/stories/SideNav/SideNavItemsGroup.stories.jsx +0 -17
- package/stories/Skeleton/Skeleton.stories.jsx +0 -36
- package/stories/Spacer/Spacer.stories.jsx +0 -38
- package/stories/StackView/StackView.stories.jsx +0 -75
- package/stories/StackView/StackWrap.stories.jsx +0 -64
- package/stories/StepTracker/StepTracker.stories.jsx +0 -71
- package/stories/Tabs/Tabs.stories.jsx +0 -97
- package/stories/Tags/Tags.stories.jsx +0 -69
- package/stories/TextInput/TextArea.stories.jsx +0 -101
- package/stories/TextInput/TextInput.stories.jsx +0 -141
- package/stories/ToggleSwitch/ToggleSwitch.stories.jsx +0 -64
- package/stories/ToggleSwitch/ToggleSwitchGroup.stories.jsx +0 -81
- package/stories/Tooltip/Tooltip.stories.jsx +0 -81
- package/stories/TooltipButton/TooltipButton.stories.jsx +0 -11
- package/stories/Typography/Typography.stories.jsx +0 -49
- package/stories/platform-supports.jsx +0 -32
- package/stories/platform-supports.native.jsx +0 -3
- package/stories/supports.jsx +0 -236
|
@@ -17,6 +17,8 @@ var _ButtonBase = _interopRequireDefault(require("./ButtonBase"));
|
|
|
17
17
|
|
|
18
18
|
var _StackView = require("../StackView");
|
|
19
19
|
|
|
20
|
+
var _Fieldset = _interopRequireDefault(require("../Fieldset"));
|
|
21
|
+
|
|
20
22
|
var _ViewportProvider = require("../ViewportProvider");
|
|
21
23
|
|
|
22
24
|
var _ThemeProvider = require("../ThemeProvider");
|
|
@@ -45,6 +47,13 @@ const ButtonGroup = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
45
47
|
onChange,
|
|
46
48
|
readOnly = false,
|
|
47
49
|
inactive = false,
|
|
50
|
+
legend,
|
|
51
|
+
tooltip,
|
|
52
|
+
hint,
|
|
53
|
+
validation,
|
|
54
|
+
feedback,
|
|
55
|
+
name: inputGroupName,
|
|
56
|
+
copy,
|
|
48
57
|
accessibilityRole = maxValues === 1 ? 'radiogroup' // radiogroup is cross-platform; only web aria has generic groups
|
|
49
58
|
: _Platform.default.select({
|
|
50
59
|
web: 'group',
|
|
@@ -59,7 +68,8 @@ const ButtonGroup = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
59
68
|
const stackTokens = (0, _utils.selectTokens)('StackView', themeTokens);
|
|
60
69
|
const {
|
|
61
70
|
direction,
|
|
62
|
-
space
|
|
71
|
+
space,
|
|
72
|
+
fieldSpace
|
|
63
73
|
} = themeTokens;
|
|
64
74
|
const getButtonTokens = (0, _ThemeProvider.useThemeTokensCallback)('ButtonGroupItem', tokens, variant);
|
|
65
75
|
const {
|
|
@@ -81,54 +91,71 @@ const ButtonGroup = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
81
91
|
|
|
82
92
|
if (!(0, _utils.containUniqueFields)(items, uniqueFields)) {
|
|
83
93
|
throw new Error(`ButtonGroup items must have unique ${uniqueFields.join(', ')}`);
|
|
84
|
-
}
|
|
94
|
+
} // Some web screenreaders e.g. MacOS Voiceover don't handle radiogroups properly unless radio is direct child of radiogroup
|
|
95
|
+
|
|
85
96
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
direction: direction,
|
|
89
|
-
tokens: stackTokens,
|
|
97
|
+
const innerRole = _Platform.default.OS === 'web' && accessibilityRole === 'radiogroup' ? accessibilityRole : undefined;
|
|
98
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Fieldset.default, { ...systemProps,
|
|
90
99
|
ref: ref,
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
name: inputGroupName,
|
|
101
|
+
legend: legend,
|
|
102
|
+
tooltip: tooltip,
|
|
103
|
+
hint: hint,
|
|
104
|
+
space: fieldSpace,
|
|
105
|
+
feedback: feedback,
|
|
106
|
+
readOnly: readOnly,
|
|
107
|
+
inactive: inactive,
|
|
108
|
+
validation: validation,
|
|
109
|
+
accessibilityRole: accessibilityRole,
|
|
110
|
+
...selectProps(rest),
|
|
111
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_StackView.StackWrap, {
|
|
112
|
+
accessibilityRole: innerRole,
|
|
113
|
+
space: space,
|
|
114
|
+
direction: direction,
|
|
115
|
+
tokens: stackTokens,
|
|
116
|
+
ref: ref,
|
|
117
|
+
children: items.map(({
|
|
102
118
|
label,
|
|
103
|
-
|
|
104
|
-
}]);
|
|
105
|
-
|
|
106
|
-
const handlePress = event => {
|
|
107
|
-
if (pressHandlers.onPress) pressHandlers.onPress(event);
|
|
108
|
-
toggleOneValue(id, event);
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
const itemA11y = {
|
|
112
|
-
accessibilityState: {
|
|
113
|
-
checked: isSelected
|
|
114
|
-
},
|
|
115
|
-
accessibilityRole: itemA11yRole,
|
|
119
|
+
id = label,
|
|
116
120
|
accessibilityLabel,
|
|
117
|
-
..._utils.a11yProps.getPositionInSet(items.length, index)
|
|
118
|
-
}; // Ensure button is direct child of group as MacOS voiceover only applies "X of Y" to
|
|
119
|
-
// "radio" if it's a direct child of "radiogroup", even if aria-posinset etc exists
|
|
120
|
-
|
|
121
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonBase.default, {
|
|
122
121
|
ref: itemRef,
|
|
123
|
-
...
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
122
|
+
...itemRest
|
|
123
|
+
}, index) => {
|
|
124
|
+
const isSelected = currentValues.includes(id); // Pass an object of relevant component state as first argument for any passed-in press handlers
|
|
125
|
+
|
|
126
|
+
const pressHandlers = (0, _pressability.getPressHandlersWithArgs)(rest, [{
|
|
127
|
+
id,
|
|
128
|
+
label,
|
|
129
|
+
currentValues
|
|
130
|
+
}]);
|
|
131
|
+
|
|
132
|
+
const handlePress = event => {
|
|
133
|
+
if (pressHandlers.onPress) pressHandlers.onPress(event);
|
|
134
|
+
toggleOneValue(id, event);
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
const itemA11y = {
|
|
138
|
+
accessibilityState: {
|
|
139
|
+
checked: isSelected
|
|
140
|
+
},
|
|
141
|
+
accessibilityRole: itemA11yRole,
|
|
142
|
+
accessibilityLabel,
|
|
143
|
+
..._utils.a11yProps.getPositionInSet(items.length, index)
|
|
144
|
+
}; // Ensure button is direct child of group as MacOS voiceover only applies "X of Y" to
|
|
145
|
+
// "radio" if it's a direct child of "radiogroup", even if aria-posinset etc exists
|
|
146
|
+
|
|
147
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonBase.default, {
|
|
148
|
+
ref: itemRef,
|
|
149
|
+
...pressHandlers,
|
|
150
|
+
onPress: handlePress,
|
|
151
|
+
tokens: getButtonTokens,
|
|
152
|
+
selected: isSelected,
|
|
153
|
+
inactive: inactive,
|
|
154
|
+
...itemA11y,
|
|
155
|
+
...selectItemProps(itemRest),
|
|
156
|
+
children: label
|
|
157
|
+
}, id);
|
|
158
|
+
})
|
|
132
159
|
})
|
|
133
160
|
});
|
|
134
161
|
});
|
|
@@ -192,7 +219,53 @@ ButtonGroup.propTypes = { ...selectedSystemPropTypes,
|
|
|
192
219
|
* managing its own selected state, a default set of selections may be provided.
|
|
193
220
|
* Changing the `initialValues` does not change the user's selections.
|
|
194
221
|
*/
|
|
195
|
-
initialValues: _propTypes.default.arrayOf(_propTypes.default.string)
|
|
222
|
+
initialValues: _propTypes.default.arrayOf(_propTypes.default.string),
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Main text used to describe this group, used in Fieldset's Legend element.
|
|
226
|
+
*/
|
|
227
|
+
legend: _propTypes.default.string,
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Optional additional text giving more detail to help a user make a choice.
|
|
231
|
+
*/
|
|
232
|
+
hint: _propTypes.default.string,
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Optional tooltip text content to include alongside the legend and hint.
|
|
236
|
+
*/
|
|
237
|
+
tooltip: _propTypes.default.string,
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Current validation status of the group, passed to the feedback element if there is one.
|
|
241
|
+
*/
|
|
242
|
+
validation: _propTypes.default.oneOf(['error', 'success']),
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* If provided, a Feedback element is rendered containing this text.
|
|
246
|
+
*/
|
|
247
|
+
feedback: _propTypes.default.string,
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* If true, the buttons cannot be selected by the user and simply show their current state.
|
|
251
|
+
*/
|
|
252
|
+
readOnly: _propTypes.default.bool,
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* If true, the buttons cannot be interacted with, elements are set as `disabled` and if the
|
|
256
|
+
* theme supports `inactive` appearances rules, these are applied.
|
|
257
|
+
*/
|
|
258
|
+
inactive: _propTypes.default.bool,
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* On Web, this is passed to the `name` attribute of the fieldset.
|
|
262
|
+
*/
|
|
263
|
+
name: _propTypes.default.string,
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* Sets the language of microcopy in subcomponents (e.g. Tooltip's default accessibility label).
|
|
267
|
+
*/
|
|
268
|
+
copy: _propTypes.default.oneOf(['en', 'fr'])
|
|
196
269
|
};
|
|
197
270
|
var _default = ButtonGroup;
|
|
198
271
|
exports.default = _default;
|
|
@@ -236,18 +236,18 @@ CheckboxGroup.propTypes = { ...selectedSystemPropTypes,
|
|
|
236
236
|
onChange: _propTypes.default.func,
|
|
237
237
|
|
|
238
238
|
/**
|
|
239
|
-
* If true, the
|
|
239
|
+
* If true, the checkboxes cannot be selected by the user and simply show their current state.
|
|
240
240
|
*/
|
|
241
241
|
readOnly: _propTypes.default.bool,
|
|
242
242
|
|
|
243
243
|
/**
|
|
244
|
-
* If true, the
|
|
244
|
+
* If true, the checkboxes cannot be interacted with, elements are set as `disabled` and if the
|
|
245
245
|
* theme supports `inactive` appearances rules, these are applied.
|
|
246
246
|
*/
|
|
247
247
|
inactive: _propTypes.default.bool,
|
|
248
248
|
|
|
249
249
|
/**
|
|
250
|
-
* On Web, this is passed to the `name` attribute of the fieldset and each
|
|
250
|
+
* On Web, this is passed to the `name` attribute of the fieldset and each checkbox input.
|
|
251
251
|
*/
|
|
252
252
|
name: _propTypes.default.string
|
|
253
253
|
};
|
|
@@ -97,7 +97,7 @@ const ExpandCollapsePanel = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
97
97
|
}
|
|
98
98
|
};
|
|
99
99
|
|
|
100
|
-
const animatedStyles = (0, _utils.useVerticalExpandAnimation)({
|
|
100
|
+
const [animatedStyles, animatedRef] = (0, _utils.useVerticalExpandAnimation)({
|
|
101
101
|
containerHeight,
|
|
102
102
|
isExpanded,
|
|
103
103
|
tokens: themeTokens
|
|
@@ -118,6 +118,7 @@ const ExpandCollapsePanel = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
118
118
|
onPress: handleControlPress,
|
|
119
119
|
children: control
|
|
120
120
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Animated.default.View, {
|
|
121
|
+
ref: animatedRef,
|
|
121
122
|
style: [overflowContainerStyles, animatedStyles, staticStyles.itemsContainer],
|
|
122
123
|
...focusabilityProps,
|
|
123
124
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
package/lib/Fieldset/Fieldset.js
CHANGED
|
@@ -38,6 +38,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
38
38
|
* Follows the same theming and most of the same props as InputSupports.
|
|
39
39
|
*/
|
|
40
40
|
const Fieldset = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
41
|
+
copy = 'en',
|
|
41
42
|
space,
|
|
42
43
|
feedback,
|
|
43
44
|
feedbackPosition = 'top',
|
|
@@ -64,6 +65,7 @@ const Fieldset = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
64
65
|
});
|
|
65
66
|
const legendContent = legend && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Legend.default, {
|
|
66
67
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputLabel.default, {
|
|
68
|
+
copy: copy,
|
|
67
69
|
label: legend,
|
|
68
70
|
hint: hint,
|
|
69
71
|
hintPosition: hintPosition,
|
|
@@ -100,6 +102,11 @@ Fieldset.displayName = 'Fieldset';
|
|
|
100
102
|
Fieldset.propTypes = {
|
|
101
103
|
children: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.node]),
|
|
102
104
|
|
|
105
|
+
/**
|
|
106
|
+
* Whether the English or French copy will be used (e.g. for accessibility labels).
|
|
107
|
+
*/
|
|
108
|
+
copy: _propTypes.default.oneOf(['en', 'fr']),
|
|
109
|
+
|
|
103
110
|
/**
|
|
104
111
|
* The accessibility role of the `<fieldset>` element itself. Other React Native accessibility
|
|
105
112
|
* props are not supported because there is not an appropriate counterpart for Fieldsets.
|
|
@@ -56,6 +56,7 @@ const selectGapStyles = ({
|
|
|
56
56
|
});
|
|
57
57
|
|
|
58
58
|
const InputLabel = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
59
|
+
copy = 'en',
|
|
59
60
|
label,
|
|
60
61
|
forId,
|
|
61
62
|
hint,
|
|
@@ -89,7 +90,8 @@ const InputLabel = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
89
90
|
height: themeTokens.fontSize * themeTokens.lineHeight
|
|
90
91
|
}],
|
|
91
92
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.default, {
|
|
92
|
-
content: tooltip
|
|
93
|
+
content: tooltip,
|
|
94
|
+
copy: copy
|
|
93
95
|
})
|
|
94
96
|
})]
|
|
95
97
|
}), hint && !isHintInline && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.default, {
|
|
@@ -102,6 +104,11 @@ const InputLabel = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
102
104
|
InputLabel.displayName = 'InputLabel';
|
|
103
105
|
InputLabel.propTypes = { ...selectedSystemPropTypes,
|
|
104
106
|
|
|
107
|
+
/**
|
|
108
|
+
* Whether the English or French copy will be used (e.g. for accessibility labels).
|
|
109
|
+
*/
|
|
110
|
+
copy: _propTypes.default.oneOf(['en', 'fr']),
|
|
111
|
+
|
|
105
112
|
/**
|
|
106
113
|
* The input label.
|
|
107
114
|
*/
|
|
@@ -29,6 +29,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
29
29
|
|
|
30
30
|
const InputSupports = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
31
31
|
children,
|
|
32
|
+
copy = 'en',
|
|
32
33
|
label,
|
|
33
34
|
hint,
|
|
34
35
|
hintPosition = 'inline',
|
|
@@ -54,6 +55,7 @@ const InputSupports = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
54
55
|
space: space,
|
|
55
56
|
ref: ref,
|
|
56
57
|
children: [label && /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputLabel.default, {
|
|
58
|
+
copy: copy,
|
|
57
59
|
label: label,
|
|
58
60
|
hint: hint,
|
|
59
61
|
hintPosition: hintPosition,
|
|
@@ -74,6 +76,11 @@ InputSupports.displayName = 'InputSupports';
|
|
|
74
76
|
InputSupports.propTypes = {
|
|
75
77
|
children: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.node]),
|
|
76
78
|
|
|
79
|
+
/**
|
|
80
|
+
* Whether the English or French copy will be used (e.g. for accessibility labels).
|
|
81
|
+
*/
|
|
82
|
+
copy: _propTypes.default.oneOf(['en', 'fr']),
|
|
83
|
+
|
|
77
84
|
/**
|
|
78
85
|
* The input label.
|
|
79
86
|
*/
|
|
@@ -199,7 +199,7 @@ Notification.propTypes = { ...selectedSystemPropTypes,
|
|
|
199
199
|
dismissible: _propTypes.default.bool,
|
|
200
200
|
|
|
201
201
|
/**
|
|
202
|
-
* Select
|
|
202
|
+
* Select English or French copy for the accessible label of the dismiss button.
|
|
203
203
|
*/
|
|
204
204
|
copy: _propTypes.default.oneOfType([_propTypes.default.oneOf(['en', 'fr']), _propTypes.default.shape({
|
|
205
205
|
dismiss: _propTypes.default.string
|
package/lib/Radio/RadioGroup.js
CHANGED
|
@@ -52,7 +52,7 @@ const [selectItemProps, selectedItemPropTypes] = (0, _utils.selectSystemProps)([
|
|
|
52
52
|
* ### Uncontrolled version
|
|
53
53
|
*
|
|
54
54
|
* If the RadioGroup manages its own state, you can use `initialCheckedId` prop to provide the initial value.
|
|
55
|
-
* Whenever the radio
|
|
55
|
+
* Whenever the radio gets toggled, it calls the `onChange` callback with the new value (string).
|
|
56
56
|
*
|
|
57
57
|
* ### Use in forms
|
|
58
58
|
*
|
|
@@ -83,6 +83,7 @@ const [selectItemProps, selectedItemPropTypes] = (0, _utils.selectSystemProps)([
|
|
|
83
83
|
*/
|
|
84
84
|
|
|
85
85
|
const RadioGroup = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
86
|
+
copy = 'en',
|
|
86
87
|
tokens,
|
|
87
88
|
radioTokens,
|
|
88
89
|
variant,
|
|
@@ -151,6 +152,7 @@ const RadioGroup = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
151
152
|
}, radioId);
|
|
152
153
|
});
|
|
153
154
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Fieldset.default, {
|
|
155
|
+
copy: copy,
|
|
154
156
|
ref: ref,
|
|
155
157
|
name: inputGroupName,
|
|
156
158
|
legend: legend,
|
|
@@ -171,6 +173,11 @@ const RadioGroup = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
171
173
|
RadioGroup.displayName = 'RadioGroup';
|
|
172
174
|
RadioGroup.propTypes = { ...selectedSystemPropTypes,
|
|
173
175
|
|
|
176
|
+
/**
|
|
177
|
+
* Whether the English or French copy will be used (e.g. for accessibility labels).
|
|
178
|
+
*/
|
|
179
|
+
copy: _propTypes.default.oneOf(['en', 'fr']),
|
|
180
|
+
|
|
174
181
|
/**
|
|
175
182
|
* Optional theme token overrides for the outer RadioGroup component
|
|
176
183
|
*/
|
|
@@ -222,12 +229,12 @@ RadioGroup.propTypes = { ...selectedSystemPropTypes,
|
|
|
222
229
|
feedback: _propTypes.default.string,
|
|
223
230
|
|
|
224
231
|
/**
|
|
225
|
-
* If provided, the radio
|
|
232
|
+
* If provided, the radio with this id is selected on first render.
|
|
226
233
|
*/
|
|
227
234
|
initialCheckedId: _propTypes.default.string,
|
|
228
235
|
|
|
229
236
|
/**
|
|
230
|
-
* If not undefined, the radio
|
|
237
|
+
* If not undefined, the radio with this id is selected (or none is selected if `null`), and the
|
|
231
238
|
* element's selection state will be controlled by its parent using the `onChange` function.
|
|
232
239
|
*/
|
|
233
240
|
checkedId: _propTypes.default.string,
|
|
@@ -239,12 +246,12 @@ RadioGroup.propTypes = { ...selectedSystemPropTypes,
|
|
|
239
246
|
onChange: _propTypes.default.func,
|
|
240
247
|
|
|
241
248
|
/**
|
|
242
|
-
* If true, the
|
|
249
|
+
* If true, the radios cannot be selected by the user and simply show their current state.
|
|
243
250
|
*/
|
|
244
251
|
readOnly: _propTypes.default.bool,
|
|
245
252
|
|
|
246
253
|
/**
|
|
247
|
-
* If true, the
|
|
254
|
+
* If true, the radios cannot be interacted with, elements are set as `disabled` and if the
|
|
248
255
|
* theme supports `inactive` appearances rules, these are applied.
|
|
249
256
|
*/
|
|
250
257
|
inactive: _propTypes.default.bool,
|
|
@@ -83,6 +83,7 @@ const [selectItemProps, selectedItemPropTypes] = (0, _utils.selectSystemProps)([
|
|
|
83
83
|
*/
|
|
84
84
|
|
|
85
85
|
const RadioCardGroup = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
86
|
+
copy = 'en',
|
|
86
87
|
tokens,
|
|
87
88
|
radioCardTokens,
|
|
88
89
|
variant,
|
|
@@ -128,6 +129,7 @@ const RadioCardGroup = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
128
129
|
}
|
|
129
130
|
|
|
130
131
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Fieldset.default, {
|
|
132
|
+
copy: copy,
|
|
131
133
|
ref: ref,
|
|
132
134
|
name: inputGroupName,
|
|
133
135
|
legend: legend,
|
|
@@ -177,6 +179,11 @@ const RadioCardGroup = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
177
179
|
RadioCardGroup.displayName = 'RadioCardGroup';
|
|
178
180
|
RadioCardGroup.propTypes = { ...selectedSystemPropTypes,
|
|
179
181
|
|
|
182
|
+
/**
|
|
183
|
+
* Whether the English or French copy will be used (e.g. for accessibility labels).
|
|
184
|
+
*/
|
|
185
|
+
copy: _propTypes.default.oneOf(['en', 'fr']),
|
|
186
|
+
|
|
180
187
|
/**
|
|
181
188
|
* Optional theme token overrides for the outer RadioCardGroup component
|
|
182
189
|
*/
|
package/lib/Search/Search.js
CHANGED
|
@@ -240,7 +240,7 @@ Search.propTypes = { ...selectedContainerPropTypes,
|
|
|
240
240
|
accessibilityLabel: _propTypes.default.string,
|
|
241
241
|
|
|
242
242
|
/**
|
|
243
|
-
* Select
|
|
243
|
+
* Select English or French copy for the accessible labels.
|
|
244
244
|
* You may also pass in a custom dictionary object.
|
|
245
245
|
*/
|
|
246
246
|
copy: _propTypes.default.oneOfType([_propTypes.default.oneOf(['en', 'fr']), _propTypes.default.shape({
|
package/lib/Skeleton/Skeleton.js
CHANGED
|
@@ -68,13 +68,23 @@ const Skeleton = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
68
68
|
tokens,
|
|
69
69
|
variant,
|
|
70
70
|
size,
|
|
71
|
+
sizeIndex = size,
|
|
72
|
+
sizePixels,
|
|
71
73
|
characters,
|
|
72
74
|
lines,
|
|
73
75
|
shape = 'line',
|
|
74
76
|
...rest
|
|
75
77
|
}, ref) => {
|
|
76
78
|
const themeTokens = (0, _ThemeProvider.useThemeTokens)('Skeleton', tokens, variant);
|
|
77
|
-
const
|
|
79
|
+
const pixels = (0, _utils.useResponsiveProp)(sizePixels);
|
|
80
|
+
const spacingScaleValue = typeof pixels === 'number' ? // Size by an exact number of pixels
|
|
81
|
+
{
|
|
82
|
+
options: {
|
|
83
|
+
size: pixels
|
|
84
|
+
}
|
|
85
|
+
} : // Size by an index on the spacing scale (getting default index from theme if none provided)
|
|
86
|
+
sizeIndex || themeTokens.size;
|
|
87
|
+
const skeletonHeight = (0, _utils.useSpacingScale)(spacingScaleValue);
|
|
78
88
|
const nativeAnimation = (0, _useSkeletonNativeAnimation.default)();
|
|
79
89
|
|
|
80
90
|
const getAnimationBaseOnPlatform = () => {
|
|
@@ -132,9 +142,45 @@ Skeleton.displayName = 'Skeleton';
|
|
|
132
142
|
Skeleton.propTypes = { ...selectedSystemPropTypes,
|
|
133
143
|
tokens: (0, _utils.getTokensPropType)('Skeleton'),
|
|
134
144
|
variant: _utils.variantProp.propType,
|
|
135
|
-
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Sets the size of Skeleton lines or shape according to the theme's spacing scale. For example, size={1} gives the smallest non-zero theme-defined spacing size.
|
|
148
|
+
*
|
|
149
|
+
* May also accept an object with responsive viewport keys or spacing scale options - see `useSpacingScale` for details.
|
|
150
|
+
*/
|
|
151
|
+
sizeIndex: _utils.spacingProps.types.spacingValue,
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* @deprecated alias for `sizeIndex`
|
|
155
|
+
*/
|
|
156
|
+
size: _utils.spacingProps.types.spacingValue,
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Sets the size of Skeleton lines or shape to an exact number of pixels. Use when it's necessary to exactly match sizes of images or other boxes.
|
|
160
|
+
*
|
|
161
|
+
* Accepts a number or an object with responsive viewport keys, e.g. { xs: 32, lg: 64 } would be 32px at xs, sm and md and 64 at lg and xl viewports.
|
|
162
|
+
*/
|
|
163
|
+
sizePixels: _utils.responsiveProps.getTypeOptionallyByViewport(_propTypes.default.number),
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Determines the width of simulated lines of text if the Skeleton's shape is 'line' (the default shape).
|
|
167
|
+
*
|
|
168
|
+
* Only has any affect if shape is line (the default). If unset, takes a default value from the theme.
|
|
169
|
+
*/
|
|
136
170
|
characters: _propTypes.default.number,
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Determines how many Skeleton items are rendered (default 1).
|
|
174
|
+
*
|
|
175
|
+
* Recommended usage is to simulate paragraphs of text when Skeleton's shape is 'line' (the default shape).
|
|
176
|
+
*
|
|
177
|
+
* The amount of spacing between multiple lines is controlled by theme tokens.
|
|
178
|
+
*/
|
|
137
179
|
lines: _propTypes.default.number,
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Determines if the skeleton should resemble lines of text (default), a circle, or a square box with themed rounded corners.
|
|
183
|
+
*/
|
|
138
184
|
shape: _propTypes.default.oneOf(['line', 'circle', 'box'])
|
|
139
185
|
};
|
|
140
186
|
var _default = Skeleton;
|
|
@@ -107,6 +107,7 @@ const selectLabelTokens = ({
|
|
|
107
107
|
});
|
|
108
108
|
|
|
109
109
|
const ToggleSwitch = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
110
|
+
copy = 'en',
|
|
110
111
|
value,
|
|
111
112
|
initialValue,
|
|
112
113
|
onChange,
|
|
@@ -143,6 +144,7 @@ const ToggleSwitch = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
143
144
|
children: [Boolean(label) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
144
145
|
style: [selectLabelStyles(themeTokens), staticStyles.containText],
|
|
145
146
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputLabel.default, {
|
|
147
|
+
copy: copy,
|
|
146
148
|
forId: inputId,
|
|
147
149
|
label: label,
|
|
148
150
|
tokens: selectLabelTokens(themeTokens),
|
|
@@ -191,6 +193,11 @@ const ToggleSwitch = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
191
193
|
});
|
|
192
194
|
ToggleSwitch.displayName = 'ToggleSwitch';
|
|
193
195
|
ToggleSwitch.propTypes = { ...selectedSystemPropTypes,
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Whether the English or French copy will be used (e.g. for accessibility labels).
|
|
199
|
+
*/
|
|
200
|
+
copy: _propTypes.default.oneOf(['en', 'fr']),
|
|
194
201
|
tokens: (0, _utils.getTokensPropType)('ToggleSwitch'),
|
|
195
202
|
variant: _utils.variantProp.propType,
|
|
196
203
|
|
|
@@ -36,6 +36,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
36
36
|
const [selectProps, selectedSystemPropTypes] = (0, _utils.selectSystemProps)([_utils.a11yProps, _utils.viewProps]);
|
|
37
37
|
const [selectItemProps, selectedItemPropTypes] = (0, _utils.selectSystemProps)([_utils.a11yProps, _utils.focusHandlerProps, _utils.viewProps]);
|
|
38
38
|
const ToggleSwitchGroup = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
39
|
+
copy = 'en',
|
|
39
40
|
variant,
|
|
40
41
|
tokens,
|
|
41
42
|
items = [],
|
|
@@ -112,6 +113,7 @@ const ToggleSwitchGroup = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
112
113
|
..._utils.a11yProps.getPositionInSet(items.length, index)
|
|
113
114
|
};
|
|
114
115
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ToggleSwitch.default, {
|
|
116
|
+
copy: copy,
|
|
115
117
|
id: id,
|
|
116
118
|
ref: itemRef,
|
|
117
119
|
onChange: handleChange,
|
|
@@ -143,6 +145,11 @@ const ToggleSwitchGroup = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
143
145
|
});
|
|
144
146
|
ToggleSwitchGroup.displayName = 'ToggleSwitchGroup';
|
|
145
147
|
ToggleSwitchGroup.propTypes = { ...selectedSystemPropTypes,
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Whether the English or French copy will be used (e.g. for accessibility labels).
|
|
151
|
+
*/
|
|
152
|
+
copy: _propTypes.default.oneOf(['en', 'fr']),
|
|
146
153
|
tokens: (0, _utils.getTokensPropType)('ToggleSwitchGroup'),
|
|
147
154
|
variant: _utils.variantProp.propType,
|
|
148
155
|
|
package/lib/Tooltip/Tooltip.js
CHANGED
|
@@ -330,7 +330,7 @@ Tooltip.propTypes = { ...selectedSystemPropTypes,
|
|
|
330
330
|
content: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node]),
|
|
331
331
|
|
|
332
332
|
/**
|
|
333
|
-
* Select
|
|
333
|
+
* Select English or French copy for the accessible label.
|
|
334
334
|
*/
|
|
335
335
|
copy: _propTypes.default.oneOf(['en', 'fr']),
|
|
336
336
|
|
|
@@ -22,14 +22,25 @@ function useVerticalExpandAnimation({
|
|
|
22
22
|
isExpanded,
|
|
23
23
|
tokens
|
|
24
24
|
}) {
|
|
25
|
+
const [isAnimating, setIsAnimating] = (0, _react.useState)(false);
|
|
25
26
|
const expandAnimatedValue = (0, _react.useRef)(new _Animated.default.Value(0)).current;
|
|
27
|
+
const elementRef = (0, _react.useRef)(null);
|
|
26
28
|
const {
|
|
27
29
|
expandDuration,
|
|
28
30
|
collapseDuration
|
|
29
|
-
} = tokens;
|
|
31
|
+
} = tokens; // Treat as animating from when expanded state changes, until animation completes
|
|
32
|
+
|
|
33
|
+
(0, _react.useEffect)(() => setIsAnimating(true), [isExpanded]);
|
|
30
34
|
(0, _react.useEffect)(() => {
|
|
35
|
+
const onComplete = () => !isExpanded && setIsAnimating(false);
|
|
36
|
+
|
|
31
37
|
if (_Platform.default.OS === 'web') {
|
|
32
|
-
return;
|
|
38
|
+
if (!elementRef.current) return () => {}; // React Native Web does not pass `onTransitionEnd` through, must attach manually.
|
|
39
|
+
// https://github.com/necolas/react-native-web/pull/1713
|
|
40
|
+
|
|
41
|
+
const element = elementRef.current;
|
|
42
|
+
element.addEventListener('transitionend', onComplete);
|
|
43
|
+
return () => element.removeEventListener('transitionend', onComplete);
|
|
33
44
|
}
|
|
34
45
|
|
|
35
46
|
const animationConfig = {
|
|
@@ -39,25 +50,27 @@ function useVerticalExpandAnimation({
|
|
|
39
50
|
useNativeDriver: false
|
|
40
51
|
};
|
|
41
52
|
|
|
42
|
-
_Animated.default.timing(expandAnimatedValue, animationConfig)
|
|
43
|
-
|
|
44
|
-
|
|
53
|
+
const animation = _Animated.default.timing(expandAnimatedValue, animationConfig);
|
|
54
|
+
|
|
55
|
+
animation.start(onComplete);
|
|
56
|
+
return () => animation.stop();
|
|
57
|
+
}, [isExpanded, expandAnimatedValue, containerHeight, expandDuration, collapseDuration]); // Without `visibility: 'hidden', descendents are focusable on web even when collapsed
|
|
58
|
+
|
|
59
|
+
const containerStyles = !isExpanded && !isAnimating ? {
|
|
60
|
+
visibility: 'hidden'
|
|
61
|
+
} : {}; // don't visually collapse the container until we have it measured
|
|
45
62
|
|
|
46
63
|
if (containerHeight !== null) {
|
|
47
64
|
if (_Platform.default.OS === 'web') {
|
|
48
65
|
const transitionDuration = isExpanded ? expandDuration : collapseDuration;
|
|
49
|
-
containerStyles = {
|
|
50
|
-
|
|
51
|
-
height: isExpanded ? containerHeight : 0
|
|
52
|
-
};
|
|
66
|
+
containerStyles.transition = `height ${transitionDuration}ms ease-in-out`;
|
|
67
|
+
containerStyles.height = isExpanded ? containerHeight : 0;
|
|
53
68
|
} else {
|
|
54
|
-
containerStyles =
|
|
55
|
-
height: expandAnimatedValue
|
|
56
|
-
};
|
|
69
|
+
containerStyles.height = expandAnimatedValue;
|
|
57
70
|
}
|
|
58
71
|
}
|
|
59
72
|
|
|
60
|
-
return containerStyles;
|
|
73
|
+
return [containerStyles, elementRef];
|
|
61
74
|
}
|
|
62
75
|
|
|
63
76
|
var _default = useVerticalExpandAnimation;
|
|
@@ -11,6 +11,11 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
11
11
|
|
|
12
12
|
var _default = {
|
|
13
13
|
types: {
|
|
14
|
+
/**
|
|
15
|
+
* Whether the English or French copy will be used (e.g. for accessibility labels).
|
|
16
|
+
*/
|
|
17
|
+
copy: _propTypes.default.oneOf(['en', 'fr']),
|
|
18
|
+
|
|
14
19
|
/**
|
|
15
20
|
* The input label.
|
|
16
21
|
*/
|
|
@@ -43,6 +48,7 @@ var _default = {
|
|
|
43
48
|
validation: _propTypes.default.oneOf(['error', 'success'])
|
|
44
49
|
},
|
|
45
50
|
select: ({
|
|
51
|
+
copy,
|
|
46
52
|
label,
|
|
47
53
|
hint,
|
|
48
54
|
hintPosition,
|
|
@@ -51,6 +57,7 @@ var _default = {
|
|
|
51
57
|
validation
|
|
52
58
|
}) => ({
|
|
53
59
|
supportsProps: {
|
|
60
|
+
copy,
|
|
54
61
|
label,
|
|
55
62
|
hint,
|
|
56
63
|
hintPosition,
|