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