@aivenio/aquarium 1.50.0 → 1.51.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_variables.scss +1 -1
- package/dist/atoms.cjs +38 -17
- package/dist/atoms.mjs +38 -17
- package/dist/charts.cjs +142 -103
- package/dist/charts.mjs +129 -91
- package/dist/src/atoms/Modal/Modal.d.ts +6 -3
- package/dist/src/atoms/Modal/Modal.js +25 -14
- package/dist/src/charts/BarChart/BarChart.js +36 -25
- package/dist/src/charts/Legend/Legend.d.ts +4 -0
- package/dist/src/charts/Legend/Legend.js +15 -0
- package/dist/src/charts/PieChart/ChartValue.js +3 -3
- package/dist/src/charts/PieChart/DoughnutChart.js +45 -7
- package/dist/src/charts/PieChart/renderPieChildren.d.ts +1 -1
- package/dist/src/charts/PieChart/renderPieChildren.js +4 -5
- package/dist/src/charts/index.d.ts +1 -0
- package/dist/src/charts/index.js +2 -1
- package/dist/src/charts/lib/utils.d.ts +1 -5
- package/dist/src/charts/lib/utils.js +7 -4
- package/dist/src/molecules/DataList/DataList.d.ts +9 -2
- package/dist/src/molecules/DataList/DataList.js +3 -3
- package/dist/src/molecules/DataTable/DataTable.d.ts +9 -2
- package/dist/src/molecules/DataTable/DataTable.js +3 -3
- package/dist/src/molecules/Drawer/Drawer.d.ts +10 -0
- package/dist/src/molecules/Drawer/Drawer.js +116 -0
- package/dist/src/molecules/Modal/Modal.d.ts +8 -9
- package/dist/src/molecules/Modal/Modal.js +1 -1
- package/dist/src/molecules/Tabs/Tabs.js +3 -3
- package/dist/src/molecules/index.d.ts +1 -0
- package/dist/src/molecules/index.js +2 -1
- package/dist/src/utils/table/types.d.ts +2 -0
- package/dist/src/utils/table/types.js +4 -1
- package/dist/src/utils/table/useTableSort.d.ts +10 -3
- package/dist/src/utils/table/useTableSort.js +24 -6
- package/dist/styles.css +54 -22
- package/dist/system.cjs +1189 -1012
- package/dist/system.mjs +1191 -1016
- package/dist/tsconfig.module.tsbuildinfo +1 -1
- package/dist/types/tailwindGenerated.d.ts +1 -1
- package/package.json +2 -2
- package/dist/src/charts/PieChart/renderScaledChartValue.d.ts +0 -8
- package/dist/src/charts/PieChart/renderScaledChartValue.js +0 -15
package/dist/system.cjs
CHANGED
@@ -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,486 +12133,187 @@ 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
|
11695
|
-
var FlexboxItem = Tailwindify(
|
11696
|
-
({ htmlTag = "div", className, style, children, display, flex, grow, shrink, order, alignSelf }) => {
|
11697
|
-
const hookStyle = useStyle({
|
11698
|
-
display,
|
11699
|
-
flex,
|
11700
|
-
flexGrow: grow,
|
11701
|
-
flexShrink: shrink,
|
11702
|
-
order,
|
11703
|
-
alignSelf
|
11704
|
-
});
|
11705
|
-
const HtmlElement = htmlTag;
|
11706
|
-
return /* @__PURE__ */ import_react83.default.createElement(HtmlElement, {
|
11707
|
-
style: __spreadValues(__spreadValues({}, hookStyle), style),
|
11708
|
-
className
|
11709
|
-
}, children);
|
11710
|
-
}
|
11711
|
-
);
|
11712
|
-
|
11713
|
-
// src/molecules/Grid/GridItem.tsx
|
11714
|
-
var import_react84 = __toESM(require("react"));
|
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
|
-
}
|
12168
|
+
var import_react85 = __toESM(require("react"));
|
12169
|
+
var FlexboxItem = Tailwindify(
|
12170
|
+
({ htmlTag = "div", className, style, children, display, flex, grow, shrink, order, alignSelf }) => {
|
12171
|
+
const hookStyle = useStyle({
|
12172
|
+
display,
|
12173
|
+
flex,
|
12174
|
+
flexGrow: grow,
|
12175
|
+
flexShrink: shrink,
|
12176
|
+
order,
|
12177
|
+
alignSelf
|
12085
12178
|
});
|
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
|
-
|
12116
|
-
|
12117
|
-
|
12118
|
-
|
12119
|
-
|
12120
|
-
|
12121
|
-
|
12122
|
-
|
12123
|
-
|
12124
|
-
})
|
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
|
12217
|
+
});
|
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,20 @@ 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");
|
12474
12649
|
var import_isArray2 = __toESM(require("lodash/isArray"));
|
12475
12650
|
var import_isEqual = __toESM(require("lodash/isEqual"));
|
12476
12651
|
var import_isNil2 = __toESM(require("lodash/isNil"));
|
12477
12652
|
var import_isObject2 = __toESM(require("lodash/isObject"));
|
12478
|
-
var
|
12653
|
+
var import_omit13 = __toESM(require("lodash/omit"));
|
12479
12654
|
var import_omitBy = __toESM(require("lodash/omitBy"));
|
12480
12655
|
var import_match_sorter2 = require("match-sorter");
|
12481
12656
|
var isOptionGroup = (option) => {
|
@@ -12533,12 +12708,12 @@ var MultiSelectBase = (_a) => {
|
|
12533
12708
|
"children"
|
12534
12709
|
]);
|
12535
12710
|
var _a2;
|
12536
|
-
const popoverRef = (0,
|
12537
|
-
const targetRef = (0,
|
12538
|
-
const menuRef = (0,
|
12539
|
-
const inputRef = (0,
|
12540
|
-
const [inputValue, setInputValue] = (0,
|
12541
|
-
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);
|
12542
12717
|
const { selectedItems, addSelectedItem, removeSelectedItem, getDropdownProps, getSelectedItemProps } = (0, import_downshift3.useMultipleSelection)(
|
12543
12718
|
(0, import_omitBy.default)(
|
12544
12719
|
{
|
@@ -12622,21 +12797,21 @@ var MultiSelectBase = (_a) => {
|
|
12622
12797
|
toggle: toggleMenu,
|
12623
12798
|
setOpen: (isOpen2) => isOpen2 ? openMenu() : closeMenu()
|
12624
12799
|
};
|
12625
|
-
(0,
|
12800
|
+
(0, import_react94.useEffect)(() => {
|
12626
12801
|
if (state.isOpen && inputRef.current && popoverRef.current) {
|
12627
|
-
return (0,
|
12802
|
+
return (0, import_overlays13.ariaHideOutside)([inputRef.current, popoverRef.current]);
|
12628
12803
|
}
|
12629
12804
|
}, [state.isOpen, inputRef, popoverRef]);
|
12630
|
-
const renderItem = (item, index) => /* @__PURE__ */
|
12805
|
+
const renderItem = (item, index) => /* @__PURE__ */ import_react94.default.createElement(Select.Item, __spreadValues({
|
12631
12806
|
key: itemToString(item),
|
12632
12807
|
highlighted: index === highlightedIndex,
|
12633
12808
|
selected: selectedItems.includes(item)
|
12634
12809
|
}, getItemProps({ item, index })), renderOption(item));
|
12635
|
-
const renderGroup = (group) => group.options.length ? /* @__PURE__ */
|
12810
|
+
const renderGroup = (group) => group.options.length ? /* @__PURE__ */ import_react94.default.createElement(import_react94.default.Fragment, {
|
12636
12811
|
key: group.label
|
12637
|
-
}, /* @__PURE__ */
|
12812
|
+
}, /* @__PURE__ */ import_react94.default.createElement(Select.Group, null, group.label), group.options.map((opt) => renderItem(opt, flattenedOptions.indexOf(opt)))) : null;
|
12638
12813
|
const renderChips = () => {
|
12639
|
-
return selectedItems.map((selectedItem, index) => /* @__PURE__ */
|
12814
|
+
return selectedItems.map((selectedItem, index) => /* @__PURE__ */ import_react94.default.createElement(InputChip, __spreadProps(__spreadValues({
|
12640
12815
|
key: `${itemToString(selectedItem)}.chip`,
|
12641
12816
|
className: tw("mx-0"),
|
12642
12817
|
disabled,
|
@@ -12654,14 +12829,14 @@ var MultiSelectBase = (_a) => {
|
|
12654
12829
|
getDropdownProps({ ref: inputRef, disabled: disabled || readOnly, value: inputValue })
|
12655
12830
|
);
|
12656
12831
|
const menuProps = getMenuProps({ ref: menuRef }, { suppressRefError: !isOpen });
|
12657
|
-
return /* @__PURE__ */
|
12832
|
+
return /* @__PURE__ */ import_react94.default.createElement("div", {
|
12658
12833
|
className: classNames("Aquarium-MultiSelectBase", tw("relative"))
|
12659
|
-
}, /* @__PURE__ */
|
12834
|
+
}, /* @__PURE__ */ import_react94.default.createElement(Select.InputContainer, {
|
12660
12835
|
ref: targetRef,
|
12661
12836
|
variant: disabled ? "disabled" : !valid ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default"
|
12662
|
-
}, /* @__PURE__ */
|
12837
|
+
}, /* @__PURE__ */ import_react94.default.createElement("div", {
|
12663
12838
|
className: "grow inline-flex flex-row flex-wrap gap-2"
|
12664
|
-
}, !hideChips && inline && renderChips(), /* @__PURE__ */
|
12839
|
+
}, !hideChips && inline && renderChips(), /* @__PURE__ */ import_react94.default.createElement(Select.Input, __spreadProps(__spreadValues(__spreadValues({
|
12665
12840
|
name,
|
12666
12841
|
placeholder: selectedItems.length === 0 && !readOnly ? placeholder : ""
|
12667
12842
|
}, inputProps), props), {
|
@@ -12680,12 +12855,12 @@ var MultiSelectBase = (_a) => {
|
|
12680
12855
|
setFocus(false);
|
12681
12856
|
(_a3 = inputProps.onBlur) == null ? void 0 : _a3.call(inputProps, e);
|
12682
12857
|
}
|
12683
|
-
}))), !readOnly && /* @__PURE__ */
|
12858
|
+
}))), !readOnly && /* @__PURE__ */ import_react94.default.createElement(Select.Toggle, __spreadValues({
|
12684
12859
|
hasFocus,
|
12685
12860
|
isOpen
|
12686
|
-
}, getToggleButtonProps({ disabled })))), !hideChips && !inline && /* @__PURE__ */
|
12861
|
+
}, getToggleButtonProps({ disabled })))), !hideChips && !inline && /* @__PURE__ */ import_react94.default.createElement("div", {
|
12687
12862
|
className: tw("flex flex-row flex-wrap gap-2 mt-2")
|
12688
|
-
}, renderChips()), isOpen && /* @__PURE__ */
|
12863
|
+
}, renderChips()), isOpen && /* @__PURE__ */ import_react94.default.createElement(PopoverOverlay, {
|
12689
12864
|
ref: popoverRef,
|
12690
12865
|
triggerRef: targetRef,
|
12691
12866
|
state,
|
@@ -12693,13 +12868,13 @@ var MultiSelectBase = (_a) => {
|
|
12693
12868
|
shouldFlip: true,
|
12694
12869
|
isNonModal: true,
|
12695
12870
|
style: { width: (_a2 = targetRef.current) == null ? void 0 : _a2.offsetWidth }
|
12696
|
-
}, /* @__PURE__ */
|
12871
|
+
}, /* @__PURE__ */ import_react94.default.createElement(Select.Menu, __spreadValues({
|
12697
12872
|
maxHeight
|
12698
|
-
}, menuProps), hasNoResults && /* @__PURE__ */
|
12873
|
+
}, menuProps), hasNoResults && /* @__PURE__ */ import_react94.default.createElement(Select.NoResults, null, emptyState), filteredOptions.map(
|
12699
12874
|
(option, index) => isOptionGroup(option) ? renderGroup(option) : renderItem(option, index)
|
12700
12875
|
))));
|
12701
12876
|
};
|
12702
|
-
var MultiSelectBaseSkeleton = () => /* @__PURE__ */
|
12877
|
+
var MultiSelectBaseSkeleton = () => /* @__PURE__ */ import_react94.default.createElement(Skeleton, {
|
12703
12878
|
height: 38
|
12704
12879
|
});
|
12705
12880
|
MultiSelectBase.Skeleton = MultiSelectBaseSkeleton;
|
@@ -12714,19 +12889,19 @@ var MultiSelect = (_a) => {
|
|
12714
12889
|
"emptyState"
|
12715
12890
|
]);
|
12716
12891
|
var _a2;
|
12717
|
-
const defaultId = (0,
|
12892
|
+
const defaultId = (0, import_utils23.useId)();
|
12718
12893
|
const id = (_a2 = props.id) != null ? _a2 : defaultId;
|
12719
|
-
const errorMessageId = (0,
|
12894
|
+
const errorMessageId = (0, import_utils23.useId)();
|
12720
12895
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
12721
12896
|
const labelControlProps = getLabelControlProps(props);
|
12722
|
-
const baseProps = (0,
|
12723
|
-
return /* @__PURE__ */
|
12897
|
+
const baseProps = (0, import_omit13.default)(props, Object.keys(labelControlProps));
|
12898
|
+
return /* @__PURE__ */ import_react94.default.createElement(LabelControl, __spreadProps(__spreadValues({
|
12724
12899
|
id: `${id}-label`,
|
12725
12900
|
htmlFor: `${id}-input`,
|
12726
12901
|
messageId: errorMessageId
|
12727
12902
|
}, labelControlProps), {
|
12728
12903
|
className: "Aquarium-MultiSelect"
|
12729
|
-
}), /* @__PURE__ */
|
12904
|
+
}), /* @__PURE__ */ import_react94.default.createElement(MultiSelectBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
|
12730
12905
|
id,
|
12731
12906
|
options,
|
12732
12907
|
emptyState,
|
@@ -12734,17 +12909,17 @@ var MultiSelect = (_a) => {
|
|
12734
12909
|
valid: props.valid
|
12735
12910
|
})));
|
12736
12911
|
};
|
12737
|
-
var MultiSelectSkeleton = () => /* @__PURE__ */
|
12912
|
+
var MultiSelectSkeleton = () => /* @__PURE__ */ import_react94.default.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ import_react94.default.createElement(MultiSelectBase.Skeleton, null));
|
12738
12913
|
MultiSelect.Skeleton = MultiSelectSkeleton;
|
12739
12914
|
MultiSelect.Skeleton.displayName = "MultiSelect.Skeleton";
|
12740
12915
|
|
12741
12916
|
// src/molecules/NativeSelect/NativeSelect.tsx
|
12742
|
-
var
|
12743
|
-
var
|
12744
|
-
var
|
12917
|
+
var import_react95 = __toESM(require("react"));
|
12918
|
+
var import_utils24 = require("@react-aria/utils");
|
12919
|
+
var import_omit14 = __toESM(require("lodash/omit"));
|
12745
12920
|
var import_uniqueId = __toESM(require("lodash/uniqueId"));
|
12746
12921
|
var import_caretDown2 = __toESM(require_caretDown());
|
12747
|
-
var NativeSelectBase =
|
12922
|
+
var NativeSelectBase = import_react95.default.forwardRef(
|
12748
12923
|
(_a, ref) => {
|
12749
12924
|
var _b = _a, { children, disabled = false, required = false, valid = true, readOnly = false } = _b, props = __objRest(_b, ["children", "disabled", "required", "valid", "readOnly"]);
|
12750
12925
|
const placeholderValue = (0, import_uniqueId.default)("default_value_for_placeholder");
|
@@ -12761,16 +12936,16 @@ var NativeSelectBase = import_react94.default.forwardRef(
|
|
12761
12936
|
(_b2 = props.onBlur) == null ? void 0 : _b2.call(props, event);
|
12762
12937
|
}
|
12763
12938
|
};
|
12764
|
-
return /* @__PURE__ */
|
12939
|
+
return /* @__PURE__ */ import_react95.default.createElement("span", {
|
12765
12940
|
className: classNames("Aquarium-NativeSelectBase", tw("relative block"))
|
12766
|
-
}, !readOnly && /* @__PURE__ */
|
12941
|
+
}, !readOnly && /* @__PURE__ */ import_react95.default.createElement("span", {
|
12767
12942
|
className: tw(
|
12768
12943
|
"absolute right-0 inset-y-0 mr-4 text-grey-40 flex ml-3 pointer-events-none typography-default-strong mt-4"
|
12769
12944
|
)
|
12770
|
-
}, /* @__PURE__ */
|
12945
|
+
}, /* @__PURE__ */ import_react95.default.createElement(Icon, {
|
12771
12946
|
icon: import_caretDown2.default,
|
12772
12947
|
"data-testid": "icon-dropdown"
|
12773
|
-
})), /* @__PURE__ */
|
12948
|
+
})), /* @__PURE__ */ import_react95.default.createElement("select", __spreadProps(__spreadValues({
|
12774
12949
|
ref,
|
12775
12950
|
disabled: disabled || readOnly,
|
12776
12951
|
required
|
@@ -12789,32 +12964,32 @@ var NativeSelectBase = import_react94.default.forwardRef(
|
|
12789
12964
|
),
|
12790
12965
|
props.className
|
12791
12966
|
)
|
12792
|
-
}), props.placeholder && /* @__PURE__ */
|
12967
|
+
}), props.placeholder && /* @__PURE__ */ import_react95.default.createElement("option", {
|
12793
12968
|
value: placeholderValue,
|
12794
12969
|
disabled: true
|
12795
12970
|
}, props.placeholder), children));
|
12796
12971
|
}
|
12797
12972
|
);
|
12798
|
-
NativeSelectBase.Skeleton = () => /* @__PURE__ */
|
12973
|
+
NativeSelectBase.Skeleton = () => /* @__PURE__ */ import_react95.default.createElement(Skeleton, {
|
12799
12974
|
height: 38
|
12800
12975
|
});
|
12801
|
-
var NativeSelect =
|
12976
|
+
var NativeSelect = import_react95.default.forwardRef(
|
12802
12977
|
(_a, ref) => {
|
12803
12978
|
var _b = _a, { readOnly } = _b, props = __objRest(_b, ["readOnly"]);
|
12804
12979
|
var _a2;
|
12805
|
-
const defaultId = (0,
|
12980
|
+
const defaultId = (0, import_utils24.useId)();
|
12806
12981
|
const id = (_a2 = props.id) != null ? _a2 : defaultId;
|
12807
|
-
const errorMessageId = (0,
|
12982
|
+
const errorMessageId = (0, import_utils24.useId)();
|
12808
12983
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
12809
12984
|
const _b2 = getLabelControlProps(props), { "data-testid": dataTestId } = _b2, labelControlProps = __objRest(_b2, ["data-testid"]);
|
12810
|
-
const baseProps = (0,
|
12811
|
-
return /* @__PURE__ */
|
12985
|
+
const baseProps = (0, import_omit14.default)(props, Object.keys(labelControlProps));
|
12986
|
+
return /* @__PURE__ */ import_react95.default.createElement(LabelControl, __spreadProps(__spreadValues({
|
12812
12987
|
id: `${id}-label`,
|
12813
12988
|
htmlFor: id,
|
12814
12989
|
messageId: errorMessageId
|
12815
12990
|
}, labelControlProps), {
|
12816
12991
|
className: "Aquarium-NativeSelect"
|
12817
|
-
}), /* @__PURE__ */
|
12992
|
+
}), /* @__PURE__ */ import_react95.default.createElement(NativeSelectBase, __spreadProps(__spreadValues(__spreadValues({
|
12818
12993
|
ref
|
12819
12994
|
}, baseProps), errorProps), {
|
12820
12995
|
id,
|
@@ -12828,63 +13003,63 @@ var NativeSelect = import_react94.default.forwardRef(
|
|
12828
13003
|
}
|
12829
13004
|
);
|
12830
13005
|
NativeSelect.displayName = "NativeSelect";
|
12831
|
-
var Option =
|
13006
|
+
var Option = import_react95.default.forwardRef((_a, ref) => {
|
12832
13007
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
12833
|
-
return /* @__PURE__ */
|
13008
|
+
return /* @__PURE__ */ import_react95.default.createElement("option", __spreadValues({
|
12834
13009
|
ref
|
12835
13010
|
}, props), children);
|
12836
13011
|
});
|
12837
13012
|
Option.displayName = "Option";
|
12838
|
-
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", {
|
12839
13014
|
style: { height: "1px" }
|
12840
13015
|
}));
|
12841
13016
|
NativeSelect.Skeleton = NativeSelectSkeleton;
|
12842
13017
|
NativeSelect.Skeleton.displayName = "NativeSelect.Skeleton";
|
12843
13018
|
|
12844
13019
|
// src/molecules/Navigation/Navigation.tsx
|
12845
|
-
var
|
13020
|
+
var import_react97 = __toESM(require("react"));
|
12846
13021
|
var import_classnames10 = __toESM(require("classnames"));
|
12847
13022
|
|
12848
13023
|
// src/atoms/Navigation/Navigation.tsx
|
12849
|
-
var
|
13024
|
+
var import_react96 = __toESM(require("react"));
|
12850
13025
|
var Navigation = (_a) => {
|
12851
13026
|
var _b = _a, { className, children } = _b, rest = __objRest(_b, ["className", "children"]);
|
12852
|
-
return /* @__PURE__ */
|
13027
|
+
return /* @__PURE__ */ import_react96.default.createElement("nav", {
|
12853
13028
|
className: classNames(tw("bg-grey-0 h-full"))
|
12854
|
-
}, /* @__PURE__ */
|
13029
|
+
}, /* @__PURE__ */ import_react96.default.createElement("ul", __spreadProps(__spreadValues({}, rest), {
|
12855
13030
|
className: classNames(tw("flex flex-col h-full"), className),
|
12856
13031
|
role: "menubar"
|
12857
13032
|
}), children));
|
12858
13033
|
};
|
12859
13034
|
var Header = (_a) => {
|
12860
13035
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
12861
|
-
return /* @__PURE__ */
|
13036
|
+
return /* @__PURE__ */ import_react96.default.createElement("li", __spreadProps(__spreadValues({}, rest), {
|
12862
13037
|
role: "presentation",
|
12863
13038
|
className: classNames(tw("px-6 py-5"), className)
|
12864
13039
|
}));
|
12865
13040
|
};
|
12866
13041
|
var Footer = (_a) => {
|
12867
13042
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
12868
|
-
return /* @__PURE__ */
|
13043
|
+
return /* @__PURE__ */ import_react96.default.createElement("li", __spreadProps(__spreadValues({}, rest), {
|
12869
13044
|
role: "presentation",
|
12870
13045
|
className: classNames(tw("px-6 py-5 mt-auto"), className)
|
12871
13046
|
}));
|
12872
13047
|
};
|
12873
13048
|
var Section2 = (_a) => {
|
12874
13049
|
var _b = _a, { title, className } = _b, rest = __objRest(_b, ["title", "className"]);
|
12875
|
-
return /* @__PURE__ */
|
13050
|
+
return /* @__PURE__ */ import_react96.default.createElement("li", {
|
12876
13051
|
role: "presentation",
|
12877
13052
|
className: tw("py-5")
|
12878
|
-
}, title && /* @__PURE__ */
|
13053
|
+
}, title && /* @__PURE__ */ import_react96.default.createElement("div", {
|
12879
13054
|
className: classNames(className, "py-2 px-6 text-grey-40 uppercase cursor-default typography-caption")
|
12880
|
-
}, title), /* @__PURE__ */
|
13055
|
+
}, title), /* @__PURE__ */ import_react96.default.createElement("ul", __spreadProps(__spreadValues({}, rest), {
|
12881
13056
|
role: "group",
|
12882
13057
|
className: classNames(tw("flex flex-col"), className)
|
12883
13058
|
})));
|
12884
13059
|
};
|
12885
13060
|
var Divider3 = (_a) => {
|
12886
13061
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
12887
|
-
return /* @__PURE__ */
|
13062
|
+
return /* @__PURE__ */ import_react96.default.createElement("li", __spreadProps(__spreadValues({
|
12888
13063
|
role: "separator"
|
12889
13064
|
}, rest), {
|
12890
13065
|
className: classNames(tw("border-t-2 border-grey-5"), className)
|
@@ -12892,9 +13067,9 @@ var Divider3 = (_a) => {
|
|
12892
13067
|
};
|
12893
13068
|
var Item5 = (_a) => {
|
12894
13069
|
var _b = _a, { className, active } = _b, rest = __objRest(_b, ["className", "active"]);
|
12895
|
-
return /* @__PURE__ */
|
13070
|
+
return /* @__PURE__ */ import_react96.default.createElement("li", {
|
12896
13071
|
role: "presentation"
|
12897
|
-
}, /* @__PURE__ */
|
13072
|
+
}, /* @__PURE__ */ import_react96.default.createElement("a", __spreadProps(__spreadValues({}, rest), {
|
12898
13073
|
role: "menuitem",
|
12899
13074
|
className: classNames(
|
12900
13075
|
tw("py-3 px-6 hover:bg-grey-5 cursor-pointer flex gap-4 items-center typography-small focusable", {
|
@@ -12914,7 +13089,7 @@ Navigation.Divider = Divider3;
|
|
12914
13089
|
// src/molecules/Navigation/Navigation.tsx
|
12915
13090
|
var Navigation2 = (_a) => {
|
12916
13091
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
12917
|
-
return /* @__PURE__ */
|
13092
|
+
return /* @__PURE__ */ import_react97.default.createElement(Navigation, __spreadValues({
|
12918
13093
|
className: (0, import_classnames10.default)("Aquarium-Navigation", className)
|
12919
13094
|
}, props));
|
12920
13095
|
};
|
@@ -12928,11 +13103,11 @@ var Item6 = (_a) => {
|
|
12928
13103
|
"icon",
|
12929
13104
|
"showNotification"
|
12930
13105
|
]);
|
12931
|
-
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, {
|
12932
13107
|
icon,
|
12933
13108
|
width: "20px",
|
12934
13109
|
height: "20px"
|
12935
|
-
})), icon && !showNotification && /* @__PURE__ */
|
13110
|
+
})), icon && !showNotification && /* @__PURE__ */ import_react97.default.createElement(InlineIcon, {
|
12936
13111
|
icon,
|
12937
13112
|
width: "20px",
|
12938
13113
|
height: "20px"
|
@@ -12945,32 +13120,32 @@ Navigation2.Header = Navigation.Header;
|
|
12945
13120
|
Navigation2.Section = Navigation.Section;
|
12946
13121
|
|
12947
13122
|
// src/molecules/PageHeader/PageHeader.tsx
|
12948
|
-
var
|
12949
|
-
var
|
13123
|
+
var import_react99 = __toESM(require("react"));
|
13124
|
+
var import_castArray4 = __toESM(require("lodash/castArray"));
|
12950
13125
|
|
12951
13126
|
// src/atoms/PageHeader/PageHeader.tsx
|
12952
|
-
var
|
13127
|
+
var import_react98 = __toESM(require("react"));
|
12953
13128
|
var PageHeader = (_a) => {
|
12954
13129
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12955
|
-
return /* @__PURE__ */
|
13130
|
+
return /* @__PURE__ */ import_react98.default.createElement("div", __spreadValues({
|
12956
13131
|
className: classNames(tw("flex flex-row gap-4 pb-6"), className)
|
12957
13132
|
}, rest), children);
|
12958
13133
|
};
|
12959
13134
|
PageHeader.Container = (_a) => {
|
12960
13135
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12961
|
-
return /* @__PURE__ */
|
13136
|
+
return /* @__PURE__ */ import_react98.default.createElement("div", __spreadValues({
|
12962
13137
|
className: classNames(tw("flex flex-col grow gap-0"), className)
|
12963
13138
|
}, rest), children);
|
12964
13139
|
};
|
12965
13140
|
PageHeader.TitleContainer = (_a) => {
|
12966
13141
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12967
|
-
return /* @__PURE__ */
|
13142
|
+
return /* @__PURE__ */ import_react98.default.createElement("div", __spreadValues({
|
12968
13143
|
className: classNames(tw("flex flex-col justify-center gap-2"), className)
|
12969
13144
|
}, rest), children);
|
12970
13145
|
};
|
12971
13146
|
PageHeader.Title = (_a) => {
|
12972
13147
|
var _b = _a, { isSubHeader = false, children } = _b, rest = __objRest(_b, ["isSubHeader", "children"]);
|
12973
|
-
return /* @__PURE__ */
|
13148
|
+
return /* @__PURE__ */ import_react98.default.createElement(Typography2, __spreadProps(__spreadValues({}, rest), {
|
12974
13149
|
color: "grey-100",
|
12975
13150
|
variant: isSubHeader ? "subheading" : "heading",
|
12976
13151
|
htmlTag: isSubHeader ? "h2" : "h1"
|
@@ -12978,25 +13153,25 @@ PageHeader.Title = (_a) => {
|
|
12978
13153
|
};
|
12979
13154
|
PageHeader.Subtitle = (_a) => {
|
12980
13155
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
12981
|
-
return /* @__PURE__ */
|
13156
|
+
return /* @__PURE__ */ import_react98.default.createElement(Typography2.Small, __spreadProps(__spreadValues({}, rest), {
|
12982
13157
|
color: "grey-70"
|
12983
13158
|
}), children);
|
12984
13159
|
};
|
12985
13160
|
PageHeader.Chips = (_a) => {
|
12986
13161
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12987
|
-
return /* @__PURE__ */
|
13162
|
+
return /* @__PURE__ */ import_react98.default.createElement("div", __spreadValues({
|
12988
13163
|
className: classNames(tw("flex gap-3"), className)
|
12989
13164
|
}, rest), children);
|
12990
13165
|
};
|
12991
13166
|
PageHeader.Actions = (_a) => {
|
12992
13167
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12993
|
-
return /* @__PURE__ */
|
13168
|
+
return /* @__PURE__ */ import_react98.default.createElement("div", __spreadValues({
|
12994
13169
|
className: classNames(tw("flex flex-row gap-4 self-start"), className)
|
12995
13170
|
}, rest), children);
|
12996
13171
|
};
|
12997
13172
|
|
12998
13173
|
// src/molecules/PageHeader/PageHeader.tsx
|
12999
|
-
var
|
13174
|
+
var import_more5 = __toESM(require_more());
|
13000
13175
|
var CommonPageHeader = ({
|
13001
13176
|
title,
|
13002
13177
|
subtitle,
|
@@ -13014,63 +13189,63 @@ var CommonPageHeader = ({
|
|
13014
13189
|
onMenuOpenChange,
|
13015
13190
|
isSubHeader = false
|
13016
13191
|
}) => {
|
13017
|
-
return /* @__PURE__ */
|
13192
|
+
return /* @__PURE__ */ import_react99.default.createElement(PageHeader, {
|
13018
13193
|
className: "Aquarium-PageHeader"
|
13019
|
-
}, /* @__PURE__ */
|
13194
|
+
}, /* @__PURE__ */ import_react99.default.createElement(PageHeader.Container, null, breadcrumbs && /* @__PURE__ */ import_react99.default.createElement(Box, {
|
13020
13195
|
marginBottom: "3"
|
13021
|
-
}, /* @__PURE__ */
|
13196
|
+
}, /* @__PURE__ */ import_react99.default.createElement(Breadcrumbs, null, breadcrumbs)), /* @__PURE__ */ import_react99.default.createElement(Spacing, {
|
13022
13197
|
row: true,
|
13023
13198
|
gap: "5"
|
13024
|
-
}, image && /* @__PURE__ */
|
13199
|
+
}, image && /* @__PURE__ */ import_react99.default.createElement("img", {
|
13025
13200
|
src: image,
|
13026
13201
|
alt: imageAlt != null ? imageAlt : "",
|
13027
13202
|
className: tw("w-[56px] h-[56px]")
|
13028
|
-
}), /* @__PURE__ */
|
13203
|
+
}), /* @__PURE__ */ import_react99.default.createElement(PageHeader.TitleContainer, null, /* @__PURE__ */ import_react99.default.createElement(PageHeader.Title, {
|
13029
13204
|
isSubHeader
|
13030
|
-
}, 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, {
|
13031
13206
|
key: chip,
|
13032
13207
|
dense: true,
|
13033
13208
|
text: chip
|
13034
|
-
}))), 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, {
|
13035
13210
|
alignItems: "center"
|
13036
|
-
}, /* @__PURE__ */
|
13211
|
+
}, /* @__PURE__ */ import_react99.default.createElement(DropdownMenu2, {
|
13037
13212
|
onAction: (action) => onAction == null ? void 0 : onAction(action),
|
13038
13213
|
onOpenChange: onMenuOpenChange
|
13039
|
-
}, /* @__PURE__ */
|
13214
|
+
}, /* @__PURE__ */ import_react99.default.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ import_react99.default.createElement(Button.Icon, {
|
13040
13215
|
"aria-label": menuAriaLabel,
|
13041
|
-
icon:
|
13042
|
-
})), 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 })));
|
13043
13218
|
};
|
13044
|
-
var PageHeader2 = (props) => /* @__PURE__ */
|
13219
|
+
var PageHeader2 = (props) => /* @__PURE__ */ import_react99.default.createElement(CommonPageHeader, __spreadValues({}, props));
|
13045
13220
|
PageHeader2.displayName = "PageHeader";
|
13046
|
-
var SubHeader = (props) => /* @__PURE__ */
|
13221
|
+
var SubHeader = (props) => /* @__PURE__ */ import_react99.default.createElement(CommonPageHeader, __spreadProps(__spreadValues({}, props), {
|
13047
13222
|
isSubHeader: true
|
13048
13223
|
}));
|
13049
13224
|
PageHeader2.SubHeader = SubHeader;
|
13050
13225
|
PageHeader2.SubHeader.displayName = "PageHeader.SubHeader";
|
13051
13226
|
|
13052
13227
|
// src/molecules/PopoverDialog/PopoverDialog.tsx
|
13053
|
-
var
|
13054
|
-
var
|
13228
|
+
var import_react101 = __toESM(require("react"));
|
13229
|
+
var import_omit15 = __toESM(require("lodash/omit"));
|
13055
13230
|
|
13056
13231
|
// src/atoms/PopoverDialog/PopoverDialog.tsx
|
13057
|
-
var
|
13232
|
+
var import_react100 = __toESM(require("react"));
|
13058
13233
|
var Header2 = (_a) => {
|
13059
13234
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
13060
|
-
return /* @__PURE__ */
|
13235
|
+
return /* @__PURE__ */ import_react100.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13061
13236
|
className: classNames(tw("p-5 gap-3 flex items-center"), className)
|
13062
13237
|
}), children);
|
13063
13238
|
};
|
13064
13239
|
var Title2 = (_a) => {
|
13065
13240
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
13066
|
-
return /* @__PURE__ */
|
13241
|
+
return /* @__PURE__ */ import_react100.default.createElement(Typography, __spreadProps(__spreadValues({}, rest), {
|
13067
13242
|
htmlTag: "h1",
|
13068
13243
|
variant: "small-strong"
|
13069
13244
|
}), children);
|
13070
13245
|
};
|
13071
13246
|
var Body = (_a) => {
|
13072
13247
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
13073
|
-
return /* @__PURE__ */
|
13248
|
+
return /* @__PURE__ */ import_react100.default.createElement(Typography, __spreadProps(__spreadValues({}, rest), {
|
13074
13249
|
htmlTag: "div",
|
13075
13250
|
variant: "caption",
|
13076
13251
|
className: classNames(tw("px-5 overflow-y-auto"), className)
|
@@ -13078,13 +13253,13 @@ var Body = (_a) => {
|
|
13078
13253
|
};
|
13079
13254
|
var Footer2 = (_a) => {
|
13080
13255
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
13081
|
-
return /* @__PURE__ */
|
13256
|
+
return /* @__PURE__ */ import_react100.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13082
13257
|
className: classNames(tw("p-5"), className)
|
13083
13258
|
}), children);
|
13084
13259
|
};
|
13085
13260
|
var Actions2 = (_a) => {
|
13086
13261
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
13087
|
-
return /* @__PURE__ */
|
13262
|
+
return /* @__PURE__ */ import_react100.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13088
13263
|
className: classNames(tw("flex gap-4"), className)
|
13089
13264
|
}), children);
|
13090
13265
|
};
|
@@ -13100,29 +13275,29 @@ var PopoverDialog = {
|
|
13100
13275
|
var PopoverDialog2 = ({ placement, open, title, secondaryAction, primaryAction, children }) => {
|
13101
13276
|
const wrapPromptWithBody = (child) => {
|
13102
13277
|
if (isComponentType(child, PopoverDialog2.Prompt)) {
|
13103
|
-
return /* @__PURE__ */
|
13278
|
+
return /* @__PURE__ */ import_react101.default.createElement(Popover2.Panel, {
|
13104
13279
|
className: classNames("Aquarium-PopoverDialog", tw("max-w-[300px]"))
|
13105
|
-
}, /* @__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({
|
13106
13281
|
kind: "secondary-ghost",
|
13107
13282
|
key: secondaryAction.text,
|
13108
13283
|
dense: true
|
13109
|
-
}, (0,
|
13284
|
+
}, (0, import_omit15.default)(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */ import_react101.default.createElement(Popover2.Button, __spreadValues({
|
13110
13285
|
kind: "ghost",
|
13111
13286
|
key: primaryAction.text,
|
13112
13287
|
dense: true
|
13113
|
-
}, (0,
|
13288
|
+
}, (0, import_omit15.default)(primaryAction, "text")), primaryAction.text))));
|
13114
13289
|
}
|
13115
13290
|
return child;
|
13116
13291
|
};
|
13117
|
-
return /* @__PURE__ */
|
13292
|
+
return /* @__PURE__ */ import_react101.default.createElement(Popover2, {
|
13118
13293
|
type: "dialog",
|
13119
13294
|
isOpen: open,
|
13120
13295
|
placement,
|
13121
13296
|
containFocus: true
|
13122
|
-
},
|
13297
|
+
}, import_react101.default.Children.map(children, wrapPromptWithBody));
|
13123
13298
|
};
|
13124
13299
|
PopoverDialog2.Trigger = Popover2.Trigger;
|
13125
|
-
var Prompt = ({ children }) => /* @__PURE__ */
|
13300
|
+
var Prompt = ({ children }) => /* @__PURE__ */ import_react101.default.createElement(PopoverDialog.Body, null, children);
|
13126
13301
|
Prompt.displayName = "PopoverDialog.Prompt";
|
13127
13302
|
PopoverDialog2.Prompt = Prompt;
|
13128
13303
|
|
@@ -13131,14 +13306,14 @@ var import_react_dom = require("react-dom");
|
|
13131
13306
|
var Portal = ({ children, to }) => (0, import_react_dom.createPortal)(children, to);
|
13132
13307
|
|
13133
13308
|
// src/molecules/ProgressBar/ProgressBar.tsx
|
13134
|
-
var
|
13309
|
+
var import_react103 = __toESM(require("react"));
|
13135
13310
|
|
13136
13311
|
// src/atoms/ProgressBar/ProgressBar.tsx
|
13137
|
-
var
|
13312
|
+
var import_react102 = __toESM(require("react"));
|
13138
13313
|
var import_clamp3 = __toESM(require("lodash/clamp"));
|
13139
13314
|
var ProgressBar = (_a) => {
|
13140
13315
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
13141
|
-
return /* @__PURE__ */
|
13316
|
+
return /* @__PURE__ */ import_react102.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13142
13317
|
className: classNames(
|
13143
13318
|
tw("relative flex items-center w-full bg-grey-0 h-2 rounded-full overflow-hidden"),
|
13144
13319
|
className
|
@@ -13154,7 +13329,7 @@ var STATUS_COLORS = {
|
|
13154
13329
|
ProgressBar.Indicator = (_a) => {
|
13155
13330
|
var _b = _a, { min, max, value, "aria-label": ariaLabel, status, className } = _b, rest = __objRest(_b, ["min", "max", "value", "aria-label", "status", "className"]);
|
13156
13331
|
const completedPercentage = (0, import_clamp3.default)((value - min) / (max - min) * 100, 0, 100);
|
13157
|
-
return /* @__PURE__ */
|
13332
|
+
return /* @__PURE__ */ import_react102.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13158
13333
|
className: classNames(
|
13159
13334
|
tw("h-2 rounded-full transition-all ease-in-out delay-150"),
|
13160
13335
|
STATUS_COLORS[status],
|
@@ -13170,11 +13345,11 @@ ProgressBar.Indicator = (_a) => {
|
|
13170
13345
|
};
|
13171
13346
|
ProgressBar.Labels = (_a) => {
|
13172
13347
|
var _b = _a, { children, startLabel, endLabel, className } = _b, rest = __objRest(_b, ["children", "startLabel", "endLabel", "className"]);
|
13173
|
-
return /* @__PURE__ */
|
13348
|
+
return /* @__PURE__ */ import_react102.default.createElement("div", {
|
13174
13349
|
className: classNames(tw("flex flex-row"), className)
|
13175
|
-
}, /* @__PURE__ */
|
13350
|
+
}, /* @__PURE__ */ import_react102.default.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
13176
13351
|
className: tw("grow text-grey-70 typography-caption")
|
13177
|
-
}), startLabel), /* @__PURE__ */
|
13352
|
+
}), startLabel), /* @__PURE__ */ import_react102.default.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
13178
13353
|
className: tw("grow text-grey-70 typography-caption text-right")
|
13179
13354
|
}), endLabel));
|
13180
13355
|
};
|
@@ -13192,7 +13367,7 @@ var ProgressBar2 = (props) => {
|
|
13192
13367
|
if (min > max) {
|
13193
13368
|
throw new Error("`min` value provided to `ProgressBar` is greater than `max` value.");
|
13194
13369
|
}
|
13195
|
-
const progress = /* @__PURE__ */
|
13370
|
+
const progress = /* @__PURE__ */ import_react103.default.createElement(ProgressBar, null, /* @__PURE__ */ import_react103.default.createElement(ProgressBar.Indicator, {
|
13196
13371
|
status: value === max ? completedStatus : progresStatus,
|
13197
13372
|
min,
|
13198
13373
|
max,
|
@@ -13202,15 +13377,15 @@ var ProgressBar2 = (props) => {
|
|
13202
13377
|
if (props.dense) {
|
13203
13378
|
return progress;
|
13204
13379
|
}
|
13205
|
-
return /* @__PURE__ */
|
13380
|
+
return /* @__PURE__ */ import_react103.default.createElement("div", {
|
13206
13381
|
className: "Aquarium-ProgressBar"
|
13207
|
-
}, progress, /* @__PURE__ */
|
13382
|
+
}, progress, /* @__PURE__ */ import_react103.default.createElement(ProgressBar.Labels, {
|
13208
13383
|
className: tw("py-2"),
|
13209
13384
|
startLabel: props.startLabel,
|
13210
13385
|
endLabel: props.endLabel
|
13211
13386
|
}));
|
13212
13387
|
};
|
13213
|
-
var ProgressBarSkeleton = () => /* @__PURE__ */
|
13388
|
+
var ProgressBarSkeleton = () => /* @__PURE__ */ import_react103.default.createElement(Skeleton, {
|
13214
13389
|
height: 4,
|
13215
13390
|
display: "block"
|
13216
13391
|
});
|
@@ -13218,13 +13393,13 @@ ProgressBar2.Skeleton = ProgressBarSkeleton;
|
|
13218
13393
|
ProgressBar2.Skeleton.displayName = "ProgressBar.Skeleton";
|
13219
13394
|
|
13220
13395
|
// src/molecules/RadioButton/RadioButton.tsx
|
13221
|
-
var
|
13222
|
-
var RadioButton2 =
|
13396
|
+
var import_react104 = __toESM(require("react"));
|
13397
|
+
var RadioButton2 = import_react104.default.forwardRef(
|
13223
13398
|
(_a, ref) => {
|
13224
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"]);
|
13225
13400
|
var _a2;
|
13226
13401
|
const isChecked = (_a2 = props.checked) != null ? _a2 : props.defaultChecked;
|
13227
|
-
return !readOnly || isChecked ? /* @__PURE__ */
|
13402
|
+
return !readOnly || isChecked ? /* @__PURE__ */ import_react104.default.createElement(ControlLabel, {
|
13228
13403
|
htmlFor: id,
|
13229
13404
|
label: children,
|
13230
13405
|
"aria-label": ariaLabel,
|
@@ -13233,7 +13408,7 @@ var RadioButton2 = import_react103.default.forwardRef(
|
|
13233
13408
|
disabled,
|
13234
13409
|
style: { gap: "0 8px" },
|
13235
13410
|
className: "Aquarium-RadioButton"
|
13236
|
-
}, !readOnly && /* @__PURE__ */
|
13411
|
+
}, !readOnly && /* @__PURE__ */ import_react104.default.createElement(RadioButton, __spreadProps(__spreadValues({
|
13237
13412
|
id,
|
13238
13413
|
ref,
|
13239
13414
|
name
|
@@ -13244,12 +13419,12 @@ var RadioButton2 = import_react103.default.forwardRef(
|
|
13244
13419
|
}
|
13245
13420
|
);
|
13246
13421
|
RadioButton2.displayName = "RadioButton";
|
13247
|
-
var RadioButtonSkeleton = () => /* @__PURE__ */
|
13422
|
+
var RadioButtonSkeleton = () => /* @__PURE__ */ import_react104.default.createElement("div", {
|
13248
13423
|
className: tw("flex gap-3")
|
13249
|
-
}, /* @__PURE__ */
|
13424
|
+
}, /* @__PURE__ */ import_react104.default.createElement(Skeleton, {
|
13250
13425
|
height: 20,
|
13251
13426
|
width: 20
|
13252
|
-
}), /* @__PURE__ */
|
13427
|
+
}), /* @__PURE__ */ import_react104.default.createElement(Skeleton, {
|
13253
13428
|
height: 20,
|
13254
13429
|
width: 150
|
13255
13430
|
}));
|
@@ -13257,10 +13432,10 @@ RadioButton2.Skeleton = RadioButtonSkeleton;
|
|
13257
13432
|
RadioButton2.Skeleton.displayName = "RadioButton.Skeleton";
|
13258
13433
|
|
13259
13434
|
// src/molecules/RadioButtonGroup/RadioButtonGroup.tsx
|
13260
|
-
var
|
13261
|
-
var
|
13435
|
+
var import_react105 = __toESM(require("react"));
|
13436
|
+
var import_utils26 = require("@react-aria/utils");
|
13262
13437
|
var isRadioButton = (c) => {
|
13263
|
-
return
|
13438
|
+
return import_react105.default.isValidElement(c) && c.type === RadioButton2;
|
13264
13439
|
};
|
13265
13440
|
var RadioButtonGroup = (_a) => {
|
13266
13441
|
var _b = _a, {
|
@@ -13283,8 +13458,8 @@ var RadioButtonGroup = (_a) => {
|
|
13283
13458
|
"children"
|
13284
13459
|
]);
|
13285
13460
|
var _a2;
|
13286
|
-
const [value, setValue] =
|
13287
|
-
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)();
|
13288
13463
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
13289
13464
|
const labelControlProps = getLabelControlProps(props);
|
13290
13465
|
if (_value !== void 0 && _value !== value) {
|
@@ -13294,14 +13469,14 @@ var RadioButtonGroup = (_a) => {
|
|
13294
13469
|
setValue(e.target.value);
|
13295
13470
|
onChange == null ? void 0 : onChange(e.target.value);
|
13296
13471
|
};
|
13297
|
-
const content =
|
13472
|
+
const content = import_react105.default.Children.map(children, (c) => {
|
13298
13473
|
var _a3, _b2, _c;
|
13299
13474
|
if (!isRadioButton(c)) {
|
13300
13475
|
return null;
|
13301
13476
|
}
|
13302
13477
|
const defaultChecked = defaultValue === void 0 ? void 0 : c.props.value === defaultValue;
|
13303
13478
|
const checked = value === void 0 ? void 0 : c.props.value === value;
|
13304
|
-
return
|
13479
|
+
return import_react105.default.cloneElement(c, {
|
13305
13480
|
name,
|
13306
13481
|
defaultChecked: (_a3 = c.props.defaultChecked) != null ? _a3 : defaultChecked,
|
13307
13482
|
checked: (_b2 = c.props.checked) != null ? _b2 : checked,
|
@@ -13310,13 +13485,13 @@ var RadioButtonGroup = (_a) => {
|
|
13310
13485
|
readOnly
|
13311
13486
|
});
|
13312
13487
|
});
|
13313
|
-
return /* @__PURE__ */
|
13488
|
+
return /* @__PURE__ */ import_react105.default.createElement(LabelControl, __spreadProps(__spreadValues(__spreadValues({
|
13314
13489
|
fieldset: true
|
13315
13490
|
}, labelControlProps), errorProps), {
|
13316
13491
|
className: "Aquarium-RadioButtonGroup"
|
13317
|
-
}), cols && /* @__PURE__ */
|
13492
|
+
}), cols && /* @__PURE__ */ import_react105.default.createElement(InputGroup, {
|
13318
13493
|
cols
|
13319
|
-
}, content), !cols && /* @__PURE__ */
|
13494
|
+
}, content), !cols && /* @__PURE__ */ import_react105.default.createElement(Flexbox, {
|
13320
13495
|
direction,
|
13321
13496
|
alignItems: "flex-start",
|
13322
13497
|
colGap: "8",
|
@@ -13325,12 +13500,12 @@ var RadioButtonGroup = (_a) => {
|
|
13325
13500
|
}, content));
|
13326
13501
|
};
|
13327
13502
|
var RadioButtonGroupSkeleton = ({ direction = "row", options = 2 }) => {
|
13328
|
-
return /* @__PURE__ */
|
13503
|
+
return /* @__PURE__ */ import_react105.default.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ import_react105.default.createElement("div", {
|
13329
13504
|
className: tw("flex flex-wrap", {
|
13330
13505
|
"flex-row gap-8": direction === "row",
|
13331
13506
|
"flex-col gap-2": direction === "column"
|
13332
13507
|
})
|
13333
|
-
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */
|
13508
|
+
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */ import_react105.default.createElement(RadioButton2.Skeleton, {
|
13334
13509
|
key
|
13335
13510
|
}))));
|
13336
13511
|
};
|
@@ -13338,24 +13513,24 @@ RadioButtonGroup.Skeleton = RadioButtonGroupSkeleton;
|
|
13338
13513
|
RadioButtonGroup.Skeleton.displayName = "RadioButtonGroup.Skeleton";
|
13339
13514
|
|
13340
13515
|
// src/molecules/Section/Section.tsx
|
13341
|
-
var
|
13342
|
-
var
|
13343
|
-
var
|
13344
|
-
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"));
|
13345
13520
|
var import_isUndefined9 = __toESM(require("lodash/isUndefined"));
|
13346
13521
|
|
13347
13522
|
// src/molecules/Switch/Switch.tsx
|
13348
|
-
var
|
13523
|
+
var import_react107 = __toESM(require("react"));
|
13349
13524
|
|
13350
13525
|
// src/atoms/Switch/Switch.tsx
|
13351
|
-
var
|
13526
|
+
var import_react106 = __toESM(require("react"));
|
13352
13527
|
var import_ban2 = __toESM(require_ban());
|
13353
|
-
var Switch =
|
13528
|
+
var Switch = import_react106.default.forwardRef(
|
13354
13529
|
(_a, ref) => {
|
13355
13530
|
var _b = _a, { id, children, name, disabled = false, readOnly = false } = _b, props = __objRest(_b, ["id", "children", "name", "disabled", "readOnly"]);
|
13356
|
-
return /* @__PURE__ */
|
13531
|
+
return /* @__PURE__ */ import_react106.default.createElement("span", {
|
13357
13532
|
className: tw("relative inline-flex justify-center items-center self-center group")
|
13358
|
-
}, /* @__PURE__ */
|
13533
|
+
}, /* @__PURE__ */ import_react106.default.createElement("input", __spreadProps(__spreadValues({
|
13359
13534
|
id,
|
13360
13535
|
ref,
|
13361
13536
|
type: "checkbox",
|
@@ -13374,7 +13549,7 @@ var Switch = import_react105.default.forwardRef(
|
|
13374
13549
|
),
|
13375
13550
|
readOnly,
|
13376
13551
|
disabled
|
13377
|
-
})), /* @__PURE__ */
|
13552
|
+
})), /* @__PURE__ */ import_react106.default.createElement("span", {
|
13378
13553
|
className: tw(
|
13379
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",
|
13380
13555
|
"bg-white left-2 peer-checked/switch:left-1 text-grey-30 peer-checked/switch:text-primary-60",
|
@@ -13382,7 +13557,7 @@ var Switch = import_react105.default.forwardRef(
|
|
13382
13557
|
"shadow-4dp": !disabled
|
13383
13558
|
}
|
13384
13559
|
)
|
13385
|
-
}, disabled && /* @__PURE__ */
|
13560
|
+
}, disabled && /* @__PURE__ */ import_react106.default.createElement(Icon, {
|
13386
13561
|
icon: import_ban2.default,
|
13387
13562
|
width: "10px",
|
13388
13563
|
height: "10px"
|
@@ -13391,7 +13566,7 @@ var Switch = import_react105.default.forwardRef(
|
|
13391
13566
|
);
|
13392
13567
|
|
13393
13568
|
// src/molecules/Switch/Switch.tsx
|
13394
|
-
var Switch2 =
|
13569
|
+
var Switch2 = import_react107.default.forwardRef(
|
13395
13570
|
(_a, ref) => {
|
13396
13571
|
var _b = _a, {
|
13397
13572
|
id,
|
@@ -13414,7 +13589,7 @@ var Switch2 = import_react106.default.forwardRef(
|
|
13414
13589
|
]);
|
13415
13590
|
var _a2;
|
13416
13591
|
const isChecked = (_a2 = props.checked) != null ? _a2 : props.defaultChecked;
|
13417
|
-
return !readOnly || isChecked ? /* @__PURE__ */
|
13592
|
+
return !readOnly || isChecked ? /* @__PURE__ */ import_react107.default.createElement(ControlLabel, {
|
13418
13593
|
htmlFor: id,
|
13419
13594
|
label: children,
|
13420
13595
|
"aria-label": ariaLabel,
|
@@ -13424,7 +13599,7 @@ var Switch2 = import_react106.default.forwardRef(
|
|
13424
13599
|
style: { gap: "0 8px" },
|
13425
13600
|
labelPlacement,
|
13426
13601
|
className: "Aquarium-Switch"
|
13427
|
-
}, !readOnly && /* @__PURE__ */
|
13602
|
+
}, !readOnly && /* @__PURE__ */ import_react107.default.createElement(Switch, __spreadProps(__spreadValues({
|
13428
13603
|
id,
|
13429
13604
|
ref,
|
13430
13605
|
name
|
@@ -13435,12 +13610,12 @@ var Switch2 = import_react106.default.forwardRef(
|
|
13435
13610
|
}
|
13436
13611
|
);
|
13437
13612
|
Switch2.displayName = "Switch";
|
13438
|
-
var SwitchSkeleton = () => /* @__PURE__ */
|
13613
|
+
var SwitchSkeleton = () => /* @__PURE__ */ import_react107.default.createElement("div", {
|
13439
13614
|
className: tw("flex gap-3")
|
13440
|
-
}, /* @__PURE__ */
|
13615
|
+
}, /* @__PURE__ */ import_react107.default.createElement(Skeleton, {
|
13441
13616
|
height: 20,
|
13442
13617
|
width: 35
|
13443
|
-
}), /* @__PURE__ */
|
13618
|
+
}), /* @__PURE__ */ import_react107.default.createElement(Skeleton, {
|
13444
13619
|
height: 20,
|
13445
13620
|
width: 150
|
13446
13621
|
}));
|
@@ -13448,7 +13623,7 @@ Switch2.Skeleton = SwitchSkeleton;
|
|
13448
13623
|
Switch2.Skeleton.displayName = "Switch.Skeleton ";
|
13449
13624
|
|
13450
13625
|
// src/molecules/TagLabel/TagLabel.tsx
|
13451
|
-
var
|
13626
|
+
var import_react108 = __toESM(require("react"));
|
13452
13627
|
var getVariantClassNames = (variant = "primary") => {
|
13453
13628
|
switch (variant) {
|
13454
13629
|
case "danger":
|
@@ -13462,7 +13637,7 @@ var getVariantClassNames = (variant = "primary") => {
|
|
13462
13637
|
};
|
13463
13638
|
var TagLabel = (_a) => {
|
13464
13639
|
var _b = _a, { title, dense = false, variant } = _b, rest = __objRest(_b, ["title", "dense", "variant"]);
|
13465
|
-
return /* @__PURE__ */
|
13640
|
+
return /* @__PURE__ */ import_react108.default.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
13466
13641
|
className: classNames(
|
13467
13642
|
"Aquarium-TagLabel",
|
13468
13643
|
getVariantClassNames(variant),
|
@@ -13475,11 +13650,11 @@ var TagLabel = (_a) => {
|
|
13475
13650
|
};
|
13476
13651
|
|
13477
13652
|
// src/atoms/Section/Section.tsx
|
13478
|
-
var
|
13653
|
+
var import_react109 = __toESM(require("react"));
|
13479
13654
|
var import_caretUp2 = __toESM(require_caretUp());
|
13480
13655
|
var Section3 = (_a) => {
|
13481
13656
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
13482
|
-
return /* @__PURE__ */
|
13657
|
+
return /* @__PURE__ */ import_react109.default.createElement(Box, __spreadValues({
|
13483
13658
|
component: "section",
|
13484
13659
|
borderColor: "grey-5",
|
13485
13660
|
borderWidth: "1px"
|
@@ -13487,7 +13662,7 @@ var Section3 = (_a) => {
|
|
13487
13662
|
};
|
13488
13663
|
Section3.Header = (_a) => {
|
13489
13664
|
var _b = _a, { children, className, expanded } = _b, rest = __objRest(_b, ["children", "className", "expanded"]);
|
13490
|
-
return /* @__PURE__ */
|
13665
|
+
return /* @__PURE__ */ import_react109.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13491
13666
|
className: classNames(
|
13492
13667
|
tw("px-6 flex gap-5 justify-between items-center h-[72px]", { "bg-grey-0": expanded }),
|
13493
13668
|
className
|
@@ -13496,21 +13671,21 @@ Section3.Header = (_a) => {
|
|
13496
13671
|
};
|
13497
13672
|
Section3.TitleContainer = (_a) => {
|
13498
13673
|
var _b = _a, { children, className, collapsible } = _b, rest = __objRest(_b, ["children", "className", "collapsible"]);
|
13499
|
-
return /* @__PURE__ */
|
13674
|
+
return /* @__PURE__ */ import_react109.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13500
13675
|
className: classNames(
|
13501
13676
|
tw("grow grid grid-cols-[auto_1fr] gap-x-3 items-center", { "cursor-pointer": collapsible }),
|
13502
13677
|
className
|
13503
13678
|
)
|
13504
13679
|
}), children);
|
13505
13680
|
};
|
13506
|
-
Section3.Toggle = (props) => /* @__PURE__ */
|
13681
|
+
Section3.Toggle = (props) => /* @__PURE__ */ import_react109.default.createElement(Icon, __spreadProps(__spreadValues({}, props), {
|
13507
13682
|
icon: import_caretUp2.default,
|
13508
13683
|
height: 22,
|
13509
13684
|
width: 22
|
13510
13685
|
}));
|
13511
13686
|
Section3.Title = (_a) => {
|
13512
13687
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
13513
|
-
return /* @__PURE__ */
|
13688
|
+
return /* @__PURE__ */ import_react109.default.createElement(Typography2.Large, __spreadProps(__spreadValues({}, rest), {
|
13514
13689
|
htmlTag: "h2",
|
13515
13690
|
color: "black",
|
13516
13691
|
className: "flex gap-3 items-center"
|
@@ -13518,35 +13693,35 @@ Section3.Title = (_a) => {
|
|
13518
13693
|
};
|
13519
13694
|
Section3.Subtitle = (_a) => {
|
13520
13695
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
13521
|
-
return /* @__PURE__ */
|
13696
|
+
return /* @__PURE__ */ import_react109.default.createElement(Typography2.Small, __spreadProps(__spreadValues({}, rest), {
|
13522
13697
|
color: "grey-70"
|
13523
13698
|
}), children);
|
13524
13699
|
};
|
13525
13700
|
Section3.Actions = (_a) => {
|
13526
13701
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
13527
|
-
return /* @__PURE__ */
|
13702
|
+
return /* @__PURE__ */ import_react109.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13528
13703
|
className: classNames(tw("flex gap-4 justify-end"), className)
|
13529
13704
|
}), children);
|
13530
13705
|
};
|
13531
13706
|
Section3.Body = (_a) => {
|
13532
13707
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
13533
|
-
return /* @__PURE__ */
|
13708
|
+
return /* @__PURE__ */ import_react109.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13534
13709
|
className: classNames(tw("p-6"), className)
|
13535
|
-
}), /* @__PURE__ */
|
13710
|
+
}), /* @__PURE__ */ import_react109.default.createElement(Typography, {
|
13536
13711
|
htmlTag: "div",
|
13537
13712
|
color: "grey-70"
|
13538
13713
|
}, children));
|
13539
13714
|
};
|
13540
13715
|
|
13541
13716
|
// src/molecules/Section/Section.tsx
|
13542
|
-
var
|
13717
|
+
var import_more6 = __toESM(require_more());
|
13543
13718
|
var Section4 = (props) => {
|
13544
13719
|
var _a, _b, _c, _d, _e;
|
13545
13720
|
const { title, subtitle, children } = props;
|
13546
13721
|
const _collapsible = title ? (_a = props.collapsible) != null ? _a : false : false;
|
13547
13722
|
const _collapsed = title ? props.collapsed : void 0;
|
13548
13723
|
const _defaultCollapsed = title ? (_b = props.defaultCollapsed) != null ? _b : false : false;
|
13549
|
-
const [isCollapsed, setCollapsed] =
|
13724
|
+
const [isCollapsed, setCollapsed] = import_react110.default.useState(_collapsed != null ? _collapsed : _defaultCollapsed);
|
13550
13725
|
const [ref, { height }] = useMeasure();
|
13551
13726
|
const menu = title ? (_c = props.menu) != null ? _c : void 0 : void 0;
|
13552
13727
|
const menuAriaLabel = title ? (_e = (_d = props.menuAriaLabel) != null ? _d : props.menuLabel) != null ? _e : "Context menu" : void 0;
|
@@ -13567,7 +13742,7 @@ var Section4 = (props) => {
|
|
13567
13742
|
}
|
13568
13743
|
};
|
13569
13744
|
const targetHeight = isCollapsed ? "0px" : `${height != null ? height : 0}px`;
|
13570
|
-
const _f = (0,
|
13745
|
+
const _f = (0, import_web5.useSpring)({
|
13571
13746
|
height: height !== null ? targetHeight : void 0,
|
13572
13747
|
opacity: isCollapsed ? 0 : 1,
|
13573
13748
|
transform: `rotate(${isCollapsed ? 180 : 0}deg)`,
|
@@ -13577,58 +13752,58 @@ var Section4 = (props) => {
|
|
13577
13752
|
},
|
13578
13753
|
immediate: !_collapsible
|
13579
13754
|
}), { transform, backgroundColor } = _f, spring = __objRest(_f, ["transform", "backgroundColor"]);
|
13580
|
-
const toggleId = (0,
|
13581
|
-
const regionId = (0,
|
13582
|
-
const titleId = (0,
|
13583
|
-
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, {
|
13584
13759
|
"aria-label": title,
|
13585
13760
|
className: "Aquarium-Section"
|
13586
|
-
}, title && /* @__PURE__ */
|
13761
|
+
}, title && /* @__PURE__ */ import_react110.default.createElement(import_react110.default.Fragment, null, /* @__PURE__ */ import_react110.default.createElement(Section3.Header, {
|
13587
13762
|
expanded: _collapsible && !isCollapsed
|
13588
|
-
}, /* @__PURE__ */
|
13763
|
+
}, /* @__PURE__ */ import_react110.default.createElement(Section3.TitleContainer, {
|
13589
13764
|
role: _collapsible ? "button" : void 0,
|
13590
13765
|
id: toggleId,
|
13591
13766
|
collapsible: _collapsible,
|
13592
13767
|
onClick: handleTitleClick,
|
13593
13768
|
"aria-expanded": _collapsible ? !isCollapsed : void 0,
|
13594
13769
|
"aria-controls": _collapsible ? regionId : void 0
|
13595
|
-
}, _collapsible && /* @__PURE__ */
|
13770
|
+
}, _collapsible && /* @__PURE__ */ import_react110.default.createElement(import_web5.animated.div, {
|
13596
13771
|
style: { transform }
|
13597
|
-
}, /* @__PURE__ */
|
13772
|
+
}, /* @__PURE__ */ import_react110.default.createElement(Section3.Toggle, null)), /* @__PURE__ */ import_react110.default.createElement(Section3.Title, {
|
13598
13773
|
id: titleId
|
13599
|
-
}, /* @__PURE__ */
|
13774
|
+
}, /* @__PURE__ */ import_react110.default.createElement(LineClamp2, {
|
13600
13775
|
lines: 1
|
13601
|
-
}, 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, {
|
13602
13777
|
text: props.badge
|
13603
|
-
}), props.chip && /* @__PURE__ */
|
13778
|
+
}), props.chip && /* @__PURE__ */ import_react110.default.createElement(StatusChip, __spreadValues({}, props.chip))), subtitle && /* @__PURE__ */ import_react110.default.createElement(Section3.Subtitle, {
|
13604
13779
|
className: tw("row-start-2", { "col-start-2": _collapsible })
|
13605
|
-
}, /* @__PURE__ */
|
13780
|
+
}, /* @__PURE__ */ import_react110.default.createElement(LineClamp2, {
|
13606
13781
|
lines: 1
|
13607
|
-
}, subtitle))), !isCollapsed && /* @__PURE__ */
|
13782
|
+
}, subtitle))), !isCollapsed && /* @__PURE__ */ import_react110.default.createElement(Section3.Actions, null, menu && /* @__PURE__ */ import_react110.default.createElement(Box.Flex, {
|
13608
13783
|
alignItems: "center"
|
13609
|
-
}, /* @__PURE__ */
|
13784
|
+
}, /* @__PURE__ */ import_react110.default.createElement(DropdownMenu2, {
|
13610
13785
|
onAction: (action) => onAction == null ? void 0 : onAction(action),
|
13611
13786
|
onOpenChange: onMenuOpenChange
|
13612
|
-
}, /* @__PURE__ */
|
13787
|
+
}, /* @__PURE__ */ import_react110.default.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ import_react110.default.createElement(Button.Icon, {
|
13613
13788
|
"aria-label": menuAriaLabel,
|
13614
|
-
icon:
|
13615
|
-
})), 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({
|
13616
13791
|
"aria-labelledby": titleId
|
13617
|
-
}, props.select)))), /* @__PURE__ */
|
13792
|
+
}, props.select)))), /* @__PURE__ */ import_react110.default.createElement(import_web5.animated.div, {
|
13618
13793
|
className: tw(`h-[1px]`),
|
13619
13794
|
style: { backgroundColor }
|
13620
|
-
})), /* @__PURE__ */
|
13795
|
+
})), /* @__PURE__ */ import_react110.default.createElement(import_web5.animated.div, {
|
13621
13796
|
id: regionId,
|
13622
13797
|
"aria-hidden": _collapsible ? isCollapsed ? true : void 0 : void 0,
|
13623
13798
|
style: spring,
|
13624
13799
|
className: tw({ "overflow-hidden": _collapsible })
|
13625
|
-
}, /* @__PURE__ */
|
13800
|
+
}, /* @__PURE__ */ import_react110.default.createElement("div", {
|
13626
13801
|
ref
|
13627
|
-
}, /* @__PURE__ */
|
13802
|
+
}, /* @__PURE__ */ import_react110.default.createElement(Section3.Body, null, children))));
|
13628
13803
|
};
|
13629
13804
|
|
13630
13805
|
// src/molecules/SegmentedControl/SegmentedControl.tsx
|
13631
|
-
var
|
13806
|
+
var import_react111 = __toESM(require("react"));
|
13632
13807
|
var SegmentedControl = (_a) => {
|
13633
13808
|
var _b = _a, {
|
13634
13809
|
children,
|
@@ -13645,7 +13820,7 @@ var SegmentedControl = (_a) => {
|
|
13645
13820
|
"selected",
|
13646
13821
|
"className"
|
13647
13822
|
]);
|
13648
|
-
return /* @__PURE__ */
|
13823
|
+
return /* @__PURE__ */ import_react111.default.createElement("li", null, /* @__PURE__ */ import_react111.default.createElement("button", __spreadProps(__spreadValues({
|
13649
13824
|
type: "button"
|
13650
13825
|
}, rest), {
|
13651
13826
|
className: classNames(
|
@@ -13679,12 +13854,12 @@ var SegmentedControlGroup = (_a) => {
|
|
13679
13854
|
"border border-grey-20 text-grey-50": variant === "outlined",
|
13680
13855
|
"bg-grey-0": variant === "raised"
|
13681
13856
|
});
|
13682
|
-
return /* @__PURE__ */
|
13857
|
+
return /* @__PURE__ */ import_react111.default.createElement("ul", __spreadProps(__spreadValues({}, rest), {
|
13683
13858
|
"aria-label": ariaLabel,
|
13684
13859
|
className: classNames("Aquarium-SegmentedControl", classes2, className)
|
13685
|
-
}),
|
13860
|
+
}), import_react111.default.Children.map(
|
13686
13861
|
children,
|
13687
|
-
(child) =>
|
13862
|
+
(child) => import_react111.default.cloneElement(child, {
|
13688
13863
|
dense,
|
13689
13864
|
variant,
|
13690
13865
|
onClick: () => onChange(child.props.value),
|
@@ -13722,14 +13897,14 @@ var getCommonClassNames = (dense, selected) => tw(
|
|
13722
13897
|
);
|
13723
13898
|
|
13724
13899
|
// src/molecules/Stepper/Stepper.tsx
|
13725
|
-
var
|
13900
|
+
var import_react113 = __toESM(require("react"));
|
13726
13901
|
|
13727
13902
|
// src/atoms/Stepper/Stepper.tsx
|
13728
|
-
var
|
13903
|
+
var import_react112 = __toESM(require("react"));
|
13729
13904
|
var import_tick6 = __toESM(require_tick());
|
13730
13905
|
var Stepper = (_a) => {
|
13731
13906
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13732
|
-
return /* @__PURE__ */
|
13907
|
+
return /* @__PURE__ */ import_react112.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13733
13908
|
className: classNames(className)
|
13734
13909
|
}));
|
13735
13910
|
};
|
@@ -13743,7 +13918,7 @@ var ConnectorContainer = (_a) => {
|
|
13743
13918
|
"completed",
|
13744
13919
|
"dense"
|
13745
13920
|
]);
|
13746
|
-
return /* @__PURE__ */
|
13921
|
+
return /* @__PURE__ */ import_react112.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13747
13922
|
className: classNames(
|
13748
13923
|
tw("absolute w-full -left-1/2", {
|
13749
13924
|
"top-[3px] px-[14px]": Boolean(dense),
|
@@ -13755,7 +13930,7 @@ var ConnectorContainer = (_a) => {
|
|
13755
13930
|
};
|
13756
13931
|
var Connector = (_a) => {
|
13757
13932
|
var _b = _a, { children, className, completed, dense } = _b, rest = __objRest(_b, ["children", "className", "completed", "dense"]);
|
13758
|
-
return /* @__PURE__ */
|
13933
|
+
return /* @__PURE__ */ import_react112.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13759
13934
|
className: classNames(
|
13760
13935
|
tw("w-full", {
|
13761
13936
|
"bg-grey-20": !completed,
|
@@ -13769,7 +13944,7 @@ var Connector = (_a) => {
|
|
13769
13944
|
};
|
13770
13945
|
var Step = (_a) => {
|
13771
13946
|
var _b = _a, { className, state } = _b, rest = __objRest(_b, ["className", "state"]);
|
13772
|
-
return /* @__PURE__ */
|
13947
|
+
return /* @__PURE__ */ import_react112.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13773
13948
|
className: classNames(
|
13774
13949
|
tw("flex flex-col items-center text-grey-90 relative text-center", {
|
13775
13950
|
"text-grey-20": state === "inactive"
|
@@ -13790,13 +13965,13 @@ var getDenseClassNames = (state) => tw("h-[8px] w-[8px]", {
|
|
13790
13965
|
});
|
13791
13966
|
var Indicator = (_a) => {
|
13792
13967
|
var _b = _a, { children, className, state, dense } = _b, rest = __objRest(_b, ["children", "className", "state", "dense"]);
|
13793
|
-
return /* @__PURE__ */
|
13968
|
+
return /* @__PURE__ */ import_react112.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13794
13969
|
className: classNames(
|
13795
13970
|
tw("rounded-full flex justify-center items-center mx-2 mb-3"),
|
13796
13971
|
dense ? getDenseClassNames(state) : getClassNames(state),
|
13797
13972
|
className
|
13798
13973
|
)
|
13799
|
-
}), state === "completed" ? /* @__PURE__ */
|
13974
|
+
}), state === "completed" ? /* @__PURE__ */ import_react112.default.createElement(InlineIcon, {
|
13800
13975
|
icon: import_tick6.default
|
13801
13976
|
}) : dense ? null : children);
|
13802
13977
|
};
|
@@ -13807,26 +13982,26 @@ Stepper.ConnectorContainer = ConnectorContainer;
|
|
13807
13982
|
|
13808
13983
|
// src/molecules/Stepper/Stepper.tsx
|
13809
13984
|
var Stepper2 = ({ children, activeIndex, dense }) => {
|
13810
|
-
const steps =
|
13811
|
-
return /* @__PURE__ */
|
13985
|
+
const steps = import_react113.default.Children.count(children);
|
13986
|
+
return /* @__PURE__ */ import_react113.default.createElement(Stepper, {
|
13812
13987
|
role: "list",
|
13813
13988
|
className: "Aquarium-Stepper"
|
13814
|
-
}, /* @__PURE__ */
|
13989
|
+
}, /* @__PURE__ */ import_react113.default.createElement(Template, {
|
13815
13990
|
columns: steps
|
13816
|
-
},
|
13991
|
+
}, import_react113.default.Children.map(children, (child, index) => {
|
13817
13992
|
if (!isComponentType(child, Step2)) {
|
13818
13993
|
throw new Error("<Stepper> can only have <Stepper.Step> components as children");
|
13819
13994
|
} else {
|
13820
13995
|
const state = index > activeIndex ? "inactive" : index === activeIndex ? "active" : "completed";
|
13821
|
-
return /* @__PURE__ */
|
13996
|
+
return /* @__PURE__ */ import_react113.default.createElement(Stepper.Step, {
|
13822
13997
|
state,
|
13823
13998
|
"aria-current": state === "active" ? "step" : false,
|
13824
13999
|
role: "listitem"
|
13825
|
-
}, index > 0 && index <= steps && /* @__PURE__ */
|
14000
|
+
}, index > 0 && index <= steps && /* @__PURE__ */ import_react113.default.createElement(Stepper.ConnectorContainer, {
|
13826
14001
|
dense
|
13827
|
-
}, /* @__PURE__ */
|
14002
|
+
}, /* @__PURE__ */ import_react113.default.createElement(Stepper.ConnectorContainer.Connector, {
|
13828
14003
|
completed: state === "completed" || state === "active"
|
13829
|
-
})), /* @__PURE__ */
|
14004
|
+
})), /* @__PURE__ */ import_react113.default.createElement(Stepper.Step.Indicator, {
|
13830
14005
|
state,
|
13831
14006
|
dense
|
13832
14007
|
}, index + 1), child.props.children);
|
@@ -13839,8 +14014,8 @@ Step2.displayName = "Stepper.Step";
|
|
13839
14014
|
Stepper2.Step = Step2;
|
13840
14015
|
|
13841
14016
|
// src/molecules/SwitchGroup/SwitchGroup.tsx
|
13842
|
-
var
|
13843
|
-
var
|
14017
|
+
var import_react114 = __toESM(require("react"));
|
14018
|
+
var import_utils29 = require("@react-aria/utils");
|
13844
14019
|
var SwitchGroup = (_a) => {
|
13845
14020
|
var _b = _a, {
|
13846
14021
|
value,
|
@@ -13858,11 +14033,11 @@ var SwitchGroup = (_a) => {
|
|
13858
14033
|
"children"
|
13859
14034
|
]);
|
13860
14035
|
var _a2;
|
13861
|
-
const [selectedItems, setSelectedItems] = (0,
|
14036
|
+
const [selectedItems, setSelectedItems] = (0, import_react114.useState)((_a2 = value != null ? value : defaultValue) != null ? _a2 : []);
|
13862
14037
|
if (value !== void 0 && value !== selectedItems) {
|
13863
14038
|
setSelectedItems(value);
|
13864
14039
|
}
|
13865
|
-
const errorMessageId = (0,
|
14040
|
+
const errorMessageId = (0, import_utils29.useId)();
|
13866
14041
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
13867
14042
|
const labelControlProps = getLabelControlProps(props);
|
13868
14043
|
const handleChange = (e) => {
|
@@ -13871,13 +14046,13 @@ var SwitchGroup = (_a) => {
|
|
13871
14046
|
setSelectedItems(updated);
|
13872
14047
|
onChange == null ? void 0 : onChange(updated);
|
13873
14048
|
};
|
13874
|
-
return /* @__PURE__ */
|
14049
|
+
return /* @__PURE__ */ import_react114.default.createElement(LabelControl, __spreadProps(__spreadValues(__spreadValues({
|
13875
14050
|
fieldset: true
|
13876
14051
|
}, labelControlProps), errorProps), {
|
13877
14052
|
className: "Aquarium-SwitchGroup"
|
13878
|
-
}), /* @__PURE__ */
|
14053
|
+
}), /* @__PURE__ */ import_react114.default.createElement(InputGroup, {
|
13879
14054
|
cols
|
13880
|
-
},
|
14055
|
+
}, import_react114.default.Children.map(children, (c) => {
|
13881
14056
|
var _a3, _b2, _c, _d;
|
13882
14057
|
if (!isComponentType(c, Switch2)) {
|
13883
14058
|
return null;
|
@@ -13885,7 +14060,7 @@ var SwitchGroup = (_a) => {
|
|
13885
14060
|
const str = (_a3 = c.props.value) == null ? void 0 : _a3.toString();
|
13886
14061
|
const defaultChecked = defaultValue === void 0 ? void 0 : str !== void 0 && defaultValue.includes(str);
|
13887
14062
|
const checked = value === void 0 ? void 0 : str !== void 0 && value.includes(str);
|
13888
|
-
return
|
14063
|
+
return import_react114.default.cloneElement(c, {
|
13889
14064
|
defaultChecked: (_b2 = c.props.defaultChecked) != null ? _b2 : defaultChecked,
|
13890
14065
|
checked: (_c = c.props.checked) != null ? _c : checked,
|
13891
14066
|
onChange: (_d = c.props.onChange) != null ? _d : handleChange,
|
@@ -13895,9 +14070,9 @@ var SwitchGroup = (_a) => {
|
|
13895
14070
|
})));
|
13896
14071
|
};
|
13897
14072
|
var SwitchGroupSkeleton = ({ options = 2 }) => {
|
13898
|
-
return /* @__PURE__ */
|
14073
|
+
return /* @__PURE__ */ import_react114.default.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ import_react114.default.createElement("div", {
|
13899
14074
|
className: tw("flex flex-wrap flex-col gap-2")
|
13900
|
-
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */
|
14075
|
+
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */ import_react114.default.createElement(Switch2.Skeleton, {
|
13901
14076
|
key
|
13902
14077
|
}))));
|
13903
14078
|
};
|
@@ -13905,14 +14080,14 @@ SwitchGroup.Skeleton = SwitchGroupSkeleton;
|
|
13905
14080
|
SwitchGroup.Skeleton.displayName = "SwitchGroup.Skeleton";
|
13906
14081
|
|
13907
14082
|
// src/molecules/Textarea/Textarea.tsx
|
13908
|
-
var
|
13909
|
-
var
|
13910
|
-
var
|
14083
|
+
var import_react115 = __toESM(require("react"));
|
14084
|
+
var import_utils31 = require("@react-aria/utils");
|
14085
|
+
var import_omit16 = __toESM(require("lodash/omit"));
|
13911
14086
|
var import_toString2 = __toESM(require("lodash/toString"));
|
13912
|
-
var TextareaBase =
|
14087
|
+
var TextareaBase = import_react115.default.forwardRef(
|
13913
14088
|
(_a, ref) => {
|
13914
14089
|
var _b = _a, { readOnly = false, valid = true } = _b, props = __objRest(_b, ["readOnly", "valid"]);
|
13915
|
-
return /* @__PURE__ */
|
14090
|
+
return /* @__PURE__ */ import_react115.default.createElement("textarea", __spreadProps(__spreadValues({
|
13916
14091
|
ref
|
13917
14092
|
}, props), {
|
13918
14093
|
readOnly,
|
@@ -13920,26 +14095,26 @@ var TextareaBase = import_react114.default.forwardRef(
|
|
13920
14095
|
}));
|
13921
14096
|
}
|
13922
14097
|
);
|
13923
|
-
TextareaBase.Skeleton = () => /* @__PURE__ */
|
14098
|
+
TextareaBase.Skeleton = () => /* @__PURE__ */ import_react115.default.createElement(Skeleton, {
|
13924
14099
|
height: 58
|
13925
14100
|
});
|
13926
|
-
var Textarea =
|
14101
|
+
var Textarea = import_react115.default.forwardRef((props, ref) => {
|
13927
14102
|
var _a, _b, _c;
|
13928
|
-
const [value, setValue] = (0,
|
13929
|
-
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)();
|
13930
14105
|
const id = (_c = props.id) != null ? _c : defaultId;
|
13931
|
-
const errorMessageId = (0,
|
14106
|
+
const errorMessageId = (0, import_utils31.useId)();
|
13932
14107
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
13933
14108
|
const _d = getLabelControlProps(props), { "data-testid": dataTestId } = _d, labelControlProps = __objRest(_d, ["data-testid"]);
|
13934
|
-
const baseProps = (0,
|
13935
|
-
return /* @__PURE__ */
|
14109
|
+
const baseProps = (0, import_omit16.default)(props, Object.keys(labelControlProps));
|
14110
|
+
return /* @__PURE__ */ import_react115.default.createElement(LabelControl, __spreadProps(__spreadValues({
|
13936
14111
|
id: `${id}-label`,
|
13937
14112
|
htmlFor: id,
|
13938
14113
|
messageId: errorMessageId,
|
13939
14114
|
length: value !== void 0 ? (0, import_toString2.default)(value).length : void 0
|
13940
14115
|
}, labelControlProps), {
|
13941
14116
|
className: "Aquarium-Textarea"
|
13942
|
-
}), /* @__PURE__ */
|
14117
|
+
}), /* @__PURE__ */ import_react115.default.createElement(TextareaBase, __spreadProps(__spreadValues(__spreadValues({
|
13943
14118
|
ref
|
13944
14119
|
}, baseProps), errorProps), {
|
13945
14120
|
id,
|
@@ -13956,48 +14131,48 @@ var Textarea = import_react114.default.forwardRef((props, ref) => {
|
|
13956
14131
|
})));
|
13957
14132
|
});
|
13958
14133
|
Textarea.displayName = "Textarea";
|
13959
|
-
var TextAreaSkeleton = () => /* @__PURE__ */
|
14134
|
+
var TextAreaSkeleton = () => /* @__PURE__ */ import_react115.default.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ import_react115.default.createElement(TextareaBase.Skeleton, null));
|
13960
14135
|
Textarea.Skeleton = TextAreaSkeleton;
|
13961
14136
|
Textarea.Skeleton.displayName = "Textarea.Skeleton";
|
13962
14137
|
|
13963
14138
|
// src/molecules/Timeline/Timeline.tsx
|
13964
|
-
var
|
14139
|
+
var import_react117 = __toESM(require("react"));
|
13965
14140
|
|
13966
14141
|
// src/atoms/Timeline/Timeline.tsx
|
13967
|
-
var
|
14142
|
+
var import_react116 = __toESM(require("react"));
|
13968
14143
|
var Timeline = (_a) => {
|
13969
14144
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13970
|
-
return /* @__PURE__ */
|
14145
|
+
return /* @__PURE__ */ import_react116.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13971
14146
|
className: classNames(tw("grid grid-cols-[16px_1fr] gap-x-4"), className)
|
13972
14147
|
}));
|
13973
14148
|
};
|
13974
14149
|
var Content2 = (_a) => {
|
13975
14150
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13976
|
-
return /* @__PURE__ */
|
14151
|
+
return /* @__PURE__ */ import_react116.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13977
14152
|
className: classNames(tw("pb-6"), className)
|
13978
14153
|
}));
|
13979
14154
|
};
|
13980
14155
|
var Separator2 = (_a) => {
|
13981
14156
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13982
|
-
return /* @__PURE__ */
|
14157
|
+
return /* @__PURE__ */ import_react116.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13983
14158
|
className: classNames(tw("flex items-center justify-center h-5 w-5"), className)
|
13984
14159
|
}));
|
13985
14160
|
};
|
13986
14161
|
var LineContainer = (_a) => {
|
13987
14162
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13988
|
-
return /* @__PURE__ */
|
14163
|
+
return /* @__PURE__ */ import_react116.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13989
14164
|
className: classNames(tw("flex justify-center py-1"), className)
|
13990
14165
|
}));
|
13991
14166
|
};
|
13992
14167
|
var Line = (_a) => {
|
13993
14168
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13994
|
-
return /* @__PURE__ */
|
14169
|
+
return /* @__PURE__ */ import_react116.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13995
14170
|
className: classNames(tw("w-1 bg-grey-5 h-full justify-self-center"), className)
|
13996
14171
|
}));
|
13997
14172
|
};
|
13998
14173
|
var Dot = (_a) => {
|
13999
14174
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
14000
|
-
return /* @__PURE__ */
|
14175
|
+
return /* @__PURE__ */ import_react116.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
14001
14176
|
className: classNames(tw("bg-grey-30 h-[6px] w-[6px] rounded"), className)
|
14002
14177
|
}));
|
14003
14178
|
};
|
@@ -14012,54 +14187,54 @@ var import_error5 = __toESM(require_error());
|
|
14012
14187
|
var import_time2 = __toESM(require_time());
|
14013
14188
|
var import_warningSign5 = __toESM(require_warningSign());
|
14014
14189
|
var TimelineItem = () => null;
|
14015
|
-
var Timeline2 = ({ children }) => /* @__PURE__ */
|
14190
|
+
var Timeline2 = ({ children }) => /* @__PURE__ */ import_react117.default.createElement("div", {
|
14016
14191
|
className: "Aquarium-Timeline"
|
14017
|
-
},
|
14192
|
+
}, import_react117.default.Children.map(children, (item) => {
|
14018
14193
|
if (!isComponentType(item, TimelineItem)) {
|
14019
14194
|
throw new Error("<Timeline> can only have <Timeline.Item> components as children");
|
14020
14195
|
} else {
|
14021
14196
|
const { props, key } = item;
|
14022
|
-
return /* @__PURE__ */
|
14197
|
+
return /* @__PURE__ */ import_react117.default.createElement(Timeline, {
|
14023
14198
|
key: key != null ? key : props.title
|
14024
|
-
}, /* @__PURE__ */
|
14199
|
+
}, /* @__PURE__ */ import_react117.default.createElement(Timeline.Separator, null, props.variant === "error" ? /* @__PURE__ */ import_react117.default.createElement(Icon, {
|
14025
14200
|
icon: import_error5.default,
|
14026
14201
|
color: "error-30"
|
14027
|
-
}) : props.variant === "warning" ? /* @__PURE__ */
|
14202
|
+
}) : props.variant === "warning" ? /* @__PURE__ */ import_react117.default.createElement(Icon, {
|
14028
14203
|
icon: import_warningSign5.default,
|
14029
14204
|
color: "warning-30"
|
14030
|
-
}) : props.variant === "info" ? /* @__PURE__ */
|
14205
|
+
}) : props.variant === "info" ? /* @__PURE__ */ import_react117.default.createElement(Icon, {
|
14031
14206
|
icon: import_time2.default,
|
14032
14207
|
color: "info-30"
|
14033
|
-
}) : /* @__PURE__ */
|
14208
|
+
}) : /* @__PURE__ */ import_react117.default.createElement(Timeline.Separator.Dot, null)), /* @__PURE__ */ import_react117.default.createElement(Typography2.Caption, {
|
14034
14209
|
color: "grey-50"
|
14035
|
-
}, 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)));
|
14036
14211
|
}
|
14037
14212
|
}));
|
14038
|
-
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, {
|
14039
14214
|
width: 6,
|
14040
14215
|
height: 6,
|
14041
14216
|
rounded: true
|
14042
|
-
})), /* @__PURE__ */
|
14217
|
+
})), /* @__PURE__ */ import_react117.default.createElement(Skeleton, {
|
14043
14218
|
height: 12,
|
14044
14219
|
width: 120
|
14045
|
-
}), /* @__PURE__ */
|
14220
|
+
}), /* @__PURE__ */ import_react117.default.createElement(Timeline.LineContainer, null, /* @__PURE__ */ import_react117.default.createElement(Skeleton, {
|
14046
14221
|
width: 2,
|
14047
14222
|
height: "100%"
|
14048
|
-
})), /* @__PURE__ */
|
14223
|
+
})), /* @__PURE__ */ import_react117.default.createElement(Timeline.Content, null, /* @__PURE__ */ import_react117.default.createElement(Box, {
|
14049
14224
|
display: "flex",
|
14050
14225
|
flexDirection: "column",
|
14051
14226
|
gap: "3"
|
14052
|
-
}, /* @__PURE__ */
|
14227
|
+
}, /* @__PURE__ */ import_react117.default.createElement(Skeleton, {
|
14053
14228
|
height: 32,
|
14054
14229
|
width: "100%"
|
14055
|
-
}), /* @__PURE__ */
|
14230
|
+
}), /* @__PURE__ */ import_react117.default.createElement(Skeleton, {
|
14056
14231
|
height: 32,
|
14057
14232
|
width: "73%"
|
14058
|
-
}), /* @__PURE__ */
|
14233
|
+
}), /* @__PURE__ */ import_react117.default.createElement(Skeleton, {
|
14059
14234
|
height: 32,
|
14060
14235
|
width: "80%"
|
14061
14236
|
}))));
|
14062
|
-
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, {
|
14063
14238
|
key
|
14064
14239
|
})));
|
14065
14240
|
Timeline2.Item = TimelineItem;
|
@@ -14067,9 +14242,9 @@ Timeline2.Skeleton = TimelineSkeleton;
|
|
14067
14242
|
Timeline2.Skeleton.displayName = "Timeline.Skeleton";
|
14068
14243
|
|
14069
14244
|
// src/utils/table/useTableSelect.ts
|
14070
|
-
var
|
14245
|
+
var import_react118 = __toESM(require("react"));
|
14071
14246
|
var useTableSelect = (data, { key }) => {
|
14072
|
-
const [selected, setSelected] =
|
14247
|
+
const [selected, setSelected] = import_react118.default.useState([]);
|
14073
14248
|
const allSelected = selected.length === data.length;
|
14074
14249
|
const isSelected = (dot) => selected.includes(dot[key]);
|
14075
14250
|
const selectAll = () => setSelected(data.map((dot) => dot[key]));
|
@@ -14240,6 +14415,7 @@ var system_default = __spreadProps(__spreadValues({}, molecules_exports), {
|
|
14240
14415
|
DesignSystemContext,
|
14241
14416
|
Dialog,
|
14242
14417
|
Divider,
|
14418
|
+
Drawer,
|
14243
14419
|
Dropdown,
|
14244
14420
|
DropdownButton,
|
14245
14421
|
DropdownMenu,
|
@@ -14342,6 +14518,7 @@ var system_default = __spreadProps(__spreadValues({}, molecules_exports), {
|
|
14342
14518
|
createSimpleComponent,
|
14343
14519
|
createTabsComponent,
|
14344
14520
|
getLabelControlProps,
|
14521
|
+
isOnSortChangedDirection,
|
14345
14522
|
isOutOfBounds,
|
14346
14523
|
placementOrder,
|
14347
14524
|
theme,
|