@dmsi/wedgekit-react 0.0.159 → 0.0.160

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 (43) hide show
  1. package/dist/{chunk-WJ447JB5.js → chunk-4NCDT5ZY.js} +5 -5
  2. package/dist/{chunk-QFSGM4MP.js → chunk-NT2ZKA4W.js} +4 -4
  3. package/dist/{chunk-GG5JOFS6.js → chunk-PLMGI5K5.js} +1 -1
  4. package/dist/{chunk-IDSFWKOR.js → chunk-PMBEIP24.js} +1 -1
  5. package/dist/{chunk-N7EKJEYO.js → chunk-RUTYNLKS.js} +3 -3
  6. package/dist/{chunk-KADNOKNW.js → chunk-XH65MD2C.js} +1 -1
  7. package/dist/components/DataGridCell.js +8 -8
  8. package/dist/components/DateInput.js +9 -9
  9. package/dist/components/DateRangeInput.js +10 -10
  10. package/dist/components/FilterGroup.js +7 -7
  11. package/dist/components/Input.js +2 -2
  12. package/dist/components/LoadingScrim.cjs +1 -1
  13. package/dist/components/LoadingScrim.js +1 -1
  14. package/dist/components/Menu.js +2 -2
  15. package/dist/components/MenuOption.js +2 -2
  16. package/dist/components/MobileDataGrid.js +3 -3
  17. package/dist/components/Modal.js +2 -2
  18. package/dist/components/NestedMenu.js +2 -2
  19. package/dist/components/Notification.js +3 -3
  20. package/dist/components/PDFViewer.cjs +203 -42
  21. package/dist/components/PDFViewer.js +94 -40
  22. package/dist/components/Password.js +2 -2
  23. package/dist/components/PaymentOnAccountModal.cjs +1 -1
  24. package/dist/components/PaymentOnAccountModal.js +8 -8
  25. package/dist/components/Search.js +3 -3
  26. package/dist/components/Select.js +3 -3
  27. package/dist/components/SelectPaymentMethod.cjs +1 -1
  28. package/dist/components/SelectPaymentMethod.js +3 -3
  29. package/dist/components/Spinner.cjs +1 -1
  30. package/dist/components/Spinner.js +1 -1
  31. package/dist/components/Stepper.js +2 -2
  32. package/dist/components/Time.js +2 -2
  33. package/dist/components/Toast.js +3 -3
  34. package/dist/components/Upload.js +3 -3
  35. package/dist/components/index.cjs +1 -1
  36. package/dist/components/index.js +23 -23
  37. package/package.json +1 -1
  38. package/src/components/PDFViewer.tsx +63 -17
  39. package/src/components/Spinner.tsx +1 -1
  40. package/dist/{chunk-MVGOAMTP.js → chunk-4T3DRGLF.js} +3 -3
  41. package/dist/{chunk-NRCUFAOZ.js → chunk-5GOJRLQO.js} +3 -3
  42. package/dist/{chunk-AEDEFN7A.js → chunk-FFU6FB3K.js} +3 -3
  43. package/dist/{chunk-LPARJM6S.js → chunk-YR7JUKYO.js} +3 -3
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  Menu
3
- } from "./chunk-LPARJM6S.js";
3
+ } from "./chunk-YR7JUKYO.js";
4
4
  import {
5
5
  useSubMenuSystem
6
6
  } from "./chunk-5GUW4DUY.js";
7
7
  import {
8
8
  MenuOption
9
- } from "./chunk-AEDEFN7A.js";
9
+ } from "./chunk-FFU6FB3K.js";
10
+ import {
11
+ Search
12
+ } from "./chunk-PMBEIP24.js";
10
13
  import {
11
14
  CSS
12
15
  } from "./chunk-WVUIIBRR.js";
13
- import {
14
- Search
15
- } from "./chunk-IDSFWKOR.js";
16
16
  import {
17
17
  Icon
18
18
  } from "./chunk-NKUETCDA.js";
@@ -6,16 +6,13 @@ import {
6
6
  } from "./chunk-BATIOCXB.js";
7
7
  import {
8
8
  Spinner
9
- } from "./chunk-GG5JOFS6.js";
9
+ } from "./chunk-PLMGI5K5.js";
10
10
  import {
11
11
  HorizontalDivider
12
12
  } from "./chunk-EPQLWHCL.js";
13
13
  import {
14
14
  Checkbox
15
15
  } from "./chunk-WFQEE2OO.js";
16
- import {
17
- Button
18
- } from "./chunk-FKMKHLQH.js";
19
16
  import {
20
17
  formatCurrencyDisplay,
21
18
  formatDecimalValue
@@ -32,6 +29,9 @@ import {
32
29
  import {
33
30
  Card
34
31
  } from "./chunk-4LXG6QNT.js";
32
+ import {
33
+ Button
34
+ } from "./chunk-FKMKHLQH.js";
35
35
 
36
36
  // src/components/SelectPaymentMethod.tsx
37
37
  import { useEffect, useState } from "react";
@@ -11,7 +11,7 @@ var Spinner = ({ size = "small", testid }) => {
11
11
  viewBox: "0 0 24 24",
12
12
  xmlns: "http://www.w3.org/2000/svg",
13
13
  fill: "#1D1E1E",
14
- className: size === "large" ? "animate-spin" : "",
14
+ className: "animate-spin",
15
15
  "aria-label": "Loading",
16
16
  children: [
17
17
  /* @__PURE__ */ jsx("circle", { cx: "12", cy: "4", r: "2", opacity: "1", children: /* @__PURE__ */ jsx(
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Input
3
- } from "./chunk-MVGOAMTP.js";
3
+ } from "./chunk-4T3DRGLF.js";
4
4
  import {
5
5
  __objRest,
6
6
  __spreadValues
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  SelectPaymentMethod
3
- } from "./chunk-QFSGM4MP.js";
3
+ } from "./chunk-NT2ZKA4W.js";
4
4
  import {
5
5
  Modal
6
- } from "./chunk-NRCUFAOZ.js";
6
+ } from "./chunk-5GOJRLQO.js";
7
7
  import {
8
8
  Input
9
- } from "./chunk-MVGOAMTP.js";
9
+ } from "./chunk-4T3DRGLF.js";
10
10
  import {
11
11
  formatCurrencyDisplay
12
12
  } from "./chunk-5UH6QUFB.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  InputBase
3
- } from "./chunk-MVGOAMTP.js";
3
+ } from "./chunk-4T3DRGLF.js";
4
4
  import {
5
5
  Icon
6
6
  } from "./chunk-NKUETCDA.js";
@@ -4,17 +4,17 @@ import {
4
4
  DataGridCell,
5
5
  DragAlongCell,
6
6
  DraggableCellHeader
7
- } from "../chunk-WJ447JB5.js";
8
- import "../chunk-LPARJM6S.js";
7
+ } from "../chunk-4NCDT5ZY.js";
8
+ import "../chunk-YR7JUKYO.js";
9
9
  import "../chunk-5GUW4DUY.js";
10
- import "../chunk-AEDEFN7A.js";
11
- import "../chunk-WVUIIBRR.js";
12
- import "../chunk-4T7F5BZZ.js";
13
- import "../chunk-IDSFWKOR.js";
14
- import "../chunk-MVGOAMTP.js";
15
- import "../chunk-JWCT72WR.js";
10
+ import "../chunk-FFU6FB3K.js";
16
11
  import "../chunk-WNQ53SVY.js";
12
+ import "../chunk-4T7F5BZZ.js";
13
+ import "../chunk-PMBEIP24.js";
14
+ import "../chunk-4T3DRGLF.js";
17
15
  import "../chunk-5UH6QUFB.js";
16
+ import "../chunk-JWCT72WR.js";
17
+ import "../chunk-WVUIIBRR.js";
18
18
  import "../chunk-HVI3CL7Y.js";
19
19
  import "../chunk-NKUETCDA.js";
20
20
  import "../chunk-RDLEIAQU.js";
@@ -1,21 +1,21 @@
1
+ import {
2
+ calculateCursorPosition,
3
+ formatDate,
4
+ formatInputValue,
5
+ isValidDate,
6
+ parseInputDate
7
+ } from "../chunk-IDN3IN2A.js";
1
8
  import {
2
9
  findDocumentRoot
3
10
  } from "../chunk-4T7F5BZZ.js";
4
11
  import {
5
12
  InputBase
6
- } from "../chunk-MVGOAMTP.js";
13
+ } from "../chunk-4T3DRGLF.js";
14
+ import "../chunk-5UH6QUFB.js";
7
15
  import "../chunk-JWCT72WR.js";
8
16
  import {
9
17
  CalendarRange
10
18
  } from "../chunk-NMVSRA5Y.js";
11
- import {
12
- calculateCursorPosition,
13
- formatDate,
14
- formatInputValue,
15
- isValidDate,
16
- parseInputDate
17
- } from "../chunk-IDN3IN2A.js";
18
- import "../chunk-5UH6QUFB.js";
19
19
  import {
20
20
  Icon
21
21
  } from "../chunk-NKUETCDA.js";
@@ -1,13 +1,3 @@
1
- import {
2
- findDocumentRoot
3
- } from "../chunk-4T7F5BZZ.js";
4
- import {
5
- InputBase
6
- } from "../chunk-MVGOAMTP.js";
7
- import "../chunk-JWCT72WR.js";
8
- import {
9
- CalendarRange
10
- } from "../chunk-NMVSRA5Y.js";
11
1
  import {
12
2
  calculateCursorPosition,
13
3
  formatDate,
@@ -16,7 +6,17 @@ import {
16
6
  isValidDateRangeOrder,
17
7
  parseInputDate
18
8
  } from "../chunk-IDN3IN2A.js";
9
+ import {
10
+ findDocumentRoot
11
+ } from "../chunk-4T7F5BZZ.js";
12
+ import {
13
+ InputBase
14
+ } from "../chunk-4T3DRGLF.js";
19
15
  import "../chunk-5UH6QUFB.js";
16
+ import "../chunk-JWCT72WR.js";
17
+ import {
18
+ CalendarRange
19
+ } from "../chunk-NMVSRA5Y.js";
20
20
  import {
21
21
  Icon
22
22
  } from "../chunk-NKUETCDA.js";
@@ -2,22 +2,22 @@
2
2
  import {
3
3
  OptionPill
4
4
  } from "../chunk-LM5MKBPM.js";
5
+ import {
6
+ Checkbox
7
+ } from "../chunk-WFQEE2OO.js";
5
8
  import {
6
9
  Search
7
- } from "../chunk-IDSFWKOR.js";
8
- import "../chunk-MVGOAMTP.js";
10
+ } from "../chunk-PMBEIP24.js";
11
+ import "../chunk-4T3DRGLF.js";
12
+ import "../chunk-5UH6QUFB.js";
9
13
  import {
10
14
  Label
11
15
  } from "../chunk-JWCT72WR.js";
12
- import {
13
- Checkbox
14
- } from "../chunk-WFQEE2OO.js";
15
- import "../chunk-FKMKHLQH.js";
16
- import "../chunk-5UH6QUFB.js";
17
16
  import "../chunk-HVI3CL7Y.js";
18
17
  import {
19
18
  Link
20
19
  } from "../chunk-I6GEUF6Y.js";
20
+ import "../chunk-FKMKHLQH.js";
21
21
  import {
22
22
  Icon
23
23
  } from "../chunk-NKUETCDA.js";
@@ -6,9 +6,9 @@ import {
6
6
  InputBase,
7
7
  Percentage,
8
8
  UOM
9
- } from "../chunk-MVGOAMTP.js";
10
- import "../chunk-JWCT72WR.js";
9
+ } from "../chunk-4T3DRGLF.js";
11
10
  import "../chunk-5UH6QUFB.js";
11
+ import "../chunk-JWCT72WR.js";
12
12
  import "../chunk-NKUETCDA.js";
13
13
  import "../chunk-RDLEIAQU.js";
14
14
  import "../chunk-ORMEWXMH.js";
@@ -48,7 +48,7 @@ var Spinner = ({ size = "small", testid }) => {
48
48
  viewBox: "0 0 24 24",
49
49
  xmlns: "http://www.w3.org/2000/svg",
50
50
  fill: "#1D1E1E",
51
- className: size === "large" ? "animate-spin" : "",
51
+ className: "animate-spin",
52
52
  "aria-label": "Loading",
53
53
  children: [
54
54
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "12", cy: "4", r: "2", opacity: "1", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Spinner
3
- } from "../chunk-GG5JOFS6.js";
3
+ } from "../chunk-PLMGI5K5.js";
4
4
  import "../chunk-ORMEWXMH.js";
5
5
 
6
6
  // src/components/LoadingScrim.tsx
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import {
3
3
  Menu
4
- } from "../chunk-LPARJM6S.js";
4
+ } from "../chunk-YR7JUKYO.js";
5
5
  import "../chunk-5GUW4DUY.js";
6
- import "../chunk-4T7F5BZZ.js";
7
6
  import "../chunk-WNQ53SVY.js";
7
+ import "../chunk-4T7F5BZZ.js";
8
8
  import "../chunk-ORMEWXMH.js";
9
9
  export {
10
10
  Menu
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import {
3
3
  MenuOption
4
- } from "../chunk-AEDEFN7A.js";
5
- import "../chunk-JWCT72WR.js";
4
+ } from "../chunk-FFU6FB3K.js";
6
5
  import "../chunk-WNQ53SVY.js";
6
+ import "../chunk-JWCT72WR.js";
7
7
  import "../chunk-HVI3CL7Y.js";
8
8
  import "../chunk-NKUETCDA.js";
9
9
  import "../chunk-RDLEIAQU.js";
@@ -4,15 +4,15 @@ import {
4
4
  import {
5
5
  Heading3
6
6
  } from "../chunk-AZ7LVLOK.js";
7
- import {
8
- Button
9
- } from "../chunk-FKMKHLQH.js";
10
7
  import {
11
8
  Stack
12
9
  } from "../chunk-N6JVLYEE.js";
13
10
  import {
14
11
  Paragraph
15
12
  } from "../chunk-HVI3CL7Y.js";
13
+ import {
14
+ Button
15
+ } from "../chunk-FKMKHLQH.js";
16
16
  import {
17
17
  Icon
18
18
  } from "../chunk-NKUETCDA.js";
@@ -1,16 +1,16 @@
1
1
  "use client";
2
2
  import {
3
3
  Modal
4
- } from "../chunk-NRCUFAOZ.js";
4
+ } from "../chunk-5GOJRLQO.js";
5
5
  import "../chunk-4RJKB7LC.js";
6
6
  import "../chunk-C4JGTH6G.js";
7
7
  import "../chunk-SYEJVSE4.js";
8
8
  import "../chunk-R7ELP5C5.js";
9
9
  import "../chunk-ZFOANBWG.js";
10
10
  import "../chunk-AZ7LVLOK.js";
11
+ import "../chunk-WNQ53SVY.js";
11
12
  import "../chunk-4T7F5BZZ.js";
12
13
  import "../chunk-FKMKHLQH.js";
13
- import "../chunk-WNQ53SVY.js";
14
14
  import "../chunk-NKUETCDA.js";
15
15
  import "../chunk-RDLEIAQU.js";
16
16
  import "../chunk-ORMEWXMH.js";
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  import {
3
3
  MenuOption
4
- } from "../chunk-AEDEFN7A.js";
5
- import "../chunk-JWCT72WR.js";
4
+ } from "../chunk-FFU6FB3K.js";
6
5
  import {
7
6
  useKeydown
8
7
  } from "../chunk-WNQ53SVY.js";
8
+ import "../chunk-JWCT72WR.js";
9
9
  import "../chunk-HVI3CL7Y.js";
10
10
  import {
11
11
  Icon
@@ -2,15 +2,15 @@
2
2
  import {
3
3
  Heading3
4
4
  } from "../chunk-AZ7LVLOK.js";
5
- import {
6
- Button
7
- } from "../chunk-FKMKHLQH.js";
8
5
  import {
9
6
  Stack
10
7
  } from "../chunk-N6JVLYEE.js";
11
8
  import {
12
9
  Paragraph
13
10
  } from "../chunk-HVI3CL7Y.js";
11
+ import {
12
+ Button
13
+ } from "../chunk-FKMKHLQH.js";
14
14
  import {
15
15
  Icon
16
16
  } from "../chunk-NKUETCDA.js";
@@ -1154,8 +1154,118 @@ var WhichIcon = ({
1154
1154
  };
1155
1155
  Caption.displayName = "Caption";
1156
1156
 
1157
- // src/components/PDFViewer.tsx
1157
+ // src/components/Spinner.tsx
1158
1158
  var import_jsx_runtime11 = require("react/jsx-runtime");
1159
+ var Spinner = ({ size = "small", testid }) => {
1160
+ const dimension = size === "large" ? 48 : 24;
1161
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
1162
+ "svg",
1163
+ {
1164
+ "data-testid": testid,
1165
+ width: dimension,
1166
+ height: dimension,
1167
+ viewBox: "0 0 24 24",
1168
+ xmlns: "http://www.w3.org/2000/svg",
1169
+ fill: "#1D1E1E",
1170
+ className: "animate-spin",
1171
+ "aria-label": "Loading",
1172
+ children: [
1173
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("circle", { cx: "12", cy: "4", r: "2", opacity: "1", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1174
+ "animate",
1175
+ {
1176
+ attributeName: "opacity",
1177
+ begin: "0s",
1178
+ dur: "1s",
1179
+ from: "1",
1180
+ to: "0",
1181
+ repeatCount: "indefinite"
1182
+ }
1183
+ ) }),
1184
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("circle", { cx: "17.666", cy: "6.334", r: "2", opacity: "0.125", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1185
+ "animate",
1186
+ {
1187
+ attributeName: "opacity",
1188
+ begin: "-0.875s",
1189
+ dur: "1s",
1190
+ from: "1",
1191
+ to: "0",
1192
+ repeatCount: "indefinite"
1193
+ }
1194
+ ) }),
1195
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("circle", { cx: "20", cy: "12", r: "2", opacity: "0.25", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1196
+ "animate",
1197
+ {
1198
+ attributeName: "opacity",
1199
+ begin: "-0.75s",
1200
+ dur: "1s",
1201
+ from: "1",
1202
+ to: "0",
1203
+ repeatCount: "indefinite"
1204
+ }
1205
+ ) }),
1206
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("circle", { cx: "17.666", cy: "17.666", r: "2", opacity: "0.375", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1207
+ "animate",
1208
+ {
1209
+ attributeName: "opacity",
1210
+ begin: "-0.625s",
1211
+ dur: "1s",
1212
+ from: "1",
1213
+ to: "0",
1214
+ repeatCount: "indefinite"
1215
+ }
1216
+ ) }),
1217
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("circle", { cx: "12", cy: "20", r: "2", opacity: "0.5", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1218
+ "animate",
1219
+ {
1220
+ attributeName: "opacity",
1221
+ begin: "-0.5s",
1222
+ dur: "1s",
1223
+ from: "1",
1224
+ to: "0",
1225
+ repeatCount: "indefinite"
1226
+ }
1227
+ ) }),
1228
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("circle", { cx: "6.334", cy: "17.666", r: "2", opacity: "0.625", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1229
+ "animate",
1230
+ {
1231
+ attributeName: "opacity",
1232
+ begin: "-0.375s",
1233
+ dur: "1s",
1234
+ from: "1",
1235
+ to: "0",
1236
+ repeatCount: "indefinite"
1237
+ }
1238
+ ) }),
1239
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("circle", { cx: "4", cy: "12", r: "2", opacity: "0.75", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1240
+ "animate",
1241
+ {
1242
+ attributeName: "opacity",
1243
+ begin: "-0.25s",
1244
+ dur: "1s",
1245
+ from: "1",
1246
+ to: "0",
1247
+ repeatCount: "indefinite"
1248
+ }
1249
+ ) }),
1250
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("circle", { cx: "6.334", cy: "6.334", r: "2", opacity: "0.875", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1251
+ "animate",
1252
+ {
1253
+ attributeName: "opacity",
1254
+ begin: "-0.125s",
1255
+ dur: "1s",
1256
+ from: "1",
1257
+ to: "0",
1258
+ repeatCount: "indefinite"
1259
+ }
1260
+ ) })
1261
+ ]
1262
+ }
1263
+ );
1264
+ };
1265
+ Spinner.displayName = "Spinner";
1266
+
1267
+ // src/components/PDFViewer.tsx
1268
+ var import_jsx_runtime12 = require("react/jsx-runtime");
1159
1269
  function PDFViewer(props) {
1160
1270
  const { isOpen, onClose, encodedPdfs, customActions, testid } = props;
1161
1271
  const [currentIndex, setCurrentIndex] = (0, import_react6.useState)(0);
@@ -1163,15 +1273,20 @@ function PDFViewer(props) {
1163
1273
  const handleDownload = (0, import_react6.useCallback)(() => {
1164
1274
  setIsDownloading(true);
1165
1275
  const link = document.createElement("a");
1166
- link.href = `data:application/pdf;base64,${encodedPdfs[currentIndex].base64}`;
1167
- link.download = encodedPdfs[currentIndex].fileName.endsWith(".pdf") ? encodedPdfs[currentIndex].fileName : `${encodedPdfs[currentIndex].fileName}.pdf`;
1276
+ const currentPdf = encodedPdfs[currentIndex];
1277
+ if (!currentPdf) {
1278
+ setIsDownloading(false);
1279
+ return;
1280
+ }
1281
+ link.href = `data:application/pdf;base64,${currentPdf.base64}`;
1282
+ link.download = currentPdf.fileName.endsWith(".pdf") ? currentPdf.fileName : `${currentPdf.fileName}.pdf`;
1168
1283
  document.body.appendChild(link);
1169
1284
  link.click();
1170
1285
  document.body.removeChild(link);
1171
1286
  setIsDownloading(false);
1172
1287
  }, [currentIndex, encodedPdfs]);
1173
1288
  if (!encodedPdfs.length) return null;
1174
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1289
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1175
1290
  Modal,
1176
1291
  {
1177
1292
  testid,
@@ -1179,14 +1294,22 @@ function PDFViewer(props) {
1179
1294
  onClose,
1180
1295
  showButtons: !!customActions,
1181
1296
  customActions,
1182
- headerIcon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(DownloadIcon, { testid: testid ? `${testid}-download-icon` : void 0, onClick: handleDownload, isDownloading }),
1183
- children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Stack, { sizing: "layout", children: [
1184
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(PDFElement, { testid, b64: encodedPdfs[currentIndex].base64 }),
1185
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Stack, { horizontal: true, overflowX: "auto", sizing: "layout-group", children: encodedPdfs.map((pdf, index) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1297
+ headerIcon: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1298
+ DownloadIcon,
1299
+ {
1300
+ testid: testid ? `${testid}-download-icon` : void 0,
1301
+ onClick: handleDownload,
1302
+ isDownloading
1303
+ }
1304
+ ),
1305
+ children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Stack, { sizing: "layout", children: [
1306
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(PDFElement, { testid, b64: encodedPdfs[currentIndex].base64 }),
1307
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Stack, { horizontal: true, overflowX: "auto", sizing: "layout-group", children: encodedPdfs.map((pdf, index) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
1186
1308
  Button,
1187
1309
  {
1188
1310
  testid: testid ? `${testid}-${pdf.fileName}-button` : void 0,
1189
1311
  variant: index === currentIndex ? "primary" : "secondary",
1312
+ classNameLabel: "items-center flex flex-row gap-2",
1190
1313
  onClick: (e) => {
1191
1314
  setCurrentIndex(index);
1192
1315
  requestAnimationFrame(() => {
@@ -1198,8 +1321,11 @@ function PDFViewer(props) {
1198
1321
  });
1199
1322
  });
1200
1323
  },
1201
- disabled: isDownloading || currentIndex === index,
1202
- children: pdf.fileName
1324
+ disabled: isDownloading || currentIndex === index || !pdf.base64,
1325
+ children: [
1326
+ !pdf.base64 && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Spinner, {}),
1327
+ pdf.fileName
1328
+ ]
1203
1329
  },
1204
1330
  `${pdf.fileName}-${index}`
1205
1331
  )) })
@@ -1212,13 +1338,13 @@ function DownloadIcon({
1212
1338
  isDownloading,
1213
1339
  testid
1214
1340
  }) {
1215
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1341
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1216
1342
  Button,
1217
1343
  {
1218
1344
  testid,
1219
1345
  iconOnly: true,
1220
1346
  variant: "tertiary",
1221
- leftIcon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Icon, { name: isDownloading ? "cached" : "download" }),
1347
+ leftIcon: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Icon, { name: isDownloading ? "cached" : "download" }),
1222
1348
  onClick
1223
1349
  }
1224
1350
  );
@@ -1233,36 +1359,71 @@ function PDFElement({ b64, testid }) {
1233
1359
  canvasRef,
1234
1360
  scale: 1
1235
1361
  });
1236
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex flex-col space-y-4", children: [
1237
- pdfDocument ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("canvas", { "data-testid": testid ? `${testid}-pdf-content` : void 0, ref: canvasRef }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { "data-testid": testid ? `${testid}-pdf-loading` : void 0, children: "Loading PDF..." }),
1238
- (pdfDocument == null ? void 0 : pdfDocument.numPages) && pdfDocument.numPages > 1 && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("ul", { className: "flex flex-row justify-between items-center", "data-testid": testid ? `${testid}-pdf-pagination` : void 0, children: [
1239
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("li", { className: "previous", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1240
- "button",
1241
- {
1242
- "data-testid": testid ? `${testid}-pdf-pagination-previous-button` : void 0,
1243
- disabled: page === 1,
1244
- onClick: () => setPage(page - 1),
1245
- className: "not-disabled:cursor-pointer not-disabled:hover:underline ",
1246
- children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Caption, { children: "Previous" })
1247
- }
1248
- ) }),
1249
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("li", { "data-testid": testid ? `${testid}-pdf-pagination-text` : void 0, className: "text-label-desktop text-text-on-action-primary-normal", children: [
1250
- "Page ",
1251
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { "data-testid": testid ? `${testid}-pdf-pagination-page-${page}` : void 0, children: page }),
1252
- " of ",
1253
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { "data-testid": testid ? `${testid}-pdf-pagination-total-page-${pdfDocument.numPages}` : void 0, children: pdfDocument.numPages })
1254
- ] }),
1255
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("li", { className: "next", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1256
- "button",
1257
- {
1258
- "data-testid": testid ? `${testid}-pdf-pagination-next-button` : void 0,
1259
- disabled: page === pdfDocument.numPages,
1260
- onClick: () => setPage(page + 1),
1261
- className: "not-disabled:cursor-pointer not-disabled:hover:underline ",
1262
- children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Caption, { children: "Next" })
1263
- }
1264
- ) })
1265
- ] })
1362
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex flex-col space-y-4", children: [
1363
+ pdfDocument ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1364
+ "canvas",
1365
+ {
1366
+ "data-testid": testid ? `${testid}-pdf-content` : void 0,
1367
+ ref: canvasRef
1368
+ }
1369
+ ) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { "data-testid": testid ? `${testid}-pdf-loading` : void 0, children: "Loading PDF..." }),
1370
+ (pdfDocument == null ? void 0 : pdfDocument.numPages) && pdfDocument.numPages > 1 && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
1371
+ "ul",
1372
+ {
1373
+ className: "flex flex-row justify-between items-center",
1374
+ "data-testid": testid ? `${testid}-pdf-pagination` : void 0,
1375
+ children: [
1376
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("li", { className: "previous", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1377
+ "button",
1378
+ {
1379
+ "data-testid": testid ? `${testid}-pdf-pagination-previous-button` : void 0,
1380
+ disabled: page === 1,
1381
+ onClick: () => setPage(page - 1),
1382
+ className: "not-disabled:cursor-pointer not-disabled:hover:underline ",
1383
+ children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Caption, { children: "Previous" })
1384
+ }
1385
+ ) }),
1386
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
1387
+ "li",
1388
+ {
1389
+ "data-testid": testid ? `${testid}-pdf-pagination-text` : void 0,
1390
+ className: "text-label-desktop text-text-on-action-primary-normal",
1391
+ children: [
1392
+ "Page",
1393
+ " ",
1394
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1395
+ "span",
1396
+ {
1397
+ "data-testid": testid ? `${testid}-pdf-pagination-page-${page}` : void 0,
1398
+ children: page
1399
+ }
1400
+ ),
1401
+ " ",
1402
+ "of",
1403
+ " ",
1404
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1405
+ "span",
1406
+ {
1407
+ "data-testid": testid ? `${testid}-pdf-pagination-total-page-${pdfDocument.numPages}` : void 0,
1408
+ children: pdfDocument.numPages
1409
+ }
1410
+ )
1411
+ ]
1412
+ }
1413
+ ),
1414
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("li", { className: "next", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1415
+ "button",
1416
+ {
1417
+ "data-testid": testid ? `${testid}-pdf-pagination-next-button` : void 0,
1418
+ disabled: page === pdfDocument.numPages,
1419
+ onClick: () => setPage(page + 1),
1420
+ className: "not-disabled:cursor-pointer not-disabled:hover:underline ",
1421
+ children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Caption, { children: "Next" })
1422
+ }
1423
+ ) })
1424
+ ]
1425
+ }
1426
+ )
1266
1427
  ] });
1267
1428
  }
1268
1429
  // Annotate the CommonJS export names for ESM import in node: