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