@aivenio/aquarium 1.61.0 → 1.63.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_variables.scss +1 -1
- package/dist/atoms.cjs +493 -277
- package/dist/atoms.mjs +492 -277
- package/dist/src/atoms/DataList/DataList.d.ts +14 -0
- package/dist/src/atoms/DataList/DataList.js +29 -1
- package/dist/src/atoms/Typography/Typography.d.ts +1 -1
- package/dist/src/atoms/Typography/Typography.js +1 -1
- package/dist/src/atoms/index.d.ts +1 -0
- package/dist/src/atoms/index.js +2 -1
- package/dist/src/icons/faceHappy.d.ts +9 -0
- package/dist/src/icons/faceHappy.js +11 -0
- package/dist/src/icons/faceSad.d.ts +9 -0
- package/dist/src/icons/faceSad.js +11 -0
- package/dist/src/icons/index.d.ts +2 -0
- package/dist/src/icons/index.js +3 -1
- package/dist/src/molecules/Button/Button.d.ts +12 -0
- package/dist/src/molecules/Button/Button.js +9 -6
- package/dist/src/molecules/Combobox/Combobox.d.ts +3 -1
- package/dist/src/molecules/Combobox/Combobox.js +10 -4
- package/dist/src/molecules/DataList/DataList.d.ts +49 -4
- package/dist/src/molecules/DataList/DataList.js +80 -28
- package/dist/src/molecules/DataList/DataListComponents.d.ts +2 -1
- package/dist/src/molecules/DataList/DataListComponents.js +5 -4
- package/dist/src/molecules/DataList/DataListContext.d.ts +8 -0
- package/dist/src/molecules/DataList/DataListContext.js +13 -0
- package/dist/src/molecules/DataList/DataListGroup.d.ts +7 -3
- package/dist/src/molecules/DataList/DataListGroup.js +31 -9
- package/dist/src/molecules/DataList/DataListToolbar.d.ts +25 -0
- package/dist/src/molecules/DataList/DataListToolbar.js +30 -0
- package/dist/src/molecules/DataList/utils.d.ts +2 -0
- package/dist/src/molecules/DataList/utils.js +3 -0
- package/dist/src/molecules/DataTable/DataTable.js +3 -2
- package/dist/src/molecules/Dialog/Dialog.d.ts +4 -0
- package/dist/src/molecules/Dialog/Dialog.js +9 -4
- package/dist/src/molecules/MultiSelect/MultiSelect.d.ts +1 -1
- package/dist/src/molecules/MultiSelect/MultiSelect.js +1 -1
- package/dist/src/molecules/PageHeader/PageHeader.js +3 -2
- package/dist/src/molecules/Section/Section.js +3 -2
- package/dist/src/utils/table/types.d.ts +2 -1
- package/dist/src/utils/table/types.js +1 -1
- package/dist/styles.css +18 -0
- package/dist/system.cjs +850 -575
- package/dist/system.mjs +767 -492
- package/dist/tsconfig.module.tsbuildinfo +1 -1
- package/dist/types/ContextualMenu.d.ts +2 -0
- package/dist/types/ContextualMenu.js +2 -2
- package/dist/types/tailwindGenerated.d.ts +1 -1
- package/package.json +1 -1
package/dist/system.cjs
CHANGED
@@ -2390,6 +2390,38 @@ var require_eyeOpen = __commonJS({
|
|
2390
2390
|
}
|
2391
2391
|
});
|
2392
2392
|
|
2393
|
+
// src/icons/faceHappy.js
|
2394
|
+
var require_faceHappy = __commonJS({
|
2395
|
+
"src/icons/faceHappy.js"(exports) {
|
2396
|
+
"use strict";
|
2397
|
+
var data = {
|
2398
|
+
"body": '<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M7.5 13s1.375 1.833 3.667 1.833c2.291 0 3.666-1.833 3.666-1.833m-.916-4.583h.009m-5.51 0h.01m11.907 2.75a9.167 9.167 0 11-18.333 0 9.167 9.167 0 0118.333 0Zm-5.958-2.75a.458.458 0 11-.917 0 .458.458 0 01.917 0Zm-5.5 0a.458.458 0 11-.917 0 .458.458 0 01.917 0Z"/>',
|
2399
|
+
"left": 0,
|
2400
|
+
"top": 0,
|
2401
|
+
"width": 22,
|
2402
|
+
"height": 22
|
2403
|
+
};
|
2404
|
+
exports.__esModule = true;
|
2405
|
+
exports.default = data;
|
2406
|
+
}
|
2407
|
+
});
|
2408
|
+
|
2409
|
+
// src/icons/faceSad.js
|
2410
|
+
var require_faceSad = __commonJS({
|
2411
|
+
"src/icons/faceSad.js"(exports) {
|
2412
|
+
"use strict";
|
2413
|
+
var data = {
|
2414
|
+
"body": '<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M14.833 14.833S13.458 13 11.167 13C8.875 13 7.5 14.833 7.5 14.833m8.25-6.196c-.362.444-.857.696-1.375.696s-1-.252-1.375-.696m-3.667 0c-.362.444-.857.696-1.375.696s-.999-.252-1.375-.696m13.75 2.53a9.167 9.167 0 11-18.333 0 9.167 9.167 0 0118.333 0Z"/>',
|
2415
|
+
"left": 0,
|
2416
|
+
"top": 0,
|
2417
|
+
"width": 22,
|
2418
|
+
"height": 22
|
2419
|
+
};
|
2420
|
+
exports.__esModule = true;
|
2421
|
+
exports.default = data;
|
2422
|
+
}
|
2423
|
+
});
|
2424
|
+
|
2393
2425
|
// src/icons/filter.js
|
2394
2426
|
var require_filter = __commonJS({
|
2395
2427
|
"src/icons/filter.js"(exports) {
|
@@ -6174,6 +6206,8 @@ var import_expandAll = __toESM(require_expandAll());
|
|
6174
6206
|
var import_export = __toESM(require_export());
|
6175
6207
|
var import_eyeOff = __toESM(require_eyeOff());
|
6176
6208
|
var import_eyeOpen = __toESM(require_eyeOpen());
|
6209
|
+
var import_faceHappy = __toESM(require_faceHappy());
|
6210
|
+
var import_faceSad = __toESM(require_faceSad());
|
6177
6211
|
var import_filter = __toESM(require_filter());
|
6178
6212
|
var import_flag = __toESM(require_flag());
|
6179
6213
|
var import_floppyDisk = __toESM(require_floppyDisk());
|
@@ -7006,8 +7040,8 @@ var asButton = (Component, isDropdownButton) => {
|
|
7006
7040
|
'Please provide an accessible name as a string only for an icon only button via "aria-label" or "tooltip" prop.'
|
7007
7041
|
);
|
7008
7042
|
}
|
7009
|
-
if (!!isDropdownButton &&
|
7010
|
-
throw new Error('Dropdown button is available only for "primary" and "
|
7043
|
+
if (!!isDropdownButton && !["primary", "secondary", "ghost"].includes(kind)) {
|
7044
|
+
throw new Error('Dropdown button is available only for "primary", "secondary" and "ghost" kinds.');
|
7011
7045
|
}
|
7012
7046
|
if (!!isDropdownButton && !!icon) {
|
7013
7047
|
throw new Error("Dropdown button doesn't support any icon prop.");
|
@@ -7016,9 +7050,9 @@ var asButton = (Component, isDropdownButton) => {
|
|
7016
7050
|
throw new Error('Loading button is only supported for "primary" and "secondary" kinds.');
|
7017
7051
|
}
|
7018
7052
|
const buttonContent = () => {
|
7019
|
-
if (!!isDropdownButton && (kind === "primary" || kind === "secondary")) {
|
7053
|
+
if (!!isDropdownButton && (kind === "primary" || kind === "secondary" || kind === "ghost")) {
|
7020
7054
|
return /* @__PURE__ */ import_react19.default.createElement(Flexbox, {
|
7021
|
-
gap: "4",
|
7055
|
+
gap: dense ? "2" : "4",
|
7022
7056
|
alignItems: "center",
|
7023
7057
|
justifyContent: "center"
|
7024
7058
|
}, hasChildren && /* @__PURE__ */ import_react19.default.createElement("div", null, children), /* @__PURE__ */ import_react19.default.createElement(InlineIcon, {
|
@@ -7028,7 +7062,7 @@ var asButton = (Component, isDropdownButton) => {
|
|
7028
7062
|
}));
|
7029
7063
|
} else if (icon) {
|
7030
7064
|
return /* @__PURE__ */ import_react19.default.createElement(Flexbox, {
|
7031
|
-
gap: "3",
|
7065
|
+
gap: dense ? "2" : "3",
|
7032
7066
|
alignItems: "center",
|
7033
7067
|
justifyContent: "center",
|
7034
7068
|
direction: iconPlacement === "right" ? "row-reverse" : "row"
|
@@ -7162,6 +7196,13 @@ var SecondaryDropdownButton = import_react19.default.forwardRef((props, ref) =>
|
|
7162
7196
|
})));
|
7163
7197
|
SecondaryDropdownButton.displayName = "Button.SecondaryDropdown";
|
7164
7198
|
Button.SecondaryDropdown = SecondaryDropdownButton;
|
7199
|
+
var GhostDropdownButton = import_react19.default.forwardRef((props, ref) => /* @__PURE__ */ import_react19.default.createElement(DropdownButton, __spreadProps(__spreadValues({
|
7200
|
+
ref
|
7201
|
+
}, props), {
|
7202
|
+
kind: "ghost"
|
7203
|
+
})));
|
7204
|
+
GhostDropdownButton.displayName = "Button.GhostDropdownButton";
|
7205
|
+
Button.GhostDropdown = GhostDropdownButton;
|
7165
7206
|
|
7166
7207
|
// src/molecules/Typography/Typography.tsx
|
7167
7208
|
var import_react21 = __toESM(require("react"));
|
@@ -7192,7 +7233,7 @@ var Typography = (_a) => {
|
|
7192
7233
|
"fontWeight"
|
7193
7234
|
]);
|
7194
7235
|
const HtmlElement = htmlTag;
|
7195
|
-
const resolvedColorName = (0, import_isUndefined6.default)(color) || color === "current" ? "
|
7236
|
+
const resolvedColorName = (0, import_isUndefined6.default)(color) || color === "current" ? "default" : color;
|
7196
7237
|
const style = useStyle({ fontWeight });
|
7197
7238
|
return /* @__PURE__ */ import_react20.default.createElement(HtmlElement, __spreadValues({
|
7198
7239
|
className: classNames(typographies[variant], `text-${resolvedColorName}`, className),
|
@@ -9487,9 +9528,11 @@ var ComboboxBase = (_a) => {
|
|
9487
9528
|
createOption,
|
9488
9529
|
renderOption = (opt) => itemToString(opt),
|
9489
9530
|
isOptionDisabled = isOptionDisabledBuiltin,
|
9531
|
+
getOptionKey,
|
9490
9532
|
defaultValue,
|
9491
9533
|
value,
|
9492
9534
|
onChange,
|
9535
|
+
onSearchChange,
|
9493
9536
|
children,
|
9494
9537
|
valid = true,
|
9495
9538
|
disabled = false,
|
@@ -9507,9 +9550,11 @@ var ComboboxBase = (_a) => {
|
|
9507
9550
|
"createOption",
|
9508
9551
|
"renderOption",
|
9509
9552
|
"isOptionDisabled",
|
9553
|
+
"getOptionKey",
|
9510
9554
|
"defaultValue",
|
9511
9555
|
"value",
|
9512
9556
|
"onChange",
|
9557
|
+
"onSearchChange",
|
9513
9558
|
"children",
|
9514
9559
|
"valid",
|
9515
9560
|
"disabled",
|
@@ -9565,7 +9610,10 @@ var ComboboxBase = (_a) => {
|
|
9565
9610
|
return changes;
|
9566
9611
|
},
|
9567
9612
|
onSelectedItemChange: (e) => onChange == null ? void 0 : onChange(e.selectedItem),
|
9568
|
-
onInputValueChange: ({ selectedItem: selectedItem2, inputValue: inputValue2 }) =>
|
9613
|
+
onInputValueChange: ({ selectedItem: selectedItem2, inputValue: inputValue2 }) => {
|
9614
|
+
updateInputItems(inputValue2, selectedItem2);
|
9615
|
+
onSearchChange == null ? void 0 : onSearchChange(inputValue2);
|
9616
|
+
}
|
9569
9617
|
});
|
9570
9618
|
const state = {
|
9571
9619
|
isOpen,
|
@@ -9624,11 +9672,14 @@ var ComboboxBase = (_a) => {
|
|
9624
9672
|
style: { width: (_a2 = targetRef.current) == null ? void 0 : _a2.offsetWidth }
|
9625
9673
|
}, /* @__PURE__ */ import_react56.default.createElement(Select.Menu, __spreadValues({
|
9626
9674
|
maxHeight
|
9627
|
-
}, menuProps), hasNoResults && /* @__PURE__ */ import_react56.default.createElement(Select.NoResults, null, emptyState), inputItems.map((item, index) =>
|
9628
|
-
|
9629
|
-
|
9630
|
-
|
9631
|
-
|
9675
|
+
}, menuProps), hasNoResults && /* @__PURE__ */ import_react56.default.createElement(Select.NoResults, null, emptyState), inputItems.map((item, index) => {
|
9676
|
+
var _a3;
|
9677
|
+
return /* @__PURE__ */ import_react56.default.createElement(Select.Item, __spreadValues({
|
9678
|
+
key: (_a3 = getOptionKey == null ? void 0 : getOptionKey(item)) != null ? _a3 : itemToString(item),
|
9679
|
+
selected: item === selectedItem,
|
9680
|
+
highlighted: index === highlightedIndex || item === selectedItem
|
9681
|
+
}, getItemProps({ item, index })), renderOption(item));
|
9682
|
+
}))));
|
9632
9683
|
};
|
9633
9684
|
var ComboboxBaseSkeleton = () => /* @__PURE__ */ import_react56.default.createElement(Skeleton, {
|
9634
9685
|
height: 38
|
@@ -9686,7 +9737,9 @@ var Container2 = ({ maxWidth = "xl", children }) => /* @__PURE__ */ import_react
|
|
9686
9737
|
}, children);
|
9687
9738
|
|
9688
9739
|
// src/molecules/DataList/DataList.tsx
|
9689
|
-
var
|
9740
|
+
var import_react79 = __toESM(require("react"));
|
9741
|
+
var import_utils15 = require("@react-stately/utils");
|
9742
|
+
var import_castArray2 = __toESM(require("lodash/castArray"));
|
9690
9743
|
var import_compact = __toESM(require("lodash/compact"));
|
9691
9744
|
var import_groupBy2 = __toESM(require("lodash/groupBy"));
|
9692
9745
|
var import_isArray3 = __toESM(require("lodash/isArray"));
|
@@ -10779,6 +10832,49 @@ DataList.SubGroupSpacing = SubGroupSpacing;
|
|
10779
10832
|
DataList.SubGroupSpacing.displayName = "DataList.SubGroupSpacing";
|
10780
10833
|
DataList.Row = Row;
|
10781
10834
|
DataList.Row.displayName = "DataList.Row";
|
10835
|
+
var ToolbarContainer = (_a) => {
|
10836
|
+
var _b = _a, { className, sticky = true } = _b, rest = __objRest(_b, ["className", "sticky"]);
|
10837
|
+
return /* @__PURE__ */ import_react70.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
10838
|
+
role: "row",
|
10839
|
+
className: classNames(
|
10840
|
+
tw("col-span-full flex items-stretch py-4 px-l2 border-b border-default", {
|
10841
|
+
"sticky top-[47px] bg-white z-10": sticky
|
10842
|
+
}),
|
10843
|
+
className
|
10844
|
+
)
|
10845
|
+
}));
|
10846
|
+
};
|
10847
|
+
ToolbarContainer.displayName = "DataList.Toolbar.Container";
|
10848
|
+
var ToolbarGroup = (_a) => {
|
10849
|
+
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
10850
|
+
return /* @__PURE__ */ import_react70.default.createElement("div", __spreadProps(__spreadValues({
|
10851
|
+
role: "cell"
|
10852
|
+
}, rest), {
|
10853
|
+
className: classNames(tw("flex items-center px-l2 border-r-[1px] border-muted last:border-r-0"), className)
|
10854
|
+
}));
|
10855
|
+
};
|
10856
|
+
ToolbarGroup.displayName = "DataList.Toolbar.Group";
|
10857
|
+
var ToolbarSelectionCount = (_a) => {
|
10858
|
+
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
10859
|
+
return /* @__PURE__ */ import_react70.default.createElement(Typography, __spreadValues({
|
10860
|
+
variant: "small",
|
10861
|
+
color: "muted",
|
10862
|
+
className: classNames(tw("whitespace-nowrap"), className)
|
10863
|
+
}, rest));
|
10864
|
+
};
|
10865
|
+
var ToolbarActions = (_a) => {
|
10866
|
+
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
10867
|
+
return /* @__PURE__ */ import_react70.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
10868
|
+
className: classNames(tw("flex items-center gap-x-5"), className)
|
10869
|
+
}));
|
10870
|
+
};
|
10871
|
+
ToolbarActions.displayName = "DataList.Toolbar.Actions";
|
10872
|
+
DataList.Toolbar = {
|
10873
|
+
Container: ToolbarContainer,
|
10874
|
+
Group: ToolbarGroup,
|
10875
|
+
Actions: ToolbarActions,
|
10876
|
+
SelectionCount: ToolbarSelectionCount
|
10877
|
+
};
|
10782
10878
|
|
10783
10879
|
// src/utils/table/types.ts
|
10784
10880
|
var import_isArray2 = __toESM(require("lodash/isArray"));
|
@@ -11200,6 +11296,9 @@ var renameProperty = (oldProp, newProp, _a) => {
|
|
11200
11296
|
}, rest);
|
11201
11297
|
};
|
11202
11298
|
|
11299
|
+
// types/ContextualMenu.ts
|
11300
|
+
var defaultContextualMenuPlacement = "bottom-right";
|
11301
|
+
|
11203
11302
|
// src/molecules/DataList/DataListComponents.tsx
|
11204
11303
|
var import_more2 = __toESM(require_more());
|
11205
11304
|
var DataListRowMenu = ({
|
@@ -11217,6 +11316,7 @@ var DataListRowMenu = ({
|
|
11217
11316
|
return /* @__PURE__ */ import_react74.default.createElement(DataList.Cell, {
|
11218
11317
|
align: "right"
|
11219
11318
|
}, menuContent && /* @__PURE__ */ import_react74.default.createElement(DropdownMenu2, {
|
11319
|
+
placement: defaultContextualMenuPlacement,
|
11220
11320
|
onAction: (action) => onAction == null ? void 0 : onAction(action, row, index),
|
11221
11321
|
onOpenChange: onMenuOpenChange
|
11222
11322
|
}, /* @__PURE__ */ import_react74.default.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ import_react74.default.createElement(Button.Icon, {
|
@@ -11233,15 +11333,16 @@ var DataListRow = ({
|
|
11233
11333
|
active,
|
11234
11334
|
disabled,
|
11235
11335
|
renderFirstColumn,
|
11336
|
+
additionalRowProps = () => ({}),
|
11236
11337
|
additionalColumnProps = () => ({})
|
11237
11338
|
}) => {
|
11238
11339
|
var _a;
|
11239
11340
|
const isRowDisabled = (_a = disabled == null ? void 0 : disabled(row, index, rows)) != null ? _a : false;
|
11240
|
-
return /* @__PURE__ */ import_react74.default.createElement(DataList.Row, {
|
11341
|
+
return /* @__PURE__ */ import_react74.default.createElement(DataList.Row, __spreadValues({
|
11241
11342
|
key: row.id,
|
11242
11343
|
disabled: isRowDisabled,
|
11243
11344
|
active
|
11244
|
-
}, renderFirstColumn == null ? void 0 : renderFirstColumn(row, index, rows), /* @__PURE__ */ import_react74.default.createElement(List, {
|
11345
|
+
}, additionalRowProps(row, index, rows)), renderFirstColumn == null ? void 0 : renderFirstColumn(row, index, rows), /* @__PURE__ */ import_react74.default.createElement(List, {
|
11245
11346
|
items: columns,
|
11246
11347
|
renderItem: (column, columnIndex) => /* @__PURE__ */ import_react74.default.createElement(DataList.Cell, __spreadValues(__spreadValues({}, cellProps(column)), additionalColumnProps(column, columnIndex, columns, row)), /* @__PURE__ */ import_react74.default.createElement(DataListCell, {
|
11247
11348
|
column,
|
@@ -11301,12 +11402,33 @@ var DataListCell = ({
|
|
11301
11402
|
return column.tooltip ? /* @__PURE__ */ import_react74.default.createElement(Tooltip, __spreadValues({}, column.tooltip(row, index, rows)), cellContent) : /* @__PURE__ */ import_react74.default.createElement(import_react74.default.Fragment, null, cellContent);
|
11302
11403
|
};
|
11303
11404
|
|
11405
|
+
// src/molecules/DataList/DataListContext.tsx
|
11406
|
+
var import_react75 = require("react");
|
11407
|
+
var DataListContext = (0, import_react75.createContext)({
|
11408
|
+
rows: [],
|
11409
|
+
selectedRows: void 0
|
11410
|
+
});
|
11411
|
+
var useDataListContext = () => {
|
11412
|
+
const ctx = (0, import_react75.useContext)(DataListContext);
|
11413
|
+
if (!ctx) {
|
11414
|
+
throw new Error("DataListContext was used outside of provider.");
|
11415
|
+
}
|
11416
|
+
return ctx;
|
11417
|
+
};
|
11418
|
+
|
11304
11419
|
// src/molecules/DataList/DataListGroup.tsx
|
11305
|
-
var
|
11420
|
+
var import_react76 = __toESM(require("react"));
|
11306
11421
|
var import_isFunction2 = __toESM(require("lodash/isFunction"));
|
11422
|
+
|
11423
|
+
// src/molecules/DataList/utils.ts
|
11424
|
+
var flattenRows = (rows) => areRowsGrouped(rows) ? Object.values(rows).flatMap(flattenRows) : rows;
|
11425
|
+
|
11426
|
+
// src/molecules/DataList/DataListGroup.tsx
|
11307
11427
|
var GAP = 8;
|
11308
11428
|
var INDENTATION = 28;
|
11309
11429
|
var sortGroupKeys = (groupKeys) => [...groupKeys].sort((a) => a === "undefined" ? -1 : 1);
|
11430
|
+
var getDefaultRowCheckboxLabel = () => "Select row";
|
11431
|
+
var getDefaultGroupCheckboxLabel = (key) => `Select ${key}`;
|
11310
11432
|
var DataListGroup = (_a) => {
|
11311
11433
|
var _b = _a, {
|
11312
11434
|
groups,
|
@@ -11325,21 +11447,30 @@ var DataListGroup = (_a) => {
|
|
11325
11447
|
onAction,
|
11326
11448
|
onGroupToggled,
|
11327
11449
|
onMenuOpenChange,
|
11328
|
-
rows
|
11450
|
+
rows,
|
11451
|
+
selectable,
|
11452
|
+
selectedRows,
|
11453
|
+
onSelectionChange,
|
11454
|
+
getRowCheckboxLabel = getDefaultRowCheckboxLabel,
|
11455
|
+
getGroupCheckboxLabel = getDefaultGroupCheckboxLabel
|
11329
11456
|
} = props;
|
11330
11457
|
const groupKeys = groups ? Object.keys(groups) : void 0;
|
11331
11458
|
const hasCustomRowForGroup = (0, import_isFunction2.default)(getGroupRow);
|
11332
11459
|
if (!areRowsGrouped(groups)) {
|
11333
|
-
return /* @__PURE__ */
|
11460
|
+
return /* @__PURE__ */ import_react76.default.createElement(List, {
|
11334
11461
|
items: groups,
|
11335
11462
|
renderItem: (row, index) => {
|
11336
|
-
|
11463
|
+
var _a2;
|
11464
|
+
const isChecked = (_a2 = selectedRows == null ? void 0 : selectedRows.includes(row.id)) != null ? _a2 : false;
|
11465
|
+
const isDisabled = disabled == null ? void 0 : disabled(row, index, rows);
|
11466
|
+
return /* @__PURE__ */ import_react76.default.createElement(DataListRow, {
|
11337
11467
|
key: row.id,
|
11338
11468
|
columns,
|
11339
11469
|
row,
|
11340
11470
|
index,
|
11341
11471
|
rows,
|
11342
|
-
|
11472
|
+
active: selectable && isChecked,
|
11473
|
+
menu: /* @__PURE__ */ import_react76.default.createElement(DataListRowMenu, {
|
11343
11474
|
row,
|
11344
11475
|
index,
|
11345
11476
|
menu,
|
@@ -11348,11 +11479,22 @@ var DataListGroup = (_a) => {
|
|
11348
11479
|
menuAriaLabel
|
11349
11480
|
}),
|
11350
11481
|
disabled,
|
11482
|
+
additionalRowProps: () => selectable ? {
|
11483
|
+
"aria-selected": isChecked
|
11484
|
+
} : {},
|
11351
11485
|
additionalColumnProps: (_, columnIndex) => columnIndex === 0 ? {
|
11352
11486
|
style: {
|
11353
11487
|
paddingLeft: `${GAP + level * INDENTATION}px`
|
11354
11488
|
}
|
11355
|
-
} : {}
|
11489
|
+
} : {},
|
11490
|
+
renderFirstColumn: (row2, index2) => {
|
11491
|
+
return /* @__PURE__ */ import_react76.default.createElement(import_react76.default.Fragment, null, selectable && /* @__PURE__ */ import_react76.default.createElement(DataList.Cell, null, /* @__PURE__ */ import_react76.default.createElement(Checkbox, {
|
11492
|
+
"aria-label": getRowCheckboxLabel(row2, index2, isChecked, rows),
|
11493
|
+
onChange: onSelectionChange(row2.id),
|
11494
|
+
checked: isChecked,
|
11495
|
+
disabled: isDisabled
|
11496
|
+
})));
|
11497
|
+
}
|
11356
11498
|
});
|
11357
11499
|
}
|
11358
11500
|
});
|
@@ -11360,13 +11502,13 @@ var DataListGroup = (_a) => {
|
|
11360
11502
|
if (!groupKeys) {
|
11361
11503
|
return null;
|
11362
11504
|
}
|
11363
|
-
return /* @__PURE__ */
|
11505
|
+
return /* @__PURE__ */ import_react76.default.createElement(List, {
|
11364
11506
|
items: sortGroupKeys(groupKeys),
|
11365
|
-
renderItem: (key) => {
|
11366
|
-
var _a2;
|
11507
|
+
renderItem: (key, index) => {
|
11508
|
+
var _a2, _b2;
|
11367
11509
|
const group = groups[key];
|
11368
11510
|
if (key === "undefined" || key === void 0) {
|
11369
|
-
return /* @__PURE__ */
|
11511
|
+
return /* @__PURE__ */ import_react76.default.createElement(DataListGroup, __spreadProps(__spreadValues({
|
11370
11512
|
key: "undefined",
|
11371
11513
|
level
|
11372
11514
|
}, props), {
|
@@ -11374,45 +11516,59 @@ var DataListGroup = (_a) => {
|
|
11374
11516
|
}));
|
11375
11517
|
}
|
11376
11518
|
const openPanelId = expandedGroupIds ? (_a2 = expandedGroupIds.find((id) => id === key)) != null ? _a2 : null : void 0;
|
11377
|
-
|
11519
|
+
const nestedRowIds = flattenRows(group).map((row) => row.id);
|
11520
|
+
const nestedSelectedIds = (_b2 = selectedRows == null ? void 0 : selectedRows.filter((id) => nestedRowIds.includes(id))) != null ? _b2 : [];
|
11521
|
+
const allSelected = nestedRowIds.length === nestedSelectedIds.length;
|
11522
|
+
const isChecked = nestedSelectedIds.length > 0;
|
11523
|
+
return /* @__PURE__ */ import_react76.default.createElement(Accordion, {
|
11378
11524
|
key,
|
11379
11525
|
openPanelId
|
11380
|
-
}, hasCustomRowForGroup && /* @__PURE__ */
|
11381
|
-
active: !!openPanelId
|
11382
|
-
}, /* @__PURE__ */
|
11526
|
+
}, hasCustomRowForGroup && /* @__PURE__ */ import_react76.default.createElement(DataList.Row, {
|
11527
|
+
active: !!openPanelId || selectable && isChecked
|
11528
|
+
}, selectable && /* @__PURE__ */ import_react76.default.createElement(DataList.Cell, null, /* @__PURE__ */ import_react76.default.createElement(Checkbox, {
|
11529
|
+
"aria-label": getGroupCheckboxLabel(key, group, index, isChecked, rows),
|
11530
|
+
checked: isChecked,
|
11531
|
+
indeterminate: isChecked && !allSelected,
|
11532
|
+
onChange: onSelectionChange(nestedRowIds)
|
11533
|
+
})), /* @__PURE__ */ import_react76.default.createElement(List, {
|
11383
11534
|
items: columns,
|
11384
|
-
renderItem: (column, idx) => /* @__PURE__ */
|
11535
|
+
renderItem: (column, idx) => /* @__PURE__ */ import_react76.default.createElement(DataList.Cell, __spreadProps(__spreadValues({}, cellProps(column)), {
|
11385
11536
|
className: tw("gap-3"),
|
11386
11537
|
style: idx === 0 ? { paddingLeft: `${GAP + level * INDENTATION}px` } : void 0
|
11387
|
-
}), idx === 0 && /* @__PURE__ */
|
11538
|
+
}), idx === 0 && /* @__PURE__ */ import_react76.default.createElement(Accordion.Toggle, {
|
11388
11539
|
panelId: key,
|
11389
11540
|
onChange: onGroupToggled
|
11390
|
-
}), /* @__PURE__ */
|
11541
|
+
}), /* @__PURE__ */ import_react76.default.createElement(DataListCell, {
|
11391
11542
|
column,
|
11392
11543
|
row: getGroupRow(key, group),
|
11393
11544
|
index: -1,
|
11394
11545
|
rows: []
|
11395
11546
|
}))
|
11396
|
-
}), /* @__PURE__ */
|
11547
|
+
}), /* @__PURE__ */ import_react76.default.createElement(DataListRowMenu, {
|
11397
11548
|
row: getGroupRow(key, group),
|
11398
11549
|
index: -1,
|
11399
11550
|
menu,
|
11400
11551
|
onAction,
|
11401
11552
|
onMenuOpenChange,
|
11402
11553
|
menuAriaLabel
|
11403
|
-
})), !hasCustomRowForGroup && /* @__PURE__ */
|
11404
|
-
active: !!openPanelId
|
11405
|
-
}, /* @__PURE__ */
|
11554
|
+
})), !hasCustomRowForGroup && /* @__PURE__ */ import_react76.default.createElement(DataList.Row, {
|
11555
|
+
active: !!openPanelId || selectable && isChecked
|
11556
|
+
}, selectable && /* @__PURE__ */ import_react76.default.createElement(DataList.Cell, null, /* @__PURE__ */ import_react76.default.createElement(Checkbox, {
|
11557
|
+
"aria-label": getGroupCheckboxLabel(key, group, index, isChecked, rows),
|
11558
|
+
checked: isChecked,
|
11559
|
+
indeterminate: isChecked && !allSelected,
|
11560
|
+
onChange: onSelectionChange(nestedRowIds)
|
11561
|
+
})), /* @__PURE__ */ import_react76.default.createElement(DataList.Cell, {
|
11406
11562
|
className: tw("gap-3"),
|
11407
|
-
style: { paddingLeft: `${GAP + level * INDENTATION}px`, gridColumn:
|
11408
|
-
}, /* @__PURE__ */
|
11563
|
+
style: { paddingLeft: `${GAP + level * INDENTATION}px`, gridColumn: `${selectable ? 2 : 1} / -1` }
|
11564
|
+
}, /* @__PURE__ */ import_react76.default.createElement(Accordion.Toggle, {
|
11409
11565
|
panelId: key,
|
11410
11566
|
onChange: onGroupToggled
|
11411
|
-
}), "Group: ", /* @__PURE__ */
|
11567
|
+
}), "Group: ", /* @__PURE__ */ import_react76.default.createElement("b", null, key))), /* @__PURE__ */ import_react76.default.createElement(DataList.Row, {
|
11412
11568
|
subgroup: true
|
11413
|
-
}, /* @__PURE__ */
|
11569
|
+
}, /* @__PURE__ */ import_react76.default.createElement(Accordion.UnanimatedPanel, {
|
11414
11570
|
panelId: key
|
11415
|
-
}, /* @__PURE__ */
|
11571
|
+
}, /* @__PURE__ */ import_react76.default.createElement(DataListGroup, __spreadProps(__spreadValues({
|
11416
11572
|
level: level + 1
|
11417
11573
|
}, props), {
|
11418
11574
|
groups: group
|
@@ -11422,26 +11578,26 @@ var DataListGroup = (_a) => {
|
|
11422
11578
|
};
|
11423
11579
|
|
11424
11580
|
// src/molecules/DataList/DataListSkeleton.tsx
|
11425
|
-
var
|
11581
|
+
var import_react77 = __toESM(require("react"));
|
11426
11582
|
var DataListSkeleton = ({ columns = ["1", "2", "2", 52], rows = 5 }) => {
|
11427
11583
|
const columnsAmount = [...Array(typeof columns === "number" ? columns : columns.length).keys()];
|
11428
|
-
return /* @__PURE__ */
|
11584
|
+
return /* @__PURE__ */ import_react77.default.createElement(Template, {
|
11429
11585
|
role: "table",
|
11430
11586
|
columns
|
11431
|
-
}, /* @__PURE__ */
|
11587
|
+
}, /* @__PURE__ */ import_react77.default.createElement(DataList.Row, null, columnsAmount.map((_, index) => /* @__PURE__ */ import_react77.default.createElement(DataList.HeadCell, {
|
11432
11588
|
key: index
|
11433
|
-
}, /* @__PURE__ */
|
11589
|
+
}, /* @__PURE__ */ import_react77.default.createElement(Skeleton, {
|
11434
11590
|
width: "100%",
|
11435
11591
|
height: 17.5
|
11436
|
-
})))), /* @__PURE__ */
|
11592
|
+
})))), /* @__PURE__ */ import_react77.default.createElement(List, {
|
11437
11593
|
items: [...Array(rows).keys()],
|
11438
|
-
renderItem: (item) => /* @__PURE__ */
|
11594
|
+
renderItem: (item) => /* @__PURE__ */ import_react77.default.createElement(DataList.Row, {
|
11439
11595
|
key: item
|
11440
|
-
}, /* @__PURE__ */
|
11596
|
+
}, /* @__PURE__ */ import_react77.default.createElement(List, {
|
11441
11597
|
items: columnsAmount,
|
11442
|
-
renderItem: (key) => /* @__PURE__ */
|
11598
|
+
renderItem: (key) => /* @__PURE__ */ import_react77.default.createElement(DataList.Cell, {
|
11443
11599
|
key
|
11444
|
-
}, /* @__PURE__ */
|
11600
|
+
}, /* @__PURE__ */ import_react77.default.createElement(Skeleton, {
|
11445
11601
|
width: "100%",
|
11446
11602
|
height: 17.5
|
11447
11603
|
}))
|
@@ -11449,6 +11605,38 @@ var DataListSkeleton = ({ columns = ["1", "2", "2", 52], rows = 5 }) => {
|
|
11449
11605
|
}));
|
11450
11606
|
};
|
11451
11607
|
|
11608
|
+
// src/molecules/DataList/DataListToolbar.tsx
|
11609
|
+
var import_react78 = __toESM(require("react"));
|
11610
|
+
var import_castArray = __toESM(require("lodash/castArray"));
|
11611
|
+
var DataListToolbar = ({
|
11612
|
+
actions: _actions,
|
11613
|
+
menu,
|
11614
|
+
onAction,
|
11615
|
+
onMenuOpenChange,
|
11616
|
+
menuLabel,
|
11617
|
+
sticky = true
|
11618
|
+
}) => {
|
11619
|
+
var _a;
|
11620
|
+
const { selectedRows } = useDataListContext();
|
11621
|
+
const actions = (0, import_castArray.default)(_actions).filter(Boolean);
|
11622
|
+
return /* @__PURE__ */ import_react78.default.createElement(DataList.Toolbar.Container, {
|
11623
|
+
sticky
|
11624
|
+
}, /* @__PURE__ */ import_react78.default.createElement(DataList.Toolbar.Group, null, /* @__PURE__ */ import_react78.default.createElement(DataList.Toolbar.SelectionCount, null, (_a = selectedRows == null ? void 0 : selectedRows.length) != null ? _a : 0, " selected")), actions.length > 0 && /* @__PURE__ */ import_react78.default.createElement(DataList.Toolbar.Group, null, /* @__PURE__ */ import_react78.default.createElement(DataList.Toolbar.Actions, null, actions.map(
|
11625
|
+
(action) => renderAction({
|
11626
|
+
kind: "ghost",
|
11627
|
+
dense: true,
|
11628
|
+
action: __spreadProps(__spreadValues({}, action), { onClick: () => action.onClick(selectedRows != null ? selectedRows : []) })
|
11629
|
+
})
|
11630
|
+
))), menu && /* @__PURE__ */ import_react78.default.createElement(DataList.Toolbar.Group, null, /* @__PURE__ */ import_react78.default.createElement(DropdownMenu2, {
|
11631
|
+
placement: defaultContextualMenuPlacement,
|
11632
|
+
onAction: (key) => onAction == null ? void 0 : onAction(key, selectedRows != null ? selectedRows : []),
|
11633
|
+
onOpenChange: onMenuOpenChange
|
11634
|
+
}, /* @__PURE__ */ import_react78.default.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ import_react78.default.createElement(Button.GhostDropdown, {
|
11635
|
+
dense: true
|
11636
|
+
}, menuLabel)), menu)));
|
11637
|
+
};
|
11638
|
+
DataListToolbar.displayName = "DataList.Toolbar";
|
11639
|
+
|
11452
11640
|
// src/molecules/DataList/DataList.tsx
|
11453
11641
|
var DataList2 = (_a) => {
|
11454
11642
|
var _b = _a, {
|
@@ -11469,7 +11657,14 @@ var DataList2 = (_a) => {
|
|
11469
11657
|
onGroupToggled,
|
11470
11658
|
expandedGroupIds,
|
11471
11659
|
defaultSort,
|
11472
|
-
onSortChanged
|
11660
|
+
onSortChanged,
|
11661
|
+
selectable,
|
11662
|
+
getRowCheckboxLabel = getDefaultRowCheckboxLabel,
|
11663
|
+
getGroupCheckboxLabel = getDefaultGroupCheckboxLabel,
|
11664
|
+
selectedRows,
|
11665
|
+
defaultSelectedRows,
|
11666
|
+
onSelectionChange,
|
11667
|
+
toolbar
|
11473
11668
|
} = _b, rest = __objRest(_b, [
|
11474
11669
|
"columns",
|
11475
11670
|
"rows",
|
@@ -11488,9 +11683,21 @@ var DataList2 = (_a) => {
|
|
11488
11683
|
"onGroupToggled",
|
11489
11684
|
"expandedGroupIds",
|
11490
11685
|
"defaultSort",
|
11491
|
-
"onSortChanged"
|
11686
|
+
"onSortChanged",
|
11687
|
+
"selectable",
|
11688
|
+
"getRowCheckboxLabel",
|
11689
|
+
"getGroupCheckboxLabel",
|
11690
|
+
"selectedRows",
|
11691
|
+
"defaultSelectedRows",
|
11692
|
+
"onSelectionChange",
|
11693
|
+
"toolbar"
|
11492
11694
|
]);
|
11493
|
-
var _a2;
|
11695
|
+
var _a2, _b2;
|
11696
|
+
const [selected, setSelected] = (0, import_utils15.useControlledState)(
|
11697
|
+
selectedRows,
|
11698
|
+
defaultSelectedRows,
|
11699
|
+
(value) => onSelectionChange == null ? void 0 : onSelectionChange(value != null ? value : [])
|
11700
|
+
);
|
11494
11701
|
const defaultSortedColumn = columns.find((c) => c.headerName === (defaultSort == null ? void 0 : defaultSort.headerName));
|
11495
11702
|
const initialSortState = defaultSortedColumn ? { column: defaultSortedColumn, direction: (_a2 = defaultSort == null ? void 0 : defaultSort.direction) != null ? _a2 : "ascending" } : void 0;
|
11496
11703
|
const [sort, updateSort] = useTableSort(
|
@@ -11500,6 +11707,7 @@ var DataList2 = (_a) => {
|
|
11500
11707
|
const groups = areRowsGrouped(rows) ? rows : group ? (0, import_isFunction3.default)(group) ? group(sortedRows) : (0, import_groupBy2.default)(sortedRows, group) : void 0;
|
11501
11708
|
const isCollapsible = (0, import_isFunction3.default)(rowDetails);
|
11502
11709
|
const templateColumns = (0, import_compact.default)([
|
11710
|
+
selectable ? "fit-content(28px)" : void 0,
|
11503
11711
|
isCollapsible ? "fit-content(50px)" : void 0,
|
11504
11712
|
...columns.map((column) => {
|
11505
11713
|
var _a3;
|
@@ -11507,51 +11715,84 @@ var DataList2 = (_a) => {
|
|
11507
11715
|
}),
|
11508
11716
|
menu ? "fit-content(28px)" : void 0
|
11509
11717
|
]);
|
11510
|
-
const PaginationFooter =
|
11511
|
-
({ children }) => /* @__PURE__ */
|
11718
|
+
const PaginationFooter = import_react79.default.useCallback(
|
11719
|
+
({ children }) => /* @__PURE__ */ import_react79.default.createElement("div", {
|
11512
11720
|
style: { gridColumn: "1 / -1" },
|
11513
11721
|
role: "row"
|
11514
|
-
}, /* @__PURE__ */
|
11722
|
+
}, /* @__PURE__ */ import_react79.default.createElement("div", {
|
11515
11723
|
role: "cell"
|
11516
11724
|
}, children)),
|
11517
11725
|
[]
|
11518
11726
|
);
|
11519
|
-
|
11727
|
+
const handleSelectionChange = (id) => (e) => {
|
11728
|
+
const ids = (0, import_castArray2.default)(id);
|
11729
|
+
if (e.target.checked) {
|
11730
|
+
setSelected([...selected != null ? selected : [], ...ids]);
|
11731
|
+
} else {
|
11732
|
+
setSelected(selected == null ? void 0 : selected.filter((_id) => !ids.includes(_id)));
|
11733
|
+
}
|
11734
|
+
};
|
11735
|
+
const allRows = flattenRows(rows);
|
11736
|
+
const totalSelected = (_b2 = selected == null ? void 0 : selected.length) != null ? _b2 : 0;
|
11737
|
+
const allEnabledRowIds = (0, import_compact.default)(
|
11738
|
+
allRows.map((row, index) => (disabled == null ? void 0 : disabled(row, index, sortedRows)) ? void 0 : row.id)
|
11739
|
+
);
|
11740
|
+
const allRowsSelected = totalSelected >= allEnabledRowIds.length;
|
11741
|
+
return /* @__PURE__ */ import_react79.default.createElement(DataListContext.Provider, {
|
11742
|
+
value: {
|
11743
|
+
rows: (0, import_isArray3.default)(rows) ? sortedRows : rows,
|
11744
|
+
selectedRows: selected
|
11745
|
+
}
|
11746
|
+
}, /* @__PURE__ */ import_react79.default.createElement(Template, {
|
11520
11747
|
className: "Aquarium-DataList",
|
11521
11748
|
columns: templateColumns,
|
11522
11749
|
role: "table"
|
11523
|
-
}, !hideHeader && /* @__PURE__ */
|
11750
|
+
}, !hideHeader && /* @__PURE__ */ import_react79.default.createElement(import_react79.default.Fragment, null, /* @__PURE__ */ import_react79.default.createElement(DataList.Row, {
|
11524
11751
|
header: true
|
11525
|
-
},
|
11752
|
+
}, selectable && /* @__PURE__ */ import_react79.default.createElement(DataList.HeadCell, {
|
11753
|
+
align: "left",
|
11754
|
+
sticky
|
11755
|
+
}, /* @__PURE__ */ import_react79.default.createElement(Checkbox, {
|
11756
|
+
"aria-label": "Select all rows",
|
11757
|
+
indeterminate: totalSelected > 0 && totalSelected < allRows.length,
|
11758
|
+
checked: totalSelected > 0,
|
11759
|
+
onChange: () => {
|
11760
|
+
if (!allRowsSelected) {
|
11761
|
+
setSelected(allEnabledRowIds);
|
11762
|
+
} else {
|
11763
|
+
setSelected([]);
|
11764
|
+
}
|
11765
|
+
}
|
11766
|
+
})), isCollapsible && /* @__PURE__ */ import_react79.default.createElement(DataList.HeadCell, {
|
11526
11767
|
align: "left",
|
11527
11768
|
sticky
|
11528
11769
|
}), columns.map((column) => {
|
11529
|
-
const content = column.headerTooltip ? /* @__PURE__ */
|
11770
|
+
const content = column.headerTooltip ? /* @__PURE__ */ import_react79.default.createElement(Tooltip, {
|
11530
11771
|
placement: column.headerTooltip.placement,
|
11531
11772
|
content: column.headerTooltip.content
|
11532
11773
|
}, column.headerName) : column.headerName;
|
11533
|
-
const headerContentAndIcon = column.icon ? /* @__PURE__ */
|
11774
|
+
const headerContentAndIcon = column.icon ? /* @__PURE__ */ import_react79.default.createElement(Box.Flex, {
|
11534
11775
|
flexDirection: "row",
|
11535
11776
|
gap: "3",
|
11536
11777
|
alignItems: "center"
|
11537
|
-
}, /* @__PURE__ */
|
11778
|
+
}, /* @__PURE__ */ import_react79.default.createElement(InlineIcon, {
|
11538
11779
|
icon: column.icon,
|
11539
11780
|
height: "22",
|
11540
11781
|
color: "grey-70",
|
11541
11782
|
"aria-hidden": true
|
11542
11783
|
}), content) : content;
|
11543
|
-
return columnIsFieldColumn(column) && column.sortable || column.sort ? /* @__PURE__ */
|
11784
|
+
return columnIsFieldColumn(column) && column.sortable || column.sort ? /* @__PURE__ */ import_react79.default.createElement(DataList.SortCell, __spreadValues({
|
11544
11785
|
direction: sort && sort.column.headerName === column.headerName ? sort.direction : "none",
|
11545
11786
|
onClick: () => updateSort(column),
|
11546
11787
|
sticky
|
11547
|
-
}, cellProps(column)), headerContentAndIcon) : /* @__PURE__ */
|
11788
|
+
}, cellProps(column)), headerContentAndIcon) : /* @__PURE__ */ import_react79.default.createElement(DataList.HeadCell, __spreadProps(__spreadValues({}, cellProps(column)), {
|
11548
11789
|
sticky
|
11549
11790
|
}), headerContentAndIcon);
|
11550
|
-
}), menu && /* @__PURE__ */
|
11791
|
+
}), menu && /* @__PURE__ */ import_react79.default.createElement(DataList.HeadCell, {
|
11551
11792
|
align: "right",
|
11552
11793
|
"aria-label": menuAriaLabel,
|
11553
11794
|
sticky
|
11554
|
-
}, menuHeaderName)), groups && /* @__PURE__ */
|
11795
|
+
}, menuHeaderName)), toolbar), groups && /* @__PURE__ */ import_react79.default.createElement(DataListGroup, {
|
11555
11796
|
columns,
|
11556
11797
|
disabled,
|
11557
11798
|
getGroupRow,
|
@@ -11561,21 +11802,30 @@ var DataList2 = (_a) => {
|
|
11561
11802
|
onAction,
|
11562
11803
|
onGroupToggled,
|
11563
11804
|
onMenuOpenChange,
|
11805
|
+
selectable,
|
11806
|
+
selectedRows: selected,
|
11807
|
+
onSelectionChange: handleSelectionChange,
|
11808
|
+
getRowCheckboxLabel,
|
11809
|
+
getGroupCheckboxLabel,
|
11564
11810
|
rows,
|
11565
11811
|
groups,
|
11566
11812
|
level: 0
|
11567
|
-
}), !groups && /* @__PURE__ */
|
11813
|
+
}), !groups && /* @__PURE__ */ import_react79.default.createElement(List, __spreadProps(__spreadValues({}, rest), {
|
11568
11814
|
paginationContainer: PaginationFooter,
|
11569
11815
|
items: sortedRows,
|
11570
11816
|
renderItem: (row, index) => {
|
11817
|
+
var _a3;
|
11571
11818
|
const details = rowDetails == null ? void 0 : rowDetails(row, index, sortedRows);
|
11572
|
-
const
|
11819
|
+
const isChecked = (_a3 = selected == null ? void 0 : selected.includes(row.id)) != null ? _a3 : false;
|
11820
|
+
const isDisabled = disabled == null ? void 0 : disabled(row, index, sortedRows);
|
11821
|
+
const content = /* @__PURE__ */ import_react79.default.createElement(DataListRow, {
|
11573
11822
|
key: row.id,
|
11574
11823
|
columns,
|
11575
11824
|
row,
|
11576
11825
|
index,
|
11577
11826
|
rows: sortedRows,
|
11578
|
-
|
11827
|
+
active: selectable && isChecked,
|
11828
|
+
menu: /* @__PURE__ */ import_react79.default.createElement(DataListRowMenu, {
|
11579
11829
|
row,
|
11580
11830
|
index,
|
11581
11831
|
menu,
|
@@ -11584,43 +11834,57 @@ var DataList2 = (_a) => {
|
|
11584
11834
|
menuAriaLabel
|
11585
11835
|
}),
|
11586
11836
|
disabled,
|
11587
|
-
|
11588
|
-
|
11589
|
-
|
11590
|
-
|
11837
|
+
additionalRowProps: (row2) => {
|
11838
|
+
var _a4;
|
11839
|
+
return selectable ? {
|
11840
|
+
"aria-selected": (_a4 = selected == null ? void 0 : selected.includes(row2.id)) != null ? _a4 : false
|
11841
|
+
} : {};
|
11842
|
+
},
|
11843
|
+
renderFirstColumn: (row2, index2) => {
|
11844
|
+
return /* @__PURE__ */ import_react79.default.createElement(import_react79.default.Fragment, null, selectable && /* @__PURE__ */ import_react79.default.createElement(DataList.Cell, null, /* @__PURE__ */ import_react79.default.createElement(Checkbox, {
|
11845
|
+
"aria-label": getRowCheckboxLabel(row2, index2, isChecked, sortedRows),
|
11846
|
+
onChange: handleSelectionChange(row2.id),
|
11847
|
+
checked: isChecked,
|
11848
|
+
disabled: isDisabled
|
11849
|
+
})), rowDetails !== void 0 && /* @__PURE__ */ import_react79.default.createElement(DataList.Cell, null, details && /* @__PURE__ */ import_react79.default.createElement(Accordion.Toggle, {
|
11850
|
+
panelId: row2.id.toString(),
|
11851
|
+
onChange: onGroupToggled
|
11852
|
+
})));
|
11853
|
+
}
|
11591
11854
|
});
|
11592
11855
|
if (!details) {
|
11593
11856
|
return content;
|
11594
11857
|
}
|
11595
|
-
return /* @__PURE__ */
|
11858
|
+
return /* @__PURE__ */ import_react79.default.createElement(Accordion, {
|
11596
11859
|
key: row.id,
|
11597
11860
|
openPanelId: expandedGroupIds ? expandedGroupIds.find((id) => id === row.id) || null : void 0
|
11598
|
-
}, content, /* @__PURE__ */
|
11861
|
+
}, content, /* @__PURE__ */ import_react79.default.createElement(Accordion.Panel, {
|
11599
11862
|
role: "row",
|
11600
11863
|
panelId: row.id.toString(),
|
11601
11864
|
className: tw("col-span-full bg-grey-0 border-b border-default"),
|
11602
11865
|
"aria-label": `row ${row.id.toString()} details`
|
11603
|
-
}, /* @__PURE__ */
|
11866
|
+
}, /* @__PURE__ */ import_react79.default.createElement("div", {
|
11604
11867
|
role: "cell"
|
11605
11868
|
}, details)));
|
11606
11869
|
}
|
11607
|
-
})));
|
11870
|
+
}))));
|
11608
11871
|
};
|
11609
11872
|
DataList2.Skeleton = DataListSkeleton;
|
11873
|
+
DataList2.Toolbar = DataListToolbar;
|
11610
11874
|
|
11611
11875
|
// src/molecules/DataTable/DataTable.tsx
|
11612
|
-
var
|
11876
|
+
var import_react82 = __toESM(require("react"));
|
11613
11877
|
var import_compact2 = __toESM(require("lodash/compact"));
|
11614
11878
|
var import_isFunction4 = __toESM(require("lodash/isFunction"));
|
11615
11879
|
|
11616
11880
|
// src/molecules/Table/Table.tsx
|
11617
|
-
var
|
11881
|
+
var import_react81 = __toESM(require("react"));
|
11618
11882
|
|
11619
11883
|
// src/utils/table/useScrollTarget.ts
|
11620
|
-
var
|
11884
|
+
var import_react80 = __toESM(require("react"));
|
11621
11885
|
var useScrollTarget = (callback) => {
|
11622
|
-
const targetRef =
|
11623
|
-
|
11886
|
+
const targetRef = import_react80.default.useRef(null);
|
11887
|
+
import_react80.default.useLayoutEffect(() => {
|
11624
11888
|
const observer = new IntersectionObserver((entries) => entries[0].isIntersecting && callback && callback(), {
|
11625
11889
|
root: null,
|
11626
11890
|
rootMargin: `0px 0px 200px 0px`
|
@@ -11638,12 +11902,12 @@ var Table2 = (_a) => {
|
|
11638
11902
|
var _b = _a, { children, onPrev, onNext } = _b, rest = __objRest(_b, ["children", "onPrev", "onNext"]);
|
11639
11903
|
const bottomRef = useScrollTarget(onNext);
|
11640
11904
|
const topRef = useScrollTarget(onPrev);
|
11641
|
-
return /* @__PURE__ */
|
11905
|
+
return /* @__PURE__ */ import_react81.default.createElement("div", {
|
11642
11906
|
className: classNames("Aquarium-Table", tw("relative w-full"))
|
11643
|
-
}, /* @__PURE__ */
|
11907
|
+
}, /* @__PURE__ */ import_react81.default.createElement("div", {
|
11644
11908
|
ref: topRef,
|
11645
11909
|
className: tw("absolute top-0 h-1 w-full left-0 bg-transparent")
|
11646
|
-
}), /* @__PURE__ */
|
11910
|
+
}), /* @__PURE__ */ import_react81.default.createElement(Table, __spreadValues({}, rest), children), /* @__PURE__ */ import_react81.default.createElement("div", {
|
11647
11911
|
ref: bottomRef,
|
11648
11912
|
className: tw("absolute bottom-0 h-1 w-full left-0 bg-transparent")
|
11649
11913
|
}));
|
@@ -11704,13 +11968,13 @@ var DataTable = (_a) => {
|
|
11704
11968
|
);
|
11705
11969
|
const sortedRows = sortRowsBy(rows, sort);
|
11706
11970
|
const amountOfColumns = columns.length + (menu ? 1 : 0);
|
11707
|
-
const PaginationFooter =
|
11708
|
-
({ children }) => /* @__PURE__ */
|
11971
|
+
const PaginationFooter = import_react82.default.useCallback(
|
11972
|
+
({ children }) => /* @__PURE__ */ import_react82.default.createElement("tfoot", null, /* @__PURE__ */ import_react82.default.createElement("tr", null, /* @__PURE__ */ import_react82.default.createElement("td", {
|
11709
11973
|
colSpan: amountOfColumns
|
11710
11974
|
}, children))),
|
11711
11975
|
[amountOfColumns]
|
11712
11976
|
);
|
11713
|
-
return /* @__PURE__ */
|
11977
|
+
return /* @__PURE__ */ import_react82.default.createElement(Table2, {
|
11714
11978
|
ariaLabel,
|
11715
11979
|
onNext,
|
11716
11980
|
onPrev,
|
@@ -11722,40 +11986,40 @@ var DataTable = (_a) => {
|
|
11722
11986
|
"table-fixed": layout === "fixed"
|
11723
11987
|
})
|
11724
11988
|
)
|
11725
|
-
}, /* @__PURE__ */
|
11989
|
+
}, /* @__PURE__ */ import_react82.default.createElement(Table2.Head, {
|
11726
11990
|
sticky
|
11727
11991
|
}, (0, import_compact2.default)([
|
11728
11992
|
...columns.map((column) => {
|
11729
|
-
const content = column.headerTooltip && !column.headerInvisible ? /* @__PURE__ */
|
11993
|
+
const content = column.headerTooltip && !column.headerInvisible ? /* @__PURE__ */ import_react82.default.createElement(Tooltip, {
|
11730
11994
|
placement: column.headerTooltip.placement,
|
11731
11995
|
content: column.headerTooltip.content
|
11732
11996
|
}, column.headerName) : !column.headerInvisible && column.headerName;
|
11733
|
-
const headerContentAndIcon = !column.headerInvisible && column.icon ? /* @__PURE__ */
|
11997
|
+
const headerContentAndIcon = !column.headerInvisible && column.icon ? /* @__PURE__ */ import_react82.default.createElement(Box.Flex, {
|
11734
11998
|
flexDirection: "row",
|
11735
11999
|
gap: "3",
|
11736
12000
|
alignItems: "center"
|
11737
|
-
}, /* @__PURE__ */
|
12001
|
+
}, /* @__PURE__ */ import_react82.default.createElement(InlineIcon, {
|
11738
12002
|
icon: column.icon,
|
11739
12003
|
height: "22",
|
11740
12004
|
color: "grey-70",
|
11741
12005
|
"aria-hidden": true
|
11742
12006
|
}), content) : content;
|
11743
|
-
return columnIsFieldColumn(column) && column.sortable || column.sort ? /* @__PURE__ */
|
12007
|
+
return columnIsFieldColumn(column) && column.sortable || column.sort ? /* @__PURE__ */ import_react82.default.createElement(Table2.SortCell, __spreadValues({
|
11744
12008
|
direction: sort && sort.column.headerName === column.headerName ? sort.direction : "none",
|
11745
12009
|
onClick: () => updateSort(column),
|
11746
12010
|
style: { width: column.width },
|
11747
12011
|
"aria-label": column.headerInvisible ? column.headerName : void 0
|
11748
|
-
}, cellProps(column)), headerContentAndIcon) : /* @__PURE__ */
|
12012
|
+
}, cellProps(column)), headerContentAndIcon) : /* @__PURE__ */ import_react82.default.createElement(Table2.Cell, __spreadProps(__spreadValues({}, cellProps(column)), {
|
11749
12013
|
style: { width: column.width },
|
11750
12014
|
"aria-label": column.headerInvisible ? column.headerName : void 0
|
11751
12015
|
}), headerContentAndIcon);
|
11752
12016
|
}),
|
11753
|
-
menu ? /* @__PURE__ */
|
12017
|
+
menu ? /* @__PURE__ */ import_react82.default.createElement(Table2.Cell, {
|
11754
12018
|
key: "__contextMenu",
|
11755
12019
|
align: "right",
|
11756
12020
|
"aria-label": menuAriaLabel
|
11757
12021
|
}, menuHeaderName) : null
|
11758
|
-
])), /* @__PURE__ */
|
12022
|
+
])), /* @__PURE__ */ import_react82.default.createElement(List, __spreadProps(__spreadValues({
|
11759
12023
|
container: Table2.Body,
|
11760
12024
|
paginationContainer: PaginationFooter
|
11761
12025
|
}, rest), {
|
@@ -11763,12 +12027,12 @@ var DataTable = (_a) => {
|
|
11763
12027
|
renderItem: (row, index) => {
|
11764
12028
|
var _a3;
|
11765
12029
|
const isRowDisabled = (_a3 = disabled == null ? void 0 : disabled(row, index, sortedRows)) != null ? _a3 : false;
|
11766
|
-
return /* @__PURE__ */
|
12030
|
+
return /* @__PURE__ */ import_react82.default.createElement(Table2.Row, {
|
11767
12031
|
key: row.id,
|
11768
12032
|
disabled: isRowDisabled
|
11769
|
-
}, /* @__PURE__ */
|
12033
|
+
}, /* @__PURE__ */ import_react82.default.createElement(List, {
|
11770
12034
|
items: columns,
|
11771
|
-
renderItem: (column) => /* @__PURE__ */
|
12035
|
+
renderItem: (column) => /* @__PURE__ */ import_react82.default.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), renderCell(column, row, index, sortedRows))
|
11772
12036
|
}), renderRowMenu(row, index, { menu, menuAriaLabel, onAction, onMenuOpenChange }));
|
11773
12037
|
}
|
11774
12038
|
})));
|
@@ -11781,12 +12045,13 @@ var renderRowMenu = (row, index, {
|
|
11781
12045
|
}) => {
|
11782
12046
|
if (menu) {
|
11783
12047
|
const menuContent = (0, import_isFunction4.default)(menu) ? menu(row, index) : menu;
|
11784
|
-
return /* @__PURE__ */
|
12048
|
+
return /* @__PURE__ */ import_react82.default.createElement(Table2.Cell, {
|
11785
12049
|
align: "right"
|
11786
|
-
}, menuContent && /* @__PURE__ */
|
12050
|
+
}, menuContent && /* @__PURE__ */ import_react82.default.createElement(DropdownMenu2, {
|
12051
|
+
placement: defaultContextualMenuPlacement,
|
11787
12052
|
onAction: (action) => onAction == null ? void 0 : onAction(action, row, index),
|
11788
12053
|
onOpenChange: onMenuOpenChange
|
11789
|
-
}, /* @__PURE__ */
|
12054
|
+
}, /* @__PURE__ */ import_react82.default.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ import_react82.default.createElement(Button.Icon, {
|
11790
12055
|
"aria-label": menuAriaLabel,
|
11791
12056
|
icon: import_more3.default
|
11792
12057
|
})), menuContent));
|
@@ -11799,14 +12064,14 @@ var renderCell = (column, row, index, rows) => {
|
|
11799
12064
|
if (column.type === "status") {
|
11800
12065
|
const status = column.status(row, index, rows);
|
11801
12066
|
if (status) {
|
11802
|
-
cellContent = /* @__PURE__ */
|
12067
|
+
cellContent = /* @__PURE__ */ import_react82.default.createElement(StatusChip, __spreadValues({
|
11803
12068
|
dense: true
|
11804
12069
|
}, status));
|
11805
12070
|
}
|
11806
12071
|
} else if (column.type === "action") {
|
11807
12072
|
const action = renameProperty("text", "children", column.action(row, index, rows));
|
11808
12073
|
if (action) {
|
11809
|
-
cellContent = /* @__PURE__ */
|
12074
|
+
cellContent = /* @__PURE__ */ import_react82.default.createElement(Button.Secondary, __spreadValues({
|
11810
12075
|
dense: true
|
11811
12076
|
}, action));
|
11812
12077
|
}
|
@@ -11815,22 +12080,22 @@ var renderCell = (column, row, index, rows) => {
|
|
11815
12080
|
} else if (column.type === "item") {
|
11816
12081
|
const item = column.item(row, index, rows);
|
11817
12082
|
if (item) {
|
11818
|
-
cellContent = /* @__PURE__ */
|
12083
|
+
cellContent = /* @__PURE__ */ import_react82.default.createElement(Item2, __spreadValues({}, item));
|
11819
12084
|
}
|
11820
12085
|
} else if (column.formatter) {
|
11821
12086
|
cellContent = column.formatter(row[column.field], row, index, rows);
|
11822
12087
|
} else {
|
11823
12088
|
cellContent = row[column.field];
|
11824
12089
|
}
|
11825
|
-
return column.tooltip ? /* @__PURE__ */
|
12090
|
+
return column.tooltip ? /* @__PURE__ */ import_react82.default.createElement(Tooltip, __spreadValues({}, column.tooltip(row, index, rows)), cellContent) : cellContent;
|
11826
12091
|
};
|
11827
12092
|
DataTable.Skeleton = DataListSkeleton;
|
11828
12093
|
|
11829
12094
|
// src/molecules/Dialog/Dialog.tsx
|
11830
|
-
var
|
12095
|
+
var import_react84 = __toESM(require("react"));
|
11831
12096
|
var import_dialog = require("@react-aria/dialog");
|
11832
12097
|
var import_overlays6 = require("@react-aria/overlays");
|
11833
|
-
var
|
12098
|
+
var import_utils19 = require("@react-aria/utils");
|
11834
12099
|
var import_overlays7 = require("@react-stately/overlays");
|
11835
12100
|
var import_omit8 = __toESM(require("lodash/omit"));
|
11836
12101
|
|
@@ -11854,7 +12119,7 @@ var DIALOG_ICONS_AND_COLORS = {
|
|
11854
12119
|
};
|
11855
12120
|
|
11856
12121
|
// src/atoms/Modal/Modal.tsx
|
11857
|
-
var
|
12122
|
+
var import_react83 = __toESM(require("react"));
|
11858
12123
|
var Modal = (_a) => {
|
11859
12124
|
var _b = _a, {
|
11860
12125
|
children,
|
@@ -11867,7 +12132,7 @@ var Modal = (_a) => {
|
|
11867
12132
|
"className",
|
11868
12133
|
"open"
|
11869
12134
|
]);
|
11870
|
-
return open ? /* @__PURE__ */
|
12135
|
+
return open ? /* @__PURE__ */ import_react83.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
11871
12136
|
className: classNames(
|
11872
12137
|
tw("inset-0 overflow-y-auto z-modal fixed"),
|
11873
12138
|
{
|
@@ -11879,11 +12144,11 @@ var Modal = (_a) => {
|
|
11879
12144
|
};
|
11880
12145
|
Modal.BackDrop = (_a) => {
|
11881
12146
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
11882
|
-
return /* @__PURE__ */
|
12147
|
+
return /* @__PURE__ */ import_react83.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
11883
12148
|
className: classNames(tw("-z-10 fixed min-w-full min-h-full bg-primary-100 opacity-60"), className)
|
11884
12149
|
}));
|
11885
12150
|
};
|
11886
|
-
Modal.Dialog =
|
12151
|
+
Modal.Dialog = import_react83.default.forwardRef(
|
11887
12152
|
(_a, ref) => {
|
11888
12153
|
var _b = _a, { kind = "dialog", children, className, size = "sm" } = _b, rest = __objRest(_b, ["kind", "children", "className", "size"]);
|
11889
12154
|
const commonClasses = tw("bg-white max-h-full flex flex-col");
|
@@ -11897,7 +12162,7 @@ Modal.Dialog = import_react81.default.forwardRef(
|
|
11897
12162
|
"w-[560px]": size === "md",
|
11898
12163
|
"w-[1080px]": size === "full"
|
11899
12164
|
});
|
11900
|
-
return /* @__PURE__ */
|
12165
|
+
return /* @__PURE__ */ import_react83.default.createElement("div", __spreadProps(__spreadValues({
|
11901
12166
|
ref,
|
11902
12167
|
"aria-modal": "true"
|
11903
12168
|
}, rest), {
|
@@ -11907,31 +12172,31 @@ Modal.Dialog = import_react81.default.forwardRef(
|
|
11907
12172
|
);
|
11908
12173
|
Modal.Header = (_a) => {
|
11909
12174
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
11910
|
-
return /* @__PURE__ */
|
12175
|
+
return /* @__PURE__ */ import_react83.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
11911
12176
|
className: classNames(tw("pl-7 pr-[64px] py-6 gap-3 flex items-center"), className)
|
11912
12177
|
}), children);
|
11913
12178
|
};
|
11914
12179
|
Modal.HeaderImage = (_a) => {
|
11915
12180
|
var _b = _a, { backgroundImage, className } = _b, rest = __objRest(_b, ["backgroundImage", "className"]);
|
11916
12181
|
const common = tw("h-[120px] min-h-[120px] w-full ");
|
11917
|
-
return backgroundImage ? /* @__PURE__ */
|
12182
|
+
return backgroundImage ? /* @__PURE__ */ import_react83.default.createElement("img", __spreadProps(__spreadValues({
|
11918
12183
|
"aria-hidden": true,
|
11919
12184
|
src: backgroundImage != null ? backgroundImage : void 0
|
11920
12185
|
}, rest), {
|
11921
12186
|
className: classNames(common, tw("object-cover"), className)
|
11922
|
-
})) : /* @__PURE__ */
|
12187
|
+
})) : /* @__PURE__ */ import_react83.default.createElement("div", {
|
11923
12188
|
className: classNames(common, tw("bg-grey-5"), className)
|
11924
12189
|
});
|
11925
12190
|
};
|
11926
12191
|
Modal.CloseButtonContainer = (_a) => {
|
11927
12192
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
11928
|
-
return /* @__PURE__ */
|
12193
|
+
return /* @__PURE__ */ import_react83.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
11929
12194
|
className: classNames(tw("absolute top-[24px] right-[28px]"), className)
|
11930
12195
|
}));
|
11931
12196
|
};
|
11932
12197
|
Modal.Title = (_a) => {
|
11933
12198
|
var _b = _a, { kind = "dialog", children, className } = _b, rest = __objRest(_b, ["kind", "children", "className"]);
|
11934
|
-
return /* @__PURE__ */
|
12199
|
+
return /* @__PURE__ */ import_react83.default.createElement(Typography, __spreadValues({
|
11935
12200
|
htmlTag: "h2",
|
11936
12201
|
variant: "subheading",
|
11937
12202
|
color: "grey-90",
|
@@ -11945,52 +12210,57 @@ Modal.Title = (_a) => {
|
|
11945
12210
|
};
|
11946
12211
|
Modal.Subtitle = (_a) => {
|
11947
12212
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
11948
|
-
return /* @__PURE__ */
|
12213
|
+
return /* @__PURE__ */ import_react83.default.createElement(Typography, __spreadValues({
|
11949
12214
|
variant: "small",
|
11950
12215
|
color: "grey-60"
|
11951
12216
|
}, rest), children);
|
11952
12217
|
};
|
11953
12218
|
Modal.TitleContainer = (_a) => {
|
11954
12219
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
11955
|
-
return /* @__PURE__ */
|
12220
|
+
return /* @__PURE__ */ import_react83.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
11956
12221
|
className: classNames(tw("flex flex-col grow"), className)
|
11957
12222
|
}), children);
|
11958
12223
|
};
|
11959
12224
|
Modal.Body = (_a) => {
|
11960
12225
|
var _b = _a, { children, className, noFooter = false, maxHeight, style } = _b, rest = __objRest(_b, ["children", "className", "noFooter", "maxHeight", "style"]);
|
11961
|
-
return /* @__PURE__ */
|
12226
|
+
return /* @__PURE__ */ import_react83.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
11962
12227
|
className: classNames(tw("px-7 grow overflow-y-auto", { "pb-6": noFooter }), className),
|
11963
12228
|
style: __spreadValues({ maxHeight }, style)
|
11964
12229
|
}), children);
|
11965
12230
|
};
|
11966
12231
|
Modal.Footer = (_a) => {
|
11967
12232
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
11968
|
-
return /* @__PURE__ */
|
12233
|
+
return /* @__PURE__ */ import_react83.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
11969
12234
|
className: classNames(tw("px-7 py-6"), className)
|
11970
12235
|
}), children);
|
11971
12236
|
};
|
11972
12237
|
Modal.Actions = (_a) => {
|
11973
12238
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
11974
|
-
return /* @__PURE__ */
|
12239
|
+
return /* @__PURE__ */ import_react83.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
11975
12240
|
className: classNames(tw("flex gap-4 justify-end"), className)
|
11976
12241
|
}), children);
|
11977
12242
|
};
|
11978
12243
|
|
11979
12244
|
// src/molecules/Dialog/Dialog.tsx
|
11980
12245
|
var Dialog = (props) => {
|
11981
|
-
const ref =
|
11982
|
-
const
|
11983
|
-
const
|
12246
|
+
const ref = import_react84.default.useRef(null);
|
12247
|
+
const { open, onClose } = props;
|
12248
|
+
const state = (0, import_overlays7.useOverlayTriggerState)({ isOpen: open, onOpenChange: (isOpen) => !isOpen && (onClose == null ? void 0 : onClose()) });
|
12249
|
+
const { modalProps, underlayProps } = (0, import_overlays6.useModalOverlay)(
|
12250
|
+
{ isDismissable: false, isKeyboardDismissDisabled: false },
|
12251
|
+
state,
|
12252
|
+
ref
|
12253
|
+
);
|
11984
12254
|
if (!state.isOpen) {
|
11985
12255
|
return null;
|
11986
12256
|
}
|
11987
|
-
return /* @__PURE__ */
|
12257
|
+
return /* @__PURE__ */ import_react84.default.createElement(import_overlays6.Overlay, null, /* @__PURE__ */ import_react84.default.createElement(Modal, {
|
11988
12258
|
className: "Aquarium-Dialog",
|
11989
12259
|
open: true
|
11990
|
-
}, /* @__PURE__ */
|
12260
|
+
}, /* @__PURE__ */ import_react84.default.createElement(Modal.BackDrop, __spreadValues({}, underlayProps)), /* @__PURE__ */ import_react84.default.createElement(Modal.Dialog, __spreadValues({
|
11991
12261
|
ref,
|
11992
12262
|
size: "sm"
|
11993
|
-
}, modalProps), /* @__PURE__ */
|
12263
|
+
}, modalProps), /* @__PURE__ */ import_react84.default.createElement(DialogWrapper, __spreadValues({}, props)))));
|
11994
12264
|
};
|
11995
12265
|
var DialogWrapper = ({
|
11996
12266
|
title,
|
@@ -11999,59 +12269,63 @@ var DialogWrapper = ({
|
|
11999
12269
|
primaryAction,
|
12000
12270
|
secondaryAction
|
12001
12271
|
}) => {
|
12002
|
-
const ref =
|
12003
|
-
const labelledBy = (0,
|
12004
|
-
const describedBy = (0,
|
12272
|
+
const ref = import_react84.default.useRef(null);
|
12273
|
+
const labelledBy = (0, import_utils19.useId)();
|
12274
|
+
const describedBy = (0, import_utils19.useId)();
|
12005
12275
|
const { dialogProps } = (0, import_dialog.useDialog)(
|
12006
|
-
{
|
12276
|
+
{
|
12277
|
+
"role": "alertdialog",
|
12278
|
+
"aria-labelledby": labelledBy,
|
12279
|
+
"aria-describedby": describedBy
|
12280
|
+
},
|
12007
12281
|
ref
|
12008
12282
|
);
|
12009
|
-
return /* @__PURE__ */
|
12283
|
+
return /* @__PURE__ */ import_react84.default.createElement("div", __spreadProps(__spreadValues({
|
12010
12284
|
ref
|
12011
12285
|
}, dialogProps), {
|
12012
12286
|
className: tw("outline-none")
|
12013
|
-
}), /* @__PURE__ */
|
12287
|
+
}), /* @__PURE__ */ import_react84.default.createElement(Modal.Header, {
|
12014
12288
|
className: tw("icon-stroke-2")
|
12015
|
-
}, /* @__PURE__ */
|
12289
|
+
}, /* @__PURE__ */ import_react84.default.createElement(Icon, {
|
12016
12290
|
icon: DIALOG_ICONS_AND_COLORS[type].icon,
|
12017
12291
|
color: DIALOG_ICONS_AND_COLORS[type].color,
|
12018
12292
|
fontSize: 20
|
12019
|
-
}), /* @__PURE__ */
|
12293
|
+
}), /* @__PURE__ */ import_react84.default.createElement(Modal.Title, {
|
12020
12294
|
id: labelledBy,
|
12021
12295
|
variant: "large",
|
12022
12296
|
color: DIALOG_ICONS_AND_COLORS[type].color
|
12023
|
-
}, title)), /* @__PURE__ */
|
12297
|
+
}, title)), /* @__PURE__ */ import_react84.default.createElement(Modal.Body, {
|
12024
12298
|
id: describedBy
|
12025
|
-
}, /* @__PURE__ */
|
12299
|
+
}, /* @__PURE__ */ import_react84.default.createElement(Typography2.Default, null, children)), /* @__PURE__ */ import_react84.default.createElement(Modal.Footer, null, /* @__PURE__ */ import_react84.default.createElement(Modal.Actions, null, secondaryAction && /* @__PURE__ */ import_react84.default.createElement(Button.Ghost, __spreadValues({
|
12026
12300
|
key: secondaryAction.text
|
12027
|
-
}, (0, import_omit8.default)(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */
|
12301
|
+
}, (0, import_omit8.default)(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */ import_react84.default.createElement(Button.Secondary, __spreadValues({
|
12028
12302
|
key: primaryAction.text
|
12029
12303
|
}, (0, import_omit8.default)(primaryAction, "text")), primaryAction.text))));
|
12030
12304
|
};
|
12031
12305
|
|
12032
12306
|
// src/molecules/Drawer/Drawer.tsx
|
12033
|
-
var
|
12307
|
+
var import_react86 = __toESM(require("react"));
|
12034
12308
|
var import_react_stately = require("react-stately");
|
12035
12309
|
var import_dialog2 = require("@react-aria/dialog");
|
12036
12310
|
var import_overlays8 = require("@react-aria/overlays");
|
12037
|
-
var
|
12311
|
+
var import_utils20 = require("@react-aria/utils");
|
12038
12312
|
var import_web4 = require("@react-spring/web");
|
12039
|
-
var
|
12313
|
+
var import_castArray3 = __toESM(require("lodash/castArray"));
|
12040
12314
|
var import_omit9 = __toESM(require("lodash/omit"));
|
12041
12315
|
|
12042
12316
|
// src/molecules/Tabs/Tabs.tsx
|
12043
|
-
var
|
12317
|
+
var import_react85 = __toESM(require("react"));
|
12044
12318
|
var import_isNumber5 = __toESM(require("lodash/isNumber"));
|
12045
12319
|
var import_kebabCase = __toESM(require("lodash/kebabCase"));
|
12046
12320
|
var import_chevronLeft4 = __toESM(require_chevronLeft());
|
12047
12321
|
var import_chevronRight4 = __toESM(require_chevronRight());
|
12048
12322
|
var import_warningSign4 = __toESM(require_warningSign());
|
12049
12323
|
var isTabComponent = (c) => {
|
12050
|
-
return
|
12324
|
+
return import_react85.default.isValidElement(c) && (c.type === Tab || c.type === ModalTab);
|
12051
12325
|
};
|
12052
|
-
var Tab =
|
12326
|
+
var Tab = import_react85.default.forwardRef(
|
12053
12327
|
({ className, id, title, children }, ref) => {
|
12054
|
-
return /* @__PURE__ */
|
12328
|
+
return /* @__PURE__ */ import_react85.default.createElement("div", {
|
12055
12329
|
ref,
|
12056
12330
|
id: `${id != null ? id : (0, import_kebabCase.default)(title)}-panel`,
|
12057
12331
|
className,
|
@@ -12063,14 +12337,14 @@ var Tab = import_react83.default.forwardRef(
|
|
12063
12337
|
);
|
12064
12338
|
var TabContainer = (_a) => {
|
12065
12339
|
var _b = _a, { className, children } = _b, rest = __objRest(_b, ["className", "children"]);
|
12066
|
-
return /* @__PURE__ */
|
12340
|
+
return /* @__PURE__ */ import_react85.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12067
12341
|
className: classNames("py-6 z-0", className)
|
12068
12342
|
}), children);
|
12069
12343
|
};
|
12070
12344
|
var ModalTab = Tab;
|
12071
12345
|
var ModalTabContainer = TabContainer;
|
12072
12346
|
var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
12073
|
-
const Tab2 =
|
12347
|
+
const Tab2 = import_react85.default.forwardRef(
|
12074
12348
|
(_a, ref) => {
|
12075
12349
|
var _b = _a, {
|
12076
12350
|
id,
|
@@ -12102,17 +12376,17 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
12102
12376
|
const _id = id != null ? id : (0, import_kebabCase.default)(title);
|
12103
12377
|
let statusIcon = void 0;
|
12104
12378
|
if (status === "warning") {
|
12105
|
-
statusIcon = /* @__PURE__ */
|
12379
|
+
statusIcon = /* @__PURE__ */ import_react85.default.createElement(InlineIcon, {
|
12106
12380
|
icon: import_warningSign4.default,
|
12107
12381
|
color: selected ? void 0 : "warning-80"
|
12108
12382
|
});
|
12109
12383
|
} else if (status === "error") {
|
12110
|
-
statusIcon = /* @__PURE__ */
|
12384
|
+
statusIcon = /* @__PURE__ */ import_react85.default.createElement(InlineIcon, {
|
12111
12385
|
icon: import_warningSign4.default,
|
12112
12386
|
color: selected ? void 0 : "error-50"
|
12113
12387
|
});
|
12114
12388
|
}
|
12115
|
-
const tab = /* @__PURE__ */
|
12389
|
+
const tab = /* @__PURE__ */ import_react85.default.createElement(Component, __spreadValues({
|
12116
12390
|
ref,
|
12117
12391
|
id: `${_id}-tab`,
|
12118
12392
|
onClick: () => !disabled && onSelected(value != null ? value : index),
|
@@ -12129,29 +12403,29 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
12129
12403
|
"aria-selected": selected,
|
12130
12404
|
"aria-controls": `${_id}-panel`,
|
12131
12405
|
tabIndex: disabled ? void 0 : 0
|
12132
|
-
}, rest), /* @__PURE__ */
|
12406
|
+
}, rest), /* @__PURE__ */ import_react85.default.createElement(Typography2, {
|
12133
12407
|
htmlTag: "div",
|
12134
12408
|
variant: "small-strong",
|
12135
12409
|
color: selected ? "primary-80" : disabled ? "grey-20" : "current",
|
12136
12410
|
className: tw("inline-flex items-center gap-3")
|
12137
|
-
}, showNotification ? /* @__PURE__ */
|
12411
|
+
}, showNotification ? /* @__PURE__ */ import_react85.default.createElement(Badge.Notification, {
|
12138
12412
|
right: "-4px",
|
12139
12413
|
top: "3px"
|
12140
|
-
}, /* @__PURE__ */
|
12414
|
+
}, /* @__PURE__ */ import_react85.default.createElement("span", {
|
12141
12415
|
className: tw("whitespace-nowrap")
|
12142
|
-
}, title)) : /* @__PURE__ */
|
12416
|
+
}, title)) : /* @__PURE__ */ import_react85.default.createElement("span", {
|
12143
12417
|
className: tw("whitespace-nowrap")
|
12144
|
-
}, title), (0, import_isNumber5.default)(badge) && /* @__PURE__ */
|
12418
|
+
}, title), (0, import_isNumber5.default)(badge) && /* @__PURE__ */ import_react85.default.createElement(Typography2, {
|
12145
12419
|
htmlTag: "span",
|
12146
12420
|
variant: "small",
|
12147
12421
|
color: selected ? "primary-80" : "grey-5",
|
12148
12422
|
className: "leading-none"
|
12149
|
-
}, /* @__PURE__ */
|
12423
|
+
}, /* @__PURE__ */ import_react85.default.createElement(TabBadge, {
|
12150
12424
|
kind: "filled",
|
12151
12425
|
value: badge,
|
12152
12426
|
textClassname: classNames({ "text-white": selected, "text-grey-50": !selected })
|
12153
12427
|
})), statusIcon));
|
12154
|
-
return tooltip ? /* @__PURE__ */
|
12428
|
+
return tooltip ? /* @__PURE__ */ import_react85.default.createElement(Tooltip, {
|
12155
12429
|
content: tooltip
|
12156
12430
|
}, tab) : tab;
|
12157
12431
|
}
|
@@ -12165,20 +12439,20 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
12165
12439
|
const Tabs2 = (props) => {
|
12166
12440
|
var _a, _b;
|
12167
12441
|
const { className, value, defaultValue, onChange, children } = props;
|
12168
|
-
const childArr =
|
12442
|
+
const childArr = import_react85.default.Children.toArray(children);
|
12169
12443
|
const firstTab = childArr[0];
|
12170
12444
|
const firstTabValue = isTabComponent(firstTab) ? firstTab.props.value : -1;
|
12171
|
-
const [selected, setSelected] = (0,
|
12172
|
-
const [leftCaret, showLeftCaret] = (0,
|
12173
|
-
const [rightCaret, showRightCaret] = (0,
|
12174
|
-
const parentRef = (0,
|
12175
|
-
const containerRef = (0,
|
12176
|
-
const tabsRef = (0,
|
12445
|
+
const [selected, setSelected] = (0, import_react85.useState)((_b = (_a = value != null ? value : defaultValue) != null ? _a : firstTabValue) != null ? _b : 0);
|
12446
|
+
const [leftCaret, showLeftCaret] = (0, import_react85.useState)(false);
|
12447
|
+
const [rightCaret, showRightCaret] = (0, import_react85.useState)(false);
|
12448
|
+
const parentRef = (0, import_react85.useRef)(null);
|
12449
|
+
const containerRef = (0, import_react85.useRef)(null);
|
12450
|
+
const tabsRef = (0, import_react85.useRef)(null);
|
12177
12451
|
const revealSelectedTab = ({ smooth }) => {
|
12178
12452
|
var _a2, _b2;
|
12179
12453
|
const container = containerRef.current;
|
12180
12454
|
const tabs = tabsRef.current;
|
12181
|
-
const values =
|
12455
|
+
const values = import_react85.default.Children.map(
|
12182
12456
|
children,
|
12183
12457
|
(tab, i) => {
|
12184
12458
|
var _a3;
|
@@ -12212,15 +12486,15 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
12212
12486
|
showLeftCaret(hasLeftCaret);
|
12213
12487
|
showRightCaret(hasRightCaret);
|
12214
12488
|
};
|
12215
|
-
(0,
|
12489
|
+
(0, import_react85.useEffect)(() => {
|
12216
12490
|
if (value === void 0) {
|
12217
12491
|
return;
|
12218
12492
|
}
|
12219
12493
|
updateCarets();
|
12220
12494
|
setSelected(value);
|
12221
12495
|
revealSelectedTab({ smooth: value !== selected });
|
12222
|
-
}, [value,
|
12223
|
-
(0,
|
12496
|
+
}, [value, import_react85.default.Children.count(children)]);
|
12497
|
+
(0, import_react85.useLayoutEffect)(() => {
|
12224
12498
|
var _a2;
|
12225
12499
|
updateCarets();
|
12226
12500
|
(_a2 = containerRef.current) == null ? void 0 : _a2.addEventListener("scroll", updateCarets);
|
@@ -12283,27 +12557,27 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
12283
12557
|
const handleSelected = (key) => {
|
12284
12558
|
(onChange != null ? onChange : setSelected)(key);
|
12285
12559
|
};
|
12286
|
-
|
12560
|
+
import_react85.default.Children.forEach(children, (c) => {
|
12287
12561
|
if (c && !isTabComponent(c)) {
|
12288
12562
|
throw new Error("<Tabs> can only have <Tabs.Tab> components as children");
|
12289
12563
|
}
|
12290
12564
|
});
|
12291
|
-
return /* @__PURE__ */
|
12565
|
+
return /* @__PURE__ */ import_react85.default.createElement("div", {
|
12292
12566
|
ref: parentRef,
|
12293
12567
|
className: classNames("Aquarium-Tabs", tw("h-full"), className)
|
12294
|
-
}, /* @__PURE__ */
|
12568
|
+
}, /* @__PURE__ */ import_react85.default.createElement("div", {
|
12295
12569
|
className: tw("relative flex items-center border-b-2 border-default")
|
12296
|
-
}, /* @__PURE__ */
|
12570
|
+
}, /* @__PURE__ */ import_react85.default.createElement("div", {
|
12297
12571
|
ref: containerRef,
|
12298
12572
|
className: tw("overflow-y-auto scrollbar-hide mb-[-2px] h-auto")
|
12299
|
-
}, /* @__PURE__ */
|
12573
|
+
}, /* @__PURE__ */ import_react85.default.createElement("div", {
|
12300
12574
|
ref: tabsRef,
|
12301
12575
|
role: "tablist",
|
12302
12576
|
"aria-label": "tabs",
|
12303
12577
|
className: tw("inline-flex items-center cursor-pointer font-normal h-full")
|
12304
|
-
},
|
12578
|
+
}, import_react85.default.Children.map(
|
12305
12579
|
children,
|
12306
|
-
(tab, index) => tab ? /* @__PURE__ */
|
12580
|
+
(tab, index) => tab ? /* @__PURE__ */ import_react85.default.createElement(TabItemComponent, __spreadProps(__spreadValues({
|
12307
12581
|
key: tab.props.value
|
12308
12582
|
}, tab.props), {
|
12309
12583
|
index,
|
@@ -12311,20 +12585,20 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
12311
12585
|
onKeyDown: handleKeyDown,
|
12312
12586
|
onSelected: handleSelected
|
12313
12587
|
})) : void 0
|
12314
|
-
))), leftCaret && /* @__PURE__ */
|
12588
|
+
))), leftCaret && /* @__PURE__ */ import_react85.default.createElement("div", {
|
12315
12589
|
className: tw("absolute left-0 bg-gradient-to-r from-white via-white z-20 py-3 pr-4")
|
12316
|
-
}, /* @__PURE__ */
|
12590
|
+
}, /* @__PURE__ */ import_react85.default.createElement("div", {
|
12317
12591
|
onClick: () => handleScrollToNext("left"),
|
12318
12592
|
className: tw("hover:bg-grey-0 p-2 leading-none cursor-pointer")
|
12319
|
-
}, /* @__PURE__ */
|
12593
|
+
}, /* @__PURE__ */ import_react85.default.createElement(InlineIcon, {
|
12320
12594
|
icon: import_chevronLeft4.default
|
12321
|
-
}))), rightCaret && /* @__PURE__ */
|
12595
|
+
}))), rightCaret && /* @__PURE__ */ import_react85.default.createElement("div", {
|
12322
12596
|
onClick: () => handleScrollToNext("right"),
|
12323
12597
|
className: tw("absolute right-0 bg-gradient-to-l from-white via-white z-20 py-3 pl-4")
|
12324
|
-
}, /* @__PURE__ */
|
12598
|
+
}, /* @__PURE__ */ import_react85.default.createElement("div", {
|
12325
12599
|
onClick: () => handleScrollToNext("right"),
|
12326
12600
|
className: tw("hover:bg-grey-0 p-2 leading-none cursor-pointer")
|
12327
|
-
}, /* @__PURE__ */
|
12601
|
+
}, /* @__PURE__ */ import_react85.default.createElement(InlineIcon, {
|
12328
12602
|
icon: import_chevronRight4.default
|
12329
12603
|
})))), renderChildren(children, selected, props));
|
12330
12604
|
};
|
@@ -12332,7 +12606,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
12332
12606
|
Tabs2.Tab = TabComponent;
|
12333
12607
|
return Tabs2;
|
12334
12608
|
};
|
12335
|
-
var Tabs = createTabsComponent(Tab, TabItem, "Tabs", (children, selected) => /* @__PURE__ */
|
12609
|
+
var Tabs = createTabsComponent(Tab, TabItem, "Tabs", (children, selected) => /* @__PURE__ */ import_react85.default.createElement(TabContainer, null, children.find(
|
12336
12610
|
(node, index) => (node == null ? void 0 : node.props.value) === selected || index === selected
|
12337
12611
|
)));
|
12338
12612
|
|
@@ -12349,10 +12623,10 @@ var WIDTHS = {
|
|
12349
12623
|
var Drawer = (_a) => {
|
12350
12624
|
var _b = _a, { open, closeOnEsc = true } = _b, props = __objRest(_b, ["open", "closeOnEsc"]);
|
12351
12625
|
const { onClose, size = "sm", portalContainer } = props;
|
12352
|
-
const [hidden, setHidden] =
|
12353
|
-
const ref =
|
12626
|
+
const [hidden, setHidden] = import_react86.default.useState(!open);
|
12627
|
+
const ref = import_react86.default.useRef(null);
|
12354
12628
|
const state = (0, import_react_stately.useOverlayTriggerState)({ isOpen: !hidden, onOpenChange: (isOpen) => !isOpen && onClose() });
|
12355
|
-
(0,
|
12629
|
+
(0, import_react86.useEffect)(() => {
|
12356
12630
|
if (open && hidden) {
|
12357
12631
|
setHidden(!open);
|
12358
12632
|
}
|
@@ -12379,21 +12653,21 @@ var Drawer = (_a) => {
|
|
12379
12653
|
if (!state.isOpen) {
|
12380
12654
|
return null;
|
12381
12655
|
}
|
12382
|
-
return /* @__PURE__ */
|
12656
|
+
return /* @__PURE__ */ import_react86.default.createElement(import_overlays8.Overlay, {
|
12383
12657
|
portalContainer
|
12384
|
-
}, /* @__PURE__ */
|
12658
|
+
}, /* @__PURE__ */ import_react86.default.createElement(Modal, {
|
12385
12659
|
kind: "drawer",
|
12386
12660
|
className: "Aquarium-Drawer overflow-x-hidden",
|
12387
12661
|
open: true
|
12388
|
-
}, /* @__PURE__ */
|
12662
|
+
}, /* @__PURE__ */ import_react86.default.createElement(AnimatedBackDrop, __spreadValues({
|
12389
12663
|
style: { opacity }
|
12390
|
-
}, underlayProps)), /* @__PURE__ */
|
12664
|
+
}, underlayProps)), /* @__PURE__ */ import_react86.default.createElement(DrawerWrapper, __spreadProps(__spreadValues(__spreadValues({
|
12391
12665
|
ref
|
12392
12666
|
}, props), modalProps), {
|
12393
12667
|
spring: { right }
|
12394
12668
|
}))));
|
12395
12669
|
};
|
12396
|
-
var DrawerWrapper =
|
12670
|
+
var DrawerWrapper = import_react86.default.forwardRef(
|
12397
12671
|
(_a, ref) => {
|
12398
12672
|
var _b = _a, {
|
12399
12673
|
title,
|
@@ -12423,83 +12697,83 @@ var DrawerWrapper = import_react84.default.forwardRef(
|
|
12423
12697
|
"menuAriaLabel"
|
12424
12698
|
]);
|
12425
12699
|
var _a2;
|
12426
|
-
const labelledBy = (0,
|
12427
|
-
const describedBy = (0,
|
12700
|
+
const labelledBy = (0, import_utils20.useId)();
|
12701
|
+
const describedBy = (0, import_utils20.useId)();
|
12428
12702
|
const { dialogProps } = (0, import_dialog2.useDialog)(
|
12429
12703
|
{ "role": "dialog", "aria-labelledby": labelledBy, "aria-describedby": describedBy },
|
12430
12704
|
ref
|
12431
12705
|
);
|
12432
12706
|
const dialogSize = size === "lg" ? "full" : size;
|
12433
|
-
const childElements =
|
12707
|
+
const childElements = import_react86.default.Children.toArray(children).filter(import_react86.default.isValidElement);
|
12434
12708
|
const onlyChild = childElements.length === 1 ? childElements[0] : null;
|
12435
12709
|
const hasTabs = isComponentType(onlyChild, Tabs);
|
12436
|
-
return /* @__PURE__ */
|
12710
|
+
return /* @__PURE__ */ import_react86.default.createElement(AnimatedDialog, __spreadProps(__spreadValues(__spreadValues({
|
12437
12711
|
ref,
|
12438
12712
|
kind: "drawer",
|
12439
12713
|
"aria-modal": "true",
|
12440
12714
|
size: dialogSize
|
12441
12715
|
}, props), dialogProps), {
|
12442
12716
|
style: { position: "fixed", right: spring.right }
|
12443
|
-
}), /* @__PURE__ */
|
12717
|
+
}), /* @__PURE__ */ import_react86.default.createElement(Modal.CloseButtonContainer, null, /* @__PURE__ */ import_react86.default.createElement(Button.Icon, {
|
12444
12718
|
"aria-label": "Close",
|
12445
12719
|
icon: import_cross6.default,
|
12446
12720
|
onClick: onClose
|
12447
|
-
})), /* @__PURE__ */
|
12721
|
+
})), /* @__PURE__ */ import_react86.default.createElement(Modal.Header, {
|
12448
12722
|
className: tw({ "pb-3": hasTabs })
|
12449
|
-
}, /* @__PURE__ */
|
12723
|
+
}, /* @__PURE__ */ import_react86.default.createElement(Modal.Title, {
|
12450
12724
|
id: labelledBy,
|
12451
12725
|
kind: "drawer"
|
12452
|
-
}, title)), hasTabs ? /* @__PURE__ */
|
12726
|
+
}, title)), hasTabs ? /* @__PURE__ */ import_react86.default.createElement(DrawerTabs, __spreadProps(__spreadValues({}, onlyChild.props), {
|
12453
12727
|
className: tw("[&>div:first-child]:px-5 grow flex flex-col overflow-y-auto")
|
12454
|
-
})) : /* @__PURE__ */
|
12728
|
+
})) : /* @__PURE__ */ import_react86.default.createElement(Modal.Body, {
|
12455
12729
|
id: describedBy,
|
12456
12730
|
tabIndex: 0,
|
12457
12731
|
noFooter: !(secondaryActions || primaryAction)
|
12458
|
-
}, children), (secondaryActions || primaryAction) && /* @__PURE__ */
|
12732
|
+
}, children), (secondaryActions || primaryAction) && /* @__PURE__ */ import_react86.default.createElement(Modal.Footer, null, /* @__PURE__ */ import_react86.default.createElement(Modal.Actions, {
|
12459
12733
|
className: size === "sm" ? tw("flex-col") : void 0
|
12460
|
-
}, size !== "sm" && menu && /* @__PURE__ */
|
12734
|
+
}, size !== "sm" && menu && /* @__PURE__ */ import_react86.default.createElement(Box.Flex, {
|
12461
12735
|
alignItems: "center"
|
12462
|
-
}, /* @__PURE__ */
|
12736
|
+
}, /* @__PURE__ */ import_react86.default.createElement(DropdownMenu2, {
|
12463
12737
|
onAction: (action) => onAction == null ? void 0 : onAction(action),
|
12464
12738
|
onOpenChange: onMenuOpenChange
|
12465
|
-
}, /* @__PURE__ */
|
12739
|
+
}, /* @__PURE__ */ import_react86.default.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ import_react86.default.createElement(Button.Icon, {
|
12466
12740
|
"aria-label": (_a2 = menuAriaLabel != null ? menuAriaLabel : menuLabel) != null ? _a2 : "Context menu",
|
12467
12741
|
icon: import_more4.default
|
12468
|
-
})), menu)), secondaryActions && (0,
|
12742
|
+
})), menu)), secondaryActions && (0, import_castArray3.default)(secondaryActions).filter(Boolean).map((_b2) => {
|
12469
12743
|
var _c = _b2, { text } = _c, action = __objRest(_c, ["text"]);
|
12470
|
-
return /* @__PURE__ */
|
12744
|
+
return /* @__PURE__ */ import_react86.default.createElement(Button.Secondary, __spreadValues({
|
12471
12745
|
key: text
|
12472
12746
|
}, action), text);
|
12473
|
-
}), primaryAction && /* @__PURE__ */
|
12747
|
+
}), primaryAction && /* @__PURE__ */ import_react86.default.createElement(Button.Primary, __spreadValues({
|
12474
12748
|
key: primaryAction.text
|
12475
12749
|
}, (0, import_omit9.default)(primaryAction, "text")), primaryAction.text))));
|
12476
12750
|
}
|
12477
12751
|
);
|
12478
|
-
var DrawerTabs = createTabsComponent(ModalTab, TabItem, "DrawerTabs", (children, selected) => /* @__PURE__ */
|
12752
|
+
var DrawerTabs = createTabsComponent(ModalTab, TabItem, "DrawerTabs", (children, selected) => /* @__PURE__ */ import_react86.default.createElement(Modal.Body, {
|
12479
12753
|
className: tw("h-full")
|
12480
|
-
}, /* @__PURE__ */
|
12754
|
+
}, /* @__PURE__ */ import_react86.default.createElement(ModalTabContainer, null, children.find(
|
12481
12755
|
(node, index) => (node == null ? void 0 : node.props.value) === selected || index === selected
|
12482
12756
|
))));
|
12483
12757
|
|
12484
12758
|
// src/molecules/Dropdown/Dropdown.tsx
|
12485
|
-
var
|
12759
|
+
var import_react90 = __toESM(require("react"));
|
12486
12760
|
|
12487
12761
|
// src/molecules/Popover/Popover.tsx
|
12488
|
-
var
|
12762
|
+
var import_react89 = __toESM(require("react"));
|
12489
12763
|
var import_interactions3 = require("@react-aria/interactions");
|
12490
12764
|
var import_overlays9 = require("@react-aria/overlays");
|
12491
|
-
var
|
12765
|
+
var import_utils22 = require("@react-aria/utils");
|
12492
12766
|
var import_overlays10 = require("@react-stately/overlays");
|
12493
12767
|
var import_classnames8 = __toESM(require("classnames"));
|
12494
12768
|
var import_omit10 = __toESM(require("lodash/omit"));
|
12495
12769
|
|
12496
12770
|
// src/molecules/Popover/Dialog.tsx
|
12497
|
-
var
|
12771
|
+
var import_react87 = __toESM(require("react"));
|
12498
12772
|
var import_dialog3 = require("@react-aria/dialog");
|
12499
12773
|
var Dialog2 = ({ children }) => {
|
12500
|
-
const ref =
|
12774
|
+
const ref = import_react87.default.useRef(null);
|
12501
12775
|
const { dialogProps } = (0, import_dialog3.useDialog)({}, ref);
|
12502
|
-
return /* @__PURE__ */
|
12776
|
+
return /* @__PURE__ */ import_react87.default.createElement("div", __spreadProps(__spreadValues({
|
12503
12777
|
ref
|
12504
12778
|
}, dialogProps), {
|
12505
12779
|
className: tw("outline-none")
|
@@ -12507,10 +12781,10 @@ var Dialog2 = ({ children }) => {
|
|
12507
12781
|
};
|
12508
12782
|
|
12509
12783
|
// src/molecules/Popover/PopoverContext.tsx
|
12510
|
-
var
|
12511
|
-
var PopoverContext = (0,
|
12784
|
+
var import_react88 = require("react");
|
12785
|
+
var PopoverContext = (0, import_react88.createContext)(null);
|
12512
12786
|
var usePopoverContext = () => {
|
12513
|
-
const ctx = (0,
|
12787
|
+
const ctx = (0, import_react88.useContext)(PopoverContext);
|
12514
12788
|
if (ctx === null) {
|
12515
12789
|
throw new Error("PopoverContext was used outside of provider.");
|
12516
12790
|
}
|
@@ -12530,25 +12804,25 @@ var Popover2 = (props) => {
|
|
12530
12804
|
crossOffset,
|
12531
12805
|
shouldFlip
|
12532
12806
|
} = props;
|
12533
|
-
const triggerRef = (0,
|
12807
|
+
const triggerRef = (0, import_react89.useRef)(null);
|
12534
12808
|
const state = (0, import_overlays10.useOverlayTriggerState)(props);
|
12535
12809
|
const { triggerProps, overlayProps } = (0, import_overlays9.useOverlayTrigger)({ type: type != null ? type : "dialog" }, state, triggerRef);
|
12536
|
-
return /* @__PURE__ */
|
12810
|
+
return /* @__PURE__ */ import_react89.default.createElement(PopoverContext.Provider, {
|
12537
12811
|
value: {
|
12538
12812
|
state
|
12539
12813
|
}
|
12540
|
-
},
|
12814
|
+
}, import_react89.default.Children.map(props.children, (child) => {
|
12541
12815
|
if (isComponentType(child, Popover2.Trigger)) {
|
12542
|
-
return /* @__PURE__ */
|
12816
|
+
return /* @__PURE__ */ import_react89.default.createElement(import_interactions3.PressResponder, __spreadValues({
|
12543
12817
|
ref: triggerRef
|
12544
|
-
}, (0, import_omit10.default)(triggerProps, "aria-expanded")), /* @__PURE__ */
|
12818
|
+
}, (0, import_omit10.default)(triggerProps, "aria-expanded")), /* @__PURE__ */ import_react89.default.createElement(PopoverTriggerWrapper, {
|
12545
12819
|
"data-testid": props["data-testid"],
|
12546
12820
|
"aria-controls": id,
|
12547
12821
|
"aria-expanded": triggerProps["aria-expanded"]
|
12548
12822
|
}, child.props.children));
|
12549
12823
|
}
|
12550
12824
|
if (isComponentType(child, Popover2.Panel)) {
|
12551
|
-
return state.isOpen && /* @__PURE__ */
|
12825
|
+
return state.isOpen && /* @__PURE__ */ import_react89.default.createElement(PopoverOverlay, __spreadValues({
|
12552
12826
|
triggerRef: targetRef != null ? targetRef : triggerRef,
|
12553
12827
|
state,
|
12554
12828
|
placement,
|
@@ -12559,7 +12833,7 @@ var Popover2 = (props) => {
|
|
12559
12833
|
offset,
|
12560
12834
|
crossOffset,
|
12561
12835
|
shouldFlip
|
12562
|
-
}, overlayProps), containFocus ? /* @__PURE__ */
|
12836
|
+
}, overlayProps), containFocus ? /* @__PURE__ */ import_react89.default.createElement(Dialog2, null, child.props.children) : child.props.children);
|
12563
12837
|
}
|
12564
12838
|
throw new Error("Invalid children element type");
|
12565
12839
|
}));
|
@@ -12578,7 +12852,7 @@ var asPopoverButton = (Component, displayName) => {
|
|
12578
12852
|
state.close();
|
12579
12853
|
onClick == null ? void 0 : onClick(e);
|
12580
12854
|
};
|
12581
|
-
return /* @__PURE__ */
|
12855
|
+
return /* @__PURE__ */ import_react89.default.createElement(Component, __spreadProps(__spreadValues({}, props), {
|
12582
12856
|
onClick: handleClick
|
12583
12857
|
}));
|
12584
12858
|
};
|
@@ -12590,22 +12864,22 @@ Popover2.Button = PopoverButton;
|
|
12590
12864
|
var PopoverTriggerWrapper = (_a) => {
|
12591
12865
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
12592
12866
|
var _a2;
|
12593
|
-
const ref = (0,
|
12594
|
-
const trigger =
|
12867
|
+
const ref = (0, import_react89.useRef)(null);
|
12868
|
+
const trigger = import_react89.default.Children.only(children);
|
12595
12869
|
const { pressProps } = (0, import_interactions3.usePress)(__spreadProps(__spreadValues({}, rest), { ref }));
|
12596
|
-
return
|
12870
|
+
return import_react89.default.cloneElement(trigger, __spreadProps(__spreadValues({
|
12597
12871
|
"ref": ref
|
12598
|
-
}, (0,
|
12872
|
+
}, (0, import_utils22.mergeProps)(pressProps, trigger.props)), {
|
12599
12873
|
"aria-controls": (_a2 = rest["aria-controls"]) != null ? _a2 : pressProps["aria-controls"]
|
12600
12874
|
}));
|
12601
12875
|
};
|
12602
12876
|
|
12603
12877
|
// src/molecules/Dropdown/Dropdown.tsx
|
12604
12878
|
var Dropdown = ({ children, content, placement = "bottom-left" }) => {
|
12605
|
-
return /* @__PURE__ */
|
12879
|
+
return /* @__PURE__ */ import_react90.default.createElement(Popover2, {
|
12606
12880
|
type: "menu",
|
12607
12881
|
placement
|
12608
|
-
}, /* @__PURE__ */
|
12882
|
+
}, /* @__PURE__ */ import_react90.default.createElement(Popover2.Trigger, null, children), /* @__PURE__ */ import_react90.default.createElement(Popover2.Panel, {
|
12609
12883
|
className: "Aquarium-Dropdown"
|
12610
12884
|
}, content));
|
12611
12885
|
};
|
@@ -12616,26 +12890,26 @@ var DropdownMenu3 = ({
|
|
12616
12890
|
triggerId,
|
12617
12891
|
setClose = () => void 0
|
12618
12892
|
}) => {
|
12619
|
-
const menuRef =
|
12620
|
-
|
12893
|
+
const menuRef = import_react90.default.useRef(null);
|
12894
|
+
import_react90.default.useEffect(() => {
|
12621
12895
|
const id = setTimeout(() => {
|
12622
12896
|
var _a, _b, _c;
|
12623
12897
|
return (_c = (_b = (_a = menuRef.current) == null ? void 0 : _a.children) == null ? void 0 : _b[0]) == null ? void 0 : _c.focus();
|
12624
12898
|
});
|
12625
12899
|
return () => clearTimeout(id);
|
12626
12900
|
}, [menuRef.current]);
|
12627
|
-
return /* @__PURE__ */
|
12901
|
+
return /* @__PURE__ */ import_react90.default.createElement("div", {
|
12628
12902
|
style: { minWidth: "250px" },
|
12629
12903
|
className: tw("py-3 bg-white")
|
12630
|
-
}, !!title && /* @__PURE__ */
|
12904
|
+
}, !!title && /* @__PURE__ */ import_react90.default.createElement("div", {
|
12631
12905
|
className: tw("px-4 py-4 text-left text-grey-100 typography-default-strong")
|
12632
|
-
}, title), /* @__PURE__ */
|
12906
|
+
}, title), /* @__PURE__ */ import_react90.default.createElement("ol", {
|
12633
12907
|
role: "menu",
|
12634
12908
|
ref: menuRef,
|
12635
12909
|
id: contentId,
|
12636
12910
|
"aria-labelledby": triggerId
|
12637
|
-
},
|
12638
|
-
return
|
12911
|
+
}, import_react90.default.Children.map(children, (child) => {
|
12912
|
+
return import_react90.default.cloneElement(child, { setClose });
|
12639
12913
|
})));
|
12640
12914
|
};
|
12641
12915
|
var DropdownItem = (_a) => {
|
@@ -12690,10 +12964,10 @@ var DropdownItem = (_a) => {
|
|
12690
12964
|
handleSelect();
|
12691
12965
|
}
|
12692
12966
|
};
|
12693
|
-
const itemContent = /* @__PURE__ */
|
12967
|
+
const itemContent = /* @__PURE__ */ import_react90.default.createElement("div", {
|
12694
12968
|
className: tw("py-3 px-4")
|
12695
12969
|
}, children);
|
12696
|
-
return /* @__PURE__ */
|
12970
|
+
return /* @__PURE__ */ import_react90.default.createElement("li", __spreadProps(__spreadValues({
|
12697
12971
|
role: "menuitem",
|
12698
12972
|
tabIndex: -1,
|
12699
12973
|
onClick: handleClick,
|
@@ -12704,11 +12978,11 @@ var DropdownItem = (_a) => {
|
|
12704
12978
|
"text-muted cursor-not-allowed": disabled,
|
12705
12979
|
"text-primary-70 hover:text-primary-80": color === "danger" && !disabled
|
12706
12980
|
})
|
12707
|
-
}), tooltip ? /* @__PURE__ */
|
12981
|
+
}), tooltip ? /* @__PURE__ */ import_react90.default.createElement(Tooltip, {
|
12708
12982
|
content: tooltip,
|
12709
12983
|
placement: tooltipPlacement,
|
12710
12984
|
inline: false
|
12711
|
-
}, /* @__PURE__ */
|
12985
|
+
}, /* @__PURE__ */ import_react90.default.createElement("div", {
|
12712
12986
|
tabIndex: 0,
|
12713
12987
|
className: tw("grow")
|
12714
12988
|
}, itemContent)) : itemContent);
|
@@ -12717,7 +12991,7 @@ Dropdown.Menu = DropdownMenu3;
|
|
12717
12991
|
Dropdown.Item = DropdownItem;
|
12718
12992
|
|
12719
12993
|
// src/molecules/EmptyState/EmptyState.tsx
|
12720
|
-
var
|
12994
|
+
var import_react91 = __toESM(require("react"));
|
12721
12995
|
var EmptyStateLayout = /* @__PURE__ */ ((EmptyStateLayout2) => {
|
12722
12996
|
EmptyStateLayout2["Vertical"] = "vertical";
|
12723
12997
|
EmptyStateLayout2["Horizontal"] = "horizontal";
|
@@ -12774,7 +13048,7 @@ var EmptyState = ({
|
|
12774
13048
|
fullHeight = isVerticalLayout(layout) ? true : false
|
12775
13049
|
}) => {
|
12776
13050
|
const template = layoutStyle(layout);
|
12777
|
-
return /* @__PURE__ */
|
13051
|
+
return /* @__PURE__ */ import_react91.default.createElement(Box, {
|
12778
13052
|
className: classNames(
|
12779
13053
|
"Aquarium-EmptyState",
|
12780
13054
|
tw("rounded p-[56px]", {
|
@@ -12787,39 +13061,39 @@ var EmptyState = ({
|
|
12787
13061
|
),
|
12788
13062
|
backgroundColor: "transparent",
|
12789
13063
|
borderColor: "grey-10"
|
12790
|
-
}, /* @__PURE__ */
|
13064
|
+
}, /* @__PURE__ */ import_react91.default.createElement(Box.Flex, {
|
12791
13065
|
style: { gap: "56px" },
|
12792
13066
|
flexDirection: template.layout,
|
12793
13067
|
justifyContent: template.justifyContent,
|
12794
13068
|
alignItems: template.layout === "row" ? "center" : template.alignItems,
|
12795
13069
|
height: fullHeight ? "full" : void 0
|
12796
|
-
}, image && /* @__PURE__ */
|
13070
|
+
}, image && /* @__PURE__ */ import_react91.default.createElement("img", {
|
12797
13071
|
src: image,
|
12798
13072
|
alt: imageAlt,
|
12799
13073
|
style: { width: imageWidth ? `${imageWidth}px` : void 0, height: "auto" }
|
12800
|
-
}), /* @__PURE__ */
|
13074
|
+
}), /* @__PURE__ */ import_react91.default.createElement(Box.Flex, {
|
12801
13075
|
flexDirection: "column",
|
12802
13076
|
justifyContent: template.justifyContent,
|
12803
13077
|
alignItems: template.alignItems
|
12804
|
-
}, /* @__PURE__ */
|
13078
|
+
}, /* @__PURE__ */ import_react91.default.createElement(Typography2.Heading, {
|
12805
13079
|
htmlTag: "h2"
|
12806
|
-
}, title), (description || children) && /* @__PURE__ */
|
13080
|
+
}, title), (description || children) && /* @__PURE__ */ import_react91.default.createElement(Box, {
|
12807
13081
|
marginTop: "5"
|
12808
|
-
}, /* @__PURE__ */
|
13082
|
+
}, /* @__PURE__ */ import_react91.default.createElement(Typography2.Default, null, children || description)), (secondaryAction || primaryAction) && /* @__PURE__ */ import_react91.default.createElement(Box.Flex, {
|
12809
13083
|
marginTop: "7",
|
12810
13084
|
gap: "4",
|
12811
13085
|
justifyContent: "center",
|
12812
13086
|
alignItems: "center",
|
12813
13087
|
flexWrap: "wrap"
|
12814
|
-
}, primaryAction && renderAction({ kind: "primary", action: primaryAction }), secondaryAction && renderAction({ kind: "secondary", action: secondaryAction })), footer && /* @__PURE__ */
|
13088
|
+
}, primaryAction && renderAction({ kind: "primary", action: primaryAction }), secondaryAction && renderAction({ kind: "secondary", action: secondaryAction })), footer && /* @__PURE__ */ import_react91.default.createElement(Box, {
|
12815
13089
|
marginTop: "5"
|
12816
|
-
}, /* @__PURE__ */
|
13090
|
+
}, /* @__PURE__ */ import_react91.default.createElement(Typography2.Small, {
|
12817
13091
|
color: "grey-60"
|
12818
13092
|
}, footer)))));
|
12819
13093
|
};
|
12820
13094
|
|
12821
13095
|
// src/molecules/Flexbox/FlexboxItem.tsx
|
12822
|
-
var
|
13096
|
+
var import_react92 = __toESM(require("react"));
|
12823
13097
|
var FlexboxItem = Tailwindify(
|
12824
13098
|
({ htmlTag = "div", className, style, children, display, flex, grow, shrink, order, alignSelf }) => {
|
12825
13099
|
const hookStyle = useStyle({
|
@@ -12831,7 +13105,7 @@ var FlexboxItem = Tailwindify(
|
|
12831
13105
|
alignSelf
|
12832
13106
|
});
|
12833
13107
|
const HtmlElement = htmlTag;
|
12834
|
-
return /* @__PURE__ */
|
13108
|
+
return /* @__PURE__ */ import_react92.default.createElement(HtmlElement, {
|
12835
13109
|
style: __spreadValues(__spreadValues({}, hookStyle), style),
|
12836
13110
|
className
|
12837
13111
|
}, children);
|
@@ -12839,7 +13113,7 @@ var FlexboxItem = Tailwindify(
|
|
12839
13113
|
);
|
12840
13114
|
|
12841
13115
|
// src/molecules/Grid/GridItem.tsx
|
12842
|
-
var
|
13116
|
+
var import_react93 = __toESM(require("react"));
|
12843
13117
|
var GridItem2 = Tailwindify(
|
12844
13118
|
({
|
12845
13119
|
htmlTag = "div",
|
@@ -12870,7 +13144,7 @@ var GridItem2 = Tailwindify(
|
|
12870
13144
|
gridRowEnd: rowEnd
|
12871
13145
|
});
|
12872
13146
|
const HtmlElement = htmlTag;
|
12873
|
-
return /* @__PURE__ */
|
13147
|
+
return /* @__PURE__ */ import_react93.default.createElement(HtmlElement, {
|
12874
13148
|
style: __spreadValues(__spreadValues({}, hookStyle), style),
|
12875
13149
|
className
|
12876
13150
|
}, children);
|
@@ -12878,7 +13152,7 @@ var GridItem2 = Tailwindify(
|
|
12878
13152
|
);
|
12879
13153
|
|
12880
13154
|
// src/molecules/LineClamp/LineClamp.tsx
|
12881
|
-
var
|
13155
|
+
var import_react94 = __toESM(require("react"));
|
12882
13156
|
var LineClamp2 = ({
|
12883
13157
|
lines,
|
12884
13158
|
children,
|
@@ -12887,10 +13161,10 @@ var LineClamp2 = ({
|
|
12887
13161
|
collapseLabel,
|
12888
13162
|
onClampedChange
|
12889
13163
|
}) => {
|
12890
|
-
const ref =
|
12891
|
-
const [clamped, setClamped] =
|
12892
|
-
const [isClampingEnabled, setClampingEnabled] =
|
12893
|
-
|
13164
|
+
const ref = import_react94.default.useRef(null);
|
13165
|
+
const [clamped, setClamped] = import_react94.default.useState(true);
|
13166
|
+
const [isClampingEnabled, setClampingEnabled] = import_react94.default.useState(false);
|
13167
|
+
import_react94.default.useEffect(() => {
|
12894
13168
|
var _a, _b;
|
12895
13169
|
const el = ref.current;
|
12896
13170
|
setClampingEnabled(((_a = el == null ? void 0 : el.scrollHeight) != null ? _a : 0) > ((_b = el == null ? void 0 : el.clientHeight) != null ? _b : 0));
|
@@ -12899,28 +13173,28 @@ var LineClamp2 = ({
|
|
12899
13173
|
setClamped(!clamped);
|
12900
13174
|
onClampedChange == null ? void 0 : onClampedChange(!clamped);
|
12901
13175
|
};
|
12902
|
-
return /* @__PURE__ */
|
13176
|
+
return /* @__PURE__ */ import_react94.default.createElement("div", {
|
12903
13177
|
className: "Aquarium-LineClamp"
|
12904
|
-
}, /* @__PURE__ */
|
13178
|
+
}, /* @__PURE__ */ import_react94.default.createElement(LineClamp, {
|
12905
13179
|
ref,
|
12906
13180
|
lines,
|
12907
13181
|
clamped,
|
12908
13182
|
wordBreak
|
12909
|
-
}, children), expandLabel && isClampingEnabled && /* @__PURE__ */
|
13183
|
+
}, children), expandLabel && isClampingEnabled && /* @__PURE__ */ import_react94.default.createElement(Button.Ghost, {
|
12910
13184
|
dense: true,
|
12911
13185
|
onClick: handleClampedChange
|
12912
13186
|
}, clamped ? expandLabel : collapseLabel));
|
12913
13187
|
};
|
12914
13188
|
|
12915
13189
|
// src/molecules/Link/Link.tsx
|
12916
|
-
var
|
13190
|
+
var import_react96 = __toESM(require("react"));
|
12917
13191
|
var import_classnames9 = __toESM(require("classnames"));
|
12918
13192
|
|
12919
13193
|
// src/atoms/Link/Link.tsx
|
12920
|
-
var
|
13194
|
+
var import_react95 = __toESM(require("react"));
|
12921
13195
|
var Link = (_a) => {
|
12922
13196
|
var _b = _a, { children, className } = _b, props = __objRest(_b, ["children", "className"]);
|
12923
|
-
return /* @__PURE__ */
|
13197
|
+
return /* @__PURE__ */ import_react95.default.createElement("a", __spreadValues({
|
12924
13198
|
className: classNames(className, linkStyle)
|
12925
13199
|
}, props), children);
|
12926
13200
|
};
|
@@ -12928,27 +13202,27 @@ var Link = (_a) => {
|
|
12928
13202
|
// src/molecules/Link/Link.tsx
|
12929
13203
|
var Link2 = (_a) => {
|
12930
13204
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
12931
|
-
return /* @__PURE__ */
|
13205
|
+
return /* @__PURE__ */ import_react96.default.createElement(Link, __spreadValues({
|
12932
13206
|
className: (0, import_classnames9.default)("Aquarium-Link", className)
|
12933
13207
|
}, props));
|
12934
13208
|
};
|
12935
13209
|
|
12936
13210
|
// src/molecules/List/useStaticInfiniteList.ts
|
12937
|
-
var
|
13211
|
+
var import_react97 = __toESM(require("react"));
|
12938
13212
|
var useStaticInfiniteList = ({
|
12939
13213
|
items,
|
12940
13214
|
pageSize,
|
12941
13215
|
autoReset = true
|
12942
13216
|
}) => {
|
12943
|
-
const [currentPage, setCurrentPage] =
|
13217
|
+
const [currentPage, setCurrentPage] = import_react97.default.useState(1);
|
12944
13218
|
const numberOfVisible = currentPage * pageSize;
|
12945
|
-
const next =
|
13219
|
+
const next = import_react97.default.useCallback(() => {
|
12946
13220
|
setCurrentPage((page) => page + 1);
|
12947
13221
|
}, [setCurrentPage]);
|
12948
|
-
const reset =
|
13222
|
+
const reset = import_react97.default.useCallback(() => {
|
12949
13223
|
setCurrentPage(1);
|
12950
13224
|
}, [setCurrentPage]);
|
12951
|
-
|
13225
|
+
import_react97.default.useEffect(() => {
|
12952
13226
|
if (autoReset) {
|
12953
13227
|
setCurrentPage(1);
|
12954
13228
|
}
|
@@ -12963,17 +13237,17 @@ var useStaticInfiniteList = ({
|
|
12963
13237
|
};
|
12964
13238
|
|
12965
13239
|
// src/molecules/ListItem/ListItem.tsx
|
12966
|
-
var
|
13240
|
+
var import_react98 = __toESM(require("react"));
|
12967
13241
|
var ListItem = ({ name, icon, active = false }) => {
|
12968
|
-
return /* @__PURE__ */
|
13242
|
+
return /* @__PURE__ */ import_react98.default.createElement(Box.Flex, {
|
12969
13243
|
className: "Aquarium-ListItem",
|
12970
13244
|
alignItems: "center"
|
12971
|
-
}, /* @__PURE__ */
|
13245
|
+
}, /* @__PURE__ */ import_react98.default.createElement(Typography2, {
|
12972
13246
|
variant: active ? "small-strong" : "small",
|
12973
13247
|
color: "grey-70",
|
12974
13248
|
htmlTag: "span",
|
12975
13249
|
className: `px-4 py-2 rounded-full ${active ? "bg-grey-5" : "hover:bg-grey-0"}`
|
12976
|
-
}, /* @__PURE__ */
|
13250
|
+
}, /* @__PURE__ */ import_react98.default.createElement("img", {
|
12977
13251
|
src: icon,
|
12978
13252
|
alt: "",
|
12979
13253
|
className: "inline mr-4",
|
@@ -12983,18 +13257,18 @@ var ListItem = ({ name, icon, active = false }) => {
|
|
12983
13257
|
};
|
12984
13258
|
|
12985
13259
|
// src/molecules/Modal/Modal.tsx
|
12986
|
-
var
|
13260
|
+
var import_react99 = __toESM(require("react"));
|
12987
13261
|
var import_dialog4 = require("@react-aria/dialog");
|
12988
13262
|
var import_overlays11 = require("@react-aria/overlays");
|
12989
|
-
var
|
13263
|
+
var import_utils24 = require("@react-aria/utils");
|
12990
13264
|
var import_overlays12 = require("@react-stately/overlays");
|
12991
|
-
var
|
13265
|
+
var import_castArray4 = __toESM(require("lodash/castArray"));
|
12992
13266
|
var import_omit11 = __toESM(require("lodash/omit"));
|
12993
13267
|
var import_cross7 = __toESM(require_cross());
|
12994
13268
|
var Modal2 = (_a) => {
|
12995
13269
|
var _b = _a, { closeOnEsc = true } = _b, props = __objRest(_b, ["closeOnEsc"]);
|
12996
13270
|
const { open, onClose, size, portalContainer } = props;
|
12997
|
-
const ref =
|
13271
|
+
const ref = import_react99.default.useRef(null);
|
12998
13272
|
const state = (0, import_overlays12.useOverlayTriggerState)({ isOpen: open, onOpenChange: (isOpen) => !isOpen && onClose() });
|
12999
13273
|
const { modalProps, underlayProps } = (0, import_overlays11.useModalOverlay)(
|
13000
13274
|
{ isDismissable: false, isKeyboardDismissDisabled: !closeOnEsc },
|
@@ -13004,49 +13278,49 @@ var Modal2 = (_a) => {
|
|
13004
13278
|
if (!state.isOpen) {
|
13005
13279
|
return null;
|
13006
13280
|
}
|
13007
|
-
return /* @__PURE__ */
|
13281
|
+
return /* @__PURE__ */ import_react99.default.createElement(import_overlays11.Overlay, {
|
13008
13282
|
portalContainer
|
13009
|
-
}, /* @__PURE__ */
|
13283
|
+
}, /* @__PURE__ */ import_react99.default.createElement(Modal, {
|
13010
13284
|
className: "Aquarium-Modal",
|
13011
13285
|
open: true
|
13012
|
-
}, /* @__PURE__ */
|
13286
|
+
}, /* @__PURE__ */ import_react99.default.createElement(Modal.BackDrop, __spreadValues({}, underlayProps)), /* @__PURE__ */ import_react99.default.createElement(ModalWrapper, __spreadValues(__spreadValues({
|
13013
13287
|
ref,
|
13014
13288
|
size
|
13015
13289
|
}, props), modalProps))));
|
13016
13290
|
};
|
13017
|
-
var ModalWrapper =
|
13291
|
+
var ModalWrapper = import_react99.default.forwardRef(
|
13018
13292
|
(_a, ref) => {
|
13019
13293
|
var _b = _a, { title, subtitle, headerImage, primaryAction, secondaryActions, children, onClose } = _b, props = __objRest(_b, ["title", "subtitle", "headerImage", "primaryAction", "secondaryActions", "children", "onClose"]);
|
13020
|
-
const labelledBy = (0,
|
13021
|
-
const describedBy = (0,
|
13294
|
+
const labelledBy = (0, import_utils24.useId)();
|
13295
|
+
const describedBy = (0, import_utils24.useId)();
|
13022
13296
|
const { dialogProps } = (0, import_dialog4.useDialog)(
|
13023
13297
|
{ "role": "dialog", "aria-labelledby": labelledBy, "aria-describedby": describedBy },
|
13024
13298
|
ref
|
13025
13299
|
);
|
13026
|
-
return /* @__PURE__ */
|
13300
|
+
return /* @__PURE__ */ import_react99.default.createElement(Modal.Dialog, __spreadProps(__spreadValues(__spreadValues({
|
13027
13301
|
ref
|
13028
13302
|
}, props), dialogProps), {
|
13029
13303
|
tabIndex: -1
|
13030
|
-
}), /* @__PURE__ */
|
13304
|
+
}), /* @__PURE__ */ import_react99.default.createElement(Modal.CloseButtonContainer, null, /* @__PURE__ */ import_react99.default.createElement(IconButton, {
|
13031
13305
|
"aria-label": "Close",
|
13032
13306
|
icon: import_cross7.default,
|
13033
13307
|
onClick: onClose
|
13034
|
-
})), headerImage !== void 0 && /* @__PURE__ */
|
13308
|
+
})), headerImage !== void 0 && /* @__PURE__ */ import_react99.default.createElement(Modal.HeaderImage, {
|
13035
13309
|
backgroundImage: headerImage
|
13036
|
-
}), /* @__PURE__ */
|
13310
|
+
}), /* @__PURE__ */ import_react99.default.createElement(Modal.Header, {
|
13037
13311
|
className: tw({ "pb-3": isComponentType(children, ModalTabs) })
|
13038
|
-
}, /* @__PURE__ */
|
13312
|
+
}, /* @__PURE__ */ import_react99.default.createElement(Modal.TitleContainer, null, /* @__PURE__ */ import_react99.default.createElement(Modal.Title, {
|
13039
13313
|
id: labelledBy
|
13040
|
-
}, title), subtitle && /* @__PURE__ */
|
13314
|
+
}, title), subtitle && /* @__PURE__ */ import_react99.default.createElement(Modal.Subtitle, null, subtitle))), isComponentType(children, ModalTabs) ? import_react99.default.cloneElement(children, { className: tw("[&>div:first-child]:px-5 grow") }) : /* @__PURE__ */ import_react99.default.createElement(Modal.Body, {
|
13041
13315
|
id: describedBy,
|
13042
13316
|
tabIndex: 0,
|
13043
13317
|
noFooter: !(secondaryActions || primaryAction)
|
13044
|
-
}, children), (secondaryActions || primaryAction) && /* @__PURE__ */
|
13318
|
+
}, children), (secondaryActions || primaryAction) && /* @__PURE__ */ import_react99.default.createElement(Modal.Footer, null, /* @__PURE__ */ import_react99.default.createElement(Modal.Actions, null, secondaryActions && (0, import_castArray4.default)(secondaryActions).filter(Boolean).map((_a2) => {
|
13045
13319
|
var _b2 = _a2, { text } = _b2, action = __objRest(_b2, ["text"]);
|
13046
|
-
return /* @__PURE__ */
|
13320
|
+
return /* @__PURE__ */ import_react99.default.createElement(Button.Secondary, __spreadValues({
|
13047
13321
|
key: text
|
13048
13322
|
}, action), text);
|
13049
|
-
}), primaryAction && /* @__PURE__ */
|
13323
|
+
}), primaryAction && /* @__PURE__ */ import_react99.default.createElement(Button.Primary, __spreadValues({
|
13050
13324
|
key: primaryAction.text
|
13051
13325
|
}, (0, import_omit11.default)(primaryAction, "text")), primaryAction.text))));
|
13052
13326
|
}
|
@@ -13055,24 +13329,24 @@ var ModalTabs = createTabsComponent(
|
|
13055
13329
|
ModalTab,
|
13056
13330
|
TabItem,
|
13057
13331
|
"ModalTabs",
|
13058
|
-
(children, selected, props) => /* @__PURE__ */
|
13332
|
+
(children, selected, props) => /* @__PURE__ */ import_react99.default.createElement(Modal.Body, {
|
13059
13333
|
maxHeight: props.maxHeight
|
13060
|
-
}, /* @__PURE__ */
|
13334
|
+
}, /* @__PURE__ */ import_react99.default.createElement(ModalTabContainer, null, children.find(
|
13061
13335
|
(node, index) => (node == null ? void 0 : node.props.value) === selected || index === selected
|
13062
13336
|
)))
|
13063
13337
|
);
|
13064
13338
|
|
13065
13339
|
// src/molecules/MultiInput/MultiInput.tsx
|
13066
|
-
var
|
13067
|
-
var
|
13068
|
-
var
|
13340
|
+
var import_react101 = __toESM(require("react"));
|
13341
|
+
var import_utils26 = require("@react-aria/utils");
|
13342
|
+
var import_castArray5 = __toESM(require("lodash/castArray"));
|
13069
13343
|
var import_identity = __toESM(require("lodash/identity"));
|
13070
13344
|
var import_omit12 = __toESM(require("lodash/omit"));
|
13071
13345
|
|
13072
13346
|
// src/molecules/MultiInput/InputChip.tsx
|
13073
|
-
var
|
13347
|
+
var import_react100 = __toESM(require("react"));
|
13074
13348
|
var import_smallCross2 = __toESM(require_smallCross());
|
13075
|
-
var InputChip =
|
13349
|
+
var InputChip = import_react100.default.forwardRef(
|
13076
13350
|
(_a, ref) => {
|
13077
13351
|
var _b = _a, { invalid = false, disabled, readOnly, className, onClick: _onClick, children } = _b, props = __objRest(_b, ["invalid", "disabled", "readOnly", "className", "onClick", "children"]);
|
13078
13352
|
const onClick = (e) => {
|
@@ -13080,18 +13354,18 @@ var InputChip = import_react98.default.forwardRef(
|
|
13080
13354
|
_onClick == null ? void 0 : _onClick(e);
|
13081
13355
|
}
|
13082
13356
|
};
|
13083
|
-
return /* @__PURE__ */
|
13357
|
+
return /* @__PURE__ */ import_react100.default.createElement("div", {
|
13084
13358
|
className: classNames(className, "inline-flex align-middle mx-1 items-stretch rounded-sm break-all", {
|
13085
13359
|
"bg-error-0 ": invalid,
|
13086
13360
|
"bg-grey-0 ": !invalid && !disabled,
|
13087
13361
|
"bg-grey-5": disabled
|
13088
13362
|
})
|
13089
|
-
}, /* @__PURE__ */
|
13363
|
+
}, /* @__PURE__ */ import_react100.default.createElement("div", {
|
13090
13364
|
className: tw("px-2 py-1")
|
13091
|
-
}, /* @__PURE__ */
|
13365
|
+
}, /* @__PURE__ */ import_react100.default.createElement(Typography2, {
|
13092
13366
|
variant: "small",
|
13093
13367
|
color: invalid ? "error-80" : disabled ? "grey-40" : "grey-70"
|
13094
|
-
}, children)), !readOnly && /* @__PURE__ */
|
13368
|
+
}, children)), !readOnly && /* @__PURE__ */ import_react100.default.createElement("div", __spreadProps(__spreadValues({
|
13095
13369
|
ref
|
13096
13370
|
}, props), {
|
13097
13371
|
onClick,
|
@@ -13102,7 +13376,7 @@ var InputChip = import_react98.default.forwardRef(
|
|
13102
13376
|
}),
|
13103
13377
|
role: "button",
|
13104
13378
|
"aria-label": `Remove ${String(children)}`
|
13105
|
-
}), /* @__PURE__ */
|
13379
|
+
}), /* @__PURE__ */ import_react100.default.createElement(Icon, {
|
13106
13380
|
icon: import_smallCross2.default,
|
13107
13381
|
className: tw({
|
13108
13382
|
"text-error-70": invalid,
|
@@ -13160,11 +13434,11 @@ var MultiInputBase = (_a) => {
|
|
13160
13434
|
"valid"
|
13161
13435
|
]);
|
13162
13436
|
var _a2;
|
13163
|
-
const inputRef = (0,
|
13164
|
-
const [items, setItems] = (0,
|
13165
|
-
const [hasFocus, setFocus] = (0,
|
13437
|
+
const inputRef = (0, import_react101.useRef)(null);
|
13438
|
+
const [items, setItems] = (0, import_react101.useState)((_a2 = value != null ? value : defaultValue) != null ? _a2 : []);
|
13439
|
+
const [hasFocus, setFocus] = (0, import_react101.useState)(false);
|
13166
13440
|
const keyCodes = [delimiter !== "enter" ? " " : null, delimiter !== "space" ? "Enter" : null].filter(import_identity.default);
|
13167
|
-
(0,
|
13441
|
+
(0, import_react101.useEffect)(() => {
|
13168
13442
|
const requiresUpdate = value !== void 0 || defaultValue === void 0;
|
13169
13443
|
if (requiresUpdate && JSON.stringify(value) !== JSON.stringify(items)) {
|
13170
13444
|
setItems(value != null ? value : []);
|
@@ -13205,7 +13479,7 @@ var MultiInputBase = (_a) => {
|
|
13205
13479
|
inputRef.current.value = "";
|
13206
13480
|
}
|
13207
13481
|
if (value2) {
|
13208
|
-
const newItems = (0,
|
13482
|
+
const newItems = (0, import_castArray5.default)(value2).map(createItem).filter((item) => !items.includes(item));
|
13209
13483
|
if (newItems.length > 0 && items.length + newItems.length <= (maxLength != null ? maxLength : Number.MAX_SAFE_INTEGER)) {
|
13210
13484
|
const updated = (items != null ? items : []).concat(newItems);
|
13211
13485
|
setItems(updated);
|
@@ -13243,7 +13517,7 @@ var MultiInputBase = (_a) => {
|
|
13243
13517
|
};
|
13244
13518
|
const renderChips = () => items == null ? void 0 : items.map((item, index) => {
|
13245
13519
|
var _a3;
|
13246
|
-
return /* @__PURE__ */
|
13520
|
+
return /* @__PURE__ */ import_react101.default.createElement(InputChip, {
|
13247
13521
|
key: `${itemToString(item)}.${index}`,
|
13248
13522
|
invalid: !((_a3 = isItemValid == null ? void 0 : isItemValid(item, index)) != null ? _a3 : true),
|
13249
13523
|
readOnly,
|
@@ -13254,13 +13528,13 @@ var MultiInputBase = (_a) => {
|
|
13254
13528
|
}
|
13255
13529
|
}, itemToString(item));
|
13256
13530
|
});
|
13257
|
-
return /* @__PURE__ */
|
13531
|
+
return /* @__PURE__ */ import_react101.default.createElement("div", {
|
13258
13532
|
className: "Aquarium-MultiInputBase"
|
13259
|
-
}, /* @__PURE__ */
|
13533
|
+
}, /* @__PURE__ */ import_react101.default.createElement(Select.InputContainer, {
|
13260
13534
|
variant: disabled ? "disabled" : !valid ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default"
|
13261
|
-
}, /* @__PURE__ */
|
13535
|
+
}, /* @__PURE__ */ import_react101.default.createElement("div", {
|
13262
13536
|
className: "grow inline-flex flex-row flex-wrap gap-y-2"
|
13263
|
-
}, inline && renderChips(), /* @__PURE__ */
|
13537
|
+
}, inline && renderChips(), /* @__PURE__ */ import_react101.default.createElement(Select.Input, __spreadProps(__spreadValues({
|
13264
13538
|
ref: inputRef,
|
13265
13539
|
id: id != null ? id : name,
|
13266
13540
|
name,
|
@@ -13278,29 +13552,29 @@ var MultiInputBase = (_a) => {
|
|
13278
13552
|
onFocus: handleFocus,
|
13279
13553
|
onBlur: handleBlur,
|
13280
13554
|
autoComplete: "off"
|
13281
|
-
}))), endAdornment && /* @__PURE__ */
|
13555
|
+
}))), endAdornment && /* @__PURE__ */ import_react101.default.createElement(InputAdornment, null, endAdornment)), !inline && /* @__PURE__ */ import_react101.default.createElement("div", {
|
13282
13556
|
className: tw("flex flex-row flex-wrap gap-y-2 mt-2")
|
13283
13557
|
}, renderChips()));
|
13284
13558
|
};
|
13285
|
-
var BaseMultiInputSkeleton = () => /* @__PURE__ */
|
13559
|
+
var BaseMultiInputSkeleton = () => /* @__PURE__ */ import_react101.default.createElement(Skeleton, {
|
13286
13560
|
height: 38
|
13287
13561
|
});
|
13288
13562
|
MultiInputBase.Skeleton = BaseMultiInputSkeleton;
|
13289
13563
|
var MultiInput = (props) => {
|
13290
13564
|
var _a, _b, _c, _d, _e;
|
13291
13565
|
const maxLength = (_a = props.maxLength) != null ? _a : props.max;
|
13292
|
-
const [value, setValue] = (0,
|
13293
|
-
(0,
|
13566
|
+
const [value, setValue] = (0, import_react101.useState)((_c = (_b = props.value) != null ? _b : props.defaultValue) != null ? _c : []);
|
13567
|
+
(0, import_react101.useEffect)(() => {
|
13294
13568
|
var _a2;
|
13295
13569
|
setValue((_a2 = props.value) != null ? _a2 : []);
|
13296
13570
|
}, [JSON.stringify(props.value)]);
|
13297
|
-
const defaultId = (0,
|
13571
|
+
const defaultId = (0, import_utils26.useId)();
|
13298
13572
|
const id = (_e = (_d = props.id) != null ? _d : props.name) != null ? _e : defaultId;
|
13299
|
-
const errorMessageId = (0,
|
13573
|
+
const errorMessageId = (0, import_utils26.useId)();
|
13300
13574
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
13301
13575
|
const labelControlProps = getLabelControlProps(props);
|
13302
13576
|
const baseProps = (0, import_omit12.default)(props, Object.keys(labelControlProps));
|
13303
|
-
return /* @__PURE__ */
|
13577
|
+
return /* @__PURE__ */ import_react101.default.createElement(LabelControl, __spreadProps(__spreadValues({
|
13304
13578
|
id: `${id}-label`,
|
13305
13579
|
htmlFor: `${id}-input`,
|
13306
13580
|
messageId: errorMessageId
|
@@ -13308,7 +13582,7 @@ var MultiInput = (props) => {
|
|
13308
13582
|
length: value.length,
|
13309
13583
|
maxLength,
|
13310
13584
|
className: "Aquarium-MultiInput"
|
13311
|
-
}), /* @__PURE__ */
|
13585
|
+
}), /* @__PURE__ */ import_react101.default.createElement(MultiInputBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
|
13312
13586
|
id: `${id}-input`,
|
13313
13587
|
onChange: (value2) => {
|
13314
13588
|
var _a2;
|
@@ -13320,14 +13594,14 @@ var MultiInput = (props) => {
|
|
13320
13594
|
valid: props.valid
|
13321
13595
|
})));
|
13322
13596
|
};
|
13323
|
-
var MultiInputSkeleton = () => /* @__PURE__ */
|
13597
|
+
var MultiInputSkeleton = () => /* @__PURE__ */ import_react101.default.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ import_react101.default.createElement(MultiInputBase.Skeleton, null));
|
13324
13598
|
MultiInput.Skeleton = MultiInputSkeleton;
|
13325
13599
|
MultiInput.Skeleton.displayName = "MultiInput.Skeleton";
|
13326
13600
|
|
13327
13601
|
// src/molecules/MultiSelect/MultiSelect.tsx
|
13328
|
-
var
|
13602
|
+
var import_react102 = __toESM(require("react"));
|
13329
13603
|
var import_overlays13 = require("@react-aria/overlays");
|
13330
|
-
var
|
13604
|
+
var import_utils27 = require("@react-aria/utils");
|
13331
13605
|
var import_downshift3 = require("downshift");
|
13332
13606
|
var import_isArray4 = __toESM(require("lodash/isArray"));
|
13333
13607
|
var import_isEqual = __toESM(require("lodash/isEqual"));
|
@@ -13391,12 +13665,12 @@ var MultiSelectBase = (_a) => {
|
|
13391
13665
|
"children"
|
13392
13666
|
]);
|
13393
13667
|
var _a2;
|
13394
|
-
const popoverRef = (0,
|
13395
|
-
const targetRef = (0,
|
13396
|
-
const menuRef = (0,
|
13397
|
-
const inputRef = (0,
|
13398
|
-
const [inputValue, setInputValue] = (0,
|
13399
|
-
const [hasFocus, setFocus] = (0,
|
13668
|
+
const popoverRef = (0, import_react102.useRef)(null);
|
13669
|
+
const targetRef = (0, import_react102.useRef)(null);
|
13670
|
+
const menuRef = (0, import_react102.useRef)(null);
|
13671
|
+
const inputRef = (0, import_react102.useRef)(null);
|
13672
|
+
const [inputValue, setInputValue] = (0, import_react102.useState)("");
|
13673
|
+
const [hasFocus, setFocus] = (0, import_react102.useState)(false);
|
13400
13674
|
const { selectedItems, addSelectedItem, removeSelectedItem, getDropdownProps, getSelectedItemProps } = (0, import_downshift3.useMultipleSelection)(
|
13401
13675
|
(0, import_omitBy.default)(
|
13402
13676
|
{
|
@@ -13480,21 +13754,21 @@ var MultiSelectBase = (_a) => {
|
|
13480
13754
|
toggle: toggleMenu,
|
13481
13755
|
setOpen: (isOpen2) => isOpen2 ? openMenu() : closeMenu()
|
13482
13756
|
};
|
13483
|
-
(0,
|
13757
|
+
(0, import_react102.useEffect)(() => {
|
13484
13758
|
if (state.isOpen && inputRef.current && popoverRef.current) {
|
13485
13759
|
return (0, import_overlays13.ariaHideOutside)([inputRef.current, popoverRef.current]);
|
13486
13760
|
}
|
13487
13761
|
}, [state.isOpen, inputRef, popoverRef]);
|
13488
|
-
const renderItem = (item, index) => /* @__PURE__ */
|
13762
|
+
const renderItem = (item, index) => /* @__PURE__ */ import_react102.default.createElement(Select.Item, __spreadValues({
|
13489
13763
|
key: itemToString(item),
|
13490
13764
|
highlighted: index === highlightedIndex,
|
13491
13765
|
selected: selectedItems.includes(item)
|
13492
13766
|
}, getItemProps({ item, index })), renderOption(item));
|
13493
|
-
const renderGroup = (group) => group.options.length ? /* @__PURE__ */
|
13767
|
+
const renderGroup = (group) => group.options.length ? /* @__PURE__ */ import_react102.default.createElement(import_react102.default.Fragment, {
|
13494
13768
|
key: group.label
|
13495
|
-
}, /* @__PURE__ */
|
13769
|
+
}, /* @__PURE__ */ import_react102.default.createElement(Select.Group, null, group.label), group.options.map((opt) => renderItem(opt, flattenedOptions.indexOf(opt)))) : null;
|
13496
13770
|
const renderChips = () => {
|
13497
|
-
return selectedItems.map((selectedItem, index) => /* @__PURE__ */
|
13771
|
+
return selectedItems.map((selectedItem, index) => /* @__PURE__ */ import_react102.default.createElement(InputChip, __spreadProps(__spreadValues({
|
13498
13772
|
key: `${itemToString(selectedItem)}.chip`,
|
13499
13773
|
className: tw("mx-0"),
|
13500
13774
|
disabled,
|
@@ -13512,14 +13786,14 @@ var MultiSelectBase = (_a) => {
|
|
13512
13786
|
getDropdownProps({ ref: inputRef, disabled: disabled || readOnly, value: inputValue })
|
13513
13787
|
);
|
13514
13788
|
const menuProps = getMenuProps({ ref: menuRef }, { suppressRefError: !isOpen });
|
13515
|
-
return /* @__PURE__ */
|
13789
|
+
return /* @__PURE__ */ import_react102.default.createElement("div", {
|
13516
13790
|
className: classNames("Aquarium-MultiSelectBase", tw("relative"))
|
13517
|
-
}, /* @__PURE__ */
|
13791
|
+
}, /* @__PURE__ */ import_react102.default.createElement(Select.InputContainer, {
|
13518
13792
|
ref: targetRef,
|
13519
13793
|
variant: disabled ? "disabled" : !valid ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default"
|
13520
|
-
}, /* @__PURE__ */
|
13794
|
+
}, /* @__PURE__ */ import_react102.default.createElement("div", {
|
13521
13795
|
className: "grow inline-flex flex-row flex-wrap gap-2"
|
13522
|
-
}, !hideChips && inline && renderChips(), /* @__PURE__ */
|
13796
|
+
}, !hideChips && inline && renderChips(), /* @__PURE__ */ import_react102.default.createElement(Select.Input, __spreadProps(__spreadValues(__spreadValues({
|
13523
13797
|
name,
|
13524
13798
|
placeholder: selectedItems.length === 0 && !readOnly ? placeholder : ""
|
13525
13799
|
}, inputProps), props), {
|
@@ -13538,12 +13812,12 @@ var MultiSelectBase = (_a) => {
|
|
13538
13812
|
setFocus(false);
|
13539
13813
|
(_a3 = inputProps.onBlur) == null ? void 0 : _a3.call(inputProps, e);
|
13540
13814
|
}
|
13541
|
-
}))), !readOnly && /* @__PURE__ */
|
13815
|
+
}))), !readOnly && /* @__PURE__ */ import_react102.default.createElement(Select.Toggle, __spreadValues({
|
13542
13816
|
hasFocus,
|
13543
13817
|
isOpen
|
13544
|
-
}, getToggleButtonProps({ disabled })))), !hideChips && !inline && /* @__PURE__ */
|
13818
|
+
}, getToggleButtonProps({ disabled })))), !hideChips && !inline && /* @__PURE__ */ import_react102.default.createElement("div", {
|
13545
13819
|
className: tw("flex flex-row flex-wrap gap-2 mt-2")
|
13546
|
-
}, renderChips()), isOpen && /* @__PURE__ */
|
13820
|
+
}, renderChips()), isOpen && /* @__PURE__ */ import_react102.default.createElement(PopoverOverlay, {
|
13547
13821
|
ref: popoverRef,
|
13548
13822
|
triggerRef: targetRef,
|
13549
13823
|
state,
|
@@ -13551,13 +13825,13 @@ var MultiSelectBase = (_a) => {
|
|
13551
13825
|
shouldFlip: true,
|
13552
13826
|
isNonModal: true,
|
13553
13827
|
style: { width: (_a2 = targetRef.current) == null ? void 0 : _a2.offsetWidth }
|
13554
|
-
}, /* @__PURE__ */
|
13828
|
+
}, /* @__PURE__ */ import_react102.default.createElement(Select.Menu, __spreadValues({
|
13555
13829
|
maxHeight
|
13556
|
-
}, menuProps), hasNoResults && /* @__PURE__ */
|
13830
|
+
}, menuProps), hasNoResults && /* @__PURE__ */ import_react102.default.createElement(Select.NoResults, null, emptyState), filteredOptions.map(
|
13557
13831
|
(option, index) => isOptionGroup(option) ? renderGroup(option) : renderItem(option, index)
|
13558
13832
|
))));
|
13559
13833
|
};
|
13560
|
-
var MultiSelectBaseSkeleton = () => /* @__PURE__ */
|
13834
|
+
var MultiSelectBaseSkeleton = () => /* @__PURE__ */ import_react102.default.createElement(Skeleton, {
|
13561
13835
|
height: 38
|
13562
13836
|
});
|
13563
13837
|
MultiSelectBase.Skeleton = MultiSelectBaseSkeleton;
|
@@ -13572,19 +13846,19 @@ var MultiSelect = (_a) => {
|
|
13572
13846
|
"emptyState"
|
13573
13847
|
]);
|
13574
13848
|
var _a2;
|
13575
|
-
const defaultId = (0,
|
13849
|
+
const defaultId = (0, import_utils27.useId)();
|
13576
13850
|
const id = (_a2 = props.id) != null ? _a2 : defaultId;
|
13577
|
-
const errorMessageId = (0,
|
13851
|
+
const errorMessageId = (0, import_utils27.useId)();
|
13578
13852
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
13579
13853
|
const labelControlProps = getLabelControlProps(props);
|
13580
13854
|
const baseProps = (0, import_omit13.default)(props, Object.keys(labelControlProps));
|
13581
|
-
return /* @__PURE__ */
|
13855
|
+
return /* @__PURE__ */ import_react102.default.createElement(LabelControl, __spreadProps(__spreadValues({
|
13582
13856
|
id: `${id}-label`,
|
13583
13857
|
htmlFor: `${id}-input`,
|
13584
13858
|
messageId: errorMessageId
|
13585
13859
|
}, labelControlProps), {
|
13586
13860
|
className: "Aquarium-MultiSelect"
|
13587
|
-
}), /* @__PURE__ */
|
13861
|
+
}), /* @__PURE__ */ import_react102.default.createElement(MultiSelectBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
|
13588
13862
|
id,
|
13589
13863
|
options,
|
13590
13864
|
emptyState,
|
@@ -13592,17 +13866,17 @@ var MultiSelect = (_a) => {
|
|
13592
13866
|
valid: props.valid
|
13593
13867
|
})));
|
13594
13868
|
};
|
13595
|
-
var MultiSelectSkeleton = () => /* @__PURE__ */
|
13869
|
+
var MultiSelectSkeleton = () => /* @__PURE__ */ import_react102.default.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ import_react102.default.createElement(MultiSelectBase.Skeleton, null));
|
13596
13870
|
MultiSelect.Skeleton = MultiSelectSkeleton;
|
13597
13871
|
MultiSelect.Skeleton.displayName = "MultiSelect.Skeleton";
|
13598
13872
|
|
13599
13873
|
// src/molecules/NativeSelect/NativeSelect.tsx
|
13600
|
-
var
|
13601
|
-
var
|
13874
|
+
var import_react103 = __toESM(require("react"));
|
13875
|
+
var import_utils28 = require("@react-aria/utils");
|
13602
13876
|
var import_omit14 = __toESM(require("lodash/omit"));
|
13603
13877
|
var import_uniqueId = __toESM(require("lodash/uniqueId"));
|
13604
13878
|
var import_caretDown2 = __toESM(require_caretDown());
|
13605
|
-
var NativeSelectBase =
|
13879
|
+
var NativeSelectBase = import_react103.default.forwardRef(
|
13606
13880
|
(_a, ref) => {
|
13607
13881
|
var _b = _a, { children, disabled = false, required = false, valid = true, readOnly = false } = _b, props = __objRest(_b, ["children", "disabled", "required", "valid", "readOnly"]);
|
13608
13882
|
const placeholderValue = (0, import_uniqueId.default)("default_value_for_placeholder");
|
@@ -13619,16 +13893,16 @@ var NativeSelectBase = import_react101.default.forwardRef(
|
|
13619
13893
|
(_b2 = props.onBlur) == null ? void 0 : _b2.call(props, event);
|
13620
13894
|
}
|
13621
13895
|
};
|
13622
|
-
return /* @__PURE__ */
|
13896
|
+
return /* @__PURE__ */ import_react103.default.createElement("span", {
|
13623
13897
|
className: classNames("Aquarium-NativeSelectBase", tw("relative block"))
|
13624
|
-
}, !readOnly && /* @__PURE__ */
|
13898
|
+
}, !readOnly && /* @__PURE__ */ import_react103.default.createElement("span", {
|
13625
13899
|
className: tw(
|
13626
13900
|
"absolute right-0 inset-y-0 mr-4 text-muted flex ml-3 pointer-events-none typography-default-strong mt-4"
|
13627
13901
|
)
|
13628
|
-
}, /* @__PURE__ */
|
13902
|
+
}, /* @__PURE__ */ import_react103.default.createElement(Icon, {
|
13629
13903
|
icon: import_caretDown2.default,
|
13630
13904
|
"data-testid": "icon-dropdown"
|
13631
|
-
})), /* @__PURE__ */
|
13905
|
+
})), /* @__PURE__ */ import_react103.default.createElement("select", __spreadProps(__spreadValues({
|
13632
13906
|
ref,
|
13633
13907
|
disabled: disabled || readOnly,
|
13634
13908
|
required
|
@@ -13647,32 +13921,32 @@ var NativeSelectBase = import_react101.default.forwardRef(
|
|
13647
13921
|
),
|
13648
13922
|
props.className
|
13649
13923
|
)
|
13650
|
-
}), props.placeholder && /* @__PURE__ */
|
13924
|
+
}), props.placeholder && /* @__PURE__ */ import_react103.default.createElement("option", {
|
13651
13925
|
value: placeholderValue,
|
13652
13926
|
disabled: true
|
13653
13927
|
}, props.placeholder), children));
|
13654
13928
|
}
|
13655
13929
|
);
|
13656
|
-
NativeSelectBase.Skeleton = () => /* @__PURE__ */
|
13930
|
+
NativeSelectBase.Skeleton = () => /* @__PURE__ */ import_react103.default.createElement(Skeleton, {
|
13657
13931
|
height: 38
|
13658
13932
|
});
|
13659
|
-
var NativeSelect =
|
13933
|
+
var NativeSelect = import_react103.default.forwardRef(
|
13660
13934
|
(_a, ref) => {
|
13661
13935
|
var _b = _a, { readOnly } = _b, props = __objRest(_b, ["readOnly"]);
|
13662
13936
|
var _a2;
|
13663
|
-
const defaultId = (0,
|
13937
|
+
const defaultId = (0, import_utils28.useId)();
|
13664
13938
|
const id = (_a2 = props.id) != null ? _a2 : defaultId;
|
13665
|
-
const errorMessageId = (0,
|
13939
|
+
const errorMessageId = (0, import_utils28.useId)();
|
13666
13940
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
13667
13941
|
const _b2 = getLabelControlProps(props), { "data-testid": dataTestId } = _b2, labelControlProps = __objRest(_b2, ["data-testid"]);
|
13668
13942
|
const baseProps = (0, import_omit14.default)(props, Object.keys(labelControlProps));
|
13669
|
-
return /* @__PURE__ */
|
13943
|
+
return /* @__PURE__ */ import_react103.default.createElement(LabelControl, __spreadProps(__spreadValues({
|
13670
13944
|
id: `${id}-label`,
|
13671
13945
|
htmlFor: id,
|
13672
13946
|
messageId: errorMessageId
|
13673
13947
|
}, labelControlProps), {
|
13674
13948
|
className: "Aquarium-NativeSelect"
|
13675
|
-
}), /* @__PURE__ */
|
13949
|
+
}), /* @__PURE__ */ import_react103.default.createElement(NativeSelectBase, __spreadProps(__spreadValues(__spreadValues({
|
13676
13950
|
ref
|
13677
13951
|
}, baseProps), errorProps), {
|
13678
13952
|
id,
|
@@ -13686,63 +13960,63 @@ var NativeSelect = import_react101.default.forwardRef(
|
|
13686
13960
|
}
|
13687
13961
|
);
|
13688
13962
|
NativeSelect.displayName = "NativeSelect";
|
13689
|
-
var Option =
|
13963
|
+
var Option = import_react103.default.forwardRef((_a, ref) => {
|
13690
13964
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
13691
|
-
return /* @__PURE__ */
|
13965
|
+
return /* @__PURE__ */ import_react103.default.createElement("option", __spreadValues({
|
13692
13966
|
ref
|
13693
13967
|
}, props), children);
|
13694
13968
|
});
|
13695
13969
|
Option.displayName = "Option";
|
13696
|
-
var NativeSelectSkeleton = () => /* @__PURE__ */
|
13970
|
+
var NativeSelectSkeleton = () => /* @__PURE__ */ import_react103.default.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ import_react103.default.createElement(NativeSelectBase.Skeleton, null), /* @__PURE__ */ import_react103.default.createElement("div", {
|
13697
13971
|
style: { height: "1px" }
|
13698
13972
|
}));
|
13699
13973
|
NativeSelect.Skeleton = NativeSelectSkeleton;
|
13700
13974
|
NativeSelect.Skeleton.displayName = "NativeSelect.Skeleton";
|
13701
13975
|
|
13702
13976
|
// src/molecules/Navigation/Navigation.tsx
|
13703
|
-
var
|
13977
|
+
var import_react105 = __toESM(require("react"));
|
13704
13978
|
var import_classnames10 = __toESM(require("classnames"));
|
13705
13979
|
|
13706
13980
|
// src/atoms/Navigation/Navigation.tsx
|
13707
|
-
var
|
13981
|
+
var import_react104 = __toESM(require("react"));
|
13708
13982
|
var Navigation = (_a) => {
|
13709
13983
|
var _b = _a, { className, children } = _b, rest = __objRest(_b, ["className", "children"]);
|
13710
|
-
return /* @__PURE__ */
|
13984
|
+
return /* @__PURE__ */ import_react104.default.createElement("nav", {
|
13711
13985
|
className: classNames(tw("bg-grey-0 h-full"))
|
13712
|
-
}, /* @__PURE__ */
|
13986
|
+
}, /* @__PURE__ */ import_react104.default.createElement("ul", __spreadProps(__spreadValues({}, rest), {
|
13713
13987
|
className: classNames(tw("flex flex-col h-full"), className),
|
13714
13988
|
role: "menubar"
|
13715
13989
|
}), children));
|
13716
13990
|
};
|
13717
13991
|
var Header = (_a) => {
|
13718
13992
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13719
|
-
return /* @__PURE__ */
|
13993
|
+
return /* @__PURE__ */ import_react104.default.createElement("li", __spreadProps(__spreadValues({}, rest), {
|
13720
13994
|
role: "presentation",
|
13721
13995
|
className: classNames(tw("px-6 py-5"), className)
|
13722
13996
|
}));
|
13723
13997
|
};
|
13724
13998
|
var Footer = (_a) => {
|
13725
13999
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13726
|
-
return /* @__PURE__ */
|
14000
|
+
return /* @__PURE__ */ import_react104.default.createElement("li", __spreadProps(__spreadValues({}, rest), {
|
13727
14001
|
role: "presentation",
|
13728
14002
|
className: classNames(tw("px-6 py-5 mt-auto"), className)
|
13729
14003
|
}));
|
13730
14004
|
};
|
13731
14005
|
var Section2 = (_a) => {
|
13732
14006
|
var _b = _a, { title, className } = _b, rest = __objRest(_b, ["title", "className"]);
|
13733
|
-
return /* @__PURE__ */
|
14007
|
+
return /* @__PURE__ */ import_react104.default.createElement("li", {
|
13734
14008
|
role: "presentation",
|
13735
14009
|
className: tw("py-5")
|
13736
|
-
}, title && /* @__PURE__ */
|
14010
|
+
}, title && /* @__PURE__ */ import_react104.default.createElement("div", {
|
13737
14011
|
className: classNames(className, "py-2 px-6 text-muted uppercase cursor-default typography-caption")
|
13738
|
-
}, title), /* @__PURE__ */
|
14012
|
+
}, title), /* @__PURE__ */ import_react104.default.createElement("ul", __spreadProps(__spreadValues({}, rest), {
|
13739
14013
|
role: "group",
|
13740
14014
|
className: classNames(tw("flex flex-col"), className)
|
13741
14015
|
})));
|
13742
14016
|
};
|
13743
14017
|
var Divider3 = (_a) => {
|
13744
14018
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13745
|
-
return /* @__PURE__ */
|
14019
|
+
return /* @__PURE__ */ import_react104.default.createElement("li", __spreadProps(__spreadValues({
|
13746
14020
|
role: "separator"
|
13747
14021
|
}, rest), {
|
13748
14022
|
className: classNames(tw("border-t-2 border-muted"), className)
|
@@ -13750,9 +14024,9 @@ var Divider3 = (_a) => {
|
|
13750
14024
|
};
|
13751
14025
|
var Item5 = (_a) => {
|
13752
14026
|
var _b = _a, { className, active } = _b, rest = __objRest(_b, ["className", "active"]);
|
13753
|
-
return /* @__PURE__ */
|
14027
|
+
return /* @__PURE__ */ import_react104.default.createElement("li", {
|
13754
14028
|
role: "presentation"
|
13755
|
-
}, /* @__PURE__ */
|
14029
|
+
}, /* @__PURE__ */ import_react104.default.createElement("a", __spreadProps(__spreadValues({}, rest), {
|
13756
14030
|
role: "menuitem",
|
13757
14031
|
className: classNames(
|
13758
14032
|
tw("py-3 px-6 hover:bg-grey-5 cursor-pointer flex gap-4 items-center typography-small focusable", {
|
@@ -13772,7 +14046,7 @@ Navigation.Divider = Divider3;
|
|
13772
14046
|
// src/molecules/Navigation/Navigation.tsx
|
13773
14047
|
var Navigation2 = (_a) => {
|
13774
14048
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
13775
|
-
return /* @__PURE__ */
|
14049
|
+
return /* @__PURE__ */ import_react105.default.createElement(Navigation, __spreadValues({
|
13776
14050
|
className: (0, import_classnames10.default)("Aquarium-Navigation", className)
|
13777
14051
|
}, props));
|
13778
14052
|
};
|
@@ -13786,11 +14060,11 @@ var Item6 = (_a) => {
|
|
13786
14060
|
"icon",
|
13787
14061
|
"showNotification"
|
13788
14062
|
]);
|
13789
|
-
return /* @__PURE__ */
|
14063
|
+
return /* @__PURE__ */ import_react105.default.createElement(Navigation.Item, __spreadValues({}, rest), icon && showNotification && /* @__PURE__ */ import_react105.default.createElement(Badge.Notification, null, /* @__PURE__ */ import_react105.default.createElement(InlineIcon, {
|
13790
14064
|
icon,
|
13791
14065
|
width: "20px",
|
13792
14066
|
height: "20px"
|
13793
|
-
})), icon && !showNotification && /* @__PURE__ */
|
14067
|
+
})), icon && !showNotification && /* @__PURE__ */ import_react105.default.createElement(InlineIcon, {
|
13794
14068
|
icon,
|
13795
14069
|
width: "20px",
|
13796
14070
|
height: "20px"
|
@@ -13803,32 +14077,32 @@ Navigation2.Header = Navigation.Header;
|
|
13803
14077
|
Navigation2.Section = Navigation.Section;
|
13804
14078
|
|
13805
14079
|
// src/molecules/PageHeader/PageHeader.tsx
|
13806
|
-
var
|
13807
|
-
var
|
14080
|
+
var import_react107 = __toESM(require("react"));
|
14081
|
+
var import_castArray6 = __toESM(require("lodash/castArray"));
|
13808
14082
|
|
13809
14083
|
// src/atoms/PageHeader/PageHeader.tsx
|
13810
|
-
var
|
14084
|
+
var import_react106 = __toESM(require("react"));
|
13811
14085
|
var PageHeader = (_a) => {
|
13812
14086
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
13813
|
-
return /* @__PURE__ */
|
14087
|
+
return /* @__PURE__ */ import_react106.default.createElement("div", __spreadValues({
|
13814
14088
|
className: classNames(tw("flex flex-row gap-4 pb-6"), className)
|
13815
14089
|
}, rest), children);
|
13816
14090
|
};
|
13817
14091
|
PageHeader.Container = (_a) => {
|
13818
14092
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
13819
|
-
return /* @__PURE__ */
|
14093
|
+
return /* @__PURE__ */ import_react106.default.createElement("div", __spreadValues({
|
13820
14094
|
className: classNames(tw("flex flex-col grow gap-0"), className)
|
13821
14095
|
}, rest), children);
|
13822
14096
|
};
|
13823
14097
|
PageHeader.TitleContainer = (_a) => {
|
13824
14098
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
13825
|
-
return /* @__PURE__ */
|
14099
|
+
return /* @__PURE__ */ import_react106.default.createElement("div", __spreadValues({
|
13826
14100
|
className: classNames(tw("flex flex-col justify-center gap-2"), className)
|
13827
14101
|
}, rest), children);
|
13828
14102
|
};
|
13829
14103
|
PageHeader.Title = (_a) => {
|
13830
14104
|
var _b = _a, { isSubHeader = false, children } = _b, rest = __objRest(_b, ["isSubHeader", "children"]);
|
13831
|
-
return /* @__PURE__ */
|
14105
|
+
return /* @__PURE__ */ import_react106.default.createElement(Typography2, __spreadProps(__spreadValues({}, rest), {
|
13832
14106
|
color: "grey-100",
|
13833
14107
|
variant: isSubHeader ? "subheading" : "heading",
|
13834
14108
|
htmlTag: isSubHeader ? "h2" : "h1"
|
@@ -13836,19 +14110,19 @@ PageHeader.Title = (_a) => {
|
|
13836
14110
|
};
|
13837
14111
|
PageHeader.Subtitle = (_a) => {
|
13838
14112
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
13839
|
-
return /* @__PURE__ */
|
14113
|
+
return /* @__PURE__ */ import_react106.default.createElement(Typography2.Small, __spreadProps(__spreadValues({}, rest), {
|
13840
14114
|
color: "grey-70"
|
13841
14115
|
}), children);
|
13842
14116
|
};
|
13843
14117
|
PageHeader.Chips = (_a) => {
|
13844
14118
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
13845
|
-
return /* @__PURE__ */
|
14119
|
+
return /* @__PURE__ */ import_react106.default.createElement("div", __spreadValues({
|
13846
14120
|
className: classNames(tw("flex gap-3"), className)
|
13847
14121
|
}, rest), children);
|
13848
14122
|
};
|
13849
14123
|
PageHeader.Actions = (_a) => {
|
13850
14124
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
13851
|
-
return /* @__PURE__ */
|
14125
|
+
return /* @__PURE__ */ import_react106.default.createElement("div", __spreadValues({
|
13852
14126
|
className: classNames(tw("flex flex-row gap-4 self-start"), className)
|
13853
14127
|
}, rest), children);
|
13854
14128
|
};
|
@@ -13872,63 +14146,64 @@ var CommonPageHeader = ({
|
|
13872
14146
|
onMenuOpenChange,
|
13873
14147
|
isSubHeader = false
|
13874
14148
|
}) => {
|
13875
|
-
return /* @__PURE__ */
|
14149
|
+
return /* @__PURE__ */ import_react107.default.createElement(PageHeader, {
|
13876
14150
|
className: "Aquarium-PageHeader"
|
13877
|
-
}, /* @__PURE__ */
|
14151
|
+
}, /* @__PURE__ */ import_react107.default.createElement(PageHeader.Container, null, breadcrumbs && /* @__PURE__ */ import_react107.default.createElement(Box, {
|
13878
14152
|
marginBottom: "3"
|
13879
|
-
}, /* @__PURE__ */
|
14153
|
+
}, /* @__PURE__ */ import_react107.default.createElement(Breadcrumbs, null, breadcrumbs)), /* @__PURE__ */ import_react107.default.createElement(Spacing, {
|
13880
14154
|
row: true,
|
13881
14155
|
gap: "5"
|
13882
|
-
}, image && /* @__PURE__ */
|
14156
|
+
}, image && /* @__PURE__ */ import_react107.default.createElement("img", {
|
13883
14157
|
src: image,
|
13884
14158
|
alt: imageAlt != null ? imageAlt : "",
|
13885
14159
|
className: tw("w-[56px] h-[56px]")
|
13886
|
-
}), /* @__PURE__ */
|
14160
|
+
}), /* @__PURE__ */ import_react107.default.createElement(PageHeader.TitleContainer, null, /* @__PURE__ */ import_react107.default.createElement(PageHeader.Title, {
|
13887
14161
|
isSubHeader
|
13888
|
-
}, title), chips.length > 0 && /* @__PURE__ */
|
14162
|
+
}, title), chips.length > 0 && /* @__PURE__ */ import_react107.default.createElement(PageHeader.Chips, null, chips.map((chip) => /* @__PURE__ */ import_react107.default.createElement(Chip2, {
|
13889
14163
|
key: chip,
|
13890
14164
|
dense: true,
|
13891
14165
|
text: chip
|
13892
|
-
}))), subtitle && /* @__PURE__ */
|
14166
|
+
}))), subtitle && /* @__PURE__ */ import_react107.default.createElement(PageHeader.Subtitle, null, subtitle)))), (secondaryActions || primaryAction || secondaryAction || menu) && /* @__PURE__ */ import_react107.default.createElement(PageHeader.Actions, null, menu && /* @__PURE__ */ import_react107.default.createElement(Box.Flex, {
|
13893
14167
|
alignItems: "center"
|
13894
|
-
}, /* @__PURE__ */
|
14168
|
+
}, /* @__PURE__ */ import_react107.default.createElement(DropdownMenu2, {
|
14169
|
+
placement: defaultContextualMenuPlacement,
|
13895
14170
|
onAction: (action) => onAction == null ? void 0 : onAction(action),
|
13896
14171
|
onOpenChange: onMenuOpenChange
|
13897
|
-
}, /* @__PURE__ */
|
14172
|
+
}, /* @__PURE__ */ import_react107.default.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ import_react107.default.createElement(Button.Icon, {
|
13898
14173
|
"aria-label": menuAriaLabel,
|
13899
14174
|
icon: import_more5.default
|
13900
|
-
})), menu)), secondaryActions && (0,
|
14175
|
+
})), menu)), secondaryActions && (0, import_castArray6.default)(secondaryActions).filter(Boolean).map((secondaryAction2) => renderAction({ kind: "secondary", action: secondaryAction2 })), primaryAction && renderAction({ kind: "primary", action: primaryAction })));
|
13901
14176
|
};
|
13902
|
-
var PageHeader2 = (props) => /* @__PURE__ */
|
14177
|
+
var PageHeader2 = (props) => /* @__PURE__ */ import_react107.default.createElement(CommonPageHeader, __spreadValues({}, props));
|
13903
14178
|
PageHeader2.displayName = "PageHeader";
|
13904
|
-
var SubHeader = (props) => /* @__PURE__ */
|
14179
|
+
var SubHeader = (props) => /* @__PURE__ */ import_react107.default.createElement(CommonPageHeader, __spreadProps(__spreadValues({}, props), {
|
13905
14180
|
isSubHeader: true
|
13906
14181
|
}));
|
13907
14182
|
PageHeader2.SubHeader = SubHeader;
|
13908
14183
|
PageHeader2.SubHeader.displayName = "PageHeader.SubHeader";
|
13909
14184
|
|
13910
14185
|
// src/molecules/PopoverDialog/PopoverDialog.tsx
|
13911
|
-
var
|
14186
|
+
var import_react109 = __toESM(require("react"));
|
13912
14187
|
var import_omit15 = __toESM(require("lodash/omit"));
|
13913
14188
|
|
13914
14189
|
// src/atoms/PopoverDialog/PopoverDialog.tsx
|
13915
|
-
var
|
14190
|
+
var import_react108 = __toESM(require("react"));
|
13916
14191
|
var Header2 = (_a) => {
|
13917
14192
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
13918
|
-
return /* @__PURE__ */
|
14193
|
+
return /* @__PURE__ */ import_react108.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13919
14194
|
className: classNames(tw("p-5 gap-3 flex items-center"), className)
|
13920
14195
|
}), children);
|
13921
14196
|
};
|
13922
14197
|
var Title2 = (_a) => {
|
13923
14198
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
13924
|
-
return /* @__PURE__ */
|
14199
|
+
return /* @__PURE__ */ import_react108.default.createElement(Typography, __spreadProps(__spreadValues({}, rest), {
|
13925
14200
|
htmlTag: "h1",
|
13926
14201
|
variant: "small-strong"
|
13927
14202
|
}), children);
|
13928
14203
|
};
|
13929
14204
|
var Body = (_a) => {
|
13930
14205
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
13931
|
-
return /* @__PURE__ */
|
14206
|
+
return /* @__PURE__ */ import_react108.default.createElement(Typography, __spreadProps(__spreadValues({}, rest), {
|
13932
14207
|
htmlTag: "div",
|
13933
14208
|
variant: "caption",
|
13934
14209
|
className: classNames(tw("px-5 overflow-y-auto"), className)
|
@@ -13936,13 +14211,13 @@ var Body = (_a) => {
|
|
13936
14211
|
};
|
13937
14212
|
var Footer2 = (_a) => {
|
13938
14213
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
13939
|
-
return /* @__PURE__ */
|
14214
|
+
return /* @__PURE__ */ import_react108.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13940
14215
|
className: classNames(tw("p-5"), className)
|
13941
14216
|
}), children);
|
13942
14217
|
};
|
13943
14218
|
var Actions2 = (_a) => {
|
13944
14219
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
13945
|
-
return /* @__PURE__ */
|
14220
|
+
return /* @__PURE__ */ import_react108.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13946
14221
|
className: classNames(tw("flex gap-4"), className)
|
13947
14222
|
}), children);
|
13948
14223
|
};
|
@@ -13958,13 +14233,13 @@ var PopoverDialog = {
|
|
13958
14233
|
var PopoverDialog2 = ({ placement, open, title, secondaryAction, primaryAction, children }) => {
|
13959
14234
|
const wrapPromptWithBody = (child) => {
|
13960
14235
|
if (isComponentType(child, PopoverDialog2.Prompt)) {
|
13961
|
-
return /* @__PURE__ */
|
14236
|
+
return /* @__PURE__ */ import_react109.default.createElement(Popover2.Panel, {
|
13962
14237
|
className: classNames("Aquarium-PopoverDialog", tw("max-w-[300px]"))
|
13963
|
-
}, /* @__PURE__ */
|
14238
|
+
}, /* @__PURE__ */ import_react109.default.createElement(PopoverDialog.Header, null, /* @__PURE__ */ import_react109.default.createElement(PopoverDialog.Title, null, title)), child, /* @__PURE__ */ import_react109.default.createElement(PopoverDialog.Footer, null, /* @__PURE__ */ import_react109.default.createElement(PopoverDialog.Actions, null, secondaryAction && /* @__PURE__ */ import_react109.default.createElement(Popover2.Button, __spreadValues({
|
13964
14239
|
kind: "secondary-ghost",
|
13965
14240
|
key: secondaryAction.text,
|
13966
14241
|
dense: true
|
13967
|
-
}, (0, import_omit15.default)(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */
|
14242
|
+
}, (0, import_omit15.default)(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */ import_react109.default.createElement(Popover2.Button, __spreadValues({
|
13968
14243
|
kind: "ghost",
|
13969
14244
|
key: primaryAction.text,
|
13970
14245
|
dense: true
|
@@ -13972,15 +14247,15 @@ var PopoverDialog2 = ({ placement, open, title, secondaryAction, primaryAction,
|
|
13972
14247
|
}
|
13973
14248
|
return child;
|
13974
14249
|
};
|
13975
|
-
return /* @__PURE__ */
|
14250
|
+
return /* @__PURE__ */ import_react109.default.createElement(Popover2, {
|
13976
14251
|
type: "dialog",
|
13977
14252
|
isOpen: open,
|
13978
14253
|
placement,
|
13979
14254
|
containFocus: true
|
13980
|
-
},
|
14255
|
+
}, import_react109.default.Children.map(children, wrapPromptWithBody));
|
13981
14256
|
};
|
13982
14257
|
PopoverDialog2.Trigger = Popover2.Trigger;
|
13983
|
-
var Prompt = ({ children }) => /* @__PURE__ */
|
14258
|
+
var Prompt = ({ children }) => /* @__PURE__ */ import_react109.default.createElement(PopoverDialog.Body, null, children);
|
13984
14259
|
Prompt.displayName = "PopoverDialog.Prompt";
|
13985
14260
|
PopoverDialog2.Prompt = Prompt;
|
13986
14261
|
|
@@ -13989,14 +14264,14 @@ var import_react_dom = require("react-dom");
|
|
13989
14264
|
var Portal = ({ children, to }) => (0, import_react_dom.createPortal)(children, to);
|
13990
14265
|
|
13991
14266
|
// src/molecules/ProgressBar/ProgressBar.tsx
|
13992
|
-
var
|
14267
|
+
var import_react111 = __toESM(require("react"));
|
13993
14268
|
|
13994
14269
|
// src/atoms/ProgressBar/ProgressBar.tsx
|
13995
|
-
var
|
14270
|
+
var import_react110 = __toESM(require("react"));
|
13996
14271
|
var import_clamp3 = __toESM(require("lodash/clamp"));
|
13997
14272
|
var ProgressBar = (_a) => {
|
13998
14273
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
13999
|
-
return /* @__PURE__ */
|
14274
|
+
return /* @__PURE__ */ import_react110.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
14000
14275
|
className: classNames(
|
14001
14276
|
tw("relative flex items-center w-full bg-grey-0 h-2 rounded-full overflow-hidden"),
|
14002
14277
|
className
|
@@ -14012,7 +14287,7 @@ var STATUS_COLORS = {
|
|
14012
14287
|
ProgressBar.Indicator = (_a) => {
|
14013
14288
|
var _b = _a, { min, max, value, "aria-label": ariaLabel, status, className } = _b, rest = __objRest(_b, ["min", "max", "value", "aria-label", "status", "className"]);
|
14014
14289
|
const completedPercentage = (0, import_clamp3.default)((value - min) / (max - min) * 100, 0, 100);
|
14015
|
-
return /* @__PURE__ */
|
14290
|
+
return /* @__PURE__ */ import_react110.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
14016
14291
|
className: classNames(
|
14017
14292
|
tw("h-2 rounded-full transition-all ease-in-out delay-150"),
|
14018
14293
|
STATUS_COLORS[status],
|
@@ -14028,11 +14303,11 @@ ProgressBar.Indicator = (_a) => {
|
|
14028
14303
|
};
|
14029
14304
|
ProgressBar.Labels = (_a) => {
|
14030
14305
|
var _b = _a, { children, startLabel, endLabel, className } = _b, rest = __objRest(_b, ["children", "startLabel", "endLabel", "className"]);
|
14031
|
-
return /* @__PURE__ */
|
14306
|
+
return /* @__PURE__ */ import_react110.default.createElement("div", {
|
14032
14307
|
className: classNames(tw("flex flex-row"), className)
|
14033
|
-
}, /* @__PURE__ */
|
14308
|
+
}, /* @__PURE__ */ import_react110.default.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
14034
14309
|
className: tw("grow text-default typography-caption")
|
14035
|
-
}), startLabel), /* @__PURE__ */
|
14310
|
+
}), startLabel), /* @__PURE__ */ import_react110.default.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
14036
14311
|
className: tw("grow text-default typography-caption text-right")
|
14037
14312
|
}), endLabel));
|
14038
14313
|
};
|
@@ -14050,7 +14325,7 @@ var ProgressBar2 = (props) => {
|
|
14050
14325
|
if (min > max) {
|
14051
14326
|
throw new Error("`min` value provided to `ProgressBar` is greater than `max` value.");
|
14052
14327
|
}
|
14053
|
-
const progress = /* @__PURE__ */
|
14328
|
+
const progress = /* @__PURE__ */ import_react111.default.createElement(ProgressBar, null, /* @__PURE__ */ import_react111.default.createElement(ProgressBar.Indicator, {
|
14054
14329
|
status: value === max ? completedStatus : progresStatus,
|
14055
14330
|
min,
|
14056
14331
|
max,
|
@@ -14060,15 +14335,15 @@ var ProgressBar2 = (props) => {
|
|
14060
14335
|
if (props.dense) {
|
14061
14336
|
return progress;
|
14062
14337
|
}
|
14063
|
-
return /* @__PURE__ */
|
14338
|
+
return /* @__PURE__ */ import_react111.default.createElement("div", {
|
14064
14339
|
className: "Aquarium-ProgressBar"
|
14065
|
-
}, progress, /* @__PURE__ */
|
14340
|
+
}, progress, /* @__PURE__ */ import_react111.default.createElement(ProgressBar.Labels, {
|
14066
14341
|
className: tw("py-2"),
|
14067
14342
|
startLabel: props.startLabel,
|
14068
14343
|
endLabel: props.endLabel
|
14069
14344
|
}));
|
14070
14345
|
};
|
14071
|
-
var ProgressBarSkeleton = () => /* @__PURE__ */
|
14346
|
+
var ProgressBarSkeleton = () => /* @__PURE__ */ import_react111.default.createElement(Skeleton, {
|
14072
14347
|
height: 4,
|
14073
14348
|
display: "block"
|
14074
14349
|
});
|
@@ -14076,13 +14351,13 @@ ProgressBar2.Skeleton = ProgressBarSkeleton;
|
|
14076
14351
|
ProgressBar2.Skeleton.displayName = "ProgressBar.Skeleton";
|
14077
14352
|
|
14078
14353
|
// src/molecules/RadioButton/RadioButton.tsx
|
14079
|
-
var
|
14080
|
-
var RadioButton2 =
|
14354
|
+
var import_react112 = __toESM(require("react"));
|
14355
|
+
var RadioButton2 = import_react112.default.forwardRef(
|
14081
14356
|
(_a, ref) => {
|
14082
14357
|
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"]);
|
14083
14358
|
var _a2;
|
14084
14359
|
const isChecked = (_a2 = props.checked) != null ? _a2 : props.defaultChecked;
|
14085
|
-
return !readOnly || isChecked ? /* @__PURE__ */
|
14360
|
+
return !readOnly || isChecked ? /* @__PURE__ */ import_react112.default.createElement(ControlLabel, {
|
14086
14361
|
htmlFor: id,
|
14087
14362
|
label: children,
|
14088
14363
|
"aria-label": ariaLabel,
|
@@ -14091,7 +14366,7 @@ var RadioButton2 = import_react110.default.forwardRef(
|
|
14091
14366
|
disabled,
|
14092
14367
|
style: { gap: "0 8px" },
|
14093
14368
|
className: "Aquarium-RadioButton"
|
14094
|
-
}, !readOnly && /* @__PURE__ */
|
14369
|
+
}, !readOnly && /* @__PURE__ */ import_react112.default.createElement(RadioButton, __spreadProps(__spreadValues({
|
14095
14370
|
id,
|
14096
14371
|
ref,
|
14097
14372
|
name
|
@@ -14102,12 +14377,12 @@ var RadioButton2 = import_react110.default.forwardRef(
|
|
14102
14377
|
}
|
14103
14378
|
);
|
14104
14379
|
RadioButton2.displayName = "RadioButton";
|
14105
|
-
var RadioButtonSkeleton = () => /* @__PURE__ */
|
14380
|
+
var RadioButtonSkeleton = () => /* @__PURE__ */ import_react112.default.createElement("div", {
|
14106
14381
|
className: tw("flex gap-3")
|
14107
|
-
}, /* @__PURE__ */
|
14382
|
+
}, /* @__PURE__ */ import_react112.default.createElement(Skeleton, {
|
14108
14383
|
height: 20,
|
14109
14384
|
width: 20
|
14110
|
-
}), /* @__PURE__ */
|
14385
|
+
}), /* @__PURE__ */ import_react112.default.createElement(Skeleton, {
|
14111
14386
|
height: 20,
|
14112
14387
|
width: 150
|
14113
14388
|
}));
|
@@ -14115,10 +14390,10 @@ RadioButton2.Skeleton = RadioButtonSkeleton;
|
|
14115
14390
|
RadioButton2.Skeleton.displayName = "RadioButton.Skeleton";
|
14116
14391
|
|
14117
14392
|
// src/molecules/RadioButtonGroup/RadioButtonGroup.tsx
|
14118
|
-
var
|
14119
|
-
var
|
14393
|
+
var import_react113 = __toESM(require("react"));
|
14394
|
+
var import_utils30 = require("@react-aria/utils");
|
14120
14395
|
var isRadioButton = (c) => {
|
14121
|
-
return
|
14396
|
+
return import_react113.default.isValidElement(c) && c.type === RadioButton2;
|
14122
14397
|
};
|
14123
14398
|
var RadioButtonGroup = (_a) => {
|
14124
14399
|
var _b = _a, {
|
@@ -14141,8 +14416,8 @@ var RadioButtonGroup = (_a) => {
|
|
14141
14416
|
"children"
|
14142
14417
|
]);
|
14143
14418
|
var _a2;
|
14144
|
-
const [value, setValue] =
|
14145
|
-
const errorMessageId = (0,
|
14419
|
+
const [value, setValue] = import_react113.default.useState((_a2 = _value != null ? _value : defaultValue) != null ? _a2 : "");
|
14420
|
+
const errorMessageId = (0, import_utils30.useId)();
|
14146
14421
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
14147
14422
|
const labelControlProps = getLabelControlProps(props);
|
14148
14423
|
if (_value !== void 0 && _value !== value) {
|
@@ -14152,14 +14427,14 @@ var RadioButtonGroup = (_a) => {
|
|
14152
14427
|
setValue(e.target.value);
|
14153
14428
|
onChange == null ? void 0 : onChange(e.target.value);
|
14154
14429
|
};
|
14155
|
-
const content =
|
14430
|
+
const content = import_react113.default.Children.map(children, (c) => {
|
14156
14431
|
var _a3, _b2, _c;
|
14157
14432
|
if (!isRadioButton(c)) {
|
14158
14433
|
return null;
|
14159
14434
|
}
|
14160
14435
|
const defaultChecked = defaultValue === void 0 ? void 0 : c.props.value === defaultValue;
|
14161
14436
|
const checked = value === void 0 ? void 0 : c.props.value === value;
|
14162
|
-
return
|
14437
|
+
return import_react113.default.cloneElement(c, {
|
14163
14438
|
name,
|
14164
14439
|
defaultChecked: (_a3 = c.props.defaultChecked) != null ? _a3 : defaultChecked,
|
14165
14440
|
checked: (_b2 = c.props.checked) != null ? _b2 : checked,
|
@@ -14168,13 +14443,13 @@ var RadioButtonGroup = (_a) => {
|
|
14168
14443
|
readOnly
|
14169
14444
|
});
|
14170
14445
|
});
|
14171
|
-
return /* @__PURE__ */
|
14446
|
+
return /* @__PURE__ */ import_react113.default.createElement(LabelControl, __spreadProps(__spreadValues(__spreadValues({
|
14172
14447
|
fieldset: true
|
14173
14448
|
}, labelControlProps), errorProps), {
|
14174
14449
|
className: "Aquarium-RadioButtonGroup"
|
14175
|
-
}), cols && /* @__PURE__ */
|
14450
|
+
}), cols && /* @__PURE__ */ import_react113.default.createElement(InputGroup, {
|
14176
14451
|
cols
|
14177
|
-
}, content), !cols && /* @__PURE__ */
|
14452
|
+
}, content), !cols && /* @__PURE__ */ import_react113.default.createElement(Flexbox, {
|
14178
14453
|
direction,
|
14179
14454
|
alignItems: "flex-start",
|
14180
14455
|
colGap: "8",
|
@@ -14183,12 +14458,12 @@ var RadioButtonGroup = (_a) => {
|
|
14183
14458
|
}, content));
|
14184
14459
|
};
|
14185
14460
|
var RadioButtonGroupSkeleton = ({ direction = "row", options = 2 }) => {
|
14186
|
-
return /* @__PURE__ */
|
14461
|
+
return /* @__PURE__ */ import_react113.default.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ import_react113.default.createElement("div", {
|
14187
14462
|
className: tw("flex flex-wrap", {
|
14188
14463
|
"flex-row gap-8": direction === "row",
|
14189
14464
|
"flex-col gap-2": direction === "column"
|
14190
14465
|
})
|
14191
|
-
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */
|
14466
|
+
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */ import_react113.default.createElement(RadioButton2.Skeleton, {
|
14192
14467
|
key
|
14193
14468
|
}))));
|
14194
14469
|
};
|
@@ -14196,24 +14471,24 @@ RadioButtonGroup.Skeleton = RadioButtonGroupSkeleton;
|
|
14196
14471
|
RadioButtonGroup.Skeleton.displayName = "RadioButtonGroup.Skeleton";
|
14197
14472
|
|
14198
14473
|
// src/molecules/Section/Section.tsx
|
14199
|
-
var
|
14200
|
-
var
|
14474
|
+
var import_react118 = __toESM(require("react"));
|
14475
|
+
var import_utils31 = require("@react-aria/utils");
|
14201
14476
|
var import_web5 = require("@react-spring/web");
|
14202
|
-
var
|
14477
|
+
var import_castArray7 = __toESM(require("lodash/castArray"));
|
14203
14478
|
var import_isUndefined9 = __toESM(require("lodash/isUndefined"));
|
14204
14479
|
|
14205
14480
|
// src/molecules/Switch/Switch.tsx
|
14206
|
-
var
|
14481
|
+
var import_react115 = __toESM(require("react"));
|
14207
14482
|
|
14208
14483
|
// src/atoms/Switch/Switch.tsx
|
14209
|
-
var
|
14484
|
+
var import_react114 = __toESM(require("react"));
|
14210
14485
|
var import_ban2 = __toESM(require_ban());
|
14211
|
-
var Switch =
|
14486
|
+
var Switch = import_react114.default.forwardRef(
|
14212
14487
|
(_a, ref) => {
|
14213
14488
|
var _b = _a, { id, children, name, disabled = false, readOnly = false } = _b, props = __objRest(_b, ["id", "children", "name", "disabled", "readOnly"]);
|
14214
|
-
return /* @__PURE__ */
|
14489
|
+
return /* @__PURE__ */ import_react114.default.createElement("span", {
|
14215
14490
|
className: tw("relative inline-flex justify-center items-center self-center group")
|
14216
|
-
}, /* @__PURE__ */
|
14491
|
+
}, /* @__PURE__ */ import_react114.default.createElement("input", __spreadProps(__spreadValues({
|
14217
14492
|
id,
|
14218
14493
|
ref,
|
14219
14494
|
type: "checkbox",
|
@@ -14232,7 +14507,7 @@ var Switch = import_react112.default.forwardRef(
|
|
14232
14507
|
),
|
14233
14508
|
readOnly,
|
14234
14509
|
disabled
|
14235
|
-
})), /* @__PURE__ */
|
14510
|
+
})), /* @__PURE__ */ import_react114.default.createElement("span", {
|
14236
14511
|
className: tw(
|
14237
14512
|
"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",
|
14238
14513
|
"bg-white left-2 peer-checked/switch:left-1 text-grey-30 peer-checked/switch:text-primary-60",
|
@@ -14240,7 +14515,7 @@ var Switch = import_react112.default.forwardRef(
|
|
14240
14515
|
"shadow-4dp": !disabled
|
14241
14516
|
}
|
14242
14517
|
)
|
14243
|
-
}, disabled && /* @__PURE__ */
|
14518
|
+
}, disabled && /* @__PURE__ */ import_react114.default.createElement(Icon, {
|
14244
14519
|
icon: import_ban2.default,
|
14245
14520
|
width: "10px",
|
14246
14521
|
height: "10px"
|
@@ -14249,7 +14524,7 @@ var Switch = import_react112.default.forwardRef(
|
|
14249
14524
|
);
|
14250
14525
|
|
14251
14526
|
// src/molecules/Switch/Switch.tsx
|
14252
|
-
var Switch2 =
|
14527
|
+
var Switch2 = import_react115.default.forwardRef(
|
14253
14528
|
(_a, ref) => {
|
14254
14529
|
var _b = _a, {
|
14255
14530
|
id,
|
@@ -14272,7 +14547,7 @@ var Switch2 = import_react113.default.forwardRef(
|
|
14272
14547
|
]);
|
14273
14548
|
var _a2;
|
14274
14549
|
const isChecked = (_a2 = props.checked) != null ? _a2 : props.defaultChecked;
|
14275
|
-
return !readOnly || isChecked ? /* @__PURE__ */
|
14550
|
+
return !readOnly || isChecked ? /* @__PURE__ */ import_react115.default.createElement(ControlLabel, {
|
14276
14551
|
htmlFor: id,
|
14277
14552
|
label: children,
|
14278
14553
|
"aria-label": ariaLabel,
|
@@ -14282,7 +14557,7 @@ var Switch2 = import_react113.default.forwardRef(
|
|
14282
14557
|
style: { gap: "0 8px" },
|
14283
14558
|
labelPlacement,
|
14284
14559
|
className: "Aquarium-Switch"
|
14285
|
-
}, !readOnly && /* @__PURE__ */
|
14560
|
+
}, !readOnly && /* @__PURE__ */ import_react115.default.createElement(Switch, __spreadProps(__spreadValues({
|
14286
14561
|
id,
|
14287
14562
|
ref,
|
14288
14563
|
name
|
@@ -14293,12 +14568,12 @@ var Switch2 = import_react113.default.forwardRef(
|
|
14293
14568
|
}
|
14294
14569
|
);
|
14295
14570
|
Switch2.displayName = "Switch";
|
14296
|
-
var SwitchSkeleton = () => /* @__PURE__ */
|
14571
|
+
var SwitchSkeleton = () => /* @__PURE__ */ import_react115.default.createElement("div", {
|
14297
14572
|
className: tw("flex gap-3")
|
14298
|
-
}, /* @__PURE__ */
|
14573
|
+
}, /* @__PURE__ */ import_react115.default.createElement(Skeleton, {
|
14299
14574
|
height: 20,
|
14300
14575
|
width: 35
|
14301
|
-
}), /* @__PURE__ */
|
14576
|
+
}), /* @__PURE__ */ import_react115.default.createElement(Skeleton, {
|
14302
14577
|
height: 20,
|
14303
14578
|
width: 150
|
14304
14579
|
}));
|
@@ -14306,7 +14581,7 @@ Switch2.Skeleton = SwitchSkeleton;
|
|
14306
14581
|
Switch2.Skeleton.displayName = "Switch.Skeleton ";
|
14307
14582
|
|
14308
14583
|
// src/molecules/TagLabel/TagLabel.tsx
|
14309
|
-
var
|
14584
|
+
var import_react116 = __toESM(require("react"));
|
14310
14585
|
var getVariantClassNames = (variant = "primary") => {
|
14311
14586
|
switch (variant) {
|
14312
14587
|
case "danger":
|
@@ -14320,7 +14595,7 @@ var getVariantClassNames = (variant = "primary") => {
|
|
14320
14595
|
};
|
14321
14596
|
var TagLabel = (_a) => {
|
14322
14597
|
var _b = _a, { title, dense = false, variant } = _b, rest = __objRest(_b, ["title", "dense", "variant"]);
|
14323
|
-
return /* @__PURE__ */
|
14598
|
+
return /* @__PURE__ */ import_react116.default.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
14324
14599
|
className: classNames(
|
14325
14600
|
"Aquarium-TagLabel",
|
14326
14601
|
getVariantClassNames(variant),
|
@@ -14333,11 +14608,11 @@ var TagLabel = (_a) => {
|
|
14333
14608
|
};
|
14334
14609
|
|
14335
14610
|
// src/atoms/Section/Section.tsx
|
14336
|
-
var
|
14611
|
+
var import_react117 = __toESM(require("react"));
|
14337
14612
|
var import_caretUp2 = __toESM(require_caretUp());
|
14338
14613
|
var Section3 = (_a) => {
|
14339
14614
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
14340
|
-
return /* @__PURE__ */
|
14615
|
+
return /* @__PURE__ */ import_react117.default.createElement(Box, __spreadValues({
|
14341
14616
|
component: "section",
|
14342
14617
|
borderColor: "grey-5",
|
14343
14618
|
borderWidth: "1px"
|
@@ -14345,7 +14620,7 @@ var Section3 = (_a) => {
|
|
14345
14620
|
};
|
14346
14621
|
Section3.Header = (_a) => {
|
14347
14622
|
var _b = _a, { children, className, expanded } = _b, rest = __objRest(_b, ["children", "className", "expanded"]);
|
14348
|
-
return /* @__PURE__ */
|
14623
|
+
return /* @__PURE__ */ import_react117.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
14349
14624
|
className: classNames(
|
14350
14625
|
tw("px-6 flex gap-5 justify-between items-center h-[72px]", { "bg-grey-0": expanded }),
|
14351
14626
|
className
|
@@ -14354,21 +14629,21 @@ Section3.Header = (_a) => {
|
|
14354
14629
|
};
|
14355
14630
|
Section3.TitleContainer = (_a) => {
|
14356
14631
|
var _b = _a, { children, className, collapsible } = _b, rest = __objRest(_b, ["children", "className", "collapsible"]);
|
14357
|
-
return /* @__PURE__ */
|
14632
|
+
return /* @__PURE__ */ import_react117.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
14358
14633
|
className: classNames(
|
14359
14634
|
tw("grow grid grid-cols-[auto_1fr] gap-x-3 items-center", { "cursor-pointer": collapsible }),
|
14360
14635
|
className
|
14361
14636
|
)
|
14362
14637
|
}), children);
|
14363
14638
|
};
|
14364
|
-
Section3.Toggle = (props) => /* @__PURE__ */
|
14639
|
+
Section3.Toggle = (props) => /* @__PURE__ */ import_react117.default.createElement(Icon, __spreadProps(__spreadValues({}, props), {
|
14365
14640
|
icon: import_caretUp2.default,
|
14366
14641
|
height: 22,
|
14367
14642
|
width: 22
|
14368
14643
|
}));
|
14369
14644
|
Section3.Title = (_a) => {
|
14370
14645
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
14371
|
-
return /* @__PURE__ */
|
14646
|
+
return /* @__PURE__ */ import_react117.default.createElement(Typography2.Large, __spreadProps(__spreadValues({}, rest), {
|
14372
14647
|
htmlTag: "h2",
|
14373
14648
|
color: "black",
|
14374
14649
|
className: "flex gap-3 items-center"
|
@@ -14376,21 +14651,21 @@ Section3.Title = (_a) => {
|
|
14376
14651
|
};
|
14377
14652
|
Section3.Subtitle = (_a) => {
|
14378
14653
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
14379
|
-
return /* @__PURE__ */
|
14654
|
+
return /* @__PURE__ */ import_react117.default.createElement(Typography2.Small, __spreadProps(__spreadValues({}, rest), {
|
14380
14655
|
color: "grey-70"
|
14381
14656
|
}), children);
|
14382
14657
|
};
|
14383
14658
|
Section3.Actions = (_a) => {
|
14384
14659
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
14385
|
-
return /* @__PURE__ */
|
14660
|
+
return /* @__PURE__ */ import_react117.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
14386
14661
|
className: classNames(tw("flex gap-4 justify-end"), className)
|
14387
14662
|
}), children);
|
14388
14663
|
};
|
14389
14664
|
Section3.Body = (_a) => {
|
14390
14665
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
14391
|
-
return /* @__PURE__ */
|
14666
|
+
return /* @__PURE__ */ import_react117.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
14392
14667
|
className: classNames(tw("p-6"), className)
|
14393
|
-
}), /* @__PURE__ */
|
14668
|
+
}), /* @__PURE__ */ import_react117.default.createElement(Typography, {
|
14394
14669
|
htmlTag: "div",
|
14395
14670
|
color: "grey-70"
|
14396
14671
|
}, children));
|
@@ -14404,7 +14679,7 @@ var Section4 = (props) => {
|
|
14404
14679
|
const _collapsible = title ? (_a = props.collapsible) != null ? _a : false : false;
|
14405
14680
|
const _collapsed = title ? props.collapsed : void 0;
|
14406
14681
|
const _defaultCollapsed = title ? (_b = props.defaultCollapsed) != null ? _b : false : false;
|
14407
|
-
const [isCollapsed, setCollapsed] =
|
14682
|
+
const [isCollapsed, setCollapsed] = import_react118.default.useState(_collapsed != null ? _collapsed : _defaultCollapsed);
|
14408
14683
|
const [ref, { height }] = useMeasure();
|
14409
14684
|
const menu = title ? (_c = props.menu) != null ? _c : void 0 : void 0;
|
14410
14685
|
const menuAriaLabel = title ? (_e = (_d = props.menuAriaLabel) != null ? _d : props.menuLabel) != null ? _e : "Context menu" : void 0;
|
@@ -14435,65 +14710,65 @@ var Section4 = (props) => {
|
|
14435
14710
|
},
|
14436
14711
|
immediate: !_collapsible
|
14437
14712
|
}), { transform, backgroundColor } = _f, spring = __objRest(_f, ["transform", "backgroundColor"]);
|
14438
|
-
const toggleId = (0,
|
14439
|
-
const regionId = (0,
|
14440
|
-
const titleId = (0,
|
14713
|
+
const toggleId = (0, import_utils31.useId)();
|
14714
|
+
const regionId = (0, import_utils31.useId)();
|
14715
|
+
const titleId = (0, import_utils31.useId)();
|
14441
14716
|
const hasTabs = isComponentType(children, Tabs);
|
14442
|
-
return /* @__PURE__ */
|
14717
|
+
return /* @__PURE__ */ import_react118.default.createElement(Section3, {
|
14443
14718
|
"aria-label": title,
|
14444
14719
|
className: "Aquarium-Section"
|
14445
|
-
}, title && /* @__PURE__ */
|
14720
|
+
}, title && /* @__PURE__ */ import_react118.default.createElement(import_react118.default.Fragment, null, /* @__PURE__ */ import_react118.default.createElement(Section3.Header, {
|
14446
14721
|
expanded: _collapsible && !isCollapsed
|
14447
|
-
}, /* @__PURE__ */
|
14722
|
+
}, /* @__PURE__ */ import_react118.default.createElement(Section3.TitleContainer, {
|
14448
14723
|
role: _collapsible ? "button" : void 0,
|
14449
14724
|
id: toggleId,
|
14450
14725
|
collapsible: _collapsible,
|
14451
14726
|
onClick: handleTitleClick,
|
14452
14727
|
"aria-expanded": _collapsible ? !isCollapsed : void 0,
|
14453
14728
|
"aria-controls": _collapsible ? regionId : void 0
|
14454
|
-
}, _collapsible && /* @__PURE__ */
|
14729
|
+
}, _collapsible && /* @__PURE__ */ import_react118.default.createElement(import_web5.animated.div, {
|
14455
14730
|
style: { transform }
|
14456
|
-
}, /* @__PURE__ */
|
14731
|
+
}, /* @__PURE__ */ import_react118.default.createElement(Section3.Toggle, null)), /* @__PURE__ */ import_react118.default.createElement(Section3.Title, {
|
14457
14732
|
id: titleId
|
14458
|
-
}, /* @__PURE__ */
|
14733
|
+
}, /* @__PURE__ */ import_react118.default.createElement(LineClamp2, {
|
14459
14734
|
lines: 1
|
14460
|
-
}, title), props.tag && /* @__PURE__ */
|
14735
|
+
}, title), props.tag && /* @__PURE__ */ import_react118.default.createElement(TagLabel, __spreadValues({}, props.tag)), props.badge && /* @__PURE__ */ import_react118.default.createElement(Chip2, {
|
14461
14736
|
text: props.badge
|
14462
|
-
}), props.chip && /* @__PURE__ */
|
14737
|
+
}), props.chip && /* @__PURE__ */ import_react118.default.createElement(StatusChip, __spreadValues({}, props.chip))), subtitle && /* @__PURE__ */ import_react118.default.createElement(Section3.Subtitle, {
|
14463
14738
|
className: tw("row-start-2", { "col-start-2": _collapsible })
|
14464
|
-
}, /* @__PURE__ */
|
14739
|
+
}, /* @__PURE__ */ import_react118.default.createElement(LineClamp2, {
|
14465
14740
|
lines: 1
|
14466
|
-
}, subtitle))), !isCollapsed && /* @__PURE__ */
|
14741
|
+
}, subtitle))), !isCollapsed && /* @__PURE__ */ import_react118.default.createElement(Section3.Actions, null, menu && /* @__PURE__ */ import_react118.default.createElement(Box.Flex, {
|
14467
14742
|
alignItems: "center"
|
14468
|
-
}, /* @__PURE__ */
|
14743
|
+
}, /* @__PURE__ */ import_react118.default.createElement(DropdownMenu2, {
|
14469
14744
|
onAction: (action) => onAction == null ? void 0 : onAction(action),
|
14470
14745
|
onOpenChange: onMenuOpenChange,
|
14471
|
-
placement:
|
14472
|
-
}, /* @__PURE__ */
|
14746
|
+
placement: defaultContextualMenuPlacement
|
14747
|
+
}, /* @__PURE__ */ import_react118.default.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ import_react118.default.createElement(Button.Icon, {
|
14473
14748
|
"aria-label": menuAriaLabel,
|
14474
14749
|
icon: import_more6.default
|
14475
|
-
})), menu)), props.actions && (0,
|
14750
|
+
})), menu)), props.actions && (0, import_castArray7.default)(props.actions).filter(Boolean).map((action) => renderAction({ kind: "secondary", action })), props.switch && /* @__PURE__ */ import_react118.default.createElement(Switch2, __spreadValues({}, props.switch)), props.select && /* @__PURE__ */ import_react118.default.createElement(SelectBase, __spreadValues({
|
14476
14751
|
"aria-labelledby": titleId
|
14477
|
-
}, props.select)))), !hasTabs && /* @__PURE__ */
|
14752
|
+
}, props.select)))), !hasTabs && /* @__PURE__ */ import_react118.default.createElement(import_web5.animated.div, {
|
14478
14753
|
className: tw(`h-[1px]`),
|
14479
14754
|
style: { backgroundColor }
|
14480
|
-
})), /* @__PURE__ */
|
14755
|
+
})), /* @__PURE__ */ import_react118.default.createElement(import_web5.animated.div, {
|
14481
14756
|
id: regionId,
|
14482
14757
|
"aria-hidden": _collapsible ? isCollapsed ? true : void 0 : void 0,
|
14483
14758
|
style: spring,
|
14484
14759
|
className: tw({ "overflow-hidden": _collapsible })
|
14485
|
-
}, /* @__PURE__ */
|
14760
|
+
}, /* @__PURE__ */ import_react118.default.createElement("div", {
|
14486
14761
|
ref
|
14487
|
-
}, hasTabs ? /* @__PURE__ */
|
14762
|
+
}, hasTabs ? /* @__PURE__ */ import_react118.default.createElement(SectionTabs, __spreadProps(__spreadValues({}, children.props), {
|
14488
14763
|
className: tw("[&>div:first-child]:px-3 grow flex flex-col overflow-y-auto", { "mt-4": _collapsible })
|
14489
|
-
})) : /* @__PURE__ */
|
14764
|
+
})) : /* @__PURE__ */ import_react118.default.createElement(Section3.Body, null, children))));
|
14490
14765
|
};
|
14491
|
-
var SectionTabs = createTabsComponent(ModalTab, TabItem, "SectionTabs", (children, selected) => /* @__PURE__ */
|
14766
|
+
var SectionTabs = createTabsComponent(ModalTab, TabItem, "SectionTabs", (children, selected) => /* @__PURE__ */ import_react118.default.createElement(Section3.Body, null, children.find(
|
14492
14767
|
(node, index) => (node == null ? void 0 : node.props.value) === selected || index === selected
|
14493
14768
|
)));
|
14494
14769
|
|
14495
14770
|
// src/molecules/SegmentedControl/SegmentedControl.tsx
|
14496
|
-
var
|
14771
|
+
var import_react119 = __toESM(require("react"));
|
14497
14772
|
var SegmentedControl = (_a) => {
|
14498
14773
|
var _b = _a, {
|
14499
14774
|
children,
|
@@ -14510,7 +14785,7 @@ var SegmentedControl = (_a) => {
|
|
14510
14785
|
"selected",
|
14511
14786
|
"className"
|
14512
14787
|
]);
|
14513
|
-
return /* @__PURE__ */
|
14788
|
+
return /* @__PURE__ */ import_react119.default.createElement("li", null, /* @__PURE__ */ import_react119.default.createElement("button", __spreadProps(__spreadValues({
|
14514
14789
|
type: "button"
|
14515
14790
|
}, rest), {
|
14516
14791
|
className: classNames(
|
@@ -14544,12 +14819,12 @@ var SegmentedControlGroup = (_a) => {
|
|
14544
14819
|
"border border-default text-grey-50": variant === "outlined",
|
14545
14820
|
"bg-grey-0": variant === "raised"
|
14546
14821
|
});
|
14547
|
-
return /* @__PURE__ */
|
14822
|
+
return /* @__PURE__ */ import_react119.default.createElement("ul", __spreadProps(__spreadValues({}, rest), {
|
14548
14823
|
"aria-label": ariaLabel,
|
14549
14824
|
className: classNames("Aquarium-SegmentedControl", classes2, className)
|
14550
|
-
}),
|
14825
|
+
}), import_react119.default.Children.map(
|
14551
14826
|
children,
|
14552
|
-
(child) =>
|
14827
|
+
(child) => import_react119.default.cloneElement(child, {
|
14553
14828
|
dense,
|
14554
14829
|
variant,
|
14555
14830
|
onClick: () => onChange(child.props.value),
|
@@ -14587,14 +14862,14 @@ var getCommonClassNames = (dense, selected) => tw(
|
|
14587
14862
|
);
|
14588
14863
|
|
14589
14864
|
// src/molecules/Stepper/Stepper.tsx
|
14590
|
-
var
|
14865
|
+
var import_react121 = __toESM(require("react"));
|
14591
14866
|
|
14592
14867
|
// src/atoms/Stepper/Stepper.tsx
|
14593
|
-
var
|
14868
|
+
var import_react120 = __toESM(require("react"));
|
14594
14869
|
var import_tick6 = __toESM(require_tick());
|
14595
14870
|
var Stepper = (_a) => {
|
14596
14871
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
14597
|
-
return /* @__PURE__ */
|
14872
|
+
return /* @__PURE__ */ import_react120.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
14598
14873
|
className: classNames(className)
|
14599
14874
|
}));
|
14600
14875
|
};
|
@@ -14608,7 +14883,7 @@ var ConnectorContainer = (_a) => {
|
|
14608
14883
|
"completed",
|
14609
14884
|
"dense"
|
14610
14885
|
]);
|
14611
|
-
return /* @__PURE__ */
|
14886
|
+
return /* @__PURE__ */ import_react120.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
14612
14887
|
className: classNames(
|
14613
14888
|
tw("absolute w-full -left-1/2", {
|
14614
14889
|
"top-[3px] px-[14px]": Boolean(dense),
|
@@ -14620,7 +14895,7 @@ var ConnectorContainer = (_a) => {
|
|
14620
14895
|
};
|
14621
14896
|
var Connector = (_a) => {
|
14622
14897
|
var _b = _a, { children, className, completed, dense } = _b, rest = __objRest(_b, ["children", "className", "completed", "dense"]);
|
14623
|
-
return /* @__PURE__ */
|
14898
|
+
return /* @__PURE__ */ import_react120.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
14624
14899
|
className: classNames(
|
14625
14900
|
tw("w-full", {
|
14626
14901
|
"bg-grey-20": !completed,
|
@@ -14634,7 +14909,7 @@ var Connector = (_a) => {
|
|
14634
14909
|
};
|
14635
14910
|
var Step = (_a) => {
|
14636
14911
|
var _b = _a, { className, state } = _b, rest = __objRest(_b, ["className", "state"]);
|
14637
|
-
return /* @__PURE__ */
|
14912
|
+
return /* @__PURE__ */ import_react120.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
14638
14913
|
className: classNames(
|
14639
14914
|
tw("flex flex-col items-center text-grey-90 relative text-center", {
|
14640
14915
|
"text-grey-20": state === "inactive"
|
@@ -14655,13 +14930,13 @@ var getDenseClassNames = (state) => tw("h-[8px] w-[8px]", {
|
|
14655
14930
|
});
|
14656
14931
|
var Indicator = (_a) => {
|
14657
14932
|
var _b = _a, { children, className, state, dense } = _b, rest = __objRest(_b, ["children", "className", "state", "dense"]);
|
14658
|
-
return /* @__PURE__ */
|
14933
|
+
return /* @__PURE__ */ import_react120.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
14659
14934
|
className: classNames(
|
14660
14935
|
tw("rounded-full flex justify-center items-center mx-2 mb-3"),
|
14661
14936
|
dense ? getDenseClassNames(state) : getClassNames(state),
|
14662
14937
|
className
|
14663
14938
|
)
|
14664
|
-
}), state === "completed" ? /* @__PURE__ */
|
14939
|
+
}), state === "completed" ? /* @__PURE__ */ import_react120.default.createElement(InlineIcon, {
|
14665
14940
|
icon: import_tick6.default
|
14666
14941
|
}) : dense ? null : children);
|
14667
14942
|
};
|
@@ -14672,26 +14947,26 @@ Stepper.ConnectorContainer = ConnectorContainer;
|
|
14672
14947
|
|
14673
14948
|
// src/molecules/Stepper/Stepper.tsx
|
14674
14949
|
var Stepper2 = ({ children, activeIndex, dense }) => {
|
14675
|
-
const steps =
|
14676
|
-
return /* @__PURE__ */
|
14950
|
+
const steps = import_react121.default.Children.count(children);
|
14951
|
+
return /* @__PURE__ */ import_react121.default.createElement(Stepper, {
|
14677
14952
|
role: "list",
|
14678
14953
|
className: "Aquarium-Stepper"
|
14679
|
-
}, /* @__PURE__ */
|
14954
|
+
}, /* @__PURE__ */ import_react121.default.createElement(Template, {
|
14680
14955
|
columns: steps
|
14681
|
-
},
|
14956
|
+
}, import_react121.default.Children.map(children, (child, index) => {
|
14682
14957
|
if (!isComponentType(child, Step2)) {
|
14683
14958
|
throw new Error("<Stepper> can only have <Stepper.Step> components as children");
|
14684
14959
|
} else {
|
14685
14960
|
const state = index > activeIndex ? "inactive" : index === activeIndex ? "active" : "completed";
|
14686
|
-
return /* @__PURE__ */
|
14961
|
+
return /* @__PURE__ */ import_react121.default.createElement(Stepper.Step, {
|
14687
14962
|
state,
|
14688
14963
|
"aria-current": state === "active" ? "step" : false,
|
14689
14964
|
role: "listitem"
|
14690
|
-
}, index > 0 && index <= steps && /* @__PURE__ */
|
14965
|
+
}, index > 0 && index <= steps && /* @__PURE__ */ import_react121.default.createElement(Stepper.ConnectorContainer, {
|
14691
14966
|
dense
|
14692
|
-
}, /* @__PURE__ */
|
14967
|
+
}, /* @__PURE__ */ import_react121.default.createElement(Stepper.ConnectorContainer.Connector, {
|
14693
14968
|
completed: state === "completed" || state === "active"
|
14694
|
-
})), /* @__PURE__ */
|
14969
|
+
})), /* @__PURE__ */ import_react121.default.createElement(Stepper.Step.Indicator, {
|
14695
14970
|
state,
|
14696
14971
|
dense
|
14697
14972
|
}, index + 1), child.props.children);
|
@@ -14704,8 +14979,8 @@ Step2.displayName = "Stepper.Step";
|
|
14704
14979
|
Stepper2.Step = Step2;
|
14705
14980
|
|
14706
14981
|
// src/molecules/SwitchGroup/SwitchGroup.tsx
|
14707
|
-
var
|
14708
|
-
var
|
14982
|
+
var import_react122 = __toESM(require("react"));
|
14983
|
+
var import_utils34 = require("@react-aria/utils");
|
14709
14984
|
var SwitchGroup = (_a) => {
|
14710
14985
|
var _b = _a, {
|
14711
14986
|
value,
|
@@ -14723,11 +14998,11 @@ var SwitchGroup = (_a) => {
|
|
14723
14998
|
"children"
|
14724
14999
|
]);
|
14725
15000
|
var _a2;
|
14726
|
-
const [selectedItems, setSelectedItems] = (0,
|
15001
|
+
const [selectedItems, setSelectedItems] = (0, import_react122.useState)((_a2 = value != null ? value : defaultValue) != null ? _a2 : []);
|
14727
15002
|
if (value !== void 0 && value !== selectedItems) {
|
14728
15003
|
setSelectedItems(value);
|
14729
15004
|
}
|
14730
|
-
const errorMessageId = (0,
|
15005
|
+
const errorMessageId = (0, import_utils34.useId)();
|
14731
15006
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
14732
15007
|
const labelControlProps = getLabelControlProps(props);
|
14733
15008
|
const handleChange = (e) => {
|
@@ -14736,13 +15011,13 @@ var SwitchGroup = (_a) => {
|
|
14736
15011
|
setSelectedItems(updated);
|
14737
15012
|
onChange == null ? void 0 : onChange(updated);
|
14738
15013
|
};
|
14739
|
-
return /* @__PURE__ */
|
15014
|
+
return /* @__PURE__ */ import_react122.default.createElement(LabelControl, __spreadProps(__spreadValues(__spreadValues({
|
14740
15015
|
fieldset: true
|
14741
15016
|
}, labelControlProps), errorProps), {
|
14742
15017
|
className: "Aquarium-SwitchGroup"
|
14743
|
-
}), /* @__PURE__ */
|
15018
|
+
}), /* @__PURE__ */ import_react122.default.createElement(InputGroup, {
|
14744
15019
|
cols
|
14745
|
-
},
|
15020
|
+
}, import_react122.default.Children.map(children, (c) => {
|
14746
15021
|
var _a3, _b2, _c, _d;
|
14747
15022
|
if (!isComponentType(c, Switch2)) {
|
14748
15023
|
return null;
|
@@ -14750,7 +15025,7 @@ var SwitchGroup = (_a) => {
|
|
14750
15025
|
const str = (_a3 = c.props.value) == null ? void 0 : _a3.toString();
|
14751
15026
|
const defaultChecked = defaultValue === void 0 ? void 0 : str !== void 0 && defaultValue.includes(str);
|
14752
15027
|
const checked = value === void 0 ? void 0 : str !== void 0 && value.includes(str);
|
14753
|
-
return
|
15028
|
+
return import_react122.default.cloneElement(c, {
|
14754
15029
|
defaultChecked: (_b2 = c.props.defaultChecked) != null ? _b2 : defaultChecked,
|
14755
15030
|
checked: (_c = c.props.checked) != null ? _c : checked,
|
14756
15031
|
onChange: (_d = c.props.onChange) != null ? _d : handleChange,
|
@@ -14760,9 +15035,9 @@ var SwitchGroup = (_a) => {
|
|
14760
15035
|
})));
|
14761
15036
|
};
|
14762
15037
|
var SwitchGroupSkeleton = ({ options = 2 }) => {
|
14763
|
-
return /* @__PURE__ */
|
15038
|
+
return /* @__PURE__ */ import_react122.default.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ import_react122.default.createElement("div", {
|
14764
15039
|
className: tw("flex flex-wrap flex-col gap-2")
|
14765
|
-
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */
|
15040
|
+
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */ import_react122.default.createElement(Switch2.Skeleton, {
|
14766
15041
|
key
|
14767
15042
|
}))));
|
14768
15043
|
};
|
@@ -14770,14 +15045,14 @@ SwitchGroup.Skeleton = SwitchGroupSkeleton;
|
|
14770
15045
|
SwitchGroup.Skeleton.displayName = "SwitchGroup.Skeleton";
|
14771
15046
|
|
14772
15047
|
// src/molecules/Textarea/Textarea.tsx
|
14773
|
-
var
|
14774
|
-
var
|
15048
|
+
var import_react123 = __toESM(require("react"));
|
15049
|
+
var import_utils36 = require("@react-aria/utils");
|
14775
15050
|
var import_omit16 = __toESM(require("lodash/omit"));
|
14776
15051
|
var import_toString2 = __toESM(require("lodash/toString"));
|
14777
|
-
var TextareaBase =
|
15052
|
+
var TextareaBase = import_react123.default.forwardRef(
|
14778
15053
|
(_a, ref) => {
|
14779
15054
|
var _b = _a, { readOnly = false, valid = true } = _b, props = __objRest(_b, ["readOnly", "valid"]);
|
14780
|
-
return /* @__PURE__ */
|
15055
|
+
return /* @__PURE__ */ import_react123.default.createElement("textarea", __spreadProps(__spreadValues({
|
14781
15056
|
ref
|
14782
15057
|
}, props), {
|
14783
15058
|
readOnly,
|
@@ -14785,26 +15060,26 @@ var TextareaBase = import_react121.default.forwardRef(
|
|
14785
15060
|
}));
|
14786
15061
|
}
|
14787
15062
|
);
|
14788
|
-
TextareaBase.Skeleton = () => /* @__PURE__ */
|
15063
|
+
TextareaBase.Skeleton = () => /* @__PURE__ */ import_react123.default.createElement(Skeleton, {
|
14789
15064
|
height: 58
|
14790
15065
|
});
|
14791
|
-
var Textarea =
|
15066
|
+
var Textarea = import_react123.default.forwardRef((props, ref) => {
|
14792
15067
|
var _a, _b, _c;
|
14793
|
-
const [value, setValue] = (0,
|
14794
|
-
const defaultId = (0,
|
15068
|
+
const [value, setValue] = (0, import_react123.useState)((_b = (_a = props.value) != null ? _a : props.defaultValue) != null ? _b : "");
|
15069
|
+
const defaultId = (0, import_utils36.useId)();
|
14795
15070
|
const id = (_c = props.id) != null ? _c : defaultId;
|
14796
|
-
const errorMessageId = (0,
|
15071
|
+
const errorMessageId = (0, import_utils36.useId)();
|
14797
15072
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
14798
15073
|
const _d = getLabelControlProps(props), { "data-testid": dataTestId } = _d, labelControlProps = __objRest(_d, ["data-testid"]);
|
14799
15074
|
const baseProps = (0, import_omit16.default)(props, Object.keys(labelControlProps));
|
14800
|
-
return /* @__PURE__ */
|
15075
|
+
return /* @__PURE__ */ import_react123.default.createElement(LabelControl, __spreadProps(__spreadValues({
|
14801
15076
|
id: `${id}-label`,
|
14802
15077
|
htmlFor: id,
|
14803
15078
|
messageId: errorMessageId,
|
14804
15079
|
length: value !== void 0 ? (0, import_toString2.default)(value).length : void 0
|
14805
15080
|
}, labelControlProps), {
|
14806
15081
|
className: "Aquarium-Textarea"
|
14807
|
-
}), /* @__PURE__ */
|
15082
|
+
}), /* @__PURE__ */ import_react123.default.createElement(TextareaBase, __spreadProps(__spreadValues(__spreadValues({
|
14808
15083
|
ref
|
14809
15084
|
}, baseProps), errorProps), {
|
14810
15085
|
id,
|
@@ -14821,48 +15096,48 @@ var Textarea = import_react121.default.forwardRef((props, ref) => {
|
|
14821
15096
|
})));
|
14822
15097
|
});
|
14823
15098
|
Textarea.displayName = "Textarea";
|
14824
|
-
var TextAreaSkeleton = () => /* @__PURE__ */
|
15099
|
+
var TextAreaSkeleton = () => /* @__PURE__ */ import_react123.default.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ import_react123.default.createElement(TextareaBase.Skeleton, null));
|
14825
15100
|
Textarea.Skeleton = TextAreaSkeleton;
|
14826
15101
|
Textarea.Skeleton.displayName = "Textarea.Skeleton";
|
14827
15102
|
|
14828
15103
|
// src/molecules/Timeline/Timeline.tsx
|
14829
|
-
var
|
15104
|
+
var import_react125 = __toESM(require("react"));
|
14830
15105
|
|
14831
15106
|
// src/atoms/Timeline/Timeline.tsx
|
14832
|
-
var
|
15107
|
+
var import_react124 = __toESM(require("react"));
|
14833
15108
|
var Timeline = (_a) => {
|
14834
15109
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
14835
|
-
return /* @__PURE__ */
|
15110
|
+
return /* @__PURE__ */ import_react124.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
14836
15111
|
className: classNames(tw("grid grid-cols-[16px_1fr] gap-x-4"), className)
|
14837
15112
|
}));
|
14838
15113
|
};
|
14839
15114
|
var Content2 = (_a) => {
|
14840
15115
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
14841
|
-
return /* @__PURE__ */
|
15116
|
+
return /* @__PURE__ */ import_react124.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
14842
15117
|
className: classNames(tw("pb-6"), className)
|
14843
15118
|
}));
|
14844
15119
|
};
|
14845
15120
|
var Separator2 = (_a) => {
|
14846
15121
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
14847
|
-
return /* @__PURE__ */
|
15122
|
+
return /* @__PURE__ */ import_react124.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
14848
15123
|
className: classNames(tw("flex items-center justify-center h-5 w-5"), className)
|
14849
15124
|
}));
|
14850
15125
|
};
|
14851
15126
|
var LineContainer = (_a) => {
|
14852
15127
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
14853
|
-
return /* @__PURE__ */
|
15128
|
+
return /* @__PURE__ */ import_react124.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
14854
15129
|
className: classNames(tw("flex justify-center py-1"), className)
|
14855
15130
|
}));
|
14856
15131
|
};
|
14857
15132
|
var Line = (_a) => {
|
14858
15133
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
14859
|
-
return /* @__PURE__ */
|
15134
|
+
return /* @__PURE__ */ import_react124.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
14860
15135
|
className: classNames(tw("w-1 bg-grey-5 h-full justify-self-center"), className)
|
14861
15136
|
}));
|
14862
15137
|
};
|
14863
15138
|
var Dot = (_a) => {
|
14864
15139
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
14865
|
-
return /* @__PURE__ */
|
15140
|
+
return /* @__PURE__ */ import_react124.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
14866
15141
|
className: classNames(tw("bg-grey-30 h-[6px] w-[6px] rounded"), className)
|
14867
15142
|
}));
|
14868
15143
|
};
|
@@ -14877,54 +15152,54 @@ var import_error5 = __toESM(require_error());
|
|
14877
15152
|
var import_time2 = __toESM(require_time());
|
14878
15153
|
var import_warningSign5 = __toESM(require_warningSign());
|
14879
15154
|
var TimelineItem = () => null;
|
14880
|
-
var Timeline2 = ({ children }) => /* @__PURE__ */
|
15155
|
+
var Timeline2 = ({ children }) => /* @__PURE__ */ import_react125.default.createElement("div", {
|
14881
15156
|
className: "Aquarium-Timeline"
|
14882
|
-
},
|
15157
|
+
}, import_react125.default.Children.map(children, (item) => {
|
14883
15158
|
if (!isComponentType(item, TimelineItem)) {
|
14884
15159
|
throw new Error("<Timeline> can only have <Timeline.Item> components as children");
|
14885
15160
|
} else {
|
14886
15161
|
const { props, key } = item;
|
14887
|
-
return /* @__PURE__ */
|
15162
|
+
return /* @__PURE__ */ import_react125.default.createElement(Timeline, {
|
14888
15163
|
key: key != null ? key : props.title
|
14889
|
-
}, /* @__PURE__ */
|
15164
|
+
}, /* @__PURE__ */ import_react125.default.createElement(Timeline.Separator, null, props.variant === "error" ? /* @__PURE__ */ import_react125.default.createElement(Icon, {
|
14890
15165
|
icon: import_error5.default,
|
14891
15166
|
color: "error-30"
|
14892
|
-
}) : props.variant === "warning" ? /* @__PURE__ */
|
15167
|
+
}) : props.variant === "warning" ? /* @__PURE__ */ import_react125.default.createElement(Icon, {
|
14893
15168
|
icon: import_warningSign5.default,
|
14894
15169
|
color: "warning-30"
|
14895
|
-
}) : props.variant === "info" ? /* @__PURE__ */
|
15170
|
+
}) : props.variant === "info" ? /* @__PURE__ */ import_react125.default.createElement(Icon, {
|
14896
15171
|
icon: import_time2.default,
|
14897
15172
|
color: "info-30"
|
14898
|
-
}) : /* @__PURE__ */
|
15173
|
+
}) : /* @__PURE__ */ import_react125.default.createElement(Timeline.Separator.Dot, null)), /* @__PURE__ */ import_react125.default.createElement(Typography2.Caption, {
|
14899
15174
|
color: "grey-50"
|
14900
|
-
}, props.title), /* @__PURE__ */
|
15175
|
+
}, props.title), /* @__PURE__ */ import_react125.default.createElement(Timeline.LineContainer, null, /* @__PURE__ */ import_react125.default.createElement(Timeline.LineContainer.Line, null)), /* @__PURE__ */ import_react125.default.createElement(Timeline.Content, null, /* @__PURE__ */ import_react125.default.createElement(Typography2.Small, null, props.children)));
|
14901
15176
|
}
|
14902
15177
|
}));
|
14903
|
-
var TimelineItemSkeleton = () => /* @__PURE__ */
|
15178
|
+
var TimelineItemSkeleton = () => /* @__PURE__ */ import_react125.default.createElement(Timeline, null, /* @__PURE__ */ import_react125.default.createElement(Timeline.Separator, null, /* @__PURE__ */ import_react125.default.createElement(Skeleton, {
|
14904
15179
|
width: 6,
|
14905
15180
|
height: 6,
|
14906
15181
|
rounded: true
|
14907
|
-
})), /* @__PURE__ */
|
15182
|
+
})), /* @__PURE__ */ import_react125.default.createElement(Skeleton, {
|
14908
15183
|
height: 12,
|
14909
15184
|
width: 120
|
14910
|
-
}), /* @__PURE__ */
|
15185
|
+
}), /* @__PURE__ */ import_react125.default.createElement(Timeline.LineContainer, null, /* @__PURE__ */ import_react125.default.createElement(Skeleton, {
|
14911
15186
|
width: 2,
|
14912
15187
|
height: "100%"
|
14913
|
-
})), /* @__PURE__ */
|
15188
|
+
})), /* @__PURE__ */ import_react125.default.createElement(Timeline.Content, null, /* @__PURE__ */ import_react125.default.createElement(Box, {
|
14914
15189
|
display: "flex",
|
14915
15190
|
flexDirection: "column",
|
14916
15191
|
gap: "3"
|
14917
|
-
}, /* @__PURE__ */
|
15192
|
+
}, /* @__PURE__ */ import_react125.default.createElement(Skeleton, {
|
14918
15193
|
height: 32,
|
14919
15194
|
width: "100%"
|
14920
|
-
}), /* @__PURE__ */
|
15195
|
+
}), /* @__PURE__ */ import_react125.default.createElement(Skeleton, {
|
14921
15196
|
height: 32,
|
14922
15197
|
width: "73%"
|
14923
|
-
}), /* @__PURE__ */
|
15198
|
+
}), /* @__PURE__ */ import_react125.default.createElement(Skeleton, {
|
14924
15199
|
height: 32,
|
14925
15200
|
width: "80%"
|
14926
15201
|
}))));
|
14927
|
-
var TimelineSkeleton = ({ items = 3 }) => /* @__PURE__ */
|
15202
|
+
var TimelineSkeleton = ({ items = 3 }) => /* @__PURE__ */ import_react125.default.createElement("div", null, Array.from({ length: items }).map((_, key) => /* @__PURE__ */ import_react125.default.createElement(TimelineItemSkeleton, {
|
14928
15203
|
key
|
14929
15204
|
})));
|
14930
15205
|
Timeline2.Item = TimelineItem;
|
@@ -14932,9 +15207,9 @@ Timeline2.Skeleton = TimelineSkeleton;
|
|
14932
15207
|
Timeline2.Skeleton.displayName = "Timeline.Skeleton";
|
14933
15208
|
|
14934
15209
|
// src/utils/table/useTableSelect.ts
|
14935
|
-
var
|
15210
|
+
var import_react126 = __toESM(require("react"));
|
14936
15211
|
var useTableSelect = (data, { key }) => {
|
14937
|
-
const [selected, setSelected] =
|
15212
|
+
const [selected, setSelected] = import_react126.default.useState([]);
|
14938
15213
|
const allSelected = selected.length === data.length;
|
14939
15214
|
const isSelected = (dot) => selected.includes(dot[key]);
|
14940
15215
|
const selectAll = () => setSelected(data.map((dot) => dot[key]));
|