@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
|
@@ -57,6 +57,7 @@ const NO_RESULTS_HEIGHT = "h-[120px]";
|
|
|
57
57
|
|
|
58
58
|
export function DataGrid<T extends Record<string, unknown>>({
|
|
59
59
|
id,
|
|
60
|
+
testid,
|
|
60
61
|
data,
|
|
61
62
|
columns,
|
|
62
63
|
status,
|
|
@@ -329,6 +330,7 @@ export function DataGrid<T extends Record<string, unknown>>({
|
|
|
329
330
|
>
|
|
330
331
|
<div
|
|
331
332
|
id={id}
|
|
333
|
+
data-testid={testid}
|
|
332
334
|
className="flex flex-col flex-1 h-full w-full rounded border border-border-primary-normal overflow-hidden text-text-primary-normal"
|
|
333
335
|
>
|
|
334
336
|
<div
|
|
@@ -339,6 +341,7 @@ export function DataGrid<T extends Record<string, unknown>>({
|
|
|
339
341
|
ref={containerRef}
|
|
340
342
|
>
|
|
341
343
|
<PinnedColumns
|
|
344
|
+
testid={testid}
|
|
342
345
|
pinDirection="left"
|
|
343
346
|
table={table}
|
|
344
347
|
tableContainerRef={containerRef}
|
|
@@ -352,7 +355,7 @@ export function DataGrid<T extends Record<string, unknown>>({
|
|
|
352
355
|
<table className="flex-1 flex flex-col min-h-min">
|
|
353
356
|
<thead className="sticky top-0 z-10 grid">
|
|
354
357
|
{table.getCenterHeaderGroups().map((headerGroup) => (
|
|
355
|
-
<tr key={headerGroup.id} className="flex w-full">
|
|
358
|
+
<tr data-testid={testid ? `${testid}-header-row-${headerGroup.id}` : undefined} key={headerGroup.id} className="flex w-full">
|
|
356
359
|
{virtualPaddingLeft ? (
|
|
357
360
|
// fake empty column to the left for virtualization scroll padding
|
|
358
361
|
<th
|
|
@@ -378,6 +381,7 @@ export function DataGrid<T extends Record<string, unknown>>({
|
|
|
378
381
|
<DraggableCellHeader
|
|
379
382
|
key={header.id}
|
|
380
383
|
id={id ? `${id}-header-${header.id}` : undefined}
|
|
384
|
+
testid={testid ? `${testid}-header-${header.id}` : undefined}
|
|
381
385
|
header={header}
|
|
382
386
|
locked={header.column.columnDef.meta?.locked}
|
|
383
387
|
center={centerHeader}
|
|
@@ -442,6 +446,7 @@ export function DataGrid<T extends Record<string, unknown>>({
|
|
|
442
446
|
{header.column.columnDef.meta?.checkbox ? (
|
|
443
447
|
<DataGridCell
|
|
444
448
|
id={id ? `${id}-header-${header.id}` : undefined}
|
|
449
|
+
testid={testid ? `${testid}-header-${header.id}` : undefined}
|
|
445
450
|
type="header"
|
|
446
451
|
component="checkbox" locked
|
|
447
452
|
>
|
|
@@ -449,6 +454,9 @@ export function DataGrid<T extends Record<string, unknown>>({
|
|
|
449
454
|
id={
|
|
450
455
|
id ? `${id}-select-all-checkbox` : undefined
|
|
451
456
|
}
|
|
457
|
+
testid={
|
|
458
|
+
testid ? `${testid}-select-all-checkbox` : undefined
|
|
459
|
+
}
|
|
452
460
|
checked={allSelectedAcrossPages}
|
|
453
461
|
indeterminate={someSelectedAcrossPages}
|
|
454
462
|
onChange={toggleSelectAllAcrossPages}
|
|
@@ -473,6 +481,7 @@ export function DataGrid<T extends Record<string, unknown>>({
|
|
|
473
481
|
{enableColumnSelector && (
|
|
474
482
|
<ColumnSelectorHeaderCell
|
|
475
483
|
id={id ? `${id}-column-selector` : undefined}
|
|
484
|
+
testid={testid ? `${testid}-column-selector` : undefined}
|
|
476
485
|
table={table}
|
|
477
486
|
toggleColumnVisibility={toggleColumnVisibility}
|
|
478
487
|
resetColumnVisibility={resetColumnVisibility}
|
|
@@ -484,6 +493,7 @@ export function DataGrid<T extends Record<string, unknown>>({
|
|
|
484
493
|
|
|
485
494
|
<TableBody
|
|
486
495
|
id={id}
|
|
496
|
+
testid={testid}
|
|
487
497
|
columnVirtualizer={columnVirtualizer}
|
|
488
498
|
table={table}
|
|
489
499
|
tableContainerRef={containerRef}
|
|
@@ -498,6 +508,7 @@ export function DataGrid<T extends Record<string, unknown>>({
|
|
|
498
508
|
</table>
|
|
499
509
|
|
|
500
510
|
<PinnedColumns
|
|
511
|
+
testid={testid}
|
|
501
512
|
pinDirection="right"
|
|
502
513
|
table={table}
|
|
503
514
|
tableContainerRef={containerRef}
|
|
@@ -517,6 +528,7 @@ export function DataGrid<T extends Record<string, unknown>>({
|
|
|
517
528
|
componentGap,
|
|
518
529
|
componentPadding,
|
|
519
530
|
)}
|
|
531
|
+
data-testid={testid ? `${testid}-no-results` : undefined}
|
|
520
532
|
>
|
|
521
533
|
<Subheader color="text-secondary-normal">No Results</Subheader>
|
|
522
534
|
<Paragraph color="text-secondary-normal">
|
|
@@ -532,6 +544,7 @@ export function DataGrid<T extends Record<string, unknown>>({
|
|
|
532
544
|
<div className="flex items-center gap-1 w-min">
|
|
533
545
|
<Select
|
|
534
546
|
id={id ? `${id}-pagesize-select` : undefined}
|
|
547
|
+
testid={testid ? `${testid}-pagesize-select` : undefined}
|
|
535
548
|
wrapperClassName="!w-20"
|
|
536
549
|
value={pagination.pageSize.toString()}
|
|
537
550
|
onChange={(e) =>
|
|
@@ -541,6 +554,7 @@ export function DataGrid<T extends Record<string, unknown>>({
|
|
|
541
554
|
<Menu
|
|
542
555
|
{...props}
|
|
543
556
|
id={id ? `${id}-pagesize-menu` : undefined}
|
|
557
|
+
testid={testid ? `${testid}-pagesize-menu` : undefined}
|
|
544
558
|
>
|
|
545
559
|
{PAGE_SIZE_OPTIONS.map((option) => (
|
|
546
560
|
<MenuOption
|
|
@@ -567,6 +581,7 @@ export function DataGrid<T extends Record<string, unknown>>({
|
|
|
567
581
|
<div className="flex items-center gap-2">
|
|
568
582
|
<Button
|
|
569
583
|
id={id ? `${id}-prev-page-button` : undefined}
|
|
584
|
+
testid={testid ? `${testid}-prev-page-button` : undefined}
|
|
570
585
|
iconOnly
|
|
571
586
|
leftIcon={<Icon name="chevron_left" />}
|
|
572
587
|
onClick={() =>
|
|
@@ -585,6 +600,7 @@ export function DataGrid<T extends Record<string, unknown>>({
|
|
|
585
600
|
</Paragraph>
|
|
586
601
|
<Button
|
|
587
602
|
id={id ? `${id}-next-page-button` : undefined}
|
|
603
|
+
testid={testid ? `${testid}-next-page-button` : undefined}
|
|
588
604
|
iconOnly
|
|
589
605
|
leftIcon={<Icon name="chevron_right" />}
|
|
590
606
|
onClick={() =>
|
|
@@ -600,7 +616,7 @@ export function DataGrid<T extends Record<string, unknown>>({
|
|
|
600
616
|
</div>
|
|
601
617
|
)}
|
|
602
618
|
|
|
603
|
-
{status && <Paragraph>{status}</Paragraph>}
|
|
619
|
+
{status && <Paragraph testid={testid ? `${testid}-status-text` : undefined}>{status}</Paragraph>}
|
|
604
620
|
</div>
|
|
605
621
|
)}
|
|
606
622
|
</div>
|
|
@@ -33,6 +33,7 @@ type Tags = "td" | "th";
|
|
|
33
33
|
|
|
34
34
|
type DataGridCellProps = PropsWithChildren<{
|
|
35
35
|
id?: string;
|
|
36
|
+
testid?: string;
|
|
36
37
|
type?: "default" | "header" | "summary";
|
|
37
38
|
component?: "header" | "checkbox" | "icon" | "button" | "static" | "input";
|
|
38
39
|
locked?: boolean;
|
|
@@ -62,6 +63,7 @@ export const DataGridCell = memo(
|
|
|
62
63
|
warning,
|
|
63
64
|
center,
|
|
64
65
|
width,
|
|
66
|
+
testid,
|
|
65
67
|
...props
|
|
66
68
|
}: AsProps<Tags> & DataGridCellProps) => {
|
|
67
69
|
const Element = type === "header" ? "th" : "td";
|
|
@@ -167,6 +169,7 @@ export const DataGridCell = memo(
|
|
|
167
169
|
return (
|
|
168
170
|
<Element
|
|
169
171
|
id={id}
|
|
172
|
+
data-testid={testid}
|
|
170
173
|
className={clsx("flex h-10", !width && "flex-1")}
|
|
171
174
|
style={{ width }}
|
|
172
175
|
{...props}
|
|
@@ -210,6 +213,7 @@ export function DataCellHeader<T>({
|
|
|
210
213
|
setNodeRef,
|
|
211
214
|
node,
|
|
212
215
|
id,
|
|
216
|
+
testid,
|
|
213
217
|
useMenuDefaultMinWidth,
|
|
214
218
|
...props
|
|
215
219
|
}: DataGridCellHeaderProps<T>) {
|
|
@@ -264,6 +268,7 @@ export function DataCellHeader<T>({
|
|
|
264
268
|
return (
|
|
265
269
|
<DataGridCell
|
|
266
270
|
id={id}
|
|
271
|
+
testid={testid}
|
|
267
272
|
ref={setNodeRef ? setNodeRef : ref}
|
|
268
273
|
type="header"
|
|
269
274
|
component="header"
|
|
@@ -277,6 +282,7 @@ export function DataCellHeader<T>({
|
|
|
277
282
|
{header.column.getCanFilter() && (
|
|
278
283
|
<Menu
|
|
279
284
|
id={id ? `${id}-menu` : undefined}
|
|
285
|
+
testid={testid ? `${testid}-menu` : undefined}
|
|
280
286
|
ref={menuRootRef}
|
|
281
287
|
positionTo={node ? node : ref}
|
|
282
288
|
show={showMenu}
|
|
@@ -286,10 +292,12 @@ export function DataCellHeader<T>({
|
|
|
286
292
|
>
|
|
287
293
|
<MenuOption
|
|
288
294
|
id={id ? `${id}-filter-option` : undefined}
|
|
295
|
+
testid={testid ? `${testid}-filter-option` : undefined}
|
|
289
296
|
{...subMenuListeners}
|
|
290
297
|
subMenu={({ menuId, subMenuLevel, ...props }) => (
|
|
291
298
|
<Menu
|
|
292
299
|
id={id ? `${id}-filter-submenu` : undefined}
|
|
300
|
+
testid={testid ? `${testid}-filter-submenu` : undefined}
|
|
293
301
|
{...props}
|
|
294
302
|
show={isMenuActive(menuId, subMenuLevel)}
|
|
295
303
|
ref={(el) => {
|
|
@@ -300,6 +308,7 @@ export function DataCellHeader<T>({
|
|
|
300
308
|
<div className={clsx(paddingUsingComponentGap)}>
|
|
301
309
|
<Search
|
|
302
310
|
id={id ? `${id}-filter-search` : undefined}
|
|
311
|
+
testid={testid ? `${testid}-filter-search` : undefined}
|
|
303
312
|
onChange={(event) => {
|
|
304
313
|
setFilter(event.target.value);
|
|
305
314
|
}}
|
|
@@ -314,6 +323,7 @@ export function DataCellHeader<T>({
|
|
|
314
323
|
|
|
315
324
|
<MenuOption
|
|
316
325
|
id={id ? `${id}-filter-contains` : undefined}
|
|
326
|
+
testid={testid ? `${testid}-filter-contains` : undefined}
|
|
317
327
|
onClick={handleFilterFnChange}
|
|
318
328
|
before={menuOptionIcon("includesString")}
|
|
319
329
|
>
|
|
@@ -322,6 +332,7 @@ export function DataCellHeader<T>({
|
|
|
322
332
|
|
|
323
333
|
<MenuOption
|
|
324
334
|
id={id ? `${id}-filter-startswith` : undefined}
|
|
335
|
+
testid={testid ? `${testid}-filter-startswith` : undefined}
|
|
325
336
|
onClick={handleFilterFnChange}
|
|
326
337
|
before={menuOptionIcon("startsWith")}
|
|
327
338
|
>
|
|
@@ -330,6 +341,7 @@ export function DataCellHeader<T>({
|
|
|
330
341
|
|
|
331
342
|
<MenuOption
|
|
332
343
|
id={id ? `${id}-filter-endswith` : undefined}
|
|
344
|
+
testid={testid ? `${testid}-filter-endswith` : undefined}
|
|
333
345
|
onClick={handleFilterFnChange}
|
|
334
346
|
before={menuOptionIcon("endsWith")}
|
|
335
347
|
>
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
|
|
15
15
|
type DateInputProps = Omit<InputBaseProps, "id"> & {
|
|
16
16
|
id?: string;
|
|
17
|
+
testid?: string;
|
|
17
18
|
/**
|
|
18
19
|
* Value in the format "YYYY-MM-DD" or empty string.
|
|
19
20
|
* When enableRangeInSingleMode is true, this should be in format "YYYY-MM-DD|YYYY-MM-DD"
|
|
@@ -42,6 +43,7 @@ type DateInputProps = Omit<InputBaseProps, "id"> & {
|
|
|
42
43
|
|
|
43
44
|
export const DateInput = ({
|
|
44
45
|
id,
|
|
46
|
+
testid,
|
|
45
47
|
value,
|
|
46
48
|
onChange,
|
|
47
49
|
placeholder = "MM/DD/YYYY",
|
|
@@ -230,6 +232,7 @@ export const DateInput = ({
|
|
|
230
232
|
<div className="relative">
|
|
231
233
|
<InputBase
|
|
232
234
|
id={id}
|
|
235
|
+
testid={testid}
|
|
233
236
|
ref={(el) => {
|
|
234
237
|
triggerRef.current = el;
|
|
235
238
|
}}
|
|
@@ -262,6 +265,7 @@ export const DateInput = ({
|
|
|
262
265
|
>
|
|
263
266
|
<CalendarRange
|
|
264
267
|
id={id ? `${id}-calendar` : undefined}
|
|
268
|
+
testid={testid ? `${testid}-calendar` : undefined}
|
|
265
269
|
from={from}
|
|
266
270
|
to={to || from}
|
|
267
271
|
onChange={handleDateChange}
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
|
|
16
16
|
type DateRangeInputProps = Omit<InputBaseProps, "id"> & {
|
|
17
17
|
id?: string;
|
|
18
|
+
testid?: string;
|
|
18
19
|
/**
|
|
19
20
|
* Value in the format "YYYY-MM-DD|YYYY-MM-DD" or empty string
|
|
20
21
|
*/
|
|
@@ -45,6 +46,7 @@ type DateRangeInputProps = Omit<InputBaseProps, "id"> & {
|
|
|
45
46
|
|
|
46
47
|
export const DateRangeInput = ({
|
|
47
48
|
id,
|
|
49
|
+
testid,
|
|
48
50
|
value,
|
|
49
51
|
onChange,
|
|
50
52
|
placeholder = "MM/DD/YYYY - MM/DD/YYYY",
|
|
@@ -576,6 +578,7 @@ export const DateRangeInput = ({
|
|
|
576
578
|
<div className="relative">
|
|
577
579
|
<InputBase
|
|
578
580
|
id={id}
|
|
581
|
+
testid={testid}
|
|
579
582
|
ref={(el) => {
|
|
580
583
|
triggerRef.current = el;
|
|
581
584
|
}}
|
|
@@ -608,6 +611,7 @@ export const DateRangeInput = ({
|
|
|
608
611
|
>
|
|
609
612
|
<CalendarRange
|
|
610
613
|
id={id ? `${id}-calendar` : undefined}
|
|
614
|
+
testid={testid ? `${testid}-calendar` : undefined}
|
|
611
615
|
from={from}
|
|
612
616
|
to={to}
|
|
613
617
|
onChange={handleRangeChange}
|
|
@@ -10,6 +10,7 @@ type DisplayProps = {
|
|
|
10
10
|
as?: Tags;
|
|
11
11
|
variant?: DisplayVariant;
|
|
12
12
|
id?: string;
|
|
13
|
+
testid?: string;
|
|
13
14
|
} & AsProps<Tags> &
|
|
14
15
|
TextAttributes &
|
|
15
16
|
TypographyProps;
|
|
@@ -22,6 +23,7 @@ export const Display = ({
|
|
|
22
23
|
align,
|
|
23
24
|
variant = "display1",
|
|
24
25
|
id,
|
|
26
|
+
testid,
|
|
25
27
|
...props
|
|
26
28
|
}: DisplayProps) => {
|
|
27
29
|
const defaultElement = variant === "display1" ? "h1" : "h2";
|
|
@@ -30,6 +32,7 @@ export const Display = ({
|
|
|
30
32
|
return (
|
|
31
33
|
<Element
|
|
32
34
|
id={id}
|
|
35
|
+
data-testid={testid}
|
|
33
36
|
className={clsx(
|
|
34
37
|
typography[variant],
|
|
35
38
|
className,
|
|
@@ -20,6 +20,7 @@ import { Icon } from "./Icon";
|
|
|
20
20
|
|
|
21
21
|
type FilterGroupProps = {
|
|
22
22
|
id?: string;
|
|
23
|
+
testid?: string;
|
|
23
24
|
label: string;
|
|
24
25
|
open?: boolean;
|
|
25
26
|
showMore?: boolean;
|
|
@@ -41,6 +42,7 @@ type FilterGroupProps = {
|
|
|
41
42
|
|
|
42
43
|
export const FilterGroup = ({
|
|
43
44
|
id,
|
|
45
|
+
testid,
|
|
44
46
|
label,
|
|
45
47
|
type = "link",
|
|
46
48
|
open = false,
|
|
@@ -73,6 +75,7 @@ export const FilterGroup = ({
|
|
|
73
75
|
return (
|
|
74
76
|
<div
|
|
75
77
|
id={id}
|
|
78
|
+
data-testid={testid}
|
|
76
79
|
{...props}
|
|
77
80
|
className={clsx(
|
|
78
81
|
"border-b border-border-primary-normal",
|
|
@@ -103,6 +106,7 @@ export const FilterGroup = ({
|
|
|
103
106
|
) : (
|
|
104
107
|
<Link
|
|
105
108
|
id={id ? `${id}-clear-all` : undefined}
|
|
109
|
+
testid={testid ? `${testid}-clear-all` : undefined}
|
|
106
110
|
className={clsx("block", componentPaddingY)}
|
|
107
111
|
onClick={handleClearAll}
|
|
108
112
|
>
|
|
@@ -132,6 +136,7 @@ export const FilterGroup = ({
|
|
|
132
136
|
{!isSummary && showSearchField && (
|
|
133
137
|
<Search
|
|
134
138
|
id={id ? `${id}-search` : undefined}
|
|
139
|
+
testid={testid ? `${testid}-search` : undefined}
|
|
135
140
|
style={{ marginBottom: "2px" }}
|
|
136
141
|
onChange={onSearchChange}
|
|
137
142
|
value={searchValue}
|
|
@@ -144,6 +149,7 @@ export const FilterGroup = ({
|
|
|
144
149
|
{showShowMoreLink && (
|
|
145
150
|
<Link
|
|
146
151
|
id={id ? `${id}-show-more` : undefined}
|
|
152
|
+
testid={testid ? `${testid}-show-more` : undefined}
|
|
147
153
|
className={clsx("block", "!items-start", componentPaddingY)}
|
|
148
154
|
onClick={handleOnShowMore}
|
|
149
155
|
>
|
|
@@ -175,12 +181,14 @@ export const FilterGroup = ({
|
|
|
175
181
|
|
|
176
182
|
type FilterGroupItemProps = {
|
|
177
183
|
id?: string;
|
|
184
|
+
testid?: string;
|
|
178
185
|
count?: number;
|
|
179
186
|
type?: FilterGroupProps["type"];
|
|
180
187
|
};
|
|
181
188
|
|
|
182
189
|
export const FilterGroupItem = ({
|
|
183
190
|
id,
|
|
191
|
+
testid,
|
|
184
192
|
type = "link",
|
|
185
193
|
children,
|
|
186
194
|
onClick,
|
|
@@ -189,6 +197,7 @@ export const FilterGroupItem = ({
|
|
|
189
197
|
return (
|
|
190
198
|
<div
|
|
191
199
|
id={id}
|
|
200
|
+
data-testid={testid}
|
|
192
201
|
onClick={handleClick}
|
|
193
202
|
{...props}
|
|
194
203
|
className={clsx(
|
|
@@ -201,6 +210,7 @@ export const FilterGroupItem = ({
|
|
|
201
210
|
<FilterGroupItemChildComponent
|
|
202
211
|
{...props}
|
|
203
212
|
id={id ? `${id}-child` : undefined}
|
|
213
|
+
data-testid={testid ? `${testid}-child` : undefined}
|
|
204
214
|
type={type}
|
|
205
215
|
count={props.count}
|
|
206
216
|
>
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
export function FullViewportLayout({
|
|
2
2
|
children,
|
|
3
3
|
id,
|
|
4
|
+
testid,
|
|
4
5
|
}: {
|
|
5
6
|
children: React.ReactNode;
|
|
6
7
|
id?: string;
|
|
8
|
+
testid?: string;
|
|
7
9
|
}) {
|
|
8
10
|
return (
|
|
9
11
|
<div
|
|
10
12
|
id={id}
|
|
13
|
+
data-testid={testid}
|
|
11
14
|
className="flex flex-col min-h-screen min-w-screen p-mobile-container-padding desktop:p-desktop-container-padding compact:p-desktop-compact-container-padding items-center justify-center bg-background-grouped-secondary-normal"
|
|
12
15
|
>
|
|
13
16
|
{children}
|
package/src/components/Grid.tsx
CHANGED
|
@@ -9,6 +9,7 @@ type GridProps = {
|
|
|
9
9
|
hasSideMenu?: boolean;
|
|
10
10
|
columns?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
11
11
|
id?: string;
|
|
12
|
+
testid?: string;
|
|
12
13
|
} & Omit<ComponentProps<"div">, "className">;
|
|
13
14
|
|
|
14
15
|
// Grid class configuration maps for better maintainability
|
|
@@ -89,11 +90,13 @@ export const Grid = ({
|
|
|
89
90
|
hasSideMenu = false,
|
|
90
91
|
columns,
|
|
91
92
|
id,
|
|
93
|
+
testid,
|
|
92
94
|
}: GridProps) => {
|
|
93
95
|
const childCount = Children.count(children);
|
|
94
96
|
return (
|
|
95
97
|
<div
|
|
96
98
|
id={id}
|
|
99
|
+
data-testid={testid}
|
|
97
100
|
className={clsx(
|
|
98
101
|
padding &&
|
|
99
102
|
sizing === "container" &&
|
|
@@ -10,6 +10,7 @@ type HeadingProps = {
|
|
|
10
10
|
as?: Tags;
|
|
11
11
|
variant?: HeadingVariant;
|
|
12
12
|
id?: string;
|
|
13
|
+
testid?: string;
|
|
13
14
|
} & AsProps<Tags> &
|
|
14
15
|
TextAttributes &
|
|
15
16
|
TypographyProps;
|
|
@@ -22,6 +23,7 @@ export const Heading = ({
|
|
|
22
23
|
align,
|
|
23
24
|
variant = "heading1",
|
|
24
25
|
id,
|
|
26
|
+
testid,
|
|
25
27
|
...props
|
|
26
28
|
}: HeadingProps) => {
|
|
27
29
|
const defaultElement =
|
|
@@ -31,6 +33,7 @@ export const Heading = ({
|
|
|
31
33
|
return (
|
|
32
34
|
<Element
|
|
33
35
|
id={id}
|
|
36
|
+
data-testid={testid}
|
|
34
37
|
className={clsx(
|
|
35
38
|
typography[variant],
|
|
36
39
|
className,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import clsx from "clsx";
|
|
2
2
|
|
|
3
|
-
export function HorizontalDivider({ id, hideOnMobile }: { id?: string, hideOnMobile?: boolean }) {
|
|
3
|
+
export function HorizontalDivider({ id, testid, hideOnMobile }: { id?: string, testid?: string, hideOnMobile?: boolean }) {
|
|
4
4
|
const hideOnMobileStyle = clsx(hideOnMobile && "hidden desktop:block")
|
|
5
5
|
|
|
6
6
|
return (
|
|
7
|
-
<hr id={id} className={clsx("w-full border-t border-border-primary-normal", hideOnMobileStyle)} />
|
|
7
|
+
<hr id={id} data-testid={testid} className={clsx("w-full border-t border-border-primary-normal", hideOnMobileStyle)} />
|
|
8
8
|
);
|
|
9
9
|
}
|
package/src/components/Icon.tsx
CHANGED
|
@@ -6,12 +6,14 @@ type IconProps = {
|
|
|
6
6
|
name: string;
|
|
7
7
|
size?: IconSize;
|
|
8
8
|
variant?: "outline" | "filled";
|
|
9
|
+
testid?: string;
|
|
9
10
|
} & Omit<ComponentProps<"span">, "name">;
|
|
10
11
|
|
|
11
12
|
export function Icon({
|
|
12
13
|
name,
|
|
13
14
|
size = 24,
|
|
14
15
|
variant = "outline",
|
|
16
|
+
testid,
|
|
15
17
|
...props
|
|
16
18
|
}: IconProps) {
|
|
17
19
|
const variantStyle = variant === "filled" ? '"FILL" 1' : '"FILL" 0';
|
|
@@ -19,6 +21,7 @@ export function Icon({
|
|
|
19
21
|
return (
|
|
20
22
|
<span
|
|
21
23
|
{...props}
|
|
24
|
+
data-testid={testid}
|
|
22
25
|
className={clsx(
|
|
23
26
|
"icon",
|
|
24
27
|
`icon-${size}`,
|
package/src/components/Input.tsx
CHANGED
|
@@ -42,6 +42,7 @@ export type InputFormatting = {
|
|
|
42
42
|
|
|
43
43
|
export type InputBaseProps = {
|
|
44
44
|
id?: string;
|
|
45
|
+
testid?: string;
|
|
45
46
|
after?: ReactNode;
|
|
46
47
|
before?: ReactNode;
|
|
47
48
|
label?: string;
|
|
@@ -61,6 +62,7 @@ export type InputBaseProps = {
|
|
|
61
62
|
|
|
62
63
|
export const InputBase = ({
|
|
63
64
|
id,
|
|
65
|
+
testid,
|
|
64
66
|
before,
|
|
65
67
|
after,
|
|
66
68
|
type,
|
|
@@ -132,6 +134,7 @@ export const InputBase = ({
|
|
|
132
134
|
return (
|
|
133
135
|
<label
|
|
134
136
|
id={id}
|
|
137
|
+
data-testid={testid}
|
|
135
138
|
htmlFor={inputId}
|
|
136
139
|
ref={inputContainerRef}
|
|
137
140
|
className={clsx(
|
|
@@ -188,6 +191,7 @@ export const InputBase = ({
|
|
|
188
191
|
{...props}
|
|
189
192
|
{...attributes}
|
|
190
193
|
id={inputId}
|
|
194
|
+
data-testid={testid ? `${testid}-input` : undefined}
|
|
191
195
|
className={clsx(
|
|
192
196
|
"flex-1 outline-none w-full max-w-full min-h-6 min-w-0",
|
|
193
197
|
"[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",
|
|
@@ -204,7 +208,7 @@ export const InputBase = ({
|
|
|
204
208
|
{after}
|
|
205
209
|
</div>
|
|
206
210
|
|
|
207
|
-
{caption && <div id={id ? `${id}-caption` : undefined}>{caption}</div>}
|
|
211
|
+
{caption && <div id={id ? `${id}-caption` : undefined} data-testid={testid ? `${testid}-caption` : undefined}>{caption}</div>}
|
|
208
212
|
</label>
|
|
209
213
|
);
|
|
210
214
|
};
|
|
@@ -219,42 +223,38 @@ export const Input = ({
|
|
|
219
223
|
onBlur,
|
|
220
224
|
onClear,
|
|
221
225
|
id,
|
|
226
|
+
testid,
|
|
222
227
|
...props
|
|
223
|
-
}: Omit<ComponentProps<"input">,
|
|
228
|
+
}: Omit<ComponentProps<"input">,"onChange" | "align" | "children"> &
|
|
224
229
|
InputBaseProps & {
|
|
225
|
-
value?: string | number;
|
|
226
230
|
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
227
231
|
onClear?: () => void;
|
|
228
232
|
}) => {
|
|
229
233
|
const [internalValue, setInternalValue] = useState("");
|
|
230
234
|
const [displayValue, setDisplayValue] = useState("");
|
|
231
235
|
|
|
232
|
-
// Initialize values based on variant
|
|
233
236
|
useEffect(() => {
|
|
234
237
|
const stringValue = propValue?.toString() ?? "";
|
|
238
|
+
setInternalValue(stringValue);
|
|
239
|
+
setDisplayValue(stringValue);
|
|
240
|
+
}, [propValue]);
|
|
235
241
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
const numValue =
|
|
246
|
-
typeof propValue === "string" ? parseFloat(propValue) : propValue;
|
|
247
|
-
if (!isNaN(numValue)) {
|
|
248
|
-
const formatted = numValue.toFixed(decimals ?? 2);
|
|
249
|
-
setInternalValue(formatted);
|
|
250
|
-
setDisplayValue(formatCurrencyDisplay(formatted));
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
} else {
|
|
254
|
-
setInternalValue(stringValue);
|
|
255
|
-
setDisplayValue(stringValue);
|
|
242
|
+
useEffect(() => {
|
|
243
|
+
if (variant !== 'currency') {
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
const stringValue = propValue?.toString() ?? "";
|
|
248
|
+
|
|
249
|
+
if (!stringValue) {
|
|
250
|
+
return;
|
|
256
251
|
}
|
|
257
|
-
|
|
252
|
+
|
|
253
|
+
const formatted = formatDecimalValue(stringValue, decimals ?? 2);
|
|
254
|
+
|
|
255
|
+
setInternalValue(formatted);
|
|
256
|
+
setDisplayValue(formatCurrencyDisplay(formatted));
|
|
257
|
+
}, [])
|
|
258
258
|
|
|
259
259
|
const getInputProps = () => {
|
|
260
260
|
const baseProps = {
|
|
@@ -329,6 +329,7 @@ export const Input = ({
|
|
|
329
329
|
return hasValue && !props.readOnly ? (
|
|
330
330
|
<Icon
|
|
331
331
|
id={id ? `${id}-clear-button` : undefined}
|
|
332
|
+
testid={testid ? `${testid}-clear-button` : undefined}
|
|
332
333
|
name="close"
|
|
333
334
|
onClick={handleSearchReset}
|
|
334
335
|
className="cursor-pointer absolute right-2 bottom-2/4 translate-y-2/4"
|
|
@@ -378,15 +379,6 @@ export const Input = ({
|
|
|
378
379
|
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
379
380
|
const rawValue = e.target.value;
|
|
380
381
|
|
|
381
|
-
if (variant === "search") {
|
|
382
|
-
setInternalValue(rawValue);
|
|
383
|
-
setDisplayValue(rawValue);
|
|
384
|
-
if (typeof onChange === "function") {
|
|
385
|
-
onChange(e);
|
|
386
|
-
}
|
|
387
|
-
return;
|
|
388
|
-
}
|
|
389
|
-
|
|
390
382
|
if (variant === "currency") {
|
|
391
383
|
const raw = rawValue.replace(/,/g, ""); // Remove commas for processing
|
|
392
384
|
|
|
@@ -433,6 +425,10 @@ export const Input = ({
|
|
|
433
425
|
};
|
|
434
426
|
|
|
435
427
|
const handleBlur = (e: React.FocusEvent<HTMLInputElement>) => {
|
|
428
|
+
if (!internalValue) {
|
|
429
|
+
return;
|
|
430
|
+
}
|
|
431
|
+
|
|
436
432
|
if (variant === "currency") {
|
|
437
433
|
const formatted = formatDecimalValue(internalValue, decimals ?? 2);
|
|
438
434
|
setInternalValue(formatted);
|
|
@@ -463,6 +459,7 @@ export const Input = ({
|
|
|
463
459
|
after={getAfterElement()}
|
|
464
460
|
onChange={handleChange}
|
|
465
461
|
onBlur={handleBlur}
|
|
462
|
+
testid={testid}
|
|
466
463
|
/>
|
|
467
464
|
);
|
|
468
465
|
};
|
|
@@ -486,10 +483,9 @@ export const UOM = (
|
|
|
486
483
|
export const Currency = (
|
|
487
484
|
props: Omit<
|
|
488
485
|
ComponentProps<"input">,
|
|
489
|
-
"
|
|
486
|
+
"onChange" | "align" | "children" | "id"
|
|
490
487
|
> &
|
|
491
488
|
InputBaseProps & {
|
|
492
|
-
value?: number;
|
|
493
489
|
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
494
490
|
},
|
|
495
491
|
) => {
|
|
@@ -7,6 +7,7 @@ import { componentGap, layoutGap } from "../classNames";
|
|
|
7
7
|
|
|
8
8
|
type InputGroupProps = {
|
|
9
9
|
id?: string;
|
|
10
|
+
testid?: string;
|
|
10
11
|
label: string;
|
|
11
12
|
orientation?: "vertical" | "horizontal";
|
|
12
13
|
error?: boolean;
|
|
@@ -15,6 +16,7 @@ type InputGroupProps = {
|
|
|
15
16
|
|
|
16
17
|
export const InputGroup = ({
|
|
17
18
|
id,
|
|
19
|
+
testid,
|
|
18
20
|
label,
|
|
19
21
|
orientation = "horizontal",
|
|
20
22
|
error = false,
|
|
@@ -24,11 +26,13 @@ export const InputGroup = ({
|
|
|
24
26
|
}: ComponentProps<"div"> & InputGroupProps) => {
|
|
25
27
|
const internalId = useId();
|
|
26
28
|
const labelId = id ? `${id}-label` : undefined;
|
|
29
|
+
const labelTestId = testid ? `${testid}-label` : undefined;
|
|
27
30
|
|
|
28
31
|
return (
|
|
29
|
-
<div id={id} {...props} className={clsx("flex flex-col", componentGap)}>
|
|
32
|
+
<div id={id} data-testid={testid} {...props} className={clsx("flex flex-col", componentGap)}>
|
|
30
33
|
<Label
|
|
31
34
|
id={labelId}
|
|
35
|
+
testid={labelTestId}
|
|
32
36
|
as="label"
|
|
33
37
|
className={clsx({ "!text-text-primary-error": error })}
|
|
34
38
|
htmlFor={internalId}
|
|
@@ -47,7 +51,7 @@ export const InputGroup = ({
|
|
|
47
51
|
{children}
|
|
48
52
|
</div>
|
|
49
53
|
|
|
50
|
-
{caption && <div id={id ? `${id}-caption` : undefined}>{caption}</div>}
|
|
54
|
+
{caption && <div id={id ? `${id}-caption` : undefined} data-testid={testid ? `${testid}-caption` : undefined}>{caption}</div>}
|
|
51
55
|
</div>
|
|
52
56
|
);
|
|
53
57
|
};
|