@aivenio/aquarium 1.49.1 → 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 +39 -18
- package/dist/atoms.mjs +39 -18
- 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/icons/more.js +2 -2
- 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/MultiSelect/MultiSelect.d.ts +8 -1
- package/dist/src/molecules/MultiSelect/MultiSelect.js +22 -5
- 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 +1203 -1007
- package/dist/system.mjs +1205 -1011
- package/dist/tsconfig.module.tsbuildinfo +1 -1
- package/dist/types/tailwindGenerated.d.ts +1 -1
- package/package.json +14 -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
@@ -3289,7 +3289,7 @@ var require_more = __commonJS({
|
|
3289
3289
|
"src/icons/more.js"(exports) {
|
3290
3290
|
"use strict";
|
3291
3291
|
var data = {
|
3292
|
-
"body": '<
|
3292
|
+
"body": '<g fill="none"><path fill="currentColor" d="M11 12a1 1 0 100-2 1 1 0 000 2Zm8 0a1 1 0 100-2 1 1 0 000 2ZM3 12a1 1 0 100-2 1 1 0 000 2Z"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M11 12a1 1 0 100-2 1 1 0 000 2Zm8 0a1 1 0 100-2 1 1 0 000 2ZM3 12a1 1 0 100-2 1 1 0 000 2Z"/></g>',
|
3293
3293
|
"left": 0,
|
3294
3294
|
"top": 0,
|
3295
3295
|
"width": 22,
|
@@ -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
12018
|
}, footer)))));
|
11547
12019
|
};
|
11548
12020
|
|
11549
12021
|
// src/molecules/Flexbox/FlexboxItem.tsx
|
11550
|
-
import
|
12022
|
+
import React77 from "react";
|
11551
12023
|
var FlexboxItem = Tailwindify(
|
11552
12024
|
({ htmlTag = "div", className, style, children, display, flex, grow, shrink, order, alignSelf }) => {
|
11553
12025
|
const hookStyle = useStyle({
|
11554
12026
|
display,
|
11555
12027
|
flex,
|
11556
12028
|
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
|
-
}
|
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,28 @@ 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";
|
12503
|
+
import isArray2 from "lodash/isArray";
|
12330
12504
|
import isEqual from "lodash/isEqual";
|
12331
12505
|
import isNil2 from "lodash/isNil";
|
12332
|
-
import
|
12506
|
+
import isObject2 from "lodash/isObject";
|
12507
|
+
import omit13 from "lodash/omit";
|
12333
12508
|
import omitBy from "lodash/omitBy";
|
12334
12509
|
import { matchSorter as matchSorter2 } from "match-sorter";
|
12510
|
+
var isOptionGroup = (option) => {
|
12511
|
+
return isObject2(option) && "options" in option && isArray2(option.options);
|
12512
|
+
};
|
12513
|
+
var hasOptionGroups2 = (options) => {
|
12514
|
+
return options.some(isOptionGroup);
|
12515
|
+
};
|
12335
12516
|
var MultiSelectBase = (_a) => {
|
12336
12517
|
var _b = _a, {
|
12337
12518
|
id,
|
@@ -12399,9 +12580,14 @@ var MultiSelectBase = (_a) => {
|
|
12399
12580
|
);
|
12400
12581
|
const keys = typeof options[0] === "string" ? void 0 : optionKeys;
|
12401
12582
|
const selectedItemsAsStrings = selectedItems.map(itemToString);
|
12402
|
-
const filteredOptions = (
|
12583
|
+
const filteredOptions = hasOptionGroups2(options) ? options.map((option) => __spreadProps(__spreadValues({}, option), {
|
12584
|
+
options: (inputValue ? matchSorter2(option.options, inputValue, { keys }) : option.options).filter(
|
12585
|
+
(opt) => !selectedItemsAsStrings.includes(itemToString(opt))
|
12586
|
+
)
|
12587
|
+
})) : (inputValue ? matchSorter2(options, inputValue, { keys }) : options).filter(
|
12403
12588
|
(opt) => !selectedItemsAsStrings.includes(itemToString(opt))
|
12404
12589
|
);
|
12590
|
+
const flattenedOptions = hasOptionGroups2(filteredOptions) ? filteredOptions.flatMap((group) => group.options) : filteredOptions;
|
12405
12591
|
const {
|
12406
12592
|
isOpen,
|
12407
12593
|
openMenu,
|
@@ -12418,7 +12604,7 @@ var MultiSelectBase = (_a) => {
|
|
12418
12604
|
defaultSelectedItem: defaultValue,
|
12419
12605
|
isItemDisabled: (item, index) => isOptionDisabled(item, index),
|
12420
12606
|
selectedItem: null,
|
12421
|
-
items:
|
12607
|
+
items: flattenedOptions,
|
12422
12608
|
stateReducer: (_, actionChanges) => {
|
12423
12609
|
var _a3, _b2;
|
12424
12610
|
const { changes, type } = actionChanges;
|
@@ -12450,7 +12636,7 @@ var MultiSelectBase = (_a) => {
|
|
12450
12636
|
case useCombobox2.stateChangeTypes.ItemClick:
|
12451
12637
|
case useCombobox2.stateChangeTypes.InputBlur: {
|
12452
12638
|
setInputValue("");
|
12453
|
-
if (selectedItem && !isOptionDisabled(selectedItem,
|
12639
|
+
if (selectedItem && !isOptionDisabled(selectedItem, flattenedOptions.indexOf(selectedItem)) && !selectedItems.some((val) => isEqual(val, selectedItem))) {
|
12454
12640
|
addSelectedItem(selectedItem);
|
12455
12641
|
}
|
12456
12642
|
break;
|
@@ -12465,13 +12651,21 @@ var MultiSelectBase = (_a) => {
|
|
12465
12651
|
toggle: toggleMenu,
|
12466
12652
|
setOpen: (isOpen2) => isOpen2 ? openMenu() : closeMenu()
|
12467
12653
|
};
|
12468
|
-
|
12654
|
+
useEffect12(() => {
|
12469
12655
|
if (state.isOpen && inputRef.current && popoverRef.current) {
|
12470
12656
|
return ariaHideOutside2([inputRef.current, popoverRef.current]);
|
12471
12657
|
}
|
12472
12658
|
}, [state.isOpen, inputRef, popoverRef]);
|
12659
|
+
const renderItem = (item, index) => /* @__PURE__ */ React86.createElement(Select.Item, __spreadValues({
|
12660
|
+
key: itemToString(item),
|
12661
|
+
highlighted: index === highlightedIndex,
|
12662
|
+
selected: selectedItems.includes(item)
|
12663
|
+
}, getItemProps({ item, index })), renderOption(item));
|
12664
|
+
const renderGroup = (group) => group.options.length ? /* @__PURE__ */ React86.createElement(React86.Fragment, {
|
12665
|
+
key: group.label
|
12666
|
+
}, /* @__PURE__ */ React86.createElement(Select.Group, null, group.label), group.options.map((opt) => renderItem(opt, flattenedOptions.indexOf(opt)))) : null;
|
12473
12667
|
const renderChips = () => {
|
12474
|
-
return selectedItems.map((selectedItem, index) => /* @__PURE__ */
|
12668
|
+
return selectedItems.map((selectedItem, index) => /* @__PURE__ */ React86.createElement(InputChip, __spreadProps(__spreadValues({
|
12475
12669
|
key: `${itemToString(selectedItem)}.chip`,
|
12476
12670
|
className: tw("mx-0"),
|
12477
12671
|
disabled,
|
@@ -12489,14 +12683,14 @@ var MultiSelectBase = (_a) => {
|
|
12489
12683
|
getDropdownProps({ ref: inputRef, disabled: disabled || readOnly, value: inputValue })
|
12490
12684
|
);
|
12491
12685
|
const menuProps = getMenuProps({ ref: menuRef }, { suppressRefError: !isOpen });
|
12492
|
-
return /* @__PURE__ */
|
12686
|
+
return /* @__PURE__ */ React86.createElement("div", {
|
12493
12687
|
className: classNames("Aquarium-MultiSelectBase", tw("relative"))
|
12494
|
-
}, /* @__PURE__ */
|
12688
|
+
}, /* @__PURE__ */ React86.createElement(Select.InputContainer, {
|
12495
12689
|
ref: targetRef,
|
12496
12690
|
variant: disabled ? "disabled" : !valid ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default"
|
12497
|
-
}, /* @__PURE__ */
|
12691
|
+
}, /* @__PURE__ */ React86.createElement("div", {
|
12498
12692
|
className: "grow inline-flex flex-row flex-wrap gap-2"
|
12499
|
-
}, !hideChips && inline && renderChips(), /* @__PURE__ */
|
12693
|
+
}, !hideChips && inline && renderChips(), /* @__PURE__ */ React86.createElement(Select.Input, __spreadProps(__spreadValues(__spreadValues({
|
12500
12694
|
name,
|
12501
12695
|
placeholder: selectedItems.length === 0 && !readOnly ? placeholder : ""
|
12502
12696
|
}, inputProps), props), {
|
@@ -12515,12 +12709,12 @@ var MultiSelectBase = (_a) => {
|
|
12515
12709
|
setFocus(false);
|
12516
12710
|
(_a3 = inputProps.onBlur) == null ? void 0 : _a3.call(inputProps, e);
|
12517
12711
|
}
|
12518
|
-
}))), !readOnly && /* @__PURE__ */
|
12712
|
+
}))), !readOnly && /* @__PURE__ */ React86.createElement(Select.Toggle, __spreadValues({
|
12519
12713
|
hasFocus,
|
12520
12714
|
isOpen
|
12521
|
-
}, getToggleButtonProps({ disabled })))), !hideChips && !inline && /* @__PURE__ */
|
12715
|
+
}, getToggleButtonProps({ disabled })))), !hideChips && !inline && /* @__PURE__ */ React86.createElement("div", {
|
12522
12716
|
className: tw("flex flex-row flex-wrap gap-2 mt-2")
|
12523
|
-
}, renderChips()), isOpen && /* @__PURE__ */
|
12717
|
+
}, renderChips()), isOpen && /* @__PURE__ */ React86.createElement(PopoverOverlay, {
|
12524
12718
|
ref: popoverRef,
|
12525
12719
|
triggerRef: targetRef,
|
12526
12720
|
state,
|
@@ -12528,15 +12722,13 @@ var MultiSelectBase = (_a) => {
|
|
12528
12722
|
shouldFlip: true,
|
12529
12723
|
isNonModal: true,
|
12530
12724
|
style: { width: (_a2 = targetRef.current) == null ? void 0 : _a2.offsetWidth }
|
12531
|
-
}, /* @__PURE__ */
|
12725
|
+
}, /* @__PURE__ */ React86.createElement(Select.Menu, __spreadValues({
|
12532
12726
|
maxHeight
|
12533
|
-
}, menuProps), hasNoResults && /* @__PURE__ */
|
12534
|
-
|
12535
|
-
|
12536
|
-
selected: selectedItems.includes(item)
|
12537
|
-
}, getItemProps({ item, index })), renderOption(item))))));
|
12727
|
+
}, menuProps), hasNoResults && /* @__PURE__ */ React86.createElement(Select.NoResults, null, emptyState), filteredOptions.map(
|
12728
|
+
(option, index) => isOptionGroup(option) ? renderGroup(option) : renderItem(option, index)
|
12729
|
+
))));
|
12538
12730
|
};
|
12539
|
-
var MultiSelectBaseSkeleton = () => /* @__PURE__ */
|
12731
|
+
var MultiSelectBaseSkeleton = () => /* @__PURE__ */ React86.createElement(Skeleton, {
|
12540
12732
|
height: 38
|
12541
12733
|
});
|
12542
12734
|
MultiSelectBase.Skeleton = MultiSelectBaseSkeleton;
|
@@ -12551,19 +12743,19 @@ var MultiSelect = (_a) => {
|
|
12551
12743
|
"emptyState"
|
12552
12744
|
]);
|
12553
12745
|
var _a2;
|
12554
|
-
const defaultId =
|
12746
|
+
const defaultId = useId12();
|
12555
12747
|
const id = (_a2 = props.id) != null ? _a2 : defaultId;
|
12556
|
-
const errorMessageId =
|
12748
|
+
const errorMessageId = useId12();
|
12557
12749
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
12558
12750
|
const labelControlProps = getLabelControlProps(props);
|
12559
|
-
const baseProps =
|
12560
|
-
return /* @__PURE__ */
|
12751
|
+
const baseProps = omit13(props, Object.keys(labelControlProps));
|
12752
|
+
return /* @__PURE__ */ React86.createElement(LabelControl, __spreadProps(__spreadValues({
|
12561
12753
|
id: `${id}-label`,
|
12562
12754
|
htmlFor: `${id}-input`,
|
12563
12755
|
messageId: errorMessageId
|
12564
12756
|
}, labelControlProps), {
|
12565
12757
|
className: "Aquarium-MultiSelect"
|
12566
|
-
}), /* @__PURE__ */
|
12758
|
+
}), /* @__PURE__ */ React86.createElement(MultiSelectBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
|
12567
12759
|
id,
|
12568
12760
|
options,
|
12569
12761
|
emptyState,
|
@@ -12571,17 +12763,17 @@ var MultiSelect = (_a) => {
|
|
12571
12763
|
valid: props.valid
|
12572
12764
|
})));
|
12573
12765
|
};
|
12574
|
-
var MultiSelectSkeleton = () => /* @__PURE__ */
|
12766
|
+
var MultiSelectSkeleton = () => /* @__PURE__ */ React86.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React86.createElement(MultiSelectBase.Skeleton, null));
|
12575
12767
|
MultiSelect.Skeleton = MultiSelectSkeleton;
|
12576
12768
|
MultiSelect.Skeleton.displayName = "MultiSelect.Skeleton";
|
12577
12769
|
|
12578
12770
|
// src/molecules/NativeSelect/NativeSelect.tsx
|
12579
|
-
import
|
12580
|
-
import { useId as
|
12581
|
-
import
|
12771
|
+
import React87 from "react";
|
12772
|
+
import { useId as useId13 } from "@react-aria/utils";
|
12773
|
+
import omit14 from "lodash/omit";
|
12582
12774
|
import uniqueId from "lodash/uniqueId";
|
12583
12775
|
var import_caretDown2 = __toESM(require_caretDown());
|
12584
|
-
var NativeSelectBase =
|
12776
|
+
var NativeSelectBase = React87.forwardRef(
|
12585
12777
|
(_a, ref) => {
|
12586
12778
|
var _b = _a, { children, disabled = false, required = false, valid = true, readOnly = false } = _b, props = __objRest(_b, ["children", "disabled", "required", "valid", "readOnly"]);
|
12587
12779
|
const placeholderValue = uniqueId("default_value_for_placeholder");
|
@@ -12598,16 +12790,16 @@ var NativeSelectBase = React86.forwardRef(
|
|
12598
12790
|
(_b2 = props.onBlur) == null ? void 0 : _b2.call(props, event);
|
12599
12791
|
}
|
12600
12792
|
};
|
12601
|
-
return /* @__PURE__ */
|
12793
|
+
return /* @__PURE__ */ React87.createElement("span", {
|
12602
12794
|
className: classNames("Aquarium-NativeSelectBase", tw("relative block"))
|
12603
|
-
}, !readOnly && /* @__PURE__ */
|
12795
|
+
}, !readOnly && /* @__PURE__ */ React87.createElement("span", {
|
12604
12796
|
className: tw(
|
12605
12797
|
"absolute right-0 inset-y-0 mr-4 text-grey-40 flex ml-3 pointer-events-none typography-default-strong mt-4"
|
12606
12798
|
)
|
12607
|
-
}, /* @__PURE__ */
|
12799
|
+
}, /* @__PURE__ */ React87.createElement(Icon, {
|
12608
12800
|
icon: import_caretDown2.default,
|
12609
12801
|
"data-testid": "icon-dropdown"
|
12610
|
-
})), /* @__PURE__ */
|
12802
|
+
})), /* @__PURE__ */ React87.createElement("select", __spreadProps(__spreadValues({
|
12611
12803
|
ref,
|
12612
12804
|
disabled: disabled || readOnly,
|
12613
12805
|
required
|
@@ -12626,32 +12818,32 @@ var NativeSelectBase = React86.forwardRef(
|
|
12626
12818
|
),
|
12627
12819
|
props.className
|
12628
12820
|
)
|
12629
|
-
}), props.placeholder && /* @__PURE__ */
|
12821
|
+
}), props.placeholder && /* @__PURE__ */ React87.createElement("option", {
|
12630
12822
|
value: placeholderValue,
|
12631
12823
|
disabled: true
|
12632
12824
|
}, props.placeholder), children));
|
12633
12825
|
}
|
12634
12826
|
);
|
12635
|
-
NativeSelectBase.Skeleton = () => /* @__PURE__ */
|
12827
|
+
NativeSelectBase.Skeleton = () => /* @__PURE__ */ React87.createElement(Skeleton, {
|
12636
12828
|
height: 38
|
12637
12829
|
});
|
12638
|
-
var NativeSelect =
|
12830
|
+
var NativeSelect = React87.forwardRef(
|
12639
12831
|
(_a, ref) => {
|
12640
12832
|
var _b = _a, { readOnly } = _b, props = __objRest(_b, ["readOnly"]);
|
12641
12833
|
var _a2;
|
12642
|
-
const defaultId =
|
12834
|
+
const defaultId = useId13();
|
12643
12835
|
const id = (_a2 = props.id) != null ? _a2 : defaultId;
|
12644
|
-
const errorMessageId =
|
12836
|
+
const errorMessageId = useId13();
|
12645
12837
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
12646
12838
|
const _b2 = getLabelControlProps(props), { "data-testid": dataTestId } = _b2, labelControlProps = __objRest(_b2, ["data-testid"]);
|
12647
|
-
const baseProps =
|
12648
|
-
return /* @__PURE__ */
|
12839
|
+
const baseProps = omit14(props, Object.keys(labelControlProps));
|
12840
|
+
return /* @__PURE__ */ React87.createElement(LabelControl, __spreadProps(__spreadValues({
|
12649
12841
|
id: `${id}-label`,
|
12650
12842
|
htmlFor: id,
|
12651
12843
|
messageId: errorMessageId
|
12652
12844
|
}, labelControlProps), {
|
12653
12845
|
className: "Aquarium-NativeSelect"
|
12654
|
-
}), /* @__PURE__ */
|
12846
|
+
}), /* @__PURE__ */ React87.createElement(NativeSelectBase, __spreadProps(__spreadValues(__spreadValues({
|
12655
12847
|
ref
|
12656
12848
|
}, baseProps), errorProps), {
|
12657
12849
|
id,
|
@@ -12665,63 +12857,63 @@ var NativeSelect = React86.forwardRef(
|
|
12665
12857
|
}
|
12666
12858
|
);
|
12667
12859
|
NativeSelect.displayName = "NativeSelect";
|
12668
|
-
var Option =
|
12860
|
+
var Option = React87.forwardRef((_a, ref) => {
|
12669
12861
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
12670
|
-
return /* @__PURE__ */
|
12862
|
+
return /* @__PURE__ */ React87.createElement("option", __spreadValues({
|
12671
12863
|
ref
|
12672
12864
|
}, props), children);
|
12673
12865
|
});
|
12674
12866
|
Option.displayName = "Option";
|
12675
|
-
var NativeSelectSkeleton = () => /* @__PURE__ */
|
12867
|
+
var NativeSelectSkeleton = () => /* @__PURE__ */ React87.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React87.createElement(NativeSelectBase.Skeleton, null), /* @__PURE__ */ React87.createElement("div", {
|
12676
12868
|
style: { height: "1px" }
|
12677
12869
|
}));
|
12678
12870
|
NativeSelect.Skeleton = NativeSelectSkeleton;
|
12679
12871
|
NativeSelect.Skeleton.displayName = "NativeSelect.Skeleton";
|
12680
12872
|
|
12681
12873
|
// src/molecules/Navigation/Navigation.tsx
|
12682
|
-
import
|
12874
|
+
import React89 from "react";
|
12683
12875
|
import classNames10 from "classnames";
|
12684
12876
|
|
12685
12877
|
// src/atoms/Navigation/Navigation.tsx
|
12686
|
-
import
|
12878
|
+
import React88 from "react";
|
12687
12879
|
var Navigation = (_a) => {
|
12688
12880
|
var _b = _a, { className, children } = _b, rest = __objRest(_b, ["className", "children"]);
|
12689
|
-
return /* @__PURE__ */
|
12881
|
+
return /* @__PURE__ */ React88.createElement("nav", {
|
12690
12882
|
className: classNames(tw("bg-grey-0 h-full"))
|
12691
|
-
}, /* @__PURE__ */
|
12883
|
+
}, /* @__PURE__ */ React88.createElement("ul", __spreadProps(__spreadValues({}, rest), {
|
12692
12884
|
className: classNames(tw("flex flex-col h-full"), className),
|
12693
12885
|
role: "menubar"
|
12694
12886
|
}), children));
|
12695
12887
|
};
|
12696
12888
|
var Header = (_a) => {
|
12697
12889
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
12698
|
-
return /* @__PURE__ */
|
12890
|
+
return /* @__PURE__ */ React88.createElement("li", __spreadProps(__spreadValues({}, rest), {
|
12699
12891
|
role: "presentation",
|
12700
12892
|
className: classNames(tw("px-6 py-5"), className)
|
12701
12893
|
}));
|
12702
12894
|
};
|
12703
12895
|
var Footer = (_a) => {
|
12704
12896
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
12705
|
-
return /* @__PURE__ */
|
12897
|
+
return /* @__PURE__ */ React88.createElement("li", __spreadProps(__spreadValues({}, rest), {
|
12706
12898
|
role: "presentation",
|
12707
12899
|
className: classNames(tw("px-6 py-5 mt-auto"), className)
|
12708
12900
|
}));
|
12709
12901
|
};
|
12710
12902
|
var Section2 = (_a) => {
|
12711
12903
|
var _b = _a, { title, className } = _b, rest = __objRest(_b, ["title", "className"]);
|
12712
|
-
return /* @__PURE__ */
|
12904
|
+
return /* @__PURE__ */ React88.createElement("li", {
|
12713
12905
|
role: "presentation",
|
12714
12906
|
className: tw("py-5")
|
12715
|
-
}, title && /* @__PURE__ */
|
12907
|
+
}, title && /* @__PURE__ */ React88.createElement("div", {
|
12716
12908
|
className: classNames(className, "py-2 px-6 text-grey-40 uppercase cursor-default typography-caption")
|
12717
|
-
}, title), /* @__PURE__ */
|
12909
|
+
}, title), /* @__PURE__ */ React88.createElement("ul", __spreadProps(__spreadValues({}, rest), {
|
12718
12910
|
role: "group",
|
12719
12911
|
className: classNames(tw("flex flex-col"), className)
|
12720
12912
|
})));
|
12721
12913
|
};
|
12722
12914
|
var Divider3 = (_a) => {
|
12723
12915
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
12724
|
-
return /* @__PURE__ */
|
12916
|
+
return /* @__PURE__ */ React88.createElement("li", __spreadProps(__spreadValues({
|
12725
12917
|
role: "separator"
|
12726
12918
|
}, rest), {
|
12727
12919
|
className: classNames(tw("border-t-2 border-grey-5"), className)
|
@@ -12729,9 +12921,9 @@ var Divider3 = (_a) => {
|
|
12729
12921
|
};
|
12730
12922
|
var Item5 = (_a) => {
|
12731
12923
|
var _b = _a, { className, active } = _b, rest = __objRest(_b, ["className", "active"]);
|
12732
|
-
return /* @__PURE__ */
|
12924
|
+
return /* @__PURE__ */ React88.createElement("li", {
|
12733
12925
|
role: "presentation"
|
12734
|
-
}, /* @__PURE__ */
|
12926
|
+
}, /* @__PURE__ */ React88.createElement("a", __spreadProps(__spreadValues({}, rest), {
|
12735
12927
|
role: "menuitem",
|
12736
12928
|
className: classNames(
|
12737
12929
|
tw("py-3 px-6 hover:bg-grey-5 cursor-pointer flex gap-4 items-center typography-small focusable", {
|
@@ -12751,7 +12943,7 @@ Navigation.Divider = Divider3;
|
|
12751
12943
|
// src/molecules/Navigation/Navigation.tsx
|
12752
12944
|
var Navigation2 = (_a) => {
|
12753
12945
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
12754
|
-
return /* @__PURE__ */
|
12946
|
+
return /* @__PURE__ */ React89.createElement(Navigation, __spreadValues({
|
12755
12947
|
className: classNames10("Aquarium-Navigation", className)
|
12756
12948
|
}, props));
|
12757
12949
|
};
|
@@ -12765,11 +12957,11 @@ var Item6 = (_a) => {
|
|
12765
12957
|
"icon",
|
12766
12958
|
"showNotification"
|
12767
12959
|
]);
|
12768
|
-
return /* @__PURE__ */
|
12960
|
+
return /* @__PURE__ */ React89.createElement(Navigation.Item, __spreadValues({}, rest), icon && showNotification && /* @__PURE__ */ React89.createElement(Badge.Notification, null, /* @__PURE__ */ React89.createElement(InlineIcon, {
|
12769
12961
|
icon,
|
12770
12962
|
width: "20px",
|
12771
12963
|
height: "20px"
|
12772
|
-
})), icon && !showNotification && /* @__PURE__ */
|
12964
|
+
})), icon && !showNotification && /* @__PURE__ */ React89.createElement(InlineIcon, {
|
12773
12965
|
icon,
|
12774
12966
|
width: "20px",
|
12775
12967
|
height: "20px"
|
@@ -12782,32 +12974,32 @@ Navigation2.Header = Navigation.Header;
|
|
12782
12974
|
Navigation2.Section = Navigation.Section;
|
12783
12975
|
|
12784
12976
|
// src/molecules/PageHeader/PageHeader.tsx
|
12785
|
-
import
|
12786
|
-
import
|
12977
|
+
import React91 from "react";
|
12978
|
+
import castArray4 from "lodash/castArray";
|
12787
12979
|
|
12788
12980
|
// src/atoms/PageHeader/PageHeader.tsx
|
12789
|
-
import
|
12981
|
+
import React90 from "react";
|
12790
12982
|
var PageHeader = (_a) => {
|
12791
12983
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12792
|
-
return /* @__PURE__ */
|
12984
|
+
return /* @__PURE__ */ React90.createElement("div", __spreadValues({
|
12793
12985
|
className: classNames(tw("flex flex-row gap-4 pb-6"), className)
|
12794
12986
|
}, rest), children);
|
12795
12987
|
};
|
12796
12988
|
PageHeader.Container = (_a) => {
|
12797
12989
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12798
|
-
return /* @__PURE__ */
|
12990
|
+
return /* @__PURE__ */ React90.createElement("div", __spreadValues({
|
12799
12991
|
className: classNames(tw("flex flex-col grow gap-0"), className)
|
12800
12992
|
}, rest), children);
|
12801
12993
|
};
|
12802
12994
|
PageHeader.TitleContainer = (_a) => {
|
12803
12995
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12804
|
-
return /* @__PURE__ */
|
12996
|
+
return /* @__PURE__ */ React90.createElement("div", __spreadValues({
|
12805
12997
|
className: classNames(tw("flex flex-col justify-center gap-2"), className)
|
12806
12998
|
}, rest), children);
|
12807
12999
|
};
|
12808
13000
|
PageHeader.Title = (_a) => {
|
12809
13001
|
var _b = _a, { isSubHeader = false, children } = _b, rest = __objRest(_b, ["isSubHeader", "children"]);
|
12810
|
-
return /* @__PURE__ */
|
13002
|
+
return /* @__PURE__ */ React90.createElement(Typography2, __spreadProps(__spreadValues({}, rest), {
|
12811
13003
|
color: "grey-100",
|
12812
13004
|
variant: isSubHeader ? "subheading" : "heading",
|
12813
13005
|
htmlTag: isSubHeader ? "h2" : "h1"
|
@@ -12815,25 +13007,25 @@ PageHeader.Title = (_a) => {
|
|
12815
13007
|
};
|
12816
13008
|
PageHeader.Subtitle = (_a) => {
|
12817
13009
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
12818
|
-
return /* @__PURE__ */
|
13010
|
+
return /* @__PURE__ */ React90.createElement(Typography2.Small, __spreadProps(__spreadValues({}, rest), {
|
12819
13011
|
color: "grey-70"
|
12820
13012
|
}), children);
|
12821
13013
|
};
|
12822
13014
|
PageHeader.Chips = (_a) => {
|
12823
13015
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12824
|
-
return /* @__PURE__ */
|
13016
|
+
return /* @__PURE__ */ React90.createElement("div", __spreadValues({
|
12825
13017
|
className: classNames(tw("flex gap-3"), className)
|
12826
13018
|
}, rest), children);
|
12827
13019
|
};
|
12828
13020
|
PageHeader.Actions = (_a) => {
|
12829
13021
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12830
|
-
return /* @__PURE__ */
|
13022
|
+
return /* @__PURE__ */ React90.createElement("div", __spreadValues({
|
12831
13023
|
className: classNames(tw("flex flex-row gap-4 self-start"), className)
|
12832
13024
|
}, rest), children);
|
12833
13025
|
};
|
12834
13026
|
|
12835
13027
|
// src/molecules/PageHeader/PageHeader.tsx
|
12836
|
-
var
|
13028
|
+
var import_more5 = __toESM(require_more());
|
12837
13029
|
var CommonPageHeader = ({
|
12838
13030
|
title,
|
12839
13031
|
subtitle,
|
@@ -12851,63 +13043,63 @@ var CommonPageHeader = ({
|
|
12851
13043
|
onMenuOpenChange,
|
12852
13044
|
isSubHeader = false
|
12853
13045
|
}) => {
|
12854
|
-
return /* @__PURE__ */
|
13046
|
+
return /* @__PURE__ */ React91.createElement(PageHeader, {
|
12855
13047
|
className: "Aquarium-PageHeader"
|
12856
|
-
}, /* @__PURE__ */
|
13048
|
+
}, /* @__PURE__ */ React91.createElement(PageHeader.Container, null, breadcrumbs && /* @__PURE__ */ React91.createElement(Box, {
|
12857
13049
|
marginBottom: "3"
|
12858
|
-
}, /* @__PURE__ */
|
13050
|
+
}, /* @__PURE__ */ React91.createElement(Breadcrumbs, null, breadcrumbs)), /* @__PURE__ */ React91.createElement(Spacing, {
|
12859
13051
|
row: true,
|
12860
13052
|
gap: "5"
|
12861
|
-
}, image && /* @__PURE__ */
|
13053
|
+
}, image && /* @__PURE__ */ React91.createElement("img", {
|
12862
13054
|
src: image,
|
12863
13055
|
alt: imageAlt != null ? imageAlt : "",
|
12864
13056
|
className: tw("w-[56px] h-[56px]")
|
12865
|
-
}), /* @__PURE__ */
|
13057
|
+
}), /* @__PURE__ */ React91.createElement(PageHeader.TitleContainer, null, /* @__PURE__ */ React91.createElement(PageHeader.Title, {
|
12866
13058
|
isSubHeader
|
12867
|
-
}, title), chips.length > 0 && /* @__PURE__ */
|
13059
|
+
}, title), chips.length > 0 && /* @__PURE__ */ React91.createElement(PageHeader.Chips, null, chips.map((chip) => /* @__PURE__ */ React91.createElement(Chip2, {
|
12868
13060
|
key: chip,
|
12869
13061
|
dense: true,
|
12870
13062
|
text: chip
|
12871
|
-
}))), 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, {
|
12872
13064
|
alignItems: "center"
|
12873
|
-
}, /* @__PURE__ */
|
13065
|
+
}, /* @__PURE__ */ React91.createElement(DropdownMenu2, {
|
12874
13066
|
onAction: (action) => onAction == null ? void 0 : onAction(action),
|
12875
13067
|
onOpenChange: onMenuOpenChange
|
12876
|
-
}, /* @__PURE__ */
|
13068
|
+
}, /* @__PURE__ */ React91.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ React91.createElement(Button.Icon, {
|
12877
13069
|
"aria-label": menuAriaLabel,
|
12878
|
-
icon:
|
12879
|
-
})), 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 })));
|
12880
13072
|
};
|
12881
|
-
var PageHeader2 = (props) => /* @__PURE__ */
|
13073
|
+
var PageHeader2 = (props) => /* @__PURE__ */ React91.createElement(CommonPageHeader, __spreadValues({}, props));
|
12882
13074
|
PageHeader2.displayName = "PageHeader";
|
12883
|
-
var SubHeader = (props) => /* @__PURE__ */
|
13075
|
+
var SubHeader = (props) => /* @__PURE__ */ React91.createElement(CommonPageHeader, __spreadProps(__spreadValues({}, props), {
|
12884
13076
|
isSubHeader: true
|
12885
13077
|
}));
|
12886
13078
|
PageHeader2.SubHeader = SubHeader;
|
12887
13079
|
PageHeader2.SubHeader.displayName = "PageHeader.SubHeader";
|
12888
13080
|
|
12889
13081
|
// src/molecules/PopoverDialog/PopoverDialog.tsx
|
12890
|
-
import
|
12891
|
-
import
|
13082
|
+
import React93 from "react";
|
13083
|
+
import omit15 from "lodash/omit";
|
12892
13084
|
|
12893
13085
|
// src/atoms/PopoverDialog/PopoverDialog.tsx
|
12894
|
-
import
|
13086
|
+
import React92 from "react";
|
12895
13087
|
var Header2 = (_a) => {
|
12896
13088
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12897
|
-
return /* @__PURE__ */
|
13089
|
+
return /* @__PURE__ */ React92.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12898
13090
|
className: classNames(tw("p-5 gap-3 flex items-center"), className)
|
12899
13091
|
}), children);
|
12900
13092
|
};
|
12901
13093
|
var Title2 = (_a) => {
|
12902
13094
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12903
|
-
return /* @__PURE__ */
|
13095
|
+
return /* @__PURE__ */ React92.createElement(Typography, __spreadProps(__spreadValues({}, rest), {
|
12904
13096
|
htmlTag: "h1",
|
12905
13097
|
variant: "small-strong"
|
12906
13098
|
}), children);
|
12907
13099
|
};
|
12908
13100
|
var Body = (_a) => {
|
12909
13101
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12910
|
-
return /* @__PURE__ */
|
13102
|
+
return /* @__PURE__ */ React92.createElement(Typography, __spreadProps(__spreadValues({}, rest), {
|
12911
13103
|
htmlTag: "div",
|
12912
13104
|
variant: "caption",
|
12913
13105
|
className: classNames(tw("px-5 overflow-y-auto"), className)
|
@@ -12915,13 +13107,13 @@ var Body = (_a) => {
|
|
12915
13107
|
};
|
12916
13108
|
var Footer2 = (_a) => {
|
12917
13109
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12918
|
-
return /* @__PURE__ */
|
13110
|
+
return /* @__PURE__ */ React92.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12919
13111
|
className: classNames(tw("p-5"), className)
|
12920
13112
|
}), children);
|
12921
13113
|
};
|
12922
13114
|
var Actions2 = (_a) => {
|
12923
13115
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12924
|
-
return /* @__PURE__ */
|
13116
|
+
return /* @__PURE__ */ React92.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12925
13117
|
className: classNames(tw("flex gap-4"), className)
|
12926
13118
|
}), children);
|
12927
13119
|
};
|
@@ -12937,29 +13129,29 @@ var PopoverDialog = {
|
|
12937
13129
|
var PopoverDialog2 = ({ placement, open, title, secondaryAction, primaryAction, children }) => {
|
12938
13130
|
const wrapPromptWithBody = (child) => {
|
12939
13131
|
if (isComponentType(child, PopoverDialog2.Prompt)) {
|
12940
|
-
return /* @__PURE__ */
|
13132
|
+
return /* @__PURE__ */ React93.createElement(Popover2.Panel, {
|
12941
13133
|
className: classNames("Aquarium-PopoverDialog", tw("max-w-[300px]"))
|
12942
|
-
}, /* @__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({
|
12943
13135
|
kind: "secondary-ghost",
|
12944
13136
|
key: secondaryAction.text,
|
12945
13137
|
dense: true
|
12946
|
-
},
|
13138
|
+
}, omit15(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */ React93.createElement(Popover2.Button, __spreadValues({
|
12947
13139
|
kind: "ghost",
|
12948
13140
|
key: primaryAction.text,
|
12949
13141
|
dense: true
|
12950
|
-
},
|
13142
|
+
}, omit15(primaryAction, "text")), primaryAction.text))));
|
12951
13143
|
}
|
12952
13144
|
return child;
|
12953
13145
|
};
|
12954
|
-
return /* @__PURE__ */
|
13146
|
+
return /* @__PURE__ */ React93.createElement(Popover2, {
|
12955
13147
|
type: "dialog",
|
12956
13148
|
isOpen: open,
|
12957
13149
|
placement,
|
12958
13150
|
containFocus: true
|
12959
|
-
},
|
13151
|
+
}, React93.Children.map(children, wrapPromptWithBody));
|
12960
13152
|
};
|
12961
13153
|
PopoverDialog2.Trigger = Popover2.Trigger;
|
12962
|
-
var Prompt = ({ children }) => /* @__PURE__ */
|
13154
|
+
var Prompt = ({ children }) => /* @__PURE__ */ React93.createElement(PopoverDialog.Body, null, children);
|
12963
13155
|
Prompt.displayName = "PopoverDialog.Prompt";
|
12964
13156
|
PopoverDialog2.Prompt = Prompt;
|
12965
13157
|
|
@@ -12968,14 +13160,14 @@ import { createPortal } from "react-dom";
|
|
12968
13160
|
var Portal = ({ children, to }) => createPortal(children, to);
|
12969
13161
|
|
12970
13162
|
// src/molecules/ProgressBar/ProgressBar.tsx
|
12971
|
-
import
|
13163
|
+
import React95 from "react";
|
12972
13164
|
|
12973
13165
|
// src/atoms/ProgressBar/ProgressBar.tsx
|
12974
|
-
import
|
13166
|
+
import React94 from "react";
|
12975
13167
|
import clamp3 from "lodash/clamp";
|
12976
13168
|
var ProgressBar = (_a) => {
|
12977
13169
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12978
|
-
return /* @__PURE__ */
|
13170
|
+
return /* @__PURE__ */ React94.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12979
13171
|
className: classNames(
|
12980
13172
|
tw("relative flex items-center w-full bg-grey-0 h-2 rounded-full overflow-hidden"),
|
12981
13173
|
className
|
@@ -12991,7 +13183,7 @@ var STATUS_COLORS = {
|
|
12991
13183
|
ProgressBar.Indicator = (_a) => {
|
12992
13184
|
var _b = _a, { min, max, value, "aria-label": ariaLabel, status, className } = _b, rest = __objRest(_b, ["min", "max", "value", "aria-label", "status", "className"]);
|
12993
13185
|
const completedPercentage = clamp3((value - min) / (max - min) * 100, 0, 100);
|
12994
|
-
return /* @__PURE__ */
|
13186
|
+
return /* @__PURE__ */ React94.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12995
13187
|
className: classNames(
|
12996
13188
|
tw("h-2 rounded-full transition-all ease-in-out delay-150"),
|
12997
13189
|
STATUS_COLORS[status],
|
@@ -13007,11 +13199,11 @@ ProgressBar.Indicator = (_a) => {
|
|
13007
13199
|
};
|
13008
13200
|
ProgressBar.Labels = (_a) => {
|
13009
13201
|
var _b = _a, { children, startLabel, endLabel, className } = _b, rest = __objRest(_b, ["children", "startLabel", "endLabel", "className"]);
|
13010
|
-
return /* @__PURE__ */
|
13202
|
+
return /* @__PURE__ */ React94.createElement("div", {
|
13011
13203
|
className: classNames(tw("flex flex-row"), className)
|
13012
|
-
}, /* @__PURE__ */
|
13204
|
+
}, /* @__PURE__ */ React94.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
13013
13205
|
className: tw("grow text-grey-70 typography-caption")
|
13014
|
-
}), startLabel), /* @__PURE__ */
|
13206
|
+
}), startLabel), /* @__PURE__ */ React94.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
13015
13207
|
className: tw("grow text-grey-70 typography-caption text-right")
|
13016
13208
|
}), endLabel));
|
13017
13209
|
};
|
@@ -13029,7 +13221,7 @@ var ProgressBar2 = (props) => {
|
|
13029
13221
|
if (min > max) {
|
13030
13222
|
throw new Error("`min` value provided to `ProgressBar` is greater than `max` value.");
|
13031
13223
|
}
|
13032
|
-
const progress = /* @__PURE__ */
|
13224
|
+
const progress = /* @__PURE__ */ React95.createElement(ProgressBar, null, /* @__PURE__ */ React95.createElement(ProgressBar.Indicator, {
|
13033
13225
|
status: value === max ? completedStatus : progresStatus,
|
13034
13226
|
min,
|
13035
13227
|
max,
|
@@ -13039,15 +13231,15 @@ var ProgressBar2 = (props) => {
|
|
13039
13231
|
if (props.dense) {
|
13040
13232
|
return progress;
|
13041
13233
|
}
|
13042
|
-
return /* @__PURE__ */
|
13234
|
+
return /* @__PURE__ */ React95.createElement("div", {
|
13043
13235
|
className: "Aquarium-ProgressBar"
|
13044
|
-
}, progress, /* @__PURE__ */
|
13236
|
+
}, progress, /* @__PURE__ */ React95.createElement(ProgressBar.Labels, {
|
13045
13237
|
className: tw("py-2"),
|
13046
13238
|
startLabel: props.startLabel,
|
13047
13239
|
endLabel: props.endLabel
|
13048
13240
|
}));
|
13049
13241
|
};
|
13050
|
-
var ProgressBarSkeleton = () => /* @__PURE__ */
|
13242
|
+
var ProgressBarSkeleton = () => /* @__PURE__ */ React95.createElement(Skeleton, {
|
13051
13243
|
height: 4,
|
13052
13244
|
display: "block"
|
13053
13245
|
});
|
@@ -13055,13 +13247,13 @@ ProgressBar2.Skeleton = ProgressBarSkeleton;
|
|
13055
13247
|
ProgressBar2.Skeleton.displayName = "ProgressBar.Skeleton";
|
13056
13248
|
|
13057
13249
|
// src/molecules/RadioButton/RadioButton.tsx
|
13058
|
-
import
|
13059
|
-
var RadioButton2 =
|
13250
|
+
import React96 from "react";
|
13251
|
+
var RadioButton2 = React96.forwardRef(
|
13060
13252
|
(_a, ref) => {
|
13061
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"]);
|
13062
13254
|
var _a2;
|
13063
13255
|
const isChecked = (_a2 = props.checked) != null ? _a2 : props.defaultChecked;
|
13064
|
-
return !readOnly || isChecked ? /* @__PURE__ */
|
13256
|
+
return !readOnly || isChecked ? /* @__PURE__ */ React96.createElement(ControlLabel, {
|
13065
13257
|
htmlFor: id,
|
13066
13258
|
label: children,
|
13067
13259
|
"aria-label": ariaLabel,
|
@@ -13070,7 +13262,7 @@ var RadioButton2 = React95.forwardRef(
|
|
13070
13262
|
disabled,
|
13071
13263
|
style: { gap: "0 8px" },
|
13072
13264
|
className: "Aquarium-RadioButton"
|
13073
|
-
}, !readOnly && /* @__PURE__ */
|
13265
|
+
}, !readOnly && /* @__PURE__ */ React96.createElement(RadioButton, __spreadProps(__spreadValues({
|
13074
13266
|
id,
|
13075
13267
|
ref,
|
13076
13268
|
name
|
@@ -13081,12 +13273,12 @@ var RadioButton2 = React95.forwardRef(
|
|
13081
13273
|
}
|
13082
13274
|
);
|
13083
13275
|
RadioButton2.displayName = "RadioButton";
|
13084
|
-
var RadioButtonSkeleton = () => /* @__PURE__ */
|
13276
|
+
var RadioButtonSkeleton = () => /* @__PURE__ */ React96.createElement("div", {
|
13085
13277
|
className: tw("flex gap-3")
|
13086
|
-
}, /* @__PURE__ */
|
13278
|
+
}, /* @__PURE__ */ React96.createElement(Skeleton, {
|
13087
13279
|
height: 20,
|
13088
13280
|
width: 20
|
13089
|
-
}), /* @__PURE__ */
|
13281
|
+
}), /* @__PURE__ */ React96.createElement(Skeleton, {
|
13090
13282
|
height: 20,
|
13091
13283
|
width: 150
|
13092
13284
|
}));
|
@@ -13094,10 +13286,10 @@ RadioButton2.Skeleton = RadioButtonSkeleton;
|
|
13094
13286
|
RadioButton2.Skeleton.displayName = "RadioButton.Skeleton";
|
13095
13287
|
|
13096
13288
|
// src/molecules/RadioButtonGroup/RadioButtonGroup.tsx
|
13097
|
-
import
|
13098
|
-
import { useId as
|
13289
|
+
import React97 from "react";
|
13290
|
+
import { useId as useId14 } from "@react-aria/utils";
|
13099
13291
|
var isRadioButton = (c) => {
|
13100
|
-
return
|
13292
|
+
return React97.isValidElement(c) && c.type === RadioButton2;
|
13101
13293
|
};
|
13102
13294
|
var RadioButtonGroup = (_a) => {
|
13103
13295
|
var _b = _a, {
|
@@ -13120,8 +13312,8 @@ var RadioButtonGroup = (_a) => {
|
|
13120
13312
|
"children"
|
13121
13313
|
]);
|
13122
13314
|
var _a2;
|
13123
|
-
const [value, setValue] =
|
13124
|
-
const errorMessageId =
|
13315
|
+
const [value, setValue] = React97.useState((_a2 = _value != null ? _value : defaultValue) != null ? _a2 : "");
|
13316
|
+
const errorMessageId = useId14();
|
13125
13317
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
13126
13318
|
const labelControlProps = getLabelControlProps(props);
|
13127
13319
|
if (_value !== void 0 && _value !== value) {
|
@@ -13131,14 +13323,14 @@ var RadioButtonGroup = (_a) => {
|
|
13131
13323
|
setValue(e.target.value);
|
13132
13324
|
onChange == null ? void 0 : onChange(e.target.value);
|
13133
13325
|
};
|
13134
|
-
const content =
|
13326
|
+
const content = React97.Children.map(children, (c) => {
|
13135
13327
|
var _a3, _b2, _c;
|
13136
13328
|
if (!isRadioButton(c)) {
|
13137
13329
|
return null;
|
13138
13330
|
}
|
13139
13331
|
const defaultChecked = defaultValue === void 0 ? void 0 : c.props.value === defaultValue;
|
13140
13332
|
const checked = value === void 0 ? void 0 : c.props.value === value;
|
13141
|
-
return
|
13333
|
+
return React97.cloneElement(c, {
|
13142
13334
|
name,
|
13143
13335
|
defaultChecked: (_a3 = c.props.defaultChecked) != null ? _a3 : defaultChecked,
|
13144
13336
|
checked: (_b2 = c.props.checked) != null ? _b2 : checked,
|
@@ -13147,13 +13339,13 @@ var RadioButtonGroup = (_a) => {
|
|
13147
13339
|
readOnly
|
13148
13340
|
});
|
13149
13341
|
});
|
13150
|
-
return /* @__PURE__ */
|
13342
|
+
return /* @__PURE__ */ React97.createElement(LabelControl, __spreadProps(__spreadValues(__spreadValues({
|
13151
13343
|
fieldset: true
|
13152
13344
|
}, labelControlProps), errorProps), {
|
13153
13345
|
className: "Aquarium-RadioButtonGroup"
|
13154
|
-
}), cols && /* @__PURE__ */
|
13346
|
+
}), cols && /* @__PURE__ */ React97.createElement(InputGroup, {
|
13155
13347
|
cols
|
13156
|
-
}, content), !cols && /* @__PURE__ */
|
13348
|
+
}, content), !cols && /* @__PURE__ */ React97.createElement(Flexbox, {
|
13157
13349
|
direction,
|
13158
13350
|
alignItems: "flex-start",
|
13159
13351
|
colGap: "8",
|
@@ -13162,12 +13354,12 @@ var RadioButtonGroup = (_a) => {
|
|
13162
13354
|
}, content));
|
13163
13355
|
};
|
13164
13356
|
var RadioButtonGroupSkeleton = ({ direction = "row", options = 2 }) => {
|
13165
|
-
return /* @__PURE__ */
|
13357
|
+
return /* @__PURE__ */ React97.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React97.createElement("div", {
|
13166
13358
|
className: tw("flex flex-wrap", {
|
13167
13359
|
"flex-row gap-8": direction === "row",
|
13168
13360
|
"flex-col gap-2": direction === "column"
|
13169
13361
|
})
|
13170
|
-
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */
|
13362
|
+
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */ React97.createElement(RadioButton2.Skeleton, {
|
13171
13363
|
key
|
13172
13364
|
}))));
|
13173
13365
|
};
|
@@ -13175,24 +13367,24 @@ RadioButtonGroup.Skeleton = RadioButtonGroupSkeleton;
|
|
13175
13367
|
RadioButtonGroup.Skeleton.displayName = "RadioButtonGroup.Skeleton";
|
13176
13368
|
|
13177
13369
|
// src/molecules/Section/Section.tsx
|
13178
|
-
import
|
13179
|
-
import { useId as
|
13180
|
-
import { animated as
|
13181
|
-
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";
|
13182
13374
|
import isUndefined9 from "lodash/isUndefined";
|
13183
13375
|
|
13184
13376
|
// src/molecules/Switch/Switch.tsx
|
13185
|
-
import
|
13377
|
+
import React99 from "react";
|
13186
13378
|
|
13187
13379
|
// src/atoms/Switch/Switch.tsx
|
13188
|
-
import
|
13380
|
+
import React98 from "react";
|
13189
13381
|
var import_ban2 = __toESM(require_ban());
|
13190
|
-
var Switch =
|
13382
|
+
var Switch = React98.forwardRef(
|
13191
13383
|
(_a, ref) => {
|
13192
13384
|
var _b = _a, { id, children, name, disabled = false, readOnly = false } = _b, props = __objRest(_b, ["id", "children", "name", "disabled", "readOnly"]);
|
13193
|
-
return /* @__PURE__ */
|
13385
|
+
return /* @__PURE__ */ React98.createElement("span", {
|
13194
13386
|
className: tw("relative inline-flex justify-center items-center self-center group")
|
13195
|
-
}, /* @__PURE__ */
|
13387
|
+
}, /* @__PURE__ */ React98.createElement("input", __spreadProps(__spreadValues({
|
13196
13388
|
id,
|
13197
13389
|
ref,
|
13198
13390
|
type: "checkbox",
|
@@ -13211,7 +13403,7 @@ var Switch = React97.forwardRef(
|
|
13211
13403
|
),
|
13212
13404
|
readOnly,
|
13213
13405
|
disabled
|
13214
|
-
})), /* @__PURE__ */
|
13406
|
+
})), /* @__PURE__ */ React98.createElement("span", {
|
13215
13407
|
className: tw(
|
13216
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",
|
13217
13409
|
"bg-white left-2 peer-checked/switch:left-1 text-grey-30 peer-checked/switch:text-primary-60",
|
@@ -13219,7 +13411,7 @@ var Switch = React97.forwardRef(
|
|
13219
13411
|
"shadow-4dp": !disabled
|
13220
13412
|
}
|
13221
13413
|
)
|
13222
|
-
}, disabled && /* @__PURE__ */
|
13414
|
+
}, disabled && /* @__PURE__ */ React98.createElement(Icon, {
|
13223
13415
|
icon: import_ban2.default,
|
13224
13416
|
width: "10px",
|
13225
13417
|
height: "10px"
|
@@ -13228,7 +13420,7 @@ var Switch = React97.forwardRef(
|
|
13228
13420
|
);
|
13229
13421
|
|
13230
13422
|
// src/molecules/Switch/Switch.tsx
|
13231
|
-
var Switch2 =
|
13423
|
+
var Switch2 = React99.forwardRef(
|
13232
13424
|
(_a, ref) => {
|
13233
13425
|
var _b = _a, {
|
13234
13426
|
id,
|
@@ -13251,7 +13443,7 @@ var Switch2 = React98.forwardRef(
|
|
13251
13443
|
]);
|
13252
13444
|
var _a2;
|
13253
13445
|
const isChecked = (_a2 = props.checked) != null ? _a2 : props.defaultChecked;
|
13254
|
-
return !readOnly || isChecked ? /* @__PURE__ */
|
13446
|
+
return !readOnly || isChecked ? /* @__PURE__ */ React99.createElement(ControlLabel, {
|
13255
13447
|
htmlFor: id,
|
13256
13448
|
label: children,
|
13257
13449
|
"aria-label": ariaLabel,
|
@@ -13261,7 +13453,7 @@ var Switch2 = React98.forwardRef(
|
|
13261
13453
|
style: { gap: "0 8px" },
|
13262
13454
|
labelPlacement,
|
13263
13455
|
className: "Aquarium-Switch"
|
13264
|
-
}, !readOnly && /* @__PURE__ */
|
13456
|
+
}, !readOnly && /* @__PURE__ */ React99.createElement(Switch, __spreadProps(__spreadValues({
|
13265
13457
|
id,
|
13266
13458
|
ref,
|
13267
13459
|
name
|
@@ -13272,12 +13464,12 @@ var Switch2 = React98.forwardRef(
|
|
13272
13464
|
}
|
13273
13465
|
);
|
13274
13466
|
Switch2.displayName = "Switch";
|
13275
|
-
var SwitchSkeleton = () => /* @__PURE__ */
|
13467
|
+
var SwitchSkeleton = () => /* @__PURE__ */ React99.createElement("div", {
|
13276
13468
|
className: tw("flex gap-3")
|
13277
|
-
}, /* @__PURE__ */
|
13469
|
+
}, /* @__PURE__ */ React99.createElement(Skeleton, {
|
13278
13470
|
height: 20,
|
13279
13471
|
width: 35
|
13280
|
-
}), /* @__PURE__ */
|
13472
|
+
}), /* @__PURE__ */ React99.createElement(Skeleton, {
|
13281
13473
|
height: 20,
|
13282
13474
|
width: 150
|
13283
13475
|
}));
|
@@ -13285,7 +13477,7 @@ Switch2.Skeleton = SwitchSkeleton;
|
|
13285
13477
|
Switch2.Skeleton.displayName = "Switch.Skeleton ";
|
13286
13478
|
|
13287
13479
|
// src/molecules/TagLabel/TagLabel.tsx
|
13288
|
-
import
|
13480
|
+
import React100 from "react";
|
13289
13481
|
var getVariantClassNames = (variant = "primary") => {
|
13290
13482
|
switch (variant) {
|
13291
13483
|
case "danger":
|
@@ -13299,7 +13491,7 @@ var getVariantClassNames = (variant = "primary") => {
|
|
13299
13491
|
};
|
13300
13492
|
var TagLabel = (_a) => {
|
13301
13493
|
var _b = _a, { title, dense = false, variant } = _b, rest = __objRest(_b, ["title", "dense", "variant"]);
|
13302
|
-
return /* @__PURE__ */
|
13494
|
+
return /* @__PURE__ */ React100.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
13303
13495
|
className: classNames(
|
13304
13496
|
"Aquarium-TagLabel",
|
13305
13497
|
getVariantClassNames(variant),
|
@@ -13312,11 +13504,11 @@ var TagLabel = (_a) => {
|
|
13312
13504
|
};
|
13313
13505
|
|
13314
13506
|
// src/atoms/Section/Section.tsx
|
13315
|
-
import
|
13507
|
+
import React101 from "react";
|
13316
13508
|
var import_caretUp2 = __toESM(require_caretUp());
|
13317
13509
|
var Section3 = (_a) => {
|
13318
13510
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
13319
|
-
return /* @__PURE__ */
|
13511
|
+
return /* @__PURE__ */ React101.createElement(Box, __spreadValues({
|
13320
13512
|
component: "section",
|
13321
13513
|
borderColor: "grey-5",
|
13322
13514
|
borderWidth: "1px"
|
@@ -13324,7 +13516,7 @@ var Section3 = (_a) => {
|
|
13324
13516
|
};
|
13325
13517
|
Section3.Header = (_a) => {
|
13326
13518
|
var _b = _a, { children, className, expanded } = _b, rest = __objRest(_b, ["children", "className", "expanded"]);
|
13327
|
-
return /* @__PURE__ */
|
13519
|
+
return /* @__PURE__ */ React101.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13328
13520
|
className: classNames(
|
13329
13521
|
tw("px-6 flex gap-5 justify-between items-center h-[72px]", { "bg-grey-0": expanded }),
|
13330
13522
|
className
|
@@ -13333,21 +13525,21 @@ Section3.Header = (_a) => {
|
|
13333
13525
|
};
|
13334
13526
|
Section3.TitleContainer = (_a) => {
|
13335
13527
|
var _b = _a, { children, className, collapsible } = _b, rest = __objRest(_b, ["children", "className", "collapsible"]);
|
13336
|
-
return /* @__PURE__ */
|
13528
|
+
return /* @__PURE__ */ React101.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13337
13529
|
className: classNames(
|
13338
13530
|
tw("grow grid grid-cols-[auto_1fr] gap-x-3 items-center", { "cursor-pointer": collapsible }),
|
13339
13531
|
className
|
13340
13532
|
)
|
13341
13533
|
}), children);
|
13342
13534
|
};
|
13343
|
-
Section3.Toggle = (props) => /* @__PURE__ */
|
13535
|
+
Section3.Toggle = (props) => /* @__PURE__ */ React101.createElement(Icon, __spreadProps(__spreadValues({}, props), {
|
13344
13536
|
icon: import_caretUp2.default,
|
13345
13537
|
height: 22,
|
13346
13538
|
width: 22
|
13347
13539
|
}));
|
13348
13540
|
Section3.Title = (_a) => {
|
13349
13541
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
13350
|
-
return /* @__PURE__ */
|
13542
|
+
return /* @__PURE__ */ React101.createElement(Typography2.Large, __spreadProps(__spreadValues({}, rest), {
|
13351
13543
|
htmlTag: "h2",
|
13352
13544
|
color: "black",
|
13353
13545
|
className: "flex gap-3 items-center"
|
@@ -13355,35 +13547,35 @@ Section3.Title = (_a) => {
|
|
13355
13547
|
};
|
13356
13548
|
Section3.Subtitle = (_a) => {
|
13357
13549
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
13358
|
-
return /* @__PURE__ */
|
13550
|
+
return /* @__PURE__ */ React101.createElement(Typography2.Small, __spreadProps(__spreadValues({}, rest), {
|
13359
13551
|
color: "grey-70"
|
13360
13552
|
}), children);
|
13361
13553
|
};
|
13362
13554
|
Section3.Actions = (_a) => {
|
13363
13555
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
13364
|
-
return /* @__PURE__ */
|
13556
|
+
return /* @__PURE__ */ React101.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13365
13557
|
className: classNames(tw("flex gap-4 justify-end"), className)
|
13366
13558
|
}), children);
|
13367
13559
|
};
|
13368
13560
|
Section3.Body = (_a) => {
|
13369
13561
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
13370
|
-
return /* @__PURE__ */
|
13562
|
+
return /* @__PURE__ */ React101.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13371
13563
|
className: classNames(tw("p-6"), className)
|
13372
|
-
}), /* @__PURE__ */
|
13564
|
+
}), /* @__PURE__ */ React101.createElement(Typography, {
|
13373
13565
|
htmlTag: "div",
|
13374
13566
|
color: "grey-70"
|
13375
13567
|
}, children));
|
13376
13568
|
};
|
13377
13569
|
|
13378
13570
|
// src/molecules/Section/Section.tsx
|
13379
|
-
var
|
13571
|
+
var import_more6 = __toESM(require_more());
|
13380
13572
|
var Section4 = (props) => {
|
13381
13573
|
var _a, _b, _c, _d, _e;
|
13382
13574
|
const { title, subtitle, children } = props;
|
13383
13575
|
const _collapsible = title ? (_a = props.collapsible) != null ? _a : false : false;
|
13384
13576
|
const _collapsed = title ? props.collapsed : void 0;
|
13385
13577
|
const _defaultCollapsed = title ? (_b = props.defaultCollapsed) != null ? _b : false : false;
|
13386
|
-
const [isCollapsed, setCollapsed] =
|
13578
|
+
const [isCollapsed, setCollapsed] = React102.useState(_collapsed != null ? _collapsed : _defaultCollapsed);
|
13387
13579
|
const [ref, { height }] = useMeasure();
|
13388
13580
|
const menu = title ? (_c = props.menu) != null ? _c : void 0 : void 0;
|
13389
13581
|
const menuAriaLabel = title ? (_e = (_d = props.menuAriaLabel) != null ? _d : props.menuLabel) != null ? _e : "Context menu" : void 0;
|
@@ -13404,7 +13596,7 @@ var Section4 = (props) => {
|
|
13404
13596
|
}
|
13405
13597
|
};
|
13406
13598
|
const targetHeight = isCollapsed ? "0px" : `${height != null ? height : 0}px`;
|
13407
|
-
const _f =
|
13599
|
+
const _f = useSpring4({
|
13408
13600
|
height: height !== null ? targetHeight : void 0,
|
13409
13601
|
opacity: isCollapsed ? 0 : 1,
|
13410
13602
|
transform: `rotate(${isCollapsed ? 180 : 0}deg)`,
|
@@ -13414,58 +13606,58 @@ var Section4 = (props) => {
|
|
13414
13606
|
},
|
13415
13607
|
immediate: !_collapsible
|
13416
13608
|
}), { transform, backgroundColor } = _f, spring = __objRest(_f, ["transform", "backgroundColor"]);
|
13417
|
-
const toggleId =
|
13418
|
-
const regionId =
|
13419
|
-
const titleId =
|
13420
|
-
return /* @__PURE__ */
|
13609
|
+
const toggleId = useId15();
|
13610
|
+
const regionId = useId15();
|
13611
|
+
const titleId = useId15();
|
13612
|
+
return /* @__PURE__ */ React102.createElement(Section3, {
|
13421
13613
|
"aria-label": title,
|
13422
13614
|
className: "Aquarium-Section"
|
13423
|
-
}, title && /* @__PURE__ */
|
13615
|
+
}, title && /* @__PURE__ */ React102.createElement(React102.Fragment, null, /* @__PURE__ */ React102.createElement(Section3.Header, {
|
13424
13616
|
expanded: _collapsible && !isCollapsed
|
13425
|
-
}, /* @__PURE__ */
|
13617
|
+
}, /* @__PURE__ */ React102.createElement(Section3.TitleContainer, {
|
13426
13618
|
role: _collapsible ? "button" : void 0,
|
13427
13619
|
id: toggleId,
|
13428
13620
|
collapsible: _collapsible,
|
13429
13621
|
onClick: handleTitleClick,
|
13430
13622
|
"aria-expanded": _collapsible ? !isCollapsed : void 0,
|
13431
13623
|
"aria-controls": _collapsible ? regionId : void 0
|
13432
|
-
}, _collapsible && /* @__PURE__ */
|
13624
|
+
}, _collapsible && /* @__PURE__ */ React102.createElement(animated5.div, {
|
13433
13625
|
style: { transform }
|
13434
|
-
}, /* @__PURE__ */
|
13626
|
+
}, /* @__PURE__ */ React102.createElement(Section3.Toggle, null)), /* @__PURE__ */ React102.createElement(Section3.Title, {
|
13435
13627
|
id: titleId
|
13436
|
-
}, /* @__PURE__ */
|
13628
|
+
}, /* @__PURE__ */ React102.createElement(LineClamp2, {
|
13437
13629
|
lines: 1
|
13438
|
-
}, title), props.tag && /* @__PURE__ */
|
13630
|
+
}, title), props.tag && /* @__PURE__ */ React102.createElement(TagLabel, __spreadValues({}, props.tag)), props.badge && /* @__PURE__ */ React102.createElement(Chip2, {
|
13439
13631
|
text: props.badge
|
13440
|
-
}), props.chip && /* @__PURE__ */
|
13632
|
+
}), props.chip && /* @__PURE__ */ React102.createElement(StatusChip, __spreadValues({}, props.chip))), subtitle && /* @__PURE__ */ React102.createElement(Section3.Subtitle, {
|
13441
13633
|
className: tw("row-start-2", { "col-start-2": _collapsible })
|
13442
|
-
}, /* @__PURE__ */
|
13634
|
+
}, /* @__PURE__ */ React102.createElement(LineClamp2, {
|
13443
13635
|
lines: 1
|
13444
|
-
}, subtitle))), !isCollapsed && /* @__PURE__ */
|
13636
|
+
}, subtitle))), !isCollapsed && /* @__PURE__ */ React102.createElement(Section3.Actions, null, menu && /* @__PURE__ */ React102.createElement(Box.Flex, {
|
13445
13637
|
alignItems: "center"
|
13446
|
-
}, /* @__PURE__ */
|
13638
|
+
}, /* @__PURE__ */ React102.createElement(DropdownMenu2, {
|
13447
13639
|
onAction: (action) => onAction == null ? void 0 : onAction(action),
|
13448
13640
|
onOpenChange: onMenuOpenChange
|
13449
|
-
}, /* @__PURE__ */
|
13641
|
+
}, /* @__PURE__ */ React102.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ React102.createElement(Button.Icon, {
|
13450
13642
|
"aria-label": menuAriaLabel,
|
13451
|
-
icon:
|
13452
|
-
})), 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({
|
13453
13645
|
"aria-labelledby": titleId
|
13454
|
-
}, props.select)))), /* @__PURE__ */
|
13646
|
+
}, props.select)))), /* @__PURE__ */ React102.createElement(animated5.div, {
|
13455
13647
|
className: tw(`h-[1px]`),
|
13456
13648
|
style: { backgroundColor }
|
13457
|
-
})), /* @__PURE__ */
|
13649
|
+
})), /* @__PURE__ */ React102.createElement(animated5.div, {
|
13458
13650
|
id: regionId,
|
13459
13651
|
"aria-hidden": _collapsible ? isCollapsed ? true : void 0 : void 0,
|
13460
13652
|
style: spring,
|
13461
13653
|
className: tw({ "overflow-hidden": _collapsible })
|
13462
|
-
}, /* @__PURE__ */
|
13654
|
+
}, /* @__PURE__ */ React102.createElement("div", {
|
13463
13655
|
ref
|
13464
|
-
}, /* @__PURE__ */
|
13656
|
+
}, /* @__PURE__ */ React102.createElement(Section3.Body, null, children))));
|
13465
13657
|
};
|
13466
13658
|
|
13467
13659
|
// src/molecules/SegmentedControl/SegmentedControl.tsx
|
13468
|
-
import
|
13660
|
+
import React103 from "react";
|
13469
13661
|
var SegmentedControl = (_a) => {
|
13470
13662
|
var _b = _a, {
|
13471
13663
|
children,
|
@@ -13482,7 +13674,7 @@ var SegmentedControl = (_a) => {
|
|
13482
13674
|
"selected",
|
13483
13675
|
"className"
|
13484
13676
|
]);
|
13485
|
-
return /* @__PURE__ */
|
13677
|
+
return /* @__PURE__ */ React103.createElement("li", null, /* @__PURE__ */ React103.createElement("button", __spreadProps(__spreadValues({
|
13486
13678
|
type: "button"
|
13487
13679
|
}, rest), {
|
13488
13680
|
className: classNames(
|
@@ -13516,12 +13708,12 @@ var SegmentedControlGroup = (_a) => {
|
|
13516
13708
|
"border border-grey-20 text-grey-50": variant === "outlined",
|
13517
13709
|
"bg-grey-0": variant === "raised"
|
13518
13710
|
});
|
13519
|
-
return /* @__PURE__ */
|
13711
|
+
return /* @__PURE__ */ React103.createElement("ul", __spreadProps(__spreadValues({}, rest), {
|
13520
13712
|
"aria-label": ariaLabel,
|
13521
13713
|
className: classNames("Aquarium-SegmentedControl", classes2, className)
|
13522
|
-
}),
|
13714
|
+
}), React103.Children.map(
|
13523
13715
|
children,
|
13524
|
-
(child) =>
|
13716
|
+
(child) => React103.cloneElement(child, {
|
13525
13717
|
dense,
|
13526
13718
|
variant,
|
13527
13719
|
onClick: () => onChange(child.props.value),
|
@@ -13559,14 +13751,14 @@ var getCommonClassNames = (dense, selected) => tw(
|
|
13559
13751
|
);
|
13560
13752
|
|
13561
13753
|
// src/molecules/Stepper/Stepper.tsx
|
13562
|
-
import
|
13754
|
+
import React105 from "react";
|
13563
13755
|
|
13564
13756
|
// src/atoms/Stepper/Stepper.tsx
|
13565
|
-
import
|
13757
|
+
import React104 from "react";
|
13566
13758
|
var import_tick6 = __toESM(require_tick());
|
13567
13759
|
var Stepper = (_a) => {
|
13568
13760
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13569
|
-
return /* @__PURE__ */
|
13761
|
+
return /* @__PURE__ */ React104.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13570
13762
|
className: classNames(className)
|
13571
13763
|
}));
|
13572
13764
|
};
|
@@ -13580,7 +13772,7 @@ var ConnectorContainer = (_a) => {
|
|
13580
13772
|
"completed",
|
13581
13773
|
"dense"
|
13582
13774
|
]);
|
13583
|
-
return /* @__PURE__ */
|
13775
|
+
return /* @__PURE__ */ React104.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13584
13776
|
className: classNames(
|
13585
13777
|
tw("absolute w-full -left-1/2", {
|
13586
13778
|
"top-[3px] px-[14px]": Boolean(dense),
|
@@ -13592,7 +13784,7 @@ var ConnectorContainer = (_a) => {
|
|
13592
13784
|
};
|
13593
13785
|
var Connector = (_a) => {
|
13594
13786
|
var _b = _a, { children, className, completed, dense } = _b, rest = __objRest(_b, ["children", "className", "completed", "dense"]);
|
13595
|
-
return /* @__PURE__ */
|
13787
|
+
return /* @__PURE__ */ React104.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13596
13788
|
className: classNames(
|
13597
13789
|
tw("w-full", {
|
13598
13790
|
"bg-grey-20": !completed,
|
@@ -13606,7 +13798,7 @@ var Connector = (_a) => {
|
|
13606
13798
|
};
|
13607
13799
|
var Step = (_a) => {
|
13608
13800
|
var _b = _a, { className, state } = _b, rest = __objRest(_b, ["className", "state"]);
|
13609
|
-
return /* @__PURE__ */
|
13801
|
+
return /* @__PURE__ */ React104.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13610
13802
|
className: classNames(
|
13611
13803
|
tw("flex flex-col items-center text-grey-90 relative text-center", {
|
13612
13804
|
"text-grey-20": state === "inactive"
|
@@ -13627,13 +13819,13 @@ var getDenseClassNames = (state) => tw("h-[8px] w-[8px]", {
|
|
13627
13819
|
});
|
13628
13820
|
var Indicator = (_a) => {
|
13629
13821
|
var _b = _a, { children, className, state, dense } = _b, rest = __objRest(_b, ["children", "className", "state", "dense"]);
|
13630
|
-
return /* @__PURE__ */
|
13822
|
+
return /* @__PURE__ */ React104.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13631
13823
|
className: classNames(
|
13632
13824
|
tw("rounded-full flex justify-center items-center mx-2 mb-3"),
|
13633
13825
|
dense ? getDenseClassNames(state) : getClassNames(state),
|
13634
13826
|
className
|
13635
13827
|
)
|
13636
|
-
}), state === "completed" ? /* @__PURE__ */
|
13828
|
+
}), state === "completed" ? /* @__PURE__ */ React104.createElement(InlineIcon, {
|
13637
13829
|
icon: import_tick6.default
|
13638
13830
|
}) : dense ? null : children);
|
13639
13831
|
};
|
@@ -13644,26 +13836,26 @@ Stepper.ConnectorContainer = ConnectorContainer;
|
|
13644
13836
|
|
13645
13837
|
// src/molecules/Stepper/Stepper.tsx
|
13646
13838
|
var Stepper2 = ({ children, activeIndex, dense }) => {
|
13647
|
-
const steps =
|
13648
|
-
return /* @__PURE__ */
|
13839
|
+
const steps = React105.Children.count(children);
|
13840
|
+
return /* @__PURE__ */ React105.createElement(Stepper, {
|
13649
13841
|
role: "list",
|
13650
13842
|
className: "Aquarium-Stepper"
|
13651
|
-
}, /* @__PURE__ */
|
13843
|
+
}, /* @__PURE__ */ React105.createElement(Template, {
|
13652
13844
|
columns: steps
|
13653
|
-
},
|
13845
|
+
}, React105.Children.map(children, (child, index) => {
|
13654
13846
|
if (!isComponentType(child, Step2)) {
|
13655
13847
|
throw new Error("<Stepper> can only have <Stepper.Step> components as children");
|
13656
13848
|
} else {
|
13657
13849
|
const state = index > activeIndex ? "inactive" : index === activeIndex ? "active" : "completed";
|
13658
|
-
return /* @__PURE__ */
|
13850
|
+
return /* @__PURE__ */ React105.createElement(Stepper.Step, {
|
13659
13851
|
state,
|
13660
13852
|
"aria-current": state === "active" ? "step" : false,
|
13661
13853
|
role: "listitem"
|
13662
|
-
}, index > 0 && index <= steps && /* @__PURE__ */
|
13854
|
+
}, index > 0 && index <= steps && /* @__PURE__ */ React105.createElement(Stepper.ConnectorContainer, {
|
13663
13855
|
dense
|
13664
|
-
}, /* @__PURE__ */
|
13856
|
+
}, /* @__PURE__ */ React105.createElement(Stepper.ConnectorContainer.Connector, {
|
13665
13857
|
completed: state === "completed" || state === "active"
|
13666
|
-
})), /* @__PURE__ */
|
13858
|
+
})), /* @__PURE__ */ React105.createElement(Stepper.Step.Indicator, {
|
13667
13859
|
state,
|
13668
13860
|
dense
|
13669
13861
|
}, index + 1), child.props.children);
|
@@ -13676,8 +13868,8 @@ Step2.displayName = "Stepper.Step";
|
|
13676
13868
|
Stepper2.Step = Step2;
|
13677
13869
|
|
13678
13870
|
// src/molecules/SwitchGroup/SwitchGroup.tsx
|
13679
|
-
import
|
13680
|
-
import { useId as
|
13871
|
+
import React106, { useState as useState13 } from "react";
|
13872
|
+
import { useId as useId16 } from "@react-aria/utils";
|
13681
13873
|
var SwitchGroup = (_a) => {
|
13682
13874
|
var _b = _a, {
|
13683
13875
|
value,
|
@@ -13699,7 +13891,7 @@ var SwitchGroup = (_a) => {
|
|
13699
13891
|
if (value !== void 0 && value !== selectedItems) {
|
13700
13892
|
setSelectedItems(value);
|
13701
13893
|
}
|
13702
|
-
const errorMessageId =
|
13894
|
+
const errorMessageId = useId16();
|
13703
13895
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
13704
13896
|
const labelControlProps = getLabelControlProps(props);
|
13705
13897
|
const handleChange = (e) => {
|
@@ -13708,13 +13900,13 @@ var SwitchGroup = (_a) => {
|
|
13708
13900
|
setSelectedItems(updated);
|
13709
13901
|
onChange == null ? void 0 : onChange(updated);
|
13710
13902
|
};
|
13711
|
-
return /* @__PURE__ */
|
13903
|
+
return /* @__PURE__ */ React106.createElement(LabelControl, __spreadProps(__spreadValues(__spreadValues({
|
13712
13904
|
fieldset: true
|
13713
13905
|
}, labelControlProps), errorProps), {
|
13714
13906
|
className: "Aquarium-SwitchGroup"
|
13715
|
-
}), /* @__PURE__ */
|
13907
|
+
}), /* @__PURE__ */ React106.createElement(InputGroup, {
|
13716
13908
|
cols
|
13717
|
-
},
|
13909
|
+
}, React106.Children.map(children, (c) => {
|
13718
13910
|
var _a3, _b2, _c, _d;
|
13719
13911
|
if (!isComponentType(c, Switch2)) {
|
13720
13912
|
return null;
|
@@ -13722,7 +13914,7 @@ var SwitchGroup = (_a) => {
|
|
13722
13914
|
const str = (_a3 = c.props.value) == null ? void 0 : _a3.toString();
|
13723
13915
|
const defaultChecked = defaultValue === void 0 ? void 0 : str !== void 0 && defaultValue.includes(str);
|
13724
13916
|
const checked = value === void 0 ? void 0 : str !== void 0 && value.includes(str);
|
13725
|
-
return
|
13917
|
+
return React106.cloneElement(c, {
|
13726
13918
|
defaultChecked: (_b2 = c.props.defaultChecked) != null ? _b2 : defaultChecked,
|
13727
13919
|
checked: (_c = c.props.checked) != null ? _c : checked,
|
13728
13920
|
onChange: (_d = c.props.onChange) != null ? _d : handleChange,
|
@@ -13732,9 +13924,9 @@ var SwitchGroup = (_a) => {
|
|
13732
13924
|
})));
|
13733
13925
|
};
|
13734
13926
|
var SwitchGroupSkeleton = ({ options = 2 }) => {
|
13735
|
-
return /* @__PURE__ */
|
13927
|
+
return /* @__PURE__ */ React106.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React106.createElement("div", {
|
13736
13928
|
className: tw("flex flex-wrap flex-col gap-2")
|
13737
|
-
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */
|
13929
|
+
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */ React106.createElement(Switch2.Skeleton, {
|
13738
13930
|
key
|
13739
13931
|
}))));
|
13740
13932
|
};
|
@@ -13742,14 +13934,14 @@ SwitchGroup.Skeleton = SwitchGroupSkeleton;
|
|
13742
13934
|
SwitchGroup.Skeleton.displayName = "SwitchGroup.Skeleton";
|
13743
13935
|
|
13744
13936
|
// src/molecules/Textarea/Textarea.tsx
|
13745
|
-
import
|
13746
|
-
import { useId as
|
13747
|
-
import
|
13937
|
+
import React107, { useState as useState14 } from "react";
|
13938
|
+
import { useId as useId17 } from "@react-aria/utils";
|
13939
|
+
import omit16 from "lodash/omit";
|
13748
13940
|
import toString2 from "lodash/toString";
|
13749
|
-
var TextareaBase =
|
13941
|
+
var TextareaBase = React107.forwardRef(
|
13750
13942
|
(_a, ref) => {
|
13751
13943
|
var _b = _a, { readOnly = false, valid = true } = _b, props = __objRest(_b, ["readOnly", "valid"]);
|
13752
|
-
return /* @__PURE__ */
|
13944
|
+
return /* @__PURE__ */ React107.createElement("textarea", __spreadProps(__spreadValues({
|
13753
13945
|
ref
|
13754
13946
|
}, props), {
|
13755
13947
|
readOnly,
|
@@ -13757,26 +13949,26 @@ var TextareaBase = React106.forwardRef(
|
|
13757
13949
|
}));
|
13758
13950
|
}
|
13759
13951
|
);
|
13760
|
-
TextareaBase.Skeleton = () => /* @__PURE__ */
|
13952
|
+
TextareaBase.Skeleton = () => /* @__PURE__ */ React107.createElement(Skeleton, {
|
13761
13953
|
height: 58
|
13762
13954
|
});
|
13763
|
-
var Textarea =
|
13955
|
+
var Textarea = React107.forwardRef((props, ref) => {
|
13764
13956
|
var _a, _b, _c;
|
13765
13957
|
const [value, setValue] = useState14((_b = (_a = props.value) != null ? _a : props.defaultValue) != null ? _b : "");
|
13766
|
-
const defaultId =
|
13958
|
+
const defaultId = useId17();
|
13767
13959
|
const id = (_c = props.id) != null ? _c : defaultId;
|
13768
|
-
const errorMessageId =
|
13960
|
+
const errorMessageId = useId17();
|
13769
13961
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
13770
13962
|
const _d = getLabelControlProps(props), { "data-testid": dataTestId } = _d, labelControlProps = __objRest(_d, ["data-testid"]);
|
13771
|
-
const baseProps =
|
13772
|
-
return /* @__PURE__ */
|
13963
|
+
const baseProps = omit16(props, Object.keys(labelControlProps));
|
13964
|
+
return /* @__PURE__ */ React107.createElement(LabelControl, __spreadProps(__spreadValues({
|
13773
13965
|
id: `${id}-label`,
|
13774
13966
|
htmlFor: id,
|
13775
13967
|
messageId: errorMessageId,
|
13776
13968
|
length: value !== void 0 ? toString2(value).length : void 0
|
13777
13969
|
}, labelControlProps), {
|
13778
13970
|
className: "Aquarium-Textarea"
|
13779
|
-
}), /* @__PURE__ */
|
13971
|
+
}), /* @__PURE__ */ React107.createElement(TextareaBase, __spreadProps(__spreadValues(__spreadValues({
|
13780
13972
|
ref
|
13781
13973
|
}, baseProps), errorProps), {
|
13782
13974
|
id,
|
@@ -13793,48 +13985,48 @@ var Textarea = React106.forwardRef((props, ref) => {
|
|
13793
13985
|
})));
|
13794
13986
|
});
|
13795
13987
|
Textarea.displayName = "Textarea";
|
13796
|
-
var TextAreaSkeleton = () => /* @__PURE__ */
|
13988
|
+
var TextAreaSkeleton = () => /* @__PURE__ */ React107.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React107.createElement(TextareaBase.Skeleton, null));
|
13797
13989
|
Textarea.Skeleton = TextAreaSkeleton;
|
13798
13990
|
Textarea.Skeleton.displayName = "Textarea.Skeleton";
|
13799
13991
|
|
13800
13992
|
// src/molecules/Timeline/Timeline.tsx
|
13801
|
-
import
|
13993
|
+
import React109 from "react";
|
13802
13994
|
|
13803
13995
|
// src/atoms/Timeline/Timeline.tsx
|
13804
|
-
import
|
13996
|
+
import React108 from "react";
|
13805
13997
|
var Timeline = (_a) => {
|
13806
13998
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13807
|
-
return /* @__PURE__ */
|
13999
|
+
return /* @__PURE__ */ React108.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13808
14000
|
className: classNames(tw("grid grid-cols-[16px_1fr] gap-x-4"), className)
|
13809
14001
|
}));
|
13810
14002
|
};
|
13811
14003
|
var Content2 = (_a) => {
|
13812
14004
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13813
|
-
return /* @__PURE__ */
|
14005
|
+
return /* @__PURE__ */ React108.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13814
14006
|
className: classNames(tw("pb-6"), className)
|
13815
14007
|
}));
|
13816
14008
|
};
|
13817
14009
|
var Separator2 = (_a) => {
|
13818
14010
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13819
|
-
return /* @__PURE__ */
|
14011
|
+
return /* @__PURE__ */ React108.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13820
14012
|
className: classNames(tw("flex items-center justify-center h-5 w-5"), className)
|
13821
14013
|
}));
|
13822
14014
|
};
|
13823
14015
|
var LineContainer = (_a) => {
|
13824
14016
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13825
|
-
return /* @__PURE__ */
|
14017
|
+
return /* @__PURE__ */ React108.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13826
14018
|
className: classNames(tw("flex justify-center py-1"), className)
|
13827
14019
|
}));
|
13828
14020
|
};
|
13829
14021
|
var Line = (_a) => {
|
13830
14022
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13831
|
-
return /* @__PURE__ */
|
14023
|
+
return /* @__PURE__ */ React108.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13832
14024
|
className: classNames(tw("w-1 bg-grey-5 h-full justify-self-center"), className)
|
13833
14025
|
}));
|
13834
14026
|
};
|
13835
14027
|
var Dot = (_a) => {
|
13836
14028
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13837
|
-
return /* @__PURE__ */
|
14029
|
+
return /* @__PURE__ */ React108.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13838
14030
|
className: classNames(tw("bg-grey-30 h-[6px] w-[6px] rounded"), className)
|
13839
14031
|
}));
|
13840
14032
|
};
|
@@ -13849,54 +14041,54 @@ var import_error5 = __toESM(require_error());
|
|
13849
14041
|
var import_time2 = __toESM(require_time());
|
13850
14042
|
var import_warningSign5 = __toESM(require_warningSign());
|
13851
14043
|
var TimelineItem = () => null;
|
13852
|
-
var Timeline2 = ({ children }) => /* @__PURE__ */
|
14044
|
+
var Timeline2 = ({ children }) => /* @__PURE__ */ React109.createElement("div", {
|
13853
14045
|
className: "Aquarium-Timeline"
|
13854
|
-
},
|
14046
|
+
}, React109.Children.map(children, (item) => {
|
13855
14047
|
if (!isComponentType(item, TimelineItem)) {
|
13856
14048
|
throw new Error("<Timeline> can only have <Timeline.Item> components as children");
|
13857
14049
|
} else {
|
13858
14050
|
const { props, key } = item;
|
13859
|
-
return /* @__PURE__ */
|
14051
|
+
return /* @__PURE__ */ React109.createElement(Timeline, {
|
13860
14052
|
key: key != null ? key : props.title
|
13861
|
-
}, /* @__PURE__ */
|
14053
|
+
}, /* @__PURE__ */ React109.createElement(Timeline.Separator, null, props.variant === "error" ? /* @__PURE__ */ React109.createElement(Icon, {
|
13862
14054
|
icon: import_error5.default,
|
13863
14055
|
color: "error-30"
|
13864
|
-
}) : props.variant === "warning" ? /* @__PURE__ */
|
14056
|
+
}) : props.variant === "warning" ? /* @__PURE__ */ React109.createElement(Icon, {
|
13865
14057
|
icon: import_warningSign5.default,
|
13866
14058
|
color: "warning-30"
|
13867
|
-
}) : props.variant === "info" ? /* @__PURE__ */
|
14059
|
+
}) : props.variant === "info" ? /* @__PURE__ */ React109.createElement(Icon, {
|
13868
14060
|
icon: import_time2.default,
|
13869
14061
|
color: "info-30"
|
13870
|
-
}) : /* @__PURE__ */
|
14062
|
+
}) : /* @__PURE__ */ React109.createElement(Timeline.Separator.Dot, null)), /* @__PURE__ */ React109.createElement(Typography2.Caption, {
|
13871
14063
|
color: "grey-50"
|
13872
|
-
}, 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)));
|
13873
14065
|
}
|
13874
14066
|
}));
|
13875
|
-
var TimelineItemSkeleton = () => /* @__PURE__ */
|
14067
|
+
var TimelineItemSkeleton = () => /* @__PURE__ */ React109.createElement(Timeline, null, /* @__PURE__ */ React109.createElement(Timeline.Separator, null, /* @__PURE__ */ React109.createElement(Skeleton, {
|
13876
14068
|
width: 6,
|
13877
14069
|
height: 6,
|
13878
14070
|
rounded: true
|
13879
|
-
})), /* @__PURE__ */
|
14071
|
+
})), /* @__PURE__ */ React109.createElement(Skeleton, {
|
13880
14072
|
height: 12,
|
13881
14073
|
width: 120
|
13882
|
-
}), /* @__PURE__ */
|
14074
|
+
}), /* @__PURE__ */ React109.createElement(Timeline.LineContainer, null, /* @__PURE__ */ React109.createElement(Skeleton, {
|
13883
14075
|
width: 2,
|
13884
14076
|
height: "100%"
|
13885
|
-
})), /* @__PURE__ */
|
14077
|
+
})), /* @__PURE__ */ React109.createElement(Timeline.Content, null, /* @__PURE__ */ React109.createElement(Box, {
|
13886
14078
|
display: "flex",
|
13887
14079
|
flexDirection: "column",
|
13888
14080
|
gap: "3"
|
13889
|
-
}, /* @__PURE__ */
|
14081
|
+
}, /* @__PURE__ */ React109.createElement(Skeleton, {
|
13890
14082
|
height: 32,
|
13891
14083
|
width: "100%"
|
13892
|
-
}), /* @__PURE__ */
|
14084
|
+
}), /* @__PURE__ */ React109.createElement(Skeleton, {
|
13893
14085
|
height: 32,
|
13894
14086
|
width: "73%"
|
13895
|
-
}), /* @__PURE__ */
|
14087
|
+
}), /* @__PURE__ */ React109.createElement(Skeleton, {
|
13896
14088
|
height: 32,
|
13897
14089
|
width: "80%"
|
13898
14090
|
}))));
|
13899
|
-
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, {
|
13900
14092
|
key
|
13901
14093
|
})));
|
13902
14094
|
Timeline2.Item = TimelineItem;
|
@@ -13904,9 +14096,9 @@ Timeline2.Skeleton = TimelineSkeleton;
|
|
13904
14096
|
Timeline2.Skeleton.displayName = "Timeline.Skeleton";
|
13905
14097
|
|
13906
14098
|
// src/utils/table/useTableSelect.ts
|
13907
|
-
import
|
14099
|
+
import React110 from "react";
|
13908
14100
|
var useTableSelect = (data, { key }) => {
|
13909
|
-
const [selected, setSelected] =
|
14101
|
+
const [selected, setSelected] = React110.useState([]);
|
13910
14102
|
const allSelected = selected.length === data.length;
|
13911
14103
|
const isSelected = (dot) => selected.includes(dot[key]);
|
13912
14104
|
const selectAll = () => setSelected(data.map((dot) => dot[key]));
|
@@ -14077,6 +14269,7 @@ export {
|
|
14077
14269
|
DesignSystemContext,
|
14078
14270
|
Dialog,
|
14079
14271
|
Divider2 as Divider,
|
14272
|
+
Drawer,
|
14080
14273
|
Dropdown,
|
14081
14274
|
DropdownButton,
|
14082
14275
|
DropdownMenu2 as DropdownMenu,
|
@@ -14180,6 +14373,7 @@ export {
|
|
14180
14373
|
createTabsComponent,
|
14181
14374
|
system_default as default,
|
14182
14375
|
getLabelControlProps,
|
14376
|
+
isOnSortChangedDirection,
|
14183
14377
|
isOutOfBounds,
|
14184
14378
|
placementOrder,
|
14185
14379
|
export_theme as theme,
|