@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
|
@@ -62,7 +62,7 @@ __export(DateRangeInput_exports, {
|
|
|
62
62
|
DateRangeInput: () => DateRangeInput
|
|
63
63
|
});
|
|
64
64
|
module.exports = __toCommonJS(DateRangeInput_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
|
|
@@ -4056,7 +4056,7 @@ var Tooltip = ({
|
|
|
4056
4056
|
id,
|
|
4057
4057
|
"data-testid": testid,
|
|
4058
4058
|
ref,
|
|
4059
|
-
className: "relative inline-grid grid-cols-[auto_1fr] items-center",
|
|
4059
|
+
className: "relative inline-grid grid-cols-[auto_1fr] items-center cursor-pointer",
|
|
4060
4060
|
onMouseEnter: handleMouseEnter,
|
|
4061
4061
|
onMouseLeave: handleMouseLeave,
|
|
4062
4062
|
children: [
|
|
@@ -4647,12 +4647,11 @@ var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
|
4647
4647
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
4648
4648
|
|
|
4649
4649
|
// src/components/Grid.tsx
|
|
4650
|
-
var import_react27 = require("react");
|
|
4651
4650
|
var import_clsx30 = __toESM(require("clsx"), 1);
|
|
4652
4651
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
4653
4652
|
|
|
4654
4653
|
// src/components/ProductImagePreview/ProductPrimaryImage.tsx
|
|
4655
|
-
var
|
|
4654
|
+
var import_react27 = require("react");
|
|
4656
4655
|
|
|
4657
4656
|
// src/components/Spinner.tsx
|
|
4658
4657
|
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
@@ -4688,7 +4687,7 @@ Spinner.displayName = "Spinner";
|
|
|
4688
4687
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
4689
4688
|
|
|
4690
4689
|
// src/components/ProductImagePreview/ZoomWindow.tsx
|
|
4691
|
-
var
|
|
4690
|
+
var import_react28 = require("react");
|
|
4692
4691
|
|
|
4693
4692
|
// src/components/Surface.tsx
|
|
4694
4693
|
var import_clsx31 = __toESM(require("clsx"), 1);
|
|
@@ -4733,22 +4732,202 @@ var import_clsx32 = require("clsx");
|
|
|
4733
4732
|
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
4734
4733
|
|
|
4735
4734
|
// src/components/ProductImagePreview/MobileImageCarousel.tsx
|
|
4736
|
-
var
|
|
4735
|
+
var import_react29 = require("react");
|
|
4737
4736
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
4738
4737
|
|
|
4739
4738
|
// src/components/ProductImagePreview/useProductImagePreview.ts
|
|
4740
|
-
var
|
|
4739
|
+
var import_react30 = require("react");
|
|
4741
4740
|
|
|
4742
4741
|
// src/components/ProductImagePreview/index.tsx
|
|
4743
4742
|
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
4744
4743
|
|
|
4745
4744
|
// src/components/CompactImagesPreview.tsx
|
|
4746
|
-
var
|
|
4745
|
+
var import_react31 = require("react");
|
|
4747
4746
|
var import_clsx33 = __toESM(require("clsx"), 1);
|
|
4748
4747
|
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
4749
4748
|
|
|
4750
|
-
// src/components/
|
|
4749
|
+
// src/components/SimpleTable.tsx
|
|
4750
|
+
var import_clsx34 = __toESM(require("clsx"), 1);
|
|
4751
4751
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
4752
|
+
|
|
4753
|
+
// src/components/PDFViewer/index.tsx
|
|
4754
|
+
var import_react34 = require("react");
|
|
4755
|
+
|
|
4756
|
+
// src/components/PDFViewer/PDFElement.tsx
|
|
4757
|
+
var import_react_pdf2 = require("@mikecousins/react-pdf");
|
|
4758
|
+
var import_react33 = require("react");
|
|
4759
|
+
|
|
4760
|
+
// src/components/PDFViewer/PDFPage.tsx
|
|
4761
|
+
var import_react_pdf = require("@mikecousins/react-pdf");
|
|
4762
|
+
var import_react32 = require("react");
|
|
4763
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
4764
|
+
|
|
4765
|
+
// src/components/PDFViewer/PDFElement.tsx
|
|
4766
|
+
var import_clsx35 = __toESM(require("clsx"), 1);
|
|
4767
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
4768
|
+
|
|
4769
|
+
// src/components/PDFViewer/DownloadIcon.tsx
|
|
4770
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
4771
|
+
|
|
4772
|
+
// src/components/PDFViewer/PDFNavigation.tsx
|
|
4773
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
4774
|
+
|
|
4775
|
+
// src/components/PDFViewer/index.tsx
|
|
4776
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
4777
|
+
|
|
4778
|
+
// src/components/ListGroup.tsx
|
|
4779
|
+
var import_react35 = require("react");
|
|
4780
|
+
var import_clsx36 = __toESM(require("clsx"), 1);
|
|
4781
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
4782
|
+
|
|
4783
|
+
// src/components/Pagination.tsx
|
|
4784
|
+
var import_react36 = require("react");
|
|
4785
|
+
var import_clsx37 = __toESM(require("clsx"), 1);
|
|
4786
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
4787
|
+
var Pagination = ({
|
|
4788
|
+
totalPages,
|
|
4789
|
+
currentPage,
|
|
4790
|
+
onPageChange,
|
|
4791
|
+
id,
|
|
4792
|
+
testid,
|
|
4793
|
+
className,
|
|
4794
|
+
disabled
|
|
4795
|
+
}) => {
|
|
4796
|
+
const goTo = (0, import_react36.useCallback)(
|
|
4797
|
+
(page) => {
|
|
4798
|
+
if (disabled) return;
|
|
4799
|
+
onPageChange(page);
|
|
4800
|
+
},
|
|
4801
|
+
[onPageChange, disabled]
|
|
4802
|
+
);
|
|
4803
|
+
const handleKey = (e) => {
|
|
4804
|
+
if (disabled) return;
|
|
4805
|
+
if (e.key === "ArrowLeft") {
|
|
4806
|
+
e.preventDefault();
|
|
4807
|
+
goTo(currentPage - 1);
|
|
4808
|
+
} else if (e.key === "ArrowRight") {
|
|
4809
|
+
e.preventDefault();
|
|
4810
|
+
goTo(currentPage + 1);
|
|
4811
|
+
}
|
|
4812
|
+
};
|
|
4813
|
+
const pageTokens = (0, import_react36.useMemo)(() => {
|
|
4814
|
+
if (totalPages <= 5) {
|
|
4815
|
+
return Array.from({ length: totalPages }, (_, i) => i + 1);
|
|
4816
|
+
}
|
|
4817
|
+
const pages = /* @__PURE__ */ new Set();
|
|
4818
|
+
pages.add(1);
|
|
4819
|
+
pages.add(totalPages);
|
|
4820
|
+
if (currentPage <= 3) {
|
|
4821
|
+
pages.add(2);
|
|
4822
|
+
pages.add(3);
|
|
4823
|
+
pages.add(4);
|
|
4824
|
+
} else if (currentPage >= totalPages - 2) {
|
|
4825
|
+
pages.add(totalPages - 1);
|
|
4826
|
+
pages.add(totalPages - 2);
|
|
4827
|
+
pages.add(totalPages - 3);
|
|
4828
|
+
} else {
|
|
4829
|
+
pages.add(currentPage - 1);
|
|
4830
|
+
pages.add(currentPage);
|
|
4831
|
+
pages.add(currentPage + 1);
|
|
4832
|
+
}
|
|
4833
|
+
const sorted = Array.from(pages).sort((a, b) => a - b);
|
|
4834
|
+
const tokens = [];
|
|
4835
|
+
for (let i = 0; i < sorted.length; i++) {
|
|
4836
|
+
const value = sorted[i];
|
|
4837
|
+
const prev = sorted[i - 1];
|
|
4838
|
+
if (i > 0) {
|
|
4839
|
+
if (value - prev === 2) {
|
|
4840
|
+
tokens.push(prev + 1);
|
|
4841
|
+
} else if (value - prev > 2) {
|
|
4842
|
+
tokens.push("ellipsis");
|
|
4843
|
+
}
|
|
4844
|
+
}
|
|
4845
|
+
tokens.push(value);
|
|
4846
|
+
}
|
|
4847
|
+
return tokens;
|
|
4848
|
+
}, [totalPages, currentPage]);
|
|
4849
|
+
if (totalPages <= 1) return null;
|
|
4850
|
+
const buttonClass = (0, import_clsx37.default)(
|
|
4851
|
+
"cursor-pointer disabled:cursor-default",
|
|
4852
|
+
paddingUsingComponentGap,
|
|
4853
|
+
"w-8 h-8",
|
|
4854
|
+
"flex items-center justify-center",
|
|
4855
|
+
"bg-transparent",
|
|
4856
|
+
"box-content",
|
|
4857
|
+
"hover:bg-background-grouped-secondary-normal",
|
|
4858
|
+
"focus:bg-background-grouped-secondary-normal focus:outline-0",
|
|
4859
|
+
"disabled:bg-transparent disabled:text-text-action-primary-disabled"
|
|
4860
|
+
);
|
|
4861
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
4862
|
+
"nav",
|
|
4863
|
+
{
|
|
4864
|
+
id,
|
|
4865
|
+
"data-testid": testid,
|
|
4866
|
+
"aria-label": "Pagination",
|
|
4867
|
+
onKeyDown: handleKey,
|
|
4868
|
+
className: (0, import_clsx37.default)(
|
|
4869
|
+
"flex items-center",
|
|
4870
|
+
"border border-border-primary-normal",
|
|
4871
|
+
"bg-background-grouped-primary-normal",
|
|
4872
|
+
"rounded-sm",
|
|
4873
|
+
className
|
|
4874
|
+
),
|
|
4875
|
+
children: [
|
|
4876
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
4877
|
+
"button",
|
|
4878
|
+
{
|
|
4879
|
+
disabled: disabled || currentPage <= 1,
|
|
4880
|
+
"aria-label": "Previous page",
|
|
4881
|
+
onClick: () => goTo(currentPage - 1),
|
|
4882
|
+
className: (0, import_clsx37.default)(buttonClass, "border-r-1 border-border-primary-normal"),
|
|
4883
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Icon, { name: "keyboard_arrow_left" })
|
|
4884
|
+
}
|
|
4885
|
+
),
|
|
4886
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("ul", { className: (0, import_clsx37.default)("flex items-center"), children: pageTokens.map((token, index) => {
|
|
4887
|
+
if (token === "ellipsis") {
|
|
4888
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
4889
|
+
"li",
|
|
4890
|
+
{
|
|
4891
|
+
className: "w-8 h-8 select-none text-text-action-primary-disabled",
|
|
4892
|
+
children: "\u2026"
|
|
4893
|
+
},
|
|
4894
|
+
`ellipsis-${index}`
|
|
4895
|
+
);
|
|
4896
|
+
}
|
|
4897
|
+
const selected = token === currentPage;
|
|
4898
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
4899
|
+
"button",
|
|
4900
|
+
{
|
|
4901
|
+
"aria-label": `Page ${token}`,
|
|
4902
|
+
"aria-current": selected ? "page" : void 0,
|
|
4903
|
+
disabled,
|
|
4904
|
+
onClick: () => goTo(token),
|
|
4905
|
+
className: (0, import_clsx37.default)(
|
|
4906
|
+
buttonClass,
|
|
4907
|
+
selected && "border-x-1 bg-background-grouped-secondary-normal border-border-primary-normal"
|
|
4908
|
+
),
|
|
4909
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Subheader, { align: "center", weight: "bold", children: token })
|
|
4910
|
+
}
|
|
4911
|
+
) }, token);
|
|
4912
|
+
}) }),
|
|
4913
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
4914
|
+
"button",
|
|
4915
|
+
{
|
|
4916
|
+
disabled: disabled || currentPage >= totalPages,
|
|
4917
|
+
"aria-label": "Next page",
|
|
4918
|
+
onClick: () => goTo(currentPage + 1),
|
|
4919
|
+
className: (0, import_clsx37.default)(buttonClass, "border-l-1 border-border-primary-normal"),
|
|
4920
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Icon, { name: "keyboard_arrow_right" })
|
|
4921
|
+
}
|
|
4922
|
+
)
|
|
4923
|
+
]
|
|
4924
|
+
}
|
|
4925
|
+
);
|
|
4926
|
+
};
|
|
4927
|
+
Pagination.displayName = "Pagination";
|
|
4928
|
+
|
|
4929
|
+
// src/components/CalendarRange.tsx
|
|
4930
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
4752
4931
|
function DateCell(_a) {
|
|
4753
4932
|
var _b = _a, {
|
|
4754
4933
|
date,
|
|
@@ -4783,12 +4962,12 @@ function DateCell(_a) {
|
|
|
4783
4962
|
"id",
|
|
4784
4963
|
"testid"
|
|
4785
4964
|
]);
|
|
4786
|
-
return /* @__PURE__ */ (0,
|
|
4965
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
4787
4966
|
"span",
|
|
4788
4967
|
__spreadProps(__spreadValues({}, props), {
|
|
4789
4968
|
id,
|
|
4790
4969
|
"data-testid": testid,
|
|
4791
|
-
className: (0,
|
|
4970
|
+
className: (0, import_clsx38.default)(
|
|
4792
4971
|
"flex items-center justify-center aspect-square select-none transition-colors border duration-100 font-medium",
|
|
4793
4972
|
typography.caption,
|
|
4794
4973
|
cellPadding,
|
|
@@ -4858,20 +5037,20 @@ function CalendarRange({
|
|
|
4858
5037
|
const fromDate = parseDate(from);
|
|
4859
5038
|
const toDate = parseDate(to);
|
|
4860
5039
|
const today = import_polyfill.Temporal.Now.plainDateISO();
|
|
4861
|
-
const [baseMonth, setBaseMonth] = (0,
|
|
5040
|
+
const [baseMonth, setBaseMonth] = (0, import_react37.useState)(
|
|
4862
5041
|
fromDate != null ? fromDate : today.with({ day: 1 })
|
|
4863
5042
|
);
|
|
4864
|
-
const [selecting, setSelecting] = (0,
|
|
4865
|
-
const [pendingFrom, setPendingFrom] = (0,
|
|
4866
|
-
const [hoveredDate, setHoveredDate] = (0,
|
|
4867
|
-
(0,
|
|
5043
|
+
const [selecting, setSelecting] = (0, import_react37.useState)("from");
|
|
5044
|
+
const [pendingFrom, setPendingFrom] = (0, import_react37.useState)(void 0);
|
|
5045
|
+
const [hoveredDate, setHoveredDate] = (0, import_react37.useState)(void 0);
|
|
5046
|
+
(0, import_react37.useEffect)(() => {
|
|
4868
5047
|
if (fromDate) {
|
|
4869
5048
|
setBaseMonth(fromDate.with({ day: 1 }));
|
|
4870
5049
|
} else if (toDate) {
|
|
4871
5050
|
setBaseMonth(toDate.with({ day: 1 }));
|
|
4872
5051
|
}
|
|
4873
5052
|
}, [from, to]);
|
|
4874
|
-
(0,
|
|
5053
|
+
(0, import_react37.useEffect)(() => {
|
|
4875
5054
|
if (fromDate && toDate) {
|
|
4876
5055
|
setSelecting("from");
|
|
4877
5056
|
setPendingFrom(void 0);
|
|
@@ -4937,12 +5116,12 @@ function CalendarRange({
|
|
|
4937
5116
|
}
|
|
4938
5117
|
return false;
|
|
4939
5118
|
}
|
|
4940
|
-
return /* @__PURE__ */ (0,
|
|
5119
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
4941
5120
|
"div",
|
|
4942
5121
|
{
|
|
4943
5122
|
id,
|
|
4944
5123
|
"data-testid": testid,
|
|
4945
|
-
className: (0,
|
|
5124
|
+
className: (0, import_clsx38.default)(
|
|
4946
5125
|
"relative bg-background-grouped-primary-normal rounded-base w-fit",
|
|
4947
5126
|
layoutPaddding,
|
|
4948
5127
|
layoutGap,
|
|
@@ -4950,15 +5129,15 @@ function CalendarRange({
|
|
|
4950
5129
|
// baseTransition,
|
|
4951
5130
|
"overflow-hidden"
|
|
4952
5131
|
),
|
|
4953
|
-
children: /* @__PURE__ */ (0,
|
|
5132
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
4954
5133
|
"div",
|
|
4955
5134
|
{
|
|
4956
|
-
className: (0,
|
|
5135
|
+
className: (0, import_clsx38.default)(
|
|
4957
5136
|
"flex flex-row items-start justify-start bg-background-primary-normal overflow-clip",
|
|
4958
5137
|
layoutGap
|
|
4959
5138
|
),
|
|
4960
5139
|
children: (mode === "double" ? [0, 1] : [0]).map((offset, idx) => {
|
|
4961
|
-
return /* @__PURE__ */ (0,
|
|
5140
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
4962
5141
|
CalendarPane,
|
|
4963
5142
|
{
|
|
4964
5143
|
getMonthData,
|
|
@@ -5016,45 +5195,45 @@ function CalendarPane({
|
|
|
5016
5195
|
const years = Array.from({ length: 100 }).map(
|
|
5017
5196
|
(_, i) => baseMonth.year - 50 + i
|
|
5018
5197
|
);
|
|
5019
|
-
const [monthMenuOpen, setMonthMenuOpen] = (0,
|
|
5020
|
-
const [yearMenuOpen, setYearMenuOpen] = (0,
|
|
5021
|
-
const monthMenuRef = (0,
|
|
5022
|
-
const yearMenuRef = (0,
|
|
5198
|
+
const [monthMenuOpen, setMonthMenuOpen] = (0, import_react37.useState)(false);
|
|
5199
|
+
const [yearMenuOpen, setYearMenuOpen] = (0, import_react37.useState)(false);
|
|
5200
|
+
const monthMenuRef = (0, import_react37.useRef)(null);
|
|
5201
|
+
const yearMenuRef = (0, import_react37.useRef)(null);
|
|
5023
5202
|
const month = getMonthData(offset);
|
|
5024
5203
|
const totalCells = 42;
|
|
5025
5204
|
const emptyCells = month.firstDayOffset;
|
|
5026
|
-
return /* @__PURE__ */ (0,
|
|
5027
|
-
/* @__PURE__ */ (0,
|
|
5205
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_react37.default.Fragment, { children: [
|
|
5206
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
|
|
5028
5207
|
"div",
|
|
5029
5208
|
{
|
|
5030
|
-
className: (0,
|
|
5209
|
+
className: (0, import_clsx38.default)("flex flex-col"),
|
|
5031
5210
|
children: [
|
|
5032
|
-
/* @__PURE__ */ (0,
|
|
5211
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
|
|
5033
5212
|
"div",
|
|
5034
5213
|
{
|
|
5035
|
-
className: (0,
|
|
5214
|
+
className: (0, import_clsx38.default)(
|
|
5036
5215
|
"flex flex-row items-center justify-between",
|
|
5037
5216
|
typography.label,
|
|
5038
5217
|
"text-text-action-primary-normal"
|
|
5039
5218
|
),
|
|
5040
5219
|
children: [
|
|
5041
|
-
idx === 0 ? /* @__PURE__ */ (0,
|
|
5220
|
+
idx === 0 ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
5042
5221
|
"button",
|
|
5043
5222
|
{
|
|
5044
5223
|
id: id ? `${id}-prev-month-button` : void 0,
|
|
5045
5224
|
"data-testid": testid ? `${testid}-prev-month-button` : void 0,
|
|
5046
5225
|
type: "button",
|
|
5047
|
-
className: (0,
|
|
5226
|
+
className: (0, import_clsx38.default)(
|
|
5048
5227
|
"flex items-center justify-center rounded-base hover:bg-action-100 active:bg-action-300 text-icon-action-primary-normal",
|
|
5049
5228
|
componentPadding
|
|
5050
5229
|
),
|
|
5051
5230
|
"aria-label": "Previous month",
|
|
5052
5231
|
onClick: () => setBaseMonth(baseMonth.subtract({ months: 1 })),
|
|
5053
|
-
children: /* @__PURE__ */ (0,
|
|
5232
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Icon, { name: "chevron_left", size: 24 })
|
|
5054
5233
|
}
|
|
5055
|
-
) : /* @__PURE__ */ (0,
|
|
5056
|
-
/* @__PURE__ */ (0,
|
|
5057
|
-
/* @__PURE__ */ (0,
|
|
5234
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { className: (0, import_clsx38.default)(componentPadding, "mr-1") }),
|
|
5235
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex gap-desktop-compact-component-padding", children: [
|
|
5236
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
5058
5237
|
"button",
|
|
5059
5238
|
{
|
|
5060
5239
|
ref: (el) => {
|
|
@@ -5069,13 +5248,13 @@ function CalendarPane({
|
|
|
5069
5248
|
children: month.name
|
|
5070
5249
|
}
|
|
5071
5250
|
),
|
|
5072
|
-
/* @__PURE__ */ (0,
|
|
5251
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
5073
5252
|
Menu,
|
|
5074
5253
|
{
|
|
5075
5254
|
show: monthMenuOpen,
|
|
5076
5255
|
positionTo: monthMenuRef,
|
|
5077
5256
|
setShow: () => setMonthMenuOpen(false),
|
|
5078
|
-
children: months.map((x) => [x, getMonthDataWith(x + 1)]).map(([x, m]) => /* @__PURE__ */ (0,
|
|
5257
|
+
children: months.map((x) => [x, getMonthDataWith(x + 1)]).map(([x, m]) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
5079
5258
|
MenuOption,
|
|
5080
5259
|
{
|
|
5081
5260
|
selected: baseMonth.month === x + 1,
|
|
@@ -5089,7 +5268,7 @@ function CalendarPane({
|
|
|
5089
5268
|
))
|
|
5090
5269
|
}
|
|
5091
5270
|
),
|
|
5092
|
-
/* @__PURE__ */ (0,
|
|
5271
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
5093
5272
|
"button",
|
|
5094
5273
|
{
|
|
5095
5274
|
ref: (el) => {
|
|
@@ -5104,13 +5283,13 @@ function CalendarPane({
|
|
|
5104
5283
|
children: month.year
|
|
5105
5284
|
}
|
|
5106
5285
|
),
|
|
5107
|
-
/* @__PURE__ */ (0,
|
|
5286
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
5108
5287
|
Menu,
|
|
5109
5288
|
{
|
|
5110
5289
|
show: yearMenuOpen,
|
|
5111
5290
|
positionTo: yearMenuRef,
|
|
5112
5291
|
setShow: () => setYearMenuOpen(false),
|
|
5113
|
-
children: years.map((y) => /* @__PURE__ */ (0,
|
|
5292
|
+
children: years.map((y) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
5114
5293
|
MenuOption,
|
|
5115
5294
|
{
|
|
5116
5295
|
selected: baseMonth.year === y,
|
|
@@ -5125,28 +5304,28 @@ function CalendarPane({
|
|
|
5125
5304
|
}
|
|
5126
5305
|
)
|
|
5127
5306
|
] }),
|
|
5128
|
-
(mode === "double" ? idx === 1 : true) ? /* @__PURE__ */ (0,
|
|
5307
|
+
(mode === "double" ? idx === 1 : true) ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
5129
5308
|
"button",
|
|
5130
5309
|
{
|
|
5131
5310
|
id: id ? `${id}-next-month-button` : void 0,
|
|
5132
5311
|
"data-testid": testid ? `${testid}-next-month-button` : void 0,
|
|
5133
5312
|
type: "button",
|
|
5134
|
-
className: (0,
|
|
5313
|
+
className: (0, import_clsx38.default)(
|
|
5135
5314
|
"flex items-center justify-center rounded-base hover:bg-action-100 active:bg-action-300 text-icon-action-primary-normal",
|
|
5136
5315
|
componentPadding
|
|
5137
5316
|
),
|
|
5138
5317
|
"aria-label": "Next month",
|
|
5139
5318
|
onClick: () => setBaseMonth(baseMonth.add({ months: 1 })),
|
|
5140
|
-
children: /* @__PURE__ */ (0,
|
|
5319
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Icon, { name: "chevron_right", size: 24 })
|
|
5141
5320
|
}
|
|
5142
|
-
) : /* @__PURE__ */ (0,
|
|
5321
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { className: (0, import_clsx38.default)(componentPadding, "ml-1") })
|
|
5143
5322
|
]
|
|
5144
5323
|
}
|
|
5145
5324
|
),
|
|
5146
|
-
/* @__PURE__ */ (0,
|
|
5325
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: (0, import_clsx38.default)("grid grid-cols-7"), children: weekDays.map((d) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
5147
5326
|
"span",
|
|
5148
5327
|
{
|
|
5149
|
-
className: (0,
|
|
5328
|
+
className: (0, import_clsx38.default)(
|
|
5150
5329
|
typography.caption,
|
|
5151
5330
|
"text-text-secondary-normal text-center",
|
|
5152
5331
|
"w-10"
|
|
@@ -5155,7 +5334,7 @@ function CalendarPane({
|
|
|
5155
5334
|
},
|
|
5156
5335
|
d
|
|
5157
5336
|
)) }),
|
|
5158
|
-
/* @__PURE__ */ (0,
|
|
5337
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: (0, import_clsx38.default)("grid grid-cols-7"), children: Array.from({ length: totalCells }).map((_, i) => {
|
|
5159
5338
|
const day = i - emptyCells + 1;
|
|
5160
5339
|
const date = month.date.with({ day: 1 }).add({
|
|
5161
5340
|
days: i - emptyCells
|
|
@@ -5169,7 +5348,7 @@ function CalendarPane({
|
|
|
5169
5348
|
const hoverDateIsAfterPendingFrom = hoveredDate && pendingFrom && import_polyfill.Temporal.PlainDate.compare(hoveredDate, pendingFrom) >= 0;
|
|
5170
5349
|
const isRangeStart = mode === "single" && disableRange ? false : !pendingFrom && isInMonth && fromDate && date.equals(fromDate) || hoverDateIsAfterPendingFrom && date.equals(pendingFrom);
|
|
5171
5350
|
const isRangeEnd = mode === "single" && disableRange ? false : !pendingFrom && isInMonth && toDate && date.equals(toDate) || hoverDateIsBeforePendingFrom && date.equals(pendingFrom);
|
|
5172
|
-
return /* @__PURE__ */ (0,
|
|
5351
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
5173
5352
|
DateCell,
|
|
5174
5353
|
{
|
|
5175
5354
|
id: id ? `${id}-date-${date.toString()}` : void 0,
|
|
@@ -5194,10 +5373,10 @@ function CalendarPane({
|
|
|
5194
5373
|
]
|
|
5195
5374
|
}
|
|
5196
5375
|
),
|
|
5197
|
-
mode === "double" && idx === 0 && /* @__PURE__ */ (0,
|
|
5376
|
+
mode === "double" && idx === 0 && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
5198
5377
|
"div",
|
|
5199
5378
|
{
|
|
5200
|
-
className: (0,
|
|
5379
|
+
className: (0, import_clsx38.default)(
|
|
5201
5380
|
"self-stretch bg-border-primary-normal rounded-base",
|
|
5202
5381
|
// 1px width, full height, matches Figma divider
|
|
5203
5382
|
"w-px"
|
|
@@ -5208,7 +5387,7 @@ function CalendarPane({
|
|
|
5208
5387
|
}
|
|
5209
5388
|
|
|
5210
5389
|
// src/components/DateRangeInput.tsx
|
|
5211
|
-
var
|
|
5390
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
5212
5391
|
var DateRangeInput = (_a) => {
|
|
5213
5392
|
var _b = _a, {
|
|
5214
5393
|
id,
|
|
@@ -5233,24 +5412,24 @@ var DateRangeInput = (_a) => {
|
|
|
5233
5412
|
"disableRange",
|
|
5234
5413
|
"label"
|
|
5235
5414
|
]);
|
|
5236
|
-
const [visible, setVisible] = (0,
|
|
5237
|
-
const [inputValue, setInputValue] = (0,
|
|
5238
|
-
const [isTyping, setIsTyping] = (0,
|
|
5239
|
-
const popoverRef = (0,
|
|
5240
|
-
const rootRef = (0,
|
|
5241
|
-
const triggerRef = (0,
|
|
5242
|
-
const [calendarPosition, setCalendarPosition] = (0,
|
|
5415
|
+
const [visible, setVisible] = (0, import_react38.useState)(false);
|
|
5416
|
+
const [inputValue, setInputValue] = (0, import_react38.useState)("");
|
|
5417
|
+
const [isTyping, setIsTyping] = (0, import_react38.useState)(false);
|
|
5418
|
+
const popoverRef = (0, import_react38.useRef)(null);
|
|
5419
|
+
const rootRef = (0, import_react38.useRef)(null);
|
|
5420
|
+
const triggerRef = (0, import_react38.useRef)(null);
|
|
5421
|
+
const [calendarPosition, setCalendarPosition] = (0, import_react38.useState)({
|
|
5243
5422
|
top: 0,
|
|
5244
5423
|
left: 0,
|
|
5245
5424
|
width: 0
|
|
5246
5425
|
});
|
|
5247
5426
|
const [from, to] = value.split("|");
|
|
5248
|
-
(0,
|
|
5427
|
+
(0, import_react38.useEffect)(() => {
|
|
5249
5428
|
if (!isTyping) {
|
|
5250
5429
|
setInputValue(formatDisplayValue(from, to));
|
|
5251
5430
|
}
|
|
5252
5431
|
}, [from, to, isTyping, disableRange]);
|
|
5253
|
-
(0,
|
|
5432
|
+
(0, import_react38.useLayoutEffect)(() => {
|
|
5254
5433
|
if (visible) {
|
|
5255
5434
|
updatePosition();
|
|
5256
5435
|
}
|
|
@@ -5265,7 +5444,7 @@ var DateRangeInput = (_a) => {
|
|
|
5265
5444
|
});
|
|
5266
5445
|
}
|
|
5267
5446
|
};
|
|
5268
|
-
(0,
|
|
5447
|
+
(0, import_react38.useEffect)(() => {
|
|
5269
5448
|
updatePosition();
|
|
5270
5449
|
const resizeObserver = new ResizeObserver(updatePosition);
|
|
5271
5450
|
if (triggerRef.current) {
|
|
@@ -5277,7 +5456,7 @@ var DateRangeInput = (_a) => {
|
|
|
5277
5456
|
window.removeEventListener("scroll", updatePosition);
|
|
5278
5457
|
};
|
|
5279
5458
|
}, []);
|
|
5280
|
-
(0,
|
|
5459
|
+
(0, import_react38.useEffect)(() => {
|
|
5281
5460
|
const handleKeyDown2 = (event) => {
|
|
5282
5461
|
var _a2;
|
|
5283
5462
|
if (event.key === "Escape" && popoverRef.current) {
|
|
@@ -5290,7 +5469,7 @@ var DateRangeInput = (_a) => {
|
|
|
5290
5469
|
document.removeEventListener("keydown", handleKeyDown2);
|
|
5291
5470
|
};
|
|
5292
5471
|
}, []);
|
|
5293
|
-
(0,
|
|
5472
|
+
(0, import_react38.useEffect)(() => {
|
|
5294
5473
|
const handleClickOutside = (event) => {
|
|
5295
5474
|
if (popoverRef.current && !popoverRef.current.contains(event.target) && triggerRef.current && !triggerRef.current.contains(event.target)) {
|
|
5296
5475
|
setVisible(false);
|
|
@@ -5625,8 +5804,8 @@ var DateRangeInput = (_a) => {
|
|
|
5625
5804
|
}
|
|
5626
5805
|
}
|
|
5627
5806
|
};
|
|
5628
|
-
return /* @__PURE__ */ (0,
|
|
5629
|
-
/* @__PURE__ */ (0,
|
|
5807
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_jsx_runtime61.Fragment, { children: [
|
|
5808
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
5630
5809
|
InputBase,
|
|
5631
5810
|
__spreadProps(__spreadValues({
|
|
5632
5811
|
id,
|
|
@@ -5640,7 +5819,7 @@ var DateRangeInput = (_a) => {
|
|
|
5640
5819
|
placeholder: disableRange ? "MM/DD/YYYY" : placeholder,
|
|
5641
5820
|
disabled,
|
|
5642
5821
|
readOnly,
|
|
5643
|
-
after: /* @__PURE__ */ (0,
|
|
5822
|
+
after: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Icon, { name: "calendar_month" }),
|
|
5644
5823
|
onFocus: handleFocus,
|
|
5645
5824
|
onClick: handleClick,
|
|
5646
5825
|
onChange: handleInputChange,
|
|
@@ -5651,7 +5830,7 @@ var DateRangeInput = (_a) => {
|
|
|
5651
5830
|
})
|
|
5652
5831
|
),
|
|
5653
5832
|
visible && !readOnly && (0, import_react_dom4.createPortal)(
|
|
5654
|
-
/* @__PURE__ */ (0,
|
|
5833
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
5655
5834
|
"div",
|
|
5656
5835
|
{
|
|
5657
5836
|
ref: (el) => {
|
|
@@ -5663,7 +5842,7 @@ var DateRangeInput = (_a) => {
|
|
|
5663
5842
|
left: `${calendarPosition.left}px`,
|
|
5664
5843
|
minWidth: `${calendarPosition.width}px`
|
|
5665
5844
|
},
|
|
5666
|
-
children: /* @__PURE__ */ (0,
|
|
5845
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
5667
5846
|
CalendarRange,
|
|
5668
5847
|
{
|
|
5669
5848
|
id: id ? `${id}-calendar` : void 0,
|