@aivenio/aquarium 1.16.0 → 1.17.1
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/_variables.scss +1 -1
- package/dist/_variables_timescale.scss +1 -1
- package/dist/atoms.cjs +8 -4
- package/dist/atoms.mjs +8 -4
- package/dist/src/atoms/Navigation/Navigation.d.ts +3 -1
- package/dist/src/atoms/Navigation/Navigation.js +5 -4
- package/dist/src/molecules/Box/Box.d.ts +34 -1
- package/dist/src/molecules/Box/Box.js +2 -1
- package/dist/src/molecules/Breadcrumbs/Breadcrumbs.js +2 -2
- package/dist/src/molecules/DataList/DataList.d.ts +1 -1
- package/dist/src/molecules/DataList/DataList.js +5 -5
- package/dist/src/molecules/DataTable/DataTable.d.ts +1 -1
- package/dist/src/molecules/DataTable/DataTable.js +4 -4
- package/dist/src/molecules/Flexbox/Flexbox.d.ts +3 -0
- package/dist/src/molecules/Flexbox/Flexbox.js +4 -1
- package/dist/src/molecules/Flexbox/FlexboxItem.d.ts +3 -0
- package/dist/src/molecules/Flexbox/FlexboxItem.js +4 -1
- package/dist/src/molecules/Modal/Modal.js +2 -2
- package/dist/src/molecules/MultiInput/InputChip.js +13 -9
- package/dist/src/molecules/Navigation/Navigation.d.ts +3 -1
- package/dist/src/molecules/PageHeader/PageHeader.js +4 -2
- package/dist/src/utils/table/types.d.ts +4 -0
- package/dist/styles.css +26 -14
- package/dist/styles_timescaledb.css +26 -14
- package/dist/system.cjs +214 -196
- package/dist/system.mjs +209 -191
- package/dist/tsconfig.module.tsbuildinfo +1 -1
- package/dist/types/tailwindGenerated.d.ts +1 -1
- package/package.json +1 -1
package/dist/system.mjs
CHANGED
@@ -3517,6 +3517,7 @@ var Box = (_a) => {
|
|
3517
3517
|
style: __spreadValues(__spreadValues({}, styles), style)
|
3518
3518
|
}, rest));
|
3519
3519
|
};
|
3520
|
+
Box.Flex = createSimpleComponent(Box, { display: "flex" }, "Box.Flex");
|
3520
3521
|
var BorderBox = createSimpleComponent(
|
3521
3522
|
Box,
|
3522
3523
|
{ className: "rounded border", borderColor: "grey-10" },
|
@@ -3803,7 +3804,7 @@ var asCrumb = (Component, displayName, options = { isActive: false }) => {
|
|
3803
3804
|
}), /* @__PURE__ */ React19.createElement("span", {
|
3804
3805
|
className: classNames2(
|
3805
3806
|
tw("flex flex-row flex-nowrap items-center gap-x-3 ", {
|
3806
|
-
"text-primary-80
|
3807
|
+
"text-primary-80 hover:text-primary-70": !options.isActive,
|
3807
3808
|
"text-grey-90": options.isActive
|
3808
3809
|
})
|
3809
3810
|
)
|
@@ -5245,7 +5246,7 @@ var Container2 = ({ maxWidth = "xl", children }) => /* @__PURE__ */ React42.crea
|
|
5245
5246
|
}, children);
|
5246
5247
|
|
5247
5248
|
// src/molecules/DataList/DataList.tsx
|
5248
|
-
import
|
5249
|
+
import React53 from "react";
|
5249
5250
|
import compact from "lodash/compact";
|
5250
5251
|
import isFunction from "lodash/isFunction";
|
5251
5252
|
|
@@ -5696,8 +5697,15 @@ var getDisabledItemKeys = (children) => {
|
|
5696
5697
|
return keys.flat().filter((key) => key !== null);
|
5697
5698
|
};
|
5698
5699
|
|
5699
|
-
// src/molecules/
|
5700
|
+
// src/molecules/List/List.tsx
|
5700
5701
|
import React47 from "react";
|
5702
|
+
var List2 = ({ items, renderItem, container = React47.Fragment }) => {
|
5703
|
+
const Component = container;
|
5704
|
+
return /* @__PURE__ */ React47.createElement(Component, null, items.map(renderItem));
|
5705
|
+
};
|
5706
|
+
|
5707
|
+
// src/molecules/Template/Template.tsx
|
5708
|
+
import React48 from "react";
|
5701
5709
|
var Template = ({
|
5702
5710
|
children,
|
5703
5711
|
columns,
|
@@ -5723,23 +5731,23 @@ var Template = ({
|
|
5723
5731
|
rowGap,
|
5724
5732
|
columnGap
|
5725
5733
|
});
|
5726
|
-
return /* @__PURE__ */
|
5734
|
+
return /* @__PURE__ */ React48.createElement("div", {
|
5727
5735
|
style: __spreadValues({}, styles)
|
5728
5736
|
}, children);
|
5729
5737
|
};
|
5730
5738
|
|
5731
5739
|
// src/atoms/DataList/DataList.tsx
|
5732
|
-
import
|
5740
|
+
import React51 from "react";
|
5733
5741
|
|
5734
5742
|
// src/atoms/Table/Table.tsx
|
5735
|
-
import
|
5743
|
+
import React50 from "react";
|
5736
5744
|
|
5737
5745
|
// src/atoms/RadioButton/RadioButton.tsx
|
5738
|
-
import
|
5739
|
-
var RadioButton =
|
5746
|
+
import React49 from "react";
|
5747
|
+
var RadioButton = React49.forwardRef(
|
5740
5748
|
(_a, ref) => {
|
5741
5749
|
var _b = _a, { id, children, name, disabled = false, readOnly = false } = _b, props = __objRest(_b, ["id", "children", "name", "disabled", "readOnly"]);
|
5742
|
-
return /* @__PURE__ */
|
5750
|
+
return /* @__PURE__ */ React49.createElement("input", __spreadProps(__spreadValues({
|
5743
5751
|
id,
|
5744
5752
|
ref,
|
5745
5753
|
type: "radio",
|
@@ -5765,29 +5773,29 @@ var RadioButton = React48.forwardRef(
|
|
5765
5773
|
// src/atoms/Table/Table.tsx
|
5766
5774
|
var import_chevronDown3 = __toESM(require_chevronDown());
|
5767
5775
|
var import_chevronUp2 = __toESM(require_chevronUp());
|
5768
|
-
var HeadContext =
|
5776
|
+
var HeadContext = React50.createContext(null);
|
5769
5777
|
var tableClassNames = tw("w-full relative typography-default border-spacing-0");
|
5770
5778
|
var Table = (_a) => {
|
5771
5779
|
var _b = _a, { children, ariaLabel, className } = _b, rest = __objRest(_b, ["children", "ariaLabel", "className"]);
|
5772
|
-
return /* @__PURE__ */
|
5780
|
+
return /* @__PURE__ */ React50.createElement("table", __spreadProps(__spreadValues({}, rest), {
|
5773
5781
|
className: classNames(tableClassNames, className),
|
5774
5782
|
"aria-label": ariaLabel
|
5775
5783
|
}), children);
|
5776
5784
|
};
|
5777
5785
|
var TableHead = (_a) => {
|
5778
5786
|
var _b = _a, { children, sticky } = _b, rest = __objRest(_b, ["children", "sticky"]);
|
5779
|
-
return /* @__PURE__ */
|
5787
|
+
return /* @__PURE__ */ React50.createElement("thead", __spreadValues({}, rest), /* @__PURE__ */ React50.createElement("tr", null, /* @__PURE__ */ React50.createElement(HeadContext.Provider, {
|
5780
5788
|
value: { children, sticky }
|
5781
5789
|
}, children)));
|
5782
5790
|
};
|
5783
5791
|
var TableBody = (_a) => {
|
5784
5792
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
5785
|
-
return /* @__PURE__ */
|
5793
|
+
return /* @__PURE__ */ React50.createElement("tbody", __spreadValues({}, rest), children);
|
5786
5794
|
};
|
5787
5795
|
var rowClassNames = tw("children:border-grey-10 group children:last:border-b-0 hover:bg-grey-0");
|
5788
5796
|
var TableRow = (_a) => {
|
5789
5797
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
5790
|
-
return /* @__PURE__ */
|
5798
|
+
return /* @__PURE__ */ React50.createElement("tr", __spreadProps(__spreadValues({}, rest), {
|
5791
5799
|
className: classNames(rowClassNames, className)
|
5792
5800
|
}), children);
|
5793
5801
|
};
|
@@ -5814,15 +5822,15 @@ var getHeadCellClassNames = (sticky = true, stickyColumn) => {
|
|
5814
5822
|
};
|
5815
5823
|
var TableCell = (_a) => {
|
5816
5824
|
var _b = _a, { children, className, stickyColumn, align = "left" } = _b, rest = __objRest(_b, ["children", "className", "stickyColumn", "align"]);
|
5817
|
-
const headContext =
|
5818
|
-
return headContext ? /* @__PURE__ */
|
5825
|
+
const headContext = React50.useContext(HeadContext);
|
5826
|
+
return headContext ? /* @__PURE__ */ React50.createElement("th", __spreadProps(__spreadValues({}, rest), {
|
5819
5827
|
className: classNames(
|
5820
5828
|
cellClassNames,
|
5821
5829
|
getHeadCellClassNames(headContext.sticky, stickyColumn),
|
5822
5830
|
getAlignClassNames(align),
|
5823
5831
|
className
|
5824
5832
|
)
|
5825
|
-
}), children) : /* @__PURE__ */
|
5833
|
+
}), children) : /* @__PURE__ */ React50.createElement("td", __spreadProps(__spreadValues({}, rest), {
|
5826
5834
|
className: classNames(
|
5827
5835
|
cellClassNames,
|
5828
5836
|
getBodyCellClassNames(true, stickyColumn),
|
@@ -5833,11 +5841,11 @@ var TableCell = (_a) => {
|
|
5833
5841
|
};
|
5834
5842
|
var TableSelectCell = (_a) => {
|
5835
5843
|
var _b = _a, { ariaLabel } = _b, props = __objRest(_b, ["ariaLabel"]);
|
5836
|
-
return /* @__PURE__ */
|
5844
|
+
return /* @__PURE__ */ React50.createElement(Table.Cell, {
|
5837
5845
|
className: tw("leading-[0px]")
|
5838
|
-
}, props.type === "radio" ? /* @__PURE__ */
|
5846
|
+
}, props.type === "radio" ? /* @__PURE__ */ React50.createElement(RadioButton, __spreadValues({
|
5839
5847
|
"aria-label": ariaLabel
|
5840
|
-
}, props)) : /* @__PURE__ */
|
5848
|
+
}, props)) : /* @__PURE__ */ React50.createElement(Checkbox, __spreadValues({
|
5841
5849
|
"aria-label": ariaLabel
|
5842
5850
|
}, props)));
|
5843
5851
|
};
|
@@ -5847,39 +5855,39 @@ var getSortCellIconClassNames = (active) => {
|
|
5847
5855
|
};
|
5848
5856
|
var TableSortCell = (_a) => {
|
5849
5857
|
var _b = _a, { children, direction = "none", onClick } = _b, rest = __objRest(_b, ["children", "direction", "onClick"]);
|
5850
|
-
return /* @__PURE__ */
|
5858
|
+
return /* @__PURE__ */ React50.createElement(Table.Cell, __spreadProps(__spreadValues({}, rest), {
|
5851
5859
|
"aria-sort": direction
|
5852
|
-
}), /* @__PURE__ */
|
5860
|
+
}), /* @__PURE__ */ React50.createElement("span", {
|
5853
5861
|
className: getSortCellButtonClassNames(rest.align),
|
5854
5862
|
role: "button",
|
5855
5863
|
tabIndex: -1,
|
5856
5864
|
onClick
|
5857
|
-
}, children, /* @__PURE__ */
|
5865
|
+
}, children, /* @__PURE__ */ React50.createElement("div", {
|
5858
5866
|
"data-sort-icons": true,
|
5859
5867
|
className: tw("flex flex-col", {
|
5860
5868
|
"invisible group-hover:visible": direction === "none"
|
5861
5869
|
})
|
5862
|
-
}, /* @__PURE__ */
|
5870
|
+
}, /* @__PURE__ */ React50.createElement(InlineIcon, {
|
5863
5871
|
icon: import_chevronUp2.default,
|
5864
5872
|
className: getSortCellIconClassNames(direction === "descending")
|
5865
|
-
}), /* @__PURE__ */
|
5873
|
+
}), /* @__PURE__ */ React50.createElement(InlineIcon, {
|
5866
5874
|
icon: import_chevronDown3.default,
|
5867
5875
|
className: getSortCellIconClassNames(direction === "ascending")
|
5868
5876
|
}))));
|
5869
5877
|
};
|
5870
|
-
var Item4 = ({ image, imageAlt, imageSize = 35, title, caption }) => /* @__PURE__ */
|
5878
|
+
var Item4 = ({ image, imageAlt, imageSize = 35, title, caption }) => /* @__PURE__ */ React50.createElement("div", {
|
5871
5879
|
className: tw("flex gap-4 items-center")
|
5872
|
-
}, image && /* @__PURE__ */
|
5880
|
+
}, image && /* @__PURE__ */ React50.createElement("img", {
|
5873
5881
|
src: image,
|
5874
5882
|
alt: imageAlt,
|
5875
5883
|
style: { width: imageSize, height: imageSize }
|
5876
|
-
}), /* @__PURE__ */
|
5877
|
-
Table.Head =
|
5878
|
-
Table.Body =
|
5879
|
-
Table.Row =
|
5880
|
-
Table.Cell =
|
5881
|
-
Table.SortCell =
|
5882
|
-
Table.SelectCell =
|
5884
|
+
}), /* @__PURE__ */ React50.createElement("div", null, title, caption && /* @__PURE__ */ React50.createElement(Typography2.Caption, null, caption)));
|
5885
|
+
Table.Head = React50.memo(TableHead);
|
5886
|
+
Table.Body = React50.memo(TableBody);
|
5887
|
+
Table.Row = React50.memo(TableRow);
|
5888
|
+
Table.Cell = React50.memo(TableCell);
|
5889
|
+
Table.SortCell = React50.memo(TableSortCell);
|
5890
|
+
Table.SelectCell = React50.memo(TableSelectCell);
|
5883
5891
|
|
5884
5892
|
// src/atoms/DataList/DataList.tsx
|
5885
5893
|
var import_chevronDown4 = __toESM(require_chevronDown());
|
@@ -5891,7 +5899,7 @@ var getAlignClassNames2 = (align) => tw("flex items-center", {
|
|
5891
5899
|
});
|
5892
5900
|
var DataList = (_a) => {
|
5893
5901
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
5894
|
-
return /* @__PURE__ */
|
5902
|
+
return /* @__PURE__ */ React51.createElement("div", __spreadValues({}, rest));
|
5895
5903
|
};
|
5896
5904
|
var HeadCell = (_a) => {
|
5897
5905
|
var _b = _a, {
|
@@ -5905,7 +5913,7 @@ var HeadCell = (_a) => {
|
|
5905
5913
|
"align",
|
5906
5914
|
"stickyColumn"
|
5907
5915
|
]);
|
5908
|
-
return /* @__PURE__ */
|
5916
|
+
return /* @__PURE__ */ React51.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
5909
5917
|
role: "cell",
|
5910
5918
|
className: classNames(
|
5911
5919
|
cellClassNames,
|
@@ -5925,7 +5933,7 @@ var Cell = (_a) => {
|
|
5925
5933
|
"align",
|
5926
5934
|
"stickyColumn"
|
5927
5935
|
]);
|
5928
|
-
return /* @__PURE__ */
|
5936
|
+
return /* @__PURE__ */ React51.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
5929
5937
|
role: "cell",
|
5930
5938
|
className: classNames(
|
5931
5939
|
cellClassNames,
|
@@ -5938,31 +5946,31 @@ var Cell = (_a) => {
|
|
5938
5946
|
};
|
5939
5947
|
var Row = (_a) => {
|
5940
5948
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
5941
|
-
return /* @__PURE__ */
|
5949
|
+
return /* @__PURE__ */ React51.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
5942
5950
|
className: classNames(tw("contents group"), className),
|
5943
5951
|
role: "row"
|
5944
5952
|
}));
|
5945
5953
|
};
|
5946
5954
|
var SortCell = (_a) => {
|
5947
5955
|
var _b = _a, { children, direction = "none", onClick, sticky } = _b, rest = __objRest(_b, ["children", "direction", "onClick", "sticky"]);
|
5948
|
-
return /* @__PURE__ */
|
5956
|
+
return /* @__PURE__ */ React51.createElement(HeadCell, __spreadProps(__spreadValues({}, rest), {
|
5949
5957
|
"aria-sort": direction,
|
5950
5958
|
role: "cell",
|
5951
5959
|
sticky
|
5952
|
-
}), /* @__PURE__ */
|
5960
|
+
}), /* @__PURE__ */ React51.createElement("span", {
|
5953
5961
|
className: getSortCellButtonClassNames(rest.align),
|
5954
5962
|
role: "button",
|
5955
5963
|
tabIndex: -1,
|
5956
5964
|
onClick
|
5957
|
-
}, children, /* @__PURE__ */
|
5965
|
+
}, children, /* @__PURE__ */ React51.createElement("div", {
|
5958
5966
|
"data-sort-icons": true,
|
5959
5967
|
className: tw("flex flex-col", {
|
5960
5968
|
"invisible group-hover:visible": direction === "none"
|
5961
5969
|
})
|
5962
|
-
}, /* @__PURE__ */
|
5970
|
+
}, /* @__PURE__ */ React51.createElement(InlineIcon, {
|
5963
5971
|
icon: import_chevronUp3.default,
|
5964
5972
|
className: getSortCellIconClassNames(direction === "descending")
|
5965
|
-
}), /* @__PURE__ */
|
5973
|
+
}), /* @__PURE__ */ React51.createElement(InlineIcon, {
|
5966
5974
|
icon: import_chevronDown4.default,
|
5967
5975
|
className: getSortCellIconClassNames(direction === "ascending")
|
5968
5976
|
}))));
|
@@ -5990,9 +5998,9 @@ var cellProps = (column) => ({
|
|
5990
5998
|
var columnIsFieldColumn = (column) => Boolean(column && column.field);
|
5991
5999
|
|
5992
6000
|
// src/utils/table/useTableSort.tsx
|
5993
|
-
import
|
6001
|
+
import React52 from "react";
|
5994
6002
|
var useTableSort = () => {
|
5995
|
-
const [sort, setSort] =
|
6003
|
+
const [sort, setSort] = React52.useState();
|
5996
6004
|
const handleSortClick = (column) => {
|
5997
6005
|
if (sort && sort.column.headerName === column.headerName) {
|
5998
6006
|
if (sort.direction === "ascending") {
|
@@ -6029,6 +6037,7 @@ var DataList2 = ({
|
|
6029
6037
|
rows,
|
6030
6038
|
sticky,
|
6031
6039
|
menu,
|
6040
|
+
menuLabel = "Context menu",
|
6032
6041
|
onAction
|
6033
6042
|
}) => {
|
6034
6043
|
const [sort, updateSort] = useTableSort();
|
@@ -6040,54 +6049,54 @@ var DataList2 = ({
|
|
6040
6049
|
}),
|
6041
6050
|
menu ? "auto" : void 0
|
6042
6051
|
]);
|
6043
|
-
return /* @__PURE__ */
|
6052
|
+
return /* @__PURE__ */ React53.createElement(Template, {
|
6044
6053
|
columns: templateColumns
|
6045
6054
|
}, columns.map(
|
6046
|
-
(column) => columnIsFieldColumn(column) && column.sortable || column.sort ? /* @__PURE__ */
|
6055
|
+
(column) => columnIsFieldColumn(column) && column.sortable || column.sort ? /* @__PURE__ */ React53.createElement(DataList.SortCell, __spreadValues({
|
6047
6056
|
direction: sort && sort.column.headerName === column.headerName ? sort.direction : "none",
|
6048
6057
|
onClick: () => updateSort(column),
|
6049
6058
|
sticky
|
6050
|
-
}, cellProps(column)), column.headerName) : /* @__PURE__ */
|
6059
|
+
}, cellProps(column)), column.headerName) : /* @__PURE__ */ React53.createElement(DataList.HeadCell, __spreadProps(__spreadValues({}, cellProps(column)), {
|
6051
6060
|
sticky
|
6052
6061
|
}), column.headerName)
|
6053
|
-
), menu && /* @__PURE__ */
|
6062
|
+
), menu && /* @__PURE__ */ React53.createElement(DataList.HeadCell, {
|
6054
6063
|
align: "right",
|
6055
|
-
"aria-label":
|
6056
|
-
}), /* @__PURE__ */
|
6064
|
+
"aria-label": menuLabel
|
6065
|
+
}), /* @__PURE__ */ React53.createElement(List2, {
|
6057
6066
|
items: sortedRows,
|
6058
|
-
renderItem: (row, index) => /* @__PURE__ */
|
6067
|
+
renderItem: (row, index) => /* @__PURE__ */ React53.createElement(DataList.Row, {
|
6059
6068
|
key: row.id
|
6060
|
-
}, /* @__PURE__ */
|
6069
|
+
}, /* @__PURE__ */ React53.createElement(List2, {
|
6061
6070
|
items: columns,
|
6062
|
-
renderItem: (column) => column.type === "status" ? /* @__PURE__ */
|
6071
|
+
renderItem: (column) => column.type === "status" ? /* @__PURE__ */ React53.createElement(DataList.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React53.createElement(StatusChip, __spreadValues({
|
6063
6072
|
dense: true
|
6064
|
-
}, column.status(row, index, sortedRows)))) : column.type === "action" ? /* @__PURE__ */
|
6073
|
+
}, column.status(row, index, sortedRows)))) : column.type === "action" ? /* @__PURE__ */ React53.createElement(DataList.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React53.createElement(Button.Secondary, __spreadValues({
|
6065
6074
|
dense: true
|
6066
|
-
}, renameProperty("text", "children", column.action(row, index, sortedRows))))) : column.type === "custom" ? /* @__PURE__ */
|
6067
|
-
}), menu && /* @__PURE__ */
|
6075
|
+
}, renameProperty("text", "children", column.action(row, index, sortedRows))))) : column.type === "custom" ? /* @__PURE__ */ React53.createElement(DataList.Cell, __spreadValues({}, cellProps(column)), column.UNSAFE_render(row, index, sortedRows)) : column.type === "item" ? /* @__PURE__ */ React53.createElement(DataList.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React53.createElement(Item4, __spreadValues({}, column.item(row, index, sortedRows)))) : /* @__PURE__ */ React53.createElement(DataList.Cell, __spreadValues({}, cellProps(column)), column.formatter ? column.formatter(row[column.field], row, index, sortedRows) : row[column.field])
|
6076
|
+
}), menu && /* @__PURE__ */ React53.createElement(DataList.Cell, {
|
6068
6077
|
align: "right"
|
6069
|
-
}, /* @__PURE__ */
|
6078
|
+
}, /* @__PURE__ */ React53.createElement(DropdownMenu2, {
|
6070
6079
|
onAction: (action) => onAction == null ? void 0 : onAction(action, row, index)
|
6071
|
-
}, /* @__PURE__ */
|
6072
|
-
"aria-label":
|
6080
|
+
}, /* @__PURE__ */ React53.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ React53.createElement(Button.Icon, {
|
6081
|
+
"aria-label": menuLabel,
|
6073
6082
|
icon: import_more.default
|
6074
6083
|
})), isFunction(menu) ? menu(row, index) : menu)))
|
6075
6084
|
}));
|
6076
6085
|
};
|
6077
6086
|
|
6078
6087
|
// src/molecules/DataTable/DataTable.tsx
|
6079
|
-
import
|
6088
|
+
import React56 from "react";
|
6080
6089
|
import compact2 from "lodash/compact";
|
6081
6090
|
import isFunction2 from "lodash/isFunction";
|
6082
6091
|
|
6083
6092
|
// src/molecules/Table/Table.tsx
|
6084
|
-
import
|
6093
|
+
import React55 from "react";
|
6085
6094
|
|
6086
6095
|
// src/utils/table/useScrollTarget.ts
|
6087
|
-
import
|
6096
|
+
import React54 from "react";
|
6088
6097
|
var useScrollTarget = (callback) => {
|
6089
|
-
const targetRef =
|
6090
|
-
|
6098
|
+
const targetRef = React54.useRef(null);
|
6099
|
+
React54.useLayoutEffect(() => {
|
6091
6100
|
const observer = new IntersectionObserver((entries) => entries[0].isIntersecting && callback && callback(), {
|
6092
6101
|
root: null,
|
6093
6102
|
rootMargin: `0px 0px 200px 0px`
|
@@ -6105,12 +6114,12 @@ var Table2 = (_a) => {
|
|
6105
6114
|
var _b = _a, { children, onPrev, onNext } = _b, rest = __objRest(_b, ["children", "onPrev", "onNext"]);
|
6106
6115
|
const bottomRef = useScrollTarget(onNext);
|
6107
6116
|
const topRef = useScrollTarget(onPrev);
|
6108
|
-
return /* @__PURE__ */
|
6117
|
+
return /* @__PURE__ */ React55.createElement("div", {
|
6109
6118
|
className: "relative w-full"
|
6110
|
-
}, /* @__PURE__ */
|
6119
|
+
}, /* @__PURE__ */ React55.createElement("div", {
|
6111
6120
|
ref: topRef,
|
6112
6121
|
className: tw("absolute top-0 h-1 w-full left-0 bg-transparent")
|
6113
|
-
}), /* @__PURE__ */
|
6122
|
+
}), /* @__PURE__ */ React55.createElement(Table, __spreadValues({}, rest), children), /* @__PURE__ */ React55.createElement("div", {
|
6114
6123
|
ref: bottomRef,
|
6115
6124
|
className: tw("absolute bottom-0 h-1 w-full left-0 bg-transparent")
|
6116
6125
|
}));
|
@@ -6132,6 +6141,7 @@ var DataTable = (_a) => {
|
|
6132
6141
|
layout = "auto",
|
6133
6142
|
sticky,
|
6134
6143
|
menu,
|
6144
|
+
menuLabel = "Context menu",
|
6135
6145
|
onAction
|
6136
6146
|
} = _b, rest = __objRest(_b, [
|
6137
6147
|
"columns",
|
@@ -6140,59 +6150,60 @@ var DataTable = (_a) => {
|
|
6140
6150
|
"layout",
|
6141
6151
|
"sticky",
|
6142
6152
|
"menu",
|
6153
|
+
"menuLabel",
|
6143
6154
|
"onAction"
|
6144
6155
|
]);
|
6145
6156
|
const [sort, updateSort] = useTableSort();
|
6146
6157
|
const sortedRows = sortRowsBy(rows, sort);
|
6147
|
-
return /* @__PURE__ */
|
6158
|
+
return /* @__PURE__ */ React56.createElement(Table2, __spreadProps(__spreadValues({}, rest), {
|
6148
6159
|
className: tw({
|
6149
6160
|
"whitespace-nowrap": noWrap,
|
6150
6161
|
"table-auto": layout === "auto",
|
6151
6162
|
"table-fixed": layout === "fixed"
|
6152
6163
|
})
|
6153
|
-
}), /* @__PURE__ */
|
6164
|
+
}), /* @__PURE__ */ React56.createElement(Table2.Head, {
|
6154
6165
|
sticky
|
6155
6166
|
}, compact2([
|
6156
6167
|
...columns.map(
|
6157
|
-
(column) => columnIsFieldColumn(column) && column.sortable || column.sort ? /* @__PURE__ */
|
6168
|
+
(column) => columnIsFieldColumn(column) && column.sortable || column.sort ? /* @__PURE__ */ React56.createElement(Table2.SortCell, __spreadValues({
|
6158
6169
|
direction: sort && sort.column.headerName === column.headerName ? sort.direction : "none",
|
6159
6170
|
onClick: () => updateSort(column),
|
6160
6171
|
style: { width: column.width },
|
6161
6172
|
"aria-label": column.headerInvisible ? column.headerName : void 0
|
6162
|
-
}, cellProps(column)), !column.headerInvisible && column.headerName) : /* @__PURE__ */
|
6173
|
+
}, cellProps(column)), !column.headerInvisible && column.headerName) : /* @__PURE__ */ React56.createElement(Table2.Cell, __spreadProps(__spreadValues({}, cellProps(column)), {
|
6163
6174
|
style: { width: column.width },
|
6164
6175
|
"aria-label": column.headerInvisible ? column.headerName : void 0
|
6165
6176
|
}), !column.headerInvisible && column.headerName)
|
6166
6177
|
),
|
6167
|
-
menu ? /* @__PURE__ */
|
6178
|
+
menu ? /* @__PURE__ */ React56.createElement(Table2.Cell, {
|
6168
6179
|
key: "__contextMenu",
|
6169
6180
|
align: "right",
|
6170
|
-
"aria-label":
|
6181
|
+
"aria-label": menuLabel
|
6171
6182
|
}) : null
|
6172
|
-
])), /* @__PURE__ */
|
6183
|
+
])), /* @__PURE__ */ React56.createElement(Table2.Body, null, /* @__PURE__ */ React56.createElement(List2, {
|
6173
6184
|
items: sortedRows,
|
6174
|
-
renderItem: (row, index) => /* @__PURE__ */
|
6185
|
+
renderItem: (row, index) => /* @__PURE__ */ React56.createElement(Table2.Row, {
|
6175
6186
|
key: row.id
|
6176
|
-
}, /* @__PURE__ */
|
6187
|
+
}, /* @__PURE__ */ React56.createElement(List2, {
|
6177
6188
|
items: columns,
|
6178
|
-
renderItem: (column) => column.type === "status" ? /* @__PURE__ */
|
6189
|
+
renderItem: (column) => column.type === "status" ? /* @__PURE__ */ React56.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React56.createElement(StatusChip, __spreadValues({
|
6179
6190
|
dense: true
|
6180
|
-
}, column.status(row, index, sortedRows)))) : column.type === "action" ? /* @__PURE__ */
|
6191
|
+
}, column.status(row, index, sortedRows)))) : column.type === "action" ? /* @__PURE__ */ React56.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React56.createElement(Button.Secondary, __spreadValues({
|
6181
6192
|
dense: true
|
6182
|
-
}, renameProperty("text", "children", column.action(row, index, sortedRows))))) : column.type === "custom" ? /* @__PURE__ */
|
6183
|
-
}), menu && /* @__PURE__ */
|
6193
|
+
}, renameProperty("text", "children", column.action(row, index, sortedRows))))) : column.type === "custom" ? /* @__PURE__ */ React56.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), column.UNSAFE_render(row, index, sortedRows)) : column.type === "item" ? /* @__PURE__ */ React56.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React56.createElement(Item4, __spreadValues({}, column.item(row, index, sortedRows)))) : /* @__PURE__ */ React56.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), column.formatter ? column.formatter(row[column.field], row, index, sortedRows) : row[column.field])
|
6194
|
+
}), menu && /* @__PURE__ */ React56.createElement(Table2.Cell, {
|
6184
6195
|
align: "right"
|
6185
|
-
}, /* @__PURE__ */
|
6196
|
+
}, /* @__PURE__ */ React56.createElement(DropdownMenu2, {
|
6186
6197
|
onAction: (action) => onAction == null ? void 0 : onAction(action, row, index)
|
6187
|
-
}, /* @__PURE__ */
|
6188
|
-
"aria-label":
|
6198
|
+
}, /* @__PURE__ */ React56.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ React56.createElement(Button.Icon, {
|
6199
|
+
"aria-label": menuLabel,
|
6189
6200
|
icon: import_more2.default
|
6190
6201
|
})), isFunction2(menu) ? menu(row, index) : menu)))
|
6191
6202
|
})));
|
6192
6203
|
};
|
6193
6204
|
|
6194
6205
|
// src/molecules/Dialog/Dialog.tsx
|
6195
|
-
import
|
6206
|
+
import React58 from "react";
|
6196
6207
|
import { useDialog } from "@react-aria/dialog";
|
6197
6208
|
import { Overlay as Overlay2, useModalOverlay } from "@react-aria/overlays";
|
6198
6209
|
import { useId } from "@react-aria/utils";
|
@@ -6219,10 +6230,10 @@ var DIALOG_ICONS_AND_COLORS = {
|
|
6219
6230
|
};
|
6220
6231
|
|
6221
6232
|
// src/atoms/Modal/Modal.tsx
|
6222
|
-
import
|
6233
|
+
import React57 from "react";
|
6223
6234
|
var Modal = (_a) => {
|
6224
6235
|
var _b = _a, { children, className, open } = _b, rest = __objRest(_b, ["children", "className", "open"]);
|
6225
|
-
return open ? /* @__PURE__ */
|
6236
|
+
return open ? /* @__PURE__ */ React57.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
6226
6237
|
className: classNames(
|
6227
6238
|
tw("inset-0 overflow-y-auto z-modal flex justify-center items-center fixed py-7"),
|
6228
6239
|
className
|
@@ -6231,14 +6242,14 @@ var Modal = (_a) => {
|
|
6231
6242
|
};
|
6232
6243
|
Modal.BackDrop = (_a) => {
|
6233
6244
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
6234
|
-
return /* @__PURE__ */
|
6245
|
+
return /* @__PURE__ */ React57.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
6235
6246
|
className: classNames(tw("-z-10 fixed min-w-full min-h-full bg-navyBlue-100 opacity-70"), className)
|
6236
6247
|
}));
|
6237
6248
|
};
|
6238
|
-
Modal.Dialog =
|
6249
|
+
Modal.Dialog = React57.forwardRef(
|
6239
6250
|
(_a, ref) => {
|
6240
6251
|
var _b = _a, { children, className, size = "sm" } = _b, rest = __objRest(_b, ["children", "className", "size"]);
|
6241
|
-
return /* @__PURE__ */
|
6252
|
+
return /* @__PURE__ */ React57.createElement("div", __spreadProps(__spreadValues({
|
6242
6253
|
ref,
|
6243
6254
|
"aria-modal": "true"
|
6244
6255
|
}, rest), {
|
@@ -6256,31 +6267,31 @@ Modal.Dialog = React56.forwardRef(
|
|
6256
6267
|
);
|
6257
6268
|
Modal.Header = (_a) => {
|
6258
6269
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
6259
|
-
return /* @__PURE__ */
|
6270
|
+
return /* @__PURE__ */ React57.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
6260
6271
|
className: classNames(tw("px-7 py-6 gap-3 flex items-center"), className)
|
6261
6272
|
}), children);
|
6262
6273
|
};
|
6263
6274
|
Modal.HeaderImage = (_a) => {
|
6264
6275
|
var _b = _a, { backgroundImage, className } = _b, rest = __objRest(_b, ["backgroundImage", "className"]);
|
6265
6276
|
const common = tw("h-[120px] min-h-[120px] w-full ");
|
6266
|
-
return backgroundImage ? /* @__PURE__ */
|
6277
|
+
return backgroundImage ? /* @__PURE__ */ React57.createElement("img", __spreadProps(__spreadValues({
|
6267
6278
|
"aria-hidden": true,
|
6268
6279
|
src: backgroundImage != null ? backgroundImage : void 0
|
6269
6280
|
}, rest), {
|
6270
6281
|
className: classNames(common, tw("object-cover"), className)
|
6271
|
-
})) : /* @__PURE__ */
|
6282
|
+
})) : /* @__PURE__ */ React57.createElement("div", {
|
6272
6283
|
className: classNames(common, tw("bg-grey-5"), className)
|
6273
6284
|
});
|
6274
6285
|
};
|
6275
6286
|
Modal.CloseButtonContainer = (_a) => {
|
6276
6287
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
6277
|
-
return /* @__PURE__ */
|
6288
|
+
return /* @__PURE__ */ React57.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
6278
6289
|
className: classNames(tw("absolute top-[20px] right-[28px]"), className)
|
6279
6290
|
}));
|
6280
6291
|
};
|
6281
6292
|
Modal.Title = (_a) => {
|
6282
6293
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
6283
|
-
return /* @__PURE__ */
|
6294
|
+
return /* @__PURE__ */ React57.createElement(Typography, __spreadValues({
|
6284
6295
|
htmlTag: "h2",
|
6285
6296
|
variant: "subheading",
|
6286
6297
|
color: "grey-90",
|
@@ -6289,51 +6300,51 @@ Modal.Title = (_a) => {
|
|
6289
6300
|
};
|
6290
6301
|
Modal.Subtitle = (_a) => {
|
6291
6302
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
6292
|
-
return /* @__PURE__ */
|
6303
|
+
return /* @__PURE__ */ React57.createElement(Typography, __spreadValues({
|
6293
6304
|
variant: "small",
|
6294
6305
|
color: "grey-60"
|
6295
6306
|
}, rest), children);
|
6296
6307
|
};
|
6297
6308
|
Modal.TitleContainer = (_a) => {
|
6298
6309
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
6299
|
-
return /* @__PURE__ */
|
6310
|
+
return /* @__PURE__ */ React57.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
6300
6311
|
className: classNames(tw("flex flex-col grow gap-2"), className)
|
6301
6312
|
}), children);
|
6302
6313
|
};
|
6303
6314
|
Modal.Body = (_a) => {
|
6304
6315
|
var _b = _a, { children, className, noFooter = false, maxHeight, style } = _b, rest = __objRest(_b, ["children", "className", "noFooter", "maxHeight", "style"]);
|
6305
|
-
return /* @__PURE__ */
|
6316
|
+
return /* @__PURE__ */ React57.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
6306
6317
|
className: classNames(tw("px-7 grow overflow-y-auto", { "pb-6": noFooter }), className),
|
6307
6318
|
style: __spreadValues({ maxHeight }, style)
|
6308
6319
|
}), children);
|
6309
6320
|
};
|
6310
6321
|
Modal.Footer = (_a) => {
|
6311
6322
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
6312
|
-
return /* @__PURE__ */
|
6323
|
+
return /* @__PURE__ */ React57.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
6313
6324
|
className: classNames(tw("px-7 py-6"), className)
|
6314
6325
|
}), children);
|
6315
6326
|
};
|
6316
6327
|
Modal.Actions = (_a) => {
|
6317
6328
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
6318
|
-
return /* @__PURE__ */
|
6329
|
+
return /* @__PURE__ */ React57.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
6319
6330
|
className: classNames(tw("flex gap-4 justify-end"), className)
|
6320
6331
|
}), children);
|
6321
6332
|
};
|
6322
6333
|
|
6323
6334
|
// src/molecules/Dialog/Dialog.tsx
|
6324
6335
|
var Dialog = (props) => {
|
6325
|
-
const ref =
|
6336
|
+
const ref = React58.useRef(null);
|
6326
6337
|
const state = useOverlayTriggerState2({ isOpen: props.open });
|
6327
6338
|
const { modalProps, underlayProps } = useModalOverlay({}, state, ref);
|
6328
6339
|
if (!state.isOpen) {
|
6329
6340
|
return null;
|
6330
6341
|
}
|
6331
|
-
return /* @__PURE__ */
|
6342
|
+
return /* @__PURE__ */ React58.createElement(Overlay2, null, /* @__PURE__ */ React58.createElement(Modal, {
|
6332
6343
|
open: true
|
6333
|
-
}, /* @__PURE__ */
|
6344
|
+
}, /* @__PURE__ */ React58.createElement(Modal.BackDrop, __spreadValues({}, underlayProps)), /* @__PURE__ */ React58.createElement(Modal.Dialog, __spreadValues({
|
6334
6345
|
ref,
|
6335
6346
|
size: "sm"
|
6336
|
-
}, modalProps), /* @__PURE__ */
|
6347
|
+
}, modalProps), /* @__PURE__ */ React58.createElement(DialogWrapper, __spreadValues({}, props)))));
|
6337
6348
|
};
|
6338
6349
|
var DialogWrapper = ({
|
6339
6350
|
title,
|
@@ -6342,36 +6353,36 @@ var DialogWrapper = ({
|
|
6342
6353
|
primaryAction,
|
6343
6354
|
secondaryAction
|
6344
6355
|
}) => {
|
6345
|
-
const ref =
|
6356
|
+
const ref = React58.useRef(null);
|
6346
6357
|
const labelledBy = useId();
|
6347
6358
|
const describedBy = useId();
|
6348
6359
|
const { dialogProps } = useDialog(
|
6349
6360
|
{ "role": "alertdialog", "aria-labelledby": labelledBy, "aria-describedby": describedBy },
|
6350
6361
|
ref
|
6351
6362
|
);
|
6352
|
-
return /* @__PURE__ */
|
6363
|
+
return /* @__PURE__ */ React58.createElement("div", __spreadProps(__spreadValues({
|
6353
6364
|
ref
|
6354
6365
|
}, dialogProps), {
|
6355
6366
|
className: tw("outline-none")
|
6356
|
-
}), /* @__PURE__ */
|
6367
|
+
}), /* @__PURE__ */ React58.createElement(Modal.Header, null, /* @__PURE__ */ React58.createElement(Icon, {
|
6357
6368
|
icon: DIALOG_ICONS_AND_COLORS[type].icon,
|
6358
6369
|
color: DIALOG_ICONS_AND_COLORS[type].color,
|
6359
6370
|
fontSize: 20
|
6360
|
-
}), /* @__PURE__ */
|
6371
|
+
}), /* @__PURE__ */ React58.createElement(Modal.Title, {
|
6361
6372
|
id: labelledBy,
|
6362
6373
|
variant: "large-strong",
|
6363
6374
|
color: DIALOG_ICONS_AND_COLORS[type].color
|
6364
|
-
}, title)), /* @__PURE__ */
|
6375
|
+
}, title)), /* @__PURE__ */ React58.createElement(Modal.Body, {
|
6365
6376
|
id: describedBy
|
6366
|
-
}, children), /* @__PURE__ */
|
6377
|
+
}, children), /* @__PURE__ */ React58.createElement(Modal.Footer, null, /* @__PURE__ */ React58.createElement(Modal.Actions, null, secondaryAction && /* @__PURE__ */ React58.createElement(Button.Ghost, __spreadValues({
|
6367
6378
|
key: secondaryAction.text
|
6368
|
-
}, omit8(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */
|
6379
|
+
}, omit8(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */ React58.createElement(Button.Secondary, __spreadValues({
|
6369
6380
|
key: primaryAction.text
|
6370
6381
|
}, omit8(primaryAction, "text")), primaryAction.text))));
|
6371
6382
|
};
|
6372
6383
|
|
6373
6384
|
// src/molecules/Divider/Divider.tsx
|
6374
|
-
import
|
6385
|
+
import React59 from "react";
|
6375
6386
|
var sizeClasses = {
|
6376
6387
|
horizontal: {
|
6377
6388
|
1: "h-1px",
|
@@ -6393,7 +6404,7 @@ var sizeClasses = {
|
|
6393
6404
|
var Divider2 = (_a) => {
|
6394
6405
|
var _b = _a, { direction = "horizontal", size = 1 } = _b, props = __objRest(_b, ["direction", "size"]);
|
6395
6406
|
const sizeClass = sizeClasses[direction][size];
|
6396
|
-
return /* @__PURE__ */
|
6407
|
+
return /* @__PURE__ */ React59.createElement("div", __spreadProps(__spreadValues({}, props), {
|
6397
6408
|
className: tw(`bg-grey-5 ${sizeClass}`, {
|
6398
6409
|
"block w-full": direction === "horizontal",
|
6399
6410
|
"inline-block h-full": direction === "vertical"
|
@@ -6402,22 +6413,22 @@ var Divider2 = (_a) => {
|
|
6402
6413
|
};
|
6403
6414
|
|
6404
6415
|
// src/molecules/Dropdown/Dropdown.tsx
|
6405
|
-
import
|
6416
|
+
import React62 from "react";
|
6406
6417
|
|
6407
6418
|
// src/molecules/Popover/Popover.tsx
|
6408
|
-
import
|
6419
|
+
import React61, { useRef as useRef7 } from "react";
|
6409
6420
|
import { PressResponder as PressResponder2, usePress as usePress2 } from "@react-aria/interactions";
|
6410
6421
|
import { useOverlayTrigger } from "@react-aria/overlays";
|
6411
6422
|
import { mergeProps as mergeProps3 } from "@react-aria/utils";
|
6412
6423
|
import { useOverlayTriggerState as useOverlayTriggerState3 } from "@react-stately/overlays";
|
6413
6424
|
|
6414
6425
|
// src/molecules/Popover/Dialog.tsx
|
6415
|
-
import
|
6426
|
+
import React60 from "react";
|
6416
6427
|
import { useDialog as useDialog2 } from "@react-aria/dialog";
|
6417
6428
|
var Dialog2 = ({ children }) => {
|
6418
|
-
const ref =
|
6429
|
+
const ref = React60.useRef(null);
|
6419
6430
|
const { dialogProps } = useDialog2({}, ref);
|
6420
|
-
return /* @__PURE__ */
|
6431
|
+
return /* @__PURE__ */ React60.createElement("div", __spreadProps(__spreadValues({
|
6421
6432
|
ref
|
6422
6433
|
}, dialogProps), {
|
6423
6434
|
className: tw("outline-none")
|
@@ -6451,21 +6462,21 @@ var Popover2 = (props) => {
|
|
6451
6462
|
const triggerRef = useRef7(null);
|
6452
6463
|
const state = useOverlayTriggerState3(props);
|
6453
6464
|
const { triggerProps, overlayProps } = useOverlayTrigger({ type: type != null ? type : "dialog" }, state, triggerRef);
|
6454
|
-
return /* @__PURE__ */
|
6465
|
+
return /* @__PURE__ */ React61.createElement(PopoverContext.Provider, {
|
6455
6466
|
value: {
|
6456
6467
|
state
|
6457
6468
|
}
|
6458
|
-
},
|
6469
|
+
}, React61.Children.map(props.children, (child) => {
|
6459
6470
|
if (isComponentType(child, Popover2.Trigger)) {
|
6460
|
-
return /* @__PURE__ */
|
6471
|
+
return /* @__PURE__ */ React61.createElement(PressResponder2, __spreadValues({
|
6461
6472
|
ref: triggerRef
|
6462
|
-
}, triggerProps), /* @__PURE__ */
|
6473
|
+
}, triggerProps), /* @__PURE__ */ React61.createElement(PopoverTriggerWrapper, {
|
6463
6474
|
"data-testid": props["data-testid"],
|
6464
6475
|
"aria-controls": id
|
6465
6476
|
}, child.props.children));
|
6466
6477
|
}
|
6467
6478
|
if (isComponentType(child, Popover2.Panel)) {
|
6468
|
-
return state.isOpen && /* @__PURE__ */
|
6479
|
+
return state.isOpen && /* @__PURE__ */ React61.createElement(PopoverOverlay, __spreadValues({
|
6469
6480
|
triggerRef: targetRef != null ? targetRef : triggerRef,
|
6470
6481
|
state,
|
6471
6482
|
placement,
|
@@ -6476,7 +6487,7 @@ var Popover2 = (props) => {
|
|
6476
6487
|
offset,
|
6477
6488
|
crossOffset,
|
6478
6489
|
shouldFlip
|
6479
|
-
}, overlayProps), containFocus ? /* @__PURE__ */
|
6490
|
+
}, overlayProps), containFocus ? /* @__PURE__ */ React61.createElement(Dialog2, null, child.props.children) : child.props.children);
|
6480
6491
|
}
|
6481
6492
|
throw new Error("Invalid children element type");
|
6482
6493
|
}));
|
@@ -6495,7 +6506,7 @@ var asPopoverButton = (Component, displayName) => {
|
|
6495
6506
|
state.close();
|
6496
6507
|
onClick == null ? void 0 : onClick(e);
|
6497
6508
|
};
|
6498
|
-
return /* @__PURE__ */
|
6509
|
+
return /* @__PURE__ */ React61.createElement(Component, __spreadProps(__spreadValues({}, props), {
|
6499
6510
|
onClick: handleClick
|
6500
6511
|
}));
|
6501
6512
|
};
|
@@ -6508,9 +6519,9 @@ var PopoverTriggerWrapper = (_a) => {
|
|
6508
6519
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
6509
6520
|
var _a2;
|
6510
6521
|
const ref = useRef7(null);
|
6511
|
-
const trigger =
|
6522
|
+
const trigger = React61.Children.only(children);
|
6512
6523
|
const { pressProps } = usePress2(__spreadProps(__spreadValues({}, rest), { ref }));
|
6513
|
-
return
|
6524
|
+
return React61.cloneElement(trigger, __spreadProps(__spreadValues({
|
6514
6525
|
"ref": ref
|
6515
6526
|
}, mergeProps3(pressProps, trigger.props)), {
|
6516
6527
|
"aria-controls": (_a2 = rest["aria-controls"]) != null ? _a2 : pressProps["aria-controls"]
|
@@ -6519,10 +6530,10 @@ var PopoverTriggerWrapper = (_a) => {
|
|
6519
6530
|
|
6520
6531
|
// src/molecules/Dropdown/Dropdown.tsx
|
6521
6532
|
var Dropdown = ({ children, content, placement = "bottom-left" }) => {
|
6522
|
-
return /* @__PURE__ */
|
6533
|
+
return /* @__PURE__ */ React62.createElement(Popover2, {
|
6523
6534
|
type: "menu",
|
6524
6535
|
placement
|
6525
|
-
}, /* @__PURE__ */
|
6536
|
+
}, /* @__PURE__ */ React62.createElement(Popover2.Trigger, null, children), /* @__PURE__ */ React62.createElement(Popover2.Panel, null, content));
|
6526
6537
|
};
|
6527
6538
|
var DropdownMenu3 = ({
|
6528
6539
|
title,
|
@@ -6531,26 +6542,26 @@ var DropdownMenu3 = ({
|
|
6531
6542
|
triggerId,
|
6532
6543
|
setClose = () => void 0
|
6533
6544
|
}) => {
|
6534
|
-
const menuRef =
|
6535
|
-
|
6545
|
+
const menuRef = React62.useRef(null);
|
6546
|
+
React62.useEffect(() => {
|
6536
6547
|
const id = setTimeout(() => {
|
6537
6548
|
var _a, _b, _c;
|
6538
6549
|
return (_c = (_b = (_a = menuRef.current) == null ? void 0 : _a.children) == null ? void 0 : _b[0]) == null ? void 0 : _c.focus();
|
6539
6550
|
});
|
6540
6551
|
return () => clearTimeout(id);
|
6541
6552
|
}, [menuRef.current]);
|
6542
|
-
return /* @__PURE__ */
|
6553
|
+
return /* @__PURE__ */ React62.createElement("div", {
|
6543
6554
|
style: { minWidth: "250px" },
|
6544
6555
|
className: tw("py-3 bg-white")
|
6545
|
-
}, !!title && /* @__PURE__ */
|
6556
|
+
}, !!title && /* @__PURE__ */ React62.createElement("div", {
|
6546
6557
|
className: tw("px-4 py-4 text-left text-grey-100 typography-default-strong")
|
6547
|
-
}, title), /* @__PURE__ */
|
6558
|
+
}, title), /* @__PURE__ */ React62.createElement("ol", {
|
6548
6559
|
role: "menu",
|
6549
6560
|
ref: menuRef,
|
6550
6561
|
id: contentId,
|
6551
6562
|
"aria-labelledby": triggerId
|
6552
|
-
},
|
6553
|
-
return
|
6563
|
+
}, React62.Children.map(children, (child) => {
|
6564
|
+
return React62.cloneElement(child, { setClose });
|
6554
6565
|
})));
|
6555
6566
|
};
|
6556
6567
|
var DropdownItem = (_a) => {
|
@@ -6605,10 +6616,10 @@ var DropdownItem = (_a) => {
|
|
6605
6616
|
handleSelect();
|
6606
6617
|
}
|
6607
6618
|
};
|
6608
|
-
const itemContent = /* @__PURE__ */
|
6619
|
+
const itemContent = /* @__PURE__ */ React62.createElement("div", {
|
6609
6620
|
className: tw("py-3 px-4")
|
6610
6621
|
}, children);
|
6611
|
-
return /* @__PURE__ */
|
6622
|
+
return /* @__PURE__ */ React62.createElement("li", __spreadProps(__spreadValues({
|
6612
6623
|
role: "menuitem",
|
6613
6624
|
tabIndex: -1,
|
6614
6625
|
onClick: handleClick,
|
@@ -6619,11 +6630,11 @@ var DropdownItem = (_a) => {
|
|
6619
6630
|
"text-grey-10 cursor-not-allowed": disabled,
|
6620
6631
|
"text-primary-70 hover:text-primary-80": color === "danger" && !disabled
|
6621
6632
|
})
|
6622
|
-
}), tooltip ? /* @__PURE__ */
|
6633
|
+
}), tooltip ? /* @__PURE__ */ React62.createElement(Tooltip, {
|
6623
6634
|
content: tooltip,
|
6624
6635
|
placement: tooltipPlacement,
|
6625
6636
|
inline: false
|
6626
|
-
}, /* @__PURE__ */
|
6637
|
+
}, /* @__PURE__ */ React62.createElement("div", {
|
6627
6638
|
tabIndex: 0,
|
6628
6639
|
className: tw("grow")
|
6629
6640
|
}, itemContent)) : itemContent);
|
@@ -6632,11 +6643,11 @@ Dropdown.Menu = DropdownMenu3;
|
|
6632
6643
|
Dropdown.Item = DropdownItem;
|
6633
6644
|
|
6634
6645
|
// src/molecules/EmptyState/EmptyState.tsx
|
6635
|
-
import
|
6646
|
+
import React64 from "react";
|
6636
6647
|
import omit9 from "lodash/omit";
|
6637
6648
|
|
6638
6649
|
// src/molecules/Flexbox/FlexboxItem.tsx
|
6639
|
-
import
|
6650
|
+
import React63 from "react";
|
6640
6651
|
var FlexboxItem = Tailwindify(
|
6641
6652
|
({ htmlTag = "div", className, style, children, display, flex, grow, shrink, order, alignSelf }) => {
|
6642
6653
|
const hookStyle = useStyle({
|
@@ -6648,7 +6659,7 @@ var FlexboxItem = Tailwindify(
|
|
6648
6659
|
alignSelf
|
6649
6660
|
});
|
6650
6661
|
const HtmlElement = htmlTag;
|
6651
|
-
return /* @__PURE__ */
|
6662
|
+
return /* @__PURE__ */ React63.createElement(HtmlElement, {
|
6652
6663
|
style: __spreadValues(__spreadValues({}, hookStyle), style),
|
6653
6664
|
className
|
6654
6665
|
}, children);
|
@@ -6706,7 +6717,7 @@ var EmptyState = ({
|
|
6706
6717
|
borderStyle = "dashed"
|
6707
6718
|
}) => {
|
6708
6719
|
const template = layoutStyle(layout);
|
6709
|
-
return /* @__PURE__ */
|
6720
|
+
return /* @__PURE__ */ React64.createElement(Box, {
|
6710
6721
|
className: classNames(
|
6711
6722
|
tw("rounded", {
|
6712
6723
|
"border border-dashed": borderStyle === "dashed",
|
@@ -6718,38 +6729,38 @@ var EmptyState = ({
|
|
6718
6729
|
backgroundColor: "transparent",
|
6719
6730
|
borderColor: "grey-10",
|
6720
6731
|
padding: "9"
|
6721
|
-
}, /* @__PURE__ */
|
6732
|
+
}, /* @__PURE__ */ React64.createElement(Flexbox, {
|
6722
6733
|
direction: template.layout,
|
6723
6734
|
justifyContent: template.justifyContent,
|
6724
6735
|
alignItems: template.layout === "row" ? "center" : template.alignItems,
|
6725
6736
|
colGap: "l5",
|
6726
6737
|
rowGap: "8"
|
6727
|
-
}, image && /* @__PURE__ */
|
6738
|
+
}, image && /* @__PURE__ */ React64.createElement(FlexboxItem, null, /* @__PURE__ */ React64.createElement("img", {
|
6728
6739
|
src: image,
|
6729
6740
|
alt: imageAlt,
|
6730
6741
|
style: { width: imageWidth ? `${imageWidth}px` : void 0, height: "auto" }
|
6731
|
-
})), /* @__PURE__ */
|
6742
|
+
})), /* @__PURE__ */ React64.createElement(Flexbox, {
|
6732
6743
|
style: { maxWidth: "610px" },
|
6733
6744
|
direction: "column",
|
6734
6745
|
justifyContent: template.justifyContent,
|
6735
6746
|
alignItems: template.alignItems
|
6736
|
-
}, /* @__PURE__ */
|
6747
|
+
}, /* @__PURE__ */ React64.createElement(Typography2, {
|
6737
6748
|
variant: "heading",
|
6738
6749
|
htmlTag: "h2"
|
6739
|
-
}, title), (description || children) && /* @__PURE__ */
|
6750
|
+
}, title), (description || children) && /* @__PURE__ */ React64.createElement(Box, {
|
6740
6751
|
marginTop: "5"
|
6741
|
-
}, /* @__PURE__ */
|
6752
|
+
}, /* @__PURE__ */ React64.createElement(Typography2, {
|
6742
6753
|
variant: "default",
|
6743
6754
|
color: "grey-60"
|
6744
|
-
}, children || description)), (secondaryAction || primaryAction) && /* @__PURE__ */
|
6755
|
+
}, children || description)), (secondaryAction || primaryAction) && /* @__PURE__ */ React64.createElement(Flexbox, {
|
6745
6756
|
marginTop: "7",
|
6746
6757
|
gap: "4",
|
6747
6758
|
justifyContent: "center",
|
6748
6759
|
alignItems: "center",
|
6749
6760
|
wrap: "wrap"
|
6750
|
-
}, primaryAction && /* @__PURE__ */
|
6761
|
+
}, primaryAction && /* @__PURE__ */ React64.createElement(Button.Primary, __spreadValues({}, omit9(primaryAction, "text")), primaryAction.text), secondaryAction && /* @__PURE__ */ React64.createElement(Button.Secondary, __spreadValues({}, omit9(secondaryAction, "text")), secondaryAction.text)), footer && /* @__PURE__ */ React64.createElement(Box, {
|
6751
6762
|
marginTop: "7"
|
6752
|
-
}, /* @__PURE__ */
|
6763
|
+
}, /* @__PURE__ */ React64.createElement(Typography2, {
|
6753
6764
|
htmlTag: "div",
|
6754
6765
|
variant: "small",
|
6755
6766
|
color: "grey-60"
|
@@ -6757,7 +6768,7 @@ var EmptyState = ({
|
|
6757
6768
|
};
|
6758
6769
|
|
6759
6770
|
// src/molecules/Grid/GridItem.tsx
|
6760
|
-
import
|
6771
|
+
import React65 from "react";
|
6761
6772
|
var GridItem = Tailwindify(
|
6762
6773
|
({
|
6763
6774
|
htmlTag = "div",
|
@@ -6788,7 +6799,7 @@ var GridItem = Tailwindify(
|
|
6788
6799
|
gridRowEnd: rowEnd
|
6789
6800
|
});
|
6790
6801
|
const HtmlElement = htmlTag;
|
6791
|
-
return /* @__PURE__ */
|
6802
|
+
return /* @__PURE__ */ React65.createElement(HtmlElement, {
|
6792
6803
|
style: __spreadValues(__spreadValues({}, hookStyle), style),
|
6793
6804
|
className
|
6794
6805
|
}, children);
|
@@ -6796,7 +6807,7 @@ var GridItem = Tailwindify(
|
|
6796
6807
|
);
|
6797
6808
|
|
6798
6809
|
// src/molecules/LineClamp/LineClamp.tsx
|
6799
|
-
import
|
6810
|
+
import React66 from "react";
|
6800
6811
|
var LineClamp2 = ({
|
6801
6812
|
lines,
|
6802
6813
|
children,
|
@@ -6805,10 +6816,10 @@ var LineClamp2 = ({
|
|
6805
6816
|
collapseLabel,
|
6806
6817
|
onClampedChange
|
6807
6818
|
}) => {
|
6808
|
-
const ref =
|
6809
|
-
const [clamped, setClamped] =
|
6810
|
-
const [isClampingEnabled, setClampingEnabled] =
|
6811
|
-
|
6819
|
+
const ref = React66.useRef(null);
|
6820
|
+
const [clamped, setClamped] = React66.useState(true);
|
6821
|
+
const [isClampingEnabled, setClampingEnabled] = React66.useState(false);
|
6822
|
+
React66.useEffect(() => {
|
6812
6823
|
var _a, _b;
|
6813
6824
|
const el = ref.current;
|
6814
6825
|
setClampingEnabled(((_a = el == null ? void 0 : el.scrollHeight) != null ? _a : 0) > ((_b = el == null ? void 0 : el.clientHeight) != null ? _b : 0));
|
@@ -6817,38 +6828,31 @@ var LineClamp2 = ({
|
|
6817
6828
|
setClamped(!clamped);
|
6818
6829
|
onClampedChange == null ? void 0 : onClampedChange(!clamped);
|
6819
6830
|
};
|
6820
|
-
return /* @__PURE__ */
|
6831
|
+
return /* @__PURE__ */ React66.createElement("div", null, /* @__PURE__ */ React66.createElement(LineClamp, {
|
6821
6832
|
ref,
|
6822
6833
|
lines,
|
6823
6834
|
clamped,
|
6824
6835
|
wordBreak
|
6825
|
-
}, children), expandLabel && isClampingEnabled && /* @__PURE__ */
|
6836
|
+
}, children), expandLabel && isClampingEnabled && /* @__PURE__ */ React66.createElement(Button.Ghost, {
|
6826
6837
|
dense: true,
|
6827
6838
|
onClick: handleClampedChange
|
6828
6839
|
}, clamped ? expandLabel : collapseLabel));
|
6829
6840
|
};
|
6830
6841
|
|
6831
6842
|
// src/molecules/Link/Link.tsx
|
6832
|
-
import
|
6843
|
+
import React68 from "react";
|
6833
6844
|
|
6834
6845
|
// src/atoms/Link/Link.tsx
|
6835
|
-
import
|
6846
|
+
import React67 from "react";
|
6836
6847
|
var Link = (_a) => {
|
6837
6848
|
var _b = _a, { children, className } = _b, props = __objRest(_b, ["children", "className"]);
|
6838
|
-
return /* @__PURE__ */
|
6849
|
+
return /* @__PURE__ */ React67.createElement("a", __spreadValues({
|
6839
6850
|
className: classNames(className, linkStyle)
|
6840
6851
|
}, props), children);
|
6841
6852
|
};
|
6842
6853
|
|
6843
6854
|
// src/molecules/Link/Link.tsx
|
6844
|
-
var Link2 = (props) => /* @__PURE__ */
|
6845
|
-
|
6846
|
-
// src/molecules/List/List.tsx
|
6847
|
-
import React68 from "react";
|
6848
|
-
var List2 = ({ items, renderItem, container = React68.Fragment }) => {
|
6849
|
-
const Component = container;
|
6850
|
-
return /* @__PURE__ */ React68.createElement(Component, null, items.map(renderItem));
|
6851
|
-
};
|
6855
|
+
var Link2 = (props) => /* @__PURE__ */ React68.createElement(Link, __spreadValues({}, props));
|
6852
6856
|
|
6853
6857
|
// src/molecules/ListItem/ListItem.tsx
|
6854
6858
|
import React69 from "react";
|
@@ -7176,7 +7180,7 @@ var Modal2 = (_a) => {
|
|
7176
7180
|
const ref = React71.useRef(null);
|
7177
7181
|
const state = useOverlayTriggerState4({ isOpen: open, onOpenChange: (isOpen) => !isOpen && onClose() });
|
7178
7182
|
const { modalProps, underlayProps } = useModalOverlay2(
|
7179
|
-
{ isDismissable:
|
7183
|
+
{ isDismissable: false, isKeyboardDismissDisabled: !closeOnEsc },
|
7180
7184
|
state,
|
7181
7185
|
ref
|
7182
7186
|
);
|
@@ -7258,22 +7262,31 @@ var InputChip = React72.forwardRef(
|
|
7258
7262
|
_onClick == null ? void 0 : _onClick(e);
|
7259
7263
|
}
|
7260
7264
|
};
|
7261
|
-
return /* @__PURE__ */ React72.createElement("div",
|
7262
|
-
|
7263
|
-
role: "button",
|
7264
|
-
className: classNames(className, "inline-flex align-middle mx-1 px-2 py-1 items-center rounded-sm break-all", {
|
7265
|
+
return /* @__PURE__ */ React72.createElement("div", {
|
7266
|
+
className: classNames(className, "inline-flex align-middle mx-1 items-stretch rounded-sm break-all", {
|
7265
7267
|
"bg-error-0 ": invalid,
|
7266
|
-
"bg-grey-0": !invalid && !disabled,
|
7267
|
-
"
|
7268
|
-
|
7269
|
-
|
7270
|
-
|
7271
|
-
},
|
7268
|
+
"bg-grey-0 ": !invalid && !disabled,
|
7269
|
+
"bg-grey-5": disabled
|
7270
|
+
})
|
7271
|
+
}, /* @__PURE__ */ React72.createElement("div", {
|
7272
|
+
className: tw("px-2 py-1")
|
7273
|
+
}, /* @__PURE__ */ React72.createElement(Typography2, {
|
7272
7274
|
variant: "small",
|
7273
7275
|
color: invalid ? "error-80" : disabled ? "grey-40" : "grey-70"
|
7274
|
-
}, children), !readOnly && /* @__PURE__ */ React72.createElement("div",
|
7276
|
+
}, children)), !readOnly && /* @__PURE__ */ React72.createElement("div", __spreadProps(__spreadValues({
|
7277
|
+
ref
|
7278
|
+
}, props), {
|
7279
|
+
onClick,
|
7280
|
+
className: tw("flex items-center p-1", {
|
7281
|
+
"pointer-events-none": !!disabled,
|
7282
|
+
"hover:bg-error-10 focus:bg-error-20": invalid,
|
7283
|
+
"hover:bg-grey-10 focus:bg-grey-20": !invalid && !disabled
|
7284
|
+
}),
|
7285
|
+
role: "button",
|
7286
|
+
"aria-label": `Remove ${children}`
|
7287
|
+
}), /* @__PURE__ */ React72.createElement(Icon, {
|
7275
7288
|
icon: import_smallCross.default,
|
7276
|
-
className: tw(
|
7289
|
+
className: tw({
|
7277
7290
|
"text-error-70": invalid,
|
7278
7291
|
"text-grey-70": !invalid
|
7279
7292
|
})
|
@@ -7864,12 +7877,15 @@ var Footer = (_a) => {
|
|
7864
7877
|
}));
|
7865
7878
|
};
|
7866
7879
|
var Section2 = (_a) => {
|
7867
|
-
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
7880
|
+
var _b = _a, { title, className } = _b, rest = __objRest(_b, ["title", "className"]);
|
7868
7881
|
return /* @__PURE__ */ React76.createElement("li", {
|
7869
|
-
role: "presentation"
|
7870
|
-
|
7882
|
+
role: "presentation",
|
7883
|
+
className: tw("py-5")
|
7884
|
+
}, title && /* @__PURE__ */ React76.createElement("div", {
|
7885
|
+
className: classNames(className, "py-2 px-6 text-grey-40 uppercase cursor-default typography-caption")
|
7886
|
+
}, title), /* @__PURE__ */ React76.createElement("ul", __spreadProps(__spreadValues({}, rest), {
|
7871
7887
|
role: "group",
|
7872
|
-
className: classNames(tw("
|
7888
|
+
className: classNames(tw("flex flex-col"), className)
|
7873
7889
|
})));
|
7874
7890
|
};
|
7875
7891
|
var Divider3 = (_a) => {
|
@@ -7976,7 +7992,9 @@ var PageHeader2 = ({
|
|
7976
7992
|
chips = [],
|
7977
7993
|
breadcrumbs
|
7978
7994
|
}) => {
|
7979
|
-
return /* @__PURE__ */ React79.createElement(PageHeader, null, /* @__PURE__ */ React79.createElement(PageHeader.Container, null, breadcrumbs && /* @__PURE__ */ React79.createElement(
|
7995
|
+
return /* @__PURE__ */ React79.createElement(PageHeader, null, /* @__PURE__ */ React79.createElement(PageHeader.Container, null, breadcrumbs && /* @__PURE__ */ React79.createElement(Box, {
|
7996
|
+
marginBottom: image ? "3" : void 0
|
7997
|
+
}, /* @__PURE__ */ React79.createElement(Breadcrumbs, null, breadcrumbs)), /* @__PURE__ */ React79.createElement(Flexbox, {
|
7980
7998
|
gap: "5"
|
7981
7999
|
}, image && /* @__PURE__ */ React79.createElement("img", {
|
7982
8000
|
src: image,
|