@aivenio/aquarium 1.22.0 → 1.24.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 +2 -2
- package/dist/_variables_timescale.scss +2 -2
- package/dist/atoms.cjs +251 -150
- package/dist/atoms.mjs +251 -150
- package/dist/src/atoms/DropdownMenu/DropdownMenu.d.ts +1 -0
- package/dist/src/atoms/DropdownMenu/DropdownMenu.js +6 -3
- package/dist/src/icons/loading.js +3 -3
- package/dist/src/molecules/Alert/Alert.js +2 -2
- package/dist/src/molecules/Badge/Badge.d.ts +5 -0
- package/dist/src/molecules/Badge/Badge.js +8 -1
- package/dist/src/molecules/Banner/Banner.d.ts +3 -3
- package/dist/src/molecules/Banner/Banner.js +4 -2
- package/dist/src/molecules/DataList/DataList.d.ts +8 -2
- package/dist/src/molecules/DataList/DataList.js +5 -3
- package/dist/src/molecules/DataList/DataListSkeleton.d.ts +8 -0
- package/dist/src/molecules/DataList/DataListSkeleton.js +15 -0
- package/dist/src/molecules/DataTable/DataTable.d.ts +8 -2
- package/dist/src/molecules/DataTable/DataTable.js +5 -3
- package/dist/src/molecules/DropdownMenu/DropdownMenu.d.ts +4 -0
- package/dist/src/molecules/DropdownMenu/DropdownMenu.js +3 -3
- package/dist/src/molecules/EmptyState/EmptyState.d.ts +5 -3
- package/dist/src/molecules/EmptyState/EmptyState.js +8 -3
- package/dist/src/molecules/ListItem/ListItem.js +3 -3
- package/dist/src/molecules/Navigation/Navigation.d.ts +6 -2
- package/dist/src/molecules/Navigation/Navigation.js +6 -3
- package/dist/src/molecules/PageHeader/PageHeader.d.ts +5 -3
- package/dist/src/molecules/PageHeader/PageHeader.js +6 -17
- package/dist/src/molecules/Section/Section.d.ts +3 -2
- package/dist/src/molecules/Section/Section.js +4 -16
- package/dist/src/molecules/Toast/Toast.d.ts +7 -1
- package/dist/src/molecules/Toast/Toast.js +2 -2
- package/dist/src/utils/ContrastRatio.d.ts +11 -0
- package/dist/src/utils/ContrastRatio.js +54 -0
- package/dist/src/utils/link.d.ts +2 -0
- package/dist/src/utils/link.js +2 -0
- package/dist/src/utils/table/types.d.ts +4 -0
- package/dist/styles.css +17 -13
- package/dist/styles_timescaledb.css +17 -13
- package/dist/system.cjs +575 -487
- package/dist/system.mjs +534 -447
- package/dist/tailwind.config.js +0 -3
- package/dist/tailwind.theme.json +2 -2
- package/dist/tokens.json +4 -2
- package/dist/tsconfig.module.tsbuildinfo +1 -1
- package/dist/types/ActionType.d.ts +1 -0
- package/dist/types/tailwindGenerated.d.ts +1 -1
- package/package.json +1 -1
package/dist/system.mjs
CHANGED
@@ -164,7 +164,8 @@ var require_tokens = __commonJS({
|
|
164
164
|
"primary-20": "#b4e5fb",
|
165
165
|
"primary-10": "#e0f5fe",
|
166
166
|
"primary-5": "#effaff",
|
167
|
-
"primary-0": "#f9fdff"
|
167
|
+
"primary-0": "#f9fdff",
|
168
|
+
"navyBlue-100": "#30375e"
|
168
169
|
},
|
169
170
|
typography: {
|
170
171
|
sizes: [
|
@@ -724,7 +725,8 @@ var require_tokens = __commonJS({
|
|
724
725
|
"primary-10": "#ffdeef",
|
725
726
|
"primary-5": "#ffe8f4",
|
726
727
|
"primary-0": "#fff9fc",
|
727
|
-
"grey-20": "#d2d2d6"
|
728
|
+
"grey-20": "#d2d2d6",
|
729
|
+
"navyBlue-100": "#30375e"
|
728
730
|
},
|
729
731
|
typography: {
|
730
732
|
sizes: [
|
@@ -3561,11 +3563,11 @@ var require_loading = __commonJS({
|
|
3561
3563
|
"src/icons/loading.js"(exports) {
|
3562
3564
|
"use strict";
|
3563
3565
|
var data = {
|
3564
|
-
"body": '<g fill="none" fill-rule="evenodd" stroke="currentColor" stroke-width="
|
3566
|
+
"body": '<g fill="none" fill-rule="evenodd" stroke="currentColor" stroke-width="2" transform="translate(1 1)"><circle cx="18" cy="18" r="18" stroke-opacity=".5"/><path d="M36 18c0-9.94-8.06-18-18-18"><animateTransform attributeName="transform" dur="1s" from="0 18 18" repeatCount="indefinite" to="360 18 18" type="rotate"/></path></g>',
|
3565
3567
|
"left": 0,
|
3566
3568
|
"top": 0,
|
3567
|
-
"width":
|
3568
|
-
"height":
|
3569
|
+
"width": 38,
|
3570
|
+
"height": 38
|
3569
3571
|
};
|
3570
3572
|
exports.__esModule = true;
|
3571
3573
|
exports.default = data;
|
@@ -5052,6 +5054,7 @@ __export(molecules_exports, {
|
|
5052
5054
|
Textarea: () => Textarea,
|
5053
5055
|
TextareaBase: () => TextareaBase,
|
5054
5056
|
Timeline: () => Timeline2,
|
5057
|
+
ToastComponent: () => ToastComponent,
|
5055
5058
|
ToastProvider: () => ToastProvider,
|
5056
5059
|
Tooltip: () => Tooltip,
|
5057
5060
|
Typography: () => Typography2,
|
@@ -5669,11 +5672,11 @@ var tailwind_theme_default = {
|
|
5669
5672
|
"primary-5": "var(--aquarium-colors-primary-5, #ffe8f4)",
|
5670
5673
|
"primary-0": "var(--aquarium-colors-primary-0, #fff9fc)",
|
5671
5674
|
"grey-20": "var(--aquarium-colors-grey-20, #d2d2d6)",
|
5675
|
+
"navyBlue-100": "var(--aquarium-colors-navyBlue-100, #30375e)",
|
5672
5676
|
transparent: "var(--aquarium-colors-transparent, transparent)",
|
5673
5677
|
white: "var(--aquarium-colors-white, white)",
|
5674
5678
|
black: "var(--aquarium-colors-black, black)",
|
5675
|
-
current: "var(--aquarium-colors-current, currentColor)"
|
5676
|
-
"navyBlue-100": "#30375E"
|
5679
|
+
current: "var(--aquarium-colors-current, currentColor)"
|
5677
5680
|
},
|
5678
5681
|
gap: {
|
5679
5682
|
"0": "0",
|
@@ -7355,8 +7358,10 @@ Alert.Dismiss = (_a) => {
|
|
7355
7358
|
})));
|
7356
7359
|
};
|
7357
7360
|
|
7358
|
-
// src/
|
7361
|
+
// src/utils/link.ts
|
7359
7362
|
var isLink = (action) => action.href !== void 0;
|
7363
|
+
|
7364
|
+
// src/molecules/Alert/Alert.tsx
|
7360
7365
|
var Alert2 = ({ description, type, title, onDismiss, children, action }) => /* @__PURE__ */ React18.createElement(Alert, {
|
7361
7366
|
className: "Aquarium-Alert",
|
7362
7367
|
type,
|
@@ -7477,7 +7482,21 @@ var createBadge = (type, displayName) => {
|
|
7477
7482
|
Component.Skeleton.displayName = `${displayName}.Skeleton`;
|
7478
7483
|
return Component;
|
7479
7484
|
};
|
7485
|
+
var NotificationBadge = ({
|
7486
|
+
children,
|
7487
|
+
top = "-2px",
|
7488
|
+
right = "-2px"
|
7489
|
+
}) => {
|
7490
|
+
return /* @__PURE__ */ React21.createElement("div", {
|
7491
|
+
className: tw("relative inline-flex")
|
7492
|
+
}, children, /* @__PURE__ */ React21.createElement("span", {
|
7493
|
+
style: { top, right },
|
7494
|
+
className: tw("absolute rounded-full w-[6px] h-[6px] bg-error-70")
|
7495
|
+
}));
|
7496
|
+
};
|
7480
7497
|
var Badge = createBadge("default", "Badge");
|
7498
|
+
Badge.Notification = NotificationBadge;
|
7499
|
+
Badge.Notification.displayName = "Badge.Notification";
|
7481
7500
|
var TabBadge = createBadge("tab", "TabBadge");
|
7482
7501
|
var ChipBadge = createBadge("chip", "ChipBadge");
|
7483
7502
|
|
@@ -7596,8 +7615,11 @@ var createBanner = (displayName, opts = {}) => {
|
|
7596
7615
|
flexGrow: isDismissable ? false : true
|
7597
7616
|
}, children || description), action && /* @__PURE__ */ React23.createElement(Banner.Actions, {
|
7598
7617
|
layout
|
7599
|
-
}, /* @__PURE__ */ React23.createElement(Button.Ghost, __spreadValues({
|
7618
|
+
}, !isLink(action) && /* @__PURE__ */ React23.createElement(Button.Ghost, __spreadValues({
|
7600
7619
|
dense: true
|
7620
|
+
}, omit3(action, "text")), action.text), isLink(action) && /* @__PURE__ */ React23.createElement(Button.ExternalLink, __spreadValues({
|
7621
|
+
dense: true,
|
7622
|
+
kind: "ghost"
|
7601
7623
|
}, omit3(action, "text")), action.text))), (props.layout === "vertical" || props.layout === void 0) && props.image !== void 0 && /* @__PURE__ */ React23.createElement(Banner.ImageContainer, null, props.image ? /* @__PURE__ */ React23.createElement("img", {
|
7602
7624
|
src: props.image,
|
7603
7625
|
alt: props.imageAlt,
|
@@ -9127,7 +9149,7 @@ var Container2 = ({ maxWidth = "xl", children }) => /* @__PURE__ */ React47.crea
|
|
9127
9149
|
}, children);
|
9128
9150
|
|
9129
9151
|
// src/molecules/DataList/DataList.tsx
|
9130
|
-
import
|
9152
|
+
import React59 from "react";
|
9131
9153
|
import compact from "lodash/compact";
|
9132
9154
|
import isFunction from "lodash/isFunction";
|
9133
9155
|
|
@@ -9327,7 +9349,7 @@ var Group2 = React50.forwardRef(
|
|
9327
9349
|
DropdownMenu.Group = Group2;
|
9328
9350
|
var Item2 = React50.forwardRef(
|
9329
9351
|
(_a, ref) => {
|
9330
|
-
var _b = _a, { kind, highlighted, selected, className, icon, children } = _b, props = __objRest(_b, ["kind", "highlighted", "selected", "className", "icon", "children"]);
|
9352
|
+
var _b = _a, { kind, highlighted, selected, className, icon, showNotification = false, children } = _b, props = __objRest(_b, ["kind", "highlighted", "selected", "className", "icon", "showNotification", "children"]);
|
9331
9353
|
return /* @__PURE__ */ React50.createElement("li", __spreadValues({
|
9332
9354
|
ref,
|
9333
9355
|
className: classNames(className, "flex items-center gap-x-3 p-3 outline-none", {
|
@@ -9336,7 +9358,9 @@ var Item2 = React50.forwardRef(
|
|
9336
9358
|
"text-primary-80": kind === "action",
|
9337
9359
|
"text-grey-20 cursor-not-allowed": props.disabled
|
9338
9360
|
})
|
9339
|
-
}, props), icon && /* @__PURE__ */ React50.createElement(InlineIcon, {
|
9361
|
+
}, props), icon && showNotification && /* @__PURE__ */ React50.createElement(Badge.Notification, null, /* @__PURE__ */ React50.createElement(InlineIcon, {
|
9362
|
+
icon
|
9363
|
+
})), icon && !showNotification && /* @__PURE__ */ React50.createElement(InlineIcon, {
|
9340
9364
|
icon
|
9341
9365
|
}), /* @__PURE__ */ React50.createElement("span", {
|
9342
9366
|
className: tw("grow")
|
@@ -9527,7 +9551,7 @@ var ItemWrapper = ({ item, state }) => {
|
|
9527
9551
|
state,
|
9528
9552
|
ref
|
9529
9553
|
);
|
9530
|
-
const { icon, description, kind = "default" } = item.props;
|
9554
|
+
const { icon, description, kind = "default", showNotification = false } = item.props;
|
9531
9555
|
return /* @__PURE__ */ React51.createElement(DropdownMenu.Item, __spreadProps(__spreadValues({
|
9532
9556
|
ref
|
9533
9557
|
}, menuItemProps), {
|
@@ -9535,7 +9559,8 @@ var ItemWrapper = ({ item, state }) => {
|
|
9535
9559
|
selected: isSelected,
|
9536
9560
|
highlighted: isFocused,
|
9537
9561
|
disabled: isDisabled,
|
9538
|
-
icon
|
9562
|
+
icon,
|
9563
|
+
showNotification
|
9539
9564
|
}), item.rendered, description && /* @__PURE__ */ React51.createElement(DropdownMenu.Description, __spreadValues({
|
9540
9565
|
disabled: isDisabled
|
9541
9566
|
}, descriptionProps), description));
|
@@ -9918,13 +9943,43 @@ var sortRowsBy = (rows, sort) => {
|
|
9918
9943
|
|
9919
9944
|
// src/molecules/DataList/DataList.tsx
|
9920
9945
|
var import_more2 = __toESM(require_more());
|
9946
|
+
|
9947
|
+
// src/molecules/DataList/DataListSkeleton.tsx
|
9948
|
+
import React58 from "react";
|
9949
|
+
var DataListSkeleton = ({ columns = ["1", "2", "2", 52], rows = 5 }) => {
|
9950
|
+
const columnsAmount = [...Array(typeof columns === "number" ? columns : columns.length).keys()];
|
9951
|
+
return /* @__PURE__ */ React58.createElement(Template, {
|
9952
|
+
columns
|
9953
|
+
}, columnsAmount.map((_, index) => /* @__PURE__ */ React58.createElement(DataList.HeadCell, {
|
9954
|
+
key: index
|
9955
|
+
}, /* @__PURE__ */ React58.createElement(Skeleton, {
|
9956
|
+
width: "100%",
|
9957
|
+
height: 17.5
|
9958
|
+
}))), /* @__PURE__ */ React58.createElement(List2, {
|
9959
|
+
items: [...Array(rows).keys()],
|
9960
|
+
renderItem: (item) => /* @__PURE__ */ React58.createElement(DataList.Row, {
|
9961
|
+
key: item
|
9962
|
+
}, /* @__PURE__ */ React58.createElement(List2, {
|
9963
|
+
items: columnsAmount,
|
9964
|
+
renderItem: (key) => /* @__PURE__ */ React58.createElement(DataList.Cell, {
|
9965
|
+
key
|
9966
|
+
}, /* @__PURE__ */ React58.createElement(Skeleton, {
|
9967
|
+
width: "100%",
|
9968
|
+
height: 17.5
|
9969
|
+
}))
|
9970
|
+
}))
|
9971
|
+
}));
|
9972
|
+
};
|
9973
|
+
|
9974
|
+
// src/molecules/DataList/DataList.tsx
|
9921
9975
|
var DataList2 = ({
|
9922
9976
|
columns,
|
9923
9977
|
rows,
|
9924
9978
|
sticky,
|
9925
9979
|
menu,
|
9926
9980
|
menuLabel = "Context menu",
|
9927
|
-
onAction
|
9981
|
+
onAction,
|
9982
|
+
onMenuOpenChange
|
9928
9983
|
}) => {
|
9929
9984
|
const [sort, updateSort] = useTableSort();
|
9930
9985
|
const sortedRows = sortRowsBy(rows, sort);
|
@@ -9935,55 +9990,57 @@ var DataList2 = ({
|
|
9935
9990
|
}),
|
9936
9991
|
menu ? "auto" : void 0
|
9937
9992
|
]);
|
9938
|
-
return /* @__PURE__ */
|
9993
|
+
return /* @__PURE__ */ React59.createElement(Template, {
|
9939
9994
|
className: "Aquarium-DataList",
|
9940
9995
|
columns: templateColumns
|
9941
9996
|
}, columns.map(
|
9942
|
-
(column) => columnIsFieldColumn(column) && column.sortable || column.sort ? /* @__PURE__ */
|
9997
|
+
(column) => columnIsFieldColumn(column) && column.sortable || column.sort ? /* @__PURE__ */ React59.createElement(DataList.SortCell, __spreadValues({
|
9943
9998
|
direction: sort && sort.column.headerName === column.headerName ? sort.direction : "none",
|
9944
9999
|
onClick: () => updateSort(column),
|
9945
10000
|
sticky
|
9946
|
-
}, cellProps(column)), column.headerName) : /* @__PURE__ */
|
10001
|
+
}, cellProps(column)), column.headerName) : /* @__PURE__ */ React59.createElement(DataList.HeadCell, __spreadProps(__spreadValues({}, cellProps(column)), {
|
9947
10002
|
sticky
|
9948
10003
|
}), column.headerName)
|
9949
|
-
), menu && /* @__PURE__ */
|
10004
|
+
), menu && /* @__PURE__ */ React59.createElement(DataList.HeadCell, {
|
9950
10005
|
align: "right",
|
9951
10006
|
"aria-label": menuLabel
|
9952
|
-
}), /* @__PURE__ */
|
10007
|
+
}), /* @__PURE__ */ React59.createElement(List2, {
|
9953
10008
|
items: sortedRows,
|
9954
|
-
renderItem: (row, index) => /* @__PURE__ */
|
10009
|
+
renderItem: (row, index) => /* @__PURE__ */ React59.createElement(DataList.Row, {
|
9955
10010
|
key: row.id
|
9956
|
-
}, /* @__PURE__ */
|
10011
|
+
}, /* @__PURE__ */ React59.createElement(List2, {
|
9957
10012
|
items: columns,
|
9958
|
-
renderItem: (column) => column.type === "status" ? /* @__PURE__ */
|
10013
|
+
renderItem: (column) => column.type === "status" ? /* @__PURE__ */ React59.createElement(DataList.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React59.createElement(StatusChip, __spreadValues({
|
9959
10014
|
dense: true
|
9960
|
-
}, column.status(row, index, sortedRows)))) : column.type === "action" ? /* @__PURE__ */
|
10015
|
+
}, column.status(row, index, sortedRows)))) : column.type === "action" ? /* @__PURE__ */ React59.createElement(DataList.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React59.createElement(Button.Secondary, __spreadValues({
|
9961
10016
|
dense: true
|
9962
|
-
}, renameProperty("text", "children", column.action(row, index, sortedRows))))) : column.type === "custom" ? /* @__PURE__ */
|
9963
|
-
}), menu && /* @__PURE__ */
|
10017
|
+
}, renameProperty("text", "children", column.action(row, index, sortedRows))))) : column.type === "custom" ? /* @__PURE__ */ React59.createElement(DataList.Cell, __spreadValues({}, cellProps(column)), column.UNSAFE_render(row, index, sortedRows)) : column.type === "item" ? /* @__PURE__ */ React59.createElement(DataList.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React59.createElement(Item4, __spreadValues({}, column.item(row, index, sortedRows)))) : /* @__PURE__ */ React59.createElement(DataList.Cell, __spreadValues({}, cellProps(column)), column.formatter ? column.formatter(row[column.field], row, index, sortedRows) : row[column.field])
|
10018
|
+
}), menu && /* @__PURE__ */ React59.createElement(DataList.Cell, {
|
9964
10019
|
align: "right"
|
9965
|
-
}, /* @__PURE__ */
|
9966
|
-
onAction: (action) => onAction == null ? void 0 : onAction(action, row, index)
|
9967
|
-
|
10020
|
+
}, /* @__PURE__ */ React59.createElement(DropdownMenu2, {
|
10021
|
+
onAction: (action) => onAction == null ? void 0 : onAction(action, row, index),
|
10022
|
+
onOpenChange: onMenuOpenChange
|
10023
|
+
}, /* @__PURE__ */ React59.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ React59.createElement(Button.Icon, {
|
9968
10024
|
"aria-label": menuLabel,
|
9969
10025
|
icon: import_more2.default
|
9970
10026
|
})), isFunction(menu) ? menu(row, index) : menu)))
|
9971
10027
|
}));
|
9972
10028
|
};
|
10029
|
+
DataList2.Skeleton = DataListSkeleton;
|
9973
10030
|
|
9974
10031
|
// src/molecules/DataTable/DataTable.tsx
|
9975
|
-
import
|
10032
|
+
import React62 from "react";
|
9976
10033
|
import compact2 from "lodash/compact";
|
9977
10034
|
import isFunction2 from "lodash/isFunction";
|
9978
10035
|
|
9979
10036
|
// src/molecules/Table/Table.tsx
|
9980
|
-
import
|
10037
|
+
import React61 from "react";
|
9981
10038
|
|
9982
10039
|
// src/utils/table/useScrollTarget.ts
|
9983
|
-
import
|
10040
|
+
import React60 from "react";
|
9984
10041
|
var useScrollTarget = (callback) => {
|
9985
|
-
const targetRef =
|
9986
|
-
|
10042
|
+
const targetRef = React60.useRef(null);
|
10043
|
+
React60.useLayoutEffect(() => {
|
9987
10044
|
const observer = new IntersectionObserver((entries) => entries[0].isIntersecting && callback && callback(), {
|
9988
10045
|
root: null,
|
9989
10046
|
rootMargin: `0px 0px 200px 0px`
|
@@ -10001,12 +10058,12 @@ var Table2 = (_a) => {
|
|
10001
10058
|
var _b = _a, { children, onPrev, onNext } = _b, rest = __objRest(_b, ["children", "onPrev", "onNext"]);
|
10002
10059
|
const bottomRef = useScrollTarget(onNext);
|
10003
10060
|
const topRef = useScrollTarget(onPrev);
|
10004
|
-
return /* @__PURE__ */
|
10061
|
+
return /* @__PURE__ */ React61.createElement("div", {
|
10005
10062
|
className: classNames("Aquarium-Table", tw("relative w-full"))
|
10006
|
-
}, /* @__PURE__ */
|
10063
|
+
}, /* @__PURE__ */ React61.createElement("div", {
|
10007
10064
|
ref: topRef,
|
10008
10065
|
className: tw("absolute top-0 h-1 w-full left-0 bg-transparent")
|
10009
|
-
}), /* @__PURE__ */
|
10066
|
+
}), /* @__PURE__ */ React61.createElement(Table, __spreadValues({}, rest), children), /* @__PURE__ */ React61.createElement("div", {
|
10010
10067
|
ref: bottomRef,
|
10011
10068
|
className: tw("absolute bottom-0 h-1 w-full left-0 bg-transparent")
|
10012
10069
|
}));
|
@@ -10029,7 +10086,8 @@ var DataTable = (_a) => {
|
|
10029
10086
|
sticky,
|
10030
10087
|
menu,
|
10031
10088
|
menuLabel = "Context menu",
|
10032
|
-
onAction
|
10089
|
+
onAction,
|
10090
|
+
onMenuOpenChange
|
10033
10091
|
} = _b, rest = __objRest(_b, [
|
10034
10092
|
"columns",
|
10035
10093
|
"rows",
|
@@ -10038,11 +10096,12 @@ var DataTable = (_a) => {
|
|
10038
10096
|
"sticky",
|
10039
10097
|
"menu",
|
10040
10098
|
"menuLabel",
|
10041
|
-
"onAction"
|
10099
|
+
"onAction",
|
10100
|
+
"onMenuOpenChange"
|
10042
10101
|
]);
|
10043
10102
|
const [sort, updateSort] = useTableSort();
|
10044
10103
|
const sortedRows = sortRowsBy(rows, sort);
|
10045
|
-
return /* @__PURE__ */
|
10104
|
+
return /* @__PURE__ */ React62.createElement(Table2, __spreadProps(__spreadValues({}, rest), {
|
10046
10105
|
className: classNames(
|
10047
10106
|
"Aquarium-DataTable",
|
10048
10107
|
tw({
|
@@ -10051,49 +10110,51 @@ var DataTable = (_a) => {
|
|
10051
10110
|
"table-fixed": layout === "fixed"
|
10052
10111
|
})
|
10053
10112
|
)
|
10054
|
-
}), /* @__PURE__ */
|
10113
|
+
}), /* @__PURE__ */ React62.createElement(Table2.Head, {
|
10055
10114
|
sticky
|
10056
10115
|
}, compact2([
|
10057
10116
|
...columns.map(
|
10058
|
-
(column) => columnIsFieldColumn(column) && column.sortable || column.sort ? /* @__PURE__ */
|
10117
|
+
(column) => columnIsFieldColumn(column) && column.sortable || column.sort ? /* @__PURE__ */ React62.createElement(Table2.SortCell, __spreadValues({
|
10059
10118
|
direction: sort && sort.column.headerName === column.headerName ? sort.direction : "none",
|
10060
10119
|
onClick: () => updateSort(column),
|
10061
10120
|
style: { width: column.width },
|
10062
10121
|
"aria-label": column.headerInvisible ? column.headerName : void 0
|
10063
|
-
}, cellProps(column)), !column.headerInvisible && column.headerName) : /* @__PURE__ */
|
10122
|
+
}, cellProps(column)), !column.headerInvisible && column.headerName) : /* @__PURE__ */ React62.createElement(Table2.Cell, __spreadProps(__spreadValues({}, cellProps(column)), {
|
10064
10123
|
style: { width: column.width },
|
10065
10124
|
"aria-label": column.headerInvisible ? column.headerName : void 0
|
10066
10125
|
}), !column.headerInvisible && column.headerName)
|
10067
10126
|
),
|
10068
|
-
menu ? /* @__PURE__ */
|
10127
|
+
menu ? /* @__PURE__ */ React62.createElement(Table2.Cell, {
|
10069
10128
|
key: "__contextMenu",
|
10070
10129
|
align: "right",
|
10071
10130
|
"aria-label": menuLabel
|
10072
10131
|
}) : null
|
10073
|
-
])), /* @__PURE__ */
|
10132
|
+
])), /* @__PURE__ */ React62.createElement(Table2.Body, null, /* @__PURE__ */ React62.createElement(List2, {
|
10074
10133
|
items: sortedRows,
|
10075
|
-
renderItem: (row, index) => /* @__PURE__ */
|
10134
|
+
renderItem: (row, index) => /* @__PURE__ */ React62.createElement(Table2.Row, {
|
10076
10135
|
key: row.id
|
10077
|
-
}, /* @__PURE__ */
|
10136
|
+
}, /* @__PURE__ */ React62.createElement(List2, {
|
10078
10137
|
items: columns,
|
10079
|
-
renderItem: (column) => column.type === "status" ? /* @__PURE__ */
|
10138
|
+
renderItem: (column) => column.type === "status" ? /* @__PURE__ */ React62.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React62.createElement(StatusChip, __spreadValues({
|
10080
10139
|
dense: true
|
10081
|
-
}, column.status(row, index, sortedRows)))) : column.type === "action" ? /* @__PURE__ */
|
10140
|
+
}, column.status(row, index, sortedRows)))) : column.type === "action" ? /* @__PURE__ */ React62.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React62.createElement(Button.Secondary, __spreadValues({
|
10082
10141
|
dense: true
|
10083
|
-
}, renameProperty("text", "children", column.action(row, index, sortedRows))))) : column.type === "custom" ? /* @__PURE__ */
|
10084
|
-
}), menu && /* @__PURE__ */
|
10142
|
+
}, renameProperty("text", "children", column.action(row, index, sortedRows))))) : column.type === "custom" ? /* @__PURE__ */ React62.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), column.UNSAFE_render(row, index, sortedRows)) : column.type === "item" ? /* @__PURE__ */ React62.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React62.createElement(Item4, __spreadValues({}, column.item(row, index, sortedRows)))) : /* @__PURE__ */ React62.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), column.formatter ? column.formatter(row[column.field], row, index, sortedRows) : row[column.field])
|
10143
|
+
}), menu && /* @__PURE__ */ React62.createElement(Table2.Cell, {
|
10085
10144
|
align: "right"
|
10086
|
-
}, /* @__PURE__ */
|
10087
|
-
onAction: (action) => onAction == null ? void 0 : onAction(action, row, index)
|
10088
|
-
|
10145
|
+
}, /* @__PURE__ */ React62.createElement(DropdownMenu2, {
|
10146
|
+
onAction: (action) => onAction == null ? void 0 : onAction(action, row, index),
|
10147
|
+
onOpenChange: onMenuOpenChange
|
10148
|
+
}, /* @__PURE__ */ React62.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ React62.createElement(Button.Icon, {
|
10089
10149
|
"aria-label": menuLabel,
|
10090
10150
|
icon: import_more3.default
|
10091
10151
|
})), isFunction2(menu) ? menu(row, index) : menu)))
|
10092
10152
|
})));
|
10093
10153
|
};
|
10154
|
+
DataTable.Skeleton = DataListSkeleton;
|
10094
10155
|
|
10095
10156
|
// src/molecules/Dialog/Dialog.tsx
|
10096
|
-
import
|
10157
|
+
import React64 from "react";
|
10097
10158
|
import { useDialog } from "@react-aria/dialog";
|
10098
10159
|
import { Overlay as Overlay2, useModalOverlay } from "@react-aria/overlays";
|
10099
10160
|
import { useId } from "@react-aria/utils";
|
@@ -10120,10 +10181,10 @@ var DIALOG_ICONS_AND_COLORS = {
|
|
10120
10181
|
};
|
10121
10182
|
|
10122
10183
|
// src/atoms/Modal/Modal.tsx
|
10123
|
-
import
|
10184
|
+
import React63 from "react";
|
10124
10185
|
var Modal = (_a) => {
|
10125
10186
|
var _b = _a, { children, className, open } = _b, rest = __objRest(_b, ["children", "className", "open"]);
|
10126
|
-
return open ? /* @__PURE__ */
|
10187
|
+
return open ? /* @__PURE__ */ React63.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
10127
10188
|
className: classNames(
|
10128
10189
|
tw("inset-0 overflow-y-auto z-modal flex justify-center items-center fixed py-7"),
|
10129
10190
|
className
|
@@ -10132,14 +10193,14 @@ var Modal = (_a) => {
|
|
10132
10193
|
};
|
10133
10194
|
Modal.BackDrop = (_a) => {
|
10134
10195
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
10135
|
-
return /* @__PURE__ */
|
10196
|
+
return /* @__PURE__ */ React63.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
10136
10197
|
className: classNames(tw("-z-10 fixed min-w-full min-h-full bg-navyBlue-100 opacity-70"), className)
|
10137
10198
|
}));
|
10138
10199
|
};
|
10139
|
-
Modal.Dialog =
|
10200
|
+
Modal.Dialog = React63.forwardRef(
|
10140
10201
|
(_a, ref) => {
|
10141
10202
|
var _b = _a, { children, className, size = "sm" } = _b, rest = __objRest(_b, ["children", "className", "size"]);
|
10142
|
-
return /* @__PURE__ */
|
10203
|
+
return /* @__PURE__ */ React63.createElement("div", __spreadProps(__spreadValues({
|
10143
10204
|
ref,
|
10144
10205
|
"aria-modal": "true"
|
10145
10206
|
}, rest), {
|
@@ -10157,31 +10218,31 @@ Modal.Dialog = React62.forwardRef(
|
|
10157
10218
|
);
|
10158
10219
|
Modal.Header = (_a) => {
|
10159
10220
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
10160
|
-
return /* @__PURE__ */
|
10221
|
+
return /* @__PURE__ */ React63.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
10161
10222
|
className: classNames(tw("px-7 py-6 gap-3 flex items-center"), className)
|
10162
10223
|
}), children);
|
10163
10224
|
};
|
10164
10225
|
Modal.HeaderImage = (_a) => {
|
10165
10226
|
var _b = _a, { backgroundImage, className } = _b, rest = __objRest(_b, ["backgroundImage", "className"]);
|
10166
10227
|
const common = tw("h-[120px] min-h-[120px] w-full ");
|
10167
|
-
return backgroundImage ? /* @__PURE__ */
|
10228
|
+
return backgroundImage ? /* @__PURE__ */ React63.createElement("img", __spreadProps(__spreadValues({
|
10168
10229
|
"aria-hidden": true,
|
10169
10230
|
src: backgroundImage != null ? backgroundImage : void 0
|
10170
10231
|
}, rest), {
|
10171
10232
|
className: classNames(common, tw("object-cover"), className)
|
10172
|
-
})) : /* @__PURE__ */
|
10233
|
+
})) : /* @__PURE__ */ React63.createElement("div", {
|
10173
10234
|
className: classNames(common, tw("bg-grey-5"), className)
|
10174
10235
|
});
|
10175
10236
|
};
|
10176
10237
|
Modal.CloseButtonContainer = (_a) => {
|
10177
10238
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
10178
|
-
return /* @__PURE__ */
|
10239
|
+
return /* @__PURE__ */ React63.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
10179
10240
|
className: classNames(tw("absolute top-[20px] right-[28px]"), className)
|
10180
10241
|
}));
|
10181
10242
|
};
|
10182
10243
|
Modal.Title = (_a) => {
|
10183
10244
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
10184
|
-
return /* @__PURE__ */
|
10245
|
+
return /* @__PURE__ */ React63.createElement(Typography, __spreadValues({
|
10185
10246
|
htmlTag: "h2",
|
10186
10247
|
variant: "subheading",
|
10187
10248
|
color: "grey-90",
|
@@ -10190,52 +10251,52 @@ Modal.Title = (_a) => {
|
|
10190
10251
|
};
|
10191
10252
|
Modal.Subtitle = (_a) => {
|
10192
10253
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
10193
|
-
return /* @__PURE__ */
|
10254
|
+
return /* @__PURE__ */ React63.createElement(Typography, __spreadValues({
|
10194
10255
|
variant: "small",
|
10195
10256
|
color: "grey-60"
|
10196
10257
|
}, rest), children);
|
10197
10258
|
};
|
10198
10259
|
Modal.TitleContainer = (_a) => {
|
10199
10260
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
10200
|
-
return /* @__PURE__ */
|
10261
|
+
return /* @__PURE__ */ React63.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
10201
10262
|
className: classNames(tw("flex flex-col grow gap-2"), className)
|
10202
10263
|
}), children);
|
10203
10264
|
};
|
10204
10265
|
Modal.Body = (_a) => {
|
10205
10266
|
var _b = _a, { children, className, noFooter = false, maxHeight, style } = _b, rest = __objRest(_b, ["children", "className", "noFooter", "maxHeight", "style"]);
|
10206
|
-
return /* @__PURE__ */
|
10267
|
+
return /* @__PURE__ */ React63.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
10207
10268
|
className: classNames(tw("px-7 grow overflow-y-auto", { "pb-6": noFooter }), className),
|
10208
10269
|
style: __spreadValues({ maxHeight }, style)
|
10209
10270
|
}), children);
|
10210
10271
|
};
|
10211
10272
|
Modal.Footer = (_a) => {
|
10212
10273
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
10213
|
-
return /* @__PURE__ */
|
10274
|
+
return /* @__PURE__ */ React63.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
10214
10275
|
className: classNames(tw("px-7 py-6"), className)
|
10215
10276
|
}), children);
|
10216
10277
|
};
|
10217
10278
|
Modal.Actions = (_a) => {
|
10218
10279
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
10219
|
-
return /* @__PURE__ */
|
10280
|
+
return /* @__PURE__ */ React63.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
10220
10281
|
className: classNames(tw("flex gap-4 justify-end"), className)
|
10221
10282
|
}), children);
|
10222
10283
|
};
|
10223
10284
|
|
10224
10285
|
// src/molecules/Dialog/Dialog.tsx
|
10225
10286
|
var Dialog = (props) => {
|
10226
|
-
const ref =
|
10287
|
+
const ref = React64.useRef(null);
|
10227
10288
|
const state = useOverlayTriggerState2({ isOpen: props.open });
|
10228
10289
|
const { modalProps, underlayProps } = useModalOverlay({}, state, ref);
|
10229
10290
|
if (!state.isOpen) {
|
10230
10291
|
return null;
|
10231
10292
|
}
|
10232
|
-
return /* @__PURE__ */
|
10293
|
+
return /* @__PURE__ */ React64.createElement(Overlay2, null, /* @__PURE__ */ React64.createElement(Modal, {
|
10233
10294
|
className: "Aquarium-Dialog",
|
10234
10295
|
open: true
|
10235
|
-
}, /* @__PURE__ */
|
10296
|
+
}, /* @__PURE__ */ React64.createElement(Modal.BackDrop, __spreadValues({}, underlayProps)), /* @__PURE__ */ React64.createElement(Modal.Dialog, __spreadValues({
|
10236
10297
|
ref,
|
10237
10298
|
size: "sm"
|
10238
|
-
}, modalProps), /* @__PURE__ */
|
10299
|
+
}, modalProps), /* @__PURE__ */ React64.createElement(DialogWrapper, __spreadValues({}, props)))));
|
10239
10300
|
};
|
10240
10301
|
var DialogWrapper = ({
|
10241
10302
|
title,
|
@@ -10244,36 +10305,36 @@ var DialogWrapper = ({
|
|
10244
10305
|
primaryAction,
|
10245
10306
|
secondaryAction
|
10246
10307
|
}) => {
|
10247
|
-
const ref =
|
10308
|
+
const ref = React64.useRef(null);
|
10248
10309
|
const labelledBy = useId();
|
10249
10310
|
const describedBy = useId();
|
10250
10311
|
const { dialogProps } = useDialog(
|
10251
10312
|
{ "role": "alertdialog", "aria-labelledby": labelledBy, "aria-describedby": describedBy },
|
10252
10313
|
ref
|
10253
10314
|
);
|
10254
|
-
return /* @__PURE__ */
|
10315
|
+
return /* @__PURE__ */ React64.createElement("div", __spreadProps(__spreadValues({
|
10255
10316
|
ref
|
10256
10317
|
}, dialogProps), {
|
10257
10318
|
className: tw("outline-none")
|
10258
|
-
}), /* @__PURE__ */
|
10319
|
+
}), /* @__PURE__ */ React64.createElement(Modal.Header, null, /* @__PURE__ */ React64.createElement(Icon, {
|
10259
10320
|
icon: DIALOG_ICONS_AND_COLORS[type].icon,
|
10260
10321
|
color: DIALOG_ICONS_AND_COLORS[type].color,
|
10261
10322
|
fontSize: 20
|
10262
|
-
}), /* @__PURE__ */
|
10323
|
+
}), /* @__PURE__ */ React64.createElement(Modal.Title, {
|
10263
10324
|
id: labelledBy,
|
10264
10325
|
variant: "large-strong",
|
10265
10326
|
color: DIALOG_ICONS_AND_COLORS[type].color
|
10266
|
-
}, title)), /* @__PURE__ */
|
10327
|
+
}, title)), /* @__PURE__ */ React64.createElement(Modal.Body, {
|
10267
10328
|
id: describedBy
|
10268
|
-
}, children), /* @__PURE__ */
|
10329
|
+
}, children), /* @__PURE__ */ React64.createElement(Modal.Footer, null, /* @__PURE__ */ React64.createElement(Modal.Actions, null, secondaryAction && /* @__PURE__ */ React64.createElement(Button.Ghost, __spreadValues({
|
10269
10330
|
key: secondaryAction.text
|
10270
|
-
}, omit8(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */
|
10331
|
+
}, omit8(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */ React64.createElement(Button.Secondary, __spreadValues({
|
10271
10332
|
key: primaryAction.text
|
10272
10333
|
}, omit8(primaryAction, "text")), primaryAction.text))));
|
10273
10334
|
};
|
10274
10335
|
|
10275
10336
|
// src/molecules/Divider/Divider.tsx
|
10276
|
-
import
|
10337
|
+
import React65 from "react";
|
10277
10338
|
var sizeClasses = {
|
10278
10339
|
horizontal: {
|
10279
10340
|
1: "h-1px",
|
@@ -10295,7 +10356,7 @@ var sizeClasses = {
|
|
10295
10356
|
var Divider2 = (_a) => {
|
10296
10357
|
var _b = _a, { direction = "horizontal", size = 1 } = _b, props = __objRest(_b, ["direction", "size"]);
|
10297
10358
|
const sizeClass = sizeClasses[direction][size];
|
10298
|
-
return /* @__PURE__ */
|
10359
|
+
return /* @__PURE__ */ React65.createElement("div", __spreadProps(__spreadValues({}, props), {
|
10299
10360
|
className: classNames(
|
10300
10361
|
"Aquarium-Divider",
|
10301
10362
|
tw(`bg-grey-5 ${sizeClass}`, {
|
@@ -10307,10 +10368,10 @@ var Divider2 = (_a) => {
|
|
10307
10368
|
};
|
10308
10369
|
|
10309
10370
|
// src/molecules/Dropdown/Dropdown.tsx
|
10310
|
-
import
|
10371
|
+
import React68 from "react";
|
10311
10372
|
|
10312
10373
|
// src/molecules/Popover/Popover.tsx
|
10313
|
-
import
|
10374
|
+
import React67, { useRef as useRef7 } from "react";
|
10314
10375
|
import { PressResponder as PressResponder2, usePress as usePress2 } from "@react-aria/interactions";
|
10315
10376
|
import { useOverlayTrigger } from "@react-aria/overlays";
|
10316
10377
|
import { mergeProps as mergeProps3 } from "@react-aria/utils";
|
@@ -10318,12 +10379,12 @@ import { useOverlayTriggerState as useOverlayTriggerState3 } from "@react-statel
|
|
10318
10379
|
import classNames7 from "classnames";
|
10319
10380
|
|
10320
10381
|
// src/molecules/Popover/Dialog.tsx
|
10321
|
-
import
|
10382
|
+
import React66 from "react";
|
10322
10383
|
import { useDialog as useDialog2 } from "@react-aria/dialog";
|
10323
10384
|
var Dialog2 = ({ children }) => {
|
10324
|
-
const ref =
|
10385
|
+
const ref = React66.useRef(null);
|
10325
10386
|
const { dialogProps } = useDialog2({}, ref);
|
10326
|
-
return /* @__PURE__ */
|
10387
|
+
return /* @__PURE__ */ React66.createElement("div", __spreadProps(__spreadValues({
|
10327
10388
|
ref
|
10328
10389
|
}, dialogProps), {
|
10329
10390
|
className: tw("outline-none")
|
@@ -10357,21 +10418,21 @@ var Popover2 = (props) => {
|
|
10357
10418
|
const triggerRef = useRef7(null);
|
10358
10419
|
const state = useOverlayTriggerState3(props);
|
10359
10420
|
const { triggerProps, overlayProps } = useOverlayTrigger({ type: type != null ? type : "dialog" }, state, triggerRef);
|
10360
|
-
return /* @__PURE__ */
|
10421
|
+
return /* @__PURE__ */ React67.createElement(PopoverContext.Provider, {
|
10361
10422
|
value: {
|
10362
10423
|
state
|
10363
10424
|
}
|
10364
|
-
},
|
10425
|
+
}, React67.Children.map(props.children, (child) => {
|
10365
10426
|
if (isComponentType(child, Popover2.Trigger)) {
|
10366
|
-
return /* @__PURE__ */
|
10427
|
+
return /* @__PURE__ */ React67.createElement(PressResponder2, __spreadValues({
|
10367
10428
|
ref: triggerRef
|
10368
|
-
}, triggerProps), /* @__PURE__ */
|
10429
|
+
}, triggerProps), /* @__PURE__ */ React67.createElement(PopoverTriggerWrapper, {
|
10369
10430
|
"data-testid": props["data-testid"],
|
10370
10431
|
"aria-controls": id
|
10371
10432
|
}, child.props.children));
|
10372
10433
|
}
|
10373
10434
|
if (isComponentType(child, Popover2.Panel)) {
|
10374
|
-
return state.isOpen && /* @__PURE__ */
|
10435
|
+
return state.isOpen && /* @__PURE__ */ React67.createElement(PopoverOverlay, __spreadValues({
|
10375
10436
|
triggerRef: targetRef != null ? targetRef : triggerRef,
|
10376
10437
|
state,
|
10377
10438
|
placement,
|
@@ -10382,7 +10443,7 @@ var Popover2 = (props) => {
|
|
10382
10443
|
offset,
|
10383
10444
|
crossOffset,
|
10384
10445
|
shouldFlip
|
10385
|
-
}, overlayProps), containFocus ? /* @__PURE__ */
|
10446
|
+
}, overlayProps), containFocus ? /* @__PURE__ */ React67.createElement(Dialog2, null, child.props.children) : child.props.children);
|
10386
10447
|
}
|
10387
10448
|
throw new Error("Invalid children element type");
|
10388
10449
|
}));
|
@@ -10401,7 +10462,7 @@ var asPopoverButton = (Component, displayName) => {
|
|
10401
10462
|
state.close();
|
10402
10463
|
onClick == null ? void 0 : onClick(e);
|
10403
10464
|
};
|
10404
|
-
return /* @__PURE__ */
|
10465
|
+
return /* @__PURE__ */ React67.createElement(Component, __spreadProps(__spreadValues({}, props), {
|
10405
10466
|
onClick: handleClick
|
10406
10467
|
}));
|
10407
10468
|
};
|
@@ -10414,9 +10475,9 @@ var PopoverTriggerWrapper = (_a) => {
|
|
10414
10475
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
10415
10476
|
var _a2;
|
10416
10477
|
const ref = useRef7(null);
|
10417
|
-
const trigger =
|
10478
|
+
const trigger = React67.Children.only(children);
|
10418
10479
|
const { pressProps } = usePress2(__spreadProps(__spreadValues({}, rest), { ref }));
|
10419
|
-
return
|
10480
|
+
return React67.cloneElement(trigger, __spreadProps(__spreadValues({
|
10420
10481
|
"ref": ref
|
10421
10482
|
}, mergeProps3(pressProps, trigger.props)), {
|
10422
10483
|
"aria-controls": (_a2 = rest["aria-controls"]) != null ? _a2 : pressProps["aria-controls"]
|
@@ -10425,10 +10486,10 @@ var PopoverTriggerWrapper = (_a) => {
|
|
10425
10486
|
|
10426
10487
|
// src/molecules/Dropdown/Dropdown.tsx
|
10427
10488
|
var Dropdown = ({ children, content, placement = "bottom-left" }) => {
|
10428
|
-
return /* @__PURE__ */
|
10489
|
+
return /* @__PURE__ */ React68.createElement(Popover2, {
|
10429
10490
|
type: "menu",
|
10430
10491
|
placement
|
10431
|
-
}, /* @__PURE__ */
|
10492
|
+
}, /* @__PURE__ */ React68.createElement(Popover2.Trigger, null, children), /* @__PURE__ */ React68.createElement(Popover2.Panel, {
|
10432
10493
|
className: "Aquarium-Dropdown"
|
10433
10494
|
}, content));
|
10434
10495
|
};
|
@@ -10439,26 +10500,26 @@ var DropdownMenu3 = ({
|
|
10439
10500
|
triggerId,
|
10440
10501
|
setClose = () => void 0
|
10441
10502
|
}) => {
|
10442
|
-
const menuRef =
|
10443
|
-
|
10503
|
+
const menuRef = React68.useRef(null);
|
10504
|
+
React68.useEffect(() => {
|
10444
10505
|
const id = setTimeout(() => {
|
10445
10506
|
var _a, _b, _c;
|
10446
10507
|
return (_c = (_b = (_a = menuRef.current) == null ? void 0 : _a.children) == null ? void 0 : _b[0]) == null ? void 0 : _c.focus();
|
10447
10508
|
});
|
10448
10509
|
return () => clearTimeout(id);
|
10449
10510
|
}, [menuRef.current]);
|
10450
|
-
return /* @__PURE__ */
|
10511
|
+
return /* @__PURE__ */ React68.createElement("div", {
|
10451
10512
|
style: { minWidth: "250px" },
|
10452
10513
|
className: tw("py-3 bg-white")
|
10453
|
-
}, !!title && /* @__PURE__ */
|
10514
|
+
}, !!title && /* @__PURE__ */ React68.createElement("div", {
|
10454
10515
|
className: tw("px-4 py-4 text-left text-grey-100 typography-default-strong")
|
10455
|
-
}, title), /* @__PURE__ */
|
10516
|
+
}, title), /* @__PURE__ */ React68.createElement("ol", {
|
10456
10517
|
role: "menu",
|
10457
10518
|
ref: menuRef,
|
10458
10519
|
id: contentId,
|
10459
10520
|
"aria-labelledby": triggerId
|
10460
|
-
},
|
10461
|
-
return
|
10521
|
+
}, React68.Children.map(children, (child) => {
|
10522
|
+
return React68.cloneElement(child, { setClose });
|
10462
10523
|
})));
|
10463
10524
|
};
|
10464
10525
|
var DropdownItem = (_a) => {
|
@@ -10513,10 +10574,10 @@ var DropdownItem = (_a) => {
|
|
10513
10574
|
handleSelect();
|
10514
10575
|
}
|
10515
10576
|
};
|
10516
|
-
const itemContent = /* @__PURE__ */
|
10577
|
+
const itemContent = /* @__PURE__ */ React68.createElement("div", {
|
10517
10578
|
className: tw("py-3 px-4")
|
10518
10579
|
}, children);
|
10519
|
-
return /* @__PURE__ */
|
10580
|
+
return /* @__PURE__ */ React68.createElement("li", __spreadProps(__spreadValues({
|
10520
10581
|
role: "menuitem",
|
10521
10582
|
tabIndex: -1,
|
10522
10583
|
onClick: handleClick,
|
@@ -10527,11 +10588,11 @@ var DropdownItem = (_a) => {
|
|
10527
10588
|
"text-grey-10 cursor-not-allowed": disabled,
|
10528
10589
|
"text-primary-70 hover:text-primary-80": color === "danger" && !disabled
|
10529
10590
|
})
|
10530
|
-
}), tooltip ? /* @__PURE__ */
|
10591
|
+
}), tooltip ? /* @__PURE__ */ React68.createElement(Tooltip, {
|
10531
10592
|
content: tooltip,
|
10532
10593
|
placement: tooltipPlacement,
|
10533
10594
|
inline: false
|
10534
|
-
}, /* @__PURE__ */
|
10595
|
+
}, /* @__PURE__ */ React68.createElement("div", {
|
10535
10596
|
tabIndex: 0,
|
10536
10597
|
className: tw("grow")
|
10537
10598
|
}, itemContent)) : itemContent);
|
@@ -10540,11 +10601,11 @@ Dropdown.Menu = DropdownMenu3;
|
|
10540
10601
|
Dropdown.Item = DropdownItem;
|
10541
10602
|
|
10542
10603
|
// src/molecules/EmptyState/EmptyState.tsx
|
10543
|
-
import
|
10604
|
+
import React70 from "react";
|
10544
10605
|
import omit9 from "lodash/omit";
|
10545
10606
|
|
10546
10607
|
// src/molecules/Flexbox/FlexboxItem.tsx
|
10547
|
-
import
|
10608
|
+
import React69 from "react";
|
10548
10609
|
var FlexboxItem = Tailwindify(
|
10549
10610
|
({ htmlTag = "div", className, style, children, display, flex, grow, shrink, order, alignSelf }) => {
|
10550
10611
|
const hookStyle = useStyle({
|
@@ -10556,7 +10617,7 @@ var FlexboxItem = Tailwindify(
|
|
10556
10617
|
alignSelf
|
10557
10618
|
});
|
10558
10619
|
const HtmlElement = htmlTag;
|
10559
|
-
return /* @__PURE__ */
|
10620
|
+
return /* @__PURE__ */ React69.createElement(HtmlElement, {
|
10560
10621
|
style: __spreadValues(__spreadValues({}, hookStyle), style),
|
10561
10622
|
className
|
10562
10623
|
}, children);
|
@@ -10614,7 +10675,7 @@ var EmptyState = ({
|
|
10614
10675
|
borderStyle = "dashed"
|
10615
10676
|
}) => {
|
10616
10677
|
const template = layoutStyle(layout);
|
10617
|
-
return /* @__PURE__ */
|
10678
|
+
return /* @__PURE__ */ React70.createElement(Box, {
|
10618
10679
|
className: classNames(
|
10619
10680
|
"Aquarium-EmptyState",
|
10620
10681
|
tw("rounded", {
|
@@ -10627,38 +10688,42 @@ var EmptyState = ({
|
|
10627
10688
|
backgroundColor: "transparent",
|
10628
10689
|
borderColor: "grey-10",
|
10629
10690
|
padding: "9"
|
10630
|
-
}, /* @__PURE__ */
|
10691
|
+
}, /* @__PURE__ */ React70.createElement(Flexbox, {
|
10631
10692
|
direction: template.layout,
|
10632
10693
|
justifyContent: template.justifyContent,
|
10633
10694
|
alignItems: template.layout === "row" ? "center" : template.alignItems,
|
10634
10695
|
colGap: "l5",
|
10635
10696
|
rowGap: "8"
|
10636
|
-
}, image && /* @__PURE__ */
|
10697
|
+
}, image && /* @__PURE__ */ React70.createElement(FlexboxItem, null, /* @__PURE__ */ React70.createElement("img", {
|
10637
10698
|
src: image,
|
10638
10699
|
alt: imageAlt,
|
10639
10700
|
style: { width: imageWidth ? `${imageWidth}px` : void 0, height: "auto" }
|
10640
|
-
})), /* @__PURE__ */
|
10701
|
+
})), /* @__PURE__ */ React70.createElement(Flexbox, {
|
10641
10702
|
style: { maxWidth: "610px" },
|
10642
10703
|
direction: "column",
|
10643
10704
|
justifyContent: template.justifyContent,
|
10644
10705
|
alignItems: template.alignItems
|
10645
|
-
}, /* @__PURE__ */
|
10706
|
+
}, /* @__PURE__ */ React70.createElement(Typography2, {
|
10646
10707
|
variant: "heading",
|
10647
10708
|
htmlTag: "h2"
|
10648
|
-
}, title), (description || children) && /* @__PURE__ */
|
10709
|
+
}, title), (description || children) && /* @__PURE__ */ React70.createElement(Box, {
|
10649
10710
|
marginTop: "5"
|
10650
|
-
}, /* @__PURE__ */
|
10711
|
+
}, /* @__PURE__ */ React70.createElement(Typography2, {
|
10651
10712
|
variant: "default",
|
10652
10713
|
color: "grey-60"
|
10653
|
-
}, children || description)), (secondaryAction || primaryAction) && /* @__PURE__ */
|
10714
|
+
}, children || description)), (secondaryAction || primaryAction) && /* @__PURE__ */ React70.createElement(Flexbox, {
|
10654
10715
|
marginTop: "7",
|
10655
10716
|
gap: "4",
|
10656
10717
|
justifyContent: "center",
|
10657
10718
|
alignItems: "center",
|
10658
10719
|
wrap: "wrap"
|
10659
|
-
}, primaryAction && /* @__PURE__ */
|
10720
|
+
}, primaryAction && /* @__PURE__ */ React70.createElement(React70.Fragment, null, !isLink(primaryAction) && /* @__PURE__ */ React70.createElement(Button.Primary, __spreadValues({}, omit9(primaryAction, "text")), primaryAction.text), isLink(primaryAction) && /* @__PURE__ */ React70.createElement(Button.ExternalLink, __spreadValues({
|
10721
|
+
kind: "primary"
|
10722
|
+
}, omit9(primaryAction, "text")), primaryAction.text)), secondaryAction && /* @__PURE__ */ React70.createElement(React70.Fragment, null, !isLink(secondaryAction) && /* @__PURE__ */ React70.createElement(Button.Secondary, __spreadValues({}, omit9(secondaryAction, "text")), secondaryAction.text), isLink(secondaryAction) && /* @__PURE__ */ React70.createElement(Button.ExternalLink, __spreadValues({
|
10723
|
+
kind: "secondary"
|
10724
|
+
}, omit9(secondaryAction, "text")), secondaryAction.text))), footer && /* @__PURE__ */ React70.createElement(Box, {
|
10660
10725
|
marginTop: "7"
|
10661
|
-
}, /* @__PURE__ */
|
10726
|
+
}, /* @__PURE__ */ React70.createElement(Typography2, {
|
10662
10727
|
htmlTag: "div",
|
10663
10728
|
variant: "small",
|
10664
10729
|
color: "grey-60"
|
@@ -10666,7 +10731,7 @@ var EmptyState = ({
|
|
10666
10731
|
};
|
10667
10732
|
|
10668
10733
|
// src/molecules/Grid/GridItem.tsx
|
10669
|
-
import
|
10734
|
+
import React71 from "react";
|
10670
10735
|
var GridItem = Tailwindify(
|
10671
10736
|
({
|
10672
10737
|
htmlTag = "div",
|
@@ -10697,7 +10762,7 @@ var GridItem = Tailwindify(
|
|
10697
10762
|
gridRowEnd: rowEnd
|
10698
10763
|
});
|
10699
10764
|
const HtmlElement = htmlTag;
|
10700
|
-
return /* @__PURE__ */
|
10765
|
+
return /* @__PURE__ */ React71.createElement(HtmlElement, {
|
10701
10766
|
style: __spreadValues(__spreadValues({}, hookStyle), style),
|
10702
10767
|
className
|
10703
10768
|
}, children);
|
@@ -10705,7 +10770,7 @@ var GridItem = Tailwindify(
|
|
10705
10770
|
);
|
10706
10771
|
|
10707
10772
|
// src/molecules/LineClamp/LineClamp.tsx
|
10708
|
-
import
|
10773
|
+
import React72 from "react";
|
10709
10774
|
var LineClamp2 = ({
|
10710
10775
|
lines,
|
10711
10776
|
children,
|
@@ -10714,10 +10779,10 @@ var LineClamp2 = ({
|
|
10714
10779
|
collapseLabel,
|
10715
10780
|
onClampedChange
|
10716
10781
|
}) => {
|
10717
|
-
const ref =
|
10718
|
-
const [clamped, setClamped] =
|
10719
|
-
const [isClampingEnabled, setClampingEnabled] =
|
10720
|
-
|
10782
|
+
const ref = React72.useRef(null);
|
10783
|
+
const [clamped, setClamped] = React72.useState(true);
|
10784
|
+
const [isClampingEnabled, setClampingEnabled] = React72.useState(false);
|
10785
|
+
React72.useEffect(() => {
|
10721
10786
|
var _a, _b;
|
10722
10787
|
const el = ref.current;
|
10723
10788
|
setClampingEnabled(((_a = el == null ? void 0 : el.scrollHeight) != null ? _a : 0) > ((_b = el == null ? void 0 : el.clientHeight) != null ? _b : 0));
|
@@ -10726,28 +10791,28 @@ var LineClamp2 = ({
|
|
10726
10791
|
setClamped(!clamped);
|
10727
10792
|
onClampedChange == null ? void 0 : onClampedChange(!clamped);
|
10728
10793
|
};
|
10729
|
-
return /* @__PURE__ */
|
10794
|
+
return /* @__PURE__ */ React72.createElement("div", {
|
10730
10795
|
className: "Aquarium-LineClamp"
|
10731
|
-
}, /* @__PURE__ */
|
10796
|
+
}, /* @__PURE__ */ React72.createElement(LineClamp, {
|
10732
10797
|
ref,
|
10733
10798
|
lines,
|
10734
10799
|
clamped,
|
10735
10800
|
wordBreak
|
10736
|
-
}, children), expandLabel && isClampingEnabled && /* @__PURE__ */
|
10801
|
+
}, children), expandLabel && isClampingEnabled && /* @__PURE__ */ React72.createElement(Button.Ghost, {
|
10737
10802
|
dense: true,
|
10738
10803
|
onClick: handleClampedChange
|
10739
10804
|
}, clamped ? expandLabel : collapseLabel));
|
10740
10805
|
};
|
10741
10806
|
|
10742
10807
|
// src/molecules/Link/Link.tsx
|
10743
|
-
import
|
10808
|
+
import React74 from "react";
|
10744
10809
|
import classNames8 from "classnames";
|
10745
10810
|
|
10746
10811
|
// src/atoms/Link/Link.tsx
|
10747
|
-
import
|
10812
|
+
import React73 from "react";
|
10748
10813
|
var Link = (_a) => {
|
10749
10814
|
var _b = _a, { children, className } = _b, props = __objRest(_b, ["children", "className"]);
|
10750
|
-
return /* @__PURE__ */
|
10815
|
+
return /* @__PURE__ */ React73.createElement("a", __spreadValues({
|
10751
10816
|
className: classNames(className, linkStyle)
|
10752
10817
|
}, props), children);
|
10753
10818
|
};
|
@@ -10755,22 +10820,23 @@ var Link = (_a) => {
|
|
10755
10820
|
// src/molecules/Link/Link.tsx
|
10756
10821
|
var Link2 = (_a) => {
|
10757
10822
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
10758
|
-
return /* @__PURE__ */
|
10823
|
+
return /* @__PURE__ */ React74.createElement(Link, __spreadValues({
|
10759
10824
|
className: classNames8("Aquarium-Link", className)
|
10760
10825
|
}, props));
|
10761
10826
|
};
|
10762
10827
|
|
10763
10828
|
// src/molecules/ListItem/ListItem.tsx
|
10764
|
-
import
|
10829
|
+
import React75 from "react";
|
10765
10830
|
var ListItem = ({ name, icon, active = false }) => {
|
10766
|
-
return /* @__PURE__ */
|
10831
|
+
return /* @__PURE__ */ React75.createElement(Box.Flex, {
|
10832
|
+
className: "Aquarium-ListItem",
|
10767
10833
|
alignItems: "center"
|
10768
|
-
}, /* @__PURE__ */
|
10834
|
+
}, /* @__PURE__ */ React75.createElement(Typography2, {
|
10769
10835
|
variant: active ? "small-strong" : "small",
|
10770
10836
|
color: "grey-70",
|
10771
10837
|
htmlTag: "span",
|
10772
10838
|
className: `px-4 py-2 rounded-full ${active ? "bg-grey-5" : "hover:bg-grey-0"}`
|
10773
|
-
}, /* @__PURE__ */
|
10839
|
+
}, /* @__PURE__ */ React75.createElement("img", {
|
10774
10840
|
src: icon,
|
10775
10841
|
alt: name,
|
10776
10842
|
className: "inline mr-4",
|
@@ -10780,7 +10846,7 @@ var ListItem = ({ name, icon, active = false }) => {
|
|
10780
10846
|
};
|
10781
10847
|
|
10782
10848
|
// src/molecules/Modal/Modal.tsx
|
10783
|
-
import
|
10849
|
+
import React77 from "react";
|
10784
10850
|
import { useDialog as useDialog3 } from "@react-aria/dialog";
|
10785
10851
|
import { Overlay as Overlay3, useModalOverlay as useModalOverlay2 } from "@react-aria/overlays";
|
10786
10852
|
import { useId as useId2 } from "@react-aria/utils";
|
@@ -10789,18 +10855,18 @@ import castArray from "lodash/castArray";
|
|
10789
10855
|
import omit10 from "lodash/omit";
|
10790
10856
|
|
10791
10857
|
// src/molecules/Tabs/Tabs.tsx
|
10792
|
-
import
|
10858
|
+
import React76, { useEffect as useEffect7, useLayoutEffect as useLayoutEffect2, useRef as useRef8, useState as useState7 } from "react";
|
10793
10859
|
import isNumber5 from "lodash/isNumber";
|
10794
10860
|
import kebabCase from "lodash/kebabCase";
|
10795
10861
|
var import_chevronLeft3 = __toESM(require_chevronLeft());
|
10796
10862
|
var import_chevronRight3 = __toESM(require_chevronRight());
|
10797
10863
|
var import_warningSign4 = __toESM(require_warningSign());
|
10798
10864
|
var isTabComponent = (c) => {
|
10799
|
-
return
|
10865
|
+
return React76.isValidElement(c) && (c.type === Tab || c.type === ModalTab);
|
10800
10866
|
};
|
10801
|
-
var Tab =
|
10867
|
+
var Tab = React76.forwardRef(
|
10802
10868
|
({ className, id, title, children }, ref) => {
|
10803
|
-
return /* @__PURE__ */
|
10869
|
+
return /* @__PURE__ */ React76.createElement("div", {
|
10804
10870
|
ref,
|
10805
10871
|
id: `${id != null ? id : kebabCase(title)}-panel`,
|
10806
10872
|
className,
|
@@ -10812,14 +10878,14 @@ var Tab = React75.forwardRef(
|
|
10812
10878
|
);
|
10813
10879
|
var TabContainer = (_a) => {
|
10814
10880
|
var _b = _a, { className, children } = _b, rest = __objRest(_b, ["className", "children"]);
|
10815
|
-
return /* @__PURE__ */
|
10881
|
+
return /* @__PURE__ */ React76.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
10816
10882
|
className: classNames("py-6 z-0", className)
|
10817
10883
|
}), children);
|
10818
10884
|
};
|
10819
10885
|
var ModalTab = Tab;
|
10820
10886
|
var ModalTabContainer = TabContainer;
|
10821
10887
|
var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
10822
|
-
const Tab2 =
|
10888
|
+
const Tab2 = React76.forwardRef(
|
10823
10889
|
(_a, ref) => {
|
10824
10890
|
var _b = _a, {
|
10825
10891
|
id,
|
@@ -10849,17 +10915,17 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
10849
10915
|
const _id = id != null ? id : kebabCase(title);
|
10850
10916
|
let statusIcon = void 0;
|
10851
10917
|
if (status === "warning") {
|
10852
|
-
statusIcon = /* @__PURE__ */
|
10918
|
+
statusIcon = /* @__PURE__ */ React76.createElement(InlineIcon, {
|
10853
10919
|
icon: import_warningSign4.default,
|
10854
10920
|
color: "warning-80"
|
10855
10921
|
});
|
10856
10922
|
} else if (status === "error") {
|
10857
|
-
statusIcon = /* @__PURE__ */
|
10923
|
+
statusIcon = /* @__PURE__ */ React76.createElement(InlineIcon, {
|
10858
10924
|
icon: import_warningSign4.default,
|
10859
10925
|
color: "error-50"
|
10860
10926
|
});
|
10861
10927
|
}
|
10862
|
-
const tab = /* @__PURE__ */
|
10928
|
+
const tab = /* @__PURE__ */ React76.createElement(Component, __spreadValues({
|
10863
10929
|
ref,
|
10864
10930
|
id: `${_id}-tab`,
|
10865
10931
|
onClick: () => !disabled && onSelected(value != null ? value : index),
|
@@ -10876,24 +10942,24 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
10876
10942
|
"aria-selected": selected,
|
10877
10943
|
"aria-controls": `${_id}-panel`,
|
10878
10944
|
tabIndex: disabled ? void 0 : 0
|
10879
|
-
}, rest), /* @__PURE__ */
|
10945
|
+
}, rest), /* @__PURE__ */ React76.createElement(Typography2, {
|
10880
10946
|
htmlTag: "div",
|
10881
10947
|
variant: "small",
|
10882
10948
|
color: selected ? "primary-80" : disabled ? "grey-20" : "current",
|
10883
10949
|
className: tw("inline-flex items-center gap-3")
|
10884
|
-
}, /* @__PURE__ */
|
10950
|
+
}, /* @__PURE__ */ React76.createElement("span", {
|
10885
10951
|
className: tw("whitespace-nowrap")
|
10886
|
-
}, title), isNumber5(badge) && /* @__PURE__ */
|
10952
|
+
}, title), isNumber5(badge) && /* @__PURE__ */ React76.createElement(Typography2, {
|
10887
10953
|
htmlTag: "span",
|
10888
10954
|
variant: "small",
|
10889
10955
|
color: selected ? "primary-80" : "grey-5",
|
10890
10956
|
className: "leading-none"
|
10891
|
-
}, /* @__PURE__ */
|
10957
|
+
}, /* @__PURE__ */ React76.createElement(TabBadge, {
|
10892
10958
|
kind: "filled",
|
10893
10959
|
value: badge,
|
10894
10960
|
textClassname: classNames({ "text-white": selected, "text-grey-50": !selected })
|
10895
10961
|
})), statusIcon));
|
10896
|
-
return tooltip ? /* @__PURE__ */
|
10962
|
+
return tooltip ? /* @__PURE__ */ React76.createElement(Tooltip, {
|
10897
10963
|
content: tooltip
|
10898
10964
|
}, tab) : tab;
|
10899
10965
|
}
|
@@ -10907,7 +10973,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
10907
10973
|
const Tabs2 = (props) => {
|
10908
10974
|
var _a, _b;
|
10909
10975
|
const { className, value, defaultValue, onChange, children } = props;
|
10910
|
-
const childArr =
|
10976
|
+
const childArr = React76.Children.toArray(children);
|
10911
10977
|
const firstTab = childArr[0];
|
10912
10978
|
const firstTabValue = isTabComponent(firstTab) ? firstTab.props.value : -1;
|
10913
10979
|
const [selected, setSelected] = useState7((_b = (_a = value != null ? value : defaultValue) != null ? _a : firstTabValue) != null ? _b : 0);
|
@@ -10920,7 +10986,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
10920
10986
|
var _a2, _b2;
|
10921
10987
|
const container = containerRef.current;
|
10922
10988
|
const tabs = tabsRef.current;
|
10923
|
-
const values =
|
10989
|
+
const values = React76.Children.map(
|
10924
10990
|
children,
|
10925
10991
|
(tab, i) => {
|
10926
10992
|
var _a3;
|
@@ -10961,7 +11027,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
10961
11027
|
updateCarets();
|
10962
11028
|
setSelected(value);
|
10963
11029
|
revealSelectedTab({ smooth: value !== selected });
|
10964
|
-
}, [value,
|
11030
|
+
}, [value, React76.Children.count(children)]);
|
10965
11031
|
useLayoutEffect2(() => {
|
10966
11032
|
var _a2;
|
10967
11033
|
updateCarets();
|
@@ -11025,27 +11091,27 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
11025
11091
|
const handleSelected = (key) => {
|
11026
11092
|
(onChange != null ? onChange : setSelected)(key);
|
11027
11093
|
};
|
11028
|
-
|
11094
|
+
React76.Children.forEach(children, (c) => {
|
11029
11095
|
if (c && !isTabComponent(c)) {
|
11030
11096
|
throw new Error("<Tabs> can only have <Tabs.Tab> components as children");
|
11031
11097
|
}
|
11032
11098
|
});
|
11033
|
-
return /* @__PURE__ */
|
11099
|
+
return /* @__PURE__ */ React76.createElement("div", {
|
11034
11100
|
ref: parentRef,
|
11035
11101
|
className: classNames("Aquarium-Tabs", tw("h-full"), className)
|
11036
|
-
}, /* @__PURE__ */
|
11102
|
+
}, /* @__PURE__ */ React76.createElement("div", {
|
11037
11103
|
className: tw("relative flex items-center h-full border-b-2 border-grey-10")
|
11038
|
-
}, /* @__PURE__ */
|
11104
|
+
}, /* @__PURE__ */ React76.createElement("div", {
|
11039
11105
|
ref: containerRef,
|
11040
11106
|
className: tw("overflow-y-auto scrollbar-hide h-full mb-[-2px]")
|
11041
|
-
}, /* @__PURE__ */
|
11107
|
+
}, /* @__PURE__ */ React76.createElement("div", {
|
11042
11108
|
ref: tabsRef,
|
11043
11109
|
role: "tablist",
|
11044
11110
|
"aria-label": "tabs",
|
11045
11111
|
className: tw("inline-flex items-center cursor-pointer font-normal h-full")
|
11046
|
-
},
|
11112
|
+
}, React76.Children.map(
|
11047
11113
|
children,
|
11048
|
-
(tab, index) => tab ? /* @__PURE__ */
|
11114
|
+
(tab, index) => tab ? /* @__PURE__ */ React76.createElement(TabItemComponent, __spreadProps(__spreadValues({
|
11049
11115
|
key: tab.props.value
|
11050
11116
|
}, tab.props), {
|
11051
11117
|
index,
|
@@ -11053,20 +11119,20 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
11053
11119
|
onKeyDown: handleKeyDown,
|
11054
11120
|
onSelected: handleSelected
|
11055
11121
|
})) : void 0
|
11056
|
-
))), leftCaret && /* @__PURE__ */
|
11122
|
+
))), leftCaret && /* @__PURE__ */ React76.createElement("div", {
|
11057
11123
|
className: tw("absolute left-0 bg-gradient-to-r from-white via-white z-20 py-3 pr-4")
|
11058
|
-
}, /* @__PURE__ */
|
11124
|
+
}, /* @__PURE__ */ React76.createElement("div", {
|
11059
11125
|
onClick: () => handleScrollToNext("left"),
|
11060
11126
|
className: tw("hover:bg-grey-0 p-2 leading-none cursor-pointer")
|
11061
|
-
}, /* @__PURE__ */
|
11127
|
+
}, /* @__PURE__ */ React76.createElement(InlineIcon, {
|
11062
11128
|
icon: import_chevronLeft3.default
|
11063
|
-
}))), rightCaret && /* @__PURE__ */
|
11129
|
+
}))), rightCaret && /* @__PURE__ */ React76.createElement("div", {
|
11064
11130
|
onClick: () => handleScrollToNext("right"),
|
11065
11131
|
className: tw("absolute right-0 bg-gradient-to-l from-white via-white z-20 py-3 pl-4")
|
11066
|
-
}, /* @__PURE__ */
|
11132
|
+
}, /* @__PURE__ */ React76.createElement("div", {
|
11067
11133
|
onClick: () => handleScrollToNext("right"),
|
11068
11134
|
className: tw("hover:bg-grey-0 p-2 leading-none cursor-pointer")
|
11069
|
-
}, /* @__PURE__ */
|
11135
|
+
}, /* @__PURE__ */ React76.createElement(InlineIcon, {
|
11070
11136
|
icon: import_chevronRight3.default
|
11071
11137
|
})))), renderChildren(children, selected, props));
|
11072
11138
|
};
|
@@ -11074,7 +11140,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
11074
11140
|
Tabs2.Tab = TabComponent;
|
11075
11141
|
return Tabs2;
|
11076
11142
|
};
|
11077
|
-
var Tabs = createTabsComponent(Tab, TabItem, "Tabs", (children, selected) => /* @__PURE__ */
|
11143
|
+
var Tabs = createTabsComponent(Tab, TabItem, "Tabs", (children, selected) => /* @__PURE__ */ React76.createElement(TabContainer, null, children.find(
|
11078
11144
|
(node, index) => (node == null ? void 0 : node.props.value) === selected || index === selected
|
11079
11145
|
)));
|
11080
11146
|
|
@@ -11083,7 +11149,7 @@ var import_cross6 = __toESM(require_cross());
|
|
11083
11149
|
var Modal2 = (_a) => {
|
11084
11150
|
var _b = _a, { closeOnEsc = true } = _b, props = __objRest(_b, ["closeOnEsc"]);
|
11085
11151
|
const { open, onClose, size, portalContainer } = props;
|
11086
|
-
const ref =
|
11152
|
+
const ref = React77.useRef(null);
|
11087
11153
|
const state = useOverlayTriggerState4({ isOpen: open, onOpenChange: (isOpen) => !isOpen && onClose() });
|
11088
11154
|
const { modalProps, underlayProps } = useModalOverlay2(
|
11089
11155
|
{ isDismissable: false, isKeyboardDismissDisabled: !closeOnEsc },
|
@@ -11093,17 +11159,17 @@ var Modal2 = (_a) => {
|
|
11093
11159
|
if (!state.isOpen) {
|
11094
11160
|
return null;
|
11095
11161
|
}
|
11096
|
-
return /* @__PURE__ */
|
11162
|
+
return /* @__PURE__ */ React77.createElement(Overlay3, {
|
11097
11163
|
portalContainer
|
11098
|
-
}, /* @__PURE__ */
|
11164
|
+
}, /* @__PURE__ */ React77.createElement(Modal, {
|
11099
11165
|
className: "Aquarium-Modal",
|
11100
11166
|
open: true
|
11101
|
-
}, /* @__PURE__ */
|
11167
|
+
}, /* @__PURE__ */ React77.createElement(Modal.BackDrop, __spreadValues({}, underlayProps)), /* @__PURE__ */ React77.createElement(ModalWrapper, __spreadValues(__spreadValues({
|
11102
11168
|
ref,
|
11103
11169
|
size
|
11104
11170
|
}, props), modalProps))));
|
11105
11171
|
};
|
11106
|
-
var ModalWrapper =
|
11172
|
+
var ModalWrapper = React77.forwardRef(
|
11107
11173
|
(_a, ref) => {
|
11108
11174
|
var _b = _a, { title, subtitle, headerImage, primaryAction, secondaryActions, children, onClose } = _b, props = __objRest(_b, ["title", "subtitle", "headerImage", "primaryAction", "secondaryActions", "children", "onClose"]);
|
11109
11175
|
const labelledBy = useId2();
|
@@ -11112,30 +11178,30 @@ var ModalWrapper = React76.forwardRef(
|
|
11112
11178
|
{ "role": "dialog", "aria-labelledby": labelledBy, "aria-describedby": describedBy },
|
11113
11179
|
ref
|
11114
11180
|
);
|
11115
|
-
return /* @__PURE__ */
|
11181
|
+
return /* @__PURE__ */ React77.createElement(Modal.Dialog, __spreadProps(__spreadValues(__spreadValues({
|
11116
11182
|
ref
|
11117
11183
|
}, props), dialogProps), {
|
11118
11184
|
tabIndex: -1
|
11119
|
-
}), /* @__PURE__ */
|
11185
|
+
}), /* @__PURE__ */ React77.createElement(Modal.CloseButtonContainer, null, /* @__PURE__ */ React77.createElement(IconButton, {
|
11120
11186
|
"aria-label": "Close",
|
11121
11187
|
icon: import_cross6.default,
|
11122
11188
|
onClick: onClose
|
11123
|
-
})), headerImage !== void 0 && /* @__PURE__ */
|
11189
|
+
})), headerImage !== void 0 && /* @__PURE__ */ React77.createElement(Modal.HeaderImage, {
|
11124
11190
|
backgroundImage: headerImage
|
11125
|
-
}), /* @__PURE__ */
|
11191
|
+
}), /* @__PURE__ */ React77.createElement(Modal.Header, {
|
11126
11192
|
className: tw({ "pb-3": isComponentType(children, ModalTabs) })
|
11127
|
-
}, /* @__PURE__ */
|
11193
|
+
}, /* @__PURE__ */ React77.createElement(Modal.TitleContainer, null, /* @__PURE__ */ React77.createElement(Modal.Title, {
|
11128
11194
|
id: labelledBy
|
11129
|
-
}, title), subtitle && /* @__PURE__ */
|
11195
|
+
}, title), subtitle && /* @__PURE__ */ React77.createElement(Modal.Subtitle, null, subtitle))), isComponentType(children, ModalTabs) ? React77.cloneElement(children, { className: tw("[&>div:first-child]:px-5 grow") }) : /* @__PURE__ */ React77.createElement(Modal.Body, {
|
11130
11196
|
id: describedBy,
|
11131
11197
|
tabIndex: 0,
|
11132
11198
|
noFooter: !(secondaryActions || primaryAction)
|
11133
|
-
}, children), (secondaryActions || primaryAction) && /* @__PURE__ */
|
11199
|
+
}, children), (secondaryActions || primaryAction) && /* @__PURE__ */ React77.createElement(Modal.Footer, null, /* @__PURE__ */ React77.createElement(Modal.Actions, null, secondaryActions && castArray(secondaryActions).filter(Boolean).map((_a2) => {
|
11134
11200
|
var _b2 = _a2, { text } = _b2, action = __objRest(_b2, ["text"]);
|
11135
|
-
return /* @__PURE__ */
|
11201
|
+
return /* @__PURE__ */ React77.createElement(Button.Secondary, __spreadValues({
|
11136
11202
|
key: text
|
11137
11203
|
}, action), text);
|
11138
|
-
}), primaryAction && /* @__PURE__ */
|
11204
|
+
}), primaryAction && /* @__PURE__ */ React77.createElement(Button.Primary, __spreadValues({
|
11139
11205
|
key: primaryAction.text
|
11140
11206
|
}, omit10(primaryAction, "text")), primaryAction.text))));
|
11141
11207
|
}
|
@@ -11144,24 +11210,24 @@ var ModalTabs = createTabsComponent(
|
|
11144
11210
|
ModalTab,
|
11145
11211
|
TabItem,
|
11146
11212
|
"ModalTabs",
|
11147
|
-
(children, selected, props) => /* @__PURE__ */
|
11213
|
+
(children, selected, props) => /* @__PURE__ */ React77.createElement(Modal.Body, {
|
11148
11214
|
maxHeight: props.maxHeight
|
11149
|
-
}, /* @__PURE__ */
|
11215
|
+
}, /* @__PURE__ */ React77.createElement(ModalTabContainer, null, children.find(
|
11150
11216
|
(node, index) => (node == null ? void 0 : node.props.value) === selected || index === selected
|
11151
11217
|
)))
|
11152
11218
|
);
|
11153
11219
|
|
11154
11220
|
// src/molecules/MultiInput/MultiInput.tsx
|
11155
|
-
import
|
11221
|
+
import React79, { useEffect as useEffect8, useRef as useRef9, useState as useState8 } from "react";
|
11156
11222
|
import castArray2 from "lodash/castArray";
|
11157
11223
|
import identity from "lodash/identity";
|
11158
11224
|
import omit11 from "lodash/omit";
|
11159
11225
|
import uniqueId4 from "lodash/uniqueId";
|
11160
11226
|
|
11161
11227
|
// src/molecules/MultiInput/InputChip.tsx
|
11162
|
-
import
|
11228
|
+
import React78 from "react";
|
11163
11229
|
var import_smallCross2 = __toESM(require_smallCross());
|
11164
|
-
var InputChip =
|
11230
|
+
var InputChip = React78.forwardRef(
|
11165
11231
|
(_a, ref) => {
|
11166
11232
|
var _b = _a, { invalid = false, disabled, readOnly, className, onClick: _onClick, children } = _b, props = __objRest(_b, ["invalid", "disabled", "readOnly", "className", "onClick", "children"]);
|
11167
11233
|
const onClick = (e) => {
|
@@ -11169,18 +11235,18 @@ var InputChip = React77.forwardRef(
|
|
11169
11235
|
_onClick == null ? void 0 : _onClick(e);
|
11170
11236
|
}
|
11171
11237
|
};
|
11172
|
-
return /* @__PURE__ */
|
11238
|
+
return /* @__PURE__ */ React78.createElement("div", {
|
11173
11239
|
className: classNames(className, "inline-flex align-middle mx-1 items-stretch rounded-sm break-all", {
|
11174
11240
|
"bg-error-0 ": invalid,
|
11175
11241
|
"bg-grey-0 ": !invalid && !disabled,
|
11176
11242
|
"bg-grey-5": disabled
|
11177
11243
|
})
|
11178
|
-
}, /* @__PURE__ */
|
11244
|
+
}, /* @__PURE__ */ React78.createElement("div", {
|
11179
11245
|
className: tw("px-2 py-1")
|
11180
|
-
}, /* @__PURE__ */
|
11246
|
+
}, /* @__PURE__ */ React78.createElement(Typography2, {
|
11181
11247
|
variant: "small",
|
11182
11248
|
color: invalid ? "error-80" : disabled ? "grey-40" : "grey-70"
|
11183
|
-
}, children)), !readOnly && /* @__PURE__ */
|
11249
|
+
}, children)), !readOnly && /* @__PURE__ */ React78.createElement("div", __spreadProps(__spreadValues({
|
11184
11250
|
ref
|
11185
11251
|
}, props), {
|
11186
11252
|
onClick,
|
@@ -11191,7 +11257,7 @@ var InputChip = React77.forwardRef(
|
|
11191
11257
|
}),
|
11192
11258
|
role: "button",
|
11193
11259
|
"aria-label": `Remove ${children}`
|
11194
|
-
}), /* @__PURE__ */
|
11260
|
+
}), /* @__PURE__ */ React78.createElement(Icon, {
|
11195
11261
|
icon: import_smallCross2.default,
|
11196
11262
|
className: tw({
|
11197
11263
|
"text-error-70": invalid,
|
@@ -11332,7 +11398,7 @@ var MultiInputBase = (_a) => {
|
|
11332
11398
|
};
|
11333
11399
|
const renderChips = () => items == null ? void 0 : items.map((item, index) => {
|
11334
11400
|
var _a3;
|
11335
|
-
return /* @__PURE__ */
|
11401
|
+
return /* @__PURE__ */ React79.createElement(InputChip, {
|
11336
11402
|
key: `${itemToString(item)}.${index}`,
|
11337
11403
|
invalid: !((_a3 = isItemValid == null ? void 0 : isItemValid(item, index)) != null ? _a3 : true),
|
11338
11404
|
readOnly,
|
@@ -11343,13 +11409,13 @@ var MultiInputBase = (_a) => {
|
|
11343
11409
|
}
|
11344
11410
|
}, itemToString(item));
|
11345
11411
|
});
|
11346
|
-
return /* @__PURE__ */
|
11412
|
+
return /* @__PURE__ */ React79.createElement("div", {
|
11347
11413
|
className: "Aquarium-MultiInputBase"
|
11348
|
-
}, /* @__PURE__ */
|
11414
|
+
}, /* @__PURE__ */ React79.createElement(Select.InputContainer, {
|
11349
11415
|
variant: disabled ? "disabled" : valid === false ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default"
|
11350
|
-
}, /* @__PURE__ */
|
11416
|
+
}, /* @__PURE__ */ React79.createElement("div", {
|
11351
11417
|
className: "grow inline-flex flex-row flex-wrap gap-y-2"
|
11352
|
-
}, inline && renderChips(), /* @__PURE__ */
|
11418
|
+
}, inline && renderChips(), /* @__PURE__ */ React79.createElement(Select.Input, __spreadProps(__spreadValues({
|
11353
11419
|
ref: inputRef,
|
11354
11420
|
id: id != null ? id : name,
|
11355
11421
|
name,
|
@@ -11367,11 +11433,11 @@ var MultiInputBase = (_a) => {
|
|
11367
11433
|
onFocus: handleFocus,
|
11368
11434
|
onBlur: handleBlur,
|
11369
11435
|
autoComplete: "off"
|
11370
|
-
}))), endAdornment && /* @__PURE__ */
|
11436
|
+
}))), endAdornment && /* @__PURE__ */ React79.createElement(InputAdornment, null, endAdornment)), !inline && /* @__PURE__ */ React79.createElement("div", {
|
11371
11437
|
className: tw("flex flex-row flex-wrap gap-y-2 mt-2")
|
11372
11438
|
}, renderChips()));
|
11373
11439
|
};
|
11374
|
-
var BaseMultiInputSkeleton = () => /* @__PURE__ */
|
11440
|
+
var BaseMultiInputSkeleton = () => /* @__PURE__ */ React79.createElement(Skeleton, {
|
11375
11441
|
height: 38
|
11376
11442
|
});
|
11377
11443
|
MultiInputBase.Skeleton = BaseMultiInputSkeleton;
|
@@ -11388,7 +11454,7 @@ var MultiInput = (props) => {
|
|
11388
11454
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
11389
11455
|
const labelControlProps = getLabelControlProps(props);
|
11390
11456
|
const baseProps = omit11(props, Object.keys(labelControlProps));
|
11391
|
-
return /* @__PURE__ */
|
11457
|
+
return /* @__PURE__ */ React79.createElement(LabelControl, __spreadProps(__spreadValues({
|
11392
11458
|
id: `${id.current}-label`,
|
11393
11459
|
htmlFor: `${id.current}-input`,
|
11394
11460
|
messageId: errorMessageId
|
@@ -11396,7 +11462,7 @@ var MultiInput = (props) => {
|
|
11396
11462
|
length: value.length,
|
11397
11463
|
maxLength,
|
11398
11464
|
className: "Aquarium-MultiInput"
|
11399
|
-
}), /* @__PURE__ */
|
11465
|
+
}), /* @__PURE__ */ React79.createElement(MultiInputBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
|
11400
11466
|
id: `${id.current}-input`,
|
11401
11467
|
onChange: (value2) => {
|
11402
11468
|
var _a2;
|
@@ -11408,12 +11474,12 @@ var MultiInput = (props) => {
|
|
11408
11474
|
valid: props.valid
|
11409
11475
|
})));
|
11410
11476
|
};
|
11411
|
-
var MultiInputSkeleton = () => /* @__PURE__ */
|
11477
|
+
var MultiInputSkeleton = () => /* @__PURE__ */ React79.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React79.createElement(MultiInputBase.Skeleton, null));
|
11412
11478
|
MultiInput.Skeleton = MultiInputSkeleton;
|
11413
11479
|
MultiInput.Skeleton.displayName = "MultiInput.Skeleton";
|
11414
11480
|
|
11415
11481
|
// src/molecules/MultiSelect/MultiSelect.tsx
|
11416
|
-
import
|
11482
|
+
import React80, { useEffect as useEffect9, useRef as useRef10, useState as useState9 } from "react";
|
11417
11483
|
import { ariaHideOutside as ariaHideOutside2 } from "@react-aria/overlays";
|
11418
11484
|
import { useCombobox as useCombobox2, useMultipleSelection } from "downshift";
|
11419
11485
|
import isEqual from "lodash/isEqual";
|
@@ -11558,7 +11624,7 @@ var MultiSelectBase = (_a) => {
|
|
11558
11624
|
}
|
11559
11625
|
}, [state.isOpen, inputRef, popoverRef]);
|
11560
11626
|
const renderChips = () => {
|
11561
|
-
return selectedItems.map((selectedItem, index) => /* @__PURE__ */
|
11627
|
+
return selectedItems.map((selectedItem, index) => /* @__PURE__ */ React80.createElement(InputChip, __spreadProps(__spreadValues({
|
11562
11628
|
key: `${itemToString(selectedItem)}.chip`,
|
11563
11629
|
className: tw("mx-0"),
|
11564
11630
|
disabled,
|
@@ -11574,14 +11640,14 @@ var MultiSelectBase = (_a) => {
|
|
11574
11640
|
const hasNoResults = options.length === 0 || filteredOptions.length === 0;
|
11575
11641
|
const inputProps = getInputProps(getDropdownProps({ ref: inputRef, disabled: disabled || readOnly }));
|
11576
11642
|
const menuProps = getMenuProps({ ref: menuRef }, { suppressRefError: !isOpen });
|
11577
|
-
return /* @__PURE__ */
|
11643
|
+
return /* @__PURE__ */ React80.createElement("div", {
|
11578
11644
|
className: classNames("Aquarium-MultiSelectBase", tw("relative"))
|
11579
|
-
}, /* @__PURE__ */
|
11645
|
+
}, /* @__PURE__ */ React80.createElement(Select.InputContainer, {
|
11580
11646
|
ref: targetRef,
|
11581
11647
|
variant: disabled ? "disabled" : !valid ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default"
|
11582
|
-
}, /* @__PURE__ */
|
11648
|
+
}, /* @__PURE__ */ React80.createElement("div", {
|
11583
11649
|
className: "grow inline-flex flex-row flex-wrap gap-2"
|
11584
|
-
}, !hideChips && inline && renderChips(), /* @__PURE__ */
|
11650
|
+
}, !hideChips && inline && renderChips(), /* @__PURE__ */ React80.createElement(Select.Input, __spreadProps(__spreadValues(__spreadValues({
|
11585
11651
|
id,
|
11586
11652
|
ref: inputRef,
|
11587
11653
|
name,
|
@@ -11603,12 +11669,12 @@ var MultiSelectBase = (_a) => {
|
|
11603
11669
|
setFocus(false);
|
11604
11670
|
(_a3 = inputProps.onBlur) == null ? void 0 : _a3.call(inputProps, e);
|
11605
11671
|
}
|
11606
|
-
}))), !readOnly && /* @__PURE__ */
|
11672
|
+
}))), !readOnly && /* @__PURE__ */ React80.createElement(Select.Toggle, __spreadValues({
|
11607
11673
|
hasFocus,
|
11608
11674
|
isOpen
|
11609
|
-
}, getToggleButtonProps({ disabled })))), !hideChips && !inline && /* @__PURE__ */
|
11675
|
+
}, getToggleButtonProps({ disabled })))), !hideChips && !inline && /* @__PURE__ */ React80.createElement("div", {
|
11610
11676
|
className: tw("flex flex-row flex-wrap gap-2 mt-2")
|
11611
|
-
}, renderChips()), isOpen && /* @__PURE__ */
|
11677
|
+
}, renderChips()), isOpen && /* @__PURE__ */ React80.createElement(PopoverOverlay, {
|
11612
11678
|
ref: popoverRef,
|
11613
11679
|
triggerRef: targetRef,
|
11614
11680
|
state,
|
@@ -11616,16 +11682,16 @@ var MultiSelectBase = (_a) => {
|
|
11616
11682
|
shouldFlip: true,
|
11617
11683
|
isNonModal: true,
|
11618
11684
|
style: { width: (_a2 = targetRef.current) == null ? void 0 : _a2.offsetWidth }
|
11619
|
-
}, /* @__PURE__ */
|
11685
|
+
}, /* @__PURE__ */ React80.createElement(Select.Menu, __spreadValues({
|
11620
11686
|
ref: menuRef,
|
11621
11687
|
maxHeight
|
11622
|
-
}, menuProps), hasNoResults && /* @__PURE__ */
|
11688
|
+
}, menuProps), hasNoResults && /* @__PURE__ */ React80.createElement(Select.NoResults, null, noResults), filteredOptions.map((item, index) => /* @__PURE__ */ React80.createElement(Select.Item, __spreadValues({
|
11623
11689
|
key: itemToString(item),
|
11624
11690
|
highlighted: index === highlightedIndex,
|
11625
11691
|
selected: selectedItems.includes(item)
|
11626
11692
|
}, getItemProps({ item, index, disabled: isOptionDisabled(item, index) })), renderOption(item))))));
|
11627
11693
|
};
|
11628
|
-
var MultiSelectBaseSkeleton = () => /* @__PURE__ */
|
11694
|
+
var MultiSelectBaseSkeleton = () => /* @__PURE__ */ React80.createElement(Skeleton, {
|
11629
11695
|
height: 38
|
11630
11696
|
});
|
11631
11697
|
MultiSelectBase.Skeleton = MultiSelectBaseSkeleton;
|
@@ -11643,13 +11709,13 @@ var MultiSelect = (_a) => {
|
|
11643
11709
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
11644
11710
|
const labelControlProps = getLabelControlProps(props);
|
11645
11711
|
const baseProps = omit12(props, Object.keys(labelControlProps));
|
11646
|
-
return /* @__PURE__ */
|
11712
|
+
return /* @__PURE__ */ React80.createElement(LabelControl, __spreadProps(__spreadValues({
|
11647
11713
|
id: `${id.current}-label`,
|
11648
11714
|
htmlFor: `${id.current}-input`,
|
11649
11715
|
messageId: errorMessageId
|
11650
11716
|
}, labelControlProps), {
|
11651
11717
|
className: "Aquarium-MultiSelect"
|
11652
|
-
}), /* @__PURE__ */
|
11718
|
+
}), /* @__PURE__ */ React80.createElement(MultiSelectBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
|
11653
11719
|
id: id.current,
|
11654
11720
|
options,
|
11655
11721
|
noResults,
|
@@ -11657,16 +11723,16 @@ var MultiSelect = (_a) => {
|
|
11657
11723
|
valid: props.valid
|
11658
11724
|
})));
|
11659
11725
|
};
|
11660
|
-
var MultiSelectSkeleton = () => /* @__PURE__ */
|
11726
|
+
var MultiSelectSkeleton = () => /* @__PURE__ */ React80.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React80.createElement(MultiSelectBase.Skeleton, null));
|
11661
11727
|
MultiSelect.Skeleton = MultiSelectSkeleton;
|
11662
11728
|
MultiSelect.Skeleton.displayName = "MultiSelect.Skeleton";
|
11663
11729
|
|
11664
11730
|
// src/molecules/NativeSelect/NativeSelect.tsx
|
11665
|
-
import
|
11731
|
+
import React81, { useRef as useRef11 } from "react";
|
11666
11732
|
import omit13 from "lodash/omit";
|
11667
11733
|
import uniqueId6 from "lodash/uniqueId";
|
11668
11734
|
var import_caretDown2 = __toESM(require_caretDown());
|
11669
|
-
var NativeSelectBase =
|
11735
|
+
var NativeSelectBase = React81.forwardRef(
|
11670
11736
|
(_a, ref) => {
|
11671
11737
|
var _b = _a, { children, disabled = false, required = false, valid = true, readOnly = false } = _b, props = __objRest(_b, ["children", "disabled", "required", "valid", "readOnly"]);
|
11672
11738
|
const placeholderValue = uniqueId6("default_value_for_placeholder");
|
@@ -11683,16 +11749,16 @@ var NativeSelectBase = React80.forwardRef(
|
|
11683
11749
|
(_b2 = props.onBlur) == null ? void 0 : _b2.call(props, event);
|
11684
11750
|
}
|
11685
11751
|
};
|
11686
|
-
return /* @__PURE__ */
|
11752
|
+
return /* @__PURE__ */ React81.createElement("span", {
|
11687
11753
|
className: classNames("Aquarium-NativeSelectBase", tw("relative block"))
|
11688
|
-
}, !readOnly && /* @__PURE__ */
|
11754
|
+
}, !readOnly && /* @__PURE__ */ React81.createElement("span", {
|
11689
11755
|
className: tw(
|
11690
11756
|
"absolute right-0 inset-y-0 mr-4 text-grey-40 flex ml-3 pointer-events-none typography-default-strong mt-4"
|
11691
11757
|
)
|
11692
|
-
}, /* @__PURE__ */
|
11758
|
+
}, /* @__PURE__ */ React81.createElement(Icon, {
|
11693
11759
|
icon: import_caretDown2.default,
|
11694
11760
|
"data-testid": "icon-dropdown"
|
11695
|
-
})), /* @__PURE__ */
|
11761
|
+
})), /* @__PURE__ */ React81.createElement("select", __spreadProps(__spreadValues({
|
11696
11762
|
ref,
|
11697
11763
|
disabled: disabled || readOnly,
|
11698
11764
|
required
|
@@ -11711,16 +11777,16 @@ var NativeSelectBase = React80.forwardRef(
|
|
11711
11777
|
),
|
11712
11778
|
props.className
|
11713
11779
|
)
|
11714
|
-
}), props.placeholder && /* @__PURE__ */
|
11780
|
+
}), props.placeholder && /* @__PURE__ */ React81.createElement("option", {
|
11715
11781
|
value: placeholderValue,
|
11716
11782
|
disabled: true
|
11717
11783
|
}, props.placeholder), children));
|
11718
11784
|
}
|
11719
11785
|
);
|
11720
|
-
NativeSelectBase.Skeleton = () => /* @__PURE__ */
|
11786
|
+
NativeSelectBase.Skeleton = () => /* @__PURE__ */ React81.createElement(Skeleton, {
|
11721
11787
|
height: 38
|
11722
11788
|
});
|
11723
|
-
var NativeSelect =
|
11789
|
+
var NativeSelect = React81.forwardRef(
|
11724
11790
|
(_a, ref) => {
|
11725
11791
|
var _b = _a, { readOnly } = _b, props = __objRest(_b, ["readOnly"]);
|
11726
11792
|
var _a2;
|
@@ -11729,13 +11795,13 @@ var NativeSelect = React80.forwardRef(
|
|
11729
11795
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
11730
11796
|
const _b2 = getLabelControlProps(props), { "data-testid": dataTestId } = _b2, labelControlProps = __objRest(_b2, ["data-testid"]);
|
11731
11797
|
const baseProps = omit13(props, Object.keys(labelControlProps));
|
11732
|
-
return /* @__PURE__ */
|
11798
|
+
return /* @__PURE__ */ React81.createElement(LabelControl, __spreadProps(__spreadValues({
|
11733
11799
|
id: `${id.current}-label`,
|
11734
11800
|
htmlFor: id.current,
|
11735
11801
|
messageId: errorMessageId
|
11736
11802
|
}, labelControlProps), {
|
11737
11803
|
className: "Aquarium-NativeSelect"
|
11738
|
-
}), /* @__PURE__ */
|
11804
|
+
}), /* @__PURE__ */ React81.createElement(NativeSelectBase, __spreadProps(__spreadValues(__spreadValues({
|
11739
11805
|
ref
|
11740
11806
|
}, baseProps), errorProps), {
|
11741
11807
|
id: id.current,
|
@@ -11749,63 +11815,63 @@ var NativeSelect = React80.forwardRef(
|
|
11749
11815
|
}
|
11750
11816
|
);
|
11751
11817
|
NativeSelect.displayName = "NativeSelect";
|
11752
|
-
var Option =
|
11818
|
+
var Option = React81.forwardRef((_a, ref) => {
|
11753
11819
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
11754
|
-
return /* @__PURE__ */
|
11820
|
+
return /* @__PURE__ */ React81.createElement("option", __spreadValues({
|
11755
11821
|
ref
|
11756
11822
|
}, props), children);
|
11757
11823
|
});
|
11758
11824
|
Option.displayName = "Option";
|
11759
|
-
var NativeSelectSkeleton = () => /* @__PURE__ */
|
11825
|
+
var NativeSelectSkeleton = () => /* @__PURE__ */ React81.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React81.createElement(NativeSelectBase.Skeleton, null), /* @__PURE__ */ React81.createElement("div", {
|
11760
11826
|
style: { height: "1px" }
|
11761
11827
|
}));
|
11762
11828
|
NativeSelect.Skeleton = NativeSelectSkeleton;
|
11763
11829
|
NativeSelect.Skeleton.displayName = "NativeSelect.Skeleton";
|
11764
11830
|
|
11765
11831
|
// src/molecules/Navigation/Navigation.tsx
|
11766
|
-
import
|
11832
|
+
import React83 from "react";
|
11767
11833
|
import classNames9 from "classnames";
|
11768
11834
|
|
11769
11835
|
// src/atoms/Navigation/Navigation.tsx
|
11770
|
-
import
|
11836
|
+
import React82 from "react";
|
11771
11837
|
var Navigation = (_a) => {
|
11772
11838
|
var _b = _a, { className, children } = _b, rest = __objRest(_b, ["className", "children"]);
|
11773
|
-
return /* @__PURE__ */
|
11839
|
+
return /* @__PURE__ */ React82.createElement("nav", {
|
11774
11840
|
className: classNames(tw("bg-grey-0 h-full"))
|
11775
|
-
}, /* @__PURE__ */
|
11841
|
+
}, /* @__PURE__ */ React82.createElement("ul", __spreadProps(__spreadValues({}, rest), {
|
11776
11842
|
className: classNames(tw("flex flex-col h-full"), className),
|
11777
11843
|
role: "menu"
|
11778
11844
|
}), children));
|
11779
11845
|
};
|
11780
11846
|
var Header = (_a) => {
|
11781
11847
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
11782
|
-
return /* @__PURE__ */
|
11848
|
+
return /* @__PURE__ */ React82.createElement("li", __spreadProps(__spreadValues({}, rest), {
|
11783
11849
|
role: "presentation",
|
11784
11850
|
className: classNames(tw("px-6 py-5"), className)
|
11785
11851
|
}));
|
11786
11852
|
};
|
11787
11853
|
var Footer = (_a) => {
|
11788
11854
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
11789
|
-
return /* @__PURE__ */
|
11855
|
+
return /* @__PURE__ */ React82.createElement("li", __spreadProps(__spreadValues({}, rest), {
|
11790
11856
|
role: "presentation",
|
11791
11857
|
className: classNames(tw("px-6 py-5 mt-auto"), className)
|
11792
11858
|
}));
|
11793
11859
|
};
|
11794
11860
|
var Section2 = (_a) => {
|
11795
11861
|
var _b = _a, { title, className } = _b, rest = __objRest(_b, ["title", "className"]);
|
11796
|
-
return /* @__PURE__ */
|
11862
|
+
return /* @__PURE__ */ React82.createElement("li", {
|
11797
11863
|
role: "presentation",
|
11798
11864
|
className: tw("py-5")
|
11799
|
-
}, title && /* @__PURE__ */
|
11865
|
+
}, title && /* @__PURE__ */ React82.createElement("div", {
|
11800
11866
|
className: classNames(className, "py-2 px-6 text-grey-40 uppercase cursor-default typography-caption")
|
11801
|
-
}, title), /* @__PURE__ */
|
11867
|
+
}, title), /* @__PURE__ */ React82.createElement("ul", __spreadProps(__spreadValues({}, rest), {
|
11802
11868
|
role: "group",
|
11803
11869
|
className: classNames(tw("flex flex-col"), className)
|
11804
11870
|
})));
|
11805
11871
|
};
|
11806
11872
|
var Divider3 = (_a) => {
|
11807
11873
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
11808
|
-
return /* @__PURE__ */
|
11874
|
+
return /* @__PURE__ */ React82.createElement("li", __spreadProps(__spreadValues({
|
11809
11875
|
role: "separator"
|
11810
11876
|
}, rest), {
|
11811
11877
|
className: classNames(tw("border-t-2 border-grey-5"), className)
|
@@ -11813,9 +11879,9 @@ var Divider3 = (_a) => {
|
|
11813
11879
|
};
|
11814
11880
|
var Item5 = (_a) => {
|
11815
11881
|
var _b = _a, { className, active } = _b, rest = __objRest(_b, ["className", "active"]);
|
11816
|
-
return /* @__PURE__ */
|
11882
|
+
return /* @__PURE__ */ React82.createElement("li", {
|
11817
11883
|
role: "presentation"
|
11818
|
-
}, /* @__PURE__ */
|
11884
|
+
}, /* @__PURE__ */ React82.createElement("a", __spreadProps(__spreadValues({}, rest), {
|
11819
11885
|
role: "menuitem",
|
11820
11886
|
className: classNames(
|
11821
11887
|
tw("py-3 px-6 hover:bg-grey-5 cursor-pointer flex gap-4 items-center typography-small focusable", {
|
@@ -11835,13 +11901,25 @@ Navigation.Divider = Divider3;
|
|
11835
11901
|
// src/molecules/Navigation/Navigation.tsx
|
11836
11902
|
var Navigation2 = (_a) => {
|
11837
11903
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
11838
|
-
return /* @__PURE__ */
|
11904
|
+
return /* @__PURE__ */ React83.createElement(Navigation, __spreadValues({
|
11839
11905
|
className: classNames9("Aquarium-Navigation", className)
|
11840
11906
|
}, props));
|
11841
11907
|
};
|
11842
11908
|
var Item6 = (_a) => {
|
11843
|
-
var _b = _a, {
|
11844
|
-
|
11909
|
+
var _b = _a, {
|
11910
|
+
children,
|
11911
|
+
icon,
|
11912
|
+
showNotification = false
|
11913
|
+
} = _b, rest = __objRest(_b, [
|
11914
|
+
"children",
|
11915
|
+
"icon",
|
11916
|
+
"showNotification"
|
11917
|
+
]);
|
11918
|
+
return /* @__PURE__ */ React83.createElement(Navigation.Item, __spreadValues({}, rest), icon && showNotification && /* @__PURE__ */ React83.createElement(Badge.Notification, null, /* @__PURE__ */ React83.createElement(InlineIcon, {
|
11919
|
+
icon,
|
11920
|
+
width: "20px",
|
11921
|
+
height: "20px"
|
11922
|
+
})), icon && !showNotification && /* @__PURE__ */ React83.createElement(InlineIcon, {
|
11845
11923
|
icon,
|
11846
11924
|
width: "20px",
|
11847
11925
|
height: "20px"
|
@@ -11854,51 +11932,51 @@ Navigation2.Header = Navigation.Header;
|
|
11854
11932
|
Navigation2.Section = Navigation.Section;
|
11855
11933
|
|
11856
11934
|
// src/molecules/PageHeader/PageHeader.tsx
|
11857
|
-
import
|
11935
|
+
import React85 from "react";
|
11858
11936
|
import castArray3 from "lodash/castArray";
|
11859
11937
|
import omit14 from "lodash/omit";
|
11860
11938
|
|
11861
11939
|
// src/atoms/PageHeader/PageHeader.tsx
|
11862
|
-
import
|
11940
|
+
import React84 from "react";
|
11863
11941
|
var PageHeader = (_a) => {
|
11864
11942
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
11865
|
-
return /* @__PURE__ */
|
11943
|
+
return /* @__PURE__ */ React84.createElement("div", __spreadValues({
|
11866
11944
|
className: classNames(tw("flex flex-row gap-4 pb-6"), className)
|
11867
11945
|
}, rest), children);
|
11868
11946
|
};
|
11869
11947
|
PageHeader.Container = (_a) => {
|
11870
11948
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
11871
|
-
return /* @__PURE__ */
|
11949
|
+
return /* @__PURE__ */ React84.createElement("div", __spreadValues({
|
11872
11950
|
className: classNames(tw("flex flex-col grow gap-0"), className)
|
11873
11951
|
}, rest), children);
|
11874
11952
|
};
|
11875
11953
|
PageHeader.TitleContainer = (_a) => {
|
11876
11954
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
11877
|
-
return /* @__PURE__ */
|
11955
|
+
return /* @__PURE__ */ React84.createElement("div", __spreadValues({
|
11878
11956
|
className: classNames(tw("flex flex-col justify-center gap-2"), className)
|
11879
11957
|
}, rest), children);
|
11880
11958
|
};
|
11881
11959
|
PageHeader.Title = (_a) => {
|
11882
11960
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
11883
|
-
return /* @__PURE__ */
|
11961
|
+
return /* @__PURE__ */ React84.createElement(Typography2.Heading, __spreadProps(__spreadValues({}, rest), {
|
11884
11962
|
color: "grey-100"
|
11885
11963
|
}), children);
|
11886
11964
|
};
|
11887
11965
|
PageHeader.Subtitle = (_a) => {
|
11888
11966
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
11889
|
-
return /* @__PURE__ */
|
11967
|
+
return /* @__PURE__ */ React84.createElement(Typography2.Small, __spreadProps(__spreadValues({}, rest), {
|
11890
11968
|
color: "grey-70"
|
11891
11969
|
}), children);
|
11892
11970
|
};
|
11893
11971
|
PageHeader.Chips = (_a) => {
|
11894
11972
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
11895
|
-
return /* @__PURE__ */
|
11973
|
+
return /* @__PURE__ */ React84.createElement("div", __spreadValues({
|
11896
11974
|
className: classNames(tw("flex gap-3"), className)
|
11897
11975
|
}, rest), children);
|
11898
11976
|
};
|
11899
11977
|
PageHeader.Actions = (_a) => {
|
11900
11978
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
11901
|
-
return /* @__PURE__ */
|
11979
|
+
return /* @__PURE__ */ React84.createElement("div", __spreadValues({
|
11902
11980
|
className: classNames(tw("flex flex-row gap-4 self-start"), className)
|
11903
11981
|
}, rest), children);
|
11904
11982
|
};
|
@@ -11914,36 +11992,41 @@ var PageHeader2 = ({
|
|
11914
11992
|
chips = [],
|
11915
11993
|
breadcrumbs
|
11916
11994
|
}) => {
|
11917
|
-
return /* @__PURE__ */
|
11995
|
+
return /* @__PURE__ */ React85.createElement(PageHeader, {
|
11918
11996
|
className: "Aquarium-PageHeader"
|
11919
|
-
}, /* @__PURE__ */
|
11997
|
+
}, /* @__PURE__ */ React85.createElement(PageHeader.Container, null, breadcrumbs && /* @__PURE__ */ React85.createElement(Box, {
|
11920
11998
|
marginBottom: image ? "3" : void 0
|
11921
|
-
}, /* @__PURE__ */
|
11999
|
+
}, /* @__PURE__ */ React85.createElement(Breadcrumbs, null, breadcrumbs)), /* @__PURE__ */ React85.createElement(Flexbox, {
|
11922
12000
|
gap: "5"
|
11923
|
-
}, image && /* @__PURE__ */
|
12001
|
+
}, image && /* @__PURE__ */ React85.createElement("img", {
|
11924
12002
|
src: image,
|
11925
12003
|
alt: imageAlt,
|
11926
12004
|
className: tw("w-[56px] h-[56px]")
|
11927
|
-
}), /* @__PURE__ */
|
12005
|
+
}), /* @__PURE__ */ React85.createElement(PageHeader.TitleContainer, null, /* @__PURE__ */ React85.createElement(PageHeader.Title, null, title), chips.length > 0 && /* @__PURE__ */ React85.createElement(PageHeader.Chips, null, chips.map((chip) => /* @__PURE__ */ React85.createElement(Chip2, {
|
11928
12006
|
key: chip,
|
11929
12007
|
dense: true,
|
11930
12008
|
text: chip
|
11931
|
-
}))), subtitle && /* @__PURE__ */
|
11932
|
-
|
11933
|
-
|
11934
|
-
|
11935
|
-
|
11936
|
-
|
12009
|
+
}))), subtitle && /* @__PURE__ */ React85.createElement(PageHeader.Subtitle, null, subtitle)))), (secondaryActions || primaryAction) && /* @__PURE__ */ React85.createElement(PageHeader.Actions, null, secondaryActions && castArray3(secondaryActions).filter(Boolean).map(
|
12010
|
+
(action) => !isLink(action) ? /* @__PURE__ */ React85.createElement(Button.Secondary, __spreadValues({
|
12011
|
+
key: action.text
|
12012
|
+
}, omit14(action, "text")), action.text) : /* @__PURE__ */ React85.createElement(Button.ExternalLink, __spreadValues({
|
12013
|
+
key: action.text,
|
12014
|
+
kind: "secondary"
|
12015
|
+
}, omit14(action, "text")), action.text)
|
12016
|
+
), primaryAction && /* @__PURE__ */ React85.createElement(React85.Fragment, null, !isLink(primaryAction) && /* @__PURE__ */ React85.createElement(Button.Primary, __spreadValues({
|
11937
12017
|
key: primaryAction.text
|
11938
|
-
}, omit14(primaryAction, "text")), primaryAction.text))
|
12018
|
+
}, omit14(primaryAction, "text")), primaryAction.text), isLink(primaryAction) && /* @__PURE__ */ React85.createElement(Button.ExternalLink, __spreadValues({
|
12019
|
+
key: primaryAction.text,
|
12020
|
+
kind: "primary"
|
12021
|
+
}, omit14(primaryAction, "text")), primaryAction.text))));
|
11939
12022
|
};
|
11940
12023
|
|
11941
12024
|
// src/molecules/Pagination/Pagination.tsx
|
11942
|
-
import
|
12025
|
+
import React87 from "react";
|
11943
12026
|
import clamp from "lodash/clamp";
|
11944
12027
|
|
11945
12028
|
// src/molecules/Select/Select.tsx
|
11946
|
-
import
|
12029
|
+
import React86, { useRef as useRef12, useState as useState10 } from "react";
|
11947
12030
|
import { useSelect } from "downshift";
|
11948
12031
|
import defaults from "lodash/defaults";
|
11949
12032
|
import isArray from "lodash/isArray";
|
@@ -11959,10 +12042,10 @@ var hasOptionGroups = (val) => {
|
|
11959
12042
|
};
|
11960
12043
|
var defaultRenderOption = (item, props, { selectedItem }, { getOptionKey, getValue, optionToString = getOptionLabelBuiltin }) => {
|
11961
12044
|
var _a, _b;
|
11962
|
-
return /* @__PURE__ */
|
12045
|
+
return /* @__PURE__ */ React86.createElement(Select.Item, __spreadValues({
|
11963
12046
|
key: (_b = (_a = getOptionKey == null ? void 0 : getOptionKey(item)) != null ? _a : getValue == null ? void 0 : getValue(item)) != null ? _b : optionToString(item),
|
11964
12047
|
selected: item === selectedItem
|
11965
|
-
}, props), hasIconProperty(item) && /* @__PURE__ */
|
12048
|
+
}, props), hasIconProperty(item) && /* @__PURE__ */ React86.createElement(InlineIcon, {
|
11966
12049
|
icon: item.icon
|
11967
12050
|
}), optionToString(item));
|
11968
12051
|
};
|
@@ -12081,13 +12164,13 @@ var _SelectBase = (props) => {
|
|
12081
12164
|
},
|
12082
12165
|
withDefaults
|
12083
12166
|
);
|
12084
|
-
const renderGroup = (group) => /* @__PURE__ */
|
12167
|
+
const renderGroup = (group) => /* @__PURE__ */ React86.createElement(React86.Fragment, {
|
12085
12168
|
key: group.label
|
12086
|
-
}, /* @__PURE__ */
|
12087
|
-
const input = /* @__PURE__ */
|
12169
|
+
}, /* @__PURE__ */ React86.createElement(Select.Group, null, group.label), group.options.map((opt) => renderItem(opt, items.indexOf(opt))));
|
12170
|
+
const input = /* @__PURE__ */ React86.createElement(Select.InputContainer, __spreadProps(__spreadValues({}, getToggleButtonProps({ disabled: disabled || readOnly, ref: targetRef })), {
|
12088
12171
|
variant: disabled ? "disabled" : !valid ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default",
|
12089
12172
|
tabIndex: 0
|
12090
|
-
}), /* @__PURE__ */
|
12173
|
+
}), /* @__PURE__ */ React86.createElement(Select.Input, __spreadProps(__spreadValues({
|
12091
12174
|
id,
|
12092
12175
|
name
|
12093
12176
|
}, rest), {
|
@@ -12099,26 +12182,26 @@ var _SelectBase = (props) => {
|
|
12099
12182
|
tabIndex: -1,
|
12100
12183
|
onFocus: () => setFocus(true),
|
12101
12184
|
onBlur: () => setFocus(false)
|
12102
|
-
})), !readOnly && /* @__PURE__ */
|
12185
|
+
})), !readOnly && /* @__PURE__ */ React86.createElement(Select.Toggle, {
|
12103
12186
|
disabled,
|
12104
12187
|
isOpen,
|
12105
12188
|
tabIndex: -1
|
12106
12189
|
}));
|
12107
12190
|
const menuProps = getMenuProps({ ref: menuRef }, { suppressRefError: !isOpen });
|
12108
|
-
return /* @__PURE__ */
|
12191
|
+
return /* @__PURE__ */ React86.createElement("div", {
|
12109
12192
|
className: classNames("Aquarium-SelectBase", tw("relative"))
|
12110
|
-
}, labelWrapper ?
|
12193
|
+
}, labelWrapper ? React86.cloneElement(labelWrapper, { children: input }) : input, isOpen && /* @__PURE__ */ React86.createElement(PopoverOverlay, {
|
12111
12194
|
state,
|
12112
12195
|
triggerRef: targetRef,
|
12113
12196
|
placement: "bottom-left",
|
12114
12197
|
shouldFlip: true,
|
12115
12198
|
style: { width: (_b = targetRef.current) == null ? void 0 : _b.offsetWidth }
|
12116
|
-
}, /* @__PURE__ */
|
12199
|
+
}, /* @__PURE__ */ React86.createElement(Select.Menu, __spreadValues({
|
12117
12200
|
ref: menuRef,
|
12118
12201
|
maxHeight
|
12119
|
-
}, menuProps), options.length === 0 && /* @__PURE__ */
|
12202
|
+
}, menuProps), options.length === 0 && /* @__PURE__ */ React86.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__ */ React86.createElement(React86.Fragment, null, /* @__PURE__ */ React86.createElement(Select.Divider, {
|
12120
12203
|
onMouseOver: () => setHighlightedIndex(-1)
|
12121
|
-
}), actions.map((act, index) => /* @__PURE__ */
|
12204
|
+
}), actions.map((act, index) => /* @__PURE__ */ React86.createElement(Select.ActionItem, __spreadProps(__spreadValues({
|
12122
12205
|
key: `${index}`
|
12123
12206
|
}, act), {
|
12124
12207
|
onMouseOver: () => setHighlightedIndex(-1),
|
@@ -12128,10 +12211,10 @@ var _SelectBase = (props) => {
|
|
12128
12211
|
}
|
12129
12212
|
}), act.label))))));
|
12130
12213
|
};
|
12131
|
-
var SelectBase = (props) => /* @__PURE__ */
|
12214
|
+
var SelectBase = (props) => /* @__PURE__ */ React86.createElement(_SelectBase, __spreadProps(__spreadValues({}, props), {
|
12132
12215
|
labelWrapper: void 0
|
12133
12216
|
}));
|
12134
|
-
var SelectBaseSkeleton = () => /* @__PURE__ */
|
12217
|
+
var SelectBaseSkeleton = () => /* @__PURE__ */ React86.createElement(Skeleton, {
|
12135
12218
|
height: 38
|
12136
12219
|
});
|
12137
12220
|
SelectBase.Skeleton = SelectBaseSkeleton;
|
@@ -12149,21 +12232,21 @@ var Select2 = (_a) => {
|
|
12149
12232
|
const baseProps = omit15(props, Object.keys(labelProps));
|
12150
12233
|
const legacyError = labelProps.error !== void 0 && labelProps.valid === false;
|
12151
12234
|
const variant = !labelProps.valid || legacyError ? "error" : labelProps.disabled ? "disabled" : "default";
|
12152
|
-
const label = /* @__PURE__ */
|
12235
|
+
const label = /* @__PURE__ */ React86.createElement(Label, __spreadValues({
|
12153
12236
|
id: `${id.current}-label`,
|
12154
12237
|
htmlFor: `${id.current}-input`,
|
12155
12238
|
variant,
|
12156
12239
|
messageId: errorMessageId
|
12157
12240
|
}, labelProps));
|
12158
|
-
return /* @__PURE__ */
|
12241
|
+
return /* @__PURE__ */ React86.createElement(FormControl, {
|
12159
12242
|
className: "Aquarium-Select"
|
12160
|
-
}, /* @__PURE__ */
|
12243
|
+
}, /* @__PURE__ */ React86.createElement(_SelectBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
|
12161
12244
|
id: `${id.current}-input`,
|
12162
12245
|
options,
|
12163
12246
|
disabled: props.disabled,
|
12164
12247
|
valid: props.valid,
|
12165
12248
|
labelWrapper: label
|
12166
|
-
})), /* @__PURE__ */
|
12249
|
+
})), /* @__PURE__ */ React86.createElement(HelperText, {
|
12167
12250
|
messageId: errorMessageId,
|
12168
12251
|
error: !labelProps.valid,
|
12169
12252
|
helperText: labelProps.helperText,
|
@@ -12172,7 +12255,7 @@ var Select2 = (_a) => {
|
|
12172
12255
|
reserveSpaceForError: labelProps.reserveSpaceForError
|
12173
12256
|
}));
|
12174
12257
|
};
|
12175
|
-
var SelectSkeleton = () => /* @__PURE__ */
|
12258
|
+
var SelectSkeleton = () => /* @__PURE__ */ React86.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React86.createElement(SelectBase.Skeleton, null));
|
12176
12259
|
Select2.Skeleton = SelectSkeleton;
|
12177
12260
|
Select2.Skeleton.displayName = "Select.Skeleton";
|
12178
12261
|
|
@@ -12191,23 +12274,23 @@ var Pagination = ({
|
|
12191
12274
|
pageSizes,
|
12192
12275
|
onPageSizeChange
|
12193
12276
|
}) => {
|
12194
|
-
const [value, setValue] =
|
12195
|
-
|
12277
|
+
const [value, setValue] = React87.useState(currentPage);
|
12278
|
+
React87.useEffect(() => {
|
12196
12279
|
setValue(currentPage);
|
12197
12280
|
}, [currentPage]);
|
12198
|
-
return /* @__PURE__ */
|
12281
|
+
return /* @__PURE__ */ React87.createElement(Box, {
|
12199
12282
|
className: classNames("Aquarium-Pagination", tw("grid grid-cols-[200px_1fr_200px]")),
|
12200
12283
|
backgroundColor: "grey-0",
|
12201
12284
|
padding: "4"
|
12202
|
-
}, pageSizes && onPageSizeChange && typeof pageSize === "number" ? /* @__PURE__ */
|
12285
|
+
}, pageSizes && onPageSizeChange && typeof pageSize === "number" ? /* @__PURE__ */ React87.createElement(Box, {
|
12203
12286
|
display: "flex",
|
12204
12287
|
alignItems: "center",
|
12205
12288
|
gap: "4"
|
12206
|
-
}, /* @__PURE__ */
|
12289
|
+
}, /* @__PURE__ */ React87.createElement(Typography2.Small, {
|
12207
12290
|
color: "grey-50"
|
12208
|
-
}, "Items per page "), /* @__PURE__ */
|
12291
|
+
}, "Items per page "), /* @__PURE__ */ React87.createElement("div", {
|
12209
12292
|
className: tw("max-w-[70px]")
|
12210
|
-
}, /* @__PURE__ */
|
12293
|
+
}, /* @__PURE__ */ React87.createElement(SelectBase, {
|
12211
12294
|
options: pageSizes.map((size) => size.toString()),
|
12212
12295
|
value: pageSize.toString(),
|
12213
12296
|
onChange: (size) => {
|
@@ -12218,26 +12301,26 @@ var Pagination = ({
|
|
12218
12301
|
}
|
12219
12302
|
}
|
12220
12303
|
}
|
12221
|
-
}))) : /* @__PURE__ */
|
12304
|
+
}))) : /* @__PURE__ */ React87.createElement("div", null), /* @__PURE__ */ React87.createElement(Box, {
|
12222
12305
|
display: "flex",
|
12223
12306
|
justifyContent: "center",
|
12224
12307
|
alignItems: "center",
|
12225
12308
|
className: tw("grow")
|
12226
|
-
}, /* @__PURE__ */
|
12309
|
+
}, /* @__PURE__ */ React87.createElement(IconButton, {
|
12227
12310
|
"aria-label": "First",
|
12228
12311
|
onClick: () => onPageChange(1),
|
12229
12312
|
icon: import_chevronBackward2.default,
|
12230
12313
|
disabled: !hasPreviousPage
|
12231
|
-
}), /* @__PURE__ */
|
12314
|
+
}), /* @__PURE__ */ React87.createElement(IconButton, {
|
12232
12315
|
"aria-label": "Previous",
|
12233
12316
|
onClick: () => onPageChange(currentPage - 1),
|
12234
12317
|
icon: import_chevronLeft4.default,
|
12235
12318
|
disabled: !hasPreviousPage
|
12236
|
-
}), /* @__PURE__ */
|
12319
|
+
}), /* @__PURE__ */ React87.createElement(Box, {
|
12237
12320
|
paddingX: "4"
|
12238
|
-
}, /* @__PURE__ */
|
12321
|
+
}, /* @__PURE__ */ React87.createElement(Typography2.Small, {
|
12239
12322
|
color: "grey-60"
|
12240
|
-
}, "Page")), /* @__PURE__ */
|
12323
|
+
}, "Page")), /* @__PURE__ */ React87.createElement(InputBase, {
|
12241
12324
|
className: classNames(tw("text-center max-w-[40px]"), "no-arrows"),
|
12242
12325
|
type: "number",
|
12243
12326
|
min: 1,
|
@@ -12254,45 +12337,45 @@ var Pagination = ({
|
|
12254
12337
|
const newPage = !isNaN(numberValue) ? clamp(numberValue, 1, totalPages) : 1;
|
12255
12338
|
onPageChange(newPage);
|
12256
12339
|
}
|
12257
|
-
}), /* @__PURE__ */
|
12340
|
+
}), /* @__PURE__ */ React87.createElement(Box, {
|
12258
12341
|
paddingX: "4"
|
12259
|
-
}, /* @__PURE__ */
|
12342
|
+
}, /* @__PURE__ */ React87.createElement(Typography2.Small, {
|
12260
12343
|
color: "grey-60"
|
12261
|
-
}, "of ", totalPages)), /* @__PURE__ */
|
12344
|
+
}, "of ", totalPages)), /* @__PURE__ */ React87.createElement(IconButton, {
|
12262
12345
|
"aria-label": "Next",
|
12263
12346
|
onClick: () => onPageChange(currentPage + 1),
|
12264
12347
|
icon: import_chevronRight4.default,
|
12265
12348
|
disabled: !hasNextPage
|
12266
|
-
}), /* @__PURE__ */
|
12349
|
+
}), /* @__PURE__ */ React87.createElement(IconButton, {
|
12267
12350
|
"aria-label": "Last",
|
12268
12351
|
onClick: () => onPageChange(totalPages),
|
12269
12352
|
icon: import_chevronForward2.default,
|
12270
12353
|
disabled: !hasNextPage
|
12271
|
-
})), /* @__PURE__ */
|
12354
|
+
})), /* @__PURE__ */ React87.createElement("div", null));
|
12272
12355
|
};
|
12273
12356
|
|
12274
12357
|
// src/molecules/PopoverDialog/PopoverDialog.tsx
|
12275
|
-
import
|
12358
|
+
import React89 from "react";
|
12276
12359
|
import omit16 from "lodash/omit";
|
12277
12360
|
|
12278
12361
|
// src/atoms/PopoverDialog/PopoverDialog.tsx
|
12279
|
-
import
|
12362
|
+
import React88 from "react";
|
12280
12363
|
var Header2 = (_a) => {
|
12281
12364
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12282
|
-
return /* @__PURE__ */
|
12365
|
+
return /* @__PURE__ */ React88.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12283
12366
|
className: classNames(tw("p-5 gap-3 flex items-center"), className)
|
12284
12367
|
}), children);
|
12285
12368
|
};
|
12286
12369
|
var Title = (_a) => {
|
12287
12370
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12288
|
-
return /* @__PURE__ */
|
12371
|
+
return /* @__PURE__ */ React88.createElement(Typography, __spreadProps(__spreadValues({}, rest), {
|
12289
12372
|
htmlTag: "h1",
|
12290
12373
|
variant: "small-strong"
|
12291
12374
|
}), children);
|
12292
12375
|
};
|
12293
12376
|
var Body = (_a) => {
|
12294
12377
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12295
|
-
return /* @__PURE__ */
|
12378
|
+
return /* @__PURE__ */ React88.createElement(Typography, __spreadProps(__spreadValues({}, rest), {
|
12296
12379
|
htmlTag: "div",
|
12297
12380
|
variant: "caption",
|
12298
12381
|
className: classNames(tw("px-5 overflow-y-auto"), className)
|
@@ -12300,13 +12383,13 @@ var Body = (_a) => {
|
|
12300
12383
|
};
|
12301
12384
|
var Footer2 = (_a) => {
|
12302
12385
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12303
|
-
return /* @__PURE__ */
|
12386
|
+
return /* @__PURE__ */ React88.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12304
12387
|
className: classNames(tw("p-5"), className)
|
12305
12388
|
}), children);
|
12306
12389
|
};
|
12307
12390
|
var Actions2 = (_a) => {
|
12308
12391
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12309
|
-
return /* @__PURE__ */
|
12392
|
+
return /* @__PURE__ */ React88.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12310
12393
|
className: classNames(tw("flex gap-4"), className)
|
12311
12394
|
}), children);
|
12312
12395
|
};
|
@@ -12322,13 +12405,13 @@ var PopoverDialog = {
|
|
12322
12405
|
var PopoverDialog2 = ({ placement, open, title, secondaryAction, primaryAction, children }) => {
|
12323
12406
|
const wrapPromptWithBody = (child) => {
|
12324
12407
|
if (isComponentType(child, PopoverDialog2.Prompt)) {
|
12325
|
-
return /* @__PURE__ */
|
12408
|
+
return /* @__PURE__ */ React89.createElement(Popover2.Panel, {
|
12326
12409
|
className: classNames("Aquarium-PopoverDialog", tw("max-w-[300px]"))
|
12327
|
-
}, /* @__PURE__ */
|
12410
|
+
}, /* @__PURE__ */ React89.createElement(PopoverDialog.Header, null, /* @__PURE__ */ React89.createElement(PopoverDialog.Title, null, title)), child, /* @__PURE__ */ React89.createElement(PopoverDialog.Footer, null, /* @__PURE__ */ React89.createElement(PopoverDialog.Actions, null, secondaryAction && /* @__PURE__ */ React89.createElement(Popover2.Button, __spreadValues({
|
12328
12411
|
kind: "secondary-ghost",
|
12329
12412
|
key: secondaryAction.text,
|
12330
12413
|
dense: true
|
12331
|
-
}, omit16(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */
|
12414
|
+
}, omit16(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */ React89.createElement(Popover2.Button, __spreadValues({
|
12332
12415
|
kind: "ghost",
|
12333
12416
|
key: primaryAction.text,
|
12334
12417
|
dense: true
|
@@ -12336,15 +12419,15 @@ var PopoverDialog2 = ({ placement, open, title, secondaryAction, primaryAction,
|
|
12336
12419
|
}
|
12337
12420
|
return child;
|
12338
12421
|
};
|
12339
|
-
return /* @__PURE__ */
|
12422
|
+
return /* @__PURE__ */ React89.createElement(Popover2, {
|
12340
12423
|
type: "dialog",
|
12341
12424
|
isOpen: open,
|
12342
12425
|
placement,
|
12343
12426
|
containFocus: true
|
12344
|
-
},
|
12427
|
+
}, React89.Children.map(children, wrapPromptWithBody));
|
12345
12428
|
};
|
12346
12429
|
PopoverDialog2.Trigger = Popover2.Trigger;
|
12347
|
-
var Prompt = ({ children }) => /* @__PURE__ */
|
12430
|
+
var Prompt = ({ children }) => /* @__PURE__ */ React89.createElement(PopoverDialog.Body, null, children);
|
12348
12431
|
Prompt.displayName = "PopoverDialog.Prompt";
|
12349
12432
|
PopoverDialog2.Prompt = Prompt;
|
12350
12433
|
|
@@ -12353,14 +12436,14 @@ import { createPortal } from "react-dom";
|
|
12353
12436
|
var Portal = ({ children, to }) => createPortal(children, to);
|
12354
12437
|
|
12355
12438
|
// src/molecules/ProgressBar/ProgressBar.tsx
|
12356
|
-
import
|
12439
|
+
import React91 from "react";
|
12357
12440
|
|
12358
12441
|
// src/atoms/ProgressBar/ProgressBar.tsx
|
12359
|
-
import
|
12442
|
+
import React90 from "react";
|
12360
12443
|
import clamp2 from "lodash/clamp";
|
12361
12444
|
var ProgressBar = (_a) => {
|
12362
12445
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12363
|
-
return /* @__PURE__ */
|
12446
|
+
return /* @__PURE__ */ React90.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12364
12447
|
className: classNames(
|
12365
12448
|
tw("relative flex items-center w-full bg-grey-0 h-2 rounded-full overflow-hidden"),
|
12366
12449
|
className
|
@@ -12376,7 +12459,7 @@ var STATUS_COLORS = {
|
|
12376
12459
|
ProgressBar.Indicator = (_a) => {
|
12377
12460
|
var _b = _a, { min, max, value, "aria-label": ariaLabel, status, className } = _b, rest = __objRest(_b, ["min", "max", "value", "aria-label", "status", "className"]);
|
12378
12461
|
const completedPercentage = clamp2((value - min) / (max - min) * 100, 0, 100);
|
12379
|
-
return /* @__PURE__ */
|
12462
|
+
return /* @__PURE__ */ React90.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12380
12463
|
className: classNames(
|
12381
12464
|
tw("h-2 rounded-full transition-all ease-in-out delay-150"),
|
12382
12465
|
STATUS_COLORS[status],
|
@@ -12392,11 +12475,11 @@ ProgressBar.Indicator = (_a) => {
|
|
12392
12475
|
};
|
12393
12476
|
ProgressBar.Labels = (_a) => {
|
12394
12477
|
var _b = _a, { children, startLabel, endLabel, className } = _b, rest = __objRest(_b, ["children", "startLabel", "endLabel", "className"]);
|
12395
|
-
return /* @__PURE__ */
|
12478
|
+
return /* @__PURE__ */ React90.createElement("div", {
|
12396
12479
|
className: classNames(tw("flex flex-row"), className)
|
12397
|
-
}, /* @__PURE__ */
|
12480
|
+
}, /* @__PURE__ */ React90.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
12398
12481
|
className: tw("grow text-grey-70 typography-caption")
|
12399
|
-
}), startLabel), /* @__PURE__ */
|
12482
|
+
}), startLabel), /* @__PURE__ */ React90.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
12400
12483
|
className: tw("grow text-grey-70 typography-caption text-right")
|
12401
12484
|
}), endLabel));
|
12402
12485
|
};
|
@@ -12414,7 +12497,7 @@ var ProgressBar2 = (props) => {
|
|
12414
12497
|
if (min > max) {
|
12415
12498
|
throw new Error("`min` value provided to `ProgressBar` is greater than `max` value.");
|
12416
12499
|
}
|
12417
|
-
const progress = /* @__PURE__ */
|
12500
|
+
const progress = /* @__PURE__ */ React91.createElement(ProgressBar, null, /* @__PURE__ */ React91.createElement(ProgressBar.Indicator, {
|
12418
12501
|
status: value === max ? completedStatus : progresStatus,
|
12419
12502
|
min,
|
12420
12503
|
max,
|
@@ -12424,15 +12507,15 @@ var ProgressBar2 = (props) => {
|
|
12424
12507
|
if (props.dense) {
|
12425
12508
|
return progress;
|
12426
12509
|
}
|
12427
|
-
return /* @__PURE__ */
|
12510
|
+
return /* @__PURE__ */ React91.createElement("div", {
|
12428
12511
|
className: "Aquarium-ProgressBar"
|
12429
|
-
}, progress, /* @__PURE__ */
|
12512
|
+
}, progress, /* @__PURE__ */ React91.createElement(ProgressBar.Labels, {
|
12430
12513
|
className: tw("py-2"),
|
12431
12514
|
startLabel: props.startLabel,
|
12432
12515
|
endLabel: props.endLabel
|
12433
12516
|
}));
|
12434
12517
|
};
|
12435
|
-
var ProgressBarSkeleton = () => /* @__PURE__ */
|
12518
|
+
var ProgressBarSkeleton = () => /* @__PURE__ */ React91.createElement(Skeleton, {
|
12436
12519
|
height: 4,
|
12437
12520
|
display: "block"
|
12438
12521
|
});
|
@@ -12440,13 +12523,13 @@ ProgressBar2.Skeleton = ProgressBarSkeleton;
|
|
12440
12523
|
ProgressBar2.Skeleton.displayName = "ProgressBar.Skeleton";
|
12441
12524
|
|
12442
12525
|
// src/molecules/RadioButton/RadioButton.tsx
|
12443
|
-
import
|
12444
|
-
var RadioButton2 =
|
12526
|
+
import React92 from "react";
|
12527
|
+
var RadioButton2 = React92.forwardRef(
|
12445
12528
|
(_a, ref) => {
|
12446
12529
|
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"]);
|
12447
12530
|
var _a2;
|
12448
12531
|
const isChecked = (_a2 = props.checked) != null ? _a2 : props.defaultChecked;
|
12449
|
-
return !readOnly || isChecked ? /* @__PURE__ */
|
12532
|
+
return !readOnly || isChecked ? /* @__PURE__ */ React92.createElement(ControlLabel, {
|
12450
12533
|
htmlFor: id,
|
12451
12534
|
label: children,
|
12452
12535
|
"aria-label": ariaLabel,
|
@@ -12455,7 +12538,7 @@ var RadioButton2 = React91.forwardRef(
|
|
12455
12538
|
disabled,
|
12456
12539
|
style: { gap: "0 8px" },
|
12457
12540
|
className: "Aquarium-RadioButton"
|
12458
|
-
}, !readOnly && /* @__PURE__ */
|
12541
|
+
}, !readOnly && /* @__PURE__ */ React92.createElement(RadioButton, __spreadProps(__spreadValues({
|
12459
12542
|
id,
|
12460
12543
|
ref,
|
12461
12544
|
name
|
@@ -12466,12 +12549,12 @@ var RadioButton2 = React91.forwardRef(
|
|
12466
12549
|
}
|
12467
12550
|
);
|
12468
12551
|
RadioButton2.displayName = "RadioButton";
|
12469
|
-
var RadioButtonSkeleton = () => /* @__PURE__ */
|
12552
|
+
var RadioButtonSkeleton = () => /* @__PURE__ */ React92.createElement("div", {
|
12470
12553
|
className: tw("flex gap-3")
|
12471
|
-
}, /* @__PURE__ */
|
12554
|
+
}, /* @__PURE__ */ React92.createElement(Skeleton, {
|
12472
12555
|
height: 20,
|
12473
12556
|
width: 20
|
12474
|
-
}), /* @__PURE__ */
|
12557
|
+
}), /* @__PURE__ */ React92.createElement(Skeleton, {
|
12475
12558
|
height: 20,
|
12476
12559
|
width: 150
|
12477
12560
|
}));
|
@@ -12479,10 +12562,10 @@ RadioButton2.Skeleton = RadioButtonSkeleton;
|
|
12479
12562
|
RadioButton2.Skeleton.displayName = "RadioButton.Skeleton";
|
12480
12563
|
|
12481
12564
|
// src/molecules/RadioButtonGroup/RadioButtonGroup.tsx
|
12482
|
-
import
|
12565
|
+
import React93 from "react";
|
12483
12566
|
import uniqueId8 from "lodash/uniqueId";
|
12484
12567
|
var isRadioButton = (c) => {
|
12485
|
-
return
|
12568
|
+
return React93.isValidElement(c) && c.type === RadioButton2;
|
12486
12569
|
};
|
12487
12570
|
var RadioButtonGroup = (_a) => {
|
12488
12571
|
var _b = _a, {
|
@@ -12505,7 +12588,7 @@ var RadioButtonGroup = (_a) => {
|
|
12505
12588
|
"children"
|
12506
12589
|
]);
|
12507
12590
|
var _a2;
|
12508
|
-
const [value, setValue] =
|
12591
|
+
const [value, setValue] = React93.useState((_a2 = _value != null ? _value : defaultValue) != null ? _a2 : "");
|
12509
12592
|
const errorMessageId = uniqueId8();
|
12510
12593
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
12511
12594
|
const labelControlProps = getLabelControlProps(props);
|
@@ -12516,14 +12599,14 @@ var RadioButtonGroup = (_a) => {
|
|
12516
12599
|
setValue(e.target.value);
|
12517
12600
|
onChange == null ? void 0 : onChange(e.target.value);
|
12518
12601
|
};
|
12519
|
-
const content =
|
12602
|
+
const content = React93.Children.map(children, (c) => {
|
12520
12603
|
var _a3, _b2, _c;
|
12521
12604
|
if (!isRadioButton(c)) {
|
12522
12605
|
return null;
|
12523
12606
|
}
|
12524
12607
|
const defaultChecked = defaultValue === void 0 ? void 0 : c.props.value === defaultValue;
|
12525
12608
|
const checked = value === void 0 ? void 0 : c.props.value === value;
|
12526
|
-
return
|
12609
|
+
return React93.cloneElement(c, {
|
12527
12610
|
name,
|
12528
12611
|
defaultChecked: (_a3 = c.props.defaultChecked) != null ? _a3 : defaultChecked,
|
12529
12612
|
checked: (_b2 = c.props.checked) != null ? _b2 : checked,
|
@@ -12532,13 +12615,13 @@ var RadioButtonGroup = (_a) => {
|
|
12532
12615
|
readOnly
|
12533
12616
|
});
|
12534
12617
|
});
|
12535
|
-
return /* @__PURE__ */
|
12618
|
+
return /* @__PURE__ */ React93.createElement(LabelControl, __spreadProps(__spreadValues(__spreadValues({
|
12536
12619
|
fieldset: true
|
12537
12620
|
}, labelControlProps), errorProps), {
|
12538
12621
|
className: "Aquarium-RadioButtonGroup"
|
12539
|
-
}), cols && /* @__PURE__ */
|
12622
|
+
}), cols && /* @__PURE__ */ React93.createElement(InputGroup, {
|
12540
12623
|
cols
|
12541
|
-
}, content), !cols && /* @__PURE__ */
|
12624
|
+
}, content), !cols && /* @__PURE__ */ React93.createElement(Flexbox, {
|
12542
12625
|
direction,
|
12543
12626
|
alignItems: "flex-start",
|
12544
12627
|
colGap: "8",
|
@@ -12547,12 +12630,12 @@ var RadioButtonGroup = (_a) => {
|
|
12547
12630
|
}, content));
|
12548
12631
|
};
|
12549
12632
|
var RadioButtonGroupSkeleton = ({ direction = "row", options = 2 }) => {
|
12550
|
-
return /* @__PURE__ */
|
12633
|
+
return /* @__PURE__ */ React93.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React93.createElement("div", {
|
12551
12634
|
className: tw("flex flex-wrap", {
|
12552
12635
|
"flex-row gap-8": direction === "row",
|
12553
12636
|
"flex-col gap-2": direction === "column"
|
12554
12637
|
})
|
12555
|
-
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */
|
12638
|
+
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */ React93.createElement(RadioButton2.Skeleton, {
|
12556
12639
|
key
|
12557
12640
|
}))));
|
12558
12641
|
};
|
@@ -12560,70 +12643,73 @@ RadioButtonGroup.Skeleton = RadioButtonGroupSkeleton;
|
|
12560
12643
|
RadioButtonGroup.Skeleton.displayName = "RadioButtonGroup.Skeleton";
|
12561
12644
|
|
12562
12645
|
// src/molecules/Section/Section.tsx
|
12563
|
-
import
|
12646
|
+
import React95 from "react";
|
12564
12647
|
import castArray4 from "lodash/castArray";
|
12648
|
+
import omit17 from "lodash/omit";
|
12565
12649
|
|
12566
12650
|
// src/atoms/Section/Section.tsx
|
12567
|
-
import
|
12651
|
+
import React94 from "react";
|
12568
12652
|
var Section3 = (_a) => {
|
12569
12653
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
12570
|
-
return /* @__PURE__ */
|
12654
|
+
return /* @__PURE__ */ React94.createElement(Box, __spreadValues({
|
12571
12655
|
borderColor: "grey-5",
|
12572
12656
|
borderWidth: "1px"
|
12573
12657
|
}, rest), children);
|
12574
12658
|
};
|
12575
12659
|
Section3.Header = (_a) => {
|
12576
12660
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12577
|
-
return /* @__PURE__ */
|
12661
|
+
return /* @__PURE__ */ React94.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12578
12662
|
className: classNames(tw("px-6 py-5 flex gap-5 justify-between items-center"), className)
|
12579
12663
|
}), children);
|
12580
12664
|
};
|
12581
12665
|
Section3.TitleContainer = (_a) => {
|
12582
12666
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12583
|
-
return /* @__PURE__ */
|
12667
|
+
return /* @__PURE__ */ React94.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12584
12668
|
className: classNames(tw("flex flex-col grow gap-2"), className)
|
12585
12669
|
}), children);
|
12586
12670
|
};
|
12587
12671
|
Section3.Title = (_a) => {
|
12588
12672
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
12589
|
-
return /* @__PURE__ */
|
12673
|
+
return /* @__PURE__ */ React94.createElement(Typography2.Subheading, __spreadProps(__spreadValues({}, rest), {
|
12590
12674
|
color: "black"
|
12591
12675
|
}), children);
|
12592
12676
|
};
|
12593
12677
|
Section3.Subtitle = (_a) => {
|
12594
12678
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
12595
|
-
return /* @__PURE__ */
|
12679
|
+
return /* @__PURE__ */ React94.createElement(Typography2.SmallText, __spreadProps(__spreadValues({}, rest), {
|
12596
12680
|
color: "grey-70"
|
12597
12681
|
}), children);
|
12598
12682
|
};
|
12599
12683
|
Section3.Actions = (_a) => {
|
12600
12684
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12601
|
-
return /* @__PURE__ */
|
12685
|
+
return /* @__PURE__ */ React94.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12602
12686
|
className: classNames(tw("flex gap-4 justify-end"), className)
|
12603
12687
|
}), children);
|
12604
12688
|
};
|
12605
12689
|
Section3.Body = (_a) => {
|
12606
12690
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12607
|
-
return /* @__PURE__ */
|
12691
|
+
return /* @__PURE__ */ React94.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12608
12692
|
className: classNames(tw("p-6"), className)
|
12609
|
-
}), /* @__PURE__ */
|
12693
|
+
}), /* @__PURE__ */ React94.createElement(Typography, {
|
12610
12694
|
htmlTag: "div",
|
12611
12695
|
color: "grey-70"
|
12612
12696
|
}, children));
|
12613
12697
|
};
|
12614
12698
|
|
12615
12699
|
// src/molecules/Section/Section.tsx
|
12616
|
-
var Section4 = ({ title, subtitle, actions, children }) => /* @__PURE__ */
|
12700
|
+
var Section4 = ({ title, subtitle, actions, children }) => /* @__PURE__ */ React95.createElement(Section3, {
|
12617
12701
|
className: "Aquarium-Section"
|
12618
|
-
}, title && /* @__PURE__ */
|
12619
|
-
|
12620
|
-
|
12621
|
-
|
12622
|
-
|
12623
|
-
|
12702
|
+
}, title && /* @__PURE__ */ React95.createElement(React95.Fragment, null, /* @__PURE__ */ React95.createElement(Section3.Header, null, /* @__PURE__ */ React95.createElement(Section3.TitleContainer, null, /* @__PURE__ */ React95.createElement(Section3.Title, null, title), subtitle && /* @__PURE__ */ React95.createElement(Section3.Subtitle, null, subtitle)), /* @__PURE__ */ React95.createElement(Section3.Actions, null, actions && castArray4(actions).filter(Boolean).map(
|
12703
|
+
(action) => !isLink(action) ? /* @__PURE__ */ React95.createElement(Button.Secondary, __spreadValues({
|
12704
|
+
key: action.text
|
12705
|
+
}, omit17(action, "text")), action.text) : /* @__PURE__ */ React95.createElement(Button.ExternalLink, __spreadValues({
|
12706
|
+
key: action.text,
|
12707
|
+
kind: "secondary"
|
12708
|
+
}, omit17(action, "text")), action.text)
|
12709
|
+
))), /* @__PURE__ */ React95.createElement(Divider2, null)), /* @__PURE__ */ React95.createElement(Section3.Body, null, children));
|
12624
12710
|
|
12625
12711
|
// src/molecules/SegmentedControl/SegmentedControl.tsx
|
12626
|
-
import
|
12712
|
+
import React96 from "react";
|
12627
12713
|
var SegmentedControl = (_a) => {
|
12628
12714
|
var _b = _a, {
|
12629
12715
|
children,
|
@@ -12640,7 +12726,7 @@ var SegmentedControl = (_a) => {
|
|
12640
12726
|
"selected",
|
12641
12727
|
"className"
|
12642
12728
|
]);
|
12643
|
-
return /* @__PURE__ */
|
12729
|
+
return /* @__PURE__ */ React96.createElement("button", __spreadProps(__spreadValues({
|
12644
12730
|
type: "button"
|
12645
12731
|
}, rest), {
|
12646
12732
|
className: classNames(
|
@@ -12671,11 +12757,11 @@ var SegmentedControlGroup = (_a) => {
|
|
12671
12757
|
"border border-grey-20 text-grey-50": variant === "outlined",
|
12672
12758
|
"bg-grey-0": variant === "raised"
|
12673
12759
|
});
|
12674
|
-
return /* @__PURE__ */
|
12760
|
+
return /* @__PURE__ */ React96.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12675
12761
|
className: classNames("Aquarium-SegmentedControl", classes2, className)
|
12676
|
-
}),
|
12762
|
+
}), React96.Children.map(
|
12677
12763
|
children,
|
12678
|
-
(child) =>
|
12764
|
+
(child) => React96.cloneElement(child, {
|
12679
12765
|
dense,
|
12680
12766
|
variant,
|
12681
12767
|
onClick: () => onChange(child.props.value),
|
@@ -12713,14 +12799,14 @@ var getCommonClassNames = (dense, selected) => tw(
|
|
12713
12799
|
);
|
12714
12800
|
|
12715
12801
|
// src/molecules/Stepper/Stepper.tsx
|
12716
|
-
import
|
12802
|
+
import React98 from "react";
|
12717
12803
|
|
12718
12804
|
// src/atoms/Stepper/Stepper.tsx
|
12719
|
-
import
|
12805
|
+
import React97 from "react";
|
12720
12806
|
var import_tick6 = __toESM(require_tick());
|
12721
12807
|
var Stepper = (_a) => {
|
12722
12808
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
12723
|
-
return /* @__PURE__ */
|
12809
|
+
return /* @__PURE__ */ React97.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12724
12810
|
className: classNames(className)
|
12725
12811
|
}));
|
12726
12812
|
};
|
@@ -12734,7 +12820,7 @@ var ConnectorContainer = (_a) => {
|
|
12734
12820
|
"completed",
|
12735
12821
|
"dense"
|
12736
12822
|
]);
|
12737
|
-
return /* @__PURE__ */
|
12823
|
+
return /* @__PURE__ */ React97.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12738
12824
|
className: classNames(
|
12739
12825
|
tw("absolute w-full -left-1/2", {
|
12740
12826
|
"top-[3px] px-[14px]": Boolean(dense),
|
@@ -12746,7 +12832,7 @@ var ConnectorContainer = (_a) => {
|
|
12746
12832
|
};
|
12747
12833
|
var Connector = (_a) => {
|
12748
12834
|
var _b = _a, { children, className, completed, dense } = _b, rest = __objRest(_b, ["children", "className", "completed", "dense"]);
|
12749
|
-
return /* @__PURE__ */
|
12835
|
+
return /* @__PURE__ */ React97.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12750
12836
|
className: classNames(
|
12751
12837
|
tw("w-full", {
|
12752
12838
|
"bg-grey-20": !completed,
|
@@ -12760,7 +12846,7 @@ var Connector = (_a) => {
|
|
12760
12846
|
};
|
12761
12847
|
var Step = (_a) => {
|
12762
12848
|
var _b = _a, { className, state } = _b, rest = __objRest(_b, ["className", "state"]);
|
12763
|
-
return /* @__PURE__ */
|
12849
|
+
return /* @__PURE__ */ React97.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12764
12850
|
className: classNames(
|
12765
12851
|
tw("flex flex-col items-center text-grey-90 relative text-center", {
|
12766
12852
|
"text-grey-20": state === "inactive"
|
@@ -12781,13 +12867,13 @@ var getDenseClassNames = (state) => tw("h-[8px] w-[8px]", {
|
|
12781
12867
|
});
|
12782
12868
|
var Indicator = (_a) => {
|
12783
12869
|
var _b = _a, { children, className, state, dense } = _b, rest = __objRest(_b, ["children", "className", "state", "dense"]);
|
12784
|
-
return /* @__PURE__ */
|
12870
|
+
return /* @__PURE__ */ React97.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12785
12871
|
className: classNames(
|
12786
12872
|
tw("rounded-full flex justify-center items-center mx-2 mb-3"),
|
12787
12873
|
dense ? getDenseClassNames(state) : getClassNames(state),
|
12788
12874
|
className
|
12789
12875
|
)
|
12790
|
-
}), state === "completed" ? /* @__PURE__ */
|
12876
|
+
}), state === "completed" ? /* @__PURE__ */ React97.createElement(InlineIcon, {
|
12791
12877
|
icon: import_tick6.default
|
12792
12878
|
}) : dense ? null : children);
|
12793
12879
|
};
|
@@ -12798,26 +12884,26 @@ Stepper.ConnectorContainer = ConnectorContainer;
|
|
12798
12884
|
|
12799
12885
|
// src/molecules/Stepper/Stepper.tsx
|
12800
12886
|
var Stepper2 = ({ children, activeIndex, dense }) => {
|
12801
|
-
const steps =
|
12802
|
-
return /* @__PURE__ */
|
12887
|
+
const steps = React98.Children.count(children);
|
12888
|
+
return /* @__PURE__ */ React98.createElement(Stepper, {
|
12803
12889
|
role: "list",
|
12804
12890
|
className: "Aquarium-Stepper"
|
12805
|
-
}, /* @__PURE__ */
|
12891
|
+
}, /* @__PURE__ */ React98.createElement(Template, {
|
12806
12892
|
columns: steps
|
12807
|
-
},
|
12893
|
+
}, React98.Children.map(children, (child, index) => {
|
12808
12894
|
if (!isComponentType(child, Step2)) {
|
12809
12895
|
return new Error("<Stepper> can only have <Stepper.Step> components as children");
|
12810
12896
|
} else {
|
12811
12897
|
const state = index > activeIndex ? "inactive" : index === activeIndex ? "active" : "completed";
|
12812
|
-
return /* @__PURE__ */
|
12898
|
+
return /* @__PURE__ */ React98.createElement(Stepper.Step, {
|
12813
12899
|
state,
|
12814
12900
|
"aria-current": state === "active" ? "step" : false,
|
12815
12901
|
role: "listitem"
|
12816
|
-
}, index > 0 && index <= steps && /* @__PURE__ */
|
12902
|
+
}, index > 0 && index <= steps && /* @__PURE__ */ React98.createElement(Stepper.ConnectorContainer, {
|
12817
12903
|
dense
|
12818
|
-
}, /* @__PURE__ */
|
12904
|
+
}, /* @__PURE__ */ React98.createElement(Stepper.ConnectorContainer.Connector, {
|
12819
12905
|
completed: state === "completed" || state === "active"
|
12820
|
-
})), /* @__PURE__ */
|
12906
|
+
})), /* @__PURE__ */ React98.createElement(Stepper.Step.Indicator, {
|
12821
12907
|
state,
|
12822
12908
|
dense
|
12823
12909
|
}, index + 1), child.props.children);
|
@@ -12830,16 +12916,16 @@ Step2.displayName = "Stepper.Step";
|
|
12830
12916
|
Stepper2.Step = Step2;
|
12831
12917
|
|
12832
12918
|
// src/molecules/Switch/Switch.tsx
|
12833
|
-
import
|
12919
|
+
import React100 from "react";
|
12834
12920
|
|
12835
12921
|
// src/atoms/Switch/Switch.tsx
|
12836
|
-
import
|
12837
|
-
var Switch =
|
12922
|
+
import React99 from "react";
|
12923
|
+
var Switch = React99.forwardRef(
|
12838
12924
|
(_a, ref) => {
|
12839
12925
|
var _b = _a, { id, children, name, disabled = false, readOnly = false } = _b, props = __objRest(_b, ["id", "children", "name", "disabled", "readOnly"]);
|
12840
|
-
return /* @__PURE__ */
|
12926
|
+
return /* @__PURE__ */ React99.createElement("span", {
|
12841
12927
|
className: tw("relative inline-flex justify-center items-center self-center group")
|
12842
|
-
}, /* @__PURE__ */
|
12928
|
+
}, /* @__PURE__ */ React99.createElement("input", __spreadProps(__spreadValues({
|
12843
12929
|
id,
|
12844
12930
|
ref,
|
12845
12931
|
type: "checkbox",
|
@@ -12858,7 +12944,7 @@ var Switch = React98.forwardRef(
|
|
12858
12944
|
),
|
12859
12945
|
readOnly,
|
12860
12946
|
disabled
|
12861
|
-
})), /* @__PURE__ */
|
12947
|
+
})), /* @__PURE__ */ React99.createElement("span", {
|
12862
12948
|
className: tw(
|
12863
12949
|
"pointer-events-none rounded-full absolute inline-block transition duration-300 h-4 w-4 transform peer-checked/switch:translate-x-5",
|
12864
12950
|
"bg-white peer-disabled/switch:bg-grey-0 left-2 peer-checked/switch:left-1",
|
@@ -12871,12 +12957,12 @@ var Switch = React98.forwardRef(
|
|
12871
12957
|
);
|
12872
12958
|
|
12873
12959
|
// src/molecules/Switch/Switch.tsx
|
12874
|
-
var Switch2 =
|
12960
|
+
var Switch2 = React100.forwardRef(
|
12875
12961
|
(_a, ref) => {
|
12876
12962
|
var _b = _a, { id, name, caption, readOnly = false, disabled = false, children, "aria-label": ariaLabel } = _b, props = __objRest(_b, ["id", "name", "caption", "readOnly", "disabled", "children", "aria-label"]);
|
12877
12963
|
var _a2;
|
12878
12964
|
const isChecked = (_a2 = props.checked) != null ? _a2 : props.defaultChecked;
|
12879
|
-
return !readOnly || isChecked ? /* @__PURE__ */
|
12965
|
+
return !readOnly || isChecked ? /* @__PURE__ */ React100.createElement(ControlLabel, {
|
12880
12966
|
htmlFor: id,
|
12881
12967
|
label: children,
|
12882
12968
|
"aria-label": ariaLabel,
|
@@ -12885,7 +12971,7 @@ var Switch2 = React99.forwardRef(
|
|
12885
12971
|
disabled,
|
12886
12972
|
style: { gap: "0 8px" },
|
12887
12973
|
className: "Aquarium-Switch"
|
12888
|
-
}, !readOnly && /* @__PURE__ */
|
12974
|
+
}, !readOnly && /* @__PURE__ */ React100.createElement(Switch, __spreadProps(__spreadValues({
|
12889
12975
|
id,
|
12890
12976
|
ref,
|
12891
12977
|
name
|
@@ -12896,12 +12982,12 @@ var Switch2 = React99.forwardRef(
|
|
12896
12982
|
}
|
12897
12983
|
);
|
12898
12984
|
Switch2.displayName = "Switch";
|
12899
|
-
var SwitchSkeleton = () => /* @__PURE__ */
|
12985
|
+
var SwitchSkeleton = () => /* @__PURE__ */ React100.createElement("div", {
|
12900
12986
|
className: tw("flex gap-3")
|
12901
|
-
}, /* @__PURE__ */
|
12987
|
+
}, /* @__PURE__ */ React100.createElement(Skeleton, {
|
12902
12988
|
height: 20,
|
12903
12989
|
width: 35
|
12904
|
-
}), /* @__PURE__ */
|
12990
|
+
}), /* @__PURE__ */ React100.createElement(Skeleton, {
|
12905
12991
|
height: 20,
|
12906
12992
|
width: 150
|
12907
12993
|
}));
|
@@ -12909,7 +12995,7 @@ Switch2.Skeleton = SwitchSkeleton;
|
|
12909
12995
|
Switch2.Skeleton.displayName = "Switch.Skeleton ";
|
12910
12996
|
|
12911
12997
|
// src/molecules/SwitchGroup/SwitchGroup.tsx
|
12912
|
-
import
|
12998
|
+
import React101, { useState as useState11 } from "react";
|
12913
12999
|
import uniqueId9 from "lodash/uniqueId";
|
12914
13000
|
var SwitchGroup = (_a) => {
|
12915
13001
|
var _b = _a, {
|
@@ -12941,13 +13027,13 @@ var SwitchGroup = (_a) => {
|
|
12941
13027
|
setSelectedItems(updated);
|
12942
13028
|
onChange == null ? void 0 : onChange(updated);
|
12943
13029
|
};
|
12944
|
-
return /* @__PURE__ */
|
13030
|
+
return /* @__PURE__ */ React101.createElement(LabelControl, __spreadProps(__spreadValues(__spreadValues({
|
12945
13031
|
fieldset: true
|
12946
13032
|
}, labelControlProps), errorProps), {
|
12947
13033
|
className: "Aquarium-SwitchGroup"
|
12948
|
-
}), /* @__PURE__ */
|
13034
|
+
}), /* @__PURE__ */ React101.createElement(InputGroup, {
|
12949
13035
|
cols
|
12950
|
-
},
|
13036
|
+
}, React101.Children.map(children, (c) => {
|
12951
13037
|
var _a3, _b2, _c, _d;
|
12952
13038
|
if (!isComponentType(c, Switch2)) {
|
12953
13039
|
return null;
|
@@ -12955,7 +13041,7 @@ var SwitchGroup = (_a) => {
|
|
12955
13041
|
const str = (_a3 = c.props.value) == null ? void 0 : _a3.toString();
|
12956
13042
|
const defaultChecked = defaultValue === void 0 ? void 0 : str !== void 0 && defaultValue.includes(str);
|
12957
13043
|
const checked = value === void 0 ? void 0 : str !== void 0 && value.includes(str);
|
12958
|
-
return
|
13044
|
+
return React101.cloneElement(c, {
|
12959
13045
|
defaultChecked: (_b2 = c.props.defaultChecked) != null ? _b2 : defaultChecked,
|
12960
13046
|
checked: (_c = c.props.checked) != null ? _c : checked,
|
12961
13047
|
onChange: (_d = c.props.onChange) != null ? _d : handleChange,
|
@@ -12965,9 +13051,9 @@ var SwitchGroup = (_a) => {
|
|
12965
13051
|
})));
|
12966
13052
|
};
|
12967
13053
|
var SwitchGroupSkeleton = ({ options = 2 }) => {
|
12968
|
-
return /* @__PURE__ */
|
13054
|
+
return /* @__PURE__ */ React101.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React101.createElement("div", {
|
12969
13055
|
className: tw("flex flex-wrap flex-col gap-2")
|
12970
|
-
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */
|
13056
|
+
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */ React101.createElement(Switch2.Skeleton, {
|
12971
13057
|
key
|
12972
13058
|
}))));
|
12973
13059
|
};
|
@@ -12975,10 +13061,10 @@ SwitchGroup.Skeleton = SwitchGroupSkeleton;
|
|
12975
13061
|
SwitchGroup.Skeleton.displayName = "SwitchGroup.Skeleton";
|
12976
13062
|
|
12977
13063
|
// src/molecules/TagLabel/TagLabel.tsx
|
12978
|
-
import
|
13064
|
+
import React102 from "react";
|
12979
13065
|
var TagLabel = (_a) => {
|
12980
13066
|
var _b = _a, { title, dense = false } = _b, rest = __objRest(_b, ["title", "dense"]);
|
12981
|
-
return /* @__PURE__ */
|
13067
|
+
return /* @__PURE__ */ React102.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
12982
13068
|
className: classNames(
|
12983
13069
|
"Aquarium-TagLabel",
|
12984
13070
|
tw("rounded-full text-white bg-primary-70", {
|
@@ -12990,14 +13076,14 @@ var TagLabel = (_a) => {
|
|
12990
13076
|
};
|
12991
13077
|
|
12992
13078
|
// src/molecules/Textarea/Textarea.tsx
|
12993
|
-
import
|
12994
|
-
import
|
13079
|
+
import React103, { useRef as useRef13, useState as useState12 } from "react";
|
13080
|
+
import omit18 from "lodash/omit";
|
12995
13081
|
import toString2 from "lodash/toString";
|
12996
13082
|
import uniqueId10 from "lodash/uniqueId";
|
12997
|
-
var TextareaBase =
|
13083
|
+
var TextareaBase = React103.forwardRef(
|
12998
13084
|
(_a, ref) => {
|
12999
13085
|
var _b = _a, { readOnly = false, valid = true } = _b, props = __objRest(_b, ["readOnly", "valid"]);
|
13000
|
-
return /* @__PURE__ */
|
13086
|
+
return /* @__PURE__ */ React103.createElement("textarea", __spreadProps(__spreadValues({
|
13001
13087
|
ref
|
13002
13088
|
}, props), {
|
13003
13089
|
readOnly,
|
@@ -13005,25 +13091,25 @@ var TextareaBase = React102.forwardRef(
|
|
13005
13091
|
}));
|
13006
13092
|
}
|
13007
13093
|
);
|
13008
|
-
TextareaBase.Skeleton = () => /* @__PURE__ */
|
13094
|
+
TextareaBase.Skeleton = () => /* @__PURE__ */ React103.createElement(Skeleton, {
|
13009
13095
|
height: 58
|
13010
13096
|
});
|
13011
|
-
var Textarea =
|
13097
|
+
var Textarea = React103.forwardRef((props, ref) => {
|
13012
13098
|
var _a, _b, _c;
|
13013
13099
|
const [value, setValue] = useState12((_b = (_a = props.value) != null ? _a : props.defaultValue) != null ? _b : "");
|
13014
13100
|
const id = useRef13((_c = props.id) != null ? _c : `textarea-${uniqueId10()}`);
|
13015
13101
|
const errorMessageId = uniqueId10();
|
13016
13102
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
13017
13103
|
const _d = getLabelControlProps(props), { "data-testid": dataTestId } = _d, labelControlProps = __objRest(_d, ["data-testid"]);
|
13018
|
-
const baseProps =
|
13019
|
-
return /* @__PURE__ */
|
13104
|
+
const baseProps = omit18(props, Object.keys(labelControlProps));
|
13105
|
+
return /* @__PURE__ */ React103.createElement(LabelControl, __spreadProps(__spreadValues({
|
13020
13106
|
id: `${id.current}-label`,
|
13021
13107
|
htmlFor: id.current,
|
13022
13108
|
messageId: errorMessageId,
|
13023
13109
|
length: value !== void 0 ? toString2(value).length : void 0
|
13024
13110
|
}, labelControlProps), {
|
13025
13111
|
className: "Aquarium-Textarea"
|
13026
|
-
}), /* @__PURE__ */
|
13112
|
+
}), /* @__PURE__ */ React103.createElement(TextareaBase, __spreadProps(__spreadValues(__spreadValues({
|
13027
13113
|
ref
|
13028
13114
|
}, baseProps), errorProps), {
|
13029
13115
|
id: id.current,
|
@@ -13040,48 +13126,48 @@ var Textarea = React102.forwardRef((props, ref) => {
|
|
13040
13126
|
})));
|
13041
13127
|
});
|
13042
13128
|
Textarea.displayName = "Textarea";
|
13043
|
-
var TextAreaSkeleton = () => /* @__PURE__ */
|
13129
|
+
var TextAreaSkeleton = () => /* @__PURE__ */ React103.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React103.createElement(TextareaBase.Skeleton, null));
|
13044
13130
|
Textarea.Skeleton = TextAreaSkeleton;
|
13045
13131
|
Textarea.Skeleton.displayName = "Textarea.Skeleton";
|
13046
13132
|
|
13047
13133
|
// src/molecules/Timeline/Timeline.tsx
|
13048
|
-
import
|
13134
|
+
import React105 from "react";
|
13049
13135
|
|
13050
13136
|
// src/atoms/Timeline/Timeline.tsx
|
13051
|
-
import
|
13137
|
+
import React104 from "react";
|
13052
13138
|
var Timeline = (_a) => {
|
13053
13139
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13054
|
-
return /* @__PURE__ */
|
13140
|
+
return /* @__PURE__ */ React104.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13055
13141
|
className: classNames(tw("grid grid-cols-[16px_1fr] gap-x-4"), className)
|
13056
13142
|
}));
|
13057
13143
|
};
|
13058
13144
|
var Content2 = (_a) => {
|
13059
13145
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13060
|
-
return /* @__PURE__ */
|
13146
|
+
return /* @__PURE__ */ React104.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13061
13147
|
className: classNames(tw("pb-6"), className)
|
13062
13148
|
}));
|
13063
13149
|
};
|
13064
13150
|
var Separator2 = (_a) => {
|
13065
13151
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13066
|
-
return /* @__PURE__ */
|
13152
|
+
return /* @__PURE__ */ React104.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13067
13153
|
className: classNames(tw("flex items-center justify-center h-5 w-5"), className)
|
13068
13154
|
}));
|
13069
13155
|
};
|
13070
13156
|
var LineContainer = (_a) => {
|
13071
13157
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13072
|
-
return /* @__PURE__ */
|
13158
|
+
return /* @__PURE__ */ React104.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13073
13159
|
className: classNames(tw("flex justify-center py-1"), className)
|
13074
13160
|
}));
|
13075
13161
|
};
|
13076
13162
|
var Line = (_a) => {
|
13077
13163
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13078
|
-
return /* @__PURE__ */
|
13164
|
+
return /* @__PURE__ */ React104.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13079
13165
|
className: classNames(tw("w-1 bg-grey-5 h-full justify-self-center"), className)
|
13080
13166
|
}));
|
13081
13167
|
};
|
13082
13168
|
var Dot = (_a) => {
|
13083
13169
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13084
|
-
return /* @__PURE__ */
|
13170
|
+
return /* @__PURE__ */ React104.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13085
13171
|
className: classNames(tw("bg-grey-30 h-[6px] w-[6px] rounded"), className)
|
13086
13172
|
}));
|
13087
13173
|
};
|
@@ -13096,54 +13182,54 @@ var import_error5 = __toESM(require_error());
|
|
13096
13182
|
var import_time2 = __toESM(require_time());
|
13097
13183
|
var import_warningSign5 = __toESM(require_warningSign());
|
13098
13184
|
var TimelineItem = () => null;
|
13099
|
-
var Timeline2 = ({ children }) => /* @__PURE__ */
|
13185
|
+
var Timeline2 = ({ children }) => /* @__PURE__ */ React105.createElement("div", {
|
13100
13186
|
className: "Aquarium-Timeline"
|
13101
|
-
},
|
13187
|
+
}, React105.Children.map(children, (item) => {
|
13102
13188
|
if (!isComponentType(item, TimelineItem)) {
|
13103
13189
|
throw new Error("<Timeline> can only have <Timeline.Item> components as children");
|
13104
13190
|
} else {
|
13105
13191
|
const { props, key } = item;
|
13106
|
-
return /* @__PURE__ */
|
13192
|
+
return /* @__PURE__ */ React105.createElement(Timeline, {
|
13107
13193
|
key: key != null ? key : props.title
|
13108
|
-
}, /* @__PURE__ */
|
13194
|
+
}, /* @__PURE__ */ React105.createElement(Timeline.Separator, null, props.variant === "error" ? /* @__PURE__ */ React105.createElement(Icon, {
|
13109
13195
|
icon: import_error5.default,
|
13110
13196
|
color: "error-30"
|
13111
|
-
}) : props.variant === "warning" ? /* @__PURE__ */
|
13197
|
+
}) : props.variant === "warning" ? /* @__PURE__ */ React105.createElement(Icon, {
|
13112
13198
|
icon: import_warningSign5.default,
|
13113
13199
|
color: "warning-30"
|
13114
|
-
}) : props.variant === "info" ? /* @__PURE__ */
|
13200
|
+
}) : props.variant === "info" ? /* @__PURE__ */ React105.createElement(Icon, {
|
13115
13201
|
icon: import_time2.default,
|
13116
13202
|
color: "info-30"
|
13117
|
-
}) : /* @__PURE__ */
|
13203
|
+
}) : /* @__PURE__ */ React105.createElement(Timeline.Separator.Dot, null)), /* @__PURE__ */ React105.createElement(Typography2.Caption, {
|
13118
13204
|
color: "grey-50"
|
13119
|
-
}, props.title), /* @__PURE__ */
|
13205
|
+
}, props.title), /* @__PURE__ */ React105.createElement(Timeline.LineContainer, null, /* @__PURE__ */ React105.createElement(Timeline.LineContainer.Line, null)), /* @__PURE__ */ React105.createElement(Timeline.Content, null, /* @__PURE__ */ React105.createElement(Typography2.Small, null, props.children)));
|
13120
13206
|
}
|
13121
13207
|
}));
|
13122
|
-
var TimelineItemSkeleton = () => /* @__PURE__ */
|
13208
|
+
var TimelineItemSkeleton = () => /* @__PURE__ */ React105.createElement(Timeline, null, /* @__PURE__ */ React105.createElement(Timeline.Separator, null, /* @__PURE__ */ React105.createElement(Skeleton, {
|
13123
13209
|
width: 6,
|
13124
13210
|
height: 6,
|
13125
13211
|
rounded: true
|
13126
|
-
})), /* @__PURE__ */
|
13212
|
+
})), /* @__PURE__ */ React105.createElement(Skeleton, {
|
13127
13213
|
height: 12,
|
13128
13214
|
width: 120
|
13129
|
-
}), /* @__PURE__ */
|
13215
|
+
}), /* @__PURE__ */ React105.createElement(Timeline.LineContainer, null, /* @__PURE__ */ React105.createElement(Skeleton, {
|
13130
13216
|
width: 2,
|
13131
13217
|
height: "100%"
|
13132
|
-
})), /* @__PURE__ */
|
13218
|
+
})), /* @__PURE__ */ React105.createElement(Timeline.Content, null, /* @__PURE__ */ React105.createElement(Box, {
|
13133
13219
|
display: "flex",
|
13134
13220
|
flexDirection: "column",
|
13135
13221
|
gap: "3"
|
13136
|
-
}, /* @__PURE__ */
|
13222
|
+
}, /* @__PURE__ */ React105.createElement(Skeleton, {
|
13137
13223
|
height: 32,
|
13138
13224
|
width: "100%"
|
13139
|
-
}), /* @__PURE__ */
|
13225
|
+
}), /* @__PURE__ */ React105.createElement(Skeleton, {
|
13140
13226
|
height: 32,
|
13141
13227
|
width: "73%"
|
13142
|
-
}), /* @__PURE__ */
|
13228
|
+
}), /* @__PURE__ */ React105.createElement(Skeleton, {
|
13143
13229
|
height: 32,
|
13144
13230
|
width: "80%"
|
13145
13231
|
}))));
|
13146
|
-
var TimelineSkeleton = ({ items = 3 }) => /* @__PURE__ */
|
13232
|
+
var TimelineSkeleton = ({ items = 3 }) => /* @__PURE__ */ React105.createElement("div", null, Array.from({ length: items }).map((_, key) => /* @__PURE__ */ React105.createElement(TimelineItemSkeleton, {
|
13147
13233
|
key
|
13148
13234
|
})));
|
13149
13235
|
Timeline2.Item = TimelineItem;
|
@@ -13151,9 +13237,9 @@ Timeline2.Skeleton = TimelineSkeleton;
|
|
13151
13237
|
Timeline2.Skeleton.displayName = "Timeline.Skeleton";
|
13152
13238
|
|
13153
13239
|
// src/utils/table/useTableSelect.ts
|
13154
|
-
import
|
13240
|
+
import React106 from "react";
|
13155
13241
|
var useTableSelect = (data, { key }) => {
|
13156
|
-
const [selected, setSelected] =
|
13242
|
+
const [selected, setSelected] = React106.useState([]);
|
13157
13243
|
const allSelected = selected.length === data.length;
|
13158
13244
|
const isSelected = (dot) => selected.includes(dot[key]);
|
13159
13245
|
const selectAll = () => setSelected(data.map((dot) => dot[key]));
|
@@ -13438,6 +13524,7 @@ export {
|
|
13438
13524
|
Textarea,
|
13439
13525
|
TextareaBase,
|
13440
13526
|
Timeline2 as Timeline,
|
13527
|
+
ToastComponent,
|
13441
13528
|
ToastProvider,
|
13442
13529
|
Tooltip,
|
13443
13530
|
Typography2 as Typography,
|