@dmsi/wedgekit-react 0.0.415 → 0.0.418
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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-CANJ2YPW.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-ESCNCQGI.js +9 -0
- package/dist/chunk-IFHMGICR.js +66 -0
- package/dist/{chunk-ZHZIIVJN.js → chunk-IMOIZFJZ.js} +5 -5
- package/dist/chunk-KBJZUVLM.js +65 -0
- package/dist/{chunk-AA6GE3TH.js → chunk-LUPHOXAQ.js} +1 -1
- package/dist/{chunk-44TDIHUP.js → chunk-P3MIP2FD.js} +1 -1
- package/dist/{chunk-7ULLUUVJ.js → chunk-PQWWVBSR.js} +1 -1
- package/dist/{chunk-ERW5DEIO.js → chunk-RQLWSLVE.js} +1 -1
- package/dist/{chunk-BK7SPR6Y.js → chunk-TQIKP534.js} +4 -4
- 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 +231 -53
- package/dist/components/CalendarRange.css +169 -65
- package/dist/components/CalendarRange.js +24 -16
- 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 +189 -11
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.css +169 -65
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +24 -16
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.cjs +198 -20
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.css +169 -65
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +24 -16
- package/dist/components/DataGrid/PinnedColumns.cjs +214 -36
- package/dist/components/DataGrid/PinnedColumns.css +169 -65
- package/dist/components/DataGrid/PinnedColumns.js +24 -16
- package/dist/components/DataGrid/TableBody/LoadingCell.cjs +190 -12
- package/dist/components/DataGrid/TableBody/LoadingCell.css +169 -65
- package/dist/components/DataGrid/TableBody/LoadingCell.js +24 -16
- package/dist/components/DataGrid/TableBody/TableBodyRow.cjs +196 -18
- package/dist/components/DataGrid/TableBody/TableBodyRow.css +169 -65
- package/dist/components/DataGrid/TableBody/TableBodyRow.js +24 -16
- package/dist/components/DataGrid/TableBody/index.cjs +211 -33
- package/dist/components/DataGrid/TableBody/index.css +169 -65
- package/dist/components/DataGrid/TableBody/index.js +24 -16
- package/dist/components/DataGrid/index.cjs +300 -122
- package/dist/components/DataGrid/index.css +169 -65
- package/dist/components/DataGrid/index.js +24 -16
- package/dist/components/DataGrid/utils.cjs +190 -12
- package/dist/components/DataGrid/utils.css +169 -65
- package/dist/components/DataGrid/utils.js +24 -16
- package/dist/components/DateInput.cjs +250 -72
- package/dist/components/DateInput.css +169 -65
- package/dist/components/DateInput.js +24 -16
- package/dist/components/DateRangeInput.cjs +250 -72
- package/dist/components/DateRangeInput.css +169 -65
- package/dist/components/DateRangeInput.js +24 -16
- 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 +197 -19
- package/dist/components/MobileDataGrid/ColumnSelector/index.css +169 -65
- package/dist/components/MobileDataGrid/ColumnSelector/index.js +24 -16
- package/dist/components/MobileDataGrid/MobileDataGridCard/index.cjs +36 -0
- package/dist/components/MobileDataGrid/MobileDataGridCard/index.js +2 -2
- package/dist/components/MobileDataGrid/MobileDataGridHeader.cjs +241 -27
- package/dist/components/MobileDataGrid/MobileDataGridHeader.css +169 -65
- package/dist/components/MobileDataGrid/MobileDataGridHeader.js +24 -16
- 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 +743 -529
- package/dist/components/MobileDataGrid/index.css +169 -65
- package/dist/components/MobileDataGrid/index.js +24 -16
- 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 +4 -4
- 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 +36 -0
- package/dist/components/SimpleTable.js +2 -2
- package/dist/components/SkeletonParagraph.js +3 -6
- 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 +694 -131
- package/dist/components/index.css +169 -65
- package/dist/components/index.js +37 -17
- package/dist/index.css +169 -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/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
|
@@ -62,7 +62,7 @@ __export(DateInput_exports, {
|
|
|
62
62
|
DateInput: () => DateInput
|
|
63
63
|
});
|
|
64
64
|
module.exports = __toCommonJS(DateInput_exports);
|
|
65
|
-
var
|
|
65
|
+
var import_react38 = require("react");
|
|
66
66
|
var import_react_dom4 = require("react-dom");
|
|
67
67
|
|
|
68
68
|
// src/components/Input.tsx
|
|
@@ -716,8 +716,8 @@ Currency.displayName = "Currency";
|
|
|
716
716
|
Percentage.displayName = "Percentage";
|
|
717
717
|
|
|
718
718
|
// src/components/CalendarRange.tsx
|
|
719
|
-
var
|
|
720
|
-
var
|
|
719
|
+
var import_clsx38 = __toESM(require("clsx"), 1);
|
|
720
|
+
var import_react37 = __toESM(require("react"), 1);
|
|
721
721
|
var import_polyfill = require("@js-temporal/polyfill");
|
|
722
722
|
|
|
723
723
|
// src/components/DataGridCell.tsx
|
|
@@ -4048,7 +4048,7 @@ var Tooltip = ({
|
|
|
4048
4048
|
id,
|
|
4049
4049
|
"data-testid": testid,
|
|
4050
4050
|
ref,
|
|
4051
|
-
className: "relative inline-grid grid-cols-[auto_1fr] items-center",
|
|
4051
|
+
className: "relative inline-grid grid-cols-[auto_1fr] items-center cursor-pointer",
|
|
4052
4052
|
onMouseEnter: handleMouseEnter,
|
|
4053
4053
|
onMouseLeave: handleMouseLeave,
|
|
4054
4054
|
children: [
|
|
@@ -4639,12 +4639,11 @@ var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
|
4639
4639
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
4640
4640
|
|
|
4641
4641
|
// src/components/Grid.tsx
|
|
4642
|
-
var import_react27 = require("react");
|
|
4643
4642
|
var import_clsx30 = __toESM(require("clsx"), 1);
|
|
4644
4643
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
4645
4644
|
|
|
4646
4645
|
// src/components/ProductImagePreview/ProductPrimaryImage.tsx
|
|
4647
|
-
var
|
|
4646
|
+
var import_react27 = require("react");
|
|
4648
4647
|
|
|
4649
4648
|
// src/components/Spinner.tsx
|
|
4650
4649
|
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
@@ -4680,7 +4679,7 @@ Spinner.displayName = "Spinner";
|
|
|
4680
4679
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
4681
4680
|
|
|
4682
4681
|
// src/components/ProductImagePreview/ZoomWindow.tsx
|
|
4683
|
-
var
|
|
4682
|
+
var import_react28 = require("react");
|
|
4684
4683
|
|
|
4685
4684
|
// src/components/Surface.tsx
|
|
4686
4685
|
var import_clsx31 = __toESM(require("clsx"), 1);
|
|
@@ -4725,17 +4724,17 @@ var import_clsx32 = require("clsx");
|
|
|
4725
4724
|
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
4726
4725
|
|
|
4727
4726
|
// src/components/ProductImagePreview/MobileImageCarousel.tsx
|
|
4728
|
-
var
|
|
4727
|
+
var import_react29 = require("react");
|
|
4729
4728
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
4730
4729
|
|
|
4731
4730
|
// src/components/ProductImagePreview/useProductImagePreview.ts
|
|
4732
|
-
var
|
|
4731
|
+
var import_react30 = require("react");
|
|
4733
4732
|
|
|
4734
4733
|
// src/components/ProductImagePreview/index.tsx
|
|
4735
4734
|
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
4736
4735
|
|
|
4737
4736
|
// src/components/CompactImagesPreview.tsx
|
|
4738
|
-
var
|
|
4737
|
+
var import_react31 = require("react");
|
|
4739
4738
|
var import_clsx33 = __toESM(require("clsx"), 1);
|
|
4740
4739
|
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
4741
4740
|
|
|
@@ -4743,8 +4742,187 @@ var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
|
4743
4742
|
var import_clsx34 = __toESM(require("clsx"), 1);
|
|
4744
4743
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
4745
4744
|
|
|
4746
|
-
// src/components/
|
|
4745
|
+
// src/components/PDFViewer/index.tsx
|
|
4746
|
+
var import_react34 = require("react");
|
|
4747
|
+
|
|
4748
|
+
// src/components/PDFViewer/PDFElement.tsx
|
|
4749
|
+
var import_react_pdf2 = require("@mikecousins/react-pdf");
|
|
4750
|
+
var import_react33 = require("react");
|
|
4751
|
+
|
|
4752
|
+
// src/components/PDFViewer/PDFPage.tsx
|
|
4753
|
+
var import_react_pdf = require("@mikecousins/react-pdf");
|
|
4754
|
+
var import_react32 = require("react");
|
|
4747
4755
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
4756
|
+
|
|
4757
|
+
// src/components/PDFViewer/PDFElement.tsx
|
|
4758
|
+
var import_clsx35 = __toESM(require("clsx"), 1);
|
|
4759
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
4760
|
+
|
|
4761
|
+
// src/components/PDFViewer/DownloadIcon.tsx
|
|
4762
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
4763
|
+
|
|
4764
|
+
// src/components/PDFViewer/PDFNavigation.tsx
|
|
4765
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
4766
|
+
|
|
4767
|
+
// src/components/PDFViewer/index.tsx
|
|
4768
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
4769
|
+
|
|
4770
|
+
// src/components/ListGroup.tsx
|
|
4771
|
+
var import_react35 = require("react");
|
|
4772
|
+
var import_clsx36 = __toESM(require("clsx"), 1);
|
|
4773
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
4774
|
+
|
|
4775
|
+
// src/components/Pagination.tsx
|
|
4776
|
+
var import_react36 = require("react");
|
|
4777
|
+
var import_clsx37 = __toESM(require("clsx"), 1);
|
|
4778
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
4779
|
+
var Pagination = ({
|
|
4780
|
+
totalPages,
|
|
4781
|
+
currentPage,
|
|
4782
|
+
onPageChange,
|
|
4783
|
+
id,
|
|
4784
|
+
testid,
|
|
4785
|
+
className,
|
|
4786
|
+
disabled
|
|
4787
|
+
}) => {
|
|
4788
|
+
const goTo = (0, import_react36.useCallback)(
|
|
4789
|
+
(page) => {
|
|
4790
|
+
if (disabled) return;
|
|
4791
|
+
onPageChange(page);
|
|
4792
|
+
},
|
|
4793
|
+
[onPageChange, disabled]
|
|
4794
|
+
);
|
|
4795
|
+
const handleKey = (e) => {
|
|
4796
|
+
if (disabled) return;
|
|
4797
|
+
if (e.key === "ArrowLeft") {
|
|
4798
|
+
e.preventDefault();
|
|
4799
|
+
goTo(currentPage - 1);
|
|
4800
|
+
} else if (e.key === "ArrowRight") {
|
|
4801
|
+
e.preventDefault();
|
|
4802
|
+
goTo(currentPage + 1);
|
|
4803
|
+
}
|
|
4804
|
+
};
|
|
4805
|
+
const pageTokens = (0, import_react36.useMemo)(() => {
|
|
4806
|
+
if (totalPages <= 5) {
|
|
4807
|
+
return Array.from({ length: totalPages }, (_, i) => i + 1);
|
|
4808
|
+
}
|
|
4809
|
+
const pages = /* @__PURE__ */ new Set();
|
|
4810
|
+
pages.add(1);
|
|
4811
|
+
pages.add(totalPages);
|
|
4812
|
+
if (currentPage <= 3) {
|
|
4813
|
+
pages.add(2);
|
|
4814
|
+
pages.add(3);
|
|
4815
|
+
pages.add(4);
|
|
4816
|
+
} else if (currentPage >= totalPages - 2) {
|
|
4817
|
+
pages.add(totalPages - 1);
|
|
4818
|
+
pages.add(totalPages - 2);
|
|
4819
|
+
pages.add(totalPages - 3);
|
|
4820
|
+
} else {
|
|
4821
|
+
pages.add(currentPage - 1);
|
|
4822
|
+
pages.add(currentPage);
|
|
4823
|
+
pages.add(currentPage + 1);
|
|
4824
|
+
}
|
|
4825
|
+
const sorted = Array.from(pages).sort((a, b) => a - b);
|
|
4826
|
+
const tokens = [];
|
|
4827
|
+
for (let i = 0; i < sorted.length; i++) {
|
|
4828
|
+
const value = sorted[i];
|
|
4829
|
+
const prev = sorted[i - 1];
|
|
4830
|
+
if (i > 0) {
|
|
4831
|
+
if (value - prev === 2) {
|
|
4832
|
+
tokens.push(prev + 1);
|
|
4833
|
+
} else if (value - prev > 2) {
|
|
4834
|
+
tokens.push("ellipsis");
|
|
4835
|
+
}
|
|
4836
|
+
}
|
|
4837
|
+
tokens.push(value);
|
|
4838
|
+
}
|
|
4839
|
+
return tokens;
|
|
4840
|
+
}, [totalPages, currentPage]);
|
|
4841
|
+
if (totalPages <= 1) return null;
|
|
4842
|
+
const buttonClass = (0, import_clsx37.default)(
|
|
4843
|
+
"cursor-pointer disabled:cursor-default",
|
|
4844
|
+
paddingUsingComponentGap,
|
|
4845
|
+
"w-8 h-8",
|
|
4846
|
+
"flex items-center justify-center",
|
|
4847
|
+
"bg-transparent",
|
|
4848
|
+
"box-content",
|
|
4849
|
+
"hover:bg-background-grouped-secondary-normal",
|
|
4850
|
+
"focus:bg-background-grouped-secondary-normal focus:outline-0",
|
|
4851
|
+
"disabled:bg-transparent disabled:text-text-action-primary-disabled"
|
|
4852
|
+
);
|
|
4853
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
4854
|
+
"nav",
|
|
4855
|
+
{
|
|
4856
|
+
id,
|
|
4857
|
+
"data-testid": testid,
|
|
4858
|
+
"aria-label": "Pagination",
|
|
4859
|
+
onKeyDown: handleKey,
|
|
4860
|
+
className: (0, import_clsx37.default)(
|
|
4861
|
+
"flex items-center",
|
|
4862
|
+
"border border-border-primary-normal",
|
|
4863
|
+
"bg-background-grouped-primary-normal",
|
|
4864
|
+
"rounded-sm",
|
|
4865
|
+
className
|
|
4866
|
+
),
|
|
4867
|
+
children: [
|
|
4868
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
4869
|
+
"button",
|
|
4870
|
+
{
|
|
4871
|
+
disabled: disabled || currentPage <= 1,
|
|
4872
|
+
"aria-label": "Previous page",
|
|
4873
|
+
onClick: () => goTo(currentPage - 1),
|
|
4874
|
+
className: (0, import_clsx37.default)(buttonClass, "border-r-1 border-border-primary-normal"),
|
|
4875
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Icon, { name: "keyboard_arrow_left" })
|
|
4876
|
+
}
|
|
4877
|
+
),
|
|
4878
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("ul", { className: (0, import_clsx37.default)("flex items-center"), children: pageTokens.map((token, index) => {
|
|
4879
|
+
if (token === "ellipsis") {
|
|
4880
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
4881
|
+
"li",
|
|
4882
|
+
{
|
|
4883
|
+
className: "w-8 h-8 select-none text-text-action-primary-disabled",
|
|
4884
|
+
children: "\u2026"
|
|
4885
|
+
},
|
|
4886
|
+
`ellipsis-${index}`
|
|
4887
|
+
);
|
|
4888
|
+
}
|
|
4889
|
+
const selected = token === currentPage;
|
|
4890
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
4891
|
+
"button",
|
|
4892
|
+
{
|
|
4893
|
+
"aria-label": `Page ${token}`,
|
|
4894
|
+
"aria-current": selected ? "page" : void 0,
|
|
4895
|
+
disabled,
|
|
4896
|
+
onClick: () => goTo(token),
|
|
4897
|
+
className: (0, import_clsx37.default)(
|
|
4898
|
+
buttonClass,
|
|
4899
|
+
selected && "border-x-1 bg-background-grouped-secondary-normal border-border-primary-normal"
|
|
4900
|
+
),
|
|
4901
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Subheader, { align: "center", weight: "bold", children: token })
|
|
4902
|
+
}
|
|
4903
|
+
) }, token);
|
|
4904
|
+
}) }),
|
|
4905
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
4906
|
+
"button",
|
|
4907
|
+
{
|
|
4908
|
+
disabled: disabled || currentPage >= totalPages,
|
|
4909
|
+
"aria-label": "Next page",
|
|
4910
|
+
onClick: () => goTo(currentPage + 1),
|
|
4911
|
+
className: (0, import_clsx37.default)(buttonClass, "border-l-1 border-border-primary-normal"),
|
|
4912
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Icon, { name: "keyboard_arrow_right" })
|
|
4913
|
+
}
|
|
4914
|
+
)
|
|
4915
|
+
]
|
|
4916
|
+
}
|
|
4917
|
+
);
|
|
4918
|
+
};
|
|
4919
|
+
Pagination.displayName = "Pagination";
|
|
4920
|
+
|
|
4921
|
+
// src/components/SkeletonParagraph.tsx
|
|
4922
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
4923
|
+
|
|
4924
|
+
// src/components/CalendarRange.tsx
|
|
4925
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
4748
4926
|
function DateCell(_a) {
|
|
4749
4927
|
var _b = _a, {
|
|
4750
4928
|
date,
|
|
@@ -4779,12 +4957,12 @@ function DateCell(_a) {
|
|
|
4779
4957
|
"id",
|
|
4780
4958
|
"testid"
|
|
4781
4959
|
]);
|
|
4782
|
-
return /* @__PURE__ */ (0,
|
|
4960
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
4783
4961
|
"span",
|
|
4784
4962
|
__spreadProps(__spreadValues({}, props), {
|
|
4785
4963
|
id,
|
|
4786
4964
|
"data-testid": testid,
|
|
4787
|
-
className: (0,
|
|
4965
|
+
className: (0, import_clsx38.default)(
|
|
4788
4966
|
"flex items-center justify-center aspect-square select-none transition-colors border duration-100 font-medium",
|
|
4789
4967
|
typography.caption,
|
|
4790
4968
|
cellPadding,
|
|
@@ -4854,20 +5032,20 @@ function CalendarRange({
|
|
|
4854
5032
|
const fromDate = parseDate(from);
|
|
4855
5033
|
const toDate = parseDate(to);
|
|
4856
5034
|
const today = import_polyfill.Temporal.Now.plainDateISO();
|
|
4857
|
-
const [baseMonth, setBaseMonth] = (0,
|
|
5035
|
+
const [baseMonth, setBaseMonth] = (0, import_react37.useState)(
|
|
4858
5036
|
fromDate != null ? fromDate : today.with({ day: 1 })
|
|
4859
5037
|
);
|
|
4860
|
-
const [selecting, setSelecting] = (0,
|
|
4861
|
-
const [pendingFrom, setPendingFrom] = (0,
|
|
4862
|
-
const [hoveredDate, setHoveredDate] = (0,
|
|
4863
|
-
(0,
|
|
5038
|
+
const [selecting, setSelecting] = (0, import_react37.useState)("from");
|
|
5039
|
+
const [pendingFrom, setPendingFrom] = (0, import_react37.useState)(void 0);
|
|
5040
|
+
const [hoveredDate, setHoveredDate] = (0, import_react37.useState)(void 0);
|
|
5041
|
+
(0, import_react37.useEffect)(() => {
|
|
4864
5042
|
if (fromDate) {
|
|
4865
5043
|
setBaseMonth(fromDate.with({ day: 1 }));
|
|
4866
5044
|
} else if (toDate) {
|
|
4867
5045
|
setBaseMonth(toDate.with({ day: 1 }));
|
|
4868
5046
|
}
|
|
4869
5047
|
}, [from, to]);
|
|
4870
|
-
(0,
|
|
5048
|
+
(0, import_react37.useEffect)(() => {
|
|
4871
5049
|
if (fromDate && toDate) {
|
|
4872
5050
|
setSelecting("from");
|
|
4873
5051
|
setPendingFrom(void 0);
|
|
@@ -4933,12 +5111,12 @@ function CalendarRange({
|
|
|
4933
5111
|
}
|
|
4934
5112
|
return false;
|
|
4935
5113
|
}
|
|
4936
|
-
return /* @__PURE__ */ (0,
|
|
5114
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
4937
5115
|
"div",
|
|
4938
5116
|
{
|
|
4939
5117
|
id,
|
|
4940
5118
|
"data-testid": testid,
|
|
4941
|
-
className: (0,
|
|
5119
|
+
className: (0, import_clsx38.default)(
|
|
4942
5120
|
"relative bg-background-grouped-primary-normal rounded-base w-fit",
|
|
4943
5121
|
layoutPaddding,
|
|
4944
5122
|
layoutGap,
|
|
@@ -4946,15 +5124,15 @@ function CalendarRange({
|
|
|
4946
5124
|
// baseTransition,
|
|
4947
5125
|
"overflow-hidden"
|
|
4948
5126
|
),
|
|
4949
|
-
children: /* @__PURE__ */ (0,
|
|
5127
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
4950
5128
|
"div",
|
|
4951
5129
|
{
|
|
4952
|
-
className: (0,
|
|
5130
|
+
className: (0, import_clsx38.default)(
|
|
4953
5131
|
"flex flex-row items-start justify-start bg-background-primary-normal overflow-clip",
|
|
4954
5132
|
layoutGap
|
|
4955
5133
|
),
|
|
4956
5134
|
children: (mode === "double" ? [0, 1] : [0]).map((offset, idx) => {
|
|
4957
|
-
return /* @__PURE__ */ (0,
|
|
5135
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
4958
5136
|
CalendarPane,
|
|
4959
5137
|
{
|
|
4960
5138
|
getMonthData,
|
|
@@ -5012,45 +5190,45 @@ function CalendarPane({
|
|
|
5012
5190
|
const years = Array.from({ length: 100 }).map(
|
|
5013
5191
|
(_, i) => baseMonth.year - 50 + i
|
|
5014
5192
|
);
|
|
5015
|
-
const [monthMenuOpen, setMonthMenuOpen] = (0,
|
|
5016
|
-
const [yearMenuOpen, setYearMenuOpen] = (0,
|
|
5017
|
-
const monthMenuRef = (0,
|
|
5018
|
-
const yearMenuRef = (0,
|
|
5193
|
+
const [monthMenuOpen, setMonthMenuOpen] = (0, import_react37.useState)(false);
|
|
5194
|
+
const [yearMenuOpen, setYearMenuOpen] = (0, import_react37.useState)(false);
|
|
5195
|
+
const monthMenuRef = (0, import_react37.useRef)(null);
|
|
5196
|
+
const yearMenuRef = (0, import_react37.useRef)(null);
|
|
5019
5197
|
const month = getMonthData(offset);
|
|
5020
5198
|
const totalCells = 42;
|
|
5021
5199
|
const emptyCells = month.firstDayOffset;
|
|
5022
|
-
return /* @__PURE__ */ (0,
|
|
5023
|
-
/* @__PURE__ */ (0,
|
|
5200
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_react37.default.Fragment, { children: [
|
|
5201
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
|
|
5024
5202
|
"div",
|
|
5025
5203
|
{
|
|
5026
|
-
className: (0,
|
|
5204
|
+
className: (0, import_clsx38.default)("flex flex-col"),
|
|
5027
5205
|
children: [
|
|
5028
|
-
/* @__PURE__ */ (0,
|
|
5206
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
|
|
5029
5207
|
"div",
|
|
5030
5208
|
{
|
|
5031
|
-
className: (0,
|
|
5209
|
+
className: (0, import_clsx38.default)(
|
|
5032
5210
|
"flex flex-row items-center justify-between",
|
|
5033
5211
|
typography.label,
|
|
5034
5212
|
"text-text-action-primary-normal"
|
|
5035
5213
|
),
|
|
5036
5214
|
children: [
|
|
5037
|
-
idx === 0 ? /* @__PURE__ */ (0,
|
|
5215
|
+
idx === 0 ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
5038
5216
|
"button",
|
|
5039
5217
|
{
|
|
5040
5218
|
id: id ? `${id}-prev-month-button` : void 0,
|
|
5041
5219
|
"data-testid": testid ? `${testid}-prev-month-button` : void 0,
|
|
5042
5220
|
type: "button",
|
|
5043
|
-
className: (0,
|
|
5221
|
+
className: (0, import_clsx38.default)(
|
|
5044
5222
|
"flex items-center justify-center rounded-base hover:bg-action-100 active:bg-action-300 text-icon-action-primary-normal",
|
|
5045
5223
|
componentPadding
|
|
5046
5224
|
),
|
|
5047
5225
|
"aria-label": "Previous month",
|
|
5048
5226
|
onClick: () => setBaseMonth(baseMonth.subtract({ months: 1 })),
|
|
5049
|
-
children: /* @__PURE__ */ (0,
|
|
5227
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Icon, { name: "chevron_left", size: 24 })
|
|
5050
5228
|
}
|
|
5051
|
-
) : /* @__PURE__ */ (0,
|
|
5052
|
-
/* @__PURE__ */ (0,
|
|
5053
|
-
/* @__PURE__ */ (0,
|
|
5229
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("span", { className: (0, import_clsx38.default)(componentPadding, "mr-1") }),
|
|
5230
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex gap-desktop-compact-component-padding", children: [
|
|
5231
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
5054
5232
|
"button",
|
|
5055
5233
|
{
|
|
5056
5234
|
ref: (el) => {
|
|
@@ -5065,13 +5243,13 @@ function CalendarPane({
|
|
|
5065
5243
|
children: month.name
|
|
5066
5244
|
}
|
|
5067
5245
|
),
|
|
5068
|
-
/* @__PURE__ */ (0,
|
|
5246
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
5069
5247
|
Menu,
|
|
5070
5248
|
{
|
|
5071
5249
|
show: monthMenuOpen,
|
|
5072
5250
|
positionTo: monthMenuRef,
|
|
5073
5251
|
setShow: () => setMonthMenuOpen(false),
|
|
5074
|
-
children: months.map((x) => [x, getMonthDataWith(x + 1)]).map(([x, m]) => /* @__PURE__ */ (0,
|
|
5252
|
+
children: months.map((x) => [x, getMonthDataWith(x + 1)]).map(([x, m]) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
5075
5253
|
MenuOption,
|
|
5076
5254
|
{
|
|
5077
5255
|
selected: baseMonth.month === x + 1,
|
|
@@ -5085,7 +5263,7 @@ function CalendarPane({
|
|
|
5085
5263
|
))
|
|
5086
5264
|
}
|
|
5087
5265
|
),
|
|
5088
|
-
/* @__PURE__ */ (0,
|
|
5266
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
5089
5267
|
"button",
|
|
5090
5268
|
{
|
|
5091
5269
|
ref: (el) => {
|
|
@@ -5100,13 +5278,13 @@ function CalendarPane({
|
|
|
5100
5278
|
children: month.year
|
|
5101
5279
|
}
|
|
5102
5280
|
),
|
|
5103
|
-
/* @__PURE__ */ (0,
|
|
5281
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
5104
5282
|
Menu,
|
|
5105
5283
|
{
|
|
5106
5284
|
show: yearMenuOpen,
|
|
5107
5285
|
positionTo: yearMenuRef,
|
|
5108
5286
|
setShow: () => setYearMenuOpen(false),
|
|
5109
|
-
children: years.map((y) => /* @__PURE__ */ (0,
|
|
5287
|
+
children: years.map((y) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
5110
5288
|
MenuOption,
|
|
5111
5289
|
{
|
|
5112
5290
|
selected: baseMonth.year === y,
|
|
@@ -5121,28 +5299,28 @@ function CalendarPane({
|
|
|
5121
5299
|
}
|
|
5122
5300
|
)
|
|
5123
5301
|
] }),
|
|
5124
|
-
(mode === "double" ? idx === 1 : true) ? /* @__PURE__ */ (0,
|
|
5302
|
+
(mode === "double" ? idx === 1 : true) ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
5125
5303
|
"button",
|
|
5126
5304
|
{
|
|
5127
5305
|
id: id ? `${id}-next-month-button` : void 0,
|
|
5128
5306
|
"data-testid": testid ? `${testid}-next-month-button` : void 0,
|
|
5129
5307
|
type: "button",
|
|
5130
|
-
className: (0,
|
|
5308
|
+
className: (0, import_clsx38.default)(
|
|
5131
5309
|
"flex items-center justify-center rounded-base hover:bg-action-100 active:bg-action-300 text-icon-action-primary-normal",
|
|
5132
5310
|
componentPadding
|
|
5133
5311
|
),
|
|
5134
5312
|
"aria-label": "Next month",
|
|
5135
5313
|
onClick: () => setBaseMonth(baseMonth.add({ months: 1 })),
|
|
5136
|
-
children: /* @__PURE__ */ (0,
|
|
5314
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Icon, { name: "chevron_right", size: 24 })
|
|
5137
5315
|
}
|
|
5138
|
-
) : /* @__PURE__ */ (0,
|
|
5316
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("span", { className: (0, import_clsx38.default)(componentPadding, "ml-1") })
|
|
5139
5317
|
]
|
|
5140
5318
|
}
|
|
5141
5319
|
),
|
|
5142
|
-
/* @__PURE__ */ (0,
|
|
5320
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: (0, import_clsx38.default)("grid grid-cols-7"), children: weekDays.map((d) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
5143
5321
|
"span",
|
|
5144
5322
|
{
|
|
5145
|
-
className: (0,
|
|
5323
|
+
className: (0, import_clsx38.default)(
|
|
5146
5324
|
typography.caption,
|
|
5147
5325
|
"text-text-secondary-normal text-center",
|
|
5148
5326
|
"w-10"
|
|
@@ -5151,7 +5329,7 @@ function CalendarPane({
|
|
|
5151
5329
|
},
|
|
5152
5330
|
d
|
|
5153
5331
|
)) }),
|
|
5154
|
-
/* @__PURE__ */ (0,
|
|
5332
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: (0, import_clsx38.default)("grid grid-cols-7"), children: Array.from({ length: totalCells }).map((_, i) => {
|
|
5155
5333
|
const day = i - emptyCells + 1;
|
|
5156
5334
|
const date = month.date.with({ day: 1 }).add({
|
|
5157
5335
|
days: i - emptyCells
|
|
@@ -5165,7 +5343,7 @@ function CalendarPane({
|
|
|
5165
5343
|
const hoverDateIsAfterPendingFrom = hoveredDate && pendingFrom && import_polyfill.Temporal.PlainDate.compare(hoveredDate, pendingFrom) >= 0;
|
|
5166
5344
|
const isRangeStart = mode === "single" && disableRange ? false : !pendingFrom && isInMonth && fromDate && date.equals(fromDate) || hoverDateIsAfterPendingFrom && date.equals(pendingFrom);
|
|
5167
5345
|
const isRangeEnd = mode === "single" && disableRange ? false : !pendingFrom && isInMonth && toDate && date.equals(toDate) || hoverDateIsBeforePendingFrom && date.equals(pendingFrom);
|
|
5168
|
-
return /* @__PURE__ */ (0,
|
|
5346
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
5169
5347
|
DateCell,
|
|
5170
5348
|
{
|
|
5171
5349
|
id: id ? `${id}-date-${date.toString()}` : void 0,
|
|
@@ -5190,10 +5368,10 @@ function CalendarPane({
|
|
|
5190
5368
|
]
|
|
5191
5369
|
}
|
|
5192
5370
|
),
|
|
5193
|
-
mode === "double" && idx === 0 && /* @__PURE__ */ (0,
|
|
5371
|
+
mode === "double" && idx === 0 && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
5194
5372
|
"div",
|
|
5195
5373
|
{
|
|
5196
|
-
className: (0,
|
|
5374
|
+
className: (0, import_clsx38.default)(
|
|
5197
5375
|
"self-stretch bg-border-primary-normal rounded-base",
|
|
5198
5376
|
// 1px width, full height, matches Figma divider
|
|
5199
5377
|
"w-px"
|
|
@@ -5204,7 +5382,7 @@ function CalendarPane({
|
|
|
5204
5382
|
}
|
|
5205
5383
|
|
|
5206
5384
|
// src/components/DateInput.tsx
|
|
5207
|
-
var
|
|
5385
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
5208
5386
|
var DateInput = (_a) => {
|
|
5209
5387
|
var _b = _a, {
|
|
5210
5388
|
id,
|
|
@@ -5225,24 +5403,24 @@ var DateInput = (_a) => {
|
|
|
5225
5403
|
"readOnly",
|
|
5226
5404
|
"label"
|
|
5227
5405
|
]);
|
|
5228
|
-
const [visible, setVisible] = (0,
|
|
5229
|
-
const [inputValue, setInputValue] = (0,
|
|
5230
|
-
const [isTyping, setIsTyping] = (0,
|
|
5231
|
-
const popoverRef = (0,
|
|
5232
|
-
const triggerRef = (0,
|
|
5233
|
-
const rootRef = (0,
|
|
5234
|
-
const [calendarPosition, setCalendarPosition] = (0,
|
|
5406
|
+
const [visible, setVisible] = (0, import_react38.useState)(false);
|
|
5407
|
+
const [inputValue, setInputValue] = (0, import_react38.useState)("");
|
|
5408
|
+
const [isTyping, setIsTyping] = (0, import_react38.useState)(false);
|
|
5409
|
+
const popoverRef = (0, import_react38.useRef)(null);
|
|
5410
|
+
const triggerRef = (0, import_react38.useRef)(null);
|
|
5411
|
+
const rootRef = (0, import_react38.useRef)(null);
|
|
5412
|
+
const [calendarPosition, setCalendarPosition] = (0, import_react38.useState)({
|
|
5235
5413
|
top: 0,
|
|
5236
5414
|
left: 0,
|
|
5237
5415
|
width: 0
|
|
5238
5416
|
});
|
|
5239
5417
|
const [from, to] = [value, ""];
|
|
5240
|
-
(0,
|
|
5418
|
+
(0, import_react38.useEffect)(() => {
|
|
5241
5419
|
if (!isTyping) {
|
|
5242
5420
|
setInputValue(formatDisplayValue(from));
|
|
5243
5421
|
}
|
|
5244
5422
|
}, [from, isTyping]);
|
|
5245
|
-
(0,
|
|
5423
|
+
(0, import_react38.useLayoutEffect)(() => {
|
|
5246
5424
|
if (visible) {
|
|
5247
5425
|
updatePosition();
|
|
5248
5426
|
}
|
|
@@ -5257,7 +5435,7 @@ var DateInput = (_a) => {
|
|
|
5257
5435
|
});
|
|
5258
5436
|
}
|
|
5259
5437
|
};
|
|
5260
|
-
(0,
|
|
5438
|
+
(0, import_react38.useEffect)(() => {
|
|
5261
5439
|
updatePosition();
|
|
5262
5440
|
const resizeObserver = new ResizeObserver(updatePosition);
|
|
5263
5441
|
if (triggerRef.current) {
|
|
@@ -5269,7 +5447,7 @@ var DateInput = (_a) => {
|
|
|
5269
5447
|
window.removeEventListener("scroll", updatePosition);
|
|
5270
5448
|
};
|
|
5271
5449
|
}, []);
|
|
5272
|
-
(0,
|
|
5450
|
+
(0, import_react38.useEffect)(() => {
|
|
5273
5451
|
const handleKeyDown2 = (event) => {
|
|
5274
5452
|
var _a2;
|
|
5275
5453
|
if (event.key === "Escape" && popoverRef.current) {
|
|
@@ -5282,7 +5460,7 @@ var DateInput = (_a) => {
|
|
|
5282
5460
|
document.removeEventListener("keydown", handleKeyDown2);
|
|
5283
5461
|
};
|
|
5284
5462
|
});
|
|
5285
|
-
(0,
|
|
5463
|
+
(0, import_react38.useEffect)(() => {
|
|
5286
5464
|
const handleClickOutside = (event) => {
|
|
5287
5465
|
if (popoverRef.current && !popoverRef.current.contains(event.target) && triggerRef.current && !triggerRef.current.contains(event.target)) {
|
|
5288
5466
|
setVisible(false);
|
|
@@ -5363,8 +5541,8 @@ var DateInput = (_a) => {
|
|
|
5363
5541
|
}
|
|
5364
5542
|
}
|
|
5365
5543
|
};
|
|
5366
|
-
return /* @__PURE__ */ (0,
|
|
5367
|
-
/* @__PURE__ */ (0,
|
|
5544
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "relative", children: [
|
|
5545
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
5368
5546
|
InputBase,
|
|
5369
5547
|
__spreadProps(__spreadValues({
|
|
5370
5548
|
id,
|
|
@@ -5378,7 +5556,7 @@ var DateInput = (_a) => {
|
|
|
5378
5556
|
placeholder,
|
|
5379
5557
|
disabled,
|
|
5380
5558
|
readOnly,
|
|
5381
|
-
after: /* @__PURE__ */ (0,
|
|
5559
|
+
after: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Icon, { name: "calendar_month" }),
|
|
5382
5560
|
onFocus: handleFocus,
|
|
5383
5561
|
onClick: handleClick,
|
|
5384
5562
|
onChange: handleInputChange,
|
|
@@ -5389,7 +5567,7 @@ var DateInput = (_a) => {
|
|
|
5389
5567
|
})
|
|
5390
5568
|
),
|
|
5391
5569
|
visible && !readOnly && (0, import_react_dom4.createPortal)(
|
|
5392
|
-
/* @__PURE__ */ (0,
|
|
5570
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
5393
5571
|
"div",
|
|
5394
5572
|
{
|
|
5395
5573
|
ref: (el) => {
|
|
@@ -5401,7 +5579,7 @@ var DateInput = (_a) => {
|
|
|
5401
5579
|
left: `${calendarPosition.left}px`,
|
|
5402
5580
|
minWidth: `${calendarPosition.width}px`
|
|
5403
5581
|
},
|
|
5404
|
-
children: /* @__PURE__ */ (0,
|
|
5582
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
5405
5583
|
CalendarRange,
|
|
5406
5584
|
{
|
|
5407
5585
|
id: id ? `${id}-calendar` : void 0,
|