@trackunit/react-components 0.0.74-alpha-e5eca93e1.0 → 0.0.77
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/RadioGroup/RadioGroup.d.ts +17 -4
- package/components/RadioGroup/RadioGroupContext.d.ts +1 -0
- package/components/RadioGroup/RadioItem.d.ts +5 -1
- package/components/Timeline/Timeline.d.ts +30 -0
- package/components/index.d.ts +1 -0
- package/index.js +175 -62
- package/package.json +8 -7
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { CommonProps } from "../../common/CommonProps";
|
|
3
|
-
interface RadioGroupProps extends CommonProps {
|
|
3
|
+
export interface RadioGroupProps extends CommonProps, React.InputHTMLAttributes<HTMLInputElement> {
|
|
4
4
|
/**
|
|
5
5
|
*/
|
|
6
6
|
children: React.ReactNode;
|
|
@@ -32,12 +32,25 @@ interface RadioGroupProps extends CommonProps {
|
|
|
32
32
|
* Whether the radio group is disabled or not.
|
|
33
33
|
*/
|
|
34
34
|
disabled?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* An boolean flag to set invalid mode
|
|
37
|
+
* can be used for handling errors
|
|
38
|
+
*/
|
|
39
|
+
isInvalid?: boolean;
|
|
35
40
|
}
|
|
36
41
|
/**
|
|
37
|
-
*
|
|
42
|
+
* Use radio buttons when you have a group of mutually exclusive choices and only one selection from the group is allowed.
|
|
43
|
+
*
|
|
44
|
+
* Radio buttons are used for mutually exclusive choices, not for multiple choices. Only one radio button can be selected at a time. When a user chooses a new item, the previous choice is automatically deselected.
|
|
45
|
+
*
|
|
46
|
+
* _**Do use** Radio buttons in forms, settings, or selections in a list._
|
|
47
|
+
*
|
|
48
|
+
* _**Do not use** Radio buttons if a user can select many option from a list, use checkboxes instead of radio buttons._
|
|
38
49
|
*
|
|
39
50
|
* @param {RadioGroupProps} props - The props for the RadioGroup component
|
|
40
51
|
* @returns {JSX.Element} RadioGroup component
|
|
41
52
|
*/
|
|
42
|
-
export declare const RadioGroup:
|
|
43
|
-
|
|
53
|
+
export declare const RadioGroup: {
|
|
54
|
+
({ children, id, name, value, disabled, onChange, label, inline, className, dataTestId, isInvalid, }: RadioGroupProps): JSX.Element;
|
|
55
|
+
displayName: string;
|
|
56
|
+
};
|
|
@@ -4,6 +4,7 @@ interface RadioGroupContextProps {
|
|
|
4
4
|
name: string;
|
|
5
5
|
value: string | number;
|
|
6
6
|
disabled?: boolean;
|
|
7
|
+
isInvalid?: boolean;
|
|
7
8
|
onChange: (e: React.FormEvent<HTMLInputElement>) => void;
|
|
8
9
|
}
|
|
9
10
|
export declare const RadioGroupContext: React.Context<RadioGroupContextProps | null>;
|
|
@@ -9,6 +9,10 @@ interface RadioItemProps extends CommonProps {
|
|
|
9
9
|
* The value of the radio item.
|
|
10
10
|
*/
|
|
11
11
|
value: string | number;
|
|
12
|
+
/**
|
|
13
|
+
* The description of the radio item.
|
|
14
|
+
*/
|
|
15
|
+
description?: string;
|
|
12
16
|
}
|
|
13
17
|
/**
|
|
14
18
|
* The RadioItem component.
|
|
@@ -16,5 +20,5 @@ interface RadioItemProps extends CommonProps {
|
|
|
16
20
|
* @param {RadioItemProps} props - The props for the RadioItem component
|
|
17
21
|
* @returns {JSX.Element} RadioItem component
|
|
18
22
|
*/
|
|
19
|
-
export declare const RadioItem: ({ label, value, dataTestId, className }: RadioItemProps) => JSX.Element;
|
|
23
|
+
export declare const RadioItem: ({ label, value, dataTestId, className, description }: RadioItemProps) => JSX.Element;
|
|
20
24
|
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { CommonProps } from "../../common/CommonProps";
|
|
3
|
+
export interface TimelineProps extends CommonProps {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Timeline - used to contain TimelineElements for building a sequence of timed entries - each rendered on a line
|
|
8
|
+
* - with an indicator (dot)
|
|
9
|
+
* - a header (next to the dot)
|
|
10
|
+
* - and a body.
|
|
11
|
+
*
|
|
12
|
+
* @param {TimelineProps} props - The props for the Timeline component
|
|
13
|
+
* @returns {JSX.Element} Timeline component
|
|
14
|
+
*/
|
|
15
|
+
export declare const Timeline: ({ className, dataTestId, children }: TimelineProps) => JSX.Element;
|
|
16
|
+
interface TimeLineElementProps extends CommonProps {
|
|
17
|
+
date: Date;
|
|
18
|
+
header?: React.ReactNode;
|
|
19
|
+
children: React.ReactNode;
|
|
20
|
+
dot?: React.ReactNode;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* TimelineElement - entry on a timeline - rendered with an icon on the timeline
|
|
24
|
+
* - a date as the header and the children provided as body.
|
|
25
|
+
*
|
|
26
|
+
* @param {TimeLineElementProps} props the props
|
|
27
|
+
* @returns {JSX.Element} component
|
|
28
|
+
*/
|
|
29
|
+
export declare const TimelineElement: ({ date, children, className, dataTestId, dot, header, }: TimeLineElementProps) => JSX.Element;
|
|
30
|
+
export {};
|
package/components/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -17,6 +17,7 @@ import ReactAsyncCreatableSelect from 'react-select/async-creatable';
|
|
|
17
17
|
import ReactCreatableSelect from 'react-select/creatable';
|
|
18
18
|
import ReactSelect from 'react-select';
|
|
19
19
|
import ReactAsyncSelect from 'react-select/async';
|
|
20
|
+
import ReactMoment from 'react-moment';
|
|
20
21
|
|
|
21
22
|
const docs = {
|
|
22
23
|
source: {
|
|
@@ -649,7 +650,7 @@ const Alert = ({
|
|
|
649
650
|
weight: "bold"
|
|
650
651
|
}, {
|
|
651
652
|
children: title !== null && title !== void 0 ? title : children
|
|
652
|
-
})), children && jsx(Description$
|
|
653
|
+
})), children && jsx(Description$2, Object.assign({
|
|
653
654
|
weight: !title ? "bold" : "default",
|
|
654
655
|
"$hasTitle": !!title
|
|
655
656
|
}, {
|
|
@@ -660,7 +661,7 @@ const Alert = ({
|
|
|
660
661
|
weight: "bold"
|
|
661
662
|
}, {
|
|
662
663
|
children: title !== null && title !== void 0 ? title : children
|
|
663
|
-
})), children && jsx(Description$
|
|
664
|
+
})), children && jsx(Description$2, Object.assign({
|
|
664
665
|
weight: !title ? "bold" : "default",
|
|
665
666
|
"$hasTitle": !!title
|
|
666
667
|
}, {
|
|
@@ -749,7 +750,7 @@ const Container$7 = tw.div`
|
|
|
749
750
|
const Content$2 = tw.div`
|
|
750
751
|
${p => p.$inline ? tws`tu-alert__content--inline` : tws`tu-alert__content`}
|
|
751
752
|
`;
|
|
752
|
-
const Description$
|
|
753
|
+
const Description$2 = tw(Text)`
|
|
753
754
|
${p => p.$hasTitle ? tws`tu-alert__description` : null}
|
|
754
755
|
`;
|
|
755
756
|
const RightAligned = tw.div`
|
|
@@ -1502,7 +1503,7 @@ const Checkbox = React.forwardRef((_a, ref) => {
|
|
|
1502
1503
|
onKeyPress: onKeyPress
|
|
1503
1504
|
}, {
|
|
1504
1505
|
children: icon
|
|
1505
|
-
})), label && jsx(Label$
|
|
1506
|
+
})), label && jsx(Label$5, Object.assign({
|
|
1506
1507
|
ref: internalRef,
|
|
1507
1508
|
htmlFor: uuid,
|
|
1508
1509
|
"$disabled": isReadonly,
|
|
@@ -1550,7 +1551,7 @@ const HiddenInput$1 = tw.input`
|
|
|
1550
1551
|
const CheckboxContainer = tw.label`
|
|
1551
1552
|
tu-checkbox--container group
|
|
1552
1553
|
`;
|
|
1553
|
-
const Label$
|
|
1554
|
+
const Label$5 = tw.label`
|
|
1554
1555
|
tu-checkbox__label
|
|
1555
1556
|
${({
|
|
1556
1557
|
$disabled
|
|
@@ -2491,7 +2492,7 @@ const Indicator$1 = _a => {
|
|
|
2491
2492
|
"$withBackground": withBackground
|
|
2492
2493
|
}, {
|
|
2493
2494
|
children: icon
|
|
2494
|
-
})), label !== undefined && jsx(Label$
|
|
2495
|
+
})), label !== undefined && jsx(Label$4, Object.assign({
|
|
2495
2496
|
"data-testid": dataTestId ? `${dataTestId}-label` : "indicator-label"
|
|
2496
2497
|
}, {
|
|
2497
2498
|
children: label
|
|
@@ -2560,7 +2561,7 @@ const IconBackground = tw.div`
|
|
|
2560
2561
|
return $withBackground ? "" : "tu-indicator__icon-background--none";
|
|
2561
2562
|
}}
|
|
2562
2563
|
`;
|
|
2563
|
-
const Label$
|
|
2564
|
+
const Label$4 = tw.div`
|
|
2564
2565
|
tu-indicator__label
|
|
2565
2566
|
`;
|
|
2566
2567
|
|
|
@@ -2573,7 +2574,7 @@ const Label$3 = tw.div`
|
|
|
2573
2574
|
* @returns {JSX.Element} Label component
|
|
2574
2575
|
*/
|
|
2575
2576
|
|
|
2576
|
-
const Label$
|
|
2577
|
+
const Label$3 = ({
|
|
2577
2578
|
id,
|
|
2578
2579
|
htmlFor,
|
|
2579
2580
|
label,
|
|
@@ -2595,14 +2596,14 @@ const Label$2 = ({
|
|
|
2595
2596
|
htmlFor: htmlFor
|
|
2596
2597
|
}, {
|
|
2597
2598
|
children: labelElement
|
|
2598
|
-
})), jsx(Description, Object.assign({
|
|
2599
|
+
})), jsx(Description$1, Object.assign({
|
|
2599
2600
|
subtle: true
|
|
2600
2601
|
}, {
|
|
2601
2602
|
children: description
|
|
2602
2603
|
}))]
|
|
2603
2604
|
});
|
|
2604
2605
|
};
|
|
2605
|
-
const Description = tw(Text)`
|
|
2606
|
+
const Description$1 = tw(Text)`
|
|
2606
2607
|
tu-label
|
|
2607
2608
|
`;
|
|
2608
2609
|
|
|
@@ -2634,7 +2635,7 @@ const LegendItem = ({
|
|
|
2634
2635
|
style: {
|
|
2635
2636
|
backgroundColor: color
|
|
2636
2637
|
}
|
|
2637
|
-
}), jsx(Label$
|
|
2638
|
+
}), jsx(Label$2, {
|
|
2638
2639
|
children: label
|
|
2639
2640
|
})]
|
|
2640
2641
|
}));
|
|
@@ -2657,7 +2658,7 @@ const Indicator = tw.span`
|
|
|
2657
2658
|
rounded-[50%]
|
|
2658
2659
|
mr-2
|
|
2659
2660
|
`;
|
|
2660
|
-
const Label$
|
|
2661
|
+
const Label$2 = tw.span`
|
|
2661
2662
|
text-sm
|
|
2662
2663
|
`;
|
|
2663
2664
|
|
|
@@ -2717,7 +2718,7 @@ const MenuItem = ({
|
|
|
2717
2718
|
onClick: onClick
|
|
2718
2719
|
}, {
|
|
2719
2720
|
children: jsxs(Content, {
|
|
2720
|
-
children: [jsx(Label, {
|
|
2721
|
+
children: [jsx(Label$1, {
|
|
2721
2722
|
children: label
|
|
2722
2723
|
}), icon && jsx(Icon, {
|
|
2723
2724
|
children: icon
|
|
@@ -2734,7 +2735,7 @@ const Content = tw.div`
|
|
|
2734
2735
|
const Icon = tw.div`
|
|
2735
2736
|
tu-menuItem__icon
|
|
2736
2737
|
`;
|
|
2737
|
-
const Label = tw.div`
|
|
2738
|
+
const Label$1 = tw.div`
|
|
2738
2739
|
tu-menuItem__label
|
|
2739
2740
|
`;
|
|
2740
2741
|
|
|
@@ -3450,7 +3451,13 @@ const Prompt = ({
|
|
|
3450
3451
|
const RadioGroupContext = React.createContext(null);
|
|
3451
3452
|
|
|
3452
3453
|
/**
|
|
3453
|
-
*
|
|
3454
|
+
* Use radio buttons when you have a group of mutually exclusive choices and only one selection from the group is allowed.
|
|
3455
|
+
*
|
|
3456
|
+
* Radio buttons are used for mutually exclusive choices, not for multiple choices. Only one radio button can be selected at a time. When a user chooses a new item, the previous choice is automatically deselected.
|
|
3457
|
+
*
|
|
3458
|
+
* _**Do use** Radio buttons in forms, settings, or selections in a list._
|
|
3459
|
+
*
|
|
3460
|
+
* _**Do not use** Radio buttons if a user can select many option from a list, use checkboxes instead of radio buttons._
|
|
3454
3461
|
*
|
|
3455
3462
|
* @param {RadioGroupProps} props - The props for the RadioGroup component
|
|
3456
3463
|
* @returns {JSX.Element} RadioGroup component
|
|
@@ -3466,37 +3473,38 @@ const RadioGroup = ({
|
|
|
3466
3473
|
label,
|
|
3467
3474
|
inline,
|
|
3468
3475
|
className,
|
|
3469
|
-
dataTestId
|
|
3476
|
+
dataTestId,
|
|
3477
|
+
isInvalid
|
|
3470
3478
|
}) => {
|
|
3471
|
-
return
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
"data-testid": dataTestId
|
|
3479
|
+
return jsx(FormGroup, Object.assign({
|
|
3480
|
+
label: label,
|
|
3481
|
+
dataTestId: `${dataTestId}-FormGroup`
|
|
3475
3482
|
}, {
|
|
3476
|
-
children:
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
children: label
|
|
3481
|
-
})), jsx(RadioGroupContext.Provider, Object.assign({
|
|
3482
|
-
value: {
|
|
3483
|
-
id,
|
|
3484
|
-
value,
|
|
3485
|
-
name: name || id,
|
|
3486
|
-
onChange,
|
|
3487
|
-
disabled
|
|
3488
|
-
}
|
|
3483
|
+
children: jsx(Flex, Object.assign({
|
|
3484
|
+
"$inline": inline,
|
|
3485
|
+
className: className,
|
|
3486
|
+
"data-testid": dataTestId
|
|
3489
3487
|
}, {
|
|
3490
|
-
children:
|
|
3491
|
-
|
|
3488
|
+
children: jsx(RadioGroupContext.Provider, Object.assign({
|
|
3489
|
+
value: {
|
|
3490
|
+
id,
|
|
3491
|
+
value,
|
|
3492
|
+
name: name || id,
|
|
3493
|
+
onChange,
|
|
3494
|
+
disabled,
|
|
3495
|
+
isInvalid
|
|
3496
|
+
}
|
|
3497
|
+
}, {
|
|
3498
|
+
children: children
|
|
3499
|
+
}))
|
|
3500
|
+
}))
|
|
3492
3501
|
}));
|
|
3493
3502
|
};
|
|
3503
|
+
RadioGroup.displayName = "RadioGroup";
|
|
3494
3504
|
const Flex = tw.div`
|
|
3495
|
-
|
|
3496
|
-
gap-2
|
|
3497
|
-
${({
|
|
3505
|
+
${({
|
|
3498
3506
|
$inline
|
|
3499
|
-
}) => $inline ? tws`
|
|
3507
|
+
}) => $inline ? tws`tu-radiogroup--inline` : tws`tu-radiogroup`}
|
|
3500
3508
|
`;
|
|
3501
3509
|
|
|
3502
3510
|
/**
|
|
@@ -3510,37 +3518,71 @@ const RadioItem = ({
|
|
|
3510
3518
|
label,
|
|
3511
3519
|
value,
|
|
3512
3520
|
dataTestId,
|
|
3513
|
-
className
|
|
3521
|
+
className,
|
|
3522
|
+
description
|
|
3514
3523
|
}) => {
|
|
3515
3524
|
const groupCtx = React.useContext(RadioGroupContext);
|
|
3516
3525
|
const isChecked = (groupCtx === null || groupCtx === void 0 ? void 0 : groupCtx.value) === value;
|
|
3526
|
+
const uuid = v4();
|
|
3517
3527
|
return jsxs(CustomFlex, Object.assign({
|
|
3518
3528
|
className: className
|
|
3519
3529
|
}, {
|
|
3520
|
-
children: [
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3530
|
+
children: [jsxs(InputWrapper, {
|
|
3531
|
+
children: [jsx(Input, {
|
|
3532
|
+
id: uuid,
|
|
3533
|
+
type: "radio",
|
|
3534
|
+
value: value,
|
|
3535
|
+
checked: isChecked,
|
|
3536
|
+
"$disabled": groupCtx === null || groupCtx === void 0 ? void 0 : groupCtx.disabled,
|
|
3537
|
+
"$isInvalid": groupCtx === null || groupCtx === void 0 ? void 0 : groupCtx.isInvalid,
|
|
3538
|
+
onChange: groupCtx === null || groupCtx === void 0 ? void 0 : groupCtx.onChange,
|
|
3539
|
+
"data-testid": dataTestId,
|
|
3540
|
+
"$checked": isChecked
|
|
3541
|
+
}), jsx(Label, Object.assign({
|
|
3542
|
+
htmlFor: uuid,
|
|
3543
|
+
"$disabled": groupCtx === null || groupCtx === void 0 ? void 0 : groupCtx.disabled,
|
|
3544
|
+
"$isInvalid": groupCtx === null || groupCtx === void 0 ? void 0 : groupCtx.isInvalid
|
|
3545
|
+
}, {
|
|
3534
3546
|
children: label
|
|
3535
|
-
})
|
|
3547
|
+
}))]
|
|
3548
|
+
}), description && jsx(Description, Object.assign({
|
|
3549
|
+
htmlFor: uuid,
|
|
3550
|
+
"$disabled": groupCtx === null || groupCtx === void 0 ? void 0 : groupCtx.disabled,
|
|
3551
|
+
"$isInvalid": groupCtx === null || groupCtx === void 0 ? void 0 : groupCtx.isInvalid
|
|
3552
|
+
}, {
|
|
3553
|
+
children: description
|
|
3536
3554
|
}))]
|
|
3537
3555
|
}));
|
|
3538
3556
|
};
|
|
3539
3557
|
const CustomFlex = tw.div`
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3558
|
+
tu-radioitem_custom_flex
|
|
3559
|
+
`;
|
|
3560
|
+
const InputWrapper = tw.div`
|
|
3561
|
+
tu-radioitem_wrapper
|
|
3562
|
+
`;
|
|
3563
|
+
const Input = tw.input`
|
|
3564
|
+
tu-radioitem
|
|
3565
|
+
${({
|
|
3566
|
+
$checked
|
|
3567
|
+
}) => $checked ? tws`tu-radioitem--checked` : tws``}
|
|
3568
|
+
${({
|
|
3569
|
+
$disabled
|
|
3570
|
+
}) => $disabled ? tws`tu-radioitem--disabled` : tws``}
|
|
3571
|
+
${({
|
|
3572
|
+
$isInvalid
|
|
3573
|
+
}) => $isInvalid ? tws`tu-radioitem--invalid` : tws``}
|
|
3574
|
+
`;
|
|
3575
|
+
const Label = tw.label`
|
|
3576
|
+
tu-radioitem__label
|
|
3577
|
+
${({
|
|
3578
|
+
$isInvalid
|
|
3579
|
+
}) => $isInvalid ? tws`tu-radioitem__label--invalid` : tws``}
|
|
3580
|
+
${({
|
|
3581
|
+
$disabled
|
|
3582
|
+
}) => $disabled ? tws`tu-radioitem__label--disabled` : tws``}
|
|
3583
|
+
`;
|
|
3584
|
+
const Description = tw.label`
|
|
3585
|
+
tu-radioitem__description
|
|
3544
3586
|
`;
|
|
3545
3587
|
|
|
3546
3588
|
/**
|
|
@@ -3564,7 +3606,7 @@ const SelectContainer = ({
|
|
|
3564
3606
|
return jsxs(Container, Object.assign({
|
|
3565
3607
|
"data-testid": dataTestId
|
|
3566
3608
|
}, {
|
|
3567
|
-
children: [label && !hideLabel && jsx(Label$
|
|
3609
|
+
children: [label && !hideLabel && jsx(Label$3, {
|
|
3568
3610
|
label: label,
|
|
3569
3611
|
htmlFor: id !== null && id !== void 0 ? id : false,
|
|
3570
3612
|
description: description
|
|
@@ -3969,7 +4011,7 @@ const TextArea = React.forwardRef(({
|
|
|
3969
4011
|
className: className,
|
|
3970
4012
|
"data-testid": dataTestId
|
|
3971
4013
|
}, {
|
|
3972
|
-
children: [jsx(Label$
|
|
4014
|
+
children: [jsx(Label$3, {
|
|
3973
4015
|
htmlFor: id !== null && id !== void 0 ? id : false,
|
|
3974
4016
|
id: id,
|
|
3975
4017
|
label: label,
|
|
@@ -4138,6 +4180,77 @@ const TextField = React.forwardRef((_a, ref) => {
|
|
|
4138
4180
|
}));
|
|
4139
4181
|
});
|
|
4140
4182
|
|
|
4183
|
+
/**
|
|
4184
|
+
* Timeline - used to contain TimelineElements for building a sequence of timed entries - each rendered on a line
|
|
4185
|
+
* - with an indicator (dot)
|
|
4186
|
+
* - a header (next to the dot)
|
|
4187
|
+
* - and a body.
|
|
4188
|
+
*
|
|
4189
|
+
* @param {TimelineProps} props - The props for the Timeline component
|
|
4190
|
+
* @returns {JSX.Element} Timeline component
|
|
4191
|
+
*/
|
|
4192
|
+
|
|
4193
|
+
const Timeline = ({
|
|
4194
|
+
className,
|
|
4195
|
+
dataTestId,
|
|
4196
|
+
children
|
|
4197
|
+
}) => {
|
|
4198
|
+
return jsx("ol", Object.assign({
|
|
4199
|
+
className: `${className !== null && className !== void 0 ? className : ""} ${tws`tu-timeline`}`,
|
|
4200
|
+
"data-testid": dataTestId
|
|
4201
|
+
}, {
|
|
4202
|
+
children: children
|
|
4203
|
+
}));
|
|
4204
|
+
};
|
|
4205
|
+
/**
|
|
4206
|
+
* TimelineElement - entry on a timeline - rendered with an icon on the timeline
|
|
4207
|
+
* - a date as the header and the children provided as body.
|
|
4208
|
+
*
|
|
4209
|
+
* @param {TimeLineElementProps} props the props
|
|
4210
|
+
* @returns {JSX.Element} component
|
|
4211
|
+
*/
|
|
4212
|
+
|
|
4213
|
+
const TimelineElement = ({
|
|
4214
|
+
date,
|
|
4215
|
+
children,
|
|
4216
|
+
className,
|
|
4217
|
+
dataTestId = "timeline-date",
|
|
4218
|
+
dot = jsx(Indicator$1, {
|
|
4219
|
+
className: tws`mt-[-1px]`,
|
|
4220
|
+
color: "neutral",
|
|
4221
|
+
icon: jsx(Icon$1, {
|
|
4222
|
+
name: "CalendarIcon",
|
|
4223
|
+
size: "large"
|
|
4224
|
+
})
|
|
4225
|
+
}),
|
|
4226
|
+
header = jsx(ReactMoment, Object.assign({
|
|
4227
|
+
format: "LLL",
|
|
4228
|
+
fromNow: true
|
|
4229
|
+
}, {
|
|
4230
|
+
children: date
|
|
4231
|
+
}))
|
|
4232
|
+
}) => {
|
|
4233
|
+
var _a;
|
|
4234
|
+
|
|
4235
|
+
return jsxs("li", Object.assign({
|
|
4236
|
+
className: `${tws`tu-timeline-element`}${(_a = " " + className) !== null && _a !== void 0 ? _a : ""} `,
|
|
4237
|
+
"data-date": `${date}`,
|
|
4238
|
+
"data-testid": `${dataTestId}`
|
|
4239
|
+
}, {
|
|
4240
|
+
children: [jsx("div", Object.assign({
|
|
4241
|
+
className: tws`tu-timeline-element-dot`
|
|
4242
|
+
}, {
|
|
4243
|
+
children: dot
|
|
4244
|
+
})), jsx("div", {
|
|
4245
|
+
children: header
|
|
4246
|
+
}), jsx("div", {}), jsx("div", {
|
|
4247
|
+
children: jsx("div", {
|
|
4248
|
+
children: children
|
|
4249
|
+
})
|
|
4250
|
+
})]
|
|
4251
|
+
}));
|
|
4252
|
+
};
|
|
4253
|
+
|
|
4141
4254
|
const Toggle = React.forwardRef(({
|
|
4142
4255
|
toggled = false,
|
|
4143
4256
|
onChange,
|
|
@@ -4338,4 +4451,4 @@ const useTimeout = ({
|
|
|
4338
4451
|
};
|
|
4339
4452
|
};
|
|
4340
4453
|
|
|
4341
|
-
export { Alert, AnimatedPopover, Badge, BaseInput, Button, Card, CardBody, CardFooter, CardHeader, Chart, Checkbox, Collapse, CopyableText, CreatableSelect, DateField, DayPicker, DayPickerPopover, DayRangePicker, DensityContainer, FilterListMapLayout, FormGroup, FullWidthRepeatingLayout, GridArea, Heading, Icon$1 as Icon, IconButton, Indicator$1 as Indicator, IntrinsicallyResponsiveGrid, Label$
|
|
4454
|
+
export { Alert, AnimatedPopover, Badge, BaseInput, Button, Card, CardBody, CardFooter, CardHeader, Chart, Checkbox, Collapse, CopyableText, CreatableSelect, DateField, 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, MultiRowTableCell, NumberField, NumberInput, PageHeading, PopoverLifecycle, PopoverList, PopoverListItem, PopoverTitle, Prompt, ROLE_CARD, RadioGroup, RadioItem, Select, SkeletonLines, Spacer, Spinner, StarButton, Tag, Text, TextArea, TextField, TextInput, Timeline, TimelineElement, Tip, TitleNavContentLayout, Toggle, Tooltip, TwoColumnLayout, activityColors, colors, criticalityColors, docs, generalColors, intentColors, useContainerProps, useCustomComponents, useCustomStyles, useDebounce, useLocalStorage, useModal, usePopover, usePrompt, useTimeout };
|
package/package.json
CHANGED
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.77",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@trackunit/css-core": "0.0.
|
|
8
|
-
"@trackunit/tailwind-styled-components": "0.0.
|
|
7
|
+
"@trackunit/css-core": "0.0.45",
|
|
8
|
+
"@trackunit/tailwind-styled-components": "0.0.40",
|
|
9
9
|
"react": "17.0.1",
|
|
10
|
-
"@trackunit/ui-design-tokens": "0.0.
|
|
10
|
+
"@trackunit/ui-design-tokens": "0.0.39",
|
|
11
11
|
"echarts-for-react": "^3.0.2",
|
|
12
12
|
"uuid": "^8.3.2",
|
|
13
|
-
"@react-spring/web": "^9.4.
|
|
13
|
+
"@react-spring/web": "^9.4.5",
|
|
14
14
|
"react-use": "^17.3.2",
|
|
15
15
|
"react-day-picker": "^8.0.3",
|
|
16
16
|
"date-fns": "^2.28.0",
|
|
17
|
-
"@trackunit/ui-icons": "0.0.
|
|
17
|
+
"@trackunit/ui-icons": "0.0.41",
|
|
18
18
|
"react-useportal": "^1.0.16",
|
|
19
19
|
"react-helmet": "^6.1.0",
|
|
20
20
|
"@popperjs/core": "^2.11.4",
|
|
21
21
|
"history": "^5.3.0",
|
|
22
22
|
"react-router-dom": "^6.2.2",
|
|
23
23
|
"react-select": "^5.2.2",
|
|
24
|
-
"faker": "^5.5.3"
|
|
24
|
+
"faker": "^5.5.3",
|
|
25
|
+
"react-moment": "^1.1.2"
|
|
25
26
|
},
|
|
26
27
|
"module": "./index.js",
|
|
27
28
|
"main": "./index.js",
|