@dmsi/wedgekit-react 0.0.369 → 0.0.371
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-RLLQRVM7.js → chunk-2H35FETR.js} +18 -10
- package/dist/chunk-2IKT6IHB.js +190 -0
- package/dist/chunk-4UNWXB4A.js +89 -0
- package/dist/chunk-5IFPG6TS.js +17 -0
- package/dist/{chunk-6GAYJCFE.js → chunk-6DPFKSCT.js} +1 -1
- package/dist/{chunk-ZFOANBWG.js → chunk-AG43RS4Q.js} +2 -1
- package/dist/chunk-AJ5M6MVX.js +7 -0
- package/dist/chunk-AT4AWD6B.js +44 -0
- package/dist/chunk-BQNPOGD5.js +105 -0
- package/dist/chunk-CQFPNZTN.js +172 -0
- package/dist/chunk-EJSPFQCY.js +29 -0
- package/dist/chunk-ER6RCOH3.js +97 -0
- package/dist/{chunk-4VER5OEU.js → chunk-FBE2HGEF.js} +35 -11
- package/dist/chunk-HPQWEZJL.js +45 -0
- package/dist/{chunk-URCLLHO5.js → chunk-IBX6DVHU.js} +376 -102
- package/dist/{chunk-I3WFZOFY.js → chunk-J5V2JRIK.js} +1 -1
- package/dist/chunk-JGJUVJKD.js +283 -0
- package/dist/chunk-KEMCFN4U.js +78 -0
- package/dist/chunk-M6TSTDNZ.js +22 -0
- package/dist/chunk-M7INAUAJ.js +140 -0
- package/dist/chunk-MBZ55T2D.js +51 -0
- package/dist/chunk-N6PNLLNS.js +77 -0
- package/dist/{chunk-ZA5E7ZYM.js → chunk-NXGUDYRR.js} +1 -1
- package/dist/chunk-P36QKH26.js +143 -0
- package/dist/chunk-PTRZHGHA.js +89 -0
- package/dist/chunk-QVWYTQKL.js +29 -0
- package/dist/{chunk-6CPGOW6J.js → chunk-T36HX6QY.js} +6 -4
- package/dist/chunk-U6PUOGG4.js +114 -0
- package/dist/{chunk-NQXZBWDZ.js → chunk-V6U7LU6M.js} +15 -6
- package/dist/chunk-VJVY6NPF.js +32 -0
- package/dist/chunk-VVXPGI2P.js +61 -0
- package/dist/{chunk-ARQBSR3I.js → chunk-YCKRVNJ3.js} +4 -4
- package/dist/chunk-YYHQLQDQ.js +68 -0
- package/dist/components/Accordion.cjs +47 -14
- package/dist/components/Accordion.js +2 -2
- package/dist/components/CalendarRange.cjs +700 -46
- package/dist/components/CalendarRange.css +186 -3
- package/dist/components/CalendarRange.js +43 -11
- package/dist/components/CompactImagesPreview.cjs +485 -0
- package/dist/components/CompactImagesPreview.js +13 -0
- package/dist/components/ContentTabs.cjs +3 -2
- package/dist/components/ContentTabs.js +3 -2
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.cjs +4687 -0
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.css +5051 -0
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +62 -0
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.cjs +4687 -0
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.css +5051 -0
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +62 -0
- package/dist/components/DataGrid/PinnedColumns.cjs +4687 -0
- package/dist/components/DataGrid/PinnedColumns.css +5051 -0
- package/dist/components/DataGrid/PinnedColumns.js +62 -0
- package/dist/components/DataGrid/TableBody/LoadingCell.cjs +4689 -0
- package/dist/components/DataGrid/TableBody/LoadingCell.css +5051 -0
- package/dist/components/DataGrid/TableBody/LoadingCell.js +62 -0
- package/dist/components/DataGrid/TableBody/TableBodyRow.cjs +4689 -0
- package/dist/components/DataGrid/TableBody/TableBodyRow.css +5051 -0
- package/dist/components/DataGrid/TableBody/TableBodyRow.js +62 -0
- package/dist/components/DataGrid/TableBody/index.cjs +4689 -0
- package/dist/components/DataGrid/TableBody/index.css +5051 -0
- package/dist/components/DataGrid/TableBody/index.js +62 -0
- package/dist/components/DataGrid/index.cjs +4692 -0
- package/dist/components/DataGrid/index.css +5051 -0
- package/dist/components/DataGrid/index.js +65 -0
- package/dist/components/DataGrid/utils.cjs +4687 -0
- package/dist/components/DataGrid/utils.css +5051 -0
- package/dist/components/DataGrid/utils.js +62 -0
- package/dist/components/DataGridCell.js +6 -6
- package/dist/components/DateInput.cjs +721 -67
- package/dist/components/DateInput.css +186 -3
- package/dist/components/DateInput.js +45 -13
- package/dist/components/DateRangeInput.cjs +721 -67
- package/dist/components/DateRangeInput.css +186 -3
- package/dist/components/DateRangeInput.js +45 -13
- package/dist/components/FilterGroup.js +3 -3
- package/dist/components/Grid.cjs +3 -1
- package/dist/components/Grid.js +3 -92
- package/dist/components/ImagePlaceholder.cjs +65 -0
- package/dist/components/ImagePlaceholder.js +7 -0
- package/dist/components/Input.js +2 -2
- package/dist/components/MenuOption.js +2 -2
- package/dist/components/MobileDataGrid/ColumnList.cjs +845 -0
- package/dist/components/MobileDataGrid/ColumnList.js +17 -0
- package/dist/components/MobileDataGrid/ColumnSelector/index.cjs +4797 -0
- package/dist/components/MobileDataGrid/ColumnSelector/index.css +5051 -0
- package/dist/components/MobileDataGrid/ColumnSelector/index.js +62 -0
- package/dist/components/MobileDataGrid/GridContextProvider/GridContext.cjs +31 -0
- package/dist/components/MobileDataGrid/GridContextProvider/GridContext.js +7 -0
- package/dist/components/MobileDataGrid/GridContextProvider/index.cjs +177 -0
- package/dist/components/MobileDataGrid/GridContextProvider/index.js +8 -0
- package/dist/components/MobileDataGrid/MobileDataGridCard/MobileDataGridColumn.cjs +269 -0
- package/dist/components/MobileDataGrid/MobileDataGridCard/MobileDataGridColumn.js +9 -0
- package/dist/components/MobileDataGrid/MobileDataGridCard/index.cjs +790 -0
- package/dist/components/MobileDataGrid/MobileDataGridCard/index.js +16 -0
- package/dist/components/MobileDataGrid/MobileDataGridHeader.cjs +5059 -0
- package/dist/components/MobileDataGrid/MobileDataGridHeader.css +5051 -0
- package/dist/components/MobileDataGrid/MobileDataGridHeader.js +62 -0
- package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.cjs +509 -0
- package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.js +13 -0
- package/dist/components/MobileDataGrid/RowDetailModalProvider/index.cjs +1261 -0
- package/dist/components/MobileDataGrid/RowDetailModalProvider/index.js +27 -0
- package/dist/components/MobileDataGrid/index.cjs +5521 -0
- package/dist/components/MobileDataGrid/index.css +5051 -0
- package/dist/components/MobileDataGrid/index.js +62 -0
- package/dist/components/Modal.cjs +24 -13
- package/dist/components/Modal.js +3 -3
- package/dist/components/ModalHeader.cjs +6 -4
- package/dist/components/ModalHeader.js +1 -1
- package/dist/components/ModalScrim.cjs +2 -1
- package/dist/components/ModalScrim.js +1 -1
- package/dist/components/NestedMenu.js +4 -4
- package/dist/components/Notification.cjs +15 -6
- package/dist/components/Notification.js +1 -1
- package/dist/components/PDFViewer/DownloadIcon.cjs +394 -0
- package/dist/components/PDFViewer/DownloadIcon.js +10 -0
- package/dist/components/PDFViewer/PDFElement.cjs +515 -0
- package/dist/components/PDFViewer/PDFElement.js +11 -0
- package/dist/components/{MobileDataGrid.cjs → PDFViewer/PDFNavigation.cjs} +318 -402
- package/dist/components/PDFViewer/PDFNavigation.js +13 -0
- package/dist/components/PDFViewer/PDFPage.cjs +56 -0
- package/dist/components/PDFViewer/PDFPage.js +7 -0
- package/dist/components/{PDFViewer.cjs → PDFViewer/index.cjs} +290 -202
- package/dist/components/PDFViewer/index.js +29 -0
- package/dist/components/Password.js +2 -2
- package/dist/components/ProductImagePreview/CarouselPagination.cjs +75 -0
- package/dist/components/ProductImagePreview/CarouselPagination.js +7 -0
- package/dist/components/ProductImagePreview/MobileImageCarousel.cjs +214 -0
- package/dist/components/ProductImagePreview/MobileImageCarousel.js +7 -0
- package/dist/components/ProductImagePreview/ProductPrimaryImage.cjs +255 -0
- package/dist/components/ProductImagePreview/ProductPrimaryImage.js +9 -0
- package/dist/components/ProductImagePreview/Thumbnail.cjs +105 -0
- package/dist/components/ProductImagePreview/Thumbnail.js +8 -0
- package/dist/components/ProductImagePreview/ZoomWindow.cjs +198 -0
- package/dist/components/ProductImagePreview/ZoomWindow.js +8 -0
- package/dist/components/ProductImagePreview/index.cjs +1369 -0
- package/dist/components/ProductImagePreview/index.js +22 -0
- package/dist/components/Search.js +3 -3
- package/dist/components/Select.js +3 -3
- package/dist/components/SideMenuGroup.cjs +15 -6
- package/dist/components/SideMenuGroup.js +1 -1
- package/dist/components/SideMenuItem.cjs +15 -6
- package/dist/components/SideMenuItem.js +1 -1
- package/dist/components/SkeletonParagraph.cjs +33 -0
- package/dist/components/SkeletonParagraph.js +10 -0
- package/dist/components/Stack.cjs +15 -6
- package/dist/components/Stack.js +1 -1
- package/dist/components/Stepper.cjs +61 -53
- package/dist/components/Stepper.js +63 -55
- package/dist/components/Surface.js +3 -39
- package/dist/components/Swatch.cjs +15 -6
- package/dist/components/Swatch.js +4 -4
- package/dist/components/Time.cjs +15 -6
- package/dist/components/Time.js +5 -5
- package/dist/components/Upload.cjs +15 -6
- package/dist/components/Upload.js +1 -1
- package/dist/components/index.cjs +2559 -14
- package/dist/components/index.css +186 -3
- package/dist/components/index.js +57 -14
- package/dist/index.css +186 -3
- package/package.json +1 -1
- package/src/components/Accordion.tsx +23 -4
- package/src/components/CompactImagesPreview.tsx +99 -0
- package/src/components/ContentTabs.tsx +3 -1
- package/src/components/DataGrid/types.ts +5 -0
- package/src/components/Grid.tsx +2 -0
- package/src/components/ImagePlaceholder.tsx +22 -0
- package/src/components/MobileDataGrid/ColumnList.tsx +66 -0
- package/src/components/MobileDataGrid/ColumnSelector/index.tsx +97 -0
- package/src/components/MobileDataGrid/GridContextProvider/GridContext.tsx +25 -0
- package/src/components/MobileDataGrid/GridContextProvider/index.tsx +132 -0
- package/src/components/MobileDataGrid/GridContextProvider/useGridContext.ts +10 -0
- package/src/components/MobileDataGrid/MobileDataGridCard/MobileDataGridColumn.tsx +20 -0
- package/src/components/MobileDataGrid/MobileDataGridCard/index.tsx +129 -0
- package/src/components/MobileDataGrid/MobileDataGridHeader.tsx +80 -0
- package/src/components/MobileDataGrid/RowDetailModalProvider/ModalContent.tsx +42 -0
- package/src/components/MobileDataGrid/RowDetailModalProvider/index.tsx +68 -0
- package/src/components/MobileDataGrid/dataGridReducer.ts +55 -0
- package/src/components/MobileDataGrid/index.tsx +92 -0
- package/src/components/MobileDataGrid/types.ts +4 -0
- package/src/components/Modal.tsx +31 -12
- package/src/components/ModalButtons.tsx +1 -1
- package/src/components/ModalHeader.tsx +5 -2
- package/src/components/ModalScrim.tsx +3 -2
- package/src/components/PDFViewer/DownloadIcon.tsx +22 -0
- package/src/components/PDFViewer/PDFElement.tsx +90 -0
- package/src/components/PDFViewer/PDFNavigation.tsx +68 -0
- package/src/components/PDFViewer/PDFPage.tsx +34 -0
- package/src/components/PDFViewer/index.tsx +128 -0
- package/src/components/ProductImagePreview/CarouselPagination.tsx +54 -0
- package/src/components/ProductImagePreview/MobileImageCarousel.tsx +226 -0
- package/src/components/ProductImagePreview/ProductPrimaryImage.tsx +218 -0
- package/src/components/ProductImagePreview/Thumbnail.tsx +49 -0
- package/src/components/ProductImagePreview/ZoomWindow.tsx +136 -0
- package/src/components/ProductImagePreview/index.tsx +182 -0
- package/src/components/ProductImagePreview/useProductImagePreview.ts +211 -0
- package/src/components/SkeletonParagraph.tsx +5 -0
- package/src/components/Stack.tsx +29 -6
- package/src/components/Stepper.tsx +5 -1
- package/src/components/index.ts +4 -0
- package/src/types.ts +2 -1
- package/dist/components/MobileDataGrid.js +0 -150
- package/dist/components/PDFViewer.js +0 -250
- package/src/components/MobileDataGrid.tsx +0 -163
- package/src/components/PDFViewer.tsx +0 -264
- package/dist/{chunk-OXSBIBGT.js → chunk-CKQNJNU3.js} +3 -3
- package/dist/{chunk-RJUN52HJ.js → chunk-ZL5X7KP6.js} +3 -3
|
@@ -57,14 +57,13 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
57
57
|
));
|
|
58
58
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
59
59
|
|
|
60
|
-
// src/components/PDFViewer.tsx
|
|
60
|
+
// src/components/PDFViewer/index.tsx
|
|
61
61
|
var PDFViewer_exports = {};
|
|
62
62
|
__export(PDFViewer_exports, {
|
|
63
63
|
PDFViewer: () => PDFViewer
|
|
64
64
|
});
|
|
65
65
|
module.exports = __toCommonJS(PDFViewer_exports);
|
|
66
|
-
var
|
|
67
|
-
var import_react7 = require("react");
|
|
66
|
+
var import_react9 = require("react");
|
|
68
67
|
|
|
69
68
|
// src/components/Modal.tsx
|
|
70
69
|
var import_clsx9 = __toESM(require("clsx"), 1);
|
|
@@ -440,7 +439,8 @@ var ModalHeader = ({
|
|
|
440
439
|
headerIconAlign,
|
|
441
440
|
onClose,
|
|
442
441
|
id,
|
|
443
|
-
testid
|
|
442
|
+
testid,
|
|
443
|
+
headerClassname
|
|
444
444
|
}) => {
|
|
445
445
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
446
446
|
"div",
|
|
@@ -453,10 +453,11 @@ var ModalHeader = ({
|
|
|
453
453
|
headerIconAlign === "right" && "justify-end",
|
|
454
454
|
headerIconAlign === "left" && "justify-start",
|
|
455
455
|
layoutPaddding,
|
|
456
|
-
layoutGroupGap
|
|
456
|
+
layoutGroupGap,
|
|
457
|
+
headerClassname
|
|
457
458
|
),
|
|
458
459
|
children: [
|
|
459
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: (0, import_clsx5.default)("flex items-center", layoutGroupGap), children: [
|
|
460
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: (0, import_clsx5.default)("flex items-center flex-1", layoutGroupGap), children: [
|
|
460
461
|
headerIcon,
|
|
461
462
|
title && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
462
463
|
Heading2,
|
|
@@ -476,7 +477,7 @@ var ModalHeader = ({
|
|
|
476
477
|
iconOnly: true,
|
|
477
478
|
variant: "tertiary",
|
|
478
479
|
onClick: onClose,
|
|
479
|
-
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { name: "close", size: 24 }) })
|
|
480
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "text-brand-text-action-primary-normal desktop:text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { name: "close", size: 24 }) })
|
|
480
481
|
}
|
|
481
482
|
)
|
|
482
483
|
]
|
|
@@ -579,9 +580,10 @@ var ModalScrim = ({
|
|
|
579
580
|
id,
|
|
580
581
|
"data-testid": testid,
|
|
581
582
|
className: (0, import_clsx8.default)(
|
|
582
|
-
"overflow-y-auto h-screen transition-[visibility,opacity,background] ease-in-out duration-100 grid place-content-center
|
|
583
|
+
"overflow-y-auto h-screen transition-[visibility,opacity,background] ease-in-out duration-100 grid place-content-center group bg-neutral-600/50 fixed opacity-0",
|
|
583
584
|
!show && " pointer-events-none",
|
|
584
585
|
size === "small" && "p-4",
|
|
586
|
+
size === "screen" ? "desktop:p-0" : "desktop:p-4",
|
|
585
587
|
"inset-0 z-50"
|
|
586
588
|
),
|
|
587
589
|
onMouseDown: onClick,
|
|
@@ -713,6 +715,9 @@ var sizes = {
|
|
|
713
715
|
},
|
|
714
716
|
"x-large": {
|
|
715
717
|
sizeClass: "desktop:max-w-300 w-screen desktop:h-fit h-screen desktop:w-full max-w-240"
|
|
718
|
+
},
|
|
719
|
+
screen: {
|
|
720
|
+
sizeClass: "w-screen h-screen max-w-screen !rounded-none"
|
|
716
721
|
}
|
|
717
722
|
};
|
|
718
723
|
var Modal = ({
|
|
@@ -731,7 +736,10 @@ var Modal = ({
|
|
|
731
736
|
headerIcon,
|
|
732
737
|
headerIconAlign,
|
|
733
738
|
fixedHeightScrolling = false,
|
|
734
|
-
customActions
|
|
739
|
+
customActions,
|
|
740
|
+
headerClassname,
|
|
741
|
+
customFooter,
|
|
742
|
+
noWrapper
|
|
735
743
|
}) => {
|
|
736
744
|
var _a;
|
|
737
745
|
const mounted = useMounted();
|
|
@@ -839,9 +847,10 @@ var Modal = ({
|
|
|
839
847
|
"data-testid": testid,
|
|
840
848
|
ref: modalRef,
|
|
841
849
|
className: (0, import_clsx9.default)(
|
|
842
|
-
"
|
|
843
|
-
computedFixedHeightScrolling && "desktop:max-h-[calc(100vh-32px)] desktop:h-auto",
|
|
850
|
+
"shadow-md rounded-sm flex flex-col overflow-hidden w-full opacity-0 h-fit",
|
|
851
|
+
computedFixedHeightScrolling && size !== "screen" && "desktop:max-h-[calc(100vh-32px)] desktop:h-auto",
|
|
844
852
|
className,
|
|
853
|
+
!(className == null ? void 0 : className.includes("bg-")) && "bg-white",
|
|
845
854
|
sizeClass
|
|
846
855
|
),
|
|
847
856
|
onClick: (e) => e.stopPropagation(),
|
|
@@ -855,10 +864,11 @@ var Modal = ({
|
|
|
855
864
|
onClose: handleClose,
|
|
856
865
|
hideCloseIcon,
|
|
857
866
|
headerIcon,
|
|
858
|
-
headerIconAlign
|
|
867
|
+
headerIconAlign,
|
|
868
|
+
headerClassname
|
|
859
869
|
}
|
|
860
870
|
),
|
|
861
|
-
children && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
871
|
+
children && (size !== "screen" || noWrapper) ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
862
872
|
ModalContent,
|
|
863
873
|
{
|
|
864
874
|
id: id ? `${id}-content` : void 0,
|
|
@@ -866,8 +876,8 @@ var Modal = ({
|
|
|
866
876
|
fixedHeightScrolling: computedFixedHeightScrolling,
|
|
867
877
|
children
|
|
868
878
|
}
|
|
869
|
-
),
|
|
870
|
-
showButtons
|
|
879
|
+
) : children,
|
|
880
|
+
showButtons ? customFooter ? customActions : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
871
881
|
ModalButtons,
|
|
872
882
|
{
|
|
873
883
|
id: id ? `${id}-buttons` : void 0,
|
|
@@ -876,7 +886,7 @@ var Modal = ({
|
|
|
876
886
|
onContinue,
|
|
877
887
|
customActions
|
|
878
888
|
}
|
|
879
|
-
)
|
|
889
|
+
) : null
|
|
880
890
|
]
|
|
881
891
|
}
|
|
882
892
|
)
|
|
@@ -887,9 +897,43 @@ var Modal = ({
|
|
|
887
897
|
};
|
|
888
898
|
Modal.displayName = "Modal";
|
|
889
899
|
|
|
900
|
+
// src/components/PDFViewer/PDFElement.tsx
|
|
901
|
+
var import_react_pdf2 = require("@mikecousins/react-pdf");
|
|
902
|
+
var import_react8 = require("react");
|
|
903
|
+
|
|
904
|
+
// src/components/Spinner.tsx
|
|
905
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
906
|
+
var Spinner = ({ size = "small", testid }) => {
|
|
907
|
+
const dimension = size === "large" ? 48 : 24;
|
|
908
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
909
|
+
"svg",
|
|
910
|
+
{
|
|
911
|
+
"data-testid": testid,
|
|
912
|
+
width: dimension,
|
|
913
|
+
height: dimension,
|
|
914
|
+
viewBox: "0 0 24 24",
|
|
915
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
916
|
+
fill: "#1D1E1E",
|
|
917
|
+
className: "spinner",
|
|
918
|
+
"aria-label": "Loading",
|
|
919
|
+
children: [
|
|
920
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("circle", { cx: "12", cy: "4", r: "2", opacity: "1" }),
|
|
921
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("circle", { cx: "17.666", cy: "6.334", r: "2", opacity: "0.125" }),
|
|
922
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("circle", { cx: "20", cy: "12", r: "2", opacity: "0.25" }),
|
|
923
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("circle", { cx: "17.666", cy: "17.666", r: "2", opacity: "0.375" }),
|
|
924
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("circle", { cx: "12", cy: "20", r: "2", opacity: "0.5" }),
|
|
925
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("circle", { cx: "6.334", cy: "17.666", r: "2", opacity: "0.625" }),
|
|
926
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("circle", { cx: "4", cy: "12", r: "2", opacity: "0.75" }),
|
|
927
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("circle", { cx: "6.334", cy: "6.334", r: "2", opacity: "0.875" })
|
|
928
|
+
]
|
|
929
|
+
}
|
|
930
|
+
);
|
|
931
|
+
};
|
|
932
|
+
Spinner.displayName = "Spinner";
|
|
933
|
+
|
|
890
934
|
// src/components/Stack.tsx
|
|
891
935
|
var import_clsx10 = __toESM(require("clsx"), 1);
|
|
892
|
-
var
|
|
936
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
893
937
|
var getFlexClassNames = ({ items, justify, grow }) => (0, import_clsx10.default)(
|
|
894
938
|
"flex",
|
|
895
939
|
items === "start" && "items-start",
|
|
@@ -950,7 +994,9 @@ var Stack = (_a) => {
|
|
|
950
994
|
noGap,
|
|
951
995
|
marginTop,
|
|
952
996
|
marginBottom,
|
|
953
|
-
testid
|
|
997
|
+
testid,
|
|
998
|
+
bottom,
|
|
999
|
+
zIndex
|
|
954
1000
|
} = _b, props = __objRest(_b, [
|
|
955
1001
|
"children",
|
|
956
1002
|
"items",
|
|
@@ -987,11 +1033,14 @@ var Stack = (_a) => {
|
|
|
987
1033
|
"noGap",
|
|
988
1034
|
"marginTop",
|
|
989
1035
|
"marginBottom",
|
|
990
|
-
"testid"
|
|
1036
|
+
"testid",
|
|
1037
|
+
"bottom",
|
|
1038
|
+
"zIndex"
|
|
991
1039
|
]);
|
|
1040
|
+
var _a2, _b2, _c, _d, _e;
|
|
992
1041
|
const flexClassNames = getFlexClassNames({ items, justify, grow });
|
|
993
1042
|
const gapClassNames = useGapClassNames(sizing);
|
|
994
|
-
return /* @__PURE__ */ (0,
|
|
1043
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
995
1044
|
"div",
|
|
996
1045
|
__spreadProps(__spreadValues({
|
|
997
1046
|
id,
|
|
@@ -999,9 +1048,9 @@ var Stack = (_a) => {
|
|
|
999
1048
|
}, props), {
|
|
1000
1049
|
style: {
|
|
1001
1050
|
height: height === "full" ? "100%" : height !== void 0 ? `${height}px` : void 0,
|
|
1002
|
-
maxHeight: maxHeight !== void 0 ? `${maxHeight}px` : void 0,
|
|
1003
|
-
|
|
1004
|
-
|
|
1051
|
+
maxHeight: maxHeight !== void 0 ? isNaN(+maxHeight) ? maxHeight : `${maxHeight}px` : (_a2 = props.style) == null ? void 0 : _a2.maxHeight,
|
|
1052
|
+
maxWidth: maxWidth !== void 0 ? isNaN(+maxWidth) ? maxWidth : `${maxWidth}px` : (_b2 = props.style) == null ? void 0 : _b2.maxWidth,
|
|
1053
|
+
minHeight: minHeight !== void 0 ? isNaN(+minHeight) ? minHeight : `${minHeight}px` : (_c = props.style) == null ? void 0 : _c.minHeight,
|
|
1005
1054
|
width: width !== void 0 && typeof width === "number" ? `${width}px` : void 0,
|
|
1006
1055
|
minWidth: minWidth !== void 0 ? `${minWidth}px` : void 0,
|
|
1007
1056
|
border: borderColor ? `1px solid var(--color-${borderColor})` : void 0,
|
|
@@ -1010,7 +1059,11 @@ var Stack = (_a) => {
|
|
|
1010
1059
|
flexShrink: flexShrink !== void 0 ? flexShrink : void 0,
|
|
1011
1060
|
position: position !== void 0 ? position : void 0,
|
|
1012
1061
|
top: top !== void 0 ? `${top}px` : void 0,
|
|
1013
|
-
|
|
1062
|
+
bottom: bottom !== void 0 ? `${bottom}px` : void 0,
|
|
1063
|
+
left: left !== void 0 ? `${left}px` : void 0,
|
|
1064
|
+
borderBlock: (_d = props.style) == null ? void 0 : _d.borderBlock,
|
|
1065
|
+
marginInline: (_e = props.style) == null ? void 0 : _e.marginInline,
|
|
1066
|
+
zIndex: zIndex !== void 0 ? zIndex : void 0
|
|
1014
1067
|
},
|
|
1015
1068
|
className: (0, import_clsx10.default)(
|
|
1016
1069
|
"scrollbar-thin",
|
|
@@ -1057,39 +1110,131 @@ var Stack = (_a) => {
|
|
|
1057
1110
|
);
|
|
1058
1111
|
};
|
|
1059
1112
|
|
|
1060
|
-
// src/components/
|
|
1061
|
-
var
|
|
1062
|
-
var
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1113
|
+
// src/components/PDFViewer/PDFPage.tsx
|
|
1114
|
+
var import_react_pdf = require("@mikecousins/react-pdf");
|
|
1115
|
+
var import_react7 = require("react");
|
|
1116
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1117
|
+
function PdfPage({
|
|
1118
|
+
file,
|
|
1119
|
+
pageNumber,
|
|
1120
|
+
testid,
|
|
1121
|
+
isMobile
|
|
1122
|
+
}) {
|
|
1123
|
+
const canvasRef = (0, import_react7.useRef)(null);
|
|
1124
|
+
const { pdfDocument } = (0, import_react_pdf.usePdf)({
|
|
1125
|
+
file,
|
|
1126
|
+
page: pageNumber,
|
|
1127
|
+
canvasRef,
|
|
1128
|
+
workerSrc: "/scripts/pdf.worker.min.mjs",
|
|
1129
|
+
scale: isMobile ? 1 : 1.3
|
|
1130
|
+
});
|
|
1131
|
+
if (!pdfDocument) return null;
|
|
1132
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1133
|
+
"canvas",
|
|
1066
1134
|
{
|
|
1135
|
+
ref: canvasRef,
|
|
1067
1136
|
"data-testid": testid,
|
|
1068
|
-
width:
|
|
1069
|
-
height: dimension,
|
|
1070
|
-
viewBox: "0 0 24 24",
|
|
1071
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1072
|
-
fill: "#1D1E1E",
|
|
1073
|
-
className: "spinner",
|
|
1074
|
-
"aria-label": "Loading",
|
|
1075
|
-
children: [
|
|
1076
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("circle", { cx: "12", cy: "4", r: "2", opacity: "1" }),
|
|
1077
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("circle", { cx: "17.666", cy: "6.334", r: "2", opacity: "0.125" }),
|
|
1078
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("circle", { cx: "20", cy: "12", r: "2", opacity: "0.25" }),
|
|
1079
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("circle", { cx: "17.666", cy: "17.666", r: "2", opacity: "0.375" }),
|
|
1080
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("circle", { cx: "12", cy: "20", r: "2", opacity: "0.5" }),
|
|
1081
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("circle", { cx: "6.334", cy: "17.666", r: "2", opacity: "0.625" }),
|
|
1082
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("circle", { cx: "4", cy: "12", r: "2", opacity: "0.75" }),
|
|
1083
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("circle", { cx: "6.334", cy: "6.334", r: "2", opacity: "0.875" })
|
|
1084
|
-
]
|
|
1137
|
+
style: { width: "100%", height: "auto" }
|
|
1085
1138
|
}
|
|
1086
1139
|
);
|
|
1087
|
-
}
|
|
1088
|
-
Spinner.displayName = "Spinner";
|
|
1140
|
+
}
|
|
1089
1141
|
|
|
1090
|
-
// src/components/
|
|
1142
|
+
// src/components/PDFViewer/PDFElement.tsx
|
|
1091
1143
|
var import_clsx11 = __toESM(require("clsx"), 1);
|
|
1092
|
-
var
|
|
1144
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1145
|
+
function PDFElement({
|
|
1146
|
+
b64,
|
|
1147
|
+
testid,
|
|
1148
|
+
isMobile,
|
|
1149
|
+
error
|
|
1150
|
+
}) {
|
|
1151
|
+
var _a;
|
|
1152
|
+
const canvasRef = (0, import_react8.useRef)(null);
|
|
1153
|
+
const { pdfDocument } = (0, import_react_pdf2.usePdf)({
|
|
1154
|
+
file: `data:application/pdf;base64,${b64}`,
|
|
1155
|
+
workerSrc: "/scripts/pdf.worker.min.mjs",
|
|
1156
|
+
scale: isMobile ? 1 : 1.3,
|
|
1157
|
+
canvasRef
|
|
1158
|
+
});
|
|
1159
|
+
const pagesArr = new Array((_a = pdfDocument == null ? void 0 : pdfDocument.numPages) != null ? _a : 1).fill(null);
|
|
1160
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1161
|
+
"div",
|
|
1162
|
+
{
|
|
1163
|
+
className: "flex flex-col space-y-4",
|
|
1164
|
+
style: !isMobile ? {
|
|
1165
|
+
minHeight: 871,
|
|
1166
|
+
minWidth: 654
|
|
1167
|
+
} : void 0,
|
|
1168
|
+
children: !!pdfDocument && !!b64 && !error ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Stack, { sizing: "layout-group", children: pagesArr.length > 1 ? pagesArr.map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1169
|
+
"div",
|
|
1170
|
+
{
|
|
1171
|
+
className: (0, import_clsx11.default)(
|
|
1172
|
+
"flex justify-center border-border-primary-normal",
|
|
1173
|
+
isMobile ? "border-0" : "border"
|
|
1174
|
+
),
|
|
1175
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1176
|
+
PdfPage,
|
|
1177
|
+
{
|
|
1178
|
+
testid: testid ? `${testid}-pdf_page_${i + 1}` : void 0,
|
|
1179
|
+
file: `data:application/pdf;base64,${b64}`,
|
|
1180
|
+
pageNumber: i + 1
|
|
1181
|
+
}
|
|
1182
|
+
)
|
|
1183
|
+
},
|
|
1184
|
+
`${testid}-pdf-page-${i + 1}`
|
|
1185
|
+
)) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1186
|
+
"div",
|
|
1187
|
+
{
|
|
1188
|
+
className: (0, import_clsx11.default)(
|
|
1189
|
+
"flex justify-center border-border-primary-normal",
|
|
1190
|
+
isMobile ? "border-0" : "border"
|
|
1191
|
+
),
|
|
1192
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1193
|
+
"canvas",
|
|
1194
|
+
{
|
|
1195
|
+
"data-testid": testid ? `${testid}-pdf-content` : void 0,
|
|
1196
|
+
ref: canvasRef,
|
|
1197
|
+
style: { width: "100%", height: "auto" }
|
|
1198
|
+
}
|
|
1199
|
+
)
|
|
1200
|
+
}
|
|
1201
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1202
|
+
Stack,
|
|
1203
|
+
{
|
|
1204
|
+
justify: "center",
|
|
1205
|
+
items: "center",
|
|
1206
|
+
height: "full",
|
|
1207
|
+
flexGrow: 1,
|
|
1208
|
+
"data-testid": testid ? `${testid}-pdf-${error ? "error" : "loading"}` : void 0,
|
|
1209
|
+
children: error ? error : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Spinner, { size: "large" })
|
|
1210
|
+
}
|
|
1211
|
+
)
|
|
1212
|
+
}
|
|
1213
|
+
);
|
|
1214
|
+
}
|
|
1215
|
+
|
|
1216
|
+
// src/components/PDFViewer/DownloadIcon.tsx
|
|
1217
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1218
|
+
function DownloadIcon({
|
|
1219
|
+
onClick,
|
|
1220
|
+
isDownloading,
|
|
1221
|
+
testid
|
|
1222
|
+
}) {
|
|
1223
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1224
|
+
Button,
|
|
1225
|
+
{
|
|
1226
|
+
testid,
|
|
1227
|
+
iconOnly: true,
|
|
1228
|
+
variant: "tertiary",
|
|
1229
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Icon, { name: isDownloading ? "cached" : "download" }),
|
|
1230
|
+
onClick
|
|
1231
|
+
}
|
|
1232
|
+
);
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1235
|
+
// src/components/Paragraph.tsx
|
|
1236
|
+
var import_clsx12 = __toESM(require("clsx"), 1);
|
|
1237
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1093
1238
|
var Paragraph = (_a) => {
|
|
1094
1239
|
var _b = _a, {
|
|
1095
1240
|
className,
|
|
@@ -1115,13 +1260,13 @@ var Paragraph = (_a) => {
|
|
|
1115
1260
|
"testid"
|
|
1116
1261
|
]);
|
|
1117
1262
|
const Element = as;
|
|
1118
|
-
return /* @__PURE__ */ (0,
|
|
1263
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1119
1264
|
Element,
|
|
1120
1265
|
__spreadProps(__spreadValues({
|
|
1121
1266
|
id,
|
|
1122
1267
|
"data-testid": testid
|
|
1123
1268
|
}, props), {
|
|
1124
|
-
className: (0,
|
|
1269
|
+
className: (0, import_clsx12.default)(
|
|
1125
1270
|
typography.paragraph,
|
|
1126
1271
|
className,
|
|
1127
1272
|
padded && componentPaddingXUsingComponentGap,
|
|
@@ -1140,13 +1285,82 @@ var Paragraph = (_a) => {
|
|
|
1140
1285
|
};
|
|
1141
1286
|
Paragraph.displayName = "Paragraph";
|
|
1142
1287
|
|
|
1143
|
-
// src/components/PDFViewer.tsx
|
|
1144
|
-
var
|
|
1288
|
+
// src/components/PDFViewer/PDFNavigation.tsx
|
|
1289
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1290
|
+
function PdfNavigation({
|
|
1291
|
+
currentIndex,
|
|
1292
|
+
total,
|
|
1293
|
+
onPrev,
|
|
1294
|
+
onNext,
|
|
1295
|
+
disablePrev,
|
|
1296
|
+
disableNext,
|
|
1297
|
+
extraActions,
|
|
1298
|
+
testid,
|
|
1299
|
+
fileName
|
|
1300
|
+
}) {
|
|
1301
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1302
|
+
Stack,
|
|
1303
|
+
{
|
|
1304
|
+
horizontal: true,
|
|
1305
|
+
items: "center",
|
|
1306
|
+
justify: "between",
|
|
1307
|
+
sizing: "layout-group",
|
|
1308
|
+
testid: testid ? `${testid}-pdf-navigation` : void 0,
|
|
1309
|
+
children: [
|
|
1310
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Stack, { horizontal: true, items: "center", children: [
|
|
1311
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1312
|
+
Button,
|
|
1313
|
+
{
|
|
1314
|
+
iconOnly: true,
|
|
1315
|
+
variant: "tertiary",
|
|
1316
|
+
onClick: onPrev,
|
|
1317
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Icon, { name: "chevron_backward" }),
|
|
1318
|
+
disabled: disablePrev,
|
|
1319
|
+
testid: testid ? `${testid}-pdf-file-previous-button` : void 0
|
|
1320
|
+
}
|
|
1321
|
+
),
|
|
1322
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Heading3, { className: "text-text-primary-normal whitespace-nowrap", children: [
|
|
1323
|
+
currentIndex + 1,
|
|
1324
|
+
" / ",
|
|
1325
|
+
total
|
|
1326
|
+
] }),
|
|
1327
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1328
|
+
Button,
|
|
1329
|
+
{
|
|
1330
|
+
iconOnly: true,
|
|
1331
|
+
variant: "tertiary",
|
|
1332
|
+
onClick: onNext,
|
|
1333
|
+
rightIcon: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Icon, { name: "chevron_forward" }),
|
|
1334
|
+
disabled: disableNext,
|
|
1335
|
+
testid: testid ? `${testid}-pdf-file-next-button` : void 0
|
|
1336
|
+
}
|
|
1337
|
+
),
|
|
1338
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Paragraph, { children: (fileName == null ? void 0 : fileName.endsWith(".pdf")) ? fileName : `${fileName}.pdf` })
|
|
1339
|
+
] }),
|
|
1340
|
+
extraActions && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "flex items-center gap-2", children: extraActions })
|
|
1341
|
+
]
|
|
1342
|
+
}
|
|
1343
|
+
) });
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1346
|
+
// src/components/PDFViewer/index.tsx
|
|
1347
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1145
1348
|
function PDFViewer(props) {
|
|
1146
|
-
const {
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1349
|
+
const {
|
|
1350
|
+
isOpen,
|
|
1351
|
+
onClose,
|
|
1352
|
+
encodedPdfs,
|
|
1353
|
+
customActions,
|
|
1354
|
+
testid,
|
|
1355
|
+
isMobile,
|
|
1356
|
+
title,
|
|
1357
|
+
customFooter = false,
|
|
1358
|
+
withPagination = true,
|
|
1359
|
+
error
|
|
1360
|
+
} = props;
|
|
1361
|
+
const [currentIndex, setCurrentIndex] = (0, import_react9.useState)(0);
|
|
1362
|
+
const [isDownloading, setIsDownloading] = (0, import_react9.useState)(false);
|
|
1363
|
+
const handleDownload = (0, import_react9.useCallback)(() => {
|
|
1150
1364
|
setIsDownloading(true);
|
|
1151
1365
|
const link = document.createElement("a");
|
|
1152
1366
|
const currentPdf = encodedPdfs[currentIndex];
|
|
@@ -1177,14 +1391,16 @@ function PDFViewer(props) {
|
|
|
1177
1391
|
setIsDownloading(false);
|
|
1178
1392
|
onClose();
|
|
1179
1393
|
}
|
|
1180
|
-
return /* @__PURE__ */ (0,
|
|
1394
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1181
1395
|
Modal,
|
|
1182
1396
|
{
|
|
1183
1397
|
testid,
|
|
1184
1398
|
open: isOpen,
|
|
1399
|
+
customFooter,
|
|
1185
1400
|
onClose: handleClose,
|
|
1186
|
-
|
|
1187
|
-
|
|
1401
|
+
noWrapper: true,
|
|
1402
|
+
showButtons: isMobile && customFooter ? !!customActions : !!encodedPdfs.length,
|
|
1403
|
+
customActions: !!encodedPdfs.length && !isMobile && withPagination ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1188
1404
|
PdfNavigation,
|
|
1189
1405
|
{
|
|
1190
1406
|
testid,
|
|
@@ -1197,160 +1413,32 @@ function PDFViewer(props) {
|
|
|
1197
1413
|
extraActions: customActions,
|
|
1198
1414
|
fileName: encodedPdfs[currentIndex].fileName
|
|
1199
1415
|
}
|
|
1200
|
-
),
|
|
1201
|
-
size: "large",
|
|
1416
|
+
) : customActions,
|
|
1202
1417
|
fixedHeightScrolling: true,
|
|
1203
1418
|
headerIconAlign: "right",
|
|
1204
|
-
headerIcon: /* @__PURE__ */ (0,
|
|
1419
|
+
headerIcon: !isMobile ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1205
1420
|
DownloadIcon,
|
|
1206
1421
|
{
|
|
1207
1422
|
testid: testid ? `${testid}-download-icon` : void 0,
|
|
1208
1423
|
onClick: handleDownload,
|
|
1209
1424
|
isDownloading
|
|
1210
1425
|
}
|
|
1211
|
-
),
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
function DownloadIcon({
|
|
1218
|
-
onClick,
|
|
1219
|
-
isDownloading,
|
|
1220
|
-
testid
|
|
1221
|
-
}) {
|
|
1222
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1223
|
-
Button,
|
|
1224
|
-
{
|
|
1225
|
-
testid,
|
|
1226
|
-
iconOnly: true,
|
|
1227
|
-
variant: "tertiary",
|
|
1228
|
-
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Icon, { name: isDownloading ? "cached" : "download" }),
|
|
1229
|
-
onClick
|
|
1230
|
-
}
|
|
1231
|
-
);
|
|
1232
|
-
}
|
|
1233
|
-
function PDFElement({ b64, testid }) {
|
|
1234
|
-
var _a;
|
|
1235
|
-
const canvasRef = (0, import_react7.useRef)(null);
|
|
1236
|
-
const { pdfDocument } = (0, import_react_pdf.usePdf)({
|
|
1237
|
-
file: `data:application/pdf;base64,${b64}`,
|
|
1238
|
-
workerSrc: "/scripts/pdf.worker.min.mjs",
|
|
1239
|
-
canvasRef,
|
|
1240
|
-
scale: 1.1
|
|
1241
|
-
});
|
|
1242
|
-
const pagesArr = new Array((_a = pdfDocument == null ? void 0 : pdfDocument.numPages) != null ? _a : 1).fill(null);
|
|
1243
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1244
|
-
"div",
|
|
1245
|
-
{
|
|
1246
|
-
className: "flex flex-col space-y-4",
|
|
1247
|
-
style: {
|
|
1248
|
-
minHeight: 871,
|
|
1249
|
-
minWidth: 654
|
|
1250
|
-
},
|
|
1251
|
-
children: !!pdfDocument && !!b64 ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Stack, { sizing: "layout-group", children: pagesArr.length > 1 ? pagesArr.map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1252
|
-
"div",
|
|
1426
|
+
) : void 0,
|
|
1427
|
+
title: isMobile ? title != null ? title : encodedPdfs[currentIndex].fileName : void 0,
|
|
1428
|
+
size: isMobile ? "screen" : "large",
|
|
1429
|
+
headerClassname: "bg-brand-400 desktop:bg-background-grouped-primary-normal p-mobile-layout-padding text-brand-text-action-primary-normal",
|
|
1430
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1431
|
+
PDFElement,
|
|
1253
1432
|
{
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
testid: testid ? `${testid}-pdf_page_${i + 1}` : void 0,
|
|
1259
|
-
file: `data:application/pdf;base64,${b64}`,
|
|
1260
|
-
pageNumber: i + 1
|
|
1261
|
-
}
|
|
1262
|
-
)
|
|
1263
|
-
},
|
|
1264
|
-
`${testid}-pdf-page-${i + 1}`
|
|
1265
|
-
)) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex justify-center border border-border-primary-normal", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1266
|
-
"canvas",
|
|
1267
|
-
{
|
|
1268
|
-
"data-testid": testid ? `${testid}-pdf-content` : void 0,
|
|
1269
|
-
ref: canvasRef
|
|
1270
|
-
}
|
|
1271
|
-
) }) }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1272
|
-
Stack,
|
|
1273
|
-
{
|
|
1274
|
-
justify: "center",
|
|
1275
|
-
items: "center",
|
|
1276
|
-
height: "full",
|
|
1277
|
-
flexGrow: 1,
|
|
1278
|
-
"data-testid": testid ? `${testid}-pdf-loading` : void 0,
|
|
1279
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Spinner, { size: "large" })
|
|
1433
|
+
testid,
|
|
1434
|
+
b64: encodedPdfs[currentIndex].base64,
|
|
1435
|
+
isMobile,
|
|
1436
|
+
error
|
|
1280
1437
|
}
|
|
1281
1438
|
)
|
|
1282
1439
|
}
|
|
1283
1440
|
);
|
|
1284
1441
|
}
|
|
1285
|
-
function PdfNavigation({
|
|
1286
|
-
currentIndex,
|
|
1287
|
-
total,
|
|
1288
|
-
onPrev,
|
|
1289
|
-
onNext,
|
|
1290
|
-
disablePrev,
|
|
1291
|
-
disableNext,
|
|
1292
|
-
extraActions,
|
|
1293
|
-
testid,
|
|
1294
|
-
fileName
|
|
1295
|
-
}) {
|
|
1296
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1297
|
-
Stack,
|
|
1298
|
-
{
|
|
1299
|
-
horizontal: true,
|
|
1300
|
-
items: "center",
|
|
1301
|
-
justify: "between",
|
|
1302
|
-
sizing: "layout-group",
|
|
1303
|
-
testid: testid ? `${testid}-pdf-navigation` : void 0,
|
|
1304
|
-
children: [
|
|
1305
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Stack, { horizontal: true, items: "center", children: [
|
|
1306
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1307
|
-
Button,
|
|
1308
|
-
{
|
|
1309
|
-
iconOnly: true,
|
|
1310
|
-
variant: "tertiary",
|
|
1311
|
-
onClick: onPrev,
|
|
1312
|
-
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Icon, { name: "chevron_backward" }),
|
|
1313
|
-
disabled: disablePrev,
|
|
1314
|
-
testid: testid ? `${testid}-pdf-file-previous-button` : void 0
|
|
1315
|
-
}
|
|
1316
|
-
),
|
|
1317
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Heading3, { className: "text-text-primary-normal whitespace-nowrap", children: [
|
|
1318
|
-
currentIndex + 1,
|
|
1319
|
-
" / ",
|
|
1320
|
-
total
|
|
1321
|
-
] }),
|
|
1322
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1323
|
-
Button,
|
|
1324
|
-
{
|
|
1325
|
-
iconOnly: true,
|
|
1326
|
-
variant: "tertiary",
|
|
1327
|
-
onClick: onNext,
|
|
1328
|
-
rightIcon: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Icon, { name: "chevron_forward" }),
|
|
1329
|
-
disabled: disableNext,
|
|
1330
|
-
testid: testid ? `${testid}-pdf-file-next-button` : void 0
|
|
1331
|
-
}
|
|
1332
|
-
),
|
|
1333
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Paragraph, { children: (fileName == null ? void 0 : fileName.endsWith(".pdf")) ? fileName : `${fileName}.pdf` })
|
|
1334
|
-
] }),
|
|
1335
|
-
extraActions && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex items-center gap-2", children: extraActions })
|
|
1336
|
-
]
|
|
1337
|
-
}
|
|
1338
|
-
) });
|
|
1339
|
-
}
|
|
1340
|
-
function PdfPage({
|
|
1341
|
-
file,
|
|
1342
|
-
pageNumber,
|
|
1343
|
-
testid
|
|
1344
|
-
}) {
|
|
1345
|
-
const canvasRef = (0, import_react7.useRef)(null);
|
|
1346
|
-
const { pdfDocument } = (0, import_react_pdf.usePdf)({
|
|
1347
|
-
file,
|
|
1348
|
-
page: pageNumber,
|
|
1349
|
-
canvasRef
|
|
1350
|
-
});
|
|
1351
|
-
if (!pdfDocument) return null;
|
|
1352
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("canvas", { ref: canvasRef, "data-testid": testid });
|
|
1353
|
-
}
|
|
1354
1442
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1355
1443
|
0 && (module.exports = {
|
|
1356
1444
|
PDFViewer
|