@trackunit/react-components 0.0.126 → 0.0.130
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/components/ActionButton/ActionButton.d.ts +25 -0
- package/components/ActionButton/index.d.ts +1 -0
- package/components/Checkbox/Checkbox.d.ts +1 -5
- package/components/Label/Label.d.ts +11 -1
- package/components/Menu/MenuButton.d.ts +2 -1
- package/components/RadioGroup/RadioGroup.d.ts +3 -2
- package/components/Select/SelectMenuItem/SelectMenuItem.d.ts +1 -1
- package/components/index.d.ts +1 -0
- package/index.css +178 -42
- package/index.js +219 -191
- package/package.json +1 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { CommonProps } from "../../common";
|
|
3
|
+
declare type ActionType = "PHONE_NUMBER" | "WEB_ADDRESS" | "EMAIL";
|
|
4
|
+
interface ActionButtonProps extends CommonProps {
|
|
5
|
+
/**
|
|
6
|
+
* The type of action performed when clicking the button.
|
|
7
|
+
*/
|
|
8
|
+
type: ActionType;
|
|
9
|
+
/**
|
|
10
|
+
* The value to be passed into the button.
|
|
11
|
+
*/
|
|
12
|
+
value?: string | null;
|
|
13
|
+
/**
|
|
14
|
+
* The onClick event.
|
|
15
|
+
*/
|
|
16
|
+
onClick?: (e: React.MouseEvent) => void;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The ActionButton component is a wrapper over IconButton to perform an action when the onClick event is triggered.
|
|
20
|
+
*
|
|
21
|
+
* @param {ActionButtonProps} props - The props for the ActionButton component
|
|
22
|
+
* @returns {JSX.Element} ActionButton component
|
|
23
|
+
*/
|
|
24
|
+
export declare const ActionButton: ({ type, value }: ActionButtonProps) => JSX.Element;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./ActionButton";
|
|
@@ -11,17 +11,13 @@ export interface CheckboxProps extends CommonProps, React.InputHTMLAttributes<HT
|
|
|
11
11
|
disabled?: boolean;
|
|
12
12
|
/**
|
|
13
13
|
* An boolean flag to set invalid mode
|
|
14
|
-
* can be used for
|
|
14
|
+
* can be used for indicating errors
|
|
15
15
|
*/
|
|
16
16
|
isInvalid?: boolean;
|
|
17
17
|
/**
|
|
18
18
|
* An boolean flag to set checkbox to readonly mode
|
|
19
19
|
*/
|
|
20
20
|
readOnly?: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* An string element to be used as input name
|
|
23
|
-
*/
|
|
24
|
-
name?: string;
|
|
25
21
|
/**
|
|
26
22
|
* An boolean flag to set checkbox to intermediate state
|
|
27
23
|
*/
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { CommonProps } from "../../common/CommonProps";
|
|
3
|
+
import "./Label.css";
|
|
3
4
|
export interface LabelProps extends CommonProps {
|
|
4
5
|
/**
|
|
5
6
|
* ID of the label.
|
|
@@ -13,6 +14,15 @@ export interface LabelProps extends CommonProps {
|
|
|
13
14
|
* The label value.
|
|
14
15
|
*/
|
|
15
16
|
children?: React.ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* Whether the label is disabled or not.
|
|
19
|
+
*/
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* A boolean flag to set invalid mode
|
|
23
|
+
* can be used for indicating errors
|
|
24
|
+
*/
|
|
25
|
+
isInvalid?: boolean;
|
|
16
26
|
}
|
|
17
27
|
/**
|
|
18
28
|
* The Label component is used for labels for input fields.
|
|
@@ -21,4 +31,4 @@ export interface LabelProps extends CommonProps {
|
|
|
21
31
|
* @param {LabelProps} props - The props for the Label component
|
|
22
32
|
* @returns {JSX.Element} Label component
|
|
23
33
|
*/
|
|
24
|
-
export declare const Label: ({ id, htmlFor, children, className, dataTestId }: LabelProps) => JSX.Element;
|
|
34
|
+
export declare const Label: ({ id, htmlFor, children, className, dataTestId, disabled, isInvalid, }: LabelProps) => JSX.Element;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
interface IMobileButton {
|
|
3
3
|
onClick: () => void;
|
|
4
4
|
className?: string;
|
|
5
|
+
dataTestId?: string;
|
|
5
6
|
}
|
|
6
7
|
/**
|
|
7
8
|
* The MenuButton component.
|
|
@@ -9,5 +10,5 @@ interface IMobileButton {
|
|
|
9
10
|
* @param {IMobileButton} props - The props for the MenuButton component
|
|
10
11
|
* @returns {JSX.Element} MenuButton component
|
|
11
12
|
*/
|
|
12
|
-
export declare const MenuButton: ({ onClick, className }: IMobileButton) => JSX.Element;
|
|
13
|
+
export declare const MenuButton: ({ onClick, className, dataTestId }: IMobileButton) => JSX.Element;
|
|
13
14
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { CommonProps } from "../../common/CommonProps";
|
|
3
|
+
import "./RadioGroup.css";
|
|
3
4
|
export interface RadioGroupProps extends CommonProps, React.InputHTMLAttributes<HTMLInputElement> {
|
|
4
5
|
/**
|
|
5
6
|
*/
|
|
@@ -33,8 +34,8 @@ export interface RadioGroupProps extends CommonProps, React.InputHTMLAttributes<
|
|
|
33
34
|
*/
|
|
34
35
|
disabled?: boolean;
|
|
35
36
|
/**
|
|
36
|
-
*
|
|
37
|
-
* can be used for
|
|
37
|
+
* A boolean flag to set invalid mode
|
|
38
|
+
* can be used for indicating errors
|
|
38
39
|
*/
|
|
39
40
|
isInvalid?: boolean;
|
|
40
41
|
}
|
|
@@ -38,7 +38,7 @@ export interface SingleSelectMenuItemProps extends SelectMenuItemProps {
|
|
|
38
38
|
* @param {SelectMenuItemProps} props - The props for the SingleSelectMenuItem
|
|
39
39
|
* @returns {JSX.Element} SingleSelectMenuItem
|
|
40
40
|
*/
|
|
41
|
-
export declare const SingleSelectMenuItem: ({ label, icon, onClick, selected, dataTestId, focused, }: SingleSelectMenuItemProps) => JSX.Element;
|
|
41
|
+
export declare const SingleSelectMenuItem: ({ label, icon, onClick, selected, dataTestId, focused, disabled, }: SingleSelectMenuItemProps) => JSX.Element;
|
|
42
42
|
/**
|
|
43
43
|
* A multi select menu item is a basic wrapper around Menu item designed to be used as a multi value render in Select list
|
|
44
44
|
*
|
package/components/index.d.ts
CHANGED
package/index.css
CHANGED
|
@@ -16,8 +16,7 @@
|
|
|
16
16
|
rounded-lg
|
|
17
17
|
cursor-pointer
|
|
18
18
|
flex-none
|
|
19
|
-
|
|
20
|
-
px-3
|
|
19
|
+
p-2.5
|
|
21
20
|
h-min
|
|
22
21
|
drop-shadow
|
|
23
22
|
focus:ring
|
|
@@ -46,7 +45,7 @@
|
|
|
46
45
|
}
|
|
47
46
|
|
|
48
47
|
&--small {
|
|
49
|
-
@apply
|
|
48
|
+
@apply p-2;
|
|
50
49
|
}
|
|
51
50
|
|
|
52
51
|
&--large {
|
|
@@ -161,6 +160,166 @@
|
|
|
161
160
|
hover:bg-slate-600/10
|
|
162
161
|
disabled:hover:bg-transparent;
|
|
163
162
|
}
|
|
163
|
+
|
|
164
|
+
&__container {
|
|
165
|
+
@apply w-5
|
|
166
|
+
h-5
|
|
167
|
+
flex
|
|
168
|
+
justify-center
|
|
169
|
+
items-center
|
|
170
|
+
box-border;
|
|
171
|
+
|
|
172
|
+
&--small {
|
|
173
|
+
@apply w-4
|
|
174
|
+
h-4
|
|
175
|
+
flex
|
|
176
|
+
justify-center
|
|
177
|
+
items-center
|
|
178
|
+
box-border;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/* CSS related to the LAbel component */
|
|
184
|
+
|
|
185
|
+
.tu-label {
|
|
186
|
+
@apply leading-none
|
|
187
|
+
text-base
|
|
188
|
+
text-slate-700
|
|
189
|
+
whitespace-nowrap
|
|
190
|
+
text-ellipsis
|
|
191
|
+
items-center
|
|
192
|
+
grid
|
|
193
|
+
gap-2
|
|
194
|
+
hover:text-slate-800
|
|
195
|
+
group-hover:text-slate-800
|
|
196
|
+
active:text-slate-800
|
|
197
|
+
group-active:text-slate-800;
|
|
198
|
+
|
|
199
|
+
&--invalid {
|
|
200
|
+
@apply text-red-600
|
|
201
|
+
hover:text-red-700
|
|
202
|
+
group-hover:text-red-700
|
|
203
|
+
active:text-red-700
|
|
204
|
+
group-active:text-red-700;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
&--disabled {
|
|
208
|
+
@apply text-slate-400
|
|
209
|
+
hover:text-slate-400
|
|
210
|
+
group-hover:text-slate-400;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/* CSS related to the RadioGroup component */
|
|
215
|
+
.tu-radiogroup {
|
|
216
|
+
@apply flex
|
|
217
|
+
gap-2
|
|
218
|
+
w-fit
|
|
219
|
+
flex-col
|
|
220
|
+
items-start;
|
|
221
|
+
|
|
222
|
+
&--inline {
|
|
223
|
+
@apply flex
|
|
224
|
+
gap-3
|
|
225
|
+
flex-row
|
|
226
|
+
items-center;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.tu-radioitem {
|
|
231
|
+
@apply w-4
|
|
232
|
+
h-4
|
|
233
|
+
appearance-none
|
|
234
|
+
rounded-3xl
|
|
235
|
+
bg-white
|
|
236
|
+
border-solid
|
|
237
|
+
border
|
|
238
|
+
border-slate-300
|
|
239
|
+
shadow-sm
|
|
240
|
+
shrink-0
|
|
241
|
+
transition
|
|
242
|
+
box-border
|
|
243
|
+
hover:cursor-pointer
|
|
244
|
+
hover:bg-slate-100
|
|
245
|
+
focus:ring-2
|
|
246
|
+
focus:ring-offset-2
|
|
247
|
+
focus:ring-blue-700;
|
|
248
|
+
|
|
249
|
+
&__wrapper {
|
|
250
|
+
@apply flex
|
|
251
|
+
gap-2;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
&--checked {
|
|
255
|
+
@apply border-solid
|
|
256
|
+
border-4
|
|
257
|
+
border-blue-600
|
|
258
|
+
bg-white
|
|
259
|
+
hover:bg-slate-100
|
|
260
|
+
hover:cursor-pointer
|
|
261
|
+
outline-0
|
|
262
|
+
active:bg-slate-200
|
|
263
|
+
active:ring-2
|
|
264
|
+
active:ring-offset-2
|
|
265
|
+
active:ring-blue-700
|
|
266
|
+
focus:bg-slate-200
|
|
267
|
+
focus:ring-2
|
|
268
|
+
focus:ring-offset-2
|
|
269
|
+
focus:ring-blue-700
|
|
270
|
+
group-active:ring-2
|
|
271
|
+
group-active:ring-offset-2
|
|
272
|
+
group-active:ring-blue-700;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
&--invalid {
|
|
276
|
+
@apply border-red-600
|
|
277
|
+
active:ring-red-700
|
|
278
|
+
focus:ring-red-700
|
|
279
|
+
group-focus:ring-2
|
|
280
|
+
group-focus:ring-offset-2;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
&--disabled {
|
|
284
|
+
@apply bg-slate-400
|
|
285
|
+
border-slate-300
|
|
286
|
+
cursor-not-allowed
|
|
287
|
+
group-hover:bg-slate-400
|
|
288
|
+
group-focus:bg-slate-400
|
|
289
|
+
hover:bg-slate-400
|
|
290
|
+
focus:bg-slate-400
|
|
291
|
+
active:bg-slate-400
|
|
292
|
+
focus:ring-0
|
|
293
|
+
focus:ring-offset-0
|
|
294
|
+
group-active:ring-0
|
|
295
|
+
group-active:ring-offset-0;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
&--disabled.tu-radioitem--checked {
|
|
299
|
+
@apply bg-white;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
&__label-container {
|
|
304
|
+
@apply gap-y-1
|
|
305
|
+
grid;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
&__description {
|
|
309
|
+
@apply text-sm
|
|
310
|
+
font-normal
|
|
311
|
+
text-slate-500
|
|
312
|
+
text-left
|
|
313
|
+
whitespace-nowrap
|
|
314
|
+
text-ellipsis
|
|
315
|
+
overflow-hidden;
|
|
316
|
+
|
|
317
|
+
&--disabled {
|
|
318
|
+
@apply text-slate-400
|
|
319
|
+
hover:text-slate-400
|
|
320
|
+
group-hover:text-slate-400;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
164
323
|
}
|
|
165
324
|
|
|
166
325
|
.tu-textarea {
|
|
@@ -199,15 +358,13 @@
|
|
|
199
358
|
|
|
200
359
|
&__wrapper {
|
|
201
360
|
@apply flex
|
|
202
|
-
|
|
203
|
-
p-0.5;
|
|
361
|
+
gap-2;
|
|
204
362
|
}
|
|
205
363
|
|
|
206
|
-
&
|
|
207
|
-
@apply
|
|
208
|
-
|
|
364
|
+
&__input-container {
|
|
365
|
+
@apply flex
|
|
366
|
+
self-start
|
|
209
367
|
w-fit
|
|
210
|
-
mr-2
|
|
211
368
|
active:shadow
|
|
212
369
|
rounded-full
|
|
213
370
|
cursor-pointer
|
|
@@ -216,8 +373,10 @@
|
|
|
216
373
|
focus-within:ring-blue-700;
|
|
217
374
|
}
|
|
218
375
|
|
|
219
|
-
|
|
220
|
-
@apply
|
|
376
|
+
&__input {
|
|
377
|
+
@apply absolute
|
|
378
|
+
opacity-0
|
|
379
|
+
-z-10;
|
|
221
380
|
}
|
|
222
381
|
|
|
223
382
|
&__switch-container {
|
|
@@ -288,47 +447,24 @@
|
|
|
288
447
|
@apply bg-slate-400;
|
|
289
448
|
}
|
|
290
449
|
|
|
291
|
-
&
|
|
292
|
-
@apply
|
|
293
|
-
|
|
294
|
-
-z-10;
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
&__label {
|
|
298
|
-
@apply hover:cursor-pointer
|
|
299
|
-
text-base
|
|
300
|
-
text-slate-900
|
|
301
|
-
max-w-[250px]
|
|
302
|
-
whitespace-nowrap
|
|
303
|
-
overflow-hidden
|
|
304
|
-
text-ellipsis;
|
|
305
|
-
|
|
306
|
-
&--disabled {
|
|
307
|
-
@apply text-slate-400
|
|
308
|
-
group-hover:text-slate-400
|
|
309
|
-
group-active:text-slate-400;
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
&--align-label {
|
|
314
|
-
@apply inline-block;
|
|
450
|
+
&__label-container {
|
|
451
|
+
@apply gap-y-1
|
|
452
|
+
grid;
|
|
315
453
|
}
|
|
316
454
|
|
|
317
455
|
&__description {
|
|
318
456
|
@apply text-sm
|
|
319
457
|
font-normal
|
|
320
|
-
font-sans
|
|
321
458
|
text-slate-500
|
|
322
|
-
|
|
323
|
-
max-w-[150px]
|
|
459
|
+
text-left
|
|
324
460
|
whitespace-nowrap
|
|
325
|
-
|
|
326
|
-
|
|
461
|
+
text-ellipsis
|
|
462
|
+
overflow-hidden;
|
|
327
463
|
|
|
328
464
|
&--disabled {
|
|
329
465
|
@apply text-slate-400
|
|
330
|
-
|
|
331
|
-
group-
|
|
466
|
+
hover:text-slate-400
|
|
467
|
+
group-hover:text-slate-400;
|
|
332
468
|
}
|
|
333
469
|
}
|
|
334
470
|
}
|
package/index.js
CHANGED
|
@@ -115,7 +115,7 @@ const Spinner = ({
|
|
|
115
115
|
containerClassName,
|
|
116
116
|
dataTestId
|
|
117
117
|
}) => {
|
|
118
|
-
return jsx(Container$
|
|
118
|
+
return jsx(Container$9, Object.assign({
|
|
119
119
|
"$mode": mode,
|
|
120
120
|
"$centered": centered,
|
|
121
121
|
className: containerClassName
|
|
@@ -151,7 +151,7 @@ const StyledSpinner$1 = tw.span`
|
|
|
151
151
|
${p => p.$mode === "dark" ? tws`tu-spinner--dark` : null}
|
|
152
152
|
${getSpinnerStyles()}
|
|
153
153
|
`;
|
|
154
|
-
const Container$
|
|
154
|
+
const Container$9 = tw.div`
|
|
155
155
|
tu-spinner--container
|
|
156
156
|
${p => p.$centered ? tws`tu-spinner--container-centered` : null}
|
|
157
157
|
`;
|
|
@@ -287,12 +287,20 @@ const IconButton = React.forwardRef((_a, ref) => {
|
|
|
287
287
|
disabled: disabled || loading,
|
|
288
288
|
ref: ref
|
|
289
289
|
}, rest, {
|
|
290
|
-
children:
|
|
290
|
+
children: jsx(IconContainer$2, {
|
|
291
|
+
children: loading ? jsx(Spinner, {
|
|
292
|
+
size: size
|
|
293
|
+
}) : icon
|
|
294
|
+
})
|
|
291
295
|
}));
|
|
292
296
|
});
|
|
293
297
|
const StyledButton = tw(Button)`
|
|
294
298
|
${p => p.$circular ? tws`tu-button--rounded` : null}
|
|
295
299
|
`;
|
|
300
|
+
const IconContainer$2 = tw.div`
|
|
301
|
+
tu-button__container
|
|
302
|
+
${p => p.$size === "small" ? tws`tu-button__container--small` : null}
|
|
303
|
+
`;
|
|
296
304
|
|
|
297
305
|
/**
|
|
298
306
|
* ? A collection of all the types and tokens related to the named colors in the default theme.
|
|
@@ -465,6 +473,69 @@ const Root$3 = tw.span`
|
|
|
465
473
|
}}
|
|
466
474
|
`;
|
|
467
475
|
|
|
476
|
+
/**
|
|
477
|
+
* The ActionButton component is a wrapper over IconButton to perform an action when the onClick event is triggered.
|
|
478
|
+
*
|
|
479
|
+
* @param {ActionButtonProps} props - The props for the ActionButton component
|
|
480
|
+
* @returns {JSX.Element} ActionButton component
|
|
481
|
+
*/
|
|
482
|
+
|
|
483
|
+
const ActionButton = ({
|
|
484
|
+
type,
|
|
485
|
+
value
|
|
486
|
+
}) => {
|
|
487
|
+
const getIconName = () => {
|
|
488
|
+
switch (type) {
|
|
489
|
+
case "PHONE_NUMBER":
|
|
490
|
+
return "PhoneOutgoingIcon";
|
|
491
|
+
|
|
492
|
+
case "WEB_ADDRESS":
|
|
493
|
+
return "ExternalLinkIcon";
|
|
494
|
+
|
|
495
|
+
case "EMAIL":
|
|
496
|
+
default:
|
|
497
|
+
return "MailIcon";
|
|
498
|
+
}
|
|
499
|
+
};
|
|
500
|
+
|
|
501
|
+
const ButtonAction = () => {
|
|
502
|
+
switch (type) {
|
|
503
|
+
case "EMAIL":
|
|
504
|
+
return window.open(`mailto:${value}`);
|
|
505
|
+
|
|
506
|
+
case "WEB_ADDRESS":
|
|
507
|
+
if (value) {
|
|
508
|
+
return window.open(value, "_blank", "noopener,noreferrer");
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
return null;
|
|
512
|
+
|
|
513
|
+
case "PHONE_NUMBER":
|
|
514
|
+
default:
|
|
515
|
+
return window.open(`tel:${value}`);
|
|
516
|
+
}
|
|
517
|
+
};
|
|
518
|
+
|
|
519
|
+
return jsx(ActionContainer, {
|
|
520
|
+
children: jsx(StyledIconButton, {
|
|
521
|
+
dataTestId: "testIconButtonId",
|
|
522
|
+
size: "small",
|
|
523
|
+
intent: "tertiary",
|
|
524
|
+
icon: jsx(Icon$1, {
|
|
525
|
+
size: "small",
|
|
526
|
+
name: getIconName()
|
|
527
|
+
}),
|
|
528
|
+
onClick: ButtonAction
|
|
529
|
+
})
|
|
530
|
+
});
|
|
531
|
+
};
|
|
532
|
+
const ActionContainer = tw.div`
|
|
533
|
+
tu-action-container
|
|
534
|
+
`;
|
|
535
|
+
const StyledIconButton = tw(IconButton)`
|
|
536
|
+
tu-action-button
|
|
537
|
+
`;
|
|
538
|
+
|
|
468
539
|
/**
|
|
469
540
|
* The StarButton component is used for favorite actions or similar.
|
|
470
541
|
*
|
|
@@ -683,7 +754,7 @@ const Alert = ({
|
|
|
683
754
|
ref && ref.current && ref.current.scrollIntoView && ref.current.scrollIntoView();
|
|
684
755
|
}
|
|
685
756
|
}, [ref, autoScroll]);
|
|
686
|
-
return jsxs(Container$
|
|
757
|
+
return jsxs(Container$8, Object.assign({
|
|
687
758
|
"$intent": intent,
|
|
688
759
|
className: className,
|
|
689
760
|
"data-testid": dataTestId,
|
|
@@ -771,7 +842,7 @@ const getBackgroundColor = () => ({
|
|
|
771
842
|
return colors[$intent];
|
|
772
843
|
};
|
|
773
844
|
|
|
774
|
-
const Container$
|
|
845
|
+
const Container$8 = tw.div`
|
|
775
846
|
tu-alert
|
|
776
847
|
${p => p.$inline ? tws`tu-alert--inline` : null}
|
|
777
848
|
${getBackgroundColor()}
|
|
@@ -900,7 +971,7 @@ const BaseInput = React.forwardRef((_a, ref) => {
|
|
|
900
971
|
} = _a,
|
|
901
972
|
rest = __rest(_a, ["className", "isInvalid", "dataTestId", "prefix", "suffix", "addonBefore", "addonAfter", "actions", "fieldSize"]);
|
|
902
973
|
|
|
903
|
-
return jsxs(InputContainer, Object.assign({
|
|
974
|
+
return jsxs(InputContainer$1, Object.assign({
|
|
904
975
|
"$fieldSize": fieldSize,
|
|
905
976
|
"$invalid": isInvalid,
|
|
906
977
|
"$disabled": rest.disabled || rest.readOnly,
|
|
@@ -942,7 +1013,7 @@ const AddonBefore = tw.div`
|
|
|
942
1013
|
const AddonAfter = tw.div`
|
|
943
1014
|
tu-input__addon-after
|
|
944
1015
|
`;
|
|
945
|
-
const InputContainer = tw.div`
|
|
1016
|
+
const InputContainer$1 = tw.div`
|
|
946
1017
|
tu-input
|
|
947
1018
|
${({
|
|
948
1019
|
$invalid
|
|
@@ -1259,7 +1330,7 @@ const CardHeader = ({
|
|
|
1259
1330
|
className: className,
|
|
1260
1331
|
"$density": density
|
|
1261
1332
|
}, {
|
|
1262
|
-
children: jsxs(Container$
|
|
1333
|
+
children: jsxs(Container$7, {
|
|
1263
1334
|
children: [jsxs("div", {
|
|
1264
1335
|
children: [jsxs(HeadingContainer, {
|
|
1265
1336
|
children: [jsx(Heading, Object.assign({
|
|
@@ -1289,7 +1360,7 @@ const CardHeader = ({
|
|
|
1289
1360
|
const BottomBorderedDensityContainer = tw(DensityContainer)`
|
|
1290
1361
|
tu-card__header-density-container
|
|
1291
1362
|
`;
|
|
1292
|
-
const Container$
|
|
1363
|
+
const Container$7 = tw.div`
|
|
1293
1364
|
tu-card__header
|
|
1294
1365
|
`;
|
|
1295
1366
|
const HeadingContainer = tw.div`
|
|
@@ -1404,6 +1475,44 @@ const ChartContainer = tw.div`
|
|
|
1404
1475
|
tu-chart-container
|
|
1405
1476
|
`;
|
|
1406
1477
|
|
|
1478
|
+
/**
|
|
1479
|
+
* The Label component is used for labels for input fields.
|
|
1480
|
+
* This component is **not used directly**, but is part of the FormGroup and Field components.
|
|
1481
|
+
*
|
|
1482
|
+
* @param {LabelProps} props - The props for the Label component
|
|
1483
|
+
* @returns {JSX.Element} Label component
|
|
1484
|
+
*/
|
|
1485
|
+
|
|
1486
|
+
const Label$3 = ({
|
|
1487
|
+
id,
|
|
1488
|
+
htmlFor,
|
|
1489
|
+
children,
|
|
1490
|
+
className,
|
|
1491
|
+
dataTestId,
|
|
1492
|
+
disabled,
|
|
1493
|
+
isInvalid
|
|
1494
|
+
}) => {
|
|
1495
|
+
return jsx(Root$2, Object.assign({
|
|
1496
|
+
id: id || "",
|
|
1497
|
+
htmlFor: htmlFor || "",
|
|
1498
|
+
className: className,
|
|
1499
|
+
"data-testid": dataTestId,
|
|
1500
|
+
"$disabled": disabled,
|
|
1501
|
+
"$isInvalid": isInvalid
|
|
1502
|
+
}, {
|
|
1503
|
+
children: children
|
|
1504
|
+
}));
|
|
1505
|
+
};
|
|
1506
|
+
const Root$2 = tw.label`
|
|
1507
|
+
tu-label
|
|
1508
|
+
${({
|
|
1509
|
+
$disabled
|
|
1510
|
+
}) => $disabled && tws`tu-label--disabled`}
|
|
1511
|
+
${({
|
|
1512
|
+
$isInvalid
|
|
1513
|
+
}) => $isInvalid && tws`tu-label--invalid`}
|
|
1514
|
+
`;
|
|
1515
|
+
|
|
1407
1516
|
/**
|
|
1408
1517
|
* The CheckIcon component is used by the checkbox to display the checked state.
|
|
1409
1518
|
*
|
|
@@ -1518,35 +1627,31 @@ const Checkbox = React.forwardRef((_a, ref) => {
|
|
|
1518
1627
|
}, rest, {
|
|
1519
1628
|
ref: ref
|
|
1520
1629
|
})), jsx(CheckboxWrapper, Object.assign({
|
|
1630
|
+
id: uuid,
|
|
1521
1631
|
"$disabled": isReadonly,
|
|
1522
1632
|
"$checked": checked,
|
|
1523
1633
|
"$indeterminate": indeterminate,
|
|
1524
1634
|
"$isInvalid": isReadonly ? false : isInvalid,
|
|
1525
|
-
className: className,
|
|
1526
1635
|
tabIndex: isReadonly ? -1 : tabIndex,
|
|
1527
1636
|
onKeyPress: onKeyPress
|
|
1528
1637
|
}, {
|
|
1529
1638
|
children: icon
|
|
1530
|
-
})), label && jsx(Label$
|
|
1531
|
-
ref: internalRef,
|
|
1639
|
+
})), label && jsx(Label$3, Object.assign({
|
|
1532
1640
|
htmlFor: uuid,
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1641
|
+
disabled: isReadonly,
|
|
1642
|
+
isInvalid: isReadonly ? false : isInvalid,
|
|
1643
|
+
dataTestId: `${dataTestId}-Label`
|
|
1536
1644
|
}, {
|
|
1537
1645
|
children: label
|
|
1538
1646
|
})), children]
|
|
1539
1647
|
}));
|
|
1540
1648
|
});
|
|
1541
|
-
const StyledCheckIcon = tw(CheckIcon)`
|
|
1542
|
-
|
|
1543
|
-
`;
|
|
1544
|
-
const
|
|
1545
|
-
tu-checkbox--icon
|
|
1546
|
-
`;
|
|
1649
|
+
const StyledCheckIcon = tw(CheckIcon)`tu-checkbox--icon`;
|
|
1650
|
+
const StyledIndeterminateIcon = tw(IndeterminateIcon)`tu-checkbox--icon`;
|
|
1651
|
+
const CheckboxContainer = tw.label`tu-checkbox--container group`;
|
|
1652
|
+
const HiddenInput$1 = tw.input`tu-checkbox--input`;
|
|
1547
1653
|
const CheckboxWrapper = tw.span`
|
|
1548
1654
|
tu-checkbox
|
|
1549
|
-
transition
|
|
1550
1655
|
${({
|
|
1551
1656
|
$checked,
|
|
1552
1657
|
$disabled,
|
|
@@ -1561,28 +1666,7 @@ const CheckboxWrapper = tw.span`
|
|
|
1561
1666
|
|
|
1562
1667
|
${({
|
|
1563
1668
|
$isInvalid
|
|
1564
|
-
}) =>
|
|
1565
|
-
if ($isInvalid) {
|
|
1566
|
-
return tws`tu-checkbox--invalid`;
|
|
1567
|
-
}
|
|
1568
|
-
|
|
1569
|
-
return tws``;
|
|
1570
|
-
}}
|
|
1571
|
-
`;
|
|
1572
|
-
const HiddenInput$1 = tw.input`
|
|
1573
|
-
tu-checkbox--input
|
|
1574
|
-
`;
|
|
1575
|
-
const CheckboxContainer = tw.label`
|
|
1576
|
-
tu-checkbox--container group
|
|
1577
|
-
`;
|
|
1578
|
-
const Label$6 = tw.label`
|
|
1579
|
-
tu-checkbox__label
|
|
1580
|
-
${({
|
|
1581
|
-
$disabled
|
|
1582
|
-
}) => $disabled ? tws`tu-checkbox-item--disabled` : null}
|
|
1583
|
-
${({
|
|
1584
|
-
$isInvalid
|
|
1585
|
-
}) => $isInvalid ? tws`tu-checkbox--invalid` : null}
|
|
1669
|
+
}) => $isInvalid && tws`tu-checkbox--invalid`}
|
|
1586
1670
|
`;
|
|
1587
1671
|
|
|
1588
1672
|
/**
|
|
@@ -1619,7 +1703,7 @@ const Collapse = ({
|
|
|
1619
1703
|
"aria-controls": id,
|
|
1620
1704
|
onClick: handleClick
|
|
1621
1705
|
}, {
|
|
1622
|
-
children: jsxs(LabelContainer, {
|
|
1706
|
+
children: jsxs(LabelContainer$2, {
|
|
1623
1707
|
children: [jsx(Text, Object.assign({
|
|
1624
1708
|
weight: "bold"
|
|
1625
1709
|
}, {
|
|
@@ -1653,7 +1737,7 @@ const StyledCollapse = tw.div`
|
|
|
1653
1737
|
const CollapseLabel = tw.div`
|
|
1654
1738
|
tu-collapse__label
|
|
1655
1739
|
`;
|
|
1656
|
-
const LabelContainer = tw.div`
|
|
1740
|
+
const LabelContainer$2 = tw.div`
|
|
1657
1741
|
tu-collapse__label__container
|
|
1658
1742
|
`;
|
|
1659
1743
|
|
|
@@ -2087,34 +2171,6 @@ const RemoveValueContainer = tw.div`
|
|
|
2087
2171
|
tu-date__remove
|
|
2088
2172
|
`;
|
|
2089
2173
|
|
|
2090
|
-
/**
|
|
2091
|
-
* The Label component is used for labels for input fields.
|
|
2092
|
-
* This component is **not used directly**, but is part of the FormGroup and Field components.
|
|
2093
|
-
*
|
|
2094
|
-
* @param {LabelProps} props - The props for the Label component
|
|
2095
|
-
* @returns {JSX.Element} Label component
|
|
2096
|
-
*/
|
|
2097
|
-
|
|
2098
|
-
const Label$5 = ({
|
|
2099
|
-
id,
|
|
2100
|
-
htmlFor,
|
|
2101
|
-
children,
|
|
2102
|
-
className,
|
|
2103
|
-
dataTestId
|
|
2104
|
-
}) => {
|
|
2105
|
-
return jsx(Root$2, Object.assign({
|
|
2106
|
-
className: className,
|
|
2107
|
-
id: id,
|
|
2108
|
-
"data-testid": dataTestId,
|
|
2109
|
-
htmlFor: htmlFor
|
|
2110
|
-
}, {
|
|
2111
|
-
children: children
|
|
2112
|
-
}));
|
|
2113
|
-
};
|
|
2114
|
-
const Root$2 = tw.label`
|
|
2115
|
-
tu-label
|
|
2116
|
-
`;
|
|
2117
|
-
|
|
2118
2174
|
/**
|
|
2119
2175
|
* The PopoverListItem component.
|
|
2120
2176
|
*
|
|
@@ -2191,7 +2247,7 @@ const PopoverTitle = ({
|
|
|
2191
2247
|
className,
|
|
2192
2248
|
dataTestId
|
|
2193
2249
|
}) => {
|
|
2194
|
-
return jsxs(Container$
|
|
2250
|
+
return jsxs(Container$6, Object.assign({
|
|
2195
2251
|
"$divider": divider,
|
|
2196
2252
|
className: className,
|
|
2197
2253
|
"data-testid": dataTestId
|
|
@@ -2207,7 +2263,7 @@ const PopoverTitle = ({
|
|
|
2207
2263
|
})), action]
|
|
2208
2264
|
}));
|
|
2209
2265
|
};
|
|
2210
|
-
const Container$
|
|
2266
|
+
const Container$6 = tw.div`
|
|
2211
2267
|
tu-popover-title-container
|
|
2212
2268
|
${p => p.$divider && `tu-popover-title-container--divider`}
|
|
2213
2269
|
`;
|
|
@@ -2256,7 +2312,7 @@ const Tooltip = ({
|
|
|
2256
2312
|
"data-testid": dataTestId && `${dataTestId}-parent`
|
|
2257
2313
|
}, {
|
|
2258
2314
|
children: children
|
|
2259
|
-
})), !disabled && jsx(Container$
|
|
2315
|
+
})), !disabled && jsx(Container$5, Object.assign({
|
|
2260
2316
|
ref: popoverRef,
|
|
2261
2317
|
onRequestClose: onHide,
|
|
2262
2318
|
enterDelay: 450
|
|
@@ -2280,7 +2336,7 @@ const Tooltip = ({
|
|
|
2280
2336
|
const Flex$1 = tw.div`
|
|
2281
2337
|
inline-flex
|
|
2282
2338
|
`;
|
|
2283
|
-
const Container$
|
|
2339
|
+
const Container$5 = tw(AnimatedPopover)`
|
|
2284
2340
|
tu-tooltip__container
|
|
2285
2341
|
`;
|
|
2286
2342
|
const Content = tw.div`
|
|
@@ -2350,7 +2406,7 @@ const FormGroup = ({
|
|
|
2350
2406
|
"data-testid": dataTestId
|
|
2351
2407
|
}, {
|
|
2352
2408
|
children: [jsxs(ContainerBefore, {
|
|
2353
|
-
children: [jsx(Label$
|
|
2409
|
+
children: [jsx(Label$3, Object.assign({
|
|
2354
2410
|
"data-testid": `${dataTestId}-label`
|
|
2355
2411
|
}, {
|
|
2356
2412
|
children: label
|
|
@@ -2566,7 +2622,7 @@ const Indicator$1 = _a => {
|
|
|
2566
2622
|
} = _a,
|
|
2567
2623
|
rest = __rest(_a, ["dataTestId", "icon", "label", "color", "withBackground"]);
|
|
2568
2624
|
|
|
2569
|
-
return jsxs(Container$
|
|
2625
|
+
return jsxs(Container$4, Object.assign({
|
|
2570
2626
|
"$color": color,
|
|
2571
2627
|
"data-testid": dataTestId
|
|
2572
2628
|
}, rest, {
|
|
@@ -2575,14 +2631,14 @@ const Indicator$1 = _a => {
|
|
|
2575
2631
|
"$withBackground": withBackground
|
|
2576
2632
|
}, {
|
|
2577
2633
|
children: icon
|
|
2578
|
-
})), label !== undefined && jsx(Label$
|
|
2634
|
+
})), label !== undefined && jsx(Label$2, Object.assign({
|
|
2579
2635
|
"data-testid": dataTestId ? `${dataTestId}-label` : "indicator-label"
|
|
2580
2636
|
}, {
|
|
2581
2637
|
children: label
|
|
2582
2638
|
}))]
|
|
2583
2639
|
}));
|
|
2584
2640
|
};
|
|
2585
|
-
const Container$
|
|
2641
|
+
const Container$4 = tw.div`
|
|
2586
2642
|
tu-indicator
|
|
2587
2643
|
${({
|
|
2588
2644
|
$color
|
|
@@ -2644,7 +2700,7 @@ const IconBackground = tw.div`
|
|
|
2644
2700
|
return $withBackground ? "" : "tu-indicator__icon-background--none";
|
|
2645
2701
|
}}
|
|
2646
2702
|
`;
|
|
2647
|
-
const Label$
|
|
2703
|
+
const Label$2 = tw.div`
|
|
2648
2704
|
tu-indicator__label
|
|
2649
2705
|
`;
|
|
2650
2706
|
|
|
@@ -2676,7 +2732,7 @@ const LegendItem = ({
|
|
|
2676
2732
|
style: {
|
|
2677
2733
|
backgroundColor: color
|
|
2678
2734
|
}
|
|
2679
|
-
}), jsx(Label$
|
|
2735
|
+
}), jsx(Label$1, {
|
|
2680
2736
|
children: label
|
|
2681
2737
|
})]
|
|
2682
2738
|
}));
|
|
@@ -2699,7 +2755,7 @@ const Indicator = tw.span`
|
|
|
2699
2755
|
rounded-[50%]
|
|
2700
2756
|
mr-2
|
|
2701
2757
|
`;
|
|
2702
|
-
const Label$
|
|
2758
|
+
const Label$1 = tw.span`
|
|
2703
2759
|
text-sm
|
|
2704
2760
|
`;
|
|
2705
2761
|
|
|
@@ -2712,7 +2768,8 @@ const Label$3 = tw.span`
|
|
|
2712
2768
|
|
|
2713
2769
|
const MenuButton = ({
|
|
2714
2770
|
onClick,
|
|
2715
|
-
className
|
|
2771
|
+
className,
|
|
2772
|
+
dataTestId
|
|
2716
2773
|
}) => {
|
|
2717
2774
|
return jsx(MobileIconButton, {
|
|
2718
2775
|
icon: jsx(Icon$1, {
|
|
@@ -2722,7 +2779,8 @@ const MenuButton = ({
|
|
|
2722
2779
|
size: "small",
|
|
2723
2780
|
circular: true,
|
|
2724
2781
|
onClick: onClick,
|
|
2725
|
-
className: className
|
|
2782
|
+
className: className,
|
|
2783
|
+
"data-testid": dataTestId
|
|
2726
2784
|
});
|
|
2727
2785
|
};
|
|
2728
2786
|
const MobileIconButton = tw(IconButton)`
|
|
@@ -2759,7 +2817,7 @@ const MenuItem = ({
|
|
|
2759
2817
|
className,
|
|
2760
2818
|
dataTestId
|
|
2761
2819
|
});
|
|
2762
|
-
return jsxs(Container$
|
|
2820
|
+
return jsxs(Container$3, Object.assign({}, containerProps, {
|
|
2763
2821
|
onClick: e => {
|
|
2764
2822
|
e.stopPropagation();
|
|
2765
2823
|
onClick && onClick(e);
|
|
@@ -2770,21 +2828,23 @@ const MenuItem = ({
|
|
|
2770
2828
|
"$disabled": disabled
|
|
2771
2829
|
}, {
|
|
2772
2830
|
children: [prefix && jsx(Prefix, Object.assign({
|
|
2773
|
-
"$selected": selected
|
|
2831
|
+
"$selected": selected,
|
|
2832
|
+
"data-testid": `${dataTestId}-prefix`
|
|
2774
2833
|
}, {
|
|
2775
2834
|
children: prefix
|
|
2776
|
-
})), jsx(Label
|
|
2777
|
-
"data-testid": dataTestId
|
|
2835
|
+
})), jsx(Label, Object.assign({
|
|
2836
|
+
"data-testid": `${dataTestId}-label`
|
|
2778
2837
|
}, {
|
|
2779
2838
|
children: label
|
|
2780
2839
|
})), icon && jsx(Icon, Object.assign({
|
|
2781
|
-
"$selected": selected
|
|
2840
|
+
"$selected": selected,
|
|
2841
|
+
"data-testid": `${dataTestId}-icon`
|
|
2782
2842
|
}, {
|
|
2783
2843
|
children: icon
|
|
2784
2844
|
}))]
|
|
2785
2845
|
}));
|
|
2786
2846
|
};
|
|
2787
|
-
const Container$
|
|
2847
|
+
const Container$3 = tw.div`
|
|
2788
2848
|
group tu-menu-item
|
|
2789
2849
|
${({
|
|
2790
2850
|
$selected
|
|
@@ -2809,7 +2869,7 @@ const Prefix = tw.div`
|
|
|
2809
2869
|
$selected
|
|
2810
2870
|
}) => $selected ? tws`tu-menu-item__prefix--selected ` : ""}
|
|
2811
2871
|
`;
|
|
2812
|
-
const Label
|
|
2872
|
+
const Label = tw.div`
|
|
2813
2873
|
tu-menu-item__label
|
|
2814
2874
|
`;
|
|
2815
2875
|
|
|
@@ -2835,7 +2895,7 @@ const MenuList = _a => {
|
|
|
2835
2895
|
dataTestId
|
|
2836
2896
|
}, args));
|
|
2837
2897
|
return jsx(Wrapper, {
|
|
2838
|
-
children: jsx(Container$
|
|
2898
|
+
children: jsx(Container$2, Object.assign({}, containerProps, {
|
|
2839
2899
|
style: width ? {
|
|
2840
2900
|
width
|
|
2841
2901
|
} : undefined,
|
|
@@ -2857,7 +2917,7 @@ const MenuList = _a => {
|
|
|
2857
2917
|
const Wrapper = tw.div`
|
|
2858
2918
|
tu-menu-list__wrapper
|
|
2859
2919
|
`;
|
|
2860
|
-
const Container$
|
|
2920
|
+
const Container$2 = tw.div`
|
|
2861
2921
|
tu-menu-list
|
|
2862
2922
|
`;
|
|
2863
2923
|
const Divider = tw.div`
|
|
@@ -3420,65 +3480,58 @@ const RadioItem = ({
|
|
|
3420
3480
|
const groupCtx = React.useContext(RadioGroupContext);
|
|
3421
3481
|
const isChecked = (groupCtx === null || groupCtx === void 0 ? void 0 : groupCtx.value) === value;
|
|
3422
3482
|
const uuid = v4();
|
|
3423
|
-
return jsxs(
|
|
3424
|
-
className: className
|
|
3483
|
+
return jsxs(InputWrapper, Object.assign({
|
|
3484
|
+
className: className,
|
|
3485
|
+
htmlFor: `${groupCtx === null || groupCtx === void 0 ? void 0 : groupCtx.id} ${uuid}`,
|
|
3486
|
+
"data-testid": `${dataTestId}-Wrapper`
|
|
3425
3487
|
}, {
|
|
3426
|
-
children: [
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
htmlFor: uuid
|
|
3439
|
-
|
|
3440
|
-
|
|
3488
|
+
children: [jsx(Input, {
|
|
3489
|
+
id: `${groupCtx === null || groupCtx === void 0 ? void 0 : groupCtx.id} ${uuid}`,
|
|
3490
|
+
type: "radio",
|
|
3491
|
+
value: value,
|
|
3492
|
+
checked: isChecked,
|
|
3493
|
+
"$disabled": groupCtx === null || groupCtx === void 0 ? void 0 : groupCtx.disabled,
|
|
3494
|
+
"$isInvalid": groupCtx === null || groupCtx === void 0 ? void 0 : groupCtx.isInvalid,
|
|
3495
|
+
onChange: groupCtx === null || groupCtx === void 0 ? void 0 : groupCtx.onChange,
|
|
3496
|
+
"data-testid": dataTestId,
|
|
3497
|
+
"$checked": isChecked
|
|
3498
|
+
}), jsxs(LabelContainer$1, {
|
|
3499
|
+
children: [jsx(Label$3, Object.assign({
|
|
3500
|
+
htmlFor: `${groupCtx === null || groupCtx === void 0 ? void 0 : groupCtx.id} ${uuid}`,
|
|
3501
|
+
dataTestId: `${dataTestId}-Label`,
|
|
3502
|
+
disabled: groupCtx === null || groupCtx === void 0 ? void 0 : groupCtx.disabled,
|
|
3503
|
+
isInvalid: groupCtx === null || groupCtx === void 0 ? void 0 : groupCtx.isInvalid
|
|
3441
3504
|
}, {
|
|
3442
3505
|
children: label
|
|
3506
|
+
})), description && jsx(Description$1, Object.assign({
|
|
3507
|
+
htmlFor: `${groupCtx === null || groupCtx === void 0 ? void 0 : groupCtx.id} ${uuid}`,
|
|
3508
|
+
"data-testid": `${dataTestId}-Description`,
|
|
3509
|
+
"$disabled": groupCtx === null || groupCtx === void 0 ? void 0 : groupCtx.disabled
|
|
3510
|
+
}, {
|
|
3511
|
+
children: description
|
|
3443
3512
|
}))]
|
|
3444
|
-
})
|
|
3445
|
-
htmlFor: uuid,
|
|
3446
|
-
"$disabled": groupCtx === null || groupCtx === void 0 ? void 0 : groupCtx.disabled,
|
|
3447
|
-
"$isInvalid": groupCtx === null || groupCtx === void 0 ? void 0 : groupCtx.isInvalid
|
|
3448
|
-
}, {
|
|
3449
|
-
children: description
|
|
3450
|
-
}))]
|
|
3513
|
+
})]
|
|
3451
3514
|
}));
|
|
3452
3515
|
};
|
|
3453
|
-
const
|
|
3454
|
-
tu-radioitem__custom-flex
|
|
3455
|
-
`;
|
|
3456
|
-
const InputWrapper = tw.div`
|
|
3457
|
-
tu-radioitem__wrapper
|
|
3458
|
-
`;
|
|
3516
|
+
const InputWrapper = tw.label`tu-radioitem__wrapper`;
|
|
3459
3517
|
const Input = tw.input`
|
|
3460
3518
|
tu-radioitem
|
|
3461
3519
|
${({
|
|
3462
3520
|
$checked
|
|
3463
|
-
}) => $checked
|
|
3521
|
+
}) => $checked && tws`tu-radioitem--checked`}
|
|
3464
3522
|
${({
|
|
3465
3523
|
$disabled
|
|
3466
|
-
}) => $disabled
|
|
3524
|
+
}) => $disabled && tws`tu-radioitem--disabled`}
|
|
3467
3525
|
${({
|
|
3468
3526
|
$isInvalid
|
|
3469
|
-
}) => $isInvalid
|
|
3470
|
-
`;
|
|
3471
|
-
const Label$1 = tw.label`
|
|
3472
|
-
tu-radioitem__label
|
|
3473
|
-
${({
|
|
3474
|
-
$isInvalid
|
|
3475
|
-
}) => $isInvalid ? tws`tu-radioitem__label--invalid` : tws``}
|
|
3476
|
-
${({
|
|
3477
|
-
$disabled
|
|
3478
|
-
}) => $disabled ? tws`tu-radioitem__label--disabled` : tws``}
|
|
3527
|
+
}) => $isInvalid && tws`tu-radioitem--invalid`}
|
|
3479
3528
|
`;
|
|
3529
|
+
const LabelContainer$1 = tw.div`tu-radioitem__label-container`;
|
|
3480
3530
|
const Description$1 = tw.label`
|
|
3481
3531
|
tu-radioitem__description
|
|
3532
|
+
${({
|
|
3533
|
+
$disabled
|
|
3534
|
+
}) => $disabled && tws`tu-radioitem__description--disabled`}
|
|
3482
3535
|
`;
|
|
3483
3536
|
|
|
3484
3537
|
/**
|
|
@@ -3500,12 +3553,12 @@ const SelectContainer$1 = ({
|
|
|
3500
3553
|
dataTestId,
|
|
3501
3554
|
isDisabled
|
|
3502
3555
|
}) => {
|
|
3503
|
-
return jsxs(Container$
|
|
3556
|
+
return jsxs(Container$1, Object.assign({
|
|
3504
3557
|
"data-testid": dataTestId,
|
|
3505
3558
|
"$hasError": hasError,
|
|
3506
3559
|
"$isDisabled": isDisabled
|
|
3507
3560
|
}, {
|
|
3508
|
-
children: [label && !hideLabel && jsx(Label$
|
|
3561
|
+
children: [label && !hideLabel && jsx(Label$3, Object.assign({
|
|
3509
3562
|
htmlFor: id
|
|
3510
3563
|
}, {
|
|
3511
3564
|
children: label
|
|
@@ -3517,7 +3570,7 @@ const SelectContainer$1 = ({
|
|
|
3517
3570
|
}))]
|
|
3518
3571
|
}));
|
|
3519
3572
|
};
|
|
3520
|
-
const Container$
|
|
3573
|
+
const Container$1 = tw.label`
|
|
3521
3574
|
tu-select__container
|
|
3522
3575
|
tu-select
|
|
3523
3576
|
${({
|
|
@@ -3597,7 +3650,8 @@ const SingleSelectMenuItem = ({
|
|
|
3597
3650
|
onClick,
|
|
3598
3651
|
selected,
|
|
3599
3652
|
dataTestId,
|
|
3600
|
-
focused
|
|
3653
|
+
focused,
|
|
3654
|
+
disabled
|
|
3601
3655
|
}) => {
|
|
3602
3656
|
return jsx(MenuItem, {
|
|
3603
3657
|
dataTestId: dataTestId,
|
|
@@ -3605,6 +3659,7 @@ const SingleSelectMenuItem = ({
|
|
|
3605
3659
|
prefix: icon,
|
|
3606
3660
|
onClick: onClick,
|
|
3607
3661
|
selected: selected,
|
|
3662
|
+
disabled: disabled,
|
|
3608
3663
|
focused: focused,
|
|
3609
3664
|
icon: selected ? jsx(Icon$1, {
|
|
3610
3665
|
name: "CheckIcon",
|
|
@@ -3775,7 +3830,7 @@ const TagsContainer = ({
|
|
|
3775
3830
|
|
|
3776
3831
|
return null;
|
|
3777
3832
|
}).filter(element => element !== null);
|
|
3778
|
-
return jsxs(Container
|
|
3833
|
+
return jsxs(Container, Object.assign({
|
|
3779
3834
|
style: {
|
|
3780
3835
|
width: `${width}`
|
|
3781
3836
|
},
|
|
@@ -3785,7 +3840,7 @@ const TagsContainer = ({
|
|
|
3785
3840
|
children: [renderedElements, postFix]
|
|
3786
3841
|
}));
|
|
3787
3842
|
};
|
|
3788
|
-
const Container
|
|
3843
|
+
const Container = tw.div`
|
|
3789
3844
|
tu-select__dynamic-tag--container
|
|
3790
3845
|
${({
|
|
3791
3846
|
$ready
|
|
@@ -3886,7 +3941,7 @@ const useCustomComponents = (componentsProps, disabled, menuIsClosing, refMenuIs
|
|
|
3886
3941
|
});
|
|
3887
3942
|
},
|
|
3888
3943
|
DropdownIndicator: props => {
|
|
3889
|
-
return jsx(components.DropdownIndicator, Object.assign({}, props, {
|
|
3944
|
+
return props.selectProps.isLoading ? null : jsx(components.DropdownIndicator, Object.assign({}, props, {
|
|
3890
3945
|
children: jsx(StyledIcon, {
|
|
3891
3946
|
children: dropdownIcon ? dropdownIcon : menuIsClosing ? jsx(Icon$1, {
|
|
3892
3947
|
name: "ChevronDownIcon",
|
|
@@ -3937,15 +3992,6 @@ const useCustomComponents = (componentsProps, disabled, menuIsClosing, refMenuIs
|
|
|
3937
3992
|
className: menuIsClosing ? tws`tu-menu-list animate-fade-out-fast` : tws`tu-menu-list animate-fade-in-fast`
|
|
3938
3993
|
}));
|
|
3939
3994
|
},
|
|
3940
|
-
MenuList: props => {
|
|
3941
|
-
return jsx(components.MenuList, Object.assign({}, props, {
|
|
3942
|
-
children: jsx(Container, Object.assign({
|
|
3943
|
-
"$disabled": disabled
|
|
3944
|
-
}, {
|
|
3945
|
-
children: props.children
|
|
3946
|
-
}))
|
|
3947
|
-
}));
|
|
3948
|
-
},
|
|
3949
3995
|
Option: props => {
|
|
3950
3996
|
const componentProps = {
|
|
3951
3997
|
label: props.label,
|
|
@@ -3962,6 +4008,7 @@ const useCustomComponents = (componentsProps, disabled, menuIsClosing, refMenuIs
|
|
|
3962
4008
|
disabled: disabled,
|
|
3963
4009
|
dataTestId: props.label
|
|
3964
4010
|
})) : jsx(SingleSelectMenuItem, Object.assign({}, componentProps, {
|
|
4011
|
+
disabled: disabled,
|
|
3965
4012
|
dataTestId: props.label
|
|
3966
4013
|
}))
|
|
3967
4014
|
}));
|
|
@@ -3971,14 +4018,6 @@ const useCustomComponents = (componentsProps, disabled, menuIsClosing, refMenuIs
|
|
|
3971
4018
|
|
|
3972
4019
|
return customComponents;
|
|
3973
4020
|
};
|
|
3974
|
-
const Container = tw.div`
|
|
3975
|
-
tu-select__menu
|
|
3976
|
-
${({
|
|
3977
|
-
$disabled
|
|
3978
|
-
}) => {
|
|
3979
|
-
return $disabled ? tws`pointer-events-none` : "";
|
|
3980
|
-
}}
|
|
3981
|
-
`;
|
|
3982
4021
|
const StyledIcon = tw.div`
|
|
3983
4022
|
tu-select--icon
|
|
3984
4023
|
`;
|
|
@@ -4042,6 +4081,10 @@ const useCustomStyles = (refContainer, refPrefix, maxSelectedDisplayCount, style
|
|
|
4042
4081
|
}),
|
|
4043
4082
|
menuList: base => {
|
|
4044
4083
|
return Object.assign(Object.assign({}, base), {
|
|
4084
|
+
position: "relative",
|
|
4085
|
+
padding: "var(--spacing-1)",
|
|
4086
|
+
display: "grid",
|
|
4087
|
+
gap: "var(--spacing-1)",
|
|
4045
4088
|
width: "100%",
|
|
4046
4089
|
borderRadius: "0px",
|
|
4047
4090
|
boxShadow: "none",
|
|
@@ -4720,9 +4763,8 @@ const Toggle = React.forwardRef(({
|
|
|
4720
4763
|
description = ""
|
|
4721
4764
|
}, ref) => {
|
|
4722
4765
|
return jsxs(ToggleWrapper, {
|
|
4723
|
-
children: [jsxs(
|
|
4724
|
-
htmlFor: id
|
|
4725
|
-
"$description": description
|
|
4766
|
+
children: [jsxs(InputContainer, Object.assign({
|
|
4767
|
+
htmlFor: id
|
|
4726
4768
|
}, {
|
|
4727
4769
|
children: [jsx(HiddenInput, {
|
|
4728
4770
|
name: name,
|
|
@@ -4745,8 +4787,7 @@ const Toggle = React.forwardRef(({
|
|
|
4745
4787
|
"$toggled": toggled,
|
|
4746
4788
|
htmlFor: id,
|
|
4747
4789
|
"$disabled": disabled,
|
|
4748
|
-
"$size": size
|
|
4749
|
-
className: className
|
|
4790
|
+
"$size": size
|
|
4750
4791
|
}, {
|
|
4751
4792
|
children: jsx(Switch, {
|
|
4752
4793
|
"$toggled": toggled,
|
|
@@ -4754,19 +4795,17 @@ const Toggle = React.forwardRef(({
|
|
|
4754
4795
|
"data-testid": `${dataTestId}-Switch`
|
|
4755
4796
|
})
|
|
4756
4797
|
}))]
|
|
4757
|
-
})), jsxs(
|
|
4758
|
-
children: [jsx(Label, Object.assign({
|
|
4759
|
-
"$disabled": disabled,
|
|
4760
|
-
title: name,
|
|
4761
|
-
"$description": description,
|
|
4798
|
+
})), jsxs(LabelContainer, {
|
|
4799
|
+
children: [jsx(Label$3, Object.assign({
|
|
4762
4800
|
htmlFor: id,
|
|
4763
|
-
|
|
4801
|
+
dataTestId: `${dataTestId}-Label`,
|
|
4802
|
+
disabled: disabled
|
|
4764
4803
|
}, {
|
|
4765
4804
|
children: name
|
|
4766
|
-
})),
|
|
4767
|
-
|
|
4768
|
-
|
|
4769
|
-
"
|
|
4805
|
+
})), description && jsx(Description, Object.assign({
|
|
4806
|
+
htmlFor: id,
|
|
4807
|
+
"data-testid": `${dataTestId}-Description`,
|
|
4808
|
+
"$disabled": disabled
|
|
4770
4809
|
}, {
|
|
4771
4810
|
children: description
|
|
4772
4811
|
}))]
|
|
@@ -4775,11 +4814,7 @@ const Toggle = React.forwardRef(({
|
|
|
4775
4814
|
});
|
|
4776
4815
|
Toggle.displayName = "Toggle";
|
|
4777
4816
|
const ToggleWrapper = tw.div`tu-toggle__wrapper`;
|
|
4778
|
-
const
|
|
4779
|
-
tu-toggle__container
|
|
4780
|
-
${({
|
|
4781
|
-
$description
|
|
4782
|
-
}) => $description && tws`tu-toggle--align-bottom`}`;
|
|
4817
|
+
const InputContainer = tw.label`tu-toggle__input-container `;
|
|
4783
4818
|
const HiddenInput = tw.input`tu-toggle__input`;
|
|
4784
4819
|
const Switch = tw.label`
|
|
4785
4820
|
${({
|
|
@@ -4796,14 +4831,7 @@ tu-toggle__switch-container
|
|
|
4796
4831
|
${({
|
|
4797
4832
|
$toggled
|
|
4798
4833
|
}) => $toggled && tws`tu-toggle--toggled`}`;
|
|
4799
|
-
const
|
|
4800
|
-
tu-toggle__label
|
|
4801
|
-
${({
|
|
4802
|
-
$disabled
|
|
4803
|
-
}) => $disabled && tws`tu-toggle__label--disabled`}
|
|
4804
|
-
${({
|
|
4805
|
-
$description
|
|
4806
|
-
}) => $description && tws`tu-toggle--align-label`}`;
|
|
4834
|
+
const LabelContainer = tw.div`tu-toggle__label-container`;
|
|
4807
4835
|
const Description = tw.label`
|
|
4808
4836
|
tu-toggle__description
|
|
4809
4837
|
${({
|
|
@@ -5174,4 +5202,4 @@ const Layout = tw.div`
|
|
|
5174
5202
|
tu-layout-TwoColumnLayout
|
|
5175
5203
|
`;
|
|
5176
5204
|
|
|
5177
|
-
export { Alert, AnimatedPopover, Badge, BaseInput, Button, Card, CardBody, CardFooter, CardHeader, Chart, Checkbox, Collapse, CopyableText, CreatableSelect, DateField, DateInput, DayPicker, DayPickerPopover, DayRangePicker, DensityContainer, FilterListMapLayout, FormGroup, FullWidthRepeatingLayout, GridArea, Heading, Icon$1 as Icon, IconButton, Indicator$1 as Indicator, IntrinsicallyResponsiveGrid, Label$
|
|
5205
|
+
export { ActionButton, Alert, AnimatedPopover, Badge, BaseInput, Button, Card, CardBody, CardFooter, CardHeader, Chart, Checkbox, Collapse, CopyableText, CreatableSelect, DateField, DateInput, DayPicker, DayPickerPopover, DayRangePicker, DensityContainer, FilterListMapLayout, FormGroup, FullWidthRepeatingLayout, GridArea, Heading, Icon$1 as Icon, IconButton, Indicator$1 as Indicator, IntrinsicallyResponsiveGrid, Label$3 as Label, LegendItem, MenuButton, MenuItem, MenuList, MinTopFullContentLayout, Modal, ModalBackdrop, MultiSelectMenuItem, NumberField, NumberInput, PageHeading, PopoverLifecycle, PopoverList, PopoverListItem, PopoverTitle, Prompt, ROLE_CARD, RadioGroup, RadioItem, Select, SingleSelectMenuItem, SkeletonLines, Spacer, Spinner, StarButton, Tag, Text, TextArea, TextAreaField, TextField, TextInput, Timeline, TimelineElement, Tip, TitleNavContentLayout, Toggle, Tooltip, TwoColumnLayout, activityColors, colors, criticalityColors, docs, generalColors, getOrderedOptions, intentColors, isMultiValue, useContainerProps, useCustomComponents, useDebounce, useLocalStorage, useModal, usePopover, usePrompt, useTimeout };
|