@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.cjs
CHANGED
@@ -3291,7 +3291,7 @@ var require_more = __commonJS({
|
|
3291
3291
|
"src/icons/more.js"(exports) {
|
3292
3292
|
"use strict";
|
3293
3293
|
var data = {
|
3294
|
-
"body": '<
|
3294
|
+
"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>',
|
3295
3295
|
"left": 0,
|
3296
3296
|
"top": 0,
|
3297
3297
|
"width": 22,
|
@@ -4644,6 +4644,7 @@ __export(system_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,
|
@@ -4747,6 +4748,7 @@ __export(system_exports, {
|
|
4747
4748
|
createTabsComponent: () => createTabsComponent,
|
4748
4749
|
default: () => system_default,
|
4749
4750
|
getLabelControlProps: () => getLabelControlProps,
|
4751
|
+
isOnSortChangedDirection: () => isOnSortChangedDirection,
|
4750
4752
|
isOutOfBounds: () => isOutOfBounds,
|
4751
4753
|
placementOrder: () => placementOrder,
|
4752
4754
|
theme: () => import_resolveTheme2.theme,
|
@@ -4791,6 +4793,7 @@ __export(molecules_exports, {
|
|
4791
4793
|
DesignSystemContext: () => DesignSystemContext,
|
4792
4794
|
Dialog: () => Dialog,
|
4793
4795
|
Divider: () => Divider2,
|
4796
|
+
Drawer: () => Drawer,
|
4794
4797
|
Dropdown: () => Dropdown,
|
4795
4798
|
DropdownButton: () => DropdownButton,
|
4796
4799
|
DropdownMenu: () => DropdownMenu2,
|
@@ -4874,6 +4877,7 @@ __export(molecules_exports, {
|
|
4874
4877
|
cellProps: () => cellProps,
|
4875
4878
|
columnIsFieldColumn: () => columnIsFieldColumn,
|
4876
4879
|
createTabsComponent: () => createTabsComponent,
|
4880
|
+
isOnSortChangedDirection: () => isOnSortChangedDirection,
|
4877
4881
|
toSortDirection: () => toSortDirection,
|
4878
4882
|
usePagination: () => usePagination,
|
4879
4883
|
usePopoverContext: () => usePopoverContext,
|
@@ -10511,20 +10515,35 @@ var cellProps = (column) => ({
|
|
10511
10515
|
stickyColumn: column.sticky
|
10512
10516
|
});
|
10513
10517
|
var columnIsFieldColumn = (column) => Boolean(column && column.field);
|
10518
|
+
function isOnSortChangedDirection(value) {
|
10519
|
+
return value === void 0 || ["ascending", "descending"].includes(value);
|
10520
|
+
}
|
10514
10521
|
|
10515
10522
|
// src/utils/table/useTableSort.tsx
|
10516
10523
|
var import_react66 = __toESM(require("react"));
|
10517
|
-
var
|
10518
|
-
|
10524
|
+
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;
|
10525
|
+
var useTableSort = (props) => {
|
10526
|
+
const onSortChanged = props && "onSortChanged" in props ? props.onSortChanged : void 0;
|
10527
|
+
const [sort, setSort] = import_react66.default.useState(props && getDefaultSort(props));
|
10528
|
+
const setSortAndEmitOnSortChangedEvent = (sort2) => {
|
10529
|
+
setSort(sort2);
|
10530
|
+
if (onSortChanged) {
|
10531
|
+
if (sort2 && isOnSortChangedDirection(sort2.direction)) {
|
10532
|
+
onSortChanged({ key: sort2.column.key, direction: sort2 == null ? void 0 : sort2.direction });
|
10533
|
+
} else {
|
10534
|
+
onSortChanged(null);
|
10535
|
+
}
|
10536
|
+
}
|
10537
|
+
};
|
10519
10538
|
const handleSortClick = (column) => {
|
10520
10539
|
if (sort && sort.column.headerName === column.headerName) {
|
10521
10540
|
if (sort.direction === "ascending") {
|
10522
|
-
|
10541
|
+
setSortAndEmitOnSortChangedEvent({ column, direction: "descending" });
|
10523
10542
|
} else {
|
10524
|
-
|
10543
|
+
setSortAndEmitOnSortChangedEvent(void 0);
|
10525
10544
|
}
|
10526
10545
|
} else {
|
10527
|
-
|
10546
|
+
setSortAndEmitOnSortChangedEvent({ column, direction: "ascending" });
|
10528
10547
|
}
|
10529
10548
|
};
|
10530
10549
|
return [sort, handleSortClick];
|
@@ -10784,12 +10803,15 @@ var DataList2 = ({
|
|
10784
10803
|
getGroupRow,
|
10785
10804
|
onGroupToggled,
|
10786
10805
|
expandedGroupIds,
|
10787
|
-
defaultSort
|
10806
|
+
defaultSort,
|
10807
|
+
onSortChanged
|
10788
10808
|
}) => {
|
10789
10809
|
var _a;
|
10790
10810
|
const defaultSortedColumn = columns.find((c) => c.headerName === (defaultSort == null ? void 0 : defaultSort.headerName));
|
10791
10811
|
const initialSortState = defaultSortedColumn ? { column: defaultSortedColumn, direction: (_a = defaultSort == null ? void 0 : defaultSort.direction) != null ? _a : "ascending" } : void 0;
|
10792
|
-
const [sort, updateSort] = useTableSort(
|
10812
|
+
const [sort, updateSort] = useTableSort(
|
10813
|
+
onSortChanged ? __spreadProps(__spreadValues({}, initialSortState), { onSortChanged }) : initialSortState
|
10814
|
+
);
|
10793
10815
|
const sortedRows = sortRowsBy(rows, sort);
|
10794
10816
|
const groups = group ? (0, import_isFunction.default)(group) ? group(sortedRows) : (0, import_groupBy2.default)(sortedRows, group) : void 0;
|
10795
10817
|
const groupKeys = groups ? Object.keys(groups) : void 0;
|
@@ -11039,7 +11061,8 @@ var DataTable = (_a) => {
|
|
11039
11061
|
onMenuOpenChange,
|
11040
11062
|
pagination,
|
11041
11063
|
disabled,
|
11042
|
-
defaultSort
|
11064
|
+
defaultSort,
|
11065
|
+
onSortChanged
|
11043
11066
|
} = _b, rest = __objRest(_b, [
|
11044
11067
|
"columns",
|
11045
11068
|
"rows",
|
@@ -11054,12 +11077,15 @@ var DataTable = (_a) => {
|
|
11054
11077
|
"onMenuOpenChange",
|
11055
11078
|
"pagination",
|
11056
11079
|
"disabled",
|
11057
|
-
"defaultSort"
|
11080
|
+
"defaultSort",
|
11081
|
+
"onSortChanged"
|
11058
11082
|
]);
|
11059
11083
|
var _a2;
|
11060
11084
|
const defaultSortedColumn = columns.find((c) => c.headerName === (defaultSort == null ? void 0 : defaultSort.headerName));
|
11061
11085
|
const initialSortState = defaultSortedColumn ? { column: defaultSortedColumn, direction: (_a2 = defaultSort == null ? void 0 : defaultSort.direction) != null ? _a2 : "ascending" } : void 0;
|
11062
|
-
const [sort, updateSort] = useTableSort(
|
11086
|
+
const [sort, updateSort] = useTableSort(
|
11087
|
+
onSortChanged ? __spreadProps(__spreadValues({}, initialSortState), { onSortChanged }) : initialSortState
|
11088
|
+
);
|
11063
11089
|
const sortedRows = sortRowsBy(rows, sort);
|
11064
11090
|
const amountOfColumns = columns.length + (menu ? 1 : 0);
|
11065
11091
|
const PaginationFooter = import_react75.default.useCallback(
|
@@ -11201,10 +11227,23 @@ var DIALOG_ICONS_AND_COLORS = {
|
|
11201
11227
|
// src/atoms/Modal/Modal.tsx
|
11202
11228
|
var import_react76 = __toESM(require("react"));
|
11203
11229
|
var Modal = (_a) => {
|
11204
|
-
var _b = _a, {
|
11230
|
+
var _b = _a, {
|
11231
|
+
children,
|
11232
|
+
kind = "dialog",
|
11233
|
+
className,
|
11234
|
+
open
|
11235
|
+
} = _b, rest = __objRest(_b, [
|
11236
|
+
"children",
|
11237
|
+
"kind",
|
11238
|
+
"className",
|
11239
|
+
"open"
|
11240
|
+
]);
|
11205
11241
|
return open ? /* @__PURE__ */ import_react76.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
11206
11242
|
className: classNames(
|
11207
|
-
tw("inset-0 overflow-y-auto z-modal
|
11243
|
+
tw("inset-0 overflow-y-auto z-modal fixed"),
|
11244
|
+
{
|
11245
|
+
"py-7 justify-center flex items-center": kind === "dialog"
|
11246
|
+
},
|
11208
11247
|
className
|
11209
11248
|
)
|
11210
11249
|
}), children) : null;
|
@@ -11217,27 +11256,30 @@ Modal.BackDrop = (_a) => {
|
|
11217
11256
|
};
|
11218
11257
|
Modal.Dialog = import_react76.default.forwardRef(
|
11219
11258
|
(_a, ref) => {
|
11220
|
-
var _b = _a, { children, className, size = "sm" } = _b, rest = __objRest(_b, ["children", "className", "size"]);
|
11259
|
+
var _b = _a, { kind = "dialog", children, className, size = "sm" } = _b, rest = __objRest(_b, ["kind", "children", "className", "size"]);
|
11260
|
+
const commonClasses = tw("bg-white max-h-full flex flex-col");
|
11261
|
+
const dialogClasses = classNames("relative w-full rounded", {
|
11262
|
+
"max-w-[600px]": size === "sm",
|
11263
|
+
"max-w-[940px]": size === "md",
|
11264
|
+
"min-h-full": size === "full"
|
11265
|
+
});
|
11266
|
+
const drawerClasses = classNames("absolute h-full", {
|
11267
|
+
"w-[360px]": size === "sm",
|
11268
|
+
"w-[560px]": size === "md",
|
11269
|
+
"w-[1080px]": size === "full"
|
11270
|
+
});
|
11221
11271
|
return /* @__PURE__ */ import_react76.default.createElement("div", __spreadProps(__spreadValues({
|
11222
11272
|
ref,
|
11223
11273
|
"aria-modal": "true"
|
11224
11274
|
}, rest), {
|
11225
|
-
className: classNames(
|
11226
|
-
tw("relative bg-white rounded mx-7 w-full max-h-full flex flex-col"),
|
11227
|
-
{
|
11228
|
-
"max-w-[600px]": size === "sm",
|
11229
|
-
"max-w-[940px]": size === "md",
|
11230
|
-
"min-h-full": size === "full"
|
11231
|
-
},
|
11232
|
-
className
|
11233
|
-
)
|
11275
|
+
className: classNames(commonClasses, kind === "dialog" ? dialogClasses : drawerClasses, className)
|
11234
11276
|
}), children);
|
11235
11277
|
}
|
11236
11278
|
);
|
11237
11279
|
Modal.Header = (_a) => {
|
11238
11280
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
11239
11281
|
return /* @__PURE__ */ import_react76.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
11240
|
-
className: classNames(tw("
|
11282
|
+
className: classNames(tw("pl-7 pr-[64px] py-6 gap-3 flex items-center"), className)
|
11241
11283
|
}), children);
|
11242
11284
|
};
|
11243
11285
|
Modal.HeaderImage = (_a) => {
|
@@ -11255,16 +11297,21 @@ Modal.HeaderImage = (_a) => {
|
|
11255
11297
|
Modal.CloseButtonContainer = (_a) => {
|
11256
11298
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
11257
11299
|
return /* @__PURE__ */ import_react76.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
11258
|
-
className: classNames(tw("absolute top-[
|
11300
|
+
className: classNames(tw("absolute top-[24px] right-[28px]"), className)
|
11259
11301
|
}));
|
11260
11302
|
};
|
11261
11303
|
Modal.Title = (_a) => {
|
11262
|
-
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
11304
|
+
var _b = _a, { kind = "dialog", children, className } = _b, rest = __objRest(_b, ["kind", "children", "className"]);
|
11263
11305
|
return /* @__PURE__ */ import_react76.default.createElement(Typography, __spreadValues({
|
11264
11306
|
htmlTag: "h2",
|
11265
11307
|
variant: "subheading",
|
11266
11308
|
color: "grey-90",
|
11267
|
-
className: classNames(
|
11309
|
+
className: classNames(
|
11310
|
+
tw({
|
11311
|
+
"text-ellipsis overflow-x-hidden whitespace-nowrap": kind === "drawer"
|
11312
|
+
}),
|
11313
|
+
className
|
11314
|
+
)
|
11268
11315
|
}, rest), children);
|
11269
11316
|
};
|
11270
11317
|
Modal.Subtitle = (_a) => {
|
@@ -11277,7 +11324,7 @@ Modal.Subtitle = (_a) => {
|
|
11277
11324
|
Modal.TitleContainer = (_a) => {
|
11278
11325
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
11279
11326
|
return /* @__PURE__ */ import_react76.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
11280
|
-
className: classNames(tw("flex flex-col grow
|
11327
|
+
className: classNames(tw("flex flex-col grow"), className)
|
11281
11328
|
}), children);
|
11282
11329
|
};
|
11283
11330
|
Modal.Body = (_a) => {
|
@@ -11353,250 +11400,677 @@ var DialogWrapper = ({
|
|
11353
11400
|
}, (0, import_omit8.default)(primaryAction, "text")), primaryAction.text))));
|
11354
11401
|
};
|
11355
11402
|
|
11356
|
-
// src/molecules/
|
11357
|
-
var
|
11358
|
-
|
11359
|
-
|
11360
|
-
var import_react80 = __toESM(require("react"));
|
11361
|
-
var import_interactions3 = require("@react-aria/interactions");
|
11403
|
+
// src/molecules/Drawer/Drawer.tsx
|
11404
|
+
var import_react79 = __toESM(require("react"));
|
11405
|
+
var import_react_stately = require("react-stately");
|
11406
|
+
var import_dialog2 = require("@react-aria/dialog");
|
11362
11407
|
var import_overlays8 = require("@react-aria/overlays");
|
11363
11408
|
var import_utils16 = require("@react-aria/utils");
|
11364
|
-
var
|
11365
|
-
var
|
11409
|
+
var import_web4 = require("@react-spring/web");
|
11410
|
+
var import_castArray = __toESM(require("lodash/castArray"));
|
11366
11411
|
var import_omit9 = __toESM(require("lodash/omit"));
|
11367
11412
|
|
11368
|
-
// src/molecules/
|
11413
|
+
// src/molecules/Tabs/Tabs.tsx
|
11369
11414
|
var import_react78 = __toESM(require("react"));
|
11370
|
-
var
|
11371
|
-
var
|
11372
|
-
|
11373
|
-
|
11374
|
-
|
11375
|
-
|
11376
|
-
|
11377
|
-
className: tw("outline-none")
|
11378
|
-
}), children);
|
11415
|
+
var import_isNumber5 = __toESM(require("lodash/isNumber"));
|
11416
|
+
var import_kebabCase = __toESM(require("lodash/kebabCase"));
|
11417
|
+
var import_chevronLeft4 = __toESM(require_chevronLeft());
|
11418
|
+
var import_chevronRight4 = __toESM(require_chevronRight());
|
11419
|
+
var import_warningSign4 = __toESM(require_warningSign());
|
11420
|
+
var isTabComponent = (c) => {
|
11421
|
+
return import_react78.default.isValidElement(c) && (c.type === Tab || c.type === ModalTab);
|
11379
11422
|
};
|
11380
|
-
|
11381
|
-
|
11382
|
-
|
11383
|
-
|
11384
|
-
|
11385
|
-
|
11386
|
-
|
11387
|
-
|
11423
|
+
var Tab = import_react78.default.forwardRef(
|
11424
|
+
({ className, id, title, children }, ref) => {
|
11425
|
+
return /* @__PURE__ */ import_react78.default.createElement("div", {
|
11426
|
+
ref,
|
11427
|
+
id: `${id != null ? id : (0, import_kebabCase.default)(title)}-panel`,
|
11428
|
+
className,
|
11429
|
+
role: "tabpanel",
|
11430
|
+
tabIndex: 0,
|
11431
|
+
"aria-labelledby": `${id != null ? id : (0, import_kebabCase.default)(title)}-tab`
|
11432
|
+
}, children);
|
11388
11433
|
}
|
11389
|
-
|
11434
|
+
);
|
11435
|
+
var TabContainer = (_a) => {
|
11436
|
+
var _b = _a, { className, children } = _b, rest = __objRest(_b, ["className", "children"]);
|
11437
|
+
return /* @__PURE__ */ import_react78.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
11438
|
+
className: classNames("py-6 z-0", className)
|
11439
|
+
}), children);
|
11390
11440
|
};
|
11391
|
-
|
11392
|
-
|
11393
|
-
var
|
11394
|
-
const
|
11395
|
-
|
11396
|
-
|
11397
|
-
|
11398
|
-
|
11399
|
-
|
11400
|
-
|
11401
|
-
|
11402
|
-
|
11403
|
-
|
11404
|
-
|
11405
|
-
|
11406
|
-
|
11407
|
-
|
11408
|
-
|
11409
|
-
|
11410
|
-
|
11411
|
-
|
11412
|
-
|
11413
|
-
|
11414
|
-
|
11415
|
-
|
11416
|
-
|
11417
|
-
"
|
11418
|
-
"
|
11419
|
-
"
|
11420
|
-
|
11421
|
-
|
11422
|
-
|
11423
|
-
|
11424
|
-
|
11425
|
-
|
11426
|
-
|
11427
|
-
|
11428
|
-
|
11429
|
-
|
11430
|
-
|
11431
|
-
|
11432
|
-
|
11433
|
-
|
11434
|
-
|
11441
|
+
var ModalTab = Tab;
|
11442
|
+
var ModalTabContainer = TabContainer;
|
11443
|
+
var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
11444
|
+
const Tab2 = import_react78.default.forwardRef(
|
11445
|
+
(_a, ref) => {
|
11446
|
+
var _b = _a, {
|
11447
|
+
id,
|
11448
|
+
value,
|
11449
|
+
status = "default",
|
11450
|
+
disabled,
|
11451
|
+
badge,
|
11452
|
+
tooltip,
|
11453
|
+
title,
|
11454
|
+
index,
|
11455
|
+
selected,
|
11456
|
+
onSelected,
|
11457
|
+
showNotification = false,
|
11458
|
+
className
|
11459
|
+
} = _b, rest = __objRest(_b, [
|
11460
|
+
"id",
|
11461
|
+
"value",
|
11462
|
+
"status",
|
11463
|
+
"disabled",
|
11464
|
+
"badge",
|
11465
|
+
"tooltip",
|
11466
|
+
"title",
|
11467
|
+
"index",
|
11468
|
+
"selected",
|
11469
|
+
"onSelected",
|
11470
|
+
"showNotification",
|
11471
|
+
"className"
|
11472
|
+
]);
|
11473
|
+
const _id = id != null ? id : (0, import_kebabCase.default)(title);
|
11474
|
+
let statusIcon = void 0;
|
11475
|
+
if (status === "warning") {
|
11476
|
+
statusIcon = /* @__PURE__ */ import_react78.default.createElement(InlineIcon, {
|
11477
|
+
icon: import_warningSign4.default,
|
11478
|
+
color: selected ? void 0 : "warning-80"
|
11479
|
+
});
|
11480
|
+
} else if (status === "error") {
|
11481
|
+
statusIcon = /* @__PURE__ */ import_react78.default.createElement(InlineIcon, {
|
11482
|
+
icon: import_warningSign4.default,
|
11483
|
+
color: selected ? void 0 : "error-50"
|
11484
|
+
});
|
11485
|
+
}
|
11486
|
+
const tab = /* @__PURE__ */ import_react78.default.createElement(Component, __spreadValues({
|
11487
|
+
ref,
|
11488
|
+
id: `${_id}-tab`,
|
11489
|
+
onClick: () => !disabled && onSelected(value != null ? value : index),
|
11490
|
+
className: classNames(className, "px-5 py-3 z-10 no-underline appearance-none outline-none h-full", {
|
11491
|
+
"cursor-default": disabled,
|
11492
|
+
"text-grey-80 focus:text-primary-80": !selected,
|
11493
|
+
"hover:bg-grey-0 hover:border-grey-20": !selected && !disabled,
|
11494
|
+
"border-b-2": !defaultUnderlineHidden || selected,
|
11495
|
+
"border-grey-10": !selected,
|
11496
|
+
"border-primary-80": selected
|
11497
|
+
}),
|
11498
|
+
type: "button",
|
11499
|
+
role: "tab",
|
11500
|
+
"aria-selected": selected,
|
11501
|
+
"aria-controls": `${_id}-panel`,
|
11502
|
+
tabIndex: disabled ? void 0 : 0
|
11503
|
+
}, rest), /* @__PURE__ */ import_react78.default.createElement(Typography2, {
|
11504
|
+
htmlTag: "div",
|
11505
|
+
variant: "small-strong",
|
11506
|
+
color: selected ? "primary-80" : disabled ? "grey-20" : "current",
|
11507
|
+
className: tw("inline-flex items-center gap-3")
|
11508
|
+
}, showNotification ? /* @__PURE__ */ import_react78.default.createElement(Badge.Notification, {
|
11509
|
+
right: "-4px",
|
11510
|
+
top: "3px"
|
11511
|
+
}, /* @__PURE__ */ import_react78.default.createElement("span", {
|
11512
|
+
className: tw("whitespace-nowrap")
|
11513
|
+
}, title)) : /* @__PURE__ */ import_react78.default.createElement("span", {
|
11514
|
+
className: tw("whitespace-nowrap")
|
11515
|
+
}, title), (0, import_isNumber5.default)(badge) && /* @__PURE__ */ import_react78.default.createElement(Typography2, {
|
11516
|
+
htmlTag: "span",
|
11517
|
+
variant: "small",
|
11518
|
+
color: selected ? "primary-80" : "grey-5",
|
11519
|
+
className: "leading-none"
|
11520
|
+
}, /* @__PURE__ */ import_react78.default.createElement(TabBadge, {
|
11521
|
+
kind: "filled",
|
11522
|
+
value: badge,
|
11523
|
+
textClassname: classNames({ "text-white": selected, "text-grey-50": !selected })
|
11524
|
+
})), statusIcon));
|
11525
|
+
return tooltip ? /* @__PURE__ */ import_react78.default.createElement(Tooltip, {
|
11526
|
+
content: tooltip
|
11527
|
+
}, tab) : tab;
|
11435
11528
|
}
|
11436
|
-
|
11437
|
-
|
11529
|
+
);
|
11530
|
+
Tab2.displayName = displayName;
|
11531
|
+
return Tab2;
|
11438
11532
|
};
|
11439
|
-
var
|
11440
|
-
|
11441
|
-
|
11442
|
-
|
11443
|
-
|
11444
|
-
|
11445
|
-
|
11446
|
-
|
11447
|
-
const
|
11448
|
-
const
|
11449
|
-
const
|
11450
|
-
|
11451
|
-
|
11533
|
+
var TabItem = asTabItem("button", "TabItem");
|
11534
|
+
var CARET_OFFSET = 24;
|
11535
|
+
var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderChildren) => {
|
11536
|
+
const Tabs2 = (props) => {
|
11537
|
+
var _a, _b;
|
11538
|
+
const { className, value, defaultValue, onChange, children } = props;
|
11539
|
+
const childArr = import_react78.default.Children.toArray(children);
|
11540
|
+
const firstTab = childArr[0];
|
11541
|
+
const firstTabValue = isTabComponent(firstTab) ? firstTab.props.value : -1;
|
11542
|
+
const [selected, setSelected] = (0, import_react78.useState)((_b = (_a = value != null ? value : defaultValue) != null ? _a : firstTabValue) != null ? _b : 0);
|
11543
|
+
const [leftCaret, showLeftCaret] = (0, import_react78.useState)(false);
|
11544
|
+
const [rightCaret, showRightCaret] = (0, import_react78.useState)(false);
|
11545
|
+
const parentRef = (0, import_react78.useRef)(null);
|
11546
|
+
const containerRef = (0, import_react78.useRef)(null);
|
11547
|
+
const tabsRef = (0, import_react78.useRef)(null);
|
11548
|
+
const revealSelectedTab = ({ smooth }) => {
|
11549
|
+
var _a2, _b2;
|
11550
|
+
const container = containerRef.current;
|
11551
|
+
const tabs = tabsRef.current;
|
11552
|
+
const values = import_react78.default.Children.map(
|
11553
|
+
children,
|
11554
|
+
(tab, i) => {
|
11555
|
+
var _a3;
|
11556
|
+
return (_a3 = tab == null ? void 0 : tab.props.value) != null ? _a3 : i;
|
11557
|
+
}
|
11558
|
+
);
|
11559
|
+
const idx = (_a2 = values == null ? void 0 : values.findIndex((val) => value === val)) != null ? _a2 : -1;
|
11560
|
+
const child = Array.from((_b2 = tabs == null ? void 0 : tabs.childNodes) != null ? _b2 : [])[idx];
|
11561
|
+
if (!container || !(child instanceof HTMLElement)) {
|
11562
|
+
return;
|
11563
|
+
}
|
11564
|
+
const { width: containerWidth, x: containerX } = container.getBoundingClientRect();
|
11565
|
+
const { x, width } = child.getBoundingClientRect();
|
11566
|
+
const isInViewPort = x >= containerX && x + width <= containerX + containerWidth;
|
11567
|
+
if (!isInViewPort) {
|
11568
|
+
container.scrollTo({
|
11569
|
+
left: container.scrollLeft + Math.ceil(x + width + CARET_OFFSET - containerX - containerWidth),
|
11570
|
+
behavior: smooth ? "smooth" : void 0
|
11571
|
+
});
|
11572
|
+
}
|
11452
11573
|
};
|
11453
|
-
|
11454
|
-
|
11455
|
-
|
11456
|
-
|
11457
|
-
|
11458
|
-
|
11459
|
-
};
|
11460
|
-
|
11461
|
-
|
11462
|
-
|
11463
|
-
|
11464
|
-
|
11465
|
-
|
11466
|
-
|
11467
|
-
|
11468
|
-
|
11469
|
-
|
11470
|
-
|
11471
|
-
|
11472
|
-
|
11473
|
-
|
11474
|
-
|
11475
|
-
|
11476
|
-
|
11477
|
-
|
11478
|
-
|
11479
|
-
|
11480
|
-
|
11481
|
-
|
11482
|
-
|
11483
|
-
};
|
11484
|
-
|
11485
|
-
|
11486
|
-
|
11487
|
-
|
11488
|
-
|
11489
|
-
|
11490
|
-
}
|
11491
|
-
|
11492
|
-
|
11493
|
-
|
11494
|
-
|
11495
|
-
|
11574
|
+
const updateCarets = () => {
|
11575
|
+
const pEl = parentRef.current;
|
11576
|
+
const el = containerRef.current;
|
11577
|
+
if (!pEl || !el) {
|
11578
|
+
return;
|
11579
|
+
}
|
11580
|
+
const { width } = pEl.getBoundingClientRect();
|
11581
|
+
const hasLeftCaret = el.scrollWidth > width && el.scrollLeft !== 0;
|
11582
|
+
const hasRightCaret = el.scrollWidth > width && Math.round(el.scrollLeft + el.getBoundingClientRect().width) !== Math.round(el.scrollWidth);
|
11583
|
+
showLeftCaret(hasLeftCaret);
|
11584
|
+
showRightCaret(hasRightCaret);
|
11585
|
+
};
|
11586
|
+
(0, import_react78.useEffect)(() => {
|
11587
|
+
if (value === void 0) {
|
11588
|
+
return;
|
11589
|
+
}
|
11590
|
+
updateCarets();
|
11591
|
+
setSelected(value);
|
11592
|
+
revealSelectedTab({ smooth: value !== selected });
|
11593
|
+
}, [value, import_react78.default.Children.count(children)]);
|
11594
|
+
(0, import_react78.useLayoutEffect)(() => {
|
11595
|
+
var _a2;
|
11596
|
+
updateCarets();
|
11597
|
+
(_a2 = containerRef.current) == null ? void 0 : _a2.addEventListener("scroll", updateCarets);
|
11598
|
+
window.addEventListener("resize", updateCarets);
|
11599
|
+
return () => {
|
11600
|
+
var _a3;
|
11601
|
+
(_a3 = containerRef.current) == null ? void 0 : _a3.removeEventListener("scroll", updateCarets);
|
11602
|
+
window.removeEventListener("resize", updateCarets);
|
11603
|
+
};
|
11604
|
+
}, [parentRef.current, containerRef.current, children]);
|
11605
|
+
const handleScrollToNext = (direction) => {
|
11606
|
+
const container = containerRef.current;
|
11607
|
+
const tabs = tabsRef.current;
|
11608
|
+
if (!container || !tabs) {
|
11609
|
+
return;
|
11610
|
+
}
|
11611
|
+
const { width: containerWidth, x: containerX } = container.getBoundingClientRect();
|
11612
|
+
const children2 = Array.from(tabs.childNodes).filter(
|
11613
|
+
(c) => c instanceof HTMLElement
|
11614
|
+
);
|
11615
|
+
if (direction === "right") {
|
11616
|
+
const next = children2.find((c) => {
|
11617
|
+
const { x, width } = c.getBoundingClientRect();
|
11618
|
+
return Math.round(x + width - containerX - containerWidth) > 0;
|
11619
|
+
});
|
11620
|
+
if (next instanceof HTMLElement) {
|
11621
|
+
const { x, width } = next.getBoundingClientRect();
|
11622
|
+
container.scrollTo({
|
11623
|
+
left: container.scrollLeft + Math.ceil(x + width + CARET_OFFSET - containerX - containerWidth),
|
11624
|
+
behavior: "smooth"
|
11625
|
+
});
|
11626
|
+
}
|
11627
|
+
} else {
|
11628
|
+
const next = children2.find((c) => {
|
11629
|
+
const { x, width } = c.getBoundingClientRect();
|
11630
|
+
return Math.round(x + width - containerX) >= 0;
|
11631
|
+
});
|
11632
|
+
if (next instanceof HTMLElement) {
|
11633
|
+
const { x } = next.getBoundingClientRect();
|
11634
|
+
container.scrollTo({
|
11635
|
+
left: container.scrollLeft - Math.abs(x - containerX - CARET_OFFSET),
|
11636
|
+
behavior: "smooth"
|
11637
|
+
});
|
11638
|
+
}
|
11639
|
+
}
|
11640
|
+
};
|
11641
|
+
const handleKeyDown = (event) => {
|
11642
|
+
const target = event.target;
|
11643
|
+
const parent = target.parentElement;
|
11644
|
+
const first = parent.firstChild;
|
11645
|
+
const last = parent.lastChild;
|
11646
|
+
const next = target.nextElementSibling;
|
11647
|
+
const prev = target.previousElementSibling;
|
11648
|
+
if (event.key === "ArrowRight") {
|
11649
|
+
(next != null ? next : first).focus();
|
11650
|
+
} else if (event.key === "ArrowLeft") {
|
11651
|
+
(prev != null ? prev : last).focus();
|
11652
|
+
}
|
11653
|
+
};
|
11654
|
+
const handleSelected = (key) => {
|
11655
|
+
(onChange != null ? onChange : setSelected)(key);
|
11656
|
+
};
|
11657
|
+
import_react78.default.Children.forEach(children, (c) => {
|
11658
|
+
if (c && !isTabComponent(c)) {
|
11659
|
+
throw new Error("<Tabs> can only have <Tabs.Tab> components as children");
|
11660
|
+
}
|
11496
11661
|
});
|
11497
|
-
return
|
11498
|
-
|
11499
|
-
|
11500
|
-
|
11501
|
-
|
11502
|
-
|
11503
|
-
|
11504
|
-
|
11505
|
-
|
11506
|
-
|
11507
|
-
|
11508
|
-
|
11509
|
-
|
11510
|
-
|
11511
|
-
|
11512
|
-
|
11513
|
-
|
11514
|
-
|
11515
|
-
|
11516
|
-
|
11517
|
-
|
11518
|
-
|
11519
|
-
|
11520
|
-
|
11521
|
-
|
11522
|
-
|
11523
|
-
|
11524
|
-
|
11525
|
-
|
11526
|
-
|
11527
|
-
"
|
11528
|
-
|
11529
|
-
|
11530
|
-
|
11531
|
-
|
11532
|
-
|
11533
|
-
|
11534
|
-
|
11535
|
-
|
11662
|
+
return /* @__PURE__ */ import_react78.default.createElement("div", {
|
11663
|
+
ref: parentRef,
|
11664
|
+
className: classNames("Aquarium-Tabs", tw("h-full"), className)
|
11665
|
+
}, /* @__PURE__ */ import_react78.default.createElement("div", {
|
11666
|
+
className: tw("relative flex items-center border-b-2 border-grey-10")
|
11667
|
+
}, /* @__PURE__ */ import_react78.default.createElement("div", {
|
11668
|
+
ref: containerRef,
|
11669
|
+
className: tw("overflow-y-auto scrollbar-hide h-full mb-[-2px]")
|
11670
|
+
}, /* @__PURE__ */ import_react78.default.createElement("div", {
|
11671
|
+
ref: tabsRef,
|
11672
|
+
role: "tablist",
|
11673
|
+
"aria-label": "tabs",
|
11674
|
+
className: tw("inline-flex items-center cursor-pointer font-normal h-full")
|
11675
|
+
}, import_react78.default.Children.map(
|
11676
|
+
children,
|
11677
|
+
(tab, index) => tab ? /* @__PURE__ */ import_react78.default.createElement(TabItemComponent, __spreadProps(__spreadValues({
|
11678
|
+
key: tab.props.value
|
11679
|
+
}, tab.props), {
|
11680
|
+
index,
|
11681
|
+
selected: tab.props.value !== void 0 ? tab.props.value === selected : index === selected,
|
11682
|
+
onKeyDown: handleKeyDown,
|
11683
|
+
onSelected: handleSelected
|
11684
|
+
})) : void 0
|
11685
|
+
))), leftCaret && /* @__PURE__ */ import_react78.default.createElement("div", {
|
11686
|
+
className: tw("absolute left-0 bg-gradient-to-r from-white via-white z-20 py-3 pr-4")
|
11687
|
+
}, /* @__PURE__ */ import_react78.default.createElement("div", {
|
11688
|
+
onClick: () => handleScrollToNext("left"),
|
11689
|
+
className: tw("hover:bg-grey-0 p-2 leading-none cursor-pointer")
|
11690
|
+
}, /* @__PURE__ */ import_react78.default.createElement(InlineIcon, {
|
11691
|
+
icon: import_chevronLeft4.default
|
11692
|
+
}))), rightCaret && /* @__PURE__ */ import_react78.default.createElement("div", {
|
11693
|
+
onClick: () => handleScrollToNext("right"),
|
11694
|
+
className: tw("absolute right-0 bg-gradient-to-l from-white via-white z-20 py-3 pl-4")
|
11695
|
+
}, /* @__PURE__ */ import_react78.default.createElement("div", {
|
11696
|
+
onClick: () => handleScrollToNext("right"),
|
11697
|
+
className: tw("hover:bg-grey-0 p-2 leading-none cursor-pointer")
|
11698
|
+
}, /* @__PURE__ */ import_react78.default.createElement(InlineIcon, {
|
11699
|
+
icon: import_chevronRight4.default
|
11700
|
+
})))), renderChildren(children, selected, props));
|
11536
11701
|
};
|
11537
|
-
|
11538
|
-
|
11539
|
-
|
11540
|
-
|
11541
|
-
|
11542
|
-
|
11543
|
-
|
11544
|
-
|
11545
|
-
|
11546
|
-
|
11547
|
-
|
11548
|
-
|
11549
|
-
|
11550
|
-
|
11551
|
-
|
11552
|
-
|
11553
|
-
|
11554
|
-
|
11555
|
-
|
11556
|
-
|
11702
|
+
Tabs2.displayName = displayName;
|
11703
|
+
Tabs2.Tab = TabComponent;
|
11704
|
+
return Tabs2;
|
11705
|
+
};
|
11706
|
+
var Tabs = createTabsComponent(Tab, TabItem, "Tabs", (children, selected) => /* @__PURE__ */ import_react78.default.createElement(TabContainer, null, children.find(
|
11707
|
+
(node, index) => (node == null ? void 0 : node.props.value) === selected || index === selected
|
11708
|
+
)));
|
11709
|
+
|
11710
|
+
// src/molecules/Drawer/Drawer.tsx
|
11711
|
+
var import_cross6 = __toESM(require_cross());
|
11712
|
+
var import_more4 = __toESM(require_more());
|
11713
|
+
var AnimatedBackDrop = (0, import_web4.animated)(Modal.BackDrop);
|
11714
|
+
var AnimatedDialog = (0, import_web4.animated)(Modal.Dialog);
|
11715
|
+
var WIDTHS = {
|
11716
|
+
sm: 360,
|
11717
|
+
md: 560,
|
11718
|
+
lg: 1080
|
11719
|
+
};
|
11720
|
+
var Drawer = (_a) => {
|
11721
|
+
var _b = _a, { open, closeOnEsc = true } = _b, props = __objRest(_b, ["open", "closeOnEsc"]);
|
11722
|
+
const { onClose, size = "sm", portalContainer } = props;
|
11723
|
+
const [hidden, setHidden] = import_react79.default.useState(!open);
|
11724
|
+
const ref = import_react79.default.useRef(null);
|
11725
|
+
const state = (0, import_react_stately.useOverlayTriggerState)({ isOpen: !hidden, onOpenChange: (isOpen) => !isOpen && onClose() });
|
11726
|
+
(0, import_react79.useEffect)(() => {
|
11727
|
+
if (open && hidden) {
|
11728
|
+
setHidden(!open);
|
11557
11729
|
}
|
11558
|
-
};
|
11559
|
-
const
|
11560
|
-
|
11561
|
-
|
11562
|
-
|
11730
|
+
}, [open]);
|
11731
|
+
const { modalProps, underlayProps } = (0, import_overlays8.useModalOverlay)(
|
11732
|
+
{ isDismissable: false, isKeyboardDismissDisabled: !closeOnEsc },
|
11733
|
+
state,
|
11734
|
+
ref
|
11735
|
+
);
|
11736
|
+
const { opacity, transform } = (0, import_web4.useSpring)({
|
11737
|
+
transform: open ? `translateX(100vw) translateX(-${WIDTHS[size]}px)` : "translateX(100vw) translateX(0px)",
|
11738
|
+
opacity: open ? 0.6 : 0,
|
11739
|
+
config: {
|
11740
|
+
mass: 0.5,
|
11741
|
+
tension: 150,
|
11742
|
+
friction: 15
|
11743
|
+
},
|
11744
|
+
onRest: () => {
|
11745
|
+
if (!open) {
|
11746
|
+
setHidden(true);
|
11747
|
+
}
|
11563
11748
|
}
|
11564
|
-
};
|
11565
|
-
|
11566
|
-
|
11567
|
-
}
|
11568
|
-
return /* @__PURE__ */
|
11569
|
-
|
11570
|
-
|
11571
|
-
|
11572
|
-
|
11573
|
-
|
11574
|
-
|
11575
|
-
|
11576
|
-
|
11577
|
-
|
11578
|
-
|
11579
|
-
|
11580
|
-
|
11581
|
-
placement: tooltipPlacement,
|
11582
|
-
inline: false
|
11583
|
-
}, /* @__PURE__ */ import_react81.default.createElement("div", {
|
11584
|
-
tabIndex: 0,
|
11585
|
-
className: tw("grow")
|
11586
|
-
}, itemContent)) : itemContent);
|
11749
|
+
});
|
11750
|
+
if (!state.isOpen) {
|
11751
|
+
return null;
|
11752
|
+
}
|
11753
|
+
return /* @__PURE__ */ import_react79.default.createElement(import_overlays8.Overlay, {
|
11754
|
+
portalContainer
|
11755
|
+
}, /* @__PURE__ */ import_react79.default.createElement(Modal, {
|
11756
|
+
kind: "drawer",
|
11757
|
+
className: "Aquarium-Drawer overflow-x-hidden",
|
11758
|
+
open: true
|
11759
|
+
}, /* @__PURE__ */ import_react79.default.createElement(AnimatedBackDrop, __spreadValues({
|
11760
|
+
style: { opacity }
|
11761
|
+
}, underlayProps)), /* @__PURE__ */ import_react79.default.createElement(DrawerWrapper, __spreadProps(__spreadValues(__spreadValues({
|
11762
|
+
ref
|
11763
|
+
}, props), modalProps), {
|
11764
|
+
spring: { transform }
|
11765
|
+
}))));
|
11587
11766
|
};
|
11588
|
-
|
11589
|
-
|
11767
|
+
var DrawerWrapper = import_react79.default.forwardRef(
|
11768
|
+
(_a, ref) => {
|
11769
|
+
var _b = _a, { title, children, size = "sm", primaryAction, secondaryActions, onClose, spring } = _b, props = __objRest(_b, ["title", "children", "size", "primaryAction", "secondaryActions", "onClose", "spring"]);
|
11770
|
+
var _a2;
|
11771
|
+
const labelledBy = (0, import_utils16.useId)();
|
11772
|
+
const describedBy = (0, import_utils16.useId)();
|
11773
|
+
const { dialogProps } = (0, import_dialog2.useDialog)(
|
11774
|
+
{ "role": "dialog", "aria-labelledby": labelledBy, "aria-describedby": describedBy },
|
11775
|
+
ref
|
11776
|
+
);
|
11777
|
+
const dialogSize = size === "lg" ? "full" : size;
|
11778
|
+
const hasTabs = isComponentType(children, Tabs);
|
11779
|
+
return /* @__PURE__ */ import_react79.default.createElement(AnimatedDialog, __spreadProps(__spreadValues(__spreadValues({
|
11780
|
+
ref,
|
11781
|
+
kind: "drawer",
|
11782
|
+
"aria-modal": "true",
|
11783
|
+
size: dialogSize
|
11784
|
+
}, props), dialogProps), {
|
11785
|
+
style: __spreadValues({}, spring)
|
11786
|
+
}), /* @__PURE__ */ import_react79.default.createElement(Modal.CloseButtonContainer, null, /* @__PURE__ */ import_react79.default.createElement(Button.Icon, {
|
11787
|
+
"aria-label": "Close",
|
11788
|
+
icon: import_cross6.default,
|
11789
|
+
onClick: onClose
|
11790
|
+
})), /* @__PURE__ */ import_react79.default.createElement(Modal.Header, {
|
11791
|
+
className: tw({ "pb-3": hasTabs })
|
11792
|
+
}, /* @__PURE__ */ import_react79.default.createElement(Modal.Title, {
|
11793
|
+
id: labelledBy,
|
11794
|
+
kind: "drawer"
|
11795
|
+
}, title)), hasTabs ? /* @__PURE__ */ import_react79.default.createElement(DrawerTabs, __spreadProps(__spreadValues({}, children.props), {
|
11796
|
+
className: tw("[&>div:first-child]:px-5 grow flex flex-col overflow-y-auto")
|
11797
|
+
})) : /* @__PURE__ */ import_react79.default.createElement(Modal.Body, {
|
11798
|
+
id: describedBy,
|
11799
|
+
tabIndex: 0,
|
11800
|
+
noFooter: !(secondaryActions || primaryAction)
|
11801
|
+
}, children), (secondaryActions || primaryAction) && /* @__PURE__ */ import_react79.default.createElement(Modal.Footer, null, /* @__PURE__ */ import_react79.default.createElement(Modal.Actions, {
|
11802
|
+
className: size === "sm" ? tw("flex-col") : void 0
|
11803
|
+
}, size !== "sm" && props.menu && /* @__PURE__ */ import_react79.default.createElement(Box.Flex, {
|
11804
|
+
alignItems: "center"
|
11805
|
+
}, /* @__PURE__ */ import_react79.default.createElement(DropdownMenu2, {
|
11806
|
+
onAction: (action) => {
|
11807
|
+
var _a3;
|
11808
|
+
return (_a3 = props.onAction) == null ? void 0 : _a3.call(props, action);
|
11809
|
+
},
|
11810
|
+
onOpenChange: props.onMenuOpenChange
|
11811
|
+
}, /* @__PURE__ */ import_react79.default.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ import_react79.default.createElement(Button.Icon, {
|
11812
|
+
"aria-label": (_a2 = props.menuAriaLabel) != null ? _a2 : "Context menu",
|
11813
|
+
icon: import_more4.default
|
11814
|
+
})), props.menu)), secondaryActions && (0, import_castArray.default)(secondaryActions).filter(Boolean).map((_b2) => {
|
11815
|
+
var _c = _b2, { text } = _c, action = __objRest(_c, ["text"]);
|
11816
|
+
return /* @__PURE__ */ import_react79.default.createElement(Button.Secondary, __spreadValues({
|
11817
|
+
key: text
|
11818
|
+
}, action), text);
|
11819
|
+
}), primaryAction && /* @__PURE__ */ import_react79.default.createElement(Button.Primary, __spreadValues({
|
11820
|
+
key: primaryAction.text
|
11821
|
+
}, (0, import_omit9.default)(primaryAction, "text")), primaryAction.text))));
|
11822
|
+
}
|
11823
|
+
);
|
11824
|
+
var DrawerTabs = createTabsComponent(ModalTab, TabItem, "DrawerTabs", (children, selected) => /* @__PURE__ */ import_react79.default.createElement(Modal.Body, {
|
11825
|
+
className: tw("h-full")
|
11826
|
+
}, /* @__PURE__ */ import_react79.default.createElement(ModalTabContainer, null, children.find(
|
11827
|
+
(node, index) => (node == null ? void 0 : node.props.value) === selected || index === selected
|
11828
|
+
))));
|
11590
11829
|
|
11591
|
-
// src/molecules/
|
11830
|
+
// src/molecules/Dropdown/Dropdown.tsx
|
11831
|
+
var import_react83 = __toESM(require("react"));
|
11832
|
+
|
11833
|
+
// src/molecules/Popover/Popover.tsx
|
11592
11834
|
var import_react82 = __toESM(require("react"));
|
11593
|
-
var
|
11594
|
-
|
11595
|
-
|
11596
|
-
|
11597
|
-
|
11598
|
-
|
11599
|
-
|
11835
|
+
var import_interactions3 = require("@react-aria/interactions");
|
11836
|
+
var import_overlays9 = require("@react-aria/overlays");
|
11837
|
+
var import_utils18 = require("@react-aria/utils");
|
11838
|
+
var import_overlays10 = require("@react-stately/overlays");
|
11839
|
+
var import_classnames8 = __toESM(require("classnames"));
|
11840
|
+
var import_omit10 = __toESM(require("lodash/omit"));
|
11841
|
+
|
11842
|
+
// src/molecules/Popover/Dialog.tsx
|
11843
|
+
var import_react80 = __toESM(require("react"));
|
11844
|
+
var import_dialog3 = require("@react-aria/dialog");
|
11845
|
+
var Dialog2 = ({ children }) => {
|
11846
|
+
const ref = import_react80.default.useRef(null);
|
11847
|
+
const { dialogProps } = (0, import_dialog3.useDialog)({}, ref);
|
11848
|
+
return /* @__PURE__ */ import_react80.default.createElement("div", __spreadProps(__spreadValues({
|
11849
|
+
ref
|
11850
|
+
}, dialogProps), {
|
11851
|
+
className: tw("outline-none")
|
11852
|
+
}), children);
|
11853
|
+
};
|
11854
|
+
|
11855
|
+
// src/molecules/Popover/PopoverContext.tsx
|
11856
|
+
var import_react81 = require("react");
|
11857
|
+
var PopoverContext = (0, import_react81.createContext)(null);
|
11858
|
+
var usePopoverContext = () => {
|
11859
|
+
const ctx = (0, import_react81.useContext)(PopoverContext);
|
11860
|
+
if (ctx === null) {
|
11861
|
+
throw new Error("PopoverContext was used outside of provider.");
|
11862
|
+
}
|
11863
|
+
return ctx;
|
11864
|
+
};
|
11865
|
+
|
11866
|
+
// src/molecules/Popover/Popover.tsx
|
11867
|
+
var Popover2 = (props) => {
|
11868
|
+
const {
|
11869
|
+
id,
|
11870
|
+
type,
|
11871
|
+
placement = "bottom-left",
|
11872
|
+
containFocus = true,
|
11873
|
+
isKeyboardDismissDisabled = false,
|
11874
|
+
targetRef,
|
11875
|
+
offset,
|
11876
|
+
crossOffset,
|
11877
|
+
shouldFlip
|
11878
|
+
} = props;
|
11879
|
+
const triggerRef = (0, import_react82.useRef)(null);
|
11880
|
+
const state = (0, import_overlays10.useOverlayTriggerState)(props);
|
11881
|
+
const { triggerProps, overlayProps } = (0, import_overlays9.useOverlayTrigger)({ type: type != null ? type : "dialog" }, state, triggerRef);
|
11882
|
+
return /* @__PURE__ */ import_react82.default.createElement(PopoverContext.Provider, {
|
11883
|
+
value: {
|
11884
|
+
state
|
11885
|
+
}
|
11886
|
+
}, import_react82.default.Children.map(props.children, (child) => {
|
11887
|
+
if (isComponentType(child, Popover2.Trigger)) {
|
11888
|
+
return /* @__PURE__ */ import_react82.default.createElement(import_interactions3.PressResponder, __spreadValues({
|
11889
|
+
ref: triggerRef
|
11890
|
+
}, (0, import_omit10.default)(triggerProps, "aria-expanded")), /* @__PURE__ */ import_react82.default.createElement(PopoverTriggerWrapper, {
|
11891
|
+
"data-testid": props["data-testid"],
|
11892
|
+
"aria-controls": id,
|
11893
|
+
"aria-expanded": triggerProps["aria-expanded"]
|
11894
|
+
}, child.props.children));
|
11895
|
+
}
|
11896
|
+
if (isComponentType(child, Popover2.Panel)) {
|
11897
|
+
return state.isOpen && /* @__PURE__ */ import_react82.default.createElement(PopoverOverlay, __spreadValues({
|
11898
|
+
triggerRef: targetRef != null ? targetRef : triggerRef,
|
11899
|
+
state,
|
11900
|
+
placement,
|
11901
|
+
isNonModal: !containFocus,
|
11902
|
+
autoFocus: !containFocus,
|
11903
|
+
isKeyboardDismissDisabled,
|
11904
|
+
className: (0, import_classnames8.default)("Aquarium-Popover", child.props.className),
|
11905
|
+
offset,
|
11906
|
+
crossOffset,
|
11907
|
+
shouldFlip
|
11908
|
+
}, overlayProps), containFocus ? /* @__PURE__ */ import_react82.default.createElement(Dialog2, null, child.props.children) : child.props.children);
|
11909
|
+
}
|
11910
|
+
throw new Error("Invalid children element type");
|
11911
|
+
}));
|
11912
|
+
};
|
11913
|
+
var Trigger = () => null;
|
11914
|
+
Trigger.displayName = "Popover.Trigger";
|
11915
|
+
Popover2.Trigger = Trigger;
|
11916
|
+
var Panel = () => null;
|
11917
|
+
Panel.displayName = "Popover.Panel";
|
11918
|
+
Popover2.Panel = Panel;
|
11919
|
+
var asPopoverButton = (Component, displayName) => {
|
11920
|
+
const PopoverButton2 = (props) => {
|
11921
|
+
const { onClick } = props;
|
11922
|
+
const { state } = usePopoverContext();
|
11923
|
+
const handleClick = (e) => {
|
11924
|
+
state.close();
|
11925
|
+
onClick == null ? void 0 : onClick(e);
|
11926
|
+
};
|
11927
|
+
return /* @__PURE__ */ import_react82.default.createElement(Component, __spreadProps(__spreadValues({}, props), {
|
11928
|
+
onClick: handleClick
|
11929
|
+
}));
|
11930
|
+
};
|
11931
|
+
PopoverButton2.displayName = displayName;
|
11932
|
+
return PopoverButton2;
|
11933
|
+
};
|
11934
|
+
var PopoverButton = asPopoverButton(Button, "PopoverButton");
|
11935
|
+
Popover2.Button = PopoverButton;
|
11936
|
+
var PopoverTriggerWrapper = (_a) => {
|
11937
|
+
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
11938
|
+
var _a2;
|
11939
|
+
const ref = (0, import_react82.useRef)(null);
|
11940
|
+
const trigger = import_react82.default.Children.only(children);
|
11941
|
+
const { pressProps } = (0, import_interactions3.usePress)(__spreadProps(__spreadValues({}, rest), { ref }));
|
11942
|
+
return import_react82.default.cloneElement(trigger, __spreadProps(__spreadValues({
|
11943
|
+
"ref": ref
|
11944
|
+
}, (0, import_utils18.mergeProps)(pressProps, trigger.props)), {
|
11945
|
+
"aria-controls": (_a2 = rest["aria-controls"]) != null ? _a2 : pressProps["aria-controls"]
|
11946
|
+
}));
|
11947
|
+
};
|
11948
|
+
|
11949
|
+
// src/molecules/Dropdown/Dropdown.tsx
|
11950
|
+
var Dropdown = ({ children, content, placement = "bottom-left" }) => {
|
11951
|
+
return /* @__PURE__ */ import_react83.default.createElement(Popover2, {
|
11952
|
+
type: "menu",
|
11953
|
+
placement
|
11954
|
+
}, /* @__PURE__ */ import_react83.default.createElement(Popover2.Trigger, null, children), /* @__PURE__ */ import_react83.default.createElement(Popover2.Panel, {
|
11955
|
+
className: "Aquarium-Dropdown"
|
11956
|
+
}, content));
|
11957
|
+
};
|
11958
|
+
var DropdownMenu3 = ({
|
11959
|
+
title,
|
11960
|
+
children,
|
11961
|
+
contentId,
|
11962
|
+
triggerId,
|
11963
|
+
setClose = () => void 0
|
11964
|
+
}) => {
|
11965
|
+
const menuRef = import_react83.default.useRef(null);
|
11966
|
+
import_react83.default.useEffect(() => {
|
11967
|
+
const id = setTimeout(() => {
|
11968
|
+
var _a, _b, _c;
|
11969
|
+
return (_c = (_b = (_a = menuRef.current) == null ? void 0 : _a.children) == null ? void 0 : _b[0]) == null ? void 0 : _c.focus();
|
11970
|
+
});
|
11971
|
+
return () => clearTimeout(id);
|
11972
|
+
}, [menuRef.current]);
|
11973
|
+
return /* @__PURE__ */ import_react83.default.createElement("div", {
|
11974
|
+
style: { minWidth: "250px" },
|
11975
|
+
className: tw("py-3 bg-white")
|
11976
|
+
}, !!title && /* @__PURE__ */ import_react83.default.createElement("div", {
|
11977
|
+
className: tw("px-4 py-4 text-left text-grey-100 typography-default-strong")
|
11978
|
+
}, title), /* @__PURE__ */ import_react83.default.createElement("ol", {
|
11979
|
+
role: "menu",
|
11980
|
+
ref: menuRef,
|
11981
|
+
id: contentId,
|
11982
|
+
"aria-labelledby": triggerId
|
11983
|
+
}, import_react83.default.Children.map(children, (child) => {
|
11984
|
+
return import_react83.default.cloneElement(child, { setClose });
|
11985
|
+
})));
|
11986
|
+
};
|
11987
|
+
var DropdownItem = (_a) => {
|
11988
|
+
var _b = _a, {
|
11989
|
+
children,
|
11990
|
+
disabled = false,
|
11991
|
+
tooltip,
|
11992
|
+
tooltipPlacement,
|
11993
|
+
color = "default",
|
11994
|
+
onSelect,
|
11995
|
+
setClose = () => void 0
|
11996
|
+
} = _b, props = __objRest(_b, [
|
11997
|
+
"children",
|
11998
|
+
"disabled",
|
11999
|
+
"tooltip",
|
12000
|
+
"tooltipPlacement",
|
12001
|
+
"color",
|
12002
|
+
"onSelect",
|
12003
|
+
"setClose"
|
12004
|
+
]);
|
12005
|
+
const { state } = usePopoverContext();
|
12006
|
+
const handleSelect = () => {
|
12007
|
+
onSelect == null ? void 0 : onSelect();
|
12008
|
+
state.close();
|
12009
|
+
setClose();
|
12010
|
+
};
|
12011
|
+
const handleKeyDown = (event) => {
|
12012
|
+
const target = event.target;
|
12013
|
+
const parent = target.parentElement;
|
12014
|
+
const first = parent.firstChild;
|
12015
|
+
const last = parent.lastChild;
|
12016
|
+
const next = target.nextElementSibling;
|
12017
|
+
const prev = target.previousElementSibling;
|
12018
|
+
if (event.key === "ArrowUp") {
|
12019
|
+
prev ? prev.focus() : last.focus();
|
12020
|
+
} else if (event.key === "ArrowDown") {
|
12021
|
+
next ? next.focus() : first.focus();
|
12022
|
+
} else if (event.key === "Tab") {
|
12023
|
+
event.preventDefault();
|
12024
|
+
event.stopPropagation();
|
12025
|
+
} else if (event.key === "Home" || event.key === "PageUp") {
|
12026
|
+
first.focus();
|
12027
|
+
} else if (event.key === "End" || event.key === "PageDown") {
|
12028
|
+
last.focus();
|
12029
|
+
} else if (event.key === "Enter") {
|
12030
|
+
!disabled && handleSelect();
|
12031
|
+
}
|
12032
|
+
};
|
12033
|
+
const handleClick = (e) => {
|
12034
|
+
e.stopPropagation();
|
12035
|
+
if (!disabled) {
|
12036
|
+
handleSelect();
|
12037
|
+
}
|
12038
|
+
};
|
12039
|
+
const itemContent = /* @__PURE__ */ import_react83.default.createElement("div", {
|
12040
|
+
className: tw("py-3 px-4")
|
12041
|
+
}, children);
|
12042
|
+
return /* @__PURE__ */ import_react83.default.createElement("li", __spreadProps(__spreadValues({
|
12043
|
+
role: "menuitem",
|
12044
|
+
tabIndex: -1,
|
12045
|
+
onClick: handleClick,
|
12046
|
+
onKeyDown: handleKeyDown
|
12047
|
+
}, props), {
|
12048
|
+
className: tw("typography-small flex items-center focus:ring-0", {
|
12049
|
+
"text-grey-70 cursor-pointer hover:bg-grey-0": !disabled,
|
12050
|
+
"text-grey-10 cursor-not-allowed": disabled,
|
12051
|
+
"text-primary-70 hover:text-primary-80": color === "danger" && !disabled
|
12052
|
+
})
|
12053
|
+
}), tooltip ? /* @__PURE__ */ import_react83.default.createElement(Tooltip, {
|
12054
|
+
content: tooltip,
|
12055
|
+
placement: tooltipPlacement,
|
12056
|
+
inline: false
|
12057
|
+
}, /* @__PURE__ */ import_react83.default.createElement("div", {
|
12058
|
+
tabIndex: 0,
|
12059
|
+
className: tw("grow")
|
12060
|
+
}, itemContent)) : itemContent);
|
12061
|
+
};
|
12062
|
+
Dropdown.Menu = DropdownMenu3;
|
12063
|
+
Dropdown.Item = DropdownItem;
|
12064
|
+
|
12065
|
+
// src/molecules/EmptyState/EmptyState.tsx
|
12066
|
+
var import_react84 = __toESM(require("react"));
|
12067
|
+
var EmptyStateLayout = /* @__PURE__ */ ((EmptyStateLayout2) => {
|
12068
|
+
EmptyStateLayout2["Vertical"] = "vertical";
|
12069
|
+
EmptyStateLayout2["Horizontal"] = "horizontal";
|
12070
|
+
EmptyStateLayout2["CenterVertical"] = "center-vertical";
|
12071
|
+
EmptyStateLayout2["LeftVertical"] = "left-vertical";
|
12072
|
+
EmptyStateLayout2["CenterHorizontal"] = "center-horizontal";
|
12073
|
+
EmptyStateLayout2["LeftHorizontal"] = "left-horizontal";
|
11600
12074
|
return EmptyStateLayout2;
|
11601
12075
|
})(EmptyStateLayout || {});
|
11602
12076
|
var layoutStyle = (layout) => {
|
@@ -11646,7 +12120,7 @@ var EmptyState = ({
|
|
11646
12120
|
fullHeight = isVerticalLayout(layout) ? true : false
|
11647
12121
|
}) => {
|
11648
12122
|
const template = layoutStyle(layout);
|
11649
|
-
return /* @__PURE__ */
|
12123
|
+
return /* @__PURE__ */ import_react84.default.createElement(Box, {
|
11650
12124
|
className: classNames(
|
11651
12125
|
"Aquarium-EmptyState",
|
11652
12126
|
tw("rounded p-[56px]", {
|
@@ -11659,39 +12133,39 @@ var EmptyState = ({
|
|
11659
12133
|
),
|
11660
12134
|
backgroundColor: "transparent",
|
11661
12135
|
borderColor: "grey-10"
|
11662
|
-
}, /* @__PURE__ */
|
12136
|
+
}, /* @__PURE__ */ import_react84.default.createElement(Box.Flex, {
|
11663
12137
|
style: { gap: "56px" },
|
11664
12138
|
flexDirection: template.layout,
|
11665
12139
|
justifyContent: template.justifyContent,
|
11666
12140
|
alignItems: template.layout === "row" ? "center" : template.alignItems,
|
11667
12141
|
height: fullHeight ? "full" : void 0
|
11668
|
-
}, image && /* @__PURE__ */
|
12142
|
+
}, image && /* @__PURE__ */ import_react84.default.createElement("img", {
|
11669
12143
|
src: image,
|
11670
12144
|
alt: imageAlt,
|
11671
12145
|
style: { width: imageWidth ? `${imageWidth}px` : void 0, height: "auto" }
|
11672
|
-
}), /* @__PURE__ */
|
12146
|
+
}), /* @__PURE__ */ import_react84.default.createElement(Box.Flex, {
|
11673
12147
|
flexDirection: "column",
|
11674
12148
|
justifyContent: template.justifyContent,
|
11675
12149
|
alignItems: template.alignItems
|
11676
|
-
}, /* @__PURE__ */
|
12150
|
+
}, /* @__PURE__ */ import_react84.default.createElement(Typography2.Heading, {
|
11677
12151
|
htmlTag: "h2"
|
11678
|
-
}, title), (description || children) && /* @__PURE__ */
|
12152
|
+
}, title), (description || children) && /* @__PURE__ */ import_react84.default.createElement(Box, {
|
11679
12153
|
marginTop: "5"
|
11680
|
-
}, /* @__PURE__ */
|
12154
|
+
}, /* @__PURE__ */ import_react84.default.createElement(Typography2.Default, null, children || description)), (secondaryAction || primaryAction) && /* @__PURE__ */ import_react84.default.createElement(Box.Flex, {
|
11681
12155
|
marginTop: "7",
|
11682
12156
|
gap: "4",
|
11683
12157
|
justifyContent: "center",
|
11684
12158
|
alignItems: "center",
|
11685
12159
|
flexWrap: "wrap"
|
11686
|
-
}, primaryAction && renderAction({ kind: "primary", action: primaryAction }), secondaryAction && renderAction({ kind: "secondary", action: secondaryAction })), footer && /* @__PURE__ */
|
12160
|
+
}, primaryAction && renderAction({ kind: "primary", action: primaryAction }), secondaryAction && renderAction({ kind: "secondary", action: secondaryAction })), footer && /* @__PURE__ */ import_react84.default.createElement(Box, {
|
11687
12161
|
marginTop: "5"
|
11688
|
-
}, /* @__PURE__ */
|
12162
|
+
}, /* @__PURE__ */ import_react84.default.createElement(Typography2.Small, {
|
11689
12163
|
color: "grey-60"
|
11690
12164
|
}, footer)))));
|
11691
12165
|
};
|
11692
12166
|
|
11693
12167
|
// src/molecules/Flexbox/FlexboxItem.tsx
|
11694
|
-
var
|
12168
|
+
var import_react85 = __toESM(require("react"));
|
11695
12169
|
var FlexboxItem = Tailwindify(
|
11696
12170
|
({ htmlTag = "div", className, style, children, display, flex, grow, shrink, order, alignSelf }) => {
|
11697
12171
|
const hookStyle = useStyle({
|
@@ -11702,443 +12176,144 @@ var FlexboxItem = Tailwindify(
|
|
11702
12176
|
order,
|
11703
12177
|
alignSelf
|
11704
12178
|
});
|
11705
|
-
const HtmlElement = htmlTag;
|
11706
|
-
return /* @__PURE__ */
|
11707
|
-
style: __spreadValues(__spreadValues({}, hookStyle), style),
|
11708
|
-
className
|
11709
|
-
}, children);
|
11710
|
-
}
|
11711
|
-
);
|
11712
|
-
|
11713
|
-
// src/molecules/Grid/GridItem.tsx
|
11714
|
-
var
|
11715
|
-
var GridItem2 = Tailwindify(
|
11716
|
-
({
|
11717
|
-
htmlTag = "div",
|
11718
|
-
className,
|
11719
|
-
style,
|
11720
|
-
children,
|
11721
|
-
display,
|
11722
|
-
justifySelf,
|
11723
|
-
alignSelf,
|
11724
|
-
placeSelf,
|
11725
|
-
colSpan,
|
11726
|
-
colStart,
|
11727
|
-
colEnd,
|
11728
|
-
rowSpan,
|
11729
|
-
rowStart,
|
11730
|
-
rowEnd
|
11731
|
-
}) => {
|
11732
|
-
const hookStyle = useStyle({
|
11733
|
-
display,
|
11734
|
-
justifySelf,
|
11735
|
-
alignSelf,
|
11736
|
-
placeSelf,
|
11737
|
-
gridColumn: colSpan,
|
11738
|
-
gridColumnStart: colStart,
|
11739
|
-
gridColumnEnd: colEnd,
|
11740
|
-
gridRow: rowSpan,
|
11741
|
-
gridRowStart: rowStart,
|
11742
|
-
gridRowEnd: rowEnd
|
11743
|
-
});
|
11744
|
-
const HtmlElement = htmlTag;
|
11745
|
-
return /* @__PURE__ */ import_react84.default.createElement(HtmlElement, {
|
11746
|
-
style: __spreadValues(__spreadValues({}, hookStyle), style),
|
11747
|
-
className
|
11748
|
-
}, children);
|
11749
|
-
}
|
11750
|
-
);
|
11751
|
-
|
11752
|
-
// src/molecules/LineClamp/LineClamp.tsx
|
11753
|
-
var import_react85 = __toESM(require("react"));
|
11754
|
-
var LineClamp2 = ({
|
11755
|
-
lines,
|
11756
|
-
children,
|
11757
|
-
wordBreak,
|
11758
|
-
expandLabel,
|
11759
|
-
collapseLabel,
|
11760
|
-
onClampedChange
|
11761
|
-
}) => {
|
11762
|
-
const ref = import_react85.default.useRef(null);
|
11763
|
-
const [clamped, setClamped] = import_react85.default.useState(true);
|
11764
|
-
const [isClampingEnabled, setClampingEnabled] = import_react85.default.useState(false);
|
11765
|
-
import_react85.default.useEffect(() => {
|
11766
|
-
var _a, _b;
|
11767
|
-
const el = ref.current;
|
11768
|
-
setClampingEnabled(((_a = el == null ? void 0 : el.scrollHeight) != null ? _a : 0) > ((_b = el == null ? void 0 : el.clientHeight) != null ? _b : 0));
|
11769
|
-
}, [ref.current]);
|
11770
|
-
const handleClampedChange = () => {
|
11771
|
-
setClamped(!clamped);
|
11772
|
-
onClampedChange == null ? void 0 : onClampedChange(!clamped);
|
11773
|
-
};
|
11774
|
-
return /* @__PURE__ */ import_react85.default.createElement("div", {
|
11775
|
-
className: "Aquarium-LineClamp"
|
11776
|
-
}, /* @__PURE__ */ import_react85.default.createElement(LineClamp, {
|
11777
|
-
ref,
|
11778
|
-
lines,
|
11779
|
-
clamped,
|
11780
|
-
wordBreak
|
11781
|
-
}, children), expandLabel && isClampingEnabled && /* @__PURE__ */ import_react85.default.createElement(Button.Ghost, {
|
11782
|
-
dense: true,
|
11783
|
-
onClick: handleClampedChange
|
11784
|
-
}, clamped ? expandLabel : collapseLabel));
|
11785
|
-
};
|
11786
|
-
|
11787
|
-
// src/molecules/Link/Link.tsx
|
11788
|
-
var import_react87 = __toESM(require("react"));
|
11789
|
-
var import_classnames9 = __toESM(require("classnames"));
|
11790
|
-
|
11791
|
-
// src/atoms/Link/Link.tsx
|
11792
|
-
var import_react86 = __toESM(require("react"));
|
11793
|
-
var Link = (_a) => {
|
11794
|
-
var _b = _a, { children, className } = _b, props = __objRest(_b, ["children", "className"]);
|
11795
|
-
return /* @__PURE__ */ import_react86.default.createElement("a", __spreadValues({
|
11796
|
-
className: classNames(className, linkStyle)
|
11797
|
-
}, props), children);
|
11798
|
-
};
|
11799
|
-
|
11800
|
-
// src/molecules/Link/Link.tsx
|
11801
|
-
var Link2 = (_a) => {
|
11802
|
-
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
11803
|
-
return /* @__PURE__ */ import_react87.default.createElement(Link, __spreadValues({
|
11804
|
-
className: (0, import_classnames9.default)("Aquarium-Link", className)
|
11805
|
-
}, props));
|
11806
|
-
};
|
11807
|
-
|
11808
|
-
// src/molecules/ListItem/ListItem.tsx
|
11809
|
-
var import_react88 = __toESM(require("react"));
|
11810
|
-
var ListItem = ({ name, icon, active = false }) => {
|
11811
|
-
return /* @__PURE__ */ import_react88.default.createElement(Box.Flex, {
|
11812
|
-
className: "Aquarium-ListItem",
|
11813
|
-
alignItems: "center"
|
11814
|
-
}, /* @__PURE__ */ import_react88.default.createElement(Typography2, {
|
11815
|
-
variant: active ? "small-strong" : "small",
|
11816
|
-
color: "grey-70",
|
11817
|
-
htmlTag: "span",
|
11818
|
-
className: `px-4 py-2 rounded-full ${active ? "bg-grey-5" : "hover:bg-grey-0"}`
|
11819
|
-
}, /* @__PURE__ */ import_react88.default.createElement("img", {
|
11820
|
-
src: icon,
|
11821
|
-
alt: "",
|
11822
|
-
className: "inline mr-4",
|
11823
|
-
height: 28,
|
11824
|
-
width: 28
|
11825
|
-
}), name));
|
11826
|
-
};
|
11827
|
-
|
11828
|
-
// src/molecules/Modal/Modal.tsx
|
11829
|
-
var import_react90 = __toESM(require("react"));
|
11830
|
-
var import_dialog3 = require("@react-aria/dialog");
|
11831
|
-
var import_overlays10 = require("@react-aria/overlays");
|
11832
|
-
var import_utils18 = require("@react-aria/utils");
|
11833
|
-
var import_overlays11 = require("@react-stately/overlays");
|
11834
|
-
var import_castArray = __toESM(require("lodash/castArray"));
|
11835
|
-
var import_omit10 = __toESM(require("lodash/omit"));
|
11836
|
-
|
11837
|
-
// src/molecules/Tabs/Tabs.tsx
|
11838
|
-
var import_react89 = __toESM(require("react"));
|
11839
|
-
var import_isNumber5 = __toESM(require("lodash/isNumber"));
|
11840
|
-
var import_kebabCase = __toESM(require("lodash/kebabCase"));
|
11841
|
-
var import_chevronLeft4 = __toESM(require_chevronLeft());
|
11842
|
-
var import_chevronRight4 = __toESM(require_chevronRight());
|
11843
|
-
var import_warningSign4 = __toESM(require_warningSign());
|
11844
|
-
var isTabComponent = (c) => {
|
11845
|
-
return import_react89.default.isValidElement(c) && (c.type === Tab || c.type === ModalTab);
|
11846
|
-
};
|
11847
|
-
var Tab = import_react89.default.forwardRef(
|
11848
|
-
({ className, id, title, children }, ref) => {
|
11849
|
-
return /* @__PURE__ */ import_react89.default.createElement("div", {
|
11850
|
-
ref,
|
11851
|
-
id: `${id != null ? id : (0, import_kebabCase.default)(title)}-panel`,
|
11852
|
-
className,
|
11853
|
-
role: "tabpanel",
|
11854
|
-
tabIndex: 0,
|
11855
|
-
"aria-labelledby": `${id != null ? id : (0, import_kebabCase.default)(title)}-tab`
|
11856
|
-
}, children);
|
11857
|
-
}
|
11858
|
-
);
|
11859
|
-
var TabContainer = (_a) => {
|
11860
|
-
var _b = _a, { className, children } = _b, rest = __objRest(_b, ["className", "children"]);
|
11861
|
-
return /* @__PURE__ */ import_react89.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
11862
|
-
className: classNames("py-6 z-0", className)
|
11863
|
-
}), children);
|
11864
|
-
};
|
11865
|
-
var ModalTab = Tab;
|
11866
|
-
var ModalTabContainer = TabContainer;
|
11867
|
-
var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
11868
|
-
const Tab2 = import_react89.default.forwardRef(
|
11869
|
-
(_a, ref) => {
|
11870
|
-
var _b = _a, {
|
11871
|
-
id,
|
11872
|
-
value,
|
11873
|
-
status = "default",
|
11874
|
-
disabled,
|
11875
|
-
badge,
|
11876
|
-
tooltip,
|
11877
|
-
title,
|
11878
|
-
index,
|
11879
|
-
selected,
|
11880
|
-
onSelected,
|
11881
|
-
showNotification = false,
|
11882
|
-
className
|
11883
|
-
} = _b, rest = __objRest(_b, [
|
11884
|
-
"id",
|
11885
|
-
"value",
|
11886
|
-
"status",
|
11887
|
-
"disabled",
|
11888
|
-
"badge",
|
11889
|
-
"tooltip",
|
11890
|
-
"title",
|
11891
|
-
"index",
|
11892
|
-
"selected",
|
11893
|
-
"onSelected",
|
11894
|
-
"showNotification",
|
11895
|
-
"className"
|
11896
|
-
]);
|
11897
|
-
const _id = id != null ? id : (0, import_kebabCase.default)(title);
|
11898
|
-
let statusIcon = void 0;
|
11899
|
-
if (status === "warning") {
|
11900
|
-
statusIcon = /* @__PURE__ */ import_react89.default.createElement(InlineIcon, {
|
11901
|
-
icon: import_warningSign4.default,
|
11902
|
-
color: selected ? void 0 : "warning-80"
|
11903
|
-
});
|
11904
|
-
} else if (status === "error") {
|
11905
|
-
statusIcon = /* @__PURE__ */ import_react89.default.createElement(InlineIcon, {
|
11906
|
-
icon: import_warningSign4.default,
|
11907
|
-
color: selected ? void 0 : "error-50"
|
11908
|
-
});
|
11909
|
-
}
|
11910
|
-
const tab = /* @__PURE__ */ import_react89.default.createElement(Component, __spreadValues({
|
11911
|
-
ref,
|
11912
|
-
id: `${_id}-tab`,
|
11913
|
-
onClick: () => !disabled && onSelected(value != null ? value : index),
|
11914
|
-
className: classNames(className, "px-5 py-3 z-10 no-underline appearance-none outline-none h-full", {
|
11915
|
-
"cursor-default": disabled,
|
11916
|
-
"text-grey-80 focus:text-primary-80": !selected,
|
11917
|
-
"hover:bg-grey-0 hover:border-grey-20": !selected && !disabled,
|
11918
|
-
"border-b-2": !defaultUnderlineHidden || selected,
|
11919
|
-
"border-grey-10": !selected,
|
11920
|
-
"border-primary-80": selected
|
11921
|
-
}),
|
11922
|
-
type: "button",
|
11923
|
-
role: "tab",
|
11924
|
-
"aria-selected": selected,
|
11925
|
-
"aria-controls": `${_id}-panel`,
|
11926
|
-
tabIndex: disabled ? void 0 : 0
|
11927
|
-
}, rest), /* @__PURE__ */ import_react89.default.createElement(Typography2, {
|
11928
|
-
htmlTag: "div",
|
11929
|
-
variant: "small",
|
11930
|
-
color: selected ? "primary-80" : disabled ? "grey-20" : "current",
|
11931
|
-
className: tw("inline-flex items-center gap-3")
|
11932
|
-
}, showNotification ? /* @__PURE__ */ import_react89.default.createElement(Badge.Notification, {
|
11933
|
-
right: "-4px",
|
11934
|
-
top: "3px"
|
11935
|
-
}, /* @__PURE__ */ import_react89.default.createElement("span", {
|
11936
|
-
className: tw("whitespace-nowrap")
|
11937
|
-
}, title)) : /* @__PURE__ */ import_react89.default.createElement("span", {
|
11938
|
-
className: tw("whitespace-nowrap")
|
11939
|
-
}, title), (0, import_isNumber5.default)(badge) && /* @__PURE__ */ import_react89.default.createElement(Typography2, {
|
11940
|
-
htmlTag: "span",
|
11941
|
-
variant: "small",
|
11942
|
-
color: selected ? "primary-80" : "grey-5",
|
11943
|
-
className: "leading-none"
|
11944
|
-
}, /* @__PURE__ */ import_react89.default.createElement(TabBadge, {
|
11945
|
-
kind: "filled",
|
11946
|
-
value: badge,
|
11947
|
-
textClassname: classNames({ "text-white": selected, "text-grey-50": !selected })
|
11948
|
-
})), statusIcon));
|
11949
|
-
return tooltip ? /* @__PURE__ */ import_react89.default.createElement(Tooltip, {
|
11950
|
-
content: tooltip
|
11951
|
-
}, tab) : tab;
|
11952
|
-
}
|
11953
|
-
);
|
11954
|
-
Tab2.displayName = displayName;
|
11955
|
-
return Tab2;
|
11956
|
-
};
|
11957
|
-
var TabItem = asTabItem("button", "TabItem");
|
11958
|
-
var CARET_OFFSET = 24;
|
11959
|
-
var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderChildren) => {
|
11960
|
-
const Tabs2 = (props) => {
|
11961
|
-
var _a, _b;
|
11962
|
-
const { className, value, defaultValue, onChange, children } = props;
|
11963
|
-
const childArr = import_react89.default.Children.toArray(children);
|
11964
|
-
const firstTab = childArr[0];
|
11965
|
-
const firstTabValue = isTabComponent(firstTab) ? firstTab.props.value : -1;
|
11966
|
-
const [selected, setSelected] = (0, import_react89.useState)((_b = (_a = value != null ? value : defaultValue) != null ? _a : firstTabValue) != null ? _b : 0);
|
11967
|
-
const [leftCaret, showLeftCaret] = (0, import_react89.useState)(false);
|
11968
|
-
const [rightCaret, showRightCaret] = (0, import_react89.useState)(false);
|
11969
|
-
const parentRef = (0, import_react89.useRef)(null);
|
11970
|
-
const containerRef = (0, import_react89.useRef)(null);
|
11971
|
-
const tabsRef = (0, import_react89.useRef)(null);
|
11972
|
-
const revealSelectedTab = ({ smooth }) => {
|
11973
|
-
var _a2, _b2;
|
11974
|
-
const container = containerRef.current;
|
11975
|
-
const tabs = tabsRef.current;
|
11976
|
-
const values = import_react89.default.Children.map(
|
11977
|
-
children,
|
11978
|
-
(tab, i) => {
|
11979
|
-
var _a3;
|
11980
|
-
return (_a3 = tab == null ? void 0 : tab.props.value) != null ? _a3 : i;
|
11981
|
-
}
|
11982
|
-
);
|
11983
|
-
const idx = (_a2 = values == null ? void 0 : values.findIndex((val) => value === val)) != null ? _a2 : -1;
|
11984
|
-
const child = Array.from((_b2 = tabs == null ? void 0 : tabs.childNodes) != null ? _b2 : [])[idx];
|
11985
|
-
if (!container || !(child instanceof HTMLElement)) {
|
11986
|
-
return;
|
11987
|
-
}
|
11988
|
-
const { width: containerWidth, x: containerX } = container.getBoundingClientRect();
|
11989
|
-
const { x, width } = child.getBoundingClientRect();
|
11990
|
-
const isInViewPort = x >= containerX && x + width <= containerX + containerWidth;
|
11991
|
-
if (!isInViewPort) {
|
11992
|
-
container.scrollTo({
|
11993
|
-
left: container.scrollLeft + Math.ceil(x + width + CARET_OFFSET - containerX - containerWidth),
|
11994
|
-
behavior: smooth ? "smooth" : void 0
|
11995
|
-
});
|
11996
|
-
}
|
11997
|
-
};
|
11998
|
-
const updateCarets = () => {
|
11999
|
-
const pEl = parentRef.current;
|
12000
|
-
const el = containerRef.current;
|
12001
|
-
if (!pEl || !el) {
|
12002
|
-
return;
|
12003
|
-
}
|
12004
|
-
const { width } = pEl.getBoundingClientRect();
|
12005
|
-
const hasLeftCaret = el.scrollWidth > width && el.scrollLeft !== 0;
|
12006
|
-
const hasRightCaret = el.scrollWidth > width && Math.round(el.scrollLeft + el.getBoundingClientRect().width) !== Math.round(el.scrollWidth);
|
12007
|
-
showLeftCaret(hasLeftCaret);
|
12008
|
-
showRightCaret(hasRightCaret);
|
12009
|
-
};
|
12010
|
-
(0, import_react89.useEffect)(() => {
|
12011
|
-
if (value === void 0) {
|
12012
|
-
return;
|
12013
|
-
}
|
12014
|
-
updateCarets();
|
12015
|
-
setSelected(value);
|
12016
|
-
revealSelectedTab({ smooth: value !== selected });
|
12017
|
-
}, [value, import_react89.default.Children.count(children)]);
|
12018
|
-
(0, import_react89.useLayoutEffect)(() => {
|
12019
|
-
var _a2;
|
12020
|
-
updateCarets();
|
12021
|
-
(_a2 = containerRef.current) == null ? void 0 : _a2.addEventListener("scroll", updateCarets);
|
12022
|
-
window.addEventListener("resize", updateCarets);
|
12023
|
-
return () => {
|
12024
|
-
var _a3;
|
12025
|
-
(_a3 = containerRef.current) == null ? void 0 : _a3.removeEventListener("scroll", updateCarets);
|
12026
|
-
window.removeEventListener("resize", updateCarets);
|
12027
|
-
};
|
12028
|
-
}, [parentRef.current, containerRef.current, children]);
|
12029
|
-
const handleScrollToNext = (direction) => {
|
12030
|
-
const container = containerRef.current;
|
12031
|
-
const tabs = tabsRef.current;
|
12032
|
-
if (!container || !tabs) {
|
12033
|
-
return;
|
12034
|
-
}
|
12035
|
-
const { width: containerWidth, x: containerX } = container.getBoundingClientRect();
|
12036
|
-
const children2 = Array.from(tabs.childNodes).filter(
|
12037
|
-
(c) => c instanceof HTMLElement
|
12038
|
-
);
|
12039
|
-
if (direction === "right") {
|
12040
|
-
const next = children2.find((c) => {
|
12041
|
-
const { x, width } = c.getBoundingClientRect();
|
12042
|
-
return Math.round(x + width - containerX - containerWidth) > 0;
|
12043
|
-
});
|
12044
|
-
if (next instanceof HTMLElement) {
|
12045
|
-
const { x, width } = next.getBoundingClientRect();
|
12046
|
-
container.scrollTo({
|
12047
|
-
left: container.scrollLeft + Math.ceil(x + width + CARET_OFFSET - containerX - containerWidth),
|
12048
|
-
behavior: "smooth"
|
12049
|
-
});
|
12050
|
-
}
|
12051
|
-
} else {
|
12052
|
-
const next = children2.find((c) => {
|
12053
|
-
const { x, width } = c.getBoundingClientRect();
|
12054
|
-
return Math.round(x + width - containerX) >= 0;
|
12055
|
-
});
|
12056
|
-
if (next instanceof HTMLElement) {
|
12057
|
-
const { x } = next.getBoundingClientRect();
|
12058
|
-
container.scrollTo({
|
12059
|
-
left: container.scrollLeft - Math.abs(x - containerX - CARET_OFFSET),
|
12060
|
-
behavior: "smooth"
|
12061
|
-
});
|
12062
|
-
}
|
12063
|
-
}
|
12064
|
-
};
|
12065
|
-
const handleKeyDown = (event) => {
|
12066
|
-
const target = event.target;
|
12067
|
-
const parent = target.parentElement;
|
12068
|
-
const first = parent.firstChild;
|
12069
|
-
const last = parent.lastChild;
|
12070
|
-
const next = target.nextElementSibling;
|
12071
|
-
const prev = target.previousElementSibling;
|
12072
|
-
if (event.key === "ArrowRight") {
|
12073
|
-
(next != null ? next : first).focus();
|
12074
|
-
} else if (event.key === "ArrowLeft") {
|
12075
|
-
(prev != null ? prev : last).focus();
|
12076
|
-
}
|
12077
|
-
};
|
12078
|
-
const handleSelected = (key) => {
|
12079
|
-
(onChange != null ? onChange : setSelected)(key);
|
12080
|
-
};
|
12081
|
-
import_react89.default.Children.forEach(children, (c) => {
|
12082
|
-
if (c && !isTabComponent(c)) {
|
12083
|
-
throw new Error("<Tabs> can only have <Tabs.Tab> components as children");
|
12084
|
-
}
|
12179
|
+
const HtmlElement = htmlTag;
|
12180
|
+
return /* @__PURE__ */ import_react85.default.createElement(HtmlElement, {
|
12181
|
+
style: __spreadValues(__spreadValues({}, hookStyle), style),
|
12182
|
+
className
|
12183
|
+
}, children);
|
12184
|
+
}
|
12185
|
+
);
|
12186
|
+
|
12187
|
+
// src/molecules/Grid/GridItem.tsx
|
12188
|
+
var import_react86 = __toESM(require("react"));
|
12189
|
+
var GridItem2 = Tailwindify(
|
12190
|
+
({
|
12191
|
+
htmlTag = "div",
|
12192
|
+
className,
|
12193
|
+
style,
|
12194
|
+
children,
|
12195
|
+
display,
|
12196
|
+
justifySelf,
|
12197
|
+
alignSelf,
|
12198
|
+
placeSelf,
|
12199
|
+
colSpan,
|
12200
|
+
colStart,
|
12201
|
+
colEnd,
|
12202
|
+
rowSpan,
|
12203
|
+
rowStart,
|
12204
|
+
rowEnd
|
12205
|
+
}) => {
|
12206
|
+
const hookStyle = useStyle({
|
12207
|
+
display,
|
12208
|
+
justifySelf,
|
12209
|
+
alignSelf,
|
12210
|
+
placeSelf,
|
12211
|
+
gridColumn: colSpan,
|
12212
|
+
gridColumnStart: colStart,
|
12213
|
+
gridColumnEnd: colEnd,
|
12214
|
+
gridRow: rowSpan,
|
12215
|
+
gridRowStart: rowStart,
|
12216
|
+
gridRowEnd: rowEnd
|
12085
12217
|
});
|
12086
|
-
|
12087
|
-
|
12088
|
-
|
12089
|
-
|
12090
|
-
|
12091
|
-
|
12092
|
-
|
12093
|
-
|
12094
|
-
|
12095
|
-
|
12096
|
-
|
12097
|
-
|
12098
|
-
|
12099
|
-
|
12100
|
-
|
12101
|
-
|
12102
|
-
|
12103
|
-
|
12104
|
-
|
12105
|
-
|
12106
|
-
|
12107
|
-
|
12108
|
-
|
12109
|
-
|
12110
|
-
|
12111
|
-
|
12112
|
-
|
12113
|
-
|
12114
|
-
|
12115
|
-
icon: import_chevronLeft4.default
|
12116
|
-
}))), rightCaret && /* @__PURE__ */ import_react89.default.createElement("div", {
|
12117
|
-
onClick: () => handleScrollToNext("right"),
|
12118
|
-
className: tw("absolute right-0 bg-gradient-to-l from-white via-white z-20 py-3 pl-4")
|
12119
|
-
}, /* @__PURE__ */ import_react89.default.createElement("div", {
|
12120
|
-
onClick: () => handleScrollToNext("right"),
|
12121
|
-
className: tw("hover:bg-grey-0 p-2 leading-none cursor-pointer")
|
12122
|
-
}, /* @__PURE__ */ import_react89.default.createElement(InlineIcon, {
|
12123
|
-
icon: import_chevronRight4.default
|
12124
|
-
})))), renderChildren(children, selected, props));
|
12218
|
+
const HtmlElement = htmlTag;
|
12219
|
+
return /* @__PURE__ */ import_react86.default.createElement(HtmlElement, {
|
12220
|
+
style: __spreadValues(__spreadValues({}, hookStyle), style),
|
12221
|
+
className
|
12222
|
+
}, children);
|
12223
|
+
}
|
12224
|
+
);
|
12225
|
+
|
12226
|
+
// src/molecules/LineClamp/LineClamp.tsx
|
12227
|
+
var import_react87 = __toESM(require("react"));
|
12228
|
+
var LineClamp2 = ({
|
12229
|
+
lines,
|
12230
|
+
children,
|
12231
|
+
wordBreak,
|
12232
|
+
expandLabel,
|
12233
|
+
collapseLabel,
|
12234
|
+
onClampedChange
|
12235
|
+
}) => {
|
12236
|
+
const ref = import_react87.default.useRef(null);
|
12237
|
+
const [clamped, setClamped] = import_react87.default.useState(true);
|
12238
|
+
const [isClampingEnabled, setClampingEnabled] = import_react87.default.useState(false);
|
12239
|
+
import_react87.default.useEffect(() => {
|
12240
|
+
var _a, _b;
|
12241
|
+
const el = ref.current;
|
12242
|
+
setClampingEnabled(((_a = el == null ? void 0 : el.scrollHeight) != null ? _a : 0) > ((_b = el == null ? void 0 : el.clientHeight) != null ? _b : 0));
|
12243
|
+
}, [ref.current]);
|
12244
|
+
const handleClampedChange = () => {
|
12245
|
+
setClamped(!clamped);
|
12246
|
+
onClampedChange == null ? void 0 : onClampedChange(!clamped);
|
12125
12247
|
};
|
12126
|
-
|
12127
|
-
|
12128
|
-
|
12248
|
+
return /* @__PURE__ */ import_react87.default.createElement("div", {
|
12249
|
+
className: "Aquarium-LineClamp"
|
12250
|
+
}, /* @__PURE__ */ import_react87.default.createElement(LineClamp, {
|
12251
|
+
ref,
|
12252
|
+
lines,
|
12253
|
+
clamped,
|
12254
|
+
wordBreak
|
12255
|
+
}, children), expandLabel && isClampingEnabled && /* @__PURE__ */ import_react87.default.createElement(Button.Ghost, {
|
12256
|
+
dense: true,
|
12257
|
+
onClick: handleClampedChange
|
12258
|
+
}, clamped ? expandLabel : collapseLabel));
|
12259
|
+
};
|
12260
|
+
|
12261
|
+
// src/molecules/Link/Link.tsx
|
12262
|
+
var import_react89 = __toESM(require("react"));
|
12263
|
+
var import_classnames9 = __toESM(require("classnames"));
|
12264
|
+
|
12265
|
+
// src/atoms/Link/Link.tsx
|
12266
|
+
var import_react88 = __toESM(require("react"));
|
12267
|
+
var Link = (_a) => {
|
12268
|
+
var _b = _a, { children, className } = _b, props = __objRest(_b, ["children", "className"]);
|
12269
|
+
return /* @__PURE__ */ import_react88.default.createElement("a", __spreadValues({
|
12270
|
+
className: classNames(className, linkStyle)
|
12271
|
+
}, props), children);
|
12272
|
+
};
|
12273
|
+
|
12274
|
+
// src/molecules/Link/Link.tsx
|
12275
|
+
var Link2 = (_a) => {
|
12276
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
12277
|
+
return /* @__PURE__ */ import_react89.default.createElement(Link, __spreadValues({
|
12278
|
+
className: (0, import_classnames9.default)("Aquarium-Link", className)
|
12279
|
+
}, props));
|
12280
|
+
};
|
12281
|
+
|
12282
|
+
// src/molecules/ListItem/ListItem.tsx
|
12283
|
+
var import_react90 = __toESM(require("react"));
|
12284
|
+
var ListItem = ({ name, icon, active = false }) => {
|
12285
|
+
return /* @__PURE__ */ import_react90.default.createElement(Box.Flex, {
|
12286
|
+
className: "Aquarium-ListItem",
|
12287
|
+
alignItems: "center"
|
12288
|
+
}, /* @__PURE__ */ import_react90.default.createElement(Typography2, {
|
12289
|
+
variant: active ? "small-strong" : "small",
|
12290
|
+
color: "grey-70",
|
12291
|
+
htmlTag: "span",
|
12292
|
+
className: `px-4 py-2 rounded-full ${active ? "bg-grey-5" : "hover:bg-grey-0"}`
|
12293
|
+
}, /* @__PURE__ */ import_react90.default.createElement("img", {
|
12294
|
+
src: icon,
|
12295
|
+
alt: "",
|
12296
|
+
className: "inline mr-4",
|
12297
|
+
height: 28,
|
12298
|
+
width: 28
|
12299
|
+
}), name));
|
12129
12300
|
};
|
12130
|
-
var Tabs = createTabsComponent(Tab, TabItem, "Tabs", (children, selected) => /* @__PURE__ */ import_react89.default.createElement(TabContainer, null, children.find(
|
12131
|
-
(node, index) => (node == null ? void 0 : node.props.value) === selected || index === selected
|
12132
|
-
)));
|
12133
12301
|
|
12134
12302
|
// src/molecules/Modal/Modal.tsx
|
12135
|
-
var
|
12303
|
+
var import_react91 = __toESM(require("react"));
|
12304
|
+
var import_dialog4 = require("@react-aria/dialog");
|
12305
|
+
var import_overlays11 = require("@react-aria/overlays");
|
12306
|
+
var import_utils20 = require("@react-aria/utils");
|
12307
|
+
var import_overlays12 = require("@react-stately/overlays");
|
12308
|
+
var import_castArray2 = __toESM(require("lodash/castArray"));
|
12309
|
+
var import_omit11 = __toESM(require("lodash/omit"));
|
12310
|
+
var import_cross7 = __toESM(require_cross());
|
12136
12311
|
var Modal2 = (_a) => {
|
12137
12312
|
var _b = _a, { closeOnEsc = true } = _b, props = __objRest(_b, ["closeOnEsc"]);
|
12138
12313
|
const { open, onClose, size, portalContainer } = props;
|
12139
|
-
const ref =
|
12140
|
-
const state = (0,
|
12141
|
-
const { modalProps, underlayProps } = (0,
|
12314
|
+
const ref = import_react91.default.useRef(null);
|
12315
|
+
const state = (0, import_overlays12.useOverlayTriggerState)({ isOpen: open, onOpenChange: (isOpen) => !isOpen && onClose() });
|
12316
|
+
const { modalProps, underlayProps } = (0, import_overlays11.useModalOverlay)(
|
12142
12317
|
{ isDismissable: false, isKeyboardDismissDisabled: !closeOnEsc },
|
12143
12318
|
state,
|
12144
12319
|
ref
|
@@ -12146,75 +12321,75 @@ var Modal2 = (_a) => {
|
|
12146
12321
|
if (!state.isOpen) {
|
12147
12322
|
return null;
|
12148
12323
|
}
|
12149
|
-
return /* @__PURE__ */
|
12324
|
+
return /* @__PURE__ */ import_react91.default.createElement(import_overlays11.Overlay, {
|
12150
12325
|
portalContainer
|
12151
|
-
}, /* @__PURE__ */
|
12326
|
+
}, /* @__PURE__ */ import_react91.default.createElement(Modal, {
|
12152
12327
|
className: "Aquarium-Modal",
|
12153
12328
|
open: true
|
12154
|
-
}, /* @__PURE__ */
|
12329
|
+
}, /* @__PURE__ */ import_react91.default.createElement(Modal.BackDrop, __spreadValues({}, underlayProps)), /* @__PURE__ */ import_react91.default.createElement(ModalWrapper, __spreadValues(__spreadValues({
|
12155
12330
|
ref,
|
12156
12331
|
size
|
12157
12332
|
}, props), modalProps))));
|
12158
12333
|
};
|
12159
|
-
var ModalWrapper =
|
12334
|
+
var ModalWrapper = import_react91.default.forwardRef(
|
12160
12335
|
(_a, ref) => {
|
12161
12336
|
var _b = _a, { title, subtitle, headerImage, primaryAction, secondaryActions, children, onClose } = _b, props = __objRest(_b, ["title", "subtitle", "headerImage", "primaryAction", "secondaryActions", "children", "onClose"]);
|
12162
|
-
const labelledBy = (0,
|
12163
|
-
const describedBy = (0,
|
12164
|
-
const { dialogProps } = (0,
|
12337
|
+
const labelledBy = (0, import_utils20.useId)();
|
12338
|
+
const describedBy = (0, import_utils20.useId)();
|
12339
|
+
const { dialogProps } = (0, import_dialog4.useDialog)(
|
12165
12340
|
{ "role": "dialog", "aria-labelledby": labelledBy, "aria-describedby": describedBy },
|
12166
12341
|
ref
|
12167
12342
|
);
|
12168
|
-
return /* @__PURE__ */
|
12343
|
+
return /* @__PURE__ */ import_react91.default.createElement(Modal.Dialog, __spreadProps(__spreadValues(__spreadValues({
|
12169
12344
|
ref
|
12170
12345
|
}, props), dialogProps), {
|
12171
12346
|
tabIndex: -1
|
12172
|
-
}), /* @__PURE__ */
|
12347
|
+
}), /* @__PURE__ */ import_react91.default.createElement(Modal.CloseButtonContainer, null, /* @__PURE__ */ import_react91.default.createElement(IconButton, {
|
12173
12348
|
"aria-label": "Close",
|
12174
|
-
icon:
|
12349
|
+
icon: import_cross7.default,
|
12175
12350
|
onClick: onClose
|
12176
|
-
})), headerImage !== void 0 && /* @__PURE__ */
|
12351
|
+
})), headerImage !== void 0 && /* @__PURE__ */ import_react91.default.createElement(Modal.HeaderImage, {
|
12177
12352
|
backgroundImage: headerImage
|
12178
|
-
}), /* @__PURE__ */
|
12353
|
+
}), /* @__PURE__ */ import_react91.default.createElement(Modal.Header, {
|
12179
12354
|
className: tw({ "pb-3": isComponentType(children, ModalTabs) })
|
12180
|
-
}, /* @__PURE__ */
|
12355
|
+
}, /* @__PURE__ */ import_react91.default.createElement(Modal.TitleContainer, null, /* @__PURE__ */ import_react91.default.createElement(Modal.Title, {
|
12181
12356
|
id: labelledBy
|
12182
|
-
}, title), subtitle && /* @__PURE__ */
|
12357
|
+
}, title), subtitle && /* @__PURE__ */ import_react91.default.createElement(Modal.Subtitle, null, subtitle))), isComponentType(children, ModalTabs) ? import_react91.default.cloneElement(children, { className: tw("[&>div:first-child]:px-5 grow") }) : /* @__PURE__ */ import_react91.default.createElement(Modal.Body, {
|
12183
12358
|
id: describedBy,
|
12184
12359
|
tabIndex: 0,
|
12185
12360
|
noFooter: !(secondaryActions || primaryAction)
|
12186
|
-
}, children), (secondaryActions || primaryAction) && /* @__PURE__ */
|
12361
|
+
}, children), (secondaryActions || primaryAction) && /* @__PURE__ */ import_react91.default.createElement(Modal.Footer, null, /* @__PURE__ */ import_react91.default.createElement(Modal.Actions, null, secondaryActions && (0, import_castArray2.default)(secondaryActions).filter(Boolean).map((_a2) => {
|
12187
12362
|
var _b2 = _a2, { text } = _b2, action = __objRest(_b2, ["text"]);
|
12188
|
-
return /* @__PURE__ */
|
12363
|
+
return /* @__PURE__ */ import_react91.default.createElement(Button.Secondary, __spreadValues({
|
12189
12364
|
key: text
|
12190
12365
|
}, action), text);
|
12191
|
-
}), primaryAction && /* @__PURE__ */
|
12366
|
+
}), primaryAction && /* @__PURE__ */ import_react91.default.createElement(Button.Primary, __spreadValues({
|
12192
12367
|
key: primaryAction.text
|
12193
|
-
}, (0,
|
12368
|
+
}, (0, import_omit11.default)(primaryAction, "text")), primaryAction.text))));
|
12194
12369
|
}
|
12195
12370
|
);
|
12196
12371
|
var ModalTabs = createTabsComponent(
|
12197
12372
|
ModalTab,
|
12198
12373
|
TabItem,
|
12199
12374
|
"ModalTabs",
|
12200
|
-
(children, selected, props) => /* @__PURE__ */
|
12375
|
+
(children, selected, props) => /* @__PURE__ */ import_react91.default.createElement(Modal.Body, {
|
12201
12376
|
maxHeight: props.maxHeight
|
12202
|
-
}, /* @__PURE__ */
|
12377
|
+
}, /* @__PURE__ */ import_react91.default.createElement(ModalTabContainer, null, children.find(
|
12203
12378
|
(node, index) => (node == null ? void 0 : node.props.value) === selected || index === selected
|
12204
12379
|
)))
|
12205
12380
|
);
|
12206
12381
|
|
12207
12382
|
// src/molecules/MultiInput/MultiInput.tsx
|
12208
|
-
var
|
12209
|
-
var
|
12210
|
-
var
|
12383
|
+
var import_react93 = __toESM(require("react"));
|
12384
|
+
var import_utils22 = require("@react-aria/utils");
|
12385
|
+
var import_castArray3 = __toESM(require("lodash/castArray"));
|
12211
12386
|
var import_identity = __toESM(require("lodash/identity"));
|
12212
|
-
var
|
12387
|
+
var import_omit12 = __toESM(require("lodash/omit"));
|
12213
12388
|
|
12214
12389
|
// src/molecules/MultiInput/InputChip.tsx
|
12215
|
-
var
|
12390
|
+
var import_react92 = __toESM(require("react"));
|
12216
12391
|
var import_smallCross2 = __toESM(require_smallCross());
|
12217
|
-
var InputChip =
|
12392
|
+
var InputChip = import_react92.default.forwardRef(
|
12218
12393
|
(_a, ref) => {
|
12219
12394
|
var _b = _a, { invalid = false, disabled, readOnly, className, onClick: _onClick, children } = _b, props = __objRest(_b, ["invalid", "disabled", "readOnly", "className", "onClick", "children"]);
|
12220
12395
|
const onClick = (e) => {
|
@@ -12222,18 +12397,18 @@ var InputChip = import_react91.default.forwardRef(
|
|
12222
12397
|
_onClick == null ? void 0 : _onClick(e);
|
12223
12398
|
}
|
12224
12399
|
};
|
12225
|
-
return /* @__PURE__ */
|
12400
|
+
return /* @__PURE__ */ import_react92.default.createElement("div", {
|
12226
12401
|
className: classNames(className, "inline-flex align-middle mx-1 items-stretch rounded-sm break-all", {
|
12227
12402
|
"bg-error-0 ": invalid,
|
12228
12403
|
"bg-grey-0 ": !invalid && !disabled,
|
12229
12404
|
"bg-grey-5": disabled
|
12230
12405
|
})
|
12231
|
-
}, /* @__PURE__ */
|
12406
|
+
}, /* @__PURE__ */ import_react92.default.createElement("div", {
|
12232
12407
|
className: tw("px-2 py-1")
|
12233
|
-
}, /* @__PURE__ */
|
12408
|
+
}, /* @__PURE__ */ import_react92.default.createElement(Typography2, {
|
12234
12409
|
variant: "small",
|
12235
12410
|
color: invalid ? "error-80" : disabled ? "grey-40" : "grey-70"
|
12236
|
-
}, children)), !readOnly && /* @__PURE__ */
|
12411
|
+
}, children)), !readOnly && /* @__PURE__ */ import_react92.default.createElement("div", __spreadProps(__spreadValues({
|
12237
12412
|
ref
|
12238
12413
|
}, props), {
|
12239
12414
|
onClick,
|
@@ -12244,7 +12419,7 @@ var InputChip = import_react91.default.forwardRef(
|
|
12244
12419
|
}),
|
12245
12420
|
role: "button",
|
12246
12421
|
"aria-label": `Remove ${String(children)}`
|
12247
|
-
}), /* @__PURE__ */
|
12422
|
+
}), /* @__PURE__ */ import_react92.default.createElement(Icon, {
|
12248
12423
|
icon: import_smallCross2.default,
|
12249
12424
|
className: tw({
|
12250
12425
|
"text-error-70": invalid,
|
@@ -12302,11 +12477,11 @@ var MultiInputBase = (_a) => {
|
|
12302
12477
|
"valid"
|
12303
12478
|
]);
|
12304
12479
|
var _a2;
|
12305
|
-
const inputRef = (0,
|
12306
|
-
const [items, setItems] = (0,
|
12307
|
-
const [hasFocus, setFocus] = (0,
|
12480
|
+
const inputRef = (0, import_react93.useRef)(null);
|
12481
|
+
const [items, setItems] = (0, import_react93.useState)((_a2 = value != null ? value : defaultValue) != null ? _a2 : []);
|
12482
|
+
const [hasFocus, setFocus] = (0, import_react93.useState)(false);
|
12308
12483
|
const keyCodes = [delimiter !== "enter" ? " " : null, delimiter !== "space" ? "Enter" : null].filter(import_identity.default);
|
12309
|
-
(0,
|
12484
|
+
(0, import_react93.useEffect)(() => {
|
12310
12485
|
const requiresUpdate = value !== void 0 || defaultValue === void 0;
|
12311
12486
|
if (requiresUpdate && JSON.stringify(value) !== JSON.stringify(items)) {
|
12312
12487
|
setItems(value != null ? value : []);
|
@@ -12347,7 +12522,7 @@ var MultiInputBase = (_a) => {
|
|
12347
12522
|
inputRef.current.value = "";
|
12348
12523
|
}
|
12349
12524
|
if (value2) {
|
12350
|
-
const newItems = (0,
|
12525
|
+
const newItems = (0, import_castArray3.default)(value2).map(createItem).filter((item) => !items.includes(item));
|
12351
12526
|
if (newItems.length > 0 && items.length + newItems.length <= (maxLength != null ? maxLength : Number.MAX_SAFE_INTEGER)) {
|
12352
12527
|
const updated = (items != null ? items : []).concat(newItems);
|
12353
12528
|
setItems(updated);
|
@@ -12385,7 +12560,7 @@ var MultiInputBase = (_a) => {
|
|
12385
12560
|
};
|
12386
12561
|
const renderChips = () => items == null ? void 0 : items.map((item, index) => {
|
12387
12562
|
var _a3;
|
12388
|
-
return /* @__PURE__ */
|
12563
|
+
return /* @__PURE__ */ import_react93.default.createElement(InputChip, {
|
12389
12564
|
key: `${itemToString(item)}.${index}`,
|
12390
12565
|
invalid: !((_a3 = isItemValid == null ? void 0 : isItemValid(item, index)) != null ? _a3 : true),
|
12391
12566
|
readOnly,
|
@@ -12396,13 +12571,13 @@ var MultiInputBase = (_a) => {
|
|
12396
12571
|
}
|
12397
12572
|
}, itemToString(item));
|
12398
12573
|
});
|
12399
|
-
return /* @__PURE__ */
|
12574
|
+
return /* @__PURE__ */ import_react93.default.createElement("div", {
|
12400
12575
|
className: "Aquarium-MultiInputBase"
|
12401
|
-
}, /* @__PURE__ */
|
12576
|
+
}, /* @__PURE__ */ import_react93.default.createElement(Select.InputContainer, {
|
12402
12577
|
variant: disabled ? "disabled" : !valid ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default"
|
12403
|
-
}, /* @__PURE__ */
|
12578
|
+
}, /* @__PURE__ */ import_react93.default.createElement("div", {
|
12404
12579
|
className: "grow inline-flex flex-row flex-wrap gap-y-2"
|
12405
|
-
}, inline && renderChips(), /* @__PURE__ */
|
12580
|
+
}, inline && renderChips(), /* @__PURE__ */ import_react93.default.createElement(Select.Input, __spreadProps(__spreadValues({
|
12406
12581
|
ref: inputRef,
|
12407
12582
|
id: id != null ? id : name,
|
12408
12583
|
name,
|
@@ -12420,29 +12595,29 @@ var MultiInputBase = (_a) => {
|
|
12420
12595
|
onFocus: handleFocus,
|
12421
12596
|
onBlur: handleBlur,
|
12422
12597
|
autoComplete: "off"
|
12423
|
-
}))), endAdornment && /* @__PURE__ */
|
12598
|
+
}))), endAdornment && /* @__PURE__ */ import_react93.default.createElement(InputAdornment, null, endAdornment)), !inline && /* @__PURE__ */ import_react93.default.createElement("div", {
|
12424
12599
|
className: tw("flex flex-row flex-wrap gap-y-2 mt-2")
|
12425
12600
|
}, renderChips()));
|
12426
12601
|
};
|
12427
|
-
var BaseMultiInputSkeleton = () => /* @__PURE__ */
|
12602
|
+
var BaseMultiInputSkeleton = () => /* @__PURE__ */ import_react93.default.createElement(Skeleton, {
|
12428
12603
|
height: 38
|
12429
12604
|
});
|
12430
12605
|
MultiInputBase.Skeleton = BaseMultiInputSkeleton;
|
12431
12606
|
var MultiInput = (props) => {
|
12432
12607
|
var _a, _b, _c, _d, _e;
|
12433
12608
|
const maxLength = (_a = props.maxLength) != null ? _a : props.max;
|
12434
|
-
const [value, setValue] = (0,
|
12435
|
-
(0,
|
12609
|
+
const [value, setValue] = (0, import_react93.useState)((_c = (_b = props.value) != null ? _b : props.defaultValue) != null ? _c : []);
|
12610
|
+
(0, import_react93.useEffect)(() => {
|
12436
12611
|
var _a2;
|
12437
12612
|
setValue((_a2 = props.value) != null ? _a2 : []);
|
12438
12613
|
}, [JSON.stringify(props.value)]);
|
12439
|
-
const defaultId = (0,
|
12614
|
+
const defaultId = (0, import_utils22.useId)();
|
12440
12615
|
const id = (_e = (_d = props.id) != null ? _d : props.name) != null ? _e : defaultId;
|
12441
|
-
const errorMessageId = (0,
|
12616
|
+
const errorMessageId = (0, import_utils22.useId)();
|
12442
12617
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
12443
12618
|
const labelControlProps = getLabelControlProps(props);
|
12444
|
-
const baseProps = (0,
|
12445
|
-
return /* @__PURE__ */
|
12619
|
+
const baseProps = (0, import_omit12.default)(props, Object.keys(labelControlProps));
|
12620
|
+
return /* @__PURE__ */ import_react93.default.createElement(LabelControl, __spreadProps(__spreadValues({
|
12446
12621
|
id: `${id}-label`,
|
12447
12622
|
htmlFor: `${id}-input`,
|
12448
12623
|
messageId: errorMessageId
|
@@ -12450,7 +12625,7 @@ var MultiInput = (props) => {
|
|
12450
12625
|
length: value.length,
|
12451
12626
|
maxLength,
|
12452
12627
|
className: "Aquarium-MultiInput"
|
12453
|
-
}), /* @__PURE__ */
|
12628
|
+
}), /* @__PURE__ */ import_react93.default.createElement(MultiInputBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
|
12454
12629
|
id: `${id}-input`,
|
12455
12630
|
onChange: (value2) => {
|
12456
12631
|
var _a2;
|
@@ -12462,20 +12637,28 @@ var MultiInput = (props) => {
|
|
12462
12637
|
valid: props.valid
|
12463
12638
|
})));
|
12464
12639
|
};
|
12465
|
-
var MultiInputSkeleton = () => /* @__PURE__ */
|
12640
|
+
var MultiInputSkeleton = () => /* @__PURE__ */ import_react93.default.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ import_react93.default.createElement(MultiInputBase.Skeleton, null));
|
12466
12641
|
MultiInput.Skeleton = MultiInputSkeleton;
|
12467
12642
|
MultiInput.Skeleton.displayName = "MultiInput.Skeleton";
|
12468
12643
|
|
12469
12644
|
// src/molecules/MultiSelect/MultiSelect.tsx
|
12470
|
-
var
|
12471
|
-
var
|
12472
|
-
var
|
12645
|
+
var import_react94 = __toESM(require("react"));
|
12646
|
+
var import_overlays13 = require("@react-aria/overlays");
|
12647
|
+
var import_utils23 = require("@react-aria/utils");
|
12473
12648
|
var import_downshift3 = require("downshift");
|
12649
|
+
var import_isArray2 = __toESM(require("lodash/isArray"));
|
12474
12650
|
var import_isEqual = __toESM(require("lodash/isEqual"));
|
12475
12651
|
var import_isNil2 = __toESM(require("lodash/isNil"));
|
12476
|
-
var
|
12652
|
+
var import_isObject2 = __toESM(require("lodash/isObject"));
|
12653
|
+
var import_omit13 = __toESM(require("lodash/omit"));
|
12477
12654
|
var import_omitBy = __toESM(require("lodash/omitBy"));
|
12478
12655
|
var import_match_sorter2 = require("match-sorter");
|
12656
|
+
var isOptionGroup = (option) => {
|
12657
|
+
return (0, import_isObject2.default)(option) && "options" in option && (0, import_isArray2.default)(option.options);
|
12658
|
+
};
|
12659
|
+
var hasOptionGroups2 = (options) => {
|
12660
|
+
return options.some(isOptionGroup);
|
12661
|
+
};
|
12479
12662
|
var MultiSelectBase = (_a) => {
|
12480
12663
|
var _b = _a, {
|
12481
12664
|
id,
|
@@ -12525,12 +12708,12 @@ var MultiSelectBase = (_a) => {
|
|
12525
12708
|
"children"
|
12526
12709
|
]);
|
12527
12710
|
var _a2;
|
12528
|
-
const popoverRef = (0,
|
12529
|
-
const targetRef = (0,
|
12530
|
-
const menuRef = (0,
|
12531
|
-
const inputRef = (0,
|
12532
|
-
const [inputValue, setInputValue] = (0,
|
12533
|
-
const [hasFocus, setFocus] = (0,
|
12711
|
+
const popoverRef = (0, import_react94.useRef)(null);
|
12712
|
+
const targetRef = (0, import_react94.useRef)(null);
|
12713
|
+
const menuRef = (0, import_react94.useRef)(null);
|
12714
|
+
const inputRef = (0, import_react94.useRef)(null);
|
12715
|
+
const [inputValue, setInputValue] = (0, import_react94.useState)("");
|
12716
|
+
const [hasFocus, setFocus] = (0, import_react94.useState)(false);
|
12534
12717
|
const { selectedItems, addSelectedItem, removeSelectedItem, getDropdownProps, getSelectedItemProps } = (0, import_downshift3.useMultipleSelection)(
|
12535
12718
|
(0, import_omitBy.default)(
|
12536
12719
|
{
|
@@ -12543,9 +12726,14 @@ var MultiSelectBase = (_a) => {
|
|
12543
12726
|
);
|
12544
12727
|
const keys = typeof options[0] === "string" ? void 0 : optionKeys;
|
12545
12728
|
const selectedItemsAsStrings = selectedItems.map(itemToString);
|
12546
|
-
const filteredOptions = (
|
12729
|
+
const filteredOptions = hasOptionGroups2(options) ? options.map((option) => __spreadProps(__spreadValues({}, option), {
|
12730
|
+
options: (inputValue ? (0, import_match_sorter2.matchSorter)(option.options, inputValue, { keys }) : option.options).filter(
|
12731
|
+
(opt) => !selectedItemsAsStrings.includes(itemToString(opt))
|
12732
|
+
)
|
12733
|
+
})) : (inputValue ? (0, import_match_sorter2.matchSorter)(options, inputValue, { keys }) : options).filter(
|
12547
12734
|
(opt) => !selectedItemsAsStrings.includes(itemToString(opt))
|
12548
12735
|
);
|
12736
|
+
const flattenedOptions = hasOptionGroups2(filteredOptions) ? filteredOptions.flatMap((group) => group.options) : filteredOptions;
|
12549
12737
|
const {
|
12550
12738
|
isOpen,
|
12551
12739
|
openMenu,
|
@@ -12562,7 +12750,7 @@ var MultiSelectBase = (_a) => {
|
|
12562
12750
|
defaultSelectedItem: defaultValue,
|
12563
12751
|
isItemDisabled: (item, index) => isOptionDisabled(item, index),
|
12564
12752
|
selectedItem: null,
|
12565
|
-
items:
|
12753
|
+
items: flattenedOptions,
|
12566
12754
|
stateReducer: (_, actionChanges) => {
|
12567
12755
|
var _a3, _b2;
|
12568
12756
|
const { changes, type } = actionChanges;
|
@@ -12594,7 +12782,7 @@ var MultiSelectBase = (_a) => {
|
|
12594
12782
|
case import_downshift3.useCombobox.stateChangeTypes.ItemClick:
|
12595
12783
|
case import_downshift3.useCombobox.stateChangeTypes.InputBlur: {
|
12596
12784
|
setInputValue("");
|
12597
|
-
if (selectedItem && !isOptionDisabled(selectedItem,
|
12785
|
+
if (selectedItem && !isOptionDisabled(selectedItem, flattenedOptions.indexOf(selectedItem)) && !selectedItems.some((val) => (0, import_isEqual.default)(val, selectedItem))) {
|
12598
12786
|
addSelectedItem(selectedItem);
|
12599
12787
|
}
|
12600
12788
|
break;
|
@@ -12609,13 +12797,21 @@ var MultiSelectBase = (_a) => {
|
|
12609
12797
|
toggle: toggleMenu,
|
12610
12798
|
setOpen: (isOpen2) => isOpen2 ? openMenu() : closeMenu()
|
12611
12799
|
};
|
12612
|
-
(0,
|
12800
|
+
(0, import_react94.useEffect)(() => {
|
12613
12801
|
if (state.isOpen && inputRef.current && popoverRef.current) {
|
12614
|
-
return (0,
|
12802
|
+
return (0, import_overlays13.ariaHideOutside)([inputRef.current, popoverRef.current]);
|
12615
12803
|
}
|
12616
12804
|
}, [state.isOpen, inputRef, popoverRef]);
|
12805
|
+
const renderItem = (item, index) => /* @__PURE__ */ import_react94.default.createElement(Select.Item, __spreadValues({
|
12806
|
+
key: itemToString(item),
|
12807
|
+
highlighted: index === highlightedIndex,
|
12808
|
+
selected: selectedItems.includes(item)
|
12809
|
+
}, getItemProps({ item, index })), renderOption(item));
|
12810
|
+
const renderGroup = (group) => group.options.length ? /* @__PURE__ */ import_react94.default.createElement(import_react94.default.Fragment, {
|
12811
|
+
key: group.label
|
12812
|
+
}, /* @__PURE__ */ import_react94.default.createElement(Select.Group, null, group.label), group.options.map((opt) => renderItem(opt, flattenedOptions.indexOf(opt)))) : null;
|
12617
12813
|
const renderChips = () => {
|
12618
|
-
return selectedItems.map((selectedItem, index) => /* @__PURE__ */
|
12814
|
+
return selectedItems.map((selectedItem, index) => /* @__PURE__ */ import_react94.default.createElement(InputChip, __spreadProps(__spreadValues({
|
12619
12815
|
key: `${itemToString(selectedItem)}.chip`,
|
12620
12816
|
className: tw("mx-0"),
|
12621
12817
|
disabled,
|
@@ -12633,14 +12829,14 @@ var MultiSelectBase = (_a) => {
|
|
12633
12829
|
getDropdownProps({ ref: inputRef, disabled: disabled || readOnly, value: inputValue })
|
12634
12830
|
);
|
12635
12831
|
const menuProps = getMenuProps({ ref: menuRef }, { suppressRefError: !isOpen });
|
12636
|
-
return /* @__PURE__ */
|
12832
|
+
return /* @__PURE__ */ import_react94.default.createElement("div", {
|
12637
12833
|
className: classNames("Aquarium-MultiSelectBase", tw("relative"))
|
12638
|
-
}, /* @__PURE__ */
|
12834
|
+
}, /* @__PURE__ */ import_react94.default.createElement(Select.InputContainer, {
|
12639
12835
|
ref: targetRef,
|
12640
12836
|
variant: disabled ? "disabled" : !valid ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default"
|
12641
|
-
}, /* @__PURE__ */
|
12837
|
+
}, /* @__PURE__ */ import_react94.default.createElement("div", {
|
12642
12838
|
className: "grow inline-flex flex-row flex-wrap gap-2"
|
12643
|
-
}, !hideChips && inline && renderChips(), /* @__PURE__ */
|
12839
|
+
}, !hideChips && inline && renderChips(), /* @__PURE__ */ import_react94.default.createElement(Select.Input, __spreadProps(__spreadValues(__spreadValues({
|
12644
12840
|
name,
|
12645
12841
|
placeholder: selectedItems.length === 0 && !readOnly ? placeholder : ""
|
12646
12842
|
}, inputProps), props), {
|
@@ -12659,12 +12855,12 @@ var MultiSelectBase = (_a) => {
|
|
12659
12855
|
setFocus(false);
|
12660
12856
|
(_a3 = inputProps.onBlur) == null ? void 0 : _a3.call(inputProps, e);
|
12661
12857
|
}
|
12662
|
-
}))), !readOnly && /* @__PURE__ */
|
12858
|
+
}))), !readOnly && /* @__PURE__ */ import_react94.default.createElement(Select.Toggle, __spreadValues({
|
12663
12859
|
hasFocus,
|
12664
12860
|
isOpen
|
12665
|
-
}, getToggleButtonProps({ disabled })))), !hideChips && !inline && /* @__PURE__ */
|
12861
|
+
}, getToggleButtonProps({ disabled })))), !hideChips && !inline && /* @__PURE__ */ import_react94.default.createElement("div", {
|
12666
12862
|
className: tw("flex flex-row flex-wrap gap-2 mt-2")
|
12667
|
-
}, renderChips()), isOpen && /* @__PURE__ */
|
12863
|
+
}, renderChips()), isOpen && /* @__PURE__ */ import_react94.default.createElement(PopoverOverlay, {
|
12668
12864
|
ref: popoverRef,
|
12669
12865
|
triggerRef: targetRef,
|
12670
12866
|
state,
|
@@ -12672,15 +12868,13 @@ var MultiSelectBase = (_a) => {
|
|
12672
12868
|
shouldFlip: true,
|
12673
12869
|
isNonModal: true,
|
12674
12870
|
style: { width: (_a2 = targetRef.current) == null ? void 0 : _a2.offsetWidth }
|
12675
|
-
}, /* @__PURE__ */
|
12871
|
+
}, /* @__PURE__ */ import_react94.default.createElement(Select.Menu, __spreadValues({
|
12676
12872
|
maxHeight
|
12677
|
-
}, menuProps), hasNoResults && /* @__PURE__ */
|
12678
|
-
|
12679
|
-
|
12680
|
-
selected: selectedItems.includes(item)
|
12681
|
-
}, getItemProps({ item, index })), renderOption(item))))));
|
12873
|
+
}, menuProps), hasNoResults && /* @__PURE__ */ import_react94.default.createElement(Select.NoResults, null, emptyState), filteredOptions.map(
|
12874
|
+
(option, index) => isOptionGroup(option) ? renderGroup(option) : renderItem(option, index)
|
12875
|
+
))));
|
12682
12876
|
};
|
12683
|
-
var MultiSelectBaseSkeleton = () => /* @__PURE__ */
|
12877
|
+
var MultiSelectBaseSkeleton = () => /* @__PURE__ */ import_react94.default.createElement(Skeleton, {
|
12684
12878
|
height: 38
|
12685
12879
|
});
|
12686
12880
|
MultiSelectBase.Skeleton = MultiSelectBaseSkeleton;
|
@@ -12695,19 +12889,19 @@ var MultiSelect = (_a) => {
|
|
12695
12889
|
"emptyState"
|
12696
12890
|
]);
|
12697
12891
|
var _a2;
|
12698
|
-
const defaultId = (0,
|
12892
|
+
const defaultId = (0, import_utils23.useId)();
|
12699
12893
|
const id = (_a2 = props.id) != null ? _a2 : defaultId;
|
12700
|
-
const errorMessageId = (0,
|
12894
|
+
const errorMessageId = (0, import_utils23.useId)();
|
12701
12895
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
12702
12896
|
const labelControlProps = getLabelControlProps(props);
|
12703
|
-
const baseProps = (0,
|
12704
|
-
return /* @__PURE__ */
|
12897
|
+
const baseProps = (0, import_omit13.default)(props, Object.keys(labelControlProps));
|
12898
|
+
return /* @__PURE__ */ import_react94.default.createElement(LabelControl, __spreadProps(__spreadValues({
|
12705
12899
|
id: `${id}-label`,
|
12706
12900
|
htmlFor: `${id}-input`,
|
12707
12901
|
messageId: errorMessageId
|
12708
12902
|
}, labelControlProps), {
|
12709
12903
|
className: "Aquarium-MultiSelect"
|
12710
|
-
}), /* @__PURE__ */
|
12904
|
+
}), /* @__PURE__ */ import_react94.default.createElement(MultiSelectBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
|
12711
12905
|
id,
|
12712
12906
|
options,
|
12713
12907
|
emptyState,
|
@@ -12715,17 +12909,17 @@ var MultiSelect = (_a) => {
|
|
12715
12909
|
valid: props.valid
|
12716
12910
|
})));
|
12717
12911
|
};
|
12718
|
-
var MultiSelectSkeleton = () => /* @__PURE__ */
|
12912
|
+
var MultiSelectSkeleton = () => /* @__PURE__ */ import_react94.default.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ import_react94.default.createElement(MultiSelectBase.Skeleton, null));
|
12719
12913
|
MultiSelect.Skeleton = MultiSelectSkeleton;
|
12720
12914
|
MultiSelect.Skeleton.displayName = "MultiSelect.Skeleton";
|
12721
12915
|
|
12722
12916
|
// src/molecules/NativeSelect/NativeSelect.tsx
|
12723
|
-
var
|
12724
|
-
var
|
12725
|
-
var
|
12917
|
+
var import_react95 = __toESM(require("react"));
|
12918
|
+
var import_utils24 = require("@react-aria/utils");
|
12919
|
+
var import_omit14 = __toESM(require("lodash/omit"));
|
12726
12920
|
var import_uniqueId = __toESM(require("lodash/uniqueId"));
|
12727
12921
|
var import_caretDown2 = __toESM(require_caretDown());
|
12728
|
-
var NativeSelectBase =
|
12922
|
+
var NativeSelectBase = import_react95.default.forwardRef(
|
12729
12923
|
(_a, ref) => {
|
12730
12924
|
var _b = _a, { children, disabled = false, required = false, valid = true, readOnly = false } = _b, props = __objRest(_b, ["children", "disabled", "required", "valid", "readOnly"]);
|
12731
12925
|
const placeholderValue = (0, import_uniqueId.default)("default_value_for_placeholder");
|
@@ -12742,16 +12936,16 @@ var NativeSelectBase = import_react94.default.forwardRef(
|
|
12742
12936
|
(_b2 = props.onBlur) == null ? void 0 : _b2.call(props, event);
|
12743
12937
|
}
|
12744
12938
|
};
|
12745
|
-
return /* @__PURE__ */
|
12939
|
+
return /* @__PURE__ */ import_react95.default.createElement("span", {
|
12746
12940
|
className: classNames("Aquarium-NativeSelectBase", tw("relative block"))
|
12747
|
-
}, !readOnly && /* @__PURE__ */
|
12941
|
+
}, !readOnly && /* @__PURE__ */ import_react95.default.createElement("span", {
|
12748
12942
|
className: tw(
|
12749
12943
|
"absolute right-0 inset-y-0 mr-4 text-grey-40 flex ml-3 pointer-events-none typography-default-strong mt-4"
|
12750
12944
|
)
|
12751
|
-
}, /* @__PURE__ */
|
12945
|
+
}, /* @__PURE__ */ import_react95.default.createElement(Icon, {
|
12752
12946
|
icon: import_caretDown2.default,
|
12753
12947
|
"data-testid": "icon-dropdown"
|
12754
|
-
})), /* @__PURE__ */
|
12948
|
+
})), /* @__PURE__ */ import_react95.default.createElement("select", __spreadProps(__spreadValues({
|
12755
12949
|
ref,
|
12756
12950
|
disabled: disabled || readOnly,
|
12757
12951
|
required
|
@@ -12770,32 +12964,32 @@ var NativeSelectBase = import_react94.default.forwardRef(
|
|
12770
12964
|
),
|
12771
12965
|
props.className
|
12772
12966
|
)
|
12773
|
-
}), props.placeholder && /* @__PURE__ */
|
12967
|
+
}), props.placeholder && /* @__PURE__ */ import_react95.default.createElement("option", {
|
12774
12968
|
value: placeholderValue,
|
12775
12969
|
disabled: true
|
12776
12970
|
}, props.placeholder), children));
|
12777
12971
|
}
|
12778
12972
|
);
|
12779
|
-
NativeSelectBase.Skeleton = () => /* @__PURE__ */
|
12973
|
+
NativeSelectBase.Skeleton = () => /* @__PURE__ */ import_react95.default.createElement(Skeleton, {
|
12780
12974
|
height: 38
|
12781
12975
|
});
|
12782
|
-
var NativeSelect =
|
12976
|
+
var NativeSelect = import_react95.default.forwardRef(
|
12783
12977
|
(_a, ref) => {
|
12784
12978
|
var _b = _a, { readOnly } = _b, props = __objRest(_b, ["readOnly"]);
|
12785
12979
|
var _a2;
|
12786
|
-
const defaultId = (0,
|
12980
|
+
const defaultId = (0, import_utils24.useId)();
|
12787
12981
|
const id = (_a2 = props.id) != null ? _a2 : defaultId;
|
12788
|
-
const errorMessageId = (0,
|
12982
|
+
const errorMessageId = (0, import_utils24.useId)();
|
12789
12983
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
12790
12984
|
const _b2 = getLabelControlProps(props), { "data-testid": dataTestId } = _b2, labelControlProps = __objRest(_b2, ["data-testid"]);
|
12791
|
-
const baseProps = (0,
|
12792
|
-
return /* @__PURE__ */
|
12985
|
+
const baseProps = (0, import_omit14.default)(props, Object.keys(labelControlProps));
|
12986
|
+
return /* @__PURE__ */ import_react95.default.createElement(LabelControl, __spreadProps(__spreadValues({
|
12793
12987
|
id: `${id}-label`,
|
12794
12988
|
htmlFor: id,
|
12795
12989
|
messageId: errorMessageId
|
12796
12990
|
}, labelControlProps), {
|
12797
12991
|
className: "Aquarium-NativeSelect"
|
12798
|
-
}), /* @__PURE__ */
|
12992
|
+
}), /* @__PURE__ */ import_react95.default.createElement(NativeSelectBase, __spreadProps(__spreadValues(__spreadValues({
|
12799
12993
|
ref
|
12800
12994
|
}, baseProps), errorProps), {
|
12801
12995
|
id,
|
@@ -12809,63 +13003,63 @@ var NativeSelect = import_react94.default.forwardRef(
|
|
12809
13003
|
}
|
12810
13004
|
);
|
12811
13005
|
NativeSelect.displayName = "NativeSelect";
|
12812
|
-
var Option =
|
13006
|
+
var Option = import_react95.default.forwardRef((_a, ref) => {
|
12813
13007
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
12814
|
-
return /* @__PURE__ */
|
13008
|
+
return /* @__PURE__ */ import_react95.default.createElement("option", __spreadValues({
|
12815
13009
|
ref
|
12816
13010
|
}, props), children);
|
12817
13011
|
});
|
12818
13012
|
Option.displayName = "Option";
|
12819
|
-
var NativeSelectSkeleton = () => /* @__PURE__ */
|
13013
|
+
var NativeSelectSkeleton = () => /* @__PURE__ */ import_react95.default.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ import_react95.default.createElement(NativeSelectBase.Skeleton, null), /* @__PURE__ */ import_react95.default.createElement("div", {
|
12820
13014
|
style: { height: "1px" }
|
12821
13015
|
}));
|
12822
13016
|
NativeSelect.Skeleton = NativeSelectSkeleton;
|
12823
13017
|
NativeSelect.Skeleton.displayName = "NativeSelect.Skeleton";
|
12824
13018
|
|
12825
13019
|
// src/molecules/Navigation/Navigation.tsx
|
12826
|
-
var
|
13020
|
+
var import_react97 = __toESM(require("react"));
|
12827
13021
|
var import_classnames10 = __toESM(require("classnames"));
|
12828
13022
|
|
12829
13023
|
// src/atoms/Navigation/Navigation.tsx
|
12830
|
-
var
|
13024
|
+
var import_react96 = __toESM(require("react"));
|
12831
13025
|
var Navigation = (_a) => {
|
12832
13026
|
var _b = _a, { className, children } = _b, rest = __objRest(_b, ["className", "children"]);
|
12833
|
-
return /* @__PURE__ */
|
13027
|
+
return /* @__PURE__ */ import_react96.default.createElement("nav", {
|
12834
13028
|
className: classNames(tw("bg-grey-0 h-full"))
|
12835
|
-
}, /* @__PURE__ */
|
13029
|
+
}, /* @__PURE__ */ import_react96.default.createElement("ul", __spreadProps(__spreadValues({}, rest), {
|
12836
13030
|
className: classNames(tw("flex flex-col h-full"), className),
|
12837
13031
|
role: "menubar"
|
12838
13032
|
}), children));
|
12839
13033
|
};
|
12840
13034
|
var Header = (_a) => {
|
12841
13035
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
12842
|
-
return /* @__PURE__ */
|
13036
|
+
return /* @__PURE__ */ import_react96.default.createElement("li", __spreadProps(__spreadValues({}, rest), {
|
12843
13037
|
role: "presentation",
|
12844
13038
|
className: classNames(tw("px-6 py-5"), className)
|
12845
13039
|
}));
|
12846
13040
|
};
|
12847
13041
|
var Footer = (_a) => {
|
12848
13042
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
12849
|
-
return /* @__PURE__ */
|
13043
|
+
return /* @__PURE__ */ import_react96.default.createElement("li", __spreadProps(__spreadValues({}, rest), {
|
12850
13044
|
role: "presentation",
|
12851
13045
|
className: classNames(tw("px-6 py-5 mt-auto"), className)
|
12852
13046
|
}));
|
12853
13047
|
};
|
12854
13048
|
var Section2 = (_a) => {
|
12855
13049
|
var _b = _a, { title, className } = _b, rest = __objRest(_b, ["title", "className"]);
|
12856
|
-
return /* @__PURE__ */
|
13050
|
+
return /* @__PURE__ */ import_react96.default.createElement("li", {
|
12857
13051
|
role: "presentation",
|
12858
13052
|
className: tw("py-5")
|
12859
|
-
}, title && /* @__PURE__ */
|
13053
|
+
}, title && /* @__PURE__ */ import_react96.default.createElement("div", {
|
12860
13054
|
className: classNames(className, "py-2 px-6 text-grey-40 uppercase cursor-default typography-caption")
|
12861
|
-
}, title), /* @__PURE__ */
|
13055
|
+
}, title), /* @__PURE__ */ import_react96.default.createElement("ul", __spreadProps(__spreadValues({}, rest), {
|
12862
13056
|
role: "group",
|
12863
13057
|
className: classNames(tw("flex flex-col"), className)
|
12864
13058
|
})));
|
12865
13059
|
};
|
12866
13060
|
var Divider3 = (_a) => {
|
12867
13061
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
12868
|
-
return /* @__PURE__ */
|
13062
|
+
return /* @__PURE__ */ import_react96.default.createElement("li", __spreadProps(__spreadValues({
|
12869
13063
|
role: "separator"
|
12870
13064
|
}, rest), {
|
12871
13065
|
className: classNames(tw("border-t-2 border-grey-5"), className)
|
@@ -12873,9 +13067,9 @@ var Divider3 = (_a) => {
|
|
12873
13067
|
};
|
12874
13068
|
var Item5 = (_a) => {
|
12875
13069
|
var _b = _a, { className, active } = _b, rest = __objRest(_b, ["className", "active"]);
|
12876
|
-
return /* @__PURE__ */
|
13070
|
+
return /* @__PURE__ */ import_react96.default.createElement("li", {
|
12877
13071
|
role: "presentation"
|
12878
|
-
}, /* @__PURE__ */
|
13072
|
+
}, /* @__PURE__ */ import_react96.default.createElement("a", __spreadProps(__spreadValues({}, rest), {
|
12879
13073
|
role: "menuitem",
|
12880
13074
|
className: classNames(
|
12881
13075
|
tw("py-3 px-6 hover:bg-grey-5 cursor-pointer flex gap-4 items-center typography-small focusable", {
|
@@ -12895,7 +13089,7 @@ Navigation.Divider = Divider3;
|
|
12895
13089
|
// src/molecules/Navigation/Navigation.tsx
|
12896
13090
|
var Navigation2 = (_a) => {
|
12897
13091
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
12898
|
-
return /* @__PURE__ */
|
13092
|
+
return /* @__PURE__ */ import_react97.default.createElement(Navigation, __spreadValues({
|
12899
13093
|
className: (0, import_classnames10.default)("Aquarium-Navigation", className)
|
12900
13094
|
}, props));
|
12901
13095
|
};
|
@@ -12909,11 +13103,11 @@ var Item6 = (_a) => {
|
|
12909
13103
|
"icon",
|
12910
13104
|
"showNotification"
|
12911
13105
|
]);
|
12912
|
-
return /* @__PURE__ */
|
13106
|
+
return /* @__PURE__ */ import_react97.default.createElement(Navigation.Item, __spreadValues({}, rest), icon && showNotification && /* @__PURE__ */ import_react97.default.createElement(Badge.Notification, null, /* @__PURE__ */ import_react97.default.createElement(InlineIcon, {
|
12913
13107
|
icon,
|
12914
13108
|
width: "20px",
|
12915
13109
|
height: "20px"
|
12916
|
-
})), icon && !showNotification && /* @__PURE__ */
|
13110
|
+
})), icon && !showNotification && /* @__PURE__ */ import_react97.default.createElement(InlineIcon, {
|
12917
13111
|
icon,
|
12918
13112
|
width: "20px",
|
12919
13113
|
height: "20px"
|
@@ -12926,32 +13120,32 @@ Navigation2.Header = Navigation.Header;
|
|
12926
13120
|
Navigation2.Section = Navigation.Section;
|
12927
13121
|
|
12928
13122
|
// src/molecules/PageHeader/PageHeader.tsx
|
12929
|
-
var
|
12930
|
-
var
|
13123
|
+
var import_react99 = __toESM(require("react"));
|
13124
|
+
var import_castArray4 = __toESM(require("lodash/castArray"));
|
12931
13125
|
|
12932
13126
|
// src/atoms/PageHeader/PageHeader.tsx
|
12933
|
-
var
|
13127
|
+
var import_react98 = __toESM(require("react"));
|
12934
13128
|
var PageHeader = (_a) => {
|
12935
13129
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12936
|
-
return /* @__PURE__ */
|
13130
|
+
return /* @__PURE__ */ import_react98.default.createElement("div", __spreadValues({
|
12937
13131
|
className: classNames(tw("flex flex-row gap-4 pb-6"), className)
|
12938
13132
|
}, rest), children);
|
12939
13133
|
};
|
12940
13134
|
PageHeader.Container = (_a) => {
|
12941
13135
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12942
|
-
return /* @__PURE__ */
|
13136
|
+
return /* @__PURE__ */ import_react98.default.createElement("div", __spreadValues({
|
12943
13137
|
className: classNames(tw("flex flex-col grow gap-0"), className)
|
12944
13138
|
}, rest), children);
|
12945
13139
|
};
|
12946
13140
|
PageHeader.TitleContainer = (_a) => {
|
12947
13141
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12948
|
-
return /* @__PURE__ */
|
13142
|
+
return /* @__PURE__ */ import_react98.default.createElement("div", __spreadValues({
|
12949
13143
|
className: classNames(tw("flex flex-col justify-center gap-2"), className)
|
12950
13144
|
}, rest), children);
|
12951
13145
|
};
|
12952
13146
|
PageHeader.Title = (_a) => {
|
12953
13147
|
var _b = _a, { isSubHeader = false, children } = _b, rest = __objRest(_b, ["isSubHeader", "children"]);
|
12954
|
-
return /* @__PURE__ */
|
13148
|
+
return /* @__PURE__ */ import_react98.default.createElement(Typography2, __spreadProps(__spreadValues({}, rest), {
|
12955
13149
|
color: "grey-100",
|
12956
13150
|
variant: isSubHeader ? "subheading" : "heading",
|
12957
13151
|
htmlTag: isSubHeader ? "h2" : "h1"
|
@@ -12959,25 +13153,25 @@ PageHeader.Title = (_a) => {
|
|
12959
13153
|
};
|
12960
13154
|
PageHeader.Subtitle = (_a) => {
|
12961
13155
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
12962
|
-
return /* @__PURE__ */
|
13156
|
+
return /* @__PURE__ */ import_react98.default.createElement(Typography2.Small, __spreadProps(__spreadValues({}, rest), {
|
12963
13157
|
color: "grey-70"
|
12964
13158
|
}), children);
|
12965
13159
|
};
|
12966
13160
|
PageHeader.Chips = (_a) => {
|
12967
13161
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12968
|
-
return /* @__PURE__ */
|
13162
|
+
return /* @__PURE__ */ import_react98.default.createElement("div", __spreadValues({
|
12969
13163
|
className: classNames(tw("flex gap-3"), className)
|
12970
13164
|
}, rest), children);
|
12971
13165
|
};
|
12972
13166
|
PageHeader.Actions = (_a) => {
|
12973
13167
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12974
|
-
return /* @__PURE__ */
|
13168
|
+
return /* @__PURE__ */ import_react98.default.createElement("div", __spreadValues({
|
12975
13169
|
className: classNames(tw("flex flex-row gap-4 self-start"), className)
|
12976
13170
|
}, rest), children);
|
12977
13171
|
};
|
12978
13172
|
|
12979
13173
|
// src/molecules/PageHeader/PageHeader.tsx
|
12980
|
-
var
|
13174
|
+
var import_more5 = __toESM(require_more());
|
12981
13175
|
var CommonPageHeader = ({
|
12982
13176
|
title,
|
12983
13177
|
subtitle,
|
@@ -12995,63 +13189,63 @@ var CommonPageHeader = ({
|
|
12995
13189
|
onMenuOpenChange,
|
12996
13190
|
isSubHeader = false
|
12997
13191
|
}) => {
|
12998
|
-
return /* @__PURE__ */
|
13192
|
+
return /* @__PURE__ */ import_react99.default.createElement(PageHeader, {
|
12999
13193
|
className: "Aquarium-PageHeader"
|
13000
|
-
}, /* @__PURE__ */
|
13194
|
+
}, /* @__PURE__ */ import_react99.default.createElement(PageHeader.Container, null, breadcrumbs && /* @__PURE__ */ import_react99.default.createElement(Box, {
|
13001
13195
|
marginBottom: "3"
|
13002
|
-
}, /* @__PURE__ */
|
13196
|
+
}, /* @__PURE__ */ import_react99.default.createElement(Breadcrumbs, null, breadcrumbs)), /* @__PURE__ */ import_react99.default.createElement(Spacing, {
|
13003
13197
|
row: true,
|
13004
13198
|
gap: "5"
|
13005
|
-
}, image && /* @__PURE__ */
|
13199
|
+
}, image && /* @__PURE__ */ import_react99.default.createElement("img", {
|
13006
13200
|
src: image,
|
13007
13201
|
alt: imageAlt != null ? imageAlt : "",
|
13008
13202
|
className: tw("w-[56px] h-[56px]")
|
13009
|
-
}), /* @__PURE__ */
|
13203
|
+
}), /* @__PURE__ */ import_react99.default.createElement(PageHeader.TitleContainer, null, /* @__PURE__ */ import_react99.default.createElement(PageHeader.Title, {
|
13010
13204
|
isSubHeader
|
13011
|
-
}, title), chips.length > 0 && /* @__PURE__ */
|
13205
|
+
}, title), chips.length > 0 && /* @__PURE__ */ import_react99.default.createElement(PageHeader.Chips, null, chips.map((chip) => /* @__PURE__ */ import_react99.default.createElement(Chip2, {
|
13012
13206
|
key: chip,
|
13013
13207
|
dense: true,
|
13014
13208
|
text: chip
|
13015
|
-
}))), subtitle && /* @__PURE__ */
|
13209
|
+
}))), subtitle && /* @__PURE__ */ import_react99.default.createElement(PageHeader.Subtitle, null, subtitle)))), (secondaryActions || primaryAction || secondaryAction || menu) && /* @__PURE__ */ import_react99.default.createElement(PageHeader.Actions, null, menu && /* @__PURE__ */ import_react99.default.createElement(Box.Flex, {
|
13016
13210
|
alignItems: "center"
|
13017
|
-
}, /* @__PURE__ */
|
13211
|
+
}, /* @__PURE__ */ import_react99.default.createElement(DropdownMenu2, {
|
13018
13212
|
onAction: (action) => onAction == null ? void 0 : onAction(action),
|
13019
13213
|
onOpenChange: onMenuOpenChange
|
13020
|
-
}, /* @__PURE__ */
|
13214
|
+
}, /* @__PURE__ */ import_react99.default.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ import_react99.default.createElement(Button.Icon, {
|
13021
13215
|
"aria-label": menuAriaLabel,
|
13022
|
-
icon:
|
13023
|
-
})), menu)), secondaryActions && (0,
|
13216
|
+
icon: import_more5.default
|
13217
|
+
})), menu)), secondaryActions && (0, import_castArray4.default)(secondaryActions).filter(Boolean).map((secondaryAction2) => renderAction({ kind: "secondary", action: secondaryAction2 })), primaryAction && renderAction({ kind: "primary", action: primaryAction })));
|
13024
13218
|
};
|
13025
|
-
var PageHeader2 = (props) => /* @__PURE__ */
|
13219
|
+
var PageHeader2 = (props) => /* @__PURE__ */ import_react99.default.createElement(CommonPageHeader, __spreadValues({}, props));
|
13026
13220
|
PageHeader2.displayName = "PageHeader";
|
13027
|
-
var SubHeader = (props) => /* @__PURE__ */
|
13221
|
+
var SubHeader = (props) => /* @__PURE__ */ import_react99.default.createElement(CommonPageHeader, __spreadProps(__spreadValues({}, props), {
|
13028
13222
|
isSubHeader: true
|
13029
13223
|
}));
|
13030
13224
|
PageHeader2.SubHeader = SubHeader;
|
13031
13225
|
PageHeader2.SubHeader.displayName = "PageHeader.SubHeader";
|
13032
13226
|
|
13033
13227
|
// src/molecules/PopoverDialog/PopoverDialog.tsx
|
13034
|
-
var
|
13035
|
-
var
|
13228
|
+
var import_react101 = __toESM(require("react"));
|
13229
|
+
var import_omit15 = __toESM(require("lodash/omit"));
|
13036
13230
|
|
13037
13231
|
// src/atoms/PopoverDialog/PopoverDialog.tsx
|
13038
|
-
var
|
13232
|
+
var import_react100 = __toESM(require("react"));
|
13039
13233
|
var Header2 = (_a) => {
|
13040
13234
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
13041
|
-
return /* @__PURE__ */
|
13235
|
+
return /* @__PURE__ */ import_react100.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13042
13236
|
className: classNames(tw("p-5 gap-3 flex items-center"), className)
|
13043
13237
|
}), children);
|
13044
13238
|
};
|
13045
13239
|
var Title2 = (_a) => {
|
13046
13240
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
13047
|
-
return /* @__PURE__ */
|
13241
|
+
return /* @__PURE__ */ import_react100.default.createElement(Typography, __spreadProps(__spreadValues({}, rest), {
|
13048
13242
|
htmlTag: "h1",
|
13049
13243
|
variant: "small-strong"
|
13050
13244
|
}), children);
|
13051
13245
|
};
|
13052
13246
|
var Body = (_a) => {
|
13053
13247
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
13054
|
-
return /* @__PURE__ */
|
13248
|
+
return /* @__PURE__ */ import_react100.default.createElement(Typography, __spreadProps(__spreadValues({}, rest), {
|
13055
13249
|
htmlTag: "div",
|
13056
13250
|
variant: "caption",
|
13057
13251
|
className: classNames(tw("px-5 overflow-y-auto"), className)
|
@@ -13059,13 +13253,13 @@ var Body = (_a) => {
|
|
13059
13253
|
};
|
13060
13254
|
var Footer2 = (_a) => {
|
13061
13255
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
13062
|
-
return /* @__PURE__ */
|
13256
|
+
return /* @__PURE__ */ import_react100.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13063
13257
|
className: classNames(tw("p-5"), className)
|
13064
13258
|
}), children);
|
13065
13259
|
};
|
13066
13260
|
var Actions2 = (_a) => {
|
13067
13261
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
13068
|
-
return /* @__PURE__ */
|
13262
|
+
return /* @__PURE__ */ import_react100.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13069
13263
|
className: classNames(tw("flex gap-4"), className)
|
13070
13264
|
}), children);
|
13071
13265
|
};
|
@@ -13081,29 +13275,29 @@ var PopoverDialog = {
|
|
13081
13275
|
var PopoverDialog2 = ({ placement, open, title, secondaryAction, primaryAction, children }) => {
|
13082
13276
|
const wrapPromptWithBody = (child) => {
|
13083
13277
|
if (isComponentType(child, PopoverDialog2.Prompt)) {
|
13084
|
-
return /* @__PURE__ */
|
13278
|
+
return /* @__PURE__ */ import_react101.default.createElement(Popover2.Panel, {
|
13085
13279
|
className: classNames("Aquarium-PopoverDialog", tw("max-w-[300px]"))
|
13086
|
-
}, /* @__PURE__ */
|
13280
|
+
}, /* @__PURE__ */ import_react101.default.createElement(PopoverDialog.Header, null, /* @__PURE__ */ import_react101.default.createElement(PopoverDialog.Title, null, title)), child, /* @__PURE__ */ import_react101.default.createElement(PopoverDialog.Footer, null, /* @__PURE__ */ import_react101.default.createElement(PopoverDialog.Actions, null, secondaryAction && /* @__PURE__ */ import_react101.default.createElement(Popover2.Button, __spreadValues({
|
13087
13281
|
kind: "secondary-ghost",
|
13088
13282
|
key: secondaryAction.text,
|
13089
13283
|
dense: true
|
13090
|
-
}, (0,
|
13284
|
+
}, (0, import_omit15.default)(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */ import_react101.default.createElement(Popover2.Button, __spreadValues({
|
13091
13285
|
kind: "ghost",
|
13092
13286
|
key: primaryAction.text,
|
13093
13287
|
dense: true
|
13094
|
-
}, (0,
|
13288
|
+
}, (0, import_omit15.default)(primaryAction, "text")), primaryAction.text))));
|
13095
13289
|
}
|
13096
13290
|
return child;
|
13097
13291
|
};
|
13098
|
-
return /* @__PURE__ */
|
13292
|
+
return /* @__PURE__ */ import_react101.default.createElement(Popover2, {
|
13099
13293
|
type: "dialog",
|
13100
13294
|
isOpen: open,
|
13101
13295
|
placement,
|
13102
13296
|
containFocus: true
|
13103
|
-
},
|
13297
|
+
}, import_react101.default.Children.map(children, wrapPromptWithBody));
|
13104
13298
|
};
|
13105
13299
|
PopoverDialog2.Trigger = Popover2.Trigger;
|
13106
|
-
var Prompt = ({ children }) => /* @__PURE__ */
|
13300
|
+
var Prompt = ({ children }) => /* @__PURE__ */ import_react101.default.createElement(PopoverDialog.Body, null, children);
|
13107
13301
|
Prompt.displayName = "PopoverDialog.Prompt";
|
13108
13302
|
PopoverDialog2.Prompt = Prompt;
|
13109
13303
|
|
@@ -13112,14 +13306,14 @@ var import_react_dom = require("react-dom");
|
|
13112
13306
|
var Portal = ({ children, to }) => (0, import_react_dom.createPortal)(children, to);
|
13113
13307
|
|
13114
13308
|
// src/molecules/ProgressBar/ProgressBar.tsx
|
13115
|
-
var
|
13309
|
+
var import_react103 = __toESM(require("react"));
|
13116
13310
|
|
13117
13311
|
// src/atoms/ProgressBar/ProgressBar.tsx
|
13118
|
-
var
|
13312
|
+
var import_react102 = __toESM(require("react"));
|
13119
13313
|
var import_clamp3 = __toESM(require("lodash/clamp"));
|
13120
13314
|
var ProgressBar = (_a) => {
|
13121
13315
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
13122
|
-
return /* @__PURE__ */
|
13316
|
+
return /* @__PURE__ */ import_react102.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13123
13317
|
className: classNames(
|
13124
13318
|
tw("relative flex items-center w-full bg-grey-0 h-2 rounded-full overflow-hidden"),
|
13125
13319
|
className
|
@@ -13135,7 +13329,7 @@ var STATUS_COLORS = {
|
|
13135
13329
|
ProgressBar.Indicator = (_a) => {
|
13136
13330
|
var _b = _a, { min, max, value, "aria-label": ariaLabel, status, className } = _b, rest = __objRest(_b, ["min", "max", "value", "aria-label", "status", "className"]);
|
13137
13331
|
const completedPercentage = (0, import_clamp3.default)((value - min) / (max - min) * 100, 0, 100);
|
13138
|
-
return /* @__PURE__ */
|
13332
|
+
return /* @__PURE__ */ import_react102.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13139
13333
|
className: classNames(
|
13140
13334
|
tw("h-2 rounded-full transition-all ease-in-out delay-150"),
|
13141
13335
|
STATUS_COLORS[status],
|
@@ -13151,11 +13345,11 @@ ProgressBar.Indicator = (_a) => {
|
|
13151
13345
|
};
|
13152
13346
|
ProgressBar.Labels = (_a) => {
|
13153
13347
|
var _b = _a, { children, startLabel, endLabel, className } = _b, rest = __objRest(_b, ["children", "startLabel", "endLabel", "className"]);
|
13154
|
-
return /* @__PURE__ */
|
13348
|
+
return /* @__PURE__ */ import_react102.default.createElement("div", {
|
13155
13349
|
className: classNames(tw("flex flex-row"), className)
|
13156
|
-
}, /* @__PURE__ */
|
13350
|
+
}, /* @__PURE__ */ import_react102.default.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
13157
13351
|
className: tw("grow text-grey-70 typography-caption")
|
13158
|
-
}), startLabel), /* @__PURE__ */
|
13352
|
+
}), startLabel), /* @__PURE__ */ import_react102.default.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
13159
13353
|
className: tw("grow text-grey-70 typography-caption text-right")
|
13160
13354
|
}), endLabel));
|
13161
13355
|
};
|
@@ -13173,7 +13367,7 @@ var ProgressBar2 = (props) => {
|
|
13173
13367
|
if (min > max) {
|
13174
13368
|
throw new Error("`min` value provided to `ProgressBar` is greater than `max` value.");
|
13175
13369
|
}
|
13176
|
-
const progress = /* @__PURE__ */
|
13370
|
+
const progress = /* @__PURE__ */ import_react103.default.createElement(ProgressBar, null, /* @__PURE__ */ import_react103.default.createElement(ProgressBar.Indicator, {
|
13177
13371
|
status: value === max ? completedStatus : progresStatus,
|
13178
13372
|
min,
|
13179
13373
|
max,
|
@@ -13183,15 +13377,15 @@ var ProgressBar2 = (props) => {
|
|
13183
13377
|
if (props.dense) {
|
13184
13378
|
return progress;
|
13185
13379
|
}
|
13186
|
-
return /* @__PURE__ */
|
13380
|
+
return /* @__PURE__ */ import_react103.default.createElement("div", {
|
13187
13381
|
className: "Aquarium-ProgressBar"
|
13188
|
-
}, progress, /* @__PURE__ */
|
13382
|
+
}, progress, /* @__PURE__ */ import_react103.default.createElement(ProgressBar.Labels, {
|
13189
13383
|
className: tw("py-2"),
|
13190
13384
|
startLabel: props.startLabel,
|
13191
13385
|
endLabel: props.endLabel
|
13192
13386
|
}));
|
13193
13387
|
};
|
13194
|
-
var ProgressBarSkeleton = () => /* @__PURE__ */
|
13388
|
+
var ProgressBarSkeleton = () => /* @__PURE__ */ import_react103.default.createElement(Skeleton, {
|
13195
13389
|
height: 4,
|
13196
13390
|
display: "block"
|
13197
13391
|
});
|
@@ -13199,13 +13393,13 @@ ProgressBar2.Skeleton = ProgressBarSkeleton;
|
|
13199
13393
|
ProgressBar2.Skeleton.displayName = "ProgressBar.Skeleton";
|
13200
13394
|
|
13201
13395
|
// src/molecules/RadioButton/RadioButton.tsx
|
13202
|
-
var
|
13203
|
-
var RadioButton2 =
|
13396
|
+
var import_react104 = __toESM(require("react"));
|
13397
|
+
var RadioButton2 = import_react104.default.forwardRef(
|
13204
13398
|
(_a, ref) => {
|
13205
13399
|
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"]);
|
13206
13400
|
var _a2;
|
13207
13401
|
const isChecked = (_a2 = props.checked) != null ? _a2 : props.defaultChecked;
|
13208
|
-
return !readOnly || isChecked ? /* @__PURE__ */
|
13402
|
+
return !readOnly || isChecked ? /* @__PURE__ */ import_react104.default.createElement(ControlLabel, {
|
13209
13403
|
htmlFor: id,
|
13210
13404
|
label: children,
|
13211
13405
|
"aria-label": ariaLabel,
|
@@ -13214,7 +13408,7 @@ var RadioButton2 = import_react103.default.forwardRef(
|
|
13214
13408
|
disabled,
|
13215
13409
|
style: { gap: "0 8px" },
|
13216
13410
|
className: "Aquarium-RadioButton"
|
13217
|
-
}, !readOnly && /* @__PURE__ */
|
13411
|
+
}, !readOnly && /* @__PURE__ */ import_react104.default.createElement(RadioButton, __spreadProps(__spreadValues({
|
13218
13412
|
id,
|
13219
13413
|
ref,
|
13220
13414
|
name
|
@@ -13225,12 +13419,12 @@ var RadioButton2 = import_react103.default.forwardRef(
|
|
13225
13419
|
}
|
13226
13420
|
);
|
13227
13421
|
RadioButton2.displayName = "RadioButton";
|
13228
|
-
var RadioButtonSkeleton = () => /* @__PURE__ */
|
13422
|
+
var RadioButtonSkeleton = () => /* @__PURE__ */ import_react104.default.createElement("div", {
|
13229
13423
|
className: tw("flex gap-3")
|
13230
|
-
}, /* @__PURE__ */
|
13424
|
+
}, /* @__PURE__ */ import_react104.default.createElement(Skeleton, {
|
13231
13425
|
height: 20,
|
13232
13426
|
width: 20
|
13233
|
-
}), /* @__PURE__ */
|
13427
|
+
}), /* @__PURE__ */ import_react104.default.createElement(Skeleton, {
|
13234
13428
|
height: 20,
|
13235
13429
|
width: 150
|
13236
13430
|
}));
|
@@ -13238,10 +13432,10 @@ RadioButton2.Skeleton = RadioButtonSkeleton;
|
|
13238
13432
|
RadioButton2.Skeleton.displayName = "RadioButton.Skeleton";
|
13239
13433
|
|
13240
13434
|
// src/molecules/RadioButtonGroup/RadioButtonGroup.tsx
|
13241
|
-
var
|
13242
|
-
var
|
13435
|
+
var import_react105 = __toESM(require("react"));
|
13436
|
+
var import_utils26 = require("@react-aria/utils");
|
13243
13437
|
var isRadioButton = (c) => {
|
13244
|
-
return
|
13438
|
+
return import_react105.default.isValidElement(c) && c.type === RadioButton2;
|
13245
13439
|
};
|
13246
13440
|
var RadioButtonGroup = (_a) => {
|
13247
13441
|
var _b = _a, {
|
@@ -13264,8 +13458,8 @@ var RadioButtonGroup = (_a) => {
|
|
13264
13458
|
"children"
|
13265
13459
|
]);
|
13266
13460
|
var _a2;
|
13267
|
-
const [value, setValue] =
|
13268
|
-
const errorMessageId = (0,
|
13461
|
+
const [value, setValue] = import_react105.default.useState((_a2 = _value != null ? _value : defaultValue) != null ? _a2 : "");
|
13462
|
+
const errorMessageId = (0, import_utils26.useId)();
|
13269
13463
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
13270
13464
|
const labelControlProps = getLabelControlProps(props);
|
13271
13465
|
if (_value !== void 0 && _value !== value) {
|
@@ -13275,14 +13469,14 @@ var RadioButtonGroup = (_a) => {
|
|
13275
13469
|
setValue(e.target.value);
|
13276
13470
|
onChange == null ? void 0 : onChange(e.target.value);
|
13277
13471
|
};
|
13278
|
-
const content =
|
13472
|
+
const content = import_react105.default.Children.map(children, (c) => {
|
13279
13473
|
var _a3, _b2, _c;
|
13280
13474
|
if (!isRadioButton(c)) {
|
13281
13475
|
return null;
|
13282
13476
|
}
|
13283
13477
|
const defaultChecked = defaultValue === void 0 ? void 0 : c.props.value === defaultValue;
|
13284
13478
|
const checked = value === void 0 ? void 0 : c.props.value === value;
|
13285
|
-
return
|
13479
|
+
return import_react105.default.cloneElement(c, {
|
13286
13480
|
name,
|
13287
13481
|
defaultChecked: (_a3 = c.props.defaultChecked) != null ? _a3 : defaultChecked,
|
13288
13482
|
checked: (_b2 = c.props.checked) != null ? _b2 : checked,
|
@@ -13291,13 +13485,13 @@ var RadioButtonGroup = (_a) => {
|
|
13291
13485
|
readOnly
|
13292
13486
|
});
|
13293
13487
|
});
|
13294
|
-
return /* @__PURE__ */
|
13488
|
+
return /* @__PURE__ */ import_react105.default.createElement(LabelControl, __spreadProps(__spreadValues(__spreadValues({
|
13295
13489
|
fieldset: true
|
13296
13490
|
}, labelControlProps), errorProps), {
|
13297
13491
|
className: "Aquarium-RadioButtonGroup"
|
13298
|
-
}), cols && /* @__PURE__ */
|
13492
|
+
}), cols && /* @__PURE__ */ import_react105.default.createElement(InputGroup, {
|
13299
13493
|
cols
|
13300
|
-
}, content), !cols && /* @__PURE__ */
|
13494
|
+
}, content), !cols && /* @__PURE__ */ import_react105.default.createElement(Flexbox, {
|
13301
13495
|
direction,
|
13302
13496
|
alignItems: "flex-start",
|
13303
13497
|
colGap: "8",
|
@@ -13306,12 +13500,12 @@ var RadioButtonGroup = (_a) => {
|
|
13306
13500
|
}, content));
|
13307
13501
|
};
|
13308
13502
|
var RadioButtonGroupSkeleton = ({ direction = "row", options = 2 }) => {
|
13309
|
-
return /* @__PURE__ */
|
13503
|
+
return /* @__PURE__ */ import_react105.default.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ import_react105.default.createElement("div", {
|
13310
13504
|
className: tw("flex flex-wrap", {
|
13311
13505
|
"flex-row gap-8": direction === "row",
|
13312
13506
|
"flex-col gap-2": direction === "column"
|
13313
13507
|
})
|
13314
|
-
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */
|
13508
|
+
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */ import_react105.default.createElement(RadioButton2.Skeleton, {
|
13315
13509
|
key
|
13316
13510
|
}))));
|
13317
13511
|
};
|
@@ -13319,24 +13513,24 @@ RadioButtonGroup.Skeleton = RadioButtonGroupSkeleton;
|
|
13319
13513
|
RadioButtonGroup.Skeleton.displayName = "RadioButtonGroup.Skeleton";
|
13320
13514
|
|
13321
13515
|
// src/molecules/Section/Section.tsx
|
13322
|
-
var
|
13323
|
-
var
|
13324
|
-
var
|
13325
|
-
var
|
13516
|
+
var import_react110 = __toESM(require("react"));
|
13517
|
+
var import_utils27 = require("@react-aria/utils");
|
13518
|
+
var import_web5 = require("@react-spring/web");
|
13519
|
+
var import_castArray5 = __toESM(require("lodash/castArray"));
|
13326
13520
|
var import_isUndefined9 = __toESM(require("lodash/isUndefined"));
|
13327
13521
|
|
13328
13522
|
// src/molecules/Switch/Switch.tsx
|
13329
|
-
var
|
13523
|
+
var import_react107 = __toESM(require("react"));
|
13330
13524
|
|
13331
13525
|
// src/atoms/Switch/Switch.tsx
|
13332
|
-
var
|
13526
|
+
var import_react106 = __toESM(require("react"));
|
13333
13527
|
var import_ban2 = __toESM(require_ban());
|
13334
|
-
var Switch =
|
13528
|
+
var Switch = import_react106.default.forwardRef(
|
13335
13529
|
(_a, ref) => {
|
13336
13530
|
var _b = _a, { id, children, name, disabled = false, readOnly = false } = _b, props = __objRest(_b, ["id", "children", "name", "disabled", "readOnly"]);
|
13337
|
-
return /* @__PURE__ */
|
13531
|
+
return /* @__PURE__ */ import_react106.default.createElement("span", {
|
13338
13532
|
className: tw("relative inline-flex justify-center items-center self-center group")
|
13339
|
-
}, /* @__PURE__ */
|
13533
|
+
}, /* @__PURE__ */ import_react106.default.createElement("input", __spreadProps(__spreadValues({
|
13340
13534
|
id,
|
13341
13535
|
ref,
|
13342
13536
|
type: "checkbox",
|
@@ -13355,7 +13549,7 @@ var Switch = import_react105.default.forwardRef(
|
|
13355
13549
|
),
|
13356
13550
|
readOnly,
|
13357
13551
|
disabled
|
13358
|
-
})), /* @__PURE__ */
|
13552
|
+
})), /* @__PURE__ */ import_react106.default.createElement("span", {
|
13359
13553
|
className: tw(
|
13360
13554
|
"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",
|
13361
13555
|
"bg-white left-2 peer-checked/switch:left-1 text-grey-30 peer-checked/switch:text-primary-60",
|
@@ -13363,7 +13557,7 @@ var Switch = import_react105.default.forwardRef(
|
|
13363
13557
|
"shadow-4dp": !disabled
|
13364
13558
|
}
|
13365
13559
|
)
|
13366
|
-
}, disabled && /* @__PURE__ */
|
13560
|
+
}, disabled && /* @__PURE__ */ import_react106.default.createElement(Icon, {
|
13367
13561
|
icon: import_ban2.default,
|
13368
13562
|
width: "10px",
|
13369
13563
|
height: "10px"
|
@@ -13372,7 +13566,7 @@ var Switch = import_react105.default.forwardRef(
|
|
13372
13566
|
);
|
13373
13567
|
|
13374
13568
|
// src/molecules/Switch/Switch.tsx
|
13375
|
-
var Switch2 =
|
13569
|
+
var Switch2 = import_react107.default.forwardRef(
|
13376
13570
|
(_a, ref) => {
|
13377
13571
|
var _b = _a, {
|
13378
13572
|
id,
|
@@ -13395,7 +13589,7 @@ var Switch2 = import_react106.default.forwardRef(
|
|
13395
13589
|
]);
|
13396
13590
|
var _a2;
|
13397
13591
|
const isChecked = (_a2 = props.checked) != null ? _a2 : props.defaultChecked;
|
13398
|
-
return !readOnly || isChecked ? /* @__PURE__ */
|
13592
|
+
return !readOnly || isChecked ? /* @__PURE__ */ import_react107.default.createElement(ControlLabel, {
|
13399
13593
|
htmlFor: id,
|
13400
13594
|
label: children,
|
13401
13595
|
"aria-label": ariaLabel,
|
@@ -13405,7 +13599,7 @@ var Switch2 = import_react106.default.forwardRef(
|
|
13405
13599
|
style: { gap: "0 8px" },
|
13406
13600
|
labelPlacement,
|
13407
13601
|
className: "Aquarium-Switch"
|
13408
|
-
}, !readOnly && /* @__PURE__ */
|
13602
|
+
}, !readOnly && /* @__PURE__ */ import_react107.default.createElement(Switch, __spreadProps(__spreadValues({
|
13409
13603
|
id,
|
13410
13604
|
ref,
|
13411
13605
|
name
|
@@ -13416,12 +13610,12 @@ var Switch2 = import_react106.default.forwardRef(
|
|
13416
13610
|
}
|
13417
13611
|
);
|
13418
13612
|
Switch2.displayName = "Switch";
|
13419
|
-
var SwitchSkeleton = () => /* @__PURE__ */
|
13613
|
+
var SwitchSkeleton = () => /* @__PURE__ */ import_react107.default.createElement("div", {
|
13420
13614
|
className: tw("flex gap-3")
|
13421
|
-
}, /* @__PURE__ */
|
13615
|
+
}, /* @__PURE__ */ import_react107.default.createElement(Skeleton, {
|
13422
13616
|
height: 20,
|
13423
13617
|
width: 35
|
13424
|
-
}), /* @__PURE__ */
|
13618
|
+
}), /* @__PURE__ */ import_react107.default.createElement(Skeleton, {
|
13425
13619
|
height: 20,
|
13426
13620
|
width: 150
|
13427
13621
|
}));
|
@@ -13429,7 +13623,7 @@ Switch2.Skeleton = SwitchSkeleton;
|
|
13429
13623
|
Switch2.Skeleton.displayName = "Switch.Skeleton ";
|
13430
13624
|
|
13431
13625
|
// src/molecules/TagLabel/TagLabel.tsx
|
13432
|
-
var
|
13626
|
+
var import_react108 = __toESM(require("react"));
|
13433
13627
|
var getVariantClassNames = (variant = "primary") => {
|
13434
13628
|
switch (variant) {
|
13435
13629
|
case "danger":
|
@@ -13443,7 +13637,7 @@ var getVariantClassNames = (variant = "primary") => {
|
|
13443
13637
|
};
|
13444
13638
|
var TagLabel = (_a) => {
|
13445
13639
|
var _b = _a, { title, dense = false, variant } = _b, rest = __objRest(_b, ["title", "dense", "variant"]);
|
13446
|
-
return /* @__PURE__ */
|
13640
|
+
return /* @__PURE__ */ import_react108.default.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
13447
13641
|
className: classNames(
|
13448
13642
|
"Aquarium-TagLabel",
|
13449
13643
|
getVariantClassNames(variant),
|
@@ -13456,11 +13650,11 @@ var TagLabel = (_a) => {
|
|
13456
13650
|
};
|
13457
13651
|
|
13458
13652
|
// src/atoms/Section/Section.tsx
|
13459
|
-
var
|
13653
|
+
var import_react109 = __toESM(require("react"));
|
13460
13654
|
var import_caretUp2 = __toESM(require_caretUp());
|
13461
13655
|
var Section3 = (_a) => {
|
13462
13656
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
13463
|
-
return /* @__PURE__ */
|
13657
|
+
return /* @__PURE__ */ import_react109.default.createElement(Box, __spreadValues({
|
13464
13658
|
component: "section",
|
13465
13659
|
borderColor: "grey-5",
|
13466
13660
|
borderWidth: "1px"
|
@@ -13468,7 +13662,7 @@ var Section3 = (_a) => {
|
|
13468
13662
|
};
|
13469
13663
|
Section3.Header = (_a) => {
|
13470
13664
|
var _b = _a, { children, className, expanded } = _b, rest = __objRest(_b, ["children", "className", "expanded"]);
|
13471
|
-
return /* @__PURE__ */
|
13665
|
+
return /* @__PURE__ */ import_react109.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13472
13666
|
className: classNames(
|
13473
13667
|
tw("px-6 flex gap-5 justify-between items-center h-[72px]", { "bg-grey-0": expanded }),
|
13474
13668
|
className
|
@@ -13477,21 +13671,21 @@ Section3.Header = (_a) => {
|
|
13477
13671
|
};
|
13478
13672
|
Section3.TitleContainer = (_a) => {
|
13479
13673
|
var _b = _a, { children, className, collapsible } = _b, rest = __objRest(_b, ["children", "className", "collapsible"]);
|
13480
|
-
return /* @__PURE__ */
|
13674
|
+
return /* @__PURE__ */ import_react109.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13481
13675
|
className: classNames(
|
13482
13676
|
tw("grow grid grid-cols-[auto_1fr] gap-x-3 items-center", { "cursor-pointer": collapsible }),
|
13483
13677
|
className
|
13484
13678
|
)
|
13485
13679
|
}), children);
|
13486
13680
|
};
|
13487
|
-
Section3.Toggle = (props) => /* @__PURE__ */
|
13681
|
+
Section3.Toggle = (props) => /* @__PURE__ */ import_react109.default.createElement(Icon, __spreadProps(__spreadValues({}, props), {
|
13488
13682
|
icon: import_caretUp2.default,
|
13489
13683
|
height: 22,
|
13490
13684
|
width: 22
|
13491
13685
|
}));
|
13492
13686
|
Section3.Title = (_a) => {
|
13493
13687
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
13494
|
-
return /* @__PURE__ */
|
13688
|
+
return /* @__PURE__ */ import_react109.default.createElement(Typography2.Large, __spreadProps(__spreadValues({}, rest), {
|
13495
13689
|
htmlTag: "h2",
|
13496
13690
|
color: "black",
|
13497
13691
|
className: "flex gap-3 items-center"
|
@@ -13499,35 +13693,35 @@ Section3.Title = (_a) => {
|
|
13499
13693
|
};
|
13500
13694
|
Section3.Subtitle = (_a) => {
|
13501
13695
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
13502
|
-
return /* @__PURE__ */
|
13696
|
+
return /* @__PURE__ */ import_react109.default.createElement(Typography2.Small, __spreadProps(__spreadValues({}, rest), {
|
13503
13697
|
color: "grey-70"
|
13504
13698
|
}), children);
|
13505
13699
|
};
|
13506
13700
|
Section3.Actions = (_a) => {
|
13507
13701
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
13508
|
-
return /* @__PURE__ */
|
13702
|
+
return /* @__PURE__ */ import_react109.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13509
13703
|
className: classNames(tw("flex gap-4 justify-end"), className)
|
13510
13704
|
}), children);
|
13511
13705
|
};
|
13512
13706
|
Section3.Body = (_a) => {
|
13513
13707
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
13514
|
-
return /* @__PURE__ */
|
13708
|
+
return /* @__PURE__ */ import_react109.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13515
13709
|
className: classNames(tw("p-6"), className)
|
13516
|
-
}), /* @__PURE__ */
|
13710
|
+
}), /* @__PURE__ */ import_react109.default.createElement(Typography, {
|
13517
13711
|
htmlTag: "div",
|
13518
13712
|
color: "grey-70"
|
13519
13713
|
}, children));
|
13520
13714
|
};
|
13521
13715
|
|
13522
13716
|
// src/molecules/Section/Section.tsx
|
13523
|
-
var
|
13717
|
+
var import_more6 = __toESM(require_more());
|
13524
13718
|
var Section4 = (props) => {
|
13525
13719
|
var _a, _b, _c, _d, _e;
|
13526
13720
|
const { title, subtitle, children } = props;
|
13527
13721
|
const _collapsible = title ? (_a = props.collapsible) != null ? _a : false : false;
|
13528
13722
|
const _collapsed = title ? props.collapsed : void 0;
|
13529
13723
|
const _defaultCollapsed = title ? (_b = props.defaultCollapsed) != null ? _b : false : false;
|
13530
|
-
const [isCollapsed, setCollapsed] =
|
13724
|
+
const [isCollapsed, setCollapsed] = import_react110.default.useState(_collapsed != null ? _collapsed : _defaultCollapsed);
|
13531
13725
|
const [ref, { height }] = useMeasure();
|
13532
13726
|
const menu = title ? (_c = props.menu) != null ? _c : void 0 : void 0;
|
13533
13727
|
const menuAriaLabel = title ? (_e = (_d = props.menuAriaLabel) != null ? _d : props.menuLabel) != null ? _e : "Context menu" : void 0;
|
@@ -13548,7 +13742,7 @@ var Section4 = (props) => {
|
|
13548
13742
|
}
|
13549
13743
|
};
|
13550
13744
|
const targetHeight = isCollapsed ? "0px" : `${height != null ? height : 0}px`;
|
13551
|
-
const _f = (0,
|
13745
|
+
const _f = (0, import_web5.useSpring)({
|
13552
13746
|
height: height !== null ? targetHeight : void 0,
|
13553
13747
|
opacity: isCollapsed ? 0 : 1,
|
13554
13748
|
transform: `rotate(${isCollapsed ? 180 : 0}deg)`,
|
@@ -13558,58 +13752,58 @@ var Section4 = (props) => {
|
|
13558
13752
|
},
|
13559
13753
|
immediate: !_collapsible
|
13560
13754
|
}), { transform, backgroundColor } = _f, spring = __objRest(_f, ["transform", "backgroundColor"]);
|
13561
|
-
const toggleId = (0,
|
13562
|
-
const regionId = (0,
|
13563
|
-
const titleId = (0,
|
13564
|
-
return /* @__PURE__ */
|
13755
|
+
const toggleId = (0, import_utils27.useId)();
|
13756
|
+
const regionId = (0, import_utils27.useId)();
|
13757
|
+
const titleId = (0, import_utils27.useId)();
|
13758
|
+
return /* @__PURE__ */ import_react110.default.createElement(Section3, {
|
13565
13759
|
"aria-label": title,
|
13566
13760
|
className: "Aquarium-Section"
|
13567
|
-
}, title && /* @__PURE__ */
|
13761
|
+
}, title && /* @__PURE__ */ import_react110.default.createElement(import_react110.default.Fragment, null, /* @__PURE__ */ import_react110.default.createElement(Section3.Header, {
|
13568
13762
|
expanded: _collapsible && !isCollapsed
|
13569
|
-
}, /* @__PURE__ */
|
13763
|
+
}, /* @__PURE__ */ import_react110.default.createElement(Section3.TitleContainer, {
|
13570
13764
|
role: _collapsible ? "button" : void 0,
|
13571
13765
|
id: toggleId,
|
13572
13766
|
collapsible: _collapsible,
|
13573
13767
|
onClick: handleTitleClick,
|
13574
13768
|
"aria-expanded": _collapsible ? !isCollapsed : void 0,
|
13575
13769
|
"aria-controls": _collapsible ? regionId : void 0
|
13576
|
-
}, _collapsible && /* @__PURE__ */
|
13770
|
+
}, _collapsible && /* @__PURE__ */ import_react110.default.createElement(import_web5.animated.div, {
|
13577
13771
|
style: { transform }
|
13578
|
-
}, /* @__PURE__ */
|
13772
|
+
}, /* @__PURE__ */ import_react110.default.createElement(Section3.Toggle, null)), /* @__PURE__ */ import_react110.default.createElement(Section3.Title, {
|
13579
13773
|
id: titleId
|
13580
|
-
}, /* @__PURE__ */
|
13774
|
+
}, /* @__PURE__ */ import_react110.default.createElement(LineClamp2, {
|
13581
13775
|
lines: 1
|
13582
|
-
}, title), props.tag && /* @__PURE__ */
|
13776
|
+
}, title), props.tag && /* @__PURE__ */ import_react110.default.createElement(TagLabel, __spreadValues({}, props.tag)), props.badge && /* @__PURE__ */ import_react110.default.createElement(Chip2, {
|
13583
13777
|
text: props.badge
|
13584
|
-
}), props.chip && /* @__PURE__ */
|
13778
|
+
}), props.chip && /* @__PURE__ */ import_react110.default.createElement(StatusChip, __spreadValues({}, props.chip))), subtitle && /* @__PURE__ */ import_react110.default.createElement(Section3.Subtitle, {
|
13585
13779
|
className: tw("row-start-2", { "col-start-2": _collapsible })
|
13586
|
-
}, /* @__PURE__ */
|
13780
|
+
}, /* @__PURE__ */ import_react110.default.createElement(LineClamp2, {
|
13587
13781
|
lines: 1
|
13588
|
-
}, subtitle))), !isCollapsed && /* @__PURE__ */
|
13782
|
+
}, subtitle))), !isCollapsed && /* @__PURE__ */ import_react110.default.createElement(Section3.Actions, null, menu && /* @__PURE__ */ import_react110.default.createElement(Box.Flex, {
|
13589
13783
|
alignItems: "center"
|
13590
|
-
}, /* @__PURE__ */
|
13784
|
+
}, /* @__PURE__ */ import_react110.default.createElement(DropdownMenu2, {
|
13591
13785
|
onAction: (action) => onAction == null ? void 0 : onAction(action),
|
13592
13786
|
onOpenChange: onMenuOpenChange
|
13593
|
-
}, /* @__PURE__ */
|
13787
|
+
}, /* @__PURE__ */ import_react110.default.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ import_react110.default.createElement(Button.Icon, {
|
13594
13788
|
"aria-label": menuAriaLabel,
|
13595
|
-
icon:
|
13596
|
-
})), menu)), props.actions && (0,
|
13789
|
+
icon: import_more6.default
|
13790
|
+
})), menu)), props.actions && (0, import_castArray5.default)(props.actions).filter(Boolean).map((action) => renderAction({ kind: "secondary", action })), props.switch && /* @__PURE__ */ import_react110.default.createElement(Switch2, __spreadValues({}, props.switch)), props.select && /* @__PURE__ */ import_react110.default.createElement(SelectBase, __spreadValues({
|
13597
13791
|
"aria-labelledby": titleId
|
13598
|
-
}, props.select)))), /* @__PURE__ */
|
13792
|
+
}, props.select)))), /* @__PURE__ */ import_react110.default.createElement(import_web5.animated.div, {
|
13599
13793
|
className: tw(`h-[1px]`),
|
13600
13794
|
style: { backgroundColor }
|
13601
|
-
})), /* @__PURE__ */
|
13795
|
+
})), /* @__PURE__ */ import_react110.default.createElement(import_web5.animated.div, {
|
13602
13796
|
id: regionId,
|
13603
13797
|
"aria-hidden": _collapsible ? isCollapsed ? true : void 0 : void 0,
|
13604
13798
|
style: spring,
|
13605
13799
|
className: tw({ "overflow-hidden": _collapsible })
|
13606
|
-
}, /* @__PURE__ */
|
13800
|
+
}, /* @__PURE__ */ import_react110.default.createElement("div", {
|
13607
13801
|
ref
|
13608
|
-
}, /* @__PURE__ */
|
13802
|
+
}, /* @__PURE__ */ import_react110.default.createElement(Section3.Body, null, children))));
|
13609
13803
|
};
|
13610
13804
|
|
13611
13805
|
// src/molecules/SegmentedControl/SegmentedControl.tsx
|
13612
|
-
var
|
13806
|
+
var import_react111 = __toESM(require("react"));
|
13613
13807
|
var SegmentedControl = (_a) => {
|
13614
13808
|
var _b = _a, {
|
13615
13809
|
children,
|
@@ -13626,7 +13820,7 @@ var SegmentedControl = (_a) => {
|
|
13626
13820
|
"selected",
|
13627
13821
|
"className"
|
13628
13822
|
]);
|
13629
|
-
return /* @__PURE__ */
|
13823
|
+
return /* @__PURE__ */ import_react111.default.createElement("li", null, /* @__PURE__ */ import_react111.default.createElement("button", __spreadProps(__spreadValues({
|
13630
13824
|
type: "button"
|
13631
13825
|
}, rest), {
|
13632
13826
|
className: classNames(
|
@@ -13660,12 +13854,12 @@ var SegmentedControlGroup = (_a) => {
|
|
13660
13854
|
"border border-grey-20 text-grey-50": variant === "outlined",
|
13661
13855
|
"bg-grey-0": variant === "raised"
|
13662
13856
|
});
|
13663
|
-
return /* @__PURE__ */
|
13857
|
+
return /* @__PURE__ */ import_react111.default.createElement("ul", __spreadProps(__spreadValues({}, rest), {
|
13664
13858
|
"aria-label": ariaLabel,
|
13665
13859
|
className: classNames("Aquarium-SegmentedControl", classes2, className)
|
13666
|
-
}),
|
13860
|
+
}), import_react111.default.Children.map(
|
13667
13861
|
children,
|
13668
|
-
(child) =>
|
13862
|
+
(child) => import_react111.default.cloneElement(child, {
|
13669
13863
|
dense,
|
13670
13864
|
variant,
|
13671
13865
|
onClick: () => onChange(child.props.value),
|
@@ -13703,14 +13897,14 @@ var getCommonClassNames = (dense, selected) => tw(
|
|
13703
13897
|
);
|
13704
13898
|
|
13705
13899
|
// src/molecules/Stepper/Stepper.tsx
|
13706
|
-
var
|
13900
|
+
var import_react113 = __toESM(require("react"));
|
13707
13901
|
|
13708
13902
|
// src/atoms/Stepper/Stepper.tsx
|
13709
|
-
var
|
13903
|
+
var import_react112 = __toESM(require("react"));
|
13710
13904
|
var import_tick6 = __toESM(require_tick());
|
13711
13905
|
var Stepper = (_a) => {
|
13712
13906
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13713
|
-
return /* @__PURE__ */
|
13907
|
+
return /* @__PURE__ */ import_react112.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13714
13908
|
className: classNames(className)
|
13715
13909
|
}));
|
13716
13910
|
};
|
@@ -13724,7 +13918,7 @@ var ConnectorContainer = (_a) => {
|
|
13724
13918
|
"completed",
|
13725
13919
|
"dense"
|
13726
13920
|
]);
|
13727
|
-
return /* @__PURE__ */
|
13921
|
+
return /* @__PURE__ */ import_react112.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13728
13922
|
className: classNames(
|
13729
13923
|
tw("absolute w-full -left-1/2", {
|
13730
13924
|
"top-[3px] px-[14px]": Boolean(dense),
|
@@ -13736,7 +13930,7 @@ var ConnectorContainer = (_a) => {
|
|
13736
13930
|
};
|
13737
13931
|
var Connector = (_a) => {
|
13738
13932
|
var _b = _a, { children, className, completed, dense } = _b, rest = __objRest(_b, ["children", "className", "completed", "dense"]);
|
13739
|
-
return /* @__PURE__ */
|
13933
|
+
return /* @__PURE__ */ import_react112.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13740
13934
|
className: classNames(
|
13741
13935
|
tw("w-full", {
|
13742
13936
|
"bg-grey-20": !completed,
|
@@ -13750,7 +13944,7 @@ var Connector = (_a) => {
|
|
13750
13944
|
};
|
13751
13945
|
var Step = (_a) => {
|
13752
13946
|
var _b = _a, { className, state } = _b, rest = __objRest(_b, ["className", "state"]);
|
13753
|
-
return /* @__PURE__ */
|
13947
|
+
return /* @__PURE__ */ import_react112.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13754
13948
|
className: classNames(
|
13755
13949
|
tw("flex flex-col items-center text-grey-90 relative text-center", {
|
13756
13950
|
"text-grey-20": state === "inactive"
|
@@ -13771,13 +13965,13 @@ var getDenseClassNames = (state) => tw("h-[8px] w-[8px]", {
|
|
13771
13965
|
});
|
13772
13966
|
var Indicator = (_a) => {
|
13773
13967
|
var _b = _a, { children, className, state, dense } = _b, rest = __objRest(_b, ["children", "className", "state", "dense"]);
|
13774
|
-
return /* @__PURE__ */
|
13968
|
+
return /* @__PURE__ */ import_react112.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13775
13969
|
className: classNames(
|
13776
13970
|
tw("rounded-full flex justify-center items-center mx-2 mb-3"),
|
13777
13971
|
dense ? getDenseClassNames(state) : getClassNames(state),
|
13778
13972
|
className
|
13779
13973
|
)
|
13780
|
-
}), state === "completed" ? /* @__PURE__ */
|
13974
|
+
}), state === "completed" ? /* @__PURE__ */ import_react112.default.createElement(InlineIcon, {
|
13781
13975
|
icon: import_tick6.default
|
13782
13976
|
}) : dense ? null : children);
|
13783
13977
|
};
|
@@ -13788,26 +13982,26 @@ Stepper.ConnectorContainer = ConnectorContainer;
|
|
13788
13982
|
|
13789
13983
|
// src/molecules/Stepper/Stepper.tsx
|
13790
13984
|
var Stepper2 = ({ children, activeIndex, dense }) => {
|
13791
|
-
const steps =
|
13792
|
-
return /* @__PURE__ */
|
13985
|
+
const steps = import_react113.default.Children.count(children);
|
13986
|
+
return /* @__PURE__ */ import_react113.default.createElement(Stepper, {
|
13793
13987
|
role: "list",
|
13794
13988
|
className: "Aquarium-Stepper"
|
13795
|
-
}, /* @__PURE__ */
|
13989
|
+
}, /* @__PURE__ */ import_react113.default.createElement(Template, {
|
13796
13990
|
columns: steps
|
13797
|
-
},
|
13991
|
+
}, import_react113.default.Children.map(children, (child, index) => {
|
13798
13992
|
if (!isComponentType(child, Step2)) {
|
13799
13993
|
throw new Error("<Stepper> can only have <Stepper.Step> components as children");
|
13800
13994
|
} else {
|
13801
13995
|
const state = index > activeIndex ? "inactive" : index === activeIndex ? "active" : "completed";
|
13802
|
-
return /* @__PURE__ */
|
13996
|
+
return /* @__PURE__ */ import_react113.default.createElement(Stepper.Step, {
|
13803
13997
|
state,
|
13804
13998
|
"aria-current": state === "active" ? "step" : false,
|
13805
13999
|
role: "listitem"
|
13806
|
-
}, index > 0 && index <= steps && /* @__PURE__ */
|
14000
|
+
}, index > 0 && index <= steps && /* @__PURE__ */ import_react113.default.createElement(Stepper.ConnectorContainer, {
|
13807
14001
|
dense
|
13808
|
-
}, /* @__PURE__ */
|
14002
|
+
}, /* @__PURE__ */ import_react113.default.createElement(Stepper.ConnectorContainer.Connector, {
|
13809
14003
|
completed: state === "completed" || state === "active"
|
13810
|
-
})), /* @__PURE__ */
|
14004
|
+
})), /* @__PURE__ */ import_react113.default.createElement(Stepper.Step.Indicator, {
|
13811
14005
|
state,
|
13812
14006
|
dense
|
13813
14007
|
}, index + 1), child.props.children);
|
@@ -13820,8 +14014,8 @@ Step2.displayName = "Stepper.Step";
|
|
13820
14014
|
Stepper2.Step = Step2;
|
13821
14015
|
|
13822
14016
|
// src/molecules/SwitchGroup/SwitchGroup.tsx
|
13823
|
-
var
|
13824
|
-
var
|
14017
|
+
var import_react114 = __toESM(require("react"));
|
14018
|
+
var import_utils29 = require("@react-aria/utils");
|
13825
14019
|
var SwitchGroup = (_a) => {
|
13826
14020
|
var _b = _a, {
|
13827
14021
|
value,
|
@@ -13839,11 +14033,11 @@ var SwitchGroup = (_a) => {
|
|
13839
14033
|
"children"
|
13840
14034
|
]);
|
13841
14035
|
var _a2;
|
13842
|
-
const [selectedItems, setSelectedItems] = (0,
|
14036
|
+
const [selectedItems, setSelectedItems] = (0, import_react114.useState)((_a2 = value != null ? value : defaultValue) != null ? _a2 : []);
|
13843
14037
|
if (value !== void 0 && value !== selectedItems) {
|
13844
14038
|
setSelectedItems(value);
|
13845
14039
|
}
|
13846
|
-
const errorMessageId = (0,
|
14040
|
+
const errorMessageId = (0, import_utils29.useId)();
|
13847
14041
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
13848
14042
|
const labelControlProps = getLabelControlProps(props);
|
13849
14043
|
const handleChange = (e) => {
|
@@ -13852,13 +14046,13 @@ var SwitchGroup = (_a) => {
|
|
13852
14046
|
setSelectedItems(updated);
|
13853
14047
|
onChange == null ? void 0 : onChange(updated);
|
13854
14048
|
};
|
13855
|
-
return /* @__PURE__ */
|
14049
|
+
return /* @__PURE__ */ import_react114.default.createElement(LabelControl, __spreadProps(__spreadValues(__spreadValues({
|
13856
14050
|
fieldset: true
|
13857
14051
|
}, labelControlProps), errorProps), {
|
13858
14052
|
className: "Aquarium-SwitchGroup"
|
13859
|
-
}), /* @__PURE__ */
|
14053
|
+
}), /* @__PURE__ */ import_react114.default.createElement(InputGroup, {
|
13860
14054
|
cols
|
13861
|
-
},
|
14055
|
+
}, import_react114.default.Children.map(children, (c) => {
|
13862
14056
|
var _a3, _b2, _c, _d;
|
13863
14057
|
if (!isComponentType(c, Switch2)) {
|
13864
14058
|
return null;
|
@@ -13866,7 +14060,7 @@ var SwitchGroup = (_a) => {
|
|
13866
14060
|
const str = (_a3 = c.props.value) == null ? void 0 : _a3.toString();
|
13867
14061
|
const defaultChecked = defaultValue === void 0 ? void 0 : str !== void 0 && defaultValue.includes(str);
|
13868
14062
|
const checked = value === void 0 ? void 0 : str !== void 0 && value.includes(str);
|
13869
|
-
return
|
14063
|
+
return import_react114.default.cloneElement(c, {
|
13870
14064
|
defaultChecked: (_b2 = c.props.defaultChecked) != null ? _b2 : defaultChecked,
|
13871
14065
|
checked: (_c = c.props.checked) != null ? _c : checked,
|
13872
14066
|
onChange: (_d = c.props.onChange) != null ? _d : handleChange,
|
@@ -13876,9 +14070,9 @@ var SwitchGroup = (_a) => {
|
|
13876
14070
|
})));
|
13877
14071
|
};
|
13878
14072
|
var SwitchGroupSkeleton = ({ options = 2 }) => {
|
13879
|
-
return /* @__PURE__ */
|
14073
|
+
return /* @__PURE__ */ import_react114.default.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ import_react114.default.createElement("div", {
|
13880
14074
|
className: tw("flex flex-wrap flex-col gap-2")
|
13881
|
-
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */
|
14075
|
+
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */ import_react114.default.createElement(Switch2.Skeleton, {
|
13882
14076
|
key
|
13883
14077
|
}))));
|
13884
14078
|
};
|
@@ -13886,14 +14080,14 @@ SwitchGroup.Skeleton = SwitchGroupSkeleton;
|
|
13886
14080
|
SwitchGroup.Skeleton.displayName = "SwitchGroup.Skeleton";
|
13887
14081
|
|
13888
14082
|
// src/molecules/Textarea/Textarea.tsx
|
13889
|
-
var
|
13890
|
-
var
|
13891
|
-
var
|
14083
|
+
var import_react115 = __toESM(require("react"));
|
14084
|
+
var import_utils31 = require("@react-aria/utils");
|
14085
|
+
var import_omit16 = __toESM(require("lodash/omit"));
|
13892
14086
|
var import_toString2 = __toESM(require("lodash/toString"));
|
13893
|
-
var TextareaBase =
|
14087
|
+
var TextareaBase = import_react115.default.forwardRef(
|
13894
14088
|
(_a, ref) => {
|
13895
14089
|
var _b = _a, { readOnly = false, valid = true } = _b, props = __objRest(_b, ["readOnly", "valid"]);
|
13896
|
-
return /* @__PURE__ */
|
14090
|
+
return /* @__PURE__ */ import_react115.default.createElement("textarea", __spreadProps(__spreadValues({
|
13897
14091
|
ref
|
13898
14092
|
}, props), {
|
13899
14093
|
readOnly,
|
@@ -13901,26 +14095,26 @@ var TextareaBase = import_react114.default.forwardRef(
|
|
13901
14095
|
}));
|
13902
14096
|
}
|
13903
14097
|
);
|
13904
|
-
TextareaBase.Skeleton = () => /* @__PURE__ */
|
14098
|
+
TextareaBase.Skeleton = () => /* @__PURE__ */ import_react115.default.createElement(Skeleton, {
|
13905
14099
|
height: 58
|
13906
14100
|
});
|
13907
|
-
var Textarea =
|
14101
|
+
var Textarea = import_react115.default.forwardRef((props, ref) => {
|
13908
14102
|
var _a, _b, _c;
|
13909
|
-
const [value, setValue] = (0,
|
13910
|
-
const defaultId = (0,
|
14103
|
+
const [value, setValue] = (0, import_react115.useState)((_b = (_a = props.value) != null ? _a : props.defaultValue) != null ? _b : "");
|
14104
|
+
const defaultId = (0, import_utils31.useId)();
|
13911
14105
|
const id = (_c = props.id) != null ? _c : defaultId;
|
13912
|
-
const errorMessageId = (0,
|
14106
|
+
const errorMessageId = (0, import_utils31.useId)();
|
13913
14107
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
13914
14108
|
const _d = getLabelControlProps(props), { "data-testid": dataTestId } = _d, labelControlProps = __objRest(_d, ["data-testid"]);
|
13915
|
-
const baseProps = (0,
|
13916
|
-
return /* @__PURE__ */
|
14109
|
+
const baseProps = (0, import_omit16.default)(props, Object.keys(labelControlProps));
|
14110
|
+
return /* @__PURE__ */ import_react115.default.createElement(LabelControl, __spreadProps(__spreadValues({
|
13917
14111
|
id: `${id}-label`,
|
13918
14112
|
htmlFor: id,
|
13919
14113
|
messageId: errorMessageId,
|
13920
14114
|
length: value !== void 0 ? (0, import_toString2.default)(value).length : void 0
|
13921
14115
|
}, labelControlProps), {
|
13922
14116
|
className: "Aquarium-Textarea"
|
13923
|
-
}), /* @__PURE__ */
|
14117
|
+
}), /* @__PURE__ */ import_react115.default.createElement(TextareaBase, __spreadProps(__spreadValues(__spreadValues({
|
13924
14118
|
ref
|
13925
14119
|
}, baseProps), errorProps), {
|
13926
14120
|
id,
|
@@ -13937,48 +14131,48 @@ var Textarea = import_react114.default.forwardRef((props, ref) => {
|
|
13937
14131
|
})));
|
13938
14132
|
});
|
13939
14133
|
Textarea.displayName = "Textarea";
|
13940
|
-
var TextAreaSkeleton = () => /* @__PURE__ */
|
14134
|
+
var TextAreaSkeleton = () => /* @__PURE__ */ import_react115.default.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ import_react115.default.createElement(TextareaBase.Skeleton, null));
|
13941
14135
|
Textarea.Skeleton = TextAreaSkeleton;
|
13942
14136
|
Textarea.Skeleton.displayName = "Textarea.Skeleton";
|
13943
14137
|
|
13944
14138
|
// src/molecules/Timeline/Timeline.tsx
|
13945
|
-
var
|
14139
|
+
var import_react117 = __toESM(require("react"));
|
13946
14140
|
|
13947
14141
|
// src/atoms/Timeline/Timeline.tsx
|
13948
|
-
var
|
14142
|
+
var import_react116 = __toESM(require("react"));
|
13949
14143
|
var Timeline = (_a) => {
|
13950
14144
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13951
|
-
return /* @__PURE__ */
|
14145
|
+
return /* @__PURE__ */ import_react116.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13952
14146
|
className: classNames(tw("grid grid-cols-[16px_1fr] gap-x-4"), className)
|
13953
14147
|
}));
|
13954
14148
|
};
|
13955
14149
|
var Content2 = (_a) => {
|
13956
14150
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13957
|
-
return /* @__PURE__ */
|
14151
|
+
return /* @__PURE__ */ import_react116.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13958
14152
|
className: classNames(tw("pb-6"), className)
|
13959
14153
|
}));
|
13960
14154
|
};
|
13961
14155
|
var Separator2 = (_a) => {
|
13962
14156
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13963
|
-
return /* @__PURE__ */
|
14157
|
+
return /* @__PURE__ */ import_react116.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13964
14158
|
className: classNames(tw("flex items-center justify-center h-5 w-5"), className)
|
13965
14159
|
}));
|
13966
14160
|
};
|
13967
14161
|
var LineContainer = (_a) => {
|
13968
14162
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13969
|
-
return /* @__PURE__ */
|
14163
|
+
return /* @__PURE__ */ import_react116.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13970
14164
|
className: classNames(tw("flex justify-center py-1"), className)
|
13971
14165
|
}));
|
13972
14166
|
};
|
13973
14167
|
var Line = (_a) => {
|
13974
14168
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13975
|
-
return /* @__PURE__ */
|
14169
|
+
return /* @__PURE__ */ import_react116.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13976
14170
|
className: classNames(tw("w-1 bg-grey-5 h-full justify-self-center"), className)
|
13977
14171
|
}));
|
13978
14172
|
};
|
13979
14173
|
var Dot = (_a) => {
|
13980
14174
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13981
|
-
return /* @__PURE__ */
|
14175
|
+
return /* @__PURE__ */ import_react116.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13982
14176
|
className: classNames(tw("bg-grey-30 h-[6px] w-[6px] rounded"), className)
|
13983
14177
|
}));
|
13984
14178
|
};
|
@@ -13993,54 +14187,54 @@ var import_error5 = __toESM(require_error());
|
|
13993
14187
|
var import_time2 = __toESM(require_time());
|
13994
14188
|
var import_warningSign5 = __toESM(require_warningSign());
|
13995
14189
|
var TimelineItem = () => null;
|
13996
|
-
var Timeline2 = ({ children }) => /* @__PURE__ */
|
14190
|
+
var Timeline2 = ({ children }) => /* @__PURE__ */ import_react117.default.createElement("div", {
|
13997
14191
|
className: "Aquarium-Timeline"
|
13998
|
-
},
|
14192
|
+
}, import_react117.default.Children.map(children, (item) => {
|
13999
14193
|
if (!isComponentType(item, TimelineItem)) {
|
14000
14194
|
throw new Error("<Timeline> can only have <Timeline.Item> components as children");
|
14001
14195
|
} else {
|
14002
14196
|
const { props, key } = item;
|
14003
|
-
return /* @__PURE__ */
|
14197
|
+
return /* @__PURE__ */ import_react117.default.createElement(Timeline, {
|
14004
14198
|
key: key != null ? key : props.title
|
14005
|
-
}, /* @__PURE__ */
|
14199
|
+
}, /* @__PURE__ */ import_react117.default.createElement(Timeline.Separator, null, props.variant === "error" ? /* @__PURE__ */ import_react117.default.createElement(Icon, {
|
14006
14200
|
icon: import_error5.default,
|
14007
14201
|
color: "error-30"
|
14008
|
-
}) : props.variant === "warning" ? /* @__PURE__ */
|
14202
|
+
}) : props.variant === "warning" ? /* @__PURE__ */ import_react117.default.createElement(Icon, {
|
14009
14203
|
icon: import_warningSign5.default,
|
14010
14204
|
color: "warning-30"
|
14011
|
-
}) : props.variant === "info" ? /* @__PURE__ */
|
14205
|
+
}) : props.variant === "info" ? /* @__PURE__ */ import_react117.default.createElement(Icon, {
|
14012
14206
|
icon: import_time2.default,
|
14013
14207
|
color: "info-30"
|
14014
|
-
}) : /* @__PURE__ */
|
14208
|
+
}) : /* @__PURE__ */ import_react117.default.createElement(Timeline.Separator.Dot, null)), /* @__PURE__ */ import_react117.default.createElement(Typography2.Caption, {
|
14015
14209
|
color: "grey-50"
|
14016
|
-
}, props.title), /* @__PURE__ */
|
14210
|
+
}, props.title), /* @__PURE__ */ import_react117.default.createElement(Timeline.LineContainer, null, /* @__PURE__ */ import_react117.default.createElement(Timeline.LineContainer.Line, null)), /* @__PURE__ */ import_react117.default.createElement(Timeline.Content, null, /* @__PURE__ */ import_react117.default.createElement(Typography2.Small, null, props.children)));
|
14017
14211
|
}
|
14018
14212
|
}));
|
14019
|
-
var TimelineItemSkeleton = () => /* @__PURE__ */
|
14213
|
+
var TimelineItemSkeleton = () => /* @__PURE__ */ import_react117.default.createElement(Timeline, null, /* @__PURE__ */ import_react117.default.createElement(Timeline.Separator, null, /* @__PURE__ */ import_react117.default.createElement(Skeleton, {
|
14020
14214
|
width: 6,
|
14021
14215
|
height: 6,
|
14022
14216
|
rounded: true
|
14023
|
-
})), /* @__PURE__ */
|
14217
|
+
})), /* @__PURE__ */ import_react117.default.createElement(Skeleton, {
|
14024
14218
|
height: 12,
|
14025
14219
|
width: 120
|
14026
|
-
}), /* @__PURE__ */
|
14220
|
+
}), /* @__PURE__ */ import_react117.default.createElement(Timeline.LineContainer, null, /* @__PURE__ */ import_react117.default.createElement(Skeleton, {
|
14027
14221
|
width: 2,
|
14028
14222
|
height: "100%"
|
14029
|
-
})), /* @__PURE__ */
|
14223
|
+
})), /* @__PURE__ */ import_react117.default.createElement(Timeline.Content, null, /* @__PURE__ */ import_react117.default.createElement(Box, {
|
14030
14224
|
display: "flex",
|
14031
14225
|
flexDirection: "column",
|
14032
14226
|
gap: "3"
|
14033
|
-
}, /* @__PURE__ */
|
14227
|
+
}, /* @__PURE__ */ import_react117.default.createElement(Skeleton, {
|
14034
14228
|
height: 32,
|
14035
14229
|
width: "100%"
|
14036
|
-
}), /* @__PURE__ */
|
14230
|
+
}), /* @__PURE__ */ import_react117.default.createElement(Skeleton, {
|
14037
14231
|
height: 32,
|
14038
14232
|
width: "73%"
|
14039
|
-
}), /* @__PURE__ */
|
14233
|
+
}), /* @__PURE__ */ import_react117.default.createElement(Skeleton, {
|
14040
14234
|
height: 32,
|
14041
14235
|
width: "80%"
|
14042
14236
|
}))));
|
14043
|
-
var TimelineSkeleton = ({ items = 3 }) => /* @__PURE__ */
|
14237
|
+
var TimelineSkeleton = ({ items = 3 }) => /* @__PURE__ */ import_react117.default.createElement("div", null, Array.from({ length: items }).map((_, key) => /* @__PURE__ */ import_react117.default.createElement(TimelineItemSkeleton, {
|
14044
14238
|
key
|
14045
14239
|
})));
|
14046
14240
|
Timeline2.Item = TimelineItem;
|
@@ -14048,9 +14242,9 @@ Timeline2.Skeleton = TimelineSkeleton;
|
|
14048
14242
|
Timeline2.Skeleton.displayName = "Timeline.Skeleton";
|
14049
14243
|
|
14050
14244
|
// src/utils/table/useTableSelect.ts
|
14051
|
-
var
|
14245
|
+
var import_react118 = __toESM(require("react"));
|
14052
14246
|
var useTableSelect = (data, { key }) => {
|
14053
|
-
const [selected, setSelected] =
|
14247
|
+
const [selected, setSelected] = import_react118.default.useState([]);
|
14054
14248
|
const allSelected = selected.length === data.length;
|
14055
14249
|
const isSelected = (dot) => selected.includes(dot[key]);
|
14056
14250
|
const selectAll = () => setSelected(data.map((dot) => dot[key]));
|
@@ -14221,6 +14415,7 @@ var system_default = __spreadProps(__spreadValues({}, molecules_exports), {
|
|
14221
14415
|
DesignSystemContext,
|
14222
14416
|
Dialog,
|
14223
14417
|
Divider,
|
14418
|
+
Drawer,
|
14224
14419
|
Dropdown,
|
14225
14420
|
DropdownButton,
|
14226
14421
|
DropdownMenu,
|
@@ -14323,6 +14518,7 @@ var system_default = __spreadProps(__spreadValues({}, molecules_exports), {
|
|
14323
14518
|
createSimpleComponent,
|
14324
14519
|
createTabsComponent,
|
14325
14520
|
getLabelControlProps,
|
14521
|
+
isOnSortChangedDirection,
|
14326
14522
|
isOutOfBounds,
|
14327
14523
|
placementOrder,
|
14328
14524
|
theme,
|