@dmsi/wedgekit-react 0.0.140 → 0.0.142
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/dist/{chunk-4OS6APPF.js → chunk-4LXG6QNT.js} +2 -1
- package/dist/{chunk-KS4RDR6P.js → chunk-4NCDT5ZY.js} +21 -8
- package/dist/{chunk-R5TLUWDD.js → chunk-4T3DRGLF.js} +32 -30
- package/dist/{chunk-QZGUMB7T.js → chunk-4VTOTNKJ.js} +3 -0
- package/dist/{chunk-Y4HUYAI5.js → chunk-56Y5DDG3.js} +5 -2
- package/dist/{chunk-D2YP2BTN.js → chunk-5GOJRLQO.js} +10 -4
- package/dist/{chunk-J6LETUNM.js → chunk-AZ7LVLOK.js} +5 -2
- package/dist/{chunk-TTO4PL7Y.js → chunk-BATIOCXB.js} +7 -4
- package/dist/{chunk-CG2NIXZE.js → chunk-C4JGTH6G.js} +7 -3
- package/dist/{chunk-O4M2GISS.js → chunk-CYZL57LH.js} +5 -2
- package/dist/{chunk-6HIALT5L.js → chunk-E7D24OHM.js} +14 -5
- package/dist/{chunk-3ZUSYRI7.js → chunk-EPQLWHCL.js} +2 -2
- package/dist/{chunk-AY7ELVQY.js → chunk-EUXB3XKL.js} +5 -2
- package/dist/{chunk-6DONKNDT.js → chunk-EWGHVZL5.js} +2 -0
- package/dist/{chunk-VH3EJNVE.js → chunk-FFU6FB3K.js} +6 -3
- package/dist/{chunk-H6LXXGX6.js → chunk-FKMKHLQH.js} +6 -3
- package/dist/{chunk-4F6VQXKY.js → chunk-GG5JOFS6.js} +2 -1
- package/dist/{chunk-XCIBYDVK.js → chunk-GXSXCEAA.js} +25 -14
- package/dist/{chunk-VG4EPHJA.js → chunk-HVI3CL7Y.js} +6 -3
- package/dist/{chunk-AOELEEUS.js → chunk-I6GEUF6Y.js} +6 -3
- package/dist/{chunk-Z36QJ7ZF.js → chunk-J4E6Q5TM.js} +12 -9
- package/dist/{chunk-S5K22XTH.js → chunk-JWCT72WR.js} +5 -2
- package/dist/{chunk-QNQ5K7NW.js → chunk-LM5MKBPM.js} +8 -3
- package/dist/{chunk-EO3JJWFW.js → chunk-N6JVLYEE.js} +6 -3
- package/dist/{chunk-IGQVA7SC.js → chunk-NKUETCDA.js} +5 -2
- package/dist/{chunk-PCCJ7L3N.js → chunk-NMVSRA5Y.js} +12 -4
- package/dist/{chunk-X62XGQY7.js → chunk-NW2C4DL4.js} +18 -15
- package/dist/{chunk-OB3URVCR.js → chunk-PMBEIP24.js} +5 -1
- package/dist/{chunk-6UI5GABI.js → chunk-R7ELP5C5.js} +8 -5
- package/dist/{chunk-FWPJ73IK.js → chunk-SYEJVSE4.js} +3 -1
- package/dist/{chunk-WT5XXW6G.js → chunk-WFQEE2OO.js} +9 -4
- package/dist/{chunk-QTD7K43M.js → chunk-WSS2DFTP.js} +8 -6
- package/dist/{chunk-37TJJQL3.js → chunk-YR7JUKYO.js} +3 -0
- package/dist/{chunk-4JLU7TAC.js → chunk-ZFOANBWG.js} +3 -1
- package/dist/{chunk-P242H6OU.js → chunk-ZGFQN47L.js} +5 -2
- package/dist/components/AccessChangerTabItem.cjs +10 -4
- package/dist/components/AccessChangerTabItem.js +2 -2
- package/dist/components/Accordion.cjs +23 -11
- package/dist/components/Accordion.js +5 -5
- package/dist/components/Breadcrumbs.cjs +19 -8
- package/dist/components/Breadcrumbs.js +10 -5
- package/dist/components/Button.cjs +6 -3
- package/dist/components/Button.js +1 -1
- package/dist/components/CalendarRange.cjs +16 -5
- package/dist/components/CalendarRange.js +2 -2
- package/dist/components/Caption.cjs +18 -6
- package/dist/components/Caption.js +2 -2
- package/dist/components/Card.cjs +2 -1
- package/dist/components/Card.js +1 -1
- package/dist/components/Checkbox.cjs +18 -7
- package/dist/components/Checkbox.js +3 -3
- package/dist/components/ContentTab.cjs +22 -16
- package/dist/components/ContentTab.js +2 -2
- package/dist/components/ContentTabs.cjs +27 -18
- package/dist/components/ContentTabs.js +7 -4
- package/dist/components/DataGridCell.cjs +73 -39
- package/dist/components/DataGridCell.js +8 -8
- package/dist/components/DateInput.cjs +55 -35
- package/dist/components/DateInput.js +8 -4
- package/dist/components/DateRangeInput.cjs +55 -35
- package/dist/components/DateRangeInput.js +8 -4
- package/dist/components/Display.cjs +5 -2
- package/dist/components/Display.js +1 -1
- package/dist/components/FilterGroup.cjs +85 -44
- package/dist/components/FilterGroup.js +20 -10
- package/dist/components/FullViewportBox.cjs +3 -1
- package/dist/components/FullViewportBox.js +3 -1
- package/dist/components/Grid.cjs +3 -1
- package/dist/components/Grid.js +3 -1
- package/dist/components/Heading.cjs +5 -2
- package/dist/components/Heading.js +1 -1
- package/dist/components/HorizontalDivider.cjs +2 -2
- package/dist/components/HorizontalDivider.js +1 -1
- package/dist/components/Icon.cjs +5 -2
- package/dist/components/Icon.js +1 -1
- package/dist/components/Input.cjs +40 -32
- package/dist/components/Input.js +3 -3
- package/dist/components/InputGroup.cjs +11 -4
- package/dist/components/InputGroup.js +7 -3
- package/dist/components/Label.cjs +5 -2
- package/dist/components/Label.js +1 -1
- package/dist/components/Link.cjs +6 -3
- package/dist/components/Link.js +1 -1
- package/dist/components/List.cjs +3 -2
- package/dist/components/List.js +3 -2
- package/dist/components/LoadingScrim.cjs +4 -2
- package/dist/components/LoadingScrim.js +3 -2
- package/dist/components/MainBar.cjs +2 -0
- package/dist/components/MainBar.js +2 -0
- package/dist/components/Menu.cjs +3 -0
- package/dist/components/Menu.js +1 -1
- package/dist/components/MenuOption.cjs +19 -7
- package/dist/components/MenuOption.js +4 -4
- package/dist/components/MobileDataGrid.cjs +42 -18
- package/dist/components/MobileDataGrid.js +18 -11
- package/dist/components/Modal.cjs +38 -12
- package/dist/components/Modal.js +8 -8
- package/dist/components/ModalButtons.cjs +16 -6
- package/dist/components/ModalButtons.js +3 -3
- package/dist/components/ModalContent.cjs +3 -1
- package/dist/components/ModalContent.js +1 -1
- package/dist/components/ModalHeader.cjs +21 -9
- package/dist/components/ModalHeader.js +4 -4
- package/dist/components/ModalScrim.cjs +3 -1
- package/dist/components/ModalScrim.js +1 -1
- package/dist/components/NavigationTab.cjs +14 -5
- package/dist/components/NavigationTab.js +3 -3
- package/dist/components/NavigationTabs.cjs +17 -6
- package/dist/components/NavigationTabs.js +6 -4
- package/dist/components/NestedMenu.cjs +23 -9
- package/dist/components/NestedMenu.js +8 -6
- package/dist/components/Notification.cjs +32 -13
- package/dist/components/Notification.js +9 -5
- package/dist/components/OptionPill.cjs +21 -7
- package/dist/components/OptionPill.js +4 -4
- package/dist/components/PDFViewer.cjs +73 -29
- package/dist/components/PDFViewer.js +26 -20
- package/dist/components/Paragraph.cjs +6 -3
- package/dist/components/Paragraph.js +1 -1
- package/dist/components/Password.cjs +50 -37
- package/dist/components/Password.js +13 -8
- package/dist/components/PaymentOnAccountModal.cjs +135 -69
- package/dist/components/PaymentOnAccountModal.js +21 -21
- package/dist/components/ProjectBar.cjs +3 -1
- package/dist/components/ProjectBar.js +3 -1
- package/dist/components/Radio.cjs +12 -6
- package/dist/components/Radio.js +2 -2
- package/dist/components/Search.cjs +44 -32
- package/dist/components/Search.js +4 -4
- package/dist/components/Select.cjs +43 -32
- package/dist/components/Select.js +4 -4
- package/dist/components/SelectPaymentMethod.cjs +67 -29
- package/dist/components/SelectPaymentMethod.js +12 -12
- package/dist/components/SideMenu.cjs +3 -1
- package/dist/components/SideMenu.js +3 -1
- package/dist/components/SideMenuGroup.cjs +19 -8
- package/dist/components/SideMenuGroup.js +6 -4
- package/dist/components/SideMenuItem.cjs +15 -6
- package/dist/components/SideMenuItem.js +5 -2
- package/dist/components/Spinner.cjs +2 -1
- package/dist/components/Spinner.js +1 -1
- package/dist/components/Stack.cjs +6 -3
- package/dist/components/Stack.js +1 -1
- package/dist/components/StatusPill.cjs +12 -6
- package/dist/components/StatusPill.js +8 -5
- package/dist/components/Stepper.cjs +54 -38
- package/dist/components/Stepper.js +12 -7
- package/dist/components/Subheader.cjs +5 -2
- package/dist/components/Subheader.js +1 -1
- package/dist/components/Swatch.cjs +22 -10
- package/dist/components/Swatch.js +4 -4
- package/dist/components/Textarea.cjs +4 -1
- package/dist/components/Textarea.js +4 -1
- package/dist/components/Theme.cjs +2 -0
- package/dist/components/Theme.js +1 -1
- package/dist/components/Time.cjs +52 -36
- package/dist/components/Time.js +10 -5
- package/dist/components/Toast.cjs +29 -12
- package/dist/components/Toast.js +11 -6
- package/dist/components/Tooltip.cjs +3 -0
- package/dist/components/Tooltip.js +1 -1
- package/dist/components/TopBar.cjs +11 -4
- package/dist/components/TopBar.js +11 -4
- package/dist/components/Upload.cjs +30 -15
- package/dist/components/Upload.js +16 -10
- package/dist/components/index.cjs +221 -84
- package/dist/components/index.js +80 -38
- package/dist/index.css +24 -4
- package/package.json +1 -1
- package/src/components/Accordion.tsx +5 -2
- package/src/components/Breadcrumbs.tsx +9 -2
- package/src/components/Button.tsx +4 -1
- package/src/components/CalendarRange.tsx +9 -0
- package/src/components/Caption.tsx +11 -1
- package/src/components/Card.tsx +3 -2
- package/src/components/Checkbox.tsx +5 -0
- package/src/components/ContentTab.tsx +14 -12
- package/src/components/ContentTabs.tsx +6 -2
- package/src/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.tsx +4 -1
- package/src/components/DataGrid/ColumnSelectorHeaderCell/index.tsx +7 -0
- package/src/components/DataGrid/PinnedColumns.tsx +8 -1
- package/src/components/DataGrid/TableBody/LoadingCell.tsx +7 -3
- package/src/components/DataGrid/TableBody/TableBodyRow.tsx +7 -1
- package/src/components/DataGrid/TableBody/index.tsx +7 -1
- package/src/components/DataGrid/index.tsx +18 -2
- package/src/components/DataGrid/types.ts +1 -0
- package/src/components/DataGridCell.tsx +12 -0
- package/src/components/DateInput.tsx +4 -0
- package/src/components/DateRangeInput.tsx +4 -0
- package/src/components/Display.tsx +3 -0
- package/src/components/FilterGroup.tsx +10 -0
- package/src/components/FullViewportBox.tsx +3 -0
- package/src/components/Grid.tsx +3 -0
- package/src/components/Heading.tsx +3 -0
- package/src/components/HorizontalDivider.tsx +2 -2
- package/src/components/Icon.tsx +3 -0
- package/src/components/Input.tsx +32 -36
- package/src/components/InputGroup.tsx +6 -2
- package/src/components/Label.tsx +3 -0
- package/src/components/Link.tsx +3 -0
- package/src/components/List.tsx +3 -1
- package/src/components/LoadingScrim.tsx +2 -1
- package/src/components/MainBar.tsx +3 -0
- package/src/components/Menu.tsx +3 -0
- package/src/components/MenuOption.tsx +4 -0
- package/src/components/MobileDataGrid.tsx +12 -3
- package/src/components/Modal.tsx +7 -0
- package/src/components/ModalButtons.tsx +5 -0
- package/src/components/ModalContent.tsx +3 -0
- package/src/components/ModalHeader.tsx +5 -1
- package/src/components/ModalScrim.tsx +3 -0
- package/src/components/NavigationTab.tsx +3 -0
- package/src/components/NavigationTabs.tsx +7 -3
- package/src/components/NestedMenu.tsx +5 -2
- package/src/components/Notification.tsx +4 -0
- package/src/components/OptionPill.tsx +5 -0
- package/src/components/PDFViewer.tsx +16 -8
- package/src/components/Paragraph.tsx +3 -0
- package/src/components/Password.tsx +7 -2
- package/src/components/PaymentOnAccountModal.tsx +6 -2
- package/src/components/ProjectBar.tsx +3 -0
- package/src/components/Radio.tsx +4 -1
- package/src/components/Search.tsx +5 -0
- package/src/components/Select.tsx +4 -0
- package/src/components/SelectPaymentMethod.tsx +17 -3
- package/src/components/SideMenu.tsx +3 -0
- package/src/components/SideMenuGroup.tsx +4 -1
- package/src/components/SideMenuItem.tsx +4 -0
- package/src/components/Spinner.tsx +3 -1
- package/src/components/Stack.tsx +3 -0
- package/src/components/StatusPill.tsx +4 -1
- package/src/components/Stepper.tsx +6 -1
- package/src/components/Subheader.tsx +3 -0
- package/src/components/Textarea.tsx +4 -1
- package/src/components/Theme.tsx +3 -0
- package/src/components/Time.tsx +7 -1
- package/src/components/Toast.tsx +8 -3
- package/src/components/Tooltip.tsx +4 -0
- package/src/components/TopBar.tsx +7 -2
- package/src/components/Upload.tsx +10 -4
|
@@ -7,6 +7,7 @@ type Tags = "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "span" | "p";
|
|
|
7
7
|
type ParagraphProps = {
|
|
8
8
|
as?: Tags;
|
|
9
9
|
id?: string;
|
|
10
|
+
testid?: string;
|
|
10
11
|
} & AsProps<Tags> &
|
|
11
12
|
TextAttributes &
|
|
12
13
|
TypographyProps;
|
|
@@ -21,6 +22,7 @@ export const Paragraph = ({
|
|
|
21
22
|
children,
|
|
22
23
|
as = "p",
|
|
23
24
|
id,
|
|
25
|
+
testid,
|
|
24
26
|
...props
|
|
25
27
|
}: ParagraphProps) => {
|
|
26
28
|
const Element = as;
|
|
@@ -28,6 +30,7 @@ export const Paragraph = ({
|
|
|
28
30
|
return (
|
|
29
31
|
<Element
|
|
30
32
|
id={id}
|
|
33
|
+
data-testid={testid}
|
|
31
34
|
{...props}
|
|
32
35
|
className={clsx(
|
|
33
36
|
typography.paragraph,
|
|
@@ -6,6 +6,7 @@ import { Icon } from "./Icon";
|
|
|
6
6
|
|
|
7
7
|
export const Password = ({
|
|
8
8
|
id,
|
|
9
|
+
testid,
|
|
9
10
|
...props
|
|
10
11
|
}: Omit<ComponentProps<"input">, "type" | "children" | "id"> &
|
|
11
12
|
InputBaseProps) => {
|
|
@@ -14,24 +15,27 @@ export const Password = ({
|
|
|
14
15
|
return (
|
|
15
16
|
<InputBase
|
|
16
17
|
id={id}
|
|
18
|
+
testid={testid}
|
|
17
19
|
{...props}
|
|
18
20
|
type={show ? "text" : "password"}
|
|
19
|
-
after={<WhichIcon id={id} show={show} setShow={setShow} />}
|
|
21
|
+
after={<WhichIcon id={id} testid={testid} show={show} setShow={setShow} />}
|
|
20
22
|
/>
|
|
21
23
|
);
|
|
22
24
|
};
|
|
23
25
|
|
|
24
26
|
type WhichIconProps = {
|
|
25
27
|
id?: string;
|
|
28
|
+
testid?: string;
|
|
26
29
|
show: boolean;
|
|
27
30
|
setShow: (value: boolean) => void;
|
|
28
31
|
};
|
|
29
32
|
|
|
30
|
-
const WhichIcon = ({ id, show, setShow }: WhichIconProps) => {
|
|
33
|
+
const WhichIcon = ({ id, testid, show, setShow }: WhichIconProps) => {
|
|
31
34
|
if (show) {
|
|
32
35
|
return (
|
|
33
36
|
<Icon
|
|
34
37
|
id={id ? `${id}-toggle-visibility` : undefined}
|
|
38
|
+
testid={testid ? `${testid}-toggle-visibility` : undefined}
|
|
35
39
|
name="visibility_off"
|
|
36
40
|
className="cursor-pointer"
|
|
37
41
|
onClick={() => setShow(false)}
|
|
@@ -42,6 +46,7 @@ const WhichIcon = ({ id, show, setShow }: WhichIconProps) => {
|
|
|
42
46
|
return (
|
|
43
47
|
<Icon
|
|
44
48
|
id={id ? `${id}-toggle-visibility` : undefined}
|
|
49
|
+
testid={testid ? `${testid}-toggle-visibility` : undefined}
|
|
45
50
|
name="visibility"
|
|
46
51
|
className="cursor-pointer"
|
|
47
52
|
onClick={() => setShow(true)}
|
|
@@ -18,6 +18,7 @@ type PaymentOnAccountModalProps = {
|
|
|
18
18
|
cardPaymentUrl: string | null;
|
|
19
19
|
setCardPaymentUrl: (url: string | null) => void;
|
|
20
20
|
isLoadingCCiframe?: boolean;
|
|
21
|
+
testid?: string;
|
|
21
22
|
};
|
|
22
23
|
export function PaymentOnAccountModal(props: PaymentOnAccountModalProps) {
|
|
23
24
|
const {
|
|
@@ -28,6 +29,7 @@ export function PaymentOnAccountModal(props: PaymentOnAccountModalProps) {
|
|
|
28
29
|
cardPaymentUrl,
|
|
29
30
|
setCardPaymentUrl,
|
|
30
31
|
isLoadingCCiframe,
|
|
32
|
+
testid
|
|
31
33
|
} = props;
|
|
32
34
|
const [amount, setAmount] = useState<number>(paymentProps.amountToPay);
|
|
33
35
|
const { creditCardSettings, selectedMethod } =
|
|
@@ -68,12 +70,12 @@ export function PaymentOnAccountModal(props: PaymentOnAccountModalProps) {
|
|
|
68
70
|
}, [creditCardSettings, amount, selectedMethod]);
|
|
69
71
|
|
|
70
72
|
return (
|
|
71
|
-
<Modal open={isOpen} onClose={onClose} title="Payment on Account">
|
|
73
|
+
<Modal testid={testid} open={isOpen} onClose={onClose} title="Payment on Account">
|
|
72
74
|
<Stack sizing="layout-group" width="full">
|
|
73
75
|
{selectedMethod === "CCPayment" && (
|
|
74
76
|
<Stack horizontal justify="between" items="center">
|
|
75
77
|
<Paragraph>Surcharge</Paragraph>
|
|
76
|
-
<Paragraph>
|
|
78
|
+
<Paragraph testid={testid ? `${testid}-surcharge` : undefined}>
|
|
77
79
|
${formatCurrencyDisplay(creditCardSurcharge.toFixed(2))}
|
|
78
80
|
</Paragraph>
|
|
79
81
|
</Stack>
|
|
@@ -83,6 +85,7 @@ export function PaymentOnAccountModal(props: PaymentOnAccountModalProps) {
|
|
|
83
85
|
<Paragraph className="w-full">Amount to Pay</Paragraph>
|
|
84
86
|
<div>
|
|
85
87
|
<Input
|
|
88
|
+
testid={testid ? `${testid}-amount-to-pay` : undefined}
|
|
86
89
|
type="number"
|
|
87
90
|
placeholder="$0.00"
|
|
88
91
|
align="right"
|
|
@@ -95,6 +98,7 @@ export function PaymentOnAccountModal(props: PaymentOnAccountModalProps) {
|
|
|
95
98
|
</Card>
|
|
96
99
|
<SelectPaymentMethod
|
|
97
100
|
{...paymentProps}
|
|
101
|
+
testid={testid ? `${testid}-select-payment-method` : undefined}
|
|
98
102
|
amountToPay={amount + creditCardSurcharge}
|
|
99
103
|
cardPaymentUrl={cardPaymentUrl}
|
|
100
104
|
setCardPaymentUrl={setCardPaymentUrl}
|
|
@@ -14,6 +14,7 @@ type ProjectBarProps = {
|
|
|
14
14
|
mobileLeft: ReactNode;
|
|
15
15
|
mobileRight: ReactNode;
|
|
16
16
|
id?: string;
|
|
17
|
+
testid?: string;
|
|
17
18
|
};
|
|
18
19
|
|
|
19
20
|
export const ProjectBar = ({
|
|
@@ -22,6 +23,7 @@ export const ProjectBar = ({
|
|
|
22
23
|
mobileLeft,
|
|
23
24
|
mobileRight,
|
|
24
25
|
id,
|
|
26
|
+
testid,
|
|
25
27
|
}: ComponentProps<"div"> & ProjectBarProps) => {
|
|
26
28
|
const isMobile = useMatchesMobile();
|
|
27
29
|
|
|
@@ -50,6 +52,7 @@ export const ProjectBar = ({
|
|
|
50
52
|
return (
|
|
51
53
|
<div
|
|
52
54
|
id={id}
|
|
55
|
+
data-testid={testid}
|
|
53
56
|
style={{ ...tokenOverrides } as React.CSSProperties}
|
|
54
57
|
className={clsx(
|
|
55
58
|
"flex items-center justify-between",
|
package/src/components/Radio.tsx
CHANGED
|
@@ -14,6 +14,7 @@ interface RadioProps
|
|
|
14
14
|
label?: string;
|
|
15
15
|
error?: boolean;
|
|
16
16
|
readOnly?: boolean;
|
|
17
|
+
testid?: string;
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
export const Radio = ({
|
|
@@ -24,6 +25,7 @@ export const Radio = ({
|
|
|
24
25
|
checked,
|
|
25
26
|
readOnly,
|
|
26
27
|
id,
|
|
28
|
+
testid,
|
|
27
29
|
...props
|
|
28
30
|
}: RadioProps) => {
|
|
29
31
|
const radioId = id;
|
|
@@ -69,6 +71,7 @@ export const Radio = ({
|
|
|
69
71
|
<div className="relative">
|
|
70
72
|
<input
|
|
71
73
|
id={radioId}
|
|
74
|
+
data-testid={testid}
|
|
72
75
|
type="radio"
|
|
73
76
|
className="sr-only peer"
|
|
74
77
|
disabled={disabled}
|
|
@@ -105,7 +108,7 @@ export const Radio = ({
|
|
|
105
108
|
</div>
|
|
106
109
|
|
|
107
110
|
{label && (
|
|
108
|
-
<Paragraph id={`${radioId}-label`} padded color={paragraphColor}>
|
|
111
|
+
<Paragraph id={radioId ? `${radioId}-label` : undefined} testid={testid ? `${testid}-label` : undefined} padded color={paragraphColor}>
|
|
109
112
|
{label}
|
|
110
113
|
</Paragraph>
|
|
111
114
|
)}
|
|
@@ -11,8 +11,10 @@ import { Input, InputBaseProps } from "./Input";
|
|
|
11
11
|
|
|
12
12
|
export interface SearchProps {
|
|
13
13
|
id?: string;
|
|
14
|
+
testid?: string;
|
|
14
15
|
renderMenu?: (props: {
|
|
15
16
|
id?: string;
|
|
17
|
+
testid?: string;
|
|
16
18
|
positionTo: RefObject<HTMLElement | null> | undefined;
|
|
17
19
|
show: boolean;
|
|
18
20
|
setShow: (value: boolean) => void;
|
|
@@ -25,6 +27,7 @@ export interface SearchProps {
|
|
|
25
27
|
|
|
26
28
|
export const Search = ({
|
|
27
29
|
id,
|
|
30
|
+
testid,
|
|
28
31
|
label,
|
|
29
32
|
error,
|
|
30
33
|
children,
|
|
@@ -56,6 +59,7 @@ export const Search = ({
|
|
|
56
59
|
<>
|
|
57
60
|
<Input
|
|
58
61
|
id={id}
|
|
62
|
+
testid={testid}
|
|
59
63
|
variant="search"
|
|
60
64
|
inputContainerRef={inputContainerRef}
|
|
61
65
|
ref={inputRef}
|
|
@@ -129,6 +133,7 @@ export const Search = ({
|
|
|
129
133
|
{renderMenu
|
|
130
134
|
? renderMenu({
|
|
131
135
|
id: id ? `${id}-menu` : undefined,
|
|
136
|
+
testid: testid ? `${testid}-menu` : undefined,
|
|
132
137
|
positionTo: inputContainerRef,
|
|
133
138
|
show,
|
|
134
139
|
setShow,
|
|
@@ -6,8 +6,10 @@ import clsx from "clsx";
|
|
|
6
6
|
|
|
7
7
|
export interface SelectProps {
|
|
8
8
|
id?: string;
|
|
9
|
+
testid?: string;
|
|
9
10
|
renderMenu?: (props: {
|
|
10
11
|
id?: string;
|
|
12
|
+
testid?: string;
|
|
11
13
|
positionTo: RefObject<HTMLElement | null> | undefined;
|
|
12
14
|
show: boolean;
|
|
13
15
|
setShow: (value: boolean) => void;
|
|
@@ -18,6 +20,7 @@ export interface SelectProps {
|
|
|
18
20
|
|
|
19
21
|
export const Select = ({
|
|
20
22
|
id,
|
|
23
|
+
testid,
|
|
21
24
|
label,
|
|
22
25
|
error,
|
|
23
26
|
children,
|
|
@@ -49,6 +52,7 @@ export const Select = ({
|
|
|
49
52
|
<>
|
|
50
53
|
<InputBase
|
|
51
54
|
id={id}
|
|
55
|
+
testid={testid}
|
|
52
56
|
inputContainerRef={inputContainerRef}
|
|
53
57
|
ref={inputRef}
|
|
54
58
|
label={label}
|
|
@@ -34,6 +34,7 @@ export type SelectPaymentMethodProps = {
|
|
|
34
34
|
withCredits?: boolean;
|
|
35
35
|
cardPaymentUrl?: string | null;
|
|
36
36
|
isLoadingCCiframe?: boolean;
|
|
37
|
+
testid?: string;
|
|
37
38
|
|
|
38
39
|
setCardPaymentUrl?: (url: string | null) => void;
|
|
39
40
|
onSelectMethod: (method: PaymentMethodType | null) => void;
|
|
@@ -58,6 +59,7 @@ export function SelectPaymentMethod(props: SelectPaymentMethodProps) {
|
|
|
58
59
|
withCredits = false,
|
|
59
60
|
isLoadingCCiframe,
|
|
60
61
|
cardPaymentUrl,
|
|
62
|
+
testid
|
|
61
63
|
} = props;
|
|
62
64
|
|
|
63
65
|
const payAllWithCredits = withCredits && amountToPay <= 0;
|
|
@@ -77,6 +79,7 @@ export function SelectPaymentMethod(props: SelectPaymentMethodProps) {
|
|
|
77
79
|
<Stack sizing="layout-group" width="full" minWidth={400}>
|
|
78
80
|
{!!allCredits?.length && withCredits && (
|
|
79
81
|
<CreditsSelector
|
|
82
|
+
testid={testid ? `${testid}-credit-selector` : undefined}
|
|
80
83
|
selectedCredits={selectedCredits || []}
|
|
81
84
|
allCredits={allCredits || []}
|
|
82
85
|
setSelectedCredits={props.setSelectedCredits || (() => {})}
|
|
@@ -84,6 +87,7 @@ export function SelectPaymentMethod(props: SelectPaymentMethodProps) {
|
|
|
84
87
|
)}
|
|
85
88
|
{allowedMethods?.includes("ACHPayment") && !!customerBanks?.length && (
|
|
86
89
|
<ACHSelector
|
|
90
|
+
testid={testid ? `${testid}-ach-selector` : undefined}
|
|
87
91
|
selectedMethod={selectedMethod}
|
|
88
92
|
handleToggle={handleToggle}
|
|
89
93
|
selectedBankGuid={selectedACHBankGuid || null}
|
|
@@ -96,9 +100,11 @@ export function SelectPaymentMethod(props: SelectPaymentMethodProps) {
|
|
|
96
100
|
)}
|
|
97
101
|
{allowedMethods?.includes("CCPayment") && (
|
|
98
102
|
<Accordion
|
|
103
|
+
testid={testid ? `${testid}-cc-payment` : undefined}
|
|
99
104
|
isOpen={!payAllWithCredits && selectedMethod === "CCPayment"}
|
|
100
105
|
title={
|
|
101
106
|
<Radio
|
|
107
|
+
testid={testid ? `${testid}-cc-payment-radio` : undefined}
|
|
102
108
|
label="Pay by Credit/Debit Card"
|
|
103
109
|
checked={!payAllWithCredits && selectedMethod === "CCPayment"}
|
|
104
110
|
onChange={(e) => e.stopPropagation()}
|
|
@@ -138,12 +144,13 @@ export function SelectPaymentMethod(props: SelectPaymentMethodProps) {
|
|
|
138
144
|
block
|
|
139
145
|
onClick={onPay}
|
|
140
146
|
disabled={isPayLoading || amountToPay <= 0}
|
|
147
|
+
testid={testid ? `${testid}-submit-payment-button` : undefined}
|
|
141
148
|
>
|
|
142
149
|
{isPayLoading ? "Processing..." : "Submit Payment"}
|
|
143
150
|
</Button>
|
|
144
151
|
)}
|
|
145
152
|
{payAllWithCredits && (
|
|
146
|
-
<Button block onClick={onPay} disabled={isPayLoading}>
|
|
153
|
+
<Button testid={testid ? `${testid}-submit-payment-button` : undefined} block onClick={onPay} disabled={isPayLoading}>
|
|
147
154
|
{isPayLoading ? "Processing..." : "Submit Payment"}
|
|
148
155
|
</Button>
|
|
149
156
|
)}
|
|
@@ -160,6 +167,7 @@ type ACHSelectorProps = {
|
|
|
160
167
|
onPay?: () => void;
|
|
161
168
|
isPayLoading?: boolean;
|
|
162
169
|
disabled?: boolean;
|
|
170
|
+
testid?: string;
|
|
163
171
|
};
|
|
164
172
|
function ACHSelector(props: ACHSelectorProps) {
|
|
165
173
|
const {
|
|
@@ -169,6 +177,7 @@ function ACHSelector(props: ACHSelectorProps) {
|
|
|
169
177
|
setSelectedBankGuid,
|
|
170
178
|
customerBanks,
|
|
171
179
|
disabled,
|
|
180
|
+
testid
|
|
172
181
|
} = props;
|
|
173
182
|
|
|
174
183
|
function handleBankSelect(
|
|
@@ -185,6 +194,7 @@ function ACHSelector(props: ACHSelectorProps) {
|
|
|
185
194
|
<>
|
|
186
195
|
{customerBanks.map((bank) => (
|
|
187
196
|
<Card
|
|
197
|
+
testid={testid ? `${testid}-bank-${bank.CustBankGUID}` : undefined}
|
|
188
198
|
key={bank.CustBankGUID}
|
|
189
199
|
onClick={(e) => handleBankSelect(e, bank.CustBankGUID)}
|
|
190
200
|
selected={
|
|
@@ -212,9 +222,10 @@ type CreditsSelectorProps = {
|
|
|
212
222
|
selectedCredits: unknown[];
|
|
213
223
|
allCredits: unknown[];
|
|
214
224
|
setSelectedCredits: React.Dispatch<React.SetStateAction<unknown[]>>;
|
|
225
|
+
testid?: string
|
|
215
226
|
};
|
|
216
227
|
function CreditsSelector(props: CreditsSelectorProps) {
|
|
217
|
-
const { selectedCredits, allCredits, setSelectedCredits } = props;
|
|
228
|
+
const { selectedCredits, allCredits, setSelectedCredits, testid } = props;
|
|
218
229
|
const [isOpen, setIsOpen] = useState<boolean>(true);
|
|
219
230
|
|
|
220
231
|
const handleCreditSelect = (credit: unknown) => {
|
|
@@ -232,6 +243,7 @@ function CreditsSelector(props: CreditsSelectorProps) {
|
|
|
232
243
|
isOpen={isOpen}
|
|
233
244
|
title="Available Credits"
|
|
234
245
|
onClick={() => setIsOpen((prev) => !prev)}
|
|
246
|
+
testid={testid}
|
|
235
247
|
>
|
|
236
248
|
<HorizontalDivider />
|
|
237
249
|
<Stack sizing="layout-group" width="full">
|
|
@@ -260,15 +272,17 @@ function CreditsSelector(props: CreditsSelectorProps) {
|
|
|
260
272
|
onClick={() => handleCreditSelect(credits)}
|
|
261
273
|
paddingY
|
|
262
274
|
flexGrow={1}
|
|
275
|
+
testid={testid ? `${testid}-credit-${credits.InvoiceNumber}` : undefined}
|
|
263
276
|
>
|
|
264
277
|
<Checkbox
|
|
278
|
+
testid={testid ? `${testid}-credit-${credits.InvoiceNumber}-checkbox` : undefined}
|
|
265
279
|
label={credits.InvoiceNumber}
|
|
266
280
|
checked={selectedCredits?.includes(credits)}
|
|
267
281
|
onChange={() => handleCreditSelect(credits)}
|
|
268
282
|
/>
|
|
269
283
|
</Stack>
|
|
270
284
|
|
|
271
|
-
<Subheader className=" pr-desktop-component-padding">
|
|
285
|
+
<Subheader testid={testid ? `${testid}-credit-${credits.InvoiceNumber}-InvoiceBalanceDue` : undefined} className=" pr-desktop-component-padding">
|
|
272
286
|
$
|
|
273
287
|
{formatCurrencyDisplay(
|
|
274
288
|
`${Math.abs(credits.InvoiceBalanceDue)}`,
|
|
@@ -4,16 +4,19 @@ import clsx from "clsx";
|
|
|
4
4
|
type SideMenuProps = PropsWithChildren<{
|
|
5
5
|
cardStyle?: boolean;
|
|
6
6
|
id?: string;
|
|
7
|
+
testid?: string;
|
|
7
8
|
}>;
|
|
8
9
|
|
|
9
10
|
export const SideMenu = ({
|
|
10
11
|
children,
|
|
11
12
|
cardStyle = false,
|
|
12
13
|
id,
|
|
14
|
+
testid,
|
|
13
15
|
}: SideMenuProps) => {
|
|
14
16
|
return (
|
|
15
17
|
<div
|
|
16
18
|
id={id}
|
|
19
|
+
data-testid={testid}
|
|
17
20
|
className={clsx(
|
|
18
21
|
"flex flex-col",
|
|
19
22
|
cardStyle &&
|
|
@@ -9,6 +9,7 @@ import { Icon } from "./Icon";
|
|
|
9
9
|
|
|
10
10
|
export type SideMenuGroupProps = PropsWithChildren<{
|
|
11
11
|
id?: string;
|
|
12
|
+
testid?: string;
|
|
12
13
|
label?: string;
|
|
13
14
|
groupIndentLevel?: 1 | 2 | 3 | 4;
|
|
14
15
|
collapsed?: boolean;
|
|
@@ -17,6 +18,7 @@ export type SideMenuGroupProps = PropsWithChildren<{
|
|
|
17
18
|
|
|
18
19
|
export const SideMenuGroup = ({
|
|
19
20
|
id,
|
|
21
|
+
testid,
|
|
20
22
|
label,
|
|
21
23
|
groupIndentLevel = 1,
|
|
22
24
|
collapsed = false,
|
|
@@ -45,6 +47,7 @@ export const SideMenuGroup = ({
|
|
|
45
47
|
<>
|
|
46
48
|
<div
|
|
47
49
|
id={id}
|
|
50
|
+
data-testid={testid}
|
|
48
51
|
className={clsx(
|
|
49
52
|
"group/sm-group flex rounded cursor-pointer",
|
|
50
53
|
"bg-transparent",
|
|
@@ -79,7 +82,7 @@ export const SideMenuGroup = ({
|
|
|
79
82
|
size={24}
|
|
80
83
|
/>
|
|
81
84
|
|
|
82
|
-
<Label id={id ? `${id}-label` : undefined} padded>
|
|
85
|
+
<Label id={id ? `${id}-label` : undefined} testid={testid ? `${testid}-label` : undefined} padded>
|
|
83
86
|
{label}
|
|
84
87
|
</Label>
|
|
85
88
|
</Stack>
|
|
@@ -5,6 +5,7 @@ import { Paragraph } from "./Paragraph";
|
|
|
5
5
|
|
|
6
6
|
export type SideMenuItemProps = {
|
|
7
7
|
id?: string;
|
|
8
|
+
testid?: string;
|
|
8
9
|
label?: string;
|
|
9
10
|
leftIcon?: React.ReactNode;
|
|
10
11
|
rightIcon?: React.ReactNode;
|
|
@@ -17,6 +18,7 @@ export type SideMenuItemProps = {
|
|
|
17
18
|
|
|
18
19
|
export const SideMenuItem = ({
|
|
19
20
|
id,
|
|
21
|
+
testid,
|
|
20
22
|
label,
|
|
21
23
|
leftIcon,
|
|
22
24
|
rightIcon,
|
|
@@ -55,6 +57,7 @@ export const SideMenuItem = ({
|
|
|
55
57
|
return (
|
|
56
58
|
<a
|
|
57
59
|
id={id}
|
|
60
|
+
data-testid={testid}
|
|
58
61
|
href={href}
|
|
59
62
|
className={clsx(
|
|
60
63
|
"group flex w-full rounded border-2 cursor-pointer",
|
|
@@ -87,6 +90,7 @@ export const SideMenuItem = ({
|
|
|
87
90
|
|
|
88
91
|
<Paragraph
|
|
89
92
|
id={id ? `${id}-label` : undefined}
|
|
93
|
+
testid={testid ? `${testid}-label` : undefined}
|
|
90
94
|
as="span"
|
|
91
95
|
padded
|
|
92
96
|
className="mr-auto !leading-6"
|
|
@@ -2,12 +2,14 @@ import React from "react";
|
|
|
2
2
|
|
|
3
3
|
type SpinnerProps = {
|
|
4
4
|
size?: "small" | "large";
|
|
5
|
+
testid?: string;
|
|
5
6
|
};
|
|
6
7
|
|
|
7
|
-
export const Spinner: React.FC<SpinnerProps> = ({ size = "small" }) => {
|
|
8
|
+
export const Spinner: React.FC<SpinnerProps> = ({ size = "small", testid }) => {
|
|
8
9
|
const dimension = size === "large" ? 48 : 24;
|
|
9
10
|
return (
|
|
10
11
|
<svg
|
|
12
|
+
data-testid={testid}
|
|
11
13
|
width={dimension}
|
|
12
14
|
height={dimension}
|
|
13
15
|
viewBox="0 0 24 24"
|
package/src/components/Stack.tsx
CHANGED
|
@@ -41,6 +41,7 @@ type StackProps = {
|
|
|
41
41
|
top?: number;
|
|
42
42
|
left?: number;
|
|
43
43
|
id?: string;
|
|
44
|
+
testid?: string;
|
|
44
45
|
noGap?: boolean;
|
|
45
46
|
marginTop?: boolean;
|
|
46
47
|
marginBottom?: boolean;
|
|
@@ -121,6 +122,7 @@ export const Stack = ({
|
|
|
121
122
|
noGap,
|
|
122
123
|
marginTop,
|
|
123
124
|
marginBottom,
|
|
125
|
+
testid,
|
|
124
126
|
...props
|
|
125
127
|
}: StackProps) => {
|
|
126
128
|
const flexClassNames = getFlexClassNames({ items, justify, grow });
|
|
@@ -129,6 +131,7 @@ export const Stack = ({
|
|
|
129
131
|
return (
|
|
130
132
|
<div
|
|
131
133
|
id={id}
|
|
134
|
+
data-testid={testid}
|
|
132
135
|
{...props}
|
|
133
136
|
style={{
|
|
134
137
|
height:
|
|
@@ -5,6 +5,7 @@ import { componentPaddingYUsingComponentGap, paddingXUsingLayoutGroupGap } from
|
|
|
5
5
|
|
|
6
6
|
type StatusPillProps = PropsWithChildren<{
|
|
7
7
|
id?: string;
|
|
8
|
+
testid?: string;
|
|
8
9
|
intent?: "neutral" | "warning" | "success" | "critical";
|
|
9
10
|
state?: "in-progress" | "completed";
|
|
10
11
|
}>;
|
|
@@ -14,6 +15,7 @@ export const StatusPill = ({
|
|
|
14
15
|
state = "in-progress",
|
|
15
16
|
intent = "neutral",
|
|
16
17
|
id,
|
|
18
|
+
testid,
|
|
17
19
|
...props
|
|
18
20
|
}: StatusPillProps) => {
|
|
19
21
|
const textColor = clsx(
|
|
@@ -39,6 +41,7 @@ export const StatusPill = ({
|
|
|
39
41
|
return (
|
|
40
42
|
<div
|
|
41
43
|
id={id}
|
|
44
|
+
data-testid={testid}
|
|
42
45
|
{...props}
|
|
43
46
|
className={clsx(
|
|
44
47
|
"rounded flex items-center",
|
|
@@ -48,7 +51,7 @@ export const StatusPill = ({
|
|
|
48
51
|
componentPaddingYUsingComponentGap
|
|
49
52
|
)}
|
|
50
53
|
>
|
|
51
|
-
<Label id={id ? `${id}-label` : undefined}>{children}</Label>
|
|
54
|
+
<Label id={id ? `${id}-label` : undefined} testid={testid ? `${testid}-label` : undefined}>{children}</Label>
|
|
52
55
|
</div>
|
|
53
56
|
);
|
|
54
57
|
};
|
|
@@ -9,6 +9,7 @@ type StepperProps = {
|
|
|
9
9
|
error?: boolean;
|
|
10
10
|
disabled?: boolean;
|
|
11
11
|
id?: string;
|
|
12
|
+
testid?: string;
|
|
12
13
|
value: number;
|
|
13
14
|
setValue: React.Dispatch<React.SetStateAction<number>>;
|
|
14
15
|
onIncrease?: () => void;
|
|
@@ -23,6 +24,7 @@ export const Stepper = ({
|
|
|
23
24
|
onDecrease,
|
|
24
25
|
onIncrease,
|
|
25
26
|
id,
|
|
27
|
+
testid,
|
|
26
28
|
...props
|
|
27
29
|
}: StepperProps) => {
|
|
28
30
|
function handleIncrease() {
|
|
@@ -36,9 +38,10 @@ export const Stepper = ({
|
|
|
36
38
|
}
|
|
37
39
|
|
|
38
40
|
return (
|
|
39
|
-
<div id={id} className={clsx("flex items-center", componentGap)}>
|
|
41
|
+
<div id={id} data-testid={testid} className={clsx("flex items-center", componentGap)}>
|
|
40
42
|
<Button
|
|
41
43
|
id={id ? `${id}-decrease-button` : undefined}
|
|
44
|
+
testid={testid ? `${testid}-decrease-button` : undefined}
|
|
42
45
|
iconOnly
|
|
43
46
|
variant="tertiary"
|
|
44
47
|
leftIcon={
|
|
@@ -60,6 +63,7 @@ export const Stepper = ({
|
|
|
60
63
|
<InputBase
|
|
61
64
|
{...props}
|
|
62
65
|
id={id ? `${id}-input` : undefined}
|
|
66
|
+
testid={testid ? `${testid}-input` : undefined}
|
|
63
67
|
type="number"
|
|
64
68
|
align="center"
|
|
65
69
|
value={value}
|
|
@@ -72,6 +76,7 @@ export const Stepper = ({
|
|
|
72
76
|
|
|
73
77
|
<Button
|
|
74
78
|
id={id ? `${id}-increase-button` : undefined}
|
|
79
|
+
testid={testid ? `${testid}-increase-button` : undefined}
|
|
75
80
|
iconOnly
|
|
76
81
|
variant="tertiary"
|
|
77
82
|
leftIcon={
|
|
@@ -7,6 +7,7 @@ type Tags = "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "span" | "p";
|
|
|
7
7
|
type SubheaderProps = {
|
|
8
8
|
as?: Tags;
|
|
9
9
|
id?: string;
|
|
10
|
+
testid?: string;
|
|
10
11
|
} & AsProps<Tags> &
|
|
11
12
|
TextAttributes &
|
|
12
13
|
TypographyProps;
|
|
@@ -19,12 +20,14 @@ export const Subheader = ({
|
|
|
19
20
|
color,
|
|
20
21
|
tall,
|
|
21
22
|
id,
|
|
23
|
+
testid,
|
|
22
24
|
...props
|
|
23
25
|
}: SubheaderProps) => {
|
|
24
26
|
const Element = as;
|
|
25
27
|
return (
|
|
26
28
|
<Element
|
|
27
29
|
id={id}
|
|
30
|
+
data-testid={testid}
|
|
28
31
|
className={clsx(
|
|
29
32
|
typography.subheader,
|
|
30
33
|
className,
|
|
@@ -9,6 +9,7 @@ interface TextareaProps
|
|
|
9
9
|
"children" | "dangerouslySetInnerHTML" | "id"
|
|
10
10
|
> {
|
|
11
11
|
id?: string;
|
|
12
|
+
testid?: string;
|
|
12
13
|
label?: string;
|
|
13
14
|
error?: boolean;
|
|
14
15
|
caption?: ReactNode;
|
|
@@ -40,6 +41,7 @@ const textareaReadOnlyClass = clsx(
|
|
|
40
41
|
|
|
41
42
|
export const Textarea = ({
|
|
42
43
|
id,
|
|
44
|
+
testid,
|
|
43
45
|
label,
|
|
44
46
|
error,
|
|
45
47
|
caption,
|
|
@@ -80,6 +82,7 @@ export const Textarea = ({
|
|
|
80
82
|
{...props}
|
|
81
83
|
{...attributes}
|
|
82
84
|
id={id}
|
|
85
|
+
data-testid={testid}
|
|
83
86
|
className={clsx(
|
|
84
87
|
"disabled:text-text-primary-disabled",
|
|
85
88
|
typography.paragraph,
|
|
@@ -91,7 +94,7 @@ export const Textarea = ({
|
|
|
91
94
|
)}
|
|
92
95
|
></textarea>
|
|
93
96
|
|
|
94
|
-
{caption && <div id={id ? `${id}-caption` : undefined}>{caption}</div>}
|
|
97
|
+
{caption && <div id={id ? `${id}-caption` : undefined} data-testid={testid ? `${testid}-caption` : undefined}>{caption}</div>}
|
|
95
98
|
</label>
|
|
96
99
|
);
|
|
97
100
|
};
|
package/src/components/Theme.tsx
CHANGED
|
@@ -2,16 +2,19 @@ export function Theme({
|
|
|
2
2
|
theme,
|
|
3
3
|
children,
|
|
4
4
|
id,
|
|
5
|
+
testid,
|
|
5
6
|
ref,
|
|
6
7
|
}: {
|
|
7
8
|
theme: "auto" | "brand";
|
|
8
9
|
children: React.ReactNode;
|
|
9
10
|
id?: string;
|
|
11
|
+
testid?: string;
|
|
10
12
|
ref?: React.RefObject<HTMLDivElement | null>;
|
|
11
13
|
}) {
|
|
12
14
|
return (
|
|
13
15
|
<div
|
|
14
16
|
id={id}
|
|
17
|
+
data-testid={testid}
|
|
15
18
|
className="contents"
|
|
16
19
|
data-theme={theme}
|
|
17
20
|
ref={(e) => {
|
package/src/components/Time.tsx
CHANGED
|
@@ -14,6 +14,7 @@ type TimeProps = {
|
|
|
14
14
|
caption?: ReactNode;
|
|
15
15
|
format?: "12h" | "24h";
|
|
16
16
|
id?: string;
|
|
17
|
+
testid?: string;
|
|
17
18
|
} & Omit<
|
|
18
19
|
ComponentProps<"input">,
|
|
19
20
|
"type" | "children" | "dangerouslySetInnerHTML" | "id"
|
|
@@ -21,7 +22,7 @@ type TimeProps = {
|
|
|
21
22
|
|
|
22
23
|
const timePickerScrollableStyle = "overflow-auto max-h-full py-4 no-scrollbar";
|
|
23
24
|
|
|
24
|
-
export const Time = ({ onChange, format = "12h", id, ...props }: TimeProps) => {
|
|
25
|
+
export const Time = ({ onChange, format = "12h", id, testid, ...props }: TimeProps) => {
|
|
25
26
|
const [showTimePicker, setShowTimePicker] = useState(false);
|
|
26
27
|
const [hasInteracted, setHasInteracted] = useState(false);
|
|
27
28
|
const inputRef = useRef<HTMLInputElement>(null);
|
|
@@ -306,6 +307,7 @@ export const Time = ({ onChange, format = "12h", id, ...props }: TimeProps) => {
|
|
|
306
307
|
<TimeCell
|
|
307
308
|
key={val}
|
|
308
309
|
id={id ? `${id}-${type}-${val}` : undefined}
|
|
310
|
+
testid={testid ? `${testid}-${type}-${val}` : undefined}
|
|
309
311
|
selected={isSelected}
|
|
310
312
|
ref={
|
|
311
313
|
isSelected
|
|
@@ -327,6 +329,7 @@ export const Time = ({ onChange, format = "12h", id, ...props }: TimeProps) => {
|
|
|
327
329
|
<InputBase
|
|
328
330
|
{...props}
|
|
329
331
|
id={id}
|
|
332
|
+
testid={testid}
|
|
330
333
|
ref={inputRef}
|
|
331
334
|
inputContainerRef={inputContainerRef}
|
|
332
335
|
value={inputValue}
|
|
@@ -391,6 +394,7 @@ export const Time = ({ onChange, format = "12h", id, ...props }: TimeProps) => {
|
|
|
391
394
|
|
|
392
395
|
type TimeCellProps = {
|
|
393
396
|
id?: string;
|
|
397
|
+
testid?: string;
|
|
394
398
|
selected?: boolean;
|
|
395
399
|
children?: React.ReactNode;
|
|
396
400
|
start?: boolean;
|
|
@@ -407,6 +411,7 @@ type TimeCellProps = {
|
|
|
407
411
|
|
|
408
412
|
function TimeCell({
|
|
409
413
|
id,
|
|
414
|
+
testid,
|
|
410
415
|
selected = false,
|
|
411
416
|
start = false,
|
|
412
417
|
intermediate = false,
|
|
@@ -426,6 +431,7 @@ function TimeCell({
|
|
|
426
431
|
return (
|
|
427
432
|
<button
|
|
428
433
|
id={id}
|
|
434
|
+
data-testid={testid}
|
|
429
435
|
onPointerOver={onHover}
|
|
430
436
|
onClick={onClick}
|
|
431
437
|
onKeyDown={onKeyDown}
|