@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.
Files changed (56) hide show
  1. package/CHANGELOG.md +19 -3
  2. package/dist/components/UTBanner/stories/UTBanner.stories.js +16 -1
  3. package/dist/components/UTBaseInputField/theme.js +6 -5
  4. package/dist/components/UTButton/styles.module.scss +11 -11
  5. package/dist/components/UTButton/theme.js +1 -1
  6. package/dist/components/UTButtonGroup/styles.module.scss +1 -1
  7. package/dist/components/UTCheckbox/versions/V1/theme.js +4 -1
  8. package/dist/components/UTDataCategory/styles.module.scss +1 -1
  9. package/dist/components/UTDataCategory/theme.js +1 -1
  10. package/dist/components/UTDataElement/index.js +1 -1
  11. package/dist/components/UTDataElement/styles.module.scss +9 -9
  12. package/dist/components/UTDatePicker/versions/V1/stories/UTDatePickerV1.stories.js +59 -1
  13. package/dist/components/UTLabel/UTLabel.stories.js +81 -1
  14. package/dist/components/UTLabel/constants.js +10 -10
  15. package/dist/components/UTLabel/theme.js +4 -4
  16. package/dist/components/UTRadioGroup/versions/V1/index.js +12 -3
  17. package/dist/components/UTSelect/UTSelect.stories.js +897 -0
  18. package/dist/components/UTSelect/versions/V1/components/InputComponent/index.js +13 -3
  19. package/dist/components/UTSelect/versions/V1/components/ListboxComponent/index.js +7 -6
  20. package/dist/components/UTSelect/versions/V1/constants.js +10 -0
  21. package/dist/components/UTSelect/versions/V1/index.js +41 -68
  22. package/dist/components/UTSelect/versions/V1/types.js +54 -0
  23. package/dist/components/UTSelect/versions/V1/utils.js +10 -9
  24. package/dist/components/UTShortcutPanel/styles.module.scss +10 -10
  25. package/dist/components/UTStatus/theme.js +26 -26
  26. package/dist/esm/components/UTBanner/stories/UTBanner.stories.js +16 -1
  27. package/dist/esm/components/UTBaseInputField/theme.js +6 -5
  28. package/dist/esm/components/UTButton/styles.module.scss +11 -11
  29. package/dist/esm/components/UTButton/theme.js +1 -1
  30. package/dist/esm/components/UTButtonGroup/styles.module.scss +1 -1
  31. package/dist/esm/components/UTCheckbox/versions/V1/theme.js +4 -1
  32. package/dist/esm/components/UTDataCategory/styles.module.scss +1 -1
  33. package/dist/esm/components/UTDataCategory/theme.js +1 -1
  34. package/dist/esm/components/UTDataElement/index.js +1 -1
  35. package/dist/esm/components/UTDataElement/styles.module.scss +9 -9
  36. package/dist/esm/components/UTDatePicker/versions/V1/stories/UTDatePickerV1.stories.js +58 -0
  37. package/dist/esm/components/UTLabel/UTLabel.stories.js +80 -0
  38. package/dist/esm/components/UTLabel/constants.js +10 -10
  39. package/dist/esm/components/UTLabel/theme.js +4 -4
  40. package/dist/esm/components/UTRadioGroup/versions/V1/index.js +12 -3
  41. package/dist/esm/components/UTSelect/UTSelect.stories.js +889 -0
  42. package/dist/esm/components/UTSelect/versions/V1/components/InputComponent/index.js +14 -4
  43. package/dist/esm/components/UTSelect/versions/V1/components/ListboxComponent/index.js +4 -3
  44. package/dist/esm/components/UTSelect/versions/V1/constants.js +4 -0
  45. package/dist/esm/components/UTSelect/versions/V1/index.js +41 -68
  46. package/dist/esm/components/UTSelect/versions/V1/types.js +48 -0
  47. package/dist/esm/components/UTSelect/versions/V1/utils.js +7 -6
  48. package/dist/esm/components/UTShortcutPanel/styles.module.scss +10 -10
  49. package/dist/esm/components/UTStatus/theme.js +26 -26
  50. package/dist/esm/utils/hooks/useCSSVariables/constants.js +11 -9
  51. package/dist/utils/hooks/useCSSVariables/constants.js +11 -9
  52. package/package.json +10 -9
  53. package/dist/components/UTSelect/versions/V1/UTSelectV1.mdx +0 -13
  54. package/dist/components/UTSelect/versions/V1/UTSelectV1.stories.js +0 -741
  55. package/dist/esm/components/UTSelect/versions/V1/UTSelectV1.mdx +0 -13
  56. 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: restInputPropsFromField
45
+ inputProps: {
46
+ ...restInputPropsFromField,
47
+ ...(isPicker && {
48
+ readOnly: true,
49
+ style: {
50
+ cursor: 'default'
51
+ }
52
+ })
53
+ }
44
54
  };
45
- const fieldVariant = variant === 'picker' ? 'transparent' : 'white';
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: string
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: false,
42
+ reversed: true,
42
43
  showSelectAll: false,
43
44
  value: multiple ? value : [value],
44
45
  variant: "button",
@@ -0,0 +1,4 @@
1
+ export const VARIANTS = {
2
+ picker: 'picker',
3
+ select: 'select'
4
+ };
@@ -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 = 'select',
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 filteredOptions = useMemo(() => disableFilterOptions ? sortedOptions : sortedOptions.filter(option => "".concat(option.name).toLowerCase().includes(searchTerm.toLowerCase())), [sortedOptions, searchTerm, disableFilterOptions]);
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: InputComponentToRender
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 ? 'error' : 'accent'
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 === 'picker' && !disabled && {
92
- colorTheme: 'dark'
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, 8px);
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, 56px);
58
+ width: var(--UT-shortcutPanel-width-collapsed, 3.5rem);
59
59
 
60
60
  &Open {
61
61
  padding: 0;
62
- width: var(--UT-shortcutPanel-width, 256px);
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, 16px);
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, 8px);
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, 8px);
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, 8px) 0;
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, 8px);
115
- padding: var(--UT-shortcutPanel-category-padding, 8px);
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, 8px);
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, 8px)',
29
- [SIZES.medium]: 'var(--UT-status-gap-medium, 8px)',
30
- [SIZES.small]: 'var(--UT-status-gap-small, 4px)',
31
- [SIZES.xlarge]: 'var(--UT-status-gap-xlarge, 8px)',
32
- [SIZES.xsmall]: 'var(--UT-status-gap-xsmall, 4px)'
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, 4px) var(--UT-status-padding-x-large, 8px)',
41
- [SIZES.medium]: 'var(--UT-status-padding-y-medium, 4px) var(--UT-status-padding-x-medium, 8px)',
42
- [SIZES.small]: 'var(--UT-status-padding-y-small, 4px) var(--UT-status-padding-x-small, 8px)',
43
- [SIZES.xlarge]: 'var(--UT-status-padding-y-xlarge, 8px) var(--UT-status-padding-x-xlarge, 12px)',
44
- [SIZES.xsmall]: 'var(--UT-status-padding-y-xsmall, 2px) var(--UT-status-padding-x-xsmall, 4px)'
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, 20px)',
65
- [SIZES.medium]: 'var(--UT-status-icon-size-2xs, 16px)',
66
- [SIZES.small]: 'var(--UT-status-icon-size-3xs, 12px)',
67
- [SIZES.xlarge]: 'var(--UT-status-icon-size-xs, 20px)',
68
- [SIZES.xsmall]: 'var(--UT-status-icon-size-3xs, 12px)'
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, 4px)',
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, 20px)',
131
- width: 'var(--UT-status-icon-size-xs, 20px)',
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, 12px)',
159
- width: 'var(--UT-status-icon-size-3xs, 12px)'
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, 12px)',
163
- width: 'var(--UT-status-icon-size-3xs, 12px)'
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, 16px)',
167
- width: 'var(--UT-status-icon-size-2xs, 16px)'
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, 20px)',
171
- width: 'var(--UT-status-icon-size-xs, 20px)'
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.0rem',
65
- 'font-lh-120': '1.2rem',
66
- 'font-lh-140': '1.4rem',
67
- 'font-lh-150': '1.5rem',
68
- 'font-lh-170': '1.7rem',
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': 'legacy-font-lh-full',
125
- 'font-lh-body': 'legacy-font-lh-140',
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': 'legacy-font-lh-small',
216
- 'UT-label-lh-xsmall': 'legacy-font-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.0rem',
71
- 'font-lh-120': '1.2rem',
72
- 'font-lh-140': '1.4rem',
73
- 'font-lh-150': '1.5rem',
74
- 'font-lh-170': '1.7rem',
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': 'legacy-font-lh-full',
131
- 'font-lh-body': 'legacy-font-lh-140',
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': 'legacy-font-lh-small',
222
- 'UT-label-lh-xsmall': 'legacy-font-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',