@dmsi/wedgekit-react 0.0.415 → 0.0.418

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.
Files changed (125) hide show
  1. package/dist/chunk-3HBYDOYE.js +114 -0
  2. package/dist/{chunk-JIMJIJOF.js → chunk-5TGP5EFM.js} +2 -2
  3. package/dist/{chunk-2HMCS25C.js → chunk-6LHBY2IH.js} +1 -1
  4. package/dist/{chunk-6I5LZ2ZC.js → chunk-7AXHAWJX.js} +3 -3
  5. package/dist/{chunk-MQX7GFLX.js → chunk-CANJ2YPW.js} +24 -6
  6. package/dist/{chunk-QQ5G773N.js → chunk-DCLNAUC4.js} +1 -1
  7. package/dist/{chunk-GB4ZTUQV.js → chunk-DTW7JCBR.js} +36 -0
  8. package/dist/chunk-ESCNCQGI.js +9 -0
  9. package/dist/chunk-IFHMGICR.js +66 -0
  10. package/dist/{chunk-ZHZIIVJN.js → chunk-IMOIZFJZ.js} +5 -5
  11. package/dist/chunk-KBJZUVLM.js +65 -0
  12. package/dist/{chunk-AA6GE3TH.js → chunk-LUPHOXAQ.js} +1 -1
  13. package/dist/{chunk-44TDIHUP.js → chunk-P3MIP2FD.js} +1 -1
  14. package/dist/{chunk-7ULLUUVJ.js → chunk-PQWWVBSR.js} +1 -1
  15. package/dist/{chunk-ERW5DEIO.js → chunk-RQLWSLVE.js} +1 -1
  16. package/dist/{chunk-BK7SPR6Y.js → chunk-TQIKP534.js} +4 -4
  17. package/dist/chunk-TYAQWVIM.js +159 -0
  18. package/dist/{chunk-KZZKQLKF.js → chunk-W55J2KJZ.js} +1 -1
  19. package/dist/chunk-Y2GK27RX.js +79 -0
  20. package/dist/components/Accordion.cjs +74 -2
  21. package/dist/components/Accordion.js +3 -3
  22. package/dist/components/CalendarRange.cjs +231 -53
  23. package/dist/components/CalendarRange.css +169 -65
  24. package/dist/components/CalendarRange.js +24 -16
  25. package/dist/components/Card.cjs +38 -2
  26. package/dist/components/Card.js +1 -1
  27. package/dist/components/CompactImagesPreview.cjs +59 -5
  28. package/dist/components/CompactImagesPreview.js +2 -2
  29. package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.cjs +189 -11
  30. package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.css +169 -65
  31. package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +24 -16
  32. package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.cjs +198 -20
  33. package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.css +169 -65
  34. package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +24 -16
  35. package/dist/components/DataGrid/PinnedColumns.cjs +214 -36
  36. package/dist/components/DataGrid/PinnedColumns.css +169 -65
  37. package/dist/components/DataGrid/PinnedColumns.js +24 -16
  38. package/dist/components/DataGrid/TableBody/LoadingCell.cjs +190 -12
  39. package/dist/components/DataGrid/TableBody/LoadingCell.css +169 -65
  40. package/dist/components/DataGrid/TableBody/LoadingCell.js +24 -16
  41. package/dist/components/DataGrid/TableBody/TableBodyRow.cjs +196 -18
  42. package/dist/components/DataGrid/TableBody/TableBodyRow.css +169 -65
  43. package/dist/components/DataGrid/TableBody/TableBodyRow.js +24 -16
  44. package/dist/components/DataGrid/TableBody/index.cjs +211 -33
  45. package/dist/components/DataGrid/TableBody/index.css +169 -65
  46. package/dist/components/DataGrid/TableBody/index.js +24 -16
  47. package/dist/components/DataGrid/index.cjs +300 -122
  48. package/dist/components/DataGrid/index.css +169 -65
  49. package/dist/components/DataGrid/index.js +24 -16
  50. package/dist/components/DataGrid/utils.cjs +190 -12
  51. package/dist/components/DataGrid/utils.css +169 -65
  52. package/dist/components/DataGrid/utils.js +24 -16
  53. package/dist/components/DateInput.cjs +250 -72
  54. package/dist/components/DateInput.css +169 -65
  55. package/dist/components/DateInput.js +24 -16
  56. package/dist/components/DateRangeInput.cjs +250 -72
  57. package/dist/components/DateRangeInput.css +169 -65
  58. package/dist/components/DateRangeInput.js +24 -16
  59. package/dist/components/Grid.cjs +81 -76
  60. package/dist/components/Grid.js +1 -1
  61. package/dist/components/ListGroup.cjs +553 -0
  62. package/dist/components/ListGroup.js +11 -0
  63. package/dist/components/MobileDataGrid/ColumnList.cjs +36 -0
  64. package/dist/components/MobileDataGrid/ColumnList.js +3 -3
  65. package/dist/components/MobileDataGrid/ColumnSelector/index.cjs +197 -19
  66. package/dist/components/MobileDataGrid/ColumnSelector/index.css +169 -65
  67. package/dist/components/MobileDataGrid/ColumnSelector/index.js +24 -16
  68. package/dist/components/MobileDataGrid/MobileDataGridCard/index.cjs +36 -0
  69. package/dist/components/MobileDataGrid/MobileDataGridCard/index.js +2 -2
  70. package/dist/components/MobileDataGrid/MobileDataGridHeader.cjs +241 -27
  71. package/dist/components/MobileDataGrid/MobileDataGridHeader.css +169 -65
  72. package/dist/components/MobileDataGrid/MobileDataGridHeader.js +24 -16
  73. package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.cjs +36 -0
  74. package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.js +2 -2
  75. package/dist/components/MobileDataGrid/RowDetailModalProvider/index.cjs +36 -0
  76. package/dist/components/MobileDataGrid/RowDetailModalProvider/index.js +5 -5
  77. package/dist/components/MobileDataGrid/index.cjs +743 -529
  78. package/dist/components/MobileDataGrid/index.css +169 -65
  79. package/dist/components/MobileDataGrid/index.js +24 -16
  80. package/dist/components/Modal.js +2 -2
  81. package/dist/components/Notification.cjs +36 -0
  82. package/dist/components/Notification.js +1 -1
  83. package/dist/components/PDFViewer/PDFElement.cjs +36 -0
  84. package/dist/components/PDFViewer/PDFElement.js +2 -2
  85. package/dist/components/PDFViewer/PDFNavigation.cjs +36 -0
  86. package/dist/components/PDFViewer/PDFNavigation.js +2 -2
  87. package/dist/components/PDFViewer/index.cjs +36 -0
  88. package/dist/components/PDFViewer/index.js +8 -111
  89. package/dist/components/Pagination.cjs +427 -0
  90. package/dist/components/Pagination.js +10 -0
  91. package/dist/components/ProductImagePreview/index.cjs +139 -127
  92. package/dist/components/ProductImagePreview/index.js +4 -4
  93. package/dist/components/SideMenuGroup.cjs +36 -0
  94. package/dist/components/SideMenuGroup.js +1 -1
  95. package/dist/components/SideMenuItem.cjs +36 -0
  96. package/dist/components/SideMenuItem.js +1 -1
  97. package/dist/components/SimpleTable.cjs +36 -0
  98. package/dist/components/SimpleTable.js +2 -2
  99. package/dist/components/SkeletonParagraph.js +3 -6
  100. package/dist/components/Stack.cjs +36 -0
  101. package/dist/components/Stack.js +1 -1
  102. package/dist/components/Swatch.cjs +36 -0
  103. package/dist/components/Swatch.js +1 -1
  104. package/dist/components/Time.cjs +36 -0
  105. package/dist/components/Time.js +1 -1
  106. package/dist/components/Tooltip.cjs +1 -1
  107. package/dist/components/Tooltip.js +1 -1
  108. package/dist/components/Upload.cjs +36 -0
  109. package/dist/components/Upload.js +1 -1
  110. package/dist/components/index.cjs +694 -131
  111. package/dist/components/index.css +169 -65
  112. package/dist/components/index.js +37 -17
  113. package/dist/index.css +169 -65
  114. package/package.json +1 -1
  115. package/src/components/Card.tsx +60 -2
  116. package/src/components/CompactImagesPreview.tsx +54 -30
  117. package/src/components/Grid.tsx +59 -91
  118. package/src/components/ListGroup.tsx +82 -0
  119. package/src/components/Pagination.tsx +182 -0
  120. package/src/components/Stack.tsx +76 -0
  121. package/src/components/Tooltip.tsx +4 -3
  122. package/src/components/index.ts +4 -0
  123. package/dist/chunk-ER6RCOH3.js +0 -97
  124. package/dist/chunk-EZCH4PQS.js +0 -29
  125. package/dist/{chunk-D6YCMQPO.js → chunk-SBCFBHNG.js} +3 -3
@@ -496,6 +496,10 @@ var Stack = (_a) => {
496
496
  padding,
497
497
  paddingX,
498
498
  paddingY,
499
+ paddingBottom,
500
+ paddingTop,
501
+ paddingLeft,
502
+ paddingRight,
499
503
  margin,
500
504
  marginX,
501
505
  marginY,
@@ -511,6 +515,10 @@ var Stack = (_a) => {
511
515
  height,
512
516
  maxHeight,
513
517
  borderColor,
518
+ borderTopColor,
519
+ borderRightColor,
520
+ borderBottomColor,
521
+ borderLeftColor,
514
522
  backgroundColor,
515
523
  sizing = "none",
516
524
  overflowY = "inherit",
@@ -536,6 +544,10 @@ var Stack = (_a) => {
536
544
  "padding",
537
545
  "paddingX",
538
546
  "paddingY",
547
+ "paddingBottom",
548
+ "paddingTop",
549
+ "paddingLeft",
550
+ "paddingRight",
539
551
  "margin",
540
552
  "marginX",
541
553
  "marginY",
@@ -551,6 +563,10 @@ var Stack = (_a) => {
551
563
  "height",
552
564
  "maxHeight",
553
565
  "borderColor",
566
+ "borderTopColor",
567
+ "borderRightColor",
568
+ "borderBottomColor",
569
+ "borderLeftColor",
554
570
  "backgroundColor",
555
571
  "sizing",
556
572
  "overflowY",
@@ -586,6 +602,10 @@ var Stack = (_a) => {
586
602
  width: width !== void 0 && typeof width === "number" ? `${width}px` : void 0,
587
603
  minWidth: minWidth !== void 0 ? `${minWidth}px` : void 0,
588
604
  border: borderColor ? `1px solid var(--color-${borderColor})` : void 0,
605
+ borderTop: borderTopColor ? `1px solid var(--color-${borderTopColor})` : void 0,
606
+ borderRight: borderRightColor ? `1px solid var(--color-${borderRightColor})` : void 0,
607
+ borderBottom: borderBottomColor ? `1px solid var(--color-${borderBottomColor})` : void 0,
608
+ borderLeft: borderLeftColor ? `1px solid var(--color-${borderLeftColor})` : void 0,
589
609
  backgroundColor: backgroundColor ? `var(--color-${backgroundColor})` : void 0,
590
610
  flexGrow: flexGrow !== void 0 ? flexGrow : void 0,
591
611
  flexShrink: flexShrink !== void 0 ? flexShrink : void 0,
@@ -625,6 +645,22 @@ var Stack = (_a) => {
625
645
  paddingY && sizing === "layout" && "py-mobile-layout-padding desktop:py-desktop-layout-padding compact:py-desktop-compact-layout-padding",
626
646
  paddingY && sizing === "layout-group" && paddingYUsingLayoutGroupGap,
627
647
  paddingY && sizing === "component" && "py-mobile-component-padding desktop:py-desktop-component-padding compact:py-desktop-compact-component-padding",
648
+ paddingBottom && sizing === "container" && "pb-mobile-container-padding desktop:pb-desktop-container-padding compact:pb-desktop-compact-container-padding",
649
+ paddingBottom && sizing === "layout" && "pb-mobile-layout-padding desktop:pb-desktop-layout-padding compact:pb-desktop-compact-layout-padding",
650
+ paddingBottom && sizing === "layout-group" && "pb-mobile-layout-group-padding desktop:pb-desktop-layout-group-padding compact:pb-desktop-compact-layout-group-padding",
651
+ paddingBottom && sizing === "component" && "pb-mobile-component-padding desktop:pb-desktop-component-padding compact:pb-desktop-compact-component-padding",
652
+ paddingTop && sizing === "container" && "pt-mobile-container-padding desktop:pt-desktop-container-padding compact:pt-desktop-compact-container-padding",
653
+ paddingTop && sizing === "layout" && "pt-mobile-layout-padding desktop:pt-desktop-layout-padding compact:pt-desktop-compact-layout-padding",
654
+ paddingTop && sizing === "layout-group" && "pt-mobile-layout-group-padding desktop:pt-desktop-layout-group-padding compact:pt-desktop-compact-layout-group-padding",
655
+ paddingTop && sizing === "component" && "pt-mobile-component-padding desktop:pt-desktop-component-padding compact:pt-desktop-compact-component-padding",
656
+ paddingLeft && sizing === "container" && "pl-mobile-container-padding desktop:pl-desktop-container-padding compact:pl-desktop-compact-container-padding",
657
+ paddingLeft && sizing === "layout" && "pl-mobile-layout-padding desktop:pl-desktop-layout-padding compact:pl-desktop-compact-layout-padding",
658
+ paddingLeft && sizing === "layout-group" && "pl-mobile-layout-group-padding desktop:pl-desktop-layout-group-padding compact:pl-desktop-compact-layout-group-padding",
659
+ paddingLeft && sizing === "component" && "pl-mobile-component-padding desktop:pl-desktop-component-padding compact:pl-desktop-compact-component-padding",
660
+ paddingRight && sizing === "container" && "pr-mobile-container-padding desktop:pr-desktop-container-padding compact:pr-desktop-compact-container-padding",
661
+ paddingRight && sizing === "layout" && "pr-mobile-layout-padding desktop:pr-desktop-layout-padding compact:pr-desktop-compact-layout-padding",
662
+ paddingRight && sizing === "layout-group" && "pr-mobile-layout-group-padding desktop:pr-desktop-layout-group-padding compact:pr-desktop-compact-layout-group-padding",
663
+ paddingRight && sizing === "component" && "pr-mobile-component-padding desktop:pr-desktop-component-padding compact:pr-desktop-compact-component-padding",
628
664
  margin && sizing === "container" && "m-mobile-container-padding desktop:m-desktop-container-padding compact:m-compact-container-padding",
629
665
  marginX && sizing === "container" && "mx-mobile-container-padding desktop:mx-desktop-container-padding compact:mx-compact-container-padding",
630
666
  marginTop && sizing === "container" && "mt-mobile-container-padding desktop:mt-desktop-container-padding compact:mt-compact-container-padding",
@@ -670,7 +706,7 @@ function Theme({
670
706
  }
671
707
 
672
708
  // src/components/MobileDataGrid/ColumnSelector/index.tsx
673
- var import_react29 = require("react");
709
+ var import_react35 = require("react");
674
710
 
675
711
  // src/components/DataGridCell.tsx
676
712
  var import_sortable = require("@dnd-kit/sortable");
@@ -4237,7 +4273,7 @@ var Tooltip = ({
4237
4273
  id,
4238
4274
  "data-testid": testid,
4239
4275
  ref,
4240
- className: "relative inline-grid grid-cols-[auto_1fr] items-center",
4276
+ className: "relative inline-grid grid-cols-[auto_1fr] items-center cursor-pointer",
4241
4277
  onMouseEnter: handleMouseEnter,
4242
4278
  onMouseLeave: handleMouseLeave,
4243
4279
  children: [
@@ -4303,12 +4339,11 @@ var import_jsx_runtime27 = require("react/jsx-runtime");
4303
4339
  var import_jsx_runtime28 = require("react/jsx-runtime");
4304
4340
 
4305
4341
  // src/components/Grid.tsx
4306
- var import_react21 = require("react");
4307
4342
  var import_clsx23 = __toESM(require("clsx"), 1);
4308
4343
  var import_jsx_runtime29 = require("react/jsx-runtime");
4309
4344
 
4310
4345
  // src/components/ProductImagePreview/ProductPrimaryImage.tsx
4311
- var import_react22 = require("react");
4346
+ var import_react21 = require("react");
4312
4347
 
4313
4348
  // src/components/Spinner.tsx
4314
4349
  var import_jsx_runtime30 = require("react/jsx-runtime");
@@ -4344,7 +4379,7 @@ Spinner.displayName = "Spinner";
4344
4379
  var import_jsx_runtime31 = require("react/jsx-runtime");
4345
4380
 
4346
4381
  // src/components/ProductImagePreview/ZoomWindow.tsx
4347
- var import_react23 = require("react");
4382
+ var import_react22 = require("react");
4348
4383
 
4349
4384
  // src/components/Surface.tsx
4350
4385
  var import_clsx24 = __toESM(require("clsx"), 1);
@@ -4389,17 +4424,17 @@ var import_clsx25 = require("clsx");
4389
4424
  var import_jsx_runtime34 = require("react/jsx-runtime");
4390
4425
 
4391
4426
  // src/components/ProductImagePreview/MobileImageCarousel.tsx
4392
- var import_react24 = require("react");
4427
+ var import_react23 = require("react");
4393
4428
  var import_jsx_runtime35 = require("react/jsx-runtime");
4394
4429
 
4395
4430
  // src/components/ProductImagePreview/useProductImagePreview.ts
4396
- var import_react25 = require("react");
4431
+ var import_react24 = require("react");
4397
4432
 
4398
4433
  // src/components/ProductImagePreview/index.tsx
4399
4434
  var import_jsx_runtime36 = require("react/jsx-runtime");
4400
4435
 
4401
4436
  // src/components/CompactImagesPreview.tsx
4402
- var import_react26 = require("react");
4437
+ var import_react25 = require("react");
4403
4438
  var import_clsx26 = __toESM(require("clsx"), 1);
4404
4439
  var import_jsx_runtime37 = require("react/jsx-runtime");
4405
4440
 
@@ -4407,409 +4442,98 @@ var import_jsx_runtime37 = require("react/jsx-runtime");
4407
4442
  var import_clsx27 = __toESM(require("clsx"), 1);
4408
4443
  var import_jsx_runtime38 = require("react/jsx-runtime");
4409
4444
 
4410
- // src/components/MobileDataGrid/GridContextProvider/useGridContext.ts
4411
- var import_react28 = require("react");
4445
+ // src/components/PDFViewer/index.tsx
4446
+ var import_react30 = require("react");
4412
4447
 
4413
- // src/components/MobileDataGrid/GridContextProvider/GridContext.tsx
4448
+ // src/components/Modal.tsx
4449
+ var import_clsx32 = __toESM(require("clsx"), 1);
4414
4450
  var import_react27 = require("react");
4415
- var GridContext = (0, import_react27.createContext)(null);
4416
-
4417
- // src/components/MobileDataGrid/GridContextProvider/useGridContext.ts
4418
- function useGridContext() {
4419
- const ctx = (0, import_react28.useContext)(GridContext);
4420
- if (!ctx) {
4421
- throw new Error("useGridContext must be used within GridContextProvider");
4422
- }
4423
- return ctx;
4424
- }
4425
4451
 
4426
- // src/components/MobileDataGrid/ColumnSelector/index.tsx
4452
+ // src/components/ModalHeader.tsx
4453
+ var import_clsx28 = __toESM(require("clsx"), 1);
4427
4454
  var import_jsx_runtime39 = require("react/jsx-runtime");
4428
- function ColumnSelector() {
4429
- const context = useGridContext();
4430
- const ref = (0, import_react29.useRef)(null);
4431
- const [show, setShow] = (0, import_react29.useState)(false);
4432
- const {
4433
- columns,
4434
- id,
4435
- testid,
4436
- visibleColumns,
4437
- numberOfColumnsToShow,
4438
- primaryKey,
4439
- resetColumnVisibility,
4440
- dispatch
4441
- } = context;
4442
- const toggleColumnVisibility = (0, import_react29.useCallback)(
4443
- (index, visible) => {
4444
- dispatch({ type: "UPDATE", index, payload: { meta: { visible } } });
4445
- },
4446
- [dispatch]
4447
- );
4455
+ var ModalHeader = ({
4456
+ title,
4457
+ hideCloseIcon,
4458
+ headerIcon,
4459
+ headerIconAlign,
4460
+ onClose,
4461
+ id,
4462
+ testid,
4463
+ headerClassname
4464
+ }) => {
4448
4465
  return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
4449
4466
  "div",
4450
4467
  {
4451
- id: id ? `${id}-column-selector` : void 0,
4468
+ id,
4452
4469
  "data-testid": testid,
4453
- className: "text-text-secondary-normal border-l border-brand-200 p-mobile-container-padding",
4454
- ref,
4470
+ className: (0, import_clsx28.default)(
4471
+ "flex justify-between items-center",
4472
+ headerIconAlign === "center" && "justify-center",
4473
+ headerIconAlign === "right" && "justify-end",
4474
+ headerIconAlign === "left" && "justify-start",
4475
+ layoutPaddding,
4476
+ layoutGroupGap,
4477
+ headerClassname
4478
+ ),
4455
4479
  children: [
4456
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
4480
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: (0, import_clsx28.default)("flex items-center flex-1", layoutGroupGap), children: [
4481
+ headerIcon,
4482
+ title && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
4483
+ Heading2,
4484
+ {
4485
+ id: id ? `${id}-title` : void 0,
4486
+ testid: testid ? `${testid}-title` : void 0,
4487
+ as: "p",
4488
+ children: title
4489
+ }
4490
+ )
4491
+ ] }),
4492
+ !hideCloseIcon && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
4457
4493
  Button,
4458
4494
  {
4459
- id: id ? `${id}-button` : void 0,
4460
- testid: testid ? `${testid}-button` : void 0,
4461
- onClick: () => setShow((prev) => !prev),
4462
- variant: "navigation",
4495
+ id: id ? `${id}-close-button` : void 0,
4496
+ testid: testid ? `${testid}-close-button` : void 0,
4463
4497
  iconOnly: true,
4464
- size: 24,
4465
- leftIcon: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Icon, { name: "tune" })
4466
- }
4467
- ),
4468
- /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
4469
- Menu,
4470
- {
4471
- id: id ? `${id}-menu` : void 0,
4472
- testid: testid ? `${testid}-menu` : void 0,
4473
- positionTo: ref,
4474
- position: "bottom-right",
4475
- show,
4476
- setShow,
4477
- calculateMinMaxHeight: true,
4478
- children: [
4479
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
4480
- Button,
4481
- {
4482
- id: id ? `${id}-reset-button` : void 0,
4483
- testid: testid ? `${testid}-reset-button` : void 0,
4484
- variant: "tertiary",
4485
- onClick: () => {
4486
- resetColumnVisibility();
4487
- setShow(false);
4488
- },
4489
- children: "Reset to default"
4490
- }
4491
- ),
4492
- columns.filter((x) => {
4493
- var _a;
4494
- return (_a = x.meta) == null ? void 0 : _a.inVisibilityMenu;
4495
- }).map((column) => {
4496
- var _a, _b, _c;
4497
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
4498
- MenuOption,
4499
- {
4500
- testid: testid ? `${testid}-option-${column.id}` : void 0,
4501
- children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
4502
- Checkbox,
4503
- {
4504
- id: id ? `${id}-checkbox-${column.id}` : void 0,
4505
- testid: testid ? `${testid}-checkbox-${column.id}` : void 0,
4506
- label: (_a = column.header) == null ? void 0 : _a.toString(),
4507
- checked: !!((_b = column.meta) == null ? void 0 : _b.visible) || column.id === String(primaryKey),
4508
- disabled: typeof numberOfColumnsToShow !== "undefined" && // account for header+link occupying one slot
4509
- visibleColumns.length >= numberOfColumnsToShow - 1 && ((_c = column.meta) == null ? void 0 : _c.visible) !== true || column.id === String(primaryKey),
4510
- onChange: (e) => {
4511
- toggleColumnVisibility(
4512
- columns.findIndex(({ id: id2 }) => id2 === column.id),
4513
- e.target.checked
4514
- );
4515
- }
4516
- }
4517
- )
4518
- },
4519
- id ? `${id}-option-${column.id}` : void 0
4520
- );
4521
- })
4522
- ]
4498
+ variant: "tertiary",
4499
+ onClick: onClose,
4500
+ leftIcon: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "text-brand-text-action-primary-normal desktop:text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Icon, { name: "close", size: 24 }) })
4523
4501
  }
4524
4502
  )
4525
4503
  ]
4526
4504
  }
4527
4505
  );
4528
- }
4506
+ };
4507
+ ModalHeader.displayName = "ModalHeader";
4529
4508
 
4530
- // src/components/MobileDataGrid/MobileDataGridHeader.tsx
4509
+ // src/components/ModalContent.tsx
4510
+ var import_clsx29 = __toESM(require("clsx"), 1);
4531
4511
  var import_jsx_runtime40 = require("react/jsx-runtime");
4532
- function MobileDataGridHeader({
4533
- header: Header,
4534
- enableColumnSelector,
4535
- enableRowSelection
4512
+ function ModalContent({
4513
+ fixedHeightScrolling,
4514
+ children,
4515
+ id,
4516
+ testid
4536
4517
  }) {
4537
- var _a, _b;
4538
- const ctx = useGridContext();
4539
- const {
4540
- id,
4541
- testid,
4542
- selectedRowIds,
4543
- data,
4544
- primaryKey,
4545
- columns,
4546
- handleRowSelectAll
4547
- } = ctx;
4548
- if (typeof Header === "undefined" && !primaryKey) return null;
4549
- if (typeof Header === "function") return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Header, __spreadValues({}, ctx));
4550
- if (typeof Header === "string" || primaryKey)
4551
- return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
4552
- "div",
4553
- {
4554
- id: id ? `${id}-header` : void 0,
4555
- "data-testid": testid ? `${testid}-header` : void 0,
4556
- className: "sticky top-0",
4557
- children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Theme, { theme: "brand", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
4558
- Stack,
4559
- {
4560
- horizontal: true,
4561
- horizontalMobile: true,
4562
- items: "center",
4563
- justify: "between",
4564
- backgroundColor: "background-primary-normal",
4565
- children: [
4566
- enableRowSelection && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "p-mobile-component-padding border-r border-brand-200 max-w-fit h-full", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
4567
- Checkbox,
4568
- {
4569
- id: id ? `${id}-select-all-checkbox` : void 0,
4570
- testid: testid ? `${testid}-select-all-checkbox` : void 0,
4571
- checked: selectedRowIds.length === data.length,
4572
- indeterminate: !!selectedRowIds.length && selectedRowIds.length !== data.length,
4573
- onChange: handleRowSelectAll
4574
- }
4575
- ) }),
4576
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
4577
- Stack,
4578
- {
4579
- horizontal: true,
4580
- horizontalMobile: true,
4581
- items: "center",
4582
- sizing: "component",
4583
- padding: true,
4584
- children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Heading3, { as: "span", color: "text-primary-normal", children: typeof Header === "string" ? Header : (_b = (_a = columns.find((col) => col.id === primaryKey)) == null ? void 0 : _a.header) == null ? void 0 : _b.toString() })
4585
- }
4586
- ),
4587
- enableColumnSelector && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ColumnSelector, {})
4588
- ]
4589
- }
4590
- ) })
4591
- }
4592
- );
4593
- }
4594
-
4595
- // src/components/MobileDataGrid/GridContextProvider/index.tsx
4596
- var import_react30 = require("react");
4597
-
4598
- // src/components/MobileDataGrid/dataGridReducer.ts
4599
- function dataGridReducer(state, action) {
4600
- var _a, _b, _c;
4601
- const { type, payload } = action;
4602
- let itemIndex = null;
4603
- if (action.type === "INSERT" && action.pos === "INDEX")
4604
- itemIndex = action.index;
4605
- if (action.type === "UPDATE")
4606
- itemIndex = (_a = action.index) != null ? _a : state.filter(({ id }) => !!id).findIndex(({ id }) => id === action.id);
4607
- switch (type) {
4608
- case "SET":
4609
- return [...payload];
4610
- case "UPDATE":
4611
- if (typeof itemIndex !== "number" || itemIndex < 0)
4612
- throw new Error("action.(id | index) must be provided.");
4613
- return [
4614
- ...state.slice(0, itemIndex),
4615
- __spreadProps(__spreadValues(__spreadValues({}, state[itemIndex]), payload), {
4616
- meta: __spreadValues(__spreadValues({}, (_b = state[itemIndex].meta) != null ? _b : {}), (_c = payload.meta) != null ? _c : {})
4617
- }),
4618
- ...state.slice(itemIndex + 1)
4619
- ];
4620
- default:
4621
- throw new Error("Action type not implemented.");
4622
- }
4518
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
4519
+ "div",
4520
+ {
4521
+ id,
4522
+ "data-testid": testid,
4523
+ className: (0, import_clsx29.default)(
4524
+ "flex-grow desktop:flex-grow-0",
4525
+ layoutPaddding,
4526
+ fixedHeightScrolling && "overflow-auto"
4527
+ ),
4528
+ children
4529
+ }
4530
+ );
4623
4531
  }
4532
+ ModalContent.displayName = "ModalContent";
4624
4533
 
4625
- // src/components/MobileDataGrid/GridContextProvider/index.tsx
4534
+ // src/components/ModalButtons.tsx
4535
+ var import_clsx30 = __toESM(require("clsx"), 1);
4626
4536
  var import_jsx_runtime41 = require("react/jsx-runtime");
4627
- function GridContextProvider(props) {
4628
- const {
4629
- initialColumns,
4630
- id,
4631
- testid,
4632
- children,
4633
- data,
4634
- numberOfColumnsToShow,
4635
- primaryKey,
4636
- getId,
4637
- onRowSelect
4638
- } = props;
4639
- const [columns, dispatch] = (0, import_react30.useReducer)(dataGridReducer, initialColumns);
4640
- const [selectedRowIds, setSelectedRowIds] = (0, import_react30.useState)([]);
4641
- const [currentRow, setCurrentRow] = (0, import_react30.useState)(null);
4642
- const resetColumnVisibility = (0, import_react30.useCallback)(() => {
4643
- const newColumns = columns.map((column) => {
4644
- var _a;
4645
- const initialColumn = initialColumns.find((c) => c.id === column.id);
4646
- return __spreadProps(__spreadValues({}, column), {
4647
- meta: __spreadProps(__spreadValues({}, column.meta), {
4648
- visible: (_a = initialColumn == null ? void 0 : initialColumn.meta) == null ? void 0 : _a.visible
4649
- })
4650
- });
4651
- });
4652
- dispatch({ type: "SET", payload: newColumns });
4653
- }, [columns, initialColumns]);
4654
- const handleRowSelect = (0, import_react30.useCallback)(
4655
- (item) => {
4656
- var _a;
4657
- const rowId = (_a = getId(item)) != null ? _a : "";
4658
- if (!rowId) return;
4659
- const nextSelected = selectedRowIds.includes(rowId) ? selectedRowIds.filter((id2) => id2 !== rowId) : [...selectedRowIds, rowId];
4660
- setSelectedRowIds(nextSelected);
4661
- if (onRowSelect) onRowSelect(item, nextSelected);
4662
- },
4663
- [getId, onRowSelect, selectedRowIds]
4664
- );
4665
- const handleRowSelectAll = (0, import_react30.useCallback)(() => {
4666
- setSelectedRowIds((prev) => {
4667
- if (prev.length === data.length) {
4668
- return [];
4669
- }
4670
- return data.map(getId).filter((id2) => id2 !== void 0);
4671
- });
4672
- }, [data, getId]);
4673
- const openRowDetail = (0, import_react30.useCallback)((row) => {
4674
- setCurrentRow(row);
4675
- }, []);
4676
- const closeRowDetail = (0, import_react30.useCallback)(() => {
4677
- setCurrentRow(null);
4678
- }, []);
4679
- const visibleColumns = (0, import_react30.useMemo)(() => {
4680
- const effectiveLimit = typeof numberOfColumnsToShow === "number" ? Math.max(numberOfColumnsToShow - 1, 0) : void 0;
4681
- if (primaryKey) {
4682
- const pkColumn = columns.find((col) => col.id === String(primaryKey));
4683
- const otherColumns = columns.filter(
4684
- (col) => col.id !== String(primaryKey)
4685
- );
4686
- const orderedColumns = pkColumn ? [pkColumn, ...otherColumns] : [...otherColumns];
4687
- return orderedColumns.filter((x) => {
4688
- var _a;
4689
- return ((_a = x.meta) == null ? void 0 : _a.visible) !== false;
4690
- }).slice(0, effectiveLimit);
4691
- }
4692
- return columns.filter((x) => {
4693
- var _a;
4694
- return ((_a = x.meta) == null ? void 0 : _a.visible) !== false;
4695
- }).slice(0, effectiveLimit);
4696
- }, [columns, numberOfColumnsToShow, primaryKey]);
4697
- return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
4698
- GridContext.Provider,
4699
- {
4700
- value: {
4701
- columns,
4702
- testid,
4703
- id,
4704
- data,
4705
- selectedRowIds,
4706
- visibleColumns,
4707
- numberOfColumnsToShow,
4708
- primaryKey,
4709
- dispatch,
4710
- getId,
4711
- resetColumnVisibility,
4712
- handleRowSelect,
4713
- handleRowSelectAll,
4714
- isRowDetailOpen: !!currentRow,
4715
- currentRow,
4716
- openRowDetail,
4717
- closeRowDetail
4718
- },
4719
- children
4720
- }
4721
- );
4722
- }
4723
-
4724
- // src/components/Modal.tsx
4725
- var import_clsx32 = __toESM(require("clsx"), 1);
4726
- var import_react32 = require("react");
4727
-
4728
- // src/components/ModalHeader.tsx
4729
- var import_clsx28 = __toESM(require("clsx"), 1);
4730
- var import_jsx_runtime42 = require("react/jsx-runtime");
4731
- var ModalHeader = ({
4732
- title,
4733
- hideCloseIcon,
4734
- headerIcon,
4735
- headerIconAlign,
4736
- onClose,
4737
- id,
4738
- testid,
4739
- headerClassname
4740
- }) => {
4741
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
4742
- "div",
4743
- {
4744
- id,
4745
- "data-testid": testid,
4746
- className: (0, import_clsx28.default)(
4747
- "flex justify-between items-center",
4748
- headerIconAlign === "center" && "justify-center",
4749
- headerIconAlign === "right" && "justify-end",
4750
- headerIconAlign === "left" && "justify-start",
4751
- layoutPaddding,
4752
- layoutGroupGap,
4753
- headerClassname
4754
- ),
4755
- children: [
4756
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: (0, import_clsx28.default)("flex items-center flex-1", layoutGroupGap), children: [
4757
- headerIcon,
4758
- title && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
4759
- Heading2,
4760
- {
4761
- id: id ? `${id}-title` : void 0,
4762
- testid: testid ? `${testid}-title` : void 0,
4763
- as: "p",
4764
- children: title
4765
- }
4766
- )
4767
- ] }),
4768
- !hideCloseIcon && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
4769
- Button,
4770
- {
4771
- id: id ? `${id}-close-button` : void 0,
4772
- testid: testid ? `${testid}-close-button` : void 0,
4773
- iconOnly: true,
4774
- variant: "tertiary",
4775
- onClick: onClose,
4776
- leftIcon: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "text-brand-text-action-primary-normal desktop:text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Icon, { name: "close", size: 24 }) })
4777
- }
4778
- )
4779
- ]
4780
- }
4781
- );
4782
- };
4783
- ModalHeader.displayName = "ModalHeader";
4784
-
4785
- // src/components/ModalContent.tsx
4786
- var import_clsx29 = __toESM(require("clsx"), 1);
4787
- var import_jsx_runtime43 = require("react/jsx-runtime");
4788
- function ModalContent({
4789
- fixedHeightScrolling,
4790
- children,
4791
- id,
4792
- testid
4793
- }) {
4794
- return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
4795
- "div",
4796
- {
4797
- id,
4798
- "data-testid": testid,
4799
- className: (0, import_clsx29.default)(
4800
- "flex-grow desktop:flex-grow-0",
4801
- layoutPaddding,
4802
- fixedHeightScrolling && "overflow-auto"
4803
- ),
4804
- children
4805
- }
4806
- );
4807
- }
4808
- ModalContent.displayName = "ModalContent";
4809
-
4810
- // src/components/ModalButtons.tsx
4811
- var import_clsx30 = __toESM(require("clsx"), 1);
4812
- var import_jsx_runtime44 = require("react/jsx-runtime");
4813
4537
  var ModalButtons = ({
4814
4538
  onClose,
4815
4539
  onContinue,
@@ -4817,7 +4541,7 @@ var ModalButtons = ({
4817
4541
  id,
4818
4542
  testid
4819
4543
  }) => {
4820
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
4544
+ return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
4821
4545
  "div",
4822
4546
  {
4823
4547
  id,
@@ -4827,26 +4551,26 @@ var ModalButtons = ({
4827
4551
  layoutPaddding,
4828
4552
  layoutGroupGap
4829
4553
  ),
4830
- children: customActions != null ? customActions : /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_jsx_runtime44.Fragment, { children: [
4831
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
4554
+ children: customActions != null ? customActions : /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
4555
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
4832
4556
  Button,
4833
4557
  {
4834
4558
  id: id ? `${id}-close-button` : void 0,
4835
4559
  testid: testid ? `${testid}-close-button` : void 0,
4836
4560
  variant: "secondary",
4837
- leftIcon: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Icon, { name: "close", size: 24 }),
4561
+ leftIcon: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Icon, { name: "close", size: 24 }),
4838
4562
  onClick: onClose,
4839
4563
  className: "max-sm:w-full",
4840
4564
  children: "Close"
4841
4565
  }
4842
4566
  ),
4843
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
4567
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
4844
4568
  Button,
4845
4569
  {
4846
4570
  id: id ? `${id}-continue-button` : void 0,
4847
4571
  testid: testid ? `${testid}-continue-button` : void 0,
4848
4572
  variant: "primary",
4849
- leftIcon: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Icon, { name: "check", size: 24 }),
4573
+ leftIcon: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Icon, { name: "check", size: 24 }),
4850
4574
  className: "max-sm:w-full",
4851
4575
  onClick: onContinue,
4852
4576
  children: "Continue"
@@ -4860,7 +4584,7 @@ ModalButtons.displayName = "ModalButtons";
4860
4584
 
4861
4585
  // src/components/ModalScrim.tsx
4862
4586
  var import_clsx31 = __toESM(require("clsx"), 1);
4863
- var import_jsx_runtime45 = require("react/jsx-runtime");
4587
+ var import_jsx_runtime42 = require("react/jsx-runtime");
4864
4588
  var ModalScrim = ({
4865
4589
  show = false,
4866
4590
  size = "small",
@@ -4870,7 +4594,7 @@ var ModalScrim = ({
4870
4594
  id,
4871
4595
  testid
4872
4596
  }) => {
4873
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
4597
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
4874
4598
  "div",
4875
4599
  {
4876
4600
  id,
@@ -4895,10 +4619,10 @@ var import_react_dom3 = require("react-dom");
4895
4619
  var import_react_use = require("react-use");
4896
4620
 
4897
4621
  // src/components/useMounted.tsx
4898
- var import_react31 = require("react");
4622
+ var import_react26 = require("react");
4899
4623
  var useMounted = () => {
4900
- const [isMounted, setIsMounted] = (0, import_react31.useState)(false);
4901
- (0, import_react31.useEffect)(() => {
4624
+ const [isMounted, setIsMounted] = (0, import_react26.useState)(false);
4625
+ (0, import_react26.useEffect)(() => {
4902
4626
  setIsMounted(true);
4903
4627
  return () => setIsMounted(false);
4904
4628
  }, []);
@@ -4906,7 +4630,7 @@ var useMounted = () => {
4906
4630
  };
4907
4631
 
4908
4632
  // src/components/Modal.tsx
4909
- var import_jsx_runtime46 = require("react/jsx-runtime");
4633
+ var import_jsx_runtime43 = require("react/jsx-runtime");
4910
4634
  var fadeInScale = (element, duration = 300) => element.animate(
4911
4635
  [
4912
4636
  { opacity: 0, transform: "scale(0.95)" },
@@ -4990,12 +4714,12 @@ var Modal = ({
4990
4714
  }) => {
4991
4715
  var _a;
4992
4716
  const mounted = useMounted();
4993
- const modalRef = (0, import_react32.useRef)(null);
4994
- const bgRef = (0, import_react32.useRef)(null);
4717
+ const modalRef = (0, import_react27.useRef)(null);
4718
+ const bgRef = (0, import_react27.useRef)(null);
4995
4719
  const wasOpen = (0, import_react_use.usePrevious)(open);
4996
4720
  const isMobile = useMatchesMobile();
4997
4721
  const computedFixedHeightScrolling = isMobile || fixedHeightScrolling;
4998
- (0, import_react32.useEffect)(() => {
4722
+ (0, import_react27.useEffect)(() => {
4999
4723
  if (!mounted) return;
5000
4724
  if (!modalRef.current || !bgRef.current) {
5001
4725
  console.error("Modal or background reference is not set.");
@@ -5015,7 +4739,7 @@ var Modal = ({
5015
4739
  bgFadeIn(bgRef.current);
5016
4740
  }
5017
4741
  }, [mounted, onClose, open, wasOpen]);
5018
- const handleKeyDown = (0, import_react32.useCallback)(
4742
+ const handleKeyDown = (0, import_react27.useCallback)(
5019
4743
  (e) => {
5020
4744
  if (e.key === "Escape") {
5021
4745
  if (onClose) {
@@ -5026,12 +4750,12 @@ var Modal = ({
5026
4750
  },
5027
4751
  [onClose]
5028
4752
  );
5029
- const handleClose = (0, import_react32.useCallback)(() => {
4753
+ const handleClose = (0, import_react27.useCallback)(() => {
5030
4754
  if (onClose) {
5031
4755
  onClose();
5032
4756
  }
5033
4757
  }, [onClose]);
5034
- (0, import_react32.useEffect)(() => {
4758
+ (0, import_react27.useEffect)(() => {
5035
4759
  if (open) {
5036
4760
  document.addEventListener("keyup", handleKeyDown);
5037
4761
  }
@@ -5039,7 +4763,7 @@ var Modal = ({
5039
4763
  document.removeEventListener("keyup", handleKeyDown);
5040
4764
  };
5041
4765
  }, [open, handleKeyDown]);
5042
- (0, import_react32.useEffect)(() => {
4766
+ (0, import_react27.useEffect)(() => {
5043
4767
  if (!open) return;
5044
4768
  const scrollY = window.scrollY;
5045
4769
  const body = document.body;
@@ -5060,7 +4784,7 @@ var Modal = ({
5060
4784
  };
5061
4785
  }, [open]);
5062
4786
  const { sizeClass } = (_a = sizes[size]) != null ? _a : sizes.small;
5063
- const backgroundClickHandler = (0, import_react32.useCallback)(
4787
+ const backgroundClickHandler = (0, import_react27.useCallback)(
5064
4788
  (e) => {
5065
4789
  const target = e.target;
5066
4790
  const currentTarget = e.currentTarget;
@@ -5078,7 +4802,7 @@ var Modal = ({
5078
4802
  return null;
5079
4803
  }
5080
4804
  return (0, import_react_dom3.createPortal)(
5081
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
4805
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
5082
4806
  ModalScrim,
5083
4807
  {
5084
4808
  id: id ? `${id}-scrim` : void 0,
@@ -5087,7 +4811,7 @@ var Modal = ({
5087
4811
  ref: bgRef,
5088
4812
  show: open,
5089
4813
  onClick: backgroundClickHandler,
5090
- children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
4814
+ children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
5091
4815
  "div",
5092
4816
  {
5093
4817
  id,
@@ -5102,7 +4826,7 @@ var Modal = ({
5102
4826
  ),
5103
4827
  onClick: (e) => e.stopPropagation(),
5104
4828
  children: [
5105
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
4829
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
5106
4830
  ModalHeader,
5107
4831
  {
5108
4832
  id: id ? `${id}-header` : void 0,
@@ -5115,7 +4839,7 @@ var Modal = ({
5115
4839
  headerClassname
5116
4840
  }
5117
4841
  ),
5118
- children && (size !== "screen" || noWrapper) ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
4842
+ children && (size !== "screen" || noWrapper) ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
5119
4843
  ModalContent,
5120
4844
  {
5121
4845
  id: id ? `${id}-content` : void 0,
@@ -5124,7 +4848,7 @@ var Modal = ({
5124
4848
  children
5125
4849
  }
5126
4850
  ) : children,
5127
- showButtons ? customFooter ? customActions : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
4851
+ showButtons ? customFooter ? customActions : /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
5128
4852
  ModalButtons,
5129
4853
  {
5130
4854
  id: id ? `${id}-buttons` : void 0,
@@ -5144,99 +4868,589 @@ var Modal = ({
5144
4868
  };
5145
4869
  Modal.displayName = "Modal";
5146
4870
 
5147
- // src/components/MobileDataGrid/MobileDataGridCard/MobileDataGridColumn.tsx
4871
+ // src/components/PDFViewer/PDFElement.tsx
4872
+ var import_react_pdf2 = require("@mikecousins/react-pdf");
4873
+ var import_react29 = require("react");
4874
+
4875
+ // src/components/PDFViewer/PDFPage.tsx
4876
+ var import_react_pdf = require("@mikecousins/react-pdf");
4877
+ var import_react28 = require("react");
4878
+ var import_jsx_runtime44 = require("react/jsx-runtime");
4879
+
4880
+ // src/components/PDFViewer/PDFElement.tsx
4881
+ var import_clsx33 = __toESM(require("clsx"), 1);
4882
+ var import_jsx_runtime45 = require("react/jsx-runtime");
4883
+
4884
+ // src/components/PDFViewer/DownloadIcon.tsx
4885
+ var import_jsx_runtime46 = require("react/jsx-runtime");
4886
+
4887
+ // src/components/PDFViewer/PDFNavigation.tsx
5148
4888
  var import_jsx_runtime47 = require("react/jsx-runtime");
5149
- function MobileDataGridColumn(props) {
5150
- var _a;
5151
- const { column, data } = props;
5152
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "mb-2 grid grid-cols-2 gap-2 px-3 flex-1", children: [
5153
- /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(Paragraph, { color: "text-secondary-normal", className: "text-left", children: [
5154
- (_a = column.header) == null ? void 0 : _a.toString(),
5155
- ":"
5156
- ] }),
5157
- " ",
5158
- column.id && data[column.id] ? data[column.id] : null
5159
- ] });
5160
- }
5161
4889
 
5162
- // src/components/MobileDataGrid/RowDetailModalProvider/ModalContent.tsx
4890
+ // src/components/PDFViewer/index.tsx
5163
4891
  var import_jsx_runtime48 = require("react/jsx-runtime");
5164
- function ModalContent2() {
5165
- const context = useGridContext();
5166
- const { columns, currentRow } = context;
5167
- if (!currentRow) return null;
5168
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Stack, { sizing: "layout-group", children: columns.filter((x) => {
5169
- var _a;
5170
- return !((_a = x.id) == null ? void 0 : _a.startsWith("__"));
5171
- }).map(
5172
- (column, index) => {
5173
- var _a, _b;
5174
- return ((_a = column.meta) == null ? void 0 : _a.useCustomRenderer) && column.meta.mobileCell && column.id ? /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
5175
- "div",
5176
- {
5177
- className: "mb-2 grid grid-cols-2 gap-2 px-3 items-center flex-1",
5178
- children: [
5179
- /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Paragraph, { color: "text-secondary-normal", className: "text-left", children: [
5180
- (_b = column.header) == null ? void 0 : _b.toString(),
5181
- ":"
5182
- ] }),
5183
- " ",
5184
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
5185
- column.meta.mobileCell,
5186
- {
5187
- column,
5188
- row: currentRow,
5189
- cellValue: currentRow == null ? void 0 : currentRow[column.id]
5190
- }
5191
- )
5192
- ]
5193
- },
5194
- `${column.id}-${index}`
5195
- ) : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
5196
- MobileDataGridColumn,
5197
- {
5198
- column,
5199
- data: currentRow
5200
- },
5201
- `${column.id}-${index}`
5202
- );
5203
- }
5204
- ) });
5205
- }
5206
4892
 
5207
- // src/components/MobileDataGrid/RowDetailModalProvider/index.tsx
4893
+ // src/components/ListGroup.tsx
4894
+ var import_react31 = require("react");
4895
+ var import_clsx34 = __toESM(require("clsx"), 1);
5208
4896
  var import_jsx_runtime49 = require("react/jsx-runtime");
5209
- function RowDetailModalProvider() {
5210
- var _a;
5211
- const context = useGridContext();
5212
- const {
5213
- id,
5214
- testid,
5215
- isRowDetailOpen,
5216
- currentRow,
5217
- primaryKey,
5218
- closeRowDetail
5219
- } = context;
5220
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
5221
- Modal,
5222
- {
5223
- fixedHeightScrolling: true,
5224
- open: isRowDetailOpen,
5225
- onClose: closeRowDetail,
5226
- hideCloseIcon: true,
5227
- size: "medium",
5228
- className: "!p-0",
5229
- headerIcon: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
5230
- Stack,
5231
- {
4897
+
4898
+ // src/components/Pagination.tsx
4899
+ var import_react32 = require("react");
4900
+ var import_clsx35 = __toESM(require("clsx"), 1);
4901
+ var import_jsx_runtime50 = require("react/jsx-runtime");
4902
+ var Pagination = ({
4903
+ totalPages,
4904
+ currentPage,
4905
+ onPageChange,
4906
+ id,
4907
+ testid,
4908
+ className,
4909
+ disabled
4910
+ }) => {
4911
+ const goTo = (0, import_react32.useCallback)(
4912
+ (page) => {
4913
+ if (disabled) return;
4914
+ onPageChange(page);
4915
+ },
4916
+ [onPageChange, disabled]
4917
+ );
4918
+ const handleKey = (e) => {
4919
+ if (disabled) return;
4920
+ if (e.key === "ArrowLeft") {
4921
+ e.preventDefault();
4922
+ goTo(currentPage - 1);
4923
+ } else if (e.key === "ArrowRight") {
4924
+ e.preventDefault();
4925
+ goTo(currentPage + 1);
4926
+ }
4927
+ };
4928
+ const pageTokens = (0, import_react32.useMemo)(() => {
4929
+ if (totalPages <= 5) {
4930
+ return Array.from({ length: totalPages }, (_, i) => i + 1);
4931
+ }
4932
+ const pages = /* @__PURE__ */ new Set();
4933
+ pages.add(1);
4934
+ pages.add(totalPages);
4935
+ if (currentPage <= 3) {
4936
+ pages.add(2);
4937
+ pages.add(3);
4938
+ pages.add(4);
4939
+ } else if (currentPage >= totalPages - 2) {
4940
+ pages.add(totalPages - 1);
4941
+ pages.add(totalPages - 2);
4942
+ pages.add(totalPages - 3);
4943
+ } else {
4944
+ pages.add(currentPage - 1);
4945
+ pages.add(currentPage);
4946
+ pages.add(currentPage + 1);
4947
+ }
4948
+ const sorted = Array.from(pages).sort((a, b) => a - b);
4949
+ const tokens = [];
4950
+ for (let i = 0; i < sorted.length; i++) {
4951
+ const value = sorted[i];
4952
+ const prev = sorted[i - 1];
4953
+ if (i > 0) {
4954
+ if (value - prev === 2) {
4955
+ tokens.push(prev + 1);
4956
+ } else if (value - prev > 2) {
4957
+ tokens.push("ellipsis");
4958
+ }
4959
+ }
4960
+ tokens.push(value);
4961
+ }
4962
+ return tokens;
4963
+ }, [totalPages, currentPage]);
4964
+ if (totalPages <= 1) return null;
4965
+ const buttonClass = (0, import_clsx35.default)(
4966
+ "cursor-pointer disabled:cursor-default",
4967
+ paddingUsingComponentGap,
4968
+ "w-8 h-8",
4969
+ "flex items-center justify-center",
4970
+ "bg-transparent",
4971
+ "box-content",
4972
+ "hover:bg-background-grouped-secondary-normal",
4973
+ "focus:bg-background-grouped-secondary-normal focus:outline-0",
4974
+ "disabled:bg-transparent disabled:text-text-action-primary-disabled"
4975
+ );
4976
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
4977
+ "nav",
4978
+ {
4979
+ id,
4980
+ "data-testid": testid,
4981
+ "aria-label": "Pagination",
4982
+ onKeyDown: handleKey,
4983
+ className: (0, import_clsx35.default)(
4984
+ "flex items-center",
4985
+ "border border-border-primary-normal",
4986
+ "bg-background-grouped-primary-normal",
4987
+ "rounded-sm",
4988
+ className
4989
+ ),
4990
+ children: [
4991
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
4992
+ "button",
4993
+ {
4994
+ disabled: disabled || currentPage <= 1,
4995
+ "aria-label": "Previous page",
4996
+ onClick: () => goTo(currentPage - 1),
4997
+ className: (0, import_clsx35.default)(buttonClass, "border-r-1 border-border-primary-normal"),
4998
+ children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Icon, { name: "keyboard_arrow_left" })
4999
+ }
5000
+ ),
5001
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("ul", { className: (0, import_clsx35.default)("flex items-center"), children: pageTokens.map((token, index) => {
5002
+ if (token === "ellipsis") {
5003
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
5004
+ "li",
5005
+ {
5006
+ className: "w-8 h-8 select-none text-text-action-primary-disabled",
5007
+ children: "\u2026"
5008
+ },
5009
+ `ellipsis-${index}`
5010
+ );
5011
+ }
5012
+ const selected = token === currentPage;
5013
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
5014
+ "button",
5015
+ {
5016
+ "aria-label": `Page ${token}`,
5017
+ "aria-current": selected ? "page" : void 0,
5018
+ disabled,
5019
+ onClick: () => goTo(token),
5020
+ className: (0, import_clsx35.default)(
5021
+ buttonClass,
5022
+ selected && "border-x-1 bg-background-grouped-secondary-normal border-border-primary-normal"
5023
+ ),
5024
+ children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Subheader, { align: "center", weight: "bold", children: token })
5025
+ }
5026
+ ) }, token);
5027
+ }) }),
5028
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
5029
+ "button",
5030
+ {
5031
+ disabled: disabled || currentPage >= totalPages,
5032
+ "aria-label": "Next page",
5033
+ onClick: () => goTo(currentPage + 1),
5034
+ className: (0, import_clsx35.default)(buttonClass, "border-l-1 border-border-primary-normal"),
5035
+ children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Icon, { name: "keyboard_arrow_right" })
5036
+ }
5037
+ )
5038
+ ]
5039
+ }
5040
+ );
5041
+ };
5042
+ Pagination.displayName = "Pagination";
5043
+
5044
+ // src/components/SkeletonParagraph.tsx
5045
+ var import_jsx_runtime51 = require("react/jsx-runtime");
5046
+
5047
+ // src/components/MobileDataGrid/GridContextProvider/useGridContext.ts
5048
+ var import_react34 = require("react");
5049
+
5050
+ // src/components/MobileDataGrid/GridContextProvider/GridContext.tsx
5051
+ var import_react33 = require("react");
5052
+ var GridContext = (0, import_react33.createContext)(null);
5053
+
5054
+ // src/components/MobileDataGrid/GridContextProvider/useGridContext.ts
5055
+ function useGridContext() {
5056
+ const ctx = (0, import_react34.useContext)(GridContext);
5057
+ if (!ctx) {
5058
+ throw new Error("useGridContext must be used within GridContextProvider");
5059
+ }
5060
+ return ctx;
5061
+ }
5062
+
5063
+ // src/components/MobileDataGrid/ColumnSelector/index.tsx
5064
+ var import_jsx_runtime52 = require("react/jsx-runtime");
5065
+ function ColumnSelector() {
5066
+ const context = useGridContext();
5067
+ const ref = (0, import_react35.useRef)(null);
5068
+ const [show, setShow] = (0, import_react35.useState)(false);
5069
+ const {
5070
+ columns,
5071
+ id,
5072
+ testid,
5073
+ visibleColumns,
5074
+ numberOfColumnsToShow,
5075
+ primaryKey,
5076
+ resetColumnVisibility,
5077
+ dispatch
5078
+ } = context;
5079
+ const toggleColumnVisibility = (0, import_react35.useCallback)(
5080
+ (index, visible) => {
5081
+ dispatch({ type: "UPDATE", index, payload: { meta: { visible } } });
5082
+ },
5083
+ [dispatch]
5084
+ );
5085
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
5086
+ "div",
5087
+ {
5088
+ id: id ? `${id}-column-selector` : void 0,
5089
+ "data-testid": testid,
5090
+ className: "text-text-secondary-normal border-l border-brand-200 p-mobile-container-padding",
5091
+ ref,
5092
+ children: [
5093
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
5094
+ Button,
5095
+ {
5096
+ id: id ? `${id}-button` : void 0,
5097
+ testid: testid ? `${testid}-button` : void 0,
5098
+ onClick: () => setShow((prev) => !prev),
5099
+ variant: "navigation",
5100
+ iconOnly: true,
5101
+ size: 24,
5102
+ leftIcon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Icon, { name: "tune" })
5103
+ }
5104
+ ),
5105
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
5106
+ Menu,
5107
+ {
5108
+ id: id ? `${id}-menu` : void 0,
5109
+ testid: testid ? `${testid}-menu` : void 0,
5110
+ positionTo: ref,
5111
+ position: "bottom-right",
5112
+ show,
5113
+ setShow,
5114
+ calculateMinMaxHeight: true,
5115
+ children: [
5116
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
5117
+ Button,
5118
+ {
5119
+ id: id ? `${id}-reset-button` : void 0,
5120
+ testid: testid ? `${testid}-reset-button` : void 0,
5121
+ variant: "tertiary",
5122
+ onClick: () => {
5123
+ resetColumnVisibility();
5124
+ setShow(false);
5125
+ },
5126
+ children: "Reset to default"
5127
+ }
5128
+ ),
5129
+ columns.filter((x) => {
5130
+ var _a;
5131
+ return (_a = x.meta) == null ? void 0 : _a.inVisibilityMenu;
5132
+ }).map((column) => {
5133
+ var _a, _b, _c;
5134
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
5135
+ MenuOption,
5136
+ {
5137
+ testid: testid ? `${testid}-option-${column.id}` : void 0,
5138
+ children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
5139
+ Checkbox,
5140
+ {
5141
+ id: id ? `${id}-checkbox-${column.id}` : void 0,
5142
+ testid: testid ? `${testid}-checkbox-${column.id}` : void 0,
5143
+ label: (_a = column.header) == null ? void 0 : _a.toString(),
5144
+ checked: !!((_b = column.meta) == null ? void 0 : _b.visible) || column.id === String(primaryKey),
5145
+ disabled: typeof numberOfColumnsToShow !== "undefined" && // account for header+link occupying one slot
5146
+ visibleColumns.length >= numberOfColumnsToShow - 1 && ((_c = column.meta) == null ? void 0 : _c.visible) !== true || column.id === String(primaryKey),
5147
+ onChange: (e) => {
5148
+ toggleColumnVisibility(
5149
+ columns.findIndex(({ id: id2 }) => id2 === column.id),
5150
+ e.target.checked
5151
+ );
5152
+ }
5153
+ }
5154
+ )
5155
+ },
5156
+ id ? `${id}-option-${column.id}` : void 0
5157
+ );
5158
+ })
5159
+ ]
5160
+ }
5161
+ )
5162
+ ]
5163
+ }
5164
+ );
5165
+ }
5166
+
5167
+ // src/components/MobileDataGrid/MobileDataGridHeader.tsx
5168
+ var import_jsx_runtime53 = require("react/jsx-runtime");
5169
+ function MobileDataGridHeader({
5170
+ header: Header,
5171
+ enableColumnSelector,
5172
+ enableRowSelection
5173
+ }) {
5174
+ var _a, _b;
5175
+ const ctx = useGridContext();
5176
+ const {
5177
+ id,
5178
+ testid,
5179
+ selectedRowIds,
5180
+ data,
5181
+ primaryKey,
5182
+ columns,
5183
+ handleRowSelectAll
5184
+ } = ctx;
5185
+ if (typeof Header === "undefined" && !primaryKey) return null;
5186
+ if (typeof Header === "function") return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Header, __spreadValues({}, ctx));
5187
+ if (typeof Header === "string" || primaryKey)
5188
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
5189
+ "div",
5190
+ {
5191
+ id: id ? `${id}-header` : void 0,
5192
+ "data-testid": testid ? `${testid}-header` : void 0,
5193
+ className: "sticky top-0",
5194
+ children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Theme, { theme: "brand", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
5195
+ Stack,
5196
+ {
5197
+ horizontal: true,
5198
+ horizontalMobile: true,
5199
+ items: "center",
5200
+ justify: "between",
5201
+ backgroundColor: "background-primary-normal",
5202
+ children: [
5203
+ enableRowSelection && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "p-mobile-component-padding border-r border-brand-200 max-w-fit h-full", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
5204
+ Checkbox,
5205
+ {
5206
+ id: id ? `${id}-select-all-checkbox` : void 0,
5207
+ testid: testid ? `${testid}-select-all-checkbox` : void 0,
5208
+ checked: selectedRowIds.length === data.length,
5209
+ indeterminate: !!selectedRowIds.length && selectedRowIds.length !== data.length,
5210
+ onChange: handleRowSelectAll
5211
+ }
5212
+ ) }),
5213
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
5214
+ Stack,
5215
+ {
5216
+ horizontal: true,
5217
+ horizontalMobile: true,
5218
+ items: "center",
5219
+ sizing: "component",
5220
+ padding: true,
5221
+ children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Heading3, { as: "span", color: "text-primary-normal", children: typeof Header === "string" ? Header : (_b = (_a = columns.find((col) => col.id === primaryKey)) == null ? void 0 : _a.header) == null ? void 0 : _b.toString() })
5222
+ }
5223
+ ),
5224
+ enableColumnSelector && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ColumnSelector, {})
5225
+ ]
5226
+ }
5227
+ ) })
5228
+ }
5229
+ );
5230
+ }
5231
+
5232
+ // src/components/MobileDataGrid/GridContextProvider/index.tsx
5233
+ var import_react36 = require("react");
5234
+
5235
+ // src/components/MobileDataGrid/dataGridReducer.ts
5236
+ function dataGridReducer(state, action) {
5237
+ var _a, _b, _c;
5238
+ const { type, payload } = action;
5239
+ let itemIndex = null;
5240
+ if (action.type === "INSERT" && action.pos === "INDEX")
5241
+ itemIndex = action.index;
5242
+ if (action.type === "UPDATE")
5243
+ itemIndex = (_a = action.index) != null ? _a : state.filter(({ id }) => !!id).findIndex(({ id }) => id === action.id);
5244
+ switch (type) {
5245
+ case "SET":
5246
+ return [...payload];
5247
+ case "UPDATE":
5248
+ if (typeof itemIndex !== "number" || itemIndex < 0)
5249
+ throw new Error("action.(id | index) must be provided.");
5250
+ return [
5251
+ ...state.slice(0, itemIndex),
5252
+ __spreadProps(__spreadValues(__spreadValues({}, state[itemIndex]), payload), {
5253
+ meta: __spreadValues(__spreadValues({}, (_b = state[itemIndex].meta) != null ? _b : {}), (_c = payload.meta) != null ? _c : {})
5254
+ }),
5255
+ ...state.slice(itemIndex + 1)
5256
+ ];
5257
+ default:
5258
+ throw new Error("Action type not implemented.");
5259
+ }
5260
+ }
5261
+
5262
+ // src/components/MobileDataGrid/GridContextProvider/index.tsx
5263
+ var import_jsx_runtime54 = require("react/jsx-runtime");
5264
+ function GridContextProvider(props) {
5265
+ const {
5266
+ initialColumns,
5267
+ id,
5268
+ testid,
5269
+ children,
5270
+ data,
5271
+ numberOfColumnsToShow,
5272
+ primaryKey,
5273
+ getId,
5274
+ onRowSelect
5275
+ } = props;
5276
+ const [columns, dispatch] = (0, import_react36.useReducer)(dataGridReducer, initialColumns);
5277
+ const [selectedRowIds, setSelectedRowIds] = (0, import_react36.useState)([]);
5278
+ const [currentRow, setCurrentRow] = (0, import_react36.useState)(null);
5279
+ const resetColumnVisibility = (0, import_react36.useCallback)(() => {
5280
+ const newColumns = columns.map((column) => {
5281
+ var _a;
5282
+ const initialColumn = initialColumns.find((c) => c.id === column.id);
5283
+ return __spreadProps(__spreadValues({}, column), {
5284
+ meta: __spreadProps(__spreadValues({}, column.meta), {
5285
+ visible: (_a = initialColumn == null ? void 0 : initialColumn.meta) == null ? void 0 : _a.visible
5286
+ })
5287
+ });
5288
+ });
5289
+ dispatch({ type: "SET", payload: newColumns });
5290
+ }, [columns, initialColumns]);
5291
+ const handleRowSelect = (0, import_react36.useCallback)(
5292
+ (item) => {
5293
+ var _a;
5294
+ const rowId = (_a = getId(item)) != null ? _a : "";
5295
+ if (!rowId) return;
5296
+ const nextSelected = selectedRowIds.includes(rowId) ? selectedRowIds.filter((id2) => id2 !== rowId) : [...selectedRowIds, rowId];
5297
+ setSelectedRowIds(nextSelected);
5298
+ if (onRowSelect) onRowSelect(item, nextSelected);
5299
+ },
5300
+ [getId, onRowSelect, selectedRowIds]
5301
+ );
5302
+ const handleRowSelectAll = (0, import_react36.useCallback)(() => {
5303
+ setSelectedRowIds((prev) => {
5304
+ if (prev.length === data.length) {
5305
+ return [];
5306
+ }
5307
+ return data.map(getId).filter((id2) => id2 !== void 0);
5308
+ });
5309
+ }, [data, getId]);
5310
+ const openRowDetail = (0, import_react36.useCallback)((row) => {
5311
+ setCurrentRow(row);
5312
+ }, []);
5313
+ const closeRowDetail = (0, import_react36.useCallback)(() => {
5314
+ setCurrentRow(null);
5315
+ }, []);
5316
+ const visibleColumns = (0, import_react36.useMemo)(() => {
5317
+ const effectiveLimit = typeof numberOfColumnsToShow === "number" ? Math.max(numberOfColumnsToShow - 1, 0) : void 0;
5318
+ if (primaryKey) {
5319
+ const pkColumn = columns.find((col) => col.id === String(primaryKey));
5320
+ const otherColumns = columns.filter(
5321
+ (col) => col.id !== String(primaryKey)
5322
+ );
5323
+ const orderedColumns = pkColumn ? [pkColumn, ...otherColumns] : [...otherColumns];
5324
+ return orderedColumns.filter((x) => {
5325
+ var _a;
5326
+ return ((_a = x.meta) == null ? void 0 : _a.visible) !== false;
5327
+ }).slice(0, effectiveLimit);
5328
+ }
5329
+ return columns.filter((x) => {
5330
+ var _a;
5331
+ return ((_a = x.meta) == null ? void 0 : _a.visible) !== false;
5332
+ }).slice(0, effectiveLimit);
5333
+ }, [columns, numberOfColumnsToShow, primaryKey]);
5334
+ return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
5335
+ GridContext.Provider,
5336
+ {
5337
+ value: {
5338
+ columns,
5339
+ testid,
5340
+ id,
5341
+ data,
5342
+ selectedRowIds,
5343
+ visibleColumns,
5344
+ numberOfColumnsToShow,
5345
+ primaryKey,
5346
+ dispatch,
5347
+ getId,
5348
+ resetColumnVisibility,
5349
+ handleRowSelect,
5350
+ handleRowSelectAll,
5351
+ isRowDetailOpen: !!currentRow,
5352
+ currentRow,
5353
+ openRowDetail,
5354
+ closeRowDetail
5355
+ },
5356
+ children
5357
+ }
5358
+ );
5359
+ }
5360
+
5361
+ // src/components/MobileDataGrid/MobileDataGridCard/MobileDataGridColumn.tsx
5362
+ var import_jsx_runtime55 = require("react/jsx-runtime");
5363
+ function MobileDataGridColumn(props) {
5364
+ var _a;
5365
+ const { column, data } = props;
5366
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "mb-2 grid grid-cols-2 gap-2 px-3 flex-1", children: [
5367
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(Paragraph, { color: "text-secondary-normal", className: "text-left", children: [
5368
+ (_a = column.header) == null ? void 0 : _a.toString(),
5369
+ ":"
5370
+ ] }),
5371
+ " ",
5372
+ column.id && data[column.id] ? data[column.id] : null
5373
+ ] });
5374
+ }
5375
+
5376
+ // src/components/MobileDataGrid/RowDetailModalProvider/ModalContent.tsx
5377
+ var import_jsx_runtime56 = require("react/jsx-runtime");
5378
+ function ModalContent2() {
5379
+ const context = useGridContext();
5380
+ const { columns, currentRow } = context;
5381
+ if (!currentRow) return null;
5382
+ return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Stack, { sizing: "layout-group", children: columns.filter((x) => {
5383
+ var _a;
5384
+ return !((_a = x.id) == null ? void 0 : _a.startsWith("__"));
5385
+ }).map(
5386
+ (column, index) => {
5387
+ var _a, _b;
5388
+ return ((_a = column.meta) == null ? void 0 : _a.useCustomRenderer) && column.meta.mobileCell && column.id ? /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
5389
+ "div",
5390
+ {
5391
+ className: "mb-2 grid grid-cols-2 gap-2 px-3 items-center flex-1",
5392
+ children: [
5393
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Paragraph, { color: "text-secondary-normal", className: "text-left", children: [
5394
+ (_b = column.header) == null ? void 0 : _b.toString(),
5395
+ ":"
5396
+ ] }),
5397
+ " ",
5398
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
5399
+ column.meta.mobileCell,
5400
+ {
5401
+ column,
5402
+ row: currentRow,
5403
+ cellValue: currentRow == null ? void 0 : currentRow[column.id]
5404
+ }
5405
+ )
5406
+ ]
5407
+ },
5408
+ `${column.id}-${index}`
5409
+ ) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
5410
+ MobileDataGridColumn,
5411
+ {
5412
+ column,
5413
+ data: currentRow
5414
+ },
5415
+ `${column.id}-${index}`
5416
+ );
5417
+ }
5418
+ ) });
5419
+ }
5420
+
5421
+ // src/components/MobileDataGrid/RowDetailModalProvider/index.tsx
5422
+ var import_jsx_runtime57 = require("react/jsx-runtime");
5423
+ function RowDetailModalProvider() {
5424
+ var _a;
5425
+ const context = useGridContext();
5426
+ const {
5427
+ id,
5428
+ testid,
5429
+ isRowDetailOpen,
5430
+ currentRow,
5431
+ primaryKey,
5432
+ closeRowDetail
5433
+ } = context;
5434
+ return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
5435
+ Modal,
5436
+ {
5437
+ fixedHeightScrolling: true,
5438
+ open: isRowDetailOpen,
5439
+ onClose: closeRowDetail,
5440
+ hideCloseIcon: true,
5441
+ size: "medium",
5442
+ className: "!p-0",
5443
+ headerIcon: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
5444
+ Stack,
5445
+ {
5232
5446
  horizontal: true,
5233
5447
  horizontalMobile: true,
5234
5448
  items: "center",
5235
5449
  justify: "between",
5236
5450
  width: "full",
5237
5451
  children: [
5238
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Heading2, { children: (_a = currentRow == null ? void 0 : currentRow[primaryKey != null ? primaryKey : "id"]) != null ? _a : "Grid Detail" }),
5239
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
5452
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Heading2, { children: (_a = currentRow == null ? void 0 : currentRow[primaryKey != null ? primaryKey : "id"]) != null ? _a : "Grid Detail" }),
5453
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
5240
5454
  Button,
5241
5455
  {
5242
5456
  id: id ? `${id}-open-in-new-button` : void 0,
@@ -5244,25 +5458,25 @@ function RowDetailModalProvider() {
5244
5458
  iconOnly: true,
5245
5459
  variant: "tertiary",
5246
5460
  onClick: closeRowDetail,
5247
- leftIcon: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Icon, { name: "open_in_new", size: 24 }) })
5461
+ leftIcon: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Icon, { name: "open_in_new", size: 24 }) })
5248
5462
  }
5249
5463
  )
5250
5464
  ]
5251
5465
  }
5252
5466
  ),
5253
- customActions: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Button, { onClick: closeRowDetail, className: "w-full", children: "Close" }),
5467
+ customActions: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Button, { onClick: closeRowDetail, className: "w-full", children: "Close" }),
5254
5468
  showButtons: true,
5255
- children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "bg-white max-h-full flex flex-col flex-grow-1", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ModalContent2, {}) })
5469
+ children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "bg-white max-h-full flex flex-col flex-grow-1", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(ModalContent2, {}) })
5256
5470
  }
5257
5471
  );
5258
5472
  }
5259
5473
 
5260
5474
  // src/components/MobileDataGrid/ColumnList.tsx
5261
- var import_clsx34 = __toESM(require("clsx"), 1);
5475
+ var import_clsx37 = __toESM(require("clsx"), 1);
5262
5476
 
5263
5477
  // src/components/MobileDataGrid/MobileDataGridCard/index.tsx
5264
- var import_clsx33 = __toESM(require("clsx"), 1);
5265
- var import_jsx_runtime50 = require("react/jsx-runtime");
5478
+ var import_clsx36 = __toESM(require("clsx"), 1);
5479
+ var import_jsx_runtime58 = require("react/jsx-runtime");
5266
5480
  function MobileDataGridCard({
5267
5481
  renderLink,
5268
5482
  renderChevron = true,
@@ -5274,27 +5488,27 @@ function MobileDataGridCard({
5274
5488
  var _a;
5275
5489
  const context = useGridContext();
5276
5490
  const { id, testid, visibleColumns, getId, handleRowSelect, openRowDetail } = context;
5277
- return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
5491
+ return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
5278
5492
  "li",
5279
5493
  {
5280
5494
  id: id ? `${id}-card-${getId(data)}` : void 0,
5281
5495
  "data-testid": testid ? `${testid}-card-${getId(data)}` : void 0,
5282
- className: (0, import_clsx33.default)(
5496
+ className: (0, import_clsx36.default)(
5283
5497
  "hover:bg-action-100 cursor-pointer list-none",
5284
5498
  selected ? "bg-action-100" : "bg-background-grouped-primary-normal"
5285
5499
  ),
5286
5500
  onClick: () => openRowDetail(data),
5287
5501
  children: [
5288
- /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(Stack, { sizing: "component", children: [
5289
- /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(Stack, { horizontal: true, horizontalMobile: true, items: "center", justify: "between", children: [
5290
- enableRowSelection && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
5502
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Stack, { sizing: "component", children: [
5503
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Stack, { horizontal: true, horizontalMobile: true, items: "center", justify: "between", children: [
5504
+ enableRowSelection && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
5291
5505
  Stack,
5292
5506
  {
5293
5507
  sizing: "component",
5294
5508
  padding: true,
5295
5509
  width: "fit",
5296
5510
  onClick: (e) => e.stopPropagation(),
5297
- children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
5511
+ children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
5298
5512
  Checkbox,
5299
5513
  {
5300
5514
  id: id ? `${id}-${getId(data)}-select-checkbox` : void 0,
@@ -5305,16 +5519,16 @@ function MobileDataGridCard({
5305
5519
  )
5306
5520
  }
5307
5521
  ),
5308
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
5522
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
5309
5523
  Stack,
5310
5524
  {
5311
5525
  sizing: "component",
5312
5526
  padding: true,
5313
5527
  onClick: (e) => e.stopPropagation(),
5314
- children: renderLink ? renderLink(data) : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Subheader, { children: String((_a = data[context.primaryKey]) != null ? _a : "") })
5528
+ children: renderLink ? renderLink(data) : /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Subheader, { children: String((_a = data[context.primaryKey]) != null ? _a : "") })
5315
5529
  }
5316
5530
  ),
5317
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
5531
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
5318
5532
  Stack,
5319
5533
  {
5320
5534
  horizontal: true,
@@ -5327,18 +5541,18 @@ function MobileDataGridCard({
5327
5541
  }
5328
5542
  )
5329
5543
  ] }),
5330
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Stack, { sizing: "layout-group", children: visibleColumns.filter((x) => {
5544
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Stack, { sizing: "layout-group", children: visibleColumns.filter((x) => {
5331
5545
  var _a2, _b;
5332
5546
  return ((_a2 = x.meta) == null ? void 0 : _a2.visible) !== false && !((_b = x.id) == null ? void 0 : _b.startsWith("__"));
5333
5547
  }).map(
5334
5548
  (column, index) => {
5335
5549
  var _a2, _b;
5336
- return ((_a2 = column.meta) == null ? void 0 : _a2.useCustomRenderer) && column.meta.mobileCell && column.id ? /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
5550
+ return ((_a2 = column.meta) == null ? void 0 : _a2.useCustomRenderer) && column.meta.mobileCell && column.id ? /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
5337
5551
  "div",
5338
5552
  {
5339
5553
  className: "mb-2 grid grid-cols-2 gap-2 px-3 items-center flex-1",
5340
5554
  children: [
5341
- /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
5555
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
5342
5556
  Paragraph,
5343
5557
  {
5344
5558
  color: "text-secondary-normal",
@@ -5350,7 +5564,7 @@ function MobileDataGridCard({
5350
5564
  }
5351
5565
  ),
5352
5566
  " ",
5353
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
5567
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
5354
5568
  column.meta.mobileCell,
5355
5569
  {
5356
5570
  column,
@@ -5361,7 +5575,7 @@ function MobileDataGridCard({
5361
5575
  ]
5362
5576
  },
5363
5577
  `${column.id}-${index}`
5364
- ) : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
5578
+ ) : /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
5365
5579
  MobileDataGridColumn,
5366
5580
  {
5367
5581
  column,
@@ -5372,14 +5586,14 @@ function MobileDataGridCard({
5372
5586
  }
5373
5587
  ) })
5374
5588
  ] }),
5375
- renderChevron && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Stack, { items: "center", justify: "center", horizontal: true, horizontalMobile: true, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Icon, { name: "keyboard_arrow_down" }) })
5589
+ renderChevron && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Stack, { items: "center", justify: "center", horizontal: true, horizontalMobile: true, children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Icon, { name: "keyboard_arrow_down" }) })
5376
5590
  ]
5377
5591
  }
5378
5592
  );
5379
5593
  }
5380
5594
 
5381
5595
  // src/components/MobileDataGrid/ColumnList.tsx
5382
- var import_jsx_runtime51 = require("react/jsx-runtime");
5596
+ var import_jsx_runtime59 = require("react/jsx-runtime");
5383
5597
  function ColumnList(props) {
5384
5598
  const {
5385
5599
  withBorder,
@@ -5391,19 +5605,19 @@ function ColumnList(props) {
5391
5605
  } = props;
5392
5606
  const ctx = useGridContext();
5393
5607
  const { id, testid, data, getId, selectedRowIds } = ctx;
5394
- return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
5608
+ return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
5395
5609
  "div",
5396
5610
  {
5397
- className: (0, import_clsx34.default)(
5611
+ className: (0, import_clsx37.default)(
5398
5612
  "flex flex-col flex-1 relative overflow-y-auto overflow-x-hidden",
5399
5613
  !!Footer && "mb-20"
5400
5614
  ),
5401
- children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
5615
+ children: /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
5402
5616
  "ul",
5403
5617
  {
5404
5618
  id,
5405
5619
  "data-testid": testid,
5406
- className: (0, import_clsx34.default)(
5620
+ className: (0, import_clsx37.default)(
5407
5621
  "rounded absolute top-0 left-0 w-full flex-1",
5408
5622
  "divide-y divide-border-primary-normal",
5409
5623
  withBorder && "border border-border-primary-normal"
@@ -5411,7 +5625,7 @@ function ColumnList(props) {
5411
5625
  children: [
5412
5626
  data.map((item) => {
5413
5627
  const id2 = getId(item);
5414
- return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
5628
+ return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
5415
5629
  MobileDataGridCard,
5416
5630
  {
5417
5631
  data: item,
@@ -5424,7 +5638,7 @@ function ColumnList(props) {
5424
5638
  id2
5425
5639
  );
5426
5640
  }),
5427
- !!Footer && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "fixed left-0 right-0 bottom-0 flex flex-col w-full min-h-20", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Footer, __spreadValues({}, ctx)) })
5641
+ !!Footer && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "fixed left-0 right-0 bottom-0 flex flex-col w-full min-h-20", children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Footer, __spreadValues({}, ctx)) })
5428
5642
  ]
5429
5643
  }
5430
5644
  )
@@ -5433,7 +5647,7 @@ function ColumnList(props) {
5433
5647
  }
5434
5648
 
5435
5649
  // src/components/MobileDataGrid/index.tsx
5436
- var import_jsx_runtime52 = require("react/jsx-runtime");
5650
+ var import_jsx_runtime60 = require("react/jsx-runtime");
5437
5651
  function MobileDataGrid(props) {
5438
5652
  const {
5439
5653
  columns,
@@ -5455,7 +5669,7 @@ function MobileDataGrid(props) {
5455
5669
  rowActions,
5456
5670
  rounded
5457
5671
  } = props;
5458
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
5672
+ return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
5459
5673
  GridContextProvider,
5460
5674
  {
5461
5675
  initialColumns: columns,
@@ -5467,7 +5681,7 @@ function MobileDataGrid(props) {
5467
5681
  numberOfColumnsToShow,
5468
5682
  primaryKey,
5469
5683
  children: [
5470
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
5684
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
5471
5685
  Stack,
5472
5686
  {
5473
5687
  height: "full",
@@ -5475,7 +5689,7 @@ function MobileDataGrid(props) {
5475
5689
  overflowX: "hidden",
5476
5690
  overflowY: "hidden",
5477
5691
  children: [
5478
- !hideHeader && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
5692
+ !hideHeader && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
5479
5693
  MobileDataGridHeader,
5480
5694
  {
5481
5695
  header,
@@ -5483,7 +5697,7 @@ function MobileDataGrid(props) {
5483
5697
  enableRowSelection
5484
5698
  }
5485
5699
  ),
5486
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
5700
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
5487
5701
  ColumnList,
5488
5702
  {
5489
5703
  withBorder,
@@ -5497,7 +5711,7 @@ function MobileDataGrid(props) {
5497
5711
  ]
5498
5712
  }
5499
5713
  ),
5500
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(RowDetailModalProvider, {})
5714
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(RowDetailModalProvider, {})
5501
5715
  ]
5502
5716
  }
5503
5717
  );