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