@dmsi/wedgekit-react 0.0.503 → 0.0.504
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-VOSQMHNF.js → chunk-U5V2IRZX.js} +4 -29
- package/dist/{chunk-S5ZJ3Q7P.js → chunk-VJVY6NPF.js} +3 -3
- package/dist/components/CalendarRange.cjs +75 -128
- package/dist/components/CalendarRange.js +1 -7
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.cjs +33 -86
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +1 -7
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.cjs +43 -96
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +1 -7
- package/dist/components/DataGrid/PinnedColumns.cjs +58 -111
- package/dist/components/DataGrid/PinnedColumns.js +1 -7
- package/dist/components/DataGrid/TableBody/LoadingCell.cjs +34 -87
- package/dist/components/DataGrid/TableBody/LoadingCell.js +1 -7
- package/dist/components/DataGrid/TableBody/TableBodyRow.cjs +40 -93
- package/dist/components/DataGrid/TableBody/TableBodyRow.js +1 -7
- package/dist/components/DataGrid/TableBody/index.cjs +55 -108
- package/dist/components/DataGrid/TableBody/index.js +1 -7
- package/dist/components/DataGrid/index.cjs +144 -197
- package/dist/components/DataGrid/index.js +1 -7
- package/dist/components/DataGrid/utils.cjs +34 -87
- package/dist/components/DataGrid/utils.js +1 -7
- package/dist/components/DateInput.cjs +94 -147
- package/dist/components/DateInput.js +1 -7
- package/dist/components/DateRangeInput.cjs +94 -147
- package/dist/components/DateRangeInput.js +1 -7
- package/dist/components/MobileDataGrid/ColumnSelector/index.cjs +41 -94
- package/dist/components/MobileDataGrid/ColumnSelector/index.js +1 -7
- package/dist/components/MobileDataGrid/MobileDataGridHeader.cjs +49 -102
- package/dist/components/MobileDataGrid/MobileDataGridHeader.js +1 -7
- package/dist/components/MobileDataGrid/index.cjs +868 -921
- package/dist/components/MobileDataGrid/index.js +1 -7
- package/dist/components/PDFViewer/PDFElement.cjs +5 -31
- package/dist/components/PDFViewer/PDFElement.js +2 -3
- package/dist/components/PDFViewer/PDFPage.cjs +3 -3
- package/dist/components/PDFViewer/PDFPage.js +1 -1
- package/dist/components/PDFViewer/index.cjs +5 -35
- package/dist/components/PDFViewer/index.js +111 -8
- package/dist/components/index.cjs +56 -402
- package/dist/components/index.js +1 -10
- package/package.json +1 -1
- package/src/components/PDFViewer/PDFElement.tsx +3 -38
- package/src/components/PDFViewer/PDFPage.tsx +2 -4
- package/src/components/PDFViewer/index.tsx +1 -9
- package/src/components/index.ts +0 -1
- package/dist/chunk-6XLESQ2U.js +0 -119
- /package/dist/{chunk-C2YTC2CN.js → chunk-JWVZOEF5.js} +0 -0
|
@@ -80,7 +80,6 @@ __export(components_exports, {
|
|
|
80
80
|
MenuOption: () => MenuOption,
|
|
81
81
|
MobileDataGrid: () => MobileDataGrid,
|
|
82
82
|
OrderCheckIcon: () => OrderCheckIcon,
|
|
83
|
-
PDFViewer: () => PDFViewer,
|
|
84
83
|
Pagination: () => Pagination,
|
|
85
84
|
Paragraph: () => Paragraph,
|
|
86
85
|
ProductImagePreview: () => ProductImagePreview,
|
|
@@ -7644,354 +7643,10 @@ function SimpleTable({
|
|
|
7644
7643
|
] }) });
|
|
7645
7644
|
}
|
|
7646
7645
|
|
|
7647
|
-
// src/components/
|
|
7648
|
-
var import_react36 = require("react");
|
|
7649
|
-
|
|
7650
|
-
// src/components/PDFViewer/PDFElement.tsx
|
|
7651
|
-
var import_react35 = require("react");
|
|
7652
|
-
|
|
7653
|
-
// src/components/Spinner.tsx
|
|
7654
|
-
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
7655
|
-
var Spinner = ({ size = "small", testid }) => {
|
|
7656
|
-
const dimension = size === "large" ? 48 : 24;
|
|
7657
|
-
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
7658
|
-
"svg",
|
|
7659
|
-
{
|
|
7660
|
-
"data-testid": testid,
|
|
7661
|
-
width: dimension,
|
|
7662
|
-
height: dimension,
|
|
7663
|
-
viewBox: "0 0 24 24",
|
|
7664
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
7665
|
-
fill: "#1D1E1E",
|
|
7666
|
-
className: "spinner",
|
|
7667
|
-
"aria-label": "Loading",
|
|
7668
|
-
children: [
|
|
7669
|
-
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("circle", { cx: "12", cy: "4", r: "2", opacity: "1" }),
|
|
7670
|
-
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("circle", { cx: "17.666", cy: "6.334", r: "2", opacity: "0.125" }),
|
|
7671
|
-
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("circle", { cx: "20", cy: "12", r: "2", opacity: "0.25" }),
|
|
7672
|
-
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("circle", { cx: "17.666", cy: "17.666", r: "2", opacity: "0.375" }),
|
|
7673
|
-
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("circle", { cx: "12", cy: "20", r: "2", opacity: "0.5" }),
|
|
7674
|
-
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("circle", { cx: "6.334", cy: "17.666", r: "2", opacity: "0.625" }),
|
|
7675
|
-
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("circle", { cx: "4", cy: "12", r: "2", opacity: "0.75" }),
|
|
7676
|
-
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("circle", { cx: "6.334", cy: "6.334", r: "2", opacity: "0.875" })
|
|
7677
|
-
]
|
|
7678
|
-
}
|
|
7679
|
-
);
|
|
7680
|
-
};
|
|
7681
|
-
Spinner.displayName = "Spinner";
|
|
7682
|
-
|
|
7683
|
-
// src/components/PDFViewer/PDFPage.tsx
|
|
7646
|
+
// src/components/ListGroup.tsx
|
|
7684
7647
|
var import_react34 = require("react");
|
|
7685
|
-
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
7686
|
-
function PdfPage({
|
|
7687
|
-
file,
|
|
7688
|
-
pageNumber,
|
|
7689
|
-
testid,
|
|
7690
|
-
isMobile,
|
|
7691
|
-
usePDF
|
|
7692
|
-
}) {
|
|
7693
|
-
const canvasRef = (0, import_react34.useRef)(null);
|
|
7694
|
-
const { pdfDocument } = usePDF({
|
|
7695
|
-
file,
|
|
7696
|
-
page: pageNumber,
|
|
7697
|
-
canvasRef,
|
|
7698
|
-
workerSrc: "/scripts/pdf.worker.min.mjs",
|
|
7699
|
-
scale: isMobile ? 1 : 1.3
|
|
7700
|
-
});
|
|
7701
|
-
if (!pdfDocument) return null;
|
|
7702
|
-
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
7703
|
-
"canvas",
|
|
7704
|
-
{
|
|
7705
|
-
ref: canvasRef,
|
|
7706
|
-
"data-testid": testid,
|
|
7707
|
-
style: { width: "100%", height: "auto" }
|
|
7708
|
-
}
|
|
7709
|
-
);
|
|
7710
|
-
}
|
|
7711
|
-
|
|
7712
|
-
// src/components/PDFViewer/PDFElement.tsx
|
|
7713
7648
|
var import_clsx37 = __toESM(require("clsx"), 1);
|
|
7714
|
-
var
|
|
7715
|
-
function PDFElement({
|
|
7716
|
-
b64,
|
|
7717
|
-
testid,
|
|
7718
|
-
isMobile,
|
|
7719
|
-
error
|
|
7720
|
-
}) {
|
|
7721
|
-
const [pdfHook, setPDFHook] = (0, import_react35.useState)(null);
|
|
7722
|
-
(0, import_react35.useEffect)(() => {
|
|
7723
|
-
import("@mikecousins/react-pdf").then((m) => setPDFHook(m.usePdf));
|
|
7724
|
-
}, []);
|
|
7725
|
-
if (pdfHook === null) {
|
|
7726
|
-
return null;
|
|
7727
|
-
}
|
|
7728
|
-
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
7729
|
-
PDFElementInternal,
|
|
7730
|
-
{
|
|
7731
|
-
b64,
|
|
7732
|
-
testid,
|
|
7733
|
-
isMobile,
|
|
7734
|
-
error,
|
|
7735
|
-
usePDF: pdfHook
|
|
7736
|
-
}
|
|
7737
|
-
);
|
|
7738
|
-
}
|
|
7739
|
-
function PDFElementInternal({
|
|
7740
|
-
b64,
|
|
7741
|
-
testid,
|
|
7742
|
-
isMobile,
|
|
7743
|
-
error,
|
|
7744
|
-
usePDF
|
|
7745
|
-
}) {
|
|
7746
|
-
var _a;
|
|
7747
|
-
const canvasRef = (0, import_react35.useRef)(null);
|
|
7748
|
-
const { pdfDocument } = usePDF({
|
|
7749
|
-
file: `data:application/pdf;base64,${b64}`,
|
|
7750
|
-
workerSrc: "/scripts/pdf.worker.min.mjs",
|
|
7751
|
-
scale: isMobile ? 1 : 1.3,
|
|
7752
|
-
canvasRef
|
|
7753
|
-
});
|
|
7754
|
-
const pagesArr = new Array((_a = pdfDocument == null ? void 0 : pdfDocument.numPages) != null ? _a : 1).fill(null);
|
|
7755
|
-
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
7756
|
-
"div",
|
|
7757
|
-
{
|
|
7758
|
-
className: "flex flex-col space-y-4",
|
|
7759
|
-
style: !isMobile ? {
|
|
7760
|
-
minHeight: 871,
|
|
7761
|
-
minWidth: 654
|
|
7762
|
-
} : void 0,
|
|
7763
|
-
children: !!pdfDocument && !!b64 && !error ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Stack, { sizing: "layout-group", children: pagesArr.length > 1 ? pagesArr.map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
7764
|
-
"div",
|
|
7765
|
-
{
|
|
7766
|
-
className: (0, import_clsx37.default)(
|
|
7767
|
-
"flex justify-center border-border-primary-normal",
|
|
7768
|
-
isMobile ? "border-0" : "border"
|
|
7769
|
-
),
|
|
7770
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
7771
|
-
PdfPage,
|
|
7772
|
-
{
|
|
7773
|
-
usePDF,
|
|
7774
|
-
testid: testid ? `${testid}-pdf_page_${i + 1}` : void 0,
|
|
7775
|
-
file: `data:application/pdf;base64,${b64}`,
|
|
7776
|
-
pageNumber: i + 1
|
|
7777
|
-
}
|
|
7778
|
-
)
|
|
7779
|
-
},
|
|
7780
|
-
`${testid}-pdf-page-${i + 1}`
|
|
7781
|
-
)) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
7782
|
-
"div",
|
|
7783
|
-
{
|
|
7784
|
-
className: (0, import_clsx37.default)(
|
|
7785
|
-
"flex justify-center border-border-primary-normal",
|
|
7786
|
-
isMobile ? "border-0" : "border"
|
|
7787
|
-
),
|
|
7788
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
7789
|
-
"canvas",
|
|
7790
|
-
{
|
|
7791
|
-
"data-testid": testid ? `${testid}-pdf-content` : void 0,
|
|
7792
|
-
ref: canvasRef,
|
|
7793
|
-
style: { width: "100%", height: "auto" }
|
|
7794
|
-
}
|
|
7795
|
-
)
|
|
7796
|
-
}
|
|
7797
|
-
) }) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
7798
|
-
Stack,
|
|
7799
|
-
{
|
|
7800
|
-
justify: "center",
|
|
7801
|
-
items: "center",
|
|
7802
|
-
height: "full",
|
|
7803
|
-
flexGrow: 1,
|
|
7804
|
-
"data-testid": testid ? `${testid}-pdf-${error ? "error" : "loading"}` : void 0,
|
|
7805
|
-
children: error ? error : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Spinner, { size: "large" })
|
|
7806
|
-
}
|
|
7807
|
-
)
|
|
7808
|
-
}
|
|
7809
|
-
);
|
|
7810
|
-
}
|
|
7811
|
-
|
|
7812
|
-
// src/components/PDFViewer/DownloadIcon.tsx
|
|
7813
|
-
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
7814
|
-
function DownloadIcon({
|
|
7815
|
-
onClick,
|
|
7816
|
-
isDownloading,
|
|
7817
|
-
testid
|
|
7818
|
-
}) {
|
|
7819
|
-
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
7820
|
-
Button,
|
|
7821
|
-
{
|
|
7822
|
-
testid,
|
|
7823
|
-
iconOnly: true,
|
|
7824
|
-
variant: "tertiary",
|
|
7825
|
-
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Icon, { name: isDownloading ? "cached" : "download" }),
|
|
7826
|
-
onClick
|
|
7827
|
-
}
|
|
7828
|
-
);
|
|
7829
|
-
}
|
|
7830
|
-
|
|
7831
|
-
// src/components/PDFViewer/PDFNavigation.tsx
|
|
7832
|
-
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
7833
|
-
function PdfNavigation({
|
|
7834
|
-
currentIndex,
|
|
7835
|
-
total,
|
|
7836
|
-
onPrev,
|
|
7837
|
-
onNext,
|
|
7838
|
-
disablePrev,
|
|
7839
|
-
disableNext,
|
|
7840
|
-
extraActions,
|
|
7841
|
-
testid,
|
|
7842
|
-
fileName
|
|
7843
|
-
}) {
|
|
7844
|
-
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
7845
|
-
Stack,
|
|
7846
|
-
{
|
|
7847
|
-
horizontal: true,
|
|
7848
|
-
items: "center",
|
|
7849
|
-
justify: "between",
|
|
7850
|
-
sizing: "layout-group",
|
|
7851
|
-
testid: testid ? `${testid}-pdf-navigation` : void 0,
|
|
7852
|
-
children: [
|
|
7853
|
-
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(Stack, { horizontal: true, items: "center", children: [
|
|
7854
|
-
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
7855
|
-
Button,
|
|
7856
|
-
{
|
|
7857
|
-
iconOnly: true,
|
|
7858
|
-
variant: "tertiary",
|
|
7859
|
-
onClick: onPrev,
|
|
7860
|
-
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Icon, { name: "chevron_backward" }),
|
|
7861
|
-
disabled: disablePrev,
|
|
7862
|
-
testid: testid ? `${testid}-pdf-file-previous-button` : void 0
|
|
7863
|
-
}
|
|
7864
|
-
),
|
|
7865
|
-
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(Heading3, { className: "text-text-primary-normal whitespace-nowrap", children: [
|
|
7866
|
-
currentIndex + 1,
|
|
7867
|
-
" / ",
|
|
7868
|
-
total
|
|
7869
|
-
] }),
|
|
7870
|
-
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
7871
|
-
Button,
|
|
7872
|
-
{
|
|
7873
|
-
iconOnly: true,
|
|
7874
|
-
variant: "tertiary",
|
|
7875
|
-
onClick: onNext,
|
|
7876
|
-
rightIcon: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Icon, { name: "chevron_forward" }),
|
|
7877
|
-
disabled: disableNext,
|
|
7878
|
-
testid: testid ? `${testid}-pdf-file-next-button` : void 0
|
|
7879
|
-
}
|
|
7880
|
-
),
|
|
7881
|
-
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Paragraph, { children: (fileName == null ? void 0 : fileName.endsWith(".pdf")) ? fileName : `${fileName}.pdf` })
|
|
7882
|
-
] }),
|
|
7883
|
-
extraActions && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "flex items-center gap-2", children: extraActions })
|
|
7884
|
-
]
|
|
7885
|
-
}
|
|
7886
|
-
) });
|
|
7887
|
-
}
|
|
7888
|
-
|
|
7889
|
-
// src/components/PDFViewer/index.tsx
|
|
7890
|
-
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
7891
|
-
function PDFViewer(props) {
|
|
7892
|
-
const {
|
|
7893
|
-
isOpen,
|
|
7894
|
-
onClose,
|
|
7895
|
-
encodedPdfs,
|
|
7896
|
-
customActions,
|
|
7897
|
-
testid,
|
|
7898
|
-
isMobile,
|
|
7899
|
-
title,
|
|
7900
|
-
customFooter = false,
|
|
7901
|
-
withPagination = true,
|
|
7902
|
-
error
|
|
7903
|
-
} = props;
|
|
7904
|
-
const [currentIndex, setCurrentIndex] = (0, import_react36.useState)(0);
|
|
7905
|
-
const [isDownloading, setIsDownloading] = (0, import_react36.useState)(false);
|
|
7906
|
-
const [isMounted, setIsMounted] = (0, import_react36.useState)(false);
|
|
7907
|
-
(0, import_react36.useEffect)(() => {
|
|
7908
|
-
setIsMounted(true);
|
|
7909
|
-
}, []);
|
|
7910
|
-
const handleDownload = (0, import_react36.useCallback)(() => {
|
|
7911
|
-
setIsDownloading(true);
|
|
7912
|
-
const link = document.createElement("a");
|
|
7913
|
-
const currentPdf = encodedPdfs[currentIndex];
|
|
7914
|
-
if (!currentPdf) {
|
|
7915
|
-
setIsDownloading(false);
|
|
7916
|
-
return;
|
|
7917
|
-
}
|
|
7918
|
-
link.href = `data:application/pdf;base64,${currentPdf.base64}`;
|
|
7919
|
-
link.download = currentPdf.fileName.endsWith(".pdf") ? currentPdf.fileName : `${currentPdf.fileName}.pdf`;
|
|
7920
|
-
document.body.appendChild(link);
|
|
7921
|
-
link.click();
|
|
7922
|
-
document.body.removeChild(link);
|
|
7923
|
-
setIsDownloading(false);
|
|
7924
|
-
}, [currentIndex, encodedPdfs]);
|
|
7925
|
-
if (!encodedPdfs.length) return null;
|
|
7926
|
-
function handleNextFile() {
|
|
7927
|
-
if (currentIndex < encodedPdfs.length - 1) {
|
|
7928
|
-
setCurrentIndex((prev) => prev + 1);
|
|
7929
|
-
}
|
|
7930
|
-
}
|
|
7931
|
-
function handlePreviousFile() {
|
|
7932
|
-
if (currentIndex > 0) {
|
|
7933
|
-
setCurrentIndex((prev) => prev - 1);
|
|
7934
|
-
}
|
|
7935
|
-
}
|
|
7936
|
-
function handleClose() {
|
|
7937
|
-
setCurrentIndex(0);
|
|
7938
|
-
setIsDownloading(false);
|
|
7939
|
-
onClose();
|
|
7940
|
-
}
|
|
7941
|
-
if (!isMounted) return null;
|
|
7942
|
-
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
7943
|
-
Modal,
|
|
7944
|
-
{
|
|
7945
|
-
testid,
|
|
7946
|
-
open: isOpen,
|
|
7947
|
-
customFooter,
|
|
7948
|
-
onClose: handleClose,
|
|
7949
|
-
noWrapper: true,
|
|
7950
|
-
showButtons: isMobile && customFooter ? !!customActions : !!encodedPdfs.length,
|
|
7951
|
-
customActions: !!encodedPdfs.length && !isMobile && withPagination ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
7952
|
-
PdfNavigation,
|
|
7953
|
-
{
|
|
7954
|
-
testid,
|
|
7955
|
-
currentIndex,
|
|
7956
|
-
total: encodedPdfs.length,
|
|
7957
|
-
onPrev: handlePreviousFile,
|
|
7958
|
-
onNext: handleNextFile,
|
|
7959
|
-
disablePrev: currentIndex === 0,
|
|
7960
|
-
disableNext: currentIndex === encodedPdfs.length - 1,
|
|
7961
|
-
extraActions: customActions,
|
|
7962
|
-
fileName: encodedPdfs[currentIndex].fileName
|
|
7963
|
-
}
|
|
7964
|
-
) : customActions,
|
|
7965
|
-
fixedHeightScrolling: true,
|
|
7966
|
-
headerIconAlign: "right",
|
|
7967
|
-
headerIcon: !isMobile ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
7968
|
-
DownloadIcon,
|
|
7969
|
-
{
|
|
7970
|
-
testid: testid ? `${testid}-download-icon` : void 0,
|
|
7971
|
-
onClick: handleDownload,
|
|
7972
|
-
isDownloading
|
|
7973
|
-
}
|
|
7974
|
-
) : void 0,
|
|
7975
|
-
title: isMobile ? title != null ? title : encodedPdfs[currentIndex].fileName : void 0,
|
|
7976
|
-
size: isMobile ? "screen" : "large",
|
|
7977
|
-
headerClassname: "bg-brand-400 desktop:bg-background-grouped-primary-normal p-mobile-layout-padding text-brand-text-action-primary-normal",
|
|
7978
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
7979
|
-
PDFElement,
|
|
7980
|
-
{
|
|
7981
|
-
testid,
|
|
7982
|
-
b64: encodedPdfs[currentIndex].base64,
|
|
7983
|
-
isMobile,
|
|
7984
|
-
error
|
|
7985
|
-
}
|
|
7986
|
-
)
|
|
7987
|
-
}
|
|
7988
|
-
);
|
|
7989
|
-
}
|
|
7990
|
-
|
|
7991
|
-
// src/components/ListGroup.tsx
|
|
7992
|
-
var import_react37 = require("react");
|
|
7993
|
-
var import_clsx38 = __toESM(require("clsx"), 1);
|
|
7994
|
-
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
7649
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
7995
7650
|
function ListGroup({
|
|
7996
7651
|
title,
|
|
7997
7652
|
defaultOpen = false,
|
|
@@ -8002,7 +7657,7 @@ function ListGroup({
|
|
|
8002
7657
|
className,
|
|
8003
7658
|
children
|
|
8004
7659
|
}) {
|
|
8005
|
-
const [uncontrolledOpen, setUncontrolledOpen] = (0,
|
|
7660
|
+
const [uncontrolledOpen, setUncontrolledOpen] = (0, import_react34.useState)(defaultOpen);
|
|
8006
7661
|
const isControlled = controlledOpen !== void 0;
|
|
8007
7662
|
const isOpen = isControlled ? controlledOpen : uncontrolledOpen;
|
|
8008
7663
|
const toggle = () => {
|
|
@@ -8011,24 +7666,24 @@ function ListGroup({
|
|
|
8011
7666
|
if (!isControlled) setUncontrolledOpen(next);
|
|
8012
7667
|
onToggle == null ? void 0 : onToggle(next);
|
|
8013
7668
|
};
|
|
8014
|
-
return /* @__PURE__ */ (0,
|
|
8015
|
-
/* @__PURE__ */ (0,
|
|
7669
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { "data-testid": testid, className: (0, import_clsx37.default)("rounded-sm", className), children: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(Stack, { sizing: "layout", noGap: true, children: [
|
|
7670
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
8016
7671
|
"button",
|
|
8017
7672
|
{
|
|
8018
7673
|
type: "button",
|
|
8019
7674
|
onClick: toggle,
|
|
8020
|
-
className: (0,
|
|
7675
|
+
className: (0, import_clsx37.default)(
|
|
8021
7676
|
"w-full flex items-center justify-between text-left",
|
|
8022
7677
|
disabled && "opacity-50 cursor-not-allowed"
|
|
8023
7678
|
),
|
|
8024
7679
|
"aria-expanded": isOpen,
|
|
8025
7680
|
children: [
|
|
8026
|
-
/* @__PURE__ */ (0,
|
|
8027
|
-
/* @__PURE__ */ (0,
|
|
7681
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Label, { children: title }),
|
|
7682
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
8028
7683
|
Icon,
|
|
8029
7684
|
{
|
|
8030
7685
|
name: "expand_more",
|
|
8031
|
-
className: (0,
|
|
7686
|
+
className: (0, import_clsx37.default)(
|
|
8032
7687
|
"transition-transform duration-200",
|
|
8033
7688
|
isOpen ? "rotate-180" : "rotate-0"
|
|
8034
7689
|
)
|
|
@@ -8037,14 +7692,14 @@ function ListGroup({
|
|
|
8037
7692
|
]
|
|
8038
7693
|
}
|
|
8039
7694
|
),
|
|
8040
|
-
isOpen && /* @__PURE__ */ (0,
|
|
7695
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Stack, { sizing: "layout", paddingTop: true, children })
|
|
8041
7696
|
] }) });
|
|
8042
7697
|
}
|
|
8043
7698
|
|
|
8044
7699
|
// src/components/Pagination.tsx
|
|
8045
|
-
var
|
|
8046
|
-
var
|
|
8047
|
-
var
|
|
7700
|
+
var import_react35 = require("react");
|
|
7701
|
+
var import_clsx38 = __toESM(require("clsx"), 1);
|
|
7702
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
8048
7703
|
var Pagination = ({
|
|
8049
7704
|
totalPages,
|
|
8050
7705
|
currentPage,
|
|
@@ -8054,7 +7709,7 @@ var Pagination = ({
|
|
|
8054
7709
|
className,
|
|
8055
7710
|
disabled
|
|
8056
7711
|
}) => {
|
|
8057
|
-
const goTo = (0,
|
|
7712
|
+
const goTo = (0, import_react35.useCallback)(
|
|
8058
7713
|
(page) => {
|
|
8059
7714
|
if (disabled) return;
|
|
8060
7715
|
onPageChange(page);
|
|
@@ -8071,7 +7726,7 @@ var Pagination = ({
|
|
|
8071
7726
|
goTo(currentPage + 1);
|
|
8072
7727
|
}
|
|
8073
7728
|
};
|
|
8074
|
-
const pageTokens = (0,
|
|
7729
|
+
const pageTokens = (0, import_react35.useMemo)(() => {
|
|
8075
7730
|
if (totalPages <= 5) {
|
|
8076
7731
|
return Array.from({ length: totalPages }, (_, i) => i + 1);
|
|
8077
7732
|
}
|
|
@@ -8108,7 +7763,7 @@ var Pagination = ({
|
|
|
8108
7763
|
return tokens;
|
|
8109
7764
|
}, [totalPages, currentPage]);
|
|
8110
7765
|
if (totalPages <= 1) return null;
|
|
8111
|
-
const buttonClass = (0,
|
|
7766
|
+
const buttonClass = (0, import_clsx38.default)(
|
|
8112
7767
|
"cursor-pointer disabled:cursor-default",
|
|
8113
7768
|
paddingUsingComponentGap,
|
|
8114
7769
|
"w-8 h-8",
|
|
@@ -8119,14 +7774,14 @@ var Pagination = ({
|
|
|
8119
7774
|
"focus:bg-background-grouped-secondary-normal focus:outline-0",
|
|
8120
7775
|
"disabled:bg-transparent disabled:text-text-action-primary-disabled"
|
|
8121
7776
|
);
|
|
8122
|
-
return /* @__PURE__ */ (0,
|
|
7777
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
8123
7778
|
"nav",
|
|
8124
7779
|
{
|
|
8125
7780
|
id,
|
|
8126
7781
|
"data-testid": testid,
|
|
8127
7782
|
"aria-label": "Pagination",
|
|
8128
7783
|
onKeyDown: handleKey,
|
|
8129
|
-
className: (0,
|
|
7784
|
+
className: (0, import_clsx38.default)(
|
|
8130
7785
|
"flex items-center",
|
|
8131
7786
|
"border border-border-primary-normal",
|
|
8132
7787
|
"bg-background-grouped-primary-normal",
|
|
@@ -8134,19 +7789,19 @@ var Pagination = ({
|
|
|
8134
7789
|
className
|
|
8135
7790
|
),
|
|
8136
7791
|
children: [
|
|
8137
|
-
/* @__PURE__ */ (0,
|
|
7792
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8138
7793
|
"button",
|
|
8139
7794
|
{
|
|
8140
7795
|
disabled: disabled || currentPage <= 1,
|
|
8141
7796
|
"aria-label": "Previous page",
|
|
8142
7797
|
onClick: () => goTo(currentPage - 1),
|
|
8143
|
-
className: (0,
|
|
8144
|
-
children: /* @__PURE__ */ (0,
|
|
7798
|
+
className: (0, import_clsx38.default)(buttonClass, "border-r-1 border-border-primary-normal"),
|
|
7799
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Icon, { name: "keyboard_arrow_left" })
|
|
8145
7800
|
}
|
|
8146
7801
|
),
|
|
8147
|
-
/* @__PURE__ */ (0,
|
|
7802
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("ul", { className: (0, import_clsx38.default)("flex items-center"), children: pageTokens.map((token, index) => {
|
|
8148
7803
|
if (token === "ellipsis") {
|
|
8149
|
-
return /* @__PURE__ */ (0,
|
|
7804
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8150
7805
|
"li",
|
|
8151
7806
|
{
|
|
8152
7807
|
className: "w-8 h-8 select-none text-text-action-primary-disabled",
|
|
@@ -8156,29 +7811,29 @@ var Pagination = ({
|
|
|
8156
7811
|
);
|
|
8157
7812
|
}
|
|
8158
7813
|
const selected = token === currentPage;
|
|
8159
|
-
return /* @__PURE__ */ (0,
|
|
7814
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8160
7815
|
"button",
|
|
8161
7816
|
{
|
|
8162
7817
|
"aria-label": `Page ${token}`,
|
|
8163
7818
|
"aria-current": selected ? "page" : void 0,
|
|
8164
7819
|
disabled,
|
|
8165
7820
|
onClick: () => goTo(token),
|
|
8166
|
-
className: (0,
|
|
7821
|
+
className: (0, import_clsx38.default)(
|
|
8167
7822
|
buttonClass,
|
|
8168
7823
|
selected && "border-x-1 bg-background-grouped-secondary-normal border-border-primary-normal"
|
|
8169
7824
|
),
|
|
8170
|
-
children: /* @__PURE__ */ (0,
|
|
7825
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Subheader, { align: "center", weight: "bold", children: token })
|
|
8171
7826
|
}
|
|
8172
7827
|
) }, token);
|
|
8173
7828
|
}) }),
|
|
8174
|
-
/* @__PURE__ */ (0,
|
|
7829
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8175
7830
|
"button",
|
|
8176
7831
|
{
|
|
8177
7832
|
disabled: disabled || currentPage >= totalPages,
|
|
8178
7833
|
"aria-label": "Next page",
|
|
8179
7834
|
onClick: () => goTo(currentPage + 1),
|
|
8180
|
-
className: (0,
|
|
8181
|
-
children: /* @__PURE__ */ (0,
|
|
7835
|
+
className: (0, import_clsx38.default)(buttonClass, "border-l-1 border-border-primary-normal"),
|
|
7836
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Icon, { name: "keyboard_arrow_right" })
|
|
8182
7837
|
}
|
|
8183
7838
|
)
|
|
8184
7839
|
]
|
|
@@ -8188,7 +7843,7 @@ var Pagination = ({
|
|
|
8188
7843
|
Pagination.displayName = "Pagination";
|
|
8189
7844
|
|
|
8190
7845
|
// src/components/SkeletonParagraph.tsx
|
|
8191
|
-
var
|
|
7846
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
8192
7847
|
function SkeletonParagraph({
|
|
8193
7848
|
className = "",
|
|
8194
7849
|
heightClassName = "h-6",
|
|
@@ -8199,7 +7854,7 @@ function SkeletonParagraph({
|
|
|
8199
7854
|
medium: "min-w-20 w-1/2",
|
|
8200
7855
|
large: "min-w-32 w-full"
|
|
8201
7856
|
};
|
|
8202
|
-
return /* @__PURE__ */ (0,
|
|
7857
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
8203
7858
|
"div",
|
|
8204
7859
|
{
|
|
8205
7860
|
"aria-label": "Loading content",
|
|
@@ -8210,9 +7865,9 @@ function SkeletonParagraph({
|
|
|
8210
7865
|
}
|
|
8211
7866
|
|
|
8212
7867
|
// src/components/EmptyCartIcon.tsx
|
|
8213
|
-
var
|
|
7868
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
8214
7869
|
function EmptyCartIcon() {
|
|
8215
|
-
return /* @__PURE__ */ (0,
|
|
7870
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
8216
7871
|
"svg",
|
|
8217
7872
|
{
|
|
8218
7873
|
width: "211",
|
|
@@ -8220,7 +7875,7 @@ function EmptyCartIcon() {
|
|
|
8220
7875
|
viewBox: "0 0 211 196",
|
|
8221
7876
|
fill: "none",
|
|
8222
7877
|
xmlns: "http://www.w3.org/2000/svg",
|
|
8223
|
-
children: /* @__PURE__ */ (0,
|
|
7878
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
8224
7879
|
"path",
|
|
8225
7880
|
{
|
|
8226
7881
|
"fill-rule": "evenodd",
|
|
@@ -8234,17 +7889,17 @@ function EmptyCartIcon() {
|
|
|
8234
7889
|
}
|
|
8235
7890
|
|
|
8236
7891
|
// src/components/SearchResultImage/index.tsx
|
|
8237
|
-
var
|
|
8238
|
-
var
|
|
7892
|
+
var import_react36 = require("react");
|
|
7893
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
8239
7894
|
function SearchResultImage({
|
|
8240
7895
|
width = 20,
|
|
8241
7896
|
height = 20,
|
|
8242
7897
|
src,
|
|
8243
7898
|
alt
|
|
8244
7899
|
}) {
|
|
8245
|
-
const [imageError, setImageError] = (0,
|
|
7900
|
+
const [imageError, setImageError] = (0, import_react36.useState)(false);
|
|
8246
7901
|
const showPlaceholder = imageError || !src;
|
|
8247
|
-
return /* @__PURE__ */ (0,
|
|
7902
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_jsx_runtime59.Fragment, { children: showPlaceholder ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(ImagePlaceholder, { width, height }) : /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
8248
7903
|
"img",
|
|
8249
7904
|
{
|
|
8250
7905
|
src,
|
|
@@ -8259,9 +7914,9 @@ function SearchResultImage({
|
|
|
8259
7914
|
}
|
|
8260
7915
|
|
|
8261
7916
|
// src/components/Alert.tsx
|
|
8262
|
-
var
|
|
8263
|
-
var
|
|
8264
|
-
var
|
|
7917
|
+
var import_clsx39 = __toESM(require("clsx"), 1);
|
|
7918
|
+
var import_react37 = require("react");
|
|
7919
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
8265
7920
|
function Alert(_a) {
|
|
8266
7921
|
var _b = _a, {
|
|
8267
7922
|
id,
|
|
@@ -8281,10 +7936,10 @@ function Alert(_a) {
|
|
|
8281
7936
|
"onClose"
|
|
8282
7937
|
]);
|
|
8283
7938
|
const isError = variant === "error";
|
|
8284
|
-
const handleClose = (0,
|
|
7939
|
+
const handleClose = (0, import_react37.useCallback)(() => {
|
|
8285
7940
|
if (onClose) onClose();
|
|
8286
7941
|
}, [onClose]);
|
|
8287
|
-
return /* @__PURE__ */ (0,
|
|
7942
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
|
|
8288
7943
|
Stack,
|
|
8289
7944
|
__spreadProps(__spreadValues({
|
|
8290
7945
|
id,
|
|
@@ -8300,36 +7955,36 @@ function Alert(_a) {
|
|
|
8300
7955
|
horizontalMobile: true
|
|
8301
7956
|
}, rest), {
|
|
8302
7957
|
children: [
|
|
8303
|
-
/* @__PURE__ */ (0,
|
|
7958
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
8304
7959
|
"div",
|
|
8305
7960
|
{
|
|
8306
|
-
className: (0,
|
|
7961
|
+
className: (0, import_clsx39.default)("min-w-[2px] min-h-full flex", {
|
|
8307
7962
|
"bg-background-critical-normal": isError,
|
|
8308
7963
|
"bg-background-warning-normal": !isError
|
|
8309
7964
|
})
|
|
8310
7965
|
}
|
|
8311
7966
|
),
|
|
8312
|
-
/* @__PURE__ */ (0,
|
|
7967
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
8313
7968
|
"span",
|
|
8314
7969
|
{
|
|
8315
|
-
className: (0,
|
|
7970
|
+
className: (0, import_clsx39.default)({
|
|
8316
7971
|
"text-icon-critical-normal": isError,
|
|
8317
7972
|
"text-icon-warning-normal": !isError
|
|
8318
7973
|
}),
|
|
8319
|
-
children: /* @__PURE__ */ (0,
|
|
7974
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Icon, { name: "warning" })
|
|
8320
7975
|
}
|
|
8321
7976
|
),
|
|
8322
|
-
/* @__PURE__ */ (0,
|
|
8323
|
-
/* @__PURE__ */ (0,
|
|
8324
|
-
/* @__PURE__ */ (0,
|
|
7977
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Stack, { flexGrow: 1, sizing: "component", children: [
|
|
7978
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Heading2, { children: title }),
|
|
7979
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Paragraph, { children: message })
|
|
8325
7980
|
] }),
|
|
8326
|
-
dismissible && /* @__PURE__ */ (0,
|
|
7981
|
+
dismissible && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
8327
7982
|
Button,
|
|
8328
7983
|
{
|
|
8329
7984
|
"aria-label": "Dismiss alert",
|
|
8330
7985
|
iconOnly: true,
|
|
8331
7986
|
variant: "tertiary",
|
|
8332
|
-
leftIcon: /* @__PURE__ */ (0,
|
|
7987
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Icon, { name: "close" }),
|
|
8333
7988
|
onClick: handleClose
|
|
8334
7989
|
}
|
|
8335
7990
|
)
|
|
@@ -8339,9 +7994,9 @@ function Alert(_a) {
|
|
|
8339
7994
|
}
|
|
8340
7995
|
|
|
8341
7996
|
// src/components/OrderCheckIcon.tsx
|
|
8342
|
-
var
|
|
7997
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
8343
7998
|
function OrderCheckIcon(props) {
|
|
8344
|
-
return /* @__PURE__ */ (0,
|
|
7999
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
8345
8000
|
"svg",
|
|
8346
8001
|
__spreadProps(__spreadValues({
|
|
8347
8002
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -8350,7 +8005,7 @@ function OrderCheckIcon(props) {
|
|
|
8350
8005
|
width: 37,
|
|
8351
8006
|
height: 36
|
|
8352
8007
|
}, props), {
|
|
8353
|
-
children: /* @__PURE__ */ (0,
|
|
8008
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
8354
8009
|
"path",
|
|
8355
8010
|
{
|
|
8356
8011
|
d: "M18.457 3.00024C19.6493 3.01827 20.8644 3.13827 22.0283 3.41724C22.8321 3.61234 23.3287 4.42237 23.1337 5.22778C22.9402 6.03178 22.1252 6.5272 21.3242 6.33521C20.3928 6.11026 19.4046 6.01526 18.4658 6.00024C15.2603 6.00924 12.2492 7.26586 9.99018 9.53833C7.72976 11.8108 6.49103 14.829 6.49995 18.0344C6.50895 21.2399 7.7656 24.2495 10.038 26.51C12.303 28.7615 15.3065 30.0002 18.4999 30.0002H18.5341C21.7396 29.9912 24.7507 28.7346 27.0097 26.4622C29.2701 24.1882 30.5089 21.1714 30.4999 17.9661C30.4984 17.1382 31.1673 16.4629 31.9951 16.4612H31.9999C32.8263 16.4612 33.4982 17.13 33.4999 17.9563C33.5119 21.9627 31.9625 25.7354 29.1367 28.5764C26.3123 31.4173 22.5503 32.9881 18.5439 33.0002H18.4999C14.5086 33.0002 10.7542 31.4523 7.92378 28.637C5.08288 25.8126 3.51206 22.0505 3.49995 18.0442C3.48795 14.0363 5.03742 10.265 7.86323 7.42407C10.6877 4.58307 14.4505 3.01224 18.457 3.00024ZM27.872 9.51196C28.418 8.89248 29.3642 8.82637 29.9882 9.37231C30.6107 9.91681 30.6739 10.8645 30.1279 11.4885L19.6279 23.4885C19.3549 23.8004 18.9652 23.9852 18.5498 24.0002H18.4999C18.1025 24.0002 17.7214 23.8428 17.4394 23.5608L12.9394 19.0608C12.3529 18.4743 12.353 17.5262 12.9394 16.9397C13.5259 16.3532 14.474 16.3532 15.0605 16.9397L18.4267 20.3059L27.872 9.51196Z",
|
|
@@ -8383,7 +8038,6 @@ function OrderCheckIcon(props) {
|
|
|
8383
8038
|
MenuOption,
|
|
8384
8039
|
MobileDataGrid,
|
|
8385
8040
|
OrderCheckIcon,
|
|
8386
|
-
PDFViewer,
|
|
8387
8041
|
Pagination,
|
|
8388
8042
|
Paragraph,
|
|
8389
8043
|
ProductImagePreview,
|