@widergy/energy-ui 3.171.0 → 3.171.2
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 +19 -3
- package/dist/components/UTBanner/stories/UTBanner.stories.js +16 -1
- package/dist/components/UTBaseInputField/theme.js +6 -5
- package/dist/components/UTButton/styles.module.scss +11 -11
- package/dist/components/UTButton/theme.js +1 -1
- package/dist/components/UTButtonGroup/styles.module.scss +1 -1
- package/dist/components/UTCheckbox/versions/V1/theme.js +4 -1
- package/dist/components/UTDataCategory/styles.module.scss +1 -1
- package/dist/components/UTDataCategory/theme.js +1 -1
- package/dist/components/UTDataElement/index.js +1 -1
- package/dist/components/UTDataElement/styles.module.scss +9 -9
- package/dist/components/UTDatePicker/versions/V1/stories/UTDatePickerV1.stories.js +59 -1
- package/dist/components/UTLabel/UTLabel.stories.js +81 -1
- package/dist/components/UTLabel/constants.js +10 -10
- package/dist/components/UTLabel/theme.js +4 -4
- package/dist/components/UTRadioGroup/versions/V1/index.js +12 -3
- package/dist/components/UTSelect/UTSelect.stories.js +897 -0
- package/dist/components/UTSelect/versions/V1/components/InputComponent/index.js +13 -3
- package/dist/components/UTSelect/versions/V1/components/ListboxComponent/index.js +7 -6
- package/dist/components/UTSelect/versions/V1/constants.js +10 -0
- package/dist/components/UTSelect/versions/V1/index.js +41 -68
- package/dist/components/UTSelect/versions/V1/types.js +54 -0
- package/dist/components/UTSelect/versions/V1/utils.js +10 -9
- package/dist/components/UTShortcutPanel/styles.module.scss +10 -10
- package/dist/components/UTStatus/theme.js +26 -26
- package/dist/esm/components/UTBanner/stories/UTBanner.stories.js +16 -1
- package/dist/esm/components/UTBaseInputField/theme.js +6 -5
- package/dist/esm/components/UTButton/styles.module.scss +11 -11
- package/dist/esm/components/UTButton/theme.js +1 -1
- package/dist/esm/components/UTButtonGroup/styles.module.scss +1 -1
- package/dist/esm/components/UTCheckbox/versions/V1/theme.js +4 -1
- package/dist/esm/components/UTDataCategory/styles.module.scss +1 -1
- package/dist/esm/components/UTDataCategory/theme.js +1 -1
- package/dist/esm/components/UTDataElement/index.js +1 -1
- package/dist/esm/components/UTDataElement/styles.module.scss +9 -9
- package/dist/esm/components/UTDatePicker/versions/V1/stories/UTDatePickerV1.stories.js +58 -0
- package/dist/esm/components/UTLabel/UTLabel.stories.js +80 -0
- package/dist/esm/components/UTLabel/constants.js +10 -10
- package/dist/esm/components/UTLabel/theme.js +4 -4
- package/dist/esm/components/UTRadioGroup/versions/V1/index.js +12 -3
- package/dist/esm/components/UTSelect/UTSelect.stories.js +889 -0
- package/dist/esm/components/UTSelect/versions/V1/components/InputComponent/index.js +14 -4
- package/dist/esm/components/UTSelect/versions/V1/components/ListboxComponent/index.js +4 -3
- package/dist/esm/components/UTSelect/versions/V1/constants.js +4 -0
- package/dist/esm/components/UTSelect/versions/V1/index.js +41 -68
- package/dist/esm/components/UTSelect/versions/V1/types.js +48 -0
- package/dist/esm/components/UTSelect/versions/V1/utils.js +7 -6
- package/dist/esm/components/UTShortcutPanel/styles.module.scss +10 -10
- package/dist/esm/components/UTStatus/theme.js +26 -26
- package/dist/esm/utils/hooks/useCSSVariables/constants.js +11 -9
- package/dist/utils/hooks/useCSSVariables/constants.js +11 -9
- package/package.json +10 -9
- package/dist/components/UTSelect/versions/V1/UTSelectV1.mdx +0 -13
- package/dist/components/UTSelect/versions/V1/UTSelectV1.stories.js +0 -741
- package/dist/esm/components/UTSelect/versions/V1/UTSelectV1.mdx +0 -13
- package/dist/esm/components/UTSelect/versions/V1/UTSelectV1.stories.js +0 -733
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/* eslint-disable no-unused-vars */
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { arrayOf, bool, func, instanceOf, object, oneOfType, shape, string } from 'prop-types';
|
|
3
|
+
import { arrayOf, bool, func, instanceOf, object, oneOf, oneOfType, shape, string } from 'prop-types';
|
|
4
4
|
import UTBaseInputField from '../../../../../UTBaseInputField';
|
|
5
|
+
import { VARIANTS } from '../../constants';
|
|
5
6
|
const InputComponent = _ref => {
|
|
6
7
|
let {
|
|
7
8
|
alwaysShowPlaceholder,
|
|
@@ -37,12 +38,21 @@ const InputComponent = _ref => {
|
|
|
37
38
|
},
|
|
38
39
|
...restParams
|
|
39
40
|
} = params;
|
|
41
|
+
const isPicker = variant === VARIANTS.picker;
|
|
40
42
|
const modifiedParams = {
|
|
41
43
|
...restParams,
|
|
42
44
|
InputProps: restInputProps,
|
|
43
|
-
inputProps:
|
|
45
|
+
inputProps: {
|
|
46
|
+
...restInputPropsFromField,
|
|
47
|
+
...(isPicker && {
|
|
48
|
+
readOnly: true,
|
|
49
|
+
style: {
|
|
50
|
+
cursor: 'default'
|
|
51
|
+
}
|
|
52
|
+
})
|
|
53
|
+
}
|
|
44
54
|
};
|
|
45
|
-
const fieldVariant =
|
|
55
|
+
const fieldVariant = isPicker ? 'transparent' : 'white';
|
|
46
56
|
return /*#__PURE__*/React.createElement(UTBaseInputField, {
|
|
47
57
|
alwaysShowPlaceholder: alwaysShowPlaceholder,
|
|
48
58
|
dataTestId: dataTestId,
|
|
@@ -93,6 +103,6 @@ InputComponent.propTypes = {
|
|
|
93
103
|
props: object
|
|
94
104
|
})),
|
|
95
105
|
value: string,
|
|
96
|
-
variant:
|
|
106
|
+
variant: oneOf(Object.values(VARIANTS))
|
|
97
107
|
};
|
|
98
108
|
export default InputComponent;
|
|
@@ -5,6 +5,7 @@ import { arrayOf, bool, elementType, func, oneOfType, shape, string, number } fr
|
|
|
5
5
|
import isFinite from 'lodash/isFinite';
|
|
6
6
|
import UTLabel from '../../../../../UTLabel';
|
|
7
7
|
import UTCheckList from '../../../../../UTCheckList';
|
|
8
|
+
import { SPACING } from '../../../../../UTCheckList/versions/V1/constants';
|
|
8
9
|
import styles from './styles.module.scss';
|
|
9
10
|
import { DEFAULT_MAX_HEIGHT } from './constants';
|
|
10
11
|
const ListboxComponent = _ref => {
|
|
@@ -13,13 +14,13 @@ const ListboxComponent = _ref => {
|
|
|
13
14
|
dataTestId,
|
|
14
15
|
filteredOptions,
|
|
15
16
|
handleSelectionChange,
|
|
16
|
-
horizontalSpacing,
|
|
17
|
+
horizontalSpacing = SPACING.SMALL,
|
|
17
18
|
itemDataTestId,
|
|
18
19
|
maxHeight = DEFAULT_MAX_HEIGHT,
|
|
19
20
|
multiple,
|
|
20
21
|
noMatchesText,
|
|
21
22
|
value,
|
|
22
|
-
verticalSpacing
|
|
23
|
+
verticalSpacing = SPACING.SMALL
|
|
23
24
|
} = _ref;
|
|
24
25
|
const hasNoOptions = useMemo(() => isEmpty(filteredOptions), [filteredOptions]);
|
|
25
26
|
const maxHeightValid = useMemo(() => isFinite(maxHeight) ? maxHeight : DEFAULT_MAX_HEIGHT, [maxHeight]);
|
|
@@ -38,7 +39,7 @@ const ListboxComponent = _ref => {
|
|
|
38
39
|
itemDataTestId: itemDataTestId,
|
|
39
40
|
onChange: handleSelectionChange,
|
|
40
41
|
options: filteredOptions,
|
|
41
|
-
reversed:
|
|
42
|
+
reversed: true,
|
|
42
43
|
showSelectAll: false,
|
|
43
44
|
value: multiple ? value : [value],
|
|
44
45
|
variant: "button",
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
2
|
import clone from 'lodash/clone';
|
|
3
3
|
import React, { useMemo, useState, useRef, useCallback, useEffect } from 'react';
|
|
4
|
-
import { arrayOf, bool, elementType, func, number, object, oneOfType, shape, string } from 'prop-types';
|
|
5
4
|
import { Autocomplete } from '@material-ui/lab';
|
|
5
|
+
import Popper from '@material-ui/core/Popper';
|
|
6
6
|
import UTFieldLabel from '../../../UTFieldLabel';
|
|
7
7
|
import UTLabel from '../../../UTLabel';
|
|
8
8
|
import UTPaper from '../../../UTPaper';
|
|
9
9
|
import UTValidation from '../../../UTValidation';
|
|
10
10
|
import { formatErrorToValidation } from '../../../UTValidation/utils';
|
|
11
11
|
import { TITLE_VARIANTS } from '../../../../constants/inputs';
|
|
12
|
-
import { buttonTypes } from '../../../../types/buttonTypes';
|
|
13
12
|
import InputComponent from './components/InputComponent';
|
|
14
13
|
import ListboxComponent from './components/ListboxComponent';
|
|
14
|
+
import { utselectTypes } from './types';
|
|
15
15
|
import styles from './styles.module.scss';
|
|
16
|
+
import { VARIANTS } from './constants';
|
|
16
17
|
import { getLeftAdornments, getRightAdornments, shouldReset, getDisplayValue, sortOptions } from './utils';
|
|
17
18
|
const UTSelect = _ref => {
|
|
18
19
|
let {
|
|
@@ -35,6 +36,7 @@ const UTSelect = _ref => {
|
|
|
35
36
|
itemDataTestId,
|
|
36
37
|
listDataTestId,
|
|
37
38
|
listProps = {},
|
|
39
|
+
menuWidth,
|
|
38
40
|
multiple = false,
|
|
39
41
|
noMatchesText = 'No hay coincidencias con tu búsqueda',
|
|
40
42
|
noOptionsText = 'No hay opciones disponibles',
|
|
@@ -49,7 +51,7 @@ const UTSelect = _ref => {
|
|
|
49
51
|
title,
|
|
50
52
|
titleVariant = TITLE_VARIANTS.large,
|
|
51
53
|
value = multiple ? [] : null,
|
|
52
|
-
variant =
|
|
54
|
+
variant = VARIANTS.select,
|
|
53
55
|
withAutoReset = true
|
|
54
56
|
} = _ref;
|
|
55
57
|
const optionsSortedByCategory = useMemo(() => {
|
|
@@ -94,7 +96,8 @@ const UTSelect = _ref => {
|
|
|
94
96
|
if (isPopperOpen) setSortedOptions(sortOptions(optionsSortedByCategory, value, multiple));
|
|
95
97
|
}, [isPopperOpen]);
|
|
96
98
|
const validationData = useMemo(() => error && formatErrorToValidation(error), [error]);
|
|
97
|
-
const
|
|
99
|
+
const isPicker = variant === VARIANTS.picker;
|
|
100
|
+
const filteredOptions = useMemo(() => disableFilterOptions || isPicker ? sortedOptions : sortedOptions.filter(option => "".concat(option.name).toLowerCase().includes(searchTerm.toLowerCase())), [sortedOptions, searchTerm, disableFilterOptions, isPicker]);
|
|
98
101
|
const handleSearchChange = useCallback(searchValue => {
|
|
99
102
|
onChangeSearchTerm === null || onChangeSearchTerm === void 0 || onChangeSearchTerm(searchValue);
|
|
100
103
|
setSearchTerm(searchValue);
|
|
@@ -146,24 +149,6 @@ const UTSelect = _ref => {
|
|
|
146
149
|
suffix,
|
|
147
150
|
variant
|
|
148
151
|
}), [suffix, showClearButton, clearable, disabled, action, handleClearSelection, variant]);
|
|
149
|
-
const InputComponentToRender = useMemo(() => params => /*#__PURE__*/React.createElement(InputComponent, {
|
|
150
|
-
alwaysShowPlaceholder: alwaysShowPlaceholder,
|
|
151
|
-
dataTestId: dataTestId,
|
|
152
|
-
disabled: disabled,
|
|
153
|
-
error: error,
|
|
154
|
-
inputSize: inputSize,
|
|
155
|
-
inputRef: inputRef,
|
|
156
|
-
leftAdornments: leftAdornments,
|
|
157
|
-
onBlur: handleInputBlur,
|
|
158
|
-
onChange: handleSearchChange,
|
|
159
|
-
onFocus: handleInputFocus,
|
|
160
|
-
params: params,
|
|
161
|
-
placeholder: placeholder,
|
|
162
|
-
readOnly: readOnly,
|
|
163
|
-
rightAdornments: rightAdornments,
|
|
164
|
-
value: searchTerm,
|
|
165
|
-
variant: variant
|
|
166
|
-
}), [alwaysShowPlaceholder, disabled, error, handleInputBlur, handleInputFocus, leftAdornments, placeholder, rightAdornments, searchTerm]);
|
|
167
152
|
const listBoxProps = useMemo(() => ({
|
|
168
153
|
CustomRow,
|
|
169
154
|
dataTestId: listDataTestId,
|
|
@@ -175,6 +160,19 @@ const UTSelect = _ref => {
|
|
|
175
160
|
value,
|
|
176
161
|
...listProps
|
|
177
162
|
}), [CustomRow, filteredOptions, handleSelectionChange, multiple, noMatchesText, value, listProps]);
|
|
163
|
+
const menuWidthRef = useRef(menuWidth);
|
|
164
|
+
menuWidthRef.current = menuWidth;
|
|
165
|
+
const CustomPopper = useCallback(props => {
|
|
166
|
+
const width = menuWidthRef.current;
|
|
167
|
+
return /*#__PURE__*/React.createElement(Popper, _extends({}, props, width ? {
|
|
168
|
+
placement: 'bottom-start'
|
|
169
|
+
} : {}, {
|
|
170
|
+
style: width ? {
|
|
171
|
+
...props.style,
|
|
172
|
+
width
|
|
173
|
+
} : props.style
|
|
174
|
+
}));
|
|
175
|
+
}, []);
|
|
178
176
|
const noOptionsTextComponent = /*#__PURE__*/React.createElement(UTLabel, {
|
|
179
177
|
className: styles.noOptionsLabel,
|
|
180
178
|
colorTheme: "gray"
|
|
@@ -185,11 +183,12 @@ const UTSelect = _ref => {
|
|
|
185
183
|
actions: titleActions,
|
|
186
184
|
required: required,
|
|
187
185
|
size: titleVariant
|
|
188
|
-
}, title), /*#__PURE__*/React.createElement(Autocomplete, _extends({}, freeWidth ? {
|
|
186
|
+
}, title), /*#__PURE__*/React.createElement(Autocomplete, _extends({}, freeWidth && !menuWidth ? {
|
|
189
187
|
classes: {
|
|
190
188
|
popper: styles.popper
|
|
191
189
|
}
|
|
192
190
|
} : {}, {
|
|
191
|
+
PopperComponent: CustomPopper,
|
|
193
192
|
disabled: disabled || readOnly,
|
|
194
193
|
getOptionLabel: option => "".concat(option.name),
|
|
195
194
|
ListboxComponent: ListboxComponent,
|
|
@@ -201,7 +200,24 @@ const UTSelect = _ref => {
|
|
|
201
200
|
open: isPopperOpen,
|
|
202
201
|
options: optionsSortedByCategory,
|
|
203
202
|
PaperComponent: UTPaper,
|
|
204
|
-
renderInput:
|
|
203
|
+
renderInput: params => /*#__PURE__*/React.createElement(InputComponent, {
|
|
204
|
+
alwaysShowPlaceholder: alwaysShowPlaceholder,
|
|
205
|
+
dataTestId: dataTestId,
|
|
206
|
+
disabled: disabled,
|
|
207
|
+
error: error,
|
|
208
|
+
inputRef: inputRef,
|
|
209
|
+
inputSize: inputSize,
|
|
210
|
+
leftAdornments: leftAdornments,
|
|
211
|
+
onBlur: handleInputBlur,
|
|
212
|
+
onChange: handleSearchChange,
|
|
213
|
+
onFocus: handleInputFocus,
|
|
214
|
+
params: params,
|
|
215
|
+
placeholder: placeholder,
|
|
216
|
+
readOnly: readOnly,
|
|
217
|
+
rightAdornments: rightAdornments,
|
|
218
|
+
value: searchTerm,
|
|
219
|
+
variant: variant
|
|
220
|
+
})
|
|
205
221
|
}, autocompleteProps)), helpText && /*#__PURE__*/React.createElement(UTLabel, {
|
|
206
222
|
colorTheme: "gray",
|
|
207
223
|
variant: "small"
|
|
@@ -210,48 +226,5 @@ const UTSelect = _ref => {
|
|
|
210
226
|
validationData: validationData
|
|
211
227
|
}));
|
|
212
228
|
};
|
|
213
|
-
UTSelect.propTypes =
|
|
214
|
-
action: shape({
|
|
215
|
-
Icon: string,
|
|
216
|
-
onClick: func,
|
|
217
|
-
size: string
|
|
218
|
-
}),
|
|
219
|
-
actions: arrayOf(buttonTypes),
|
|
220
|
-
alwaysShowPlaceholder: bool,
|
|
221
|
-
autocompleteProps: object,
|
|
222
|
-
className: string,
|
|
223
|
-
clearable: bool,
|
|
224
|
-
CustomRow: elementType,
|
|
225
|
-
dataTestId: string,
|
|
226
|
-
disabled: bool,
|
|
227
|
-
disableFilterOptions: bool,
|
|
228
|
-
error: string,
|
|
229
|
-
errorDataTestId: string,
|
|
230
|
-
freeWidth: bool,
|
|
231
|
-
helpText: string,
|
|
232
|
-
icon: string,
|
|
233
|
-
inputSize: string,
|
|
234
|
-
itemDataTestId: string,
|
|
235
|
-
listDataTestId: string,
|
|
236
|
-
listProps: object,
|
|
237
|
-
multiple: bool,
|
|
238
|
-
noMatchesText: string,
|
|
239
|
-
noOptionsText: string,
|
|
240
|
-
onChange: func,
|
|
241
|
-
onChangeSearchTerm: func,
|
|
242
|
-
options: arrayOf(shape({
|
|
243
|
-
name: string,
|
|
244
|
-
value: oneOfType([string, number])
|
|
245
|
-
})),
|
|
246
|
-
placeholder: string,
|
|
247
|
-
prefix: string,
|
|
248
|
-
readOnly: bool,
|
|
249
|
-
required: bool,
|
|
250
|
-
suffix: string,
|
|
251
|
-
title: string,
|
|
252
|
-
titleVariant: string,
|
|
253
|
-
value: oneOfType([string, arrayOf(oneOfType([string, number]))]),
|
|
254
|
-
variant: string,
|
|
255
|
-
withAutoReset: bool
|
|
256
|
-
};
|
|
229
|
+
UTSelect.propTypes = utselectTypes;
|
|
257
230
|
export default UTSelect;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { arrayOf, bool, elementType, func, number, object, oneOf, oneOfType, shape, string } from 'prop-types';
|
|
2
|
+
import { buttonTypes } from '../../../../types/buttonTypes';
|
|
3
|
+
import { VARIANTS } from './constants';
|
|
4
|
+
export const utselectTypes = {
|
|
5
|
+
action: shape({
|
|
6
|
+
Icon: string,
|
|
7
|
+
onClick: func,
|
|
8
|
+
size: string
|
|
9
|
+
}),
|
|
10
|
+
actions: arrayOf(buttonTypes),
|
|
11
|
+
alwaysShowPlaceholder: bool,
|
|
12
|
+
autocompleteProps: object,
|
|
13
|
+
className: string,
|
|
14
|
+
clearable: bool,
|
|
15
|
+
CustomRow: elementType,
|
|
16
|
+
dataTestId: string,
|
|
17
|
+
disabled: bool,
|
|
18
|
+
disableFilterOptions: bool,
|
|
19
|
+
error: string,
|
|
20
|
+
errorDataTestId: string,
|
|
21
|
+
freeWidth: bool,
|
|
22
|
+
helpText: string,
|
|
23
|
+
icon: string,
|
|
24
|
+
inputSize: string,
|
|
25
|
+
itemDataTestId: string,
|
|
26
|
+
listDataTestId: string,
|
|
27
|
+
listProps: object,
|
|
28
|
+
menuWidth: string,
|
|
29
|
+
multiple: bool,
|
|
30
|
+
noMatchesText: string,
|
|
31
|
+
noOptionsText: string,
|
|
32
|
+
onChange: func,
|
|
33
|
+
onChangeSearchTerm: func,
|
|
34
|
+
options: arrayOf(shape({
|
|
35
|
+
name: string,
|
|
36
|
+
value: oneOfType([string, number])
|
|
37
|
+
})),
|
|
38
|
+
placeholder: string,
|
|
39
|
+
prefix: string,
|
|
40
|
+
readOnly: bool,
|
|
41
|
+
required: bool,
|
|
42
|
+
suffix: string,
|
|
43
|
+
title: string,
|
|
44
|
+
titleVariant: string,
|
|
45
|
+
value: oneOfType([string, arrayOf(oneOfType([string, number]))]),
|
|
46
|
+
variant: oneOf(Object.values(VARIANTS)),
|
|
47
|
+
withAutoReset: bool
|
|
48
|
+
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { isEmpty } from '@widergy/web-utils/lib/array';
|
|
2
1
|
import clone from 'lodash/clone';
|
|
2
|
+
import isEmpty from 'lodash/isEmpty';
|
|
3
|
+
import { COLOR_THEMES } from '../../../../constants/Palette';
|
|
3
4
|
import { COMPONENT_KEYS } from '../../../UTBaseInputField/constants';
|
|
4
5
|
import { NO_CATEGORY } from '../../../UTCheckList/versions/V1/constants';
|
|
6
|
+
import { VARIANTS } from './constants';
|
|
5
7
|
const shouldResetMultipleSelect = (value, options) => !isEmpty(value) && (isEmpty(options) || value.some(el => !options.some(opt => opt.value === el) && !options.some(opt => opt.subOptions && opt.subOptions.some(sub => sub.value === el))));
|
|
6
8
|
const shouldResetSimpleSelect = (value, options) => value && (isEmpty(options) || !options.some(el => el.value === value) && !options.some(el => el.subOptions && el.subOptions.some(sub => sub.value === value)));
|
|
7
9
|
export const shouldReset = (value, options, isMultiple) => {
|
|
@@ -36,7 +38,7 @@ export const getLeftAdornments = _ref => {
|
|
|
36
38
|
name: COMPONENT_KEYS.BADGE,
|
|
37
39
|
props: {
|
|
38
40
|
text: value.length,
|
|
39
|
-
colorTheme: error ?
|
|
41
|
+
colorTheme: error ? COLOR_THEMES.error : COLOR_THEMES.accent
|
|
40
42
|
}
|
|
41
43
|
});
|
|
42
44
|
if (prefix) adornments.push({
|
|
@@ -81,15 +83,14 @@ export const getRightAdornments = _ref2 => {
|
|
|
81
83
|
size: 'small'
|
|
82
84
|
}
|
|
83
85
|
}
|
|
84
|
-
});
|
|
85
|
-
adornments.push({
|
|
86
|
+
});else adornments.push({
|
|
86
87
|
name: COMPONENT_KEYS.ICON,
|
|
87
88
|
props: {
|
|
88
89
|
Icon: 'IconChevronDown',
|
|
89
90
|
changeIconOnError: false,
|
|
90
91
|
changeOnError: true,
|
|
91
|
-
...(variant ===
|
|
92
|
-
colorTheme:
|
|
92
|
+
...(variant === VARIANTS.picker && !disabled && {
|
|
93
|
+
colorTheme: COLOR_THEMES.dark
|
|
93
94
|
})
|
|
94
95
|
}
|
|
95
96
|
});
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
%animatedActionsContainer {
|
|
18
18
|
animation: slideInFromRight 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
19
19
|
display: flex;
|
|
20
|
-
grid-gap: var(--UT-shortcutPanel-header-gap,
|
|
20
|
+
grid-gap: var(--UT-shortcutPanel-header-gap, 0.5rem);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
%textWithEllipsis {
|
|
@@ -55,25 +55,25 @@
|
|
|
55
55
|
padding: var(--padding-lg, 24px) 0;
|
|
56
56
|
position: relative !important;
|
|
57
57
|
transition: width 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms !important;
|
|
58
|
-
width: var(--UT-shortcutPanel-width-collapsed,
|
|
58
|
+
width: var(--UT-shortcutPanel-width-collapsed, 3.5rem);
|
|
59
59
|
|
|
60
60
|
&Open {
|
|
61
61
|
padding: 0;
|
|
62
|
-
width: var(--UT-shortcutPanel-width,
|
|
62
|
+
width: var(--UT-shortcutPanel-width, 16rem);
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
.expandedPanelContent {
|
|
66
66
|
box-sizing: border-box;
|
|
67
67
|
display: flex;
|
|
68
68
|
flex-direction: column;
|
|
69
|
-
padding: 0 var(--UT-shortcutPanel-padding,
|
|
69
|
+
padding: 0 var(--UT-shortcutPanel-padding, 1rem);
|
|
70
70
|
position: relative;
|
|
71
71
|
width: 100%;
|
|
72
72
|
|
|
73
73
|
.expandedPanelContentHeader {
|
|
74
74
|
align-items: center;
|
|
75
75
|
display: flex;
|
|
76
|
-
grid-gap: var(--UT-shortcutPanel-header-gap,
|
|
76
|
+
grid-gap: var(--UT-shortcutPanel-header-gap, 0.5rem);
|
|
77
77
|
justify-content: space-between;
|
|
78
78
|
position: sticky;
|
|
79
79
|
top: 0;
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
.expandedPanelContentActions {
|
|
89
89
|
display: flex;
|
|
90
90
|
flex-wrap: nowrap;
|
|
91
|
-
grid-gap: var(--UT-shortcutPanel-header-gap,
|
|
91
|
+
grid-gap: var(--UT-shortcutPanel-header-gap, 0.5rem);
|
|
92
92
|
|
|
93
93
|
.expandedPanelContentActionsContainer {
|
|
94
94
|
@extend %actionsContainer;
|
|
@@ -105,14 +105,14 @@
|
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
.expandedPanelContentCategory {
|
|
108
|
-
padding: var(--UT-shortcutPanel-category-padding,
|
|
108
|
+
padding: var(--UT-shortcutPanel-category-padding, 0.5rem) 0;
|
|
109
109
|
|
|
110
110
|
.expandedPanelContentCategoryHeader {
|
|
111
111
|
align-items: center;
|
|
112
112
|
border-radius: var(--radius-sm, 4px);
|
|
113
113
|
display: flex;
|
|
114
|
-
grid-gap: var(--UT-shortcutPanel-category-gap,
|
|
115
|
-
padding: var(--UT-shortcutPanel-category-padding,
|
|
114
|
+
grid-gap: var(--UT-shortcutPanel-category-gap, 0.5rem);
|
|
115
|
+
padding: var(--UT-shortcutPanel-category-padding, 0.5rem);
|
|
116
116
|
height: var(--UT-shortcutPanel-category-height);
|
|
117
117
|
|
|
118
118
|
svg {
|
|
@@ -185,7 +185,7 @@
|
|
|
185
185
|
align-items: center;
|
|
186
186
|
display: flex;
|
|
187
187
|
flex-grow: 1;
|
|
188
|
-
grid-gap: var(--UT-shortcutPanel-item-gap,
|
|
188
|
+
grid-gap: var(--UT-shortcutPanel-item-gap, 0.5rem);
|
|
189
189
|
overflow: hidden;
|
|
190
190
|
|
|
191
191
|
.hoverableContainer {
|
|
@@ -25,11 +25,11 @@ const getGridGap = _ref3 => {
|
|
|
25
25
|
size
|
|
26
26
|
} = _ref3;
|
|
27
27
|
return {
|
|
28
|
-
[SIZES.large]: 'var(--UT-status-gap-large,
|
|
29
|
-
[SIZES.medium]: 'var(--UT-status-gap-medium,
|
|
30
|
-
[SIZES.small]: 'var(--UT-status-gap-small,
|
|
31
|
-
[SIZES.xlarge]: 'var(--UT-status-gap-xlarge,
|
|
32
|
-
[SIZES.xsmall]: 'var(--UT-status-gap-xsmall,
|
|
28
|
+
[SIZES.large]: 'var(--UT-status-gap-large, 0.5rem)',
|
|
29
|
+
[SIZES.medium]: 'var(--UT-status-gap-medium, 0.5rem)',
|
|
30
|
+
[SIZES.small]: 'var(--UT-status-gap-small, 0.25rem)',
|
|
31
|
+
[SIZES.xlarge]: 'var(--UT-status-gap-xlarge, 0.5rem)',
|
|
32
|
+
[SIZES.xsmall]: 'var(--UT-status-gap-xsmall, 0.25rem)'
|
|
33
33
|
}[size];
|
|
34
34
|
};
|
|
35
35
|
const getPadding = _ref4 => {
|
|
@@ -37,11 +37,11 @@ const getPadding = _ref4 => {
|
|
|
37
37
|
size
|
|
38
38
|
} = _ref4;
|
|
39
39
|
return {
|
|
40
|
-
[SIZES.large]: 'var(--UT-status-padding-y-large,
|
|
41
|
-
[SIZES.medium]: 'var(--UT-status-padding-y-medium,
|
|
42
|
-
[SIZES.small]: 'var(--UT-status-padding-y-small,
|
|
43
|
-
[SIZES.xlarge]: 'var(--UT-status-padding-y-xlarge,
|
|
44
|
-
[SIZES.xsmall]: 'var(--UT-status-padding-y-xsmall,
|
|
40
|
+
[SIZES.large]: 'var(--UT-status-padding-y-large, 0.25rem) var(--UT-status-padding-x-large, 0.5rem)',
|
|
41
|
+
[SIZES.medium]: 'var(--UT-status-padding-y-medium, 0.25rem) var(--UT-status-padding-x-medium, 0.5rem)',
|
|
42
|
+
[SIZES.small]: 'var(--UT-status-padding-y-small, 0.25rem) var(--UT-status-padding-x-small, 0.5rem)',
|
|
43
|
+
[SIZES.xlarge]: 'var(--UT-status-padding-y-xlarge, 0.5rem) var(--UT-status-padding-x-xlarge, 0.75rem)',
|
|
44
|
+
[SIZES.xsmall]: 'var(--UT-status-padding-y-xsmall, 0.125rem) var(--UT-status-padding-x-xsmall, 0.25rem)'
|
|
45
45
|
}[size];
|
|
46
46
|
};
|
|
47
47
|
export const getLabelVariant = _ref5 => {
|
|
@@ -61,11 +61,11 @@ export const getIconSize = _ref6 => {
|
|
|
61
61
|
size
|
|
62
62
|
} = _ref6;
|
|
63
63
|
return {
|
|
64
|
-
[SIZES.large]: 'var(--UT-status-icon-size-xs,
|
|
65
|
-
[SIZES.medium]: 'var(--UT-status-icon-size-2xs,
|
|
66
|
-
[SIZES.small]: 'var(--UT-status-icon-size-3xs,
|
|
67
|
-
[SIZES.xlarge]: 'var(--UT-status-icon-size-xs,
|
|
68
|
-
[SIZES.xsmall]: 'var(--UT-status-icon-size-3xs,
|
|
64
|
+
[SIZES.large]: 'var(--UT-status-icon-size-xs, 1.25rem)',
|
|
65
|
+
[SIZES.medium]: 'var(--UT-status-icon-size-2xs, 1rem)',
|
|
66
|
+
[SIZES.small]: 'var(--UT-status-icon-size-3xs, 0.75rem)',
|
|
67
|
+
[SIZES.xlarge]: 'var(--UT-status-icon-size-xs, 1.25rem)',
|
|
68
|
+
[SIZES.xsmall]: 'var(--UT-status-icon-size-3xs, 0.75rem)'
|
|
69
69
|
}[size];
|
|
70
70
|
};
|
|
71
71
|
export const defaultIconMapper = variant => ({
|
|
@@ -106,7 +106,7 @@ export const retrieveStyle = _ref8 => {
|
|
|
106
106
|
variant
|
|
107
107
|
})
|
|
108
108
|
}),
|
|
109
|
-
borderRadius: 'var(--UT-status-radius,
|
|
109
|
+
borderRadius: 'var(--UT-status-radius, 0.25rem)',
|
|
110
110
|
display: 'flex',
|
|
111
111
|
gridGap: getGridGap({
|
|
112
112
|
size
|
|
@@ -127,8 +127,8 @@ export const retrieveStyle = _ref8 => {
|
|
|
127
127
|
},
|
|
128
128
|
icon: {
|
|
129
129
|
flexShrink: '0',
|
|
130
|
-
height: 'var(--UT-status-icon-size-xs,
|
|
131
|
-
width: 'var(--UT-status-icon-size-xs,
|
|
130
|
+
height: 'var(--UT-status-icon-size-xs, 1.25rem)',
|
|
131
|
+
width: 'var(--UT-status-icon-size-xs, 1.25rem)',
|
|
132
132
|
'& path': {
|
|
133
133
|
fill: getIconFill({
|
|
134
134
|
theme,
|
|
@@ -155,20 +155,20 @@ export const retrieveStyle = _ref8 => {
|
|
|
155
155
|
}
|
|
156
156
|
},
|
|
157
157
|
iconXsmall: {
|
|
158
|
-
height: 'var(--UT-status-icon-size-3xs,
|
|
159
|
-
width: 'var(--UT-status-icon-size-3xs,
|
|
158
|
+
height: 'var(--UT-status-icon-size-3xs, 0.75rem)',
|
|
159
|
+
width: 'var(--UT-status-icon-size-3xs, 0.75rem)'
|
|
160
160
|
},
|
|
161
161
|
iconSmall: {
|
|
162
|
-
height: 'var(--UT-status-icon-size-3xs,
|
|
163
|
-
width: 'var(--UT-status-icon-size-3xs,
|
|
162
|
+
height: 'var(--UT-status-icon-size-3xs, 0.75rem)',
|
|
163
|
+
width: 'var(--UT-status-icon-size-3xs, 0.75rem)'
|
|
164
164
|
},
|
|
165
165
|
iconMedium: {
|
|
166
|
-
height: 'var(--UT-status-icon-size-2xs,
|
|
167
|
-
width: 'var(--UT-status-icon-size-2xs,
|
|
166
|
+
height: 'var(--UT-status-icon-size-2xs, 1rem)',
|
|
167
|
+
width: 'var(--UT-status-icon-size-2xs, 1rem)'
|
|
168
168
|
},
|
|
169
169
|
iconLarge: {
|
|
170
|
-
height: 'var(--UT-status-icon-size-xs,
|
|
171
|
-
width: 'var(--UT-status-icon-size-xs,
|
|
170
|
+
height: 'var(--UT-status-icon-size-xs, 1.25rem)',
|
|
171
|
+
width: 'var(--UT-status-icon-size-xs, 1.25rem)'
|
|
172
172
|
},
|
|
173
173
|
badgeXsmall: {
|
|
174
174
|
height: '8px',
|
|
@@ -61,11 +61,11 @@ export const baseTokens = {
|
|
|
61
61
|
'font-weight-700': '700',
|
|
62
62
|
'font-weight-800': '800',
|
|
63
63
|
'font-weight-900': '900',
|
|
64
|
-
'font-lh-100': '1
|
|
65
|
-
'font-lh-120': '1.
|
|
66
|
-
'font-lh-140': '1.
|
|
67
|
-
'font-lh-150': '1.
|
|
68
|
-
'font-lh-170': '1.
|
|
64
|
+
'font-lh-100': '1',
|
|
65
|
+
'font-lh-120': '1.2',
|
|
66
|
+
'font-lh-140': '1.4',
|
|
67
|
+
'font-lh-150': '1.5',
|
|
68
|
+
'font-lh-170': '1.7',
|
|
69
69
|
'legacy-font-lh-full': '100%',
|
|
70
70
|
'legacy-font-lh-100': '1.125rem',
|
|
71
71
|
'legacy-font-lh-120': '1.25rem',
|
|
@@ -121,8 +121,9 @@ export const baseTokens = {
|
|
|
121
121
|
'font-weight-extrabold': 'font-weight-800',
|
|
122
122
|
'font-weight-black': 'font-weight-900',
|
|
123
123
|
'font-lh-reset': 'font-lh-100',
|
|
124
|
-
'font-lh-heading': '
|
|
125
|
-
'font-lh-
|
|
124
|
+
'font-lh-heading': 'font-lh-120',
|
|
125
|
+
'font-lh-subheading': 'font-lh-140',
|
|
126
|
+
'font-lh-body': 'font-lh-140',
|
|
126
127
|
'font-lh-caption': 'font-lh-170',
|
|
127
128
|
'legacy-font-lh-small': 'legacy-font-lh-120',
|
|
128
129
|
'legacy-font-lh-xsmall': 'legacy-font-lh-100',
|
|
@@ -211,9 +212,10 @@ export const baseTokens = {
|
|
|
211
212
|
'UT-label-size-small': 'font-body-size-md',
|
|
212
213
|
'UT-label-size-xsmall': 'font-body-size-sm',
|
|
213
214
|
'UT-label-lh-heading': 'font-lh-heading',
|
|
215
|
+
'UT-label-lh-subheading': 'font-lh-subheading',
|
|
214
216
|
'UT-label-lh-body': 'font-lh-body',
|
|
215
|
-
'UT-label-lh-small': '
|
|
216
|
-
'UT-label-lh-xsmall': '
|
|
217
|
+
'UT-label-lh-small': 'font-lh-140',
|
|
218
|
+
'UT-label-lh-xsmall': 'font-lh-150',
|
|
217
219
|
'UT-label-weight-thin': 'font-weight-thin',
|
|
218
220
|
'UT-label-weight-extralight': 'font-weight-extralight',
|
|
219
221
|
'UT-label-weight-light': 'font-weight-light',
|
|
@@ -67,11 +67,11 @@ const baseTokens = exports.baseTokens = {
|
|
|
67
67
|
'font-weight-700': '700',
|
|
68
68
|
'font-weight-800': '800',
|
|
69
69
|
'font-weight-900': '900',
|
|
70
|
-
'font-lh-100': '1
|
|
71
|
-
'font-lh-120': '1.
|
|
72
|
-
'font-lh-140': '1.
|
|
73
|
-
'font-lh-150': '1.
|
|
74
|
-
'font-lh-170': '1.
|
|
70
|
+
'font-lh-100': '1',
|
|
71
|
+
'font-lh-120': '1.2',
|
|
72
|
+
'font-lh-140': '1.4',
|
|
73
|
+
'font-lh-150': '1.5',
|
|
74
|
+
'font-lh-170': '1.7',
|
|
75
75
|
'legacy-font-lh-full': '100%',
|
|
76
76
|
'legacy-font-lh-100': '1.125rem',
|
|
77
77
|
'legacy-font-lh-120': '1.25rem',
|
|
@@ -127,8 +127,9 @@ const baseTokens = exports.baseTokens = {
|
|
|
127
127
|
'font-weight-extrabold': 'font-weight-800',
|
|
128
128
|
'font-weight-black': 'font-weight-900',
|
|
129
129
|
'font-lh-reset': 'font-lh-100',
|
|
130
|
-
'font-lh-heading': '
|
|
131
|
-
'font-lh-
|
|
130
|
+
'font-lh-heading': 'font-lh-120',
|
|
131
|
+
'font-lh-subheading': 'font-lh-140',
|
|
132
|
+
'font-lh-body': 'font-lh-140',
|
|
132
133
|
'font-lh-caption': 'font-lh-170',
|
|
133
134
|
'legacy-font-lh-small': 'legacy-font-lh-120',
|
|
134
135
|
'legacy-font-lh-xsmall': 'legacy-font-lh-100',
|
|
@@ -217,9 +218,10 @@ const baseTokens = exports.baseTokens = {
|
|
|
217
218
|
'UT-label-size-small': 'font-body-size-md',
|
|
218
219
|
'UT-label-size-xsmall': 'font-body-size-sm',
|
|
219
220
|
'UT-label-lh-heading': 'font-lh-heading',
|
|
221
|
+
'UT-label-lh-subheading': 'font-lh-subheading',
|
|
220
222
|
'UT-label-lh-body': 'font-lh-body',
|
|
221
|
-
'UT-label-lh-small': '
|
|
222
|
-
'UT-label-lh-xsmall': '
|
|
223
|
+
'UT-label-lh-small': 'font-lh-140',
|
|
224
|
+
'UT-label-lh-xsmall': 'font-lh-150',
|
|
223
225
|
'UT-label-weight-thin': 'font-weight-thin',
|
|
224
226
|
'UT-label-weight-extralight': 'font-weight-extralight',
|
|
225
227
|
'UT-label-weight-light': 'font-weight-light',
|