@aivenio/aquarium 1.50.0 → 1.51.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 +38 -17
- package/dist/atoms.mjs +38 -17
- package/dist/charts.cjs +142 -103
- package/dist/charts.mjs +129 -91
- package/dist/src/atoms/Modal/Modal.d.ts +6 -3
- package/dist/src/atoms/Modal/Modal.js +25 -14
- package/dist/src/charts/BarChart/BarChart.js +36 -25
- package/dist/src/charts/Legend/Legend.d.ts +4 -0
- package/dist/src/charts/Legend/Legend.js +15 -0
- package/dist/src/charts/PieChart/ChartValue.js +3 -3
- package/dist/src/charts/PieChart/DoughnutChart.js +45 -7
- package/dist/src/charts/PieChart/renderPieChildren.d.ts +1 -1
- package/dist/src/charts/PieChart/renderPieChildren.js +4 -5
- package/dist/src/charts/index.d.ts +1 -0
- package/dist/src/charts/index.js +2 -1
- package/dist/src/charts/lib/utils.d.ts +1 -5
- package/dist/src/charts/lib/utils.js +7 -4
- package/dist/src/molecules/DataList/DataList.d.ts +9 -2
- package/dist/src/molecules/DataList/DataList.js +3 -3
- package/dist/src/molecules/DataTable/DataTable.d.ts +9 -2
- package/dist/src/molecules/DataTable/DataTable.js +3 -3
- package/dist/src/molecules/Drawer/Drawer.d.ts +10 -0
- package/dist/src/molecules/Drawer/Drawer.js +116 -0
- package/dist/src/molecules/Modal/Modal.d.ts +8 -9
- package/dist/src/molecules/Modal/Modal.js +1 -1
- package/dist/src/molecules/Tabs/Tabs.js +3 -3
- package/dist/src/molecules/index.d.ts +1 -0
- package/dist/src/molecules/index.js +2 -1
- package/dist/src/utils/table/types.d.ts +2 -0
- package/dist/src/utils/table/types.js +4 -1
- package/dist/src/utils/table/useTableSort.d.ts +10 -3
- package/dist/src/utils/table/useTableSort.js +24 -6
- package/dist/styles.css +54 -22
- package/dist/system.cjs +1189 -1012
- package/dist/system.mjs +1191 -1016
- package/dist/tsconfig.module.tsbuildinfo +1 -1
- package/dist/types/tailwindGenerated.d.ts +1 -1
- package/package.json +2 -2
- package/dist/src/charts/PieChart/renderScaledChartValue.d.ts +0 -8
- package/dist/src/charts/PieChart/renderScaledChartValue.js +0 -15
package/dist/system.mjs
CHANGED
@@ -4644,6 +4644,7 @@ __export(molecules_exports, {
|
|
4644
4644
|
DesignSystemContext: () => DesignSystemContext,
|
4645
4645
|
Dialog: () => Dialog,
|
4646
4646
|
Divider: () => Divider2,
|
4647
|
+
Drawer: () => Drawer,
|
4647
4648
|
Dropdown: () => Dropdown,
|
4648
4649
|
DropdownButton: () => DropdownButton,
|
4649
4650
|
DropdownMenu: () => DropdownMenu2,
|
@@ -4727,6 +4728,7 @@ __export(molecules_exports, {
|
|
4727
4728
|
cellProps: () => cellProps,
|
4728
4729
|
columnIsFieldColumn: () => columnIsFieldColumn,
|
4729
4730
|
createTabsComponent: () => createTabsComponent,
|
4731
|
+
isOnSortChangedDirection: () => isOnSortChangedDirection,
|
4730
4732
|
toSortDirection: () => toSortDirection,
|
4731
4733
|
usePagination: () => usePagination,
|
4732
4734
|
usePopoverContext: () => usePopoverContext,
|
@@ -10367,20 +10369,35 @@ var cellProps = (column) => ({
|
|
10367
10369
|
stickyColumn: column.sticky
|
10368
10370
|
});
|
10369
10371
|
var columnIsFieldColumn = (column) => Boolean(column && column.field);
|
10372
|
+
function isOnSortChangedDirection(value) {
|
10373
|
+
return value === void 0 || ["ascending", "descending"].includes(value);
|
10374
|
+
}
|
10370
10375
|
|
10371
10376
|
// src/utils/table/useTableSort.tsx
|
10372
10377
|
import React60 from "react";
|
10373
|
-
var
|
10374
|
-
|
10378
|
+
var getDefaultSort = (props) => "defaultSort" in props ? props.defaultSort : "column" in props && "direction" in props && Object.keys(props).length === 2 ? { column: props.column, direction: props.direction } : void 0;
|
10379
|
+
var useTableSort = (props) => {
|
10380
|
+
const onSortChanged = props && "onSortChanged" in props ? props.onSortChanged : void 0;
|
10381
|
+
const [sort, setSort] = React60.useState(props && getDefaultSort(props));
|
10382
|
+
const setSortAndEmitOnSortChangedEvent = (sort2) => {
|
10383
|
+
setSort(sort2);
|
10384
|
+
if (onSortChanged) {
|
10385
|
+
if (sort2 && isOnSortChangedDirection(sort2.direction)) {
|
10386
|
+
onSortChanged({ key: sort2.column.key, direction: sort2 == null ? void 0 : sort2.direction });
|
10387
|
+
} else {
|
10388
|
+
onSortChanged(null);
|
10389
|
+
}
|
10390
|
+
}
|
10391
|
+
};
|
10375
10392
|
const handleSortClick = (column) => {
|
10376
10393
|
if (sort && sort.column.headerName === column.headerName) {
|
10377
10394
|
if (sort.direction === "ascending") {
|
10378
|
-
|
10395
|
+
setSortAndEmitOnSortChangedEvent({ column, direction: "descending" });
|
10379
10396
|
} else {
|
10380
|
-
|
10397
|
+
setSortAndEmitOnSortChangedEvent(void 0);
|
10381
10398
|
}
|
10382
10399
|
} else {
|
10383
|
-
|
10400
|
+
setSortAndEmitOnSortChangedEvent({ column, direction: "ascending" });
|
10384
10401
|
}
|
10385
10402
|
};
|
10386
10403
|
return [sort, handleSortClick];
|
@@ -10640,12 +10657,15 @@ var DataList2 = ({
|
|
10640
10657
|
getGroupRow,
|
10641
10658
|
onGroupToggled,
|
10642
10659
|
expandedGroupIds,
|
10643
|
-
defaultSort
|
10660
|
+
defaultSort,
|
10661
|
+
onSortChanged
|
10644
10662
|
}) => {
|
10645
10663
|
var _a;
|
10646
10664
|
const defaultSortedColumn = columns.find((c) => c.headerName === (defaultSort == null ? void 0 : defaultSort.headerName));
|
10647
10665
|
const initialSortState = defaultSortedColumn ? { column: defaultSortedColumn, direction: (_a = defaultSort == null ? void 0 : defaultSort.direction) != null ? _a : "ascending" } : void 0;
|
10648
|
-
const [sort, updateSort] = useTableSort(
|
10666
|
+
const [sort, updateSort] = useTableSort(
|
10667
|
+
onSortChanged ? __spreadProps(__spreadValues({}, initialSortState), { onSortChanged }) : initialSortState
|
10668
|
+
);
|
10649
10669
|
const sortedRows = sortRowsBy(rows, sort);
|
10650
10670
|
const groups = group ? isFunction(group) ? group(sortedRows) : groupBy2(sortedRows, group) : void 0;
|
10651
10671
|
const groupKeys = groups ? Object.keys(groups) : void 0;
|
@@ -10895,7 +10915,8 @@ var DataTable = (_a) => {
|
|
10895
10915
|
onMenuOpenChange,
|
10896
10916
|
pagination,
|
10897
10917
|
disabled,
|
10898
|
-
defaultSort
|
10918
|
+
defaultSort,
|
10919
|
+
onSortChanged
|
10899
10920
|
} = _b, rest = __objRest(_b, [
|
10900
10921
|
"columns",
|
10901
10922
|
"rows",
|
@@ -10910,12 +10931,15 @@ var DataTable = (_a) => {
|
|
10910
10931
|
"onMenuOpenChange",
|
10911
10932
|
"pagination",
|
10912
10933
|
"disabled",
|
10913
|
-
"defaultSort"
|
10934
|
+
"defaultSort",
|
10935
|
+
"onSortChanged"
|
10914
10936
|
]);
|
10915
10937
|
var _a2;
|
10916
10938
|
const defaultSortedColumn = columns.find((c) => c.headerName === (defaultSort == null ? void 0 : defaultSort.headerName));
|
10917
10939
|
const initialSortState = defaultSortedColumn ? { column: defaultSortedColumn, direction: (_a2 = defaultSort == null ? void 0 : defaultSort.direction) != null ? _a2 : "ascending" } : void 0;
|
10918
|
-
const [sort, updateSort] = useTableSort(
|
10940
|
+
const [sort, updateSort] = useTableSort(
|
10941
|
+
onSortChanged ? __spreadProps(__spreadValues({}, initialSortState), { onSortChanged }) : initialSortState
|
10942
|
+
);
|
10919
10943
|
const sortedRows = sortRowsBy(rows, sort);
|
10920
10944
|
const amountOfColumns = columns.length + (menu ? 1 : 0);
|
10921
10945
|
const PaginationFooter = React68.useCallback(
|
@@ -11057,10 +11081,23 @@ var DIALOG_ICONS_AND_COLORS = {
|
|
11057
11081
|
// src/atoms/Modal/Modal.tsx
|
11058
11082
|
import React69 from "react";
|
11059
11083
|
var Modal = (_a) => {
|
11060
|
-
var _b = _a, {
|
11084
|
+
var _b = _a, {
|
11085
|
+
children,
|
11086
|
+
kind = "dialog",
|
11087
|
+
className,
|
11088
|
+
open
|
11089
|
+
} = _b, rest = __objRest(_b, [
|
11090
|
+
"children",
|
11091
|
+
"kind",
|
11092
|
+
"className",
|
11093
|
+
"open"
|
11094
|
+
]);
|
11061
11095
|
return open ? /* @__PURE__ */ React69.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
11062
11096
|
className: classNames(
|
11063
|
-
tw("inset-0 overflow-y-auto z-modal
|
11097
|
+
tw("inset-0 overflow-y-auto z-modal fixed"),
|
11098
|
+
{
|
11099
|
+
"py-7 justify-center flex items-center": kind === "dialog"
|
11100
|
+
},
|
11064
11101
|
className
|
11065
11102
|
)
|
11066
11103
|
}), children) : null;
|
@@ -11073,27 +11110,30 @@ Modal.BackDrop = (_a) => {
|
|
11073
11110
|
};
|
11074
11111
|
Modal.Dialog = React69.forwardRef(
|
11075
11112
|
(_a, ref) => {
|
11076
|
-
var _b = _a, { children, className, size = "sm" } = _b, rest = __objRest(_b, ["children", "className", "size"]);
|
11113
|
+
var _b = _a, { kind = "dialog", children, className, size = "sm" } = _b, rest = __objRest(_b, ["kind", "children", "className", "size"]);
|
11114
|
+
const commonClasses = tw("bg-white max-h-full flex flex-col");
|
11115
|
+
const dialogClasses = classNames("relative w-full rounded", {
|
11116
|
+
"max-w-[600px]": size === "sm",
|
11117
|
+
"max-w-[940px]": size === "md",
|
11118
|
+
"min-h-full": size === "full"
|
11119
|
+
});
|
11120
|
+
const drawerClasses = classNames("absolute h-full", {
|
11121
|
+
"w-[360px]": size === "sm",
|
11122
|
+
"w-[560px]": size === "md",
|
11123
|
+
"w-[1080px]": size === "full"
|
11124
|
+
});
|
11077
11125
|
return /* @__PURE__ */ React69.createElement("div", __spreadProps(__spreadValues({
|
11078
11126
|
ref,
|
11079
11127
|
"aria-modal": "true"
|
11080
11128
|
}, rest), {
|
11081
|
-
className: classNames(
|
11082
|
-
tw("relative bg-white rounded mx-7 w-full max-h-full flex flex-col"),
|
11083
|
-
{
|
11084
|
-
"max-w-[600px]": size === "sm",
|
11085
|
-
"max-w-[940px]": size === "md",
|
11086
|
-
"min-h-full": size === "full"
|
11087
|
-
},
|
11088
|
-
className
|
11089
|
-
)
|
11129
|
+
className: classNames(commonClasses, kind === "dialog" ? dialogClasses : drawerClasses, className)
|
11090
11130
|
}), children);
|
11091
11131
|
}
|
11092
11132
|
);
|
11093
11133
|
Modal.Header = (_a) => {
|
11094
11134
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
11095
11135
|
return /* @__PURE__ */ React69.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
11096
|
-
className: classNames(tw("
|
11136
|
+
className: classNames(tw("pl-7 pr-[64px] py-6 gap-3 flex items-center"), className)
|
11097
11137
|
}), children);
|
11098
11138
|
};
|
11099
11139
|
Modal.HeaderImage = (_a) => {
|
@@ -11111,16 +11151,21 @@ Modal.HeaderImage = (_a) => {
|
|
11111
11151
|
Modal.CloseButtonContainer = (_a) => {
|
11112
11152
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
11113
11153
|
return /* @__PURE__ */ React69.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
11114
|
-
className: classNames(tw("absolute top-[
|
11154
|
+
className: classNames(tw("absolute top-[24px] right-[28px]"), className)
|
11115
11155
|
}));
|
11116
11156
|
};
|
11117
11157
|
Modal.Title = (_a) => {
|
11118
|
-
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
11158
|
+
var _b = _a, { kind = "dialog", children, className } = _b, rest = __objRest(_b, ["kind", "children", "className"]);
|
11119
11159
|
return /* @__PURE__ */ React69.createElement(Typography, __spreadValues({
|
11120
11160
|
htmlTag: "h2",
|
11121
11161
|
variant: "subheading",
|
11122
11162
|
color: "grey-90",
|
11123
|
-
className: classNames(
|
11163
|
+
className: classNames(
|
11164
|
+
tw({
|
11165
|
+
"text-ellipsis overflow-x-hidden whitespace-nowrap": kind === "drawer"
|
11166
|
+
}),
|
11167
|
+
className
|
11168
|
+
)
|
11124
11169
|
}, rest), children);
|
11125
11170
|
};
|
11126
11171
|
Modal.Subtitle = (_a) => {
|
@@ -11133,7 +11178,7 @@ Modal.Subtitle = (_a) => {
|
|
11133
11178
|
Modal.TitleContainer = (_a) => {
|
11134
11179
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
11135
11180
|
return /* @__PURE__ */ React69.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
11136
|
-
className: classNames(tw("flex flex-col grow
|
11181
|
+
className: classNames(tw("flex flex-col grow"), className)
|
11137
11182
|
}), children);
|
11138
11183
|
};
|
11139
11184
|
Modal.Body = (_a) => {
|
@@ -11209,259 +11254,686 @@ var DialogWrapper = ({
|
|
11209
11254
|
}, omit8(primaryAction, "text")), primaryAction.text))));
|
11210
11255
|
};
|
11211
11256
|
|
11212
|
-
// src/molecules/
|
11213
|
-
import
|
11214
|
-
|
11215
|
-
|
11216
|
-
import
|
11217
|
-
import {
|
11218
|
-
import {
|
11219
|
-
import
|
11220
|
-
import { useOverlayTriggerState as useOverlayTriggerState3 } from "@react-stately/overlays";
|
11221
|
-
import classNames8 from "classnames";
|
11257
|
+
// src/molecules/Drawer/Drawer.tsx
|
11258
|
+
import React72, { useEffect as useEffect10 } from "react";
|
11259
|
+
import { useOverlayTriggerState as useOverlayTriggerState3 } from "react-stately";
|
11260
|
+
import { useDialog as useDialog2 } from "@react-aria/dialog";
|
11261
|
+
import { Overlay as Overlay3, useModalOverlay as useModalOverlay2 } from "@react-aria/overlays";
|
11262
|
+
import { useId as useId9 } from "@react-aria/utils";
|
11263
|
+
import { animated as animated4, useSpring as useSpring3 } from "@react-spring/web";
|
11264
|
+
import castArray from "lodash/castArray";
|
11222
11265
|
import omit9 from "lodash/omit";
|
11223
11266
|
|
11224
|
-
// src/molecules/
|
11225
|
-
import React71 from "react";
|
11226
|
-
import
|
11227
|
-
|
11228
|
-
|
11229
|
-
|
11230
|
-
|
11231
|
-
|
11232
|
-
|
11233
|
-
className: tw("outline-none")
|
11234
|
-
}), children);
|
11267
|
+
// src/molecules/Tabs/Tabs.tsx
|
11268
|
+
import React71, { useEffect as useEffect9, useLayoutEffect as useLayoutEffect2, useRef as useRef7, useState as useState10 } from "react";
|
11269
|
+
import isNumber5 from "lodash/isNumber";
|
11270
|
+
import kebabCase from "lodash/kebabCase";
|
11271
|
+
var import_chevronLeft4 = __toESM(require_chevronLeft());
|
11272
|
+
var import_chevronRight4 = __toESM(require_chevronRight());
|
11273
|
+
var import_warningSign4 = __toESM(require_warningSign());
|
11274
|
+
var isTabComponent = (c) => {
|
11275
|
+
return React71.isValidElement(c) && (c.type === Tab || c.type === ModalTab);
|
11235
11276
|
};
|
11236
|
-
|
11237
|
-
|
11238
|
-
|
11239
|
-
|
11240
|
-
|
11241
|
-
|
11242
|
-
|
11243
|
-
|
11277
|
+
var Tab = React71.forwardRef(
|
11278
|
+
({ className, id, title, children }, ref) => {
|
11279
|
+
return /* @__PURE__ */ React71.createElement("div", {
|
11280
|
+
ref,
|
11281
|
+
id: `${id != null ? id : kebabCase(title)}-panel`,
|
11282
|
+
className,
|
11283
|
+
role: "tabpanel",
|
11284
|
+
tabIndex: 0,
|
11285
|
+
"aria-labelledby": `${id != null ? id : kebabCase(title)}-tab`
|
11286
|
+
}, children);
|
11244
11287
|
}
|
11245
|
-
|
11288
|
+
);
|
11289
|
+
var TabContainer = (_a) => {
|
11290
|
+
var _b = _a, { className, children } = _b, rest = __objRest(_b, ["className", "children"]);
|
11291
|
+
return /* @__PURE__ */ React71.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
11292
|
+
className: classNames("py-6 z-0", className)
|
11293
|
+
}), children);
|
11246
11294
|
};
|
11247
|
-
|
11248
|
-
|
11249
|
-
var
|
11250
|
-
const
|
11251
|
-
|
11252
|
-
|
11253
|
-
|
11254
|
-
|
11255
|
-
|
11256
|
-
|
11257
|
-
|
11258
|
-
|
11259
|
-
|
11260
|
-
|
11261
|
-
|
11262
|
-
|
11263
|
-
|
11264
|
-
|
11265
|
-
|
11266
|
-
|
11267
|
-
|
11268
|
-
|
11269
|
-
|
11270
|
-
|
11271
|
-
|
11272
|
-
|
11273
|
-
"
|
11274
|
-
"
|
11275
|
-
"
|
11276
|
-
|
11277
|
-
|
11278
|
-
|
11279
|
-
|
11280
|
-
|
11281
|
-
|
11282
|
-
|
11283
|
-
|
11284
|
-
|
11285
|
-
|
11286
|
-
|
11287
|
-
|
11288
|
-
|
11289
|
-
|
11290
|
-
|
11295
|
+
var ModalTab = Tab;
|
11296
|
+
var ModalTabContainer = TabContainer;
|
11297
|
+
var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
11298
|
+
const Tab2 = React71.forwardRef(
|
11299
|
+
(_a, ref) => {
|
11300
|
+
var _b = _a, {
|
11301
|
+
id,
|
11302
|
+
value,
|
11303
|
+
status = "default",
|
11304
|
+
disabled,
|
11305
|
+
badge,
|
11306
|
+
tooltip,
|
11307
|
+
title,
|
11308
|
+
index,
|
11309
|
+
selected,
|
11310
|
+
onSelected,
|
11311
|
+
showNotification = false,
|
11312
|
+
className
|
11313
|
+
} = _b, rest = __objRest(_b, [
|
11314
|
+
"id",
|
11315
|
+
"value",
|
11316
|
+
"status",
|
11317
|
+
"disabled",
|
11318
|
+
"badge",
|
11319
|
+
"tooltip",
|
11320
|
+
"title",
|
11321
|
+
"index",
|
11322
|
+
"selected",
|
11323
|
+
"onSelected",
|
11324
|
+
"showNotification",
|
11325
|
+
"className"
|
11326
|
+
]);
|
11327
|
+
const _id = id != null ? id : kebabCase(title);
|
11328
|
+
let statusIcon = void 0;
|
11329
|
+
if (status === "warning") {
|
11330
|
+
statusIcon = /* @__PURE__ */ React71.createElement(InlineIcon, {
|
11331
|
+
icon: import_warningSign4.default,
|
11332
|
+
color: selected ? void 0 : "warning-80"
|
11333
|
+
});
|
11334
|
+
} else if (status === "error") {
|
11335
|
+
statusIcon = /* @__PURE__ */ React71.createElement(InlineIcon, {
|
11336
|
+
icon: import_warningSign4.default,
|
11337
|
+
color: selected ? void 0 : "error-50"
|
11338
|
+
});
|
11339
|
+
}
|
11340
|
+
const tab = /* @__PURE__ */ React71.createElement(Component, __spreadValues({
|
11341
|
+
ref,
|
11342
|
+
id: `${_id}-tab`,
|
11343
|
+
onClick: () => !disabled && onSelected(value != null ? value : index),
|
11344
|
+
className: classNames(className, "px-5 py-3 z-10 no-underline appearance-none outline-none h-full", {
|
11345
|
+
"cursor-default": disabled,
|
11346
|
+
"text-grey-80 focus:text-primary-80": !selected,
|
11347
|
+
"hover:bg-grey-0 hover:border-grey-20": !selected && !disabled,
|
11348
|
+
"border-b-2": !defaultUnderlineHidden || selected,
|
11349
|
+
"border-grey-10": !selected,
|
11350
|
+
"border-primary-80": selected
|
11351
|
+
}),
|
11352
|
+
type: "button",
|
11353
|
+
role: "tab",
|
11354
|
+
"aria-selected": selected,
|
11355
|
+
"aria-controls": `${_id}-panel`,
|
11356
|
+
tabIndex: disabled ? void 0 : 0
|
11357
|
+
}, rest), /* @__PURE__ */ React71.createElement(Typography2, {
|
11358
|
+
htmlTag: "div",
|
11359
|
+
variant: "small-strong",
|
11360
|
+
color: selected ? "primary-80" : disabled ? "grey-20" : "current",
|
11361
|
+
className: tw("inline-flex items-center gap-3")
|
11362
|
+
}, showNotification ? /* @__PURE__ */ React71.createElement(Badge.Notification, {
|
11363
|
+
right: "-4px",
|
11364
|
+
top: "3px"
|
11365
|
+
}, /* @__PURE__ */ React71.createElement("span", {
|
11366
|
+
className: tw("whitespace-nowrap")
|
11367
|
+
}, title)) : /* @__PURE__ */ React71.createElement("span", {
|
11368
|
+
className: tw("whitespace-nowrap")
|
11369
|
+
}, title), isNumber5(badge) && /* @__PURE__ */ React71.createElement(Typography2, {
|
11370
|
+
htmlTag: "span",
|
11371
|
+
variant: "small",
|
11372
|
+
color: selected ? "primary-80" : "grey-5",
|
11373
|
+
className: "leading-none"
|
11374
|
+
}, /* @__PURE__ */ React71.createElement(TabBadge, {
|
11375
|
+
kind: "filled",
|
11376
|
+
value: badge,
|
11377
|
+
textClassname: classNames({ "text-white": selected, "text-grey-50": !selected })
|
11378
|
+
})), statusIcon));
|
11379
|
+
return tooltip ? /* @__PURE__ */ React71.createElement(Tooltip, {
|
11380
|
+
content: tooltip
|
11381
|
+
}, tab) : tab;
|
11291
11382
|
}
|
11292
|
-
|
11293
|
-
|
11383
|
+
);
|
11384
|
+
Tab2.displayName = displayName;
|
11385
|
+
return Tab2;
|
11294
11386
|
};
|
11295
|
-
var
|
11296
|
-
|
11297
|
-
|
11298
|
-
|
11299
|
-
|
11300
|
-
|
11301
|
-
|
11302
|
-
|
11303
|
-
const
|
11304
|
-
const
|
11305
|
-
const
|
11306
|
-
|
11307
|
-
|
11387
|
+
var TabItem = asTabItem("button", "TabItem");
|
11388
|
+
var CARET_OFFSET = 24;
|
11389
|
+
var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderChildren) => {
|
11390
|
+
const Tabs2 = (props) => {
|
11391
|
+
var _a, _b;
|
11392
|
+
const { className, value, defaultValue, onChange, children } = props;
|
11393
|
+
const childArr = React71.Children.toArray(children);
|
11394
|
+
const firstTab = childArr[0];
|
11395
|
+
const firstTabValue = isTabComponent(firstTab) ? firstTab.props.value : -1;
|
11396
|
+
const [selected, setSelected] = useState10((_b = (_a = value != null ? value : defaultValue) != null ? _a : firstTabValue) != null ? _b : 0);
|
11397
|
+
const [leftCaret, showLeftCaret] = useState10(false);
|
11398
|
+
const [rightCaret, showRightCaret] = useState10(false);
|
11399
|
+
const parentRef = useRef7(null);
|
11400
|
+
const containerRef = useRef7(null);
|
11401
|
+
const tabsRef = useRef7(null);
|
11402
|
+
const revealSelectedTab = ({ smooth }) => {
|
11403
|
+
var _a2, _b2;
|
11404
|
+
const container = containerRef.current;
|
11405
|
+
const tabs = tabsRef.current;
|
11406
|
+
const values = React71.Children.map(
|
11407
|
+
children,
|
11408
|
+
(tab, i) => {
|
11409
|
+
var _a3;
|
11410
|
+
return (_a3 = tab == null ? void 0 : tab.props.value) != null ? _a3 : i;
|
11411
|
+
}
|
11412
|
+
);
|
11413
|
+
const idx = (_a2 = values == null ? void 0 : values.findIndex((val) => value === val)) != null ? _a2 : -1;
|
11414
|
+
const child = Array.from((_b2 = tabs == null ? void 0 : tabs.childNodes) != null ? _b2 : [])[idx];
|
11415
|
+
if (!container || !(child instanceof HTMLElement)) {
|
11416
|
+
return;
|
11417
|
+
}
|
11418
|
+
const { width: containerWidth, x: containerX } = container.getBoundingClientRect();
|
11419
|
+
const { x, width } = child.getBoundingClientRect();
|
11420
|
+
const isInViewPort = x >= containerX && x + width <= containerX + containerWidth;
|
11421
|
+
if (!isInViewPort) {
|
11422
|
+
container.scrollTo({
|
11423
|
+
left: container.scrollLeft + Math.ceil(x + width + CARET_OFFSET - containerX - containerWidth),
|
11424
|
+
behavior: smooth ? "smooth" : void 0
|
11425
|
+
});
|
11426
|
+
}
|
11308
11427
|
};
|
11309
|
-
|
11310
|
-
|
11311
|
-
|
11312
|
-
|
11313
|
-
|
11314
|
-
|
11315
|
-
};
|
11316
|
-
|
11317
|
-
|
11318
|
-
|
11319
|
-
|
11320
|
-
|
11321
|
-
|
11322
|
-
|
11323
|
-
|
11324
|
-
|
11325
|
-
|
11326
|
-
|
11327
|
-
|
11328
|
-
|
11329
|
-
|
11330
|
-
|
11331
|
-
|
11332
|
-
|
11333
|
-
|
11334
|
-
|
11335
|
-
|
11336
|
-
|
11337
|
-
|
11338
|
-
|
11339
|
-
};
|
11340
|
-
|
11341
|
-
|
11342
|
-
|
11343
|
-
|
11344
|
-
|
11345
|
-
|
11346
|
-
}
|
11347
|
-
|
11348
|
-
|
11349
|
-
|
11350
|
-
|
11351
|
-
|
11428
|
+
const updateCarets = () => {
|
11429
|
+
const pEl = parentRef.current;
|
11430
|
+
const el = containerRef.current;
|
11431
|
+
if (!pEl || !el) {
|
11432
|
+
return;
|
11433
|
+
}
|
11434
|
+
const { width } = pEl.getBoundingClientRect();
|
11435
|
+
const hasLeftCaret = el.scrollWidth > width && el.scrollLeft !== 0;
|
11436
|
+
const hasRightCaret = el.scrollWidth > width && Math.round(el.scrollLeft + el.getBoundingClientRect().width) !== Math.round(el.scrollWidth);
|
11437
|
+
showLeftCaret(hasLeftCaret);
|
11438
|
+
showRightCaret(hasRightCaret);
|
11439
|
+
};
|
11440
|
+
useEffect9(() => {
|
11441
|
+
if (value === void 0) {
|
11442
|
+
return;
|
11443
|
+
}
|
11444
|
+
updateCarets();
|
11445
|
+
setSelected(value);
|
11446
|
+
revealSelectedTab({ smooth: value !== selected });
|
11447
|
+
}, [value, React71.Children.count(children)]);
|
11448
|
+
useLayoutEffect2(() => {
|
11449
|
+
var _a2;
|
11450
|
+
updateCarets();
|
11451
|
+
(_a2 = containerRef.current) == null ? void 0 : _a2.addEventListener("scroll", updateCarets);
|
11452
|
+
window.addEventListener("resize", updateCarets);
|
11453
|
+
return () => {
|
11454
|
+
var _a3;
|
11455
|
+
(_a3 = containerRef.current) == null ? void 0 : _a3.removeEventListener("scroll", updateCarets);
|
11456
|
+
window.removeEventListener("resize", updateCarets);
|
11457
|
+
};
|
11458
|
+
}, [parentRef.current, containerRef.current, children]);
|
11459
|
+
const handleScrollToNext = (direction) => {
|
11460
|
+
const container = containerRef.current;
|
11461
|
+
const tabs = tabsRef.current;
|
11462
|
+
if (!container || !tabs) {
|
11463
|
+
return;
|
11464
|
+
}
|
11465
|
+
const { width: containerWidth, x: containerX } = container.getBoundingClientRect();
|
11466
|
+
const children2 = Array.from(tabs.childNodes).filter(
|
11467
|
+
(c) => c instanceof HTMLElement
|
11468
|
+
);
|
11469
|
+
if (direction === "right") {
|
11470
|
+
const next = children2.find((c) => {
|
11471
|
+
const { x, width } = c.getBoundingClientRect();
|
11472
|
+
return Math.round(x + width - containerX - containerWidth) > 0;
|
11473
|
+
});
|
11474
|
+
if (next instanceof HTMLElement) {
|
11475
|
+
const { x, width } = next.getBoundingClientRect();
|
11476
|
+
container.scrollTo({
|
11477
|
+
left: container.scrollLeft + Math.ceil(x + width + CARET_OFFSET - containerX - containerWidth),
|
11478
|
+
behavior: "smooth"
|
11479
|
+
});
|
11480
|
+
}
|
11481
|
+
} else {
|
11482
|
+
const next = children2.find((c) => {
|
11483
|
+
const { x, width } = c.getBoundingClientRect();
|
11484
|
+
return Math.round(x + width - containerX) >= 0;
|
11485
|
+
});
|
11486
|
+
if (next instanceof HTMLElement) {
|
11487
|
+
const { x } = next.getBoundingClientRect();
|
11488
|
+
container.scrollTo({
|
11489
|
+
left: container.scrollLeft - Math.abs(x - containerX - CARET_OFFSET),
|
11490
|
+
behavior: "smooth"
|
11491
|
+
});
|
11492
|
+
}
|
11493
|
+
}
|
11494
|
+
};
|
11495
|
+
const handleKeyDown = (event) => {
|
11496
|
+
const target = event.target;
|
11497
|
+
const parent = target.parentElement;
|
11498
|
+
const first = parent.firstChild;
|
11499
|
+
const last = parent.lastChild;
|
11500
|
+
const next = target.nextElementSibling;
|
11501
|
+
const prev = target.previousElementSibling;
|
11502
|
+
if (event.key === "ArrowRight") {
|
11503
|
+
(next != null ? next : first).focus();
|
11504
|
+
} else if (event.key === "ArrowLeft") {
|
11505
|
+
(prev != null ? prev : last).focus();
|
11506
|
+
}
|
11507
|
+
};
|
11508
|
+
const handleSelected = (key) => {
|
11509
|
+
(onChange != null ? onChange : setSelected)(key);
|
11510
|
+
};
|
11511
|
+
React71.Children.forEach(children, (c) => {
|
11512
|
+
if (c && !isTabComponent(c)) {
|
11513
|
+
throw new Error("<Tabs> can only have <Tabs.Tab> components as children");
|
11514
|
+
}
|
11352
11515
|
});
|
11353
|
-
return
|
11354
|
-
|
11355
|
-
|
11356
|
-
|
11357
|
-
|
11358
|
-
|
11359
|
-
|
11360
|
-
|
11361
|
-
|
11362
|
-
|
11363
|
-
|
11364
|
-
|
11365
|
-
|
11366
|
-
|
11367
|
-
|
11368
|
-
|
11369
|
-
|
11370
|
-
|
11371
|
-
|
11372
|
-
|
11373
|
-
|
11374
|
-
|
11375
|
-
|
11376
|
-
|
11377
|
-
|
11378
|
-
|
11379
|
-
|
11380
|
-
|
11381
|
-
|
11382
|
-
|
11383
|
-
"
|
11384
|
-
|
11385
|
-
|
11386
|
-
|
11387
|
-
|
11388
|
-
|
11389
|
-
|
11390
|
-
|
11391
|
-
|
11516
|
+
return /* @__PURE__ */ React71.createElement("div", {
|
11517
|
+
ref: parentRef,
|
11518
|
+
className: classNames("Aquarium-Tabs", tw("h-full"), className)
|
11519
|
+
}, /* @__PURE__ */ React71.createElement("div", {
|
11520
|
+
className: tw("relative flex items-center border-b-2 border-grey-10")
|
11521
|
+
}, /* @__PURE__ */ React71.createElement("div", {
|
11522
|
+
ref: containerRef,
|
11523
|
+
className: tw("overflow-y-auto scrollbar-hide h-full mb-[-2px]")
|
11524
|
+
}, /* @__PURE__ */ React71.createElement("div", {
|
11525
|
+
ref: tabsRef,
|
11526
|
+
role: "tablist",
|
11527
|
+
"aria-label": "tabs",
|
11528
|
+
className: tw("inline-flex items-center cursor-pointer font-normal h-full")
|
11529
|
+
}, React71.Children.map(
|
11530
|
+
children,
|
11531
|
+
(tab, index) => tab ? /* @__PURE__ */ React71.createElement(TabItemComponent, __spreadProps(__spreadValues({
|
11532
|
+
key: tab.props.value
|
11533
|
+
}, tab.props), {
|
11534
|
+
index,
|
11535
|
+
selected: tab.props.value !== void 0 ? tab.props.value === selected : index === selected,
|
11536
|
+
onKeyDown: handleKeyDown,
|
11537
|
+
onSelected: handleSelected
|
11538
|
+
})) : void 0
|
11539
|
+
))), leftCaret && /* @__PURE__ */ React71.createElement("div", {
|
11540
|
+
className: tw("absolute left-0 bg-gradient-to-r from-white via-white z-20 py-3 pr-4")
|
11541
|
+
}, /* @__PURE__ */ React71.createElement("div", {
|
11542
|
+
onClick: () => handleScrollToNext("left"),
|
11543
|
+
className: tw("hover:bg-grey-0 p-2 leading-none cursor-pointer")
|
11544
|
+
}, /* @__PURE__ */ React71.createElement(InlineIcon, {
|
11545
|
+
icon: import_chevronLeft4.default
|
11546
|
+
}))), rightCaret && /* @__PURE__ */ React71.createElement("div", {
|
11547
|
+
onClick: () => handleScrollToNext("right"),
|
11548
|
+
className: tw("absolute right-0 bg-gradient-to-l from-white via-white z-20 py-3 pl-4")
|
11549
|
+
}, /* @__PURE__ */ React71.createElement("div", {
|
11550
|
+
onClick: () => handleScrollToNext("right"),
|
11551
|
+
className: tw("hover:bg-grey-0 p-2 leading-none cursor-pointer")
|
11552
|
+
}, /* @__PURE__ */ React71.createElement(InlineIcon, {
|
11553
|
+
icon: import_chevronRight4.default
|
11554
|
+
})))), renderChildren(children, selected, props));
|
11392
11555
|
};
|
11393
|
-
|
11394
|
-
|
11395
|
-
|
11396
|
-
|
11397
|
-
|
11398
|
-
|
11399
|
-
|
11400
|
-
|
11401
|
-
|
11402
|
-
|
11403
|
-
|
11404
|
-
|
11405
|
-
|
11406
|
-
|
11407
|
-
|
11408
|
-
|
11409
|
-
|
11410
|
-
|
11411
|
-
|
11412
|
-
|
11556
|
+
Tabs2.displayName = displayName;
|
11557
|
+
Tabs2.Tab = TabComponent;
|
11558
|
+
return Tabs2;
|
11559
|
+
};
|
11560
|
+
var Tabs = createTabsComponent(Tab, TabItem, "Tabs", (children, selected) => /* @__PURE__ */ React71.createElement(TabContainer, null, children.find(
|
11561
|
+
(node, index) => (node == null ? void 0 : node.props.value) === selected || index === selected
|
11562
|
+
)));
|
11563
|
+
|
11564
|
+
// src/molecules/Drawer/Drawer.tsx
|
11565
|
+
var import_cross6 = __toESM(require_cross());
|
11566
|
+
var import_more4 = __toESM(require_more());
|
11567
|
+
var AnimatedBackDrop = animated4(Modal.BackDrop);
|
11568
|
+
var AnimatedDialog = animated4(Modal.Dialog);
|
11569
|
+
var WIDTHS = {
|
11570
|
+
sm: 360,
|
11571
|
+
md: 560,
|
11572
|
+
lg: 1080
|
11573
|
+
};
|
11574
|
+
var Drawer = (_a) => {
|
11575
|
+
var _b = _a, { open, closeOnEsc = true } = _b, props = __objRest(_b, ["open", "closeOnEsc"]);
|
11576
|
+
const { onClose, size = "sm", portalContainer } = props;
|
11577
|
+
const [hidden, setHidden] = React72.useState(!open);
|
11578
|
+
const ref = React72.useRef(null);
|
11579
|
+
const state = useOverlayTriggerState3({ isOpen: !hidden, onOpenChange: (isOpen) => !isOpen && onClose() });
|
11580
|
+
useEffect10(() => {
|
11581
|
+
if (open && hidden) {
|
11582
|
+
setHidden(!open);
|
11413
11583
|
}
|
11414
|
-
};
|
11415
|
-
const
|
11416
|
-
|
11417
|
-
|
11418
|
-
|
11584
|
+
}, [open]);
|
11585
|
+
const { modalProps, underlayProps } = useModalOverlay2(
|
11586
|
+
{ isDismissable: false, isKeyboardDismissDisabled: !closeOnEsc },
|
11587
|
+
state,
|
11588
|
+
ref
|
11589
|
+
);
|
11590
|
+
const { opacity, transform } = useSpring3({
|
11591
|
+
transform: open ? `translateX(100vw) translateX(-${WIDTHS[size]}px)` : "translateX(100vw) translateX(0px)",
|
11592
|
+
opacity: open ? 0.6 : 0,
|
11593
|
+
config: {
|
11594
|
+
mass: 0.5,
|
11595
|
+
tension: 150,
|
11596
|
+
friction: 15
|
11597
|
+
},
|
11598
|
+
onRest: () => {
|
11599
|
+
if (!open) {
|
11600
|
+
setHidden(true);
|
11601
|
+
}
|
11419
11602
|
}
|
11420
|
-
};
|
11421
|
-
|
11422
|
-
|
11423
|
-
}
|
11424
|
-
return /* @__PURE__ */
|
11425
|
-
|
11426
|
-
|
11427
|
-
|
11428
|
-
|
11429
|
-
|
11430
|
-
|
11431
|
-
|
11432
|
-
|
11433
|
-
|
11434
|
-
|
11435
|
-
|
11436
|
-
|
11437
|
-
placement: tooltipPlacement,
|
11438
|
-
inline: false
|
11439
|
-
}, /* @__PURE__ */ React73.createElement("div", {
|
11440
|
-
tabIndex: 0,
|
11441
|
-
className: tw("grow")
|
11442
|
-
}, itemContent)) : itemContent);
|
11603
|
+
});
|
11604
|
+
if (!state.isOpen) {
|
11605
|
+
return null;
|
11606
|
+
}
|
11607
|
+
return /* @__PURE__ */ React72.createElement(Overlay3, {
|
11608
|
+
portalContainer
|
11609
|
+
}, /* @__PURE__ */ React72.createElement(Modal, {
|
11610
|
+
kind: "drawer",
|
11611
|
+
className: "Aquarium-Drawer overflow-x-hidden",
|
11612
|
+
open: true
|
11613
|
+
}, /* @__PURE__ */ React72.createElement(AnimatedBackDrop, __spreadValues({
|
11614
|
+
style: { opacity }
|
11615
|
+
}, underlayProps)), /* @__PURE__ */ React72.createElement(DrawerWrapper, __spreadProps(__spreadValues(__spreadValues({
|
11616
|
+
ref
|
11617
|
+
}, props), modalProps), {
|
11618
|
+
spring: { transform }
|
11619
|
+
}))));
|
11443
11620
|
};
|
11444
|
-
|
11445
|
-
|
11446
|
-
|
11447
|
-
|
11448
|
-
|
11449
|
-
|
11450
|
-
|
11451
|
-
|
11452
|
-
|
11453
|
-
|
11454
|
-
|
11455
|
-
|
11456
|
-
|
11457
|
-
|
11458
|
-
|
11459
|
-
|
11460
|
-
|
11461
|
-
|
11462
|
-
|
11463
|
-
|
11464
|
-
|
11621
|
+
var DrawerWrapper = React72.forwardRef(
|
11622
|
+
(_a, ref) => {
|
11623
|
+
var _b = _a, { title, children, size = "sm", primaryAction, secondaryActions, onClose, spring } = _b, props = __objRest(_b, ["title", "children", "size", "primaryAction", "secondaryActions", "onClose", "spring"]);
|
11624
|
+
var _a2;
|
11625
|
+
const labelledBy = useId9();
|
11626
|
+
const describedBy = useId9();
|
11627
|
+
const { dialogProps } = useDialog2(
|
11628
|
+
{ "role": "dialog", "aria-labelledby": labelledBy, "aria-describedby": describedBy },
|
11629
|
+
ref
|
11630
|
+
);
|
11631
|
+
const dialogSize = size === "lg" ? "full" : size;
|
11632
|
+
const hasTabs = isComponentType(children, Tabs);
|
11633
|
+
return /* @__PURE__ */ React72.createElement(AnimatedDialog, __spreadProps(__spreadValues(__spreadValues({
|
11634
|
+
ref,
|
11635
|
+
kind: "drawer",
|
11636
|
+
"aria-modal": "true",
|
11637
|
+
size: dialogSize
|
11638
|
+
}, props), dialogProps), {
|
11639
|
+
style: __spreadValues({}, spring)
|
11640
|
+
}), /* @__PURE__ */ React72.createElement(Modal.CloseButtonContainer, null, /* @__PURE__ */ React72.createElement(Button.Icon, {
|
11641
|
+
"aria-label": "Close",
|
11642
|
+
icon: import_cross6.default,
|
11643
|
+
onClick: onClose
|
11644
|
+
})), /* @__PURE__ */ React72.createElement(Modal.Header, {
|
11645
|
+
className: tw({ "pb-3": hasTabs })
|
11646
|
+
}, /* @__PURE__ */ React72.createElement(Modal.Title, {
|
11647
|
+
id: labelledBy,
|
11648
|
+
kind: "drawer"
|
11649
|
+
}, title)), hasTabs ? /* @__PURE__ */ React72.createElement(DrawerTabs, __spreadProps(__spreadValues({}, children.props), {
|
11650
|
+
className: tw("[&>div:first-child]:px-5 grow flex flex-col overflow-y-auto")
|
11651
|
+
})) : /* @__PURE__ */ React72.createElement(Modal.Body, {
|
11652
|
+
id: describedBy,
|
11653
|
+
tabIndex: 0,
|
11654
|
+
noFooter: !(secondaryActions || primaryAction)
|
11655
|
+
}, children), (secondaryActions || primaryAction) && /* @__PURE__ */ React72.createElement(Modal.Footer, null, /* @__PURE__ */ React72.createElement(Modal.Actions, {
|
11656
|
+
className: size === "sm" ? tw("flex-col") : void 0
|
11657
|
+
}, size !== "sm" && props.menu && /* @__PURE__ */ React72.createElement(Box.Flex, {
|
11658
|
+
alignItems: "center"
|
11659
|
+
}, /* @__PURE__ */ React72.createElement(DropdownMenu2, {
|
11660
|
+
onAction: (action) => {
|
11661
|
+
var _a3;
|
11662
|
+
return (_a3 = props.onAction) == null ? void 0 : _a3.call(props, action);
|
11663
|
+
},
|
11664
|
+
onOpenChange: props.onMenuOpenChange
|
11665
|
+
}, /* @__PURE__ */ React72.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ React72.createElement(Button.Icon, {
|
11666
|
+
"aria-label": (_a2 = props.menuAriaLabel) != null ? _a2 : "Context menu",
|
11667
|
+
icon: import_more4.default
|
11668
|
+
})), props.menu)), secondaryActions && castArray(secondaryActions).filter(Boolean).map((_b2) => {
|
11669
|
+
var _c = _b2, { text } = _c, action = __objRest(_c, ["text"]);
|
11670
|
+
return /* @__PURE__ */ React72.createElement(Button.Secondary, __spreadValues({
|
11671
|
+
key: text
|
11672
|
+
}, action), text);
|
11673
|
+
}), primaryAction && /* @__PURE__ */ React72.createElement(Button.Primary, __spreadValues({
|
11674
|
+
key: primaryAction.text
|
11675
|
+
}, omit9(primaryAction, "text")), primaryAction.text))));
|
11676
|
+
}
|
11677
|
+
);
|
11678
|
+
var DrawerTabs = createTabsComponent(ModalTab, TabItem, "DrawerTabs", (children, selected) => /* @__PURE__ */ React72.createElement(Modal.Body, {
|
11679
|
+
className: tw("h-full")
|
11680
|
+
}, /* @__PURE__ */ React72.createElement(ModalTabContainer, null, children.find(
|
11681
|
+
(node, index) => (node == null ? void 0 : node.props.value) === selected || index === selected
|
11682
|
+
))));
|
11683
|
+
|
11684
|
+
// src/molecules/Dropdown/Dropdown.tsx
|
11685
|
+
import React75 from "react";
|
11686
|
+
|
11687
|
+
// src/molecules/Popover/Popover.tsx
|
11688
|
+
import React74, { useRef as useRef8 } from "react";
|
11689
|
+
import { PressResponder as PressResponder2, usePress as usePress2 } from "@react-aria/interactions";
|
11690
|
+
import { useOverlayTrigger } from "@react-aria/overlays";
|
11691
|
+
import { mergeProps as mergeProps3 } from "@react-aria/utils";
|
11692
|
+
import { useOverlayTriggerState as useOverlayTriggerState4 } from "@react-stately/overlays";
|
11693
|
+
import classNames8 from "classnames";
|
11694
|
+
import omit10 from "lodash/omit";
|
11695
|
+
|
11696
|
+
// src/molecules/Popover/Dialog.tsx
|
11697
|
+
import React73 from "react";
|
11698
|
+
import { useDialog as useDialog3 } from "@react-aria/dialog";
|
11699
|
+
var Dialog2 = ({ children }) => {
|
11700
|
+
const ref = React73.useRef(null);
|
11701
|
+
const { dialogProps } = useDialog3({}, ref);
|
11702
|
+
return /* @__PURE__ */ React73.createElement("div", __spreadProps(__spreadValues({
|
11703
|
+
ref
|
11704
|
+
}, dialogProps), {
|
11705
|
+
className: tw("outline-none")
|
11706
|
+
}), children);
|
11707
|
+
};
|
11708
|
+
|
11709
|
+
// src/molecules/Popover/PopoverContext.tsx
|
11710
|
+
import { createContext as createContext3, useContext as useContext4 } from "react";
|
11711
|
+
var PopoverContext = createContext3(null);
|
11712
|
+
var usePopoverContext = () => {
|
11713
|
+
const ctx = useContext4(PopoverContext);
|
11714
|
+
if (ctx === null) {
|
11715
|
+
throw new Error("PopoverContext was used outside of provider.");
|
11716
|
+
}
|
11717
|
+
return ctx;
|
11718
|
+
};
|
11719
|
+
|
11720
|
+
// src/molecules/Popover/Popover.tsx
|
11721
|
+
var Popover2 = (props) => {
|
11722
|
+
const {
|
11723
|
+
id,
|
11724
|
+
type,
|
11725
|
+
placement = "bottom-left",
|
11726
|
+
containFocus = true,
|
11727
|
+
isKeyboardDismissDisabled = false,
|
11728
|
+
targetRef,
|
11729
|
+
offset,
|
11730
|
+
crossOffset,
|
11731
|
+
shouldFlip
|
11732
|
+
} = props;
|
11733
|
+
const triggerRef = useRef8(null);
|
11734
|
+
const state = useOverlayTriggerState4(props);
|
11735
|
+
const { triggerProps, overlayProps } = useOverlayTrigger({ type: type != null ? type : "dialog" }, state, triggerRef);
|
11736
|
+
return /* @__PURE__ */ React74.createElement(PopoverContext.Provider, {
|
11737
|
+
value: {
|
11738
|
+
state
|
11739
|
+
}
|
11740
|
+
}, React74.Children.map(props.children, (child) => {
|
11741
|
+
if (isComponentType(child, Popover2.Trigger)) {
|
11742
|
+
return /* @__PURE__ */ React74.createElement(PressResponder2, __spreadValues({
|
11743
|
+
ref: triggerRef
|
11744
|
+
}, omit10(triggerProps, "aria-expanded")), /* @__PURE__ */ React74.createElement(PopoverTriggerWrapper, {
|
11745
|
+
"data-testid": props["data-testid"],
|
11746
|
+
"aria-controls": id,
|
11747
|
+
"aria-expanded": triggerProps["aria-expanded"]
|
11748
|
+
}, child.props.children));
|
11749
|
+
}
|
11750
|
+
if (isComponentType(child, Popover2.Panel)) {
|
11751
|
+
return state.isOpen && /* @__PURE__ */ React74.createElement(PopoverOverlay, __spreadValues({
|
11752
|
+
triggerRef: targetRef != null ? targetRef : triggerRef,
|
11753
|
+
state,
|
11754
|
+
placement,
|
11755
|
+
isNonModal: !containFocus,
|
11756
|
+
autoFocus: !containFocus,
|
11757
|
+
isKeyboardDismissDisabled,
|
11758
|
+
className: classNames8("Aquarium-Popover", child.props.className),
|
11759
|
+
offset,
|
11760
|
+
crossOffset,
|
11761
|
+
shouldFlip
|
11762
|
+
}, overlayProps), containFocus ? /* @__PURE__ */ React74.createElement(Dialog2, null, child.props.children) : child.props.children);
|
11763
|
+
}
|
11764
|
+
throw new Error("Invalid children element type");
|
11765
|
+
}));
|
11766
|
+
};
|
11767
|
+
var Trigger = () => null;
|
11768
|
+
Trigger.displayName = "Popover.Trigger";
|
11769
|
+
Popover2.Trigger = Trigger;
|
11770
|
+
var Panel = () => null;
|
11771
|
+
Panel.displayName = "Popover.Panel";
|
11772
|
+
Popover2.Panel = Panel;
|
11773
|
+
var asPopoverButton = (Component, displayName) => {
|
11774
|
+
const PopoverButton2 = (props) => {
|
11775
|
+
const { onClick } = props;
|
11776
|
+
const { state } = usePopoverContext();
|
11777
|
+
const handleClick = (e) => {
|
11778
|
+
state.close();
|
11779
|
+
onClick == null ? void 0 : onClick(e);
|
11780
|
+
};
|
11781
|
+
return /* @__PURE__ */ React74.createElement(Component, __spreadProps(__spreadValues({}, props), {
|
11782
|
+
onClick: handleClick
|
11783
|
+
}));
|
11784
|
+
};
|
11785
|
+
PopoverButton2.displayName = displayName;
|
11786
|
+
return PopoverButton2;
|
11787
|
+
};
|
11788
|
+
var PopoverButton = asPopoverButton(Button, "PopoverButton");
|
11789
|
+
Popover2.Button = PopoverButton;
|
11790
|
+
var PopoverTriggerWrapper = (_a) => {
|
11791
|
+
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
11792
|
+
var _a2;
|
11793
|
+
const ref = useRef8(null);
|
11794
|
+
const trigger = React74.Children.only(children);
|
11795
|
+
const { pressProps } = usePress2(__spreadProps(__spreadValues({}, rest), { ref }));
|
11796
|
+
return React74.cloneElement(trigger, __spreadProps(__spreadValues({
|
11797
|
+
"ref": ref
|
11798
|
+
}, mergeProps3(pressProps, trigger.props)), {
|
11799
|
+
"aria-controls": (_a2 = rest["aria-controls"]) != null ? _a2 : pressProps["aria-controls"]
|
11800
|
+
}));
|
11801
|
+
};
|
11802
|
+
|
11803
|
+
// src/molecules/Dropdown/Dropdown.tsx
|
11804
|
+
var Dropdown = ({ children, content, placement = "bottom-left" }) => {
|
11805
|
+
return /* @__PURE__ */ React75.createElement(Popover2, {
|
11806
|
+
type: "menu",
|
11807
|
+
placement
|
11808
|
+
}, /* @__PURE__ */ React75.createElement(Popover2.Trigger, null, children), /* @__PURE__ */ React75.createElement(Popover2.Panel, {
|
11809
|
+
className: "Aquarium-Dropdown"
|
11810
|
+
}, content));
|
11811
|
+
};
|
11812
|
+
var DropdownMenu3 = ({
|
11813
|
+
title,
|
11814
|
+
children,
|
11815
|
+
contentId,
|
11816
|
+
triggerId,
|
11817
|
+
setClose = () => void 0
|
11818
|
+
}) => {
|
11819
|
+
const menuRef = React75.useRef(null);
|
11820
|
+
React75.useEffect(() => {
|
11821
|
+
const id = setTimeout(() => {
|
11822
|
+
var _a, _b, _c;
|
11823
|
+
return (_c = (_b = (_a = menuRef.current) == null ? void 0 : _a.children) == null ? void 0 : _b[0]) == null ? void 0 : _c.focus();
|
11824
|
+
});
|
11825
|
+
return () => clearTimeout(id);
|
11826
|
+
}, [menuRef.current]);
|
11827
|
+
return /* @__PURE__ */ React75.createElement("div", {
|
11828
|
+
style: { minWidth: "250px" },
|
11829
|
+
className: tw("py-3 bg-white")
|
11830
|
+
}, !!title && /* @__PURE__ */ React75.createElement("div", {
|
11831
|
+
className: tw("px-4 py-4 text-left text-grey-100 typography-default-strong")
|
11832
|
+
}, title), /* @__PURE__ */ React75.createElement("ol", {
|
11833
|
+
role: "menu",
|
11834
|
+
ref: menuRef,
|
11835
|
+
id: contentId,
|
11836
|
+
"aria-labelledby": triggerId
|
11837
|
+
}, React75.Children.map(children, (child) => {
|
11838
|
+
return React75.cloneElement(child, { setClose });
|
11839
|
+
})));
|
11840
|
+
};
|
11841
|
+
var DropdownItem = (_a) => {
|
11842
|
+
var _b = _a, {
|
11843
|
+
children,
|
11844
|
+
disabled = false,
|
11845
|
+
tooltip,
|
11846
|
+
tooltipPlacement,
|
11847
|
+
color = "default",
|
11848
|
+
onSelect,
|
11849
|
+
setClose = () => void 0
|
11850
|
+
} = _b, props = __objRest(_b, [
|
11851
|
+
"children",
|
11852
|
+
"disabled",
|
11853
|
+
"tooltip",
|
11854
|
+
"tooltipPlacement",
|
11855
|
+
"color",
|
11856
|
+
"onSelect",
|
11857
|
+
"setClose"
|
11858
|
+
]);
|
11859
|
+
const { state } = usePopoverContext();
|
11860
|
+
const handleSelect = () => {
|
11861
|
+
onSelect == null ? void 0 : onSelect();
|
11862
|
+
state.close();
|
11863
|
+
setClose();
|
11864
|
+
};
|
11865
|
+
const handleKeyDown = (event) => {
|
11866
|
+
const target = event.target;
|
11867
|
+
const parent = target.parentElement;
|
11868
|
+
const first = parent.firstChild;
|
11869
|
+
const last = parent.lastChild;
|
11870
|
+
const next = target.nextElementSibling;
|
11871
|
+
const prev = target.previousElementSibling;
|
11872
|
+
if (event.key === "ArrowUp") {
|
11873
|
+
prev ? prev.focus() : last.focus();
|
11874
|
+
} else if (event.key === "ArrowDown") {
|
11875
|
+
next ? next.focus() : first.focus();
|
11876
|
+
} else if (event.key === "Tab") {
|
11877
|
+
event.preventDefault();
|
11878
|
+
event.stopPropagation();
|
11879
|
+
} else if (event.key === "Home" || event.key === "PageUp") {
|
11880
|
+
first.focus();
|
11881
|
+
} else if (event.key === "End" || event.key === "PageDown") {
|
11882
|
+
last.focus();
|
11883
|
+
} else if (event.key === "Enter") {
|
11884
|
+
!disabled && handleSelect();
|
11885
|
+
}
|
11886
|
+
};
|
11887
|
+
const handleClick = (e) => {
|
11888
|
+
e.stopPropagation();
|
11889
|
+
if (!disabled) {
|
11890
|
+
handleSelect();
|
11891
|
+
}
|
11892
|
+
};
|
11893
|
+
const itemContent = /* @__PURE__ */ React75.createElement("div", {
|
11894
|
+
className: tw("py-3 px-4")
|
11895
|
+
}, children);
|
11896
|
+
return /* @__PURE__ */ React75.createElement("li", __spreadProps(__spreadValues({
|
11897
|
+
role: "menuitem",
|
11898
|
+
tabIndex: -1,
|
11899
|
+
onClick: handleClick,
|
11900
|
+
onKeyDown: handleKeyDown
|
11901
|
+
}, props), {
|
11902
|
+
className: tw("typography-small flex items-center focus:ring-0", {
|
11903
|
+
"text-grey-70 cursor-pointer hover:bg-grey-0": !disabled,
|
11904
|
+
"text-grey-10 cursor-not-allowed": disabled,
|
11905
|
+
"text-primary-70 hover:text-primary-80": color === "danger" && !disabled
|
11906
|
+
})
|
11907
|
+
}), tooltip ? /* @__PURE__ */ React75.createElement(Tooltip, {
|
11908
|
+
content: tooltip,
|
11909
|
+
placement: tooltipPlacement,
|
11910
|
+
inline: false
|
11911
|
+
}, /* @__PURE__ */ React75.createElement("div", {
|
11912
|
+
tabIndex: 0,
|
11913
|
+
className: tw("grow")
|
11914
|
+
}, itemContent)) : itemContent);
|
11915
|
+
};
|
11916
|
+
Dropdown.Menu = DropdownMenu3;
|
11917
|
+
Dropdown.Item = DropdownItem;
|
11918
|
+
|
11919
|
+
// src/molecules/EmptyState/EmptyState.tsx
|
11920
|
+
import React76 from "react";
|
11921
|
+
var EmptyStateLayout = /* @__PURE__ */ ((EmptyStateLayout2) => {
|
11922
|
+
EmptyStateLayout2["Vertical"] = "vertical";
|
11923
|
+
EmptyStateLayout2["Horizontal"] = "horizontal";
|
11924
|
+
EmptyStateLayout2["CenterVertical"] = "center-vertical";
|
11925
|
+
EmptyStateLayout2["LeftVertical"] = "left-vertical";
|
11926
|
+
EmptyStateLayout2["CenterHorizontal"] = "center-horizontal";
|
11927
|
+
EmptyStateLayout2["LeftHorizontal"] = "left-horizontal";
|
11928
|
+
return EmptyStateLayout2;
|
11929
|
+
})(EmptyStateLayout || {});
|
11930
|
+
var layoutStyle = (layout) => {
|
11931
|
+
switch (layout) {
|
11932
|
+
case "left-vertical" /* LeftVertical */:
|
11933
|
+
return {
|
11934
|
+
layout: "column",
|
11935
|
+
justifyContent: "flex-start",
|
11936
|
+
alignItems: "flex-start"
|
11465
11937
|
};
|
11466
11938
|
case "left-horizontal" /* LeftHorizontal */:
|
11467
11939
|
case "horizontal" /* Horizontal */:
|
@@ -11502,7 +11974,7 @@ var EmptyState = ({
|
|
11502
11974
|
fullHeight = isVerticalLayout(layout) ? true : false
|
11503
11975
|
}) => {
|
11504
11976
|
const template = layoutStyle(layout);
|
11505
|
-
return /* @__PURE__ */
|
11977
|
+
return /* @__PURE__ */ React76.createElement(Box, {
|
11506
11978
|
className: classNames(
|
11507
11979
|
"Aquarium-EmptyState",
|
11508
11980
|
tw("rounded p-[56px]", {
|
@@ -11515,486 +11987,187 @@ var EmptyState = ({
|
|
11515
11987
|
),
|
11516
11988
|
backgroundColor: "transparent",
|
11517
11989
|
borderColor: "grey-10"
|
11518
|
-
}, /* @__PURE__ */
|
11990
|
+
}, /* @__PURE__ */ React76.createElement(Box.Flex, {
|
11519
11991
|
style: { gap: "56px" },
|
11520
11992
|
flexDirection: template.layout,
|
11521
11993
|
justifyContent: template.justifyContent,
|
11522
11994
|
alignItems: template.layout === "row" ? "center" : template.alignItems,
|
11523
11995
|
height: fullHeight ? "full" : void 0
|
11524
|
-
}, image && /* @__PURE__ */
|
11996
|
+
}, image && /* @__PURE__ */ React76.createElement("img", {
|
11525
11997
|
src: image,
|
11526
11998
|
alt: imageAlt,
|
11527
11999
|
style: { width: imageWidth ? `${imageWidth}px` : void 0, height: "auto" }
|
11528
|
-
}), /* @__PURE__ */
|
12000
|
+
}), /* @__PURE__ */ React76.createElement(Box.Flex, {
|
11529
12001
|
flexDirection: "column",
|
11530
12002
|
justifyContent: template.justifyContent,
|
11531
12003
|
alignItems: template.alignItems
|
11532
|
-
}, /* @__PURE__ */
|
12004
|
+
}, /* @__PURE__ */ React76.createElement(Typography2.Heading, {
|
11533
12005
|
htmlTag: "h2"
|
11534
|
-
}, title), (description || children) && /* @__PURE__ */
|
12006
|
+
}, title), (description || children) && /* @__PURE__ */ React76.createElement(Box, {
|
11535
12007
|
marginTop: "5"
|
11536
|
-
}, /* @__PURE__ */
|
12008
|
+
}, /* @__PURE__ */ React76.createElement(Typography2.Default, null, children || description)), (secondaryAction || primaryAction) && /* @__PURE__ */ React76.createElement(Box.Flex, {
|
11537
12009
|
marginTop: "7",
|
11538
12010
|
gap: "4",
|
11539
12011
|
justifyContent: "center",
|
11540
12012
|
alignItems: "center",
|
11541
12013
|
flexWrap: "wrap"
|
11542
|
-
}, primaryAction && renderAction({ kind: "primary", action: primaryAction }), secondaryAction && renderAction({ kind: "secondary", action: secondaryAction })), footer && /* @__PURE__ */
|
12014
|
+
}, primaryAction && renderAction({ kind: "primary", action: primaryAction }), secondaryAction && renderAction({ kind: "secondary", action: secondaryAction })), footer && /* @__PURE__ */ React76.createElement(Box, {
|
11543
12015
|
marginTop: "5"
|
11544
|
-
}, /* @__PURE__ */
|
12016
|
+
}, /* @__PURE__ */ React76.createElement(Typography2.Small, {
|
11545
12017
|
color: "grey-60"
|
11546
|
-
}, footer)))));
|
11547
|
-
};
|
11548
|
-
|
11549
|
-
// src/molecules/Flexbox/FlexboxItem.tsx
|
11550
|
-
import
|
11551
|
-
var FlexboxItem = Tailwindify(
|
11552
|
-
({ htmlTag = "div", className, style, children, display, flex, grow, shrink, order, alignSelf }) => {
|
11553
|
-
const hookStyle = useStyle({
|
11554
|
-
display,
|
11555
|
-
flex,
|
11556
|
-
flexGrow: grow,
|
11557
|
-
flexShrink: shrink,
|
11558
|
-
order,
|
11559
|
-
alignSelf
|
11560
|
-
});
|
11561
|
-
const HtmlElement = htmlTag;
|
11562
|
-
return /* @__PURE__ */ React75.createElement(HtmlElement, {
|
11563
|
-
style: __spreadValues(__spreadValues({}, hookStyle), style),
|
11564
|
-
className
|
11565
|
-
}, children);
|
11566
|
-
}
|
11567
|
-
);
|
11568
|
-
|
11569
|
-
// src/molecules/Grid/GridItem.tsx
|
11570
|
-
import React76 from "react";
|
11571
|
-
var GridItem2 = Tailwindify(
|
11572
|
-
({
|
11573
|
-
htmlTag = "div",
|
11574
|
-
className,
|
11575
|
-
style,
|
11576
|
-
children,
|
11577
|
-
display,
|
11578
|
-
justifySelf,
|
11579
|
-
alignSelf,
|
11580
|
-
placeSelf,
|
11581
|
-
colSpan,
|
11582
|
-
colStart,
|
11583
|
-
colEnd,
|
11584
|
-
rowSpan,
|
11585
|
-
rowStart,
|
11586
|
-
rowEnd
|
11587
|
-
}) => {
|
11588
|
-
const hookStyle = useStyle({
|
11589
|
-
display,
|
11590
|
-
justifySelf,
|
11591
|
-
alignSelf,
|
11592
|
-
placeSelf,
|
11593
|
-
gridColumn: colSpan,
|
11594
|
-
gridColumnStart: colStart,
|
11595
|
-
gridColumnEnd: colEnd,
|
11596
|
-
gridRow: rowSpan,
|
11597
|
-
gridRowStart: rowStart,
|
11598
|
-
gridRowEnd: rowEnd
|
11599
|
-
});
|
11600
|
-
const HtmlElement = htmlTag;
|
11601
|
-
return /* @__PURE__ */ React76.createElement(HtmlElement, {
|
11602
|
-
style: __spreadValues(__spreadValues({}, hookStyle), style),
|
11603
|
-
className
|
11604
|
-
}, children);
|
11605
|
-
}
|
11606
|
-
);
|
11607
|
-
|
11608
|
-
// src/molecules/LineClamp/LineClamp.tsx
|
11609
|
-
import React77 from "react";
|
11610
|
-
var LineClamp2 = ({
|
11611
|
-
lines,
|
11612
|
-
children,
|
11613
|
-
wordBreak,
|
11614
|
-
expandLabel,
|
11615
|
-
collapseLabel,
|
11616
|
-
onClampedChange
|
11617
|
-
}) => {
|
11618
|
-
const ref = React77.useRef(null);
|
11619
|
-
const [clamped, setClamped] = React77.useState(true);
|
11620
|
-
const [isClampingEnabled, setClampingEnabled] = React77.useState(false);
|
11621
|
-
React77.useEffect(() => {
|
11622
|
-
var _a, _b;
|
11623
|
-
const el = ref.current;
|
11624
|
-
setClampingEnabled(((_a = el == null ? void 0 : el.scrollHeight) != null ? _a : 0) > ((_b = el == null ? void 0 : el.clientHeight) != null ? _b : 0));
|
11625
|
-
}, [ref.current]);
|
11626
|
-
const handleClampedChange = () => {
|
11627
|
-
setClamped(!clamped);
|
11628
|
-
onClampedChange == null ? void 0 : onClampedChange(!clamped);
|
11629
|
-
};
|
11630
|
-
return /* @__PURE__ */ React77.createElement("div", {
|
11631
|
-
className: "Aquarium-LineClamp"
|
11632
|
-
}, /* @__PURE__ */ React77.createElement(LineClamp, {
|
11633
|
-
ref,
|
11634
|
-
lines,
|
11635
|
-
clamped,
|
11636
|
-
wordBreak
|
11637
|
-
}, children), expandLabel && isClampingEnabled && /* @__PURE__ */ React77.createElement(Button.Ghost, {
|
11638
|
-
dense: true,
|
11639
|
-
onClick: handleClampedChange
|
11640
|
-
}, clamped ? expandLabel : collapseLabel));
|
11641
|
-
};
|
11642
|
-
|
11643
|
-
// src/molecules/Link/Link.tsx
|
11644
|
-
import React79 from "react";
|
11645
|
-
import classNames9 from "classnames";
|
11646
|
-
|
11647
|
-
// src/atoms/Link/Link.tsx
|
11648
|
-
import React78 from "react";
|
11649
|
-
var Link = (_a) => {
|
11650
|
-
var _b = _a, { children, className } = _b, props = __objRest(_b, ["children", "className"]);
|
11651
|
-
return /* @__PURE__ */ React78.createElement("a", __spreadValues({
|
11652
|
-
className: classNames(className, linkStyle)
|
11653
|
-
}, props), children);
|
11654
|
-
};
|
11655
|
-
|
11656
|
-
// src/molecules/Link/Link.tsx
|
11657
|
-
var Link2 = (_a) => {
|
11658
|
-
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
11659
|
-
return /* @__PURE__ */ React79.createElement(Link, __spreadValues({
|
11660
|
-
className: classNames9("Aquarium-Link", className)
|
11661
|
-
}, props));
|
11662
|
-
};
|
11663
|
-
|
11664
|
-
// src/molecules/ListItem/ListItem.tsx
|
11665
|
-
import React80 from "react";
|
11666
|
-
var ListItem = ({ name, icon, active = false }) => {
|
11667
|
-
return /* @__PURE__ */ React80.createElement(Box.Flex, {
|
11668
|
-
className: "Aquarium-ListItem",
|
11669
|
-
alignItems: "center"
|
11670
|
-
}, /* @__PURE__ */ React80.createElement(Typography2, {
|
11671
|
-
variant: active ? "small-strong" : "small",
|
11672
|
-
color: "grey-70",
|
11673
|
-
htmlTag: "span",
|
11674
|
-
className: `px-4 py-2 rounded-full ${active ? "bg-grey-5" : "hover:bg-grey-0"}`
|
11675
|
-
}, /* @__PURE__ */ React80.createElement("img", {
|
11676
|
-
src: icon,
|
11677
|
-
alt: "",
|
11678
|
-
className: "inline mr-4",
|
11679
|
-
height: 28,
|
11680
|
-
width: 28
|
11681
|
-
}), name));
|
11682
|
-
};
|
11683
|
-
|
11684
|
-
// src/molecules/Modal/Modal.tsx
|
11685
|
-
import React82 from "react";
|
11686
|
-
import { useDialog as useDialog3 } from "@react-aria/dialog";
|
11687
|
-
import { Overlay as Overlay3, useModalOverlay as useModalOverlay2 } from "@react-aria/overlays";
|
11688
|
-
import { useId as useId9 } from "@react-aria/utils";
|
11689
|
-
import { useOverlayTriggerState as useOverlayTriggerState4 } from "@react-stately/overlays";
|
11690
|
-
import castArray from "lodash/castArray";
|
11691
|
-
import omit10 from "lodash/omit";
|
11692
|
-
|
11693
|
-
// src/molecules/Tabs/Tabs.tsx
|
11694
|
-
import React81, { useEffect as useEffect9, useLayoutEffect as useLayoutEffect2, useRef as useRef8, useState as useState10 } from "react";
|
11695
|
-
import isNumber5 from "lodash/isNumber";
|
11696
|
-
import kebabCase from "lodash/kebabCase";
|
11697
|
-
var import_chevronLeft4 = __toESM(require_chevronLeft());
|
11698
|
-
var import_chevronRight4 = __toESM(require_chevronRight());
|
11699
|
-
var import_warningSign4 = __toESM(require_warningSign());
|
11700
|
-
var isTabComponent = (c) => {
|
11701
|
-
return React81.isValidElement(c) && (c.type === Tab || c.type === ModalTab);
|
11702
|
-
};
|
11703
|
-
var Tab = React81.forwardRef(
|
11704
|
-
({ className, id, title, children }, ref) => {
|
11705
|
-
return /* @__PURE__ */ React81.createElement("div", {
|
11706
|
-
ref,
|
11707
|
-
id: `${id != null ? id : kebabCase(title)}-panel`,
|
11708
|
-
className,
|
11709
|
-
role: "tabpanel",
|
11710
|
-
tabIndex: 0,
|
11711
|
-
"aria-labelledby": `${id != null ? id : kebabCase(title)}-tab`
|
11712
|
-
}, children);
|
11713
|
-
}
|
11714
|
-
);
|
11715
|
-
var TabContainer = (_a) => {
|
11716
|
-
var _b = _a, { className, children } = _b, rest = __objRest(_b, ["className", "children"]);
|
11717
|
-
return /* @__PURE__ */ React81.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
11718
|
-
className: classNames("py-6 z-0", className)
|
11719
|
-
}), children);
|
11720
|
-
};
|
11721
|
-
var ModalTab = Tab;
|
11722
|
-
var ModalTabContainer = TabContainer;
|
11723
|
-
var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
11724
|
-
const Tab2 = React81.forwardRef(
|
11725
|
-
(_a, ref) => {
|
11726
|
-
var _b = _a, {
|
11727
|
-
id,
|
11728
|
-
value,
|
11729
|
-
status = "default",
|
11730
|
-
disabled,
|
11731
|
-
badge,
|
11732
|
-
tooltip,
|
11733
|
-
title,
|
11734
|
-
index,
|
11735
|
-
selected,
|
11736
|
-
onSelected,
|
11737
|
-
showNotification = false,
|
11738
|
-
className
|
11739
|
-
} = _b, rest = __objRest(_b, [
|
11740
|
-
"id",
|
11741
|
-
"value",
|
11742
|
-
"status",
|
11743
|
-
"disabled",
|
11744
|
-
"badge",
|
11745
|
-
"tooltip",
|
11746
|
-
"title",
|
11747
|
-
"index",
|
11748
|
-
"selected",
|
11749
|
-
"onSelected",
|
11750
|
-
"showNotification",
|
11751
|
-
"className"
|
11752
|
-
]);
|
11753
|
-
const _id = id != null ? id : kebabCase(title);
|
11754
|
-
let statusIcon = void 0;
|
11755
|
-
if (status === "warning") {
|
11756
|
-
statusIcon = /* @__PURE__ */ React81.createElement(InlineIcon, {
|
11757
|
-
icon: import_warningSign4.default,
|
11758
|
-
color: selected ? void 0 : "warning-80"
|
11759
|
-
});
|
11760
|
-
} else if (status === "error") {
|
11761
|
-
statusIcon = /* @__PURE__ */ React81.createElement(InlineIcon, {
|
11762
|
-
icon: import_warningSign4.default,
|
11763
|
-
color: selected ? void 0 : "error-50"
|
11764
|
-
});
|
11765
|
-
}
|
11766
|
-
const tab = /* @__PURE__ */ React81.createElement(Component, __spreadValues({
|
11767
|
-
ref,
|
11768
|
-
id: `${_id}-tab`,
|
11769
|
-
onClick: () => !disabled && onSelected(value != null ? value : index),
|
11770
|
-
className: classNames(className, "px-5 py-3 z-10 no-underline appearance-none outline-none h-full", {
|
11771
|
-
"cursor-default": disabled,
|
11772
|
-
"text-grey-80 focus:text-primary-80": !selected,
|
11773
|
-
"hover:bg-grey-0 hover:border-grey-20": !selected && !disabled,
|
11774
|
-
"border-b-2": !defaultUnderlineHidden || selected,
|
11775
|
-
"border-grey-10": !selected,
|
11776
|
-
"border-primary-80": selected
|
11777
|
-
}),
|
11778
|
-
type: "button",
|
11779
|
-
role: "tab",
|
11780
|
-
"aria-selected": selected,
|
11781
|
-
"aria-controls": `${_id}-panel`,
|
11782
|
-
tabIndex: disabled ? void 0 : 0
|
11783
|
-
}, rest), /* @__PURE__ */ React81.createElement(Typography2, {
|
11784
|
-
htmlTag: "div",
|
11785
|
-
variant: "small",
|
11786
|
-
color: selected ? "primary-80" : disabled ? "grey-20" : "current",
|
11787
|
-
className: tw("inline-flex items-center gap-3")
|
11788
|
-
}, showNotification ? /* @__PURE__ */ React81.createElement(Badge.Notification, {
|
11789
|
-
right: "-4px",
|
11790
|
-
top: "3px"
|
11791
|
-
}, /* @__PURE__ */ React81.createElement("span", {
|
11792
|
-
className: tw("whitespace-nowrap")
|
11793
|
-
}, title)) : /* @__PURE__ */ React81.createElement("span", {
|
11794
|
-
className: tw("whitespace-nowrap")
|
11795
|
-
}, title), isNumber5(badge) && /* @__PURE__ */ React81.createElement(Typography2, {
|
11796
|
-
htmlTag: "span",
|
11797
|
-
variant: "small",
|
11798
|
-
color: selected ? "primary-80" : "grey-5",
|
11799
|
-
className: "leading-none"
|
11800
|
-
}, /* @__PURE__ */ React81.createElement(TabBadge, {
|
11801
|
-
kind: "filled",
|
11802
|
-
value: badge,
|
11803
|
-
textClassname: classNames({ "text-white": selected, "text-grey-50": !selected })
|
11804
|
-
})), statusIcon));
|
11805
|
-
return tooltip ? /* @__PURE__ */ React81.createElement(Tooltip, {
|
11806
|
-
content: tooltip
|
11807
|
-
}, tab) : tab;
|
11808
|
-
}
|
11809
|
-
);
|
11810
|
-
Tab2.displayName = displayName;
|
11811
|
-
return Tab2;
|
11812
|
-
};
|
11813
|
-
var TabItem = asTabItem("button", "TabItem");
|
11814
|
-
var CARET_OFFSET = 24;
|
11815
|
-
var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderChildren) => {
|
11816
|
-
const Tabs2 = (props) => {
|
11817
|
-
var _a, _b;
|
11818
|
-
const { className, value, defaultValue, onChange, children } = props;
|
11819
|
-
const childArr = React81.Children.toArray(children);
|
11820
|
-
const firstTab = childArr[0];
|
11821
|
-
const firstTabValue = isTabComponent(firstTab) ? firstTab.props.value : -1;
|
11822
|
-
const [selected, setSelected] = useState10((_b = (_a = value != null ? value : defaultValue) != null ? _a : firstTabValue) != null ? _b : 0);
|
11823
|
-
const [leftCaret, showLeftCaret] = useState10(false);
|
11824
|
-
const [rightCaret, showRightCaret] = useState10(false);
|
11825
|
-
const parentRef = useRef8(null);
|
11826
|
-
const containerRef = useRef8(null);
|
11827
|
-
const tabsRef = useRef8(null);
|
11828
|
-
const revealSelectedTab = ({ smooth }) => {
|
11829
|
-
var _a2, _b2;
|
11830
|
-
const container = containerRef.current;
|
11831
|
-
const tabs = tabsRef.current;
|
11832
|
-
const values = React81.Children.map(
|
11833
|
-
children,
|
11834
|
-
(tab, i) => {
|
11835
|
-
var _a3;
|
11836
|
-
return (_a3 = tab == null ? void 0 : tab.props.value) != null ? _a3 : i;
|
11837
|
-
}
|
11838
|
-
);
|
11839
|
-
const idx = (_a2 = values == null ? void 0 : values.findIndex((val) => value === val)) != null ? _a2 : -1;
|
11840
|
-
const child = Array.from((_b2 = tabs == null ? void 0 : tabs.childNodes) != null ? _b2 : [])[idx];
|
11841
|
-
if (!container || !(child instanceof HTMLElement)) {
|
11842
|
-
return;
|
11843
|
-
}
|
11844
|
-
const { width: containerWidth, x: containerX } = container.getBoundingClientRect();
|
11845
|
-
const { x, width } = child.getBoundingClientRect();
|
11846
|
-
const isInViewPort = x >= containerX && x + width <= containerX + containerWidth;
|
11847
|
-
if (!isInViewPort) {
|
11848
|
-
container.scrollTo({
|
11849
|
-
left: container.scrollLeft + Math.ceil(x + width + CARET_OFFSET - containerX - containerWidth),
|
11850
|
-
behavior: smooth ? "smooth" : void 0
|
11851
|
-
});
|
11852
|
-
}
|
11853
|
-
};
|
11854
|
-
const updateCarets = () => {
|
11855
|
-
const pEl = parentRef.current;
|
11856
|
-
const el = containerRef.current;
|
11857
|
-
if (!pEl || !el) {
|
11858
|
-
return;
|
11859
|
-
}
|
11860
|
-
const { width } = pEl.getBoundingClientRect();
|
11861
|
-
const hasLeftCaret = el.scrollWidth > width && el.scrollLeft !== 0;
|
11862
|
-
const hasRightCaret = el.scrollWidth > width && Math.round(el.scrollLeft + el.getBoundingClientRect().width) !== Math.round(el.scrollWidth);
|
11863
|
-
showLeftCaret(hasLeftCaret);
|
11864
|
-
showRightCaret(hasRightCaret);
|
11865
|
-
};
|
11866
|
-
useEffect9(() => {
|
11867
|
-
if (value === void 0) {
|
11868
|
-
return;
|
11869
|
-
}
|
11870
|
-
updateCarets();
|
11871
|
-
setSelected(value);
|
11872
|
-
revealSelectedTab({ smooth: value !== selected });
|
11873
|
-
}, [value, React81.Children.count(children)]);
|
11874
|
-
useLayoutEffect2(() => {
|
11875
|
-
var _a2;
|
11876
|
-
updateCarets();
|
11877
|
-
(_a2 = containerRef.current) == null ? void 0 : _a2.addEventListener("scroll", updateCarets);
|
11878
|
-
window.addEventListener("resize", updateCarets);
|
11879
|
-
return () => {
|
11880
|
-
var _a3;
|
11881
|
-
(_a3 = containerRef.current) == null ? void 0 : _a3.removeEventListener("scroll", updateCarets);
|
11882
|
-
window.removeEventListener("resize", updateCarets);
|
11883
|
-
};
|
11884
|
-
}, [parentRef.current, containerRef.current, children]);
|
11885
|
-
const handleScrollToNext = (direction) => {
|
11886
|
-
const container = containerRef.current;
|
11887
|
-
const tabs = tabsRef.current;
|
11888
|
-
if (!container || !tabs) {
|
11889
|
-
return;
|
11890
|
-
}
|
11891
|
-
const { width: containerWidth, x: containerX } = container.getBoundingClientRect();
|
11892
|
-
const children2 = Array.from(tabs.childNodes).filter(
|
11893
|
-
(c) => c instanceof HTMLElement
|
11894
|
-
);
|
11895
|
-
if (direction === "right") {
|
11896
|
-
const next = children2.find((c) => {
|
11897
|
-
const { x, width } = c.getBoundingClientRect();
|
11898
|
-
return Math.round(x + width - containerX - containerWidth) > 0;
|
11899
|
-
});
|
11900
|
-
if (next instanceof HTMLElement) {
|
11901
|
-
const { x, width } = next.getBoundingClientRect();
|
11902
|
-
container.scrollTo({
|
11903
|
-
left: container.scrollLeft + Math.ceil(x + width + CARET_OFFSET - containerX - containerWidth),
|
11904
|
-
behavior: "smooth"
|
11905
|
-
});
|
11906
|
-
}
|
11907
|
-
} else {
|
11908
|
-
const next = children2.find((c) => {
|
11909
|
-
const { x, width } = c.getBoundingClientRect();
|
11910
|
-
return Math.round(x + width - containerX) >= 0;
|
11911
|
-
});
|
11912
|
-
if (next instanceof HTMLElement) {
|
11913
|
-
const { x } = next.getBoundingClientRect();
|
11914
|
-
container.scrollTo({
|
11915
|
-
left: container.scrollLeft - Math.abs(x - containerX - CARET_OFFSET),
|
11916
|
-
behavior: "smooth"
|
11917
|
-
});
|
11918
|
-
}
|
11919
|
-
}
|
11920
|
-
};
|
11921
|
-
const handleKeyDown = (event) => {
|
11922
|
-
const target = event.target;
|
11923
|
-
const parent = target.parentElement;
|
11924
|
-
const first = parent.firstChild;
|
11925
|
-
const last = parent.lastChild;
|
11926
|
-
const next = target.nextElementSibling;
|
11927
|
-
const prev = target.previousElementSibling;
|
11928
|
-
if (event.key === "ArrowRight") {
|
11929
|
-
(next != null ? next : first).focus();
|
11930
|
-
} else if (event.key === "ArrowLeft") {
|
11931
|
-
(prev != null ? prev : last).focus();
|
11932
|
-
}
|
11933
|
-
};
|
11934
|
-
const handleSelected = (key) => {
|
11935
|
-
(onChange != null ? onChange : setSelected)(key);
|
11936
|
-
};
|
11937
|
-
React81.Children.forEach(children, (c) => {
|
11938
|
-
if (c && !isTabComponent(c)) {
|
11939
|
-
throw new Error("<Tabs> can only have <Tabs.Tab> components as children");
|
11940
|
-
}
|
12018
|
+
}, footer)))));
|
12019
|
+
};
|
12020
|
+
|
12021
|
+
// src/molecules/Flexbox/FlexboxItem.tsx
|
12022
|
+
import React77 from "react";
|
12023
|
+
var FlexboxItem = Tailwindify(
|
12024
|
+
({ htmlTag = "div", className, style, children, display, flex, grow, shrink, order, alignSelf }) => {
|
12025
|
+
const hookStyle = useStyle({
|
12026
|
+
display,
|
12027
|
+
flex,
|
12028
|
+
flexGrow: grow,
|
12029
|
+
flexShrink: shrink,
|
12030
|
+
order,
|
12031
|
+
alignSelf
|
11941
12032
|
});
|
11942
|
-
|
11943
|
-
|
11944
|
-
|
11945
|
-
|
11946
|
-
|
11947
|
-
|
11948
|
-
|
11949
|
-
|
11950
|
-
|
11951
|
-
|
11952
|
-
|
11953
|
-
|
11954
|
-
|
11955
|
-
|
11956
|
-
|
11957
|
-
|
11958
|
-
|
11959
|
-
|
11960
|
-
|
11961
|
-
|
11962
|
-
|
11963
|
-
|
11964
|
-
|
11965
|
-
|
11966
|
-
|
11967
|
-
|
11968
|
-
|
11969
|
-
|
11970
|
-
|
11971
|
-
|
11972
|
-
|
11973
|
-
|
11974
|
-
|
11975
|
-
|
11976
|
-
|
11977
|
-
|
11978
|
-
|
11979
|
-
|
11980
|
-
})
|
12033
|
+
const HtmlElement = htmlTag;
|
12034
|
+
return /* @__PURE__ */ React77.createElement(HtmlElement, {
|
12035
|
+
style: __spreadValues(__spreadValues({}, hookStyle), style),
|
12036
|
+
className
|
12037
|
+
}, children);
|
12038
|
+
}
|
12039
|
+
);
|
12040
|
+
|
12041
|
+
// src/molecules/Grid/GridItem.tsx
|
12042
|
+
import React78 from "react";
|
12043
|
+
var GridItem2 = Tailwindify(
|
12044
|
+
({
|
12045
|
+
htmlTag = "div",
|
12046
|
+
className,
|
12047
|
+
style,
|
12048
|
+
children,
|
12049
|
+
display,
|
12050
|
+
justifySelf,
|
12051
|
+
alignSelf,
|
12052
|
+
placeSelf,
|
12053
|
+
colSpan,
|
12054
|
+
colStart,
|
12055
|
+
colEnd,
|
12056
|
+
rowSpan,
|
12057
|
+
rowStart,
|
12058
|
+
rowEnd
|
12059
|
+
}) => {
|
12060
|
+
const hookStyle = useStyle({
|
12061
|
+
display,
|
12062
|
+
justifySelf,
|
12063
|
+
alignSelf,
|
12064
|
+
placeSelf,
|
12065
|
+
gridColumn: colSpan,
|
12066
|
+
gridColumnStart: colStart,
|
12067
|
+
gridColumnEnd: colEnd,
|
12068
|
+
gridRow: rowSpan,
|
12069
|
+
gridRowStart: rowStart,
|
12070
|
+
gridRowEnd: rowEnd
|
12071
|
+
});
|
12072
|
+
const HtmlElement = htmlTag;
|
12073
|
+
return /* @__PURE__ */ React78.createElement(HtmlElement, {
|
12074
|
+
style: __spreadValues(__spreadValues({}, hookStyle), style),
|
12075
|
+
className
|
12076
|
+
}, children);
|
12077
|
+
}
|
12078
|
+
);
|
12079
|
+
|
12080
|
+
// src/molecules/LineClamp/LineClamp.tsx
|
12081
|
+
import React79 from "react";
|
12082
|
+
var LineClamp2 = ({
|
12083
|
+
lines,
|
12084
|
+
children,
|
12085
|
+
wordBreak,
|
12086
|
+
expandLabel,
|
12087
|
+
collapseLabel,
|
12088
|
+
onClampedChange
|
12089
|
+
}) => {
|
12090
|
+
const ref = React79.useRef(null);
|
12091
|
+
const [clamped, setClamped] = React79.useState(true);
|
12092
|
+
const [isClampingEnabled, setClampingEnabled] = React79.useState(false);
|
12093
|
+
React79.useEffect(() => {
|
12094
|
+
var _a, _b;
|
12095
|
+
const el = ref.current;
|
12096
|
+
setClampingEnabled(((_a = el == null ? void 0 : el.scrollHeight) != null ? _a : 0) > ((_b = el == null ? void 0 : el.clientHeight) != null ? _b : 0));
|
12097
|
+
}, [ref.current]);
|
12098
|
+
const handleClampedChange = () => {
|
12099
|
+
setClamped(!clamped);
|
12100
|
+
onClampedChange == null ? void 0 : onClampedChange(!clamped);
|
11981
12101
|
};
|
11982
|
-
|
11983
|
-
|
11984
|
-
|
12102
|
+
return /* @__PURE__ */ React79.createElement("div", {
|
12103
|
+
className: "Aquarium-LineClamp"
|
12104
|
+
}, /* @__PURE__ */ React79.createElement(LineClamp, {
|
12105
|
+
ref,
|
12106
|
+
lines,
|
12107
|
+
clamped,
|
12108
|
+
wordBreak
|
12109
|
+
}, children), expandLabel && isClampingEnabled && /* @__PURE__ */ React79.createElement(Button.Ghost, {
|
12110
|
+
dense: true,
|
12111
|
+
onClick: handleClampedChange
|
12112
|
+
}, clamped ? expandLabel : collapseLabel));
|
12113
|
+
};
|
12114
|
+
|
12115
|
+
// src/molecules/Link/Link.tsx
|
12116
|
+
import React81 from "react";
|
12117
|
+
import classNames9 from "classnames";
|
12118
|
+
|
12119
|
+
// src/atoms/Link/Link.tsx
|
12120
|
+
import React80 from "react";
|
12121
|
+
var Link = (_a) => {
|
12122
|
+
var _b = _a, { children, className } = _b, props = __objRest(_b, ["children", "className"]);
|
12123
|
+
return /* @__PURE__ */ React80.createElement("a", __spreadValues({
|
12124
|
+
className: classNames(className, linkStyle)
|
12125
|
+
}, props), children);
|
12126
|
+
};
|
12127
|
+
|
12128
|
+
// src/molecules/Link/Link.tsx
|
12129
|
+
var Link2 = (_a) => {
|
12130
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
12131
|
+
return /* @__PURE__ */ React81.createElement(Link, __spreadValues({
|
12132
|
+
className: classNames9("Aquarium-Link", className)
|
12133
|
+
}, props));
|
12134
|
+
};
|
12135
|
+
|
12136
|
+
// src/molecules/ListItem/ListItem.tsx
|
12137
|
+
import React82 from "react";
|
12138
|
+
var ListItem = ({ name, icon, active = false }) => {
|
12139
|
+
return /* @__PURE__ */ React82.createElement(Box.Flex, {
|
12140
|
+
className: "Aquarium-ListItem",
|
12141
|
+
alignItems: "center"
|
12142
|
+
}, /* @__PURE__ */ React82.createElement(Typography2, {
|
12143
|
+
variant: active ? "small-strong" : "small",
|
12144
|
+
color: "grey-70",
|
12145
|
+
htmlTag: "span",
|
12146
|
+
className: `px-4 py-2 rounded-full ${active ? "bg-grey-5" : "hover:bg-grey-0"}`
|
12147
|
+
}, /* @__PURE__ */ React82.createElement("img", {
|
12148
|
+
src: icon,
|
12149
|
+
alt: "",
|
12150
|
+
className: "inline mr-4",
|
12151
|
+
height: 28,
|
12152
|
+
width: 28
|
12153
|
+
}), name));
|
11985
12154
|
};
|
11986
|
-
var Tabs = createTabsComponent(Tab, TabItem, "Tabs", (children, selected) => /* @__PURE__ */ React81.createElement(TabContainer, null, children.find(
|
11987
|
-
(node, index) => (node == null ? void 0 : node.props.value) === selected || index === selected
|
11988
|
-
)));
|
11989
12155
|
|
11990
12156
|
// src/molecules/Modal/Modal.tsx
|
11991
|
-
|
12157
|
+
import React83 from "react";
|
12158
|
+
import { useDialog as useDialog4 } from "@react-aria/dialog";
|
12159
|
+
import { Overlay as Overlay4, useModalOverlay as useModalOverlay3 } from "@react-aria/overlays";
|
12160
|
+
import { useId as useId10 } from "@react-aria/utils";
|
12161
|
+
import { useOverlayTriggerState as useOverlayTriggerState5 } from "@react-stately/overlays";
|
12162
|
+
import castArray2 from "lodash/castArray";
|
12163
|
+
import omit11 from "lodash/omit";
|
12164
|
+
var import_cross7 = __toESM(require_cross());
|
11992
12165
|
var Modal2 = (_a) => {
|
11993
12166
|
var _b = _a, { closeOnEsc = true } = _b, props = __objRest(_b, ["closeOnEsc"]);
|
11994
12167
|
const { open, onClose, size, portalContainer } = props;
|
11995
|
-
const ref =
|
11996
|
-
const state =
|
11997
|
-
const { modalProps, underlayProps } =
|
12168
|
+
const ref = React83.useRef(null);
|
12169
|
+
const state = useOverlayTriggerState5({ isOpen: open, onOpenChange: (isOpen) => !isOpen && onClose() });
|
12170
|
+
const { modalProps, underlayProps } = useModalOverlay3(
|
11998
12171
|
{ isDismissable: false, isKeyboardDismissDisabled: !closeOnEsc },
|
11999
12172
|
state,
|
12000
12173
|
ref
|
@@ -12002,75 +12175,75 @@ var Modal2 = (_a) => {
|
|
12002
12175
|
if (!state.isOpen) {
|
12003
12176
|
return null;
|
12004
12177
|
}
|
12005
|
-
return /* @__PURE__ */
|
12178
|
+
return /* @__PURE__ */ React83.createElement(Overlay4, {
|
12006
12179
|
portalContainer
|
12007
|
-
}, /* @__PURE__ */
|
12180
|
+
}, /* @__PURE__ */ React83.createElement(Modal, {
|
12008
12181
|
className: "Aquarium-Modal",
|
12009
12182
|
open: true
|
12010
|
-
}, /* @__PURE__ */
|
12183
|
+
}, /* @__PURE__ */ React83.createElement(Modal.BackDrop, __spreadValues({}, underlayProps)), /* @__PURE__ */ React83.createElement(ModalWrapper, __spreadValues(__spreadValues({
|
12011
12184
|
ref,
|
12012
12185
|
size
|
12013
12186
|
}, props), modalProps))));
|
12014
12187
|
};
|
12015
|
-
var ModalWrapper =
|
12188
|
+
var ModalWrapper = React83.forwardRef(
|
12016
12189
|
(_a, ref) => {
|
12017
12190
|
var _b = _a, { title, subtitle, headerImage, primaryAction, secondaryActions, children, onClose } = _b, props = __objRest(_b, ["title", "subtitle", "headerImage", "primaryAction", "secondaryActions", "children", "onClose"]);
|
12018
|
-
const labelledBy =
|
12019
|
-
const describedBy =
|
12020
|
-
const { dialogProps } =
|
12191
|
+
const labelledBy = useId10();
|
12192
|
+
const describedBy = useId10();
|
12193
|
+
const { dialogProps } = useDialog4(
|
12021
12194
|
{ "role": "dialog", "aria-labelledby": labelledBy, "aria-describedby": describedBy },
|
12022
12195
|
ref
|
12023
12196
|
);
|
12024
|
-
return /* @__PURE__ */
|
12197
|
+
return /* @__PURE__ */ React83.createElement(Modal.Dialog, __spreadProps(__spreadValues(__spreadValues({
|
12025
12198
|
ref
|
12026
12199
|
}, props), dialogProps), {
|
12027
12200
|
tabIndex: -1
|
12028
|
-
}), /* @__PURE__ */
|
12201
|
+
}), /* @__PURE__ */ React83.createElement(Modal.CloseButtonContainer, null, /* @__PURE__ */ React83.createElement(IconButton, {
|
12029
12202
|
"aria-label": "Close",
|
12030
|
-
icon:
|
12203
|
+
icon: import_cross7.default,
|
12031
12204
|
onClick: onClose
|
12032
|
-
})), headerImage !== void 0 && /* @__PURE__ */
|
12205
|
+
})), headerImage !== void 0 && /* @__PURE__ */ React83.createElement(Modal.HeaderImage, {
|
12033
12206
|
backgroundImage: headerImage
|
12034
|
-
}), /* @__PURE__ */
|
12207
|
+
}), /* @__PURE__ */ React83.createElement(Modal.Header, {
|
12035
12208
|
className: tw({ "pb-3": isComponentType(children, ModalTabs) })
|
12036
|
-
}, /* @__PURE__ */
|
12209
|
+
}, /* @__PURE__ */ React83.createElement(Modal.TitleContainer, null, /* @__PURE__ */ React83.createElement(Modal.Title, {
|
12037
12210
|
id: labelledBy
|
12038
|
-
}, title), subtitle && /* @__PURE__ */
|
12211
|
+
}, title), subtitle && /* @__PURE__ */ React83.createElement(Modal.Subtitle, null, subtitle))), isComponentType(children, ModalTabs) ? React83.cloneElement(children, { className: tw("[&>div:first-child]:px-5 grow") }) : /* @__PURE__ */ React83.createElement(Modal.Body, {
|
12039
12212
|
id: describedBy,
|
12040
12213
|
tabIndex: 0,
|
12041
12214
|
noFooter: !(secondaryActions || primaryAction)
|
12042
|
-
}, children), (secondaryActions || primaryAction) && /* @__PURE__ */
|
12215
|
+
}, children), (secondaryActions || primaryAction) && /* @__PURE__ */ React83.createElement(Modal.Footer, null, /* @__PURE__ */ React83.createElement(Modal.Actions, null, secondaryActions && castArray2(secondaryActions).filter(Boolean).map((_a2) => {
|
12043
12216
|
var _b2 = _a2, { text } = _b2, action = __objRest(_b2, ["text"]);
|
12044
|
-
return /* @__PURE__ */
|
12217
|
+
return /* @__PURE__ */ React83.createElement(Button.Secondary, __spreadValues({
|
12045
12218
|
key: text
|
12046
12219
|
}, action), text);
|
12047
|
-
}), primaryAction && /* @__PURE__ */
|
12220
|
+
}), primaryAction && /* @__PURE__ */ React83.createElement(Button.Primary, __spreadValues({
|
12048
12221
|
key: primaryAction.text
|
12049
|
-
},
|
12222
|
+
}, omit11(primaryAction, "text")), primaryAction.text))));
|
12050
12223
|
}
|
12051
12224
|
);
|
12052
12225
|
var ModalTabs = createTabsComponent(
|
12053
12226
|
ModalTab,
|
12054
12227
|
TabItem,
|
12055
12228
|
"ModalTabs",
|
12056
|
-
(children, selected, props) => /* @__PURE__ */
|
12229
|
+
(children, selected, props) => /* @__PURE__ */ React83.createElement(Modal.Body, {
|
12057
12230
|
maxHeight: props.maxHeight
|
12058
|
-
}, /* @__PURE__ */
|
12231
|
+
}, /* @__PURE__ */ React83.createElement(ModalTabContainer, null, children.find(
|
12059
12232
|
(node, index) => (node == null ? void 0 : node.props.value) === selected || index === selected
|
12060
12233
|
)))
|
12061
12234
|
);
|
12062
12235
|
|
12063
12236
|
// src/molecules/MultiInput/MultiInput.tsx
|
12064
|
-
import
|
12065
|
-
import { useId as
|
12066
|
-
import
|
12237
|
+
import React85, { useEffect as useEffect11, useRef as useRef9, useState as useState11 } from "react";
|
12238
|
+
import { useId as useId11 } from "@react-aria/utils";
|
12239
|
+
import castArray3 from "lodash/castArray";
|
12067
12240
|
import identity from "lodash/identity";
|
12068
|
-
import
|
12241
|
+
import omit12 from "lodash/omit";
|
12069
12242
|
|
12070
12243
|
// src/molecules/MultiInput/InputChip.tsx
|
12071
|
-
import
|
12244
|
+
import React84 from "react";
|
12072
12245
|
var import_smallCross2 = __toESM(require_smallCross());
|
12073
|
-
var InputChip =
|
12246
|
+
var InputChip = React84.forwardRef(
|
12074
12247
|
(_a, ref) => {
|
12075
12248
|
var _b = _a, { invalid = false, disabled, readOnly, className, onClick: _onClick, children } = _b, props = __objRest(_b, ["invalid", "disabled", "readOnly", "className", "onClick", "children"]);
|
12076
12249
|
const onClick = (e) => {
|
@@ -12078,18 +12251,18 @@ var InputChip = React83.forwardRef(
|
|
12078
12251
|
_onClick == null ? void 0 : _onClick(e);
|
12079
12252
|
}
|
12080
12253
|
};
|
12081
|
-
return /* @__PURE__ */
|
12254
|
+
return /* @__PURE__ */ React84.createElement("div", {
|
12082
12255
|
className: classNames(className, "inline-flex align-middle mx-1 items-stretch rounded-sm break-all", {
|
12083
12256
|
"bg-error-0 ": invalid,
|
12084
12257
|
"bg-grey-0 ": !invalid && !disabled,
|
12085
12258
|
"bg-grey-5": disabled
|
12086
12259
|
})
|
12087
|
-
}, /* @__PURE__ */
|
12260
|
+
}, /* @__PURE__ */ React84.createElement("div", {
|
12088
12261
|
className: tw("px-2 py-1")
|
12089
|
-
}, /* @__PURE__ */
|
12262
|
+
}, /* @__PURE__ */ React84.createElement(Typography2, {
|
12090
12263
|
variant: "small",
|
12091
12264
|
color: invalid ? "error-80" : disabled ? "grey-40" : "grey-70"
|
12092
|
-
}, children)), !readOnly && /* @__PURE__ */
|
12265
|
+
}, children)), !readOnly && /* @__PURE__ */ React84.createElement("div", __spreadProps(__spreadValues({
|
12093
12266
|
ref
|
12094
12267
|
}, props), {
|
12095
12268
|
onClick,
|
@@ -12100,7 +12273,7 @@ var InputChip = React83.forwardRef(
|
|
12100
12273
|
}),
|
12101
12274
|
role: "button",
|
12102
12275
|
"aria-label": `Remove ${String(children)}`
|
12103
|
-
}), /* @__PURE__ */
|
12276
|
+
}), /* @__PURE__ */ React84.createElement(Icon, {
|
12104
12277
|
icon: import_smallCross2.default,
|
12105
12278
|
className: tw({
|
12106
12279
|
"text-error-70": invalid,
|
@@ -12162,7 +12335,7 @@ var MultiInputBase = (_a) => {
|
|
12162
12335
|
const [items, setItems] = useState11((_a2 = value != null ? value : defaultValue) != null ? _a2 : []);
|
12163
12336
|
const [hasFocus, setFocus] = useState11(false);
|
12164
12337
|
const keyCodes = [delimiter !== "enter" ? " " : null, delimiter !== "space" ? "Enter" : null].filter(identity);
|
12165
|
-
|
12338
|
+
useEffect11(() => {
|
12166
12339
|
const requiresUpdate = value !== void 0 || defaultValue === void 0;
|
12167
12340
|
if (requiresUpdate && JSON.stringify(value) !== JSON.stringify(items)) {
|
12168
12341
|
setItems(value != null ? value : []);
|
@@ -12203,7 +12376,7 @@ var MultiInputBase = (_a) => {
|
|
12203
12376
|
inputRef.current.value = "";
|
12204
12377
|
}
|
12205
12378
|
if (value2) {
|
12206
|
-
const newItems =
|
12379
|
+
const newItems = castArray3(value2).map(createItem).filter((item) => !items.includes(item));
|
12207
12380
|
if (newItems.length > 0 && items.length + newItems.length <= (maxLength != null ? maxLength : Number.MAX_SAFE_INTEGER)) {
|
12208
12381
|
const updated = (items != null ? items : []).concat(newItems);
|
12209
12382
|
setItems(updated);
|
@@ -12241,7 +12414,7 @@ var MultiInputBase = (_a) => {
|
|
12241
12414
|
};
|
12242
12415
|
const renderChips = () => items == null ? void 0 : items.map((item, index) => {
|
12243
12416
|
var _a3;
|
12244
|
-
return /* @__PURE__ */
|
12417
|
+
return /* @__PURE__ */ React85.createElement(InputChip, {
|
12245
12418
|
key: `${itemToString(item)}.${index}`,
|
12246
12419
|
invalid: !((_a3 = isItemValid == null ? void 0 : isItemValid(item, index)) != null ? _a3 : true),
|
12247
12420
|
readOnly,
|
@@ -12252,13 +12425,13 @@ var MultiInputBase = (_a) => {
|
|
12252
12425
|
}
|
12253
12426
|
}, itemToString(item));
|
12254
12427
|
});
|
12255
|
-
return /* @__PURE__ */
|
12428
|
+
return /* @__PURE__ */ React85.createElement("div", {
|
12256
12429
|
className: "Aquarium-MultiInputBase"
|
12257
|
-
}, /* @__PURE__ */
|
12430
|
+
}, /* @__PURE__ */ React85.createElement(Select.InputContainer, {
|
12258
12431
|
variant: disabled ? "disabled" : !valid ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default"
|
12259
|
-
}, /* @__PURE__ */
|
12432
|
+
}, /* @__PURE__ */ React85.createElement("div", {
|
12260
12433
|
className: "grow inline-flex flex-row flex-wrap gap-y-2"
|
12261
|
-
}, inline && renderChips(), /* @__PURE__ */
|
12434
|
+
}, inline && renderChips(), /* @__PURE__ */ React85.createElement(Select.Input, __spreadProps(__spreadValues({
|
12262
12435
|
ref: inputRef,
|
12263
12436
|
id: id != null ? id : name,
|
12264
12437
|
name,
|
@@ -12276,11 +12449,11 @@ var MultiInputBase = (_a) => {
|
|
12276
12449
|
onFocus: handleFocus,
|
12277
12450
|
onBlur: handleBlur,
|
12278
12451
|
autoComplete: "off"
|
12279
|
-
}))), endAdornment && /* @__PURE__ */
|
12452
|
+
}))), endAdornment && /* @__PURE__ */ React85.createElement(InputAdornment, null, endAdornment)), !inline && /* @__PURE__ */ React85.createElement("div", {
|
12280
12453
|
className: tw("flex flex-row flex-wrap gap-y-2 mt-2")
|
12281
12454
|
}, renderChips()));
|
12282
12455
|
};
|
12283
|
-
var BaseMultiInputSkeleton = () => /* @__PURE__ */
|
12456
|
+
var BaseMultiInputSkeleton = () => /* @__PURE__ */ React85.createElement(Skeleton, {
|
12284
12457
|
height: 38
|
12285
12458
|
});
|
12286
12459
|
MultiInputBase.Skeleton = BaseMultiInputSkeleton;
|
@@ -12288,17 +12461,17 @@ var MultiInput = (props) => {
|
|
12288
12461
|
var _a, _b, _c, _d, _e;
|
12289
12462
|
const maxLength = (_a = props.maxLength) != null ? _a : props.max;
|
12290
12463
|
const [value, setValue] = useState11((_c = (_b = props.value) != null ? _b : props.defaultValue) != null ? _c : []);
|
12291
|
-
|
12464
|
+
useEffect11(() => {
|
12292
12465
|
var _a2;
|
12293
12466
|
setValue((_a2 = props.value) != null ? _a2 : []);
|
12294
12467
|
}, [JSON.stringify(props.value)]);
|
12295
|
-
const defaultId =
|
12468
|
+
const defaultId = useId11();
|
12296
12469
|
const id = (_e = (_d = props.id) != null ? _d : props.name) != null ? _e : defaultId;
|
12297
|
-
const errorMessageId =
|
12470
|
+
const errorMessageId = useId11();
|
12298
12471
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
12299
12472
|
const labelControlProps = getLabelControlProps(props);
|
12300
|
-
const baseProps =
|
12301
|
-
return /* @__PURE__ */
|
12473
|
+
const baseProps = omit12(props, Object.keys(labelControlProps));
|
12474
|
+
return /* @__PURE__ */ React85.createElement(LabelControl, __spreadProps(__spreadValues({
|
12302
12475
|
id: `${id}-label`,
|
12303
12476
|
htmlFor: `${id}-input`,
|
12304
12477
|
messageId: errorMessageId
|
@@ -12306,7 +12479,7 @@ var MultiInput = (props) => {
|
|
12306
12479
|
length: value.length,
|
12307
12480
|
maxLength,
|
12308
12481
|
className: "Aquarium-MultiInput"
|
12309
|
-
}), /* @__PURE__ */
|
12482
|
+
}), /* @__PURE__ */ React85.createElement(MultiInputBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
|
12310
12483
|
id: `${id}-input`,
|
12311
12484
|
onChange: (value2) => {
|
12312
12485
|
var _a2;
|
@@ -12318,20 +12491,20 @@ var MultiInput = (props) => {
|
|
12318
12491
|
valid: props.valid
|
12319
12492
|
})));
|
12320
12493
|
};
|
12321
|
-
var MultiInputSkeleton = () => /* @__PURE__ */
|
12494
|
+
var MultiInputSkeleton = () => /* @__PURE__ */ React85.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React85.createElement(MultiInputBase.Skeleton, null));
|
12322
12495
|
MultiInput.Skeleton = MultiInputSkeleton;
|
12323
12496
|
MultiInput.Skeleton.displayName = "MultiInput.Skeleton";
|
12324
12497
|
|
12325
12498
|
// src/molecules/MultiSelect/MultiSelect.tsx
|
12326
|
-
import
|
12499
|
+
import React86, { useEffect as useEffect12, useRef as useRef10, useState as useState12 } from "react";
|
12327
12500
|
import { ariaHideOutside as ariaHideOutside2 } from "@react-aria/overlays";
|
12328
|
-
import { useId as
|
12501
|
+
import { useId as useId12 } from "@react-aria/utils";
|
12329
12502
|
import { useCombobox as useCombobox2, useMultipleSelection } from "downshift";
|
12330
12503
|
import isArray2 from "lodash/isArray";
|
12331
12504
|
import isEqual from "lodash/isEqual";
|
12332
12505
|
import isNil2 from "lodash/isNil";
|
12333
12506
|
import isObject2 from "lodash/isObject";
|
12334
|
-
import
|
12507
|
+
import omit13 from "lodash/omit";
|
12335
12508
|
import omitBy from "lodash/omitBy";
|
12336
12509
|
import { matchSorter as matchSorter2 } from "match-sorter";
|
12337
12510
|
var isOptionGroup = (option) => {
|
@@ -12478,21 +12651,21 @@ var MultiSelectBase = (_a) => {
|
|
12478
12651
|
toggle: toggleMenu,
|
12479
12652
|
setOpen: (isOpen2) => isOpen2 ? openMenu() : closeMenu()
|
12480
12653
|
};
|
12481
|
-
|
12654
|
+
useEffect12(() => {
|
12482
12655
|
if (state.isOpen && inputRef.current && popoverRef.current) {
|
12483
12656
|
return ariaHideOutside2([inputRef.current, popoverRef.current]);
|
12484
12657
|
}
|
12485
12658
|
}, [state.isOpen, inputRef, popoverRef]);
|
12486
|
-
const renderItem = (item, index) => /* @__PURE__ */
|
12659
|
+
const renderItem = (item, index) => /* @__PURE__ */ React86.createElement(Select.Item, __spreadValues({
|
12487
12660
|
key: itemToString(item),
|
12488
12661
|
highlighted: index === highlightedIndex,
|
12489
12662
|
selected: selectedItems.includes(item)
|
12490
12663
|
}, getItemProps({ item, index })), renderOption(item));
|
12491
|
-
const renderGroup = (group) => group.options.length ? /* @__PURE__ */
|
12664
|
+
const renderGroup = (group) => group.options.length ? /* @__PURE__ */ React86.createElement(React86.Fragment, {
|
12492
12665
|
key: group.label
|
12493
|
-
}, /* @__PURE__ */
|
12666
|
+
}, /* @__PURE__ */ React86.createElement(Select.Group, null, group.label), group.options.map((opt) => renderItem(opt, flattenedOptions.indexOf(opt)))) : null;
|
12494
12667
|
const renderChips = () => {
|
12495
|
-
return selectedItems.map((selectedItem, index) => /* @__PURE__ */
|
12668
|
+
return selectedItems.map((selectedItem, index) => /* @__PURE__ */ React86.createElement(InputChip, __spreadProps(__spreadValues({
|
12496
12669
|
key: `${itemToString(selectedItem)}.chip`,
|
12497
12670
|
className: tw("mx-0"),
|
12498
12671
|
disabled,
|
@@ -12510,14 +12683,14 @@ var MultiSelectBase = (_a) => {
|
|
12510
12683
|
getDropdownProps({ ref: inputRef, disabled: disabled || readOnly, value: inputValue })
|
12511
12684
|
);
|
12512
12685
|
const menuProps = getMenuProps({ ref: menuRef }, { suppressRefError: !isOpen });
|
12513
|
-
return /* @__PURE__ */
|
12686
|
+
return /* @__PURE__ */ React86.createElement("div", {
|
12514
12687
|
className: classNames("Aquarium-MultiSelectBase", tw("relative"))
|
12515
|
-
}, /* @__PURE__ */
|
12688
|
+
}, /* @__PURE__ */ React86.createElement(Select.InputContainer, {
|
12516
12689
|
ref: targetRef,
|
12517
12690
|
variant: disabled ? "disabled" : !valid ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default"
|
12518
|
-
}, /* @__PURE__ */
|
12691
|
+
}, /* @__PURE__ */ React86.createElement("div", {
|
12519
12692
|
className: "grow inline-flex flex-row flex-wrap gap-2"
|
12520
|
-
}, !hideChips && inline && renderChips(), /* @__PURE__ */
|
12693
|
+
}, !hideChips && inline && renderChips(), /* @__PURE__ */ React86.createElement(Select.Input, __spreadProps(__spreadValues(__spreadValues({
|
12521
12694
|
name,
|
12522
12695
|
placeholder: selectedItems.length === 0 && !readOnly ? placeholder : ""
|
12523
12696
|
}, inputProps), props), {
|
@@ -12536,12 +12709,12 @@ var MultiSelectBase = (_a) => {
|
|
12536
12709
|
setFocus(false);
|
12537
12710
|
(_a3 = inputProps.onBlur) == null ? void 0 : _a3.call(inputProps, e);
|
12538
12711
|
}
|
12539
|
-
}))), !readOnly && /* @__PURE__ */
|
12712
|
+
}))), !readOnly && /* @__PURE__ */ React86.createElement(Select.Toggle, __spreadValues({
|
12540
12713
|
hasFocus,
|
12541
12714
|
isOpen
|
12542
|
-
}, getToggleButtonProps({ disabled })))), !hideChips && !inline && /* @__PURE__ */
|
12715
|
+
}, getToggleButtonProps({ disabled })))), !hideChips && !inline && /* @__PURE__ */ React86.createElement("div", {
|
12543
12716
|
className: tw("flex flex-row flex-wrap gap-2 mt-2")
|
12544
|
-
}, renderChips()), isOpen && /* @__PURE__ */
|
12717
|
+
}, renderChips()), isOpen && /* @__PURE__ */ React86.createElement(PopoverOverlay, {
|
12545
12718
|
ref: popoverRef,
|
12546
12719
|
triggerRef: targetRef,
|
12547
12720
|
state,
|
@@ -12549,13 +12722,13 @@ var MultiSelectBase = (_a) => {
|
|
12549
12722
|
shouldFlip: true,
|
12550
12723
|
isNonModal: true,
|
12551
12724
|
style: { width: (_a2 = targetRef.current) == null ? void 0 : _a2.offsetWidth }
|
12552
|
-
}, /* @__PURE__ */
|
12725
|
+
}, /* @__PURE__ */ React86.createElement(Select.Menu, __spreadValues({
|
12553
12726
|
maxHeight
|
12554
|
-
}, menuProps), hasNoResults && /* @__PURE__ */
|
12727
|
+
}, menuProps), hasNoResults && /* @__PURE__ */ React86.createElement(Select.NoResults, null, emptyState), filteredOptions.map(
|
12555
12728
|
(option, index) => isOptionGroup(option) ? renderGroup(option) : renderItem(option, index)
|
12556
12729
|
))));
|
12557
12730
|
};
|
12558
|
-
var MultiSelectBaseSkeleton = () => /* @__PURE__ */
|
12731
|
+
var MultiSelectBaseSkeleton = () => /* @__PURE__ */ React86.createElement(Skeleton, {
|
12559
12732
|
height: 38
|
12560
12733
|
});
|
12561
12734
|
MultiSelectBase.Skeleton = MultiSelectBaseSkeleton;
|
@@ -12570,19 +12743,19 @@ var MultiSelect = (_a) => {
|
|
12570
12743
|
"emptyState"
|
12571
12744
|
]);
|
12572
12745
|
var _a2;
|
12573
|
-
const defaultId =
|
12746
|
+
const defaultId = useId12();
|
12574
12747
|
const id = (_a2 = props.id) != null ? _a2 : defaultId;
|
12575
|
-
const errorMessageId =
|
12748
|
+
const errorMessageId = useId12();
|
12576
12749
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
12577
12750
|
const labelControlProps = getLabelControlProps(props);
|
12578
|
-
const baseProps =
|
12579
|
-
return /* @__PURE__ */
|
12751
|
+
const baseProps = omit13(props, Object.keys(labelControlProps));
|
12752
|
+
return /* @__PURE__ */ React86.createElement(LabelControl, __spreadProps(__spreadValues({
|
12580
12753
|
id: `${id}-label`,
|
12581
12754
|
htmlFor: `${id}-input`,
|
12582
12755
|
messageId: errorMessageId
|
12583
12756
|
}, labelControlProps), {
|
12584
12757
|
className: "Aquarium-MultiSelect"
|
12585
|
-
}), /* @__PURE__ */
|
12758
|
+
}), /* @__PURE__ */ React86.createElement(MultiSelectBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
|
12586
12759
|
id,
|
12587
12760
|
options,
|
12588
12761
|
emptyState,
|
@@ -12590,17 +12763,17 @@ var MultiSelect = (_a) => {
|
|
12590
12763
|
valid: props.valid
|
12591
12764
|
})));
|
12592
12765
|
};
|
12593
|
-
var MultiSelectSkeleton = () => /* @__PURE__ */
|
12766
|
+
var MultiSelectSkeleton = () => /* @__PURE__ */ React86.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React86.createElement(MultiSelectBase.Skeleton, null));
|
12594
12767
|
MultiSelect.Skeleton = MultiSelectSkeleton;
|
12595
12768
|
MultiSelect.Skeleton.displayName = "MultiSelect.Skeleton";
|
12596
12769
|
|
12597
12770
|
// src/molecules/NativeSelect/NativeSelect.tsx
|
12598
|
-
import
|
12599
|
-
import { useId as
|
12600
|
-
import
|
12771
|
+
import React87 from "react";
|
12772
|
+
import { useId as useId13 } from "@react-aria/utils";
|
12773
|
+
import omit14 from "lodash/omit";
|
12601
12774
|
import uniqueId from "lodash/uniqueId";
|
12602
12775
|
var import_caretDown2 = __toESM(require_caretDown());
|
12603
|
-
var NativeSelectBase =
|
12776
|
+
var NativeSelectBase = React87.forwardRef(
|
12604
12777
|
(_a, ref) => {
|
12605
12778
|
var _b = _a, { children, disabled = false, required = false, valid = true, readOnly = false } = _b, props = __objRest(_b, ["children", "disabled", "required", "valid", "readOnly"]);
|
12606
12779
|
const placeholderValue = uniqueId("default_value_for_placeholder");
|
@@ -12617,16 +12790,16 @@ var NativeSelectBase = React86.forwardRef(
|
|
12617
12790
|
(_b2 = props.onBlur) == null ? void 0 : _b2.call(props, event);
|
12618
12791
|
}
|
12619
12792
|
};
|
12620
|
-
return /* @__PURE__ */
|
12793
|
+
return /* @__PURE__ */ React87.createElement("span", {
|
12621
12794
|
className: classNames("Aquarium-NativeSelectBase", tw("relative block"))
|
12622
|
-
}, !readOnly && /* @__PURE__ */
|
12795
|
+
}, !readOnly && /* @__PURE__ */ React87.createElement("span", {
|
12623
12796
|
className: tw(
|
12624
12797
|
"absolute right-0 inset-y-0 mr-4 text-grey-40 flex ml-3 pointer-events-none typography-default-strong mt-4"
|
12625
12798
|
)
|
12626
|
-
}, /* @__PURE__ */
|
12799
|
+
}, /* @__PURE__ */ React87.createElement(Icon, {
|
12627
12800
|
icon: import_caretDown2.default,
|
12628
12801
|
"data-testid": "icon-dropdown"
|
12629
|
-
})), /* @__PURE__ */
|
12802
|
+
})), /* @__PURE__ */ React87.createElement("select", __spreadProps(__spreadValues({
|
12630
12803
|
ref,
|
12631
12804
|
disabled: disabled || readOnly,
|
12632
12805
|
required
|
@@ -12645,32 +12818,32 @@ var NativeSelectBase = React86.forwardRef(
|
|
12645
12818
|
),
|
12646
12819
|
props.className
|
12647
12820
|
)
|
12648
|
-
}), props.placeholder && /* @__PURE__ */
|
12821
|
+
}), props.placeholder && /* @__PURE__ */ React87.createElement("option", {
|
12649
12822
|
value: placeholderValue,
|
12650
12823
|
disabled: true
|
12651
12824
|
}, props.placeholder), children));
|
12652
12825
|
}
|
12653
12826
|
);
|
12654
|
-
NativeSelectBase.Skeleton = () => /* @__PURE__ */
|
12827
|
+
NativeSelectBase.Skeleton = () => /* @__PURE__ */ React87.createElement(Skeleton, {
|
12655
12828
|
height: 38
|
12656
12829
|
});
|
12657
|
-
var NativeSelect =
|
12830
|
+
var NativeSelect = React87.forwardRef(
|
12658
12831
|
(_a, ref) => {
|
12659
12832
|
var _b = _a, { readOnly } = _b, props = __objRest(_b, ["readOnly"]);
|
12660
12833
|
var _a2;
|
12661
|
-
const defaultId =
|
12834
|
+
const defaultId = useId13();
|
12662
12835
|
const id = (_a2 = props.id) != null ? _a2 : defaultId;
|
12663
|
-
const errorMessageId =
|
12836
|
+
const errorMessageId = useId13();
|
12664
12837
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
12665
12838
|
const _b2 = getLabelControlProps(props), { "data-testid": dataTestId } = _b2, labelControlProps = __objRest(_b2, ["data-testid"]);
|
12666
|
-
const baseProps =
|
12667
|
-
return /* @__PURE__ */
|
12839
|
+
const baseProps = omit14(props, Object.keys(labelControlProps));
|
12840
|
+
return /* @__PURE__ */ React87.createElement(LabelControl, __spreadProps(__spreadValues({
|
12668
12841
|
id: `${id}-label`,
|
12669
12842
|
htmlFor: id,
|
12670
12843
|
messageId: errorMessageId
|
12671
12844
|
}, labelControlProps), {
|
12672
12845
|
className: "Aquarium-NativeSelect"
|
12673
|
-
}), /* @__PURE__ */
|
12846
|
+
}), /* @__PURE__ */ React87.createElement(NativeSelectBase, __spreadProps(__spreadValues(__spreadValues({
|
12674
12847
|
ref
|
12675
12848
|
}, baseProps), errorProps), {
|
12676
12849
|
id,
|
@@ -12684,63 +12857,63 @@ var NativeSelect = React86.forwardRef(
|
|
12684
12857
|
}
|
12685
12858
|
);
|
12686
12859
|
NativeSelect.displayName = "NativeSelect";
|
12687
|
-
var Option =
|
12860
|
+
var Option = React87.forwardRef((_a, ref) => {
|
12688
12861
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
12689
|
-
return /* @__PURE__ */
|
12862
|
+
return /* @__PURE__ */ React87.createElement("option", __spreadValues({
|
12690
12863
|
ref
|
12691
12864
|
}, props), children);
|
12692
12865
|
});
|
12693
12866
|
Option.displayName = "Option";
|
12694
|
-
var NativeSelectSkeleton = () => /* @__PURE__ */
|
12867
|
+
var NativeSelectSkeleton = () => /* @__PURE__ */ React87.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React87.createElement(NativeSelectBase.Skeleton, null), /* @__PURE__ */ React87.createElement("div", {
|
12695
12868
|
style: { height: "1px" }
|
12696
12869
|
}));
|
12697
12870
|
NativeSelect.Skeleton = NativeSelectSkeleton;
|
12698
12871
|
NativeSelect.Skeleton.displayName = "NativeSelect.Skeleton";
|
12699
12872
|
|
12700
12873
|
// src/molecules/Navigation/Navigation.tsx
|
12701
|
-
import
|
12874
|
+
import React89 from "react";
|
12702
12875
|
import classNames10 from "classnames";
|
12703
12876
|
|
12704
12877
|
// src/atoms/Navigation/Navigation.tsx
|
12705
|
-
import
|
12878
|
+
import React88 from "react";
|
12706
12879
|
var Navigation = (_a) => {
|
12707
12880
|
var _b = _a, { className, children } = _b, rest = __objRest(_b, ["className", "children"]);
|
12708
|
-
return /* @__PURE__ */
|
12881
|
+
return /* @__PURE__ */ React88.createElement("nav", {
|
12709
12882
|
className: classNames(tw("bg-grey-0 h-full"))
|
12710
|
-
}, /* @__PURE__ */
|
12883
|
+
}, /* @__PURE__ */ React88.createElement("ul", __spreadProps(__spreadValues({}, rest), {
|
12711
12884
|
className: classNames(tw("flex flex-col h-full"), className),
|
12712
12885
|
role: "menubar"
|
12713
12886
|
}), children));
|
12714
12887
|
};
|
12715
12888
|
var Header = (_a) => {
|
12716
12889
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
12717
|
-
return /* @__PURE__ */
|
12890
|
+
return /* @__PURE__ */ React88.createElement("li", __spreadProps(__spreadValues({}, rest), {
|
12718
12891
|
role: "presentation",
|
12719
12892
|
className: classNames(tw("px-6 py-5"), className)
|
12720
12893
|
}));
|
12721
12894
|
};
|
12722
12895
|
var Footer = (_a) => {
|
12723
12896
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
12724
|
-
return /* @__PURE__ */
|
12897
|
+
return /* @__PURE__ */ React88.createElement("li", __spreadProps(__spreadValues({}, rest), {
|
12725
12898
|
role: "presentation",
|
12726
12899
|
className: classNames(tw("px-6 py-5 mt-auto"), className)
|
12727
12900
|
}));
|
12728
12901
|
};
|
12729
12902
|
var Section2 = (_a) => {
|
12730
12903
|
var _b = _a, { title, className } = _b, rest = __objRest(_b, ["title", "className"]);
|
12731
|
-
return /* @__PURE__ */
|
12904
|
+
return /* @__PURE__ */ React88.createElement("li", {
|
12732
12905
|
role: "presentation",
|
12733
12906
|
className: tw("py-5")
|
12734
|
-
}, title && /* @__PURE__ */
|
12907
|
+
}, title && /* @__PURE__ */ React88.createElement("div", {
|
12735
12908
|
className: classNames(className, "py-2 px-6 text-grey-40 uppercase cursor-default typography-caption")
|
12736
|
-
}, title), /* @__PURE__ */
|
12909
|
+
}, title), /* @__PURE__ */ React88.createElement("ul", __spreadProps(__spreadValues({}, rest), {
|
12737
12910
|
role: "group",
|
12738
12911
|
className: classNames(tw("flex flex-col"), className)
|
12739
12912
|
})));
|
12740
12913
|
};
|
12741
12914
|
var Divider3 = (_a) => {
|
12742
12915
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
12743
|
-
return /* @__PURE__ */
|
12916
|
+
return /* @__PURE__ */ React88.createElement("li", __spreadProps(__spreadValues({
|
12744
12917
|
role: "separator"
|
12745
12918
|
}, rest), {
|
12746
12919
|
className: classNames(tw("border-t-2 border-grey-5"), className)
|
@@ -12748,9 +12921,9 @@ var Divider3 = (_a) => {
|
|
12748
12921
|
};
|
12749
12922
|
var Item5 = (_a) => {
|
12750
12923
|
var _b = _a, { className, active } = _b, rest = __objRest(_b, ["className", "active"]);
|
12751
|
-
return /* @__PURE__ */
|
12924
|
+
return /* @__PURE__ */ React88.createElement("li", {
|
12752
12925
|
role: "presentation"
|
12753
|
-
}, /* @__PURE__ */
|
12926
|
+
}, /* @__PURE__ */ React88.createElement("a", __spreadProps(__spreadValues({}, rest), {
|
12754
12927
|
role: "menuitem",
|
12755
12928
|
className: classNames(
|
12756
12929
|
tw("py-3 px-6 hover:bg-grey-5 cursor-pointer flex gap-4 items-center typography-small focusable", {
|
@@ -12770,7 +12943,7 @@ Navigation.Divider = Divider3;
|
|
12770
12943
|
// src/molecules/Navigation/Navigation.tsx
|
12771
12944
|
var Navigation2 = (_a) => {
|
12772
12945
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
12773
|
-
return /* @__PURE__ */
|
12946
|
+
return /* @__PURE__ */ React89.createElement(Navigation, __spreadValues({
|
12774
12947
|
className: classNames10("Aquarium-Navigation", className)
|
12775
12948
|
}, props));
|
12776
12949
|
};
|
@@ -12784,11 +12957,11 @@ var Item6 = (_a) => {
|
|
12784
12957
|
"icon",
|
12785
12958
|
"showNotification"
|
12786
12959
|
]);
|
12787
|
-
return /* @__PURE__ */
|
12960
|
+
return /* @__PURE__ */ React89.createElement(Navigation.Item, __spreadValues({}, rest), icon && showNotification && /* @__PURE__ */ React89.createElement(Badge.Notification, null, /* @__PURE__ */ React89.createElement(InlineIcon, {
|
12788
12961
|
icon,
|
12789
12962
|
width: "20px",
|
12790
12963
|
height: "20px"
|
12791
|
-
})), icon && !showNotification && /* @__PURE__ */
|
12964
|
+
})), icon && !showNotification && /* @__PURE__ */ React89.createElement(InlineIcon, {
|
12792
12965
|
icon,
|
12793
12966
|
width: "20px",
|
12794
12967
|
height: "20px"
|
@@ -12801,32 +12974,32 @@ Navigation2.Header = Navigation.Header;
|
|
12801
12974
|
Navigation2.Section = Navigation.Section;
|
12802
12975
|
|
12803
12976
|
// src/molecules/PageHeader/PageHeader.tsx
|
12804
|
-
import
|
12805
|
-
import
|
12977
|
+
import React91 from "react";
|
12978
|
+
import castArray4 from "lodash/castArray";
|
12806
12979
|
|
12807
12980
|
// src/atoms/PageHeader/PageHeader.tsx
|
12808
|
-
import
|
12981
|
+
import React90 from "react";
|
12809
12982
|
var PageHeader = (_a) => {
|
12810
12983
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12811
|
-
return /* @__PURE__ */
|
12984
|
+
return /* @__PURE__ */ React90.createElement("div", __spreadValues({
|
12812
12985
|
className: classNames(tw("flex flex-row gap-4 pb-6"), className)
|
12813
12986
|
}, rest), children);
|
12814
12987
|
};
|
12815
12988
|
PageHeader.Container = (_a) => {
|
12816
12989
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12817
|
-
return /* @__PURE__ */
|
12990
|
+
return /* @__PURE__ */ React90.createElement("div", __spreadValues({
|
12818
12991
|
className: classNames(tw("flex flex-col grow gap-0"), className)
|
12819
12992
|
}, rest), children);
|
12820
12993
|
};
|
12821
12994
|
PageHeader.TitleContainer = (_a) => {
|
12822
12995
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12823
|
-
return /* @__PURE__ */
|
12996
|
+
return /* @__PURE__ */ React90.createElement("div", __spreadValues({
|
12824
12997
|
className: classNames(tw("flex flex-col justify-center gap-2"), className)
|
12825
12998
|
}, rest), children);
|
12826
12999
|
};
|
12827
13000
|
PageHeader.Title = (_a) => {
|
12828
13001
|
var _b = _a, { isSubHeader = false, children } = _b, rest = __objRest(_b, ["isSubHeader", "children"]);
|
12829
|
-
return /* @__PURE__ */
|
13002
|
+
return /* @__PURE__ */ React90.createElement(Typography2, __spreadProps(__spreadValues({}, rest), {
|
12830
13003
|
color: "grey-100",
|
12831
13004
|
variant: isSubHeader ? "subheading" : "heading",
|
12832
13005
|
htmlTag: isSubHeader ? "h2" : "h1"
|
@@ -12834,25 +13007,25 @@ PageHeader.Title = (_a) => {
|
|
12834
13007
|
};
|
12835
13008
|
PageHeader.Subtitle = (_a) => {
|
12836
13009
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
12837
|
-
return /* @__PURE__ */
|
13010
|
+
return /* @__PURE__ */ React90.createElement(Typography2.Small, __spreadProps(__spreadValues({}, rest), {
|
12838
13011
|
color: "grey-70"
|
12839
13012
|
}), children);
|
12840
13013
|
};
|
12841
13014
|
PageHeader.Chips = (_a) => {
|
12842
13015
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12843
|
-
return /* @__PURE__ */
|
13016
|
+
return /* @__PURE__ */ React90.createElement("div", __spreadValues({
|
12844
13017
|
className: classNames(tw("flex gap-3"), className)
|
12845
13018
|
}, rest), children);
|
12846
13019
|
};
|
12847
13020
|
PageHeader.Actions = (_a) => {
|
12848
13021
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12849
|
-
return /* @__PURE__ */
|
13022
|
+
return /* @__PURE__ */ React90.createElement("div", __spreadValues({
|
12850
13023
|
className: classNames(tw("flex flex-row gap-4 self-start"), className)
|
12851
13024
|
}, rest), children);
|
12852
13025
|
};
|
12853
13026
|
|
12854
13027
|
// src/molecules/PageHeader/PageHeader.tsx
|
12855
|
-
var
|
13028
|
+
var import_more5 = __toESM(require_more());
|
12856
13029
|
var CommonPageHeader = ({
|
12857
13030
|
title,
|
12858
13031
|
subtitle,
|
@@ -12870,63 +13043,63 @@ var CommonPageHeader = ({
|
|
12870
13043
|
onMenuOpenChange,
|
12871
13044
|
isSubHeader = false
|
12872
13045
|
}) => {
|
12873
|
-
return /* @__PURE__ */
|
13046
|
+
return /* @__PURE__ */ React91.createElement(PageHeader, {
|
12874
13047
|
className: "Aquarium-PageHeader"
|
12875
|
-
}, /* @__PURE__ */
|
13048
|
+
}, /* @__PURE__ */ React91.createElement(PageHeader.Container, null, breadcrumbs && /* @__PURE__ */ React91.createElement(Box, {
|
12876
13049
|
marginBottom: "3"
|
12877
|
-
}, /* @__PURE__ */
|
13050
|
+
}, /* @__PURE__ */ React91.createElement(Breadcrumbs, null, breadcrumbs)), /* @__PURE__ */ React91.createElement(Spacing, {
|
12878
13051
|
row: true,
|
12879
13052
|
gap: "5"
|
12880
|
-
}, image && /* @__PURE__ */
|
13053
|
+
}, image && /* @__PURE__ */ React91.createElement("img", {
|
12881
13054
|
src: image,
|
12882
13055
|
alt: imageAlt != null ? imageAlt : "",
|
12883
13056
|
className: tw("w-[56px] h-[56px]")
|
12884
|
-
}), /* @__PURE__ */
|
13057
|
+
}), /* @__PURE__ */ React91.createElement(PageHeader.TitleContainer, null, /* @__PURE__ */ React91.createElement(PageHeader.Title, {
|
12885
13058
|
isSubHeader
|
12886
|
-
}, title), chips.length > 0 && /* @__PURE__ */
|
13059
|
+
}, title), chips.length > 0 && /* @__PURE__ */ React91.createElement(PageHeader.Chips, null, chips.map((chip) => /* @__PURE__ */ React91.createElement(Chip2, {
|
12887
13060
|
key: chip,
|
12888
13061
|
dense: true,
|
12889
13062
|
text: chip
|
12890
|
-
}))), subtitle && /* @__PURE__ */
|
13063
|
+
}))), subtitle && /* @__PURE__ */ React91.createElement(PageHeader.Subtitle, null, subtitle)))), (secondaryActions || primaryAction || secondaryAction || menu) && /* @__PURE__ */ React91.createElement(PageHeader.Actions, null, menu && /* @__PURE__ */ React91.createElement(Box.Flex, {
|
12891
13064
|
alignItems: "center"
|
12892
|
-
}, /* @__PURE__ */
|
13065
|
+
}, /* @__PURE__ */ React91.createElement(DropdownMenu2, {
|
12893
13066
|
onAction: (action) => onAction == null ? void 0 : onAction(action),
|
12894
13067
|
onOpenChange: onMenuOpenChange
|
12895
|
-
}, /* @__PURE__ */
|
13068
|
+
}, /* @__PURE__ */ React91.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ React91.createElement(Button.Icon, {
|
12896
13069
|
"aria-label": menuAriaLabel,
|
12897
|
-
icon:
|
12898
|
-
})), menu)), secondaryActions &&
|
13070
|
+
icon: import_more5.default
|
13071
|
+
})), menu)), secondaryActions && castArray4(secondaryActions).filter(Boolean).map((secondaryAction2) => renderAction({ kind: "secondary", action: secondaryAction2 })), primaryAction && renderAction({ kind: "primary", action: primaryAction })));
|
12899
13072
|
};
|
12900
|
-
var PageHeader2 = (props) => /* @__PURE__ */
|
13073
|
+
var PageHeader2 = (props) => /* @__PURE__ */ React91.createElement(CommonPageHeader, __spreadValues({}, props));
|
12901
13074
|
PageHeader2.displayName = "PageHeader";
|
12902
|
-
var SubHeader = (props) => /* @__PURE__ */
|
13075
|
+
var SubHeader = (props) => /* @__PURE__ */ React91.createElement(CommonPageHeader, __spreadProps(__spreadValues({}, props), {
|
12903
13076
|
isSubHeader: true
|
12904
13077
|
}));
|
12905
13078
|
PageHeader2.SubHeader = SubHeader;
|
12906
13079
|
PageHeader2.SubHeader.displayName = "PageHeader.SubHeader";
|
12907
13080
|
|
12908
13081
|
// src/molecules/PopoverDialog/PopoverDialog.tsx
|
12909
|
-
import
|
12910
|
-
import
|
13082
|
+
import React93 from "react";
|
13083
|
+
import omit15 from "lodash/omit";
|
12911
13084
|
|
12912
13085
|
// src/atoms/PopoverDialog/PopoverDialog.tsx
|
12913
|
-
import
|
13086
|
+
import React92 from "react";
|
12914
13087
|
var Header2 = (_a) => {
|
12915
13088
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12916
|
-
return /* @__PURE__ */
|
13089
|
+
return /* @__PURE__ */ React92.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12917
13090
|
className: classNames(tw("p-5 gap-3 flex items-center"), className)
|
12918
13091
|
}), children);
|
12919
13092
|
};
|
12920
13093
|
var Title2 = (_a) => {
|
12921
13094
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12922
|
-
return /* @__PURE__ */
|
13095
|
+
return /* @__PURE__ */ React92.createElement(Typography, __spreadProps(__spreadValues({}, rest), {
|
12923
13096
|
htmlTag: "h1",
|
12924
13097
|
variant: "small-strong"
|
12925
13098
|
}), children);
|
12926
13099
|
};
|
12927
13100
|
var Body = (_a) => {
|
12928
13101
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12929
|
-
return /* @__PURE__ */
|
13102
|
+
return /* @__PURE__ */ React92.createElement(Typography, __spreadProps(__spreadValues({}, rest), {
|
12930
13103
|
htmlTag: "div",
|
12931
13104
|
variant: "caption",
|
12932
13105
|
className: classNames(tw("px-5 overflow-y-auto"), className)
|
@@ -12934,13 +13107,13 @@ var Body = (_a) => {
|
|
12934
13107
|
};
|
12935
13108
|
var Footer2 = (_a) => {
|
12936
13109
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12937
|
-
return /* @__PURE__ */
|
13110
|
+
return /* @__PURE__ */ React92.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12938
13111
|
className: classNames(tw("p-5"), className)
|
12939
13112
|
}), children);
|
12940
13113
|
};
|
12941
13114
|
var Actions2 = (_a) => {
|
12942
13115
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12943
|
-
return /* @__PURE__ */
|
13116
|
+
return /* @__PURE__ */ React92.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12944
13117
|
className: classNames(tw("flex gap-4"), className)
|
12945
13118
|
}), children);
|
12946
13119
|
};
|
@@ -12956,29 +13129,29 @@ var PopoverDialog = {
|
|
12956
13129
|
var PopoverDialog2 = ({ placement, open, title, secondaryAction, primaryAction, children }) => {
|
12957
13130
|
const wrapPromptWithBody = (child) => {
|
12958
13131
|
if (isComponentType(child, PopoverDialog2.Prompt)) {
|
12959
|
-
return /* @__PURE__ */
|
13132
|
+
return /* @__PURE__ */ React93.createElement(Popover2.Panel, {
|
12960
13133
|
className: classNames("Aquarium-PopoverDialog", tw("max-w-[300px]"))
|
12961
|
-
}, /* @__PURE__ */
|
13134
|
+
}, /* @__PURE__ */ React93.createElement(PopoverDialog.Header, null, /* @__PURE__ */ React93.createElement(PopoverDialog.Title, null, title)), child, /* @__PURE__ */ React93.createElement(PopoverDialog.Footer, null, /* @__PURE__ */ React93.createElement(PopoverDialog.Actions, null, secondaryAction && /* @__PURE__ */ React93.createElement(Popover2.Button, __spreadValues({
|
12962
13135
|
kind: "secondary-ghost",
|
12963
13136
|
key: secondaryAction.text,
|
12964
13137
|
dense: true
|
12965
|
-
},
|
13138
|
+
}, omit15(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */ React93.createElement(Popover2.Button, __spreadValues({
|
12966
13139
|
kind: "ghost",
|
12967
13140
|
key: primaryAction.text,
|
12968
13141
|
dense: true
|
12969
|
-
},
|
13142
|
+
}, omit15(primaryAction, "text")), primaryAction.text))));
|
12970
13143
|
}
|
12971
13144
|
return child;
|
12972
13145
|
};
|
12973
|
-
return /* @__PURE__ */
|
13146
|
+
return /* @__PURE__ */ React93.createElement(Popover2, {
|
12974
13147
|
type: "dialog",
|
12975
13148
|
isOpen: open,
|
12976
13149
|
placement,
|
12977
13150
|
containFocus: true
|
12978
|
-
},
|
13151
|
+
}, React93.Children.map(children, wrapPromptWithBody));
|
12979
13152
|
};
|
12980
13153
|
PopoverDialog2.Trigger = Popover2.Trigger;
|
12981
|
-
var Prompt = ({ children }) => /* @__PURE__ */
|
13154
|
+
var Prompt = ({ children }) => /* @__PURE__ */ React93.createElement(PopoverDialog.Body, null, children);
|
12982
13155
|
Prompt.displayName = "PopoverDialog.Prompt";
|
12983
13156
|
PopoverDialog2.Prompt = Prompt;
|
12984
13157
|
|
@@ -12987,14 +13160,14 @@ import { createPortal } from "react-dom";
|
|
12987
13160
|
var Portal = ({ children, to }) => createPortal(children, to);
|
12988
13161
|
|
12989
13162
|
// src/molecules/ProgressBar/ProgressBar.tsx
|
12990
|
-
import
|
13163
|
+
import React95 from "react";
|
12991
13164
|
|
12992
13165
|
// src/atoms/ProgressBar/ProgressBar.tsx
|
12993
|
-
import
|
13166
|
+
import React94 from "react";
|
12994
13167
|
import clamp3 from "lodash/clamp";
|
12995
13168
|
var ProgressBar = (_a) => {
|
12996
13169
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12997
|
-
return /* @__PURE__ */
|
13170
|
+
return /* @__PURE__ */ React94.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12998
13171
|
className: classNames(
|
12999
13172
|
tw("relative flex items-center w-full bg-grey-0 h-2 rounded-full overflow-hidden"),
|
13000
13173
|
className
|
@@ -13010,7 +13183,7 @@ var STATUS_COLORS = {
|
|
13010
13183
|
ProgressBar.Indicator = (_a) => {
|
13011
13184
|
var _b = _a, { min, max, value, "aria-label": ariaLabel, status, className } = _b, rest = __objRest(_b, ["min", "max", "value", "aria-label", "status", "className"]);
|
13012
13185
|
const completedPercentage = clamp3((value - min) / (max - min) * 100, 0, 100);
|
13013
|
-
return /* @__PURE__ */
|
13186
|
+
return /* @__PURE__ */ React94.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13014
13187
|
className: classNames(
|
13015
13188
|
tw("h-2 rounded-full transition-all ease-in-out delay-150"),
|
13016
13189
|
STATUS_COLORS[status],
|
@@ -13026,11 +13199,11 @@ ProgressBar.Indicator = (_a) => {
|
|
13026
13199
|
};
|
13027
13200
|
ProgressBar.Labels = (_a) => {
|
13028
13201
|
var _b = _a, { children, startLabel, endLabel, className } = _b, rest = __objRest(_b, ["children", "startLabel", "endLabel", "className"]);
|
13029
|
-
return /* @__PURE__ */
|
13202
|
+
return /* @__PURE__ */ React94.createElement("div", {
|
13030
13203
|
className: classNames(tw("flex flex-row"), className)
|
13031
|
-
}, /* @__PURE__ */
|
13204
|
+
}, /* @__PURE__ */ React94.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
13032
13205
|
className: tw("grow text-grey-70 typography-caption")
|
13033
|
-
}), startLabel), /* @__PURE__ */
|
13206
|
+
}), startLabel), /* @__PURE__ */ React94.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
13034
13207
|
className: tw("grow text-grey-70 typography-caption text-right")
|
13035
13208
|
}), endLabel));
|
13036
13209
|
};
|
@@ -13048,7 +13221,7 @@ var ProgressBar2 = (props) => {
|
|
13048
13221
|
if (min > max) {
|
13049
13222
|
throw new Error("`min` value provided to `ProgressBar` is greater than `max` value.");
|
13050
13223
|
}
|
13051
|
-
const progress = /* @__PURE__ */
|
13224
|
+
const progress = /* @__PURE__ */ React95.createElement(ProgressBar, null, /* @__PURE__ */ React95.createElement(ProgressBar.Indicator, {
|
13052
13225
|
status: value === max ? completedStatus : progresStatus,
|
13053
13226
|
min,
|
13054
13227
|
max,
|
@@ -13058,15 +13231,15 @@ var ProgressBar2 = (props) => {
|
|
13058
13231
|
if (props.dense) {
|
13059
13232
|
return progress;
|
13060
13233
|
}
|
13061
|
-
return /* @__PURE__ */
|
13234
|
+
return /* @__PURE__ */ React95.createElement("div", {
|
13062
13235
|
className: "Aquarium-ProgressBar"
|
13063
|
-
}, progress, /* @__PURE__ */
|
13236
|
+
}, progress, /* @__PURE__ */ React95.createElement(ProgressBar.Labels, {
|
13064
13237
|
className: tw("py-2"),
|
13065
13238
|
startLabel: props.startLabel,
|
13066
13239
|
endLabel: props.endLabel
|
13067
13240
|
}));
|
13068
13241
|
};
|
13069
|
-
var ProgressBarSkeleton = () => /* @__PURE__ */
|
13242
|
+
var ProgressBarSkeleton = () => /* @__PURE__ */ React95.createElement(Skeleton, {
|
13070
13243
|
height: 4,
|
13071
13244
|
display: "block"
|
13072
13245
|
});
|
@@ -13074,13 +13247,13 @@ ProgressBar2.Skeleton = ProgressBarSkeleton;
|
|
13074
13247
|
ProgressBar2.Skeleton.displayName = "ProgressBar.Skeleton";
|
13075
13248
|
|
13076
13249
|
// src/molecules/RadioButton/RadioButton.tsx
|
13077
|
-
import
|
13078
|
-
var RadioButton2 =
|
13250
|
+
import React96 from "react";
|
13251
|
+
var RadioButton2 = React96.forwardRef(
|
13079
13252
|
(_a, ref) => {
|
13080
13253
|
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"]);
|
13081
13254
|
var _a2;
|
13082
13255
|
const isChecked = (_a2 = props.checked) != null ? _a2 : props.defaultChecked;
|
13083
|
-
return !readOnly || isChecked ? /* @__PURE__ */
|
13256
|
+
return !readOnly || isChecked ? /* @__PURE__ */ React96.createElement(ControlLabel, {
|
13084
13257
|
htmlFor: id,
|
13085
13258
|
label: children,
|
13086
13259
|
"aria-label": ariaLabel,
|
@@ -13089,7 +13262,7 @@ var RadioButton2 = React95.forwardRef(
|
|
13089
13262
|
disabled,
|
13090
13263
|
style: { gap: "0 8px" },
|
13091
13264
|
className: "Aquarium-RadioButton"
|
13092
|
-
}, !readOnly && /* @__PURE__ */
|
13265
|
+
}, !readOnly && /* @__PURE__ */ React96.createElement(RadioButton, __spreadProps(__spreadValues({
|
13093
13266
|
id,
|
13094
13267
|
ref,
|
13095
13268
|
name
|
@@ -13100,12 +13273,12 @@ var RadioButton2 = React95.forwardRef(
|
|
13100
13273
|
}
|
13101
13274
|
);
|
13102
13275
|
RadioButton2.displayName = "RadioButton";
|
13103
|
-
var RadioButtonSkeleton = () => /* @__PURE__ */
|
13276
|
+
var RadioButtonSkeleton = () => /* @__PURE__ */ React96.createElement("div", {
|
13104
13277
|
className: tw("flex gap-3")
|
13105
|
-
}, /* @__PURE__ */
|
13278
|
+
}, /* @__PURE__ */ React96.createElement(Skeleton, {
|
13106
13279
|
height: 20,
|
13107
13280
|
width: 20
|
13108
|
-
}), /* @__PURE__ */
|
13281
|
+
}), /* @__PURE__ */ React96.createElement(Skeleton, {
|
13109
13282
|
height: 20,
|
13110
13283
|
width: 150
|
13111
13284
|
}));
|
@@ -13113,10 +13286,10 @@ RadioButton2.Skeleton = RadioButtonSkeleton;
|
|
13113
13286
|
RadioButton2.Skeleton.displayName = "RadioButton.Skeleton";
|
13114
13287
|
|
13115
13288
|
// src/molecules/RadioButtonGroup/RadioButtonGroup.tsx
|
13116
|
-
import
|
13117
|
-
import { useId as
|
13289
|
+
import React97 from "react";
|
13290
|
+
import { useId as useId14 } from "@react-aria/utils";
|
13118
13291
|
var isRadioButton = (c) => {
|
13119
|
-
return
|
13292
|
+
return React97.isValidElement(c) && c.type === RadioButton2;
|
13120
13293
|
};
|
13121
13294
|
var RadioButtonGroup = (_a) => {
|
13122
13295
|
var _b = _a, {
|
@@ -13139,8 +13312,8 @@ var RadioButtonGroup = (_a) => {
|
|
13139
13312
|
"children"
|
13140
13313
|
]);
|
13141
13314
|
var _a2;
|
13142
|
-
const [value, setValue] =
|
13143
|
-
const errorMessageId =
|
13315
|
+
const [value, setValue] = React97.useState((_a2 = _value != null ? _value : defaultValue) != null ? _a2 : "");
|
13316
|
+
const errorMessageId = useId14();
|
13144
13317
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
13145
13318
|
const labelControlProps = getLabelControlProps(props);
|
13146
13319
|
if (_value !== void 0 && _value !== value) {
|
@@ -13150,14 +13323,14 @@ var RadioButtonGroup = (_a) => {
|
|
13150
13323
|
setValue(e.target.value);
|
13151
13324
|
onChange == null ? void 0 : onChange(e.target.value);
|
13152
13325
|
};
|
13153
|
-
const content =
|
13326
|
+
const content = React97.Children.map(children, (c) => {
|
13154
13327
|
var _a3, _b2, _c;
|
13155
13328
|
if (!isRadioButton(c)) {
|
13156
13329
|
return null;
|
13157
13330
|
}
|
13158
13331
|
const defaultChecked = defaultValue === void 0 ? void 0 : c.props.value === defaultValue;
|
13159
13332
|
const checked = value === void 0 ? void 0 : c.props.value === value;
|
13160
|
-
return
|
13333
|
+
return React97.cloneElement(c, {
|
13161
13334
|
name,
|
13162
13335
|
defaultChecked: (_a3 = c.props.defaultChecked) != null ? _a3 : defaultChecked,
|
13163
13336
|
checked: (_b2 = c.props.checked) != null ? _b2 : checked,
|
@@ -13166,13 +13339,13 @@ var RadioButtonGroup = (_a) => {
|
|
13166
13339
|
readOnly
|
13167
13340
|
});
|
13168
13341
|
});
|
13169
|
-
return /* @__PURE__ */
|
13342
|
+
return /* @__PURE__ */ React97.createElement(LabelControl, __spreadProps(__spreadValues(__spreadValues({
|
13170
13343
|
fieldset: true
|
13171
13344
|
}, labelControlProps), errorProps), {
|
13172
13345
|
className: "Aquarium-RadioButtonGroup"
|
13173
|
-
}), cols && /* @__PURE__ */
|
13346
|
+
}), cols && /* @__PURE__ */ React97.createElement(InputGroup, {
|
13174
13347
|
cols
|
13175
|
-
}, content), !cols && /* @__PURE__ */
|
13348
|
+
}, content), !cols && /* @__PURE__ */ React97.createElement(Flexbox, {
|
13176
13349
|
direction,
|
13177
13350
|
alignItems: "flex-start",
|
13178
13351
|
colGap: "8",
|
@@ -13181,12 +13354,12 @@ var RadioButtonGroup = (_a) => {
|
|
13181
13354
|
}, content));
|
13182
13355
|
};
|
13183
13356
|
var RadioButtonGroupSkeleton = ({ direction = "row", options = 2 }) => {
|
13184
|
-
return /* @__PURE__ */
|
13357
|
+
return /* @__PURE__ */ React97.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React97.createElement("div", {
|
13185
13358
|
className: tw("flex flex-wrap", {
|
13186
13359
|
"flex-row gap-8": direction === "row",
|
13187
13360
|
"flex-col gap-2": direction === "column"
|
13188
13361
|
})
|
13189
|
-
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */
|
13362
|
+
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */ React97.createElement(RadioButton2.Skeleton, {
|
13190
13363
|
key
|
13191
13364
|
}))));
|
13192
13365
|
};
|
@@ -13194,24 +13367,24 @@ RadioButtonGroup.Skeleton = RadioButtonGroupSkeleton;
|
|
13194
13367
|
RadioButtonGroup.Skeleton.displayName = "RadioButtonGroup.Skeleton";
|
13195
13368
|
|
13196
13369
|
// src/molecules/Section/Section.tsx
|
13197
|
-
import
|
13198
|
-
import { useId as
|
13199
|
-
import { animated as
|
13200
|
-
import
|
13370
|
+
import React102 from "react";
|
13371
|
+
import { useId as useId15 } from "@react-aria/utils";
|
13372
|
+
import { animated as animated5, useSpring as useSpring4 } from "@react-spring/web";
|
13373
|
+
import castArray5 from "lodash/castArray";
|
13201
13374
|
import isUndefined9 from "lodash/isUndefined";
|
13202
13375
|
|
13203
13376
|
// src/molecules/Switch/Switch.tsx
|
13204
|
-
import
|
13377
|
+
import React99 from "react";
|
13205
13378
|
|
13206
13379
|
// src/atoms/Switch/Switch.tsx
|
13207
|
-
import
|
13380
|
+
import React98 from "react";
|
13208
13381
|
var import_ban2 = __toESM(require_ban());
|
13209
|
-
var Switch =
|
13382
|
+
var Switch = React98.forwardRef(
|
13210
13383
|
(_a, ref) => {
|
13211
13384
|
var _b = _a, { id, children, name, disabled = false, readOnly = false } = _b, props = __objRest(_b, ["id", "children", "name", "disabled", "readOnly"]);
|
13212
|
-
return /* @__PURE__ */
|
13385
|
+
return /* @__PURE__ */ React98.createElement("span", {
|
13213
13386
|
className: tw("relative inline-flex justify-center items-center self-center group")
|
13214
|
-
}, /* @__PURE__ */
|
13387
|
+
}, /* @__PURE__ */ React98.createElement("input", __spreadProps(__spreadValues({
|
13215
13388
|
id,
|
13216
13389
|
ref,
|
13217
13390
|
type: "checkbox",
|
@@ -13230,7 +13403,7 @@ var Switch = React97.forwardRef(
|
|
13230
13403
|
),
|
13231
13404
|
readOnly,
|
13232
13405
|
disabled
|
13233
|
-
})), /* @__PURE__ */
|
13406
|
+
})), /* @__PURE__ */ React98.createElement("span", {
|
13234
13407
|
className: tw(
|
13235
13408
|
"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",
|
13236
13409
|
"bg-white left-2 peer-checked/switch:left-1 text-grey-30 peer-checked/switch:text-primary-60",
|
@@ -13238,7 +13411,7 @@ var Switch = React97.forwardRef(
|
|
13238
13411
|
"shadow-4dp": !disabled
|
13239
13412
|
}
|
13240
13413
|
)
|
13241
|
-
}, disabled && /* @__PURE__ */
|
13414
|
+
}, disabled && /* @__PURE__ */ React98.createElement(Icon, {
|
13242
13415
|
icon: import_ban2.default,
|
13243
13416
|
width: "10px",
|
13244
13417
|
height: "10px"
|
@@ -13247,7 +13420,7 @@ var Switch = React97.forwardRef(
|
|
13247
13420
|
);
|
13248
13421
|
|
13249
13422
|
// src/molecules/Switch/Switch.tsx
|
13250
|
-
var Switch2 =
|
13423
|
+
var Switch2 = React99.forwardRef(
|
13251
13424
|
(_a, ref) => {
|
13252
13425
|
var _b = _a, {
|
13253
13426
|
id,
|
@@ -13270,7 +13443,7 @@ var Switch2 = React98.forwardRef(
|
|
13270
13443
|
]);
|
13271
13444
|
var _a2;
|
13272
13445
|
const isChecked = (_a2 = props.checked) != null ? _a2 : props.defaultChecked;
|
13273
|
-
return !readOnly || isChecked ? /* @__PURE__ */
|
13446
|
+
return !readOnly || isChecked ? /* @__PURE__ */ React99.createElement(ControlLabel, {
|
13274
13447
|
htmlFor: id,
|
13275
13448
|
label: children,
|
13276
13449
|
"aria-label": ariaLabel,
|
@@ -13280,7 +13453,7 @@ var Switch2 = React98.forwardRef(
|
|
13280
13453
|
style: { gap: "0 8px" },
|
13281
13454
|
labelPlacement,
|
13282
13455
|
className: "Aquarium-Switch"
|
13283
|
-
}, !readOnly && /* @__PURE__ */
|
13456
|
+
}, !readOnly && /* @__PURE__ */ React99.createElement(Switch, __spreadProps(__spreadValues({
|
13284
13457
|
id,
|
13285
13458
|
ref,
|
13286
13459
|
name
|
@@ -13291,12 +13464,12 @@ var Switch2 = React98.forwardRef(
|
|
13291
13464
|
}
|
13292
13465
|
);
|
13293
13466
|
Switch2.displayName = "Switch";
|
13294
|
-
var SwitchSkeleton = () => /* @__PURE__ */
|
13467
|
+
var SwitchSkeleton = () => /* @__PURE__ */ React99.createElement("div", {
|
13295
13468
|
className: tw("flex gap-3")
|
13296
|
-
}, /* @__PURE__ */
|
13469
|
+
}, /* @__PURE__ */ React99.createElement(Skeleton, {
|
13297
13470
|
height: 20,
|
13298
13471
|
width: 35
|
13299
|
-
}), /* @__PURE__ */
|
13472
|
+
}), /* @__PURE__ */ React99.createElement(Skeleton, {
|
13300
13473
|
height: 20,
|
13301
13474
|
width: 150
|
13302
13475
|
}));
|
@@ -13304,7 +13477,7 @@ Switch2.Skeleton = SwitchSkeleton;
|
|
13304
13477
|
Switch2.Skeleton.displayName = "Switch.Skeleton ";
|
13305
13478
|
|
13306
13479
|
// src/molecules/TagLabel/TagLabel.tsx
|
13307
|
-
import
|
13480
|
+
import React100 from "react";
|
13308
13481
|
var getVariantClassNames = (variant = "primary") => {
|
13309
13482
|
switch (variant) {
|
13310
13483
|
case "danger":
|
@@ -13318,7 +13491,7 @@ var getVariantClassNames = (variant = "primary") => {
|
|
13318
13491
|
};
|
13319
13492
|
var TagLabel = (_a) => {
|
13320
13493
|
var _b = _a, { title, dense = false, variant } = _b, rest = __objRest(_b, ["title", "dense", "variant"]);
|
13321
|
-
return /* @__PURE__ */
|
13494
|
+
return /* @__PURE__ */ React100.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
13322
13495
|
className: classNames(
|
13323
13496
|
"Aquarium-TagLabel",
|
13324
13497
|
getVariantClassNames(variant),
|
@@ -13331,11 +13504,11 @@ var TagLabel = (_a) => {
|
|
13331
13504
|
};
|
13332
13505
|
|
13333
13506
|
// src/atoms/Section/Section.tsx
|
13334
|
-
import
|
13507
|
+
import React101 from "react";
|
13335
13508
|
var import_caretUp2 = __toESM(require_caretUp());
|
13336
13509
|
var Section3 = (_a) => {
|
13337
13510
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
13338
|
-
return /* @__PURE__ */
|
13511
|
+
return /* @__PURE__ */ React101.createElement(Box, __spreadValues({
|
13339
13512
|
component: "section",
|
13340
13513
|
borderColor: "grey-5",
|
13341
13514
|
borderWidth: "1px"
|
@@ -13343,7 +13516,7 @@ var Section3 = (_a) => {
|
|
13343
13516
|
};
|
13344
13517
|
Section3.Header = (_a) => {
|
13345
13518
|
var _b = _a, { children, className, expanded } = _b, rest = __objRest(_b, ["children", "className", "expanded"]);
|
13346
|
-
return /* @__PURE__ */
|
13519
|
+
return /* @__PURE__ */ React101.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13347
13520
|
className: classNames(
|
13348
13521
|
tw("px-6 flex gap-5 justify-between items-center h-[72px]", { "bg-grey-0": expanded }),
|
13349
13522
|
className
|
@@ -13352,21 +13525,21 @@ Section3.Header = (_a) => {
|
|
13352
13525
|
};
|
13353
13526
|
Section3.TitleContainer = (_a) => {
|
13354
13527
|
var _b = _a, { children, className, collapsible } = _b, rest = __objRest(_b, ["children", "className", "collapsible"]);
|
13355
|
-
return /* @__PURE__ */
|
13528
|
+
return /* @__PURE__ */ React101.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13356
13529
|
className: classNames(
|
13357
13530
|
tw("grow grid grid-cols-[auto_1fr] gap-x-3 items-center", { "cursor-pointer": collapsible }),
|
13358
13531
|
className
|
13359
13532
|
)
|
13360
13533
|
}), children);
|
13361
13534
|
};
|
13362
|
-
Section3.Toggle = (props) => /* @__PURE__ */
|
13535
|
+
Section3.Toggle = (props) => /* @__PURE__ */ React101.createElement(Icon, __spreadProps(__spreadValues({}, props), {
|
13363
13536
|
icon: import_caretUp2.default,
|
13364
13537
|
height: 22,
|
13365
13538
|
width: 22
|
13366
13539
|
}));
|
13367
13540
|
Section3.Title = (_a) => {
|
13368
13541
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
13369
|
-
return /* @__PURE__ */
|
13542
|
+
return /* @__PURE__ */ React101.createElement(Typography2.Large, __spreadProps(__spreadValues({}, rest), {
|
13370
13543
|
htmlTag: "h2",
|
13371
13544
|
color: "black",
|
13372
13545
|
className: "flex gap-3 items-center"
|
@@ -13374,35 +13547,35 @@ Section3.Title = (_a) => {
|
|
13374
13547
|
};
|
13375
13548
|
Section3.Subtitle = (_a) => {
|
13376
13549
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
13377
|
-
return /* @__PURE__ */
|
13550
|
+
return /* @__PURE__ */ React101.createElement(Typography2.Small, __spreadProps(__spreadValues({}, rest), {
|
13378
13551
|
color: "grey-70"
|
13379
13552
|
}), children);
|
13380
13553
|
};
|
13381
13554
|
Section3.Actions = (_a) => {
|
13382
13555
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
13383
|
-
return /* @__PURE__ */
|
13556
|
+
return /* @__PURE__ */ React101.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13384
13557
|
className: classNames(tw("flex gap-4 justify-end"), className)
|
13385
13558
|
}), children);
|
13386
13559
|
};
|
13387
13560
|
Section3.Body = (_a) => {
|
13388
13561
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
13389
|
-
return /* @__PURE__ */
|
13562
|
+
return /* @__PURE__ */ React101.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13390
13563
|
className: classNames(tw("p-6"), className)
|
13391
|
-
}), /* @__PURE__ */
|
13564
|
+
}), /* @__PURE__ */ React101.createElement(Typography, {
|
13392
13565
|
htmlTag: "div",
|
13393
13566
|
color: "grey-70"
|
13394
13567
|
}, children));
|
13395
13568
|
};
|
13396
13569
|
|
13397
13570
|
// src/molecules/Section/Section.tsx
|
13398
|
-
var
|
13571
|
+
var import_more6 = __toESM(require_more());
|
13399
13572
|
var Section4 = (props) => {
|
13400
13573
|
var _a, _b, _c, _d, _e;
|
13401
13574
|
const { title, subtitle, children } = props;
|
13402
13575
|
const _collapsible = title ? (_a = props.collapsible) != null ? _a : false : false;
|
13403
13576
|
const _collapsed = title ? props.collapsed : void 0;
|
13404
13577
|
const _defaultCollapsed = title ? (_b = props.defaultCollapsed) != null ? _b : false : false;
|
13405
|
-
const [isCollapsed, setCollapsed] =
|
13578
|
+
const [isCollapsed, setCollapsed] = React102.useState(_collapsed != null ? _collapsed : _defaultCollapsed);
|
13406
13579
|
const [ref, { height }] = useMeasure();
|
13407
13580
|
const menu = title ? (_c = props.menu) != null ? _c : void 0 : void 0;
|
13408
13581
|
const menuAriaLabel = title ? (_e = (_d = props.menuAriaLabel) != null ? _d : props.menuLabel) != null ? _e : "Context menu" : void 0;
|
@@ -13423,7 +13596,7 @@ var Section4 = (props) => {
|
|
13423
13596
|
}
|
13424
13597
|
};
|
13425
13598
|
const targetHeight = isCollapsed ? "0px" : `${height != null ? height : 0}px`;
|
13426
|
-
const _f =
|
13599
|
+
const _f = useSpring4({
|
13427
13600
|
height: height !== null ? targetHeight : void 0,
|
13428
13601
|
opacity: isCollapsed ? 0 : 1,
|
13429
13602
|
transform: `rotate(${isCollapsed ? 180 : 0}deg)`,
|
@@ -13433,58 +13606,58 @@ var Section4 = (props) => {
|
|
13433
13606
|
},
|
13434
13607
|
immediate: !_collapsible
|
13435
13608
|
}), { transform, backgroundColor } = _f, spring = __objRest(_f, ["transform", "backgroundColor"]);
|
13436
|
-
const toggleId =
|
13437
|
-
const regionId =
|
13438
|
-
const titleId =
|
13439
|
-
return /* @__PURE__ */
|
13609
|
+
const toggleId = useId15();
|
13610
|
+
const regionId = useId15();
|
13611
|
+
const titleId = useId15();
|
13612
|
+
return /* @__PURE__ */ React102.createElement(Section3, {
|
13440
13613
|
"aria-label": title,
|
13441
13614
|
className: "Aquarium-Section"
|
13442
|
-
}, title && /* @__PURE__ */
|
13615
|
+
}, title && /* @__PURE__ */ React102.createElement(React102.Fragment, null, /* @__PURE__ */ React102.createElement(Section3.Header, {
|
13443
13616
|
expanded: _collapsible && !isCollapsed
|
13444
|
-
}, /* @__PURE__ */
|
13617
|
+
}, /* @__PURE__ */ React102.createElement(Section3.TitleContainer, {
|
13445
13618
|
role: _collapsible ? "button" : void 0,
|
13446
13619
|
id: toggleId,
|
13447
13620
|
collapsible: _collapsible,
|
13448
13621
|
onClick: handleTitleClick,
|
13449
13622
|
"aria-expanded": _collapsible ? !isCollapsed : void 0,
|
13450
13623
|
"aria-controls": _collapsible ? regionId : void 0
|
13451
|
-
}, _collapsible && /* @__PURE__ */
|
13624
|
+
}, _collapsible && /* @__PURE__ */ React102.createElement(animated5.div, {
|
13452
13625
|
style: { transform }
|
13453
|
-
}, /* @__PURE__ */
|
13626
|
+
}, /* @__PURE__ */ React102.createElement(Section3.Toggle, null)), /* @__PURE__ */ React102.createElement(Section3.Title, {
|
13454
13627
|
id: titleId
|
13455
|
-
}, /* @__PURE__ */
|
13628
|
+
}, /* @__PURE__ */ React102.createElement(LineClamp2, {
|
13456
13629
|
lines: 1
|
13457
|
-
}, title), props.tag && /* @__PURE__ */
|
13630
|
+
}, title), props.tag && /* @__PURE__ */ React102.createElement(TagLabel, __spreadValues({}, props.tag)), props.badge && /* @__PURE__ */ React102.createElement(Chip2, {
|
13458
13631
|
text: props.badge
|
13459
|
-
}), props.chip && /* @__PURE__ */
|
13632
|
+
}), props.chip && /* @__PURE__ */ React102.createElement(StatusChip, __spreadValues({}, props.chip))), subtitle && /* @__PURE__ */ React102.createElement(Section3.Subtitle, {
|
13460
13633
|
className: tw("row-start-2", { "col-start-2": _collapsible })
|
13461
|
-
}, /* @__PURE__ */
|
13634
|
+
}, /* @__PURE__ */ React102.createElement(LineClamp2, {
|
13462
13635
|
lines: 1
|
13463
|
-
}, subtitle))), !isCollapsed && /* @__PURE__ */
|
13636
|
+
}, subtitle))), !isCollapsed && /* @__PURE__ */ React102.createElement(Section3.Actions, null, menu && /* @__PURE__ */ React102.createElement(Box.Flex, {
|
13464
13637
|
alignItems: "center"
|
13465
|
-
}, /* @__PURE__ */
|
13638
|
+
}, /* @__PURE__ */ React102.createElement(DropdownMenu2, {
|
13466
13639
|
onAction: (action) => onAction == null ? void 0 : onAction(action),
|
13467
13640
|
onOpenChange: onMenuOpenChange
|
13468
|
-
}, /* @__PURE__ */
|
13641
|
+
}, /* @__PURE__ */ React102.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ React102.createElement(Button.Icon, {
|
13469
13642
|
"aria-label": menuAriaLabel,
|
13470
|
-
icon:
|
13471
|
-
})), menu)), props.actions &&
|
13643
|
+
icon: import_more6.default
|
13644
|
+
})), menu)), props.actions && castArray5(props.actions).filter(Boolean).map((action) => renderAction({ kind: "secondary", action })), props.switch && /* @__PURE__ */ React102.createElement(Switch2, __spreadValues({}, props.switch)), props.select && /* @__PURE__ */ React102.createElement(SelectBase, __spreadValues({
|
13472
13645
|
"aria-labelledby": titleId
|
13473
|
-
}, props.select)))), /* @__PURE__ */
|
13646
|
+
}, props.select)))), /* @__PURE__ */ React102.createElement(animated5.div, {
|
13474
13647
|
className: tw(`h-[1px]`),
|
13475
13648
|
style: { backgroundColor }
|
13476
|
-
})), /* @__PURE__ */
|
13649
|
+
})), /* @__PURE__ */ React102.createElement(animated5.div, {
|
13477
13650
|
id: regionId,
|
13478
13651
|
"aria-hidden": _collapsible ? isCollapsed ? true : void 0 : void 0,
|
13479
13652
|
style: spring,
|
13480
13653
|
className: tw({ "overflow-hidden": _collapsible })
|
13481
|
-
}, /* @__PURE__ */
|
13654
|
+
}, /* @__PURE__ */ React102.createElement("div", {
|
13482
13655
|
ref
|
13483
|
-
}, /* @__PURE__ */
|
13656
|
+
}, /* @__PURE__ */ React102.createElement(Section3.Body, null, children))));
|
13484
13657
|
};
|
13485
13658
|
|
13486
13659
|
// src/molecules/SegmentedControl/SegmentedControl.tsx
|
13487
|
-
import
|
13660
|
+
import React103 from "react";
|
13488
13661
|
var SegmentedControl = (_a) => {
|
13489
13662
|
var _b = _a, {
|
13490
13663
|
children,
|
@@ -13501,7 +13674,7 @@ var SegmentedControl = (_a) => {
|
|
13501
13674
|
"selected",
|
13502
13675
|
"className"
|
13503
13676
|
]);
|
13504
|
-
return /* @__PURE__ */
|
13677
|
+
return /* @__PURE__ */ React103.createElement("li", null, /* @__PURE__ */ React103.createElement("button", __spreadProps(__spreadValues({
|
13505
13678
|
type: "button"
|
13506
13679
|
}, rest), {
|
13507
13680
|
className: classNames(
|
@@ -13535,12 +13708,12 @@ var SegmentedControlGroup = (_a) => {
|
|
13535
13708
|
"border border-grey-20 text-grey-50": variant === "outlined",
|
13536
13709
|
"bg-grey-0": variant === "raised"
|
13537
13710
|
});
|
13538
|
-
return /* @__PURE__ */
|
13711
|
+
return /* @__PURE__ */ React103.createElement("ul", __spreadProps(__spreadValues({}, rest), {
|
13539
13712
|
"aria-label": ariaLabel,
|
13540
13713
|
className: classNames("Aquarium-SegmentedControl", classes2, className)
|
13541
|
-
}),
|
13714
|
+
}), React103.Children.map(
|
13542
13715
|
children,
|
13543
|
-
(child) =>
|
13716
|
+
(child) => React103.cloneElement(child, {
|
13544
13717
|
dense,
|
13545
13718
|
variant,
|
13546
13719
|
onClick: () => onChange(child.props.value),
|
@@ -13578,14 +13751,14 @@ var getCommonClassNames = (dense, selected) => tw(
|
|
13578
13751
|
);
|
13579
13752
|
|
13580
13753
|
// src/molecules/Stepper/Stepper.tsx
|
13581
|
-
import
|
13754
|
+
import React105 from "react";
|
13582
13755
|
|
13583
13756
|
// src/atoms/Stepper/Stepper.tsx
|
13584
|
-
import
|
13757
|
+
import React104 from "react";
|
13585
13758
|
var import_tick6 = __toESM(require_tick());
|
13586
13759
|
var Stepper = (_a) => {
|
13587
13760
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13588
|
-
return /* @__PURE__ */
|
13761
|
+
return /* @__PURE__ */ React104.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13589
13762
|
className: classNames(className)
|
13590
13763
|
}));
|
13591
13764
|
};
|
@@ -13599,7 +13772,7 @@ var ConnectorContainer = (_a) => {
|
|
13599
13772
|
"completed",
|
13600
13773
|
"dense"
|
13601
13774
|
]);
|
13602
|
-
return /* @__PURE__ */
|
13775
|
+
return /* @__PURE__ */ React104.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13603
13776
|
className: classNames(
|
13604
13777
|
tw("absolute w-full -left-1/2", {
|
13605
13778
|
"top-[3px] px-[14px]": Boolean(dense),
|
@@ -13611,7 +13784,7 @@ var ConnectorContainer = (_a) => {
|
|
13611
13784
|
};
|
13612
13785
|
var Connector = (_a) => {
|
13613
13786
|
var _b = _a, { children, className, completed, dense } = _b, rest = __objRest(_b, ["children", "className", "completed", "dense"]);
|
13614
|
-
return /* @__PURE__ */
|
13787
|
+
return /* @__PURE__ */ React104.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13615
13788
|
className: classNames(
|
13616
13789
|
tw("w-full", {
|
13617
13790
|
"bg-grey-20": !completed,
|
@@ -13625,7 +13798,7 @@ var Connector = (_a) => {
|
|
13625
13798
|
};
|
13626
13799
|
var Step = (_a) => {
|
13627
13800
|
var _b = _a, { className, state } = _b, rest = __objRest(_b, ["className", "state"]);
|
13628
|
-
return /* @__PURE__ */
|
13801
|
+
return /* @__PURE__ */ React104.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13629
13802
|
className: classNames(
|
13630
13803
|
tw("flex flex-col items-center text-grey-90 relative text-center", {
|
13631
13804
|
"text-grey-20": state === "inactive"
|
@@ -13646,13 +13819,13 @@ var getDenseClassNames = (state) => tw("h-[8px] w-[8px]", {
|
|
13646
13819
|
});
|
13647
13820
|
var Indicator = (_a) => {
|
13648
13821
|
var _b = _a, { children, className, state, dense } = _b, rest = __objRest(_b, ["children", "className", "state", "dense"]);
|
13649
|
-
return /* @__PURE__ */
|
13822
|
+
return /* @__PURE__ */ React104.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13650
13823
|
className: classNames(
|
13651
13824
|
tw("rounded-full flex justify-center items-center mx-2 mb-3"),
|
13652
13825
|
dense ? getDenseClassNames(state) : getClassNames(state),
|
13653
13826
|
className
|
13654
13827
|
)
|
13655
|
-
}), state === "completed" ? /* @__PURE__ */
|
13828
|
+
}), state === "completed" ? /* @__PURE__ */ React104.createElement(InlineIcon, {
|
13656
13829
|
icon: import_tick6.default
|
13657
13830
|
}) : dense ? null : children);
|
13658
13831
|
};
|
@@ -13663,26 +13836,26 @@ Stepper.ConnectorContainer = ConnectorContainer;
|
|
13663
13836
|
|
13664
13837
|
// src/molecules/Stepper/Stepper.tsx
|
13665
13838
|
var Stepper2 = ({ children, activeIndex, dense }) => {
|
13666
|
-
const steps =
|
13667
|
-
return /* @__PURE__ */
|
13839
|
+
const steps = React105.Children.count(children);
|
13840
|
+
return /* @__PURE__ */ React105.createElement(Stepper, {
|
13668
13841
|
role: "list",
|
13669
13842
|
className: "Aquarium-Stepper"
|
13670
|
-
}, /* @__PURE__ */
|
13843
|
+
}, /* @__PURE__ */ React105.createElement(Template, {
|
13671
13844
|
columns: steps
|
13672
|
-
},
|
13845
|
+
}, React105.Children.map(children, (child, index) => {
|
13673
13846
|
if (!isComponentType(child, Step2)) {
|
13674
13847
|
throw new Error("<Stepper> can only have <Stepper.Step> components as children");
|
13675
13848
|
} else {
|
13676
13849
|
const state = index > activeIndex ? "inactive" : index === activeIndex ? "active" : "completed";
|
13677
|
-
return /* @__PURE__ */
|
13850
|
+
return /* @__PURE__ */ React105.createElement(Stepper.Step, {
|
13678
13851
|
state,
|
13679
13852
|
"aria-current": state === "active" ? "step" : false,
|
13680
13853
|
role: "listitem"
|
13681
|
-
}, index > 0 && index <= steps && /* @__PURE__ */
|
13854
|
+
}, index > 0 && index <= steps && /* @__PURE__ */ React105.createElement(Stepper.ConnectorContainer, {
|
13682
13855
|
dense
|
13683
|
-
}, /* @__PURE__ */
|
13856
|
+
}, /* @__PURE__ */ React105.createElement(Stepper.ConnectorContainer.Connector, {
|
13684
13857
|
completed: state === "completed" || state === "active"
|
13685
|
-
})), /* @__PURE__ */
|
13858
|
+
})), /* @__PURE__ */ React105.createElement(Stepper.Step.Indicator, {
|
13686
13859
|
state,
|
13687
13860
|
dense
|
13688
13861
|
}, index + 1), child.props.children);
|
@@ -13695,8 +13868,8 @@ Step2.displayName = "Stepper.Step";
|
|
13695
13868
|
Stepper2.Step = Step2;
|
13696
13869
|
|
13697
13870
|
// src/molecules/SwitchGroup/SwitchGroup.tsx
|
13698
|
-
import
|
13699
|
-
import { useId as
|
13871
|
+
import React106, { useState as useState13 } from "react";
|
13872
|
+
import { useId as useId16 } from "@react-aria/utils";
|
13700
13873
|
var SwitchGroup = (_a) => {
|
13701
13874
|
var _b = _a, {
|
13702
13875
|
value,
|
@@ -13718,7 +13891,7 @@ var SwitchGroup = (_a) => {
|
|
13718
13891
|
if (value !== void 0 && value !== selectedItems) {
|
13719
13892
|
setSelectedItems(value);
|
13720
13893
|
}
|
13721
|
-
const errorMessageId =
|
13894
|
+
const errorMessageId = useId16();
|
13722
13895
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
13723
13896
|
const labelControlProps = getLabelControlProps(props);
|
13724
13897
|
const handleChange = (e) => {
|
@@ -13727,13 +13900,13 @@ var SwitchGroup = (_a) => {
|
|
13727
13900
|
setSelectedItems(updated);
|
13728
13901
|
onChange == null ? void 0 : onChange(updated);
|
13729
13902
|
};
|
13730
|
-
return /* @__PURE__ */
|
13903
|
+
return /* @__PURE__ */ React106.createElement(LabelControl, __spreadProps(__spreadValues(__spreadValues({
|
13731
13904
|
fieldset: true
|
13732
13905
|
}, labelControlProps), errorProps), {
|
13733
13906
|
className: "Aquarium-SwitchGroup"
|
13734
|
-
}), /* @__PURE__ */
|
13907
|
+
}), /* @__PURE__ */ React106.createElement(InputGroup, {
|
13735
13908
|
cols
|
13736
|
-
},
|
13909
|
+
}, React106.Children.map(children, (c) => {
|
13737
13910
|
var _a3, _b2, _c, _d;
|
13738
13911
|
if (!isComponentType(c, Switch2)) {
|
13739
13912
|
return null;
|
@@ -13741,7 +13914,7 @@ var SwitchGroup = (_a) => {
|
|
13741
13914
|
const str = (_a3 = c.props.value) == null ? void 0 : _a3.toString();
|
13742
13915
|
const defaultChecked = defaultValue === void 0 ? void 0 : str !== void 0 && defaultValue.includes(str);
|
13743
13916
|
const checked = value === void 0 ? void 0 : str !== void 0 && value.includes(str);
|
13744
|
-
return
|
13917
|
+
return React106.cloneElement(c, {
|
13745
13918
|
defaultChecked: (_b2 = c.props.defaultChecked) != null ? _b2 : defaultChecked,
|
13746
13919
|
checked: (_c = c.props.checked) != null ? _c : checked,
|
13747
13920
|
onChange: (_d = c.props.onChange) != null ? _d : handleChange,
|
@@ -13751,9 +13924,9 @@ var SwitchGroup = (_a) => {
|
|
13751
13924
|
})));
|
13752
13925
|
};
|
13753
13926
|
var SwitchGroupSkeleton = ({ options = 2 }) => {
|
13754
|
-
return /* @__PURE__ */
|
13927
|
+
return /* @__PURE__ */ React106.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React106.createElement("div", {
|
13755
13928
|
className: tw("flex flex-wrap flex-col gap-2")
|
13756
|
-
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */
|
13929
|
+
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */ React106.createElement(Switch2.Skeleton, {
|
13757
13930
|
key
|
13758
13931
|
}))));
|
13759
13932
|
};
|
@@ -13761,14 +13934,14 @@ SwitchGroup.Skeleton = SwitchGroupSkeleton;
|
|
13761
13934
|
SwitchGroup.Skeleton.displayName = "SwitchGroup.Skeleton";
|
13762
13935
|
|
13763
13936
|
// src/molecules/Textarea/Textarea.tsx
|
13764
|
-
import
|
13765
|
-
import { useId as
|
13766
|
-
import
|
13937
|
+
import React107, { useState as useState14 } from "react";
|
13938
|
+
import { useId as useId17 } from "@react-aria/utils";
|
13939
|
+
import omit16 from "lodash/omit";
|
13767
13940
|
import toString2 from "lodash/toString";
|
13768
|
-
var TextareaBase =
|
13941
|
+
var TextareaBase = React107.forwardRef(
|
13769
13942
|
(_a, ref) => {
|
13770
13943
|
var _b = _a, { readOnly = false, valid = true } = _b, props = __objRest(_b, ["readOnly", "valid"]);
|
13771
|
-
return /* @__PURE__ */
|
13944
|
+
return /* @__PURE__ */ React107.createElement("textarea", __spreadProps(__spreadValues({
|
13772
13945
|
ref
|
13773
13946
|
}, props), {
|
13774
13947
|
readOnly,
|
@@ -13776,26 +13949,26 @@ var TextareaBase = React106.forwardRef(
|
|
13776
13949
|
}));
|
13777
13950
|
}
|
13778
13951
|
);
|
13779
|
-
TextareaBase.Skeleton = () => /* @__PURE__ */
|
13952
|
+
TextareaBase.Skeleton = () => /* @__PURE__ */ React107.createElement(Skeleton, {
|
13780
13953
|
height: 58
|
13781
13954
|
});
|
13782
|
-
var Textarea =
|
13955
|
+
var Textarea = React107.forwardRef((props, ref) => {
|
13783
13956
|
var _a, _b, _c;
|
13784
13957
|
const [value, setValue] = useState14((_b = (_a = props.value) != null ? _a : props.defaultValue) != null ? _b : "");
|
13785
|
-
const defaultId =
|
13958
|
+
const defaultId = useId17();
|
13786
13959
|
const id = (_c = props.id) != null ? _c : defaultId;
|
13787
|
-
const errorMessageId =
|
13960
|
+
const errorMessageId = useId17();
|
13788
13961
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
13789
13962
|
const _d = getLabelControlProps(props), { "data-testid": dataTestId } = _d, labelControlProps = __objRest(_d, ["data-testid"]);
|
13790
|
-
const baseProps =
|
13791
|
-
return /* @__PURE__ */
|
13963
|
+
const baseProps = omit16(props, Object.keys(labelControlProps));
|
13964
|
+
return /* @__PURE__ */ React107.createElement(LabelControl, __spreadProps(__spreadValues({
|
13792
13965
|
id: `${id}-label`,
|
13793
13966
|
htmlFor: id,
|
13794
13967
|
messageId: errorMessageId,
|
13795
13968
|
length: value !== void 0 ? toString2(value).length : void 0
|
13796
13969
|
}, labelControlProps), {
|
13797
13970
|
className: "Aquarium-Textarea"
|
13798
|
-
}), /* @__PURE__ */
|
13971
|
+
}), /* @__PURE__ */ React107.createElement(TextareaBase, __spreadProps(__spreadValues(__spreadValues({
|
13799
13972
|
ref
|
13800
13973
|
}, baseProps), errorProps), {
|
13801
13974
|
id,
|
@@ -13812,48 +13985,48 @@ var Textarea = React106.forwardRef((props, ref) => {
|
|
13812
13985
|
})));
|
13813
13986
|
});
|
13814
13987
|
Textarea.displayName = "Textarea";
|
13815
|
-
var TextAreaSkeleton = () => /* @__PURE__ */
|
13988
|
+
var TextAreaSkeleton = () => /* @__PURE__ */ React107.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React107.createElement(TextareaBase.Skeleton, null));
|
13816
13989
|
Textarea.Skeleton = TextAreaSkeleton;
|
13817
13990
|
Textarea.Skeleton.displayName = "Textarea.Skeleton";
|
13818
13991
|
|
13819
13992
|
// src/molecules/Timeline/Timeline.tsx
|
13820
|
-
import
|
13993
|
+
import React109 from "react";
|
13821
13994
|
|
13822
13995
|
// src/atoms/Timeline/Timeline.tsx
|
13823
|
-
import
|
13996
|
+
import React108 from "react";
|
13824
13997
|
var Timeline = (_a) => {
|
13825
13998
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13826
|
-
return /* @__PURE__ */
|
13999
|
+
return /* @__PURE__ */ React108.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13827
14000
|
className: classNames(tw("grid grid-cols-[16px_1fr] gap-x-4"), className)
|
13828
14001
|
}));
|
13829
14002
|
};
|
13830
14003
|
var Content2 = (_a) => {
|
13831
14004
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13832
|
-
return /* @__PURE__ */
|
14005
|
+
return /* @__PURE__ */ React108.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13833
14006
|
className: classNames(tw("pb-6"), className)
|
13834
14007
|
}));
|
13835
14008
|
};
|
13836
14009
|
var Separator2 = (_a) => {
|
13837
14010
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13838
|
-
return /* @__PURE__ */
|
14011
|
+
return /* @__PURE__ */ React108.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13839
14012
|
className: classNames(tw("flex items-center justify-center h-5 w-5"), className)
|
13840
14013
|
}));
|
13841
14014
|
};
|
13842
14015
|
var LineContainer = (_a) => {
|
13843
14016
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13844
|
-
return /* @__PURE__ */
|
14017
|
+
return /* @__PURE__ */ React108.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13845
14018
|
className: classNames(tw("flex justify-center py-1"), className)
|
13846
14019
|
}));
|
13847
14020
|
};
|
13848
14021
|
var Line = (_a) => {
|
13849
14022
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13850
|
-
return /* @__PURE__ */
|
14023
|
+
return /* @__PURE__ */ React108.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13851
14024
|
className: classNames(tw("w-1 bg-grey-5 h-full justify-self-center"), className)
|
13852
14025
|
}));
|
13853
14026
|
};
|
13854
14027
|
var Dot = (_a) => {
|
13855
14028
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13856
|
-
return /* @__PURE__ */
|
14029
|
+
return /* @__PURE__ */ React108.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13857
14030
|
className: classNames(tw("bg-grey-30 h-[6px] w-[6px] rounded"), className)
|
13858
14031
|
}));
|
13859
14032
|
};
|
@@ -13868,54 +14041,54 @@ var import_error5 = __toESM(require_error());
|
|
13868
14041
|
var import_time2 = __toESM(require_time());
|
13869
14042
|
var import_warningSign5 = __toESM(require_warningSign());
|
13870
14043
|
var TimelineItem = () => null;
|
13871
|
-
var Timeline2 = ({ children }) => /* @__PURE__ */
|
14044
|
+
var Timeline2 = ({ children }) => /* @__PURE__ */ React109.createElement("div", {
|
13872
14045
|
className: "Aquarium-Timeline"
|
13873
|
-
},
|
14046
|
+
}, React109.Children.map(children, (item) => {
|
13874
14047
|
if (!isComponentType(item, TimelineItem)) {
|
13875
14048
|
throw new Error("<Timeline> can only have <Timeline.Item> components as children");
|
13876
14049
|
} else {
|
13877
14050
|
const { props, key } = item;
|
13878
|
-
return /* @__PURE__ */
|
14051
|
+
return /* @__PURE__ */ React109.createElement(Timeline, {
|
13879
14052
|
key: key != null ? key : props.title
|
13880
|
-
}, /* @__PURE__ */
|
14053
|
+
}, /* @__PURE__ */ React109.createElement(Timeline.Separator, null, props.variant === "error" ? /* @__PURE__ */ React109.createElement(Icon, {
|
13881
14054
|
icon: import_error5.default,
|
13882
14055
|
color: "error-30"
|
13883
|
-
}) : props.variant === "warning" ? /* @__PURE__ */
|
14056
|
+
}) : props.variant === "warning" ? /* @__PURE__ */ React109.createElement(Icon, {
|
13884
14057
|
icon: import_warningSign5.default,
|
13885
14058
|
color: "warning-30"
|
13886
|
-
}) : props.variant === "info" ? /* @__PURE__ */
|
14059
|
+
}) : props.variant === "info" ? /* @__PURE__ */ React109.createElement(Icon, {
|
13887
14060
|
icon: import_time2.default,
|
13888
14061
|
color: "info-30"
|
13889
|
-
}) : /* @__PURE__ */
|
14062
|
+
}) : /* @__PURE__ */ React109.createElement(Timeline.Separator.Dot, null)), /* @__PURE__ */ React109.createElement(Typography2.Caption, {
|
13890
14063
|
color: "grey-50"
|
13891
|
-
}, props.title), /* @__PURE__ */
|
14064
|
+
}, props.title), /* @__PURE__ */ React109.createElement(Timeline.LineContainer, null, /* @__PURE__ */ React109.createElement(Timeline.LineContainer.Line, null)), /* @__PURE__ */ React109.createElement(Timeline.Content, null, /* @__PURE__ */ React109.createElement(Typography2.Small, null, props.children)));
|
13892
14065
|
}
|
13893
14066
|
}));
|
13894
|
-
var TimelineItemSkeleton = () => /* @__PURE__ */
|
14067
|
+
var TimelineItemSkeleton = () => /* @__PURE__ */ React109.createElement(Timeline, null, /* @__PURE__ */ React109.createElement(Timeline.Separator, null, /* @__PURE__ */ React109.createElement(Skeleton, {
|
13895
14068
|
width: 6,
|
13896
14069
|
height: 6,
|
13897
14070
|
rounded: true
|
13898
|
-
})), /* @__PURE__ */
|
14071
|
+
})), /* @__PURE__ */ React109.createElement(Skeleton, {
|
13899
14072
|
height: 12,
|
13900
14073
|
width: 120
|
13901
|
-
}), /* @__PURE__ */
|
14074
|
+
}), /* @__PURE__ */ React109.createElement(Timeline.LineContainer, null, /* @__PURE__ */ React109.createElement(Skeleton, {
|
13902
14075
|
width: 2,
|
13903
14076
|
height: "100%"
|
13904
|
-
})), /* @__PURE__ */
|
14077
|
+
})), /* @__PURE__ */ React109.createElement(Timeline.Content, null, /* @__PURE__ */ React109.createElement(Box, {
|
13905
14078
|
display: "flex",
|
13906
14079
|
flexDirection: "column",
|
13907
14080
|
gap: "3"
|
13908
|
-
}, /* @__PURE__ */
|
14081
|
+
}, /* @__PURE__ */ React109.createElement(Skeleton, {
|
13909
14082
|
height: 32,
|
13910
14083
|
width: "100%"
|
13911
|
-
}), /* @__PURE__ */
|
14084
|
+
}), /* @__PURE__ */ React109.createElement(Skeleton, {
|
13912
14085
|
height: 32,
|
13913
14086
|
width: "73%"
|
13914
|
-
}), /* @__PURE__ */
|
14087
|
+
}), /* @__PURE__ */ React109.createElement(Skeleton, {
|
13915
14088
|
height: 32,
|
13916
14089
|
width: "80%"
|
13917
14090
|
}))));
|
13918
|
-
var TimelineSkeleton = ({ items = 3 }) => /* @__PURE__ */
|
14091
|
+
var TimelineSkeleton = ({ items = 3 }) => /* @__PURE__ */ React109.createElement("div", null, Array.from({ length: items }).map((_, key) => /* @__PURE__ */ React109.createElement(TimelineItemSkeleton, {
|
13919
14092
|
key
|
13920
14093
|
})));
|
13921
14094
|
Timeline2.Item = TimelineItem;
|
@@ -13923,9 +14096,9 @@ Timeline2.Skeleton = TimelineSkeleton;
|
|
13923
14096
|
Timeline2.Skeleton.displayName = "Timeline.Skeleton";
|
13924
14097
|
|
13925
14098
|
// src/utils/table/useTableSelect.ts
|
13926
|
-
import
|
14099
|
+
import React110 from "react";
|
13927
14100
|
var useTableSelect = (data, { key }) => {
|
13928
|
-
const [selected, setSelected] =
|
14101
|
+
const [selected, setSelected] = React110.useState([]);
|
13929
14102
|
const allSelected = selected.length === data.length;
|
13930
14103
|
const isSelected = (dot) => selected.includes(dot[key]);
|
13931
14104
|
const selectAll = () => setSelected(data.map((dot) => dot[key]));
|
@@ -14096,6 +14269,7 @@ export {
|
|
14096
14269
|
DesignSystemContext,
|
14097
14270
|
Dialog,
|
14098
14271
|
Divider2 as Divider,
|
14272
|
+
Drawer,
|
14099
14273
|
Dropdown,
|
14100
14274
|
DropdownButton,
|
14101
14275
|
DropdownMenu2 as DropdownMenu,
|
@@ -14199,6 +14373,7 @@ export {
|
|
14199
14373
|
createTabsComponent,
|
14200
14374
|
system_default as default,
|
14201
14375
|
getLabelControlProps,
|
14376
|
+
isOnSortChangedDirection,
|
14202
14377
|
isOutOfBounds,
|
14203
14378
|
placementOrder,
|
14204
14379
|
export_theme as theme,
|