@aivenio/aquarium 1.40.0 → 1.41.0
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/atoms.cjs +6 -4
- package/dist/atoms.mjs +6 -4
- package/dist/src/atoms/DataList/DataList.d.ts +7 -1
- package/dist/src/atoms/DataList/DataList.js +18 -4
- package/dist/src/atoms/Section/Section.js +2 -2
- package/dist/src/atoms/Table/Table.js +5 -3
- package/dist/src/icons/infoSign.js +2 -2
- package/dist/src/molecules/Accordion/Accordion.d.ts +36 -0
- package/dist/src/molecules/Accordion/Accordion.js +90 -0
- package/dist/src/molecules/DataList/DataList.d.ts +29 -2
- package/dist/src/molecules/DataList/DataList.js +93 -13
- package/dist/src/molecules/DataTable/DataTable.d.ts +6 -1
- package/dist/src/molecules/DataTable/DataTable.js +50 -12
- package/dist/src/molecules/Input/Input.js +2 -2
- package/dist/src/molecules/Textarea/Textarea.js +2 -2
- package/dist/src/utils/table/types.d.ts +3 -3
- package/dist/styles.css +23 -7
- package/dist/system.cjs +824 -553
- package/dist/system.mjs +805 -534
- 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
@@ -2745,7 +2745,7 @@ var require_infoSign = __commonJS({
|
|
2745
2745
|
"src/icons/infoSign.js"(exports) {
|
2746
2746
|
"use strict";
|
2747
2747
|
var data = {
|
2748
|
-
"body": '<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M11 7.
|
2748
|
+
"body": '<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M11 7.333V9m0 7v-4m9.167-1a9.167 9.167 0 11-18.334 0 9.167 9.167 0 0118.334 0Z"/>',
|
2749
2749
|
"left": 0,
|
2750
2750
|
"top": 0,
|
2751
2751
|
"width": 22,
|
@@ -8766,8 +8766,9 @@ var Container2 = ({ maxWidth = "xl", children }) => /* @__PURE__ */ React47.crea
|
|
8766
8766
|
}, children);
|
8767
8767
|
|
8768
8768
|
// src/molecules/DataList/DataList.tsx
|
8769
|
-
import
|
8769
|
+
import React64 from "react";
|
8770
8770
|
import compact from "lodash/compact";
|
8771
|
+
import groupBy2 from "lodash/groupBy";
|
8771
8772
|
import isFunction from "lodash/isFunction";
|
8772
8773
|
|
8773
8774
|
// src/molecules/DropdownMenu/DropdownMenu.tsx
|
@@ -8865,7 +8866,7 @@ var createInput = (displayName, opts = {}) => {
|
|
8865
8866
|
}, props), {
|
8866
8867
|
disabled,
|
8867
8868
|
maxLength,
|
8868
|
-
required,
|
8869
|
+
"aria-required": required,
|
8869
8870
|
readOnly,
|
8870
8871
|
className: classNames(
|
8871
8872
|
{
|
@@ -9361,7 +9362,7 @@ var _SelectBase = (props) => {
|
|
9361
9362
|
toggle: toggleMenu,
|
9362
9363
|
setOpen: (isOpen2) => isOpen2 ? openMenu() : closeMenu()
|
9363
9364
|
};
|
9364
|
-
const
|
9365
|
+
const renderItem = (item, index) => UNSAFE_renderOption(
|
9365
9366
|
item,
|
9366
9367
|
__spreadValues({
|
9367
9368
|
highlighted: index === highlightedIndex
|
@@ -9375,7 +9376,7 @@ var _SelectBase = (props) => {
|
|
9375
9376
|
);
|
9376
9377
|
const renderGroup = (group) => /* @__PURE__ */ React52.createElement(React52.Fragment, {
|
9377
9378
|
key: group.label
|
9378
|
-
}, /* @__PURE__ */ React52.createElement(Select.Group, null, group.label), group.options.map((opt) =>
|
9379
|
+
}, /* @__PURE__ */ React52.createElement(Select.Group, null, group.label), group.options.map((opt) => renderItem(opt, items.indexOf(opt))));
|
9379
9380
|
const input = /* @__PURE__ */ React52.createElement(Select.InputContainer, __spreadProps(__spreadValues({}, getToggleButtonProps({ disabled: disabled || readOnly, ref: targetRef })), {
|
9380
9381
|
variant: disabled ? "disabled" : !valid ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default",
|
9381
9382
|
tabIndex: 0
|
@@ -9408,7 +9409,7 @@ var _SelectBase = (props) => {
|
|
9408
9409
|
}, /* @__PURE__ */ React52.createElement(Select.Menu, __spreadValues({
|
9409
9410
|
ref: menuRef,
|
9410
9411
|
maxHeight
|
9411
|
-
}, menuProps), options.length === 0 && /* @__PURE__ */ React52.createElement(Select.EmptyStateContainer, null, emptyState), options.length > 0 && !hasOptionGroups(options) && options.map(
|
9412
|
+
}, menuProps), options.length === 0 && /* @__PURE__ */ React52.createElement(Select.EmptyStateContainer, null, emptyState), options.length > 0 && !hasOptionGroups(options) && options.map(renderItem), options.length > 0 && hasOptionGroups(options) && options.map(renderGroup), actions.length > 0 && /* @__PURE__ */ React52.createElement(React52.Fragment, null, /* @__PURE__ */ React52.createElement(Select.Divider, {
|
9412
9413
|
onMouseOver: () => setHighlightedIndex(-1)
|
9413
9414
|
}), actions.map((act, index) => /* @__PURE__ */ React52.createElement(Select.ActionItem, __spreadProps(__spreadValues({
|
9414
9415
|
key: `${index}`
|
@@ -9606,7 +9607,7 @@ var usePagination = (items, options) => {
|
|
9606
9607
|
// src/molecules/List/List.tsx
|
9607
9608
|
var List2 = ({
|
9608
9609
|
items,
|
9609
|
-
renderItem
|
9610
|
+
renderItem,
|
9610
9611
|
container = React54.Fragment,
|
9611
9612
|
paginationContainer = React54.Fragment,
|
9612
9613
|
pagination
|
@@ -9616,7 +9617,7 @@ var List2 = ({
|
|
9616
9617
|
const paginationProps = isObject(pagination) ? pagination : {};
|
9617
9618
|
const [paginatedItems, paginationState] = usePagination(items, paginationProps);
|
9618
9619
|
const listItems = pagination ? paginatedItems : items;
|
9619
|
-
return /* @__PURE__ */ React54.createElement(React54.Fragment, null, /* @__PURE__ */ React54.createElement(Component, null, listItems.map(
|
9620
|
+
return /* @__PURE__ */ React54.createElement(React54.Fragment, null, /* @__PURE__ */ React54.createElement(Component, null, listItems.map(renderItem)), pagination && /* @__PURE__ */ React54.createElement(PaginationComponent, null, /* @__PURE__ */ React54.createElement(Pagination, __spreadValues(__spreadValues({}, paginationState), paginationProps))));
|
9620
9621
|
};
|
9621
9622
|
|
9622
9623
|
// src/molecules/Template/Template.tsx
|
@@ -9711,9 +9712,11 @@ var TableBody = (_a) => {
|
|
9711
9712
|
};
|
9712
9713
|
var rowClassNames = tw("children:border-grey-10 group children:last:border-b-0 hover:bg-grey-0");
|
9713
9714
|
var TableRow = (_a) => {
|
9714
|
-
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
9715
|
-
return /* @__PURE__ */ React57.createElement("tr", __spreadProps(__spreadValues({}, rest), {
|
9716
|
-
className: classNames(rowClassNames, className
|
9715
|
+
var _b = _a, { children, className, disabled } = _b, rest = __objRest(_b, ["children", "className", "disabled"]);
|
9716
|
+
return /* @__PURE__ */ React57.createElement("tr", __spreadProps(__spreadValues(__spreadValues({}, rest), { inert: disabled ? "" : void 0 }), {
|
9717
|
+
className: classNames(rowClassNames, className, {
|
9718
|
+
"opacity-70": disabled
|
9719
|
+
})
|
9717
9720
|
}), children);
|
9718
9721
|
};
|
9719
9722
|
var cellClassNames = tw("px-4 border-b typography-small leading-[18px]");
|
@@ -9856,16 +9859,30 @@ var Cell = (_a) => {
|
|
9856
9859
|
cellClassNames,
|
9857
9860
|
getBodyCellClassNames(false, stickyColumn),
|
9858
9861
|
getAlignClassNames2(align),
|
9859
|
-
tw("border-grey-10 group-hover:bg-grey-0 group-last:border-b-0"),
|
9862
|
+
tw("border-grey-10 group-hover:bg-grey-0 group-last-of-type:border-b-0"),
|
9860
9863
|
className
|
9861
9864
|
)
|
9862
9865
|
}));
|
9863
9866
|
};
|
9864
9867
|
var Row = (_a) => {
|
9865
|
-
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
9866
|
-
return /* @__PURE__ */ React58.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
9867
|
-
className: classNames(tw("contents
|
9868
|
-
|
9868
|
+
var _b = _a, { className, disabled, subgroup } = _b, rest = __objRest(_b, ["className", "disabled", "subgroup"]);
|
9869
|
+
return /* @__PURE__ */ React58.createElement("div", __spreadProps(__spreadValues(__spreadValues({}, rest), { inert: disabled ? "" : void 0 }), {
|
9870
|
+
className: classNames(tw("contents"), className, {
|
9871
|
+
"children:opacity-70": disabled,
|
9872
|
+
"[&>.group>*]:bg-grey-0 [&>.group>*:first-child]:border-b-0 ": subgroup,
|
9873
|
+
"group": !subgroup
|
9874
|
+
}),
|
9875
|
+
role: !subgroup ? "row" : void 0
|
9876
|
+
}));
|
9877
|
+
};
|
9878
|
+
var SubGroupSpacing = (_a) => {
|
9879
|
+
var _b = _a, { className, divider } = _b, rest = __objRest(_b, ["className", "divider"]);
|
9880
|
+
return /* @__PURE__ */ React58.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
9881
|
+
"aria-hidden": true,
|
9882
|
+
className: classNames(
|
9883
|
+
tw("col-span-full h-6 bg-grey-0", { "border-b border-grey-10": Boolean(divider) }),
|
9884
|
+
className
|
9885
|
+
)
|
9869
9886
|
}));
|
9870
9887
|
};
|
9871
9888
|
var SortCell = (_a) => {
|
@@ -9893,9 +9910,15 @@ var SortCell = (_a) => {
|
|
9893
9910
|
}))));
|
9894
9911
|
};
|
9895
9912
|
DataList.HeadCell = HeadCell;
|
9913
|
+
DataList.HeadCell.displayName = "DataList.HeadCell";
|
9896
9914
|
DataList.SortCell = SortCell;
|
9915
|
+
DataList.SortCell.displayName = "DataList.SortCell";
|
9897
9916
|
DataList.Cell = Cell;
|
9917
|
+
DataList.Cell.displayName = "DataList.Cell";
|
9918
|
+
DataList.SubGroupSpacing = SubGroupSpacing;
|
9919
|
+
DataList.SubGroupSpacing.displayName = "DataList.SubGroupSpacing";
|
9898
9920
|
DataList.Row = Row;
|
9921
|
+
DataList.Row.displayName = "DataList.Row";
|
9899
9922
|
|
9900
9923
|
// src/utils/object.ts
|
9901
9924
|
var renameProperty = (oldProp, newProp, _a) => {
|
@@ -9950,26 +9973,182 @@ var sortRowsBy = (rows, sort) => {
|
|
9950
9973
|
// src/molecules/DataList/DataList.tsx
|
9951
9974
|
var import_more2 = __toESM(require_more());
|
9952
9975
|
|
9953
|
-
// src/molecules/
|
9976
|
+
// src/molecules/Accordion/Accordion.tsx
|
9977
|
+
import React62, { createContext as createContext2, useContext as useContext3, useState as useState9 } from "react";
|
9978
|
+
import { Icon as Icon2 } from "@iconify/react";
|
9979
|
+
import { animated as animated3, useSpring as useSpring2 } from "@react-spring/web";
|
9980
|
+
|
9981
|
+
// src/utils/useMeasure.ts
|
9954
9982
|
import React60 from "react";
|
9983
|
+
function useMeasure() {
|
9984
|
+
const ref = React60.useRef(null);
|
9985
|
+
const [rect, setRect] = React60.useState({
|
9986
|
+
width: null,
|
9987
|
+
height: null
|
9988
|
+
});
|
9989
|
+
React60.useLayoutEffect(() => {
|
9990
|
+
if (!ref.current || !window.ResizeObserver) {
|
9991
|
+
return;
|
9992
|
+
}
|
9993
|
+
const observer = new window.ResizeObserver(([entry]) => {
|
9994
|
+
if (entry == null ? void 0 : entry.contentRect) {
|
9995
|
+
setRect({
|
9996
|
+
width: entry.contentRect.width,
|
9997
|
+
height: entry.contentRect.height
|
9998
|
+
});
|
9999
|
+
}
|
10000
|
+
});
|
10001
|
+
observer.observe(ref.current);
|
10002
|
+
return () => {
|
10003
|
+
observer.disconnect();
|
10004
|
+
};
|
10005
|
+
}, []);
|
10006
|
+
return [ref, rect];
|
10007
|
+
}
|
10008
|
+
|
10009
|
+
// src/molecules/Divider/Divider.tsx
|
10010
|
+
import React61 from "react";
|
10011
|
+
var sizeClasses = {
|
10012
|
+
horizontal: {
|
10013
|
+
1: "h-1px",
|
10014
|
+
2: "h-1",
|
10015
|
+
4: "h-2",
|
10016
|
+
8: "h-3",
|
10017
|
+
16: "h-5",
|
10018
|
+
24: "h-6"
|
10019
|
+
},
|
10020
|
+
vertical: {
|
10021
|
+
1: "w-1px",
|
10022
|
+
2: "w-1",
|
10023
|
+
4: "w-2",
|
10024
|
+
8: "w-3",
|
10025
|
+
16: "w-5",
|
10026
|
+
24: "w-6"
|
10027
|
+
}
|
10028
|
+
};
|
10029
|
+
var Divider2 = (_a) => {
|
10030
|
+
var _b = _a, { direction = "horizontal", size = 1 } = _b, props = __objRest(_b, ["direction", "size"]);
|
10031
|
+
const sizeClass = sizeClasses[direction][size];
|
10032
|
+
return /* @__PURE__ */ React61.createElement("div", __spreadProps(__spreadValues({}, props), {
|
10033
|
+
className: classNames(
|
10034
|
+
"Aquarium-Divider",
|
10035
|
+
tw(`bg-grey-5 ${sizeClass}`, {
|
10036
|
+
"block w-full": direction === "horizontal",
|
10037
|
+
"inline-block h-full": direction === "vertical"
|
10038
|
+
})
|
10039
|
+
)
|
10040
|
+
}));
|
10041
|
+
};
|
10042
|
+
|
10043
|
+
// src/molecules/Accordion/Accordion.tsx
|
10044
|
+
var AccordionContext = createContext2(null);
|
10045
|
+
var useAccordionContext = () => {
|
10046
|
+
const context2 = useContext3(AccordionContext);
|
10047
|
+
if (context2 === null) {
|
10048
|
+
throw new Error("AccordionContext was used outside of provider.");
|
10049
|
+
}
|
10050
|
+
return context2;
|
10051
|
+
};
|
10052
|
+
var Accordion = ({ children }) => {
|
10053
|
+
const [state, setState] = useState9(void 0);
|
10054
|
+
return /* @__PURE__ */ React62.createElement(AccordionContext.Provider, {
|
10055
|
+
value: [state, setState]
|
10056
|
+
}, children);
|
10057
|
+
};
|
10058
|
+
var AccordionToggle = (_a) => {
|
10059
|
+
var _b = _a, { panelId } = _b, rest = __objRest(_b, ["panelId"]);
|
10060
|
+
const [openPanelId, setOpenPanelId] = useAccordionContext();
|
10061
|
+
const isOpen = openPanelId === panelId;
|
10062
|
+
const handleClick = () => setOpenPanelId(isOpen ? void 0 : panelId);
|
10063
|
+
const { transform } = useSpring2({
|
10064
|
+
transform: `rotate(${isOpen ? 0 : 180}deg)`,
|
10065
|
+
config: {
|
10066
|
+
duration: 150
|
10067
|
+
}
|
10068
|
+
});
|
10069
|
+
return /* @__PURE__ */ React62.createElement(animated3.div, __spreadProps(__spreadValues({}, rest), {
|
10070
|
+
role: "button",
|
10071
|
+
tabIndex: 0,
|
10072
|
+
"aria-expanded": openPanelId === panelId,
|
10073
|
+
"aria-controls": panelId,
|
10074
|
+
onClick: handleClick,
|
10075
|
+
style: { transform }
|
10076
|
+
}), /* @__PURE__ */ React62.createElement(Icon2, {
|
10077
|
+
icon: import_caretUp.default,
|
10078
|
+
height: 22,
|
10079
|
+
width: 22
|
10080
|
+
}));
|
10081
|
+
};
|
10082
|
+
var AccordionPanel = (_a) => {
|
10083
|
+
var _b = _a, { children, panelId } = _b, rest = __objRest(_b, ["children", "panelId"]);
|
10084
|
+
const [openPanelId] = useAccordionContext();
|
10085
|
+
const isOpen = openPanelId === panelId;
|
10086
|
+
const [ref, { height }] = useMeasure();
|
10087
|
+
const style = useSpring2({
|
10088
|
+
height: isOpen ? height != null ? height : 0 : 0,
|
10089
|
+
opacity: isOpen ? 1 : 0,
|
10090
|
+
config: {
|
10091
|
+
duration: 150
|
10092
|
+
}
|
10093
|
+
});
|
10094
|
+
return /* @__PURE__ */ React62.createElement(animated3.div, __spreadProps(__spreadValues({}, rest), {
|
10095
|
+
role: "region",
|
10096
|
+
id: panelId,
|
10097
|
+
style
|
10098
|
+
}), /* @__PURE__ */ React62.createElement("div", {
|
10099
|
+
ref
|
10100
|
+
}, children));
|
10101
|
+
};
|
10102
|
+
var AccordionUnanimatedPanel = ({ children, panelId }) => {
|
10103
|
+
const [openPanelId] = useAccordionContext();
|
10104
|
+
const isOpen = openPanelId === panelId;
|
10105
|
+
return /* @__PURE__ */ React62.createElement(React62.Fragment, null, isOpen ? children : null);
|
10106
|
+
};
|
10107
|
+
var AccordionSummary = (_a) => {
|
10108
|
+
var _b = _a, { title, description, toggle } = _b, rest = __objRest(_b, ["title", "description", "toggle"]);
|
10109
|
+
return /* @__PURE__ */ React62.createElement(Box.Flex, __spreadValues({
|
10110
|
+
justifyContent: "space-between",
|
10111
|
+
padding: "4"
|
10112
|
+
}, rest), /* @__PURE__ */ React62.createElement(Typography2, null, title), /* @__PURE__ */ React62.createElement(Typography2.Small, {
|
10113
|
+
color: "grey-40"
|
10114
|
+
}, description), toggle);
|
10115
|
+
};
|
10116
|
+
var AccordionContainer = (_a) => {
|
10117
|
+
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
10118
|
+
return /* @__PURE__ */ React62.createElement("div", __spreadValues({}, rest), children, /* @__PURE__ */ React62.createElement(Divider2, null));
|
10119
|
+
};
|
10120
|
+
Accordion.displayName = "Accordion";
|
10121
|
+
Accordion.Container = AccordionContainer;
|
10122
|
+
Accordion.Container.displayName = "Accordion.Container";
|
10123
|
+
Accordion.Summary = AccordionSummary;
|
10124
|
+
Accordion.Summary.displayName = "Accordion.Summary";
|
10125
|
+
Accordion.Toggle = AccordionToggle;
|
10126
|
+
Accordion.Toggle.displayName = "Accordion.Toggle";
|
10127
|
+
Accordion.Panel = AccordionPanel;
|
10128
|
+
Accordion.Panel.displayName = "Accordion.Panel";
|
10129
|
+
Accordion.UnanimatedPanel = AccordionUnanimatedPanel;
|
10130
|
+
Accordion.UnanimatedPanel.displayName = "Accordion.UnanimatedPanel";
|
10131
|
+
|
10132
|
+
// src/molecules/DataList/DataListSkeleton.tsx
|
10133
|
+
import React63 from "react";
|
9955
10134
|
var DataListSkeleton = ({ columns = ["1", "2", "2", 52], rows = 5 }) => {
|
9956
10135
|
const columnsAmount = [...Array(typeof columns === "number" ? columns : columns.length).keys()];
|
9957
|
-
return /* @__PURE__ */
|
10136
|
+
return /* @__PURE__ */ React63.createElement(Template, {
|
9958
10137
|
columns
|
9959
|
-
}, columnsAmount.map((_, index) => /* @__PURE__ */
|
10138
|
+
}, columnsAmount.map((_, index) => /* @__PURE__ */ React63.createElement(DataList.HeadCell, {
|
9960
10139
|
key: index
|
9961
|
-
}, /* @__PURE__ */
|
10140
|
+
}, /* @__PURE__ */ React63.createElement(Skeleton, {
|
9962
10141
|
width: "100%",
|
9963
10142
|
height: 17.5
|
9964
|
-
}))), /* @__PURE__ */
|
10143
|
+
}))), /* @__PURE__ */ React63.createElement(List2, {
|
9965
10144
|
items: [...Array(rows).keys()],
|
9966
|
-
renderItem: (item) => /* @__PURE__ */
|
10145
|
+
renderItem: (item) => /* @__PURE__ */ React63.createElement(DataList.Row, {
|
9967
10146
|
key: item
|
9968
|
-
}, /* @__PURE__ */
|
10147
|
+
}, /* @__PURE__ */ React63.createElement(List2, {
|
9969
10148
|
items: columnsAmount,
|
9970
|
-
renderItem: (key) => /* @__PURE__ */
|
10149
|
+
renderItem: (key) => /* @__PURE__ */ React63.createElement(DataList.Cell, {
|
9971
10150
|
key
|
9972
|
-
}, /* @__PURE__ */
|
10151
|
+
}, /* @__PURE__ */ React63.createElement(Skeleton, {
|
9973
10152
|
width: "100%",
|
9974
10153
|
height: 17.5
|
9975
10154
|
}))
|
@@ -9978,6 +10157,7 @@ var DataListSkeleton = ({ columns = ["1", "2", "2", 52], rows = 5 }) => {
|
|
9978
10157
|
};
|
9979
10158
|
|
9980
10159
|
// src/molecules/DataList/DataList.tsx
|
10160
|
+
var sortGroupKeys = (groupKeys) => [...groupKeys].sort((a) => a === "undefined" ? -1 : 1);
|
9981
10161
|
var DataList2 = ({
|
9982
10162
|
columns,
|
9983
10163
|
rows,
|
@@ -9988,84 +10168,195 @@ var DataList2 = ({
|
|
9988
10168
|
menuHeaderName = "Actions",
|
9989
10169
|
onAction,
|
9990
10170
|
onMenuOpenChange,
|
9991
|
-
|
10171
|
+
rowDetails,
|
10172
|
+
pagination,
|
10173
|
+
group,
|
10174
|
+
disabled,
|
10175
|
+
getGroupRow
|
9992
10176
|
}) => {
|
9993
10177
|
const [sort, updateSort] = useTableSort();
|
9994
10178
|
const sortedRows = sortRowsBy(rows, sort);
|
10179
|
+
const groups = group ? groupBy2(sortedRows, group) : void 0;
|
10180
|
+
const groupKeys = groups ? Object.keys(groups) : void 0;
|
10181
|
+
const hasCustomRenderForGroupRow = isFunction(getGroupRow);
|
10182
|
+
const isCollapsible = isFunction(rowDetails) || group;
|
9995
10183
|
const templateColumns = compact([
|
10184
|
+
isCollapsible ? 50 : void 0,
|
9996
10185
|
...columns.map((column) => {
|
9997
10186
|
var _a;
|
9998
10187
|
return (_a = column.width) != null ? _a : "auto";
|
9999
10188
|
}),
|
10000
10189
|
menu ? "auto" : void 0
|
10001
10190
|
]);
|
10002
|
-
const PaginationFooter =
|
10003
|
-
({ children }) => /* @__PURE__ */
|
10004
|
-
style: { gridColumn:
|
10191
|
+
const PaginationFooter = React64.useCallback(
|
10192
|
+
({ children }) => /* @__PURE__ */ React64.createElement("div", {
|
10193
|
+
style: { gridColumn: "1 / -1" }
|
10005
10194
|
}, children),
|
10006
|
-
[
|
10195
|
+
[]
|
10007
10196
|
);
|
10008
|
-
return /* @__PURE__ */
|
10197
|
+
return /* @__PURE__ */ React64.createElement(Template, {
|
10009
10198
|
className: "Aquarium-DataList",
|
10010
10199
|
columns: templateColumns
|
10011
|
-
},
|
10012
|
-
|
10200
|
+
}, isCollapsible && /* @__PURE__ */ React64.createElement(DataList.HeadCell, {
|
10201
|
+
align: "left"
|
10202
|
+
}), columns.map((column) => {
|
10203
|
+
const content = column.headerTooltip ? /* @__PURE__ */ React64.createElement(Tooltip, {
|
10013
10204
|
placement: column.headerTooltip.placement,
|
10014
10205
|
content: column.headerTooltip.content
|
10015
10206
|
}, column.headerName) : column.headerName;
|
10016
|
-
return columnIsFieldColumn(column) && column.sortable || column.sort ? /* @__PURE__ */
|
10207
|
+
return columnIsFieldColumn(column) && column.sortable || column.sort ? /* @__PURE__ */ React64.createElement(DataList.SortCell, __spreadValues({
|
10017
10208
|
direction: sort && sort.column.headerName === column.headerName ? sort.direction : "none",
|
10018
10209
|
onClick: () => updateSort(column),
|
10019
10210
|
sticky
|
10020
|
-
}, cellProps(column)), content) : /* @__PURE__ */
|
10211
|
+
}, cellProps(column)), content) : /* @__PURE__ */ React64.createElement(DataList.HeadCell, __spreadProps(__spreadValues({}, cellProps(column)), {
|
10021
10212
|
sticky
|
10022
10213
|
}), content);
|
10023
|
-
}), menu && /* @__PURE__ */
|
10214
|
+
}), menu && /* @__PURE__ */ React64.createElement(DataList.HeadCell, {
|
10024
10215
|
align: "right",
|
10025
10216
|
"aria-label": menuAriaLabel
|
10026
|
-
}, menuHeaderName), /* @__PURE__ */
|
10217
|
+
}, menuHeaderName), groups && groupKeys ? /* @__PURE__ */ React64.createElement(List2, {
|
10218
|
+
items: sortGroupKeys(groupKeys),
|
10219
|
+
renderItem: (key) => {
|
10220
|
+
const groupContent = /* @__PURE__ */ React64.createElement(List2, {
|
10221
|
+
key,
|
10222
|
+
items: groups[key],
|
10223
|
+
renderItem: (row, index) => renderRow(
|
10224
|
+
columns,
|
10225
|
+
row,
|
10226
|
+
index,
|
10227
|
+
sortedRows,
|
10228
|
+
renderRowMenu(row, index, { menu, onAction, onMenuOpenChange, menuAriaLabel }),
|
10229
|
+
disabled,
|
10230
|
+
() => /* @__PURE__ */ React64.createElement(DataList.Cell, null)
|
10231
|
+
)
|
10232
|
+
});
|
10233
|
+
return key === "undefined" ? groupContent : /* @__PURE__ */ React64.createElement(Accordion, {
|
10234
|
+
key
|
10235
|
+
}, hasCustomRenderForGroupRow ? /* @__PURE__ */ React64.createElement(DataList.Row, null, /* @__PURE__ */ React64.createElement(DataList.Cell, null, /* @__PURE__ */ React64.createElement(Accordion.Toggle, {
|
10236
|
+
panelId: key
|
10237
|
+
})), /* @__PURE__ */ React64.createElement(List2, {
|
10238
|
+
items: columns,
|
10239
|
+
renderItem: (column) => /* @__PURE__ */ React64.createElement(DataList.Cell, __spreadValues({}, cellProps(column)), renderCell(column, getGroupRow(key, groups[key]), -1, []))
|
10240
|
+
}), renderRowMenu(getGroupRow(key, groups[key]), -1, {
|
10241
|
+
menu,
|
10242
|
+
onAction,
|
10243
|
+
onMenuOpenChange,
|
10244
|
+
menuAriaLabel
|
10245
|
+
})) : /* @__PURE__ */ React64.createElement(DataList.Row, null, /* @__PURE__ */ React64.createElement(DataList.Cell, null, /* @__PURE__ */ React64.createElement(Accordion.Toggle, {
|
10246
|
+
panelId: key
|
10247
|
+
})), /* @__PURE__ */ React64.createElement(DataList.Cell, {
|
10248
|
+
style: { gridColumn: "2 / -1", gap: 4 }
|
10249
|
+
}, "Group: ", /* @__PURE__ */ React64.createElement("b", null, key))), /* @__PURE__ */ React64.createElement(DataList.Row, {
|
10250
|
+
subgroup: true
|
10251
|
+
}, /* @__PURE__ */ React64.createElement(Accordion.UnanimatedPanel, {
|
10252
|
+
panelId: key
|
10253
|
+
}, /* @__PURE__ */ React64.createElement(DataList.SubGroupSpacing, null), groupContent, /* @__PURE__ */ React64.createElement(DataList.SubGroupSpacing, {
|
10254
|
+
divider: true
|
10255
|
+
}))));
|
10256
|
+
}
|
10257
|
+
}) : /* @__PURE__ */ React64.createElement(List2, {
|
10027
10258
|
pagination,
|
10028
10259
|
paginationContainer: PaginationFooter,
|
10029
10260
|
items: sortedRows,
|
10030
|
-
renderItem: (row, index) =>
|
10031
|
-
|
10032
|
-
|
10033
|
-
|
10034
|
-
|
10035
|
-
|
10261
|
+
renderItem: (row, index) => {
|
10262
|
+
const details = rowDetails == null ? void 0 : rowDetails(row, index, sortedRows);
|
10263
|
+
const content = renderRow(
|
10264
|
+
columns,
|
10265
|
+
row,
|
10266
|
+
index,
|
10267
|
+
sortedRows,
|
10268
|
+
renderRowMenu(row, index, { menu, onAction, onMenuOpenChange, menuAriaLabel }),
|
10269
|
+
disabled,
|
10270
|
+
() => rowDetails !== void 0 && /* @__PURE__ */ React64.createElement(DataList.Cell, null, details && /* @__PURE__ */ React64.createElement(Accordion.Toggle, {
|
10271
|
+
panelId: row.id.toString()
|
10272
|
+
}))
|
10273
|
+
);
|
10274
|
+
return details ? /* @__PURE__ */ React64.createElement(Accordion, {
|
10275
|
+
key: row.id
|
10276
|
+
}, content, /* @__PURE__ */ React64.createElement(Accordion.Panel, {
|
10277
|
+
panelId: row.id.toString(),
|
10278
|
+
className: tw("col-span-full bg-grey-0")
|
10279
|
+
}, details)) : content;
|
10280
|
+
}
|
10281
|
+
}));
|
10282
|
+
};
|
10283
|
+
var renderRowMenu = (row, index, {
|
10284
|
+
menu,
|
10285
|
+
onAction,
|
10286
|
+
onMenuOpenChange,
|
10287
|
+
menuAriaLabel
|
10288
|
+
}) => {
|
10289
|
+
if (menu) {
|
10290
|
+
const menuContent = isFunction(menu) ? menu(row, index) : menu;
|
10291
|
+
return /* @__PURE__ */ React64.createElement(DataList.Cell, {
|
10036
10292
|
align: "right"
|
10037
|
-
}, /* @__PURE__ */
|
10293
|
+
}, menuContent && /* @__PURE__ */ React64.createElement(DropdownMenu2, {
|
10038
10294
|
onAction: (action) => onAction == null ? void 0 : onAction(action, row, index),
|
10039
10295
|
onOpenChange: onMenuOpenChange
|
10040
|
-
}, /* @__PURE__ */
|
10296
|
+
}, /* @__PURE__ */ React64.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ React64.createElement(Button.Icon, {
|
10041
10297
|
"aria-label": menuAriaLabel,
|
10042
10298
|
icon: import_more2.default
|
10043
|
-
})),
|
10044
|
-
}
|
10299
|
+
})), menuContent));
|
10300
|
+
}
|
10301
|
+
return void 0;
|
10045
10302
|
};
|
10046
|
-
var
|
10047
|
-
|
10048
|
-
|
10049
|
-
|
10050
|
-
|
10051
|
-
|
10052
|
-
|
10303
|
+
var renderRow = (columns, row, index, rows, menu, disabled, renderFirstColumn) => {
|
10304
|
+
var _a;
|
10305
|
+
const isRowDisabled = (_a = disabled == null ? void 0 : disabled(row, index, rows)) != null ? _a : false;
|
10306
|
+
return /* @__PURE__ */ React64.createElement(DataList.Row, {
|
10307
|
+
key: row.id,
|
10308
|
+
disabled: isRowDisabled
|
10309
|
+
}, renderFirstColumn == null ? void 0 : renderFirstColumn(row, index, rows), /* @__PURE__ */ React64.createElement(List2, {
|
10310
|
+
items: columns,
|
10311
|
+
renderItem: (column) => /* @__PURE__ */ React64.createElement(DataList.Cell, __spreadValues({}, cellProps(column)), renderCell(column, row, index, rows))
|
10312
|
+
}), menu);
|
10313
|
+
};
|
10314
|
+
var DEFAULT_CONTENT = "";
|
10315
|
+
var renderCell = (column, row, index, rows) => {
|
10316
|
+
let cellContent = DEFAULT_CONTENT;
|
10317
|
+
if (column.type === "status") {
|
10318
|
+
const status = column.status(row, index, rows);
|
10319
|
+
if (status) {
|
10320
|
+
cellContent = /* @__PURE__ */ React64.createElement(StatusChip, __spreadValues({
|
10321
|
+
dense: true
|
10322
|
+
}, status));
|
10323
|
+
}
|
10324
|
+
} else if (column.type === "action") {
|
10325
|
+
const action = renameProperty("text", "children", column.action(row, index, rows));
|
10326
|
+
if (action) {
|
10327
|
+
cellContent = /* @__PURE__ */ React64.createElement(Button.Secondary, __spreadValues({
|
10328
|
+
dense: true
|
10329
|
+
}, action));
|
10330
|
+
}
|
10331
|
+
} else if (column.type === "custom") {
|
10332
|
+
cellContent = column.UNSAFE_render(row, index, rows);
|
10333
|
+
} else if (column.type === "item") {
|
10334
|
+
const item = column.item(row, index, rows);
|
10335
|
+
if (item) {
|
10336
|
+
cellContent = /* @__PURE__ */ React64.createElement(Item4, __spreadValues({}, item));
|
10337
|
+
}
|
10338
|
+
} else if (column.formatter) {
|
10339
|
+
cellContent = column.formatter(row[column.field], row, index, rows);
|
10340
|
+
} else {
|
10341
|
+
cellContent = row[column.field];
|
10342
|
+
}
|
10343
|
+
return column.tooltip ? /* @__PURE__ */ React64.createElement(Tooltip, __spreadValues({}, column.tooltip(row, index, rows)), cellContent) : cellContent;
|
10053
10344
|
};
|
10054
10345
|
DataList2.Skeleton = DataListSkeleton;
|
10055
10346
|
|
10056
10347
|
// src/molecules/DataTable/DataTable.tsx
|
10057
|
-
import
|
10348
|
+
import React67 from "react";
|
10058
10349
|
import compact2 from "lodash/compact";
|
10059
10350
|
import isFunction2 from "lodash/isFunction";
|
10060
10351
|
|
10061
10352
|
// src/molecules/Table/Table.tsx
|
10062
|
-
import
|
10353
|
+
import React66 from "react";
|
10063
10354
|
|
10064
10355
|
// src/utils/table/useScrollTarget.ts
|
10065
|
-
import
|
10356
|
+
import React65 from "react";
|
10066
10357
|
var useScrollTarget = (callback) => {
|
10067
|
-
const targetRef =
|
10068
|
-
|
10358
|
+
const targetRef = React65.useRef(null);
|
10359
|
+
React65.useLayoutEffect(() => {
|
10069
10360
|
const observer = new IntersectionObserver((entries) => entries[0].isIntersecting && callback && callback(), {
|
10070
10361
|
root: null,
|
10071
10362
|
rootMargin: `0px 0px 200px 0px`
|
@@ -10083,12 +10374,12 @@ var Table2 = (_a) => {
|
|
10083
10374
|
var _b = _a, { children, onPrev, onNext } = _b, rest = __objRest(_b, ["children", "onPrev", "onNext"]);
|
10084
10375
|
const bottomRef = useScrollTarget(onNext);
|
10085
10376
|
const topRef = useScrollTarget(onPrev);
|
10086
|
-
return /* @__PURE__ */
|
10377
|
+
return /* @__PURE__ */ React66.createElement("div", {
|
10087
10378
|
className: classNames("Aquarium-Table", tw("relative w-full"))
|
10088
|
-
}, /* @__PURE__ */
|
10379
|
+
}, /* @__PURE__ */ React66.createElement("div", {
|
10089
10380
|
ref: topRef,
|
10090
10381
|
className: tw("absolute top-0 h-1 w-full left-0 bg-transparent")
|
10091
|
-
}), /* @__PURE__ */
|
10382
|
+
}), /* @__PURE__ */ React66.createElement(Table, __spreadValues({}, rest), children), /* @__PURE__ */ React66.createElement("div", {
|
10092
10383
|
ref: bottomRef,
|
10093
10384
|
className: tw("absolute bottom-0 h-1 w-full left-0 bg-transparent")
|
10094
10385
|
}));
|
@@ -10115,7 +10406,8 @@ var DataTable = (_a) => {
|
|
10115
10406
|
menuHeaderName = "Actions",
|
10116
10407
|
onAction,
|
10117
10408
|
onMenuOpenChange,
|
10118
|
-
pagination
|
10409
|
+
pagination,
|
10410
|
+
disabled
|
10119
10411
|
} = _b, rest = __objRest(_b, [
|
10120
10412
|
"columns",
|
10121
10413
|
"rows",
|
@@ -10128,18 +10420,19 @@ var DataTable = (_a) => {
|
|
10128
10420
|
"menuHeaderName",
|
10129
10421
|
"onAction",
|
10130
10422
|
"onMenuOpenChange",
|
10131
|
-
"pagination"
|
10423
|
+
"pagination",
|
10424
|
+
"disabled"
|
10132
10425
|
]);
|
10133
10426
|
const [sort, updateSort] = useTableSort();
|
10134
10427
|
const sortedRows = sortRowsBy(rows, sort);
|
10135
10428
|
const amountOfColumns = columns.length + (menu ? 1 : 0);
|
10136
|
-
const PaginationFooter =
|
10137
|
-
({ children }) => /* @__PURE__ */
|
10429
|
+
const PaginationFooter = React67.useCallback(
|
10430
|
+
({ children }) => /* @__PURE__ */ React67.createElement("tfoot", null, /* @__PURE__ */ React67.createElement("tr", null, /* @__PURE__ */ React67.createElement("td", {
|
10138
10431
|
colSpan: amountOfColumns
|
10139
10432
|
}, children))),
|
10140
10433
|
[amountOfColumns]
|
10141
10434
|
);
|
10142
|
-
return /* @__PURE__ */
|
10435
|
+
return /* @__PURE__ */ React67.createElement(Table2, __spreadProps(__spreadValues({}, rest), {
|
10143
10436
|
className: classNames(
|
10144
10437
|
"Aquarium-DataTable",
|
10145
10438
|
tw({
|
@@ -10148,62 +10441,102 @@ var DataTable = (_a) => {
|
|
10148
10441
|
"table-fixed": layout === "fixed"
|
10149
10442
|
})
|
10150
10443
|
)
|
10151
|
-
}), /* @__PURE__ */
|
10444
|
+
}), /* @__PURE__ */ React67.createElement(Table2.Head, {
|
10152
10445
|
sticky
|
10153
10446
|
}, compact2([
|
10154
10447
|
...columns.map((column) => {
|
10155
|
-
const content = column.headerTooltip && !column.headerInvisible ? /* @__PURE__ */
|
10448
|
+
const content = column.headerTooltip && !column.headerInvisible ? /* @__PURE__ */ React67.createElement(Tooltip, {
|
10156
10449
|
placement: column.headerTooltip.placement,
|
10157
10450
|
content: column.headerTooltip.content
|
10158
10451
|
}, column.headerName) : !column.headerInvisible && column.headerName;
|
10159
|
-
return columnIsFieldColumn(column) && column.sortable || column.sort ? /* @__PURE__ */
|
10452
|
+
return columnIsFieldColumn(column) && column.sortable || column.sort ? /* @__PURE__ */ React67.createElement(Table2.SortCell, __spreadValues({
|
10160
10453
|
direction: sort && sort.column.headerName === column.headerName ? sort.direction : "none",
|
10161
10454
|
onClick: () => updateSort(column),
|
10162
10455
|
style: { width: column.width },
|
10163
10456
|
"aria-label": column.headerInvisible ? column.headerName : void 0
|
10164
|
-
}, cellProps(column)), content) : /* @__PURE__ */
|
10457
|
+
}, cellProps(column)), content) : /* @__PURE__ */ React67.createElement(Table2.Cell, __spreadProps(__spreadValues({}, cellProps(column)), {
|
10165
10458
|
style: { width: column.width },
|
10166
10459
|
"aria-label": column.headerInvisible ? column.headerName : void 0
|
10167
10460
|
}), content);
|
10168
10461
|
}),
|
10169
|
-
menu ? /* @__PURE__ */
|
10462
|
+
menu ? /* @__PURE__ */ React67.createElement(Table2.Cell, {
|
10170
10463
|
key: "__contextMenu",
|
10171
10464
|
align: "right",
|
10172
10465
|
"aria-label": menuAriaLabel
|
10173
10466
|
}, menuHeaderName) : null
|
10174
|
-
])), /* @__PURE__ */
|
10467
|
+
])), /* @__PURE__ */ React67.createElement(List2, {
|
10175
10468
|
container: Table2.Body,
|
10176
10469
|
paginationContainer: PaginationFooter,
|
10177
10470
|
pagination,
|
10178
10471
|
items: sortedRows,
|
10179
|
-
renderItem: (row, index) =>
|
10180
|
-
|
10181
|
-
|
10182
|
-
|
10183
|
-
|
10184
|
-
|
10472
|
+
renderItem: (row, index) => {
|
10473
|
+
var _a2;
|
10474
|
+
const isRowDisabled = (_a2 = disabled == null ? void 0 : disabled(row, index, sortedRows)) != null ? _a2 : false;
|
10475
|
+
return /* @__PURE__ */ React67.createElement(Table2.Row, {
|
10476
|
+
key: row.id,
|
10477
|
+
disabled: isRowDisabled
|
10478
|
+
}, /* @__PURE__ */ React67.createElement(List2, {
|
10479
|
+
items: columns,
|
10480
|
+
renderItem: (column) => /* @__PURE__ */ React67.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), renderCell2(column, row, index, sortedRows))
|
10481
|
+
}), renderRowMenu2(row, index, { menu, menuAriaLabel, onAction, onMenuOpenChange }));
|
10482
|
+
}
|
10483
|
+
}));
|
10484
|
+
};
|
10485
|
+
var renderRowMenu2 = (row, index, {
|
10486
|
+
menu,
|
10487
|
+
onAction,
|
10488
|
+
onMenuOpenChange,
|
10489
|
+
menuAriaLabel
|
10490
|
+
}) => {
|
10491
|
+
if (menu) {
|
10492
|
+
const menuContent = isFunction2(menu) ? menu(row, index) : menu;
|
10493
|
+
return /* @__PURE__ */ React67.createElement(Table2.Cell, {
|
10185
10494
|
align: "right"
|
10186
|
-
}, /* @__PURE__ */
|
10495
|
+
}, menuContent && /* @__PURE__ */ React67.createElement(DropdownMenu2, {
|
10187
10496
|
onAction: (action) => onAction == null ? void 0 : onAction(action, row, index),
|
10188
10497
|
onOpenChange: onMenuOpenChange
|
10189
|
-
}, /* @__PURE__ */
|
10498
|
+
}, /* @__PURE__ */ React67.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ React67.createElement(Button.Icon, {
|
10190
10499
|
"aria-label": menuAriaLabel,
|
10191
10500
|
icon: import_more3.default
|
10192
|
-
})),
|
10193
|
-
}
|
10501
|
+
})), menuContent));
|
10502
|
+
}
|
10503
|
+
return void 0;
|
10194
10504
|
};
|
10195
|
-
var
|
10196
|
-
|
10197
|
-
|
10198
|
-
|
10199
|
-
|
10200
|
-
|
10201
|
-
|
10505
|
+
var DEFAULT_CONTENT2 = "";
|
10506
|
+
var renderCell2 = (column, row, index, rows) => {
|
10507
|
+
let cellContent = DEFAULT_CONTENT2;
|
10508
|
+
if (column.type === "status") {
|
10509
|
+
const status = column.status(row, index, rows);
|
10510
|
+
if (status) {
|
10511
|
+
cellContent = /* @__PURE__ */ React67.createElement(StatusChip, __spreadValues({
|
10512
|
+
dense: true
|
10513
|
+
}, status));
|
10514
|
+
}
|
10515
|
+
} else if (column.type === "action") {
|
10516
|
+
const action = renameProperty("text", "children", column.action(row, index, rows));
|
10517
|
+
if (action) {
|
10518
|
+
cellContent = /* @__PURE__ */ React67.createElement(Button.Secondary, __spreadValues({
|
10519
|
+
dense: true
|
10520
|
+
}, action));
|
10521
|
+
}
|
10522
|
+
} else if (column.type === "custom") {
|
10523
|
+
cellContent = column.UNSAFE_render(row, index, rows);
|
10524
|
+
} else if (column.type === "item") {
|
10525
|
+
const item = column.item(row, index, rows);
|
10526
|
+
if (item) {
|
10527
|
+
cellContent = /* @__PURE__ */ React67.createElement(Item4, __spreadValues({}, item));
|
10528
|
+
}
|
10529
|
+
} else if (column.formatter) {
|
10530
|
+
cellContent = column.formatter(row[column.field], row, index, rows);
|
10531
|
+
} else {
|
10532
|
+
cellContent = row[column.field];
|
10533
|
+
}
|
10534
|
+
return column.tooltip ? /* @__PURE__ */ React67.createElement(Tooltip, __spreadValues({}, column.tooltip(row, index, rows)), cellContent) : cellContent;
|
10202
10535
|
};
|
10203
10536
|
DataTable.Skeleton = DataListSkeleton;
|
10204
10537
|
|
10205
10538
|
// src/molecules/Dialog/Dialog.tsx
|
10206
|
-
import
|
10539
|
+
import React69 from "react";
|
10207
10540
|
import { useDialog } from "@react-aria/dialog";
|
10208
10541
|
import { Overlay as Overlay2, useModalOverlay } from "@react-aria/overlays";
|
10209
10542
|
import { useId } from "@react-aria/utils";
|
@@ -10230,10 +10563,10 @@ var DIALOG_ICONS_AND_COLORS = {
|
|
10230
10563
|
};
|
10231
10564
|
|
10232
10565
|
// src/atoms/Modal/Modal.tsx
|
10233
|
-
import
|
10566
|
+
import React68 from "react";
|
10234
10567
|
var Modal = (_a) => {
|
10235
10568
|
var _b = _a, { children, className, open } = _b, rest = __objRest(_b, ["children", "className", "open"]);
|
10236
|
-
return open ? /* @__PURE__ */
|
10569
|
+
return open ? /* @__PURE__ */ React68.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
10237
10570
|
className: classNames(
|
10238
10571
|
tw("inset-0 overflow-y-auto z-modal flex justify-center items-center fixed py-7"),
|
10239
10572
|
className
|
@@ -10242,14 +10575,14 @@ var Modal = (_a) => {
|
|
10242
10575
|
};
|
10243
10576
|
Modal.BackDrop = (_a) => {
|
10244
10577
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
10245
|
-
return /* @__PURE__ */
|
10578
|
+
return /* @__PURE__ */ React68.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
10246
10579
|
className: classNames(tw("-z-10 fixed min-w-full min-h-full bg-primary-100 opacity-60"), className)
|
10247
10580
|
}));
|
10248
10581
|
};
|
10249
|
-
Modal.Dialog =
|
10582
|
+
Modal.Dialog = React68.forwardRef(
|
10250
10583
|
(_a, ref) => {
|
10251
10584
|
var _b = _a, { children, className, size = "sm" } = _b, rest = __objRest(_b, ["children", "className", "size"]);
|
10252
|
-
return /* @__PURE__ */
|
10585
|
+
return /* @__PURE__ */ React68.createElement("div", __spreadProps(__spreadValues({
|
10253
10586
|
ref,
|
10254
10587
|
"aria-modal": "true"
|
10255
10588
|
}, rest), {
|
@@ -10267,31 +10600,31 @@ Modal.Dialog = React65.forwardRef(
|
|
10267
10600
|
);
|
10268
10601
|
Modal.Header = (_a) => {
|
10269
10602
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
10270
|
-
return /* @__PURE__ */
|
10603
|
+
return /* @__PURE__ */ React68.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
10271
10604
|
className: classNames(tw("px-7 py-6 gap-3 flex items-center"), className)
|
10272
10605
|
}), children);
|
10273
10606
|
};
|
10274
10607
|
Modal.HeaderImage = (_a) => {
|
10275
10608
|
var _b = _a, { backgroundImage, className } = _b, rest = __objRest(_b, ["backgroundImage", "className"]);
|
10276
10609
|
const common = tw("h-[120px] min-h-[120px] w-full ");
|
10277
|
-
return backgroundImage ? /* @__PURE__ */
|
10610
|
+
return backgroundImage ? /* @__PURE__ */ React68.createElement("img", __spreadProps(__spreadValues({
|
10278
10611
|
"aria-hidden": true,
|
10279
10612
|
src: backgroundImage != null ? backgroundImage : void 0
|
10280
10613
|
}, rest), {
|
10281
10614
|
className: classNames(common, tw("object-cover"), className)
|
10282
|
-
})) : /* @__PURE__ */
|
10615
|
+
})) : /* @__PURE__ */ React68.createElement("div", {
|
10283
10616
|
className: classNames(common, tw("bg-grey-5"), className)
|
10284
10617
|
});
|
10285
10618
|
};
|
10286
10619
|
Modal.CloseButtonContainer = (_a) => {
|
10287
10620
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
10288
|
-
return /* @__PURE__ */
|
10621
|
+
return /* @__PURE__ */ React68.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
10289
10622
|
className: classNames(tw("absolute top-[20px] right-[28px]"), className)
|
10290
10623
|
}));
|
10291
10624
|
};
|
10292
10625
|
Modal.Title = (_a) => {
|
10293
10626
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
10294
|
-
return /* @__PURE__ */
|
10627
|
+
return /* @__PURE__ */ React68.createElement(Typography, __spreadValues({
|
10295
10628
|
htmlTag: "h2",
|
10296
10629
|
variant: "subheading",
|
10297
10630
|
color: "grey-90",
|
@@ -10300,52 +10633,52 @@ Modal.Title = (_a) => {
|
|
10300
10633
|
};
|
10301
10634
|
Modal.Subtitle = (_a) => {
|
10302
10635
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
10303
|
-
return /* @__PURE__ */
|
10636
|
+
return /* @__PURE__ */ React68.createElement(Typography, __spreadValues({
|
10304
10637
|
variant: "small",
|
10305
10638
|
color: "grey-60"
|
10306
10639
|
}, rest), children);
|
10307
10640
|
};
|
10308
10641
|
Modal.TitleContainer = (_a) => {
|
10309
10642
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
10310
|
-
return /* @__PURE__ */
|
10643
|
+
return /* @__PURE__ */ React68.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
10311
10644
|
className: classNames(tw("flex flex-col grow gap-2"), className)
|
10312
10645
|
}), children);
|
10313
10646
|
};
|
10314
10647
|
Modal.Body = (_a) => {
|
10315
10648
|
var _b = _a, { children, className, noFooter = false, maxHeight, style } = _b, rest = __objRest(_b, ["children", "className", "noFooter", "maxHeight", "style"]);
|
10316
|
-
return /* @__PURE__ */
|
10649
|
+
return /* @__PURE__ */ React68.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
10317
10650
|
className: classNames(tw("px-7 grow overflow-y-auto", { "pb-6": noFooter }), className),
|
10318
10651
|
style: __spreadValues({ maxHeight }, style)
|
10319
10652
|
}), children);
|
10320
10653
|
};
|
10321
10654
|
Modal.Footer = (_a) => {
|
10322
10655
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
10323
|
-
return /* @__PURE__ */
|
10656
|
+
return /* @__PURE__ */ React68.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
10324
10657
|
className: classNames(tw("px-7 py-6"), className)
|
10325
10658
|
}), children);
|
10326
10659
|
};
|
10327
10660
|
Modal.Actions = (_a) => {
|
10328
10661
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
10329
|
-
return /* @__PURE__ */
|
10662
|
+
return /* @__PURE__ */ React68.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
10330
10663
|
className: classNames(tw("flex gap-4 justify-end"), className)
|
10331
10664
|
}), children);
|
10332
10665
|
};
|
10333
10666
|
|
10334
10667
|
// src/molecules/Dialog/Dialog.tsx
|
10335
10668
|
var Dialog = (props) => {
|
10336
|
-
const ref =
|
10669
|
+
const ref = React69.useRef(null);
|
10337
10670
|
const state = useOverlayTriggerState2({ isOpen: props.open });
|
10338
10671
|
const { modalProps, underlayProps } = useModalOverlay({}, state, ref);
|
10339
10672
|
if (!state.isOpen) {
|
10340
10673
|
return null;
|
10341
10674
|
}
|
10342
|
-
return /* @__PURE__ */
|
10675
|
+
return /* @__PURE__ */ React69.createElement(Overlay2, null, /* @__PURE__ */ React69.createElement(Modal, {
|
10343
10676
|
className: "Aquarium-Dialog",
|
10344
10677
|
open: true
|
10345
|
-
}, /* @__PURE__ */
|
10678
|
+
}, /* @__PURE__ */ React69.createElement(Modal.BackDrop, __spreadValues({}, underlayProps)), /* @__PURE__ */ React69.createElement(Modal.Dialog, __spreadValues({
|
10346
10679
|
ref,
|
10347
10680
|
size: "sm"
|
10348
|
-
}, modalProps), /* @__PURE__ */
|
10681
|
+
}, modalProps), /* @__PURE__ */ React69.createElement(DialogWrapper, __spreadValues({}, props)))));
|
10349
10682
|
};
|
10350
10683
|
var DialogWrapper = ({
|
10351
10684
|
title,
|
@@ -10354,75 +10687,41 @@ var DialogWrapper = ({
|
|
10354
10687
|
primaryAction,
|
10355
10688
|
secondaryAction
|
10356
10689
|
}) => {
|
10357
|
-
const ref =
|
10690
|
+
const ref = React69.useRef(null);
|
10358
10691
|
const labelledBy = useId();
|
10359
10692
|
const describedBy = useId();
|
10360
10693
|
const { dialogProps } = useDialog(
|
10361
10694
|
{ "role": "alertdialog", "aria-labelledby": labelledBy, "aria-describedby": describedBy },
|
10362
10695
|
ref
|
10363
10696
|
);
|
10364
|
-
return /* @__PURE__ */
|
10697
|
+
return /* @__PURE__ */ React69.createElement("div", __spreadProps(__spreadValues({
|
10365
10698
|
ref
|
10366
10699
|
}, dialogProps), {
|
10367
10700
|
className: tw("outline-none")
|
10368
|
-
}), /* @__PURE__ */
|
10701
|
+
}), /* @__PURE__ */ React69.createElement(Modal.Header, {
|
10369
10702
|
className: tw("icon-stroke-2")
|
10370
|
-
}, /* @__PURE__ */
|
10703
|
+
}, /* @__PURE__ */ React69.createElement(Icon, {
|
10371
10704
|
icon: DIALOG_ICONS_AND_COLORS[type].icon,
|
10372
10705
|
color: DIALOG_ICONS_AND_COLORS[type].color,
|
10373
10706
|
fontSize: 20
|
10374
|
-
}), /* @__PURE__ */
|
10707
|
+
}), /* @__PURE__ */ React69.createElement(Modal.Title, {
|
10375
10708
|
id: labelledBy,
|
10376
10709
|
variant: "large",
|
10377
10710
|
color: DIALOG_ICONS_AND_COLORS[type].color
|
10378
|
-
}, title)), /* @__PURE__ */
|
10711
|
+
}, title)), /* @__PURE__ */ React69.createElement(Modal.Body, {
|
10379
10712
|
id: describedBy
|
10380
|
-
}, /* @__PURE__ */
|
10713
|
+
}, /* @__PURE__ */ React69.createElement(Typography2.Default, null, children)), /* @__PURE__ */ React69.createElement(Modal.Footer, null, /* @__PURE__ */ React69.createElement(Modal.Actions, null, secondaryAction && /* @__PURE__ */ React69.createElement(Button.Ghost, __spreadValues({
|
10381
10714
|
key: secondaryAction.text
|
10382
|
-
}, omit8(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */
|
10715
|
+
}, omit8(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */ React69.createElement(Button.Secondary, __spreadValues({
|
10383
10716
|
key: primaryAction.text
|
10384
10717
|
}, omit8(primaryAction, "text")), primaryAction.text))));
|
10385
10718
|
};
|
10386
10719
|
|
10387
|
-
// src/molecules/Divider/Divider.tsx
|
10388
|
-
import React67 from "react";
|
10389
|
-
var sizeClasses = {
|
10390
|
-
horizontal: {
|
10391
|
-
1: "h-1px",
|
10392
|
-
2: "h-1",
|
10393
|
-
4: "h-2",
|
10394
|
-
8: "h-3",
|
10395
|
-
16: "h-5",
|
10396
|
-
24: "h-6"
|
10397
|
-
},
|
10398
|
-
vertical: {
|
10399
|
-
1: "w-1px",
|
10400
|
-
2: "w-1",
|
10401
|
-
4: "w-2",
|
10402
|
-
8: "w-3",
|
10403
|
-
16: "w-5",
|
10404
|
-
24: "w-6"
|
10405
|
-
}
|
10406
|
-
};
|
10407
|
-
var Divider2 = (_a) => {
|
10408
|
-
var _b = _a, { direction = "horizontal", size = 1 } = _b, props = __objRest(_b, ["direction", "size"]);
|
10409
|
-
const sizeClass = sizeClasses[direction][size];
|
10410
|
-
return /* @__PURE__ */ React67.createElement("div", __spreadProps(__spreadValues({}, props), {
|
10411
|
-
className: classNames(
|
10412
|
-
"Aquarium-Divider",
|
10413
|
-
tw(`bg-grey-5 ${sizeClass}`, {
|
10414
|
-
"block w-full": direction === "horizontal",
|
10415
|
-
"inline-block h-full": direction === "vertical"
|
10416
|
-
})
|
10417
|
-
)
|
10418
|
-
}));
|
10419
|
-
};
|
10420
|
-
|
10421
10720
|
// src/molecules/Dropdown/Dropdown.tsx
|
10422
|
-
import
|
10721
|
+
import React72 from "react";
|
10423
10722
|
|
10424
10723
|
// src/molecules/Popover/Popover.tsx
|
10425
|
-
import
|
10724
|
+
import React71, { useRef as useRef8 } from "react";
|
10426
10725
|
import { PressResponder as PressResponder2, usePress as usePress2 } from "@react-aria/interactions";
|
10427
10726
|
import { useOverlayTrigger } from "@react-aria/overlays";
|
10428
10727
|
import { mergeProps as mergeProps3 } from "@react-aria/utils";
|
@@ -10430,12 +10729,12 @@ import { useOverlayTriggerState as useOverlayTriggerState3 } from "@react-statel
|
|
10430
10729
|
import classNames7 from "classnames";
|
10431
10730
|
|
10432
10731
|
// src/molecules/Popover/Dialog.tsx
|
10433
|
-
import
|
10732
|
+
import React70 from "react";
|
10434
10733
|
import { useDialog as useDialog2 } from "@react-aria/dialog";
|
10435
10734
|
var Dialog2 = ({ children }) => {
|
10436
|
-
const ref =
|
10735
|
+
const ref = React70.useRef(null);
|
10437
10736
|
const { dialogProps } = useDialog2({}, ref);
|
10438
|
-
return /* @__PURE__ */
|
10737
|
+
return /* @__PURE__ */ React70.createElement("div", __spreadProps(__spreadValues({
|
10439
10738
|
ref
|
10440
10739
|
}, dialogProps), {
|
10441
10740
|
className: tw("outline-none")
|
@@ -10443,10 +10742,10 @@ var Dialog2 = ({ children }) => {
|
|
10443
10742
|
};
|
10444
10743
|
|
10445
10744
|
// src/molecules/Popover/PopoverContext.tsx
|
10446
|
-
import { createContext as
|
10447
|
-
var PopoverContext =
|
10745
|
+
import { createContext as createContext3, useContext as useContext4 } from "react";
|
10746
|
+
var PopoverContext = createContext3(null);
|
10448
10747
|
var usePopoverContext = () => {
|
10449
|
-
const ctx =
|
10748
|
+
const ctx = useContext4(PopoverContext);
|
10450
10749
|
if (ctx === null) {
|
10451
10750
|
throw new Error("PopoverContext was used outside of provider.");
|
10452
10751
|
}
|
@@ -10469,21 +10768,21 @@ var Popover2 = (props) => {
|
|
10469
10768
|
const triggerRef = useRef8(null);
|
10470
10769
|
const state = useOverlayTriggerState3(props);
|
10471
10770
|
const { triggerProps, overlayProps } = useOverlayTrigger({ type: type != null ? type : "dialog" }, state, triggerRef);
|
10472
|
-
return /* @__PURE__ */
|
10771
|
+
return /* @__PURE__ */ React71.createElement(PopoverContext.Provider, {
|
10473
10772
|
value: {
|
10474
10773
|
state
|
10475
10774
|
}
|
10476
|
-
},
|
10775
|
+
}, React71.Children.map(props.children, (child) => {
|
10477
10776
|
if (isComponentType(child, Popover2.Trigger)) {
|
10478
|
-
return /* @__PURE__ */
|
10777
|
+
return /* @__PURE__ */ React71.createElement(PressResponder2, __spreadValues({
|
10479
10778
|
ref: triggerRef
|
10480
|
-
}, triggerProps), /* @__PURE__ */
|
10779
|
+
}, triggerProps), /* @__PURE__ */ React71.createElement(PopoverTriggerWrapper, {
|
10481
10780
|
"data-testid": props["data-testid"],
|
10482
10781
|
"aria-controls": id
|
10483
10782
|
}, child.props.children));
|
10484
10783
|
}
|
10485
10784
|
if (isComponentType(child, Popover2.Panel)) {
|
10486
|
-
return state.isOpen && /* @__PURE__ */
|
10785
|
+
return state.isOpen && /* @__PURE__ */ React71.createElement(PopoverOverlay, __spreadValues({
|
10487
10786
|
triggerRef: targetRef != null ? targetRef : triggerRef,
|
10488
10787
|
state,
|
10489
10788
|
placement,
|
@@ -10494,7 +10793,7 @@ var Popover2 = (props) => {
|
|
10494
10793
|
offset,
|
10495
10794
|
crossOffset,
|
10496
10795
|
shouldFlip
|
10497
|
-
}, overlayProps), containFocus ? /* @__PURE__ */
|
10796
|
+
}, overlayProps), containFocus ? /* @__PURE__ */ React71.createElement(Dialog2, null, child.props.children) : child.props.children);
|
10498
10797
|
}
|
10499
10798
|
throw new Error("Invalid children element type");
|
10500
10799
|
}));
|
@@ -10513,7 +10812,7 @@ var asPopoverButton = (Component, displayName) => {
|
|
10513
10812
|
state.close();
|
10514
10813
|
onClick == null ? void 0 : onClick(e);
|
10515
10814
|
};
|
10516
|
-
return /* @__PURE__ */
|
10815
|
+
return /* @__PURE__ */ React71.createElement(Component, __spreadProps(__spreadValues({}, props), {
|
10517
10816
|
onClick: handleClick
|
10518
10817
|
}));
|
10519
10818
|
};
|
@@ -10526,9 +10825,9 @@ var PopoverTriggerWrapper = (_a) => {
|
|
10526
10825
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
10527
10826
|
var _a2;
|
10528
10827
|
const ref = useRef8(null);
|
10529
|
-
const trigger =
|
10828
|
+
const trigger = React71.Children.only(children);
|
10530
10829
|
const { pressProps } = usePress2(__spreadProps(__spreadValues({}, rest), { ref }));
|
10531
|
-
return
|
10830
|
+
return React71.cloneElement(trigger, __spreadProps(__spreadValues({
|
10532
10831
|
"ref": ref
|
10533
10832
|
}, mergeProps3(pressProps, trigger.props)), {
|
10534
10833
|
"aria-controls": (_a2 = rest["aria-controls"]) != null ? _a2 : pressProps["aria-controls"]
|
@@ -10537,10 +10836,10 @@ var PopoverTriggerWrapper = (_a) => {
|
|
10537
10836
|
|
10538
10837
|
// src/molecules/Dropdown/Dropdown.tsx
|
10539
10838
|
var Dropdown = ({ children, content, placement = "bottom-left" }) => {
|
10540
|
-
return /* @__PURE__ */
|
10839
|
+
return /* @__PURE__ */ React72.createElement(Popover2, {
|
10541
10840
|
type: "menu",
|
10542
10841
|
placement
|
10543
|
-
}, /* @__PURE__ */
|
10842
|
+
}, /* @__PURE__ */ React72.createElement(Popover2.Trigger, null, children), /* @__PURE__ */ React72.createElement(Popover2.Panel, {
|
10544
10843
|
className: "Aquarium-Dropdown"
|
10545
10844
|
}, content));
|
10546
10845
|
};
|
@@ -10551,26 +10850,26 @@ var DropdownMenu3 = ({
|
|
10551
10850
|
triggerId,
|
10552
10851
|
setClose = () => void 0
|
10553
10852
|
}) => {
|
10554
|
-
const menuRef =
|
10555
|
-
|
10853
|
+
const menuRef = React72.useRef(null);
|
10854
|
+
React72.useEffect(() => {
|
10556
10855
|
const id = setTimeout(() => {
|
10557
10856
|
var _a, _b, _c;
|
10558
10857
|
return (_c = (_b = (_a = menuRef.current) == null ? void 0 : _a.children) == null ? void 0 : _b[0]) == null ? void 0 : _c.focus();
|
10559
10858
|
});
|
10560
10859
|
return () => clearTimeout(id);
|
10561
10860
|
}, [menuRef.current]);
|
10562
|
-
return /* @__PURE__ */
|
10861
|
+
return /* @__PURE__ */ React72.createElement("div", {
|
10563
10862
|
style: { minWidth: "250px" },
|
10564
10863
|
className: tw("py-3 bg-white")
|
10565
|
-
}, !!title && /* @__PURE__ */
|
10864
|
+
}, !!title && /* @__PURE__ */ React72.createElement("div", {
|
10566
10865
|
className: tw("px-4 py-4 text-left text-grey-100 typography-default-strong")
|
10567
|
-
}, title), /* @__PURE__ */
|
10866
|
+
}, title), /* @__PURE__ */ React72.createElement("ol", {
|
10568
10867
|
role: "menu",
|
10569
10868
|
ref: menuRef,
|
10570
10869
|
id: contentId,
|
10571
10870
|
"aria-labelledby": triggerId
|
10572
|
-
},
|
10573
|
-
return
|
10871
|
+
}, React72.Children.map(children, (child) => {
|
10872
|
+
return React72.cloneElement(child, { setClose });
|
10574
10873
|
})));
|
10575
10874
|
};
|
10576
10875
|
var DropdownItem = (_a) => {
|
@@ -10625,10 +10924,10 @@ var DropdownItem = (_a) => {
|
|
10625
10924
|
handleSelect();
|
10626
10925
|
}
|
10627
10926
|
};
|
10628
|
-
const itemContent = /* @__PURE__ */
|
10927
|
+
const itemContent = /* @__PURE__ */ React72.createElement("div", {
|
10629
10928
|
className: tw("py-3 px-4")
|
10630
10929
|
}, children);
|
10631
|
-
return /* @__PURE__ */
|
10930
|
+
return /* @__PURE__ */ React72.createElement("li", __spreadProps(__spreadValues({
|
10632
10931
|
role: "menuitem",
|
10633
10932
|
tabIndex: -1,
|
10634
10933
|
onClick: handleClick,
|
@@ -10639,11 +10938,11 @@ var DropdownItem = (_a) => {
|
|
10639
10938
|
"text-grey-10 cursor-not-allowed": disabled,
|
10640
10939
|
"text-primary-70 hover:text-primary-80": color === "danger" && !disabled
|
10641
10940
|
})
|
10642
|
-
}), tooltip ? /* @__PURE__ */
|
10941
|
+
}), tooltip ? /* @__PURE__ */ React72.createElement(Tooltip, {
|
10643
10942
|
content: tooltip,
|
10644
10943
|
placement: tooltipPlacement,
|
10645
10944
|
inline: false
|
10646
|
-
}, /* @__PURE__ */
|
10945
|
+
}, /* @__PURE__ */ React72.createElement("div", {
|
10647
10946
|
tabIndex: 0,
|
10648
10947
|
className: tw("grow")
|
10649
10948
|
}, itemContent)) : itemContent);
|
@@ -10652,16 +10951,16 @@ Dropdown.Menu = DropdownMenu3;
|
|
10652
10951
|
Dropdown.Item = DropdownItem;
|
10653
10952
|
|
10654
10953
|
// src/molecules/EmptyState/EmptyState.tsx
|
10655
|
-
import
|
10954
|
+
import React74 from "react";
|
10656
10955
|
|
10657
10956
|
// src/utils/actions.tsx
|
10658
|
-
import
|
10957
|
+
import React73 from "react";
|
10659
10958
|
import omit9 from "lodash/omit";
|
10660
10959
|
var renderAction = (kind = "primary", action) => {
|
10661
|
-
return isLink(action) ? /* @__PURE__ */
|
10960
|
+
return isLink(action) ? /* @__PURE__ */ React73.createElement(Button.ExternalLink, __spreadValues({
|
10662
10961
|
key: action.text,
|
10663
10962
|
kind
|
10664
|
-
}, omit9(action, "text")), action.text) : /* @__PURE__ */
|
10963
|
+
}, omit9(action, "text")), action.text) : /* @__PURE__ */ React73.createElement(Button, __spreadValues({
|
10665
10964
|
key: action.text,
|
10666
10965
|
kind
|
10667
10966
|
}, omit9(action, "text")), action.text);
|
@@ -10724,7 +11023,7 @@ var EmptyState = ({
|
|
10724
11023
|
fullHeight = isVerticalLayout(layout) ? true : false
|
10725
11024
|
}) => {
|
10726
11025
|
const template = layoutStyle(layout);
|
10727
|
-
return /* @__PURE__ */
|
11026
|
+
return /* @__PURE__ */ React74.createElement(Box, {
|
10728
11027
|
className: classNames(
|
10729
11028
|
"Aquarium-EmptyState",
|
10730
11029
|
tw("rounded p-[56px]", {
|
@@ -10737,39 +11036,39 @@ var EmptyState = ({
|
|
10737
11036
|
),
|
10738
11037
|
backgroundColor: "transparent",
|
10739
11038
|
borderColor: "grey-10"
|
10740
|
-
}, /* @__PURE__ */
|
11039
|
+
}, /* @__PURE__ */ React74.createElement(Box.Flex, {
|
10741
11040
|
style: { gap: "56px" },
|
10742
11041
|
flexDirection: template.layout,
|
10743
11042
|
justifyContent: template.justifyContent,
|
10744
11043
|
alignItems: template.layout === "row" ? "center" : template.alignItems,
|
10745
11044
|
height: fullHeight ? "full" : void 0
|
10746
|
-
}, image && /* @__PURE__ */
|
11045
|
+
}, image && /* @__PURE__ */ React74.createElement("img", {
|
10747
11046
|
src: image,
|
10748
11047
|
alt: imageAlt,
|
10749
11048
|
style: { width: imageWidth ? `${imageWidth}px` : void 0, height: "auto" }
|
10750
|
-
}), /* @__PURE__ */
|
11049
|
+
}), /* @__PURE__ */ React74.createElement(Box.Flex, {
|
10751
11050
|
flexDirection: "column",
|
10752
11051
|
justifyContent: template.justifyContent,
|
10753
11052
|
alignItems: template.alignItems
|
10754
|
-
}, /* @__PURE__ */
|
11053
|
+
}, /* @__PURE__ */ React74.createElement(Typography2.Heading, {
|
10755
11054
|
htmlTag: "h2"
|
10756
|
-
}, title), (description || children) && /* @__PURE__ */
|
11055
|
+
}, title), (description || children) && /* @__PURE__ */ React74.createElement(Box, {
|
10757
11056
|
marginTop: "5"
|
10758
|
-
}, /* @__PURE__ */
|
11057
|
+
}, /* @__PURE__ */ React74.createElement(Typography2.Default, null, children || description)), (secondaryAction || primaryAction) && /* @__PURE__ */ React74.createElement(Box.Flex, {
|
10759
11058
|
marginTop: "7",
|
10760
11059
|
gap: "4",
|
10761
11060
|
justifyContent: "center",
|
10762
11061
|
alignItems: "center",
|
10763
11062
|
wrap: "wrap"
|
10764
|
-
}, primaryAction && renderAction("primary", primaryAction), secondaryAction && renderAction("secondary", secondaryAction)), footer && /* @__PURE__ */
|
11063
|
+
}, primaryAction && renderAction("primary", primaryAction), secondaryAction && renderAction("secondary", secondaryAction)), footer && /* @__PURE__ */ React74.createElement(Box, {
|
10765
11064
|
marginTop: "5"
|
10766
|
-
}, /* @__PURE__ */
|
11065
|
+
}, /* @__PURE__ */ React74.createElement(Typography2.Small, {
|
10767
11066
|
color: "grey-60"
|
10768
11067
|
}, footer)))));
|
10769
11068
|
};
|
10770
11069
|
|
10771
11070
|
// src/molecules/Flexbox/FlexboxItem.tsx
|
10772
|
-
import
|
11071
|
+
import React75 from "react";
|
10773
11072
|
var FlexboxItem = Tailwindify(
|
10774
11073
|
({ htmlTag = "div", className, style, children, display, flex, grow, shrink, order, alignSelf }) => {
|
10775
11074
|
const hookStyle = useStyle({
|
@@ -10781,7 +11080,7 @@ var FlexboxItem = Tailwindify(
|
|
10781
11080
|
alignSelf
|
10782
11081
|
});
|
10783
11082
|
const HtmlElement = htmlTag;
|
10784
|
-
return /* @__PURE__ */
|
11083
|
+
return /* @__PURE__ */ React75.createElement(HtmlElement, {
|
10785
11084
|
style: __spreadValues(__spreadValues({}, hookStyle), style),
|
10786
11085
|
className
|
10787
11086
|
}, children);
|
@@ -10789,7 +11088,7 @@ var FlexboxItem = Tailwindify(
|
|
10789
11088
|
);
|
10790
11089
|
|
10791
11090
|
// src/molecules/Grid/GridItem.tsx
|
10792
|
-
import
|
11091
|
+
import React76 from "react";
|
10793
11092
|
var GridItem2 = Tailwindify(
|
10794
11093
|
({
|
10795
11094
|
htmlTag = "div",
|
@@ -10820,7 +11119,7 @@ var GridItem2 = Tailwindify(
|
|
10820
11119
|
gridRowEnd: rowEnd
|
10821
11120
|
});
|
10822
11121
|
const HtmlElement = htmlTag;
|
10823
|
-
return /* @__PURE__ */
|
11122
|
+
return /* @__PURE__ */ React76.createElement(HtmlElement, {
|
10824
11123
|
style: __spreadValues(__spreadValues({}, hookStyle), style),
|
10825
11124
|
className
|
10826
11125
|
}, children);
|
@@ -10828,7 +11127,7 @@ var GridItem2 = Tailwindify(
|
|
10828
11127
|
);
|
10829
11128
|
|
10830
11129
|
// src/molecules/LineClamp/LineClamp.tsx
|
10831
|
-
import
|
11130
|
+
import React77 from "react";
|
10832
11131
|
var LineClamp2 = ({
|
10833
11132
|
lines,
|
10834
11133
|
children,
|
@@ -10837,10 +11136,10 @@ var LineClamp2 = ({
|
|
10837
11136
|
collapseLabel,
|
10838
11137
|
onClampedChange
|
10839
11138
|
}) => {
|
10840
|
-
const ref =
|
10841
|
-
const [clamped, setClamped] =
|
10842
|
-
const [isClampingEnabled, setClampingEnabled] =
|
10843
|
-
|
11139
|
+
const ref = React77.useRef(null);
|
11140
|
+
const [clamped, setClamped] = React77.useState(true);
|
11141
|
+
const [isClampingEnabled, setClampingEnabled] = React77.useState(false);
|
11142
|
+
React77.useEffect(() => {
|
10844
11143
|
var _a, _b;
|
10845
11144
|
const el = ref.current;
|
10846
11145
|
setClampingEnabled(((_a = el == null ? void 0 : el.scrollHeight) != null ? _a : 0) > ((_b = el == null ? void 0 : el.clientHeight) != null ? _b : 0));
|
@@ -10849,28 +11148,28 @@ var LineClamp2 = ({
|
|
10849
11148
|
setClamped(!clamped);
|
10850
11149
|
onClampedChange == null ? void 0 : onClampedChange(!clamped);
|
10851
11150
|
};
|
10852
|
-
return /* @__PURE__ */
|
11151
|
+
return /* @__PURE__ */ React77.createElement("div", {
|
10853
11152
|
className: "Aquarium-LineClamp"
|
10854
|
-
}, /* @__PURE__ */
|
11153
|
+
}, /* @__PURE__ */ React77.createElement(LineClamp, {
|
10855
11154
|
ref,
|
10856
11155
|
lines,
|
10857
11156
|
clamped,
|
10858
11157
|
wordBreak
|
10859
|
-
}, children), expandLabel && isClampingEnabled && /* @__PURE__ */
|
11158
|
+
}, children), expandLabel && isClampingEnabled && /* @__PURE__ */ React77.createElement(Button.Ghost, {
|
10860
11159
|
dense: true,
|
10861
11160
|
onClick: handleClampedChange
|
10862
11161
|
}, clamped ? expandLabel : collapseLabel));
|
10863
11162
|
};
|
10864
11163
|
|
10865
11164
|
// src/molecules/Link/Link.tsx
|
10866
|
-
import
|
11165
|
+
import React79 from "react";
|
10867
11166
|
import classNames8 from "classnames";
|
10868
11167
|
|
10869
11168
|
// src/atoms/Link/Link.tsx
|
10870
|
-
import
|
11169
|
+
import React78 from "react";
|
10871
11170
|
var Link = (_a) => {
|
10872
11171
|
var _b = _a, { children, className } = _b, props = __objRest(_b, ["children", "className"]);
|
10873
|
-
return /* @__PURE__ */
|
11172
|
+
return /* @__PURE__ */ React78.createElement("a", __spreadValues({
|
10874
11173
|
className: classNames(className, linkStyle)
|
10875
11174
|
}, props), children);
|
10876
11175
|
};
|
@@ -10878,23 +11177,23 @@ var Link = (_a) => {
|
|
10878
11177
|
// src/molecules/Link/Link.tsx
|
10879
11178
|
var Link2 = (_a) => {
|
10880
11179
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
10881
|
-
return /* @__PURE__ */
|
11180
|
+
return /* @__PURE__ */ React79.createElement(Link, __spreadValues({
|
10882
11181
|
className: classNames8("Aquarium-Link", className)
|
10883
11182
|
}, props));
|
10884
11183
|
};
|
10885
11184
|
|
10886
11185
|
// src/molecules/ListItem/ListItem.tsx
|
10887
|
-
import
|
11186
|
+
import React80 from "react";
|
10888
11187
|
var ListItem = ({ name, icon, active = false }) => {
|
10889
|
-
return /* @__PURE__ */
|
11188
|
+
return /* @__PURE__ */ React80.createElement(Box.Flex, {
|
10890
11189
|
className: "Aquarium-ListItem",
|
10891
11190
|
alignItems: "center"
|
10892
|
-
}, /* @__PURE__ */
|
11191
|
+
}, /* @__PURE__ */ React80.createElement(Typography2, {
|
10893
11192
|
variant: active ? "small-strong" : "small",
|
10894
11193
|
color: "grey-70",
|
10895
11194
|
htmlTag: "span",
|
10896
11195
|
className: `px-4 py-2 rounded-full ${active ? "bg-grey-5" : "hover:bg-grey-0"}`
|
10897
|
-
}, /* @__PURE__ */
|
11196
|
+
}, /* @__PURE__ */ React80.createElement("img", {
|
10898
11197
|
src: icon,
|
10899
11198
|
alt: name,
|
10900
11199
|
className: "inline mr-4",
|
@@ -10904,7 +11203,7 @@ var ListItem = ({ name, icon, active = false }) => {
|
|
10904
11203
|
};
|
10905
11204
|
|
10906
11205
|
// src/molecules/Modal/Modal.tsx
|
10907
|
-
import
|
11206
|
+
import React82 from "react";
|
10908
11207
|
import { useDialog as useDialog3 } from "@react-aria/dialog";
|
10909
11208
|
import { Overlay as Overlay3, useModalOverlay as useModalOverlay2 } from "@react-aria/overlays";
|
10910
11209
|
import { useId as useId2 } from "@react-aria/utils";
|
@@ -10913,18 +11212,18 @@ import castArray from "lodash/castArray";
|
|
10913
11212
|
import omit10 from "lodash/omit";
|
10914
11213
|
|
10915
11214
|
// src/molecules/Tabs/Tabs.tsx
|
10916
|
-
import
|
11215
|
+
import React81, { useEffect as useEffect8, useLayoutEffect as useLayoutEffect2, useRef as useRef9, useState as useState10 } from "react";
|
10917
11216
|
import isNumber5 from "lodash/isNumber";
|
10918
11217
|
import kebabCase from "lodash/kebabCase";
|
10919
11218
|
var import_chevronLeft4 = __toESM(require_chevronLeft());
|
10920
11219
|
var import_chevronRight4 = __toESM(require_chevronRight());
|
10921
11220
|
var import_warningSign4 = __toESM(require_warningSign());
|
10922
11221
|
var isTabComponent = (c) => {
|
10923
|
-
return
|
11222
|
+
return React81.isValidElement(c) && (c.type === Tab || c.type === ModalTab);
|
10924
11223
|
};
|
10925
|
-
var Tab =
|
11224
|
+
var Tab = React81.forwardRef(
|
10926
11225
|
({ className, id, title, children }, ref) => {
|
10927
|
-
return /* @__PURE__ */
|
11226
|
+
return /* @__PURE__ */ React81.createElement("div", {
|
10928
11227
|
ref,
|
10929
11228
|
id: `${id != null ? id : kebabCase(title)}-panel`,
|
10930
11229
|
className,
|
@@ -10936,14 +11235,14 @@ var Tab = React79.forwardRef(
|
|
10936
11235
|
);
|
10937
11236
|
var TabContainer = (_a) => {
|
10938
11237
|
var _b = _a, { className, children } = _b, rest = __objRest(_b, ["className", "children"]);
|
10939
|
-
return /* @__PURE__ */
|
11238
|
+
return /* @__PURE__ */ React81.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
10940
11239
|
className: classNames("py-6 z-0", className)
|
10941
11240
|
}), children);
|
10942
11241
|
};
|
10943
11242
|
var ModalTab = Tab;
|
10944
11243
|
var ModalTabContainer = TabContainer;
|
10945
11244
|
var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
10946
|
-
const Tab2 =
|
11245
|
+
const Tab2 = React81.forwardRef(
|
10947
11246
|
(_a, ref) => {
|
10948
11247
|
var _b = _a, {
|
10949
11248
|
id,
|
@@ -10975,17 +11274,17 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
10975
11274
|
const _id = id != null ? id : kebabCase(title);
|
10976
11275
|
let statusIcon = void 0;
|
10977
11276
|
if (status === "warning") {
|
10978
|
-
statusIcon = /* @__PURE__ */
|
11277
|
+
statusIcon = /* @__PURE__ */ React81.createElement(InlineIcon, {
|
10979
11278
|
icon: import_warningSign4.default,
|
10980
11279
|
color: selected ? void 0 : "warning-80"
|
10981
11280
|
});
|
10982
11281
|
} else if (status === "error") {
|
10983
|
-
statusIcon = /* @__PURE__ */
|
11282
|
+
statusIcon = /* @__PURE__ */ React81.createElement(InlineIcon, {
|
10984
11283
|
icon: import_warningSign4.default,
|
10985
11284
|
color: selected ? void 0 : "error-50"
|
10986
11285
|
});
|
10987
11286
|
}
|
10988
|
-
const tab = /* @__PURE__ */
|
11287
|
+
const tab = /* @__PURE__ */ React81.createElement(Component, __spreadValues({
|
10989
11288
|
ref,
|
10990
11289
|
id: `${_id}-tab`,
|
10991
11290
|
onClick: () => !disabled && onSelected(value != null ? value : index),
|
@@ -11002,29 +11301,29 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
11002
11301
|
"aria-selected": selected,
|
11003
11302
|
"aria-controls": `${_id}-panel`,
|
11004
11303
|
tabIndex: disabled ? void 0 : 0
|
11005
|
-
}, rest), /* @__PURE__ */
|
11304
|
+
}, rest), /* @__PURE__ */ React81.createElement(Typography2, {
|
11006
11305
|
htmlTag: "div",
|
11007
11306
|
variant: "small",
|
11008
11307
|
color: selected ? "primary-80" : disabled ? "grey-20" : "current",
|
11009
11308
|
className: tw("inline-flex items-center gap-3")
|
11010
|
-
}, showNotification ? /* @__PURE__ */
|
11309
|
+
}, showNotification ? /* @__PURE__ */ React81.createElement(Badge.Notification, {
|
11011
11310
|
right: "-4px",
|
11012
11311
|
top: "3px"
|
11013
|
-
}, /* @__PURE__ */
|
11312
|
+
}, /* @__PURE__ */ React81.createElement("span", {
|
11014
11313
|
className: tw("whitespace-nowrap")
|
11015
|
-
}, title)) : /* @__PURE__ */
|
11314
|
+
}, title)) : /* @__PURE__ */ React81.createElement("span", {
|
11016
11315
|
className: tw("whitespace-nowrap")
|
11017
|
-
}, title), isNumber5(badge) && /* @__PURE__ */
|
11316
|
+
}, title), isNumber5(badge) && /* @__PURE__ */ React81.createElement(Typography2, {
|
11018
11317
|
htmlTag: "span",
|
11019
11318
|
variant: "small",
|
11020
11319
|
color: selected ? "primary-80" : "grey-5",
|
11021
11320
|
className: "leading-none"
|
11022
|
-
}, /* @__PURE__ */
|
11321
|
+
}, /* @__PURE__ */ React81.createElement(TabBadge, {
|
11023
11322
|
kind: "filled",
|
11024
11323
|
value: badge,
|
11025
11324
|
textClassname: classNames({ "text-white": selected, "text-grey-50": !selected })
|
11026
11325
|
})), statusIcon));
|
11027
|
-
return tooltip ? /* @__PURE__ */
|
11326
|
+
return tooltip ? /* @__PURE__ */ React81.createElement(Tooltip, {
|
11028
11327
|
content: tooltip
|
11029
11328
|
}, tab) : tab;
|
11030
11329
|
}
|
@@ -11038,12 +11337,12 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
11038
11337
|
const Tabs2 = (props) => {
|
11039
11338
|
var _a, _b;
|
11040
11339
|
const { className, value, defaultValue, onChange, children } = props;
|
11041
|
-
const childArr =
|
11340
|
+
const childArr = React81.Children.toArray(children);
|
11042
11341
|
const firstTab = childArr[0];
|
11043
11342
|
const firstTabValue = isTabComponent(firstTab) ? firstTab.props.value : -1;
|
11044
|
-
const [selected, setSelected] =
|
11045
|
-
const [leftCaret, showLeftCaret] =
|
11046
|
-
const [rightCaret, showRightCaret] =
|
11343
|
+
const [selected, setSelected] = useState10((_b = (_a = value != null ? value : defaultValue) != null ? _a : firstTabValue) != null ? _b : 0);
|
11344
|
+
const [leftCaret, showLeftCaret] = useState10(false);
|
11345
|
+
const [rightCaret, showRightCaret] = useState10(false);
|
11047
11346
|
const parentRef = useRef9(null);
|
11048
11347
|
const containerRef = useRef9(null);
|
11049
11348
|
const tabsRef = useRef9(null);
|
@@ -11051,7 +11350,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
11051
11350
|
var _a2, _b2;
|
11052
11351
|
const container = containerRef.current;
|
11053
11352
|
const tabs = tabsRef.current;
|
11054
|
-
const values =
|
11353
|
+
const values = React81.Children.map(
|
11055
11354
|
children,
|
11056
11355
|
(tab, i) => {
|
11057
11356
|
var _a3;
|
@@ -11092,7 +11391,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
11092
11391
|
updateCarets();
|
11093
11392
|
setSelected(value);
|
11094
11393
|
revealSelectedTab({ smooth: value !== selected });
|
11095
|
-
}, [value,
|
11394
|
+
}, [value, React81.Children.count(children)]);
|
11096
11395
|
useLayoutEffect2(() => {
|
11097
11396
|
var _a2;
|
11098
11397
|
updateCarets();
|
@@ -11156,27 +11455,27 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
11156
11455
|
const handleSelected = (key) => {
|
11157
11456
|
(onChange != null ? onChange : setSelected)(key);
|
11158
11457
|
};
|
11159
|
-
|
11458
|
+
React81.Children.forEach(children, (c) => {
|
11160
11459
|
if (c && !isTabComponent(c)) {
|
11161
11460
|
throw new Error("<Tabs> can only have <Tabs.Tab> components as children");
|
11162
11461
|
}
|
11163
11462
|
});
|
11164
|
-
return /* @__PURE__ */
|
11463
|
+
return /* @__PURE__ */ React81.createElement("div", {
|
11165
11464
|
ref: parentRef,
|
11166
11465
|
className: classNames("Aquarium-Tabs", tw("h-full"), className)
|
11167
|
-
}, /* @__PURE__ */
|
11466
|
+
}, /* @__PURE__ */ React81.createElement("div", {
|
11168
11467
|
className: tw("relative flex items-center h-full border-b-2 border-grey-10")
|
11169
|
-
}, /* @__PURE__ */
|
11468
|
+
}, /* @__PURE__ */ React81.createElement("div", {
|
11170
11469
|
ref: containerRef,
|
11171
11470
|
className: tw("overflow-y-auto scrollbar-hide h-full mb-[-2px]")
|
11172
|
-
}, /* @__PURE__ */
|
11471
|
+
}, /* @__PURE__ */ React81.createElement("div", {
|
11173
11472
|
ref: tabsRef,
|
11174
11473
|
role: "tablist",
|
11175
11474
|
"aria-label": "tabs",
|
11176
11475
|
className: tw("inline-flex items-center cursor-pointer font-normal h-full")
|
11177
|
-
},
|
11476
|
+
}, React81.Children.map(
|
11178
11477
|
children,
|
11179
|
-
(tab, index) => tab ? /* @__PURE__ */
|
11478
|
+
(tab, index) => tab ? /* @__PURE__ */ React81.createElement(TabItemComponent, __spreadProps(__spreadValues({
|
11180
11479
|
key: tab.props.value
|
11181
11480
|
}, tab.props), {
|
11182
11481
|
index,
|
@@ -11184,20 +11483,20 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
11184
11483
|
onKeyDown: handleKeyDown,
|
11185
11484
|
onSelected: handleSelected
|
11186
11485
|
})) : void 0
|
11187
|
-
))), leftCaret && /* @__PURE__ */
|
11486
|
+
))), leftCaret && /* @__PURE__ */ React81.createElement("div", {
|
11188
11487
|
className: tw("absolute left-0 bg-gradient-to-r from-white via-white z-20 py-3 pr-4")
|
11189
|
-
}, /* @__PURE__ */
|
11488
|
+
}, /* @__PURE__ */ React81.createElement("div", {
|
11190
11489
|
onClick: () => handleScrollToNext("left"),
|
11191
11490
|
className: tw("hover:bg-grey-0 p-2 leading-none cursor-pointer")
|
11192
|
-
}, /* @__PURE__ */
|
11491
|
+
}, /* @__PURE__ */ React81.createElement(InlineIcon, {
|
11193
11492
|
icon: import_chevronLeft4.default
|
11194
|
-
}))), rightCaret && /* @__PURE__ */
|
11493
|
+
}))), rightCaret && /* @__PURE__ */ React81.createElement("div", {
|
11195
11494
|
onClick: () => handleScrollToNext("right"),
|
11196
11495
|
className: tw("absolute right-0 bg-gradient-to-l from-white via-white z-20 py-3 pl-4")
|
11197
|
-
}, /* @__PURE__ */
|
11496
|
+
}, /* @__PURE__ */ React81.createElement("div", {
|
11198
11497
|
onClick: () => handleScrollToNext("right"),
|
11199
11498
|
className: tw("hover:bg-grey-0 p-2 leading-none cursor-pointer")
|
11200
|
-
}, /* @__PURE__ */
|
11499
|
+
}, /* @__PURE__ */ React81.createElement(InlineIcon, {
|
11201
11500
|
icon: import_chevronRight4.default
|
11202
11501
|
})))), renderChildren(children, selected, props));
|
11203
11502
|
};
|
@@ -11205,7 +11504,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
11205
11504
|
Tabs2.Tab = TabComponent;
|
11206
11505
|
return Tabs2;
|
11207
11506
|
};
|
11208
|
-
var Tabs = createTabsComponent(Tab, TabItem, "Tabs", (children, selected) => /* @__PURE__ */
|
11507
|
+
var Tabs = createTabsComponent(Tab, TabItem, "Tabs", (children, selected) => /* @__PURE__ */ React81.createElement(TabContainer, null, children.find(
|
11209
11508
|
(node, index) => (node == null ? void 0 : node.props.value) === selected || index === selected
|
11210
11509
|
)));
|
11211
11510
|
|
@@ -11214,7 +11513,7 @@ var import_cross6 = __toESM(require_cross());
|
|
11214
11513
|
var Modal2 = (_a) => {
|
11215
11514
|
var _b = _a, { closeOnEsc = true } = _b, props = __objRest(_b, ["closeOnEsc"]);
|
11216
11515
|
const { open, onClose, size, portalContainer } = props;
|
11217
|
-
const ref =
|
11516
|
+
const ref = React82.useRef(null);
|
11218
11517
|
const state = useOverlayTriggerState4({ isOpen: open, onOpenChange: (isOpen) => !isOpen && onClose() });
|
11219
11518
|
const { modalProps, underlayProps } = useModalOverlay2(
|
11220
11519
|
{ isDismissable: false, isKeyboardDismissDisabled: !closeOnEsc },
|
@@ -11224,17 +11523,17 @@ var Modal2 = (_a) => {
|
|
11224
11523
|
if (!state.isOpen) {
|
11225
11524
|
return null;
|
11226
11525
|
}
|
11227
|
-
return /* @__PURE__ */
|
11526
|
+
return /* @__PURE__ */ React82.createElement(Overlay3, {
|
11228
11527
|
portalContainer
|
11229
|
-
}, /* @__PURE__ */
|
11528
|
+
}, /* @__PURE__ */ React82.createElement(Modal, {
|
11230
11529
|
className: "Aquarium-Modal",
|
11231
11530
|
open: true
|
11232
|
-
}, /* @__PURE__ */
|
11531
|
+
}, /* @__PURE__ */ React82.createElement(Modal.BackDrop, __spreadValues({}, underlayProps)), /* @__PURE__ */ React82.createElement(ModalWrapper, __spreadValues(__spreadValues({
|
11233
11532
|
ref,
|
11234
11533
|
size
|
11235
11534
|
}, props), modalProps))));
|
11236
11535
|
};
|
11237
|
-
var ModalWrapper =
|
11536
|
+
var ModalWrapper = React82.forwardRef(
|
11238
11537
|
(_a, ref) => {
|
11239
11538
|
var _b = _a, { title, subtitle, headerImage, primaryAction, secondaryActions, children, onClose } = _b, props = __objRest(_b, ["title", "subtitle", "headerImage", "primaryAction", "secondaryActions", "children", "onClose"]);
|
11240
11539
|
const labelledBy = useId2();
|
@@ -11243,30 +11542,30 @@ var ModalWrapper = React80.forwardRef(
|
|
11243
11542
|
{ "role": "dialog", "aria-labelledby": labelledBy, "aria-describedby": describedBy },
|
11244
11543
|
ref
|
11245
11544
|
);
|
11246
|
-
return /* @__PURE__ */
|
11545
|
+
return /* @__PURE__ */ React82.createElement(Modal.Dialog, __spreadProps(__spreadValues(__spreadValues({
|
11247
11546
|
ref
|
11248
11547
|
}, props), dialogProps), {
|
11249
11548
|
tabIndex: -1
|
11250
|
-
}), /* @__PURE__ */
|
11549
|
+
}), /* @__PURE__ */ React82.createElement(Modal.CloseButtonContainer, null, /* @__PURE__ */ React82.createElement(IconButton, {
|
11251
11550
|
"aria-label": "Close",
|
11252
11551
|
icon: import_cross6.default,
|
11253
11552
|
onClick: onClose
|
11254
|
-
})), headerImage !== void 0 && /* @__PURE__ */
|
11553
|
+
})), headerImage !== void 0 && /* @__PURE__ */ React82.createElement(Modal.HeaderImage, {
|
11255
11554
|
backgroundImage: headerImage
|
11256
|
-
}), /* @__PURE__ */
|
11555
|
+
}), /* @__PURE__ */ React82.createElement(Modal.Header, {
|
11257
11556
|
className: tw({ "pb-3": isComponentType(children, ModalTabs) })
|
11258
|
-
}, /* @__PURE__ */
|
11557
|
+
}, /* @__PURE__ */ React82.createElement(Modal.TitleContainer, null, /* @__PURE__ */ React82.createElement(Modal.Title, {
|
11259
11558
|
id: labelledBy
|
11260
|
-
}, title), subtitle && /* @__PURE__ */
|
11559
|
+
}, title), subtitle && /* @__PURE__ */ React82.createElement(Modal.Subtitle, null, subtitle))), isComponentType(children, ModalTabs) ? React82.cloneElement(children, { className: tw("[&>div:first-child]:px-5 grow") }) : /* @__PURE__ */ React82.createElement(Modal.Body, {
|
11261
11560
|
id: describedBy,
|
11262
11561
|
tabIndex: 0,
|
11263
11562
|
noFooter: !(secondaryActions || primaryAction)
|
11264
|
-
}, children), (secondaryActions || primaryAction) && /* @__PURE__ */
|
11563
|
+
}, children), (secondaryActions || primaryAction) && /* @__PURE__ */ React82.createElement(Modal.Footer, null, /* @__PURE__ */ React82.createElement(Modal.Actions, null, secondaryActions && castArray(secondaryActions).filter(Boolean).map((_a2) => {
|
11265
11564
|
var _b2 = _a2, { text } = _b2, action = __objRest(_b2, ["text"]);
|
11266
|
-
return /* @__PURE__ */
|
11565
|
+
return /* @__PURE__ */ React82.createElement(Button.Secondary, __spreadValues({
|
11267
11566
|
key: text
|
11268
11567
|
}, action), text);
|
11269
|
-
}), primaryAction && /* @__PURE__ */
|
11568
|
+
}), primaryAction && /* @__PURE__ */ React82.createElement(Button.Primary, __spreadValues({
|
11270
11569
|
key: primaryAction.text
|
11271
11570
|
}, omit10(primaryAction, "text")), primaryAction.text))));
|
11272
11571
|
}
|
@@ -11275,24 +11574,24 @@ var ModalTabs = createTabsComponent(
|
|
11275
11574
|
ModalTab,
|
11276
11575
|
TabItem,
|
11277
11576
|
"ModalTabs",
|
11278
|
-
(children, selected, props) => /* @__PURE__ */
|
11577
|
+
(children, selected, props) => /* @__PURE__ */ React82.createElement(Modal.Body, {
|
11279
11578
|
maxHeight: props.maxHeight
|
11280
|
-
}, /* @__PURE__ */
|
11579
|
+
}, /* @__PURE__ */ React82.createElement(ModalTabContainer, null, children.find(
|
11281
11580
|
(node, index) => (node == null ? void 0 : node.props.value) === selected || index === selected
|
11282
11581
|
)))
|
11283
11582
|
);
|
11284
11583
|
|
11285
11584
|
// src/molecules/MultiInput/MultiInput.tsx
|
11286
|
-
import
|
11585
|
+
import React84, { useEffect as useEffect9, useRef as useRef10, useState as useState11 } from "react";
|
11287
11586
|
import castArray2 from "lodash/castArray";
|
11288
11587
|
import identity from "lodash/identity";
|
11289
11588
|
import omit11 from "lodash/omit";
|
11290
11589
|
import uniqueId5 from "lodash/uniqueId";
|
11291
11590
|
|
11292
11591
|
// src/molecules/MultiInput/InputChip.tsx
|
11293
|
-
import
|
11592
|
+
import React83 from "react";
|
11294
11593
|
var import_smallCross2 = __toESM(require_smallCross());
|
11295
|
-
var InputChip =
|
11594
|
+
var InputChip = React83.forwardRef(
|
11296
11595
|
(_a, ref) => {
|
11297
11596
|
var _b = _a, { invalid = false, disabled, readOnly, className, onClick: _onClick, children } = _b, props = __objRest(_b, ["invalid", "disabled", "readOnly", "className", "onClick", "children"]);
|
11298
11597
|
const onClick = (e) => {
|
@@ -11300,18 +11599,18 @@ var InputChip = React81.forwardRef(
|
|
11300
11599
|
_onClick == null ? void 0 : _onClick(e);
|
11301
11600
|
}
|
11302
11601
|
};
|
11303
|
-
return /* @__PURE__ */
|
11602
|
+
return /* @__PURE__ */ React83.createElement("div", {
|
11304
11603
|
className: classNames(className, "inline-flex align-middle mx-1 items-stretch rounded-sm break-all", {
|
11305
11604
|
"bg-error-0 ": invalid,
|
11306
11605
|
"bg-grey-0 ": !invalid && !disabled,
|
11307
11606
|
"bg-grey-5": disabled
|
11308
11607
|
})
|
11309
|
-
}, /* @__PURE__ */
|
11608
|
+
}, /* @__PURE__ */ React83.createElement("div", {
|
11310
11609
|
className: tw("px-2 py-1")
|
11311
|
-
}, /* @__PURE__ */
|
11610
|
+
}, /* @__PURE__ */ React83.createElement(Typography2, {
|
11312
11611
|
variant: "small",
|
11313
11612
|
color: invalid ? "error-80" : disabled ? "grey-40" : "grey-70"
|
11314
|
-
}, children)), !readOnly && /* @__PURE__ */
|
11613
|
+
}, children)), !readOnly && /* @__PURE__ */ React83.createElement("div", __spreadProps(__spreadValues({
|
11315
11614
|
ref
|
11316
11615
|
}, props), {
|
11317
11616
|
onClick,
|
@@ -11322,7 +11621,7 @@ var InputChip = React81.forwardRef(
|
|
11322
11621
|
}),
|
11323
11622
|
role: "button",
|
11324
11623
|
"aria-label": `Remove ${String(children)}`
|
11325
|
-
}), /* @__PURE__ */
|
11624
|
+
}), /* @__PURE__ */ React83.createElement(Icon, {
|
11326
11625
|
icon: import_smallCross2.default,
|
11327
11626
|
className: tw({
|
11328
11627
|
"text-error-70": invalid,
|
@@ -11381,8 +11680,8 @@ var MultiInputBase = (_a) => {
|
|
11381
11680
|
]);
|
11382
11681
|
var _a2;
|
11383
11682
|
const inputRef = useRef10(null);
|
11384
|
-
const [items, setItems] =
|
11385
|
-
const [hasFocus, setFocus] =
|
11683
|
+
const [items, setItems] = useState11((_a2 = value != null ? value : defaultValue) != null ? _a2 : []);
|
11684
|
+
const [hasFocus, setFocus] = useState11(false);
|
11386
11685
|
const keyCodes = [delimiter !== "enter" ? " " : null, delimiter !== "space" ? "Enter" : null].filter(identity);
|
11387
11686
|
useEffect9(() => {
|
11388
11687
|
const requiresUpdate = value !== void 0 || defaultValue === void 0;
|
@@ -11463,7 +11762,7 @@ var MultiInputBase = (_a) => {
|
|
11463
11762
|
};
|
11464
11763
|
const renderChips = () => items == null ? void 0 : items.map((item, index) => {
|
11465
11764
|
var _a3;
|
11466
|
-
return /* @__PURE__ */
|
11765
|
+
return /* @__PURE__ */ React84.createElement(InputChip, {
|
11467
11766
|
key: `${itemToString(item)}.${index}`,
|
11468
11767
|
invalid: !((_a3 = isItemValid == null ? void 0 : isItemValid(item, index)) != null ? _a3 : true),
|
11469
11768
|
readOnly,
|
@@ -11474,13 +11773,13 @@ var MultiInputBase = (_a) => {
|
|
11474
11773
|
}
|
11475
11774
|
}, itemToString(item));
|
11476
11775
|
});
|
11477
|
-
return /* @__PURE__ */
|
11776
|
+
return /* @__PURE__ */ React84.createElement("div", {
|
11478
11777
|
className: "Aquarium-MultiInputBase"
|
11479
|
-
}, /* @__PURE__ */
|
11778
|
+
}, /* @__PURE__ */ React84.createElement(Select.InputContainer, {
|
11480
11779
|
variant: disabled ? "disabled" : !valid ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default"
|
11481
|
-
}, /* @__PURE__ */
|
11780
|
+
}, /* @__PURE__ */ React84.createElement("div", {
|
11482
11781
|
className: "grow inline-flex flex-row flex-wrap gap-y-2"
|
11483
|
-
}, inline && renderChips(), /* @__PURE__ */
|
11782
|
+
}, inline && renderChips(), /* @__PURE__ */ React84.createElement(Select.Input, __spreadProps(__spreadValues({
|
11484
11783
|
ref: inputRef,
|
11485
11784
|
id: id != null ? id : name,
|
11486
11785
|
name,
|
@@ -11498,18 +11797,18 @@ var MultiInputBase = (_a) => {
|
|
11498
11797
|
onFocus: handleFocus,
|
11499
11798
|
onBlur: handleBlur,
|
11500
11799
|
autoComplete: "off"
|
11501
|
-
}))), endAdornment && /* @__PURE__ */
|
11800
|
+
}))), endAdornment && /* @__PURE__ */ React84.createElement(InputAdornment, null, endAdornment)), !inline && /* @__PURE__ */ React84.createElement("div", {
|
11502
11801
|
className: tw("flex flex-row flex-wrap gap-y-2 mt-2")
|
11503
11802
|
}, renderChips()));
|
11504
11803
|
};
|
11505
|
-
var BaseMultiInputSkeleton = () => /* @__PURE__ */
|
11804
|
+
var BaseMultiInputSkeleton = () => /* @__PURE__ */ React84.createElement(Skeleton, {
|
11506
11805
|
height: 38
|
11507
11806
|
});
|
11508
11807
|
MultiInputBase.Skeleton = BaseMultiInputSkeleton;
|
11509
11808
|
var MultiInput = (props) => {
|
11510
11809
|
var _a, _b, _c, _d, _e;
|
11511
11810
|
const maxLength = (_a = props.maxLength) != null ? _a : props.max;
|
11512
|
-
const [value, setValue] =
|
11811
|
+
const [value, setValue] = useState11((_c = (_b = props.value) != null ? _b : props.defaultValue) != null ? _c : []);
|
11513
11812
|
useEffect9(() => {
|
11514
11813
|
var _a2;
|
11515
11814
|
setValue((_a2 = props.value) != null ? _a2 : []);
|
@@ -11519,7 +11818,7 @@ var MultiInput = (props) => {
|
|
11519
11818
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
11520
11819
|
const labelControlProps = getLabelControlProps(props);
|
11521
11820
|
const baseProps = omit11(props, Object.keys(labelControlProps));
|
11522
|
-
return /* @__PURE__ */
|
11821
|
+
return /* @__PURE__ */ React84.createElement(LabelControl, __spreadProps(__spreadValues({
|
11523
11822
|
id: `${id.current}-label`,
|
11524
11823
|
htmlFor: `${id.current}-input`,
|
11525
11824
|
messageId: errorMessageId
|
@@ -11527,7 +11826,7 @@ var MultiInput = (props) => {
|
|
11527
11826
|
length: value.length,
|
11528
11827
|
maxLength,
|
11529
11828
|
className: "Aquarium-MultiInput"
|
11530
|
-
}), /* @__PURE__ */
|
11829
|
+
}), /* @__PURE__ */ React84.createElement(MultiInputBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
|
11531
11830
|
id: `${id.current}-input`,
|
11532
11831
|
onChange: (value2) => {
|
11533
11832
|
var _a2;
|
@@ -11539,12 +11838,12 @@ var MultiInput = (props) => {
|
|
11539
11838
|
valid: props.valid
|
11540
11839
|
})));
|
11541
11840
|
};
|
11542
|
-
var MultiInputSkeleton = () => /* @__PURE__ */
|
11841
|
+
var MultiInputSkeleton = () => /* @__PURE__ */ React84.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React84.createElement(MultiInputBase.Skeleton, null));
|
11543
11842
|
MultiInput.Skeleton = MultiInputSkeleton;
|
11544
11843
|
MultiInput.Skeleton.displayName = "MultiInput.Skeleton";
|
11545
11844
|
|
11546
11845
|
// src/molecules/MultiSelect/MultiSelect.tsx
|
11547
|
-
import
|
11846
|
+
import React85, { useEffect as useEffect10, useRef as useRef11, useState as useState12 } from "react";
|
11548
11847
|
import { ariaHideOutside as ariaHideOutside2 } from "@react-aria/overlays";
|
11549
11848
|
import { useCombobox as useCombobox2, useMultipleSelection } from "downshift";
|
11550
11849
|
import isEqual from "lodash/isEqual";
|
@@ -11606,8 +11905,8 @@ var MultiSelectBase = (_a) => {
|
|
11606
11905
|
const targetRef = useRef11(null);
|
11607
11906
|
const menuRef = useRef11(null);
|
11608
11907
|
const inputRef = useRef11(null);
|
11609
|
-
const [inputValue, setInputValue] =
|
11610
|
-
const [hasFocus, setFocus] =
|
11908
|
+
const [inputValue, setInputValue] = useState12("");
|
11909
|
+
const [hasFocus, setFocus] = useState12(false);
|
11611
11910
|
const { selectedItems, addSelectedItem, removeSelectedItem, getDropdownProps, getSelectedItemProps } = useMultipleSelection(
|
11612
11911
|
omitBy(
|
11613
11912
|
{
|
@@ -11691,7 +11990,7 @@ var MultiSelectBase = (_a) => {
|
|
11691
11990
|
}
|
11692
11991
|
}, [state.isOpen, inputRef, popoverRef]);
|
11693
11992
|
const renderChips = () => {
|
11694
|
-
return selectedItems.map((selectedItem, index) => /* @__PURE__ */
|
11993
|
+
return selectedItems.map((selectedItem, index) => /* @__PURE__ */ React85.createElement(InputChip, __spreadProps(__spreadValues({
|
11695
11994
|
key: `${itemToString(selectedItem)}.chip`,
|
11696
11995
|
className: tw("mx-0"),
|
11697
11996
|
disabled,
|
@@ -11707,14 +12006,14 @@ var MultiSelectBase = (_a) => {
|
|
11707
12006
|
const hasNoResults = options.length === 0 || filteredOptions.length === 0;
|
11708
12007
|
const inputProps = getInputProps(getDropdownProps({ ref: inputRef, disabled: disabled || readOnly }));
|
11709
12008
|
const menuProps = getMenuProps({ ref: menuRef }, { suppressRefError: !isOpen });
|
11710
|
-
return /* @__PURE__ */
|
12009
|
+
return /* @__PURE__ */ React85.createElement("div", {
|
11711
12010
|
className: classNames("Aquarium-MultiSelectBase", tw("relative"))
|
11712
|
-
}, /* @__PURE__ */
|
12011
|
+
}, /* @__PURE__ */ React85.createElement(Select.InputContainer, {
|
11713
12012
|
ref: targetRef,
|
11714
12013
|
variant: disabled ? "disabled" : !valid ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default"
|
11715
|
-
}, /* @__PURE__ */
|
12014
|
+
}, /* @__PURE__ */ React85.createElement("div", {
|
11716
12015
|
className: "grow inline-flex flex-row flex-wrap gap-2"
|
11717
|
-
}, !hideChips && inline && renderChips(), /* @__PURE__ */
|
12016
|
+
}, !hideChips && inline && renderChips(), /* @__PURE__ */ React85.createElement(Select.Input, __spreadProps(__spreadValues(__spreadValues({
|
11718
12017
|
id,
|
11719
12018
|
ref: inputRef,
|
11720
12019
|
name,
|
@@ -11736,12 +12035,12 @@ var MultiSelectBase = (_a) => {
|
|
11736
12035
|
setFocus(false);
|
11737
12036
|
(_a3 = inputProps.onBlur) == null ? void 0 : _a3.call(inputProps, e);
|
11738
12037
|
}
|
11739
|
-
}))), !readOnly && /* @__PURE__ */
|
12038
|
+
}))), !readOnly && /* @__PURE__ */ React85.createElement(Select.Toggle, __spreadValues({
|
11740
12039
|
hasFocus,
|
11741
12040
|
isOpen
|
11742
|
-
}, getToggleButtonProps({ disabled })))), !hideChips && !inline && /* @__PURE__ */
|
12041
|
+
}, getToggleButtonProps({ disabled })))), !hideChips && !inline && /* @__PURE__ */ React85.createElement("div", {
|
11743
12042
|
className: tw("flex flex-row flex-wrap gap-2 mt-2")
|
11744
|
-
}, renderChips()), isOpen && /* @__PURE__ */
|
12043
|
+
}, renderChips()), isOpen && /* @__PURE__ */ React85.createElement(PopoverOverlay, {
|
11745
12044
|
ref: popoverRef,
|
11746
12045
|
triggerRef: targetRef,
|
11747
12046
|
state,
|
@@ -11749,16 +12048,16 @@ var MultiSelectBase = (_a) => {
|
|
11749
12048
|
shouldFlip: true,
|
11750
12049
|
isNonModal: true,
|
11751
12050
|
style: { width: (_a2 = targetRef.current) == null ? void 0 : _a2.offsetWidth }
|
11752
|
-
}, /* @__PURE__ */
|
12051
|
+
}, /* @__PURE__ */ React85.createElement(Select.Menu, __spreadValues({
|
11753
12052
|
ref: menuRef,
|
11754
12053
|
maxHeight
|
11755
|
-
}, menuProps), hasNoResults && /* @__PURE__ */
|
12054
|
+
}, menuProps), hasNoResults && /* @__PURE__ */ React85.createElement(Select.NoResults, null, emptyState), filteredOptions.map((item, index) => /* @__PURE__ */ React85.createElement(Select.Item, __spreadValues({
|
11756
12055
|
key: itemToString(item),
|
11757
12056
|
highlighted: index === highlightedIndex,
|
11758
12057
|
selected: selectedItems.includes(item)
|
11759
12058
|
}, getItemProps({ item, index, disabled: isOptionDisabled(item, index) })), renderOption(item))))));
|
11760
12059
|
};
|
11761
|
-
var MultiSelectBaseSkeleton = () => /* @__PURE__ */
|
12060
|
+
var MultiSelectBaseSkeleton = () => /* @__PURE__ */ React85.createElement(Skeleton, {
|
11762
12061
|
height: 38
|
11763
12062
|
});
|
11764
12063
|
MultiSelectBase.Skeleton = MultiSelectBaseSkeleton;
|
@@ -11778,13 +12077,13 @@ var MultiSelect = (_a) => {
|
|
11778
12077
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
11779
12078
|
const labelControlProps = getLabelControlProps(props);
|
11780
12079
|
const baseProps = omit12(props, Object.keys(labelControlProps));
|
11781
|
-
return /* @__PURE__ */
|
12080
|
+
return /* @__PURE__ */ React85.createElement(LabelControl, __spreadProps(__spreadValues({
|
11782
12081
|
id: `${id.current}-label`,
|
11783
12082
|
htmlFor: `${id.current}-input`,
|
11784
12083
|
messageId: errorMessageId
|
11785
12084
|
}, labelControlProps), {
|
11786
12085
|
className: "Aquarium-MultiSelect"
|
11787
|
-
}), /* @__PURE__ */
|
12086
|
+
}), /* @__PURE__ */ React85.createElement(MultiSelectBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
|
11788
12087
|
id: id.current,
|
11789
12088
|
options,
|
11790
12089
|
emptyState,
|
@@ -11792,16 +12091,16 @@ var MultiSelect = (_a) => {
|
|
11792
12091
|
valid: props.valid
|
11793
12092
|
})));
|
11794
12093
|
};
|
11795
|
-
var MultiSelectSkeleton = () => /* @__PURE__ */
|
12094
|
+
var MultiSelectSkeleton = () => /* @__PURE__ */ React85.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React85.createElement(MultiSelectBase.Skeleton, null));
|
11796
12095
|
MultiSelect.Skeleton = MultiSelectSkeleton;
|
11797
12096
|
MultiSelect.Skeleton.displayName = "MultiSelect.Skeleton";
|
11798
12097
|
|
11799
12098
|
// src/molecules/NativeSelect/NativeSelect.tsx
|
11800
|
-
import
|
12099
|
+
import React86, { useRef as useRef12 } from "react";
|
11801
12100
|
import omit13 from "lodash/omit";
|
11802
12101
|
import uniqueId7 from "lodash/uniqueId";
|
11803
12102
|
var import_caretDown2 = __toESM(require_caretDown());
|
11804
|
-
var NativeSelectBase =
|
12103
|
+
var NativeSelectBase = React86.forwardRef(
|
11805
12104
|
(_a, ref) => {
|
11806
12105
|
var _b = _a, { children, disabled = false, required = false, valid = true, readOnly = false } = _b, props = __objRest(_b, ["children", "disabled", "required", "valid", "readOnly"]);
|
11807
12106
|
const placeholderValue = uniqueId7("default_value_for_placeholder");
|
@@ -11818,16 +12117,16 @@ var NativeSelectBase = React84.forwardRef(
|
|
11818
12117
|
(_b2 = props.onBlur) == null ? void 0 : _b2.call(props, event);
|
11819
12118
|
}
|
11820
12119
|
};
|
11821
|
-
return /* @__PURE__ */
|
12120
|
+
return /* @__PURE__ */ React86.createElement("span", {
|
11822
12121
|
className: classNames("Aquarium-NativeSelectBase", tw("relative block"))
|
11823
|
-
}, !readOnly && /* @__PURE__ */
|
12122
|
+
}, !readOnly && /* @__PURE__ */ React86.createElement("span", {
|
11824
12123
|
className: tw(
|
11825
12124
|
"absolute right-0 inset-y-0 mr-4 text-grey-40 flex ml-3 pointer-events-none typography-default-strong mt-4"
|
11826
12125
|
)
|
11827
|
-
}, /* @__PURE__ */
|
12126
|
+
}, /* @__PURE__ */ React86.createElement(Icon, {
|
11828
12127
|
icon: import_caretDown2.default,
|
11829
12128
|
"data-testid": "icon-dropdown"
|
11830
|
-
})), /* @__PURE__ */
|
12129
|
+
})), /* @__PURE__ */ React86.createElement("select", __spreadProps(__spreadValues({
|
11831
12130
|
ref,
|
11832
12131
|
disabled: disabled || readOnly,
|
11833
12132
|
required
|
@@ -11846,16 +12145,16 @@ var NativeSelectBase = React84.forwardRef(
|
|
11846
12145
|
),
|
11847
12146
|
props.className
|
11848
12147
|
)
|
11849
|
-
}), props.placeholder && /* @__PURE__ */
|
12148
|
+
}), props.placeholder && /* @__PURE__ */ React86.createElement("option", {
|
11850
12149
|
value: placeholderValue,
|
11851
12150
|
disabled: true
|
11852
12151
|
}, props.placeholder), children));
|
11853
12152
|
}
|
11854
12153
|
);
|
11855
|
-
NativeSelectBase.Skeleton = () => /* @__PURE__ */
|
12154
|
+
NativeSelectBase.Skeleton = () => /* @__PURE__ */ React86.createElement(Skeleton, {
|
11856
12155
|
height: 38
|
11857
12156
|
});
|
11858
|
-
var NativeSelect =
|
12157
|
+
var NativeSelect = React86.forwardRef(
|
11859
12158
|
(_a, ref) => {
|
11860
12159
|
var _b = _a, { readOnly } = _b, props = __objRest(_b, ["readOnly"]);
|
11861
12160
|
var _a2;
|
@@ -11864,13 +12163,13 @@ var NativeSelect = React84.forwardRef(
|
|
11864
12163
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
11865
12164
|
const _b2 = getLabelControlProps(props), { "data-testid": dataTestId } = _b2, labelControlProps = __objRest(_b2, ["data-testid"]);
|
11866
12165
|
const baseProps = omit13(props, Object.keys(labelControlProps));
|
11867
|
-
return /* @__PURE__ */
|
12166
|
+
return /* @__PURE__ */ React86.createElement(LabelControl, __spreadProps(__spreadValues({
|
11868
12167
|
id: `${id.current}-label`,
|
11869
12168
|
htmlFor: id.current,
|
11870
12169
|
messageId: errorMessageId
|
11871
12170
|
}, labelControlProps), {
|
11872
12171
|
className: "Aquarium-NativeSelect"
|
11873
|
-
}), /* @__PURE__ */
|
12172
|
+
}), /* @__PURE__ */ React86.createElement(NativeSelectBase, __spreadProps(__spreadValues(__spreadValues({
|
11874
12173
|
ref
|
11875
12174
|
}, baseProps), errorProps), {
|
11876
12175
|
id: id.current,
|
@@ -11884,63 +12183,63 @@ var NativeSelect = React84.forwardRef(
|
|
11884
12183
|
}
|
11885
12184
|
);
|
11886
12185
|
NativeSelect.displayName = "NativeSelect";
|
11887
|
-
var Option =
|
12186
|
+
var Option = React86.forwardRef((_a, ref) => {
|
11888
12187
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
11889
|
-
return /* @__PURE__ */
|
12188
|
+
return /* @__PURE__ */ React86.createElement("option", __spreadValues({
|
11890
12189
|
ref
|
11891
12190
|
}, props), children);
|
11892
12191
|
});
|
11893
12192
|
Option.displayName = "Option";
|
11894
|
-
var NativeSelectSkeleton = () => /* @__PURE__ */
|
12193
|
+
var NativeSelectSkeleton = () => /* @__PURE__ */ React86.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React86.createElement(NativeSelectBase.Skeleton, null), /* @__PURE__ */ React86.createElement("div", {
|
11895
12194
|
style: { height: "1px" }
|
11896
12195
|
}));
|
11897
12196
|
NativeSelect.Skeleton = NativeSelectSkeleton;
|
11898
12197
|
NativeSelect.Skeleton.displayName = "NativeSelect.Skeleton";
|
11899
12198
|
|
11900
12199
|
// src/molecules/Navigation/Navigation.tsx
|
11901
|
-
import
|
12200
|
+
import React88 from "react";
|
11902
12201
|
import classNames9 from "classnames";
|
11903
12202
|
|
11904
12203
|
// src/atoms/Navigation/Navigation.tsx
|
11905
|
-
import
|
12204
|
+
import React87 from "react";
|
11906
12205
|
var Navigation = (_a) => {
|
11907
12206
|
var _b = _a, { className, children } = _b, rest = __objRest(_b, ["className", "children"]);
|
11908
|
-
return /* @__PURE__ */
|
12207
|
+
return /* @__PURE__ */ React87.createElement("nav", {
|
11909
12208
|
className: classNames(tw("bg-grey-0 h-full"))
|
11910
|
-
}, /* @__PURE__ */
|
12209
|
+
}, /* @__PURE__ */ React87.createElement("ul", __spreadProps(__spreadValues({}, rest), {
|
11911
12210
|
className: classNames(tw("flex flex-col h-full"), className),
|
11912
12211
|
role: "menu"
|
11913
12212
|
}), children));
|
11914
12213
|
};
|
11915
12214
|
var Header = (_a) => {
|
11916
12215
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
11917
|
-
return /* @__PURE__ */
|
12216
|
+
return /* @__PURE__ */ React87.createElement("li", __spreadProps(__spreadValues({}, rest), {
|
11918
12217
|
role: "presentation",
|
11919
12218
|
className: classNames(tw("px-6 py-5"), className)
|
11920
12219
|
}));
|
11921
12220
|
};
|
11922
12221
|
var Footer = (_a) => {
|
11923
12222
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
11924
|
-
return /* @__PURE__ */
|
12223
|
+
return /* @__PURE__ */ React87.createElement("li", __spreadProps(__spreadValues({}, rest), {
|
11925
12224
|
role: "presentation",
|
11926
12225
|
className: classNames(tw("px-6 py-5 mt-auto"), className)
|
11927
12226
|
}));
|
11928
12227
|
};
|
11929
12228
|
var Section2 = (_a) => {
|
11930
12229
|
var _b = _a, { title, className } = _b, rest = __objRest(_b, ["title", "className"]);
|
11931
|
-
return /* @__PURE__ */
|
12230
|
+
return /* @__PURE__ */ React87.createElement("li", {
|
11932
12231
|
role: "presentation",
|
11933
12232
|
className: tw("py-5")
|
11934
|
-
}, title && /* @__PURE__ */
|
12233
|
+
}, title && /* @__PURE__ */ React87.createElement("div", {
|
11935
12234
|
className: classNames(className, "py-2 px-6 text-grey-40 uppercase cursor-default typography-caption")
|
11936
|
-
}, title), /* @__PURE__ */
|
12235
|
+
}, title), /* @__PURE__ */ React87.createElement("ul", __spreadProps(__spreadValues({}, rest), {
|
11937
12236
|
role: "group",
|
11938
12237
|
className: classNames(tw("flex flex-col"), className)
|
11939
12238
|
})));
|
11940
12239
|
};
|
11941
12240
|
var Divider3 = (_a) => {
|
11942
12241
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
11943
|
-
return /* @__PURE__ */
|
12242
|
+
return /* @__PURE__ */ React87.createElement("li", __spreadProps(__spreadValues({
|
11944
12243
|
role: "separator"
|
11945
12244
|
}, rest), {
|
11946
12245
|
className: classNames(tw("border-t-2 border-grey-5"), className)
|
@@ -11948,9 +12247,9 @@ var Divider3 = (_a) => {
|
|
11948
12247
|
};
|
11949
12248
|
var Item5 = (_a) => {
|
11950
12249
|
var _b = _a, { className, active } = _b, rest = __objRest(_b, ["className", "active"]);
|
11951
|
-
return /* @__PURE__ */
|
12250
|
+
return /* @__PURE__ */ React87.createElement("li", {
|
11952
12251
|
role: "presentation"
|
11953
|
-
}, /* @__PURE__ */
|
12252
|
+
}, /* @__PURE__ */ React87.createElement("a", __spreadProps(__spreadValues({}, rest), {
|
11954
12253
|
role: "menuitem",
|
11955
12254
|
className: classNames(
|
11956
12255
|
tw("py-3 px-6 hover:bg-grey-5 cursor-pointer flex gap-4 items-center typography-small focusable", {
|
@@ -11970,7 +12269,7 @@ Navigation.Divider = Divider3;
|
|
11970
12269
|
// src/molecules/Navigation/Navigation.tsx
|
11971
12270
|
var Navigation2 = (_a) => {
|
11972
12271
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
11973
|
-
return /* @__PURE__ */
|
12272
|
+
return /* @__PURE__ */ React88.createElement(Navigation, __spreadValues({
|
11974
12273
|
className: classNames9("Aquarium-Navigation", className)
|
11975
12274
|
}, props));
|
11976
12275
|
};
|
@@ -11984,11 +12283,11 @@ var Item6 = (_a) => {
|
|
11984
12283
|
"icon",
|
11985
12284
|
"showNotification"
|
11986
12285
|
]);
|
11987
|
-
return /* @__PURE__ */
|
12286
|
+
return /* @__PURE__ */ React88.createElement(Navigation.Item, __spreadValues({}, rest), icon && showNotification && /* @__PURE__ */ React88.createElement(Badge.Notification, null, /* @__PURE__ */ React88.createElement(InlineIcon, {
|
11988
12287
|
icon,
|
11989
12288
|
width: "20px",
|
11990
12289
|
height: "20px"
|
11991
|
-
})), icon && !showNotification && /* @__PURE__ */
|
12290
|
+
})), icon && !showNotification && /* @__PURE__ */ React88.createElement(InlineIcon, {
|
11992
12291
|
icon,
|
11993
12292
|
width: "20px",
|
11994
12293
|
height: "20px"
|
@@ -12001,32 +12300,32 @@ Navigation2.Header = Navigation.Header;
|
|
12001
12300
|
Navigation2.Section = Navigation.Section;
|
12002
12301
|
|
12003
12302
|
// src/molecules/PageHeader/PageHeader.tsx
|
12004
|
-
import
|
12303
|
+
import React90 from "react";
|
12005
12304
|
import castArray3 from "lodash/castArray";
|
12006
12305
|
|
12007
12306
|
// src/atoms/PageHeader/PageHeader.tsx
|
12008
|
-
import
|
12307
|
+
import React89 from "react";
|
12009
12308
|
var PageHeader = (_a) => {
|
12010
12309
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12011
|
-
return /* @__PURE__ */
|
12310
|
+
return /* @__PURE__ */ React89.createElement("div", __spreadValues({
|
12012
12311
|
className: classNames(tw("flex flex-row gap-4 pb-6"), className)
|
12013
12312
|
}, rest), children);
|
12014
12313
|
};
|
12015
12314
|
PageHeader.Container = (_a) => {
|
12016
12315
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12017
|
-
return /* @__PURE__ */
|
12316
|
+
return /* @__PURE__ */ React89.createElement("div", __spreadValues({
|
12018
12317
|
className: classNames(tw("flex flex-col grow gap-0"), className)
|
12019
12318
|
}, rest), children);
|
12020
12319
|
};
|
12021
12320
|
PageHeader.TitleContainer = (_a) => {
|
12022
12321
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12023
|
-
return /* @__PURE__ */
|
12322
|
+
return /* @__PURE__ */ React89.createElement("div", __spreadValues({
|
12024
12323
|
className: classNames(tw("flex flex-col justify-center gap-2"), className)
|
12025
12324
|
}, rest), children);
|
12026
12325
|
};
|
12027
12326
|
PageHeader.Title = (_a) => {
|
12028
12327
|
var _b = _a, { isSubHeader = false, children } = _b, rest = __objRest(_b, ["isSubHeader", "children"]);
|
12029
|
-
return /* @__PURE__ */
|
12328
|
+
return /* @__PURE__ */ React89.createElement(Typography2, __spreadProps(__spreadValues({}, rest), {
|
12030
12329
|
color: "grey-100",
|
12031
12330
|
variant: isSubHeader ? "subheading" : "heading",
|
12032
12331
|
htmlTag: isSubHeader ? "h2" : "h1"
|
@@ -12034,19 +12333,19 @@ PageHeader.Title = (_a) => {
|
|
12034
12333
|
};
|
12035
12334
|
PageHeader.Subtitle = (_a) => {
|
12036
12335
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
12037
|
-
return /* @__PURE__ */
|
12336
|
+
return /* @__PURE__ */ React89.createElement(Typography2.Small, __spreadProps(__spreadValues({}, rest), {
|
12038
12337
|
color: "grey-70"
|
12039
12338
|
}), children);
|
12040
12339
|
};
|
12041
12340
|
PageHeader.Chips = (_a) => {
|
12042
12341
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12043
|
-
return /* @__PURE__ */
|
12342
|
+
return /* @__PURE__ */ React89.createElement("div", __spreadValues({
|
12044
12343
|
className: classNames(tw("flex gap-3"), className)
|
12045
12344
|
}, rest), children);
|
12046
12345
|
};
|
12047
12346
|
PageHeader.Actions = (_a) => {
|
12048
12347
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12049
|
-
return /* @__PURE__ */
|
12348
|
+
return /* @__PURE__ */ React89.createElement("div", __spreadValues({
|
12050
12349
|
className: classNames(tw("flex flex-row gap-4 self-start"), className)
|
12051
12350
|
}, rest), children);
|
12052
12351
|
};
|
@@ -12070,63 +12369,63 @@ var CommonPageHeader = ({
|
|
12070
12369
|
onMenuOpenChange,
|
12071
12370
|
isSubHeader = false
|
12072
12371
|
}) => {
|
12073
|
-
return /* @__PURE__ */
|
12372
|
+
return /* @__PURE__ */ React90.createElement(PageHeader, {
|
12074
12373
|
className: "Aquarium-PageHeader"
|
12075
|
-
}, /* @__PURE__ */
|
12374
|
+
}, /* @__PURE__ */ React90.createElement(PageHeader.Container, null, breadcrumbs && /* @__PURE__ */ React90.createElement(Box, {
|
12076
12375
|
marginBottom: "3"
|
12077
|
-
}, /* @__PURE__ */
|
12376
|
+
}, /* @__PURE__ */ React90.createElement(Breadcrumbs, null, breadcrumbs)), /* @__PURE__ */ React90.createElement(Spacing, {
|
12078
12377
|
row: true,
|
12079
12378
|
gap: "5"
|
12080
|
-
}, image && /* @__PURE__ */
|
12379
|
+
}, image && /* @__PURE__ */ React90.createElement("img", {
|
12081
12380
|
src: image,
|
12082
12381
|
alt: imageAlt,
|
12083
12382
|
className: tw("w-[56px] h-[56px]")
|
12084
|
-
}), /* @__PURE__ */
|
12383
|
+
}), /* @__PURE__ */ React90.createElement(PageHeader.TitleContainer, null, /* @__PURE__ */ React90.createElement(PageHeader.Title, {
|
12085
12384
|
isSubHeader
|
12086
|
-
}, title), chips.length > 0 && /* @__PURE__ */
|
12385
|
+
}, title), chips.length > 0 && /* @__PURE__ */ React90.createElement(PageHeader.Chips, null, chips.map((chip) => /* @__PURE__ */ React90.createElement(Chip2, {
|
12087
12386
|
key: chip,
|
12088
12387
|
dense: true,
|
12089
12388
|
text: chip
|
12090
|
-
}))), subtitle && /* @__PURE__ */
|
12389
|
+
}))), subtitle && /* @__PURE__ */ React90.createElement(PageHeader.Subtitle, null, subtitle)))), (secondaryActions || primaryAction || secondaryAction || menu) && /* @__PURE__ */ React90.createElement(PageHeader.Actions, null, menu && /* @__PURE__ */ React90.createElement(Box.Flex, {
|
12091
12390
|
alignItems: "center"
|
12092
|
-
}, /* @__PURE__ */
|
12391
|
+
}, /* @__PURE__ */ React90.createElement(DropdownMenu2, {
|
12093
12392
|
onAction: (action) => onAction == null ? void 0 : onAction(action),
|
12094
12393
|
onOpenChange: onMenuOpenChange
|
12095
|
-
}, /* @__PURE__ */
|
12394
|
+
}, /* @__PURE__ */ React90.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ React90.createElement(Button.Icon, {
|
12096
12395
|
"aria-label": menuAriaLabel,
|
12097
12396
|
icon: import_more4.default
|
12098
12397
|
})), menu)), secondaryActions && castArray3(secondaryActions).filter(Boolean).map((secondaryAction2) => renderAction("secondary", secondaryAction2)), primaryAction && renderAction("primary", primaryAction)));
|
12099
12398
|
};
|
12100
|
-
var PageHeader2 = (props) => /* @__PURE__ */
|
12399
|
+
var PageHeader2 = (props) => /* @__PURE__ */ React90.createElement(CommonPageHeader, __spreadValues({}, props));
|
12101
12400
|
PageHeader2.displayName = "PageHeader";
|
12102
|
-
var SubHeader = (props) => /* @__PURE__ */
|
12401
|
+
var SubHeader = (props) => /* @__PURE__ */ React90.createElement(CommonPageHeader, __spreadProps(__spreadValues({}, props), {
|
12103
12402
|
isSubHeader: true
|
12104
12403
|
}));
|
12105
12404
|
PageHeader2.SubHeader = SubHeader;
|
12106
12405
|
PageHeader2.SubHeader.displayName = "PageHeader.SubHeader";
|
12107
12406
|
|
12108
12407
|
// src/molecules/PopoverDialog/PopoverDialog.tsx
|
12109
|
-
import
|
12408
|
+
import React92 from "react";
|
12110
12409
|
import omit14 from "lodash/omit";
|
12111
12410
|
|
12112
12411
|
// src/atoms/PopoverDialog/PopoverDialog.tsx
|
12113
|
-
import
|
12412
|
+
import React91 from "react";
|
12114
12413
|
var Header2 = (_a) => {
|
12115
12414
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12116
|
-
return /* @__PURE__ */
|
12415
|
+
return /* @__PURE__ */ React91.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12117
12416
|
className: classNames(tw("p-5 gap-3 flex items-center"), className)
|
12118
12417
|
}), children);
|
12119
12418
|
};
|
12120
12419
|
var Title = (_a) => {
|
12121
12420
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12122
|
-
return /* @__PURE__ */
|
12421
|
+
return /* @__PURE__ */ React91.createElement(Typography, __spreadProps(__spreadValues({}, rest), {
|
12123
12422
|
htmlTag: "h1",
|
12124
12423
|
variant: "small-strong"
|
12125
12424
|
}), children);
|
12126
12425
|
};
|
12127
12426
|
var Body = (_a) => {
|
12128
12427
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12129
|
-
return /* @__PURE__ */
|
12428
|
+
return /* @__PURE__ */ React91.createElement(Typography, __spreadProps(__spreadValues({}, rest), {
|
12130
12429
|
htmlTag: "div",
|
12131
12430
|
variant: "caption",
|
12132
12431
|
className: classNames(tw("px-5 overflow-y-auto"), className)
|
@@ -12134,13 +12433,13 @@ var Body = (_a) => {
|
|
12134
12433
|
};
|
12135
12434
|
var Footer2 = (_a) => {
|
12136
12435
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12137
|
-
return /* @__PURE__ */
|
12436
|
+
return /* @__PURE__ */ React91.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12138
12437
|
className: classNames(tw("p-5"), className)
|
12139
12438
|
}), children);
|
12140
12439
|
};
|
12141
12440
|
var Actions2 = (_a) => {
|
12142
12441
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12143
|
-
return /* @__PURE__ */
|
12442
|
+
return /* @__PURE__ */ React91.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12144
12443
|
className: classNames(tw("flex gap-4"), className)
|
12145
12444
|
}), children);
|
12146
12445
|
};
|
@@ -12156,13 +12455,13 @@ var PopoverDialog = {
|
|
12156
12455
|
var PopoverDialog2 = ({ placement, open, title, secondaryAction, primaryAction, children }) => {
|
12157
12456
|
const wrapPromptWithBody = (child) => {
|
12158
12457
|
if (isComponentType(child, PopoverDialog2.Prompt)) {
|
12159
|
-
return /* @__PURE__ */
|
12458
|
+
return /* @__PURE__ */ React92.createElement(Popover2.Panel, {
|
12160
12459
|
className: classNames("Aquarium-PopoverDialog", tw("max-w-[300px]"))
|
12161
|
-
}, /* @__PURE__ */
|
12460
|
+
}, /* @__PURE__ */ React92.createElement(PopoverDialog.Header, null, /* @__PURE__ */ React92.createElement(PopoverDialog.Title, null, title)), child, /* @__PURE__ */ React92.createElement(PopoverDialog.Footer, null, /* @__PURE__ */ React92.createElement(PopoverDialog.Actions, null, secondaryAction && /* @__PURE__ */ React92.createElement(Popover2.Button, __spreadValues({
|
12162
12461
|
kind: "secondary-ghost",
|
12163
12462
|
key: secondaryAction.text,
|
12164
12463
|
dense: true
|
12165
|
-
}, omit14(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */
|
12464
|
+
}, omit14(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */ React92.createElement(Popover2.Button, __spreadValues({
|
12166
12465
|
kind: "ghost",
|
12167
12466
|
key: primaryAction.text,
|
12168
12467
|
dense: true
|
@@ -12170,15 +12469,15 @@ var PopoverDialog2 = ({ placement, open, title, secondaryAction, primaryAction,
|
|
12170
12469
|
}
|
12171
12470
|
return child;
|
12172
12471
|
};
|
12173
|
-
return /* @__PURE__ */
|
12472
|
+
return /* @__PURE__ */ React92.createElement(Popover2, {
|
12174
12473
|
type: "dialog",
|
12175
12474
|
isOpen: open,
|
12176
12475
|
placement,
|
12177
12476
|
containFocus: true
|
12178
|
-
},
|
12477
|
+
}, React92.Children.map(children, wrapPromptWithBody));
|
12179
12478
|
};
|
12180
12479
|
PopoverDialog2.Trigger = Popover2.Trigger;
|
12181
|
-
var Prompt = ({ children }) => /* @__PURE__ */
|
12480
|
+
var Prompt = ({ children }) => /* @__PURE__ */ React92.createElement(PopoverDialog.Body, null, children);
|
12182
12481
|
Prompt.displayName = "PopoverDialog.Prompt";
|
12183
12482
|
PopoverDialog2.Prompt = Prompt;
|
12184
12483
|
|
@@ -12187,14 +12486,14 @@ import { createPortal } from "react-dom";
|
|
12187
12486
|
var Portal = ({ children, to }) => createPortal(children, to);
|
12188
12487
|
|
12189
12488
|
// src/molecules/ProgressBar/ProgressBar.tsx
|
12190
|
-
import
|
12489
|
+
import React94 from "react";
|
12191
12490
|
|
12192
12491
|
// src/atoms/ProgressBar/ProgressBar.tsx
|
12193
|
-
import
|
12492
|
+
import React93 from "react";
|
12194
12493
|
import clamp3 from "lodash/clamp";
|
12195
12494
|
var ProgressBar = (_a) => {
|
12196
12495
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12197
|
-
return /* @__PURE__ */
|
12496
|
+
return /* @__PURE__ */ React93.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12198
12497
|
className: classNames(
|
12199
12498
|
tw("relative flex items-center w-full bg-grey-0 h-2 rounded-full overflow-hidden"),
|
12200
12499
|
className
|
@@ -12210,7 +12509,7 @@ var STATUS_COLORS = {
|
|
12210
12509
|
ProgressBar.Indicator = (_a) => {
|
12211
12510
|
var _b = _a, { min, max, value, "aria-label": ariaLabel, status, className } = _b, rest = __objRest(_b, ["min", "max", "value", "aria-label", "status", "className"]);
|
12212
12511
|
const completedPercentage = clamp3((value - min) / (max - min) * 100, 0, 100);
|
12213
|
-
return /* @__PURE__ */
|
12512
|
+
return /* @__PURE__ */ React93.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12214
12513
|
className: classNames(
|
12215
12514
|
tw("h-2 rounded-full transition-all ease-in-out delay-150"),
|
12216
12515
|
STATUS_COLORS[status],
|
@@ -12226,11 +12525,11 @@ ProgressBar.Indicator = (_a) => {
|
|
12226
12525
|
};
|
12227
12526
|
ProgressBar.Labels = (_a) => {
|
12228
12527
|
var _b = _a, { children, startLabel, endLabel, className } = _b, rest = __objRest(_b, ["children", "startLabel", "endLabel", "className"]);
|
12229
|
-
return /* @__PURE__ */
|
12528
|
+
return /* @__PURE__ */ React93.createElement("div", {
|
12230
12529
|
className: classNames(tw("flex flex-row"), className)
|
12231
|
-
}, /* @__PURE__ */
|
12530
|
+
}, /* @__PURE__ */ React93.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
12232
12531
|
className: tw("grow text-grey-70 typography-caption")
|
12233
|
-
}), startLabel), /* @__PURE__ */
|
12532
|
+
}), startLabel), /* @__PURE__ */ React93.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
12234
12533
|
className: tw("grow text-grey-70 typography-caption text-right")
|
12235
12534
|
}), endLabel));
|
12236
12535
|
};
|
@@ -12248,7 +12547,7 @@ var ProgressBar2 = (props) => {
|
|
12248
12547
|
if (min > max) {
|
12249
12548
|
throw new Error("`min` value provided to `ProgressBar` is greater than `max` value.");
|
12250
12549
|
}
|
12251
|
-
const progress = /* @__PURE__ */
|
12550
|
+
const progress = /* @__PURE__ */ React94.createElement(ProgressBar, null, /* @__PURE__ */ React94.createElement(ProgressBar.Indicator, {
|
12252
12551
|
status: value === max ? completedStatus : progresStatus,
|
12253
12552
|
min,
|
12254
12553
|
max,
|
@@ -12258,15 +12557,15 @@ var ProgressBar2 = (props) => {
|
|
12258
12557
|
if (props.dense) {
|
12259
12558
|
return progress;
|
12260
12559
|
}
|
12261
|
-
return /* @__PURE__ */
|
12560
|
+
return /* @__PURE__ */ React94.createElement("div", {
|
12262
12561
|
className: "Aquarium-ProgressBar"
|
12263
|
-
}, progress, /* @__PURE__ */
|
12562
|
+
}, progress, /* @__PURE__ */ React94.createElement(ProgressBar.Labels, {
|
12264
12563
|
className: tw("py-2"),
|
12265
12564
|
startLabel: props.startLabel,
|
12266
12565
|
endLabel: props.endLabel
|
12267
12566
|
}));
|
12268
12567
|
};
|
12269
|
-
var ProgressBarSkeleton = () => /* @__PURE__ */
|
12568
|
+
var ProgressBarSkeleton = () => /* @__PURE__ */ React94.createElement(Skeleton, {
|
12270
12569
|
height: 4,
|
12271
12570
|
display: "block"
|
12272
12571
|
});
|
@@ -12274,13 +12573,13 @@ ProgressBar2.Skeleton = ProgressBarSkeleton;
|
|
12274
12573
|
ProgressBar2.Skeleton.displayName = "ProgressBar.Skeleton";
|
12275
12574
|
|
12276
12575
|
// src/molecules/RadioButton/RadioButton.tsx
|
12277
|
-
import
|
12278
|
-
var RadioButton2 =
|
12576
|
+
import React95 from "react";
|
12577
|
+
var RadioButton2 = React95.forwardRef(
|
12279
12578
|
(_a, ref) => {
|
12280
12579
|
var _b = _a, { name, id, readOnly = false, disabled = false, caption, children, "aria-label": ariaLabel } = _b, props = __objRest(_b, ["name", "id", "readOnly", "disabled", "caption", "children", "aria-label"]);
|
12281
12580
|
var _a2;
|
12282
12581
|
const isChecked = (_a2 = props.checked) != null ? _a2 : props.defaultChecked;
|
12283
|
-
return !readOnly || isChecked ? /* @__PURE__ */
|
12582
|
+
return !readOnly || isChecked ? /* @__PURE__ */ React95.createElement(ControlLabel, {
|
12284
12583
|
htmlFor: id,
|
12285
12584
|
label: children,
|
12286
12585
|
"aria-label": ariaLabel,
|
@@ -12289,7 +12588,7 @@ var RadioButton2 = React93.forwardRef(
|
|
12289
12588
|
disabled,
|
12290
12589
|
style: { gap: "0 8px" },
|
12291
12590
|
className: "Aquarium-RadioButton"
|
12292
|
-
}, !readOnly && /* @__PURE__ */
|
12591
|
+
}, !readOnly && /* @__PURE__ */ React95.createElement(RadioButton, __spreadProps(__spreadValues({
|
12293
12592
|
id,
|
12294
12593
|
ref,
|
12295
12594
|
name
|
@@ -12300,12 +12599,12 @@ var RadioButton2 = React93.forwardRef(
|
|
12300
12599
|
}
|
12301
12600
|
);
|
12302
12601
|
RadioButton2.displayName = "RadioButton";
|
12303
|
-
var RadioButtonSkeleton = () => /* @__PURE__ */
|
12602
|
+
var RadioButtonSkeleton = () => /* @__PURE__ */ React95.createElement("div", {
|
12304
12603
|
className: tw("flex gap-3")
|
12305
|
-
}, /* @__PURE__ */
|
12604
|
+
}, /* @__PURE__ */ React95.createElement(Skeleton, {
|
12306
12605
|
height: 20,
|
12307
12606
|
width: 20
|
12308
|
-
}), /* @__PURE__ */
|
12607
|
+
}), /* @__PURE__ */ React95.createElement(Skeleton, {
|
12309
12608
|
height: 20,
|
12310
12609
|
width: 150
|
12311
12610
|
}));
|
@@ -12313,10 +12612,10 @@ RadioButton2.Skeleton = RadioButtonSkeleton;
|
|
12313
12612
|
RadioButton2.Skeleton.displayName = "RadioButton.Skeleton";
|
12314
12613
|
|
12315
12614
|
// src/molecules/RadioButtonGroup/RadioButtonGroup.tsx
|
12316
|
-
import
|
12615
|
+
import React96 from "react";
|
12317
12616
|
import uniqueId8 from "lodash/uniqueId";
|
12318
12617
|
var isRadioButton = (c) => {
|
12319
|
-
return
|
12618
|
+
return React96.isValidElement(c) && c.type === RadioButton2;
|
12320
12619
|
};
|
12321
12620
|
var RadioButtonGroup = (_a) => {
|
12322
12621
|
var _b = _a, {
|
@@ -12339,7 +12638,7 @@ var RadioButtonGroup = (_a) => {
|
|
12339
12638
|
"children"
|
12340
12639
|
]);
|
12341
12640
|
var _a2;
|
12342
|
-
const [value, setValue] =
|
12641
|
+
const [value, setValue] = React96.useState((_a2 = _value != null ? _value : defaultValue) != null ? _a2 : "");
|
12343
12642
|
const errorMessageId = uniqueId8();
|
12344
12643
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
12345
12644
|
const labelControlProps = getLabelControlProps(props);
|
@@ -12350,14 +12649,14 @@ var RadioButtonGroup = (_a) => {
|
|
12350
12649
|
setValue(e.target.value);
|
12351
12650
|
onChange == null ? void 0 : onChange(e.target.value);
|
12352
12651
|
};
|
12353
|
-
const content =
|
12652
|
+
const content = React96.Children.map(children, (c) => {
|
12354
12653
|
var _a3, _b2, _c;
|
12355
12654
|
if (!isRadioButton(c)) {
|
12356
12655
|
return null;
|
12357
12656
|
}
|
12358
12657
|
const defaultChecked = defaultValue === void 0 ? void 0 : c.props.value === defaultValue;
|
12359
12658
|
const checked = value === void 0 ? void 0 : c.props.value === value;
|
12360
|
-
return
|
12659
|
+
return React96.cloneElement(c, {
|
12361
12660
|
name,
|
12362
12661
|
defaultChecked: (_a3 = c.props.defaultChecked) != null ? _a3 : defaultChecked,
|
12363
12662
|
checked: (_b2 = c.props.checked) != null ? _b2 : checked,
|
@@ -12366,13 +12665,13 @@ var RadioButtonGroup = (_a) => {
|
|
12366
12665
|
readOnly
|
12367
12666
|
});
|
12368
12667
|
});
|
12369
|
-
return /* @__PURE__ */
|
12668
|
+
return /* @__PURE__ */ React96.createElement(LabelControl, __spreadProps(__spreadValues(__spreadValues({
|
12370
12669
|
fieldset: true
|
12371
12670
|
}, labelControlProps), errorProps), {
|
12372
12671
|
className: "Aquarium-RadioButtonGroup"
|
12373
|
-
}), cols && /* @__PURE__ */
|
12672
|
+
}), cols && /* @__PURE__ */ React96.createElement(InputGroup, {
|
12374
12673
|
cols
|
12375
|
-
}, content), !cols && /* @__PURE__ */
|
12674
|
+
}, content), !cols && /* @__PURE__ */ React96.createElement(Flexbox, {
|
12376
12675
|
direction,
|
12377
12676
|
alignItems: "flex-start",
|
12378
12677
|
colGap: "8",
|
@@ -12381,12 +12680,12 @@ var RadioButtonGroup = (_a) => {
|
|
12381
12680
|
}, content));
|
12382
12681
|
};
|
12383
12682
|
var RadioButtonGroupSkeleton = ({ direction = "row", options = 2 }) => {
|
12384
|
-
return /* @__PURE__ */
|
12683
|
+
return /* @__PURE__ */ React96.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React96.createElement("div", {
|
12385
12684
|
className: tw("flex flex-wrap", {
|
12386
12685
|
"flex-row gap-8": direction === "row",
|
12387
12686
|
"flex-col gap-2": direction === "column"
|
12388
12687
|
})
|
12389
|
-
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */
|
12688
|
+
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */ React96.createElement(RadioButton2.Skeleton, {
|
12390
12689
|
key
|
12391
12690
|
}))));
|
12392
12691
|
};
|
@@ -12394,24 +12693,24 @@ RadioButtonGroup.Skeleton = RadioButtonGroupSkeleton;
|
|
12394
12693
|
RadioButtonGroup.Skeleton.displayName = "RadioButtonGroup.Skeleton";
|
12395
12694
|
|
12396
12695
|
// src/molecules/Section/Section.tsx
|
12397
|
-
import
|
12696
|
+
import React101 from "react";
|
12398
12697
|
import { useId as useId3 } from "@react-aria/utils";
|
12399
|
-
import { animated as
|
12698
|
+
import { animated as animated4, useSpring as useSpring3 } from "@react-spring/web";
|
12400
12699
|
import castArray4 from "lodash/castArray";
|
12401
12700
|
import isUndefined8 from "lodash/isUndefined";
|
12402
12701
|
|
12403
12702
|
// src/molecules/Switch/Switch.tsx
|
12404
|
-
import
|
12703
|
+
import React98 from "react";
|
12405
12704
|
|
12406
12705
|
// src/atoms/Switch/Switch.tsx
|
12407
|
-
import
|
12706
|
+
import React97 from "react";
|
12408
12707
|
var import_ban2 = __toESM(require_ban());
|
12409
|
-
var Switch =
|
12708
|
+
var Switch = React97.forwardRef(
|
12410
12709
|
(_a, ref) => {
|
12411
12710
|
var _b = _a, { id, children, name, disabled = false, readOnly = false } = _b, props = __objRest(_b, ["id", "children", "name", "disabled", "readOnly"]);
|
12412
|
-
return /* @__PURE__ */
|
12711
|
+
return /* @__PURE__ */ React97.createElement("span", {
|
12413
12712
|
className: tw("relative inline-flex justify-center items-center self-center group")
|
12414
|
-
}, /* @__PURE__ */
|
12713
|
+
}, /* @__PURE__ */ React97.createElement("input", __spreadProps(__spreadValues({
|
12415
12714
|
id,
|
12416
12715
|
ref,
|
12417
12716
|
type: "checkbox",
|
@@ -12430,7 +12729,7 @@ var Switch = React95.forwardRef(
|
|
12430
12729
|
),
|
12431
12730
|
readOnly,
|
12432
12731
|
disabled
|
12433
|
-
})), /* @__PURE__ */
|
12732
|
+
})), /* @__PURE__ */ React97.createElement("span", {
|
12434
12733
|
className: tw(
|
12435
12734
|
"pointer-events-none rounded-full absolute inline-flex justify-center items-center transition duration-300 h-4 w-4 transform peer-checked/switch:translate-x-5",
|
12436
12735
|
"bg-white left-2 peer-checked/switch:left-1 text-grey-30 peer-checked/switch:text-primary-60",
|
@@ -12438,7 +12737,7 @@ var Switch = React95.forwardRef(
|
|
12438
12737
|
"shadow-4dp": !disabled
|
12439
12738
|
}
|
12440
12739
|
)
|
12441
|
-
}, disabled && /* @__PURE__ */
|
12740
|
+
}, disabled && /* @__PURE__ */ React97.createElement(Icon, {
|
12442
12741
|
icon: import_ban2.default,
|
12443
12742
|
width: "10px",
|
12444
12743
|
height: "10px"
|
@@ -12447,7 +12746,7 @@ var Switch = React95.forwardRef(
|
|
12447
12746
|
);
|
12448
12747
|
|
12449
12748
|
// src/molecules/Switch/Switch.tsx
|
12450
|
-
var Switch2 =
|
12749
|
+
var Switch2 = React98.forwardRef(
|
12451
12750
|
(_a, ref) => {
|
12452
12751
|
var _b = _a, {
|
12453
12752
|
id,
|
@@ -12470,7 +12769,7 @@ var Switch2 = React96.forwardRef(
|
|
12470
12769
|
]);
|
12471
12770
|
var _a2;
|
12472
12771
|
const isChecked = (_a2 = props.checked) != null ? _a2 : props.defaultChecked;
|
12473
|
-
return !readOnly || isChecked ? /* @__PURE__ */
|
12772
|
+
return !readOnly || isChecked ? /* @__PURE__ */ React98.createElement(ControlLabel, {
|
12474
12773
|
htmlFor: id,
|
12475
12774
|
label: children,
|
12476
12775
|
"aria-label": ariaLabel,
|
@@ -12480,7 +12779,7 @@ var Switch2 = React96.forwardRef(
|
|
12480
12779
|
style: { gap: "0 8px" },
|
12481
12780
|
labelPlacement,
|
12482
12781
|
className: "Aquarium-Switch"
|
12483
|
-
}, !readOnly && /* @__PURE__ */
|
12782
|
+
}, !readOnly && /* @__PURE__ */ React98.createElement(Switch, __spreadProps(__spreadValues({
|
12484
12783
|
id,
|
12485
12784
|
ref,
|
12486
12785
|
name
|
@@ -12491,12 +12790,12 @@ var Switch2 = React96.forwardRef(
|
|
12491
12790
|
}
|
12492
12791
|
);
|
12493
12792
|
Switch2.displayName = "Switch";
|
12494
|
-
var SwitchSkeleton = () => /* @__PURE__ */
|
12793
|
+
var SwitchSkeleton = () => /* @__PURE__ */ React98.createElement("div", {
|
12495
12794
|
className: tw("flex gap-3")
|
12496
|
-
}, /* @__PURE__ */
|
12795
|
+
}, /* @__PURE__ */ React98.createElement(Skeleton, {
|
12497
12796
|
height: 20,
|
12498
12797
|
width: 35
|
12499
|
-
}), /* @__PURE__ */
|
12798
|
+
}), /* @__PURE__ */ React98.createElement(Skeleton, {
|
12500
12799
|
height: 20,
|
12501
12800
|
width: 150
|
12502
12801
|
}));
|
@@ -12504,7 +12803,7 @@ Switch2.Skeleton = SwitchSkeleton;
|
|
12504
12803
|
Switch2.Skeleton.displayName = "Switch.Skeleton ";
|
12505
12804
|
|
12506
12805
|
// src/molecules/TagLabel/TagLabel.tsx
|
12507
|
-
import
|
12806
|
+
import React99 from "react";
|
12508
12807
|
var getVariantClassNames = (variant = "primary") => {
|
12509
12808
|
switch (variant) {
|
12510
12809
|
case "danger":
|
@@ -12518,7 +12817,7 @@ var getVariantClassNames = (variant = "primary") => {
|
|
12518
12817
|
};
|
12519
12818
|
var TagLabel = (_a) => {
|
12520
12819
|
var _b = _a, { title, dense = false, variant } = _b, rest = __objRest(_b, ["title", "dense", "variant"]);
|
12521
|
-
return /* @__PURE__ */
|
12820
|
+
return /* @__PURE__ */ React99.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
12522
12821
|
className: classNames(
|
12523
12822
|
"Aquarium-TagLabel",
|
12524
12823
|
getVariantClassNames(variant),
|
@@ -12531,11 +12830,11 @@ var TagLabel = (_a) => {
|
|
12531
12830
|
};
|
12532
12831
|
|
12533
12832
|
// src/atoms/Section/Section.tsx
|
12534
|
-
import
|
12833
|
+
import React100 from "react";
|
12535
12834
|
var import_caretUp2 = __toESM(require_caretUp());
|
12536
12835
|
var Section3 = (_a) => {
|
12537
12836
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
12538
|
-
return /* @__PURE__ */
|
12837
|
+
return /* @__PURE__ */ React100.createElement(Box, __spreadValues({
|
12539
12838
|
component: "section",
|
12540
12839
|
borderColor: "grey-5",
|
12541
12840
|
borderWidth: "1px"
|
@@ -12543,7 +12842,7 @@ var Section3 = (_a) => {
|
|
12543
12842
|
};
|
12544
12843
|
Section3.Header = (_a) => {
|
12545
12844
|
var _b = _a, { children, className, collapsible } = _b, rest = __objRest(_b, ["children", "className", "collapsible"]);
|
12546
|
-
return /* @__PURE__ */
|
12845
|
+
return /* @__PURE__ */ React100.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12547
12846
|
className: classNames(
|
12548
12847
|
tw("px-6 flex gap-5 justify-between items-center h-[72px]", { "bg-grey-0": collapsible }),
|
12549
12848
|
className
|
@@ -12552,21 +12851,21 @@ Section3.Header = (_a) => {
|
|
12552
12851
|
};
|
12553
12852
|
Section3.TitleContainer = (_a) => {
|
12554
12853
|
var _b = _a, { children, className, collapsible } = _b, rest = __objRest(_b, ["children", "className", "collapsible"]);
|
12555
|
-
return /* @__PURE__ */
|
12854
|
+
return /* @__PURE__ */ React100.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12556
12855
|
className: classNames(
|
12557
|
-
tw("grow grid grid-cols-[auto_1fr] gap-
|
12856
|
+
tw("grow grid grid-cols-[auto_1fr] gap-x-3 items-center", { "cursor-pointer": collapsible }),
|
12558
12857
|
className
|
12559
12858
|
)
|
12560
12859
|
}), children);
|
12561
12860
|
};
|
12562
|
-
Section3.Toggle = (props) => /* @__PURE__ */
|
12861
|
+
Section3.Toggle = (props) => /* @__PURE__ */ React100.createElement(Icon, __spreadProps(__spreadValues({}, props), {
|
12563
12862
|
icon: import_caretUp2.default,
|
12564
12863
|
height: 22,
|
12565
12864
|
width: 22
|
12566
12865
|
}));
|
12567
12866
|
Section3.Title = (_a) => {
|
12568
12867
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
12569
|
-
return /* @__PURE__ */
|
12868
|
+
return /* @__PURE__ */ React100.createElement(Typography2.Large, __spreadProps(__spreadValues({}, rest), {
|
12570
12869
|
htmlTag: "h2",
|
12571
12870
|
color: "black",
|
12572
12871
|
className: "flex gap-3 items-center"
|
@@ -12574,54 +12873,26 @@ Section3.Title = (_a) => {
|
|
12574
12873
|
};
|
12575
12874
|
Section3.Subtitle = (_a) => {
|
12576
12875
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
12577
|
-
return /* @__PURE__ */
|
12876
|
+
return /* @__PURE__ */ React100.createElement(Typography2.Small, __spreadProps(__spreadValues({}, rest), {
|
12578
12877
|
color: "grey-70"
|
12579
12878
|
}), children);
|
12580
12879
|
};
|
12581
12880
|
Section3.Actions = (_a) => {
|
12582
12881
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12583
|
-
return /* @__PURE__ */
|
12882
|
+
return /* @__PURE__ */ React100.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12584
12883
|
className: classNames(tw("flex gap-4 justify-end"), className)
|
12585
12884
|
}), children);
|
12586
12885
|
};
|
12587
12886
|
Section3.Body = (_a) => {
|
12588
12887
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12589
|
-
return /* @__PURE__ */
|
12888
|
+
return /* @__PURE__ */ React100.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12590
12889
|
className: classNames(tw("p-6"), className)
|
12591
|
-
}), /* @__PURE__ */
|
12890
|
+
}), /* @__PURE__ */ React100.createElement(Typography, {
|
12592
12891
|
htmlTag: "div",
|
12593
12892
|
color: "grey-70"
|
12594
12893
|
}, children));
|
12595
12894
|
};
|
12596
12895
|
|
12597
|
-
// src/utils/useMeasure.ts
|
12598
|
-
import React99 from "react";
|
12599
|
-
function useMeasure() {
|
12600
|
-
const ref = React99.useRef(null);
|
12601
|
-
const [rect, setRect] = React99.useState({
|
12602
|
-
width: null,
|
12603
|
-
height: null
|
12604
|
-
});
|
12605
|
-
React99.useLayoutEffect(() => {
|
12606
|
-
if (!ref.current || !window.ResizeObserver) {
|
12607
|
-
return;
|
12608
|
-
}
|
12609
|
-
const observer = new window.ResizeObserver(([entry]) => {
|
12610
|
-
if (entry == null ? void 0 : entry.contentRect) {
|
12611
|
-
setRect({
|
12612
|
-
width: entry.contentRect.width,
|
12613
|
-
height: entry.contentRect.height
|
12614
|
-
});
|
12615
|
-
}
|
12616
|
-
});
|
12617
|
-
observer.observe(ref.current);
|
12618
|
-
return () => {
|
12619
|
-
observer.disconnect();
|
12620
|
-
};
|
12621
|
-
}, []);
|
12622
|
-
return [ref, rect];
|
12623
|
-
}
|
12624
|
-
|
12625
12896
|
// src/molecules/Section/Section.tsx
|
12626
12897
|
var import_more5 = __toESM(require_more());
|
12627
12898
|
var Section4 = (props) => {
|
@@ -12630,7 +12901,7 @@ var Section4 = (props) => {
|
|
12630
12901
|
const _collapsible = title ? (_a = props.collapsible) != null ? _a : false : false;
|
12631
12902
|
const _collapsed = title ? props.collapsed : void 0;
|
12632
12903
|
const _defaultCollapsed = title ? (_b = props.defaultCollapsed) != null ? _b : false : false;
|
12633
|
-
const [isCollapsed, setCollapsed] =
|
12904
|
+
const [isCollapsed, setCollapsed] = React101.useState(_collapsed != null ? _collapsed : _defaultCollapsed);
|
12634
12905
|
const [ref, { height }] = useMeasure();
|
12635
12906
|
const menu = title ? (_c = props.menu) != null ? _c : void 0 : void 0;
|
12636
12907
|
const menuAriaLabel = title ? (_e = (_d = props.menuAriaLabel) != null ? _d : props.menuLabel) != null ? _e : "Context menu" : void 0;
|
@@ -12651,7 +12922,7 @@ var Section4 = (props) => {
|
|
12651
12922
|
}
|
12652
12923
|
};
|
12653
12924
|
const targetHeight = isCollapsed ? "0px" : `${height != null ? height : 0}px`;
|
12654
|
-
const _f =
|
12925
|
+
const _f = useSpring3({
|
12655
12926
|
height: height !== null ? targetHeight : void 0,
|
12656
12927
|
opacity: isCollapsed ? 0 : 1,
|
12657
12928
|
transform: `rotate(${isCollapsed ? 180 : 0}deg)`,
|
@@ -12663,51 +12934,51 @@ var Section4 = (props) => {
|
|
12663
12934
|
}), { transform, backgroundColor } = _f, spring = __objRest(_f, ["transform", "backgroundColor"]);
|
12664
12935
|
const toggleId = useId3();
|
12665
12936
|
const regionId = useId3();
|
12666
|
-
return /* @__PURE__ */
|
12937
|
+
return /* @__PURE__ */ React101.createElement(Section3, {
|
12667
12938
|
"aria-label": title,
|
12668
12939
|
className: "Aquarium-Section"
|
12669
|
-
}, title && /* @__PURE__ */
|
12940
|
+
}, title && /* @__PURE__ */ React101.createElement(React101.Fragment, null, /* @__PURE__ */ React101.createElement(Section3.Header, {
|
12670
12941
|
collapsible: _collapsible
|
12671
|
-
}, /* @__PURE__ */
|
12942
|
+
}, /* @__PURE__ */ React101.createElement(Section3.TitleContainer, {
|
12672
12943
|
role: _collapsible ? "button" : void 0,
|
12673
12944
|
id: toggleId,
|
12674
12945
|
collapsible: _collapsible,
|
12675
12946
|
onClick: handleTitleClick,
|
12676
12947
|
"aria-expanded": !isCollapsed,
|
12677
12948
|
"aria-controls": regionId
|
12678
|
-
}, _collapsible && /* @__PURE__ */
|
12949
|
+
}, _collapsible && /* @__PURE__ */ React101.createElement(animated4.div, {
|
12679
12950
|
style: { transform }
|
12680
|
-
}, /* @__PURE__ */
|
12951
|
+
}, /* @__PURE__ */ React101.createElement(Section3.Toggle, null)), /* @__PURE__ */ React101.createElement(Section3.Title, null, /* @__PURE__ */ React101.createElement(LineClamp2, {
|
12681
12952
|
lines: 1
|
12682
|
-
}, title), props.tag && /* @__PURE__ */
|
12953
|
+
}, title), props.tag && /* @__PURE__ */ React101.createElement(TagLabel, __spreadValues({}, props.tag)), props.badge && /* @__PURE__ */ React101.createElement(Chip2, {
|
12683
12954
|
text: props.badge
|
12684
|
-
}), props.chip && /* @__PURE__ */
|
12955
|
+
}), props.chip && /* @__PURE__ */ React101.createElement(StatusChip, __spreadValues({}, props.chip))), subtitle && /* @__PURE__ */ React101.createElement(Section3.Subtitle, {
|
12685
12956
|
className: tw("row-start-2", { "col-start-2": _collapsible })
|
12686
|
-
}, /* @__PURE__ */
|
12957
|
+
}, /* @__PURE__ */ React101.createElement(LineClamp2, {
|
12687
12958
|
lines: 1
|
12688
|
-
}, subtitle))), !isCollapsed && /* @__PURE__ */
|
12959
|
+
}, subtitle))), !isCollapsed && /* @__PURE__ */ React101.createElement(Section3.Actions, null, menu && /* @__PURE__ */ React101.createElement(Box.Flex, {
|
12689
12960
|
alignItems: "center"
|
12690
|
-
}, /* @__PURE__ */
|
12961
|
+
}, /* @__PURE__ */ React101.createElement(DropdownMenu2, {
|
12691
12962
|
onAction: (action) => onAction == null ? void 0 : onAction(action),
|
12692
12963
|
onOpenChange: onMenuOpenChange
|
12693
|
-
}, /* @__PURE__ */
|
12964
|
+
}, /* @__PURE__ */ React101.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ React101.createElement(Button.Icon, {
|
12694
12965
|
"aria-label": menuAriaLabel,
|
12695
12966
|
icon: import_more5.default
|
12696
|
-
})), menu)), actions && castArray4(actions).filter(Boolean).map((action) => renderAction("secondary", action)), props.switch && /* @__PURE__ */
|
12967
|
+
})), menu)), actions && castArray4(actions).filter(Boolean).map((action) => renderAction("secondary", action)), props.switch && /* @__PURE__ */ React101.createElement(Switch2, __spreadValues({}, props.switch)))), /* @__PURE__ */ React101.createElement(animated4.div, {
|
12697
12968
|
className: tw(`h-[1px]`),
|
12698
12969
|
style: { backgroundColor }
|
12699
|
-
})), /* @__PURE__ */
|
12970
|
+
})), /* @__PURE__ */ React101.createElement(animated4.div, {
|
12700
12971
|
id: regionId,
|
12701
12972
|
"aria-hidden": isCollapsed ? true : void 0,
|
12702
12973
|
style: spring,
|
12703
12974
|
className: tw({ "overflow-hidden": _collapsible })
|
12704
|
-
}, /* @__PURE__ */
|
12975
|
+
}, /* @__PURE__ */ React101.createElement("div", {
|
12705
12976
|
ref
|
12706
|
-
}, /* @__PURE__ */
|
12977
|
+
}, /* @__PURE__ */ React101.createElement(Section3.Body, null, children))));
|
12707
12978
|
};
|
12708
12979
|
|
12709
12980
|
// src/molecules/SegmentedControl/SegmentedControl.tsx
|
12710
|
-
import
|
12981
|
+
import React102 from "react";
|
12711
12982
|
var SegmentedControl = (_a) => {
|
12712
12983
|
var _b = _a, {
|
12713
12984
|
children,
|
@@ -12724,7 +12995,7 @@ var SegmentedControl = (_a) => {
|
|
12724
12995
|
"selected",
|
12725
12996
|
"className"
|
12726
12997
|
]);
|
12727
|
-
return /* @__PURE__ */
|
12998
|
+
return /* @__PURE__ */ React102.createElement("li", null, /* @__PURE__ */ React102.createElement("button", __spreadProps(__spreadValues({
|
12728
12999
|
type: "button"
|
12729
13000
|
}, rest), {
|
12730
13001
|
className: classNames(
|
@@ -12758,12 +13029,12 @@ var SegmentedControlGroup = (_a) => {
|
|
12758
13029
|
"border border-grey-20 text-grey-50": variant === "outlined",
|
12759
13030
|
"bg-grey-0": variant === "raised"
|
12760
13031
|
});
|
12761
|
-
return /* @__PURE__ */
|
13032
|
+
return /* @__PURE__ */ React102.createElement("ul", __spreadProps(__spreadValues({}, rest), {
|
12762
13033
|
"aria-label": ariaLabel,
|
12763
13034
|
className: classNames("Aquarium-SegmentedControl", classes2, className)
|
12764
|
-
}),
|
13035
|
+
}), React102.Children.map(
|
12765
13036
|
children,
|
12766
|
-
(child) =>
|
13037
|
+
(child) => React102.cloneElement(child, {
|
12767
13038
|
dense,
|
12768
13039
|
variant,
|
12769
13040
|
onClick: () => onChange(child.props.value),
|
@@ -12801,14 +13072,14 @@ var getCommonClassNames = (dense, selected) => tw(
|
|
12801
13072
|
);
|
12802
13073
|
|
12803
13074
|
// src/molecules/Stepper/Stepper.tsx
|
12804
|
-
import
|
13075
|
+
import React104 from "react";
|
12805
13076
|
|
12806
13077
|
// src/atoms/Stepper/Stepper.tsx
|
12807
|
-
import
|
13078
|
+
import React103 from "react";
|
12808
13079
|
var import_tick6 = __toESM(require_tick());
|
12809
13080
|
var Stepper = (_a) => {
|
12810
13081
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
12811
|
-
return /* @__PURE__ */
|
13082
|
+
return /* @__PURE__ */ React103.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12812
13083
|
className: classNames(className)
|
12813
13084
|
}));
|
12814
13085
|
};
|
@@ -12822,7 +13093,7 @@ var ConnectorContainer = (_a) => {
|
|
12822
13093
|
"completed",
|
12823
13094
|
"dense"
|
12824
13095
|
]);
|
12825
|
-
return /* @__PURE__ */
|
13096
|
+
return /* @__PURE__ */ React103.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12826
13097
|
className: classNames(
|
12827
13098
|
tw("absolute w-full -left-1/2", {
|
12828
13099
|
"top-[3px] px-[14px]": Boolean(dense),
|
@@ -12834,7 +13105,7 @@ var ConnectorContainer = (_a) => {
|
|
12834
13105
|
};
|
12835
13106
|
var Connector = (_a) => {
|
12836
13107
|
var _b = _a, { children, className, completed, dense } = _b, rest = __objRest(_b, ["children", "className", "completed", "dense"]);
|
12837
|
-
return /* @__PURE__ */
|
13108
|
+
return /* @__PURE__ */ React103.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12838
13109
|
className: classNames(
|
12839
13110
|
tw("w-full", {
|
12840
13111
|
"bg-grey-20": !completed,
|
@@ -12848,7 +13119,7 @@ var Connector = (_a) => {
|
|
12848
13119
|
};
|
12849
13120
|
var Step = (_a) => {
|
12850
13121
|
var _b = _a, { className, state } = _b, rest = __objRest(_b, ["className", "state"]);
|
12851
|
-
return /* @__PURE__ */
|
13122
|
+
return /* @__PURE__ */ React103.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12852
13123
|
className: classNames(
|
12853
13124
|
tw("flex flex-col items-center text-grey-90 relative text-center", {
|
12854
13125
|
"text-grey-20": state === "inactive"
|
@@ -12869,13 +13140,13 @@ var getDenseClassNames = (state) => tw("h-[8px] w-[8px]", {
|
|
12869
13140
|
});
|
12870
13141
|
var Indicator = (_a) => {
|
12871
13142
|
var _b = _a, { children, className, state, dense } = _b, rest = __objRest(_b, ["children", "className", "state", "dense"]);
|
12872
|
-
return /* @__PURE__ */
|
13143
|
+
return /* @__PURE__ */ React103.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12873
13144
|
className: classNames(
|
12874
13145
|
tw("rounded-full flex justify-center items-center mx-2 mb-3"),
|
12875
13146
|
dense ? getDenseClassNames(state) : getClassNames(state),
|
12876
13147
|
className
|
12877
13148
|
)
|
12878
|
-
}), state === "completed" ? /* @__PURE__ */
|
13149
|
+
}), state === "completed" ? /* @__PURE__ */ React103.createElement(InlineIcon, {
|
12879
13150
|
icon: import_tick6.default
|
12880
13151
|
}) : dense ? null : children);
|
12881
13152
|
};
|
@@ -12886,26 +13157,26 @@ Stepper.ConnectorContainer = ConnectorContainer;
|
|
12886
13157
|
|
12887
13158
|
// src/molecules/Stepper/Stepper.tsx
|
12888
13159
|
var Stepper2 = ({ children, activeIndex, dense }) => {
|
12889
|
-
const steps =
|
12890
|
-
return /* @__PURE__ */
|
13160
|
+
const steps = React104.Children.count(children);
|
13161
|
+
return /* @__PURE__ */ React104.createElement(Stepper, {
|
12891
13162
|
role: "list",
|
12892
13163
|
className: "Aquarium-Stepper"
|
12893
|
-
}, /* @__PURE__ */
|
13164
|
+
}, /* @__PURE__ */ React104.createElement(Template, {
|
12894
13165
|
columns: steps
|
12895
|
-
},
|
13166
|
+
}, React104.Children.map(children, (child, index) => {
|
12896
13167
|
if (!isComponentType(child, Step2)) {
|
12897
13168
|
return new Error("<Stepper> can only have <Stepper.Step> components as children");
|
12898
13169
|
} else {
|
12899
13170
|
const state = index > activeIndex ? "inactive" : index === activeIndex ? "active" : "completed";
|
12900
|
-
return /* @__PURE__ */
|
13171
|
+
return /* @__PURE__ */ React104.createElement(Stepper.Step, {
|
12901
13172
|
state,
|
12902
13173
|
"aria-current": state === "active" ? "step" : false,
|
12903
13174
|
role: "listitem"
|
12904
|
-
}, index > 0 && index <= steps && /* @__PURE__ */
|
13175
|
+
}, index > 0 && index <= steps && /* @__PURE__ */ React104.createElement(Stepper.ConnectorContainer, {
|
12905
13176
|
dense
|
12906
|
-
}, /* @__PURE__ */
|
13177
|
+
}, /* @__PURE__ */ React104.createElement(Stepper.ConnectorContainer.Connector, {
|
12907
13178
|
completed: state === "completed" || state === "active"
|
12908
|
-
})), /* @__PURE__ */
|
13179
|
+
})), /* @__PURE__ */ React104.createElement(Stepper.Step.Indicator, {
|
12909
13180
|
state,
|
12910
13181
|
dense
|
12911
13182
|
}, index + 1), child.props.children);
|
@@ -12918,7 +13189,7 @@ Step2.displayName = "Stepper.Step";
|
|
12918
13189
|
Stepper2.Step = Step2;
|
12919
13190
|
|
12920
13191
|
// src/molecules/SwitchGroup/SwitchGroup.tsx
|
12921
|
-
import
|
13192
|
+
import React105, { useState as useState13 } from "react";
|
12922
13193
|
import uniqueId9 from "lodash/uniqueId";
|
12923
13194
|
var SwitchGroup = (_a) => {
|
12924
13195
|
var _b = _a, {
|
@@ -12937,7 +13208,7 @@ var SwitchGroup = (_a) => {
|
|
12937
13208
|
"children"
|
12938
13209
|
]);
|
12939
13210
|
var _a2;
|
12940
|
-
const [selectedItems, setSelectedItems] =
|
13211
|
+
const [selectedItems, setSelectedItems] = useState13((_a2 = value != null ? value : defaultValue) != null ? _a2 : []);
|
12941
13212
|
if (value !== void 0 && value !== selectedItems) {
|
12942
13213
|
setSelectedItems(value);
|
12943
13214
|
}
|
@@ -12950,13 +13221,13 @@ var SwitchGroup = (_a) => {
|
|
12950
13221
|
setSelectedItems(updated);
|
12951
13222
|
onChange == null ? void 0 : onChange(updated);
|
12952
13223
|
};
|
12953
|
-
return /* @__PURE__ */
|
13224
|
+
return /* @__PURE__ */ React105.createElement(LabelControl, __spreadProps(__spreadValues(__spreadValues({
|
12954
13225
|
fieldset: true
|
12955
13226
|
}, labelControlProps), errorProps), {
|
12956
13227
|
className: "Aquarium-SwitchGroup"
|
12957
|
-
}), /* @__PURE__ */
|
13228
|
+
}), /* @__PURE__ */ React105.createElement(InputGroup, {
|
12958
13229
|
cols
|
12959
|
-
},
|
13230
|
+
}, React105.Children.map(children, (c) => {
|
12960
13231
|
var _a3, _b2, _c, _d;
|
12961
13232
|
if (!isComponentType(c, Switch2)) {
|
12962
13233
|
return null;
|
@@ -12964,7 +13235,7 @@ var SwitchGroup = (_a) => {
|
|
12964
13235
|
const str = (_a3 = c.props.value) == null ? void 0 : _a3.toString();
|
12965
13236
|
const defaultChecked = defaultValue === void 0 ? void 0 : str !== void 0 && defaultValue.includes(str);
|
12966
13237
|
const checked = value === void 0 ? void 0 : str !== void 0 && value.includes(str);
|
12967
|
-
return
|
13238
|
+
return React105.cloneElement(c, {
|
12968
13239
|
defaultChecked: (_b2 = c.props.defaultChecked) != null ? _b2 : defaultChecked,
|
12969
13240
|
checked: (_c = c.props.checked) != null ? _c : checked,
|
12970
13241
|
onChange: (_d = c.props.onChange) != null ? _d : handleChange,
|
@@ -12974,9 +13245,9 @@ var SwitchGroup = (_a) => {
|
|
12974
13245
|
})));
|
12975
13246
|
};
|
12976
13247
|
var SwitchGroupSkeleton = ({ options = 2 }) => {
|
12977
|
-
return /* @__PURE__ */
|
13248
|
+
return /* @__PURE__ */ React105.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React105.createElement("div", {
|
12978
13249
|
className: tw("flex flex-wrap flex-col gap-2")
|
12979
|
-
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */
|
13250
|
+
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */ React105.createElement(Switch2.Skeleton, {
|
12980
13251
|
key
|
12981
13252
|
}))));
|
12982
13253
|
};
|
@@ -12984,14 +13255,14 @@ SwitchGroup.Skeleton = SwitchGroupSkeleton;
|
|
12984
13255
|
SwitchGroup.Skeleton.displayName = "SwitchGroup.Skeleton";
|
12985
13256
|
|
12986
13257
|
// src/molecules/Textarea/Textarea.tsx
|
12987
|
-
import
|
13258
|
+
import React106, { useRef as useRef13, useState as useState14 } from "react";
|
12988
13259
|
import omit15 from "lodash/omit";
|
12989
13260
|
import toString2 from "lodash/toString";
|
12990
13261
|
import uniqueId10 from "lodash/uniqueId";
|
12991
|
-
var TextareaBase =
|
13262
|
+
var TextareaBase = React106.forwardRef(
|
12992
13263
|
(_a, ref) => {
|
12993
13264
|
var _b = _a, { readOnly = false, valid = true } = _b, props = __objRest(_b, ["readOnly", "valid"]);
|
12994
|
-
return /* @__PURE__ */
|
13265
|
+
return /* @__PURE__ */ React106.createElement("textarea", __spreadProps(__spreadValues({
|
12995
13266
|
ref
|
12996
13267
|
}, props), {
|
12997
13268
|
readOnly,
|
@@ -12999,25 +13270,25 @@ var TextareaBase = React105.forwardRef(
|
|
12999
13270
|
}));
|
13000
13271
|
}
|
13001
13272
|
);
|
13002
|
-
TextareaBase.Skeleton = () => /* @__PURE__ */
|
13273
|
+
TextareaBase.Skeleton = () => /* @__PURE__ */ React106.createElement(Skeleton, {
|
13003
13274
|
height: 58
|
13004
13275
|
});
|
13005
|
-
var Textarea =
|
13276
|
+
var Textarea = React106.forwardRef((props, ref) => {
|
13006
13277
|
var _a, _b, _c;
|
13007
|
-
const [value, setValue] =
|
13278
|
+
const [value, setValue] = useState14((_b = (_a = props.value) != null ? _a : props.defaultValue) != null ? _b : "");
|
13008
13279
|
const id = useRef13((_c = props.id) != null ? _c : `textarea-${uniqueId10()}`);
|
13009
13280
|
const errorMessageId = uniqueId10();
|
13010
13281
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
13011
13282
|
const _d = getLabelControlProps(props), { "data-testid": dataTestId } = _d, labelControlProps = __objRest(_d, ["data-testid"]);
|
13012
13283
|
const baseProps = omit15(props, Object.keys(labelControlProps));
|
13013
|
-
return /* @__PURE__ */
|
13284
|
+
return /* @__PURE__ */ React106.createElement(LabelControl, __spreadProps(__spreadValues({
|
13014
13285
|
id: `${id.current}-label`,
|
13015
13286
|
htmlFor: id.current,
|
13016
13287
|
messageId: errorMessageId,
|
13017
13288
|
length: value !== void 0 ? toString2(value).length : void 0
|
13018
13289
|
}, labelControlProps), {
|
13019
13290
|
className: "Aquarium-Textarea"
|
13020
|
-
}), /* @__PURE__ */
|
13291
|
+
}), /* @__PURE__ */ React106.createElement(TextareaBase, __spreadProps(__spreadValues(__spreadValues({
|
13021
13292
|
ref
|
13022
13293
|
}, baseProps), errorProps), {
|
13023
13294
|
id: id.current,
|
@@ -13029,53 +13300,53 @@ var Textarea = React105.forwardRef((props, ref) => {
|
|
13029
13300
|
},
|
13030
13301
|
disabled: props.disabled,
|
13031
13302
|
maxLength: props.maxLength,
|
13032
|
-
required: props.required,
|
13303
|
+
"aria-required": props.required,
|
13033
13304
|
valid: props.valid
|
13034
13305
|
})));
|
13035
13306
|
});
|
13036
13307
|
Textarea.displayName = "Textarea";
|
13037
|
-
var TextAreaSkeleton = () => /* @__PURE__ */
|
13308
|
+
var TextAreaSkeleton = () => /* @__PURE__ */ React106.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React106.createElement(TextareaBase.Skeleton, null));
|
13038
13309
|
Textarea.Skeleton = TextAreaSkeleton;
|
13039
13310
|
Textarea.Skeleton.displayName = "Textarea.Skeleton";
|
13040
13311
|
|
13041
13312
|
// src/molecules/Timeline/Timeline.tsx
|
13042
|
-
import
|
13313
|
+
import React108 from "react";
|
13043
13314
|
|
13044
13315
|
// src/atoms/Timeline/Timeline.tsx
|
13045
|
-
import
|
13316
|
+
import React107 from "react";
|
13046
13317
|
var Timeline = (_a) => {
|
13047
13318
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13048
|
-
return /* @__PURE__ */
|
13319
|
+
return /* @__PURE__ */ React107.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13049
13320
|
className: classNames(tw("grid grid-cols-[16px_1fr] gap-x-4"), className)
|
13050
13321
|
}));
|
13051
13322
|
};
|
13052
13323
|
var Content2 = (_a) => {
|
13053
13324
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13054
|
-
return /* @__PURE__ */
|
13325
|
+
return /* @__PURE__ */ React107.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13055
13326
|
className: classNames(tw("pb-6"), className)
|
13056
13327
|
}));
|
13057
13328
|
};
|
13058
13329
|
var Separator2 = (_a) => {
|
13059
13330
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13060
|
-
return /* @__PURE__ */
|
13331
|
+
return /* @__PURE__ */ React107.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13061
13332
|
className: classNames(tw("flex items-center justify-center h-5 w-5"), className)
|
13062
13333
|
}));
|
13063
13334
|
};
|
13064
13335
|
var LineContainer = (_a) => {
|
13065
13336
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13066
|
-
return /* @__PURE__ */
|
13337
|
+
return /* @__PURE__ */ React107.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13067
13338
|
className: classNames(tw("flex justify-center py-1"), className)
|
13068
13339
|
}));
|
13069
13340
|
};
|
13070
13341
|
var Line = (_a) => {
|
13071
13342
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13072
|
-
return /* @__PURE__ */
|
13343
|
+
return /* @__PURE__ */ React107.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13073
13344
|
className: classNames(tw("w-1 bg-grey-5 h-full justify-self-center"), className)
|
13074
13345
|
}));
|
13075
13346
|
};
|
13076
13347
|
var Dot = (_a) => {
|
13077
13348
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13078
|
-
return /* @__PURE__ */
|
13349
|
+
return /* @__PURE__ */ React107.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13079
13350
|
className: classNames(tw("bg-grey-30 h-[6px] w-[6px] rounded"), className)
|
13080
13351
|
}));
|
13081
13352
|
};
|
@@ -13090,54 +13361,54 @@ var import_error5 = __toESM(require_error());
|
|
13090
13361
|
var import_time2 = __toESM(require_time());
|
13091
13362
|
var import_warningSign5 = __toESM(require_warningSign());
|
13092
13363
|
var TimelineItem = () => null;
|
13093
|
-
var Timeline2 = ({ children }) => /* @__PURE__ */
|
13364
|
+
var Timeline2 = ({ children }) => /* @__PURE__ */ React108.createElement("div", {
|
13094
13365
|
className: "Aquarium-Timeline"
|
13095
|
-
},
|
13366
|
+
}, React108.Children.map(children, (item) => {
|
13096
13367
|
if (!isComponentType(item, TimelineItem)) {
|
13097
13368
|
throw new Error("<Timeline> can only have <Timeline.Item> components as children");
|
13098
13369
|
} else {
|
13099
13370
|
const { props, key } = item;
|
13100
|
-
return /* @__PURE__ */
|
13371
|
+
return /* @__PURE__ */ React108.createElement(Timeline, {
|
13101
13372
|
key: key != null ? key : props.title
|
13102
|
-
}, /* @__PURE__ */
|
13373
|
+
}, /* @__PURE__ */ React108.createElement(Timeline.Separator, null, props.variant === "error" ? /* @__PURE__ */ React108.createElement(Icon, {
|
13103
13374
|
icon: import_error5.default,
|
13104
13375
|
color: "error-30"
|
13105
|
-
}) : props.variant === "warning" ? /* @__PURE__ */
|
13376
|
+
}) : props.variant === "warning" ? /* @__PURE__ */ React108.createElement(Icon, {
|
13106
13377
|
icon: import_warningSign5.default,
|
13107
13378
|
color: "warning-30"
|
13108
|
-
}) : props.variant === "info" ? /* @__PURE__ */
|
13379
|
+
}) : props.variant === "info" ? /* @__PURE__ */ React108.createElement(Icon, {
|
13109
13380
|
icon: import_time2.default,
|
13110
13381
|
color: "info-30"
|
13111
|
-
}) : /* @__PURE__ */
|
13382
|
+
}) : /* @__PURE__ */ React108.createElement(Timeline.Separator.Dot, null)), /* @__PURE__ */ React108.createElement(Typography2.Caption, {
|
13112
13383
|
color: "grey-50"
|
13113
|
-
}, props.title), /* @__PURE__ */
|
13384
|
+
}, props.title), /* @__PURE__ */ React108.createElement(Timeline.LineContainer, null, /* @__PURE__ */ React108.createElement(Timeline.LineContainer.Line, null)), /* @__PURE__ */ React108.createElement(Timeline.Content, null, /* @__PURE__ */ React108.createElement(Typography2.Small, null, props.children)));
|
13114
13385
|
}
|
13115
13386
|
}));
|
13116
|
-
var TimelineItemSkeleton = () => /* @__PURE__ */
|
13387
|
+
var TimelineItemSkeleton = () => /* @__PURE__ */ React108.createElement(Timeline, null, /* @__PURE__ */ React108.createElement(Timeline.Separator, null, /* @__PURE__ */ React108.createElement(Skeleton, {
|
13117
13388
|
width: 6,
|
13118
13389
|
height: 6,
|
13119
13390
|
rounded: true
|
13120
|
-
})), /* @__PURE__ */
|
13391
|
+
})), /* @__PURE__ */ React108.createElement(Skeleton, {
|
13121
13392
|
height: 12,
|
13122
13393
|
width: 120
|
13123
|
-
}), /* @__PURE__ */
|
13394
|
+
}), /* @__PURE__ */ React108.createElement(Timeline.LineContainer, null, /* @__PURE__ */ React108.createElement(Skeleton, {
|
13124
13395
|
width: 2,
|
13125
13396
|
height: "100%"
|
13126
|
-
})), /* @__PURE__ */
|
13397
|
+
})), /* @__PURE__ */ React108.createElement(Timeline.Content, null, /* @__PURE__ */ React108.createElement(Box, {
|
13127
13398
|
display: "flex",
|
13128
13399
|
flexDirection: "column",
|
13129
13400
|
gap: "3"
|
13130
|
-
}, /* @__PURE__ */
|
13401
|
+
}, /* @__PURE__ */ React108.createElement(Skeleton, {
|
13131
13402
|
height: 32,
|
13132
13403
|
width: "100%"
|
13133
|
-
}), /* @__PURE__ */
|
13404
|
+
}), /* @__PURE__ */ React108.createElement(Skeleton, {
|
13134
13405
|
height: 32,
|
13135
13406
|
width: "73%"
|
13136
|
-
}), /* @__PURE__ */
|
13407
|
+
}), /* @__PURE__ */ React108.createElement(Skeleton, {
|
13137
13408
|
height: 32,
|
13138
13409
|
width: "80%"
|
13139
13410
|
}))));
|
13140
|
-
var TimelineSkeleton = ({ items = 3 }) => /* @__PURE__ */
|
13411
|
+
var TimelineSkeleton = ({ items = 3 }) => /* @__PURE__ */ React108.createElement("div", null, Array.from({ length: items }).map((_, key) => /* @__PURE__ */ React108.createElement(TimelineItemSkeleton, {
|
13141
13412
|
key
|
13142
13413
|
})));
|
13143
13414
|
Timeline2.Item = TimelineItem;
|
@@ -13145,9 +13416,9 @@ Timeline2.Skeleton = TimelineSkeleton;
|
|
13145
13416
|
Timeline2.Skeleton.displayName = "Timeline.Skeleton";
|
13146
13417
|
|
13147
13418
|
// src/utils/table/useTableSelect.ts
|
13148
|
-
import
|
13419
|
+
import React109 from "react";
|
13149
13420
|
var useTableSelect = (data, { key }) => {
|
13150
|
-
const [selected, setSelected] =
|
13421
|
+
const [selected, setSelected] = React109.useState([]);
|
13151
13422
|
const allSelected = selected.length === data.length;
|
13152
13423
|
const isSelected = (dot) => selected.includes(dot[key]);
|
13153
13424
|
const selectAll = () => setSelected(data.map((dot) => dot[key]));
|