@dmsi/wedgekit-react 0.0.414 → 0.0.417
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-3HBYDOYE.js +114 -0
- package/dist/{chunk-JIMJIJOF.js → chunk-5TGP5EFM.js} +2 -2
- package/dist/{chunk-2HMCS25C.js → chunk-6LHBY2IH.js} +1 -1
- package/dist/{chunk-6I5LZ2ZC.js → chunk-7AXHAWJX.js} +3 -3
- package/dist/{chunk-MQX7GFLX.js → chunk-CAQWLY5V.js} +24 -6
- package/dist/{chunk-QQ5G773N.js → chunk-DCLNAUC4.js} +1 -1
- package/dist/{chunk-GB4ZTUQV.js → chunk-DTW7JCBR.js} +36 -0
- package/dist/{chunk-OBY5EH47.js → chunk-HYJIDHAK.js} +6 -6
- package/dist/{chunk-LZGYABCX.js → chunk-IMOIZFJZ.js} +8 -8
- package/dist/chunk-KBJZUVLM.js +65 -0
- package/dist/{chunk-AA6GE3TH.js → chunk-LUPHOXAQ.js} +1 -1
- package/dist/chunk-NRNWEQD7.js +66 -0
- package/dist/{chunk-44TDIHUP.js → chunk-P3MIP2FD.js} +1 -1
- package/dist/chunk-PQWWVBSR.js +61 -0
- package/dist/{chunk-ERW5DEIO.js → chunk-RQLWSLVE.js} +1 -1
- package/dist/chunk-TYAQWVIM.js +159 -0
- package/dist/{chunk-KZZKQLKF.js → chunk-W55J2KJZ.js} +1 -1
- package/dist/chunk-Y2GK27RX.js +79 -0
- package/dist/components/Accordion.cjs +74 -2
- package/dist/components/Accordion.js +3 -3
- package/dist/components/CalendarRange.cjs +232 -53
- package/dist/components/CalendarRange.css +178 -65
- package/dist/components/CalendarRange.js +25 -17
- package/dist/components/Card.cjs +38 -2
- package/dist/components/Card.js +1 -1
- package/dist/components/CompactImagesPreview.cjs +59 -5
- package/dist/components/CompactImagesPreview.js +2 -2
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.cjs +190 -11
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.css +178 -65
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +25 -17
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.cjs +200 -21
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.css +178 -65
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +25 -17
- package/dist/components/DataGrid/PinnedColumns.cjs +215 -36
- package/dist/components/DataGrid/PinnedColumns.css +178 -65
- package/dist/components/DataGrid/PinnedColumns.js +25 -17
- package/dist/components/DataGrid/TableBody/LoadingCell.cjs +191 -12
- package/dist/components/DataGrid/TableBody/LoadingCell.css +178 -65
- package/dist/components/DataGrid/TableBody/LoadingCell.js +25 -17
- package/dist/components/DataGrid/TableBody/TableBodyRow.cjs +197 -18
- package/dist/components/DataGrid/TableBody/TableBodyRow.css +178 -65
- package/dist/components/DataGrid/TableBody/TableBodyRow.js +25 -17
- package/dist/components/DataGrid/TableBody/index.cjs +212 -33
- package/dist/components/DataGrid/TableBody/index.css +178 -65
- package/dist/components/DataGrid/TableBody/index.js +25 -17
- package/dist/components/DataGrid/index.cjs +301 -122
- package/dist/components/DataGrid/index.css +178 -65
- package/dist/components/DataGrid/index.js +25 -17
- package/dist/components/DataGrid/utils.cjs +191 -12
- package/dist/components/DataGrid/utils.css +178 -65
- package/dist/components/DataGrid/utils.js +25 -17
- package/dist/components/DateInput.cjs +251 -72
- package/dist/components/DateInput.css +178 -65
- package/dist/components/DateInput.js +25 -17
- package/dist/components/DateRangeInput.cjs +251 -72
- package/dist/components/DateRangeInput.css +178 -65
- package/dist/components/DateRangeInput.js +25 -17
- package/dist/components/Grid.cjs +81 -76
- package/dist/components/Grid.js +1 -1
- package/dist/components/ListGroup.cjs +553 -0
- package/dist/components/ListGroup.js +11 -0
- package/dist/components/MobileDataGrid/ColumnList.cjs +36 -0
- package/dist/components/MobileDataGrid/ColumnList.js +3 -3
- package/dist/components/MobileDataGrid/ColumnSelector/index.cjs +198 -19
- package/dist/components/MobileDataGrid/ColumnSelector/index.css +178 -65
- package/dist/components/MobileDataGrid/ColumnSelector/index.js +25 -17
- package/dist/components/MobileDataGrid/MobileDataGridCard/index.cjs +36 -0
- package/dist/components/MobileDataGrid/MobileDataGridCard/index.js +2 -2
- package/dist/components/MobileDataGrid/MobileDataGridHeader.cjs +242 -27
- package/dist/components/MobileDataGrid/MobileDataGridHeader.css +178 -65
- package/dist/components/MobileDataGrid/MobileDataGridHeader.js +25 -17
- package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.cjs +36 -0
- package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.js +2 -2
- package/dist/components/MobileDataGrid/RowDetailModalProvider/index.cjs +36 -0
- package/dist/components/MobileDataGrid/RowDetailModalProvider/index.js +5 -5
- package/dist/components/MobileDataGrid/index.cjs +742 -527
- package/dist/components/MobileDataGrid/index.css +178 -65
- package/dist/components/MobileDataGrid/index.js +25 -17
- package/dist/components/Modal.js +2 -2
- package/dist/components/Notification.cjs +36 -0
- package/dist/components/Notification.js +1 -1
- package/dist/components/PDFViewer/PDFElement.cjs +36 -0
- package/dist/components/PDFViewer/PDFElement.js +2 -2
- package/dist/components/PDFViewer/PDFNavigation.cjs +36 -0
- package/dist/components/PDFViewer/PDFNavigation.js +2 -2
- package/dist/components/PDFViewer/index.cjs +36 -0
- package/dist/components/PDFViewer/index.js +8 -111
- package/dist/components/Pagination.cjs +427 -0
- package/dist/components/Pagination.js +10 -0
- package/dist/components/ProductImagePreview/index.cjs +139 -127
- package/dist/components/ProductImagePreview/index.js +5 -5
- package/dist/components/SideMenuGroup.cjs +36 -0
- package/dist/components/SideMenuGroup.js +1 -1
- package/dist/components/SideMenuItem.cjs +36 -0
- package/dist/components/SideMenuItem.js +1 -1
- package/dist/components/SimpleTable.cjs +521 -0
- package/dist/components/SimpleTable.js +10 -0
- package/dist/components/Stack.cjs +36 -0
- package/dist/components/Stack.js +1 -1
- package/dist/components/Swatch.cjs +36 -0
- package/dist/components/Swatch.js +1 -1
- package/dist/components/Time.cjs +36 -0
- package/dist/components/Time.js +1 -1
- package/dist/components/Tooltip.cjs +1 -1
- package/dist/components/Tooltip.js +1 -1
- package/dist/components/Upload.cjs +36 -0
- package/dist/components/Upload.js +1 -1
- package/dist/components/index.cjs +739 -131
- package/dist/components/index.css +178 -65
- package/dist/components/index.js +37 -17
- package/dist/index.css +178 -65
- package/package.json +1 -1
- package/src/components/Card.tsx +60 -2
- package/src/components/CompactImagesPreview.tsx +54 -30
- package/src/components/Grid.tsx +59 -91
- package/src/components/ListGroup.tsx +82 -0
- package/src/components/Pagination.tsx +182 -0
- package/src/components/SimpleTable.tsx +77 -0
- package/src/components/Stack.tsx +76 -0
- package/src/components/Tooltip.tsx +4 -3
- package/src/components/index.ts +4 -0
- package/dist/chunk-ER6RCOH3.js +0 -97
- package/dist/chunk-EZCH4PQS.js +0 -29
- package/dist/{chunk-D6YCMQPO.js → chunk-SBCFBHNG.js} +3 -3
|
@@ -72,13 +72,17 @@ __export(components_exports, {
|
|
|
72
72
|
Icon: () => Icon,
|
|
73
73
|
Input: () => Input,
|
|
74
74
|
Label: () => Label,
|
|
75
|
+
ListGroup: () => ListGroup,
|
|
75
76
|
Menu: () => Menu,
|
|
76
77
|
MenuOption: () => MenuOption,
|
|
77
78
|
MobileDataGrid: () => MobileDataGrid,
|
|
79
|
+
PDFViewer: () => PDFViewer,
|
|
80
|
+
Pagination: () => Pagination,
|
|
78
81
|
Paragraph: () => Paragraph,
|
|
79
82
|
ProductImagePreview: () => ProductImagePreview,
|
|
80
83
|
Search: () => Search,
|
|
81
84
|
Select: () => Select,
|
|
85
|
+
SimpleTable: () => SimpleTable,
|
|
82
86
|
Subheader: () => Subheader,
|
|
83
87
|
Tooltip: () => Tooltip
|
|
84
88
|
});
|
|
@@ -3992,7 +3996,7 @@ var Tooltip = ({
|
|
|
3992
3996
|
id,
|
|
3993
3997
|
"data-testid": testid,
|
|
3994
3998
|
ref,
|
|
3995
|
-
className: "relative inline-grid grid-cols-[auto_1fr] items-center",
|
|
3999
|
+
className: "relative inline-grid grid-cols-[auto_1fr] items-center cursor-pointer",
|
|
3996
4000
|
onMouseEnter: handleMouseEnter,
|
|
3997
4001
|
onMouseLeave: handleMouseLeave,
|
|
3998
4002
|
children: [
|
|
@@ -4044,14 +4048,50 @@ var import_clsx21 = __toESM(require("clsx"), 1);
|
|
|
4044
4048
|
var import_clsx19 = __toESM(require("clsx"), 1);
|
|
4045
4049
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
4046
4050
|
function Card(props) {
|
|
4047
|
-
const _a = props, {
|
|
4051
|
+
const _a = props, {
|
|
4052
|
+
children,
|
|
4053
|
+
selected,
|
|
4054
|
+
testid,
|
|
4055
|
+
padding,
|
|
4056
|
+
paddingX,
|
|
4057
|
+
paddingY,
|
|
4058
|
+
paddingBottom,
|
|
4059
|
+
paddingTop,
|
|
4060
|
+
paddingLeft,
|
|
4061
|
+
paddingRight
|
|
4062
|
+
} = _a, rest = __objRest(_a, [
|
|
4063
|
+
"children",
|
|
4064
|
+
"selected",
|
|
4065
|
+
"testid",
|
|
4066
|
+
"padding",
|
|
4067
|
+
"paddingX",
|
|
4068
|
+
"paddingY",
|
|
4069
|
+
"paddingBottom",
|
|
4070
|
+
"paddingTop",
|
|
4071
|
+
"paddingLeft",
|
|
4072
|
+
"paddingRight"
|
|
4073
|
+
]);
|
|
4048
4074
|
const CardComponent = props.as || "div";
|
|
4075
|
+
const anyPaddingPropSpecified = padding !== void 0 || paddingX !== void 0 || paddingY !== void 0 || paddingBottom !== void 0 || paddingTop !== void 0 || paddingLeft !== void 0 || paddingRight !== void 0;
|
|
4076
|
+
const paddingClasses = (0, import_clsx19.default)(
|
|
4077
|
+
// Backward compatibility: if no new padding props provided keep existing class.
|
|
4078
|
+
!anyPaddingPropSpecified && "p-desktop-layout-padding",
|
|
4079
|
+
// New responsive spacing tokens (mirrors Stack for layout sizing)
|
|
4080
|
+
padding && "p-mobile-layout-padding desktop:p-desktop-layout-padding compact:p-desktop-compact-layout-padding",
|
|
4081
|
+
paddingX && "px-mobile-layout-padding desktop:px-desktop-layout-padding compact:px-desktop-compact-layout-padding",
|
|
4082
|
+
paddingY && "py-mobile-layout-padding desktop:py-desktop-layout-padding compact:py-desktop-compact-layout-padding",
|
|
4083
|
+
paddingBottom && "pb-mobile-layout-padding desktop:pb-desktop-layout-padding compact:pb-desktop-compact-layout-padding",
|
|
4084
|
+
paddingTop && "pt-mobile-layout-padding desktop:pt-desktop-layout-padding compact:pt-desktop-compact-layout-padding",
|
|
4085
|
+
paddingLeft && "pl-mobile-layout-padding desktop:pl-desktop-layout-padding compact:pl-desktop-compact-layout-padding",
|
|
4086
|
+
paddingRight && "pr-mobile-layout-padding desktop:pr-desktop-layout-padding compact:pr-desktop-compact-layout-padding"
|
|
4087
|
+
);
|
|
4049
4088
|
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4050
4089
|
CardComponent,
|
|
4051
4090
|
__spreadProps(__spreadValues({}, rest), {
|
|
4052
4091
|
"data-testid": testid,
|
|
4053
4092
|
className: (0, import_clsx19.default)(
|
|
4054
|
-
"rounded-sm
|
|
4093
|
+
"rounded-sm",
|
|
4094
|
+
paddingClasses,
|
|
4055
4095
|
selected ? "border-2 border-border-primary-focus" : "border border-border-primary-normal",
|
|
4056
4096
|
rest.className
|
|
4057
4097
|
),
|
|
@@ -4095,6 +4135,10 @@ var Stack = (_a) => {
|
|
|
4095
4135
|
padding,
|
|
4096
4136
|
paddingX,
|
|
4097
4137
|
paddingY,
|
|
4138
|
+
paddingBottom,
|
|
4139
|
+
paddingTop,
|
|
4140
|
+
paddingLeft,
|
|
4141
|
+
paddingRight,
|
|
4098
4142
|
margin,
|
|
4099
4143
|
marginX,
|
|
4100
4144
|
marginY,
|
|
@@ -4110,6 +4154,10 @@ var Stack = (_a) => {
|
|
|
4110
4154
|
height,
|
|
4111
4155
|
maxHeight,
|
|
4112
4156
|
borderColor,
|
|
4157
|
+
borderTopColor,
|
|
4158
|
+
borderRightColor,
|
|
4159
|
+
borderBottomColor,
|
|
4160
|
+
borderLeftColor,
|
|
4113
4161
|
backgroundColor,
|
|
4114
4162
|
sizing = "none",
|
|
4115
4163
|
overflowY = "inherit",
|
|
@@ -4135,6 +4183,10 @@ var Stack = (_a) => {
|
|
|
4135
4183
|
"padding",
|
|
4136
4184
|
"paddingX",
|
|
4137
4185
|
"paddingY",
|
|
4186
|
+
"paddingBottom",
|
|
4187
|
+
"paddingTop",
|
|
4188
|
+
"paddingLeft",
|
|
4189
|
+
"paddingRight",
|
|
4138
4190
|
"margin",
|
|
4139
4191
|
"marginX",
|
|
4140
4192
|
"marginY",
|
|
@@ -4150,6 +4202,10 @@ var Stack = (_a) => {
|
|
|
4150
4202
|
"height",
|
|
4151
4203
|
"maxHeight",
|
|
4152
4204
|
"borderColor",
|
|
4205
|
+
"borderTopColor",
|
|
4206
|
+
"borderRightColor",
|
|
4207
|
+
"borderBottomColor",
|
|
4208
|
+
"borderLeftColor",
|
|
4153
4209
|
"backgroundColor",
|
|
4154
4210
|
"sizing",
|
|
4155
4211
|
"overflowY",
|
|
@@ -4185,6 +4241,10 @@ var Stack = (_a) => {
|
|
|
4185
4241
|
width: width !== void 0 && typeof width === "number" ? `${width}px` : void 0,
|
|
4186
4242
|
minWidth: minWidth !== void 0 ? `${minWidth}px` : void 0,
|
|
4187
4243
|
border: borderColor ? `1px solid var(--color-${borderColor})` : void 0,
|
|
4244
|
+
borderTop: borderTopColor ? `1px solid var(--color-${borderTopColor})` : void 0,
|
|
4245
|
+
borderRight: borderRightColor ? `1px solid var(--color-${borderRightColor})` : void 0,
|
|
4246
|
+
borderBottom: borderBottomColor ? `1px solid var(--color-${borderBottomColor})` : void 0,
|
|
4247
|
+
borderLeft: borderLeftColor ? `1px solid var(--color-${borderLeftColor})` : void 0,
|
|
4188
4248
|
backgroundColor: backgroundColor ? `var(--color-${backgroundColor})` : void 0,
|
|
4189
4249
|
flexGrow: flexGrow !== void 0 ? flexGrow : void 0,
|
|
4190
4250
|
flexShrink: flexShrink !== void 0 ? flexShrink : void 0,
|
|
@@ -4224,6 +4284,22 @@ var Stack = (_a) => {
|
|
|
4224
4284
|
paddingY && sizing === "layout" && "py-mobile-layout-padding desktop:py-desktop-layout-padding compact:py-desktop-compact-layout-padding",
|
|
4225
4285
|
paddingY && sizing === "layout-group" && paddingYUsingLayoutGroupGap,
|
|
4226
4286
|
paddingY && sizing === "component" && "py-mobile-component-padding desktop:py-desktop-component-padding compact:py-desktop-compact-component-padding",
|
|
4287
|
+
paddingBottom && sizing === "container" && "pb-mobile-container-padding desktop:pb-desktop-container-padding compact:pb-desktop-compact-container-padding",
|
|
4288
|
+
paddingBottom && sizing === "layout" && "pb-mobile-layout-padding desktop:pb-desktop-layout-padding compact:pb-desktop-compact-layout-padding",
|
|
4289
|
+
paddingBottom && sizing === "layout-group" && "pb-mobile-layout-group-padding desktop:pb-desktop-layout-group-padding compact:pb-desktop-compact-layout-group-padding",
|
|
4290
|
+
paddingBottom && sizing === "component" && "pb-mobile-component-padding desktop:pb-desktop-component-padding compact:pb-desktop-compact-component-padding",
|
|
4291
|
+
paddingTop && sizing === "container" && "pt-mobile-container-padding desktop:pt-desktop-container-padding compact:pt-desktop-compact-container-padding",
|
|
4292
|
+
paddingTop && sizing === "layout" && "pt-mobile-layout-padding desktop:pt-desktop-layout-padding compact:pt-desktop-compact-layout-padding",
|
|
4293
|
+
paddingTop && sizing === "layout-group" && "pt-mobile-layout-group-padding desktop:pt-desktop-layout-group-padding compact:pt-desktop-compact-layout-group-padding",
|
|
4294
|
+
paddingTop && sizing === "component" && "pt-mobile-component-padding desktop:pt-desktop-component-padding compact:pt-desktop-compact-component-padding",
|
|
4295
|
+
paddingLeft && sizing === "container" && "pl-mobile-container-padding desktop:pl-desktop-container-padding compact:pl-desktop-compact-container-padding",
|
|
4296
|
+
paddingLeft && sizing === "layout" && "pl-mobile-layout-padding desktop:pl-desktop-layout-padding compact:pl-desktop-compact-layout-padding",
|
|
4297
|
+
paddingLeft && sizing === "layout-group" && "pl-mobile-layout-group-padding desktop:pl-desktop-layout-group-padding compact:pl-desktop-compact-layout-group-padding",
|
|
4298
|
+
paddingLeft && sizing === "component" && "pl-mobile-component-padding desktop:pl-desktop-component-padding compact:pl-desktop-compact-component-padding",
|
|
4299
|
+
paddingRight && sizing === "container" && "pr-mobile-container-padding desktop:pr-desktop-container-padding compact:pr-desktop-compact-container-padding",
|
|
4300
|
+
paddingRight && sizing === "layout" && "pr-mobile-layout-padding desktop:pr-desktop-layout-padding compact:pr-desktop-compact-layout-padding",
|
|
4301
|
+
paddingRight && sizing === "layout-group" && "pr-mobile-layout-group-padding desktop:pr-desktop-layout-group-padding compact:pr-desktop-compact-layout-group-padding",
|
|
4302
|
+
paddingRight && sizing === "component" && "pr-mobile-component-padding desktop:pr-desktop-component-padding compact:pr-desktop-compact-component-padding",
|
|
4227
4303
|
margin && sizing === "container" && "m-mobile-container-padding desktop:m-desktop-container-padding compact:m-compact-container-padding",
|
|
4228
4304
|
marginX && sizing === "container" && "mx-mobile-container-padding desktop:mx-desktop-container-padding compact:mx-compact-container-padding",
|
|
4229
4305
|
marginTop && sizing === "container" && "mt-mobile-container-padding desktop:mt-desktop-container-padding compact:mt-compact-container-padding",
|
|
@@ -5581,101 +5657,77 @@ function Thumbnail({
|
|
|
5581
5657
|
}
|
|
5582
5658
|
|
|
5583
5659
|
// src/components/Grid.tsx
|
|
5584
|
-
var import_react27 = require("react");
|
|
5585
5660
|
var import_clsx30 = __toESM(require("clsx"), 1);
|
|
5586
5661
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
5587
|
-
var
|
|
5588
|
-
|
|
5589
|
-
|
|
5590
|
-
|
|
5591
|
-
|
|
5592
|
-
|
|
5593
|
-
6: "sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4",
|
|
5594
|
-
7: "sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-6",
|
|
5595
|
-
8: "sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-6",
|
|
5596
|
-
9: "sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-6",
|
|
5597
|
-
10: "sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-6",
|
|
5598
|
-
11: "sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-8",
|
|
5599
|
-
12: "sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-8"
|
|
5600
|
-
};
|
|
5601
|
-
var COLUMNS_WITHOUT_SIDE_MENU_MAP = {
|
|
5602
|
-
1: "grid-cols-1",
|
|
5603
|
-
2: "sm:grid-cols-2",
|
|
5604
|
-
3: "sm:grid-cols-2 md:grid-cols-3",
|
|
5605
|
-
4: "sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4",
|
|
5606
|
-
5: "sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5",
|
|
5607
|
-
6: "sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6",
|
|
5608
|
-
7: "sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6 2xl:grid-cols-7",
|
|
5609
|
-
8: "sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6 2xl:grid-cols-8",
|
|
5610
|
-
9: "sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6 2xl:grid-cols-9",
|
|
5611
|
-
10: "sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-8 2xl:grid-cols-10",
|
|
5612
|
-
11: "sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-8 2xl:grid-cols-11",
|
|
5613
|
-
12: "sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-8 2xl:grid-cols-12"
|
|
5662
|
+
var GAP_BY_SIZING = {
|
|
5663
|
+
none: "gap-0",
|
|
5664
|
+
"layout-group": "gap-mobile-layout-group-gap desktop:gap-desktop-layout-group-gap compact:gap-compact-layout-group-gap",
|
|
5665
|
+
layout: "gap-mobile-layout-gap desktop:gap-desktop-layout-gap compact:gap-compact-layout-gap",
|
|
5666
|
+
container: "gap-mobile-container-gap desktop:gap-desktop-container-gap compact:gap-compact-container-gap",
|
|
5667
|
+
component: "gap-mobile-component-gap desktop:gap-desktop-component-gap compact:gap-compact-component-gap"
|
|
5614
5668
|
};
|
|
5615
|
-
var
|
|
5616
|
-
|
|
5617
|
-
|
|
5618
|
-
|
|
5619
|
-
|
|
5620
|
-
|
|
5621
|
-
return "sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-6";
|
|
5622
|
-
}
|
|
5623
|
-
if (childCount <= 1) return "grid-cols-1";
|
|
5624
|
-
if (childCount <= 2) return "sm:grid-cols-2";
|
|
5625
|
-
if (childCount === 3) return "sm:grid-cols-2 md:grid-cols-3";
|
|
5626
|
-
if (childCount <= 5) return "sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4";
|
|
5627
|
-
if (childCount <= 6)
|
|
5628
|
-
return "sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6";
|
|
5629
|
-
if (childCount === 7)
|
|
5630
|
-
return "sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6";
|
|
5631
|
-
if (childCount <= 11)
|
|
5632
|
-
return "sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6 2xl:grid-cols-8";
|
|
5633
|
-
return "sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-8 2xl:grid-cols-12";
|
|
5669
|
+
var PADDING_BY_SIZING = {
|
|
5670
|
+
none: "p-0",
|
|
5671
|
+
container: "p-mobile-container-padding desktop:p-desktop-container-padding compact:p-desktop-compact-container-padding",
|
|
5672
|
+
layout: "p-mobile-layout-padding desktop:p-desktop-layout-padding compact:p-desktop-compact-layout-padding",
|
|
5673
|
+
"layout-group": "p-mobile-layout-group-padding desktop:p-desktop-layout-group-padding compact:p-desktop-compact-layout-group-padding",
|
|
5674
|
+
component: "p-mobile-component-padding desktop:p-desktop-component-padding compact:p-desktop-compact-component-padding"
|
|
5634
5675
|
};
|
|
5635
|
-
var
|
|
5636
|
-
|
|
5637
|
-
if (
|
|
5638
|
-
|
|
5639
|
-
|
|
5676
|
+
var buildColumnClasses = (base, responsive) => {
|
|
5677
|
+
const classes = [`grid-cols-${base}`];
|
|
5678
|
+
if (responsive) {
|
|
5679
|
+
Object.entries(responsive).forEach(([bp, value]) => {
|
|
5680
|
+
if (value && value > 0) classes.push(`${bp}:grid-cols-${value}`);
|
|
5681
|
+
});
|
|
5640
5682
|
}
|
|
5641
|
-
return
|
|
5683
|
+
return classes.join(" ");
|
|
5642
5684
|
};
|
|
5643
|
-
var Grid = ({
|
|
5644
|
-
|
|
5645
|
-
|
|
5646
|
-
|
|
5647
|
-
|
|
5648
|
-
|
|
5649
|
-
|
|
5650
|
-
|
|
5651
|
-
|
|
5652
|
-
|
|
5653
|
-
|
|
5685
|
+
var Grid = (_a) => {
|
|
5686
|
+
var _b = _a, {
|
|
5687
|
+
children,
|
|
5688
|
+
sizing = "container",
|
|
5689
|
+
padding,
|
|
5690
|
+
columns,
|
|
5691
|
+
responsive,
|
|
5692
|
+
id,
|
|
5693
|
+
testid,
|
|
5694
|
+
style,
|
|
5695
|
+
className
|
|
5696
|
+
} = _b, rest = __objRest(_b, [
|
|
5697
|
+
"children",
|
|
5698
|
+
"sizing",
|
|
5699
|
+
"padding",
|
|
5700
|
+
"columns",
|
|
5701
|
+
"responsive",
|
|
5702
|
+
"id",
|
|
5703
|
+
"testid",
|
|
5704
|
+
"style",
|
|
5705
|
+
"className"
|
|
5706
|
+
]);
|
|
5707
|
+
var _a2, _b2;
|
|
5708
|
+
const columnClasses = buildColumnClasses(columns, responsive);
|
|
5654
5709
|
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5655
5710
|
"div",
|
|
5656
|
-
{
|
|
5711
|
+
__spreadProps(__spreadValues({
|
|
5657
5712
|
id,
|
|
5658
5713
|
"data-testid": testid,
|
|
5714
|
+
style
|
|
5715
|
+
}, rest), {
|
|
5659
5716
|
className: (0, import_clsx30.default)(
|
|
5660
|
-
padding && sizing === "container" && "p-mobile-container-padding desktop:p-desktop-container-padding compact:p-desktop-compact-container-padding",
|
|
5661
|
-
padding && sizing === "layout" && "p-mobile-layout-padding desktop:p-desktop-layout-padding compact:p-desktop-compact-layout-padding",
|
|
5662
|
-
padding && sizing === "layout-group" && "p-mobile-layout-group-padding desktop:p-desktop-layout-group-padding compact:p-desktop-compact-layout-group-padding",
|
|
5663
|
-
padding && sizing === "component" && "p-mobile-component-padding desktop:p-desktop-component-padding compact:p-desktop-compact-component-padding",
|
|
5664
|
-
sizing === "layout-group" && "gap-mobile-layout-group-gap desktop:gap-desktop-layout-group-gap compact:gap-compact-layout-group-gap",
|
|
5665
|
-
sizing === "layout" && "gap-mobile-layout-gap desktop:gap-desktop-layout-gap compact:gap-compact-layout-gap",
|
|
5666
|
-
sizing === "container" && "gap-mobile-container-gap desktop:gap-desktop-container-gap compact:gap-compact-container-gap",
|
|
5667
|
-
sizing === "component" && "gap-mobile-component-gap desktop:gap-desktop-component-gap compact:gap-compact-component-gap",
|
|
5668
5717
|
"w-full grid",
|
|
5669
|
-
|
|
5718
|
+
(_a2 = GAP_BY_SIZING[sizing]) != null ? _a2 : GAP_BY_SIZING.container,
|
|
5719
|
+
padding && ((_b2 = PADDING_BY_SIZING[sizing]) != null ? _b2 : PADDING_BY_SIZING.container),
|
|
5720
|
+
columnClasses,
|
|
5721
|
+
"grid-cols-1 desktop:grid-cols-4",
|
|
5722
|
+
className
|
|
5670
5723
|
),
|
|
5671
|
-
style,
|
|
5672
5724
|
children
|
|
5673
|
-
}
|
|
5725
|
+
})
|
|
5674
5726
|
);
|
|
5675
5727
|
};
|
|
5676
5728
|
|
|
5677
5729
|
// src/components/ProductImagePreview/ProductPrimaryImage.tsx
|
|
5678
|
-
var
|
|
5730
|
+
var import_react27 = require("react");
|
|
5679
5731
|
|
|
5680
5732
|
// src/components/Spinner.tsx
|
|
5681
5733
|
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
@@ -5721,14 +5773,14 @@ function ProductPrimaryImage({
|
|
|
5721
5773
|
onZoomPositionChange,
|
|
5722
5774
|
onScrollZoom
|
|
5723
5775
|
}) {
|
|
5724
|
-
const containerRef = (0,
|
|
5725
|
-
const lastPointRef = (0,
|
|
5726
|
-
const rafRef = (0,
|
|
5727
|
-
const [active, setActive] = (0,
|
|
5728
|
-
const [, forceRerender] = (0,
|
|
5729
|
-
const [imageLoading, setImageLoading] = (0,
|
|
5730
|
-
const [imageError, setImageError] = (0,
|
|
5731
|
-
const imageSrc = (0,
|
|
5776
|
+
const containerRef = (0, import_react27.useRef)(null);
|
|
5777
|
+
const lastPointRef = (0, import_react27.useRef)(null);
|
|
5778
|
+
const rafRef = (0, import_react27.useRef)(null);
|
|
5779
|
+
const [active, setActive] = (0, import_react27.useState)(false);
|
|
5780
|
+
const [, forceRerender] = (0, import_react27.useState)(0);
|
|
5781
|
+
const [imageLoading, setImageLoading] = (0, import_react27.useState)(true);
|
|
5782
|
+
const [imageError, setImageError] = (0, import_react27.useState)(false);
|
|
5783
|
+
const imageSrc = (0, import_react27.useMemo)(() => image == null ? void 0 : image.src, [image == null ? void 0 : image.src]);
|
|
5732
5784
|
const schedule = () => {
|
|
5733
5785
|
if (rafRef.current != null) return;
|
|
5734
5786
|
rafRef.current = requestAnimationFrame(() => {
|
|
@@ -5736,7 +5788,7 @@ function ProductPrimaryImage({
|
|
|
5736
5788
|
forceRerender((n) => n + 1);
|
|
5737
5789
|
});
|
|
5738
5790
|
};
|
|
5739
|
-
const handlePointerEnter = (0,
|
|
5791
|
+
const handlePointerEnter = (0, import_react27.useCallback)(() => {
|
|
5740
5792
|
if (!zoomEnabled) return;
|
|
5741
5793
|
setActive(true);
|
|
5742
5794
|
const el = containerRef.current;
|
|
@@ -5749,13 +5801,13 @@ function ProductPrimaryImage({
|
|
|
5749
5801
|
);
|
|
5750
5802
|
}
|
|
5751
5803
|
}, [zoomEnabled, onZoomPositionChange, zoomLensSize]);
|
|
5752
|
-
const handlePointerLeave = (0,
|
|
5804
|
+
const handlePointerLeave = (0, import_react27.useCallback)(() => {
|
|
5753
5805
|
if (!zoomEnabled) return;
|
|
5754
5806
|
setActive(false);
|
|
5755
5807
|
lastPointRef.current = null;
|
|
5756
5808
|
onZoomPositionChange == null ? void 0 : onZoomPositionChange(null, false);
|
|
5757
5809
|
}, [zoomEnabled, onZoomPositionChange]);
|
|
5758
|
-
const handlePointerMove = (0,
|
|
5810
|
+
const handlePointerMove = (0, import_react27.useCallback)(
|
|
5759
5811
|
(e) => {
|
|
5760
5812
|
if (!zoomEnabled || !active || imageError) return;
|
|
5761
5813
|
if (e.pointerType === "touch") return;
|
|
@@ -5791,7 +5843,7 @@ function ProductPrimaryImage({
|
|
|
5791
5843
|
},
|
|
5792
5844
|
[zoomEnabled, active, imageError, zoomLensSize, onZoomPositionChange]
|
|
5793
5845
|
);
|
|
5794
|
-
(0,
|
|
5846
|
+
(0, import_react27.useEffect)(() => {
|
|
5795
5847
|
const container = containerRef.current;
|
|
5796
5848
|
if (!container || !scrollToZoomEnabled) return;
|
|
5797
5849
|
const handleNativeWheel = (e) => {
|
|
@@ -5806,7 +5858,7 @@ function ProductPrimaryImage({
|
|
|
5806
5858
|
container.removeEventListener("wheel", handleNativeWheel);
|
|
5807
5859
|
};
|
|
5808
5860
|
}, [scrollToZoomEnabled, zoomEnabled, active, onScrollZoom]);
|
|
5809
|
-
(0,
|
|
5861
|
+
(0, import_react27.useEffect)(() => {
|
|
5810
5862
|
setImageLoading(true);
|
|
5811
5863
|
setImageError(false);
|
|
5812
5864
|
}, [image]);
|
|
@@ -5875,7 +5927,7 @@ function ProductPrimaryImage({
|
|
|
5875
5927
|
}
|
|
5876
5928
|
|
|
5877
5929
|
// src/components/ProductImagePreview/ZoomWindow.tsx
|
|
5878
|
-
var
|
|
5930
|
+
var import_react28 = require("react");
|
|
5879
5931
|
|
|
5880
5932
|
// src/components/Surface.tsx
|
|
5881
5933
|
var import_clsx31 = __toESM(require("clsx"), 1);
|
|
@@ -5926,7 +5978,7 @@ function ZoomWindow({
|
|
|
5926
5978
|
offset = 10,
|
|
5927
5979
|
className = ""
|
|
5928
5980
|
}) {
|
|
5929
|
-
const imageSrc = (0,
|
|
5981
|
+
const imageSrc = (0, import_react28.useMemo)(() => image == null ? void 0 : image.src, [image == null ? void 0 : image.src]);
|
|
5930
5982
|
if (!image || !active || !pointer) return null;
|
|
5931
5983
|
const zoomWindowSize = pointer.lensSize * scaleFactor;
|
|
5932
5984
|
const baseW = pointer.w || width;
|
|
@@ -6055,7 +6107,7 @@ function CarouselPagination({
|
|
|
6055
6107
|
}
|
|
6056
6108
|
|
|
6057
6109
|
// src/components/ProductImagePreview/MobileImageCarousel.tsx
|
|
6058
|
-
var
|
|
6110
|
+
var import_react29 = require("react");
|
|
6059
6111
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
6060
6112
|
function MobileImageCarousel({
|
|
6061
6113
|
images,
|
|
@@ -6065,15 +6117,15 @@ function MobileImageCarousel({
|
|
|
6065
6117
|
onChangeIndex,
|
|
6066
6118
|
className = ""
|
|
6067
6119
|
}) {
|
|
6068
|
-
const containerRef = (0,
|
|
6069
|
-
const [isDragging, setIsDragging] = (0,
|
|
6070
|
-
const [startX, setStartX] = (0,
|
|
6071
|
-
const [currentTranslate, setCurrentTranslate] = (0,
|
|
6072
|
-
const [prevTranslate, setPrevTranslate] = (0,
|
|
6073
|
-
const [containerWidth, setContainerWidth] = (0,
|
|
6120
|
+
const containerRef = (0, import_react29.useRef)(null);
|
|
6121
|
+
const [isDragging, setIsDragging] = (0, import_react29.useState)(false);
|
|
6122
|
+
const [startX, setStartX] = (0, import_react29.useState)(0);
|
|
6123
|
+
const [currentTranslate, setCurrentTranslate] = (0, import_react29.useState)(0);
|
|
6124
|
+
const [prevTranslate, setPrevTranslate] = (0, import_react29.useState)(0);
|
|
6125
|
+
const [containerWidth, setContainerWidth] = (0, import_react29.useState)(width);
|
|
6074
6126
|
const imageSize = Math.min(containerWidth * 0.6, height * 0.6);
|
|
6075
6127
|
const gap = 16;
|
|
6076
|
-
const getTranslateX = (0,
|
|
6128
|
+
const getTranslateX = (0, import_react29.useCallback)(
|
|
6077
6129
|
(index) => {
|
|
6078
6130
|
const containerCenter = containerWidth / 2;
|
|
6079
6131
|
const imageCenter = imageSize / 2;
|
|
@@ -6082,12 +6134,12 @@ function MobileImageCarousel({
|
|
|
6082
6134
|
},
|
|
6083
6135
|
[containerWidth, imageSize, gap]
|
|
6084
6136
|
);
|
|
6085
|
-
(0,
|
|
6137
|
+
(0, import_react29.useEffect)(() => {
|
|
6086
6138
|
const translateX = getTranslateX(currentIndex);
|
|
6087
6139
|
setCurrentTranslate(translateX);
|
|
6088
6140
|
setPrevTranslate(translateX);
|
|
6089
6141
|
}, [currentIndex, getTranslateX]);
|
|
6090
|
-
(0,
|
|
6142
|
+
(0, import_react29.useEffect)(() => {
|
|
6091
6143
|
const updateContainerWidth = () => {
|
|
6092
6144
|
if (containerRef.current) {
|
|
6093
6145
|
const rect = containerRef.current.getBoundingClientRect();
|
|
@@ -6101,11 +6153,11 @@ function MobileImageCarousel({
|
|
|
6101
6153
|
}
|
|
6102
6154
|
return () => resizeObserver.disconnect();
|
|
6103
6155
|
}, []);
|
|
6104
|
-
const handleStart = (0,
|
|
6156
|
+
const handleStart = (0, import_react29.useCallback)((clientX) => {
|
|
6105
6157
|
setIsDragging(true);
|
|
6106
6158
|
setStartX(clientX);
|
|
6107
6159
|
}, []);
|
|
6108
|
-
const handleMove = (0,
|
|
6160
|
+
const handleMove = (0, import_react29.useCallback)(
|
|
6109
6161
|
(clientX) => {
|
|
6110
6162
|
if (!isDragging) return;
|
|
6111
6163
|
const currentPosition = clientX;
|
|
@@ -6114,7 +6166,7 @@ function MobileImageCarousel({
|
|
|
6114
6166
|
},
|
|
6115
6167
|
[isDragging, startX, prevTranslate]
|
|
6116
6168
|
);
|
|
6117
|
-
const handleEnd = (0,
|
|
6169
|
+
const handleEnd = (0, import_react29.useCallback)(() => {
|
|
6118
6170
|
if (!isDragging) return;
|
|
6119
6171
|
setIsDragging(false);
|
|
6120
6172
|
const moved = currentTranslate - prevTranslate;
|
|
@@ -6162,7 +6214,7 @@ function MobileImageCarousel({
|
|
|
6162
6214
|
const handleTouchEnd = () => {
|
|
6163
6215
|
handleEnd();
|
|
6164
6216
|
};
|
|
6165
|
-
const handleImageClick = (0,
|
|
6217
|
+
const handleImageClick = (0, import_react29.useCallback)(
|
|
6166
6218
|
(index) => {
|
|
6167
6219
|
if (!isDragging && index !== currentIndex) {
|
|
6168
6220
|
onChangeIndex(index);
|
|
@@ -6242,7 +6294,7 @@ function MobileImageCarousel({
|
|
|
6242
6294
|
}
|
|
6243
6295
|
|
|
6244
6296
|
// src/components/ProductImagePreview/useProductImagePreview.ts
|
|
6245
|
-
var
|
|
6297
|
+
var import_react30 = require("react");
|
|
6246
6298
|
function useProductImagePreview(props) {
|
|
6247
6299
|
const {
|
|
6248
6300
|
images,
|
|
@@ -6255,18 +6307,18 @@ function useProductImagePreview(props) {
|
|
|
6255
6307
|
} = props;
|
|
6256
6308
|
const hasImages = !!(images == null ? void 0 : images.length);
|
|
6257
6309
|
const safeIndex = hasImages && currentIndex >= 0 && currentIndex < images.length ? currentIndex : 0;
|
|
6258
|
-
const active = (0,
|
|
6310
|
+
const active = (0, import_react30.useMemo)(() => {
|
|
6259
6311
|
return hasImages ? images[safeIndex] : void 0;
|
|
6260
6312
|
}, [hasImages, images, safeIndex]);
|
|
6261
|
-
const [zoomPoint, setZoomPoint] = (0,
|
|
6262
|
-
const [zoomActive, setZoomActive] = (0,
|
|
6263
|
-
const [currentZoomFactor, setCurrentZoomFactor] = (0,
|
|
6264
|
-
const [primaryImagePosition, setPrimaryImagePosition] = (0,
|
|
6265
|
-
const primaryImageRef = (0,
|
|
6266
|
-
const cleanupRef = (0,
|
|
6313
|
+
const [zoomPoint, setZoomPoint] = (0, import_react30.useState)(null);
|
|
6314
|
+
const [zoomActive, setZoomActive] = (0, import_react30.useState)(false);
|
|
6315
|
+
const [currentZoomFactor, setCurrentZoomFactor] = (0, import_react30.useState)(zoomFactor);
|
|
6316
|
+
const [primaryImagePosition, setPrimaryImagePosition] = (0, import_react30.useState)(null);
|
|
6317
|
+
const primaryImageRef = (0, import_react30.useRef)(null);
|
|
6318
|
+
const cleanupRef = (0, import_react30.useRef)(null);
|
|
6267
6319
|
const effectiveZoomEnabled = zoomEnabled && !isMobile;
|
|
6268
6320
|
const effectiveScrollToZoomEnabled = scrollToZoomEnabled && !isMobile;
|
|
6269
|
-
(0,
|
|
6321
|
+
(0, import_react30.useEffect)(() => {
|
|
6270
6322
|
if (!effectiveZoomEnabled) return;
|
|
6271
6323
|
const setupTracking = () => {
|
|
6272
6324
|
const element = primaryImageRef.current;
|
|
@@ -6300,24 +6352,24 @@ function useProductImagePreview(props) {
|
|
|
6300
6352
|
}
|
|
6301
6353
|
};
|
|
6302
6354
|
}, [effectiveZoomEnabled]);
|
|
6303
|
-
const handleSelect = (0,
|
|
6355
|
+
const handleSelect = (0, import_react30.useCallback)(
|
|
6304
6356
|
(idx) => {
|
|
6305
6357
|
if (idx === safeIndex) return;
|
|
6306
6358
|
onChangeIndex(idx);
|
|
6307
6359
|
},
|
|
6308
6360
|
[safeIndex, onChangeIndex]
|
|
6309
6361
|
);
|
|
6310
|
-
const handleNext = (0,
|
|
6362
|
+
const handleNext = (0, import_react30.useCallback)(() => {
|
|
6311
6363
|
if (!hasImages) return;
|
|
6312
6364
|
const nextIndex = (safeIndex + 1) % images.length;
|
|
6313
6365
|
onChangeIndex(nextIndex);
|
|
6314
6366
|
}, [hasImages, safeIndex, images.length, onChangeIndex]);
|
|
6315
|
-
const handlePrevious = (0,
|
|
6367
|
+
const handlePrevious = (0, import_react30.useCallback)(() => {
|
|
6316
6368
|
if (!hasImages) return;
|
|
6317
6369
|
const previousIndex = safeIndex === 0 ? images.length - 1 : safeIndex - 1;
|
|
6318
6370
|
onChangeIndex(previousIndex);
|
|
6319
6371
|
}, [hasImages, safeIndex, images.length, onChangeIndex]);
|
|
6320
|
-
const handleZoomPositionChange = (0,
|
|
6372
|
+
const handleZoomPositionChange = (0, import_react30.useCallback)(
|
|
6321
6373
|
(p, active2) => {
|
|
6322
6374
|
if (isMobile) return;
|
|
6323
6375
|
setZoomPoint(p);
|
|
@@ -6325,7 +6377,7 @@ function useProductImagePreview(props) {
|
|
|
6325
6377
|
},
|
|
6326
6378
|
[isMobile]
|
|
6327
6379
|
);
|
|
6328
|
-
const handleScrollZoom = (0,
|
|
6380
|
+
const handleScrollZoom = (0, import_react30.useCallback)(
|
|
6329
6381
|
(delta) => {
|
|
6330
6382
|
if (!effectiveScrollToZoomEnabled) return;
|
|
6331
6383
|
const newZoomFactor = Math.max(1, Math.min(5, currentZoomFactor + delta));
|
|
@@ -6333,7 +6385,7 @@ function useProductImagePreview(props) {
|
|
|
6333
6385
|
},
|
|
6334
6386
|
[effectiveScrollToZoomEnabled, currentZoomFactor]
|
|
6335
6387
|
);
|
|
6336
|
-
(0,
|
|
6388
|
+
(0, import_react30.useEffect)(() => {
|
|
6337
6389
|
setCurrentZoomFactor(zoomFactor);
|
|
6338
6390
|
}, [zoomFactor]);
|
|
6339
6391
|
return {
|
|
@@ -6497,7 +6549,7 @@ function ProductImagePreview(props) {
|
|
|
6497
6549
|
}
|
|
6498
6550
|
|
|
6499
6551
|
// src/components/CompactImagesPreview.tsx
|
|
6500
|
-
var
|
|
6552
|
+
var import_react31 = require("react");
|
|
6501
6553
|
var import_clsx33 = __toESM(require("clsx"), 1);
|
|
6502
6554
|
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
6503
6555
|
function CompactImagesPreview(props) {
|
|
@@ -6510,11 +6562,23 @@ function CompactImagesPreview(props) {
|
|
|
6510
6562
|
thumbnailHeight = 30,
|
|
6511
6563
|
enableThumbnailBorder = false,
|
|
6512
6564
|
placeholderImageUri,
|
|
6513
|
-
|
|
6565
|
+
placeholderAlt = "placeholder image",
|
|
6566
|
+
onChangeSource,
|
|
6567
|
+
onMainImageClick
|
|
6514
6568
|
} = props;
|
|
6515
6569
|
const isMobile = useMatchesMobile();
|
|
6516
6570
|
const imagesCount = sources.length;
|
|
6517
|
-
const
|
|
6571
|
+
const handleImgError = (0, import_react31.useCallback)(
|
|
6572
|
+
(e) => {
|
|
6573
|
+
if (!placeholderImageUri) return;
|
|
6574
|
+
const img = e.currentTarget;
|
|
6575
|
+
if (img.src === placeholderImageUri) return;
|
|
6576
|
+
img.src = placeholderImageUri;
|
|
6577
|
+
if (!img.alt) img.alt = placeholderAlt;
|
|
6578
|
+
},
|
|
6579
|
+
[placeholderImageUri, placeholderAlt]
|
|
6580
|
+
);
|
|
6581
|
+
const handleThumbnailClick = (0, import_react31.useCallback)(
|
|
6518
6582
|
(newIndex) => {
|
|
6519
6583
|
if (newIndex === currentSourceIndex) return;
|
|
6520
6584
|
if (newIndex < 0 || newIndex >= imagesCount) return;
|
|
@@ -6534,7 +6598,9 @@ function CompactImagesPreview(props) {
|
|
|
6534
6598
|
objectFit: "cover"
|
|
6535
6599
|
},
|
|
6536
6600
|
src: placeholderImageUri,
|
|
6537
|
-
alt:
|
|
6601
|
+
alt: placeholderAlt,
|
|
6602
|
+
onError: handleImgError,
|
|
6603
|
+
onClick: onMainImageClick
|
|
6538
6604
|
}
|
|
6539
6605
|
);
|
|
6540
6606
|
const currentSource = sources[currentSourceIndex];
|
|
@@ -6542,6 +6608,7 @@ function CompactImagesPreview(props) {
|
|
|
6542
6608
|
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
6543
6609
|
"img",
|
|
6544
6610
|
{
|
|
6611
|
+
className: (0, import_clsx33.default)("object-center", onMainImageClick && "cursor-pointer"),
|
|
6545
6612
|
style: {
|
|
6546
6613
|
width: isMobile ? "100%" : activeImageWidth,
|
|
6547
6614
|
height: activeImageHeight,
|
|
@@ -6549,10 +6616,12 @@ function CompactImagesPreview(props) {
|
|
|
6549
6616
|
objectFit: "cover"
|
|
6550
6617
|
},
|
|
6551
6618
|
src: currentSource.uri,
|
|
6552
|
-
alt: currentSource.name
|
|
6619
|
+
alt: currentSource.name,
|
|
6620
|
+
onError: handleImgError,
|
|
6621
|
+
onClick: onMainImageClick
|
|
6553
6622
|
}
|
|
6554
6623
|
),
|
|
6555
|
-
|
|
6624
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "flex flex-row flex-wrap items-center gap-3", children: sources.map((source, index) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
6556
6625
|
"button",
|
|
6557
6626
|
{
|
|
6558
6627
|
onClick: (e) => {
|
|
@@ -6573,7 +6642,8 @@ function CompactImagesPreview(props) {
|
|
|
6573
6642
|
height: thumbnailHeight,
|
|
6574
6643
|
objectPosition: "center",
|
|
6575
6644
|
objectFit: "cover"
|
|
6576
|
-
}
|
|
6645
|
+
},
|
|
6646
|
+
onError: handleImgError
|
|
6577
6647
|
}
|
|
6578
6648
|
)
|
|
6579
6649
|
},
|
|
@@ -6581,6 +6651,540 @@ function CompactImagesPreview(props) {
|
|
|
6581
6651
|
)) })
|
|
6582
6652
|
] });
|
|
6583
6653
|
}
|
|
6654
|
+
|
|
6655
|
+
// src/components/SimpleTable.tsx
|
|
6656
|
+
var import_clsx34 = __toESM(require("clsx"), 1);
|
|
6657
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
6658
|
+
function SimpleTable({
|
|
6659
|
+
columns,
|
|
6660
|
+
data,
|
|
6661
|
+
additionalRows
|
|
6662
|
+
}) {
|
|
6663
|
+
const allRows = additionalRows && additionalRows.length > 0 ? [...data, ...additionalRows] : data;
|
|
6664
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Stack, { elevation: 4, rounded: true, overflowX: "hidden", overflowY: "hidden", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("table", { className: "w-full border-collapse text-left text-sm border overflow-hidden rounded border-border-primary-normal", children: [
|
|
6665
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("tr", { className: "bg-background-primary-normal divide-x divide-border-primary-normal", children: columns.map((column, index) => {
|
|
6666
|
+
var _a, _b;
|
|
6667
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
6668
|
+
"th",
|
|
6669
|
+
{
|
|
6670
|
+
scope: "col",
|
|
6671
|
+
className: (0, import_clsx34.default)(
|
|
6672
|
+
"p-mobile-layout-padding desktop:p-desktop-layout-padding font-semibold text-text-primary-normal",
|
|
6673
|
+
((_a = column.meta) == null ? void 0 : _a.headerWidth) ? column.meta.headerWidth : "w-2/3"
|
|
6674
|
+
),
|
|
6675
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Subheader, { children: (_b = column.header) == null ? void 0 : _b.toString() })
|
|
6676
|
+
},
|
|
6677
|
+
index
|
|
6678
|
+
);
|
|
6679
|
+
}) }) }),
|
|
6680
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("tbody", { children: allRows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
6681
|
+
"tr",
|
|
6682
|
+
{
|
|
6683
|
+
className: "border-t border-border-primary-normal divide-x divide-border-primary-normal",
|
|
6684
|
+
children: columns.map((column, colIndex) => {
|
|
6685
|
+
var _a;
|
|
6686
|
+
const rawValue = column.id ? row[column.id] : null;
|
|
6687
|
+
const cellValue = rawValue != null ? rawValue : null;
|
|
6688
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
6689
|
+
"td",
|
|
6690
|
+
{
|
|
6691
|
+
className: (0, import_clsx34.default)(
|
|
6692
|
+
"p-mobile-layout-padding desktop:p-desktop-layout-padding align-middle text-text-primary-normal",
|
|
6693
|
+
(_a = column.meta) == null ? void 0 : _a.headerWidth
|
|
6694
|
+
),
|
|
6695
|
+
children: cellValue !== null && cellValue !== void 0 ? typeof cellValue === "string" || typeof cellValue === "number" ? cellValue.toString() : cellValue : ""
|
|
6696
|
+
},
|
|
6697
|
+
colIndex
|
|
6698
|
+
);
|
|
6699
|
+
})
|
|
6700
|
+
},
|
|
6701
|
+
rowIndex
|
|
6702
|
+
)) })
|
|
6703
|
+
] }) });
|
|
6704
|
+
}
|
|
6705
|
+
|
|
6706
|
+
// src/components/PDFViewer/index.tsx
|
|
6707
|
+
var import_react34 = require("react");
|
|
6708
|
+
|
|
6709
|
+
// src/components/PDFViewer/PDFElement.tsx
|
|
6710
|
+
var import_react_pdf2 = require("@mikecousins/react-pdf");
|
|
6711
|
+
var import_react33 = require("react");
|
|
6712
|
+
|
|
6713
|
+
// src/components/PDFViewer/PDFPage.tsx
|
|
6714
|
+
var import_react_pdf = require("@mikecousins/react-pdf");
|
|
6715
|
+
var import_react32 = require("react");
|
|
6716
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
6717
|
+
function PdfPage({
|
|
6718
|
+
file,
|
|
6719
|
+
pageNumber,
|
|
6720
|
+
testid,
|
|
6721
|
+
isMobile
|
|
6722
|
+
}) {
|
|
6723
|
+
const canvasRef = (0, import_react32.useRef)(null);
|
|
6724
|
+
const { pdfDocument } = (0, import_react_pdf.usePdf)({
|
|
6725
|
+
file,
|
|
6726
|
+
page: pageNumber,
|
|
6727
|
+
canvasRef,
|
|
6728
|
+
workerSrc: "/scripts/pdf.worker.min.mjs",
|
|
6729
|
+
scale: isMobile ? 1 : 1.3
|
|
6730
|
+
});
|
|
6731
|
+
if (!pdfDocument) return null;
|
|
6732
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
6733
|
+
"canvas",
|
|
6734
|
+
{
|
|
6735
|
+
ref: canvasRef,
|
|
6736
|
+
"data-testid": testid,
|
|
6737
|
+
style: { width: "100%", height: "auto" }
|
|
6738
|
+
}
|
|
6739
|
+
);
|
|
6740
|
+
}
|
|
6741
|
+
|
|
6742
|
+
// src/components/PDFViewer/PDFElement.tsx
|
|
6743
|
+
var import_clsx35 = __toESM(require("clsx"), 1);
|
|
6744
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
6745
|
+
function PDFElement({
|
|
6746
|
+
b64,
|
|
6747
|
+
testid,
|
|
6748
|
+
isMobile,
|
|
6749
|
+
error
|
|
6750
|
+
}) {
|
|
6751
|
+
var _a;
|
|
6752
|
+
const canvasRef = (0, import_react33.useRef)(null);
|
|
6753
|
+
const { pdfDocument } = (0, import_react_pdf2.usePdf)({
|
|
6754
|
+
file: `data:application/pdf;base64,${b64}`,
|
|
6755
|
+
workerSrc: "/scripts/pdf.worker.min.mjs",
|
|
6756
|
+
scale: isMobile ? 1 : 1.3,
|
|
6757
|
+
canvasRef
|
|
6758
|
+
});
|
|
6759
|
+
const pagesArr = new Array((_a = pdfDocument == null ? void 0 : pdfDocument.numPages) != null ? _a : 1).fill(null);
|
|
6760
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
6761
|
+
"div",
|
|
6762
|
+
{
|
|
6763
|
+
className: "flex flex-col space-y-4",
|
|
6764
|
+
style: !isMobile ? {
|
|
6765
|
+
minHeight: 871,
|
|
6766
|
+
minWidth: 654
|
|
6767
|
+
} : void 0,
|
|
6768
|
+
children: !!pdfDocument && !!b64 && !error ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Stack, { sizing: "layout-group", children: pagesArr.length > 1 ? pagesArr.map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
6769
|
+
"div",
|
|
6770
|
+
{
|
|
6771
|
+
className: (0, import_clsx35.default)(
|
|
6772
|
+
"flex justify-center border-border-primary-normal",
|
|
6773
|
+
isMobile ? "border-0" : "border"
|
|
6774
|
+
),
|
|
6775
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
6776
|
+
PdfPage,
|
|
6777
|
+
{
|
|
6778
|
+
testid: testid ? `${testid}-pdf_page_${i + 1}` : void 0,
|
|
6779
|
+
file: `data:application/pdf;base64,${b64}`,
|
|
6780
|
+
pageNumber: i + 1
|
|
6781
|
+
}
|
|
6782
|
+
)
|
|
6783
|
+
},
|
|
6784
|
+
`${testid}-pdf-page-${i + 1}`
|
|
6785
|
+
)) : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
6786
|
+
"div",
|
|
6787
|
+
{
|
|
6788
|
+
className: (0, import_clsx35.default)(
|
|
6789
|
+
"flex justify-center border-border-primary-normal",
|
|
6790
|
+
isMobile ? "border-0" : "border"
|
|
6791
|
+
),
|
|
6792
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
6793
|
+
"canvas",
|
|
6794
|
+
{
|
|
6795
|
+
"data-testid": testid ? `${testid}-pdf-content` : void 0,
|
|
6796
|
+
ref: canvasRef,
|
|
6797
|
+
style: { width: "100%", height: "auto" }
|
|
6798
|
+
}
|
|
6799
|
+
)
|
|
6800
|
+
}
|
|
6801
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
6802
|
+
Stack,
|
|
6803
|
+
{
|
|
6804
|
+
justify: "center",
|
|
6805
|
+
items: "center",
|
|
6806
|
+
height: "full",
|
|
6807
|
+
flexGrow: 1,
|
|
6808
|
+
"data-testid": testid ? `${testid}-pdf-${error ? "error" : "loading"}` : void 0,
|
|
6809
|
+
children: error ? error : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Spinner, { size: "large" })
|
|
6810
|
+
}
|
|
6811
|
+
)
|
|
6812
|
+
}
|
|
6813
|
+
);
|
|
6814
|
+
}
|
|
6815
|
+
|
|
6816
|
+
// src/components/PDFViewer/DownloadIcon.tsx
|
|
6817
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
6818
|
+
function DownloadIcon({
|
|
6819
|
+
onClick,
|
|
6820
|
+
isDownloading,
|
|
6821
|
+
testid
|
|
6822
|
+
}) {
|
|
6823
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
6824
|
+
Button,
|
|
6825
|
+
{
|
|
6826
|
+
testid,
|
|
6827
|
+
iconOnly: true,
|
|
6828
|
+
variant: "tertiary",
|
|
6829
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Icon, { name: isDownloading ? "cached" : "download" }),
|
|
6830
|
+
onClick
|
|
6831
|
+
}
|
|
6832
|
+
);
|
|
6833
|
+
}
|
|
6834
|
+
|
|
6835
|
+
// src/components/PDFViewer/PDFNavigation.tsx
|
|
6836
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
6837
|
+
function PdfNavigation({
|
|
6838
|
+
currentIndex,
|
|
6839
|
+
total,
|
|
6840
|
+
onPrev,
|
|
6841
|
+
onNext,
|
|
6842
|
+
disablePrev,
|
|
6843
|
+
disableNext,
|
|
6844
|
+
extraActions,
|
|
6845
|
+
testid,
|
|
6846
|
+
fileName
|
|
6847
|
+
}) {
|
|
6848
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
6849
|
+
Stack,
|
|
6850
|
+
{
|
|
6851
|
+
horizontal: true,
|
|
6852
|
+
items: "center",
|
|
6853
|
+
justify: "between",
|
|
6854
|
+
sizing: "layout-group",
|
|
6855
|
+
testid: testid ? `${testid}-pdf-navigation` : void 0,
|
|
6856
|
+
children: [
|
|
6857
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Stack, { horizontal: true, items: "center", children: [
|
|
6858
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
6859
|
+
Button,
|
|
6860
|
+
{
|
|
6861
|
+
iconOnly: true,
|
|
6862
|
+
variant: "tertiary",
|
|
6863
|
+
onClick: onPrev,
|
|
6864
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Icon, { name: "chevron_backward" }),
|
|
6865
|
+
disabled: disablePrev,
|
|
6866
|
+
testid: testid ? `${testid}-pdf-file-previous-button` : void 0
|
|
6867
|
+
}
|
|
6868
|
+
),
|
|
6869
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Heading3, { className: "text-text-primary-normal whitespace-nowrap", children: [
|
|
6870
|
+
currentIndex + 1,
|
|
6871
|
+
" / ",
|
|
6872
|
+
total
|
|
6873
|
+
] }),
|
|
6874
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
6875
|
+
Button,
|
|
6876
|
+
{
|
|
6877
|
+
iconOnly: true,
|
|
6878
|
+
variant: "tertiary",
|
|
6879
|
+
onClick: onNext,
|
|
6880
|
+
rightIcon: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Icon, { name: "chevron_forward" }),
|
|
6881
|
+
disabled: disableNext,
|
|
6882
|
+
testid: testid ? `${testid}-pdf-file-next-button` : void 0
|
|
6883
|
+
}
|
|
6884
|
+
),
|
|
6885
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Paragraph, { children: (fileName == null ? void 0 : fileName.endsWith(".pdf")) ? fileName : `${fileName}.pdf` })
|
|
6886
|
+
] }),
|
|
6887
|
+
extraActions && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "flex items-center gap-2", children: extraActions })
|
|
6888
|
+
]
|
|
6889
|
+
}
|
|
6890
|
+
) });
|
|
6891
|
+
}
|
|
6892
|
+
|
|
6893
|
+
// src/components/PDFViewer/index.tsx
|
|
6894
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
6895
|
+
function PDFViewer(props) {
|
|
6896
|
+
const {
|
|
6897
|
+
isOpen,
|
|
6898
|
+
onClose,
|
|
6899
|
+
encodedPdfs,
|
|
6900
|
+
customActions,
|
|
6901
|
+
testid,
|
|
6902
|
+
isMobile,
|
|
6903
|
+
title,
|
|
6904
|
+
customFooter = false,
|
|
6905
|
+
withPagination = true,
|
|
6906
|
+
error
|
|
6907
|
+
} = props;
|
|
6908
|
+
const [currentIndex, setCurrentIndex] = (0, import_react34.useState)(0);
|
|
6909
|
+
const [isDownloading, setIsDownloading] = (0, import_react34.useState)(false);
|
|
6910
|
+
const handleDownload = (0, import_react34.useCallback)(() => {
|
|
6911
|
+
setIsDownloading(true);
|
|
6912
|
+
const link = document.createElement("a");
|
|
6913
|
+
const currentPdf = encodedPdfs[currentIndex];
|
|
6914
|
+
if (!currentPdf) {
|
|
6915
|
+
setIsDownloading(false);
|
|
6916
|
+
return;
|
|
6917
|
+
}
|
|
6918
|
+
link.href = `data:application/pdf;base64,${currentPdf.base64}`;
|
|
6919
|
+
link.download = currentPdf.fileName.endsWith(".pdf") ? currentPdf.fileName : `${currentPdf.fileName}.pdf`;
|
|
6920
|
+
document.body.appendChild(link);
|
|
6921
|
+
link.click();
|
|
6922
|
+
document.body.removeChild(link);
|
|
6923
|
+
setIsDownloading(false);
|
|
6924
|
+
}, [currentIndex, encodedPdfs]);
|
|
6925
|
+
if (!encodedPdfs.length) return null;
|
|
6926
|
+
function handleNextFile() {
|
|
6927
|
+
if (currentIndex < encodedPdfs.length - 1) {
|
|
6928
|
+
setCurrentIndex((prev) => prev + 1);
|
|
6929
|
+
}
|
|
6930
|
+
}
|
|
6931
|
+
function handlePreviousFile() {
|
|
6932
|
+
if (currentIndex > 0) {
|
|
6933
|
+
setCurrentIndex((prev) => prev - 1);
|
|
6934
|
+
}
|
|
6935
|
+
}
|
|
6936
|
+
function handleClose() {
|
|
6937
|
+
setCurrentIndex(0);
|
|
6938
|
+
setIsDownloading(false);
|
|
6939
|
+
onClose();
|
|
6940
|
+
}
|
|
6941
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
6942
|
+
Modal,
|
|
6943
|
+
{
|
|
6944
|
+
testid,
|
|
6945
|
+
open: isOpen,
|
|
6946
|
+
customFooter,
|
|
6947
|
+
onClose: handleClose,
|
|
6948
|
+
noWrapper: true,
|
|
6949
|
+
showButtons: isMobile && customFooter ? !!customActions : !!encodedPdfs.length,
|
|
6950
|
+
customActions: !!encodedPdfs.length && !isMobile && withPagination ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
6951
|
+
PdfNavigation,
|
|
6952
|
+
{
|
|
6953
|
+
testid,
|
|
6954
|
+
currentIndex,
|
|
6955
|
+
total: encodedPdfs.length,
|
|
6956
|
+
onPrev: handlePreviousFile,
|
|
6957
|
+
onNext: handleNextFile,
|
|
6958
|
+
disablePrev: currentIndex === 0,
|
|
6959
|
+
disableNext: currentIndex === encodedPdfs.length - 1,
|
|
6960
|
+
extraActions: customActions,
|
|
6961
|
+
fileName: encodedPdfs[currentIndex].fileName
|
|
6962
|
+
}
|
|
6963
|
+
) : customActions,
|
|
6964
|
+
fixedHeightScrolling: true,
|
|
6965
|
+
headerIconAlign: "right",
|
|
6966
|
+
headerIcon: !isMobile ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
6967
|
+
DownloadIcon,
|
|
6968
|
+
{
|
|
6969
|
+
testid: testid ? `${testid}-download-icon` : void 0,
|
|
6970
|
+
onClick: handleDownload,
|
|
6971
|
+
isDownloading
|
|
6972
|
+
}
|
|
6973
|
+
) : void 0,
|
|
6974
|
+
title: isMobile ? title != null ? title : encodedPdfs[currentIndex].fileName : void 0,
|
|
6975
|
+
size: isMobile ? "screen" : "large",
|
|
6976
|
+
headerClassname: "bg-brand-400 desktop:bg-background-grouped-primary-normal p-mobile-layout-padding text-brand-text-action-primary-normal",
|
|
6977
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
6978
|
+
PDFElement,
|
|
6979
|
+
{
|
|
6980
|
+
testid,
|
|
6981
|
+
b64: encodedPdfs[currentIndex].base64,
|
|
6982
|
+
isMobile,
|
|
6983
|
+
error
|
|
6984
|
+
}
|
|
6985
|
+
)
|
|
6986
|
+
}
|
|
6987
|
+
);
|
|
6988
|
+
}
|
|
6989
|
+
|
|
6990
|
+
// src/components/ListGroup.tsx
|
|
6991
|
+
var import_react35 = require("react");
|
|
6992
|
+
var import_clsx36 = __toESM(require("clsx"), 1);
|
|
6993
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
6994
|
+
function ListGroup({
|
|
6995
|
+
title,
|
|
6996
|
+
defaultOpen = false,
|
|
6997
|
+
open: controlledOpen,
|
|
6998
|
+
onToggle,
|
|
6999
|
+
testid,
|
|
7000
|
+
disabled,
|
|
7001
|
+
className,
|
|
7002
|
+
children
|
|
7003
|
+
}) {
|
|
7004
|
+
const [uncontrolledOpen, setUncontrolledOpen] = (0, import_react35.useState)(defaultOpen);
|
|
7005
|
+
const isControlled = controlledOpen !== void 0;
|
|
7006
|
+
const isOpen = isControlled ? controlledOpen : uncontrolledOpen;
|
|
7007
|
+
const toggle = () => {
|
|
7008
|
+
if (disabled) return;
|
|
7009
|
+
const next = !isOpen;
|
|
7010
|
+
if (!isControlled) setUncontrolledOpen(next);
|
|
7011
|
+
onToggle == null ? void 0 : onToggle(next);
|
|
7012
|
+
};
|
|
7013
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { "data-testid": testid, className: (0, import_clsx36.default)("rounded-sm", className), children: /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Stack, { sizing: "layout", noGap: true, children: [
|
|
7014
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
|
|
7015
|
+
"button",
|
|
7016
|
+
{
|
|
7017
|
+
type: "button",
|
|
7018
|
+
onClick: toggle,
|
|
7019
|
+
className: (0, import_clsx36.default)(
|
|
7020
|
+
"w-full flex items-center justify-between text-left",
|
|
7021
|
+
disabled && "opacity-50 cursor-not-allowed"
|
|
7022
|
+
),
|
|
7023
|
+
"aria-expanded": isOpen,
|
|
7024
|
+
children: [
|
|
7025
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Label, { children: title }),
|
|
7026
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
7027
|
+
Icon,
|
|
7028
|
+
{
|
|
7029
|
+
name: "expand_more",
|
|
7030
|
+
className: (0, import_clsx36.default)(
|
|
7031
|
+
"transition-transform duration-200",
|
|
7032
|
+
isOpen ? "rotate-180" : "rotate-0"
|
|
7033
|
+
)
|
|
7034
|
+
}
|
|
7035
|
+
)
|
|
7036
|
+
]
|
|
7037
|
+
}
|
|
7038
|
+
),
|
|
7039
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Stack, { sizing: "layout", paddingY: true, children })
|
|
7040
|
+
] }) });
|
|
7041
|
+
}
|
|
7042
|
+
|
|
7043
|
+
// src/components/Pagination.tsx
|
|
7044
|
+
var import_react36 = require("react");
|
|
7045
|
+
var import_clsx37 = __toESM(require("clsx"), 1);
|
|
7046
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
7047
|
+
var Pagination = ({
|
|
7048
|
+
totalPages,
|
|
7049
|
+
currentPage,
|
|
7050
|
+
onPageChange,
|
|
7051
|
+
id,
|
|
7052
|
+
testid,
|
|
7053
|
+
className,
|
|
7054
|
+
disabled
|
|
7055
|
+
}) => {
|
|
7056
|
+
const goTo = (0, import_react36.useCallback)(
|
|
7057
|
+
(page) => {
|
|
7058
|
+
if (disabled) return;
|
|
7059
|
+
onPageChange(page);
|
|
7060
|
+
},
|
|
7061
|
+
[onPageChange, disabled]
|
|
7062
|
+
);
|
|
7063
|
+
const handleKey = (e) => {
|
|
7064
|
+
if (disabled) return;
|
|
7065
|
+
if (e.key === "ArrowLeft") {
|
|
7066
|
+
e.preventDefault();
|
|
7067
|
+
goTo(currentPage - 1);
|
|
7068
|
+
} else if (e.key === "ArrowRight") {
|
|
7069
|
+
e.preventDefault();
|
|
7070
|
+
goTo(currentPage + 1);
|
|
7071
|
+
}
|
|
7072
|
+
};
|
|
7073
|
+
const pageTokens = (0, import_react36.useMemo)(() => {
|
|
7074
|
+
if (totalPages <= 5) {
|
|
7075
|
+
return Array.from({ length: totalPages }, (_, i) => i + 1);
|
|
7076
|
+
}
|
|
7077
|
+
const pages = /* @__PURE__ */ new Set();
|
|
7078
|
+
pages.add(1);
|
|
7079
|
+
pages.add(totalPages);
|
|
7080
|
+
if (currentPage <= 3) {
|
|
7081
|
+
pages.add(2);
|
|
7082
|
+
pages.add(3);
|
|
7083
|
+
pages.add(4);
|
|
7084
|
+
} else if (currentPage >= totalPages - 2) {
|
|
7085
|
+
pages.add(totalPages - 1);
|
|
7086
|
+
pages.add(totalPages - 2);
|
|
7087
|
+
pages.add(totalPages - 3);
|
|
7088
|
+
} else {
|
|
7089
|
+
pages.add(currentPage - 1);
|
|
7090
|
+
pages.add(currentPage);
|
|
7091
|
+
pages.add(currentPage + 1);
|
|
7092
|
+
}
|
|
7093
|
+
const sorted = Array.from(pages).sort((a, b) => a - b);
|
|
7094
|
+
const tokens = [];
|
|
7095
|
+
for (let i = 0; i < sorted.length; i++) {
|
|
7096
|
+
const value = sorted[i];
|
|
7097
|
+
const prev = sorted[i - 1];
|
|
7098
|
+
if (i > 0) {
|
|
7099
|
+
if (value - prev === 2) {
|
|
7100
|
+
tokens.push(prev + 1);
|
|
7101
|
+
} else if (value - prev > 2) {
|
|
7102
|
+
tokens.push("ellipsis");
|
|
7103
|
+
}
|
|
7104
|
+
}
|
|
7105
|
+
tokens.push(value);
|
|
7106
|
+
}
|
|
7107
|
+
return tokens;
|
|
7108
|
+
}, [totalPages, currentPage]);
|
|
7109
|
+
if (totalPages <= 1) return null;
|
|
7110
|
+
const buttonClass = (0, import_clsx37.default)(
|
|
7111
|
+
"cursor-pointer disabled:cursor-default",
|
|
7112
|
+
paddingUsingComponentGap,
|
|
7113
|
+
"w-8 h-8",
|
|
7114
|
+
"flex items-center justify-center",
|
|
7115
|
+
"bg-transparent",
|
|
7116
|
+
"box-content",
|
|
7117
|
+
"hover:bg-background-grouped-secondary-normal",
|
|
7118
|
+
"focus:bg-background-grouped-secondary-normal focus:outline-0",
|
|
7119
|
+
"disabled:bg-transparent disabled:text-text-action-primary-disabled"
|
|
7120
|
+
);
|
|
7121
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
7122
|
+
"nav",
|
|
7123
|
+
{
|
|
7124
|
+
id,
|
|
7125
|
+
"data-testid": testid,
|
|
7126
|
+
"aria-label": "Pagination",
|
|
7127
|
+
onKeyDown: handleKey,
|
|
7128
|
+
className: (0, import_clsx37.default)(
|
|
7129
|
+
"flex items-center",
|
|
7130
|
+
"border border-border-primary-normal",
|
|
7131
|
+
"bg-background-grouped-primary-normal",
|
|
7132
|
+
"rounded-sm",
|
|
7133
|
+
className
|
|
7134
|
+
),
|
|
7135
|
+
children: [
|
|
7136
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
7137
|
+
"button",
|
|
7138
|
+
{
|
|
7139
|
+
disabled: disabled || currentPage <= 1,
|
|
7140
|
+
"aria-label": "Previous page",
|
|
7141
|
+
onClick: () => goTo(currentPage - 1),
|
|
7142
|
+
className: (0, import_clsx37.default)(buttonClass, "border-r-1 border-border-primary-normal"),
|
|
7143
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Icon, { name: "keyboard_arrow_left" })
|
|
7144
|
+
}
|
|
7145
|
+
),
|
|
7146
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("ul", { className: (0, import_clsx37.default)("flex items-center"), children: pageTokens.map((token, index) => {
|
|
7147
|
+
if (token === "ellipsis") {
|
|
7148
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
7149
|
+
"li",
|
|
7150
|
+
{
|
|
7151
|
+
className: "w-8 h-8 select-none text-text-action-primary-disabled",
|
|
7152
|
+
children: "\u2026"
|
|
7153
|
+
},
|
|
7154
|
+
`ellipsis-${index}`
|
|
7155
|
+
);
|
|
7156
|
+
}
|
|
7157
|
+
const selected = token === currentPage;
|
|
7158
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
7159
|
+
"button",
|
|
7160
|
+
{
|
|
7161
|
+
"aria-label": `Page ${token}`,
|
|
7162
|
+
"aria-current": selected ? "page" : void 0,
|
|
7163
|
+
disabled,
|
|
7164
|
+
onClick: () => goTo(token),
|
|
7165
|
+
className: (0, import_clsx37.default)(
|
|
7166
|
+
buttonClass,
|
|
7167
|
+
selected && "border-x-1 bg-background-grouped-secondary-normal border-border-primary-normal"
|
|
7168
|
+
),
|
|
7169
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Subheader, { align: "center", weight: "bold", children: token })
|
|
7170
|
+
}
|
|
7171
|
+
) }, token);
|
|
7172
|
+
}) }),
|
|
7173
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
7174
|
+
"button",
|
|
7175
|
+
{
|
|
7176
|
+
disabled: disabled || currentPage >= totalPages,
|
|
7177
|
+
"aria-label": "Next page",
|
|
7178
|
+
onClick: () => goTo(currentPage + 1),
|
|
7179
|
+
className: (0, import_clsx37.default)(buttonClass, "border-l-1 border-border-primary-normal"),
|
|
7180
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Icon, { name: "keyboard_arrow_right" })
|
|
7181
|
+
}
|
|
7182
|
+
)
|
|
7183
|
+
]
|
|
7184
|
+
}
|
|
7185
|
+
);
|
|
7186
|
+
};
|
|
7187
|
+
Pagination.displayName = "Pagination";
|
|
6584
7188
|
// Annotate the CommonJS export names for ESM import in node:
|
|
6585
7189
|
0 && (module.exports = {
|
|
6586
7190
|
Accordion,
|
|
@@ -6596,13 +7200,17 @@ function CompactImagesPreview(props) {
|
|
|
6596
7200
|
Icon,
|
|
6597
7201
|
Input,
|
|
6598
7202
|
Label,
|
|
7203
|
+
ListGroup,
|
|
6599
7204
|
Menu,
|
|
6600
7205
|
MenuOption,
|
|
6601
7206
|
MobileDataGrid,
|
|
7207
|
+
PDFViewer,
|
|
7208
|
+
Pagination,
|
|
6602
7209
|
Paragraph,
|
|
6603
7210
|
ProductImagePreview,
|
|
6604
7211
|
Search,
|
|
6605
7212
|
Select,
|
|
7213
|
+
SimpleTable,
|
|
6606
7214
|
Subheader,
|
|
6607
7215
|
Tooltip
|
|
6608
7216
|
});
|