@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
@@ -39,16 +39,15 @@ const FOCUS_RING_KEY = {
39
39
 
40
40
  // VARIANTS
41
41
 
42
- const coreStyle = _ref => {
43
- let {
44
- theme,
45
- size,
46
- sentiment,
47
- iconPosition,
48
- fullWidth,
49
- disabled,
50
- iconOnly
51
- } = _ref;
42
+ const coreStyle = ({
43
+ theme,
44
+ size,
45
+ sentiment,
46
+ iconPosition,
47
+ fullWidth,
48
+ disabled,
49
+ iconOnly
50
+ }) => {
52
51
  const font = size === 'large' ? theme.typography.bodyStrong : theme.typography.bodySmallStrong;
53
52
  let width = 'auto';
54
53
  if (fullWidth) {
@@ -94,25 +93,17 @@ const coreStyle = _ref => {
94
93
  const StyledFilledButton = /*#__PURE__*/_styled('button', {
95
94
  shouldForwardProp: prop => !['size', 'sentiment', 'iconPosition', 'fullWidth', 'iconOnly'].includes(prop),
96
95
  target: "e112qvla2"
97
- })(args => coreStyle(args), " background:", _ref2 => {
98
- let {
99
- theme,
100
- sentiment
101
- } = _ref2;
102
- return theme.colors[sentiment].backgroundStrong;
103
- }, ";border:none;color:", _ref3 => {
104
- let {
105
- theme,
106
- sentiment
107
- } = _ref3;
108
- return theme.colors[sentiment].textStrong;
109
- }, ";", _ref4 => {
110
- let {
111
- theme,
112
- sentiment,
113
- disabled
114
- } = _ref4;
115
- return disabled ? `
96
+ })(args => coreStyle(args), " background:", ({
97
+ theme,
98
+ sentiment
99
+ }) => theme.colors[sentiment].backgroundStrong, ";border:none;color:", ({
100
+ theme,
101
+ sentiment
102
+ }) => theme.colors[sentiment].textStrong, ";", ({
103
+ theme,
104
+ sentiment,
105
+ disabled
106
+ }) => disabled ? `
116
107
  background: ${theme.colors[sentiment].backgroundStrongDisabled};
117
108
  color:
118
109
  ${theme.colors[sentiment].textStrongDisabled};
@@ -123,30 +114,21 @@ const StyledFilledButton = /*#__PURE__*/_styled('button', {
123
114
  color:
124
115
  ${theme.colors[sentiment].textStrongHover};
125
116
  }
126
- `;
127
- }, ";");
117
+ `, ";");
128
118
  const StyledOutlinedButton = /*#__PURE__*/_styled('button', {
129
119
  shouldForwardProp: prop => !['size', 'sentiment', 'iconPosition', 'fullWidth', 'iconOnly'].includes(prop),
130
120
  target: "e112qvla1"
131
- })(args => coreStyle(args), " background:none;border:1px solid ", _ref5 => {
132
- let {
133
- theme,
134
- sentiment
135
- } = _ref5;
136
- return theme.colors[sentiment][sentiment === 'neutral' ? 'borderStrong' : 'border'];
137
- }, ";color:", _ref6 => {
138
- let {
139
- theme,
140
- sentiment
141
- } = _ref6;
142
- return theme.colors[sentiment].text;
143
- }, ";", _ref7 => {
144
- let {
145
- theme,
146
- sentiment,
147
- disabled
148
- } = _ref7;
149
- return disabled ? `
121
+ })(args => coreStyle(args), " background:none;border:1px solid ", ({
122
+ theme,
123
+ sentiment
124
+ }) => theme.colors[sentiment][sentiment === 'neutral' ? 'borderStrong' : 'border'], ";color:", ({
125
+ theme,
126
+ sentiment
127
+ }) => theme.colors[sentiment].text, ";", ({
128
+ theme,
129
+ sentiment,
130
+ disabled
131
+ }) => disabled ? `
150
132
  color:
151
133
  ${theme.colors[sentiment].textDisabled};
152
134
  border: 1px solid ${theme.colors[sentiment][sentiment === 'neutral' ? 'borderStrongDisabled' : 'borderDisabled']};
@@ -160,24 +142,18 @@ const StyledOutlinedButton = /*#__PURE__*/_styled('button', {
160
142
  border: 1px solid ${theme.colors[sentiment][sentiment === 'neutral' ? 'borderStrongHover' : 'borderHover']};
161
143
 
162
144
  }
163
- `;
164
- }, ";");
145
+ `, ";");
165
146
  const StyledGhostButton = /*#__PURE__*/_styled('button', {
166
147
  shouldForwardProp: prop => !['size', 'sentiment', 'iconPosition', 'fullWidth', 'iconOnly'].includes(prop),
167
148
  target: "e112qvla0"
168
- })(args => coreStyle(args), " background:none;border:none;color:", _ref8 => {
169
- let {
170
- theme,
171
- sentiment
172
- } = _ref8;
173
- return theme.colors[sentiment].text;
174
- }, ";", _ref9 => {
175
- let {
176
- theme,
177
- sentiment,
178
- disabled
179
- } = _ref9;
180
- return disabled ? `
149
+ })(args => coreStyle(args), " background:none;border:none;color:", ({
150
+ theme,
151
+ sentiment
152
+ }) => theme.colors[sentiment].text, ";", ({
153
+ theme,
154
+ sentiment,
155
+ disabled
156
+ }) => disabled ? `
181
157
  color:
182
158
  ${theme.colors[sentiment].textDisabled};
183
159
  ` : `
@@ -187,8 +163,7 @@ const StyledGhostButton = /*#__PURE__*/_styled('button', {
187
163
  color:
188
164
  ${theme.colors[sentiment].textHover};
189
165
  }
190
- `;
191
- }, ";");
166
+ `, ";");
192
167
  const VARIANTS_COMPONENTS = {
193
168
  filled: {
194
169
  button: StyledFilledButton,
@@ -216,38 +191,37 @@ const VARIANTS_COMPONENTS = {
216
191
  * Button component is used to trigger an action or event, such as submitting a form, opening a dialog,
217
192
  * canceling an action, or performing a delete operation.
218
193
  */
219
- const Button = /*#__PURE__*/forwardRef((_ref10, ref) => {
220
- let {
221
- type = 'button',
222
- className,
223
- 'data-testid': dataTestId,
224
- sentiment = 'primary',
225
- variant = 'filled',
226
- size = 'large',
227
- disabled = false,
228
- icon,
229
- iconPosition = 'left',
230
- fullWidth = false,
231
- isLoading = false,
232
- children,
233
- onClick,
234
- onMouseDown,
235
- onMouseUp,
236
- onMouseOut,
237
- name,
238
- 'aria-label': ariaLabel,
239
- 'aria-current': ariaCurrent,
240
- 'aria-controls': ariaControls,
241
- 'aria-expanded': ariaExpanded,
242
- 'aria-haspopup': ariaHaspopup,
243
- href,
244
- download,
245
- target,
246
- role,
247
- tooltip,
248
- tabIndex,
249
- autoFocus
250
- } = _ref10;
194
+ const Button = /*#__PURE__*/forwardRef(({
195
+ type = 'button',
196
+ className,
197
+ 'data-testid': dataTestId,
198
+ sentiment = 'primary',
199
+ variant = 'filled',
200
+ size = 'large',
201
+ disabled = false,
202
+ icon,
203
+ iconPosition = 'left',
204
+ fullWidth = false,
205
+ isLoading = false,
206
+ children,
207
+ onClick,
208
+ onMouseDown,
209
+ onMouseUp,
210
+ onMouseOut,
211
+ name,
212
+ 'aria-label': ariaLabel,
213
+ 'aria-current': ariaCurrent,
214
+ 'aria-controls': ariaControls,
215
+ 'aria-expanded': ariaExpanded,
216
+ 'aria-haspopup': ariaHaspopup,
217
+ href,
218
+ download,
219
+ target,
220
+ role,
221
+ tooltip,
222
+ tabIndex,
223
+ autoFocus
224
+ }, ref) => {
251
225
  const computeIsDisabled = disabled || isLoading;
252
226
  const content = jsxs(Fragment, {
253
227
  children: [!isLoading && icon ? jsx(Icon, {
@@ -17,69 +17,51 @@ const StyledStack = /*#__PURE__*/_styled(Stack, {
17
17
  });
18
18
  const BorderedBox = /*#__PURE__*/_styled("div", {
19
19
  target: "exwxj840"
20
- })("border:1px solid ", _ref => {
21
- let {
22
- theme
23
- } = _ref;
24
- return theme.colors.neutral.border;
25
- }, ";border-radius:", _ref2 => {
26
- let {
27
- theme
28
- } = _ref2;
29
- return theme.radii.default;
30
- }, ";padding:", _ref3 => {
31
- let {
32
- theme
33
- } = _ref3;
34
- return theme.space['3'];
35
- }, ";&[data-is-active='true']{border:1px solid ", _ref4 => {
36
- let {
37
- theme
38
- } = _ref4;
39
- return theme.colors.primary.border;
40
- }, ";}&[data-disabled='true']{border:1px solid ", _ref5 => {
41
- let {
42
- theme
43
- } = _ref5;
44
- return theme.colors.neutral.borderDisabled;
45
- }, ";}");
20
+ })("border:1px solid ", ({
21
+ theme
22
+ }) => theme.colors.neutral.border, ";border-radius:", ({
23
+ theme
24
+ }) => theme.radii.default, ";padding:", ({
25
+ theme
26
+ }) => theme.space['3'], ";&[data-is-active='true']{border:1px solid ", ({
27
+ theme
28
+ }) => theme.colors.primary.border, ";}&[data-disabled='true']{border:1px solid ", ({
29
+ theme
30
+ }) => theme.colors.neutral.borderDisabled, ";}");
46
31
 
47
32
  /**
48
33
  * Card component is a simple component to display content in a box with a border.
49
34
  */
50
- const Card = /*#__PURE__*/forwardRef((_ref6, ref) => {
51
- let {
52
- header,
53
- disabled = false,
54
- isActive = false,
55
- children,
56
- className,
57
- 'data-testid': dataTestId
58
- } = _ref6;
59
- return header ? jsxs(StyledStack, {
60
- gap: 1,
61
- className: className,
62
- "data-testid": dataTestId,
63
- "data-disabled": disabled,
64
- ref: ref,
65
- children: [typeof header === 'string' ? jsx(Text, {
66
- variant: "heading",
67
- as: "h2",
68
- disabled: disabled,
69
- children: header
70
- }) : header, jsx(BorderedBox, {
71
- "data-is-active": isActive,
72
- "data-disabled": disabled,
73
- children: children
74
- })]
75
- }) : jsx(BorderedBox, {
35
+ const Card = /*#__PURE__*/forwardRef(({
36
+ header,
37
+ disabled = false,
38
+ isActive = false,
39
+ children,
40
+ className,
41
+ 'data-testid': dataTestId
42
+ }, ref) => header ? jsxs(StyledStack, {
43
+ gap: 1,
44
+ className: className,
45
+ "data-testid": dataTestId,
46
+ "data-disabled": disabled,
47
+ ref: ref,
48
+ children: [typeof header === 'string' ? jsx(Text, {
49
+ variant: "heading",
50
+ as: "h2",
51
+ disabled: disabled,
52
+ children: header
53
+ }) : header, jsx(BorderedBox, {
76
54
  "data-is-active": isActive,
77
55
  "data-disabled": disabled,
78
- className: className,
79
- "data-testid": dataTestId,
80
- ref: ref,
81
56
  children: children
82
- });
83
- });
57
+ })]
58
+ }) : jsx(BorderedBox, {
59
+ "data-is-active": isActive,
60
+ "data-disabled": disabled,
61
+ className: className,
62
+ "data-testid": dataTestId,
63
+ ref: ref,
64
+ children: children
65
+ }));
84
66
 
85
67
  export { Card };
@@ -15,72 +15,47 @@ const StyledWrapper = /*#__PURE__*/_styled("div", {
15
15
  });
16
16
  const StyledBeforeScroll = /*#__PURE__*/_styled("span", {
17
17
  target: "e1id70w03"
18
- })("position:absolute;width:100px;height:100%;content:'';background:linear-gradient(\n -90deg,\n ", _ref => {
19
- let {
20
- theme
21
- } = _ref;
22
- return theme.colors.neutral.background;
23
- }, "ff,\n ", _ref2 => {
24
- let {
25
- theme
26
- } = _ref2;
27
- return theme.colors.neutral.background;
28
- }, "\n );cursor:w-resize;z-index:auto;");
18
+ })("position:absolute;width:100px;height:100%;content:'';background:linear-gradient(\n -90deg,\n ", ({
19
+ theme
20
+ }) => theme.colors.neutral.background, "ff,\n ", ({
21
+ theme
22
+ }) => theme.colors.neutral.background, "\n );cursor:w-resize;z-index:auto;");
29
23
  const StyledScrollableWrapper = /*#__PURE__*/_styled("div", {
30
24
  target: "e1id70w02"
31
- })("overflow-x:scroll;overflow-y:hidden;white-space:nowrap;display:flex;padding:0 100px;gap:", _ref3 => {
32
- let {
33
- theme
34
- } = _ref3;
35
- return theme.space['2'];
36
- }, ";");
25
+ })("overflow-x:scroll;overflow-y:hidden;white-space:nowrap;display:flex;padding:0 100px;gap:", ({
26
+ theme
27
+ }) => theme.space['2'], ";");
37
28
  const StyledAfterScroll = /*#__PURE__*/_styled("span", {
38
29
  target: "e1id70w01"
39
- })("position:absolute;bottom:0;right:0;width:100px;height:100%;content:'';cursor:e-resize;z-index:auto;background:linear-gradient(\n -90deg,\n ", _ref4 => {
40
- let {
41
- theme
42
- } = _ref4;
43
- return theme.colors.neutral.background;
44
- }, ",\n ", _ref5 => {
45
- let {
46
- theme
47
- } = _ref5;
48
- return theme.colors.neutral.background;
49
- }, "ff\n );");
30
+ })("position:absolute;bottom:0;right:0;width:100px;height:100%;content:'';cursor:e-resize;z-index:auto;background:linear-gradient(\n -90deg,\n ", ({
31
+ theme
32
+ }) => theme.colors.neutral.background, ",\n ", ({
33
+ theme
34
+ }) => theme.colors.neutral.background, "ff\n );");
50
35
  const StyledBorderWrapper = /*#__PURE__*/_styled('div', {
51
36
  shouldForwardProp: prop => !['width'].includes(prop),
52
37
  target: "e1id70w00"
53
- })("display:flex;align-items:stretch;width:", _ref6 => {
54
- let {
55
- width
56
- } = _ref6;
57
- return width;
58
- }, ";max-width:", _ref7 => {
59
- let {
60
- width
61
- } = _ref7;
62
- return width;
63
- }, ";overflow-wrap:break-word;white-space:normal;height:auto;cursor:grab;flex-shrink:0;");
64
- const CarouselItem = _ref8 => {
65
- let {
66
- children,
67
- width = '240px'
68
- } = _ref8;
69
- return jsx(StyledBorderWrapper, {
70
- width: width,
71
- draggable: "true",
72
- children: children
73
- });
74
- };
38
+ })("display:flex;align-items:stretch;width:", ({
39
+ width
40
+ }) => width, ";max-width:", ({
41
+ width
42
+ }) => width, ";overflow-wrap:break-word;white-space:normal;height:auto;cursor:grab;flex-shrink:0;");
43
+ const CarouselItem = ({
44
+ children,
45
+ width = '240px'
46
+ }) => jsx(StyledBorderWrapper, {
47
+ width: width,
48
+ draggable: "true",
49
+ children: children
50
+ });
75
51
  /**
76
52
  * Carousel component allows you to scroll horizontally through a list of items.
77
53
  */
78
- const Carousel = _ref9 => {
79
- let {
80
- children,
81
- className,
82
- 'data-testid': dataTestId = 'scrollbar'
83
- } = _ref9;
54
+ const Carousel = ({
55
+ children,
56
+ className,
57
+ 'data-testid': dataTestId = 'scrollbar'
58
+ }) => {
84
59
  const scrollRef = useRef(null);
85
60
  let intervalLeft;
86
61
  let intervalRight;
@@ -98,10 +73,7 @@ const Carousel = _ref9 => {
98
73
  }
99
74
  }, 30);
100
75
  };
101
- const handleScrollX = function (scrollX) {
102
- if (scrollX === void 0) {
103
- scrollX = 25;
104
- }
76
+ const handleScrollX = (scrollX = 25) => {
105
77
  if (scrollRef.current?.scrollTo && scrollRef.current?.scrollLeft) {
106
78
  scrollRef.current.scrollTo?.(scrollRef.current.scrollLeft + scrollX, 0);
107
79
  }