@telus-uds/components-web 2.12.0 → 2.14.0
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 +40 -2
- package/component-docs.json +105 -43
- package/lib/Autocomplete/Loading.js +5 -10
- package/lib/Autocomplete/dictionary.js +2 -2
- package/lib/Badge/Badge.js +10 -1
- package/lib/DatePicker/DatePicker.js +13 -0
- package/lib/NavigationBar/NavigationSubMenu.js +4 -8
- package/lib/QuantitySelector/QuantitySelector.js +67 -66
- package/lib/QuantitySelector/SideButton.js +93 -0
- package/lib/QuantitySelector/styles.js +4 -20
- package/lib/Spinner/Spinner.js +10 -1
- package/lib/Spinner/SpinnerContent.js +8 -0
- package/lib/Table/Cell.js +62 -91
- package/lib/Table/Header.js +4 -1
- package/lib/Table/SubHeading.js +4 -1
- package/lib/Table/Table.js +2 -1
- package/lib/TermsAndConditions/ExpandCollapse.js +31 -13
- package/lib/TermsAndConditions/TermsAndConditions.js +42 -10
- package/lib/Testimonial/Testimonial.js +48 -12
- package/lib/VideoPicker/VideoPickerPlayer.js +4 -2
- package/lib/VideoPicker/VideoPickerThumbnail.js +103 -60
- package/lib/VideoPicker/VideoSlider.js +2 -2
- package/lib-module/Autocomplete/Loading.js +6 -12
- package/lib-module/Autocomplete/dictionary.js +2 -2
- package/lib-module/Badge/Badge.js +10 -1
- package/lib-module/DatePicker/DatePicker.js +13 -1
- package/lib-module/NavigationBar/NavigationSubMenu.js +5 -9
- package/lib-module/QuantitySelector/QuantitySelector.js +68 -67
- package/lib-module/QuantitySelector/SideButton.js +80 -0
- package/lib-module/QuantitySelector/styles.js +3 -15
- package/lib-module/Spinner/Spinner.js +10 -1
- package/lib-module/Spinner/SpinnerContent.js +8 -0
- package/lib-module/Table/Cell.js +65 -90
- package/lib-module/Table/Header.js +4 -1
- package/lib-module/Table/SubHeading.js +4 -1
- package/lib-module/Table/Table.js +2 -1
- package/lib-module/TermsAndConditions/ExpandCollapse.js +33 -15
- package/lib-module/TermsAndConditions/TermsAndConditions.js +42 -11
- package/lib-module/Testimonial/Testimonial.js +49 -13
- package/lib-module/VideoPicker/VideoPickerPlayer.js +4 -2
- package/lib-module/VideoPicker/VideoPickerThumbnail.js +103 -61
- package/lib-module/VideoPicker/VideoSlider.js +2 -2
- package/package.json +4 -4
- package/src/Autocomplete/Loading.jsx +2 -5
- package/src/Autocomplete/dictionary.js +2 -2
- package/src/Badge/Badge.jsx +14 -2
- package/src/DatePicker/DatePicker.jsx +14 -1
- package/src/NavigationBar/NavigationSubMenu.jsx +3 -4
- package/src/QuantitySelector/QuantitySelector.jsx +60 -76
- package/src/QuantitySelector/SideButton.jsx +74 -0
- package/src/QuantitySelector/styles.js +4 -70
- package/src/Spinner/Spinner.jsx +9 -1
- package/src/Spinner/SpinnerContent.jsx +13 -1
- package/src/Table/Cell.jsx +58 -78
- package/src/Table/Header.jsx +6 -1
- package/src/Table/SubHeading.jsx +4 -1
- package/src/Table/Table.jsx +10 -2
- package/src/TermsAndConditions/ExpandCollapse.jsx +36 -14
- package/src/TermsAndConditions/TermsAndConditions.jsx +48 -10
- package/src/Testimonial/Testimonial.jsx +73 -11
- package/src/VideoPicker/VideoPickerPlayer.jsx +2 -2
- package/src/VideoPicker/VideoPickerThumbnail.jsx +51 -30
- package/src/VideoPicker/VideoSlider.jsx +2 -2
- package/types/BaseProvider.d.ts +25 -0
- package/types/index.d.ts +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { forwardRef, useState } from 'react';
|
|
1
|
+
import React, { forwardRef, useEffect, useState } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import momentPropTypes from 'react-moment-proptypes';
|
|
@@ -7,6 +7,7 @@ import SingleDatePicker from 'react-dates/lib/components/SingleDatePicker';
|
|
|
7
7
|
import DayPickerSingleDateController from 'react-dates/lib/components/DayPickerSingleDateController';
|
|
8
8
|
import { IconButton, TextInput, selectSystemProps, useCopy, useViewport, useThemeTokens, applyTextStyles } from '@telus-uds/components-base';
|
|
9
9
|
import moment from 'moment';
|
|
10
|
+
import { isUndefined } from 'lodash';
|
|
10
11
|
import CalendarContainer from './CalendarContainer';
|
|
11
12
|
import dictionary from './dictionary';
|
|
12
13
|
import { htmlAttrs } from '../utils';
|
|
@@ -110,6 +111,16 @@ const DatePicker = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
110
111
|
dictionary,
|
|
111
112
|
copy
|
|
112
113
|
});
|
|
114
|
+
useEffect(() => {
|
|
115
|
+
/**
|
|
116
|
+
* `date` could be passed as `null` to reset the value so explicitly
|
|
117
|
+
* checking for not being `undefined`
|
|
118
|
+
*/
|
|
119
|
+
if (!isUndefined(date) && !moment(date).isSame(inputDate)) {
|
|
120
|
+
setInputDate(date);
|
|
121
|
+
setInputText(date instanceof moment ? date.format(dateFormat) : '');
|
|
122
|
+
}
|
|
123
|
+
}, [date, inputDate]);
|
|
113
124
|
|
|
114
125
|
const onFocusChange = _ref2 => {
|
|
115
126
|
let {
|
|
@@ -147,6 +158,7 @@ const DatePicker = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
147
158
|
const onChange = value => {
|
|
148
159
|
setInputDate(value);
|
|
149
160
|
setInputText(value.format(dateFormat));
|
|
161
|
+
setIsFocused(false);
|
|
150
162
|
if (onDateChange) onDateChange(value);
|
|
151
163
|
};
|
|
152
164
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useRef } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { Icon,
|
|
3
|
+
import { Icon, useResponsiveProp, useThemeTokens } from '@telus-uds/components-base';
|
|
4
4
|
import NavigationItem from './NavigationItem';
|
|
5
5
|
import Listbox from '../Listbox';
|
|
6
6
|
import useOverlaidPosition from '../utils/useOverlaidPosition';
|
|
@@ -98,22 +98,18 @@ const NavigationSubMenu = _ref => {
|
|
|
98
98
|
onClick: handleClick,
|
|
99
99
|
icon: icoMenu,
|
|
100
100
|
children: _ref2 => {
|
|
101
|
-
var _textStyles
|
|
101
|
+
var _textStyles$;
|
|
102
102
|
|
|
103
103
|
let {
|
|
104
104
|
textStyles
|
|
105
105
|
} = _ref2;
|
|
106
|
-
return [children, /*#__PURE__*/_jsx(
|
|
107
|
-
space: 1,
|
|
108
|
-
direction: "row"
|
|
109
|
-
}, `${id}_spacer`), /*#__PURE__*/_jsx(Icon, {
|
|
106
|
+
return [children, /*#__PURE__*/_jsx(Icon, {
|
|
110
107
|
icon: icoMenu,
|
|
111
108
|
variant: {
|
|
112
|
-
size: '
|
|
109
|
+
size: 'micro'
|
|
113
110
|
},
|
|
114
111
|
tokens: {
|
|
115
|
-
color: (_textStyles$ = textStyles[0]) === null || _textStyles$ === void 0 ? void 0 : _textStyles$.color
|
|
116
|
-
size: (_textStyles$2 = textStyles[0]) === null || _textStyles$2 === void 0 ? void 0 : _textStyles$2.fontSize
|
|
112
|
+
color: (_textStyles$ = textStyles[0]) === null || _textStyles$ === void 0 ? void 0 : _textStyles$.color
|
|
117
113
|
}
|
|
118
114
|
}, `${id}_icon`)];
|
|
119
115
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import { InputField, InputWrapper, LeftButtonWrapper, RightButtonWrapper } from './styles';
|
|
3
|
+
import { Box, TextInput, Spacer, Feedback, InputLabel, useInputValue, useCopy, useThemeTokensCallback } from '@telus-uds/components-base';
|
|
4
|
+
import { InputField, InputWrapper } from './styles';
|
|
6
5
|
import defaultDictionary from './dictionary';
|
|
6
|
+
import SideButton from './SideButton';
|
|
7
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
8
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
9
|
const {
|
|
@@ -20,6 +20,7 @@ const QuantitySelector = _ref => {
|
|
|
20
20
|
minNumber,
|
|
21
21
|
maxNumber,
|
|
22
22
|
defaultValue,
|
|
23
|
+
value,
|
|
23
24
|
label,
|
|
24
25
|
hint,
|
|
25
26
|
hintPosition,
|
|
@@ -33,19 +34,9 @@ const QuantitySelector = _ref => {
|
|
|
33
34
|
testID
|
|
34
35
|
} = _ref;
|
|
35
36
|
const {
|
|
36
|
-
|
|
37
|
-
QuantitySelector: componentTheme
|
|
38
|
-
}
|
|
39
|
-
} = useTheme();
|
|
40
|
-
const {
|
|
41
|
-
leftIcon,
|
|
42
|
-
rightIcon,
|
|
43
|
-
padding
|
|
44
|
-
} = useThemeTokens('QuantitySelector', tokens, variant);
|
|
45
|
-
const [error, setError] = useState('');
|
|
46
|
-
const {
|
|
47
|
-
alternative
|
|
37
|
+
disabled
|
|
48
38
|
} = variant;
|
|
39
|
+
const [error, setError] = useState('');
|
|
49
40
|
const getCopy = useCopy({
|
|
50
41
|
dictionary,
|
|
51
42
|
copy
|
|
@@ -58,17 +49,16 @@ const QuantitySelector = _ref => {
|
|
|
58
49
|
return numberToEvaluate;
|
|
59
50
|
};
|
|
60
51
|
|
|
61
|
-
const initialValue = getValidatedNumber(defaultValue);
|
|
62
52
|
const {
|
|
63
53
|
currentValue: number,
|
|
64
54
|
setValue: setNumber
|
|
65
55
|
} = useInputValue({
|
|
66
|
-
value:
|
|
67
|
-
initialValue,
|
|
56
|
+
value: getValidatedNumber(value),
|
|
57
|
+
initialValue: getValidatedNumber(defaultValue),
|
|
68
58
|
onChange
|
|
69
59
|
});
|
|
70
|
-
const isDecreaseEnabled = !isNumber(minNumber) || number > minNumber;
|
|
71
|
-
const isIncreaseEnabled = !isNumber(maxNumber) || number < maxNumber;
|
|
60
|
+
const isDecreaseEnabled = !disabled && !isNumber(minNumber) || number > minNumber;
|
|
61
|
+
const isIncreaseEnabled = !disabled && !isNumber(maxNumber) || number < maxNumber;
|
|
72
62
|
const inputValue = isNumber(number) ? number.toString() : '';
|
|
73
63
|
|
|
74
64
|
const updateNumber = (newNumber, originalInputEvent) => {
|
|
@@ -100,20 +90,31 @@ const QuantitySelector = _ref => {
|
|
|
100
90
|
tooltip: tooltip
|
|
101
91
|
}) : null;
|
|
102
92
|
|
|
93
|
+
const getTokens = useThemeTokensCallback('QuantitySelector', tokens, variant);
|
|
94
|
+
|
|
103
95
|
const renderTextInput = () => /*#__PURE__*/_jsx(TextInput, {
|
|
104
96
|
nativeID: id,
|
|
105
97
|
value: inputValue,
|
|
98
|
+
defaultValue: defaultValue,
|
|
106
99
|
tokens: textInputState => {
|
|
107
100
|
const {
|
|
101
|
+
inputWidth,
|
|
102
|
+
inputBorderWidth,
|
|
108
103
|
inputBorderColor,
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
104
|
+
textColor,
|
|
105
|
+
inputBackgroundColor,
|
|
106
|
+
...rest
|
|
107
|
+
} = getTokens({ ...textInputState
|
|
108
|
+
});
|
|
109
|
+
return { ...rest,
|
|
110
|
+
order: 1,
|
|
111
|
+
borderWidth: inputBorderWidth,
|
|
112
|
+
backgroundColor: inputBackgroundColor,
|
|
113
|
+
color: textColor,
|
|
114
|
+
width: inputWidth,
|
|
115
115
|
borderColor: inputBorderColor,
|
|
116
|
-
|
|
116
|
+
borderRadius: 0,
|
|
117
|
+
outerBorderWidth: 0
|
|
117
118
|
};
|
|
118
119
|
},
|
|
119
120
|
onChange: inputChangeHandler // Using title as an accessibility workaround
|
|
@@ -127,38 +128,6 @@ const QuantitySelector = _ref => {
|
|
|
127
128
|
accessibilityValueNow: number
|
|
128
129
|
});
|
|
129
130
|
|
|
130
|
-
const getButtonTokens = isEnabled => buttonState => {
|
|
131
|
-
const disabled = !isEnabled;
|
|
132
|
-
const { ...buttonTokens
|
|
133
|
-
} = getThemeTokens(componentTheme, tokens, variant, { ...buttonState,
|
|
134
|
-
disabled
|
|
135
|
-
});
|
|
136
|
-
return { ...buttonTokens,
|
|
137
|
-
outerBorderGap: 0,
|
|
138
|
-
padding
|
|
139
|
-
};
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
const renderLeftButton = () => {
|
|
143
|
-
return /*#__PURE__*/_jsx(IconButton, {
|
|
144
|
-
icon: leftIcon,
|
|
145
|
-
tokens: getButtonTokens(isDecreaseEnabled),
|
|
146
|
-
onPress: event => updateNumber(number - 1, event),
|
|
147
|
-
onDoubleClick: event => updateNumber(number - 1, event),
|
|
148
|
-
accessibilityLabel: getCopy('accessibility').decreaseButton,
|
|
149
|
-
accessibilityDisabled: !isDecreaseEnabled
|
|
150
|
-
});
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
const renderRightButton = () => /*#__PURE__*/_jsx(IconButton, {
|
|
154
|
-
icon: rightIcon,
|
|
155
|
-
tokens: getButtonTokens(isIncreaseEnabled),
|
|
156
|
-
onPress: () => updateNumber(number + 1),
|
|
157
|
-
onDoubleClick: () => updateNumber(number + 1),
|
|
158
|
-
accessibilityLabel: getCopy('accessibility').increaseButton,
|
|
159
|
-
accessibilityDisabled: !isIncreaseEnabled
|
|
160
|
-
});
|
|
161
|
-
|
|
162
131
|
return /*#__PURE__*/_jsxs(Box, {
|
|
163
132
|
space: 2,
|
|
164
133
|
testID: testID,
|
|
@@ -166,14 +135,39 @@ const QuantitySelector = _ref => {
|
|
|
166
135
|
space: 2
|
|
167
136
|
}), /*#__PURE__*/_jsxs(InputWrapper, {
|
|
168
137
|
children: [/*#__PURE__*/_jsx(InputField, {
|
|
169
|
-
className: `${alternative ? 'alternative' : ''}`,
|
|
170
138
|
children: renderTextInput()
|
|
171
|
-
}), /*#__PURE__*/_jsx(
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
139
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
140
|
+
style: {
|
|
141
|
+
order: 0
|
|
142
|
+
},
|
|
143
|
+
children: /*#__PURE__*/_jsx(SideButton, {
|
|
144
|
+
isEnabled: isDecreaseEnabled,
|
|
145
|
+
onPress: () => updateNumber(number - 1),
|
|
146
|
+
onDoubleClick: () => updateNumber(number - 1),
|
|
147
|
+
tokens: tokens,
|
|
148
|
+
variant: {
|
|
149
|
+
decrease: true,
|
|
150
|
+
...variant
|
|
151
|
+
},
|
|
152
|
+
accessibilityLabel: getCopy('accessibility').decreaseButton,
|
|
153
|
+
accessibilityDisabled: !isDecreaseEnabled
|
|
154
|
+
})
|
|
155
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
156
|
+
style: {
|
|
157
|
+
order: 2
|
|
158
|
+
},
|
|
159
|
+
children: /*#__PURE__*/_jsx(SideButton, {
|
|
160
|
+
isEnabled: isIncreaseEnabled,
|
|
161
|
+
onPress: () => updateNumber(number + 1),
|
|
162
|
+
onDoubleClick: () => updateNumber(number + 1),
|
|
163
|
+
accessibilityLabel: getCopy('accessibility').increaseButton,
|
|
164
|
+
accessibilityDisabled: !isIncreaseEnabled,
|
|
165
|
+
tokens: tokens,
|
|
166
|
+
variant: {
|
|
167
|
+
increase: true,
|
|
168
|
+
...variant
|
|
169
|
+
}
|
|
170
|
+
})
|
|
177
171
|
})]
|
|
178
172
|
}), error ? /*#__PURE__*/_jsx(Box, {
|
|
179
173
|
vertical: 2,
|
|
@@ -224,6 +218,12 @@ QuantitySelector.propTypes = {
|
|
|
224
218
|
*/
|
|
225
219
|
defaultValue: PropTypes.number,
|
|
226
220
|
|
|
221
|
+
/**
|
|
222
|
+
* If the input's state is to be controlled by a parent component, use this prop
|
|
223
|
+
* together with the `onChange` to pass down and update the lifted state.
|
|
224
|
+
*/
|
|
225
|
+
value: PropTypes.number,
|
|
226
|
+
|
|
227
227
|
/**
|
|
228
228
|
* The label of the input field
|
|
229
229
|
*/
|
|
@@ -262,7 +262,8 @@ QuantitySelector.propTypes = {
|
|
|
262
262
|
*/
|
|
263
263
|
copy: PropTypes.oneOfType([PropTypes.oneOf(['en', 'fr'])]),
|
|
264
264
|
variant: PropTypes.exact({
|
|
265
|
-
alternative: PropTypes.bool
|
|
265
|
+
alternative: PropTypes.bool,
|
|
266
|
+
disabled: PropTypes.bool
|
|
266
267
|
}),
|
|
267
268
|
tokens: PropTypes.oneOf([PropTypes.object, PropTypes.func]),
|
|
268
269
|
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { IconButton, useThemeTokensCallback } from '@telus-uds/components-base';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
const SideButton = _ref => {
|
|
7
|
+
let {
|
|
8
|
+
isEnabled,
|
|
9
|
+
onPress,
|
|
10
|
+
onDoubleClick,
|
|
11
|
+
accessibilityLabel,
|
|
12
|
+
accessibilityDisabled,
|
|
13
|
+
tokens,
|
|
14
|
+
variant
|
|
15
|
+
} = _ref;
|
|
16
|
+
const getTokens = useThemeTokensCallback('QuantitySelectorSideButton', tokens, variant);
|
|
17
|
+
|
|
18
|
+
const getButtonTokens = _ref2 => {
|
|
19
|
+
let {
|
|
20
|
+
buttonState,
|
|
21
|
+
disabled
|
|
22
|
+
} = _ref2;
|
|
23
|
+
const {
|
|
24
|
+
borderRadius,
|
|
25
|
+
borderTopLeftRadius,
|
|
26
|
+
borderTopRightRadius,
|
|
27
|
+
borderBottomLeftRadius,
|
|
28
|
+
borderBottomRightRadius,
|
|
29
|
+
...rest
|
|
30
|
+
} = getTokens({ ...buttonState,
|
|
31
|
+
disabled
|
|
32
|
+
});
|
|
33
|
+
return { ...rest,
|
|
34
|
+
borderRadius,
|
|
35
|
+
borderTopLeftRadius,
|
|
36
|
+
borderTopRightRadius,
|
|
37
|
+
borderBottomLeftRadius,
|
|
38
|
+
borderBottomRightRadius,
|
|
39
|
+
outerBorderRadius: borderRadius,
|
|
40
|
+
outerBorderTopLeftRadius: borderTopLeftRadius,
|
|
41
|
+
outerBorderTopRightRadius: borderTopRightRadius,
|
|
42
|
+
outerBorderBottomLeftRadius: borderBottomLeftRadius,
|
|
43
|
+
outerBorderBottomRightRadius: borderBottomRightRadius,
|
|
44
|
+
outerBorderGap: 0,
|
|
45
|
+
outerBorderWidth: 0
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
return /*#__PURE__*/_jsx(IconButton, {
|
|
50
|
+
tokens: buttonState => getButtonTokens({
|
|
51
|
+
disabled: !isEnabled,
|
|
52
|
+
buttonState
|
|
53
|
+
}),
|
|
54
|
+
onPress: onPress,
|
|
55
|
+
onDoubleClick: onDoubleClick,
|
|
56
|
+
accessibilityLabel: accessibilityLabel,
|
|
57
|
+
accessibilityDisabled: accessibilityDisabled
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
SideButton.displayName = 'QuantitySelectorSideButton';
|
|
62
|
+
SideButton.defaultProps = {
|
|
63
|
+
isEnabled: true,
|
|
64
|
+
onPress: () => {},
|
|
65
|
+
onDoubleClick: () => {},
|
|
66
|
+
accessibilityLabel: '',
|
|
67
|
+
accessibilityDisabled: false,
|
|
68
|
+
tokens: {},
|
|
69
|
+
variant: {}
|
|
70
|
+
};
|
|
71
|
+
SideButton.propTypes = {
|
|
72
|
+
isEnabled: PropTypes.bool,
|
|
73
|
+
onPress: PropTypes.func,
|
|
74
|
+
onDoubleClick: PropTypes.func,
|
|
75
|
+
accessibilityLabel: PropTypes.string,
|
|
76
|
+
accessibilityDisabled: PropTypes.bool,
|
|
77
|
+
tokens: PropTypes.object,
|
|
78
|
+
variant: PropTypes.object
|
|
79
|
+
};
|
|
80
|
+
export default SideButton;
|
|
@@ -2,20 +2,8 @@ import styled from 'styled-components';
|
|
|
2
2
|
export const InputField = /*#__PURE__*/styled.div.withConfig({
|
|
3
3
|
displayName: "styles__InputField",
|
|
4
4
|
componentId: "components-web__sc-1lrz1xk-0"
|
|
5
|
-
})(["order:
|
|
6
|
-
const ButtonWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
7
|
-
displayName: "styles__ButtonWrapper",
|
|
8
|
-
componentId: "components-web__sc-1lrz1xk-1"
|
|
9
|
-
})(["&.alternative{div[role='button']{height:42px;> div{height:40px;> div{padding:12px 16px;}}}}"]);
|
|
10
|
-
export const LeftButtonWrapper = /*#__PURE__*/styled(ButtonWrapper).withConfig({
|
|
11
|
-
displayName: "styles__LeftButtonWrapper",
|
|
12
|
-
componentId: "components-web__sc-1lrz1xk-2"
|
|
13
|
-
})(["order:0;div[role='button']{border-radius:4px 0px 0px 4px !important;> div{border-right:none;border-radius:4px 0px 0px 4px !important;}}&.alternative{div[role='button']{border-radius:36px 0px 0px 36px !important;> div{border-radius:24px 0px 0px 24px !important;}}}"]);
|
|
14
|
-
export const RightButtonWrapper = /*#__PURE__*/styled(ButtonWrapper).withConfig({
|
|
15
|
-
displayName: "styles__RightButtonWrapper",
|
|
16
|
-
componentId: "components-web__sc-1lrz1xk-3"
|
|
17
|
-
})(["order:3;div[role='button']{border-radius:0px 4px 4px 0px !important;> div{border-left:none;border-radius:0px 4px 4px 0px !important;}}&.alternative{div[role='button']{border-radius:0px 36px 36px 0px !important;> div{border-radius:0px 36px 36px 0px !important;}}}"]);
|
|
5
|
+
})(["order:1;text-align:center;z-index:10;input{text-align:center;}"]);
|
|
18
6
|
export const InputWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
19
7
|
displayName: "styles__InputWrapper",
|
|
20
|
-
componentId: "components-web__sc-1lrz1xk-
|
|
21
|
-
})(["
|
|
8
|
+
componentId: "components-web__sc-1lrz1xk-1"
|
|
9
|
+
})(["text-align:start;display:flex;flex-direction:row;flex-wrap:nowrap;"]);
|
|
@@ -88,6 +88,7 @@ const Spinner = _ref3 => {
|
|
|
88
88
|
fullScreen = false,
|
|
89
89
|
inline = false,
|
|
90
90
|
label,
|
|
91
|
+
labelPosition,
|
|
91
92
|
show = false,
|
|
92
93
|
isStatic = false,
|
|
93
94
|
tokens,
|
|
@@ -120,6 +121,7 @@ const Spinner = _ref3 => {
|
|
|
120
121
|
...selectProps(rest),
|
|
121
122
|
children: /*#__PURE__*/_jsx(SpinnerContent, {
|
|
122
123
|
label: label,
|
|
124
|
+
labelPosition: labelPosition,
|
|
123
125
|
overlay: true,
|
|
124
126
|
size: size,
|
|
125
127
|
thickness: thickness,
|
|
@@ -139,6 +141,7 @@ const Spinner = _ref3 => {
|
|
|
139
141
|
...selectProps(rest),
|
|
140
142
|
children: [/*#__PURE__*/_jsx(SpinnerContent, {
|
|
141
143
|
label: label,
|
|
144
|
+
labelPosition: labelPosition,
|
|
142
145
|
overlay: true,
|
|
143
146
|
size: size,
|
|
144
147
|
thickness: thickness,
|
|
@@ -164,6 +167,7 @@ const Spinner = _ref3 => {
|
|
|
164
167
|
return /*#__PURE__*/_jsx(SpinnerContainer, { ...selectProps(rest),
|
|
165
168
|
children: /*#__PURE__*/_jsx(SpinnerContent, {
|
|
166
169
|
label: label,
|
|
170
|
+
labelPosition: labelPosition,
|
|
167
171
|
size: size,
|
|
168
172
|
thickness: thickness,
|
|
169
173
|
sizeVariant: sizeVariant,
|
|
@@ -211,6 +215,11 @@ Spinner.propTypes = { ...selectedSystemPropTypes,
|
|
|
211
215
|
/**
|
|
212
216
|
* If true, it should render a static spinner
|
|
213
217
|
*/
|
|
214
|
-
isStatic: PropTypes.bool
|
|
218
|
+
isStatic: PropTypes.bool,
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Determine where the label of the spinner should be placed, left, right, bottom or top.
|
|
222
|
+
*/
|
|
223
|
+
labelPosition: PropTypes.string
|
|
215
224
|
};
|
|
216
225
|
export default Spinner;
|
|
@@ -31,6 +31,7 @@ const Container = /*#__PURE__*/styled.div.withConfig({
|
|
|
31
31
|
const SpinnerContent = _ref2 => {
|
|
32
32
|
let {
|
|
33
33
|
label,
|
|
34
|
+
labelPosition,
|
|
34
35
|
overlay = false,
|
|
35
36
|
sizeVariant,
|
|
36
37
|
size,
|
|
@@ -38,6 +39,12 @@ const SpinnerContent = _ref2 => {
|
|
|
38
39
|
isStatic,
|
|
39
40
|
...rest
|
|
40
41
|
} = _ref2;
|
|
42
|
+
const labelMapping = {
|
|
43
|
+
top: 'column-reverse',
|
|
44
|
+
bottom: 'column',
|
|
45
|
+
left: 'row-reverse',
|
|
46
|
+
right: 'row'
|
|
47
|
+
};
|
|
41
48
|
return /*#__PURE__*/_jsx(Container, {
|
|
42
49
|
overlay: overlay,
|
|
43
50
|
children: /*#__PURE__*/_jsxs(StackView, {
|
|
@@ -45,6 +52,7 @@ const SpinnerContent = _ref2 => {
|
|
|
45
52
|
tokens: {
|
|
46
53
|
alignItems: 'center'
|
|
47
54
|
},
|
|
55
|
+
direction: labelMapping[labelPosition],
|
|
48
56
|
children: [/*#__PURE__*/_jsx(ActivityIndicator, {
|
|
49
57
|
label: label,
|
|
50
58
|
tokens: {
|