@ultraviolet/ui 1.28.0 → 1.29.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.
Files changed (111) hide show
  1. package/README.md +14 -7
  2. package/dist/index.d.ts +51 -2
  3. package/dist/src/components/ActionBar/index.js +22 -37
  4. package/dist/src/components/Alert/index.js +27 -41
  5. package/dist/src/components/Avatar/index.js +48 -69
  6. package/dist/src/components/Badge/index.js +29 -49
  7. package/dist/src/components/Banner/index.js +42 -62
  8. package/dist/src/components/BarChart/Tooltip.js +35 -50
  9. package/dist/src/components/BarChart/index.js +13 -14
  10. package/dist/src/components/BarStack/index.js +100 -191
  11. package/dist/src/components/Breadcrumbs/index.js +29 -39
  12. package/dist/src/components/Bullet/index.js +42 -55
  13. package/dist/src/components/Button/index.js +73 -99
  14. package/dist/src/components/Card/index.js +39 -57
  15. package/dist/src/components/Carousel/index.js +32 -60
  16. package/dist/src/components/Checkbox/index.js +153 -341
  17. package/dist/src/components/CheckboxGroup/index.js +25 -27
  18. package/dist/src/components/CopyButton/index.js +11 -12
  19. package/dist/src/components/DateInput/index.js +141 -268
  20. package/dist/src/components/EmptyState/index.js +68 -83
  21. package/dist/src/components/Expandable/index.js +13 -20
  22. package/dist/src/components/GlobalAlert/GlobalAlertLink.js +12 -13
  23. package/dist/src/components/GlobalAlert/index.js +19 -32
  24. package/dist/src/components/LineChart/CustomLegend.js +80 -89
  25. package/dist/src/components/LineChart/Tooltip.js +32 -47
  26. package/dist/src/components/LineChart/helpers.js +15 -50
  27. package/dist/src/components/LineChart/index.js +23 -33
  28. package/dist/src/components/Link/index.js +46 -65
  29. package/dist/src/components/List/Body.js +9 -15
  30. package/dist/src/components/List/Cell.js +6 -7
  31. package/dist/src/components/List/HeaderCell.js +28 -56
  32. package/dist/src/components/List/HeaderRow.js +9 -16
  33. package/dist/src/components/List/ListContext.js +5 -6
  34. package/dist/src/components/List/Row.js +44 -90
  35. package/dist/src/components/List/SelectBar.js +9 -13
  36. package/dist/src/components/List/SkeletonRows.js +5 -6
  37. package/dist/src/components/List/index.js +15 -25
  38. package/dist/src/components/Loader/index.js +18 -25
  39. package/dist/src/components/Menu/Item.js +39 -49
  40. package/dist/src/components/Menu/index.js +31 -56
  41. package/dist/src/components/MenuV2/Item.js +39 -49
  42. package/dist/src/components/MenuV2/index.js +28 -47
  43. package/dist/src/components/Meter/index.js +25 -47
  44. package/dist/src/components/Modal/Dialog.js +33 -58
  45. package/dist/src/components/Modal/Disclosure.js +8 -9
  46. package/dist/src/components/Modal/index.js +26 -33
  47. package/dist/src/components/Notice/index.js +21 -27
  48. package/dist/src/components/NumberInput/index.js +73 -137
  49. package/dist/src/components/Pagination/getPageNumbers.js +1 -4
  50. package/dist/src/components/Pagination/index.js +17 -27
  51. package/dist/src/components/PasswordCheck/index.js +26 -32
  52. package/dist/src/components/PasswordStrengthMeter/index.js +25 -44
  53. package/dist/src/components/PieChart/Legends.js +71 -107
  54. package/dist/src/components/PieChart/Tooltip.js +33 -36
  55. package/dist/src/components/PieChart/index.js +13 -17
  56. package/dist/src/components/Popover/index.js +58 -75
  57. package/dist/src/components/Popup/helpers.js +13 -15
  58. package/dist/src/components/Popup/index.js +55 -98
  59. package/dist/src/components/ProgressBar/index.js +31 -49
  60. package/dist/src/components/Radio/index.js +58 -113
  61. package/dist/src/components/RadioGroup/index.js +26 -28
  62. package/dist/src/components/Row/index.js +25 -31
  63. package/dist/src/components/SelectInput/index.js +357 -410
  64. package/dist/src/components/SelectableCard/index.js +73 -115
  65. package/dist/src/components/Separator/index.js +52 -73
  66. package/dist/src/components/Skeleton/Block.js +23 -41
  67. package/dist/src/components/Skeleton/Blocks.js +23 -41
  68. package/dist/src/components/Skeleton/BoxWithIcon.js +21 -36
  69. package/dist/src/components/Skeleton/Donut.js +3 -6
  70. package/dist/src/components/Skeleton/IconSkeleton.js +13 -31
  71. package/dist/src/components/Skeleton/Line.js +5 -11
  72. package/dist/src/components/Skeleton/List.js +22 -31
  73. package/dist/src/components/Skeleton/Slider.js +25 -46
  74. package/dist/src/components/Skeleton/Square.js +3 -6
  75. package/dist/src/components/Skeleton/index.js +17 -33
  76. package/dist/src/components/Snippet/index.js +82 -137
  77. package/dist/src/components/Stack/index.js +11 -14
  78. package/dist/src/components/Status/index.js +48 -78
  79. package/dist/src/components/StepList/index.js +45 -63
  80. package/dist/src/components/Stepper/index.js +74 -129
  81. package/dist/src/components/SwitchButton/FocusOverlay.js +13 -23
  82. package/dist/src/components/SwitchButton/index.js +36 -62
  83. package/dist/src/components/Table/Body.js +5 -8
  84. package/dist/src/components/Table/Cell.js +14 -20
  85. package/dist/src/components/Table/Header.js +8 -14
  86. package/dist/src/components/Table/HeaderCell.js +40 -56
  87. package/dist/src/components/Table/HeaderRow.js +4 -5
  88. package/dist/src/components/Table/Row.js +10 -14
  89. package/dist/src/components/Table/SelectBar.js +9 -13
  90. package/dist/src/components/Table/SkeletonRows.js +5 -6
  91. package/dist/src/components/Table/TableContext.js +6 -7
  92. package/dist/src/components/Table/index.js +44 -50
  93. package/dist/src/components/Tabs/Tab.js +57 -118
  94. package/dist/src/components/Tabs/TabMenu.js +32 -38
  95. package/dist/src/components/Tabs/TabMenuItem.js +9 -13
  96. package/dist/src/components/Tabs/index.js +24 -43
  97. package/dist/src/components/Tag/index.js +57 -74
  98. package/dist/src/components/TagInput/index.js +63 -94
  99. package/dist/src/components/TagList/index.js +22 -35
  100. package/dist/src/components/Text/index.js +29 -31
  101. package/dist/src/components/TextArea/index.js +240 -0
  102. package/dist/src/components/TextInput/index.js +166 -260
  103. package/dist/src/components/TimeInput/index.js +10 -13
  104. package/dist/src/components/Toaster/index.js +51 -67
  105. package/dist/src/components/Toggle/index.js +62 -129
  106. package/dist/src/components/ToggleGroup/index.js +21 -23
  107. package/dist/src/components/Tooltip/index.js +28 -31
  108. package/dist/src/components/VerificationCode/index.js +55 -90
  109. package/dist/src/index.js +1 -0
  110. package/dist/src/utils/ids.js +1 -6
  111. package/package.json +3 -3
@@ -8,60 +8,41 @@ import { jsx, jsxs } from '@emotion/react/jsx-runtime';
8
8
 
9
9
  const MenuContainer = /*#__PURE__*/_styled("div", {
10
10
  target: "ewug27g2"
11
- })("display:flex;flex-direction:column;", StyledTabButton, "{font-size:", _ref => {
12
- let {
13
- theme
14
- } = _ref;
15
- return theme.typography.bodySmall.fontSize;
16
- }, ";line-height:", _ref2 => {
17
- let {
18
- theme
19
- } = _ref2;
20
- return theme.typography.bodySmall.lineHeight;
21
- }, ";font-weight:inherit;padding:", _ref3 => {
22
- let {
23
- theme
24
- } = _ref3;
25
- return `${theme.space['1']} ${theme.space['2']}`;
26
- }, ";border-bottom-width:1.5px;width:100%;cursor:pointer;min-width:110px;background-color:transparent;&[aria-disabled='true'],&:disabled{cursor:not-allowed;filter:grayscale(1) opacity(50%);}}");
11
+ })("display:flex;flex-direction:column;", StyledTabButton, "{font-size:", ({
12
+ theme
13
+ }) => theme.typography.bodySmall.fontSize, ";line-height:", ({
14
+ theme
15
+ }) => theme.typography.bodySmall.lineHeight, ";font-weight:inherit;padding:", ({
16
+ theme
17
+ }) => `${theme.space['1']} ${theme.space['2']}`, ";border-bottom-width:1.5px;width:100%;cursor:pointer;min-width:110px;background-color:transparent;&[aria-disabled='true'],&:disabled{cursor:not-allowed;filter:grayscale(1) opacity(50%);}}");
27
18
 
28
19
  // Migration to MenuV2 will not work as expected here.
29
20
  const StyledTabMenu = /*#__PURE__*/_styled(TabMenu, {
30
21
  target: "ewug27g1"
31
- })("position:sticky;right:0;top:0;bottom:0;background:", _ref4 => {
32
- let {
33
- theme
34
- } = _ref4;
35
- return theme.colors.neutral.background;
36
- }, ";box-shadow:", _ref5 => {
37
- let {
38
- theme
39
- } = _ref5;
40
- return theme.shadows.menu;
41
- }, ";");
22
+ })("position:sticky;right:0;top:0;bottom:0;background:", ({
23
+ theme
24
+ }) => theme.colors.neutral.background, ";box-shadow:", ({
25
+ theme
26
+ }) => theme.shadows.menu, ";");
42
27
  const TabsContainer = /*#__PURE__*/_styled("div", {
43
28
  target: "ewug27g0"
44
- })("display:flex;flex-wrap:nowrap;overflow-x:scroll;position:relative;z-index:0;-ms-overflow-style:none;scrollbar-width:none;&::after{z-index:-1;content:'';position:absolute;bottom:0;left:0;right:0;height:2px;background:", _ref6 => {
45
- let {
46
- theme
47
- } = _ref6;
48
- return theme.colors.neutral.border;
49
- }, ";}&::-webkit-scrollbar{display:none;}");
29
+ })("display:flex;flex-wrap:nowrap;overflow-x:scroll;position:relative;z-index:0;-ms-overflow-style:none;scrollbar-width:none;&::after{z-index:-1;content:'';position:absolute;bottom:0;left:0;right:0;height:2px;background:", ({
30
+ theme
31
+ }) => theme.colors.neutral.border, ";}&::-webkit-scrollbar{display:none;}");
50
32
  const SHADOW_THRESHOLD = 10;
51
33
 
52
34
  /**
53
35
  * Tabs component is used to display a set of tabs with a single tab selected at a time.
54
36
  */
55
- const Tabs = _ref7 => {
56
- let {
57
- children = null,
58
- onChange,
59
- moreDisclosure = 'More',
60
- selected,
61
- className,
62
- 'data-testid': dataTestId,
63
- ...props
64
- } = _ref7;
37
+ const Tabs = ({
38
+ children = null,
39
+ onChange,
40
+ moreDisclosure = 'More',
41
+ selected,
42
+ className,
43
+ 'data-testid': dataTestId,
44
+ ...props
45
+ }) => {
65
46
  const tabsRef = useRef({});
66
47
  const moreStaticRef = useRef(null);
67
48
  const [displayMore, setDisplayMore] = useState(false);
@@ -12,27 +12,16 @@ const COPY_DURATION = 2500;
12
12
  const StyledContainer = /*#__PURE__*/_styled('span', {
13
13
  shouldForwardProp: prop => !['sentiment', 'copiable'].includes(prop),
14
14
  target: "el6733p2"
15
- })("display:inline-flex;align-items:center;justify-content:center;white-space:nowrap;border-radius:", _ref => {
16
- let {
17
- theme
18
- } = _ref;
19
- return theme.radii.default;
20
- }, ";padding:0 ", _ref2 => {
21
- let {
22
- theme
23
- } = _ref2;
24
- return theme.space['1'];
25
- }, ";gap:", _ref3 => {
26
- let {
27
- theme
28
- } = _ref3;
29
- return theme.space['1'];
30
- }, ";width:fit-content;height:24px;", _ref4 => {
31
- let {
32
- copiable,
33
- theme
34
- } = _ref4;
35
- return copiable && `
15
+ })("display:inline-flex;align-items:center;justify-content:center;white-space:nowrap;border-radius:", ({
16
+ theme
17
+ }) => theme.radii.default, ";padding:0 ", ({
18
+ theme
19
+ }) => theme.space['1'], ";gap:", ({
20
+ theme
21
+ }) => theme.space['1'], ";width:fit-content;height:24px;", ({
22
+ copiable,
23
+ theme
24
+ }) => copiable && `
36
25
  &:hover, &:active {
37
26
  cursor: pointer;
38
27
  background: ${theme.colors.neutral.backgroundWeakHover};
@@ -42,12 +31,10 @@ const StyledContainer = /*#__PURE__*/_styled('span', {
42
31
  &:active {
43
32
  box-shadow: ${theme.shadows.focusNeutral};
44
33
  }
45
- `;
46
- }, " ", _ref5 => {
47
- let {
48
- sentiment,
49
- theme
50
- } = _ref5;
34
+ `, " ", ({
35
+ sentiment,
36
+ theme
37
+ }) => {
51
38
  if (sentiment === 'disabled') {
52
39
  return `
53
40
  color: ${theme.colors.neutral.textDisabled};
@@ -90,58 +77,54 @@ const StyledCloseButton = /*#__PURE__*/_styled(Button, {
90
77
  styles: "width:fit-content;height:fit-content;padding:2px",
91
78
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
92
79
  });
93
- const TagInner = _ref6 => {
94
- let {
95
- children,
96
- isLoading = false,
97
- onClose,
98
- icon,
99
- disabled = false
100
- } = _ref6;
101
- return jsxs(Fragment, {
102
- children: [icon ? jsx(Icon, {
103
- name: icon,
104
- size: 16
105
- }) : null, jsx(StyledText, {
106
- as: "span",
107
- variant: "caption",
108
- oneLine: true,
109
- "aria-disabled": disabled,
110
- children: children
111
- }), onClose && !isLoading ? jsx(StyledCloseButton, {
112
- onClick: onClose,
113
- disabled: disabled,
114
- "aria-label": "Close tag",
115
- "data-testid": "close-tag",
116
- variant: "ghost",
117
- sentiment: "neutral",
118
- icon: "close",
119
- size: "small"
120
- }) : null, isLoading ? jsx(Loader, {
121
- active: true,
122
- size: 16
123
- }) : null]
124
- });
125
- };
80
+ const TagInner = ({
81
+ children,
82
+ isLoading = false,
83
+ onClose,
84
+ icon,
85
+ disabled = false
86
+ }) => jsxs(Fragment, {
87
+ children: [icon ? jsx(Icon, {
88
+ name: icon,
89
+ size: 16
90
+ }) : null, jsx(StyledText, {
91
+ as: "span",
92
+ variant: "caption",
93
+ oneLine: true,
94
+ "aria-disabled": disabled,
95
+ children: children
96
+ }), onClose && !isLoading ? jsx(StyledCloseButton, {
97
+ onClick: onClose,
98
+ disabled: disabled,
99
+ "aria-label": "Close tag",
100
+ "data-testid": "close-tag",
101
+ variant: "ghost",
102
+ sentiment: "neutral",
103
+ icon: "close",
104
+ size: "small"
105
+ }) : null, isLoading ? jsx(Loader, {
106
+ active: true,
107
+ size: 16
108
+ }) : null]
109
+ });
126
110
 
127
111
  /**
128
112
  * Tag component is used to display a short text description of an item. It can be used to display a category
129
113
  * or any other metadata.
130
114
  */
131
- const Tag = _ref7 => {
132
- let {
133
- children,
134
- isLoading,
135
- onClose,
136
- icon,
137
- copiable = false,
138
- copyText = 'Copy',
139
- copiedText = 'Copied!',
140
- disabled,
141
- sentiment = 'neutral',
142
- className,
143
- 'data-testid': dataTestId
144
- } = _ref7;
115
+ const Tag = ({
116
+ children,
117
+ isLoading,
118
+ onClose,
119
+ icon,
120
+ copiable = false,
121
+ copyText = 'Copy',
122
+ copiedText = 'Copied!',
123
+ disabled,
124
+ sentiment = 'neutral',
125
+ className,
126
+ 'data-testid': dataTestId
127
+ }) => {
145
128
  const [isCopied, setCopied] = useClipboard(typeof children === 'string' ? children : '', {
146
129
  successDuration: COPY_DURATION
147
130
  });
@@ -9,15 +9,13 @@ const STATUS = {
9
9
  LOADING: 'loading'
10
10
  };
11
11
  const variants = {
12
- base: _ref => {
13
- let {
14
- theme: {
15
- colors,
16
- shadows,
17
- radii
18
- }
19
- } = _ref;
20
- return `
12
+ base: ({
13
+ theme: {
14
+ colors,
15
+ shadows,
16
+ radii
17
+ }
18
+ }) => `
21
19
  padding: 8px;
22
20
  cursor: text;
23
21
  border-radius: ${radii.default};
@@ -34,15 +32,12 @@ const variants = {
34
32
  & > * {
35
33
  margin: 6px;
36
34
  }
37
- `;
38
- },
39
- bordered: _ref2 => {
40
- let {
41
- theme: {
42
- shadows
43
- }
44
- } = _ref2;
45
- return `
35
+ `,
36
+ bordered: ({
37
+ theme: {
38
+ shadows
39
+ }
40
+ }) => `
46
41
  margin-top: 0;
47
42
  padding: 8px 0;
48
43
 
@@ -56,15 +51,12 @@ const variants = {
56
51
  margin-right: 6px;
57
52
  }
58
53
  }
59
- `;
60
- },
61
- 'no-border': _ref3 => {
62
- let {
63
- theme: {
64
- shadows
65
- }
66
- } = _ref3;
67
- return `
54
+ `,
55
+ 'no-border': ({
56
+ theme: {
57
+ shadows
58
+ }
59
+ }) => `
68
60
  &:focus-within {
69
61
  box-shadow: ${shadows.focusPrimary};
70
62
  }
@@ -73,59 +65,40 @@ const variants = {
73
65
  margin-right: 6px;
74
66
  margin-bottom: 6px;
75
67
  }
76
- `;
77
- }
68
+ `
78
69
  };
79
70
  const TagInputContainer = /*#__PURE__*/_styled('div', {
80
71
  shouldForwardProp: prop => !['variant'].includes(prop),
81
72
  target: "ea7vc6o1"
82
- })("display:flex;flex-wrap:wrap;background-color:", _ref4 => {
83
- let {
84
- theme: {
85
- colors
86
- }
87
- } = _ref4;
88
- return colors.neutral.background;
89
- }, ";", _ref5 => {
90
- let {
91
- variant,
92
- theme
93
- } = _ref5;
94
- return variants[variant] ? variants[variant]({
95
- theme
96
- }) : variants.base({
97
- theme
98
- });
99
- }, ";");
73
+ })("display:flex;flex-wrap:wrap;background-color:", ({
74
+ theme: {
75
+ colors
76
+ }
77
+ }) => colors.neutral.background, ";", ({
78
+ variant,
79
+ theme
80
+ }) => variants[variant] ? variants[variant]({
81
+ theme
82
+ }) : variants.base({
83
+ theme
84
+ }), ";");
100
85
  const StyledInput = /*#__PURE__*/_styled("input", {
101
86
  target: "ea7vc6o0"
102
- })("display:flex;flex:1;font-size:", _ref6 => {
103
- let {
104
- theme
105
- } = _ref6;
106
- return theme.typography.body.fontSize;
107
- }, ";color:", _ref7 => {
108
- let {
109
- theme: {
110
- colors
111
- }
112
- } = _ref7;
113
- return colors.neutral.text;
114
- }, ";border:none;outline:none;background-color:", _ref8 => {
115
- let {
116
- theme: {
117
- colors
118
- }
119
- } = _ref8;
120
- return colors.neutral.background;
121
- }, ";&::placeholder{color:", _ref9 => {
122
- let {
123
- theme: {
124
- colors
125
- }
126
- } = _ref9;
127
- return colors.neutral.textWeak;
128
- }, ";}");
87
+ })("display:flex;flex:1;font-size:", ({
88
+ theme
89
+ }) => theme.typography.body.fontSize, ";color:", ({
90
+ theme: {
91
+ colors
92
+ }
93
+ }) => colors.neutral.text, ";border:none;outline:none;background-color:", ({
94
+ theme: {
95
+ colors
96
+ }
97
+ }) => colors.neutral.background, ";&::placeholder{color:", ({
98
+ theme: {
99
+ colors
100
+ }
101
+ }) => colors.neutral.textWeak, ";}");
129
102
  const convertTagArrayToTagStateArray = tags => (tags || [])?.map((tag, index) => typeof tag === 'object' ? {
130
103
  ...tag,
131
104
  index: getUUID(`tag-${index}`)
@@ -137,20 +110,19 @@ const convertTagArrayToTagStateArray = tags => (tags || [])?.map((tag, index) =>
137
110
  * TagInput is a component that allows users to input tags.
138
111
  * @experimental This component is experimental and may be subject to breaking changes in the future.
139
112
  */
140
- const TagInput = _ref10 => {
141
- let {
142
- disabled = false,
143
- id,
144
- manualInput = true,
145
- name,
146
- onChange,
147
- onChangeError,
148
- placeholder,
149
- tags,
150
- variant = 'base',
151
- className,
152
- 'data-testid': dataTestId
153
- } = _ref10;
113
+ const TagInput = ({
114
+ disabled = false,
115
+ id,
116
+ manualInput = true,
117
+ name,
118
+ onChange,
119
+ onChangeError,
120
+ placeholder,
121
+ tags,
122
+ variant = 'base',
123
+ className,
124
+ 'data-testid': dataTestId
125
+ }) => {
154
126
  const [tagInputState, setTagInput] = useState(convertTagArrayToTagStateArray(tags ?? []));
155
127
  const [input, setInput] = useState('');
156
128
  const [status, setStatus] = useState({});
@@ -194,12 +166,9 @@ const TagInput = _ref10 => {
194
166
  setStatus({
195
167
  [tagIndex]: STATUS.LOADING
196
168
  });
197
- const findIndex = tagInputState.findIndex(_ref11 => {
198
- let {
199
- index
200
- } = _ref11;
201
- return index === tagIndex;
202
- });
169
+ const findIndex = tagInputState.findIndex(({
170
+ index
171
+ }) => index === tagIndex);
203
172
  const newTagInput = [...tagInputState];
204
173
  newTagInput.splice(findIndex, 1);
205
174
  try {
@@ -17,49 +17,36 @@ const StyledContainer = /*#__PURE__*/_styled("div", {
17
17
  });
18
18
  const TagsWrapper = /*#__PURE__*/_styled("span", {
19
19
  target: "eb6op481"
20
- })("cursor:pointer;color:", _ref => {
21
- let {
22
- theme
23
- } = _ref;
24
- return theme.colors.primary.text;
25
- }, ";border:none;font-size:14px;align-self:center;max-width:350px;overflow:hidden;white-space:pre;text-overflow:ellipsis;background-color:transparent;padding-left:8px;padding-right:8px;");
20
+ })("cursor:pointer;color:", ({
21
+ theme
22
+ }) => theme.colors.primary.text, ";border:none;font-size:14px;align-self:center;max-width:350px;overflow:hidden;white-space:pre;text-overflow:ellipsis;background-color:transparent;padding-left:8px;padding-right:8px;");
26
23
  const StyledTagContainer = /*#__PURE__*/_styled("div", {
27
24
  target: "eb6op480"
28
- })("display:flex;align-items:center;color:", _ref2 => {
29
- let {
30
- theme
31
- } = _ref2;
32
- return theme.colors.neutral.text;
33
- }, ";gap:", _ref3 => {
34
- let {
35
- theme
36
- } = _ref3;
37
- return theme.space['1'];
38
- }, ";", _ref4 => {
39
- let {
40
- multiline
41
- } = _ref4;
42
- return multiline && `flex-wrap: wrap;`;
43
- }, ";");
25
+ })("display:flex;align-items:center;color:", ({
26
+ theme
27
+ }) => theme.colors.neutral.text, ";gap:", ({
28
+ theme
29
+ }) => theme.space['1'], ";", ({
30
+ multiline
31
+ }) => multiline && `flex-wrap: wrap;`, ";");
44
32
  const DEFAULT_TAGS = [];
45
33
  const getTagLabel = tag => typeof tag === 'object' ? tag.label : tag;
46
34
 
47
35
  /**
48
36
  * This component is used to display a list of tags with a threshold and a popover when there are too many tags.
49
37
  */
50
- const TagList = _ref5 => {
51
- let {
52
- maxLength = 600,
53
- tags = DEFAULT_TAGS,
54
- threshold = 1,
55
- multiline = false,
56
- popoverTitle,
57
- copiable,
58
- copyText,
59
- copiedText,
60
- className,
61
- 'data-testid': dataTestId
62
- } = _ref5;
38
+ const TagList = ({
39
+ maxLength = 600,
40
+ tags = DEFAULT_TAGS,
41
+ threshold = 1,
42
+ multiline = false,
43
+ popoverTitle,
44
+ copiable,
45
+ copyText,
46
+ copiedText,
47
+ className,
48
+ 'data-testid': dataTestId
49
+ }) => {
63
50
  let tmpThreshold = threshold;
64
51
  if (tags.length > 0 && tags.slice(0, tmpThreshold).reduce((acc, tag) => acc + getTagLabel(tag), '').length > maxLength) {
65
52
  // If total tags length in characters is above maxLength,
@@ -16,18 +16,17 @@ const PROMINENCES = {
16
16
  /**
17
17
  * Generate all styles available for text based on prominence and variants
18
18
  */
19
- const generateStyles = _ref => {
20
- let {
21
- placement,
22
- prominence,
23
- sentiment,
24
- variant,
25
- theme,
26
- oneLine,
27
- disabled,
28
- italic,
29
- underline
30
- } = _ref;
19
+ const generateStyles = ({
20
+ placement,
21
+ prominence,
22
+ sentiment,
23
+ variant,
24
+ theme,
25
+ oneLine,
26
+ disabled,
27
+ italic,
28
+ underline
29
+ }) => {
31
30
  // stronger is available only for neutral sentiment
32
31
  const definedProminence = sentiment !== 'neutral' && prominence === 'stronger' ? capitalize(PROMINENCES.default) : capitalize(PROMINENCES[prominence]);
33
32
  sentiment ? theme.colors[sentiment] : undefined;
@@ -60,25 +59,24 @@ const StyledText = /*#__PURE__*/_styled('div', {
60
59
  /**
61
60
  * Text component is used to display text with different variants and sentiments.
62
61
  */
63
- const Text = _ref2 => {
64
- let {
65
- variant,
66
- children,
67
- as,
68
- color,
69
- sentiment,
70
- oneLine = false,
71
- placement,
72
- prominence = 'default',
73
- className,
74
- disabled = false,
75
- italic = false,
76
- underline = false,
77
- id,
78
- dir,
79
- htmlFor,
80
- 'data-testid': dataTestId
81
- } = _ref2;
62
+ const Text = ({
63
+ variant,
64
+ children,
65
+ as,
66
+ color,
67
+ sentiment,
68
+ oneLine = false,
69
+ placement,
70
+ prominence = 'default',
71
+ className,
72
+ disabled = false,
73
+ italic = false,
74
+ underline = false,
75
+ id,
76
+ dir,
77
+ htmlFor,
78
+ 'data-testid': dataTestId
79
+ }) => {
82
80
  const computedSentiment = sentiment ?? color;
83
81
  const elementRef = useRef(null);
84
82
  const isOverflowing = useIsOverflowing(elementRef);