@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.
- package/README.md +14 -7
- package/dist/index.d.ts +51 -2
- package/dist/src/components/ActionBar/index.js +22 -37
- package/dist/src/components/Alert/index.js +27 -41
- package/dist/src/components/Avatar/index.js +48 -69
- package/dist/src/components/Badge/index.js +29 -49
- package/dist/src/components/Banner/index.js +42 -62
- package/dist/src/components/BarChart/Tooltip.js +35 -50
- package/dist/src/components/BarChart/index.js +13 -14
- package/dist/src/components/BarStack/index.js +100 -191
- package/dist/src/components/Breadcrumbs/index.js +29 -39
- package/dist/src/components/Bullet/index.js +42 -55
- package/dist/src/components/Button/index.js +73 -99
- package/dist/src/components/Card/index.js +39 -57
- package/dist/src/components/Carousel/index.js +32 -60
- package/dist/src/components/Checkbox/index.js +153 -341
- package/dist/src/components/CheckboxGroup/index.js +25 -27
- package/dist/src/components/CopyButton/index.js +11 -12
- package/dist/src/components/DateInput/index.js +141 -268
- package/dist/src/components/EmptyState/index.js +68 -83
- package/dist/src/components/Expandable/index.js +13 -20
- package/dist/src/components/GlobalAlert/GlobalAlertLink.js +12 -13
- package/dist/src/components/GlobalAlert/index.js +19 -32
- package/dist/src/components/LineChart/CustomLegend.js +80 -89
- package/dist/src/components/LineChart/Tooltip.js +32 -47
- package/dist/src/components/LineChart/helpers.js +15 -50
- package/dist/src/components/LineChart/index.js +23 -33
- package/dist/src/components/Link/index.js +46 -65
- package/dist/src/components/List/Body.js +9 -15
- package/dist/src/components/List/Cell.js +6 -7
- package/dist/src/components/List/HeaderCell.js +28 -56
- package/dist/src/components/List/HeaderRow.js +9 -16
- package/dist/src/components/List/ListContext.js +5 -6
- package/dist/src/components/List/Row.js +44 -90
- package/dist/src/components/List/SelectBar.js +9 -13
- package/dist/src/components/List/SkeletonRows.js +5 -6
- package/dist/src/components/List/index.js +15 -25
- package/dist/src/components/Loader/index.js +18 -25
- package/dist/src/components/Menu/Item.js +39 -49
- package/dist/src/components/Menu/index.js +31 -56
- package/dist/src/components/MenuV2/Item.js +39 -49
- package/dist/src/components/MenuV2/index.js +28 -47
- package/dist/src/components/Meter/index.js +25 -47
- package/dist/src/components/Modal/Dialog.js +33 -58
- package/dist/src/components/Modal/Disclosure.js +8 -9
- package/dist/src/components/Modal/index.js +26 -33
- package/dist/src/components/Notice/index.js +21 -27
- package/dist/src/components/NumberInput/index.js +73 -137
- package/dist/src/components/Pagination/getPageNumbers.js +1 -4
- package/dist/src/components/Pagination/index.js +17 -27
- package/dist/src/components/PasswordCheck/index.js +26 -32
- package/dist/src/components/PasswordStrengthMeter/index.js +25 -44
- package/dist/src/components/PieChart/Legends.js +71 -107
- package/dist/src/components/PieChart/Tooltip.js +33 -36
- package/dist/src/components/PieChart/index.js +13 -17
- package/dist/src/components/Popover/index.js +58 -75
- package/dist/src/components/Popup/helpers.js +13 -15
- package/dist/src/components/Popup/index.js +55 -98
- package/dist/src/components/ProgressBar/index.js +31 -49
- package/dist/src/components/Radio/index.js +58 -113
- package/dist/src/components/RadioGroup/index.js +26 -28
- package/dist/src/components/Row/index.js +25 -31
- package/dist/src/components/SelectInput/index.js +357 -410
- package/dist/src/components/SelectableCard/index.js +73 -115
- package/dist/src/components/Separator/index.js +52 -73
- package/dist/src/components/Skeleton/Block.js +23 -41
- package/dist/src/components/Skeleton/Blocks.js +23 -41
- package/dist/src/components/Skeleton/BoxWithIcon.js +21 -36
- package/dist/src/components/Skeleton/Donut.js +3 -6
- package/dist/src/components/Skeleton/IconSkeleton.js +13 -31
- package/dist/src/components/Skeleton/Line.js +5 -11
- package/dist/src/components/Skeleton/List.js +22 -31
- package/dist/src/components/Skeleton/Slider.js +25 -46
- package/dist/src/components/Skeleton/Square.js +3 -6
- package/dist/src/components/Skeleton/index.js +17 -33
- package/dist/src/components/Snippet/index.js +82 -137
- package/dist/src/components/Stack/index.js +11 -14
- package/dist/src/components/Status/index.js +48 -78
- package/dist/src/components/StepList/index.js +45 -63
- package/dist/src/components/Stepper/index.js +74 -129
- package/dist/src/components/SwitchButton/FocusOverlay.js +13 -23
- package/dist/src/components/SwitchButton/index.js +36 -62
- package/dist/src/components/Table/Body.js +5 -8
- package/dist/src/components/Table/Cell.js +14 -20
- package/dist/src/components/Table/Header.js +8 -14
- package/dist/src/components/Table/HeaderCell.js +40 -56
- package/dist/src/components/Table/HeaderRow.js +4 -5
- package/dist/src/components/Table/Row.js +10 -14
- package/dist/src/components/Table/SelectBar.js +9 -13
- package/dist/src/components/Table/SkeletonRows.js +5 -6
- package/dist/src/components/Table/TableContext.js +6 -7
- package/dist/src/components/Table/index.js +44 -50
- package/dist/src/components/Tabs/Tab.js +57 -118
- package/dist/src/components/Tabs/TabMenu.js +32 -38
- package/dist/src/components/Tabs/TabMenuItem.js +9 -13
- package/dist/src/components/Tabs/index.js +24 -43
- package/dist/src/components/Tag/index.js +57 -74
- package/dist/src/components/TagInput/index.js +63 -94
- package/dist/src/components/TagList/index.js +22 -35
- package/dist/src/components/Text/index.js +29 -31
- package/dist/src/components/TextArea/index.js +240 -0
- package/dist/src/components/TextInput/index.js +166 -260
- package/dist/src/components/TimeInput/index.js +10 -13
- package/dist/src/components/Toaster/index.js +51 -67
- package/dist/src/components/Toggle/index.js +62 -129
- package/dist/src/components/ToggleGroup/index.js +21 -23
- package/dist/src/components/Tooltip/index.js +28 -31
- package/dist/src/components/VerificationCode/index.js +55 -90
- package/dist/src/index.js +1 -0
- package/dist/src/utils/ids.js +1 -6
- package/package.json +3 -3
|
@@ -39,16 +39,15 @@ const FOCUS_RING_KEY = {
|
|
|
39
39
|
|
|
40
40
|
// VARIANTS
|
|
41
41
|
|
|
42
|
-
const coreStyle =
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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:",
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}, ";
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
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 ",
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
}, ";
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
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:",
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
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((
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
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 ",
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}, ";
|
|
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((
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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 ",
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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:",
|
|
32
|
-
|
|
33
|
-
|
|
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 ",
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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:",
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
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 =
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
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 =
|
|
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
|
}
|