@aivenio/aquarium 1.80.1 → 2.1.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/README.md +10 -2
- package/dist/atoms.cjs +150 -41
- package/dist/atoms.mjs +149 -41
- package/dist/src/atoms/DataList/DataList.d.ts +1 -0
- package/dist/src/atoms/DataList/DataList.js +4 -3
- package/dist/src/atoms/Modal/Modal.d.ts +287 -3
- package/dist/src/atoms/Modal/Modal.js +121 -31
- package/dist/src/atoms/Select/Select.js +3 -2
- package/dist/src/icons/disasterRecovery.d.ts +9 -0
- package/dist/src/icons/disasterRecovery.js +11 -0
- package/dist/src/icons/index.d.ts +1 -0
- package/dist/src/icons/index.js +2 -1
- package/dist/src/molecules/DataList/DataList.d.ts +11 -11
- package/dist/src/molecules/DataList/DataList.js +41 -21
- package/dist/src/molecules/DataList/DataListComponents.d.ts +8 -1
- package/dist/src/molecules/DataList/DataListComponents.js +13 -5
- package/dist/src/molecules/DataList/DataListGroup.d.ts +5 -4
- package/dist/src/molecules/DataList/DataListGroup.js +24 -20
- package/dist/src/molecules/DataList/DataListSkeleton.js +2 -2
- package/dist/src/molecules/Drawer/Drawer.d.ts +1 -1
- package/dist/src/molecules/Drawer/Drawer.js +37 -53
- package/dist/src/molecules/Modal/Modal.d.ts +3 -8
- package/dist/src/molecules/Modal/Modal.js +31 -50
- package/dist/src/molecules/Modal/ModalTitle.d.ts +5 -0
- package/dist/src/molecules/Modal/ModalTitle.js +20 -0
- package/dist/styles.css +25 -4
- package/dist/system.cjs +780 -647
- package/dist/system.mjs +745 -612
- package/dist/tsconfig.module.tsbuildinfo +1 -1
- package/dist/types/tailwindGenerated.d.ts +1 -1
- package/package.json +1 -1
package/dist/system.mjs
CHANGED
@@ -1482,6 +1482,22 @@ var require_deliveryLocation = __commonJS({
|
|
1482
1482
|
}
|
1483
1483
|
});
|
1484
1484
|
|
1485
|
+
// src/icons/disasterRecovery.js
|
1486
|
+
var require_disasterRecovery = __commonJS({
|
1487
|
+
"src/icons/disasterRecovery.js"(exports) {
|
1488
|
+
"use strict";
|
1489
|
+
var data = {
|
1490
|
+
"body": '<mask id="svgIDa" fill="#fff"><path d="m13.838 8.734 1.983.731.515-1.396-1.983-.73zm-4.947.96 1.983.73.515-1.396-1.983-.73zM8.077 1.7l-3.73 10.128c.561-.45 1.211-.795 1.963-.814l2.693-7.312 9.639 3.55-1.388 3.773c.533.013 1.04.208 1.458.55l1.934-5.248zm4.88 9.491 1.983.73.515-1.395-1.984-.73zM9.772 7.237l1.984.73.514-1.395-1.983-.73zM2.748 15.91c.725.065 1.48-.262 2.082-.897l.219-.236c.184-.203.572-.627.9-.902.033.572.254 1.073.428 1.336a1.95 1.95 0 001.472.89c.759.067 1.616-.305 2.246-.968l.213-.231c.21-.23.655-.715 1.024-1.02a2.85 2.85 0 00.429 1.326c.346.523.87.837 1.474.89.761.064 1.622-.305 2.251-.968.065-.067.133-.143.205-.22.193-.211.655-.715 1.038-1.027a2.85 2.85 0 00.429 1.325c.369.557.912.892 1.528.944q.09.008.177.008c.665 0 1.346-.32 1.892-.894l-1.13-1.074c-.253.268-.564.426-.804.406-.088-.008-.22-.042-.361-.255-.096-.143-.263-.614-.107-.923l.237-.465-.34-.396a1.38 1.38 0 00-1.048-.499h-.024c-.912 0-1.734.814-2.63 1.797a9 9 0 01-.19.205c-.294.31-.692.504-.983.48-.093-.007-.203-.038-.31-.2-.095-.145-.262-.613-.106-.922l.229-.46-.343-.395a1.38 1.38 0 00-1.048-.5h-.02c-.986 0-1.89.991-2.62 1.79l-.198.212c-.292.31-.692.502-.978.481-.09-.008-.2-.039-.307-.2-.096-.143-.262-.614-.106-.923l.236-.465-.34-.395a1.4 1.4 0 00-1.066-.512h-.02c-.952 0-1.8.928-2.48 1.676-.074.078-.141.154-.201.219-.257.27-.577.434-.811.41-.088-.007-.218-.041-.356-.25l-1.3.864c.367.554.907.886 1.518.938m16.068 2.834c-.088-.008-.22-.042-.361-.255-.096-.143-.263-.613-.107-.923l.237-.465-.34-.395a1.38 1.38 0 00-1.048-.5h-.024c-.912 0-1.734.814-2.633 1.797a9 9 0 01-.19.205c-.294.31-.697.505-.983.481-.093-.008-.202-.039-.309-.2-.096-.145-.262-.613-.107-.923l.237-.465-.343-.395a1.38 1.38 0 00-1.048-.5h-.02c-.91 0-1.727.812-2.62 1.79l-.196.212c-.291.307-.691.505-.977.481-.091-.008-.2-.039-.307-.2-.096-.143-.263-.613-.107-.923l.237-.465-.34-.395a1.4 1.4 0 00-1.066-.512H6.38c-.952 0-1.8.928-2.48 1.676-.073.078-.14.154-.2.219-.258.27-.578.429-.811.41-.091-.007-.221-.041-.36-.25l-1.299.864c.367.554.907.887 1.518.939.72.06 1.48-.263 2.082-.897q.101-.111.219-.237c.184-.203.572-.626.9-.902a2.9 2.9 0 00.428 1.336c.346.523.871.837 1.472.89.756.064 1.616-.305 2.246-.968l.21-.229c.21-.228.655-.715 1.024-1.019a2.85 2.85 0 00.43 1.326c.345.523.87.837 1.473.89.757.064 1.622-.305 2.252-.968l.205-.22c.192-.211.655-.718 1.037-1.03.037.57.255 1.066.429 1.326.37.556.912.891 1.529.943q.091.008.176.008c.666 0 1.347-.32 1.893-.894l-1.134-1.069c-.252.268-.561.424-.803.406"/></mask><path fill="none" stroke="currentColor" stroke-miterlimit="16" stroke-width="1.6" d="m13.838 8.734 1.983.731.515-1.396-1.983-.73zm-4.947.96 1.983.73.515-1.396-1.983-.73zM8.077 1.7l-3.73 10.128c.561-.45 1.211-.795 1.963-.814l2.693-7.312 9.639 3.55-1.388 3.773c.533.013 1.04.208 1.458.55l1.934-5.248zm4.88 9.491 1.983.73.515-1.395-1.984-.73zM9.772 7.237l1.984.73.514-1.395-1.983-.73zM2.748 15.91c.725.065 1.48-.262 2.082-.897l.219-.236c.184-.203.572-.627.9-.902.033.572.254 1.073.428 1.336a1.95 1.95 0 001.472.89c.759.067 1.616-.305 2.246-.968l.213-.231c.21-.23.655-.715 1.024-1.02a2.85 2.85 0 00.429 1.326c.346.523.87.837 1.474.89.761.064 1.622-.305 2.251-.968.065-.067.133-.143.205-.22.193-.211.655-.715 1.038-1.027a2.85 2.85 0 00.429 1.325c.369.557.912.892 1.528.944q.09.008.177.008c.665 0 1.346-.32 1.892-.894l-1.13-1.074c-.253.268-.564.426-.804.406-.088-.008-.22-.042-.361-.255-.096-.143-.263-.614-.107-.923l.237-.465-.34-.396a1.38 1.38 0 00-1.048-.499h-.024c-.912 0-1.734.814-2.63 1.797a9 9 0 01-.19.205c-.294.31-.692.504-.983.48-.093-.007-.203-.038-.31-.2-.095-.145-.262-.613-.106-.922l.229-.46-.343-.395a1.38 1.38 0 00-1.048-.5h-.02c-.986 0-1.89.991-2.62 1.79l-.198.212c-.292.31-.692.502-.978.481-.09-.008-.2-.039-.307-.2-.096-.143-.262-.614-.106-.923l.236-.465-.34-.395a1.4 1.4 0 00-1.066-.512h-.02c-.952 0-1.8.928-2.48 1.676-.074.078-.141.154-.201.219-.257.27-.577.434-.811.41-.088-.007-.218-.041-.356-.25l-1.3.864c.367.554.907.886 1.518.938Zm16.068 2.834c-.088-.008-.22-.042-.361-.255-.096-.143-.263-.613-.107-.923l.237-.465-.34-.395a1.38 1.38 0 00-1.048-.5h-.024c-.912 0-1.734.814-2.633 1.797a9 9 0 01-.19.205c-.294.31-.697.505-.983.481-.093-.008-.202-.039-.309-.2-.096-.145-.262-.613-.107-.923l.237-.465-.343-.395a1.38 1.38 0 00-1.048-.5h-.02c-.91 0-1.727.812-2.62 1.79l-.196.212c-.291.307-.691.505-.977.481-.091-.008-.2-.039-.307-.2-.096-.143-.263-.613-.107-.923l.237-.465-.34-.395a1.4 1.4 0 00-1.066-.512H6.38c-.952 0-1.8.928-2.48 1.676-.073.078-.14.154-.2.219-.258.27-.578.429-.811.41-.091-.007-.221-.041-.36-.25l-1.299.864c.367.554.907.887 1.518.939.72.06 1.48-.263 2.082-.897q.101-.111.219-.237c.184-.203.572-.626.9-.902a2.9 2.9 0 00.428 1.336c.346.523.871.837 1.472.89.756.064 1.616-.305 2.246-.968l.21-.229c.21-.228.655-.715 1.024-1.019a2.85 2.85 0 00.43 1.326c.345.523.87.837 1.473.89.757.064 1.622-.305 2.252-.968l.205-.22c.192-.211.655-.718 1.037-1.03.037.57.255 1.066.429 1.326.37.556.912.891 1.529.943q.091.008.176.008c.666 0 1.347-.32 1.893-.894l-1.134-1.069c-.252.268-.561.424-.803.406Z" mask="url(#svgIDa)"/>',
|
1491
|
+
"left": 0,
|
1492
|
+
"top": 0,
|
1493
|
+
"width": 22,
|
1494
|
+
"height": 22
|
1495
|
+
};
|
1496
|
+
exports.__esModule = true;
|
1497
|
+
exports.default = data;
|
1498
|
+
}
|
1499
|
+
});
|
1500
|
+
|
1485
1501
|
// src/icons/document.js
|
1486
1502
|
var require_document = __commonJS({
|
1487
1503
|
"src/icons/document.js"(exports) {
|
@@ -4477,6 +4493,7 @@ var Group = React2.forwardRef((_a, ref) => {
|
|
4477
4493
|
)
|
4478
4494
|
}, props), children);
|
4479
4495
|
});
|
4496
|
+
var endAdornmentSize = { width: 14, height: 14 };
|
4480
4497
|
var Item = React2.forwardRef(
|
4481
4498
|
(_a, ref) => {
|
4482
4499
|
var _b = _a, { highlighted, selected, className, children } = _b, props = __objRest(_b, ["highlighted", "selected", "className", "children"]);
|
@@ -4489,8 +4506,10 @@ var Item = React2.forwardRef(
|
|
4489
4506
|
})
|
4490
4507
|
}, props), /* @__PURE__ */ React2.createElement("span", {
|
4491
4508
|
className: tw("grow flex gap-x-3")
|
4492
|
-
}, children), selected
|
4509
|
+
}, children), selected ? /* @__PURE__ */ React2.createElement(InlineIcon, __spreadValues({
|
4493
4510
|
icon: import_tick.default
|
4511
|
+
}, endAdornmentSize)) : /* @__PURE__ */ React2.createElement("div", {
|
4512
|
+
style: endAdornmentSize
|
4494
4513
|
}));
|
4495
4514
|
}
|
4496
4515
|
);
|
@@ -4634,6 +4653,7 @@ var import_dataflow03 = __toESM(require_dataflow03());
|
|
4634
4653
|
var import_dbBackup = __toESM(require_dbBackup());
|
4635
4654
|
var import_delete = __toESM(require_delete());
|
4636
4655
|
var import_deliveryLocation = __toESM(require_deliveryLocation());
|
4656
|
+
var import_disasterRecovery = __toESM(require_disasterRecovery());
|
4637
4657
|
var import_document = __toESM(require_document());
|
4638
4658
|
var import_dot = __toESM(require_dot());
|
4639
4659
|
var import_doubleCaretHorizontal = __toESM(require_doubleCaretHorizontal());
|
@@ -11285,7 +11305,7 @@ var Cell = (_a) => {
|
|
11285
11305
|
cellClassNames,
|
11286
11306
|
getBodyCellClassNames(false, stickyColumn),
|
11287
11307
|
getAlignClassNames2(align),
|
11288
|
-
tw("border-default
|
11308
|
+
tw("border-default"),
|
11289
11309
|
className
|
11290
11310
|
)
|
11291
11311
|
}));
|
@@ -11296,18 +11316,21 @@ var Row = (_a) => {
|
|
11296
11316
|
disabled,
|
11297
11317
|
header,
|
11298
11318
|
subgroup,
|
11299
|
-
active
|
11319
|
+
active,
|
11320
|
+
isLast
|
11300
11321
|
} = _b, rest = __objRest(_b, [
|
11301
11322
|
"className",
|
11302
11323
|
"disabled",
|
11303
11324
|
"header",
|
11304
11325
|
"subgroup",
|
11305
|
-
"active"
|
11326
|
+
"active",
|
11327
|
+
"isLast"
|
11306
11328
|
]);
|
11307
11329
|
return /* @__PURE__ */ React63.createElement("div", __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, rest), {
|
11308
11330
|
role: subgroup ? "rowgroup" : "row"
|
11309
11331
|
}), { inert: disabled ? "" : void 0 }), {
|
11310
11332
|
className: classNames(tw("contents"), className, {
|
11333
|
+
"[&>*]:border-b-transparent": isLast,
|
11311
11334
|
"children:opacity-70": disabled,
|
11312
11335
|
"[&>*]:bg-primary-active": active,
|
11313
11336
|
"[&>*]:hover:bg-muted": !disabled && !header
|
@@ -12013,19 +12036,32 @@ var DataListRow = ({
|
|
12013
12036
|
menu,
|
12014
12037
|
active,
|
12015
12038
|
disabled,
|
12039
|
+
isLast,
|
12040
|
+
selectionDisabled,
|
12016
12041
|
rowClassName,
|
12017
12042
|
renderFirstColumn,
|
12018
12043
|
additionalRowProps = () => ({}),
|
12019
12044
|
additionalColumnProps = () => ({}),
|
12020
|
-
stickyStyles
|
12045
|
+
stickyStyles,
|
12046
|
+
onClick
|
12021
12047
|
}) => {
|
12022
|
-
var _a;
|
12048
|
+
var _a, _b, _c;
|
12049
|
+
const resolvedAdditionalRowProps = additionalRowProps(row, index, rows);
|
12023
12050
|
const isRowDisabled = (_a = disabled == null ? void 0 : disabled(row, index, rows)) != null ? _a : false;
|
12024
|
-
|
12051
|
+
const isRowSelectionDisabled = (_b = selectionDisabled == null ? void 0 : selectionDisabled(row, index, rows)) != null ? _b : false;
|
12052
|
+
const isRowClickable = !isRowDisabled && !isRowSelectionDisabled && !!onClick;
|
12053
|
+
const style = __spreadProps(__spreadValues({}, (_c = resolvedAdditionalRowProps.style) != null ? _c : {}), {
|
12054
|
+
cursor: isRowClickable ? "pointer" : void 0
|
12055
|
+
});
|
12056
|
+
return /* @__PURE__ */ React68.createElement(DataList.Row, __spreadProps(__spreadValues({
|
12025
12057
|
key: row.id,
|
12026
12058
|
disabled: isRowDisabled,
|
12027
|
-
active
|
12028
|
-
|
12059
|
+
active,
|
12060
|
+
isLast
|
12061
|
+
}, resolvedAdditionalRowProps), {
|
12062
|
+
style,
|
12063
|
+
onClick: isRowClickable ? onClick : void 0
|
12064
|
+
}), renderFirstColumn == null ? void 0 : renderFirstColumn(row, index, rows), /* @__PURE__ */ React68.createElement(List, {
|
12029
12065
|
items: columns,
|
12030
12066
|
renderItem: (column, columnIndex) => {
|
12031
12067
|
const cell2 = /* @__PURE__ */ React68.createElement(DataList.Cell, __spreadProps(__spreadValues(__spreadValues({}, cellProps(column)), additionalColumnProps(column, columnIndex, columns, row)), {
|
@@ -12066,9 +12102,14 @@ var DataListCell = ({
|
|
12066
12102
|
case "action": {
|
12067
12103
|
const action = renameProperty("text", "children", column.action(row, index, rows));
|
12068
12104
|
if (action) {
|
12069
|
-
cellContent = /* @__PURE__ */ React68.createElement(Button.Secondary, __spreadValues({
|
12105
|
+
cellContent = /* @__PURE__ */ React68.createElement(Button.Secondary, __spreadProps(__spreadValues({
|
12070
12106
|
dense: true
|
12071
|
-
}, action)
|
12107
|
+
}, action), {
|
12108
|
+
onClick: (e) => {
|
12109
|
+
action.onClick();
|
12110
|
+
e.stopPropagation();
|
12111
|
+
}
|
12112
|
+
}));
|
12072
12113
|
}
|
12073
12114
|
break;
|
12074
12115
|
}
|
@@ -12120,7 +12161,7 @@ var flattenRows = (rows) => areRowsGrouped(rows) ? Object.values(rows).flatMap(f
|
|
12120
12161
|
var GAP = 8;
|
12121
12162
|
var INDENTATION = 28;
|
12122
12163
|
var sortGroupKeys = (groupKeys) => [...groupKeys].sort((a) => a === "undefined" ? -1 : 1);
|
12123
|
-
var
|
12164
|
+
var getDefaultRowSelectionLabel = () => "Select row";
|
12124
12165
|
var getDefaultGroupCheckboxLabel = (key) => `Select ${key}`;
|
12125
12166
|
var renderDefaultGroupName = (key) => /* @__PURE__ */ React69.createElement(React69.Fragment, null, "Group: ", /* @__PURE__ */ React69.createElement("b", null, key));
|
12126
12167
|
var renderDefaultEmptyGroup = () => /* @__PURE__ */ React69.createElement(DataList.EmptyGroup, {
|
@@ -12130,11 +12171,13 @@ var DataListGroup = (_a) => {
|
|
12130
12171
|
var _b = _a, {
|
12131
12172
|
groups,
|
12132
12173
|
groupKey,
|
12133
|
-
level = 0
|
12174
|
+
level = 0,
|
12175
|
+
isLastGroup
|
12134
12176
|
} = _b, props = __objRest(_b, [
|
12135
12177
|
"groups",
|
12136
12178
|
"groupKey",
|
12137
|
-
"level"
|
12179
|
+
"level",
|
12180
|
+
"isLastGroup"
|
12138
12181
|
]);
|
12139
12182
|
const {
|
12140
12183
|
columns,
|
@@ -12152,16 +12195,18 @@ var DataListGroup = (_a) => {
|
|
12152
12195
|
rows,
|
12153
12196
|
selectable,
|
12154
12197
|
selectedRows,
|
12155
|
-
|
12198
|
+
getOnSelectionChangeForId,
|
12156
12199
|
selectionDisabled = () => false,
|
12157
|
-
|
12200
|
+
getRowSelectionLabel = getDefaultRowSelectionLabel,
|
12158
12201
|
getGroupCheckboxLabel = getDefaultGroupCheckboxLabel
|
12159
12202
|
} = props;
|
12160
12203
|
const groupKeys = groups ? Object.keys(groups) : void 0;
|
12161
12204
|
const hasCustomRowForGroup = isFunction2(getGroupRow);
|
12162
12205
|
if (!areRowsGrouped(groups)) {
|
12163
12206
|
if (groups.length === 0 && groupKey && groupKey !== "undefined") {
|
12164
|
-
return /* @__PURE__ */ React69.createElement(DataList.Row,
|
12207
|
+
return /* @__PURE__ */ React69.createElement(DataList.Row, {
|
12208
|
+
isLast: isLastGroup
|
12209
|
+
}, selectable && /* @__PURE__ */ React69.createElement(DataList.Cell, null), /* @__PURE__ */ React69.createElement(DataList.Cell, {
|
12165
12210
|
style: { paddingLeft: `${2 + GAP + level * INDENTATION}px`, gridColumn: `${selectable ? 2 : 1} / -1` }
|
12166
12211
|
}, /* @__PURE__ */ React69.createElement(Typography, {
|
12167
12212
|
variant: "small",
|
@@ -12172,16 +12217,18 @@ var DataListGroup = (_a) => {
|
|
12172
12217
|
items: groups,
|
12173
12218
|
renderItem: (row, index) => {
|
12174
12219
|
var _a2;
|
12175
|
-
const
|
12220
|
+
const isSelected = (_a2 = selectedRows == null ? void 0 : selectedRows.includes(row.id)) != null ? _a2 : false;
|
12176
12221
|
const isDisabled = disabled == null ? void 0 : disabled(row, index, rows);
|
12177
12222
|
const isSelectionDisabled = selectionDisabled(row, index, rows);
|
12223
|
+
const isLastRow = isLastGroup && index === groups.length - 1;
|
12178
12224
|
return /* @__PURE__ */ React69.createElement(DataListRow, {
|
12179
12225
|
key: row.id,
|
12180
12226
|
columns,
|
12181
12227
|
row,
|
12182
12228
|
index,
|
12229
|
+
isLast: isLastRow,
|
12183
12230
|
rows,
|
12184
|
-
active: selectable &&
|
12231
|
+
active: selectable && isSelected,
|
12185
12232
|
menu: /* @__PURE__ */ React69.createElement(DataListRowMenu, {
|
12186
12233
|
row,
|
12187
12234
|
index,
|
@@ -12191,9 +12238,10 @@ var DataListGroup = (_a) => {
|
|
12191
12238
|
menuAriaLabel
|
12192
12239
|
}),
|
12193
12240
|
disabled,
|
12241
|
+
selectionDisabled,
|
12194
12242
|
rowClassName,
|
12195
12243
|
additionalRowProps: () => selectable ? {
|
12196
|
-
"aria-selected":
|
12244
|
+
"aria-selected": isSelected
|
12197
12245
|
} : {},
|
12198
12246
|
additionalColumnProps: (_, columnIndex) => columnIndex === 0 ? {
|
12199
12247
|
style: {
|
@@ -12201,13 +12249,20 @@ var DataListGroup = (_a) => {
|
|
12201
12249
|
}
|
12202
12250
|
} : {},
|
12203
12251
|
renderFirstColumn: (row2, index2) => {
|
12204
|
-
return /* @__PURE__ */ React69.createElement(React69.Fragment, null, selectable && /* @__PURE__ */ React69.createElement(DataList.Cell, null, /* @__PURE__ */ React69.createElement(
|
12205
|
-
|
12206
|
-
|
12207
|
-
|
12252
|
+
return /* @__PURE__ */ React69.createElement(React69.Fragment, null, selectable && /* @__PURE__ */ React69.createElement(DataList.Cell, null, selectable === "single" && /* @__PURE__ */ React69.createElement(RadioButton, {
|
12253
|
+
value: row2.id.toString(),
|
12254
|
+
"aria-label": getRowSelectionLabel(row2, index2, isSelected, rows),
|
12255
|
+
onChange: getOnSelectionChangeForId(row2.id),
|
12256
|
+
checked: isSelected,
|
12257
|
+
disabled: isDisabled || isSelectionDisabled
|
12258
|
+
}), selectable === "multiple" && /* @__PURE__ */ React69.createElement(Checkbox, {
|
12259
|
+
"aria-label": getRowSelectionLabel(row2, index2, isSelected, rows),
|
12260
|
+
onChange: getOnSelectionChangeForId(row2.id),
|
12261
|
+
checked: isSelected,
|
12208
12262
|
disabled: isDisabled || isSelectionDisabled
|
12209
12263
|
})));
|
12210
|
-
}
|
12264
|
+
},
|
12265
|
+
onClick: selectable === "single" ? getOnSelectionChangeForId(row.id) : void 0
|
12211
12266
|
});
|
12212
12267
|
}
|
12213
12268
|
});
|
@@ -12226,7 +12281,8 @@ var DataListGroup = (_a) => {
|
|
12226
12281
|
groupKey: "undefined",
|
12227
12282
|
level
|
12228
12283
|
}, props), {
|
12229
|
-
groups: group
|
12284
|
+
groups: group,
|
12285
|
+
isLastGroup: isLastGroup && index === groupKeys.length - 1
|
12230
12286
|
}));
|
12231
12287
|
}
|
12232
12288
|
const openPanelId = expandedGroupIds ? (_a2 = expandedGroupIds.find((id) => id === key)) != null ? _a2 : null : void 0;
|
@@ -12234,17 +12290,20 @@ var DataListGroup = (_a) => {
|
|
12234
12290
|
const nestedSelectedIds = (_b2 = selectedRows == null ? void 0 : selectedRows.filter((id) => nestedRowIds.includes(id))) != null ? _b2 : [];
|
12235
12291
|
const allSelected = nestedRowIds.length === nestedSelectedIds.length;
|
12236
12292
|
const isChecked = nestedSelectedIds.length > 0;
|
12293
|
+
const isActiveRow = !!openPanelId || selectable && isChecked;
|
12294
|
+
const isLastRow = isLastGroup && index === groupKeys.length - 1 && !openPanelId;
|
12237
12295
|
return /* @__PURE__ */ React69.createElement(Accordion, {
|
12238
12296
|
key,
|
12239
12297
|
openPanelId
|
12240
12298
|
}, hasCustomRowForGroup && /* @__PURE__ */ React69.createElement(DataList.Row, {
|
12241
|
-
active:
|
12242
|
-
|
12299
|
+
active: isActiveRow,
|
12300
|
+
isLast: isLastRow
|
12301
|
+
}, selectable && /* @__PURE__ */ React69.createElement(DataList.Cell, null, selectable === "multiple" && /* @__PURE__ */ React69.createElement(Checkbox, {
|
12243
12302
|
"aria-label": getGroupCheckboxLabel(key, group, index, isChecked, rows),
|
12244
12303
|
checked: isChecked,
|
12245
12304
|
indeterminate: isChecked && !allSelected,
|
12246
12305
|
disabled: group.length === 0,
|
12247
|
-
onChange:
|
12306
|
+
onChange: getOnSelectionChangeForId(nestedRowIds)
|
12248
12307
|
})), /* @__PURE__ */ React69.createElement(List, {
|
12249
12308
|
items: columns,
|
12250
12309
|
renderItem: (column, idx) => /* @__PURE__ */ React69.createElement(DataList.Cell, __spreadProps(__spreadValues({}, cellProps(column)), {
|
@@ -12267,29 +12326,31 @@ var DataListGroup = (_a) => {
|
|
12267
12326
|
onMenuOpenChange,
|
12268
12327
|
menuAriaLabel
|
12269
12328
|
})), !hasCustomRowForGroup && /* @__PURE__ */ React69.createElement(DataList.Row, {
|
12270
|
-
active:
|
12271
|
-
|
12329
|
+
active: isActiveRow,
|
12330
|
+
isLast: isLastRow
|
12331
|
+
}, selectable === "multiple" && /* @__PURE__ */ React69.createElement(DataList.Cell, null, /* @__PURE__ */ React69.createElement(Checkbox, {
|
12272
12332
|
"aria-label": getGroupCheckboxLabel(key, group, index, isChecked, rows),
|
12273
12333
|
checked: isChecked,
|
12274
12334
|
indeterminate: isChecked && !allSelected,
|
12275
12335
|
disabled: group.length === 0,
|
12276
|
-
onChange:
|
12336
|
+
onChange: getOnSelectionChangeForId(nestedRowIds)
|
12277
12337
|
})), /* @__PURE__ */ React69.createElement(DataList.Cell, {
|
12278
12338
|
className: tw("gap-3"),
|
12279
12339
|
style: { paddingLeft: `${GAP + level * INDENTATION}px`, gridColumn: `${selectable ? 2 : 1} / -1` }
|
12280
12340
|
}, /* @__PURE__ */ React69.createElement(Accordion.Toggle, {
|
12281
12341
|
panelId: key,
|
12282
12342
|
onChange: onGroupToggled
|
12283
|
-
}), renderGroupName(key, group))), /* @__PURE__ */ React69.createElement(
|
12284
|
-
subgroup: true
|
12285
|
-
}, /* @__PURE__ */ React69.createElement(Accordion.UnanimatedPanel, {
|
12343
|
+
}), renderGroupName(key, group))), /* @__PURE__ */ React69.createElement(Accordion.UnanimatedPanel, {
|
12286
12344
|
panelId: key
|
12345
|
+
}, /* @__PURE__ */ React69.createElement(DataList.Row, {
|
12346
|
+
subgroup: true
|
12287
12347
|
}, /* @__PURE__ */ React69.createElement(DataListGroup, __spreadProps(__spreadValues({
|
12288
12348
|
key,
|
12289
12349
|
groupKey: key,
|
12290
12350
|
level: level + 1
|
12291
12351
|
}, props), {
|
12292
|
-
groups: group
|
12352
|
+
groups: group,
|
12353
|
+
isLastGroup: isLastGroup && index === groupKeys.length - 1
|
12293
12354
|
})))));
|
12294
12355
|
}
|
12295
12356
|
});
|
@@ -12309,8 +12370,9 @@ var DataListSkeleton = ({ columns = ["1", "2", "2", 52], rows = 5 }) => {
|
|
12309
12370
|
height: 17.5
|
12310
12371
|
})))), /* @__PURE__ */ React70.createElement(List, {
|
12311
12372
|
items: [...Array(rows).keys()],
|
12312
|
-
renderItem: (item) => /* @__PURE__ */ React70.createElement(DataList.Row, {
|
12313
|
-
key: item
|
12373
|
+
renderItem: (item, index) => /* @__PURE__ */ React70.createElement(DataList.Row, {
|
12374
|
+
key: item,
|
12375
|
+
isLast: index === rows - 1
|
12314
12376
|
}, /* @__PURE__ */ React70.createElement(List, {
|
12315
12377
|
items: columnsAmount,
|
12316
12378
|
renderItem: (key) => /* @__PURE__ */ React70.createElement(DataList.Cell, {
|
@@ -12375,13 +12437,13 @@ var DataList2 = (_a) => {
|
|
12375
12437
|
getGroupRow,
|
12376
12438
|
renderGroupName,
|
12377
12439
|
renderEmptyGroup,
|
12378
|
-
onGroupToggled,
|
12379
|
-
expandedGroupIds,
|
12440
|
+
onGroupToggled: _onGroupToggled,
|
12441
|
+
expandedGroupIds: _expandedGroupIds,
|
12380
12442
|
defaultSort,
|
12381
12443
|
onSortChanged,
|
12382
12444
|
selectable,
|
12383
12445
|
selectionDisabled = () => false,
|
12384
|
-
|
12446
|
+
getRowSelectionLabel = getDefaultRowSelectionLabel,
|
12385
12447
|
getGroupCheckboxLabel = getDefaultGroupCheckboxLabel,
|
12386
12448
|
selectedRows,
|
12387
12449
|
defaultSelectedRows = [],
|
@@ -12411,7 +12473,7 @@ var DataList2 = (_a) => {
|
|
12411
12473
|
"onSortChanged",
|
12412
12474
|
"selectable",
|
12413
12475
|
"selectionDisabled",
|
12414
|
-
"
|
12476
|
+
"getRowSelectionLabel",
|
12415
12477
|
"getGroupCheckboxLabel",
|
12416
12478
|
"selectedRows",
|
12417
12479
|
"defaultSelectedRows",
|
@@ -12427,6 +12489,15 @@ var DataList2 = (_a) => {
|
|
12427
12489
|
defaultSelectedRows,
|
12428
12490
|
(value) => onSelectionChange == null ? void 0 : onSelectionChange(value != null ? value : [])
|
12429
12491
|
);
|
12492
|
+
const [expandedGroupIds, setExpandedGroupIds] = useControlledState(_expandedGroupIds, []);
|
12493
|
+
const onGroupToggled = (id, open) => {
|
12494
|
+
if (!open) {
|
12495
|
+
setExpandedGroupIds([...expandedGroupIds, id]);
|
12496
|
+
} else {
|
12497
|
+
setExpandedGroupIds(expandedGroupIds.filter((panelId) => panelId !== id));
|
12498
|
+
}
|
12499
|
+
_onGroupToggled == null ? void 0 : _onGroupToggled(id, open);
|
12500
|
+
};
|
12430
12501
|
const defaultSortedColumn = columns.find((c) => c.headerName === (defaultSort == null ? void 0 : defaultSort.headerName));
|
12431
12502
|
const initialSortState = defaultSortedColumn ? { column: defaultSortedColumn, direction: (_a2 = defaultSort == null ? void 0 : defaultSort.direction) != null ? _a2 : "ascending" } : {};
|
12432
12503
|
const [sort, updateSort] = useTableSort(__spreadProps(__spreadValues({}, initialSortState), { onSortChanged }));
|
@@ -12451,9 +12522,11 @@ var DataList2 = (_a) => {
|
|
12451
12522
|
}, children)),
|
12452
12523
|
[]
|
12453
12524
|
);
|
12454
|
-
const
|
12525
|
+
const getOnSelectionChangeForId = (id) => (e) => {
|
12455
12526
|
const ids = castArray2(id);
|
12456
|
-
if (
|
12527
|
+
if (selectable === "single") {
|
12528
|
+
setSelected(ids);
|
12529
|
+
} else if ("checked" in e.target && e.target.checked) {
|
12457
12530
|
setSelected([...selected != null ? selected : [], ...ids]);
|
12458
12531
|
} else {
|
12459
12532
|
setSelected(selected == null ? void 0 : selected.filter((_id) => !ids.includes(_id)));
|
@@ -12476,7 +12549,7 @@ var DataList2 = (_a) => {
|
|
12476
12549
|
}, selectable && /* @__PURE__ */ React72.createElement(DataList.HeadCell, {
|
12477
12550
|
align: "left",
|
12478
12551
|
sticky
|
12479
|
-
}, /* @__PURE__ */ React72.createElement(Checkbox, {
|
12552
|
+
}, selectable === "multiple" && /* @__PURE__ */ React72.createElement(Checkbox, {
|
12480
12553
|
"aria-label": "Select all rows",
|
12481
12554
|
indeterminate: totalSelected > 0 && totalSelected < allRows.length,
|
12482
12555
|
checked: totalSelected > 0,
|
@@ -12537,29 +12610,33 @@ var DataList2 = (_a) => {
|
|
12537
12610
|
selectable,
|
12538
12611
|
selectionDisabled,
|
12539
12612
|
selectedRows: selected,
|
12540
|
-
|
12541
|
-
|
12613
|
+
getOnSelectionChangeForId,
|
12614
|
+
getRowSelectionLabel,
|
12542
12615
|
getGroupCheckboxLabel,
|
12543
12616
|
rows,
|
12544
12617
|
groups,
|
12545
12618
|
groupKey: void 0,
|
12546
|
-
level: 0
|
12619
|
+
level: 0,
|
12620
|
+
isLastGroup: true
|
12547
12621
|
}), !groups && /* @__PURE__ */ React72.createElement(List, __spreadProps(__spreadValues({}, rest), {
|
12548
12622
|
paginationContainer: PaginationFooter,
|
12549
12623
|
items: sortedRows,
|
12550
12624
|
renderItem: (row, index) => {
|
12551
12625
|
var _a3;
|
12552
12626
|
const details = rowDetails == null ? void 0 : rowDetails(row, index, sortedRows);
|
12553
|
-
const
|
12627
|
+
const isSelected = (_a3 = selected == null ? void 0 : selected.includes(row.id)) != null ? _a3 : false;
|
12554
12628
|
const isSelectionDisabled = selectionDisabled == null ? void 0 : selectionDisabled(row, index, sortedRows);
|
12555
12629
|
const isDisabled = disabled == null ? void 0 : disabled(row, index, sortedRows);
|
12630
|
+
const openPanelId = expandedGroupIds.find((id) => id === row.id.toString()) || null;
|
12631
|
+
const isLastRow = index === sortedRows.length - 1;
|
12556
12632
|
const content = /* @__PURE__ */ React72.createElement(DataListRow, {
|
12557
12633
|
key: row.id,
|
12558
12634
|
columns,
|
12559
12635
|
row,
|
12560
12636
|
index,
|
12561
12637
|
rows: sortedRows,
|
12562
|
-
active: selectable &&
|
12638
|
+
active: selectable && isSelected,
|
12639
|
+
isLast: isLastRow && !openPanelId,
|
12563
12640
|
stickyStyles,
|
12564
12641
|
menu: /* @__PURE__ */ React72.createElement(DataListRowMenu, {
|
12565
12642
|
row,
|
@@ -12570,6 +12647,7 @@ var DataList2 = (_a) => {
|
|
12570
12647
|
menuAriaLabel
|
12571
12648
|
}),
|
12572
12649
|
disabled,
|
12650
|
+
selectionDisabled,
|
12573
12651
|
rowClassName,
|
12574
12652
|
additionalRowProps: (row2) => {
|
12575
12653
|
var _a4;
|
@@ -12578,27 +12656,36 @@ var DataList2 = (_a) => {
|
|
12578
12656
|
} : {};
|
12579
12657
|
},
|
12580
12658
|
renderFirstColumn: (row2, index2) => {
|
12581
|
-
return /* @__PURE__ */ React72.createElement(React72.Fragment, null, selectable && /* @__PURE__ */ React72.createElement(DataList.Cell, null, /* @__PURE__ */ React72.createElement(
|
12582
|
-
|
12583
|
-
|
12584
|
-
|
12659
|
+
return /* @__PURE__ */ React72.createElement(React72.Fragment, null, selectable && /* @__PURE__ */ React72.createElement(DataList.Cell, null, selectable === "single" && /* @__PURE__ */ React72.createElement(RadioButton, {
|
12660
|
+
value: row2.id.toString(),
|
12661
|
+
"aria-label": getRowSelectionLabel(row2, index2, isSelected, sortedRows),
|
12662
|
+
onChange: getOnSelectionChangeForId(row2.id),
|
12663
|
+
checked: isSelected,
|
12664
|
+
disabled: isDisabled || isSelectionDisabled
|
12665
|
+
}), selectable === "multiple" && /* @__PURE__ */ React72.createElement(Checkbox, {
|
12666
|
+
"aria-label": getRowSelectionLabel(row2, index2, isSelected, sortedRows),
|
12667
|
+
onChange: getOnSelectionChangeForId(row2.id),
|
12668
|
+
checked: isSelected,
|
12585
12669
|
disabled: isDisabled || isSelectionDisabled
|
12586
12670
|
})), rowDetails !== void 0 && /* @__PURE__ */ React72.createElement(DataList.Cell, null, details && /* @__PURE__ */ React72.createElement(Accordion.Toggle, {
|
12587
12671
|
panelId: row2.id.toString(),
|
12588
12672
|
onChange: onGroupToggled
|
12589
12673
|
})));
|
12590
|
-
}
|
12674
|
+
},
|
12675
|
+
onClick: selectable === "single" ? getOnSelectionChangeForId(row.id) : void 0
|
12591
12676
|
});
|
12592
12677
|
if (!details) {
|
12593
12678
|
return content;
|
12594
12679
|
}
|
12595
12680
|
return /* @__PURE__ */ React72.createElement(Accordion, {
|
12596
12681
|
key: row.id,
|
12597
|
-
openPanelId
|
12682
|
+
openPanelId
|
12598
12683
|
}, content, /* @__PURE__ */ React72.createElement(Accordion.Panel, {
|
12599
12684
|
role: "row",
|
12600
12685
|
panelId: row.id.toString(),
|
12601
|
-
className: tw("col-span-full bg-muted border-
|
12686
|
+
className: tw("col-span-full bg-muted border-default", {
|
12687
|
+
"border-b": !isLastRow
|
12688
|
+
}),
|
12602
12689
|
"aria-label": `row ${row.id.toString()} details`
|
12603
12690
|
}, /* @__PURE__ */ React72.createElement("div", {
|
12604
12691
|
role: "cell"
|
@@ -13309,6 +13396,102 @@ var DIALOG_ICONS_AND_COLORS = {
|
|
13309
13396
|
|
13310
13397
|
// src/atoms/Modal/Modal.tsx
|
13311
13398
|
import React86 from "react";
|
13399
|
+
import { tv as tv6 } from "tailwind-variants";
|
13400
|
+
var modalStyles = tv6({
|
13401
|
+
slots: {
|
13402
|
+
overlay: "inset-0 overflow-y-auto z-modal fixed",
|
13403
|
+
backdrop: "-z-10 fixed min-w-full min-h-full bg-body-intense opacity-70",
|
13404
|
+
dialog: "bg-popover-content max-h-full flex flex-col",
|
13405
|
+
header: "pl-7 pr-[64px] py-6 gap-3 flex items-center",
|
13406
|
+
headerImage: "h-[120px] min-h-[120px] w-full",
|
13407
|
+
titleContainer: "flex flex-col grow",
|
13408
|
+
title: "",
|
13409
|
+
closeButtonContainer: "absolute top-[24px] right-[28px]",
|
13410
|
+
body: "px-7 grow overflow-y-auto text-default",
|
13411
|
+
footer: "px-7 py-6",
|
13412
|
+
actions: "flex gap-4 justify-end"
|
13413
|
+
},
|
13414
|
+
variants: {
|
13415
|
+
kind: {
|
13416
|
+
dialog: {
|
13417
|
+
overlay: "py-7 justify-center flex items-center",
|
13418
|
+
dialog: "relative w-full rounded mx-7"
|
13419
|
+
},
|
13420
|
+
drawer: {
|
13421
|
+
overlay: "overflow-x-hidden",
|
13422
|
+
dialog: "absolute h-full",
|
13423
|
+
title: "text-ellipsis overflow-x-hidden whitespace-nowrap"
|
13424
|
+
}
|
13425
|
+
},
|
13426
|
+
size: {
|
13427
|
+
sm: "",
|
13428
|
+
md: "",
|
13429
|
+
full: "",
|
13430
|
+
screen: {
|
13431
|
+
overlay: "py-0",
|
13432
|
+
dialog: "w-dvw h-dvh mx-0 rounded-none",
|
13433
|
+
header: "border-b-1 border-muted mb-6"
|
13434
|
+
}
|
13435
|
+
},
|
13436
|
+
noFooter: {
|
13437
|
+
true: {
|
13438
|
+
body: "pb-6"
|
13439
|
+
}
|
13440
|
+
},
|
13441
|
+
backgroundImage: {
|
13442
|
+
true: {
|
13443
|
+
headerImage: "object-cover"
|
13444
|
+
},
|
13445
|
+
false: {
|
13446
|
+
headerImage: "bg-default"
|
13447
|
+
}
|
13448
|
+
}
|
13449
|
+
},
|
13450
|
+
compoundVariants: [
|
13451
|
+
{
|
13452
|
+
kind: "dialog",
|
13453
|
+
size: "sm",
|
13454
|
+
class: {
|
13455
|
+
dialog: "max-w-[600px]"
|
13456
|
+
}
|
13457
|
+
},
|
13458
|
+
{
|
13459
|
+
kind: "dialog",
|
13460
|
+
size: "md",
|
13461
|
+
class: {
|
13462
|
+
dialog: "max-w-[940px]"
|
13463
|
+
}
|
13464
|
+
},
|
13465
|
+
{
|
13466
|
+
kind: "dialog",
|
13467
|
+
size: "full",
|
13468
|
+
class: {
|
13469
|
+
dialog: "min-h-full"
|
13470
|
+
}
|
13471
|
+
},
|
13472
|
+
{
|
13473
|
+
kind: "drawer",
|
13474
|
+
size: "sm",
|
13475
|
+
class: {
|
13476
|
+
dialog: "w-[360px]"
|
13477
|
+
}
|
13478
|
+
},
|
13479
|
+
{
|
13480
|
+
kind: "drawer",
|
13481
|
+
size: "md",
|
13482
|
+
class: {
|
13483
|
+
dialog: "w-[560px]"
|
13484
|
+
}
|
13485
|
+
},
|
13486
|
+
{
|
13487
|
+
kind: "drawer",
|
13488
|
+
size: "full",
|
13489
|
+
class: {
|
13490
|
+
dialog: "w-[1080px]"
|
13491
|
+
}
|
13492
|
+
}
|
13493
|
+
]
|
13494
|
+
});
|
13312
13495
|
var Modal = (_a) => {
|
13313
13496
|
var _b = _a, {
|
13314
13497
|
children,
|
@@ -13321,80 +13504,64 @@ var Modal = (_a) => {
|
|
13321
13504
|
"className",
|
13322
13505
|
"open"
|
13323
13506
|
]);
|
13507
|
+
const { overlay } = modalStyles({ kind });
|
13324
13508
|
return open ? /* @__PURE__ */ React86.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13325
|
-
className:
|
13326
|
-
tw("inset-0 overflow-y-auto z-modal fixed"),
|
13327
|
-
{
|
13328
|
-
"py-7 justify-center flex items-center": kind === "dialog"
|
13329
|
-
},
|
13330
|
-
className
|
13331
|
-
)
|
13509
|
+
className: overlay({ className })
|
13332
13510
|
}), children) : null;
|
13333
13511
|
};
|
13334
13512
|
Modal.BackDrop = (_a) => {
|
13335
13513
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13514
|
+
const { backdrop } = modalStyles();
|
13336
13515
|
return /* @__PURE__ */ React86.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13337
|
-
className:
|
13516
|
+
className: backdrop({ className })
|
13338
13517
|
}));
|
13339
13518
|
};
|
13340
13519
|
Modal.Dialog = React86.forwardRef(
|
13341
13520
|
(_a, ref) => {
|
13342
|
-
var _b = _a, { kind = "dialog", children, className, size = "
|
13343
|
-
const
|
13344
|
-
const dialogClasses = classNames("relative w-full rounded mx-7", {
|
13345
|
-
"max-w-[600px]": size === "sm",
|
13346
|
-
"max-w-[940px]": size === "md",
|
13347
|
-
"min-h-full": size === "full"
|
13348
|
-
});
|
13349
|
-
const drawerClasses = classNames("absolute h-full", {
|
13350
|
-
"w-[360px]": size === "sm",
|
13351
|
-
"w-[560px]": size === "md",
|
13352
|
-
"w-[1080px]": size === "full"
|
13353
|
-
});
|
13521
|
+
var _b = _a, { kind = "dialog", children, className, size = "md" } = _b, rest = __objRest(_b, ["kind", "children", "className", "size"]);
|
13522
|
+
const { dialog } = modalStyles({ kind, size });
|
13354
13523
|
return /* @__PURE__ */ React86.createElement("div", __spreadProps(__spreadValues({
|
13355
13524
|
ref,
|
13356
13525
|
"aria-modal": "true"
|
13357
13526
|
}, rest), {
|
13358
|
-
className:
|
13527
|
+
className: dialog({ className })
|
13359
13528
|
}), children);
|
13360
13529
|
}
|
13361
13530
|
);
|
13362
13531
|
Modal.Header = (_a) => {
|
13363
|
-
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
13532
|
+
var _b = _a, { kind = "dialog", size = "md", children, className } = _b, rest = __objRest(_b, ["kind", "size", "children", "className"]);
|
13533
|
+
const { header } = modalStyles({ kind, size });
|
13364
13534
|
return /* @__PURE__ */ React86.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13365
|
-
className:
|
13535
|
+
className: header({ className })
|
13366
13536
|
}), children);
|
13367
13537
|
};
|
13368
13538
|
Modal.HeaderImage = (_a) => {
|
13369
13539
|
var _b = _a, { backgroundImage, className } = _b, rest = __objRest(_b, ["backgroundImage", "className"]);
|
13370
|
-
const
|
13540
|
+
const { headerImage } = modalStyles({ backgroundImage: Boolean(backgroundImage) });
|
13371
13541
|
return backgroundImage ? /* @__PURE__ */ React86.createElement("img", __spreadProps(__spreadValues({
|
13372
13542
|
"aria-hidden": true,
|
13373
13543
|
src: backgroundImage != null ? backgroundImage : void 0
|
13374
13544
|
}, rest), {
|
13375
|
-
className:
|
13545
|
+
className: headerImage({ className })
|
13376
13546
|
})) : /* @__PURE__ */ React86.createElement("div", {
|
13377
|
-
className:
|
13547
|
+
className: headerImage({ className })
|
13378
13548
|
});
|
13379
13549
|
};
|
13380
13550
|
Modal.CloseButtonContainer = (_a) => {
|
13381
13551
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13552
|
+
const { closeButtonContainer } = modalStyles();
|
13382
13553
|
return /* @__PURE__ */ React86.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13383
|
-
className:
|
13554
|
+
className: closeButtonContainer({ className })
|
13384
13555
|
}));
|
13385
13556
|
};
|
13386
13557
|
Modal.Title = (_a) => {
|
13387
13558
|
var _b = _a, { kind = "dialog", children, className } = _b, rest = __objRest(_b, ["kind", "children", "className"]);
|
13559
|
+
const { title } = modalStyles({ kind });
|
13388
13560
|
return /* @__PURE__ */ React86.createElement(Typography, __spreadValues({
|
13389
13561
|
htmlTag: "h2",
|
13390
13562
|
variant: "subheading",
|
13391
13563
|
color: "intense",
|
13392
|
-
className:
|
13393
|
-
tw({
|
13394
|
-
"text-ellipsis overflow-x-hidden whitespace-nowrap": kind === "drawer"
|
13395
|
-
}),
|
13396
|
-
className
|
13397
|
-
)
|
13564
|
+
className: title({ className })
|
13398
13565
|
}, rest), children);
|
13399
13566
|
};
|
13400
13567
|
Modal.Subtitle = (_a) => {
|
@@ -13406,27 +13573,31 @@ Modal.Subtitle = (_a) => {
|
|
13406
13573
|
};
|
13407
13574
|
Modal.TitleContainer = (_a) => {
|
13408
13575
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
13576
|
+
const { titleContainer } = modalStyles();
|
13409
13577
|
return /* @__PURE__ */ React86.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13410
|
-
className:
|
13578
|
+
className: titleContainer({ className })
|
13411
13579
|
}), children);
|
13412
13580
|
};
|
13413
13581
|
Modal.Body = (_a) => {
|
13414
13582
|
var _b = _a, { children, className, noFooter = false, maxHeight, style } = _b, rest = __objRest(_b, ["children", "className", "noFooter", "maxHeight", "style"]);
|
13583
|
+
const { body } = modalStyles();
|
13415
13584
|
return /* @__PURE__ */ React86.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13416
|
-
className:
|
13585
|
+
className: body({ noFooter, className }),
|
13417
13586
|
style: __spreadValues({ maxHeight }, style)
|
13418
13587
|
}), children);
|
13419
13588
|
};
|
13420
13589
|
Modal.Footer = (_a) => {
|
13421
13590
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
13591
|
+
const { footer } = modalStyles();
|
13422
13592
|
return /* @__PURE__ */ React86.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13423
|
-
className:
|
13593
|
+
className: footer({ className })
|
13424
13594
|
}), children);
|
13425
13595
|
};
|
13426
13596
|
Modal.Actions = (_a) => {
|
13427
13597
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
13598
|
+
const { actions } = modalStyles();
|
13428
13599
|
return /* @__PURE__ */ React86.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13429
|
-
className:
|
13600
|
+
className: actions({ className })
|
13430
13601
|
}), children);
|
13431
13602
|
};
|
13432
13603
|
|
@@ -13493,28 +13664,36 @@ var DialogWrapper = ({
|
|
13493
13664
|
};
|
13494
13665
|
|
13495
13666
|
// src/molecules/Drawer/Drawer.tsx
|
13496
|
-
import
|
13497
|
-
import {
|
13498
|
-
import { useDialog as useDialog2 } from "@react-aria/dialog";
|
13499
|
-
import { Overlay as Overlay3, useModalOverlay as useModalOverlay2 } from "@react-aria/overlays";
|
13500
|
-
import { useId as useId13 } from "@react-aria/utils";
|
13667
|
+
import React90 from "react";
|
13668
|
+
import { Dialog as AriaDialog2, Modal as AriaModal, ModalOverlay as AriaModalOverlay } from "react-aria-components";
|
13501
13669
|
import { animated as animated5, useSpring as useSpring4 } from "@react-spring/web";
|
13502
13670
|
import castArray3 from "lodash/castArray";
|
13503
13671
|
import omit12 from "lodash/omit";
|
13504
13672
|
|
13673
|
+
// src/molecules/Modal/ModalTitle.tsx
|
13674
|
+
import React88 from "react";
|
13675
|
+
import { HeadingContext, useContextProps } from "react-aria-components";
|
13676
|
+
var ModalTitle = (_a) => {
|
13677
|
+
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
13678
|
+
const [ctxProps] = useContextProps(__spreadProps(__spreadValues({}, props), { slot: "title" }), null, HeadingContext);
|
13679
|
+
return /* @__PURE__ */ React88.createElement(Modal.Title, __spreadValues({
|
13680
|
+
id: ctxProps.id
|
13681
|
+
}, props), children);
|
13682
|
+
};
|
13683
|
+
|
13505
13684
|
// src/molecules/Tabs/Tabs.tsx
|
13506
|
-
import
|
13685
|
+
import React89, { useEffect as useEffect8, useLayoutEffect as useLayoutEffect2, useRef as useRef10, useState as useState11 } from "react";
|
13507
13686
|
import isNumber5 from "lodash/isNumber";
|
13508
13687
|
import kebabCase from "lodash/kebabCase";
|
13509
13688
|
var import_chevronLeft5 = __toESM(require_chevronLeft());
|
13510
13689
|
var import_chevronRight5 = __toESM(require_chevronRight());
|
13511
13690
|
var import_warningSign4 = __toESM(require_warningSign());
|
13512
13691
|
var isTabComponent = (c) => {
|
13513
|
-
return
|
13692
|
+
return React89.isValidElement(c) && (c.type === Tab || c.type === ModalTab);
|
13514
13693
|
};
|
13515
|
-
var Tab =
|
13694
|
+
var Tab = React89.forwardRef(
|
13516
13695
|
({ className, id, title, children }, ref) => {
|
13517
|
-
return /* @__PURE__ */
|
13696
|
+
return /* @__PURE__ */ React89.createElement("div", {
|
13518
13697
|
ref,
|
13519
13698
|
id: `${id != null ? id : kebabCase(title)}-panel`,
|
13520
13699
|
className,
|
@@ -13526,14 +13705,14 @@ var Tab = React88.forwardRef(
|
|
13526
13705
|
);
|
13527
13706
|
var TabContainer = (_a) => {
|
13528
13707
|
var _b = _a, { className, children } = _b, rest = __objRest(_b, ["className", "children"]);
|
13529
|
-
return /* @__PURE__ */
|
13708
|
+
return /* @__PURE__ */ React89.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13530
13709
|
className: classNames("py-6 z-0", className)
|
13531
13710
|
}), children);
|
13532
13711
|
};
|
13533
13712
|
var ModalTab = Tab;
|
13534
13713
|
var ModalTabContainer = TabContainer;
|
13535
13714
|
var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
13536
|
-
const Tab2 =
|
13715
|
+
const Tab2 = React89.forwardRef(
|
13537
13716
|
(_a, ref) => {
|
13538
13717
|
var _b = _a, {
|
13539
13718
|
id,
|
@@ -13565,17 +13744,17 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
13565
13744
|
const _id = id != null ? id : kebabCase(title);
|
13566
13745
|
let statusIcon = void 0;
|
13567
13746
|
if (status === "warning") {
|
13568
|
-
statusIcon = /* @__PURE__ */
|
13747
|
+
statusIcon = /* @__PURE__ */ React89.createElement(InlineIcon, {
|
13569
13748
|
icon: import_warningSign4.default,
|
13570
13749
|
color: selected ? void 0 : "warning-default"
|
13571
13750
|
});
|
13572
13751
|
} else if (status === "error") {
|
13573
|
-
statusIcon = /* @__PURE__ */
|
13752
|
+
statusIcon = /* @__PURE__ */ React89.createElement(InlineIcon, {
|
13574
13753
|
icon: import_warningSign4.default,
|
13575
13754
|
color: selected ? void 0 : "danger-default"
|
13576
13755
|
});
|
13577
13756
|
}
|
13578
|
-
const tab = /* @__PURE__ */
|
13757
|
+
const tab = /* @__PURE__ */ React89.createElement(Component, __spreadValues({
|
13579
13758
|
ref,
|
13580
13759
|
id: `${_id}-tab`,
|
13581
13760
|
onClick: () => !disabled && onSelected(value != null ? value : index),
|
@@ -13592,29 +13771,29 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
13592
13771
|
"aria-selected": selected,
|
13593
13772
|
"aria-controls": `${_id}-panel`,
|
13594
13773
|
tabIndex: disabled ? void 0 : 0
|
13595
|
-
}, rest), /* @__PURE__ */
|
13774
|
+
}, rest), /* @__PURE__ */ React89.createElement(Typography2, {
|
13596
13775
|
htmlTag: "div",
|
13597
13776
|
variant: "small-strong",
|
13598
13777
|
color: selected ? "primary-default" : disabled ? "default" : "current",
|
13599
13778
|
className: tw("inline-flex items-center gap-3")
|
13600
|
-
}, showNotification ? /* @__PURE__ */
|
13779
|
+
}, showNotification ? /* @__PURE__ */ React89.createElement(Badge.Notification, {
|
13601
13780
|
right: "-4px",
|
13602
13781
|
top: "3px"
|
13603
|
-
}, /* @__PURE__ */
|
13782
|
+
}, /* @__PURE__ */ React89.createElement("span", {
|
13604
13783
|
className: tw("whitespace-nowrap")
|
13605
|
-
}, title)) : /* @__PURE__ */
|
13784
|
+
}, title)) : /* @__PURE__ */ React89.createElement("span", {
|
13606
13785
|
className: tw("whitespace-nowrap")
|
13607
|
-
}, title), isNumber5(badge) && /* @__PURE__ */
|
13786
|
+
}, title), isNumber5(badge) && /* @__PURE__ */ React89.createElement(Typography2, {
|
13608
13787
|
htmlTag: "span",
|
13609
13788
|
variant: "small",
|
13610
13789
|
color: selected ? "primary-intense" : "grey-5",
|
13611
13790
|
className: "leading-none"
|
13612
|
-
}, /* @__PURE__ */
|
13791
|
+
}, /* @__PURE__ */ React89.createElement(TabBadge, {
|
13613
13792
|
kind: "filled",
|
13614
13793
|
value: badge,
|
13615
13794
|
textClassname: classNames({ "text-white": selected, "text-muted": !selected })
|
13616
13795
|
})), statusIcon));
|
13617
|
-
return tooltip ? /* @__PURE__ */
|
13796
|
+
return tooltip ? /* @__PURE__ */ React89.createElement(Tooltip, {
|
13618
13797
|
content: tooltip
|
13619
13798
|
}, tab) : tab;
|
13620
13799
|
}
|
@@ -13628,7 +13807,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
13628
13807
|
const Tabs2 = (props) => {
|
13629
13808
|
var _a, _b;
|
13630
13809
|
const { className, value, defaultValue, onChange, children } = props;
|
13631
|
-
const childArr =
|
13810
|
+
const childArr = React89.Children.toArray(children);
|
13632
13811
|
const firstTab = childArr[0];
|
13633
13812
|
const firstTabValue = isTabComponent(firstTab) ? firstTab.props.value : -1;
|
13634
13813
|
const [selected, setSelected] = useState11((_b = (_a = value != null ? value : defaultValue) != null ? _a : firstTabValue) != null ? _b : 0);
|
@@ -13641,7 +13820,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
13641
13820
|
var _a2, _b2;
|
13642
13821
|
const container = containerRef.current;
|
13643
13822
|
const tabs = tabsRef.current;
|
13644
|
-
const values =
|
13823
|
+
const values = React89.Children.map(
|
13645
13824
|
children,
|
13646
13825
|
(tab, i) => {
|
13647
13826
|
var _a3;
|
@@ -13682,7 +13861,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
13682
13861
|
updateCarets();
|
13683
13862
|
setSelected(value);
|
13684
13863
|
revealSelectedTab({ smooth: value !== selected });
|
13685
|
-
}, [value,
|
13864
|
+
}, [value, React89.Children.count(children)]);
|
13686
13865
|
useLayoutEffect2(() => {
|
13687
13866
|
var _a2;
|
13688
13867
|
updateCarets();
|
@@ -13746,27 +13925,27 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
13746
13925
|
const handleSelected = (key) => {
|
13747
13926
|
(onChange != null ? onChange : setSelected)(key);
|
13748
13927
|
};
|
13749
|
-
|
13928
|
+
React89.Children.forEach(children, (c) => {
|
13750
13929
|
if (c && !isTabComponent(c)) {
|
13751
13930
|
throw new Error("<Tabs> can only have <Tabs.Tab> components as children");
|
13752
13931
|
}
|
13753
13932
|
});
|
13754
|
-
return /* @__PURE__ */
|
13933
|
+
return /* @__PURE__ */ React89.createElement("div", {
|
13755
13934
|
ref: parentRef,
|
13756
13935
|
className: classNames("Aquarium-Tabs", tw("h-full"), className)
|
13757
|
-
}, /* @__PURE__ */
|
13936
|
+
}, /* @__PURE__ */ React89.createElement("div", {
|
13758
13937
|
className: tw("relative flex items-center border-b-2 border-default")
|
13759
|
-
}, /* @__PURE__ */
|
13938
|
+
}, /* @__PURE__ */ React89.createElement("div", {
|
13760
13939
|
ref: containerRef,
|
13761
13940
|
className: tw("overflow-y-auto scrollbar-hide mb-[-2px] h-auto")
|
13762
|
-
}, /* @__PURE__ */
|
13941
|
+
}, /* @__PURE__ */ React89.createElement("div", {
|
13763
13942
|
ref: tabsRef,
|
13764
13943
|
role: "tablist",
|
13765
13944
|
"aria-label": "tabs",
|
13766
13945
|
className: tw("inline-flex items-center cursor-pointer font-normal h-full")
|
13767
|
-
},
|
13946
|
+
}, React89.Children.map(
|
13768
13947
|
children,
|
13769
|
-
(tab, index) => tab ? /* @__PURE__ */
|
13948
|
+
(tab, index) => tab ? /* @__PURE__ */ React89.createElement(TabItemComponent, __spreadProps(__spreadValues({
|
13770
13949
|
key: tab.props.value
|
13771
13950
|
}, tab.props), {
|
13772
13951
|
index,
|
@@ -13774,20 +13953,20 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
13774
13953
|
onKeyDown: handleKeyDown,
|
13775
13954
|
onSelected: handleSelected
|
13776
13955
|
})) : void 0
|
13777
|
-
))), leftCaret && /* @__PURE__ */
|
13956
|
+
))), leftCaret && /* @__PURE__ */ React89.createElement("div", {
|
13778
13957
|
className: tw("absolute left-0 bg-gradient-to-r from-white via-white z-20 py-3 pr-4")
|
13779
|
-
}, /* @__PURE__ */
|
13958
|
+
}, /* @__PURE__ */ React89.createElement("div", {
|
13780
13959
|
onClick: () => handleScrollToNext("left"),
|
13781
13960
|
className: tw("hover:bg-muted p-2 leading-none cursor-pointer")
|
13782
|
-
}, /* @__PURE__ */
|
13961
|
+
}, /* @__PURE__ */ React89.createElement(InlineIcon, {
|
13783
13962
|
icon: import_chevronLeft5.default
|
13784
|
-
}))), rightCaret && /* @__PURE__ */
|
13963
|
+
}))), rightCaret && /* @__PURE__ */ React89.createElement("div", {
|
13785
13964
|
onClick: () => handleScrollToNext("right"),
|
13786
13965
|
className: tw("absolute right-0 bg-gradient-to-l from-white via-white z-20 py-3 pl-4")
|
13787
|
-
}, /* @__PURE__ */
|
13966
|
+
}, /* @__PURE__ */ React89.createElement("div", {
|
13788
13967
|
onClick: () => handleScrollToNext("right"),
|
13789
13968
|
className: tw("hover:bg-muted p-2 leading-none cursor-pointer")
|
13790
|
-
}, /* @__PURE__ */
|
13969
|
+
}, /* @__PURE__ */ React89.createElement(InlineIcon, {
|
13791
13970
|
icon: import_chevronRight5.default
|
13792
13971
|
})))), renderChildren(children, selected, props));
|
13793
13972
|
};
|
@@ -13795,7 +13974,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
13795
13974
|
Tabs2.Tab = TabComponent;
|
13796
13975
|
return Tabs2;
|
13797
13976
|
};
|
13798
|
-
var Tabs = createTabsComponent(Tab, TabItem, "Tabs", (children, selected) => /* @__PURE__ */
|
13977
|
+
var Tabs = createTabsComponent(Tab, TabItem, "Tabs", (children, selected) => /* @__PURE__ */ React89.createElement(TabContainer, null, children.find(
|
13799
13978
|
(node, index) => (node == null ? void 0 : node.props.value) === selected || index === selected
|
13800
13979
|
)));
|
13801
13980
|
|
@@ -13809,20 +13988,25 @@ var WIDTHS = {
|
|
13809
13988
|
md: 560,
|
13810
13989
|
lg: 1080
|
13811
13990
|
};
|
13812
|
-
var Drawer = (
|
13813
|
-
|
13814
|
-
|
13815
|
-
|
13816
|
-
|
13817
|
-
|
13991
|
+
var Drawer = ({
|
13992
|
+
open,
|
13993
|
+
onClose,
|
13994
|
+
size = "sm",
|
13995
|
+
children,
|
13996
|
+
title,
|
13997
|
+
menu,
|
13998
|
+
menuAriaLabel,
|
13999
|
+
menuLabel,
|
14000
|
+
onMenuOpenChange,
|
14001
|
+
onAction,
|
14002
|
+
primaryAction,
|
14003
|
+
secondaryActions,
|
14004
|
+
closeOnEsc = true
|
14005
|
+
}) => {
|
14006
|
+
const [hidden, setHidden] = React90.useState(!open);
|
13818
14007
|
if (open && hidden) {
|
13819
14008
|
setHidden(!open);
|
13820
14009
|
}
|
13821
|
-
const { modalProps, underlayProps } = useModalOverlay2(
|
13822
|
-
{ isDismissable: false, isKeyboardDismissDisabled: !closeOnEsc },
|
13823
|
-
state,
|
13824
|
-
ref
|
13825
|
-
);
|
13826
14010
|
const { opacity, right } = useSpring4({
|
13827
14011
|
right: open ? "0px" : `-${WIDTHS[size]}px`,
|
13828
14012
|
opacity: open ? 0.6 : 0,
|
@@ -13837,130 +14021,89 @@ var Drawer = (_a) => {
|
|
13837
14021
|
}
|
13838
14022
|
}
|
13839
14023
|
});
|
13840
|
-
if (
|
14024
|
+
if (hidden) {
|
13841
14025
|
return null;
|
13842
14026
|
}
|
13843
|
-
|
13844
|
-
|
13845
|
-
|
13846
|
-
|
13847
|
-
|
13848
|
-
|
13849
|
-
|
14027
|
+
const dialogSize = size === "lg" ? "full" : size;
|
14028
|
+
const styles = modalStyles({ kind: "drawer", size: dialogSize });
|
14029
|
+
const childElements = React90.Children.toArray(children).filter(React90.isValidElement);
|
14030
|
+
const onlyChild = childElements.length === 1 ? childElements[0] : null;
|
14031
|
+
const hasTabs = isComponentType(onlyChild, Tabs);
|
14032
|
+
return /* @__PURE__ */ React90.createElement(AriaModalOverlay, {
|
14033
|
+
isOpen: !hidden,
|
14034
|
+
onOpenChange: (isOpen) => !isOpen && (onClose == null ? void 0 : onClose()),
|
14035
|
+
isDismissable: false,
|
14036
|
+
isKeyboardDismissDisabled: !closeOnEsc,
|
14037
|
+
className: styles.overlay({ className: "Aquarium-Drawer" })
|
14038
|
+
}, /* @__PURE__ */ React90.createElement(AnimatedBackDrop, {
|
13850
14039
|
style: { opacity }
|
13851
|
-
},
|
13852
|
-
|
13853
|
-
|
13854
|
-
|
13855
|
-
|
13856
|
-
}
|
13857
|
-
|
13858
|
-
|
13859
|
-
var
|
13860
|
-
|
13861
|
-
children,
|
13862
|
-
size = "sm",
|
13863
|
-
primaryAction,
|
13864
|
-
secondaryActions,
|
13865
|
-
onClose,
|
13866
|
-
spring,
|
13867
|
-
onAction,
|
13868
|
-
menu,
|
13869
|
-
onMenuOpenChange,
|
13870
|
-
menuLabel,
|
13871
|
-
menuAriaLabel
|
13872
|
-
} = _b, props = __objRest(_b, [
|
13873
|
-
"title",
|
13874
|
-
"children",
|
13875
|
-
"size",
|
13876
|
-
"primaryAction",
|
13877
|
-
"secondaryActions",
|
13878
|
-
"onClose",
|
13879
|
-
"spring",
|
13880
|
-
"onAction",
|
13881
|
-
"menu",
|
13882
|
-
"onMenuOpenChange",
|
13883
|
-
"menuLabel",
|
13884
|
-
"menuAriaLabel"
|
13885
|
-
]);
|
13886
|
-
var _a2;
|
13887
|
-
const labelledBy = useId13();
|
13888
|
-
const describedBy = useId13();
|
13889
|
-
const { dialogProps } = useDialog2(
|
13890
|
-
{ "role": "dialog", "aria-labelledby": labelledBy, "aria-describedby": describedBy },
|
13891
|
-
ref
|
13892
|
-
);
|
13893
|
-
const dialogSize = size === "lg" ? "full" : size;
|
13894
|
-
const childElements = React89.Children.toArray(children).filter(React89.isValidElement);
|
13895
|
-
const onlyChild = childElements.length === 1 ? childElements[0] : null;
|
13896
|
-
const hasTabs = isComponentType(onlyChild, Tabs);
|
13897
|
-
return /* @__PURE__ */ React89.createElement(AnimatedDialog, __spreadProps(__spreadValues(__spreadValues({
|
13898
|
-
ref,
|
13899
|
-
kind: "drawer",
|
13900
|
-
"aria-modal": "true",
|
13901
|
-
size: dialogSize
|
13902
|
-
}, props), dialogProps), {
|
13903
|
-
style: { position: "fixed", right: spring.right }
|
13904
|
-
}), /* @__PURE__ */ React89.createElement(Modal.CloseButtonContainer, null, /* @__PURE__ */ React89.createElement(Button.Icon, {
|
14040
|
+
}), /* @__PURE__ */ React90.createElement(AriaModal, null, /* @__PURE__ */ React90.createElement(AnimatedDialog, {
|
14041
|
+
kind: "drawer",
|
14042
|
+
"aria-modal": "true",
|
14043
|
+
size: dialogSize,
|
14044
|
+
style: { position: "fixed", right }
|
14045
|
+
}, /* @__PURE__ */ React90.createElement(AriaDialog2, {
|
14046
|
+
className: "flex flex-col grow overflow-y-auto"
|
14047
|
+
}, ({ close }) => {
|
14048
|
+
var _a;
|
14049
|
+
return /* @__PURE__ */ React90.createElement(React90.Fragment, null, /* @__PURE__ */ React90.createElement(Modal.CloseButtonContainer, null, /* @__PURE__ */ React90.createElement(Button.Icon, {
|
13905
14050
|
"aria-label": "Close",
|
13906
14051
|
icon: import_cross6.default,
|
13907
|
-
onClick:
|
13908
|
-
})), /* @__PURE__ */
|
14052
|
+
onClick: close
|
14053
|
+
})), /* @__PURE__ */ React90.createElement(Modal.Header, {
|
13909
14054
|
className: tw({ "pb-3": hasTabs })
|
13910
|
-
}, /* @__PURE__ */
|
13911
|
-
id: labelledBy,
|
14055
|
+
}, /* @__PURE__ */ React90.createElement(ModalTitle, {
|
13912
14056
|
kind: "drawer"
|
13913
|
-
}, title)), hasTabs ? /* @__PURE__ */
|
14057
|
+
}, title)), hasTabs ? /* @__PURE__ */ React90.createElement(DrawerTabs, __spreadProps(__spreadValues({}, onlyChild.props), {
|
13914
14058
|
className: tw("[&>div:first-child]:px-5 grow flex flex-col overflow-y-auto")
|
13915
|
-
})) : /* @__PURE__ */
|
13916
|
-
id: describedBy,
|
14059
|
+
})) : /* @__PURE__ */ React90.createElement(Modal.Body, {
|
13917
14060
|
tabIndex: 0,
|
13918
14061
|
noFooter: !(secondaryActions || primaryAction)
|
13919
|
-
}, children), (secondaryActions || primaryAction) && /* @__PURE__ */
|
14062
|
+
}, children), (secondaryActions || primaryAction) && /* @__PURE__ */ React90.createElement(Modal.Footer, null, /* @__PURE__ */ React90.createElement(Modal.Actions, {
|
13920
14063
|
className: size === "sm" ? tw("flex-col") : void 0
|
13921
|
-
}, size !== "sm" && menu && /* @__PURE__ */
|
14064
|
+
}, size !== "sm" && menu && /* @__PURE__ */ React90.createElement(Box.Flex, {
|
13922
14065
|
alignItems: "center"
|
13923
|
-
}, /* @__PURE__ */
|
14066
|
+
}, /* @__PURE__ */ React90.createElement(DropdownMenu2, {
|
13924
14067
|
onAction: (action) => onAction == null ? void 0 : onAction(action),
|
13925
14068
|
onOpenChange: onMenuOpenChange
|
13926
|
-
}, /* @__PURE__ */
|
13927
|
-
"aria-label": (
|
14069
|
+
}, /* @__PURE__ */ React90.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ React90.createElement(Button.Icon, {
|
14070
|
+
"aria-label": (_a = menuAriaLabel != null ? menuAriaLabel : menuLabel) != null ? _a : "Context menu",
|
13928
14071
|
icon: import_more4.default
|
13929
|
-
})), menu)), secondaryActions && castArray3(secondaryActions).filter(Boolean).map((
|
13930
|
-
var _c =
|
13931
|
-
return /* @__PURE__ */
|
14072
|
+
})), menu)), secondaryActions && castArray3(secondaryActions).filter(Boolean).map((_b) => {
|
14073
|
+
var _c = _b, { text } = _c, action = __objRest(_c, ["text"]);
|
14074
|
+
return /* @__PURE__ */ React90.createElement(Button.Secondary, __spreadValues({
|
13932
14075
|
key: text
|
13933
14076
|
}, action), text);
|
13934
|
-
}), primaryAction && /* @__PURE__ */
|
14077
|
+
}), primaryAction && /* @__PURE__ */ React90.createElement(Button.Primary, __spreadValues({
|
13935
14078
|
key: primaryAction.text
|
13936
14079
|
}, omit12(primaryAction, "text")), primaryAction.text))));
|
13937
|
-
}
|
13938
|
-
|
13939
|
-
var DrawerTabs = createTabsComponent(ModalTab, TabItem, "DrawerTabs", (children, selected) => /* @__PURE__ */
|
14080
|
+
}))));
|
14081
|
+
};
|
14082
|
+
var DrawerTabs = createTabsComponent(ModalTab, TabItem, "DrawerTabs", (children, selected) => /* @__PURE__ */ React90.createElement(Modal.Body, {
|
13940
14083
|
className: tw("h-full")
|
13941
|
-
}, /* @__PURE__ */
|
14084
|
+
}, /* @__PURE__ */ React90.createElement(ModalTabContainer, null, children.find(
|
13942
14085
|
(node, index) => (node == null ? void 0 : node.props.value) === selected || index === selected
|
13943
14086
|
))));
|
13944
14087
|
|
13945
14088
|
// src/molecules/Dropdown/Dropdown.tsx
|
13946
|
-
import
|
14089
|
+
import React93 from "react";
|
13947
14090
|
|
13948
14091
|
// src/molecules/Popover/Popover.tsx
|
13949
|
-
import
|
14092
|
+
import React92, { useRef as useRef11 } from "react";
|
13950
14093
|
import { PressResponder as PressResponder2, usePress as usePress2 } from "@react-aria/interactions";
|
13951
14094
|
import { useOverlayTrigger } from "@react-aria/overlays";
|
13952
14095
|
import { mergeProps as mergeProps3 } from "@react-aria/utils";
|
13953
|
-
import { useOverlayTriggerState as
|
14096
|
+
import { useOverlayTriggerState as useOverlayTriggerState3 } from "@react-stately/overlays";
|
13954
14097
|
import classNames10 from "classnames";
|
13955
14098
|
import omit13 from "lodash/omit";
|
13956
14099
|
|
13957
14100
|
// src/molecules/Popover/Dialog.tsx
|
13958
|
-
import
|
13959
|
-
import { useDialog as
|
14101
|
+
import React91 from "react";
|
14102
|
+
import { useDialog as useDialog2 } from "@react-aria/dialog";
|
13960
14103
|
var Dialog3 = ({ children }) => {
|
13961
|
-
const ref =
|
13962
|
-
const { dialogProps } =
|
13963
|
-
return /* @__PURE__ */
|
14104
|
+
const ref = React91.useRef(null);
|
14105
|
+
const { dialogProps } = useDialog2({}, ref);
|
14106
|
+
return /* @__PURE__ */ React91.createElement("div", __spreadProps(__spreadValues({
|
13964
14107
|
ref
|
13965
14108
|
}, dialogProps), {
|
13966
14109
|
className: tw("outline-none")
|
@@ -13992,7 +14135,7 @@ var Popover3 = (props) => {
|
|
13992
14135
|
shouldFlip
|
13993
14136
|
} = props;
|
13994
14137
|
const triggerRef = useRef11(null);
|
13995
|
-
const state =
|
14138
|
+
const state = useOverlayTriggerState3(__spreadProps(__spreadValues({}, props), {
|
13996
14139
|
onOpenChange: (isOpen) => {
|
13997
14140
|
var _a, _b;
|
13998
14141
|
(_a = props.onOpenChange) == null ? void 0 : _a.call(props, isOpen);
|
@@ -14000,22 +14143,22 @@ var Popover3 = (props) => {
|
|
14000
14143
|
}
|
14001
14144
|
}));
|
14002
14145
|
const { triggerProps, overlayProps } = useOverlayTrigger({ type: type != null ? type : "dialog" }, state, triggerRef);
|
14003
|
-
return /* @__PURE__ */
|
14146
|
+
return /* @__PURE__ */ React92.createElement(PopoverContext2.Provider, {
|
14004
14147
|
value: {
|
14005
14148
|
state
|
14006
14149
|
}
|
14007
|
-
},
|
14150
|
+
}, React92.Children.map(props.children, (child) => {
|
14008
14151
|
if (isComponentType(child, Popover3.Trigger)) {
|
14009
|
-
return /* @__PURE__ */
|
14152
|
+
return /* @__PURE__ */ React92.createElement(PressResponder2, __spreadValues({
|
14010
14153
|
ref: triggerRef
|
14011
|
-
}, omit13(triggerProps, "aria-expanded")), /* @__PURE__ */
|
14154
|
+
}, omit13(triggerProps, "aria-expanded")), /* @__PURE__ */ React92.createElement(PopoverTriggerWrapper, {
|
14012
14155
|
"data-testid": props["data-testid"],
|
14013
14156
|
"aria-controls": id,
|
14014
14157
|
"aria-expanded": triggerProps["aria-expanded"]
|
14015
14158
|
}, child.props.children));
|
14016
14159
|
}
|
14017
14160
|
if (isComponentType(child, Popover3.Panel)) {
|
14018
|
-
return state.isOpen && /* @__PURE__ */
|
14161
|
+
return state.isOpen && /* @__PURE__ */ React92.createElement(PopoverOverlay, __spreadValues({
|
14019
14162
|
triggerRef: targetRef != null ? targetRef : triggerRef,
|
14020
14163
|
state,
|
14021
14164
|
placement,
|
@@ -14026,7 +14169,7 @@ var Popover3 = (props) => {
|
|
14026
14169
|
offset,
|
14027
14170
|
crossOffset,
|
14028
14171
|
shouldFlip
|
14029
|
-
}, overlayProps), containFocus ? /* @__PURE__ */
|
14172
|
+
}, overlayProps), containFocus ? /* @__PURE__ */ React92.createElement(Dialog3, null, child.props.children) : child.props.children);
|
14030
14173
|
}
|
14031
14174
|
throw new Error("Invalid children element type");
|
14032
14175
|
}));
|
@@ -14045,7 +14188,7 @@ var asPopoverButton = (Component, displayName) => {
|
|
14045
14188
|
state.close();
|
14046
14189
|
onClick == null ? void 0 : onClick(e);
|
14047
14190
|
};
|
14048
|
-
return /* @__PURE__ */
|
14191
|
+
return /* @__PURE__ */ React92.createElement(Component, __spreadProps(__spreadValues({}, props), {
|
14049
14192
|
onClick: handleClick
|
14050
14193
|
}));
|
14051
14194
|
};
|
@@ -14058,9 +14201,9 @@ var PopoverTriggerWrapper = (_a) => {
|
|
14058
14201
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
14059
14202
|
var _a2;
|
14060
14203
|
const ref = useRef11(null);
|
14061
|
-
const trigger =
|
14204
|
+
const trigger = React92.Children.only(children);
|
14062
14205
|
const { pressProps } = usePress2(__spreadProps(__spreadValues({}, rest), { ref }));
|
14063
|
-
return
|
14206
|
+
return React92.cloneElement(trigger, __spreadProps(__spreadValues({
|
14064
14207
|
"ref": ref
|
14065
14208
|
}, mergeProps3(pressProps, trigger.props)), {
|
14066
14209
|
"aria-controls": (_a2 = rest["aria-controls"]) != null ? _a2 : pressProps["aria-controls"]
|
@@ -14069,10 +14212,10 @@ var PopoverTriggerWrapper = (_a) => {
|
|
14069
14212
|
|
14070
14213
|
// src/molecules/Dropdown/Dropdown.tsx
|
14071
14214
|
var Dropdown = ({ children, content, placement = "bottom-left" }) => {
|
14072
|
-
return /* @__PURE__ */
|
14215
|
+
return /* @__PURE__ */ React93.createElement(Popover3, {
|
14073
14216
|
type: "menu",
|
14074
14217
|
placement
|
14075
|
-
}, /* @__PURE__ */
|
14218
|
+
}, /* @__PURE__ */ React93.createElement(Popover3.Trigger, null, children), /* @__PURE__ */ React93.createElement(Popover3.Panel, {
|
14076
14219
|
className: "Aquarium-Dropdown"
|
14077
14220
|
}, content));
|
14078
14221
|
};
|
@@ -14083,26 +14226,26 @@ var DropdownMenu3 = ({
|
|
14083
14226
|
triggerId,
|
14084
14227
|
setClose = () => void 0
|
14085
14228
|
}) => {
|
14086
|
-
const menuRef =
|
14087
|
-
|
14229
|
+
const menuRef = React93.useRef(null);
|
14230
|
+
React93.useEffect(() => {
|
14088
14231
|
const id = setTimeout(() => {
|
14089
14232
|
var _a, _b, _c;
|
14090
14233
|
return (_c = (_b = (_a = menuRef.current) == null ? void 0 : _a.children) == null ? void 0 : _b[0]) == null ? void 0 : _c.focus();
|
14091
14234
|
});
|
14092
14235
|
return () => clearTimeout(id);
|
14093
14236
|
}, [menuRef.current]);
|
14094
|
-
return /* @__PURE__ */
|
14237
|
+
return /* @__PURE__ */ React93.createElement("div", {
|
14095
14238
|
style: { minWidth: "250px" },
|
14096
14239
|
className: tw("py-3 bg-popover-content")
|
14097
|
-
}, !!title && /* @__PURE__ */
|
14240
|
+
}, !!title && /* @__PURE__ */ React93.createElement("div", {
|
14098
14241
|
className: tw("px-4 py-4 text-left text-intense typography-default-strong")
|
14099
|
-
}, title), /* @__PURE__ */
|
14242
|
+
}, title), /* @__PURE__ */ React93.createElement("ol", {
|
14100
14243
|
role: "menu",
|
14101
14244
|
ref: menuRef,
|
14102
14245
|
id: contentId,
|
14103
14246
|
"aria-labelledby": triggerId
|
14104
|
-
},
|
14105
|
-
return
|
14247
|
+
}, React93.Children.map(children, (child) => {
|
14248
|
+
return React93.cloneElement(child, { setClose });
|
14106
14249
|
})));
|
14107
14250
|
};
|
14108
14251
|
var DropdownItem = (_a) => {
|
@@ -14157,10 +14300,10 @@ var DropdownItem = (_a) => {
|
|
14157
14300
|
handleSelect();
|
14158
14301
|
}
|
14159
14302
|
};
|
14160
|
-
const itemContent = /* @__PURE__ */
|
14303
|
+
const itemContent = /* @__PURE__ */ React93.createElement("div", {
|
14161
14304
|
className: tw("py-3 px-4")
|
14162
14305
|
}, children);
|
14163
|
-
return /* @__PURE__ */
|
14306
|
+
return /* @__PURE__ */ React93.createElement("li", __spreadProps(__spreadValues({
|
14164
14307
|
role: "menuitem",
|
14165
14308
|
tabIndex: -1,
|
14166
14309
|
onClick: handleClick,
|
@@ -14174,11 +14317,11 @@ var DropdownItem = (_a) => {
|
|
14174
14317
|
"text-danger-default": color === "danger" && !disabled
|
14175
14318
|
})
|
14176
14319
|
)
|
14177
|
-
}), tooltip ? /* @__PURE__ */
|
14320
|
+
}), tooltip ? /* @__PURE__ */ React93.createElement(Tooltip, {
|
14178
14321
|
content: tooltip,
|
14179
14322
|
placement: tooltipPlacement,
|
14180
14323
|
inline: false
|
14181
|
-
}, /* @__PURE__ */
|
14324
|
+
}, /* @__PURE__ */ React93.createElement("div", {
|
14182
14325
|
tabIndex: 0,
|
14183
14326
|
className: tw("grow")
|
14184
14327
|
}, itemContent)) : itemContent);
|
@@ -14187,7 +14330,7 @@ Dropdown.Menu = DropdownMenu3;
|
|
14187
14330
|
Dropdown.Item = DropdownItem;
|
14188
14331
|
|
14189
14332
|
// src/molecules/EmptyState/EmptyState.tsx
|
14190
|
-
import
|
14333
|
+
import React94 from "react";
|
14191
14334
|
var EmptyStateLayout = /* @__PURE__ */ ((EmptyStateLayout2) => {
|
14192
14335
|
EmptyStateLayout2["Vertical"] = "vertical";
|
14193
14336
|
EmptyStateLayout2["Horizontal"] = "horizontal";
|
@@ -14244,7 +14387,7 @@ var EmptyState = ({
|
|
14244
14387
|
fullHeight = isVerticalLayout(layout) ? true : false
|
14245
14388
|
}) => {
|
14246
14389
|
const template = layoutStyle(layout);
|
14247
|
-
return /* @__PURE__ */
|
14390
|
+
return /* @__PURE__ */ React94.createElement(Box, {
|
14248
14391
|
className: classNames(
|
14249
14392
|
"Aquarium-EmptyState",
|
14250
14393
|
tw("rounded p-[56px]", {
|
@@ -14257,39 +14400,39 @@ var EmptyState = ({
|
|
14257
14400
|
),
|
14258
14401
|
backgroundColor: "transparent",
|
14259
14402
|
borderColor: "default"
|
14260
|
-
}, /* @__PURE__ */
|
14403
|
+
}, /* @__PURE__ */ React94.createElement(Box.Flex, {
|
14261
14404
|
style: { gap: "56px" },
|
14262
14405
|
flexDirection: template.layout,
|
14263
14406
|
justifyContent: template.justifyContent,
|
14264
14407
|
alignItems: template.layout === "row" ? "center" : template.alignItems,
|
14265
14408
|
height: fullHeight ? "full" : void 0
|
14266
|
-
}, image && /* @__PURE__ */
|
14409
|
+
}, image && /* @__PURE__ */ React94.createElement("img", {
|
14267
14410
|
src: image,
|
14268
14411
|
alt: imageAlt,
|
14269
14412
|
style: { width: imageWidth ? `${imageWidth}px` : void 0, height: "auto" }
|
14270
|
-
}), /* @__PURE__ */
|
14413
|
+
}), /* @__PURE__ */ React94.createElement(Box.Flex, {
|
14271
14414
|
flexDirection: "column",
|
14272
14415
|
justifyContent: template.justifyContent,
|
14273
14416
|
alignItems: template.alignItems
|
14274
|
-
}, /* @__PURE__ */
|
14417
|
+
}, /* @__PURE__ */ React94.createElement(Typography2.Heading, {
|
14275
14418
|
htmlTag: "h2"
|
14276
|
-
}, title), (description || children) && /* @__PURE__ */
|
14419
|
+
}, title), (description || children) && /* @__PURE__ */ React94.createElement(Box, {
|
14277
14420
|
marginTop: "5"
|
14278
|
-
}, /* @__PURE__ */
|
14421
|
+
}, /* @__PURE__ */ React94.createElement(Typography2.Default, null, children || description)), (secondaryAction || primaryAction) && /* @__PURE__ */ React94.createElement(Box.Flex, {
|
14279
14422
|
marginTop: "7",
|
14280
14423
|
gap: "4",
|
14281
14424
|
justifyContent: "center",
|
14282
14425
|
alignItems: "center",
|
14283
14426
|
flexWrap: "wrap"
|
14284
|
-
}, primaryAction && renderAction({ kind: "primary", action: primaryAction }), secondaryAction && renderAction({ kind: "secondary", action: secondaryAction })), footer && /* @__PURE__ */
|
14427
|
+
}, primaryAction && renderAction({ kind: "primary", action: primaryAction }), secondaryAction && renderAction({ kind: "secondary", action: secondaryAction })), footer && /* @__PURE__ */ React94.createElement(Box, {
|
14285
14428
|
marginTop: "5"
|
14286
|
-
}, /* @__PURE__ */
|
14429
|
+
}, /* @__PURE__ */ React94.createElement(Typography2.Small, {
|
14287
14430
|
color: "default"
|
14288
14431
|
}, footer)))));
|
14289
14432
|
};
|
14290
14433
|
|
14291
14434
|
// src/molecules/Flexbox/FlexboxItem.tsx
|
14292
|
-
import
|
14435
|
+
import React95 from "react";
|
14293
14436
|
var FlexboxItem = Tailwindify(
|
14294
14437
|
({ htmlTag = "div", className, style, children, display, flex, grow, shrink, order, alignSelf }) => {
|
14295
14438
|
const hookStyle = useStyle({
|
@@ -14301,7 +14444,7 @@ var FlexboxItem = Tailwindify(
|
|
14301
14444
|
alignSelf
|
14302
14445
|
});
|
14303
14446
|
const HtmlElement = htmlTag;
|
14304
|
-
return /* @__PURE__ */
|
14447
|
+
return /* @__PURE__ */ React95.createElement(HtmlElement, {
|
14305
14448
|
style: __spreadValues(__spreadValues({}, hookStyle), style),
|
14306
14449
|
className
|
14307
14450
|
}, children);
|
@@ -14309,7 +14452,7 @@ var FlexboxItem = Tailwindify(
|
|
14309
14452
|
);
|
14310
14453
|
|
14311
14454
|
// src/molecules/Grid/GridItem.tsx
|
14312
|
-
import
|
14455
|
+
import React96 from "react";
|
14313
14456
|
var GridItem2 = Tailwindify(
|
14314
14457
|
({
|
14315
14458
|
htmlTag = "div",
|
@@ -14340,7 +14483,7 @@ var GridItem2 = Tailwindify(
|
|
14340
14483
|
gridRowEnd: rowEnd
|
14341
14484
|
});
|
14342
14485
|
const HtmlElement = htmlTag;
|
14343
|
-
return /* @__PURE__ */
|
14486
|
+
return /* @__PURE__ */ React96.createElement(HtmlElement, {
|
14344
14487
|
style: __spreadValues(__spreadValues({}, hookStyle), style),
|
14345
14488
|
className
|
14346
14489
|
}, children);
|
@@ -14348,7 +14491,7 @@ var GridItem2 = Tailwindify(
|
|
14348
14491
|
);
|
14349
14492
|
|
14350
14493
|
// src/molecules/LineClamp/LineClamp.tsx
|
14351
|
-
import
|
14494
|
+
import React97 from "react";
|
14352
14495
|
var LineClamp2 = ({
|
14353
14496
|
lines,
|
14354
14497
|
children,
|
@@ -14357,10 +14500,10 @@ var LineClamp2 = ({
|
|
14357
14500
|
collapseLabel,
|
14358
14501
|
onClampedChange
|
14359
14502
|
}) => {
|
14360
|
-
const ref =
|
14361
|
-
const [clamped, setClamped] =
|
14362
|
-
const [isClampingEnabled, setClampingEnabled] =
|
14363
|
-
|
14503
|
+
const ref = React97.useRef(null);
|
14504
|
+
const [clamped, setClamped] = React97.useState(true);
|
14505
|
+
const [isClampingEnabled, setClampingEnabled] = React97.useState(false);
|
14506
|
+
React97.useEffect(() => {
|
14364
14507
|
var _a, _b;
|
14365
14508
|
const el = ref.current;
|
14366
14509
|
setClampingEnabled(((_a = el == null ? void 0 : el.scrollHeight) != null ? _a : 0) > ((_b = el == null ? void 0 : el.clientHeight) != null ? _b : 0));
|
@@ -14369,28 +14512,28 @@ var LineClamp2 = ({
|
|
14369
14512
|
setClamped(!clamped);
|
14370
14513
|
onClampedChange == null ? void 0 : onClampedChange(!clamped);
|
14371
14514
|
};
|
14372
|
-
return /* @__PURE__ */
|
14515
|
+
return /* @__PURE__ */ React97.createElement("div", {
|
14373
14516
|
className: "Aquarium-LineClamp"
|
14374
|
-
}, /* @__PURE__ */
|
14517
|
+
}, /* @__PURE__ */ React97.createElement(LineClamp, {
|
14375
14518
|
ref,
|
14376
14519
|
lines,
|
14377
14520
|
clamped,
|
14378
14521
|
wordBreak
|
14379
|
-
}, children), expandLabel && isClampingEnabled && /* @__PURE__ */
|
14522
|
+
}, children), expandLabel && isClampingEnabled && /* @__PURE__ */ React97.createElement(Button.Ghost, {
|
14380
14523
|
dense: true,
|
14381
14524
|
onClick: handleClampedChange
|
14382
14525
|
}, clamped ? expandLabel : collapseLabel));
|
14383
14526
|
};
|
14384
14527
|
|
14385
14528
|
// src/molecules/Link/Link.tsx
|
14386
|
-
import
|
14529
|
+
import React99 from "react";
|
14387
14530
|
import classNames11 from "classnames";
|
14388
14531
|
|
14389
14532
|
// src/atoms/Link/Link.tsx
|
14390
|
-
import
|
14533
|
+
import React98 from "react";
|
14391
14534
|
var Link = (_a) => {
|
14392
14535
|
var _b = _a, { children, className } = _b, props = __objRest(_b, ["children", "className"]);
|
14393
|
-
return /* @__PURE__ */
|
14536
|
+
return /* @__PURE__ */ React98.createElement("a", __spreadValues({
|
14394
14537
|
className: classNames(className, linkStyle)
|
14395
14538
|
}, props), children);
|
14396
14539
|
};
|
@@ -14398,27 +14541,27 @@ var Link = (_a) => {
|
|
14398
14541
|
// src/molecules/Link/Link.tsx
|
14399
14542
|
var Link2 = (_a) => {
|
14400
14543
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
14401
|
-
return /* @__PURE__ */
|
14544
|
+
return /* @__PURE__ */ React99.createElement(Link, __spreadValues({
|
14402
14545
|
className: classNames11("Aquarium-Link", className)
|
14403
14546
|
}, props));
|
14404
14547
|
};
|
14405
14548
|
|
14406
14549
|
// src/molecules/List/useStaticInfiniteList.ts
|
14407
|
-
import
|
14550
|
+
import React100 from "react";
|
14408
14551
|
var useStaticInfiniteList = ({
|
14409
14552
|
items,
|
14410
14553
|
pageSize,
|
14411
14554
|
autoReset = true
|
14412
14555
|
}) => {
|
14413
|
-
const [currentPage, setCurrentPage] =
|
14556
|
+
const [currentPage, setCurrentPage] = React100.useState(1);
|
14414
14557
|
const numberOfVisible = currentPage * pageSize;
|
14415
|
-
const next =
|
14558
|
+
const next = React100.useCallback(() => {
|
14416
14559
|
setCurrentPage((page) => page + 1);
|
14417
14560
|
}, [setCurrentPage]);
|
14418
|
-
const reset =
|
14561
|
+
const reset = React100.useCallback(() => {
|
14419
14562
|
setCurrentPage(1);
|
14420
14563
|
}, [setCurrentPage]);
|
14421
|
-
|
14564
|
+
React100.useEffect(() => {
|
14422
14565
|
if (autoReset) {
|
14423
14566
|
setCurrentPage(1);
|
14424
14567
|
}
|
@@ -14433,17 +14576,17 @@ var useStaticInfiniteList = ({
|
|
14433
14576
|
};
|
14434
14577
|
|
14435
14578
|
// src/molecules/ListItem/ListItem.tsx
|
14436
|
-
import
|
14579
|
+
import React101 from "react";
|
14437
14580
|
var ListItem = ({ name, icon, active = false }) => {
|
14438
|
-
return /* @__PURE__ */
|
14581
|
+
return /* @__PURE__ */ React101.createElement(Box.Flex, {
|
14439
14582
|
className: "Aquarium-ListItem",
|
14440
14583
|
alignItems: "center"
|
14441
|
-
}, /* @__PURE__ */
|
14584
|
+
}, /* @__PURE__ */ React101.createElement(Typography2, {
|
14442
14585
|
variant: active ? "small-strong" : "small",
|
14443
14586
|
color: "default",
|
14444
14587
|
htmlTag: "span",
|
14445
14588
|
className: `px-4 py-2 rounded-full ${active ? "bg-default" : "hover:bg-muted"}`
|
14446
|
-
}, /* @__PURE__ */
|
14589
|
+
}, /* @__PURE__ */ React101.createElement("img", {
|
14447
14590
|
src: icon,
|
14448
14591
|
alt: "",
|
14449
14592
|
className: "inline mr-4",
|
@@ -14453,96 +14596,86 @@ var ListItem = ({ name, icon, active = false }) => {
|
|
14453
14596
|
};
|
14454
14597
|
|
14455
14598
|
// src/molecules/Modal/Modal.tsx
|
14456
|
-
import
|
14457
|
-
import {
|
14458
|
-
import { Overlay as Overlay4, useModalOverlay as useModalOverlay3 } from "@react-aria/overlays";
|
14459
|
-
import { useId as useId14 } from "@react-aria/utils";
|
14460
|
-
import { useOverlayTriggerState as useOverlayTriggerState5 } from "@react-stately/overlays";
|
14599
|
+
import React102 from "react";
|
14600
|
+
import { Dialog as AriaDialog3, Modal as AriaModal2, ModalOverlay as AriaModalOverlay2 } from "react-aria-components";
|
14461
14601
|
import castArray4 from "lodash/castArray";
|
14462
14602
|
import omit14 from "lodash/omit";
|
14463
14603
|
var import_cross7 = __toESM(require_cross());
|
14464
|
-
var Modal2 = (
|
14465
|
-
|
14466
|
-
|
14467
|
-
|
14468
|
-
|
14469
|
-
|
14470
|
-
|
14471
|
-
|
14472
|
-
|
14473
|
-
|
14474
|
-
|
14604
|
+
var Modal2 = ({
|
14605
|
+
open,
|
14606
|
+
onClose,
|
14607
|
+
closeOnEsc = true,
|
14608
|
+
size = "md",
|
14609
|
+
headerImage,
|
14610
|
+
children,
|
14611
|
+
title,
|
14612
|
+
subtitle,
|
14613
|
+
primaryAction,
|
14614
|
+
secondaryActions
|
14615
|
+
}) => {
|
14616
|
+
if (!open) {
|
14475
14617
|
return null;
|
14476
14618
|
}
|
14477
|
-
|
14478
|
-
|
14479
|
-
|
14480
|
-
|
14481
|
-
|
14482
|
-
|
14483
|
-
|
14484
|
-
|
14485
|
-
},
|
14619
|
+
const styles = modalStyles({ kind: "dialog", size });
|
14620
|
+
const hasTabs = isComponentType(children, ModalTabs);
|
14621
|
+
return /* @__PURE__ */ React102.createElement(AriaModalOverlay2, {
|
14622
|
+
isOpen: open,
|
14623
|
+
onOpenChange: (isOpen) => !isOpen && (onClose == null ? void 0 : onClose()),
|
14624
|
+
isDismissable: false,
|
14625
|
+
isKeyboardDismissDisabled: !closeOnEsc,
|
14626
|
+
className: styles.overlay({ className: "Aquarium-Modal" })
|
14627
|
+
}, size !== "screen" && /* @__PURE__ */ React102.createElement(Modal.BackDrop, {
|
14628
|
+
className: styles.backdrop()
|
14629
|
+
}), /* @__PURE__ */ React102.createElement(AriaModal2, {
|
14630
|
+
className: styles.dialog()
|
14631
|
+
}, /* @__PURE__ */ React102.createElement(AriaDialog3, {
|
14632
|
+
className: "flex flex-col grow overflow-y-auto"
|
14633
|
+
}, ({ close }) => /* @__PURE__ */ React102.createElement(React102.Fragment, null, /* @__PURE__ */ React102.createElement(Modal.CloseButtonContainer, null, /* @__PURE__ */ React102.createElement(Button.Icon, {
|
14634
|
+
"aria-label": "Close",
|
14635
|
+
icon: import_cross7.default,
|
14636
|
+
onClick: close
|
14637
|
+
})), headerImage !== void 0 && /* @__PURE__ */ React102.createElement(Modal.HeaderImage, {
|
14638
|
+
backgroundImage: headerImage
|
14639
|
+
}), /* @__PURE__ */ React102.createElement(Modal.Header, {
|
14640
|
+
kind: "dialog",
|
14641
|
+
size,
|
14642
|
+
className: tw({ "pb-3": isComponentType(children, ModalTabs) })
|
14643
|
+
}, /* @__PURE__ */ React102.createElement(Modal.TitleContainer, null, /* @__PURE__ */ React102.createElement(ModalTitle, {
|
14644
|
+
kind: "dialog"
|
14645
|
+
}, title), subtitle && /* @__PURE__ */ React102.createElement(Modal.Subtitle, null, subtitle))), hasTabs ? React102.cloneElement(children, { className: tw("[&>div:first-child]:px-5 grow") }) : /* @__PURE__ */ React102.createElement(Modal.Body, {
|
14646
|
+
tabIndex: 0,
|
14647
|
+
noFooter: !(secondaryActions || primaryAction)
|
14648
|
+
}, children), (secondaryActions || primaryAction) && /* @__PURE__ */ React102.createElement(Modal.Footer, null, /* @__PURE__ */ React102.createElement(Modal.Actions, null, secondaryActions && castArray4(secondaryActions).filter(Boolean).map((_a) => {
|
14649
|
+
var _b = _a, { text } = _b, action = __objRest(_b, ["text"]);
|
14650
|
+
return /* @__PURE__ */ React102.createElement(Button.Secondary, __spreadValues({
|
14651
|
+
key: text
|
14652
|
+
}, action), text);
|
14653
|
+
}), primaryAction && /* @__PURE__ */ React102.createElement(Button.Primary, __spreadValues({
|
14654
|
+
key: primaryAction.text
|
14655
|
+
}, omit14(primaryAction, "text")), primaryAction.text)))))));
|
14486
14656
|
};
|
14487
|
-
var ModalWrapper = React101.forwardRef(
|
14488
|
-
(_a, ref) => {
|
14489
|
-
var _b = _a, { title, subtitle, headerImage, primaryAction, secondaryActions, children, onClose } = _b, props = __objRest(_b, ["title", "subtitle", "headerImage", "primaryAction", "secondaryActions", "children", "onClose"]);
|
14490
|
-
const labelledBy = useId14();
|
14491
|
-
const describedBy = useId14();
|
14492
|
-
const { dialogProps } = useDialog4(
|
14493
|
-
{ "role": "dialog", "aria-labelledby": labelledBy, "aria-describedby": describedBy },
|
14494
|
-
ref
|
14495
|
-
);
|
14496
|
-
return /* @__PURE__ */ React101.createElement(Modal.Dialog, __spreadProps(__spreadValues(__spreadValues({
|
14497
|
-
ref
|
14498
|
-
}, props), dialogProps), {
|
14499
|
-
tabIndex: -1
|
14500
|
-
}), /* @__PURE__ */ React101.createElement(Modal.CloseButtonContainer, null, /* @__PURE__ */ React101.createElement(IconButton, {
|
14501
|
-
"aria-label": "Close",
|
14502
|
-
icon: import_cross7.default,
|
14503
|
-
onClick: onClose
|
14504
|
-
})), headerImage !== void 0 && /* @__PURE__ */ React101.createElement(Modal.HeaderImage, {
|
14505
|
-
backgroundImage: headerImage
|
14506
|
-
}), /* @__PURE__ */ React101.createElement(Modal.Header, {
|
14507
|
-
className: tw({ "pb-3": isComponentType(children, ModalTabs) })
|
14508
|
-
}, /* @__PURE__ */ React101.createElement(Modal.TitleContainer, null, /* @__PURE__ */ React101.createElement(Modal.Title, {
|
14509
|
-
id: labelledBy
|
14510
|
-
}, title), subtitle && /* @__PURE__ */ React101.createElement(Modal.Subtitle, null, subtitle))), isComponentType(children, ModalTabs) ? React101.cloneElement(children, { className: tw("[&>div:first-child]:px-5 grow") }) : /* @__PURE__ */ React101.createElement(Modal.Body, {
|
14511
|
-
id: describedBy,
|
14512
|
-
tabIndex: 0,
|
14513
|
-
noFooter: !(secondaryActions || primaryAction)
|
14514
|
-
}, children), (secondaryActions || primaryAction) && /* @__PURE__ */ React101.createElement(Modal.Footer, null, /* @__PURE__ */ React101.createElement(Modal.Actions, null, secondaryActions && castArray4(secondaryActions).filter(Boolean).map((_a2) => {
|
14515
|
-
var _b2 = _a2, { text } = _b2, action = __objRest(_b2, ["text"]);
|
14516
|
-
return /* @__PURE__ */ React101.createElement(Button.Secondary, __spreadValues({
|
14517
|
-
key: text
|
14518
|
-
}, action), text);
|
14519
|
-
}), primaryAction && /* @__PURE__ */ React101.createElement(Button.Primary, __spreadValues({
|
14520
|
-
key: primaryAction.text
|
14521
|
-
}, omit14(primaryAction, "text")), primaryAction.text))));
|
14522
|
-
}
|
14523
|
-
);
|
14524
14657
|
var ModalTabs = createTabsComponent(
|
14525
14658
|
ModalTab,
|
14526
14659
|
TabItem,
|
14527
14660
|
"ModalTabs",
|
14528
|
-
(children, selected, props) => /* @__PURE__ */
|
14661
|
+
(children, selected, props) => /* @__PURE__ */ React102.createElement(Modal.Body, {
|
14529
14662
|
maxHeight: props.maxHeight
|
14530
|
-
}, /* @__PURE__ */
|
14663
|
+
}, /* @__PURE__ */ React102.createElement(ModalTabContainer, null, children.find(
|
14531
14664
|
(node, index) => (node == null ? void 0 : node.props.value) === selected || index === selected
|
14532
14665
|
)))
|
14533
14666
|
);
|
14534
14667
|
|
14535
14668
|
// src/molecules/MultiInput/MultiInput.tsx
|
14536
|
-
import
|
14537
|
-
import { useId as
|
14669
|
+
import React104, { useEffect as useEffect9, useRef as useRef12, useState as useState12 } from "react";
|
14670
|
+
import { useId as useId13 } from "@react-aria/utils";
|
14538
14671
|
import castArray5 from "lodash/castArray";
|
14539
14672
|
import identity from "lodash/identity";
|
14540
14673
|
import omit15 from "lodash/omit";
|
14541
14674
|
|
14542
14675
|
// src/molecules/MultiInput/InputChip.tsx
|
14543
|
-
import
|
14676
|
+
import React103 from "react";
|
14544
14677
|
var import_smallCross3 = __toESM(require_smallCross());
|
14545
|
-
var InputChip =
|
14678
|
+
var InputChip = React103.forwardRef(
|
14546
14679
|
(_a, ref) => {
|
14547
14680
|
var _b = _a, { invalid = false, disabled, readOnly, className, onClick: _onClick, children } = _b, props = __objRest(_b, ["invalid", "disabled", "readOnly", "className", "onClick", "children"]);
|
14548
14681
|
const onClick = (e) => {
|
@@ -14550,18 +14683,18 @@ var InputChip = React102.forwardRef(
|
|
14550
14683
|
_onClick == null ? void 0 : _onClick(e);
|
14551
14684
|
}
|
14552
14685
|
};
|
14553
|
-
return /* @__PURE__ */
|
14686
|
+
return /* @__PURE__ */ React103.createElement("div", {
|
14554
14687
|
className: classNames(className, "inline-flex align-middle mx-1 items-stretch rounded-sm break-all", {
|
14555
14688
|
"bg-status-danger ": invalid,
|
14556
14689
|
"bg-muted ": !invalid && !disabled,
|
14557
14690
|
"bg-default": disabled
|
14558
14691
|
})
|
14559
|
-
}, /* @__PURE__ */
|
14692
|
+
}, /* @__PURE__ */ React103.createElement("div", {
|
14560
14693
|
className: tw("px-2 py-1")
|
14561
|
-
}, /* @__PURE__ */
|
14694
|
+
}, /* @__PURE__ */ React103.createElement(Typography2, {
|
14562
14695
|
variant: "small",
|
14563
14696
|
color: invalid ? "warning-default" : disabled ? "inactive" : "default"
|
14564
|
-
}, children)), !readOnly && /* @__PURE__ */
|
14697
|
+
}, children)), !readOnly && /* @__PURE__ */ React103.createElement("div", __spreadProps(__spreadValues({
|
14565
14698
|
ref
|
14566
14699
|
}, props), {
|
14567
14700
|
onClick,
|
@@ -14572,7 +14705,7 @@ var InputChip = React102.forwardRef(
|
|
14572
14705
|
}),
|
14573
14706
|
role: "button",
|
14574
14707
|
"aria-label": `Remove ${String(children)}`
|
14575
|
-
}), !disabled && /* @__PURE__ */
|
14708
|
+
}), !disabled && /* @__PURE__ */ React103.createElement(Icon, {
|
14576
14709
|
icon: import_smallCross3.default,
|
14577
14710
|
className: tw({
|
14578
14711
|
"text-danger-default": invalid,
|
@@ -14713,7 +14846,7 @@ var MultiInputBase = (_a) => {
|
|
14713
14846
|
};
|
14714
14847
|
const renderChips = () => items == null ? void 0 : items.map((item, index) => {
|
14715
14848
|
var _a3;
|
14716
|
-
return /* @__PURE__ */
|
14849
|
+
return /* @__PURE__ */ React104.createElement(InputChip, {
|
14717
14850
|
key: `${itemToString(item)}.${index}`,
|
14718
14851
|
invalid: !((_a3 = isItemValid == null ? void 0 : isItemValid(item, index)) != null ? _a3 : true),
|
14719
14852
|
readOnly,
|
@@ -14724,13 +14857,13 @@ var MultiInputBase = (_a) => {
|
|
14724
14857
|
}
|
14725
14858
|
}, itemToString(item));
|
14726
14859
|
});
|
14727
|
-
return /* @__PURE__ */
|
14860
|
+
return /* @__PURE__ */ React104.createElement("div", {
|
14728
14861
|
className: "Aquarium-MultiInputBase"
|
14729
|
-
}, /* @__PURE__ */
|
14862
|
+
}, /* @__PURE__ */ React104.createElement(Select.InputContainer, {
|
14730
14863
|
variant: disabled ? "disabled" : !valid ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default"
|
14731
|
-
}, /* @__PURE__ */
|
14864
|
+
}, /* @__PURE__ */ React104.createElement("div", {
|
14732
14865
|
className: "grow inline-flex flex-row flex-wrap gap-y-2"
|
14733
|
-
}, inline && renderChips(), /* @__PURE__ */
|
14866
|
+
}, inline && renderChips(), /* @__PURE__ */ React104.createElement(Select.Input, __spreadProps(__spreadValues({
|
14734
14867
|
ref: inputRef,
|
14735
14868
|
id: id != null ? id : name,
|
14736
14869
|
name,
|
@@ -14748,11 +14881,11 @@ var MultiInputBase = (_a) => {
|
|
14748
14881
|
onFocus: handleFocus,
|
14749
14882
|
onBlur: handleBlur,
|
14750
14883
|
autoComplete: "off"
|
14751
|
-
}))), endAdornment && /* @__PURE__ */
|
14884
|
+
}))), endAdornment && /* @__PURE__ */ React104.createElement(InputAdornment, null, endAdornment)), !inline && /* @__PURE__ */ React104.createElement("div", {
|
14752
14885
|
className: tw("flex flex-row flex-wrap gap-y-2 mt-2")
|
14753
14886
|
}, renderChips()));
|
14754
14887
|
};
|
14755
|
-
var BaseMultiInputSkeleton = () => /* @__PURE__ */
|
14888
|
+
var BaseMultiInputSkeleton = () => /* @__PURE__ */ React104.createElement(Skeleton, {
|
14756
14889
|
height: 38
|
14757
14890
|
});
|
14758
14891
|
MultiInputBase.Skeleton = BaseMultiInputSkeleton;
|
@@ -14764,13 +14897,13 @@ var MultiInput = (props) => {
|
|
14764
14897
|
var _a2;
|
14765
14898
|
setValue((_a2 = props.value) != null ? _a2 : []);
|
14766
14899
|
}, [JSON.stringify(props.value)]);
|
14767
|
-
const defaultId =
|
14900
|
+
const defaultId = useId13();
|
14768
14901
|
const id = (_e = (_d = props.id) != null ? _d : props.name) != null ? _e : defaultId;
|
14769
|
-
const errorMessageId =
|
14902
|
+
const errorMessageId = useId13();
|
14770
14903
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
14771
14904
|
const labelControlProps = getLabelControlProps(props);
|
14772
14905
|
const baseProps = omit15(props, Object.keys(labelControlProps));
|
14773
|
-
return /* @__PURE__ */
|
14906
|
+
return /* @__PURE__ */ React104.createElement(LabelControl, __spreadProps(__spreadValues({
|
14774
14907
|
id: `${id}-label`,
|
14775
14908
|
htmlFor: `${id}-input`,
|
14776
14909
|
messageId: errorMessageId
|
@@ -14778,7 +14911,7 @@ var MultiInput = (props) => {
|
|
14778
14911
|
length: value.length,
|
14779
14912
|
maxLength,
|
14780
14913
|
className: "Aquarium-MultiInput"
|
14781
|
-
}), /* @__PURE__ */
|
14914
|
+
}), /* @__PURE__ */ React104.createElement(MultiInputBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
|
14782
14915
|
id: `${id}-input`,
|
14783
14916
|
onChange: (value2) => {
|
14784
14917
|
var _a2;
|
@@ -14790,14 +14923,14 @@ var MultiInput = (props) => {
|
|
14790
14923
|
valid: props.valid
|
14791
14924
|
})));
|
14792
14925
|
};
|
14793
|
-
var MultiInputSkeleton = () => /* @__PURE__ */
|
14926
|
+
var MultiInputSkeleton = () => /* @__PURE__ */ React104.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React104.createElement(MultiInputBase.Skeleton, null));
|
14794
14927
|
MultiInput.Skeleton = MultiInputSkeleton;
|
14795
14928
|
MultiInput.Skeleton.displayName = "MultiInput.Skeleton";
|
14796
14929
|
|
14797
14930
|
// src/molecules/MultiSelect/MultiSelect.tsx
|
14798
|
-
import
|
14931
|
+
import React105, { useEffect as useEffect10, useRef as useRef13, useState as useState13 } from "react";
|
14799
14932
|
import { ariaHideOutside as ariaHideOutside2 } from "@react-aria/overlays";
|
14800
|
-
import { useId as
|
14933
|
+
import { useId as useId14 } from "@react-aria/utils";
|
14801
14934
|
import { useCombobox as useCombobox2, useMultipleSelection } from "downshift";
|
14802
14935
|
import isArray4 from "lodash/isArray";
|
14803
14936
|
import isEqual from "lodash/isEqual";
|
@@ -14956,16 +15089,16 @@ var MultiSelectBase = (_a) => {
|
|
14956
15089
|
return ariaHideOutside2([inputRef.current, popoverRef.current]);
|
14957
15090
|
}
|
14958
15091
|
}, [state.isOpen, inputRef, popoverRef]);
|
14959
|
-
const renderItem = (item, index) => /* @__PURE__ */
|
15092
|
+
const renderItem = (item, index) => /* @__PURE__ */ React105.createElement(Select.Item, __spreadValues({
|
14960
15093
|
key: itemToString(item),
|
14961
15094
|
highlighted: index === highlightedIndex,
|
14962
15095
|
selected: selectedItems.includes(item)
|
14963
15096
|
}, getItemProps({ item, index })), renderOption(item));
|
14964
|
-
const renderGroup = (group) => group.options.length ? /* @__PURE__ */
|
15097
|
+
const renderGroup = (group) => group.options.length ? /* @__PURE__ */ React105.createElement(React105.Fragment, {
|
14965
15098
|
key: group.label
|
14966
|
-
}, /* @__PURE__ */
|
15099
|
+
}, /* @__PURE__ */ React105.createElement(Select.Group, null, group.label), group.options.map((opt) => renderItem(opt, flattenedOptions.indexOf(opt)))) : null;
|
14967
15100
|
const renderChips = () => {
|
14968
|
-
return selectedItems.map((selectedItem, index) => /* @__PURE__ */
|
15101
|
+
return selectedItems.map((selectedItem, index) => /* @__PURE__ */ React105.createElement(InputChip, __spreadProps(__spreadValues({
|
14969
15102
|
key: `${itemToString(selectedItem)}.chip`,
|
14970
15103
|
className: tw("mx-0"),
|
14971
15104
|
disabled,
|
@@ -14983,14 +15116,14 @@ var MultiSelectBase = (_a) => {
|
|
14983
15116
|
getDropdownProps({ ref: inputRef, disabled: disabled || readOnly, value: inputValue })
|
14984
15117
|
);
|
14985
15118
|
const menuProps = getMenuProps({ ref: menuRef }, { suppressRefError: !isOpen });
|
14986
|
-
return /* @__PURE__ */
|
15119
|
+
return /* @__PURE__ */ React105.createElement("div", {
|
14987
15120
|
className: classNames("Aquarium-MultiSelectBase", tw("relative"))
|
14988
|
-
}, /* @__PURE__ */
|
15121
|
+
}, /* @__PURE__ */ React105.createElement(Select.InputContainer, {
|
14989
15122
|
ref: targetRef,
|
14990
15123
|
variant: disabled ? "disabled" : !valid ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default"
|
14991
|
-
}, /* @__PURE__ */
|
15124
|
+
}, /* @__PURE__ */ React105.createElement("div", {
|
14992
15125
|
className: "grow inline-flex flex-row flex-wrap gap-2"
|
14993
|
-
}, !hideChips && inline && renderChips(), /* @__PURE__ */
|
15126
|
+
}, !hideChips && inline && renderChips(), /* @__PURE__ */ React105.createElement(Select.Input, __spreadProps(__spreadValues(__spreadValues({
|
14994
15127
|
name,
|
14995
15128
|
placeholder: selectedItems.length === 0 && !readOnly ? placeholder : ""
|
14996
15129
|
}, inputProps), props), {
|
@@ -15009,12 +15142,12 @@ var MultiSelectBase = (_a) => {
|
|
15009
15142
|
setFocus(false);
|
15010
15143
|
(_a3 = inputProps.onBlur) == null ? void 0 : _a3.call(inputProps, e);
|
15011
15144
|
}
|
15012
|
-
}))), !readOnly && /* @__PURE__ */
|
15145
|
+
}))), !readOnly && /* @__PURE__ */ React105.createElement(Select.Toggle, __spreadValues({
|
15013
15146
|
hasFocus,
|
15014
15147
|
isOpen
|
15015
|
-
}, getToggleButtonProps({ disabled })))), !hideChips && !inline && /* @__PURE__ */
|
15148
|
+
}, getToggleButtonProps({ disabled })))), !hideChips && !inline && /* @__PURE__ */ React105.createElement("div", {
|
15016
15149
|
className: tw("flex flex-row flex-wrap gap-2 mt-2")
|
15017
|
-
}, renderChips()), isOpen && /* @__PURE__ */
|
15150
|
+
}, renderChips()), isOpen && /* @__PURE__ */ React105.createElement(PopoverOverlay, {
|
15018
15151
|
ref: popoverRef,
|
15019
15152
|
triggerRef: targetRef,
|
15020
15153
|
state,
|
@@ -15022,13 +15155,13 @@ var MultiSelectBase = (_a) => {
|
|
15022
15155
|
shouldFlip: true,
|
15023
15156
|
isNonModal: true,
|
15024
15157
|
style: { width: (_a2 = targetRef.current) == null ? void 0 : _a2.offsetWidth }
|
15025
|
-
}, /* @__PURE__ */
|
15158
|
+
}, /* @__PURE__ */ React105.createElement(Select.Menu, __spreadValues({
|
15026
15159
|
maxHeight
|
15027
|
-
}, menuProps), hasNoResults && /* @__PURE__ */
|
15160
|
+
}, menuProps), hasNoResults && /* @__PURE__ */ React105.createElement(Select.NoResults, null, emptyState), filteredOptions.map(
|
15028
15161
|
(option, index) => isOptionGroup(option) ? renderGroup(option) : renderItem(option, index)
|
15029
15162
|
))));
|
15030
15163
|
};
|
15031
|
-
var MultiSelectBaseSkeleton = () => /* @__PURE__ */
|
15164
|
+
var MultiSelectBaseSkeleton = () => /* @__PURE__ */ React105.createElement(Skeleton, {
|
15032
15165
|
height: 38
|
15033
15166
|
});
|
15034
15167
|
MultiSelectBase.Skeleton = MultiSelectBaseSkeleton;
|
@@ -15043,19 +15176,19 @@ var MultiSelect = (_a) => {
|
|
15043
15176
|
"emptyState"
|
15044
15177
|
]);
|
15045
15178
|
var _a2;
|
15046
|
-
const defaultId =
|
15179
|
+
const defaultId = useId14();
|
15047
15180
|
const id = (_a2 = props.id) != null ? _a2 : defaultId;
|
15048
|
-
const errorMessageId =
|
15181
|
+
const errorMessageId = useId14();
|
15049
15182
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
15050
15183
|
const labelControlProps = getLabelControlProps(props);
|
15051
15184
|
const baseProps = omit16(props, Object.keys(labelControlProps));
|
15052
|
-
return /* @__PURE__ */
|
15185
|
+
return /* @__PURE__ */ React105.createElement(LabelControl, __spreadProps(__spreadValues({
|
15053
15186
|
id: `${id}-label`,
|
15054
15187
|
htmlFor: `${id}-input`,
|
15055
15188
|
messageId: errorMessageId
|
15056
15189
|
}, labelControlProps), {
|
15057
15190
|
className: "Aquarium-MultiSelect"
|
15058
|
-
}), /* @__PURE__ */
|
15191
|
+
}), /* @__PURE__ */ React105.createElement(MultiSelectBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
|
15059
15192
|
id,
|
15060
15193
|
options,
|
15061
15194
|
emptyState,
|
@@ -15063,17 +15196,17 @@ var MultiSelect = (_a) => {
|
|
15063
15196
|
valid: props.valid
|
15064
15197
|
})));
|
15065
15198
|
};
|
15066
|
-
var MultiSelectSkeleton = () => /* @__PURE__ */
|
15199
|
+
var MultiSelectSkeleton = () => /* @__PURE__ */ React105.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React105.createElement(MultiSelectBase.Skeleton, null));
|
15067
15200
|
MultiSelect.Skeleton = MultiSelectSkeleton;
|
15068
15201
|
MultiSelect.Skeleton.displayName = "MultiSelect.Skeleton";
|
15069
15202
|
|
15070
15203
|
// src/molecules/NativeSelect/NativeSelect.tsx
|
15071
|
-
import
|
15072
|
-
import { useId as
|
15204
|
+
import React106 from "react";
|
15205
|
+
import { useId as useId15 } from "@react-aria/utils";
|
15073
15206
|
import omit17 from "lodash/omit";
|
15074
15207
|
import uniqueId from "lodash/uniqueId";
|
15075
15208
|
var import_caretDown2 = __toESM(require_caretDown());
|
15076
|
-
var NativeSelectBase =
|
15209
|
+
var NativeSelectBase = React106.forwardRef(
|
15077
15210
|
(_a, ref) => {
|
15078
15211
|
var _b = _a, { children, disabled = false, required = false, valid = true, readOnly = false } = _b, props = __objRest(_b, ["children", "disabled", "required", "valid", "readOnly"]);
|
15079
15212
|
const placeholderValue = uniqueId("default_value_for_placeholder");
|
@@ -15090,16 +15223,16 @@ var NativeSelectBase = React105.forwardRef(
|
|
15090
15223
|
(_b2 = props.onBlur) == null ? void 0 : _b2.call(props, event);
|
15091
15224
|
}
|
15092
15225
|
};
|
15093
|
-
return /* @__PURE__ */
|
15226
|
+
return /* @__PURE__ */ React106.createElement("span", {
|
15094
15227
|
className: classNames("Aquarium-NativeSelectBase", tw("relative block"))
|
15095
|
-
}, !readOnly && /* @__PURE__ */
|
15228
|
+
}, !readOnly && /* @__PURE__ */ React106.createElement("span", {
|
15096
15229
|
className: tw(
|
15097
15230
|
"absolute right-0 inset-y-0 mr-4 text-inactive flex ml-3 pointer-events-none typography-default-strong mt-4"
|
15098
15231
|
)
|
15099
|
-
}, /* @__PURE__ */
|
15232
|
+
}, /* @__PURE__ */ React106.createElement(Icon, {
|
15100
15233
|
icon: import_caretDown2.default,
|
15101
15234
|
"data-testid": "icon-dropdown"
|
15102
|
-
})), /* @__PURE__ */
|
15235
|
+
})), /* @__PURE__ */ React106.createElement("select", __spreadProps(__spreadValues({
|
15103
15236
|
ref,
|
15104
15237
|
disabled: disabled || readOnly,
|
15105
15238
|
required
|
@@ -15118,32 +15251,32 @@ var NativeSelectBase = React105.forwardRef(
|
|
15118
15251
|
),
|
15119
15252
|
props.className
|
15120
15253
|
)
|
15121
|
-
}), props.placeholder && /* @__PURE__ */
|
15254
|
+
}), props.placeholder && /* @__PURE__ */ React106.createElement("option", {
|
15122
15255
|
value: placeholderValue,
|
15123
15256
|
disabled: true
|
15124
15257
|
}, props.placeholder), children));
|
15125
15258
|
}
|
15126
15259
|
);
|
15127
|
-
NativeSelectBase.Skeleton = () => /* @__PURE__ */
|
15260
|
+
NativeSelectBase.Skeleton = () => /* @__PURE__ */ React106.createElement(Skeleton, {
|
15128
15261
|
height: 38
|
15129
15262
|
});
|
15130
|
-
var NativeSelect =
|
15263
|
+
var NativeSelect = React106.forwardRef(
|
15131
15264
|
(_a, ref) => {
|
15132
15265
|
var _b = _a, { readOnly } = _b, props = __objRest(_b, ["readOnly"]);
|
15133
15266
|
var _a2;
|
15134
|
-
const defaultId =
|
15267
|
+
const defaultId = useId15();
|
15135
15268
|
const id = (_a2 = props.id) != null ? _a2 : defaultId;
|
15136
|
-
const errorMessageId =
|
15269
|
+
const errorMessageId = useId15();
|
15137
15270
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
15138
15271
|
const _b2 = getLabelControlProps(props), { "data-testid": dataTestId } = _b2, labelControlProps = __objRest(_b2, ["data-testid"]);
|
15139
15272
|
const baseProps = omit17(props, Object.keys(labelControlProps));
|
15140
|
-
return /* @__PURE__ */
|
15273
|
+
return /* @__PURE__ */ React106.createElement(LabelControl, __spreadProps(__spreadValues({
|
15141
15274
|
id: `${id}-label`,
|
15142
15275
|
htmlFor: id,
|
15143
15276
|
messageId: errorMessageId
|
15144
15277
|
}, labelControlProps), {
|
15145
15278
|
className: "Aquarium-NativeSelect"
|
15146
|
-
}), /* @__PURE__ */
|
15279
|
+
}), /* @__PURE__ */ React106.createElement(NativeSelectBase, __spreadProps(__spreadValues(__spreadValues({
|
15147
15280
|
ref
|
15148
15281
|
}, baseProps), errorProps), {
|
15149
15282
|
id,
|
@@ -15157,63 +15290,63 @@ var NativeSelect = React105.forwardRef(
|
|
15157
15290
|
}
|
15158
15291
|
);
|
15159
15292
|
NativeSelect.displayName = "NativeSelect";
|
15160
|
-
var Option =
|
15293
|
+
var Option = React106.forwardRef((_a, ref) => {
|
15161
15294
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
15162
|
-
return /* @__PURE__ */
|
15295
|
+
return /* @__PURE__ */ React106.createElement("option", __spreadValues({
|
15163
15296
|
ref
|
15164
15297
|
}, props), children);
|
15165
15298
|
});
|
15166
15299
|
Option.displayName = "Option";
|
15167
|
-
var NativeSelectSkeleton = () => /* @__PURE__ */
|
15300
|
+
var NativeSelectSkeleton = () => /* @__PURE__ */ React106.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React106.createElement(NativeSelectBase.Skeleton, null), /* @__PURE__ */ React106.createElement("div", {
|
15168
15301
|
style: { height: "1px" }
|
15169
15302
|
}));
|
15170
15303
|
NativeSelect.Skeleton = NativeSelectSkeleton;
|
15171
15304
|
NativeSelect.Skeleton.displayName = "NativeSelect.Skeleton";
|
15172
15305
|
|
15173
15306
|
// src/molecules/Navigation/Navigation.tsx
|
15174
|
-
import
|
15307
|
+
import React108 from "react";
|
15175
15308
|
import classNames12 from "classnames";
|
15176
15309
|
|
15177
15310
|
// src/atoms/Navigation/Navigation.tsx
|
15178
|
-
import
|
15311
|
+
import React107 from "react";
|
15179
15312
|
var Navigation = (_a) => {
|
15180
15313
|
var _b = _a, { className, children } = _b, rest = __objRest(_b, ["className", "children"]);
|
15181
|
-
return /* @__PURE__ */
|
15314
|
+
return /* @__PURE__ */ React107.createElement("nav", {
|
15182
15315
|
className: classNames(tw("bg-muted h-full"))
|
15183
|
-
}, /* @__PURE__ */
|
15316
|
+
}, /* @__PURE__ */ React107.createElement("ul", __spreadProps(__spreadValues({}, rest), {
|
15184
15317
|
className: classNames(tw("flex flex-col h-full"), className),
|
15185
15318
|
role: "menubar"
|
15186
15319
|
}), children));
|
15187
15320
|
};
|
15188
15321
|
var Header = (_a) => {
|
15189
15322
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
15190
|
-
return /* @__PURE__ */
|
15323
|
+
return /* @__PURE__ */ React107.createElement("li", __spreadProps(__spreadValues({}, rest), {
|
15191
15324
|
role: "presentation",
|
15192
15325
|
className: classNames(tw("px-6 py-5"), className)
|
15193
15326
|
}));
|
15194
15327
|
};
|
15195
15328
|
var Footer = (_a) => {
|
15196
15329
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
15197
|
-
return /* @__PURE__ */
|
15330
|
+
return /* @__PURE__ */ React107.createElement("li", __spreadProps(__spreadValues({}, rest), {
|
15198
15331
|
role: "presentation",
|
15199
15332
|
className: classNames(tw("px-6 py-5 mt-auto"), className)
|
15200
15333
|
}));
|
15201
15334
|
};
|
15202
15335
|
var Section2 = (_a) => {
|
15203
15336
|
var _b = _a, { title, className } = _b, rest = __objRest(_b, ["title", "className"]);
|
15204
|
-
return /* @__PURE__ */
|
15337
|
+
return /* @__PURE__ */ React107.createElement("li", {
|
15205
15338
|
role: "presentation",
|
15206
15339
|
className: tw("py-5")
|
15207
|
-
}, title && /* @__PURE__ */
|
15340
|
+
}, title && /* @__PURE__ */ React107.createElement("div", {
|
15208
15341
|
className: classNames(className, "py-2 px-6 text-inactive uppercase cursor-default typography-caption")
|
15209
|
-
}, title), /* @__PURE__ */
|
15342
|
+
}, title), /* @__PURE__ */ React107.createElement("ul", __spreadProps(__spreadValues({}, rest), {
|
15210
15343
|
role: "group",
|
15211
15344
|
className: classNames(tw("flex flex-col"), className)
|
15212
15345
|
})));
|
15213
15346
|
};
|
15214
15347
|
var Divider3 = (_a) => {
|
15215
15348
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
15216
|
-
return /* @__PURE__ */
|
15349
|
+
return /* @__PURE__ */ React107.createElement("li", __spreadProps(__spreadValues({
|
15217
15350
|
role: "separator"
|
15218
15351
|
}, rest), {
|
15219
15352
|
className: classNames(tw("border-t-2 border-muted"), className)
|
@@ -15221,9 +15354,9 @@ var Divider3 = (_a) => {
|
|
15221
15354
|
};
|
15222
15355
|
var Item5 = (_a) => {
|
15223
15356
|
var _b = _a, { className, active } = _b, rest = __objRest(_b, ["className", "active"]);
|
15224
|
-
return /* @__PURE__ */
|
15357
|
+
return /* @__PURE__ */ React107.createElement("li", {
|
15225
15358
|
role: "presentation"
|
15226
|
-
}, /* @__PURE__ */
|
15359
|
+
}, /* @__PURE__ */ React107.createElement("a", __spreadProps(__spreadValues({}, rest), {
|
15227
15360
|
role: "menuitem",
|
15228
15361
|
className: classNames(
|
15229
15362
|
tw("py-3 px-6 hover:bg-default cursor-pointer flex gap-4 items-center typography-small focusable", {
|
@@ -15243,7 +15376,7 @@ Navigation.Divider = Divider3;
|
|
15243
15376
|
// src/molecules/Navigation/Navigation.tsx
|
15244
15377
|
var Navigation2 = (_a) => {
|
15245
15378
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
15246
|
-
return /* @__PURE__ */
|
15379
|
+
return /* @__PURE__ */ React108.createElement(Navigation, __spreadValues({
|
15247
15380
|
className: classNames12("Aquarium-Navigation", className)
|
15248
15381
|
}, props));
|
15249
15382
|
};
|
@@ -15257,11 +15390,11 @@ var Item6 = (_a) => {
|
|
15257
15390
|
"icon",
|
15258
15391
|
"showNotification"
|
15259
15392
|
]);
|
15260
|
-
return /* @__PURE__ */
|
15393
|
+
return /* @__PURE__ */ React108.createElement(Navigation.Item, __spreadValues({}, rest), icon && showNotification && /* @__PURE__ */ React108.createElement(Badge.Notification, null, /* @__PURE__ */ React108.createElement(InlineIcon, {
|
15261
15394
|
icon,
|
15262
15395
|
width: "20px",
|
15263
15396
|
height: "20px"
|
15264
|
-
})), icon && !showNotification && /* @__PURE__ */
|
15397
|
+
})), icon && !showNotification && /* @__PURE__ */ React108.createElement(InlineIcon, {
|
15265
15398
|
icon,
|
15266
15399
|
width: "20px",
|
15267
15400
|
height: "20px"
|
@@ -15274,32 +15407,32 @@ Navigation2.Header = Navigation.Header;
|
|
15274
15407
|
Navigation2.Section = Navigation.Section;
|
15275
15408
|
|
15276
15409
|
// src/molecules/PageHeader/PageHeader.tsx
|
15277
|
-
import
|
15410
|
+
import React110 from "react";
|
15278
15411
|
import castArray6 from "lodash/castArray";
|
15279
15412
|
|
15280
15413
|
// src/atoms/PageHeader/PageHeader.tsx
|
15281
|
-
import
|
15414
|
+
import React109 from "react";
|
15282
15415
|
var PageHeader = (_a) => {
|
15283
15416
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
15284
|
-
return /* @__PURE__ */
|
15417
|
+
return /* @__PURE__ */ React109.createElement("div", __spreadValues({
|
15285
15418
|
className: classNames(tw("flex flex-row gap-4 pb-6"), className)
|
15286
15419
|
}, rest), children);
|
15287
15420
|
};
|
15288
15421
|
PageHeader.Container = (_a) => {
|
15289
15422
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
15290
|
-
return /* @__PURE__ */
|
15423
|
+
return /* @__PURE__ */ React109.createElement("div", __spreadValues({
|
15291
15424
|
className: classNames(tw("flex flex-col grow gap-0"), className)
|
15292
15425
|
}, rest), children);
|
15293
15426
|
};
|
15294
15427
|
PageHeader.TitleContainer = (_a) => {
|
15295
15428
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
15296
|
-
return /* @__PURE__ */
|
15429
|
+
return /* @__PURE__ */ React109.createElement("div", __spreadValues({
|
15297
15430
|
className: classNames(tw("flex flex-col justify-center gap-2"), className)
|
15298
15431
|
}, rest), children);
|
15299
15432
|
};
|
15300
15433
|
PageHeader.Title = (_a) => {
|
15301
15434
|
var _b = _a, { isSubHeader = false, children } = _b, rest = __objRest(_b, ["isSubHeader", "children"]);
|
15302
|
-
return /* @__PURE__ */
|
15435
|
+
return /* @__PURE__ */ React109.createElement(Typography2, __spreadProps(__spreadValues({}, rest), {
|
15303
15436
|
color: "intense",
|
15304
15437
|
variant: isSubHeader ? "subheading" : "heading",
|
15305
15438
|
htmlTag: isSubHeader ? "h2" : "h1"
|
@@ -15307,19 +15440,19 @@ PageHeader.Title = (_a) => {
|
|
15307
15440
|
};
|
15308
15441
|
PageHeader.Subtitle = (_a) => {
|
15309
15442
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
15310
|
-
return /* @__PURE__ */
|
15443
|
+
return /* @__PURE__ */ React109.createElement(Typography2.Small, __spreadProps(__spreadValues({}, rest), {
|
15311
15444
|
color: "default"
|
15312
15445
|
}), children);
|
15313
15446
|
};
|
15314
15447
|
PageHeader.Chips = (_a) => {
|
15315
15448
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
15316
|
-
return /* @__PURE__ */
|
15449
|
+
return /* @__PURE__ */ React109.createElement("div", __spreadValues({
|
15317
15450
|
className: classNames(tw("flex gap-3"), className)
|
15318
15451
|
}, rest), children);
|
15319
15452
|
};
|
15320
15453
|
PageHeader.Actions = (_a) => {
|
15321
15454
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
15322
|
-
return /* @__PURE__ */
|
15455
|
+
return /* @__PURE__ */ React109.createElement("div", __spreadValues({
|
15323
15456
|
className: classNames(tw("flex flex-row gap-4 self-start"), className)
|
15324
15457
|
}, rest), children);
|
15325
15458
|
};
|
@@ -15343,64 +15476,64 @@ var CommonPageHeader = ({
|
|
15343
15476
|
onMenuOpenChange,
|
15344
15477
|
isSubHeader = false
|
15345
15478
|
}) => {
|
15346
|
-
return /* @__PURE__ */
|
15479
|
+
return /* @__PURE__ */ React110.createElement(PageHeader, {
|
15347
15480
|
className: "Aquarium-PageHeader"
|
15348
|
-
}, /* @__PURE__ */
|
15481
|
+
}, /* @__PURE__ */ React110.createElement(PageHeader.Container, null, breadcrumbs && /* @__PURE__ */ React110.createElement(Box, {
|
15349
15482
|
marginBottom: "3"
|
15350
|
-
}, /* @__PURE__ */
|
15483
|
+
}, /* @__PURE__ */ React110.createElement(Breadcrumbs, null, breadcrumbs)), /* @__PURE__ */ React110.createElement(Spacing, {
|
15351
15484
|
row: true,
|
15352
15485
|
gap: "5"
|
15353
|
-
}, image && /* @__PURE__ */
|
15486
|
+
}, image && /* @__PURE__ */ React110.createElement("img", {
|
15354
15487
|
src: image,
|
15355
15488
|
alt: imageAlt != null ? imageAlt : "",
|
15356
15489
|
className: tw("w-[56px] h-[56px]")
|
15357
|
-
}), /* @__PURE__ */
|
15490
|
+
}), /* @__PURE__ */ React110.createElement(PageHeader.TitleContainer, null, /* @__PURE__ */ React110.createElement(PageHeader.Title, {
|
15358
15491
|
isSubHeader
|
15359
|
-
}, title), chips.length > 0 && /* @__PURE__ */
|
15492
|
+
}, title), chips.length > 0 && /* @__PURE__ */ React110.createElement(PageHeader.Chips, null, chips.map((chip) => /* @__PURE__ */ React110.createElement(Chip2, {
|
15360
15493
|
key: chip,
|
15361
15494
|
dense: true,
|
15362
15495
|
text: chip
|
15363
|
-
}))), subtitle && /* @__PURE__ */
|
15496
|
+
}))), subtitle && /* @__PURE__ */ React110.createElement(PageHeader.Subtitle, null, subtitle)))), (secondaryActions || primaryAction || secondaryAction || menu) && /* @__PURE__ */ React110.createElement(PageHeader.Actions, null, menu && /* @__PURE__ */ React110.createElement(Box.Flex, {
|
15364
15497
|
alignItems: "center"
|
15365
|
-
}, /* @__PURE__ */
|
15498
|
+
}, /* @__PURE__ */ React110.createElement(DropdownMenu2, {
|
15366
15499
|
placement: defaultContextualMenuPlacement,
|
15367
15500
|
onAction: (action) => onAction == null ? void 0 : onAction(action),
|
15368
15501
|
onOpenChange: onMenuOpenChange
|
15369
|
-
}, /* @__PURE__ */
|
15502
|
+
}, /* @__PURE__ */ React110.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ React110.createElement(Button.Icon, {
|
15370
15503
|
"aria-label": menuAriaLabel,
|
15371
15504
|
icon: import_more5.default
|
15372
15505
|
})), menu)), secondaryActions && castArray6(secondaryActions).filter(Boolean).map((secondaryAction2) => renderAction({ kind: "secondary", action: secondaryAction2 })), primaryAction && renderAction({ kind: "primary", action: primaryAction })));
|
15373
15506
|
};
|
15374
|
-
var PageHeader2 = (props) => /* @__PURE__ */
|
15507
|
+
var PageHeader2 = (props) => /* @__PURE__ */ React110.createElement(CommonPageHeader, __spreadValues({}, props));
|
15375
15508
|
PageHeader2.displayName = "PageHeader";
|
15376
|
-
var SubHeader = (props) => /* @__PURE__ */
|
15509
|
+
var SubHeader = (props) => /* @__PURE__ */ React110.createElement(CommonPageHeader, __spreadProps(__spreadValues({}, props), {
|
15377
15510
|
isSubHeader: true
|
15378
15511
|
}));
|
15379
15512
|
PageHeader2.SubHeader = SubHeader;
|
15380
15513
|
PageHeader2.SubHeader.displayName = "PageHeader.SubHeader";
|
15381
15514
|
|
15382
15515
|
// src/molecules/PopoverDialog/PopoverDialog.tsx
|
15383
|
-
import
|
15516
|
+
import React112 from "react";
|
15384
15517
|
import omit18 from "lodash/omit";
|
15385
15518
|
|
15386
15519
|
// src/atoms/PopoverDialog/PopoverDialog.tsx
|
15387
|
-
import
|
15520
|
+
import React111 from "react";
|
15388
15521
|
var Header2 = (_a) => {
|
15389
15522
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
15390
|
-
return /* @__PURE__ */
|
15523
|
+
return /* @__PURE__ */ React111.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
15391
15524
|
className: classNames(tw("p-5 gap-3 flex items-center"), className)
|
15392
15525
|
}), children);
|
15393
15526
|
};
|
15394
15527
|
var Title2 = (_a) => {
|
15395
15528
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
15396
|
-
return /* @__PURE__ */
|
15529
|
+
return /* @__PURE__ */ React111.createElement(Typography, __spreadProps(__spreadValues({}, rest), {
|
15397
15530
|
htmlTag: "h1",
|
15398
15531
|
variant: "small-strong"
|
15399
15532
|
}), children);
|
15400
15533
|
};
|
15401
15534
|
var Body = (_a) => {
|
15402
15535
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
15403
|
-
return /* @__PURE__ */
|
15536
|
+
return /* @__PURE__ */ React111.createElement(Typography, __spreadProps(__spreadValues({}, rest), {
|
15404
15537
|
htmlTag: "div",
|
15405
15538
|
variant: "caption",
|
15406
15539
|
className: classNames(tw("px-5 overflow-y-auto"), className)
|
@@ -15408,13 +15541,13 @@ var Body = (_a) => {
|
|
15408
15541
|
};
|
15409
15542
|
var Footer2 = (_a) => {
|
15410
15543
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
15411
|
-
return /* @__PURE__ */
|
15544
|
+
return /* @__PURE__ */ React111.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
15412
15545
|
className: classNames(tw("p-5"), className)
|
15413
15546
|
}), children);
|
15414
15547
|
};
|
15415
15548
|
var Actions2 = (_a) => {
|
15416
15549
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
15417
|
-
return /* @__PURE__ */
|
15550
|
+
return /* @__PURE__ */ React111.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
15418
15551
|
className: classNames(tw("flex gap-4"), className)
|
15419
15552
|
}), children);
|
15420
15553
|
};
|
@@ -15430,13 +15563,13 @@ var PopoverDialog = {
|
|
15430
15563
|
var PopoverDialog2 = ({ placement, open, title, secondaryAction, primaryAction, children }) => {
|
15431
15564
|
const wrapPromptWithBody = (child) => {
|
15432
15565
|
if (isComponentType(child, PopoverDialog2.Prompt)) {
|
15433
|
-
return /* @__PURE__ */
|
15566
|
+
return /* @__PURE__ */ React112.createElement(Popover3.Panel, {
|
15434
15567
|
className: classNames("Aquarium-PopoverDialog", tw("max-w-[300px]"))
|
15435
|
-
}, /* @__PURE__ */
|
15568
|
+
}, /* @__PURE__ */ React112.createElement(PopoverDialog.Header, null, /* @__PURE__ */ React112.createElement(PopoverDialog.Title, null, title)), child, /* @__PURE__ */ React112.createElement(PopoverDialog.Footer, null, /* @__PURE__ */ React112.createElement(PopoverDialog.Actions, null, secondaryAction && /* @__PURE__ */ React112.createElement(Popover3.Button, __spreadValues({
|
15436
15569
|
kind: "secondary-ghost",
|
15437
15570
|
key: secondaryAction.text,
|
15438
15571
|
dense: true
|
15439
|
-
}, omit18(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */
|
15572
|
+
}, omit18(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */ React112.createElement(Popover3.Button, __spreadValues({
|
15440
15573
|
kind: "ghost",
|
15441
15574
|
key: primaryAction.text,
|
15442
15575
|
dense: true
|
@@ -15444,15 +15577,15 @@ var PopoverDialog2 = ({ placement, open, title, secondaryAction, primaryAction,
|
|
15444
15577
|
}
|
15445
15578
|
return child;
|
15446
15579
|
};
|
15447
|
-
return /* @__PURE__ */
|
15580
|
+
return /* @__PURE__ */ React112.createElement(Popover3, {
|
15448
15581
|
type: "dialog",
|
15449
15582
|
isOpen: open,
|
15450
15583
|
placement,
|
15451
15584
|
containFocus: true
|
15452
|
-
},
|
15585
|
+
}, React112.Children.map(children, wrapPromptWithBody));
|
15453
15586
|
};
|
15454
15587
|
PopoverDialog2.Trigger = Popover3.Trigger;
|
15455
|
-
var Prompt = ({ children }) => /* @__PURE__ */
|
15588
|
+
var Prompt = ({ children }) => /* @__PURE__ */ React112.createElement(PopoverDialog.Body, null, children);
|
15456
15589
|
Prompt.displayName = "PopoverDialog.Prompt";
|
15457
15590
|
PopoverDialog2.Prompt = Prompt;
|
15458
15591
|
|
@@ -15461,14 +15594,14 @@ import { createPortal } from "react-dom";
|
|
15461
15594
|
var Portal = ({ children, to }) => createPortal(children, to);
|
15462
15595
|
|
15463
15596
|
// src/molecules/ProgressBar/ProgressBar.tsx
|
15464
|
-
import
|
15597
|
+
import React114 from "react";
|
15465
15598
|
|
15466
15599
|
// src/atoms/ProgressBar/ProgressBar.tsx
|
15467
|
-
import
|
15600
|
+
import React113 from "react";
|
15468
15601
|
import clamp3 from "lodash/clamp";
|
15469
15602
|
var ProgressBar = (_a) => {
|
15470
15603
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
15471
|
-
return /* @__PURE__ */
|
15604
|
+
return /* @__PURE__ */ React113.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
15472
15605
|
className: classNames(tw("relative flex items-center w-full bg-muted h-2 rounded-full overflow-hidden"), className)
|
15473
15606
|
}), children);
|
15474
15607
|
};
|
@@ -15481,7 +15614,7 @@ var STATUS_COLORS = {
|
|
15481
15614
|
ProgressBar.Indicator = (_a) => {
|
15482
15615
|
var _b = _a, { min, max, value, "aria-label": ariaLabel, status, className } = _b, rest = __objRest(_b, ["min", "max", "value", "aria-label", "status", "className"]);
|
15483
15616
|
const completedPercentage = clamp3((value - min) / (max - min) * 100, 0, 100);
|
15484
|
-
return /* @__PURE__ */
|
15617
|
+
return /* @__PURE__ */ React113.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
15485
15618
|
className: classNames(
|
15486
15619
|
tw("h-2 rounded-full transition-all ease-in-out delay-150"),
|
15487
15620
|
STATUS_COLORS[status],
|
@@ -15497,11 +15630,11 @@ ProgressBar.Indicator = (_a) => {
|
|
15497
15630
|
};
|
15498
15631
|
ProgressBar.Labels = (_a) => {
|
15499
15632
|
var _b = _a, { children, startLabel, endLabel, className } = _b, rest = __objRest(_b, ["children", "startLabel", "endLabel", "className"]);
|
15500
|
-
return /* @__PURE__ */
|
15633
|
+
return /* @__PURE__ */ React113.createElement("div", {
|
15501
15634
|
className: classNames(tw("flex flex-row"), className)
|
15502
|
-
}, /* @__PURE__ */
|
15635
|
+
}, /* @__PURE__ */ React113.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
15503
15636
|
className: tw("grow text-default typography-caption")
|
15504
|
-
}), startLabel), /* @__PURE__ */
|
15637
|
+
}), startLabel), /* @__PURE__ */ React113.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
15505
15638
|
className: tw("grow text-default typography-caption text-right")
|
15506
15639
|
}), endLabel));
|
15507
15640
|
};
|
@@ -15519,7 +15652,7 @@ var ProgressBar2 = (props) => {
|
|
15519
15652
|
if (min > max) {
|
15520
15653
|
throw new Error("`min` value provided to `ProgressBar` is greater than `max` value.");
|
15521
15654
|
}
|
15522
|
-
const progress = /* @__PURE__ */
|
15655
|
+
const progress = /* @__PURE__ */ React114.createElement(ProgressBar, null, /* @__PURE__ */ React114.createElement(ProgressBar.Indicator, {
|
15523
15656
|
status: value === max ? completedStatus : progresStatus,
|
15524
15657
|
min,
|
15525
15658
|
max,
|
@@ -15529,15 +15662,15 @@ var ProgressBar2 = (props) => {
|
|
15529
15662
|
if (props.dense) {
|
15530
15663
|
return progress;
|
15531
15664
|
}
|
15532
|
-
return /* @__PURE__ */
|
15665
|
+
return /* @__PURE__ */ React114.createElement("div", {
|
15533
15666
|
className: "Aquarium-ProgressBar"
|
15534
|
-
}, progress, /* @__PURE__ */
|
15667
|
+
}, progress, /* @__PURE__ */ React114.createElement(ProgressBar.Labels, {
|
15535
15668
|
className: tw("py-2"),
|
15536
15669
|
startLabel: props.startLabel,
|
15537
15670
|
endLabel: props.endLabel
|
15538
15671
|
}));
|
15539
15672
|
};
|
15540
|
-
var ProgressBarSkeleton = () => /* @__PURE__ */
|
15673
|
+
var ProgressBarSkeleton = () => /* @__PURE__ */ React114.createElement(Skeleton, {
|
15541
15674
|
height: 4,
|
15542
15675
|
display: "block"
|
15543
15676
|
});
|
@@ -15545,13 +15678,13 @@ ProgressBar2.Skeleton = ProgressBarSkeleton;
|
|
15545
15678
|
ProgressBar2.Skeleton.displayName = "ProgressBar.Skeleton";
|
15546
15679
|
|
15547
15680
|
// src/molecules/RadioButton/RadioButton.tsx
|
15548
|
-
import
|
15549
|
-
var RadioButton2 =
|
15681
|
+
import React115 from "react";
|
15682
|
+
var RadioButton2 = React115.forwardRef(
|
15550
15683
|
(_a, ref) => {
|
15551
15684
|
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"]);
|
15552
15685
|
var _a2;
|
15553
15686
|
const isChecked = (_a2 = props.checked) != null ? _a2 : props.defaultChecked;
|
15554
|
-
return !readOnly || isChecked ? /* @__PURE__ */
|
15687
|
+
return !readOnly || isChecked ? /* @__PURE__ */ React115.createElement(ControlLabel, {
|
15555
15688
|
htmlFor: id,
|
15556
15689
|
label: children,
|
15557
15690
|
"aria-label": ariaLabel,
|
@@ -15560,7 +15693,7 @@ var RadioButton2 = React114.forwardRef(
|
|
15560
15693
|
disabled,
|
15561
15694
|
style: { gap: "0 8px" },
|
15562
15695
|
className: "Aquarium-RadioButton"
|
15563
|
-
}, !readOnly && /* @__PURE__ */
|
15696
|
+
}, !readOnly && /* @__PURE__ */ React115.createElement(RadioButton, __spreadProps(__spreadValues({
|
15564
15697
|
id,
|
15565
15698
|
ref,
|
15566
15699
|
name
|
@@ -15571,12 +15704,12 @@ var RadioButton2 = React114.forwardRef(
|
|
15571
15704
|
}
|
15572
15705
|
);
|
15573
15706
|
RadioButton2.displayName = "RadioButton";
|
15574
|
-
var RadioButtonSkeleton = () => /* @__PURE__ */
|
15707
|
+
var RadioButtonSkeleton = () => /* @__PURE__ */ React115.createElement("div", {
|
15575
15708
|
className: tw("flex gap-3")
|
15576
|
-
}, /* @__PURE__ */
|
15709
|
+
}, /* @__PURE__ */ React115.createElement(Skeleton, {
|
15577
15710
|
height: 20,
|
15578
15711
|
width: 20
|
15579
|
-
}), /* @__PURE__ */
|
15712
|
+
}), /* @__PURE__ */ React115.createElement(Skeleton, {
|
15580
15713
|
height: 20,
|
15581
15714
|
width: 150
|
15582
15715
|
}));
|
@@ -15584,10 +15717,10 @@ RadioButton2.Skeleton = RadioButtonSkeleton;
|
|
15584
15717
|
RadioButton2.Skeleton.displayName = "RadioButton.Skeleton";
|
15585
15718
|
|
15586
15719
|
// src/molecules/RadioButtonGroup/RadioButtonGroup.tsx
|
15587
|
-
import
|
15588
|
-
import { useId as
|
15720
|
+
import React116 from "react";
|
15721
|
+
import { useId as useId16 } from "@react-aria/utils";
|
15589
15722
|
var isRadioButton = (c) => {
|
15590
|
-
return
|
15723
|
+
return React116.isValidElement(c) && c.type === RadioButton2;
|
15591
15724
|
};
|
15592
15725
|
var RadioButtonGroup = (_a) => {
|
15593
15726
|
var _b = _a, {
|
@@ -15610,8 +15743,8 @@ var RadioButtonGroup = (_a) => {
|
|
15610
15743
|
"children"
|
15611
15744
|
]);
|
15612
15745
|
var _a2;
|
15613
|
-
const [value, setValue] =
|
15614
|
-
const errorMessageId =
|
15746
|
+
const [value, setValue] = React116.useState((_a2 = _value != null ? _value : defaultValue) != null ? _a2 : "");
|
15747
|
+
const errorMessageId = useId16();
|
15615
15748
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
15616
15749
|
const labelControlProps = getLabelControlProps(props);
|
15617
15750
|
if (_value !== void 0 && _value !== value) {
|
@@ -15621,14 +15754,14 @@ var RadioButtonGroup = (_a) => {
|
|
15621
15754
|
setValue(e.target.value);
|
15622
15755
|
onChange == null ? void 0 : onChange(e.target.value);
|
15623
15756
|
};
|
15624
|
-
const content =
|
15757
|
+
const content = React116.Children.map(children, (c) => {
|
15625
15758
|
var _a3, _b2, _c;
|
15626
15759
|
if (!isRadioButton(c)) {
|
15627
15760
|
return null;
|
15628
15761
|
}
|
15629
15762
|
const defaultChecked = defaultValue === void 0 ? void 0 : c.props.value === defaultValue;
|
15630
15763
|
const checked = value === void 0 ? void 0 : c.props.value === value;
|
15631
|
-
return
|
15764
|
+
return React116.cloneElement(c, {
|
15632
15765
|
name,
|
15633
15766
|
defaultChecked: (_a3 = c.props.defaultChecked) != null ? _a3 : defaultChecked,
|
15634
15767
|
checked: (_b2 = c.props.checked) != null ? _b2 : checked,
|
@@ -15637,13 +15770,13 @@ var RadioButtonGroup = (_a) => {
|
|
15637
15770
|
readOnly
|
15638
15771
|
});
|
15639
15772
|
});
|
15640
|
-
return /* @__PURE__ */
|
15773
|
+
return /* @__PURE__ */ React116.createElement(LabelControl, __spreadProps(__spreadValues(__spreadValues({
|
15641
15774
|
fieldset: true
|
15642
15775
|
}, labelControlProps), errorProps), {
|
15643
15776
|
className: "Aquarium-RadioButtonGroup"
|
15644
|
-
}), cols && /* @__PURE__ */
|
15777
|
+
}), cols && /* @__PURE__ */ React116.createElement(InputGroup, {
|
15645
15778
|
cols
|
15646
|
-
}, content), !cols && /* @__PURE__ */
|
15779
|
+
}, content), !cols && /* @__PURE__ */ React116.createElement(Flexbox, {
|
15647
15780
|
direction,
|
15648
15781
|
alignItems: "flex-start",
|
15649
15782
|
colGap: "8",
|
@@ -15652,12 +15785,12 @@ var RadioButtonGroup = (_a) => {
|
|
15652
15785
|
}, content));
|
15653
15786
|
};
|
15654
15787
|
var RadioButtonGroupSkeleton = ({ direction = "row", options = 2 }) => {
|
15655
|
-
return /* @__PURE__ */
|
15788
|
+
return /* @__PURE__ */ React116.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React116.createElement("div", {
|
15656
15789
|
className: tw("flex flex-wrap", {
|
15657
15790
|
"flex-row gap-8": direction === "row",
|
15658
15791
|
"flex-col gap-2": direction === "column"
|
15659
15792
|
})
|
15660
|
-
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */
|
15793
|
+
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */ React116.createElement(RadioButton2.Skeleton, {
|
15661
15794
|
key
|
15662
15795
|
}))));
|
15663
15796
|
};
|
@@ -15665,25 +15798,25 @@ RadioButtonGroup.Skeleton = RadioButtonGroupSkeleton;
|
|
15665
15798
|
RadioButtonGroup.Skeleton.displayName = "RadioButtonGroup.Skeleton";
|
15666
15799
|
|
15667
15800
|
// src/molecules/Section/Section.tsx
|
15668
|
-
import
|
15801
|
+
import React121, { useRef as useRef14 } from "react";
|
15669
15802
|
import { useButton as useButton4 } from "@react-aria/button";
|
15670
|
-
import { useId as
|
15803
|
+
import { useId as useId17 } from "@react-aria/utils";
|
15671
15804
|
import { animated as animated6, useSpring as useSpring5 } from "@react-spring/web";
|
15672
15805
|
import castArray7 from "lodash/castArray";
|
15673
15806
|
import isUndefined9 from "lodash/isUndefined";
|
15674
15807
|
|
15675
15808
|
// src/molecules/Switch/Switch.tsx
|
15676
|
-
import
|
15809
|
+
import React118 from "react";
|
15677
15810
|
|
15678
15811
|
// src/atoms/Switch/Switch.tsx
|
15679
|
-
import
|
15812
|
+
import React117 from "react";
|
15680
15813
|
var import_ban2 = __toESM(require_ban());
|
15681
|
-
var Switch =
|
15814
|
+
var Switch = React117.forwardRef(
|
15682
15815
|
(_a, ref) => {
|
15683
15816
|
var _b = _a, { id, children, name, disabled = false, readOnly = false } = _b, props = __objRest(_b, ["id", "children", "name", "disabled", "readOnly"]);
|
15684
|
-
return /* @__PURE__ */
|
15817
|
+
return /* @__PURE__ */ React117.createElement("span", {
|
15685
15818
|
className: tw("relative inline-flex justify-center items-center self-center group")
|
15686
|
-
}, /* @__PURE__ */
|
15819
|
+
}, /* @__PURE__ */ React117.createElement("input", __spreadProps(__spreadValues({
|
15687
15820
|
id,
|
15688
15821
|
ref,
|
15689
15822
|
type: "checkbox",
|
@@ -15702,7 +15835,7 @@ var Switch = React116.forwardRef(
|
|
15702
15835
|
),
|
15703
15836
|
readOnly,
|
15704
15837
|
disabled
|
15705
|
-
})), /* @__PURE__ */
|
15838
|
+
})), /* @__PURE__ */ React117.createElement("span", {
|
15706
15839
|
className: tw(
|
15707
15840
|
"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",
|
15708
15841
|
"bg-white left-2 peer-checked/switch:left-1 text-inactive peer-checked/switch:text-primary-muted",
|
@@ -15710,7 +15843,7 @@ var Switch = React116.forwardRef(
|
|
15710
15843
|
"shadow-4dp": !disabled
|
15711
15844
|
}
|
15712
15845
|
)
|
15713
|
-
}, disabled && /* @__PURE__ */
|
15846
|
+
}, disabled && /* @__PURE__ */ React117.createElement(Icon, {
|
15714
15847
|
icon: import_ban2.default,
|
15715
15848
|
width: "10px",
|
15716
15849
|
height: "10px"
|
@@ -15719,7 +15852,7 @@ var Switch = React116.forwardRef(
|
|
15719
15852
|
);
|
15720
15853
|
|
15721
15854
|
// src/molecules/Switch/Switch.tsx
|
15722
|
-
var Switch2 =
|
15855
|
+
var Switch2 = React118.forwardRef(
|
15723
15856
|
(_a, ref) => {
|
15724
15857
|
var _b = _a, {
|
15725
15858
|
id,
|
@@ -15742,7 +15875,7 @@ var Switch2 = React117.forwardRef(
|
|
15742
15875
|
]);
|
15743
15876
|
var _a2;
|
15744
15877
|
const isChecked = (_a2 = props.checked) != null ? _a2 : props.defaultChecked;
|
15745
|
-
return !readOnly || isChecked ? /* @__PURE__ */
|
15878
|
+
return !readOnly || isChecked ? /* @__PURE__ */ React118.createElement(ControlLabel, {
|
15746
15879
|
htmlFor: id,
|
15747
15880
|
label: children,
|
15748
15881
|
"aria-label": ariaLabel,
|
@@ -15752,7 +15885,7 @@ var Switch2 = React117.forwardRef(
|
|
15752
15885
|
style: { gap: "0 8px" },
|
15753
15886
|
labelPlacement,
|
15754
15887
|
className: "Aquarium-Switch"
|
15755
|
-
}, !readOnly && /* @__PURE__ */
|
15888
|
+
}, !readOnly && /* @__PURE__ */ React118.createElement(Switch, __spreadProps(__spreadValues({
|
15756
15889
|
id,
|
15757
15890
|
ref,
|
15758
15891
|
name
|
@@ -15763,12 +15896,12 @@ var Switch2 = React117.forwardRef(
|
|
15763
15896
|
}
|
15764
15897
|
);
|
15765
15898
|
Switch2.displayName = "Switch";
|
15766
|
-
var SwitchSkeleton = () => /* @__PURE__ */
|
15899
|
+
var SwitchSkeleton = () => /* @__PURE__ */ React118.createElement("div", {
|
15767
15900
|
className: tw("flex gap-3")
|
15768
|
-
}, /* @__PURE__ */
|
15901
|
+
}, /* @__PURE__ */ React118.createElement(Skeleton, {
|
15769
15902
|
height: 20,
|
15770
15903
|
width: 35
|
15771
|
-
}), /* @__PURE__ */
|
15904
|
+
}), /* @__PURE__ */ React118.createElement(Skeleton, {
|
15772
15905
|
height: 20,
|
15773
15906
|
width: 150
|
15774
15907
|
}));
|
@@ -15776,7 +15909,7 @@ Switch2.Skeleton = SwitchSkeleton;
|
|
15776
15909
|
Switch2.Skeleton.displayName = "Switch.Skeleton ";
|
15777
15910
|
|
15778
15911
|
// src/molecules/TagLabel/TagLabel.tsx
|
15779
|
-
import
|
15912
|
+
import React119 from "react";
|
15780
15913
|
var getVariantClassNames = (variant = "primary") => {
|
15781
15914
|
switch (variant) {
|
15782
15915
|
case "neutral":
|
@@ -15792,7 +15925,7 @@ var getVariantClassNames = (variant = "primary") => {
|
|
15792
15925
|
};
|
15793
15926
|
var TagLabel = (_a) => {
|
15794
15927
|
var _b = _a, { title, dense = false, variant } = _b, rest = __objRest(_b, ["title", "dense", "variant"]);
|
15795
|
-
return /* @__PURE__ */
|
15928
|
+
return /* @__PURE__ */ React119.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
15796
15929
|
className: classNames(
|
15797
15930
|
"Aquarium-TagLabel",
|
15798
15931
|
getVariantClassNames(variant),
|
@@ -15806,7 +15939,7 @@ var TagLabel = (_a) => {
|
|
15806
15939
|
};
|
15807
15940
|
|
15808
15941
|
// src/atoms/Section/Section.tsx
|
15809
|
-
import
|
15942
|
+
import React120 from "react";
|
15810
15943
|
var import_caretUp2 = __toESM(require_caretUp());
|
15811
15944
|
var Section3 = (_a) => {
|
15812
15945
|
var _b = _a, {
|
@@ -15816,7 +15949,7 @@ var Section3 = (_a) => {
|
|
15816
15949
|
"children",
|
15817
15950
|
"className"
|
15818
15951
|
]);
|
15819
|
-
return /* @__PURE__ */
|
15952
|
+
return /* @__PURE__ */ React120.createElement(Box, __spreadProps(__spreadValues({
|
15820
15953
|
component: "section"
|
15821
15954
|
}, rest), {
|
15822
15955
|
className: classNames(tw("border border-muted"), className)
|
@@ -15824,7 +15957,7 @@ var Section3 = (_a) => {
|
|
15824
15957
|
};
|
15825
15958
|
Section3.Header = (_a) => {
|
15826
15959
|
var _b = _a, { children, className, expanded } = _b, rest = __objRest(_b, ["children", "className", "expanded"]);
|
15827
|
-
return /* @__PURE__ */
|
15960
|
+
return /* @__PURE__ */ React120.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
15828
15961
|
className: classNames(
|
15829
15962
|
tw("px-6 flex gap-5 justify-between items-center h-[72px]", {
|
15830
15963
|
"bg-muted": expanded
|
@@ -15833,10 +15966,10 @@ Section3.Header = (_a) => {
|
|
15833
15966
|
)
|
15834
15967
|
}), children);
|
15835
15968
|
};
|
15836
|
-
Section3.TitleContainer =
|
15969
|
+
Section3.TitleContainer = React120.forwardRef(
|
15837
15970
|
(_a, ref) => {
|
15838
15971
|
var _b = _a, { children, className, collapsible } = _b, rest = __objRest(_b, ["children", "className", "collapsible"]);
|
15839
|
-
return /* @__PURE__ */
|
15972
|
+
return /* @__PURE__ */ React120.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
15840
15973
|
ref,
|
15841
15974
|
className: classNames(
|
15842
15975
|
tw("grow grid grid-cols-[auto_1fr] gap-x-3 items-center", {
|
@@ -15847,14 +15980,14 @@ Section3.TitleContainer = React119.forwardRef(
|
|
15847
15980
|
}), children);
|
15848
15981
|
}
|
15849
15982
|
);
|
15850
|
-
Section3.Toggle = (props) => /* @__PURE__ */
|
15983
|
+
Section3.Toggle = (props) => /* @__PURE__ */ React120.createElement(Icon, __spreadProps(__spreadValues({}, props), {
|
15851
15984
|
icon: import_caretUp2.default,
|
15852
15985
|
height: 22,
|
15853
15986
|
width: 22
|
15854
15987
|
}));
|
15855
15988
|
Section3.Title = (_a) => {
|
15856
15989
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
15857
|
-
return /* @__PURE__ */
|
15990
|
+
return /* @__PURE__ */ React120.createElement(Typography2.Large, __spreadProps(__spreadValues({}, rest), {
|
15858
15991
|
htmlTag: "h2",
|
15859
15992
|
color: "intense",
|
15860
15993
|
className: "flex gap-3 items-center"
|
@@ -15862,21 +15995,21 @@ Section3.Title = (_a) => {
|
|
15862
15995
|
};
|
15863
15996
|
Section3.Subtitle = (_a) => {
|
15864
15997
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
15865
|
-
return /* @__PURE__ */
|
15998
|
+
return /* @__PURE__ */ React120.createElement(Typography2.Small, __spreadProps(__spreadValues({}, rest), {
|
15866
15999
|
color: "default"
|
15867
16000
|
}), children);
|
15868
16001
|
};
|
15869
16002
|
Section3.Actions = (_a) => {
|
15870
16003
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
15871
|
-
return /* @__PURE__ */
|
16004
|
+
return /* @__PURE__ */ React120.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
15872
16005
|
className: classNames(tw("flex gap-4 justify-end"), className)
|
15873
16006
|
}), children);
|
15874
16007
|
};
|
15875
16008
|
Section3.Body = (_a) => {
|
15876
16009
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
15877
|
-
return /* @__PURE__ */
|
16010
|
+
return /* @__PURE__ */ React120.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
15878
16011
|
className: classNames(tw("p-6"), className)
|
15879
|
-
}), /* @__PURE__ */
|
16012
|
+
}), /* @__PURE__ */ React120.createElement(Typography, {
|
15880
16013
|
htmlTag: "div",
|
15881
16014
|
color: "default"
|
15882
16015
|
}, children));
|
@@ -15890,7 +16023,7 @@ var Section4 = (props) => {
|
|
15890
16023
|
const _collapsible = title ? (_a = props.collapsible) != null ? _a : false : false;
|
15891
16024
|
const _collapsed = title ? props.collapsed : void 0;
|
15892
16025
|
const _defaultCollapsed = title ? (_b = props.defaultCollapsed) != null ? _b : false : false;
|
15893
|
-
const [isCollapsed, setCollapsed] =
|
16026
|
+
const [isCollapsed, setCollapsed] = React121.useState(_collapsed != null ? _collapsed : _defaultCollapsed);
|
15894
16027
|
const [ref, { height }] = useMeasure();
|
15895
16028
|
const toggleAreaRef = useRef14(null);
|
15896
16029
|
const menu = title ? (_c = props.menu) != null ? _c : void 0 : void 0;
|
@@ -15921,20 +16054,20 @@ var Section4 = (props) => {
|
|
15921
16054
|
},
|
15922
16055
|
immediate: !_collapsible
|
15923
16056
|
}), { transform } = _f, spring = __objRest(_f, ["transform"]);
|
15924
|
-
const toggleId =
|
15925
|
-
const regionId =
|
15926
|
-
const titleId =
|
16057
|
+
const toggleId = useId17();
|
16058
|
+
const regionId = useId17();
|
16059
|
+
const titleId = useId17();
|
15927
16060
|
const hasTabs = isComponentType(children, Tabs);
|
15928
16061
|
const { buttonProps } = useButton4(
|
15929
16062
|
{ "elementType": "div", "onPress": handleTitleClick, "aria-expanded": !isCollapsed, "aria-controls": regionId },
|
15930
16063
|
toggleAreaRef
|
15931
16064
|
);
|
15932
|
-
return /* @__PURE__ */
|
16065
|
+
return /* @__PURE__ */ React121.createElement(Section3, {
|
15933
16066
|
"aria-label": title,
|
15934
16067
|
className: _collapsible ? "Aquarium-Collapsible-Section" : "Aquarium-Section"
|
15935
|
-
}, title && /* @__PURE__ */
|
16068
|
+
}, title && /* @__PURE__ */ React121.createElement(React121.Fragment, null, /* @__PURE__ */ React121.createElement(Section3.Header, {
|
15936
16069
|
expanded: _collapsible && !isCollapsed
|
15937
|
-
}, /* @__PURE__ */
|
16070
|
+
}, /* @__PURE__ */ React121.createElement(Section3.TitleContainer, __spreadProps(__spreadValues({}, _collapsible ? __spreadProps(__spreadValues({}, buttonProps), {
|
15938
16071
|
onPointerDown: (e) => {
|
15939
16072
|
e.preventDefault();
|
15940
16073
|
handleTitleClick();
|
@@ -15943,49 +16076,49 @@ var Section4 = (props) => {
|
|
15943
16076
|
ref: _collapsible ? toggleAreaRef : void 0,
|
15944
16077
|
id: toggleId,
|
15945
16078
|
collapsible: _collapsible
|
15946
|
-
}), _collapsible && /* @__PURE__ */
|
16079
|
+
}), _collapsible && /* @__PURE__ */ React121.createElement(animated6.div, {
|
15947
16080
|
style: { transform }
|
15948
|
-
}, /* @__PURE__ */
|
16081
|
+
}, /* @__PURE__ */ React121.createElement(Section3.Toggle, null)), /* @__PURE__ */ React121.createElement(Section3.Title, {
|
15949
16082
|
id: titleId
|
15950
|
-
}, /* @__PURE__ */
|
16083
|
+
}, /* @__PURE__ */ React121.createElement(LineClamp2, {
|
15951
16084
|
lines: 1
|
15952
|
-
}, title), props.tag && /* @__PURE__ */
|
16085
|
+
}, title), props.tag && /* @__PURE__ */ React121.createElement(TagLabel, __spreadValues({}, props.tag)), props.badge && /* @__PURE__ */ React121.createElement(Chip2, {
|
15953
16086
|
text: props.badge
|
15954
|
-
}), props.chip && /* @__PURE__ */
|
16087
|
+
}), props.chip && /* @__PURE__ */ React121.createElement(StatusChip, __spreadValues({}, props.chip))), subtitle && /* @__PURE__ */ React121.createElement(Section3.Subtitle, {
|
15955
16088
|
className: tw("row-start-2", { "col-start-2": _collapsible })
|
15956
|
-
}, /* @__PURE__ */
|
16089
|
+
}, /* @__PURE__ */ React121.createElement(LineClamp2, {
|
15957
16090
|
lines: 1
|
15958
|
-
}, subtitle))), !isCollapsed && /* @__PURE__ */
|
16091
|
+
}, subtitle))), !isCollapsed && /* @__PURE__ */ React121.createElement(Section3.Actions, null, menu && /* @__PURE__ */ React121.createElement(Box.Flex, {
|
15959
16092
|
alignItems: "center"
|
15960
|
-
}, /* @__PURE__ */
|
16093
|
+
}, /* @__PURE__ */ React121.createElement(DropdownMenu2, {
|
15961
16094
|
onAction: (action) => onAction == null ? void 0 : onAction(action),
|
15962
16095
|
onOpenChange: onMenuOpenChange,
|
15963
16096
|
placement: defaultContextualMenuPlacement
|
15964
|
-
}, /* @__PURE__ */
|
16097
|
+
}, /* @__PURE__ */ React121.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ React121.createElement(Button.Icon, {
|
15965
16098
|
"aria-label": menuAriaLabel,
|
15966
16099
|
icon: import_more6.default
|
15967
|
-
})), menu)), props.actions && castArray7(props.actions).filter(Boolean).map((action) => renderAction({ kind: "secondary", action })), props.switch && /* @__PURE__ */
|
16100
|
+
})), menu)), props.actions && castArray7(props.actions).filter(Boolean).map((action) => renderAction({ kind: "secondary", action })), props.switch && /* @__PURE__ */ React121.createElement(Switch2, __spreadValues({}, props.switch)), props.select && /* @__PURE__ */ React121.createElement(SelectBase, __spreadValues({
|
15968
16101
|
"aria-labelledby": titleId
|
15969
|
-
}, props.select)))), !hasTabs && !isCollapsed && /* @__PURE__ */
|
16102
|
+
}, props.select)))), !hasTabs && !isCollapsed && /* @__PURE__ */ React121.createElement(animated6.div, {
|
15970
16103
|
className: tw(`h-[1px]`),
|
15971
16104
|
style: { backgroundColor: "var(--aquarium-border-color-muted)" }
|
15972
|
-
})), /* @__PURE__ */
|
16105
|
+
})), /* @__PURE__ */ React121.createElement(animated6.div, {
|
15973
16106
|
id: regionId,
|
15974
16107
|
"aria-hidden": _collapsible ? isCollapsed ? true : void 0 : void 0,
|
15975
16108
|
style: spring,
|
15976
16109
|
className: tw({ "overflow-hidden": _collapsible })
|
15977
|
-
}, /* @__PURE__ */
|
16110
|
+
}, /* @__PURE__ */ React121.createElement("div", {
|
15978
16111
|
ref
|
15979
|
-
}, hasTabs ? /* @__PURE__ */
|
16112
|
+
}, hasTabs ? /* @__PURE__ */ React121.createElement(SectionTabs, __spreadProps(__spreadValues({}, children.props), {
|
15980
16113
|
className: tw("[&>div:first-child]:px-3 grow flex flex-col overflow-y-auto", { "mt-4": _collapsible })
|
15981
|
-
})) : /* @__PURE__ */
|
16114
|
+
})) : /* @__PURE__ */ React121.createElement(Section3.Body, null, children))));
|
15982
16115
|
};
|
15983
|
-
var SectionTabs = createTabsComponent(ModalTab, TabItem, "SectionTabs", (children, selected) => /* @__PURE__ */
|
16116
|
+
var SectionTabs = createTabsComponent(ModalTab, TabItem, "SectionTabs", (children, selected) => /* @__PURE__ */ React121.createElement(Section3.Body, null, children.find(
|
15984
16117
|
(node, index) => (node == null ? void 0 : node.props.value) === selected || index === selected
|
15985
16118
|
)));
|
15986
16119
|
|
15987
16120
|
// src/molecules/SegmentedControl/SegmentedControl.tsx
|
15988
|
-
import
|
16121
|
+
import React122 from "react";
|
15989
16122
|
var SegmentedControl = (_a) => {
|
15990
16123
|
var _b = _a, {
|
15991
16124
|
children,
|
@@ -16002,7 +16135,7 @@ var SegmentedControl = (_a) => {
|
|
16002
16135
|
"selected",
|
16003
16136
|
"className"
|
16004
16137
|
]);
|
16005
|
-
return /* @__PURE__ */
|
16138
|
+
return /* @__PURE__ */ React122.createElement("li", null, /* @__PURE__ */ React122.createElement("button", __spreadProps(__spreadValues({
|
16006
16139
|
type: "button"
|
16007
16140
|
}, rest), {
|
16008
16141
|
className: classNames(getBaseSegmentedControlClassNames(selected), className),
|
@@ -16027,16 +16160,16 @@ var SegmentedControlGroup = (_a) => {
|
|
16027
16160
|
"className",
|
16028
16161
|
"ariaLabel"
|
16029
16162
|
]);
|
16030
|
-
return /* @__PURE__ */
|
16163
|
+
return /* @__PURE__ */ React122.createElement("ul", __spreadProps(__spreadValues({}, rest), {
|
16031
16164
|
"aria-label": ariaLabel,
|
16032
16165
|
className: classNames(
|
16033
16166
|
"Aquarium-SegmentedControl",
|
16034
16167
|
"flex border border-default rounded-sm divide-x divide-grey-20",
|
16035
16168
|
className
|
16036
16169
|
)
|
16037
|
-
}),
|
16170
|
+
}), React122.Children.map(
|
16038
16171
|
children,
|
16039
|
-
(child) =>
|
16172
|
+
(child) => React122.cloneElement(child, {
|
16040
16173
|
onClick: () => onChange(child.props.value),
|
16041
16174
|
selected: child.props.value === value
|
16042
16175
|
})
|
@@ -16053,14 +16186,14 @@ var getBaseSegmentedControlClassNames = (selected) => tw(
|
|
16053
16186
|
);
|
16054
16187
|
|
16055
16188
|
// src/molecules/Stepper/Stepper.tsx
|
16056
|
-
import
|
16189
|
+
import React124 from "react";
|
16057
16190
|
|
16058
16191
|
// src/atoms/Stepper/Stepper.tsx
|
16059
|
-
import
|
16192
|
+
import React123 from "react";
|
16060
16193
|
var import_tick6 = __toESM(require_tick());
|
16061
16194
|
var Stepper = (_a) => {
|
16062
16195
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
16063
|
-
return /* @__PURE__ */
|
16196
|
+
return /* @__PURE__ */ React123.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
16064
16197
|
className: classNames(className)
|
16065
16198
|
}));
|
16066
16199
|
};
|
@@ -16074,7 +16207,7 @@ var ConnectorContainer = (_a) => {
|
|
16074
16207
|
"completed",
|
16075
16208
|
"dense"
|
16076
16209
|
]);
|
16077
|
-
return /* @__PURE__ */
|
16210
|
+
return /* @__PURE__ */ React123.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
16078
16211
|
className: classNames(
|
16079
16212
|
tw("absolute w-full -left-1/2", {
|
16080
16213
|
"top-[3px] px-[14px]": Boolean(dense),
|
@@ -16086,7 +16219,7 @@ var ConnectorContainer = (_a) => {
|
|
16086
16219
|
};
|
16087
16220
|
var Connector = (_a) => {
|
16088
16221
|
var _b = _a, { children, className, completed, dense } = _b, rest = __objRest(_b, ["children", "className", "completed", "dense"]);
|
16089
|
-
return /* @__PURE__ */
|
16222
|
+
return /* @__PURE__ */ React123.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
16090
16223
|
className: classNames(
|
16091
16224
|
tw("w-full", {
|
16092
16225
|
"bg-intense": !completed,
|
@@ -16100,7 +16233,7 @@ var Connector = (_a) => {
|
|
16100
16233
|
};
|
16101
16234
|
var Step = (_a) => {
|
16102
16235
|
var _b = _a, { className, state } = _b, rest = __objRest(_b, ["className", "state"]);
|
16103
|
-
return /* @__PURE__ */
|
16236
|
+
return /* @__PURE__ */ React123.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
16104
16237
|
className: classNames(
|
16105
16238
|
tw("flex flex-col items-center relative text-center", {
|
16106
16239
|
"text-intense": state !== "inactive",
|
@@ -16122,13 +16255,13 @@ var getDenseClassNames = (state) => tw("h-[8px] w-[8px]", {
|
|
16122
16255
|
});
|
16123
16256
|
var Indicator = (_a) => {
|
16124
16257
|
var _b = _a, { children, className, state, dense } = _b, rest = __objRest(_b, ["children", "className", "state", "dense"]);
|
16125
|
-
return /* @__PURE__ */
|
16258
|
+
return /* @__PURE__ */ React123.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
16126
16259
|
className: classNames(
|
16127
16260
|
tw("rounded-full flex justify-center items-center mx-2 mb-3"),
|
16128
16261
|
dense ? getDenseClassNames(state) : getClassNames(state),
|
16129
16262
|
className
|
16130
16263
|
)
|
16131
|
-
}), state === "completed" ? /* @__PURE__ */
|
16264
|
+
}), state === "completed" ? /* @__PURE__ */ React123.createElement(InlineIcon, {
|
16132
16265
|
icon: import_tick6.default
|
16133
16266
|
}) : dense ? null : children);
|
16134
16267
|
};
|
@@ -16139,26 +16272,26 @@ Stepper.ConnectorContainer = ConnectorContainer;
|
|
16139
16272
|
|
16140
16273
|
// src/molecules/Stepper/Stepper.tsx
|
16141
16274
|
var Stepper2 = ({ children, activeIndex, dense }) => {
|
16142
|
-
const steps =
|
16143
|
-
return /* @__PURE__ */
|
16275
|
+
const steps = React124.Children.count(children);
|
16276
|
+
return /* @__PURE__ */ React124.createElement(Stepper, {
|
16144
16277
|
role: "list",
|
16145
16278
|
className: "Aquarium-Stepper"
|
16146
|
-
}, /* @__PURE__ */
|
16279
|
+
}, /* @__PURE__ */ React124.createElement(Template, {
|
16147
16280
|
columns: steps
|
16148
|
-
},
|
16281
|
+
}, React124.Children.map(children, (child, index) => {
|
16149
16282
|
if (!isComponentType(child, Step2)) {
|
16150
16283
|
throw new Error("<Stepper> can only have <Stepper.Step> components as children");
|
16151
16284
|
} else {
|
16152
16285
|
const state = index > activeIndex ? "inactive" : index === activeIndex ? "active" : "completed";
|
16153
|
-
return /* @__PURE__ */
|
16286
|
+
return /* @__PURE__ */ React124.createElement(Stepper.Step, {
|
16154
16287
|
state,
|
16155
16288
|
"aria-current": state === "active" ? "step" : false,
|
16156
16289
|
role: "listitem"
|
16157
|
-
}, index > 0 && index <= steps && /* @__PURE__ */
|
16290
|
+
}, index > 0 && index <= steps && /* @__PURE__ */ React124.createElement(Stepper.ConnectorContainer, {
|
16158
16291
|
dense
|
16159
|
-
}, /* @__PURE__ */
|
16292
|
+
}, /* @__PURE__ */ React124.createElement(Stepper.ConnectorContainer.Connector, {
|
16160
16293
|
completed: state === "completed" || state === "active"
|
16161
|
-
})), /* @__PURE__ */
|
16294
|
+
})), /* @__PURE__ */ React124.createElement(Stepper.Step.Indicator, {
|
16162
16295
|
state,
|
16163
16296
|
dense
|
16164
16297
|
}, index + 1), child.props.children);
|
@@ -16171,8 +16304,8 @@ Step2.displayName = "Stepper.Step";
|
|
16171
16304
|
Stepper2.Step = Step2;
|
16172
16305
|
|
16173
16306
|
// src/molecules/SwitchGroup/SwitchGroup.tsx
|
16174
|
-
import
|
16175
|
-
import { useId as
|
16307
|
+
import React125, { useState as useState14 } from "react";
|
16308
|
+
import { useId as useId18 } from "@react-aria/utils";
|
16176
16309
|
var SwitchGroup = (_a) => {
|
16177
16310
|
var _b = _a, {
|
16178
16311
|
value,
|
@@ -16194,7 +16327,7 @@ var SwitchGroup = (_a) => {
|
|
16194
16327
|
if (value !== void 0 && value !== selectedItems) {
|
16195
16328
|
setSelectedItems(value);
|
16196
16329
|
}
|
16197
|
-
const errorMessageId =
|
16330
|
+
const errorMessageId = useId18();
|
16198
16331
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
16199
16332
|
const labelControlProps = getLabelControlProps(props);
|
16200
16333
|
const handleChange = (e) => {
|
@@ -16203,13 +16336,13 @@ var SwitchGroup = (_a) => {
|
|
16203
16336
|
setSelectedItems(updated);
|
16204
16337
|
onChange == null ? void 0 : onChange(updated);
|
16205
16338
|
};
|
16206
|
-
return /* @__PURE__ */
|
16339
|
+
return /* @__PURE__ */ React125.createElement(LabelControl, __spreadProps(__spreadValues(__spreadValues({
|
16207
16340
|
fieldset: true
|
16208
16341
|
}, labelControlProps), errorProps), {
|
16209
16342
|
className: "Aquarium-SwitchGroup"
|
16210
|
-
}), /* @__PURE__ */
|
16343
|
+
}), /* @__PURE__ */ React125.createElement(InputGroup, {
|
16211
16344
|
cols
|
16212
|
-
},
|
16345
|
+
}, React125.Children.map(children, (c) => {
|
16213
16346
|
var _a3, _b2, _c, _d;
|
16214
16347
|
if (!isComponentType(c, Switch2)) {
|
16215
16348
|
return null;
|
@@ -16217,7 +16350,7 @@ var SwitchGroup = (_a) => {
|
|
16217
16350
|
const str = (_a3 = c.props.value) == null ? void 0 : _a3.toString();
|
16218
16351
|
const defaultChecked = defaultValue === void 0 ? void 0 : str !== void 0 && defaultValue.includes(str);
|
16219
16352
|
const checked = value === void 0 ? void 0 : str !== void 0 && value.includes(str);
|
16220
|
-
return
|
16353
|
+
return React125.cloneElement(c, {
|
16221
16354
|
defaultChecked: (_b2 = c.props.defaultChecked) != null ? _b2 : defaultChecked,
|
16222
16355
|
checked: (_c = c.props.checked) != null ? _c : checked,
|
16223
16356
|
onChange: (_d = c.props.onChange) != null ? _d : handleChange,
|
@@ -16227,9 +16360,9 @@ var SwitchGroup = (_a) => {
|
|
16227
16360
|
})));
|
16228
16361
|
};
|
16229
16362
|
var SwitchGroupSkeleton = ({ options = 2 }) => {
|
16230
|
-
return /* @__PURE__ */
|
16363
|
+
return /* @__PURE__ */ React125.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React125.createElement("div", {
|
16231
16364
|
className: tw("flex flex-wrap flex-col gap-2")
|
16232
|
-
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */
|
16365
|
+
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */ React125.createElement(Switch2.Skeleton, {
|
16233
16366
|
key
|
16234
16367
|
}))));
|
16235
16368
|
};
|
@@ -16237,14 +16370,14 @@ SwitchGroup.Skeleton = SwitchGroupSkeleton;
|
|
16237
16370
|
SwitchGroup.Skeleton.displayName = "SwitchGroup.Skeleton";
|
16238
16371
|
|
16239
16372
|
// src/molecules/Textarea/Textarea.tsx
|
16240
|
-
import
|
16241
|
-
import { useId as
|
16373
|
+
import React126, { useState as useState15 } from "react";
|
16374
|
+
import { useId as useId19 } from "@react-aria/utils";
|
16242
16375
|
import omit19 from "lodash/omit";
|
16243
16376
|
import toString2 from "lodash/toString";
|
16244
|
-
var TextareaBase =
|
16377
|
+
var TextareaBase = React126.forwardRef(
|
16245
16378
|
(_a, ref) => {
|
16246
16379
|
var _b = _a, { readOnly = false, valid = true } = _b, props = __objRest(_b, ["readOnly", "valid"]);
|
16247
|
-
return /* @__PURE__ */
|
16380
|
+
return /* @__PURE__ */ React126.createElement("textarea", __spreadProps(__spreadValues({
|
16248
16381
|
ref
|
16249
16382
|
}, props), {
|
16250
16383
|
readOnly,
|
@@ -16252,26 +16385,26 @@ var TextareaBase = React125.forwardRef(
|
|
16252
16385
|
}));
|
16253
16386
|
}
|
16254
16387
|
);
|
16255
|
-
TextareaBase.Skeleton = () => /* @__PURE__ */
|
16388
|
+
TextareaBase.Skeleton = () => /* @__PURE__ */ React126.createElement(Skeleton, {
|
16256
16389
|
height: 58
|
16257
16390
|
});
|
16258
|
-
var Textarea =
|
16391
|
+
var Textarea = React126.forwardRef((props, ref) => {
|
16259
16392
|
var _a, _b, _c;
|
16260
16393
|
const [value, setValue] = useState15((_b = (_a = props.value) != null ? _a : props.defaultValue) != null ? _b : "");
|
16261
|
-
const defaultId =
|
16394
|
+
const defaultId = useId19();
|
16262
16395
|
const id = (_c = props.id) != null ? _c : defaultId;
|
16263
|
-
const errorMessageId =
|
16396
|
+
const errorMessageId = useId19();
|
16264
16397
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
16265
16398
|
const _d = getLabelControlProps(props), { "data-testid": dataTestId } = _d, labelControlProps = __objRest(_d, ["data-testid"]);
|
16266
16399
|
const baseProps = omit19(props, Object.keys(labelControlProps));
|
16267
|
-
return /* @__PURE__ */
|
16400
|
+
return /* @__PURE__ */ React126.createElement(LabelControl, __spreadProps(__spreadValues({
|
16268
16401
|
id: `${id}-label`,
|
16269
16402
|
htmlFor: id,
|
16270
16403
|
messageId: errorMessageId,
|
16271
16404
|
length: value !== void 0 ? toString2(value).length : void 0
|
16272
16405
|
}, labelControlProps), {
|
16273
16406
|
className: "Aquarium-Textarea"
|
16274
|
-
}), /* @__PURE__ */
|
16407
|
+
}), /* @__PURE__ */ React126.createElement(TextareaBase, __spreadProps(__spreadValues(__spreadValues({
|
16275
16408
|
ref
|
16276
16409
|
}, baseProps), errorProps), {
|
16277
16410
|
id,
|
@@ -16288,48 +16421,48 @@ var Textarea = React125.forwardRef((props, ref) => {
|
|
16288
16421
|
})));
|
16289
16422
|
});
|
16290
16423
|
Textarea.displayName = "Textarea";
|
16291
|
-
var TextAreaSkeleton = () => /* @__PURE__ */
|
16424
|
+
var TextAreaSkeleton = () => /* @__PURE__ */ React126.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React126.createElement(TextareaBase.Skeleton, null));
|
16292
16425
|
Textarea.Skeleton = TextAreaSkeleton;
|
16293
16426
|
Textarea.Skeleton.displayName = "Textarea.Skeleton";
|
16294
16427
|
|
16295
16428
|
// src/molecules/Timeline/Timeline.tsx
|
16296
|
-
import
|
16429
|
+
import React128 from "react";
|
16297
16430
|
|
16298
16431
|
// src/atoms/Timeline/Timeline.tsx
|
16299
|
-
import
|
16432
|
+
import React127 from "react";
|
16300
16433
|
var Timeline = (_a) => {
|
16301
16434
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
16302
|
-
return /* @__PURE__ */
|
16435
|
+
return /* @__PURE__ */ React127.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
16303
16436
|
className: classNames(tw("grid grid-cols-[16px_1fr] gap-x-4"), className)
|
16304
16437
|
}));
|
16305
16438
|
};
|
16306
16439
|
var Content2 = (_a) => {
|
16307
16440
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
16308
|
-
return /* @__PURE__ */
|
16441
|
+
return /* @__PURE__ */ React127.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
16309
16442
|
className: classNames(tw("pb-6"), className)
|
16310
16443
|
}));
|
16311
16444
|
};
|
16312
16445
|
var Separator2 = (_a) => {
|
16313
16446
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
16314
|
-
return /* @__PURE__ */
|
16447
|
+
return /* @__PURE__ */ React127.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
16315
16448
|
className: classNames(tw("flex items-center justify-center h-5 w-5"), className)
|
16316
16449
|
}));
|
16317
16450
|
};
|
16318
16451
|
var LineContainer = (_a) => {
|
16319
16452
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
16320
|
-
return /* @__PURE__ */
|
16453
|
+
return /* @__PURE__ */ React127.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
16321
16454
|
className: classNames(tw("flex justify-center py-1"), className)
|
16322
16455
|
}));
|
16323
16456
|
};
|
16324
16457
|
var Line = (_a) => {
|
16325
16458
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
16326
|
-
return /* @__PURE__ */
|
16459
|
+
return /* @__PURE__ */ React127.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
16327
16460
|
className: classNames(tw("w-1 bg-default h-full justify-self-center"), className)
|
16328
16461
|
}));
|
16329
16462
|
};
|
16330
16463
|
var Dot = (_a) => {
|
16331
16464
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
16332
|
-
return /* @__PURE__ */
|
16465
|
+
return /* @__PURE__ */ React127.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
16333
16466
|
className: classNames(tw("bg-intense h-[6px] w-[6px] rounded"), className)
|
16334
16467
|
}));
|
16335
16468
|
};
|
@@ -16344,54 +16477,54 @@ var import_error5 = __toESM(require_error());
|
|
16344
16477
|
var import_time2 = __toESM(require_time());
|
16345
16478
|
var import_warningSign5 = __toESM(require_warningSign());
|
16346
16479
|
var TimelineItem = () => null;
|
16347
|
-
var Timeline2 = ({ children }) => /* @__PURE__ */
|
16480
|
+
var Timeline2 = ({ children }) => /* @__PURE__ */ React128.createElement("div", {
|
16348
16481
|
className: "Aquarium-Timeline"
|
16349
|
-
},
|
16482
|
+
}, React128.Children.map(children, (item) => {
|
16350
16483
|
if (!isComponentType(item, TimelineItem)) {
|
16351
16484
|
throw new Error("<Timeline> can only have <Timeline.Item> components as children");
|
16352
16485
|
} else {
|
16353
16486
|
const { props, key } = item;
|
16354
|
-
return /* @__PURE__ */
|
16487
|
+
return /* @__PURE__ */ React128.createElement(Timeline, {
|
16355
16488
|
key: key != null ? key : props.title
|
16356
|
-
}, /* @__PURE__ */
|
16489
|
+
}, /* @__PURE__ */ React128.createElement(Timeline.Separator, null, props.variant === "error" ? /* @__PURE__ */ React128.createElement(Icon, {
|
16357
16490
|
icon: import_error5.default,
|
16358
16491
|
color: "danger-default"
|
16359
|
-
}) : props.variant === "warning" ? /* @__PURE__ */
|
16492
|
+
}) : props.variant === "warning" ? /* @__PURE__ */ React128.createElement(Icon, {
|
16360
16493
|
icon: import_warningSign5.default,
|
16361
16494
|
color: "warning-default"
|
16362
|
-
}) : props.variant === "info" ? /* @__PURE__ */
|
16495
|
+
}) : props.variant === "info" ? /* @__PURE__ */ React128.createElement(Icon, {
|
16363
16496
|
icon: import_time2.default,
|
16364
16497
|
color: "info-default"
|
16365
|
-
}) : /* @__PURE__ */
|
16498
|
+
}) : /* @__PURE__ */ React128.createElement(Timeline.Separator.Dot, null)), /* @__PURE__ */ React128.createElement(Typography2.Caption, {
|
16366
16499
|
color: "muted"
|
16367
|
-
}, props.title), /* @__PURE__ */
|
16500
|
+
}, props.title), /* @__PURE__ */ React128.createElement(Timeline.LineContainer, null, /* @__PURE__ */ React128.createElement(Timeline.LineContainer.Line, null)), /* @__PURE__ */ React128.createElement(Timeline.Content, null, /* @__PURE__ */ React128.createElement(Typography2.Small, null, props.children)));
|
16368
16501
|
}
|
16369
16502
|
}));
|
16370
|
-
var TimelineItemSkeleton = () => /* @__PURE__ */
|
16503
|
+
var TimelineItemSkeleton = () => /* @__PURE__ */ React128.createElement(Timeline, null, /* @__PURE__ */ React128.createElement(Timeline.Separator, null, /* @__PURE__ */ React128.createElement(Skeleton, {
|
16371
16504
|
width: 6,
|
16372
16505
|
height: 6,
|
16373
16506
|
rounded: true
|
16374
|
-
})), /* @__PURE__ */
|
16507
|
+
})), /* @__PURE__ */ React128.createElement(Skeleton, {
|
16375
16508
|
height: 12,
|
16376
16509
|
width: 120
|
16377
|
-
}), /* @__PURE__ */
|
16510
|
+
}), /* @__PURE__ */ React128.createElement(Timeline.LineContainer, null, /* @__PURE__ */ React128.createElement(Skeleton, {
|
16378
16511
|
width: 2,
|
16379
16512
|
height: "100%"
|
16380
|
-
})), /* @__PURE__ */
|
16513
|
+
})), /* @__PURE__ */ React128.createElement(Timeline.Content, null, /* @__PURE__ */ React128.createElement(Box, {
|
16381
16514
|
display: "flex",
|
16382
16515
|
flexDirection: "column",
|
16383
16516
|
gap: "3"
|
16384
|
-
}, /* @__PURE__ */
|
16517
|
+
}, /* @__PURE__ */ React128.createElement(Skeleton, {
|
16385
16518
|
height: 32,
|
16386
16519
|
width: "100%"
|
16387
|
-
}), /* @__PURE__ */
|
16520
|
+
}), /* @__PURE__ */ React128.createElement(Skeleton, {
|
16388
16521
|
height: 32,
|
16389
16522
|
width: "73%"
|
16390
|
-
}), /* @__PURE__ */
|
16523
|
+
}), /* @__PURE__ */ React128.createElement(Skeleton, {
|
16391
16524
|
height: 32,
|
16392
16525
|
width: "80%"
|
16393
16526
|
}))));
|
16394
|
-
var TimelineSkeleton = ({ items = 3 }) => /* @__PURE__ */
|
16527
|
+
var TimelineSkeleton = ({ items = 3 }) => /* @__PURE__ */ React128.createElement("div", null, Array.from({ length: items }).map((_, key) => /* @__PURE__ */ React128.createElement(TimelineItemSkeleton, {
|
16395
16528
|
key
|
16396
16529
|
})));
|
16397
16530
|
Timeline2.Item = TimelineItem;
|
@@ -16399,13 +16532,13 @@ Timeline2.Skeleton = TimelineSkeleton;
|
|
16399
16532
|
Timeline2.Skeleton.displayName = "Timeline.Skeleton";
|
16400
16533
|
|
16401
16534
|
// src/molecules/TimePicker/TimePicker.tsx
|
16402
|
-
import
|
16403
|
-
var TimePicker = (props) => /* @__PURE__ */
|
16535
|
+
import React129 from "react";
|
16536
|
+
var TimePicker = (props) => /* @__PURE__ */ React129.createElement(TimeField, __spreadValues({}, props));
|
16404
16537
|
|
16405
16538
|
// src/utils/table/useTableSelect.ts
|
16406
|
-
import
|
16539
|
+
import React130 from "react";
|
16407
16540
|
var useTableSelect = (data, { key }) => {
|
16408
|
-
const [selected, setSelected] =
|
16541
|
+
const [selected, setSelected] = React130.useState([]);
|
16409
16542
|
const allSelected = selected.length === data.length;
|
16410
16543
|
const isSelected = (dot) => selected.includes(dot[key]);
|
16411
16544
|
const selectAll = () => setSelected(data.map((dot) => dot[key]));
|