@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(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,17 +4732,17 @@ 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
|
|
|
@@ -4751,8 +4750,187 @@ var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
|
4751
4750
|
var import_clsx34 = __toESM(require("clsx"), 1);
|
|
4752
4751
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
4753
4752
|
|
|
4754
|
-
// src/components/
|
|
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");
|
|
4755
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/SkeletonParagraph.tsx
|
|
4930
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
4931
|
+
|
|
4932
|
+
// src/components/CalendarRange.tsx
|
|
4933
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
4756
4934
|
function DateCell(_a) {
|
|
4757
4935
|
var _b = _a, {
|
|
4758
4936
|
date,
|
|
@@ -4787,12 +4965,12 @@ function DateCell(_a) {
|
|
|
4787
4965
|
"id",
|
|
4788
4966
|
"testid"
|
|
4789
4967
|
]);
|
|
4790
|
-
return /* @__PURE__ */ (0,
|
|
4968
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
4791
4969
|
"span",
|
|
4792
4970
|
__spreadProps(__spreadValues({}, props), {
|
|
4793
4971
|
id,
|
|
4794
4972
|
"data-testid": testid,
|
|
4795
|
-
className: (0,
|
|
4973
|
+
className: (0, import_clsx38.default)(
|
|
4796
4974
|
"flex items-center justify-center aspect-square select-none transition-colors border duration-100 font-medium",
|
|
4797
4975
|
typography.caption,
|
|
4798
4976
|
cellPadding,
|
|
@@ -4862,20 +5040,20 @@ function CalendarRange({
|
|
|
4862
5040
|
const fromDate = parseDate(from);
|
|
4863
5041
|
const toDate = parseDate(to);
|
|
4864
5042
|
const today = import_polyfill.Temporal.Now.plainDateISO();
|
|
4865
|
-
const [baseMonth, setBaseMonth] = (0,
|
|
5043
|
+
const [baseMonth, setBaseMonth] = (0, import_react37.useState)(
|
|
4866
5044
|
fromDate != null ? fromDate : today.with({ day: 1 })
|
|
4867
5045
|
);
|
|
4868
|
-
const [selecting, setSelecting] = (0,
|
|
4869
|
-
const [pendingFrom, setPendingFrom] = (0,
|
|
4870
|
-
const [hoveredDate, setHoveredDate] = (0,
|
|
4871
|
-
(0,
|
|
5046
|
+
const [selecting, setSelecting] = (0, import_react37.useState)("from");
|
|
5047
|
+
const [pendingFrom, setPendingFrom] = (0, import_react37.useState)(void 0);
|
|
5048
|
+
const [hoveredDate, setHoveredDate] = (0, import_react37.useState)(void 0);
|
|
5049
|
+
(0, import_react37.useEffect)(() => {
|
|
4872
5050
|
if (fromDate) {
|
|
4873
5051
|
setBaseMonth(fromDate.with({ day: 1 }));
|
|
4874
5052
|
} else if (toDate) {
|
|
4875
5053
|
setBaseMonth(toDate.with({ day: 1 }));
|
|
4876
5054
|
}
|
|
4877
5055
|
}, [from, to]);
|
|
4878
|
-
(0,
|
|
5056
|
+
(0, import_react37.useEffect)(() => {
|
|
4879
5057
|
if (fromDate && toDate) {
|
|
4880
5058
|
setSelecting("from");
|
|
4881
5059
|
setPendingFrom(void 0);
|
|
@@ -4941,12 +5119,12 @@ function CalendarRange({
|
|
|
4941
5119
|
}
|
|
4942
5120
|
return false;
|
|
4943
5121
|
}
|
|
4944
|
-
return /* @__PURE__ */ (0,
|
|
5122
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
4945
5123
|
"div",
|
|
4946
5124
|
{
|
|
4947
5125
|
id,
|
|
4948
5126
|
"data-testid": testid,
|
|
4949
|
-
className: (0,
|
|
5127
|
+
className: (0, import_clsx38.default)(
|
|
4950
5128
|
"relative bg-background-grouped-primary-normal rounded-base w-fit",
|
|
4951
5129
|
layoutPaddding,
|
|
4952
5130
|
layoutGap,
|
|
@@ -4954,15 +5132,15 @@ function CalendarRange({
|
|
|
4954
5132
|
// baseTransition,
|
|
4955
5133
|
"overflow-hidden"
|
|
4956
5134
|
),
|
|
4957
|
-
children: /* @__PURE__ */ (0,
|
|
5135
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
4958
5136
|
"div",
|
|
4959
5137
|
{
|
|
4960
|
-
className: (0,
|
|
5138
|
+
className: (0, import_clsx38.default)(
|
|
4961
5139
|
"flex flex-row items-start justify-start bg-background-primary-normal overflow-clip",
|
|
4962
5140
|
layoutGap
|
|
4963
5141
|
),
|
|
4964
5142
|
children: (mode === "double" ? [0, 1] : [0]).map((offset, idx) => {
|
|
4965
|
-
return /* @__PURE__ */ (0,
|
|
5143
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
4966
5144
|
CalendarPane,
|
|
4967
5145
|
{
|
|
4968
5146
|
getMonthData,
|
|
@@ -5020,45 +5198,45 @@ function CalendarPane({
|
|
|
5020
5198
|
const years = Array.from({ length: 100 }).map(
|
|
5021
5199
|
(_, i) => baseMonth.year - 50 + i
|
|
5022
5200
|
);
|
|
5023
|
-
const [monthMenuOpen, setMonthMenuOpen] = (0,
|
|
5024
|
-
const [yearMenuOpen, setYearMenuOpen] = (0,
|
|
5025
|
-
const monthMenuRef = (0,
|
|
5026
|
-
const yearMenuRef = (0,
|
|
5201
|
+
const [monthMenuOpen, setMonthMenuOpen] = (0, import_react37.useState)(false);
|
|
5202
|
+
const [yearMenuOpen, setYearMenuOpen] = (0, import_react37.useState)(false);
|
|
5203
|
+
const monthMenuRef = (0, import_react37.useRef)(null);
|
|
5204
|
+
const yearMenuRef = (0, import_react37.useRef)(null);
|
|
5027
5205
|
const month = getMonthData(offset);
|
|
5028
5206
|
const totalCells = 42;
|
|
5029
5207
|
const emptyCells = month.firstDayOffset;
|
|
5030
|
-
return /* @__PURE__ */ (0,
|
|
5031
|
-
/* @__PURE__ */ (0,
|
|
5208
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_react37.default.Fragment, { children: [
|
|
5209
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
|
|
5032
5210
|
"div",
|
|
5033
5211
|
{
|
|
5034
|
-
className: (0,
|
|
5212
|
+
className: (0, import_clsx38.default)("flex flex-col"),
|
|
5035
5213
|
children: [
|
|
5036
|
-
/* @__PURE__ */ (0,
|
|
5214
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
|
|
5037
5215
|
"div",
|
|
5038
5216
|
{
|
|
5039
|
-
className: (0,
|
|
5217
|
+
className: (0, import_clsx38.default)(
|
|
5040
5218
|
"flex flex-row items-center justify-between",
|
|
5041
5219
|
typography.label,
|
|
5042
5220
|
"text-text-action-primary-normal"
|
|
5043
5221
|
),
|
|
5044
5222
|
children: [
|
|
5045
|
-
idx === 0 ? /* @__PURE__ */ (0,
|
|
5223
|
+
idx === 0 ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
5046
5224
|
"button",
|
|
5047
5225
|
{
|
|
5048
5226
|
id: id ? `${id}-prev-month-button` : void 0,
|
|
5049
5227
|
"data-testid": testid ? `${testid}-prev-month-button` : void 0,
|
|
5050
5228
|
type: "button",
|
|
5051
|
-
className: (0,
|
|
5229
|
+
className: (0, import_clsx38.default)(
|
|
5052
5230
|
"flex items-center justify-center rounded-base hover:bg-action-100 active:bg-action-300 text-icon-action-primary-normal",
|
|
5053
5231
|
componentPadding
|
|
5054
5232
|
),
|
|
5055
5233
|
"aria-label": "Previous month",
|
|
5056
5234
|
onClick: () => setBaseMonth(baseMonth.subtract({ months: 1 })),
|
|
5057
|
-
children: /* @__PURE__ */ (0,
|
|
5235
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Icon, { name: "chevron_left", size: 24 })
|
|
5058
5236
|
}
|
|
5059
|
-
) : /* @__PURE__ */ (0,
|
|
5060
|
-
/* @__PURE__ */ (0,
|
|
5061
|
-
/* @__PURE__ */ (0,
|
|
5237
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("span", { className: (0, import_clsx38.default)(componentPadding, "mr-1") }),
|
|
5238
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex gap-desktop-compact-component-padding", children: [
|
|
5239
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
5062
5240
|
"button",
|
|
5063
5241
|
{
|
|
5064
5242
|
ref: (el) => {
|
|
@@ -5073,13 +5251,13 @@ function CalendarPane({
|
|
|
5073
5251
|
children: month.name
|
|
5074
5252
|
}
|
|
5075
5253
|
),
|
|
5076
|
-
/* @__PURE__ */ (0,
|
|
5254
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
5077
5255
|
Menu,
|
|
5078
5256
|
{
|
|
5079
5257
|
show: monthMenuOpen,
|
|
5080
5258
|
positionTo: monthMenuRef,
|
|
5081
5259
|
setShow: () => setMonthMenuOpen(false),
|
|
5082
|
-
children: months.map((x) => [x, getMonthDataWith(x + 1)]).map(([x, m]) => /* @__PURE__ */ (0,
|
|
5260
|
+
children: months.map((x) => [x, getMonthDataWith(x + 1)]).map(([x, m]) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
5083
5261
|
MenuOption,
|
|
5084
5262
|
{
|
|
5085
5263
|
selected: baseMonth.month === x + 1,
|
|
@@ -5093,7 +5271,7 @@ function CalendarPane({
|
|
|
5093
5271
|
))
|
|
5094
5272
|
}
|
|
5095
5273
|
),
|
|
5096
|
-
/* @__PURE__ */ (0,
|
|
5274
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
5097
5275
|
"button",
|
|
5098
5276
|
{
|
|
5099
5277
|
ref: (el) => {
|
|
@@ -5108,13 +5286,13 @@ function CalendarPane({
|
|
|
5108
5286
|
children: month.year
|
|
5109
5287
|
}
|
|
5110
5288
|
),
|
|
5111
|
-
/* @__PURE__ */ (0,
|
|
5289
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
5112
5290
|
Menu,
|
|
5113
5291
|
{
|
|
5114
5292
|
show: yearMenuOpen,
|
|
5115
5293
|
positionTo: yearMenuRef,
|
|
5116
5294
|
setShow: () => setYearMenuOpen(false),
|
|
5117
|
-
children: years.map((y) => /* @__PURE__ */ (0,
|
|
5295
|
+
children: years.map((y) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
5118
5296
|
MenuOption,
|
|
5119
5297
|
{
|
|
5120
5298
|
selected: baseMonth.year === y,
|
|
@@ -5129,28 +5307,28 @@ function CalendarPane({
|
|
|
5129
5307
|
}
|
|
5130
5308
|
)
|
|
5131
5309
|
] }),
|
|
5132
|
-
(mode === "double" ? idx === 1 : true) ? /* @__PURE__ */ (0,
|
|
5310
|
+
(mode === "double" ? idx === 1 : true) ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
5133
5311
|
"button",
|
|
5134
5312
|
{
|
|
5135
5313
|
id: id ? `${id}-next-month-button` : void 0,
|
|
5136
5314
|
"data-testid": testid ? `${testid}-next-month-button` : void 0,
|
|
5137
5315
|
type: "button",
|
|
5138
|
-
className: (0,
|
|
5316
|
+
className: (0, import_clsx38.default)(
|
|
5139
5317
|
"flex items-center justify-center rounded-base hover:bg-action-100 active:bg-action-300 text-icon-action-primary-normal",
|
|
5140
5318
|
componentPadding
|
|
5141
5319
|
),
|
|
5142
5320
|
"aria-label": "Next month",
|
|
5143
5321
|
onClick: () => setBaseMonth(baseMonth.add({ months: 1 })),
|
|
5144
|
-
children: /* @__PURE__ */ (0,
|
|
5322
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Icon, { name: "chevron_right", size: 24 })
|
|
5145
5323
|
}
|
|
5146
|
-
) : /* @__PURE__ */ (0,
|
|
5324
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("span", { className: (0, import_clsx38.default)(componentPadding, "ml-1") })
|
|
5147
5325
|
]
|
|
5148
5326
|
}
|
|
5149
5327
|
),
|
|
5150
|
-
/* @__PURE__ */ (0,
|
|
5328
|
+
/* @__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)(
|
|
5151
5329
|
"span",
|
|
5152
5330
|
{
|
|
5153
|
-
className: (0,
|
|
5331
|
+
className: (0, import_clsx38.default)(
|
|
5154
5332
|
typography.caption,
|
|
5155
5333
|
"text-text-secondary-normal text-center",
|
|
5156
5334
|
"w-10"
|
|
@@ -5159,7 +5337,7 @@ function CalendarPane({
|
|
|
5159
5337
|
},
|
|
5160
5338
|
d
|
|
5161
5339
|
)) }),
|
|
5162
|
-
/* @__PURE__ */ (0,
|
|
5340
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: (0, import_clsx38.default)("grid grid-cols-7"), children: Array.from({ length: totalCells }).map((_, i) => {
|
|
5163
5341
|
const day = i - emptyCells + 1;
|
|
5164
5342
|
const date = month.date.with({ day: 1 }).add({
|
|
5165
5343
|
days: i - emptyCells
|
|
@@ -5173,7 +5351,7 @@ function CalendarPane({
|
|
|
5173
5351
|
const hoverDateIsAfterPendingFrom = hoveredDate && pendingFrom && import_polyfill.Temporal.PlainDate.compare(hoveredDate, pendingFrom) >= 0;
|
|
5174
5352
|
const isRangeStart = mode === "single" && disableRange ? false : !pendingFrom && isInMonth && fromDate && date.equals(fromDate) || hoverDateIsAfterPendingFrom && date.equals(pendingFrom);
|
|
5175
5353
|
const isRangeEnd = mode === "single" && disableRange ? false : !pendingFrom && isInMonth && toDate && date.equals(toDate) || hoverDateIsBeforePendingFrom && date.equals(pendingFrom);
|
|
5176
|
-
return /* @__PURE__ */ (0,
|
|
5354
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
5177
5355
|
DateCell,
|
|
5178
5356
|
{
|
|
5179
5357
|
id: id ? `${id}-date-${date.toString()}` : void 0,
|
|
@@ -5198,10 +5376,10 @@ function CalendarPane({
|
|
|
5198
5376
|
]
|
|
5199
5377
|
}
|
|
5200
5378
|
),
|
|
5201
|
-
mode === "double" && idx === 0 && /* @__PURE__ */ (0,
|
|
5379
|
+
mode === "double" && idx === 0 && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
5202
5380
|
"div",
|
|
5203
5381
|
{
|
|
5204
|
-
className: (0,
|
|
5382
|
+
className: (0, import_clsx38.default)(
|
|
5205
5383
|
"self-stretch bg-border-primary-normal rounded-base",
|
|
5206
5384
|
// 1px width, full height, matches Figma divider
|
|
5207
5385
|
"w-px"
|
|
@@ -5212,7 +5390,7 @@ function CalendarPane({
|
|
|
5212
5390
|
}
|
|
5213
5391
|
|
|
5214
5392
|
// src/components/DateRangeInput.tsx
|
|
5215
|
-
var
|
|
5393
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
5216
5394
|
var DateRangeInput = (_a) => {
|
|
5217
5395
|
var _b = _a, {
|
|
5218
5396
|
id,
|
|
@@ -5237,24 +5415,24 @@ var DateRangeInput = (_a) => {
|
|
|
5237
5415
|
"disableRange",
|
|
5238
5416
|
"label"
|
|
5239
5417
|
]);
|
|
5240
|
-
const [visible, setVisible] = (0,
|
|
5241
|
-
const [inputValue, setInputValue] = (0,
|
|
5242
|
-
const [isTyping, setIsTyping] = (0,
|
|
5243
|
-
const popoverRef = (0,
|
|
5244
|
-
const rootRef = (0,
|
|
5245
|
-
const triggerRef = (0,
|
|
5246
|
-
const [calendarPosition, setCalendarPosition] = (0,
|
|
5418
|
+
const [visible, setVisible] = (0, import_react38.useState)(false);
|
|
5419
|
+
const [inputValue, setInputValue] = (0, import_react38.useState)("");
|
|
5420
|
+
const [isTyping, setIsTyping] = (0, import_react38.useState)(false);
|
|
5421
|
+
const popoverRef = (0, import_react38.useRef)(null);
|
|
5422
|
+
const rootRef = (0, import_react38.useRef)(null);
|
|
5423
|
+
const triggerRef = (0, import_react38.useRef)(null);
|
|
5424
|
+
const [calendarPosition, setCalendarPosition] = (0, import_react38.useState)({
|
|
5247
5425
|
top: 0,
|
|
5248
5426
|
left: 0,
|
|
5249
5427
|
width: 0
|
|
5250
5428
|
});
|
|
5251
5429
|
const [from, to] = value.split("|");
|
|
5252
|
-
(0,
|
|
5430
|
+
(0, import_react38.useEffect)(() => {
|
|
5253
5431
|
if (!isTyping) {
|
|
5254
5432
|
setInputValue(formatDisplayValue(from, to));
|
|
5255
5433
|
}
|
|
5256
5434
|
}, [from, to, isTyping, disableRange]);
|
|
5257
|
-
(0,
|
|
5435
|
+
(0, import_react38.useLayoutEffect)(() => {
|
|
5258
5436
|
if (visible) {
|
|
5259
5437
|
updatePosition();
|
|
5260
5438
|
}
|
|
@@ -5269,7 +5447,7 @@ var DateRangeInput = (_a) => {
|
|
|
5269
5447
|
});
|
|
5270
5448
|
}
|
|
5271
5449
|
};
|
|
5272
|
-
(0,
|
|
5450
|
+
(0, import_react38.useEffect)(() => {
|
|
5273
5451
|
updatePosition();
|
|
5274
5452
|
const resizeObserver = new ResizeObserver(updatePosition);
|
|
5275
5453
|
if (triggerRef.current) {
|
|
@@ -5281,7 +5459,7 @@ var DateRangeInput = (_a) => {
|
|
|
5281
5459
|
window.removeEventListener("scroll", updatePosition);
|
|
5282
5460
|
};
|
|
5283
5461
|
}, []);
|
|
5284
|
-
(0,
|
|
5462
|
+
(0, import_react38.useEffect)(() => {
|
|
5285
5463
|
const handleKeyDown2 = (event) => {
|
|
5286
5464
|
var _a2;
|
|
5287
5465
|
if (event.key === "Escape" && popoverRef.current) {
|
|
@@ -5294,7 +5472,7 @@ var DateRangeInput = (_a) => {
|
|
|
5294
5472
|
document.removeEventListener("keydown", handleKeyDown2);
|
|
5295
5473
|
};
|
|
5296
5474
|
}, []);
|
|
5297
|
-
(0,
|
|
5475
|
+
(0, import_react38.useEffect)(() => {
|
|
5298
5476
|
const handleClickOutside = (event) => {
|
|
5299
5477
|
if (popoverRef.current && !popoverRef.current.contains(event.target) && triggerRef.current && !triggerRef.current.contains(event.target)) {
|
|
5300
5478
|
setVisible(false);
|
|
@@ -5629,8 +5807,8 @@ var DateRangeInput = (_a) => {
|
|
|
5629
5807
|
}
|
|
5630
5808
|
}
|
|
5631
5809
|
};
|
|
5632
|
-
return /* @__PURE__ */ (0,
|
|
5633
|
-
/* @__PURE__ */ (0,
|
|
5810
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(import_jsx_runtime62.Fragment, { children: [
|
|
5811
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
5634
5812
|
InputBase,
|
|
5635
5813
|
__spreadProps(__spreadValues({
|
|
5636
5814
|
id,
|
|
@@ -5644,7 +5822,7 @@ var DateRangeInput = (_a) => {
|
|
|
5644
5822
|
placeholder: disableRange ? "MM/DD/YYYY" : placeholder,
|
|
5645
5823
|
disabled,
|
|
5646
5824
|
readOnly,
|
|
5647
|
-
after: /* @__PURE__ */ (0,
|
|
5825
|
+
after: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Icon, { name: "calendar_month" }),
|
|
5648
5826
|
onFocus: handleFocus,
|
|
5649
5827
|
onClick: handleClick,
|
|
5650
5828
|
onChange: handleInputChange,
|
|
@@ -5655,7 +5833,7 @@ var DateRangeInput = (_a) => {
|
|
|
5655
5833
|
})
|
|
5656
5834
|
),
|
|
5657
5835
|
visible && !readOnly && (0, import_react_dom4.createPortal)(
|
|
5658
|
-
/* @__PURE__ */ (0,
|
|
5836
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
5659
5837
|
"div",
|
|
5660
5838
|
{
|
|
5661
5839
|
ref: (el) => {
|
|
@@ -5667,7 +5845,7 @@ var DateRangeInput = (_a) => {
|
|
|
5667
5845
|
left: `${calendarPosition.left}px`,
|
|
5668
5846
|
minWidth: `${calendarPosition.width}px`
|
|
5669
5847
|
},
|
|
5670
|
-
children: /* @__PURE__ */ (0,
|
|
5848
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
5671
5849
|
CalendarRange,
|
|
5672
5850
|
{
|
|
5673
5851
|
id: id ? `${id}-calendar` : void 0,
|