@aivenio/aquarium 1.36.1 → 1.38.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/_variables_timescale.scss +1 -1
- package/dist/atoms.cjs +90 -8
- package/dist/atoms.mjs +90 -8
- package/dist/src/atoms/Banner/Banner.js +2 -2
- package/dist/src/atoms/Section/Section.js +3 -3
- package/dist/src/atoms/Switch/Switch.js +8 -6
- package/dist/src/atoms/Typography/Typography.js +1 -1
- package/dist/src/icons/ban.d.ts +9 -0
- package/dist/src/icons/ban.js +11 -0
- package/dist/src/icons/index.d.ts +1 -0
- package/dist/src/icons/index.js +2 -1
- package/dist/src/molecules/Checkbox/Checkbox.d.ts +2 -0
- package/dist/src/molecules/Checkbox/Checkbox.js +3 -3
- package/dist/src/molecules/Chip/Chip.js +2 -2
- package/dist/src/molecules/Combobox/Combobox.d.ts +10 -3
- package/dist/src/molecules/Combobox/Combobox.js +5 -5
- package/dist/src/molecules/ControlLabel/ControlLabel.d.ts +1 -1
- package/dist/src/molecules/ControlLabel/ControlLabel.js +11 -7
- package/dist/src/molecules/DataList/DataList.d.ts +3 -8
- package/dist/src/molecules/DataList/DataList.js +16 -32
- package/dist/src/molecules/DataTable/DataTable.d.ts +3 -8
- package/dist/src/molecules/DataTable/DataTable.js +24 -29
- package/dist/src/molecules/Dialog/Dialog.js +6 -4
- package/dist/src/molecules/EmptyState/EmptyState.js +5 -11
- package/dist/src/molecules/Grid/Grid.d.ts +25 -2
- package/dist/src/molecules/Grid/Grid.js +43 -2
- package/dist/src/molecules/Grid/GridItem.d.ts +3 -0
- package/dist/src/molecules/Grid/GridItem.js +4 -1
- package/dist/src/molecules/Input/Input.js +2 -1
- package/dist/src/molecules/List/List.d.ts +11 -1
- package/dist/src/molecules/List/List.js +13 -3
- package/dist/src/molecules/MultiSelect/MultiSelect.d.ts +2 -2
- package/dist/src/molecules/MultiSelect/MultiSelect.js +5 -5
- package/dist/src/molecules/PageHeader/PageHeader.d.ts +2 -21
- package/dist/src/molecules/PageHeader/PageHeader.js +6 -9
- package/dist/src/molecules/Section/Section.d.ts +21 -7
- package/dist/src/molecules/Section/Section.js +32 -15
- package/dist/src/molecules/Switch/Switch.d.ts +2 -0
- package/dist/src/molecules/Switch/Switch.js +3 -3
- package/dist/src/test/config.js +2 -2
- package/dist/src/utils/actions.d.ts +3 -0
- package/dist/src/utils/actions.js +8 -0
- package/dist/src/utils/form/Label/Label.js +1 -1
- package/dist/src/utils/table/types.d.ts +20 -19
- package/dist/src/utils/table/types.js +1 -1
- package/dist/styles.css +22 -15
- package/dist/styles_timescaledb.css +22 -15
- package/dist/system.cjs +743 -566
- package/dist/system.mjs +708 -531
- package/dist/tsconfig.module.tsbuildinfo +1 -1
- package/dist/types/ContextualMenu.d.ts +26 -0
- package/dist/types/ContextualMenu.js +2 -0
- package/dist/types/tailwindGenerated.d.ts +1 -1
- package/package.json +1 -1
package/dist/system.mjs
CHANGED
@@ -1732,6 +1732,22 @@ var require_banCircle = __commonJS({
|
|
1732
1732
|
}
|
1733
1733
|
});
|
1734
1734
|
|
1735
|
+
// src/icons/ban.js
|
1736
|
+
var require_ban = __commonJS({
|
1737
|
+
"src/icons/ban.js"(exports) {
|
1738
|
+
"use strict";
|
1739
|
+
var data = {
|
1740
|
+
"body": '<g fill="none"><g clip-path="url(#svgIDa)"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="m2.13 2.13 5.892 5.892m1.22-2.946a4.167 4.167 0 11-8.333 0 4.167 4.167 0 018.333 0Z"/></g><defs><clipPath id="svgIDa"><path fill="#fff" d="M0 0h10v10H0z"/></clipPath></defs></g>',
|
1741
|
+
"left": 0,
|
1742
|
+
"top": 0,
|
1743
|
+
"width": 10,
|
1744
|
+
"height": 10
|
1745
|
+
};
|
1746
|
+
exports.__esModule = true;
|
1747
|
+
exports.default = data;
|
1748
|
+
}
|
1749
|
+
});
|
1750
|
+
|
1735
1751
|
// src/icons/bankAccount.js
|
1736
1752
|
var require_bankAccount = __commonJS({
|
1737
1753
|
"src/icons/bankAccount.js"(exports) {
|
@@ -5023,7 +5039,7 @@ __export(molecules_exports, {
|
|
5023
5039
|
FlexboxItem: () => FlexboxItem,
|
5024
5040
|
GhostButton: () => GhostButton,
|
5025
5041
|
Grid: () => Grid,
|
5026
|
-
GridItem: () =>
|
5042
|
+
GridItem: () => GridItem2,
|
5027
5043
|
Icon: () => Icon,
|
5028
5044
|
IconButton: () => IconButton,
|
5029
5045
|
IconExternalLinkButton: () => IconExternalLinkButton,
|
@@ -6224,6 +6240,7 @@ var import_attachment = __toESM(require_attachment());
|
|
6224
6240
|
var import_automaticUpdates = __toESM(require_automaticUpdates());
|
6225
6241
|
var import_badge = __toESM(require_badge());
|
6226
6242
|
var import_banCircle = __toESM(require_banCircle());
|
6243
|
+
var import_ban = __toESM(require_ban());
|
6227
6244
|
var import_bankAccount = __toESM(require_bankAccount());
|
6228
6245
|
var import_blockedPerson = __toESM(require_blockedPerson());
|
6229
6246
|
var import_book = __toESM(require_book());
|
@@ -7287,7 +7304,7 @@ var Typography = (_a) => {
|
|
7287
7304
|
"fontWeight"
|
7288
7305
|
]);
|
7289
7306
|
const HtmlElement = htmlTag;
|
7290
|
-
const resolvedColorName = isUndefined6(color) || color === "current" ? "grey-
|
7307
|
+
const resolvedColorName = isUndefined6(color) || color === "current" ? "grey-70" : color;
|
7291
7308
|
const style = useStyle({ fontWeight });
|
7292
7309
|
return /* @__PURE__ */ React16.createElement(HtmlElement, __spreadValues({
|
7293
7310
|
className: classNames(typographies[variant], `text-${resolvedColorName}`, className),
|
@@ -7581,7 +7598,6 @@ Banner.Description = (_a) => {
|
|
7581
7598
|
var _b = _a, { flexGrow, children, className } = _b, rest = __objRest(_b, ["flexGrow", "children", "className"]);
|
7582
7599
|
return /* @__PURE__ */ React22.createElement(Typography, __spreadProps(__spreadValues({}, rest), {
|
7583
7600
|
variant: "default",
|
7584
|
-
color: "grey-90",
|
7585
7601
|
className: classNames(className, tw({ "flex-grow": flexGrow }))
|
7586
7602
|
}), children);
|
7587
7603
|
};
|
@@ -7833,6 +7849,8 @@ var StatusChip = React26.forwardRef(
|
|
7833
7849
|
var _b = _a, { UNSAFE_icon: icon, text, dense = false, status } = _b, rest = __objRest(_b, ["UNSAFE_icon", "text", "dense", "status"]);
|
7834
7850
|
return /* @__PURE__ */ React26.createElement(Chip.Container, __spreadProps(__spreadValues({
|
7835
7851
|
ref,
|
7852
|
+
role: "status",
|
7853
|
+
"aria-label": text ? text.toString() : void 0,
|
7836
7854
|
dense
|
7837
7855
|
}, rest), {
|
7838
7856
|
className: getStatusClassNames(status)
|
@@ -8370,6 +8388,7 @@ import React33 from "react";
|
|
8370
8388
|
var ControlLabel = (_a) => {
|
8371
8389
|
var _b = _a, {
|
8372
8390
|
label,
|
8391
|
+
labelPlacement = "right",
|
8373
8392
|
caption,
|
8374
8393
|
disabled = false,
|
8375
8394
|
readOnly = false,
|
@@ -8378,6 +8397,7 @@ var ControlLabel = (_a) => {
|
|
8378
8397
|
className
|
8379
8398
|
} = _b, rest = __objRest(_b, [
|
8380
8399
|
"label",
|
8400
|
+
"labelPlacement",
|
8381
8401
|
"caption",
|
8382
8402
|
"disabled",
|
8383
8403
|
"readOnly",
|
@@ -8385,13 +8405,19 @@ var ControlLabel = (_a) => {
|
|
8385
8405
|
"style",
|
8386
8406
|
"className"
|
8387
8407
|
]);
|
8388
|
-
const textClass = disabled ? "text-grey-40" : "text-grey-
|
8408
|
+
const textClass = disabled ? "text-grey-40" : "text-grey-70";
|
8409
|
+
const rtl = labelPlacement === "left";
|
8410
|
+
const labelEl = label && /* @__PURE__ */ React33.createElement("span", {
|
8411
|
+
className: tw("typography-small self-center", { "text-right": rtl })
|
8412
|
+
}, label);
|
8389
8413
|
return /* @__PURE__ */ React33.createElement("label", __spreadValues({
|
8390
8414
|
className: classNames(
|
8391
8415
|
className,
|
8392
8416
|
tw(
|
8393
|
-
"inline-grid
|
8417
|
+
"inline-grid",
|
8394
8418
|
{
|
8419
|
+
"grid-cols-[auto_1fr]": !rtl,
|
8420
|
+
"grid-cols-[1fr_auto]": rtl,
|
8395
8421
|
"cursor-pointer": !disabled && !readOnly,
|
8396
8422
|
"cursor-not-allowed": disabled
|
8397
8423
|
},
|
@@ -8399,10 +8425,8 @@ var ControlLabel = (_a) => {
|
|
8399
8425
|
)
|
8400
8426
|
),
|
8401
8427
|
style: __spreadValues({}, style)
|
8402
|
-
}, rest), children,
|
8403
|
-
className: tw("
|
8404
|
-
}, label), caption && /* @__PURE__ */ React33.createElement(Typography2, {
|
8405
|
-
className: tw("col-start-2"),
|
8428
|
+
}, rest), rtl ? labelEl : children, rtl ? children : labelEl, caption && /* @__PURE__ */ React33.createElement(Typography2, {
|
8429
|
+
className: tw({ "col-start-2": !rtl }),
|
8406
8430
|
variant: "caption",
|
8407
8431
|
color: disabled ? "grey-40" : "grey-50"
|
8408
8432
|
}, caption));
|
@@ -8456,12 +8480,31 @@ var Checkbox = React34.forwardRef(
|
|
8456
8480
|
// src/molecules/Checkbox/Checkbox.tsx
|
8457
8481
|
var Checkbox2 = React35.forwardRef(
|
8458
8482
|
(_a, ref) => {
|
8459
|
-
var _b = _a, {
|
8483
|
+
var _b = _a, {
|
8484
|
+
id,
|
8485
|
+
name,
|
8486
|
+
caption,
|
8487
|
+
readOnly = false,
|
8488
|
+
disabled = false,
|
8489
|
+
children,
|
8490
|
+
"aria-label": ariaLabel,
|
8491
|
+
labelPlacement
|
8492
|
+
} = _b, props = __objRest(_b, [
|
8493
|
+
"id",
|
8494
|
+
"name",
|
8495
|
+
"caption",
|
8496
|
+
"readOnly",
|
8497
|
+
"disabled",
|
8498
|
+
"children",
|
8499
|
+
"aria-label",
|
8500
|
+
"labelPlacement"
|
8501
|
+
]);
|
8460
8502
|
var _a2;
|
8461
8503
|
const isChecked = (_a2 = props.checked) != null ? _a2 : props.defaultChecked;
|
8462
8504
|
return !readOnly || isChecked ? /* @__PURE__ */ React35.createElement(ControlLabel, {
|
8463
8505
|
htmlFor: id,
|
8464
8506
|
label: children,
|
8507
|
+
labelPlacement,
|
8465
8508
|
"aria-label": ariaLabel,
|
8466
8509
|
caption,
|
8467
8510
|
readOnly,
|
@@ -8500,7 +8543,66 @@ import React37 from "react";
|
|
8500
8543
|
|
8501
8544
|
// src/molecules/Grid/Grid.tsx
|
8502
8545
|
import React36 from "react";
|
8503
|
-
|
8546
|
+
import isEmpty from "lodash/isEmpty";
|
8547
|
+
import mapValues from "lodash/mapValues";
|
8548
|
+
import pick from "lodash/pick";
|
8549
|
+
var screenSizes = Object.keys(tailwind_theme_default.screens);
|
8550
|
+
var GridItem = Tailwindify(
|
8551
|
+
(_a) => {
|
8552
|
+
var _b = _a, {
|
8553
|
+
htmlTag = "div",
|
8554
|
+
className,
|
8555
|
+
style,
|
8556
|
+
children,
|
8557
|
+
display,
|
8558
|
+
justifySelf,
|
8559
|
+
alignSelf,
|
8560
|
+
placeSelf,
|
8561
|
+
colStart,
|
8562
|
+
colEnd,
|
8563
|
+
rowSpan,
|
8564
|
+
rowStart,
|
8565
|
+
rowEnd
|
8566
|
+
} = _b, props = __objRest(_b, [
|
8567
|
+
"htmlTag",
|
8568
|
+
"className",
|
8569
|
+
"style",
|
8570
|
+
"children",
|
8571
|
+
"display",
|
8572
|
+
"justifySelf",
|
8573
|
+
"alignSelf",
|
8574
|
+
"placeSelf",
|
8575
|
+
"colStart",
|
8576
|
+
"colEnd",
|
8577
|
+
"rowSpan",
|
8578
|
+
"rowStart",
|
8579
|
+
"rowEnd"
|
8580
|
+
]);
|
8581
|
+
const breakPointableProperties = pick(props, screenSizes);
|
8582
|
+
const gridColumn = !isEmpty(breakPointableProperties) ? mapValues(breakPointableProperties, (value) => value === "full" ? "1 / -1" : value ? `span-${value}` : "auto") : void 0;
|
8583
|
+
const hookStyle = useStyle({
|
8584
|
+
display,
|
8585
|
+
justifySelf,
|
8586
|
+
alignSelf,
|
8587
|
+
placeSelf,
|
8588
|
+
gridColumn,
|
8589
|
+
gridColumnStart: colStart,
|
8590
|
+
gridColumnEnd: colEnd,
|
8591
|
+
gridRow: rowSpan,
|
8592
|
+
gridRowStart: rowStart,
|
8593
|
+
gridRowEnd: rowEnd
|
8594
|
+
});
|
8595
|
+
const HtmlElement = htmlTag;
|
8596
|
+
return /* @__PURE__ */ React36.createElement(HtmlElement, {
|
8597
|
+
style: __spreadValues(__spreadValues({}, hookStyle), style),
|
8598
|
+
className
|
8599
|
+
}, children);
|
8600
|
+
}
|
8601
|
+
);
|
8602
|
+
var Grid = (props) => {
|
8603
|
+
return /* @__PURE__ */ React36.createElement(GridComponent, __spreadValues({}, props));
|
8604
|
+
};
|
8605
|
+
var GridComponent = Tailwindify(
|
8504
8606
|
({
|
8505
8607
|
htmlTag = "div",
|
8506
8608
|
className,
|
@@ -8558,6 +8660,7 @@ var Grid = Tailwindify(
|
|
8558
8660
|
}, children);
|
8559
8661
|
}
|
8560
8662
|
);
|
8663
|
+
Grid.Item = GridItem;
|
8561
8664
|
|
8562
8665
|
// src/atoms/InputGroup/InputGroup.tsx
|
8563
8666
|
var gridColumnStyles = {
|
@@ -8631,13 +8734,13 @@ var HelperText = ({
|
|
8631
8734
|
alignItems: "start",
|
8632
8735
|
autoCols: "min",
|
8633
8736
|
className: tw("mt-1 mb-3")
|
8634
|
-
}, /* @__PURE__ */ React40.createElement(
|
8737
|
+
}, /* @__PURE__ */ React40.createElement(GridItem2, {
|
8635
8738
|
colStart: "1",
|
8636
8739
|
colEnd: "2"
|
8637
8740
|
}, hasError && /* @__PURE__ */ React40.createElement("p", {
|
8638
8741
|
id: messageId,
|
8639
8742
|
className: tw("text-error-50 block typography-caption")
|
8640
|
-
}, helperText)), /* @__PURE__ */ React40.createElement(
|
8743
|
+
}, helperText)), /* @__PURE__ */ React40.createElement(GridItem2, {
|
8641
8744
|
colStart: "2",
|
8642
8745
|
colEnd: "3",
|
8643
8746
|
display: "flex"
|
@@ -8667,7 +8770,7 @@ var LabelText = ({
|
|
8667
8770
|
className: tw("block mb-2")
|
8668
8771
|
}, /* @__PURE__ */ React41.createElement("span", {
|
8669
8772
|
className: tw("inline-flex items-center typography-small-strong", {
|
8670
|
-
"text-grey-
|
8773
|
+
"text-grey-70": variant === "default",
|
8671
8774
|
"text-error-50": variant === "error",
|
8672
8775
|
"text-grey-40": variant === "disabled"
|
8673
8776
|
})
|
@@ -8995,6 +9098,7 @@ var ComboboxBase = (_a) => {
|
|
8995
9098
|
options,
|
8996
9099
|
optionKeys = ["label", "value"],
|
8997
9100
|
noResults,
|
9101
|
+
emptyState = noResults,
|
8998
9102
|
optionToString: itemToString = getOptionLabelBuiltin,
|
8999
9103
|
createOption,
|
9000
9104
|
renderOption = (opt) => itemToString(opt),
|
@@ -9014,6 +9118,7 @@ var ComboboxBase = (_a) => {
|
|
9014
9118
|
"options",
|
9015
9119
|
"optionKeys",
|
9016
9120
|
"noResults",
|
9121
|
+
"emptyState",
|
9017
9122
|
"optionToString",
|
9018
9123
|
"createOption",
|
9019
9124
|
"renderOption",
|
@@ -9129,7 +9234,7 @@ var ComboboxBase = (_a) => {
|
|
9129
9234
|
}, /* @__PURE__ */ React46.createElement(Select.Menu, __spreadValues({
|
9130
9235
|
ref: menuRef,
|
9131
9236
|
maxHeight
|
9132
|
-
}, menuProps), hasNoResults && /* @__PURE__ */ React46.createElement(Select.NoResults, null,
|
9237
|
+
}, menuProps), hasNoResults && /* @__PURE__ */ React46.createElement(Select.NoResults, null, emptyState), inputItems.map((item, index) => /* @__PURE__ */ React46.createElement(Select.Item, __spreadValues({
|
9133
9238
|
key: itemToString(item),
|
9134
9239
|
selected: item === selectedItem,
|
9135
9240
|
highlighted: index === highlightedIndex
|
@@ -9142,10 +9247,12 @@ ComboboxBase.Skeleton = ComboboxBaseSkeleton;
|
|
9142
9247
|
var Combobox = (_a) => {
|
9143
9248
|
var _b = _a, {
|
9144
9249
|
options,
|
9145
|
-
noResults
|
9250
|
+
noResults,
|
9251
|
+
emptyState = noResults
|
9146
9252
|
} = _b, props = __objRest(_b, [
|
9147
9253
|
"options",
|
9148
|
-
"noResults"
|
9254
|
+
"noResults",
|
9255
|
+
"emptyState"
|
9149
9256
|
]);
|
9150
9257
|
var _a2;
|
9151
9258
|
const id = useRef5((_a2 = props.id) != null ? _a2 : `combobox-${uniqueId2()}`);
|
@@ -9162,7 +9269,7 @@ var Combobox = (_a) => {
|
|
9162
9269
|
}), /* @__PURE__ */ React46.createElement(ComboboxBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
|
9163
9270
|
id: id.current,
|
9164
9271
|
options,
|
9165
|
-
|
9272
|
+
emptyState,
|
9166
9273
|
disabled: props.disabled,
|
9167
9274
|
valid: props.valid
|
9168
9275
|
})));
|
@@ -9191,7 +9298,6 @@ var Container2 = ({ maxWidth = "xl", children }) => /* @__PURE__ */ React47.crea
|
|
9191
9298
|
import React61 from "react";
|
9192
9299
|
import compact from "lodash/compact";
|
9193
9300
|
import isFunction from "lodash/isFunction";
|
9194
|
-
import isObject from "lodash/isObject";
|
9195
9301
|
|
9196
9302
|
// src/molecules/DropdownMenu/DropdownMenu.tsx
|
9197
9303
|
import React51 from "react";
|
@@ -9292,7 +9398,8 @@ var createInput = (displayName, opts = {}) => {
|
|
9292
9398
|
readOnly,
|
9293
9399
|
className: classNames(
|
9294
9400
|
{
|
9295
|
-
"pl-7": opts.adornment
|
9401
|
+
"pl-7": opts.adornment,
|
9402
|
+
"pr-7": opts.canReset || endAdornment
|
9296
9403
|
},
|
9297
9404
|
getCommonInputStyles({ readOnly, valid }),
|
9298
9405
|
props.className
|
@@ -9647,22 +9754,15 @@ var getDisabledItemKeys = (children) => {
|
|
9647
9754
|
};
|
9648
9755
|
|
9649
9756
|
// src/molecules/List/List.tsx
|
9650
|
-
import
|
9651
|
-
|
9652
|
-
items,
|
9653
|
-
renderItem,
|
9654
|
-
container = React52.Fragment
|
9655
|
-
}) => {
|
9656
|
-
const Component = container;
|
9657
|
-
return /* @__PURE__ */ React52.createElement(Component, null, items.map(renderItem));
|
9658
|
-
};
|
9757
|
+
import React54 from "react";
|
9758
|
+
import isObject from "lodash/isObject";
|
9659
9759
|
|
9660
9760
|
// src/molecules/Pagination/Pagination.tsx
|
9661
|
-
import
|
9761
|
+
import React53 from "react";
|
9662
9762
|
import clamp from "lodash/clamp";
|
9663
9763
|
|
9664
9764
|
// src/molecules/Select/Select.tsx
|
9665
|
-
import
|
9765
|
+
import React52, { useRef as useRef7, useState as useState7 } from "react";
|
9666
9766
|
import { useSelect } from "downshift";
|
9667
9767
|
import defaults from "lodash/defaults";
|
9668
9768
|
import isArray from "lodash/isArray";
|
@@ -9678,10 +9778,10 @@ var hasOptionGroups = (val) => {
|
|
9678
9778
|
};
|
9679
9779
|
var defaultRenderOption = (item, props, { selectedItem }, { getOptionKey, getValue, optionToString = getOptionLabelBuiltin }) => {
|
9680
9780
|
var _a, _b;
|
9681
|
-
return /* @__PURE__ */
|
9781
|
+
return /* @__PURE__ */ React52.createElement(Select.Item, __spreadValues({
|
9682
9782
|
key: (_b = (_a = getOptionKey == null ? void 0 : getOptionKey(item)) != null ? _a : getValue == null ? void 0 : getValue(item)) != null ? _b : optionToString(item),
|
9683
9783
|
selected: item === selectedItem
|
9684
|
-
}, props), hasIconProperty(item) && /* @__PURE__ */
|
9784
|
+
}, props), hasIconProperty(item) && /* @__PURE__ */ React52.createElement(InlineIcon, {
|
9685
9785
|
icon: item.icon
|
9686
9786
|
}), optionToString(item));
|
9687
9787
|
};
|
@@ -9788,7 +9888,7 @@ var _SelectBase = (props) => {
|
|
9788
9888
|
toggle: toggleMenu,
|
9789
9889
|
setOpen: (isOpen2) => isOpen2 ? openMenu() : closeMenu()
|
9790
9890
|
};
|
9791
|
-
const
|
9891
|
+
const renderItem3 = (item, index) => UNSAFE_renderOption(
|
9792
9892
|
item,
|
9793
9893
|
__spreadValues({
|
9794
9894
|
highlighted: index === highlightedIndex
|
@@ -9800,13 +9900,13 @@ var _SelectBase = (props) => {
|
|
9800
9900
|
},
|
9801
9901
|
withDefaults
|
9802
9902
|
);
|
9803
|
-
const renderGroup = (group) => /* @__PURE__ */
|
9903
|
+
const renderGroup = (group) => /* @__PURE__ */ React52.createElement(React52.Fragment, {
|
9804
9904
|
key: group.label
|
9805
|
-
}, /* @__PURE__ */
|
9806
|
-
const input = /* @__PURE__ */
|
9905
|
+
}, /* @__PURE__ */ React52.createElement(Select.Group, null, group.label), group.options.map((opt) => renderItem3(opt, items.indexOf(opt))));
|
9906
|
+
const input = /* @__PURE__ */ React52.createElement(Select.InputContainer, __spreadProps(__spreadValues({}, getToggleButtonProps({ disabled: disabled || readOnly, ref: targetRef })), {
|
9807
9907
|
variant: disabled ? "disabled" : !valid ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default",
|
9808
9908
|
tabIndex: 0
|
9809
|
-
}), /* @__PURE__ */
|
9909
|
+
}), /* @__PURE__ */ React52.createElement(Select.Input, __spreadProps(__spreadValues({
|
9810
9910
|
id,
|
9811
9911
|
name
|
9812
9912
|
}, rest), {
|
@@ -9818,26 +9918,26 @@ var _SelectBase = (props) => {
|
|
9818
9918
|
tabIndex: -1,
|
9819
9919
|
onFocus: () => setFocus(true),
|
9820
9920
|
onBlur: () => setFocus(false)
|
9821
|
-
})), !readOnly && /* @__PURE__ */
|
9921
|
+
})), !readOnly && /* @__PURE__ */ React52.createElement(Select.Toggle, {
|
9822
9922
|
disabled,
|
9823
9923
|
isOpen,
|
9824
9924
|
tabIndex: -1
|
9825
9925
|
}));
|
9826
9926
|
const menuProps = getMenuProps({ ref: menuRef }, { suppressRefError: !isOpen });
|
9827
|
-
return /* @__PURE__ */
|
9927
|
+
return /* @__PURE__ */ React52.createElement("div", {
|
9828
9928
|
className: classNames("Aquarium-SelectBase", tw("relative"))
|
9829
|
-
}, labelWrapper ?
|
9929
|
+
}, labelWrapper ? React52.cloneElement(labelWrapper, { children: input }) : input, isOpen && /* @__PURE__ */ React52.createElement(PopoverOverlay, {
|
9830
9930
|
state,
|
9831
9931
|
triggerRef: targetRef,
|
9832
9932
|
placement: "bottom-left",
|
9833
9933
|
shouldFlip: true,
|
9834
9934
|
style: { width: (_b = targetRef.current) == null ? void 0 : _b.offsetWidth }
|
9835
|
-
}, /* @__PURE__ */
|
9935
|
+
}, /* @__PURE__ */ React52.createElement(Select.Menu, __spreadValues({
|
9836
9936
|
ref: menuRef,
|
9837
9937
|
maxHeight
|
9838
|
-
}, menuProps), options.length === 0 && /* @__PURE__ */
|
9938
|
+
}, menuProps), options.length === 0 && /* @__PURE__ */ React52.createElement(Select.EmptyStateContainer, null, emptyState), options.length > 0 && !hasOptionGroups(options) && options.map(renderItem3), options.length > 0 && hasOptionGroups(options) && options.map(renderGroup), actions.length > 0 && /* @__PURE__ */ React52.createElement(React52.Fragment, null, /* @__PURE__ */ React52.createElement(Select.Divider, {
|
9839
9939
|
onMouseOver: () => setHighlightedIndex(-1)
|
9840
|
-
}), actions.map((act, index) => /* @__PURE__ */
|
9940
|
+
}), actions.map((act, index) => /* @__PURE__ */ React52.createElement(Select.ActionItem, __spreadProps(__spreadValues({
|
9841
9941
|
key: `${index}`
|
9842
9942
|
}, act), {
|
9843
9943
|
onMouseOver: () => setHighlightedIndex(-1),
|
@@ -9847,10 +9947,10 @@ var _SelectBase = (props) => {
|
|
9847
9947
|
}
|
9848
9948
|
}), act.label))))));
|
9849
9949
|
};
|
9850
|
-
var SelectBase = (props) => /* @__PURE__ */
|
9950
|
+
var SelectBase = (props) => /* @__PURE__ */ React52.createElement(_SelectBase, __spreadProps(__spreadValues({}, props), {
|
9851
9951
|
labelWrapper: void 0
|
9852
9952
|
}));
|
9853
|
-
var SelectBaseSkeleton = () => /* @__PURE__ */
|
9953
|
+
var SelectBaseSkeleton = () => /* @__PURE__ */ React52.createElement(Skeleton, {
|
9854
9954
|
height: 38
|
9855
9955
|
});
|
9856
9956
|
SelectBase.Skeleton = SelectBaseSkeleton;
|
@@ -9868,21 +9968,21 @@ var Select2 = (_a) => {
|
|
9868
9968
|
const baseProps = omit8(props, Object.keys(labelProps));
|
9869
9969
|
const legacyError = labelProps.error !== void 0 && labelProps.valid === false;
|
9870
9970
|
const variant = !labelProps.valid || legacyError ? "error" : labelProps.disabled ? "disabled" : "default";
|
9871
|
-
const label = /* @__PURE__ */
|
9971
|
+
const label = /* @__PURE__ */ React52.createElement(Label, __spreadValues({
|
9872
9972
|
id: `${id.current}-label`,
|
9873
9973
|
htmlFor: `${id.current}-input`,
|
9874
9974
|
variant,
|
9875
9975
|
messageId: errorMessageId
|
9876
9976
|
}, labelProps));
|
9877
|
-
return /* @__PURE__ */
|
9977
|
+
return /* @__PURE__ */ React52.createElement(FormControl, {
|
9878
9978
|
className: "Aquarium-Select"
|
9879
|
-
}, /* @__PURE__ */
|
9979
|
+
}, /* @__PURE__ */ React52.createElement(_SelectBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
|
9880
9980
|
id: `${id.current}-input`,
|
9881
9981
|
options,
|
9882
9982
|
disabled: props.disabled,
|
9883
9983
|
valid: props.valid,
|
9884
9984
|
labelWrapper: label
|
9885
|
-
})), /* @__PURE__ */
|
9985
|
+
})), /* @__PURE__ */ React52.createElement(HelperText, {
|
9886
9986
|
messageId: errorMessageId,
|
9887
9987
|
error: !labelProps.valid,
|
9888
9988
|
helperText: labelProps.helperText,
|
@@ -9891,7 +9991,7 @@ var Select2 = (_a) => {
|
|
9891
9991
|
reserveSpaceForError: labelProps.reserveSpaceForError
|
9892
9992
|
}));
|
9893
9993
|
};
|
9894
|
-
var SelectSkeleton = () => /* @__PURE__ */
|
9994
|
+
var SelectSkeleton = () => /* @__PURE__ */ React52.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React52.createElement(SelectBase.Skeleton, null));
|
9895
9995
|
Select2.Skeleton = SelectSkeleton;
|
9896
9996
|
Select2.Skeleton.displayName = "Select.Skeleton";
|
9897
9997
|
|
@@ -9910,26 +10010,26 @@ var Pagination = ({
|
|
9910
10010
|
pageSizes,
|
9911
10011
|
onPageSizeChange
|
9912
10012
|
}) => {
|
9913
|
-
const [value, setValue] =
|
9914
|
-
|
10013
|
+
const [value, setValue] = React53.useState(currentPage);
|
10014
|
+
React53.useEffect(() => {
|
9915
10015
|
setValue(currentPage);
|
9916
10016
|
}, [currentPage]);
|
9917
|
-
return /* @__PURE__ */
|
10017
|
+
return /* @__PURE__ */ React53.createElement(Box, {
|
9918
10018
|
className: classNames(
|
9919
10019
|
"Aquarium-Pagination",
|
9920
10020
|
tw({ "grid grid-cols-[200px_1fr_200px]": !!pageSizes, "flex flex-nowrap justify-center": !pageSizes })
|
9921
10021
|
),
|
9922
10022
|
backgroundColor: "grey-0",
|
9923
10023
|
padding: "4"
|
9924
|
-
}, pageSizes && onPageSizeChange && typeof pageSize === "number" ? /* @__PURE__ */
|
10024
|
+
}, pageSizes && onPageSizeChange && typeof pageSize === "number" ? /* @__PURE__ */ React53.createElement(Box, {
|
9925
10025
|
display: "flex",
|
9926
10026
|
alignItems: "center",
|
9927
10027
|
gap: "4"
|
9928
|
-
}, /* @__PURE__ */
|
10028
|
+
}, /* @__PURE__ */ React53.createElement(Typography2.Small, {
|
9929
10029
|
color: "grey-50"
|
9930
|
-
}, "Items per page "), /* @__PURE__ */
|
10030
|
+
}, "Items per page "), /* @__PURE__ */ React53.createElement("div", {
|
9931
10031
|
className: tw("max-w-[70px]")
|
9932
|
-
}, /* @__PURE__ */
|
10032
|
+
}, /* @__PURE__ */ React53.createElement(SelectBase, {
|
9933
10033
|
options: pageSizes.map((size) => size.toString()),
|
9934
10034
|
value: pageSize.toString(),
|
9935
10035
|
onChange: (size) => {
|
@@ -9940,26 +10040,26 @@ var Pagination = ({
|
|
9940
10040
|
}
|
9941
10041
|
}
|
9942
10042
|
}
|
9943
|
-
}))) : /* @__PURE__ */
|
10043
|
+
}))) : /* @__PURE__ */ React53.createElement("div", null), /* @__PURE__ */ React53.createElement(Box, {
|
9944
10044
|
display: "flex",
|
9945
10045
|
justifyContent: "center",
|
9946
10046
|
alignItems: "center",
|
9947
10047
|
className: tw("grow")
|
9948
|
-
}, /* @__PURE__ */
|
10048
|
+
}, /* @__PURE__ */ React53.createElement(Button.Icon, {
|
9949
10049
|
"aria-label": "First",
|
9950
10050
|
onClick: () => onPageChange(1),
|
9951
10051
|
icon: import_chevronBackward2.default,
|
9952
10052
|
disabled: !hasPreviousPage
|
9953
|
-
}), /* @__PURE__ */
|
10053
|
+
}), /* @__PURE__ */ React53.createElement(Button.Icon, {
|
9954
10054
|
"aria-label": "Previous",
|
9955
10055
|
onClick: () => onPageChange(currentPage - 1),
|
9956
10056
|
icon: import_chevronLeft3.default,
|
9957
10057
|
disabled: !hasPreviousPage
|
9958
|
-
}), /* @__PURE__ */
|
10058
|
+
}), /* @__PURE__ */ React53.createElement(Box, {
|
9959
10059
|
paddingX: "4"
|
9960
|
-
}, /* @__PURE__ */
|
10060
|
+
}, /* @__PURE__ */ React53.createElement(Typography2.Small, {
|
9961
10061
|
color: "grey-60"
|
9962
|
-
}, "Page")), /* @__PURE__ */
|
10062
|
+
}, "Page")), /* @__PURE__ */ React53.createElement(InputBase, {
|
9963
10063
|
className: classNames(tw("text-center max-w-[40px]"), "no-arrows"),
|
9964
10064
|
type: "number",
|
9965
10065
|
min: 1,
|
@@ -9976,21 +10076,21 @@ var Pagination = ({
|
|
9976
10076
|
const newPage = !isNaN(numberValue) ? clamp(numberValue, 1, totalPages) : 1;
|
9977
10077
|
onPageChange(newPage);
|
9978
10078
|
}
|
9979
|
-
}), /* @__PURE__ */
|
10079
|
+
}), /* @__PURE__ */ React53.createElement(Box, {
|
9980
10080
|
paddingX: "4"
|
9981
|
-
}, /* @__PURE__ */
|
10081
|
+
}, /* @__PURE__ */ React53.createElement(Typography2.Small, {
|
9982
10082
|
color: "grey-60"
|
9983
|
-
}, "of ", totalPages)), /* @__PURE__ */
|
10083
|
+
}, "of ", totalPages)), /* @__PURE__ */ React53.createElement(Button.Icon, {
|
9984
10084
|
"aria-label": "Next",
|
9985
10085
|
onClick: () => onPageChange(currentPage + 1),
|
9986
10086
|
icon: import_chevronRight3.default,
|
9987
10087
|
disabled: !hasNextPage
|
9988
|
-
}), /* @__PURE__ */
|
10088
|
+
}), /* @__PURE__ */ React53.createElement(Button.Icon, {
|
9989
10089
|
"aria-label": "Last",
|
9990
10090
|
onClick: () => onPageChange(totalPages),
|
9991
10091
|
icon: import_chevronForward2.default,
|
9992
10092
|
disabled: !hasNextPage
|
9993
|
-
})), pageSizes && /* @__PURE__ */
|
10093
|
+
})), pageSizes && /* @__PURE__ */ React53.createElement("div", null));
|
9994
10094
|
};
|
9995
10095
|
|
9996
10096
|
// src/molecules/Pagination/usePagination.tsx
|
@@ -10030,6 +10130,22 @@ var usePagination = (items, options) => {
|
|
10030
10130
|
];
|
10031
10131
|
};
|
10032
10132
|
|
10133
|
+
// src/molecules/List/List.tsx
|
10134
|
+
var List2 = ({
|
10135
|
+
items,
|
10136
|
+
renderItem: renderItem3,
|
10137
|
+
container = React54.Fragment,
|
10138
|
+
paginationContainer = React54.Fragment,
|
10139
|
+
pagination
|
10140
|
+
}) => {
|
10141
|
+
const Component = container;
|
10142
|
+
const PaginationComponent = paginationContainer;
|
10143
|
+
const paginationProps = isObject(pagination) ? pagination : {};
|
10144
|
+
const [paginatedItems, paginationState] = usePagination(items, paginationProps);
|
10145
|
+
const listItems = pagination ? paginatedItems : items;
|
10146
|
+
return /* @__PURE__ */ React54.createElement(React54.Fragment, null, /* @__PURE__ */ React54.createElement(Component, null, listItems.map(renderItem3)), pagination && /* @__PURE__ */ React54.createElement(PaginationComponent, null, /* @__PURE__ */ React54.createElement(Pagination, __spreadValues({}, paginationState))));
|
10147
|
+
};
|
10148
|
+
|
10033
10149
|
// src/molecules/Template/Template.tsx
|
10034
10150
|
import React55 from "react";
|
10035
10151
|
var Template = ({
|
@@ -10391,7 +10507,7 @@ var DataListSkeleton = ({ columns = ["1", "2", "2", 52], rows = 5 }) => {
|
|
10391
10507
|
// src/molecules/DataList/DataList.tsx
|
10392
10508
|
var DataList2 = ({
|
10393
10509
|
columns,
|
10394
|
-
rows
|
10510
|
+
rows,
|
10395
10511
|
sticky,
|
10396
10512
|
menu,
|
10397
10513
|
menuLabel,
|
@@ -10399,45 +10515,50 @@ var DataList2 = ({
|
|
10399
10515
|
menuHeaderName = "Actions",
|
10400
10516
|
onAction,
|
10401
10517
|
onMenuOpenChange,
|
10402
|
-
pagination
|
10518
|
+
pagination
|
10403
10519
|
}) => {
|
10404
10520
|
const [sort, updateSort] = useTableSort();
|
10405
|
-
const sortedRows = sortRowsBy(
|
10406
|
-
const _a = isObject(_pagination) ? _pagination : {}, { initialPage, initialPageSize } = _a, paginationProps = __objRest(_a, ["initialPage", "initialPageSize"]);
|
10407
|
-
const [paginatedItems, paginationState] = usePagination(sortedRows, { initialPage, initialPageSize });
|
10408
|
-
const rows = _pagination ? paginatedItems : sortedRows;
|
10521
|
+
const sortedRows = sortRowsBy(rows, sort);
|
10409
10522
|
const templateColumns = compact([
|
10410
10523
|
...columns.map((column) => {
|
10411
|
-
var
|
10412
|
-
return (
|
10524
|
+
var _a;
|
10525
|
+
return (_a = column.width) != null ? _a : "auto";
|
10413
10526
|
}),
|
10414
10527
|
menu ? "auto" : void 0
|
10415
10528
|
]);
|
10416
|
-
const
|
10529
|
+
const PaginationFooter = React61.useCallback(
|
10530
|
+
({ children }) => /* @__PURE__ */ React61.createElement("div", {
|
10531
|
+
style: { gridColumn: `span ${templateColumns.length}` }
|
10532
|
+
}, children),
|
10533
|
+
[templateColumns.length]
|
10534
|
+
);
|
10535
|
+
return /* @__PURE__ */ React61.createElement(Template, {
|
10417
10536
|
className: "Aquarium-DataList",
|
10418
10537
|
columns: templateColumns
|
10419
|
-
}, columns.map(
|
10420
|
-
|
10538
|
+
}, columns.map((column) => {
|
10539
|
+
const content = column.headerTooltip ? /* @__PURE__ */ React61.createElement(Tooltip, {
|
10540
|
+
placement: column.headerTooltip.placement,
|
10541
|
+
content: column.headerTooltip.content
|
10542
|
+
}, column.headerName) : column.headerName;
|
10543
|
+
return columnIsFieldColumn(column) && column.sortable || column.sort ? /* @__PURE__ */ React61.createElement(DataList.SortCell, __spreadValues({
|
10421
10544
|
direction: sort && sort.column.headerName === column.headerName ? sort.direction : "none",
|
10422
10545
|
onClick: () => updateSort(column),
|
10423
10546
|
sticky
|
10424
|
-
}, cellProps(column)),
|
10547
|
+
}, cellProps(column)), content) : /* @__PURE__ */ React61.createElement(DataList.HeadCell, __spreadProps(__spreadValues({}, cellProps(column)), {
|
10425
10548
|
sticky
|
10426
|
-
}),
|
10427
|
-
), menu && /* @__PURE__ */ React61.createElement(DataList.HeadCell, {
|
10549
|
+
}), content);
|
10550
|
+
}), menu && /* @__PURE__ */ React61.createElement(DataList.HeadCell, {
|
10428
10551
|
align: "right",
|
10429
10552
|
"aria-label": menuAriaLabel
|
10430
10553
|
}, menuHeaderName), /* @__PURE__ */ React61.createElement(List2, {
|
10431
|
-
|
10554
|
+
pagination,
|
10555
|
+
paginationContainer: PaginationFooter,
|
10556
|
+
items: sortedRows,
|
10432
10557
|
renderItem: (row, index) => /* @__PURE__ */ React61.createElement(DataList.Row, {
|
10433
10558
|
key: row.id
|
10434
10559
|
}, /* @__PURE__ */ React61.createElement(List2, {
|
10435
10560
|
items: columns,
|
10436
|
-
renderItem: (column) =>
|
10437
|
-
dense: true
|
10438
|
-
}, column.status(row, index, sortedRows)))) : column.type === "action" ? /* @__PURE__ */ React61.createElement(DataList.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React61.createElement(Button.Secondary, __spreadValues({
|
10439
|
-
dense: true
|
10440
|
-
}, renameProperty("text", "children", column.action(row, index, sortedRows))))) : column.type === "custom" ? /* @__PURE__ */ React61.createElement(DataList.Cell, __spreadValues({}, cellProps(column)), column.UNSAFE_render(row, index, sortedRows)) : column.type === "item" ? /* @__PURE__ */ React61.createElement(DataList.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React61.createElement(Item4, __spreadValues({}, column.item(row, index, sortedRows)))) : /* @__PURE__ */ React61.createElement(DataList.Cell, __spreadValues({}, cellProps(column)), column.formatter ? column.formatter(row[column.field], row, index, sortedRows) : row[column.field])
|
10561
|
+
renderItem: (column) => /* @__PURE__ */ React61.createElement(DataList.Cell, __spreadValues({}, cellProps(column)), renderItem(column, row, index, sortedRows))
|
10441
10562
|
}), menu && /* @__PURE__ */ React61.createElement(DataList.Cell, {
|
10442
10563
|
align: "right"
|
10443
10564
|
}, /* @__PURE__ */ React61.createElement(DropdownMenu2, {
|
@@ -10448,7 +10569,14 @@ var DataList2 = ({
|
|
10448
10569
|
icon: import_more2.default
|
10449
10570
|
})), isFunction(menu) ? menu(row, index) : menu)))
|
10450
10571
|
}));
|
10451
|
-
|
10572
|
+
};
|
10573
|
+
var renderItem = (column, row, index, sortedRows) => {
|
10574
|
+
const cellContent = column.type === "status" ? /* @__PURE__ */ React61.createElement(StatusChip, __spreadValues({
|
10575
|
+
dense: true
|
10576
|
+
}, column.status(row, index, sortedRows))) : column.type === "action" ? /* @__PURE__ */ React61.createElement(Button.Secondary, __spreadValues({
|
10577
|
+
dense: true
|
10578
|
+
}, renameProperty("text", "children", column.action(row, index, sortedRows)))) : column.type === "custom" ? column.UNSAFE_render(row, index, sortedRows) : column.type === "item" ? /* @__PURE__ */ React61.createElement(Item4, __spreadValues({}, column.item(row, index, sortedRows))) : column.formatter ? column.formatter(row[column.field], row, index, sortedRows) : row[column.field];
|
10579
|
+
return column.tooltip ? /* @__PURE__ */ React61.createElement(Tooltip, __spreadValues({}, column.tooltip(row, index, sortedRows)), cellContent) : cellContent;
|
10452
10580
|
};
|
10453
10581
|
DataList2.Skeleton = DataListSkeleton;
|
10454
10582
|
|
@@ -10456,7 +10584,6 @@ DataList2.Skeleton = DataListSkeleton;
|
|
10456
10584
|
import React64 from "react";
|
10457
10585
|
import compact2 from "lodash/compact";
|
10458
10586
|
import isFunction2 from "lodash/isFunction";
|
10459
|
-
import isObject2 from "lodash/isObject";
|
10460
10587
|
|
10461
10588
|
// src/molecules/Table/Table.tsx
|
10462
10589
|
import React63 from "react";
|
@@ -10505,7 +10632,7 @@ var import_more3 = __toESM(require_more());
|
|
10505
10632
|
var DataTable = (_a) => {
|
10506
10633
|
var _b = _a, {
|
10507
10634
|
columns,
|
10508
|
-
rows
|
10635
|
+
rows,
|
10509
10636
|
noWrap = false,
|
10510
10637
|
layout = "auto",
|
10511
10638
|
sticky,
|
@@ -10515,7 +10642,7 @@ var DataTable = (_a) => {
|
|
10515
10642
|
menuHeaderName = "Actions",
|
10516
10643
|
onAction,
|
10517
10644
|
onMenuOpenChange,
|
10518
|
-
pagination
|
10645
|
+
pagination
|
10519
10646
|
} = _b, rest = __objRest(_b, [
|
10520
10647
|
"columns",
|
10521
10648
|
"rows",
|
@@ -10531,11 +10658,15 @@ var DataTable = (_a) => {
|
|
10531
10658
|
"pagination"
|
10532
10659
|
]);
|
10533
10660
|
const [sort, updateSort] = useTableSort();
|
10534
|
-
const sortedRows = sortRowsBy(
|
10535
|
-
const
|
10536
|
-
const
|
10537
|
-
|
10538
|
-
|
10661
|
+
const sortedRows = sortRowsBy(rows, sort);
|
10662
|
+
const amountOfColumns = columns.length + (menu ? 1 : 0);
|
10663
|
+
const PaginationFooter = React64.useCallback(
|
10664
|
+
({ children }) => /* @__PURE__ */ React64.createElement("tfoot", null, /* @__PURE__ */ React64.createElement("tr", null, /* @__PURE__ */ React64.createElement("td", {
|
10665
|
+
colSpan: amountOfColumns
|
10666
|
+
}, children))),
|
10667
|
+
[amountOfColumns]
|
10668
|
+
);
|
10669
|
+
return /* @__PURE__ */ React64.createElement(Table2, __spreadProps(__spreadValues({}, rest), {
|
10539
10670
|
className: classNames(
|
10540
10671
|
"Aquarium-DataTable",
|
10541
10672
|
tw({
|
@@ -10547,33 +10678,36 @@ var DataTable = (_a) => {
|
|
10547
10678
|
}), /* @__PURE__ */ React64.createElement(Table2.Head, {
|
10548
10679
|
sticky
|
10549
10680
|
}, compact2([
|
10550
|
-
...columns.map(
|
10551
|
-
|
10681
|
+
...columns.map((column) => {
|
10682
|
+
const content = column.headerTooltip && !column.headerInvisible ? /* @__PURE__ */ React64.createElement(Tooltip, {
|
10683
|
+
placement: column.headerTooltip.placement,
|
10684
|
+
content: column.headerTooltip.content
|
10685
|
+
}, column.headerName) : !column.headerInvisible && column.headerName;
|
10686
|
+
return columnIsFieldColumn(column) && column.sortable || column.sort ? /* @__PURE__ */ React64.createElement(Table2.SortCell, __spreadValues({
|
10552
10687
|
direction: sort && sort.column.headerName === column.headerName ? sort.direction : "none",
|
10553
10688
|
onClick: () => updateSort(column),
|
10554
10689
|
style: { width: column.width },
|
10555
10690
|
"aria-label": column.headerInvisible ? column.headerName : void 0
|
10556
|
-
}, cellProps(column)),
|
10691
|
+
}, cellProps(column)), content) : /* @__PURE__ */ React64.createElement(Table2.Cell, __spreadProps(__spreadValues({}, cellProps(column)), {
|
10557
10692
|
style: { width: column.width },
|
10558
10693
|
"aria-label": column.headerInvisible ? column.headerName : void 0
|
10559
|
-
}),
|
10560
|
-
),
|
10694
|
+
}), content);
|
10695
|
+
}),
|
10561
10696
|
menu ? /* @__PURE__ */ React64.createElement(Table2.Cell, {
|
10562
10697
|
key: "__contextMenu",
|
10563
10698
|
align: "right",
|
10564
10699
|
"aria-label": menuAriaLabel
|
10565
10700
|
}, menuHeaderName) : null
|
10566
|
-
])), /* @__PURE__ */ React64.createElement(
|
10567
|
-
|
10701
|
+
])), /* @__PURE__ */ React64.createElement(List2, {
|
10702
|
+
container: Table2.Body,
|
10703
|
+
paginationContainer: PaginationFooter,
|
10704
|
+
pagination,
|
10705
|
+
items: sortedRows,
|
10568
10706
|
renderItem: (row, index) => /* @__PURE__ */ React64.createElement(Table2.Row, {
|
10569
10707
|
key: row.id
|
10570
10708
|
}, /* @__PURE__ */ React64.createElement(List2, {
|
10571
10709
|
items: columns,
|
10572
|
-
renderItem: (column) =>
|
10573
|
-
dense: true
|
10574
|
-
}, column.status(row, index, sortedRows)))) : column.type === "action" ? /* @__PURE__ */ React64.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React64.createElement(Button.Secondary, __spreadValues({
|
10575
|
-
dense: true
|
10576
|
-
}, renameProperty("text", "children", column.action(row, index, sortedRows))))) : column.type === "custom" ? /* @__PURE__ */ React64.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), column.UNSAFE_render(row, index, sortedRows)) : column.type === "item" ? /* @__PURE__ */ React64.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React64.createElement(Item4, __spreadValues({}, column.item(row, index, sortedRows)))) : /* @__PURE__ */ React64.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), column.formatter ? column.formatter(row[column.field], row, index, sortedRows) : row[column.field])
|
10710
|
+
renderItem: (column) => /* @__PURE__ */ React64.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), renderItem2(column, row, index, sortedRows))
|
10577
10711
|
}), menu && /* @__PURE__ */ React64.createElement(Table2.Cell, {
|
10578
10712
|
align: "right"
|
10579
10713
|
}, /* @__PURE__ */ React64.createElement(DropdownMenu2, {
|
@@ -10583,8 +10717,15 @@ var DataTable = (_a) => {
|
|
10583
10717
|
"aria-label": menuAriaLabel,
|
10584
10718
|
icon: import_more3.default
|
10585
10719
|
})), isFunction2(menu) ? menu(row, index) : menu)))
|
10586
|
-
}))
|
10587
|
-
|
10720
|
+
}));
|
10721
|
+
};
|
10722
|
+
var renderItem2 = (column, row, index, sortedRows) => {
|
10723
|
+
const cellContent = column.type === "status" ? /* @__PURE__ */ React64.createElement(StatusChip, __spreadValues({
|
10724
|
+
dense: true
|
10725
|
+
}, column.status(row, index, sortedRows))) : column.type === "action" ? /* @__PURE__ */ React64.createElement(Button.Secondary, __spreadValues({
|
10726
|
+
dense: true
|
10727
|
+
}, renameProperty("text", "children", column.action(row, index, sortedRows)))) : column.type === "custom" ? column.UNSAFE_render(row, index, sortedRows) : column.type === "item" ? /* @__PURE__ */ React64.createElement(Item4, __spreadValues({}, column.item(row, index, sortedRows))) : column.formatter ? column.formatter(row[column.field], row, index, sortedRows) : row[column.field];
|
10728
|
+
return column.tooltip ? /* @__PURE__ */ React64.createElement(Tooltip, __spreadValues({}, column.tooltip(row, index, sortedRows)), cellContent) : cellContent;
|
10588
10729
|
};
|
10589
10730
|
DataTable.Skeleton = DataListSkeleton;
|
10590
10731
|
|
@@ -10751,17 +10892,19 @@ var DialogWrapper = ({
|
|
10751
10892
|
ref
|
10752
10893
|
}, dialogProps), {
|
10753
10894
|
className: tw("outline-none")
|
10754
|
-
}), /* @__PURE__ */ React66.createElement(Modal.Header,
|
10895
|
+
}), /* @__PURE__ */ React66.createElement(Modal.Header, {
|
10896
|
+
className: tw("icon-stroke-2")
|
10897
|
+
}, /* @__PURE__ */ React66.createElement(Icon, {
|
10755
10898
|
icon: DIALOG_ICONS_AND_COLORS[type].icon,
|
10756
10899
|
color: DIALOG_ICONS_AND_COLORS[type].color,
|
10757
10900
|
fontSize: 20
|
10758
10901
|
}), /* @__PURE__ */ React66.createElement(Modal.Title, {
|
10759
10902
|
id: labelledBy,
|
10760
|
-
variant: "large
|
10903
|
+
variant: "large",
|
10761
10904
|
color: DIALOG_ICONS_AND_COLORS[type].color
|
10762
10905
|
}, title)), /* @__PURE__ */ React66.createElement(Modal.Body, {
|
10763
10906
|
id: describedBy
|
10764
|
-
}, children), /* @__PURE__ */ React66.createElement(Modal.Footer, null, /* @__PURE__ */ React66.createElement(Modal.Actions, null, secondaryAction && /* @__PURE__ */ React66.createElement(Button.Ghost, __spreadValues({
|
10907
|
+
}, /* @__PURE__ */ React66.createElement(Typography2.Default, null, children)), /* @__PURE__ */ React66.createElement(Modal.Footer, null, /* @__PURE__ */ React66.createElement(Modal.Actions, null, secondaryAction && /* @__PURE__ */ React66.createElement(Button.Ghost, __spreadValues({
|
10765
10908
|
key: secondaryAction.text
|
10766
10909
|
}, omit9(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */ React66.createElement(Button.Secondary, __spreadValues({
|
10767
10910
|
key: primaryAction.text
|
@@ -11036,8 +11179,22 @@ Dropdown.Menu = DropdownMenu3;
|
|
11036
11179
|
Dropdown.Item = DropdownItem;
|
11037
11180
|
|
11038
11181
|
// src/molecules/EmptyState/EmptyState.tsx
|
11182
|
+
import React72 from "react";
|
11183
|
+
|
11184
|
+
// src/utils/actions.tsx
|
11039
11185
|
import React71 from "react";
|
11040
11186
|
import omit10 from "lodash/omit";
|
11187
|
+
var renderAction = (kind = "primary", action) => {
|
11188
|
+
return isLink(action) ? /* @__PURE__ */ React71.createElement(Button.ExternalLink, __spreadValues({
|
11189
|
+
key: action.text,
|
11190
|
+
kind
|
11191
|
+
}, omit10(action, "text")), action.text) : /* @__PURE__ */ React71.createElement(Button, __spreadValues({
|
11192
|
+
key: action.text,
|
11193
|
+
kind
|
11194
|
+
}, omit10(action, "text")), action.text);
|
11195
|
+
};
|
11196
|
+
|
11197
|
+
// src/molecules/EmptyState/EmptyState.tsx
|
11041
11198
|
var EmptyStateLayout = /* @__PURE__ */ ((EmptyStateLayout2) => {
|
11042
11199
|
EmptyStateLayout2["Vertical"] = "vertical";
|
11043
11200
|
EmptyStateLayout2["Horizontal"] = "horizontal";
|
@@ -11094,7 +11251,7 @@ var EmptyState = ({
|
|
11094
11251
|
fullHeight = isVerticalLayout(layout) ? true : false
|
11095
11252
|
}) => {
|
11096
11253
|
const template = layoutStyle(layout);
|
11097
|
-
return /* @__PURE__ */
|
11254
|
+
return /* @__PURE__ */ React72.createElement(Box, {
|
11098
11255
|
className: classNames(
|
11099
11256
|
"Aquarium-EmptyState",
|
11100
11257
|
tw("rounded p-[56px]", {
|
@@ -11107,45 +11264,39 @@ var EmptyState = ({
|
|
11107
11264
|
),
|
11108
11265
|
backgroundColor: "transparent",
|
11109
11266
|
borderColor: "grey-10"
|
11110
|
-
}, /* @__PURE__ */
|
11267
|
+
}, /* @__PURE__ */ React72.createElement(Box.Flex, {
|
11111
11268
|
style: { gap: "56px" },
|
11112
11269
|
flexDirection: template.layout,
|
11113
11270
|
justifyContent: template.justifyContent,
|
11114
11271
|
alignItems: template.layout === "row" ? "center" : template.alignItems,
|
11115
11272
|
height: fullHeight ? "full" : void 0
|
11116
|
-
}, image && /* @__PURE__ */
|
11273
|
+
}, image && /* @__PURE__ */ React72.createElement("img", {
|
11117
11274
|
src: image,
|
11118
11275
|
alt: imageAlt,
|
11119
11276
|
style: { width: imageWidth ? `${imageWidth}px` : void 0, height: "auto" }
|
11120
|
-
}), /* @__PURE__ */
|
11277
|
+
}), /* @__PURE__ */ React72.createElement(Box.Flex, {
|
11121
11278
|
flexDirection: "column",
|
11122
11279
|
justifyContent: template.justifyContent,
|
11123
11280
|
alignItems: template.alignItems
|
11124
|
-
}, /* @__PURE__ */
|
11281
|
+
}, /* @__PURE__ */ React72.createElement(Typography2.Heading, {
|
11125
11282
|
htmlTag: "h2"
|
11126
|
-
}, title), (description || children) && /* @__PURE__ */
|
11283
|
+
}, title), (description || children) && /* @__PURE__ */ React72.createElement(Box, {
|
11127
11284
|
marginTop: "5"
|
11128
|
-
}, /* @__PURE__ */
|
11129
|
-
color: "grey-60"
|
11130
|
-
}, children || description)), (secondaryAction || primaryAction) && /* @__PURE__ */ React71.createElement(Box.Flex, {
|
11285
|
+
}, /* @__PURE__ */ React72.createElement(Typography2.Default, null, children || description)), (secondaryAction || primaryAction) && /* @__PURE__ */ React72.createElement(Box.Flex, {
|
11131
11286
|
marginTop: "7",
|
11132
11287
|
gap: "4",
|
11133
11288
|
justifyContent: "center",
|
11134
11289
|
alignItems: "center",
|
11135
11290
|
wrap: "wrap"
|
11136
|
-
}, primaryAction &&
|
11137
|
-
kind: "primary"
|
11138
|
-
}, omit10(primaryAction, "text")), primaryAction.text)), secondaryAction && /* @__PURE__ */ React71.createElement(React71.Fragment, null, !isLink(secondaryAction) && /* @__PURE__ */ React71.createElement(Button.Secondary, __spreadValues({}, omit10(secondaryAction, "text")), secondaryAction.text), isLink(secondaryAction) && /* @__PURE__ */ React71.createElement(Button.ExternalLink, __spreadValues({
|
11139
|
-
kind: "secondary"
|
11140
|
-
}, omit10(secondaryAction, "text")), secondaryAction.text))), footer && /* @__PURE__ */ React71.createElement(Box, {
|
11291
|
+
}, primaryAction && renderAction("primary", primaryAction), secondaryAction && renderAction("secondary", secondaryAction)), footer && /* @__PURE__ */ React72.createElement(Box, {
|
11141
11292
|
marginTop: "5"
|
11142
|
-
}, /* @__PURE__ */
|
11293
|
+
}, /* @__PURE__ */ React72.createElement(Typography2.Small, {
|
11143
11294
|
color: "grey-60"
|
11144
11295
|
}, footer)))));
|
11145
11296
|
};
|
11146
11297
|
|
11147
11298
|
// src/molecules/Flexbox/FlexboxItem.tsx
|
11148
|
-
import
|
11299
|
+
import React73 from "react";
|
11149
11300
|
var FlexboxItem = Tailwindify(
|
11150
11301
|
({ htmlTag = "div", className, style, children, display, flex, grow, shrink, order, alignSelf }) => {
|
11151
11302
|
const hookStyle = useStyle({
|
@@ -11157,7 +11308,7 @@ var FlexboxItem = Tailwindify(
|
|
11157
11308
|
alignSelf
|
11158
11309
|
});
|
11159
11310
|
const HtmlElement = htmlTag;
|
11160
|
-
return /* @__PURE__ */
|
11311
|
+
return /* @__PURE__ */ React73.createElement(HtmlElement, {
|
11161
11312
|
style: __spreadValues(__spreadValues({}, hookStyle), style),
|
11162
11313
|
className
|
11163
11314
|
}, children);
|
@@ -11165,8 +11316,8 @@ var FlexboxItem = Tailwindify(
|
|
11165
11316
|
);
|
11166
11317
|
|
11167
11318
|
// src/molecules/Grid/GridItem.tsx
|
11168
|
-
import
|
11169
|
-
var
|
11319
|
+
import React74 from "react";
|
11320
|
+
var GridItem2 = Tailwindify(
|
11170
11321
|
({
|
11171
11322
|
htmlTag = "div",
|
11172
11323
|
className,
|
@@ -11196,7 +11347,7 @@ var GridItem = Tailwindify(
|
|
11196
11347
|
gridRowEnd: rowEnd
|
11197
11348
|
});
|
11198
11349
|
const HtmlElement = htmlTag;
|
11199
|
-
return /* @__PURE__ */
|
11350
|
+
return /* @__PURE__ */ React74.createElement(HtmlElement, {
|
11200
11351
|
style: __spreadValues(__spreadValues({}, hookStyle), style),
|
11201
11352
|
className
|
11202
11353
|
}, children);
|
@@ -11204,7 +11355,7 @@ var GridItem = Tailwindify(
|
|
11204
11355
|
);
|
11205
11356
|
|
11206
11357
|
// src/molecules/LineClamp/LineClamp.tsx
|
11207
|
-
import
|
11358
|
+
import React75 from "react";
|
11208
11359
|
var LineClamp2 = ({
|
11209
11360
|
lines,
|
11210
11361
|
children,
|
@@ -11213,10 +11364,10 @@ var LineClamp2 = ({
|
|
11213
11364
|
collapseLabel,
|
11214
11365
|
onClampedChange
|
11215
11366
|
}) => {
|
11216
|
-
const ref =
|
11217
|
-
const [clamped, setClamped] =
|
11218
|
-
const [isClampingEnabled, setClampingEnabled] =
|
11219
|
-
|
11367
|
+
const ref = React75.useRef(null);
|
11368
|
+
const [clamped, setClamped] = React75.useState(true);
|
11369
|
+
const [isClampingEnabled, setClampingEnabled] = React75.useState(false);
|
11370
|
+
React75.useEffect(() => {
|
11220
11371
|
var _a, _b;
|
11221
11372
|
const el = ref.current;
|
11222
11373
|
setClampingEnabled(((_a = el == null ? void 0 : el.scrollHeight) != null ? _a : 0) > ((_b = el == null ? void 0 : el.clientHeight) != null ? _b : 0));
|
@@ -11225,28 +11376,28 @@ var LineClamp2 = ({
|
|
11225
11376
|
setClamped(!clamped);
|
11226
11377
|
onClampedChange == null ? void 0 : onClampedChange(!clamped);
|
11227
11378
|
};
|
11228
|
-
return /* @__PURE__ */
|
11379
|
+
return /* @__PURE__ */ React75.createElement("div", {
|
11229
11380
|
className: "Aquarium-LineClamp"
|
11230
|
-
}, /* @__PURE__ */
|
11381
|
+
}, /* @__PURE__ */ React75.createElement(LineClamp, {
|
11231
11382
|
ref,
|
11232
11383
|
lines,
|
11233
11384
|
clamped,
|
11234
11385
|
wordBreak
|
11235
|
-
}, children), expandLabel && isClampingEnabled && /* @__PURE__ */
|
11386
|
+
}, children), expandLabel && isClampingEnabled && /* @__PURE__ */ React75.createElement(Button.Ghost, {
|
11236
11387
|
dense: true,
|
11237
11388
|
onClick: handleClampedChange
|
11238
11389
|
}, clamped ? expandLabel : collapseLabel));
|
11239
11390
|
};
|
11240
11391
|
|
11241
11392
|
// src/molecules/Link/Link.tsx
|
11242
|
-
import
|
11393
|
+
import React77 from "react";
|
11243
11394
|
import classNames8 from "classnames";
|
11244
11395
|
|
11245
11396
|
// src/atoms/Link/Link.tsx
|
11246
|
-
import
|
11397
|
+
import React76 from "react";
|
11247
11398
|
var Link = (_a) => {
|
11248
11399
|
var _b = _a, { children, className } = _b, props = __objRest(_b, ["children", "className"]);
|
11249
|
-
return /* @__PURE__ */
|
11400
|
+
return /* @__PURE__ */ React76.createElement("a", __spreadValues({
|
11250
11401
|
className: classNames(className, linkStyle)
|
11251
11402
|
}, props), children);
|
11252
11403
|
};
|
@@ -11254,23 +11405,23 @@ var Link = (_a) => {
|
|
11254
11405
|
// src/molecules/Link/Link.tsx
|
11255
11406
|
var Link2 = (_a) => {
|
11256
11407
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
11257
|
-
return /* @__PURE__ */
|
11408
|
+
return /* @__PURE__ */ React77.createElement(Link, __spreadValues({
|
11258
11409
|
className: classNames8("Aquarium-Link", className)
|
11259
11410
|
}, props));
|
11260
11411
|
};
|
11261
11412
|
|
11262
11413
|
// src/molecules/ListItem/ListItem.tsx
|
11263
|
-
import
|
11414
|
+
import React78 from "react";
|
11264
11415
|
var ListItem = ({ name, icon, active = false }) => {
|
11265
|
-
return /* @__PURE__ */
|
11416
|
+
return /* @__PURE__ */ React78.createElement(Box.Flex, {
|
11266
11417
|
className: "Aquarium-ListItem",
|
11267
11418
|
alignItems: "center"
|
11268
|
-
}, /* @__PURE__ */
|
11419
|
+
}, /* @__PURE__ */ React78.createElement(Typography2, {
|
11269
11420
|
variant: active ? "small-strong" : "small",
|
11270
11421
|
color: "grey-70",
|
11271
11422
|
htmlTag: "span",
|
11272
11423
|
className: `px-4 py-2 rounded-full ${active ? "bg-grey-5" : "hover:bg-grey-0"}`
|
11273
|
-
}, /* @__PURE__ */
|
11424
|
+
}, /* @__PURE__ */ React78.createElement("img", {
|
11274
11425
|
src: icon,
|
11275
11426
|
alt: name,
|
11276
11427
|
className: "inline mr-4",
|
@@ -11280,7 +11431,7 @@ var ListItem = ({ name, icon, active = false }) => {
|
|
11280
11431
|
};
|
11281
11432
|
|
11282
11433
|
// src/molecules/Modal/Modal.tsx
|
11283
|
-
import
|
11434
|
+
import React80 from "react";
|
11284
11435
|
import { useDialog as useDialog3 } from "@react-aria/dialog";
|
11285
11436
|
import { Overlay as Overlay3, useModalOverlay as useModalOverlay2 } from "@react-aria/overlays";
|
11286
11437
|
import { useId as useId2 } from "@react-aria/utils";
|
@@ -11289,18 +11440,18 @@ import castArray from "lodash/castArray";
|
|
11289
11440
|
import omit11 from "lodash/omit";
|
11290
11441
|
|
11291
11442
|
// src/molecules/Tabs/Tabs.tsx
|
11292
|
-
import
|
11443
|
+
import React79, { useEffect as useEffect8, useLayoutEffect as useLayoutEffect2, useRef as useRef9, useState as useState9 } from "react";
|
11293
11444
|
import isNumber5 from "lodash/isNumber";
|
11294
11445
|
import kebabCase from "lodash/kebabCase";
|
11295
11446
|
var import_chevronLeft4 = __toESM(require_chevronLeft());
|
11296
11447
|
var import_chevronRight4 = __toESM(require_chevronRight());
|
11297
11448
|
var import_warningSign4 = __toESM(require_warningSign());
|
11298
11449
|
var isTabComponent = (c) => {
|
11299
|
-
return
|
11450
|
+
return React79.isValidElement(c) && (c.type === Tab || c.type === ModalTab);
|
11300
11451
|
};
|
11301
|
-
var Tab =
|
11452
|
+
var Tab = React79.forwardRef(
|
11302
11453
|
({ className, id, title, children }, ref) => {
|
11303
|
-
return /* @__PURE__ */
|
11454
|
+
return /* @__PURE__ */ React79.createElement("div", {
|
11304
11455
|
ref,
|
11305
11456
|
id: `${id != null ? id : kebabCase(title)}-panel`,
|
11306
11457
|
className,
|
@@ -11312,14 +11463,14 @@ var Tab = React78.forwardRef(
|
|
11312
11463
|
);
|
11313
11464
|
var TabContainer = (_a) => {
|
11314
11465
|
var _b = _a, { className, children } = _b, rest = __objRest(_b, ["className", "children"]);
|
11315
|
-
return /* @__PURE__ */
|
11466
|
+
return /* @__PURE__ */ React79.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
11316
11467
|
className: classNames("py-6 z-0", className)
|
11317
11468
|
}), children);
|
11318
11469
|
};
|
11319
11470
|
var ModalTab = Tab;
|
11320
11471
|
var ModalTabContainer = TabContainer;
|
11321
11472
|
var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
11322
|
-
const Tab2 =
|
11473
|
+
const Tab2 = React79.forwardRef(
|
11323
11474
|
(_a, ref) => {
|
11324
11475
|
var _b = _a, {
|
11325
11476
|
id,
|
@@ -11351,17 +11502,17 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
11351
11502
|
const _id = id != null ? id : kebabCase(title);
|
11352
11503
|
let statusIcon = void 0;
|
11353
11504
|
if (status === "warning") {
|
11354
|
-
statusIcon = /* @__PURE__ */
|
11505
|
+
statusIcon = /* @__PURE__ */ React79.createElement(InlineIcon, {
|
11355
11506
|
icon: import_warningSign4.default,
|
11356
11507
|
color: selected ? void 0 : "warning-80"
|
11357
11508
|
});
|
11358
11509
|
} else if (status === "error") {
|
11359
|
-
statusIcon = /* @__PURE__ */
|
11510
|
+
statusIcon = /* @__PURE__ */ React79.createElement(InlineIcon, {
|
11360
11511
|
icon: import_warningSign4.default,
|
11361
11512
|
color: selected ? void 0 : "error-50"
|
11362
11513
|
});
|
11363
11514
|
}
|
11364
|
-
const tab = /* @__PURE__ */
|
11515
|
+
const tab = /* @__PURE__ */ React79.createElement(Component, __spreadValues({
|
11365
11516
|
ref,
|
11366
11517
|
id: `${_id}-tab`,
|
11367
11518
|
onClick: () => !disabled && onSelected(value != null ? value : index),
|
@@ -11378,29 +11529,29 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
11378
11529
|
"aria-selected": selected,
|
11379
11530
|
"aria-controls": `${_id}-panel`,
|
11380
11531
|
tabIndex: disabled ? void 0 : 0
|
11381
|
-
}, rest), /* @__PURE__ */
|
11532
|
+
}, rest), /* @__PURE__ */ React79.createElement(Typography2, {
|
11382
11533
|
htmlTag: "div",
|
11383
11534
|
variant: "small",
|
11384
11535
|
color: selected ? "primary-80" : disabled ? "grey-20" : "current",
|
11385
11536
|
className: tw("inline-flex items-center gap-3")
|
11386
|
-
}, showNotification ? /* @__PURE__ */
|
11537
|
+
}, showNotification ? /* @__PURE__ */ React79.createElement(Badge.Notification, {
|
11387
11538
|
right: "-4px",
|
11388
11539
|
top: "3px"
|
11389
|
-
}, /* @__PURE__ */
|
11540
|
+
}, /* @__PURE__ */ React79.createElement("span", {
|
11390
11541
|
className: tw("whitespace-nowrap")
|
11391
|
-
}, title)) : /* @__PURE__ */
|
11542
|
+
}, title)) : /* @__PURE__ */ React79.createElement("span", {
|
11392
11543
|
className: tw("whitespace-nowrap")
|
11393
|
-
}, title), isNumber5(badge) && /* @__PURE__ */
|
11544
|
+
}, title), isNumber5(badge) && /* @__PURE__ */ React79.createElement(Typography2, {
|
11394
11545
|
htmlTag: "span",
|
11395
11546
|
variant: "small",
|
11396
11547
|
color: selected ? "primary-80" : "grey-5",
|
11397
11548
|
className: "leading-none"
|
11398
|
-
}, /* @__PURE__ */
|
11549
|
+
}, /* @__PURE__ */ React79.createElement(TabBadge, {
|
11399
11550
|
kind: "filled",
|
11400
11551
|
value: badge,
|
11401
11552
|
textClassname: classNames({ "text-white": selected, "text-grey-50": !selected })
|
11402
11553
|
})), statusIcon));
|
11403
|
-
return tooltip ? /* @__PURE__ */
|
11554
|
+
return tooltip ? /* @__PURE__ */ React79.createElement(Tooltip, {
|
11404
11555
|
content: tooltip
|
11405
11556
|
}, tab) : tab;
|
11406
11557
|
}
|
@@ -11414,7 +11565,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
11414
11565
|
const Tabs2 = (props) => {
|
11415
11566
|
var _a, _b;
|
11416
11567
|
const { className, value, defaultValue, onChange, children } = props;
|
11417
|
-
const childArr =
|
11568
|
+
const childArr = React79.Children.toArray(children);
|
11418
11569
|
const firstTab = childArr[0];
|
11419
11570
|
const firstTabValue = isTabComponent(firstTab) ? firstTab.props.value : -1;
|
11420
11571
|
const [selected, setSelected] = useState9((_b = (_a = value != null ? value : defaultValue) != null ? _a : firstTabValue) != null ? _b : 0);
|
@@ -11427,7 +11578,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
11427
11578
|
var _a2, _b2;
|
11428
11579
|
const container = containerRef.current;
|
11429
11580
|
const tabs = tabsRef.current;
|
11430
|
-
const values =
|
11581
|
+
const values = React79.Children.map(
|
11431
11582
|
children,
|
11432
11583
|
(tab, i) => {
|
11433
11584
|
var _a3;
|
@@ -11468,7 +11619,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
11468
11619
|
updateCarets();
|
11469
11620
|
setSelected(value);
|
11470
11621
|
revealSelectedTab({ smooth: value !== selected });
|
11471
|
-
}, [value,
|
11622
|
+
}, [value, React79.Children.count(children)]);
|
11472
11623
|
useLayoutEffect2(() => {
|
11473
11624
|
var _a2;
|
11474
11625
|
updateCarets();
|
@@ -11532,27 +11683,27 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
11532
11683
|
const handleSelected = (key) => {
|
11533
11684
|
(onChange != null ? onChange : setSelected)(key);
|
11534
11685
|
};
|
11535
|
-
|
11686
|
+
React79.Children.forEach(children, (c) => {
|
11536
11687
|
if (c && !isTabComponent(c)) {
|
11537
11688
|
throw new Error("<Tabs> can only have <Tabs.Tab> components as children");
|
11538
11689
|
}
|
11539
11690
|
});
|
11540
|
-
return /* @__PURE__ */
|
11691
|
+
return /* @__PURE__ */ React79.createElement("div", {
|
11541
11692
|
ref: parentRef,
|
11542
11693
|
className: classNames("Aquarium-Tabs", tw("h-full"), className)
|
11543
|
-
}, /* @__PURE__ */
|
11694
|
+
}, /* @__PURE__ */ React79.createElement("div", {
|
11544
11695
|
className: tw("relative flex items-center h-full border-b-2 border-grey-10")
|
11545
|
-
}, /* @__PURE__ */
|
11696
|
+
}, /* @__PURE__ */ React79.createElement("div", {
|
11546
11697
|
ref: containerRef,
|
11547
11698
|
className: tw("overflow-y-auto scrollbar-hide h-full mb-[-2px]")
|
11548
|
-
}, /* @__PURE__ */
|
11699
|
+
}, /* @__PURE__ */ React79.createElement("div", {
|
11549
11700
|
ref: tabsRef,
|
11550
11701
|
role: "tablist",
|
11551
11702
|
"aria-label": "tabs",
|
11552
11703
|
className: tw("inline-flex items-center cursor-pointer font-normal h-full")
|
11553
|
-
},
|
11704
|
+
}, React79.Children.map(
|
11554
11705
|
children,
|
11555
|
-
(tab, index) => tab ? /* @__PURE__ */
|
11706
|
+
(tab, index) => tab ? /* @__PURE__ */ React79.createElement(TabItemComponent, __spreadProps(__spreadValues({
|
11556
11707
|
key: tab.props.value
|
11557
11708
|
}, tab.props), {
|
11558
11709
|
index,
|
@@ -11560,20 +11711,20 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
11560
11711
|
onKeyDown: handleKeyDown,
|
11561
11712
|
onSelected: handleSelected
|
11562
11713
|
})) : void 0
|
11563
|
-
))), leftCaret && /* @__PURE__ */
|
11714
|
+
))), leftCaret && /* @__PURE__ */ React79.createElement("div", {
|
11564
11715
|
className: tw("absolute left-0 bg-gradient-to-r from-white via-white z-20 py-3 pr-4")
|
11565
|
-
}, /* @__PURE__ */
|
11716
|
+
}, /* @__PURE__ */ React79.createElement("div", {
|
11566
11717
|
onClick: () => handleScrollToNext("left"),
|
11567
11718
|
className: tw("hover:bg-grey-0 p-2 leading-none cursor-pointer")
|
11568
|
-
}, /* @__PURE__ */
|
11719
|
+
}, /* @__PURE__ */ React79.createElement(InlineIcon, {
|
11569
11720
|
icon: import_chevronLeft4.default
|
11570
|
-
}))), rightCaret && /* @__PURE__ */
|
11721
|
+
}))), rightCaret && /* @__PURE__ */ React79.createElement("div", {
|
11571
11722
|
onClick: () => handleScrollToNext("right"),
|
11572
11723
|
className: tw("absolute right-0 bg-gradient-to-l from-white via-white z-20 py-3 pl-4")
|
11573
|
-
}, /* @__PURE__ */
|
11724
|
+
}, /* @__PURE__ */ React79.createElement("div", {
|
11574
11725
|
onClick: () => handleScrollToNext("right"),
|
11575
11726
|
className: tw("hover:bg-grey-0 p-2 leading-none cursor-pointer")
|
11576
|
-
}, /* @__PURE__ */
|
11727
|
+
}, /* @__PURE__ */ React79.createElement(InlineIcon, {
|
11577
11728
|
icon: import_chevronRight4.default
|
11578
11729
|
})))), renderChildren(children, selected, props));
|
11579
11730
|
};
|
@@ -11581,7 +11732,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
11581
11732
|
Tabs2.Tab = TabComponent;
|
11582
11733
|
return Tabs2;
|
11583
11734
|
};
|
11584
|
-
var Tabs = createTabsComponent(Tab, TabItem, "Tabs", (children, selected) => /* @__PURE__ */
|
11735
|
+
var Tabs = createTabsComponent(Tab, TabItem, "Tabs", (children, selected) => /* @__PURE__ */ React79.createElement(TabContainer, null, children.find(
|
11585
11736
|
(node, index) => (node == null ? void 0 : node.props.value) === selected || index === selected
|
11586
11737
|
)));
|
11587
11738
|
|
@@ -11590,7 +11741,7 @@ var import_cross6 = __toESM(require_cross());
|
|
11590
11741
|
var Modal2 = (_a) => {
|
11591
11742
|
var _b = _a, { closeOnEsc = true } = _b, props = __objRest(_b, ["closeOnEsc"]);
|
11592
11743
|
const { open, onClose, size, portalContainer } = props;
|
11593
|
-
const ref =
|
11744
|
+
const ref = React80.useRef(null);
|
11594
11745
|
const state = useOverlayTriggerState4({ isOpen: open, onOpenChange: (isOpen) => !isOpen && onClose() });
|
11595
11746
|
const { modalProps, underlayProps } = useModalOverlay2(
|
11596
11747
|
{ isDismissable: false, isKeyboardDismissDisabled: !closeOnEsc },
|
@@ -11600,17 +11751,17 @@ var Modal2 = (_a) => {
|
|
11600
11751
|
if (!state.isOpen) {
|
11601
11752
|
return null;
|
11602
11753
|
}
|
11603
|
-
return /* @__PURE__ */
|
11754
|
+
return /* @__PURE__ */ React80.createElement(Overlay3, {
|
11604
11755
|
portalContainer
|
11605
|
-
}, /* @__PURE__ */
|
11756
|
+
}, /* @__PURE__ */ React80.createElement(Modal, {
|
11606
11757
|
className: "Aquarium-Modal",
|
11607
11758
|
open: true
|
11608
|
-
}, /* @__PURE__ */
|
11759
|
+
}, /* @__PURE__ */ React80.createElement(Modal.BackDrop, __spreadValues({}, underlayProps)), /* @__PURE__ */ React80.createElement(ModalWrapper, __spreadValues(__spreadValues({
|
11609
11760
|
ref,
|
11610
11761
|
size
|
11611
11762
|
}, props), modalProps))));
|
11612
11763
|
};
|
11613
|
-
var ModalWrapper =
|
11764
|
+
var ModalWrapper = React80.forwardRef(
|
11614
11765
|
(_a, ref) => {
|
11615
11766
|
var _b = _a, { title, subtitle, headerImage, primaryAction, secondaryActions, children, onClose } = _b, props = __objRest(_b, ["title", "subtitle", "headerImage", "primaryAction", "secondaryActions", "children", "onClose"]);
|
11616
11767
|
const labelledBy = useId2();
|
@@ -11619,30 +11770,30 @@ var ModalWrapper = React79.forwardRef(
|
|
11619
11770
|
{ "role": "dialog", "aria-labelledby": labelledBy, "aria-describedby": describedBy },
|
11620
11771
|
ref
|
11621
11772
|
);
|
11622
|
-
return /* @__PURE__ */
|
11773
|
+
return /* @__PURE__ */ React80.createElement(Modal.Dialog, __spreadProps(__spreadValues(__spreadValues({
|
11623
11774
|
ref
|
11624
11775
|
}, props), dialogProps), {
|
11625
11776
|
tabIndex: -1
|
11626
|
-
}), /* @__PURE__ */
|
11777
|
+
}), /* @__PURE__ */ React80.createElement(Modal.CloseButtonContainer, null, /* @__PURE__ */ React80.createElement(IconButton, {
|
11627
11778
|
"aria-label": "Close",
|
11628
11779
|
icon: import_cross6.default,
|
11629
11780
|
onClick: onClose
|
11630
|
-
})), headerImage !== void 0 && /* @__PURE__ */
|
11781
|
+
})), headerImage !== void 0 && /* @__PURE__ */ React80.createElement(Modal.HeaderImage, {
|
11631
11782
|
backgroundImage: headerImage
|
11632
|
-
}), /* @__PURE__ */
|
11783
|
+
}), /* @__PURE__ */ React80.createElement(Modal.Header, {
|
11633
11784
|
className: tw({ "pb-3": isComponentType(children, ModalTabs) })
|
11634
|
-
}, /* @__PURE__ */
|
11785
|
+
}, /* @__PURE__ */ React80.createElement(Modal.TitleContainer, null, /* @__PURE__ */ React80.createElement(Modal.Title, {
|
11635
11786
|
id: labelledBy
|
11636
|
-
}, title), subtitle && /* @__PURE__ */
|
11787
|
+
}, title), subtitle && /* @__PURE__ */ React80.createElement(Modal.Subtitle, null, subtitle))), isComponentType(children, ModalTabs) ? React80.cloneElement(children, { className: tw("[&>div:first-child]:px-5 grow") }) : /* @__PURE__ */ React80.createElement(Modal.Body, {
|
11637
11788
|
id: describedBy,
|
11638
11789
|
tabIndex: 0,
|
11639
11790
|
noFooter: !(secondaryActions || primaryAction)
|
11640
|
-
}, children), (secondaryActions || primaryAction) && /* @__PURE__ */
|
11791
|
+
}, children), (secondaryActions || primaryAction) && /* @__PURE__ */ React80.createElement(Modal.Footer, null, /* @__PURE__ */ React80.createElement(Modal.Actions, null, secondaryActions && castArray(secondaryActions).filter(Boolean).map((_a2) => {
|
11641
11792
|
var _b2 = _a2, { text } = _b2, action = __objRest(_b2, ["text"]);
|
11642
|
-
return /* @__PURE__ */
|
11793
|
+
return /* @__PURE__ */ React80.createElement(Button.Secondary, __spreadValues({
|
11643
11794
|
key: text
|
11644
11795
|
}, action), text);
|
11645
|
-
}), primaryAction && /* @__PURE__ */
|
11796
|
+
}), primaryAction && /* @__PURE__ */ React80.createElement(Button.Primary, __spreadValues({
|
11646
11797
|
key: primaryAction.text
|
11647
11798
|
}, omit11(primaryAction, "text")), primaryAction.text))));
|
11648
11799
|
}
|
@@ -11651,24 +11802,24 @@ var ModalTabs = createTabsComponent(
|
|
11651
11802
|
ModalTab,
|
11652
11803
|
TabItem,
|
11653
11804
|
"ModalTabs",
|
11654
|
-
(children, selected, props) => /* @__PURE__ */
|
11805
|
+
(children, selected, props) => /* @__PURE__ */ React80.createElement(Modal.Body, {
|
11655
11806
|
maxHeight: props.maxHeight
|
11656
|
-
}, /* @__PURE__ */
|
11807
|
+
}, /* @__PURE__ */ React80.createElement(ModalTabContainer, null, children.find(
|
11657
11808
|
(node, index) => (node == null ? void 0 : node.props.value) === selected || index === selected
|
11658
11809
|
)))
|
11659
11810
|
);
|
11660
11811
|
|
11661
11812
|
// src/molecules/MultiInput/MultiInput.tsx
|
11662
|
-
import
|
11813
|
+
import React82, { useEffect as useEffect9, useRef as useRef10, useState as useState10 } from "react";
|
11663
11814
|
import castArray2 from "lodash/castArray";
|
11664
11815
|
import identity from "lodash/identity";
|
11665
11816
|
import omit12 from "lodash/omit";
|
11666
11817
|
import uniqueId5 from "lodash/uniqueId";
|
11667
11818
|
|
11668
11819
|
// src/molecules/MultiInput/InputChip.tsx
|
11669
|
-
import
|
11820
|
+
import React81 from "react";
|
11670
11821
|
var import_smallCross2 = __toESM(require_smallCross());
|
11671
|
-
var InputChip =
|
11822
|
+
var InputChip = React81.forwardRef(
|
11672
11823
|
(_a, ref) => {
|
11673
11824
|
var _b = _a, { invalid = false, disabled, readOnly, className, onClick: _onClick, children } = _b, props = __objRest(_b, ["invalid", "disabled", "readOnly", "className", "onClick", "children"]);
|
11674
11825
|
const onClick = (e) => {
|
@@ -11676,18 +11827,18 @@ var InputChip = React80.forwardRef(
|
|
11676
11827
|
_onClick == null ? void 0 : _onClick(e);
|
11677
11828
|
}
|
11678
11829
|
};
|
11679
|
-
return /* @__PURE__ */
|
11830
|
+
return /* @__PURE__ */ React81.createElement("div", {
|
11680
11831
|
className: classNames(className, "inline-flex align-middle mx-1 items-stretch rounded-sm break-all", {
|
11681
11832
|
"bg-error-0 ": invalid,
|
11682
11833
|
"bg-grey-0 ": !invalid && !disabled,
|
11683
11834
|
"bg-grey-5": disabled
|
11684
11835
|
})
|
11685
|
-
}, /* @__PURE__ */
|
11836
|
+
}, /* @__PURE__ */ React81.createElement("div", {
|
11686
11837
|
className: tw("px-2 py-1")
|
11687
|
-
}, /* @__PURE__ */
|
11838
|
+
}, /* @__PURE__ */ React81.createElement(Typography2, {
|
11688
11839
|
variant: "small",
|
11689
11840
|
color: invalid ? "error-80" : disabled ? "grey-40" : "grey-70"
|
11690
|
-
}, children)), !readOnly && /* @__PURE__ */
|
11841
|
+
}, children)), !readOnly && /* @__PURE__ */ React81.createElement("div", __spreadProps(__spreadValues({
|
11691
11842
|
ref
|
11692
11843
|
}, props), {
|
11693
11844
|
onClick,
|
@@ -11698,7 +11849,7 @@ var InputChip = React80.forwardRef(
|
|
11698
11849
|
}),
|
11699
11850
|
role: "button",
|
11700
11851
|
"aria-label": `Remove ${String(children)}`
|
11701
|
-
}), /* @__PURE__ */
|
11852
|
+
}), /* @__PURE__ */ React81.createElement(Icon, {
|
11702
11853
|
icon: import_smallCross2.default,
|
11703
11854
|
className: tw({
|
11704
11855
|
"text-error-70": invalid,
|
@@ -11839,7 +11990,7 @@ var MultiInputBase = (_a) => {
|
|
11839
11990
|
};
|
11840
11991
|
const renderChips = () => items == null ? void 0 : items.map((item, index) => {
|
11841
11992
|
var _a3;
|
11842
|
-
return /* @__PURE__ */
|
11993
|
+
return /* @__PURE__ */ React82.createElement(InputChip, {
|
11843
11994
|
key: `${itemToString(item)}.${index}`,
|
11844
11995
|
invalid: !((_a3 = isItemValid == null ? void 0 : isItemValid(item, index)) != null ? _a3 : true),
|
11845
11996
|
readOnly,
|
@@ -11850,13 +12001,13 @@ var MultiInputBase = (_a) => {
|
|
11850
12001
|
}
|
11851
12002
|
}, itemToString(item));
|
11852
12003
|
});
|
11853
|
-
return /* @__PURE__ */
|
12004
|
+
return /* @__PURE__ */ React82.createElement("div", {
|
11854
12005
|
className: "Aquarium-MultiInputBase"
|
11855
|
-
}, /* @__PURE__ */
|
12006
|
+
}, /* @__PURE__ */ React82.createElement(Select.InputContainer, {
|
11856
12007
|
variant: disabled ? "disabled" : !valid ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default"
|
11857
|
-
}, /* @__PURE__ */
|
12008
|
+
}, /* @__PURE__ */ React82.createElement("div", {
|
11858
12009
|
className: "grow inline-flex flex-row flex-wrap gap-y-2"
|
11859
|
-
}, inline && renderChips(), /* @__PURE__ */
|
12010
|
+
}, inline && renderChips(), /* @__PURE__ */ React82.createElement(Select.Input, __spreadProps(__spreadValues({
|
11860
12011
|
ref: inputRef,
|
11861
12012
|
id: id != null ? id : name,
|
11862
12013
|
name,
|
@@ -11874,11 +12025,11 @@ var MultiInputBase = (_a) => {
|
|
11874
12025
|
onFocus: handleFocus,
|
11875
12026
|
onBlur: handleBlur,
|
11876
12027
|
autoComplete: "off"
|
11877
|
-
}))), endAdornment && /* @__PURE__ */
|
12028
|
+
}))), endAdornment && /* @__PURE__ */ React82.createElement(InputAdornment, null, endAdornment)), !inline && /* @__PURE__ */ React82.createElement("div", {
|
11878
12029
|
className: tw("flex flex-row flex-wrap gap-y-2 mt-2")
|
11879
12030
|
}, renderChips()));
|
11880
12031
|
};
|
11881
|
-
var BaseMultiInputSkeleton = () => /* @__PURE__ */
|
12032
|
+
var BaseMultiInputSkeleton = () => /* @__PURE__ */ React82.createElement(Skeleton, {
|
11882
12033
|
height: 38
|
11883
12034
|
});
|
11884
12035
|
MultiInputBase.Skeleton = BaseMultiInputSkeleton;
|
@@ -11895,7 +12046,7 @@ var MultiInput = (props) => {
|
|
11895
12046
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
11896
12047
|
const labelControlProps = getLabelControlProps(props);
|
11897
12048
|
const baseProps = omit12(props, Object.keys(labelControlProps));
|
11898
|
-
return /* @__PURE__ */
|
12049
|
+
return /* @__PURE__ */ React82.createElement(LabelControl, __spreadProps(__spreadValues({
|
11899
12050
|
id: `${id.current}-label`,
|
11900
12051
|
htmlFor: `${id.current}-input`,
|
11901
12052
|
messageId: errorMessageId
|
@@ -11903,7 +12054,7 @@ var MultiInput = (props) => {
|
|
11903
12054
|
length: value.length,
|
11904
12055
|
maxLength,
|
11905
12056
|
className: "Aquarium-MultiInput"
|
11906
|
-
}), /* @__PURE__ */
|
12057
|
+
}), /* @__PURE__ */ React82.createElement(MultiInputBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
|
11907
12058
|
id: `${id.current}-input`,
|
11908
12059
|
onChange: (value2) => {
|
11909
12060
|
var _a2;
|
@@ -11915,12 +12066,12 @@ var MultiInput = (props) => {
|
|
11915
12066
|
valid: props.valid
|
11916
12067
|
})));
|
11917
12068
|
};
|
11918
|
-
var MultiInputSkeleton = () => /* @__PURE__ */
|
12069
|
+
var MultiInputSkeleton = () => /* @__PURE__ */ React82.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React82.createElement(MultiInputBase.Skeleton, null));
|
11919
12070
|
MultiInput.Skeleton = MultiInputSkeleton;
|
11920
12071
|
MultiInput.Skeleton.displayName = "MultiInput.Skeleton";
|
11921
12072
|
|
11922
12073
|
// src/molecules/MultiSelect/MultiSelect.tsx
|
11923
|
-
import
|
12074
|
+
import React83, { useEffect as useEffect10, useRef as useRef11, useState as useState11 } from "react";
|
11924
12075
|
import { ariaHideOutside as ariaHideOutside2 } from "@react-aria/overlays";
|
11925
12076
|
import { useCombobox as useCombobox2, useMultipleSelection } from "downshift";
|
11926
12077
|
import isEqual from "lodash/isEqual";
|
@@ -11941,6 +12092,7 @@ var MultiSelectBase = (_a) => {
|
|
11941
12092
|
options,
|
11942
12093
|
optionKeys = ["label", "value"],
|
11943
12094
|
noResults,
|
12095
|
+
emptyState = noResults,
|
11944
12096
|
optionToString: itemToString = getOptionLabelBuiltin,
|
11945
12097
|
renderOption = (opt) => itemToString(opt),
|
11946
12098
|
isOptionDisabled = isOptionDisabledBuiltin,
|
@@ -11963,6 +12115,7 @@ var MultiSelectBase = (_a) => {
|
|
11963
12115
|
"options",
|
11964
12116
|
"optionKeys",
|
11965
12117
|
"noResults",
|
12118
|
+
"emptyState",
|
11966
12119
|
"optionToString",
|
11967
12120
|
"renderOption",
|
11968
12121
|
"isOptionDisabled",
|
@@ -12065,7 +12218,7 @@ var MultiSelectBase = (_a) => {
|
|
12065
12218
|
}
|
12066
12219
|
}, [state.isOpen, inputRef, popoverRef]);
|
12067
12220
|
const renderChips = () => {
|
12068
|
-
return selectedItems.map((selectedItem, index) => /* @__PURE__ */
|
12221
|
+
return selectedItems.map((selectedItem, index) => /* @__PURE__ */ React83.createElement(InputChip, __spreadProps(__spreadValues({
|
12069
12222
|
key: `${itemToString(selectedItem)}.chip`,
|
12070
12223
|
className: tw("mx-0"),
|
12071
12224
|
disabled,
|
@@ -12081,14 +12234,14 @@ var MultiSelectBase = (_a) => {
|
|
12081
12234
|
const hasNoResults = options.length === 0 || filteredOptions.length === 0;
|
12082
12235
|
const inputProps = getInputProps(getDropdownProps({ ref: inputRef, disabled: disabled || readOnly }));
|
12083
12236
|
const menuProps = getMenuProps({ ref: menuRef }, { suppressRefError: !isOpen });
|
12084
|
-
return /* @__PURE__ */
|
12237
|
+
return /* @__PURE__ */ React83.createElement("div", {
|
12085
12238
|
className: classNames("Aquarium-MultiSelectBase", tw("relative"))
|
12086
|
-
}, /* @__PURE__ */
|
12239
|
+
}, /* @__PURE__ */ React83.createElement(Select.InputContainer, {
|
12087
12240
|
ref: targetRef,
|
12088
12241
|
variant: disabled ? "disabled" : !valid ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default"
|
12089
|
-
}, /* @__PURE__ */
|
12242
|
+
}, /* @__PURE__ */ React83.createElement("div", {
|
12090
12243
|
className: "grow inline-flex flex-row flex-wrap gap-2"
|
12091
|
-
}, !hideChips && inline && renderChips(), /* @__PURE__ */
|
12244
|
+
}, !hideChips && inline && renderChips(), /* @__PURE__ */ React83.createElement(Select.Input, __spreadProps(__spreadValues(__spreadValues({
|
12092
12245
|
id,
|
12093
12246
|
ref: inputRef,
|
12094
12247
|
name,
|
@@ -12110,12 +12263,12 @@ var MultiSelectBase = (_a) => {
|
|
12110
12263
|
setFocus(false);
|
12111
12264
|
(_a3 = inputProps.onBlur) == null ? void 0 : _a3.call(inputProps, e);
|
12112
12265
|
}
|
12113
|
-
}))), !readOnly && /* @__PURE__ */
|
12266
|
+
}))), !readOnly && /* @__PURE__ */ React83.createElement(Select.Toggle, __spreadValues({
|
12114
12267
|
hasFocus,
|
12115
12268
|
isOpen
|
12116
|
-
}, getToggleButtonProps({ disabled })))), !hideChips && !inline && /* @__PURE__ */
|
12269
|
+
}, getToggleButtonProps({ disabled })))), !hideChips && !inline && /* @__PURE__ */ React83.createElement("div", {
|
12117
12270
|
className: tw("flex flex-row flex-wrap gap-2 mt-2")
|
12118
|
-
}, renderChips()), isOpen && /* @__PURE__ */
|
12271
|
+
}, renderChips()), isOpen && /* @__PURE__ */ React83.createElement(PopoverOverlay, {
|
12119
12272
|
ref: popoverRef,
|
12120
12273
|
triggerRef: targetRef,
|
12121
12274
|
state,
|
@@ -12123,26 +12276,28 @@ var MultiSelectBase = (_a) => {
|
|
12123
12276
|
shouldFlip: true,
|
12124
12277
|
isNonModal: true,
|
12125
12278
|
style: { width: (_a2 = targetRef.current) == null ? void 0 : _a2.offsetWidth }
|
12126
|
-
}, /* @__PURE__ */
|
12279
|
+
}, /* @__PURE__ */ React83.createElement(Select.Menu, __spreadValues({
|
12127
12280
|
ref: menuRef,
|
12128
12281
|
maxHeight
|
12129
|
-
}, menuProps), hasNoResults && /* @__PURE__ */
|
12282
|
+
}, menuProps), hasNoResults && /* @__PURE__ */ React83.createElement(Select.NoResults, null, emptyState), filteredOptions.map((item, index) => /* @__PURE__ */ React83.createElement(Select.Item, __spreadValues({
|
12130
12283
|
key: itemToString(item),
|
12131
12284
|
highlighted: index === highlightedIndex,
|
12132
12285
|
selected: selectedItems.includes(item)
|
12133
12286
|
}, getItemProps({ item, index, disabled: isOptionDisabled(item, index) })), renderOption(item))))));
|
12134
12287
|
};
|
12135
|
-
var MultiSelectBaseSkeleton = () => /* @__PURE__ */
|
12288
|
+
var MultiSelectBaseSkeleton = () => /* @__PURE__ */ React83.createElement(Skeleton, {
|
12136
12289
|
height: 38
|
12137
12290
|
});
|
12138
12291
|
MultiSelectBase.Skeleton = MultiSelectBaseSkeleton;
|
12139
12292
|
var MultiSelect = (_a) => {
|
12140
12293
|
var _b = _a, {
|
12141
12294
|
options,
|
12142
|
-
noResults
|
12295
|
+
noResults,
|
12296
|
+
emptyState = noResults
|
12143
12297
|
} = _b, props = __objRest(_b, [
|
12144
12298
|
"options",
|
12145
|
-
"noResults"
|
12299
|
+
"noResults",
|
12300
|
+
"emptyState"
|
12146
12301
|
]);
|
12147
12302
|
var _a2;
|
12148
12303
|
const id = useRef11((_a2 = props.id) != null ? _a2 : `multiselect-${uniqueId6()}`);
|
@@ -12150,30 +12305,30 @@ var MultiSelect = (_a) => {
|
|
12150
12305
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
12151
12306
|
const labelControlProps = getLabelControlProps(props);
|
12152
12307
|
const baseProps = omit13(props, Object.keys(labelControlProps));
|
12153
|
-
return /* @__PURE__ */
|
12308
|
+
return /* @__PURE__ */ React83.createElement(LabelControl, __spreadProps(__spreadValues({
|
12154
12309
|
id: `${id.current}-label`,
|
12155
12310
|
htmlFor: `${id.current}-input`,
|
12156
12311
|
messageId: errorMessageId
|
12157
12312
|
}, labelControlProps), {
|
12158
12313
|
className: "Aquarium-MultiSelect"
|
12159
|
-
}), /* @__PURE__ */
|
12314
|
+
}), /* @__PURE__ */ React83.createElement(MultiSelectBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
|
12160
12315
|
id: id.current,
|
12161
12316
|
options,
|
12162
|
-
|
12317
|
+
emptyState,
|
12163
12318
|
disabled: props.disabled,
|
12164
12319
|
valid: props.valid
|
12165
12320
|
})));
|
12166
12321
|
};
|
12167
|
-
var MultiSelectSkeleton = () => /* @__PURE__ */
|
12322
|
+
var MultiSelectSkeleton = () => /* @__PURE__ */ React83.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React83.createElement(MultiSelectBase.Skeleton, null));
|
12168
12323
|
MultiSelect.Skeleton = MultiSelectSkeleton;
|
12169
12324
|
MultiSelect.Skeleton.displayName = "MultiSelect.Skeleton";
|
12170
12325
|
|
12171
12326
|
// src/molecules/NativeSelect/NativeSelect.tsx
|
12172
|
-
import
|
12327
|
+
import React84, { useRef as useRef12 } from "react";
|
12173
12328
|
import omit14 from "lodash/omit";
|
12174
12329
|
import uniqueId7 from "lodash/uniqueId";
|
12175
12330
|
var import_caretDown2 = __toESM(require_caretDown());
|
12176
|
-
var NativeSelectBase =
|
12331
|
+
var NativeSelectBase = React84.forwardRef(
|
12177
12332
|
(_a, ref) => {
|
12178
12333
|
var _b = _a, { children, disabled = false, required = false, valid = true, readOnly = false } = _b, props = __objRest(_b, ["children", "disabled", "required", "valid", "readOnly"]);
|
12179
12334
|
const placeholderValue = uniqueId7("default_value_for_placeholder");
|
@@ -12190,16 +12345,16 @@ var NativeSelectBase = React83.forwardRef(
|
|
12190
12345
|
(_b2 = props.onBlur) == null ? void 0 : _b2.call(props, event);
|
12191
12346
|
}
|
12192
12347
|
};
|
12193
|
-
return /* @__PURE__ */
|
12348
|
+
return /* @__PURE__ */ React84.createElement("span", {
|
12194
12349
|
className: classNames("Aquarium-NativeSelectBase", tw("relative block"))
|
12195
|
-
}, !readOnly && /* @__PURE__ */
|
12350
|
+
}, !readOnly && /* @__PURE__ */ React84.createElement("span", {
|
12196
12351
|
className: tw(
|
12197
12352
|
"absolute right-0 inset-y-0 mr-4 text-grey-40 flex ml-3 pointer-events-none typography-default-strong mt-4"
|
12198
12353
|
)
|
12199
|
-
}, /* @__PURE__ */
|
12354
|
+
}, /* @__PURE__ */ React84.createElement(Icon, {
|
12200
12355
|
icon: import_caretDown2.default,
|
12201
12356
|
"data-testid": "icon-dropdown"
|
12202
|
-
})), /* @__PURE__ */
|
12357
|
+
})), /* @__PURE__ */ React84.createElement("select", __spreadProps(__spreadValues({
|
12203
12358
|
ref,
|
12204
12359
|
disabled: disabled || readOnly,
|
12205
12360
|
required
|
@@ -12218,16 +12373,16 @@ var NativeSelectBase = React83.forwardRef(
|
|
12218
12373
|
),
|
12219
12374
|
props.className
|
12220
12375
|
)
|
12221
|
-
}), props.placeholder && /* @__PURE__ */
|
12376
|
+
}), props.placeholder && /* @__PURE__ */ React84.createElement("option", {
|
12222
12377
|
value: placeholderValue,
|
12223
12378
|
disabled: true
|
12224
12379
|
}, props.placeholder), children));
|
12225
12380
|
}
|
12226
12381
|
);
|
12227
|
-
NativeSelectBase.Skeleton = () => /* @__PURE__ */
|
12382
|
+
NativeSelectBase.Skeleton = () => /* @__PURE__ */ React84.createElement(Skeleton, {
|
12228
12383
|
height: 38
|
12229
12384
|
});
|
12230
|
-
var NativeSelect =
|
12385
|
+
var NativeSelect = React84.forwardRef(
|
12231
12386
|
(_a, ref) => {
|
12232
12387
|
var _b = _a, { readOnly } = _b, props = __objRest(_b, ["readOnly"]);
|
12233
12388
|
var _a2;
|
@@ -12236,13 +12391,13 @@ var NativeSelect = React83.forwardRef(
|
|
12236
12391
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
12237
12392
|
const _b2 = getLabelControlProps(props), { "data-testid": dataTestId } = _b2, labelControlProps = __objRest(_b2, ["data-testid"]);
|
12238
12393
|
const baseProps = omit14(props, Object.keys(labelControlProps));
|
12239
|
-
return /* @__PURE__ */
|
12394
|
+
return /* @__PURE__ */ React84.createElement(LabelControl, __spreadProps(__spreadValues({
|
12240
12395
|
id: `${id.current}-label`,
|
12241
12396
|
htmlFor: id.current,
|
12242
12397
|
messageId: errorMessageId
|
12243
12398
|
}, labelControlProps), {
|
12244
12399
|
className: "Aquarium-NativeSelect"
|
12245
|
-
}), /* @__PURE__ */
|
12400
|
+
}), /* @__PURE__ */ React84.createElement(NativeSelectBase, __spreadProps(__spreadValues(__spreadValues({
|
12246
12401
|
ref
|
12247
12402
|
}, baseProps), errorProps), {
|
12248
12403
|
id: id.current,
|
@@ -12256,63 +12411,63 @@ var NativeSelect = React83.forwardRef(
|
|
12256
12411
|
}
|
12257
12412
|
);
|
12258
12413
|
NativeSelect.displayName = "NativeSelect";
|
12259
|
-
var Option =
|
12414
|
+
var Option = React84.forwardRef((_a, ref) => {
|
12260
12415
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
12261
|
-
return /* @__PURE__ */
|
12416
|
+
return /* @__PURE__ */ React84.createElement("option", __spreadValues({
|
12262
12417
|
ref
|
12263
12418
|
}, props), children);
|
12264
12419
|
});
|
12265
12420
|
Option.displayName = "Option";
|
12266
|
-
var NativeSelectSkeleton = () => /* @__PURE__ */
|
12421
|
+
var NativeSelectSkeleton = () => /* @__PURE__ */ React84.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React84.createElement(NativeSelectBase.Skeleton, null), /* @__PURE__ */ React84.createElement("div", {
|
12267
12422
|
style: { height: "1px" }
|
12268
12423
|
}));
|
12269
12424
|
NativeSelect.Skeleton = NativeSelectSkeleton;
|
12270
12425
|
NativeSelect.Skeleton.displayName = "NativeSelect.Skeleton";
|
12271
12426
|
|
12272
12427
|
// src/molecules/Navigation/Navigation.tsx
|
12273
|
-
import
|
12428
|
+
import React86 from "react";
|
12274
12429
|
import classNames9 from "classnames";
|
12275
12430
|
|
12276
12431
|
// src/atoms/Navigation/Navigation.tsx
|
12277
|
-
import
|
12432
|
+
import React85 from "react";
|
12278
12433
|
var Navigation = (_a) => {
|
12279
12434
|
var _b = _a, { className, children } = _b, rest = __objRest(_b, ["className", "children"]);
|
12280
|
-
return /* @__PURE__ */
|
12435
|
+
return /* @__PURE__ */ React85.createElement("nav", {
|
12281
12436
|
className: classNames(tw("bg-grey-0 h-full"))
|
12282
|
-
}, /* @__PURE__ */
|
12437
|
+
}, /* @__PURE__ */ React85.createElement("ul", __spreadProps(__spreadValues({}, rest), {
|
12283
12438
|
className: classNames(tw("flex flex-col h-full"), className),
|
12284
12439
|
role: "menu"
|
12285
12440
|
}), children));
|
12286
12441
|
};
|
12287
12442
|
var Header = (_a) => {
|
12288
12443
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
12289
|
-
return /* @__PURE__ */
|
12444
|
+
return /* @__PURE__ */ React85.createElement("li", __spreadProps(__spreadValues({}, rest), {
|
12290
12445
|
role: "presentation",
|
12291
12446
|
className: classNames(tw("px-6 py-5"), className)
|
12292
12447
|
}));
|
12293
12448
|
};
|
12294
12449
|
var Footer = (_a) => {
|
12295
12450
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
12296
|
-
return /* @__PURE__ */
|
12451
|
+
return /* @__PURE__ */ React85.createElement("li", __spreadProps(__spreadValues({}, rest), {
|
12297
12452
|
role: "presentation",
|
12298
12453
|
className: classNames(tw("px-6 py-5 mt-auto"), className)
|
12299
12454
|
}));
|
12300
12455
|
};
|
12301
12456
|
var Section2 = (_a) => {
|
12302
12457
|
var _b = _a, { title, className } = _b, rest = __objRest(_b, ["title", "className"]);
|
12303
|
-
return /* @__PURE__ */
|
12458
|
+
return /* @__PURE__ */ React85.createElement("li", {
|
12304
12459
|
role: "presentation",
|
12305
12460
|
className: tw("py-5")
|
12306
|
-
}, title && /* @__PURE__ */
|
12461
|
+
}, title && /* @__PURE__ */ React85.createElement("div", {
|
12307
12462
|
className: classNames(className, "py-2 px-6 text-grey-40 uppercase cursor-default typography-caption")
|
12308
|
-
}, title), /* @__PURE__ */
|
12463
|
+
}, title), /* @__PURE__ */ React85.createElement("ul", __spreadProps(__spreadValues({}, rest), {
|
12309
12464
|
role: "group",
|
12310
12465
|
className: classNames(tw("flex flex-col"), className)
|
12311
12466
|
})));
|
12312
12467
|
};
|
12313
12468
|
var Divider3 = (_a) => {
|
12314
12469
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
12315
|
-
return /* @__PURE__ */
|
12470
|
+
return /* @__PURE__ */ React85.createElement("li", __spreadProps(__spreadValues({
|
12316
12471
|
role: "separator"
|
12317
12472
|
}, rest), {
|
12318
12473
|
className: classNames(tw("border-t-2 border-grey-5"), className)
|
@@ -12320,9 +12475,9 @@ var Divider3 = (_a) => {
|
|
12320
12475
|
};
|
12321
12476
|
var Item5 = (_a) => {
|
12322
12477
|
var _b = _a, { className, active } = _b, rest = __objRest(_b, ["className", "active"]);
|
12323
|
-
return /* @__PURE__ */
|
12478
|
+
return /* @__PURE__ */ React85.createElement("li", {
|
12324
12479
|
role: "presentation"
|
12325
|
-
}, /* @__PURE__ */
|
12480
|
+
}, /* @__PURE__ */ React85.createElement("a", __spreadProps(__spreadValues({}, rest), {
|
12326
12481
|
role: "menuitem",
|
12327
12482
|
className: classNames(
|
12328
12483
|
tw("py-3 px-6 hover:bg-grey-5 cursor-pointer flex gap-4 items-center typography-small focusable", {
|
@@ -12342,7 +12497,7 @@ Navigation.Divider = Divider3;
|
|
12342
12497
|
// src/molecules/Navigation/Navigation.tsx
|
12343
12498
|
var Navigation2 = (_a) => {
|
12344
12499
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
12345
|
-
return /* @__PURE__ */
|
12500
|
+
return /* @__PURE__ */ React86.createElement(Navigation, __spreadValues({
|
12346
12501
|
className: classNames9("Aquarium-Navigation", className)
|
12347
12502
|
}, props));
|
12348
12503
|
};
|
@@ -12356,11 +12511,11 @@ var Item6 = (_a) => {
|
|
12356
12511
|
"icon",
|
12357
12512
|
"showNotification"
|
12358
12513
|
]);
|
12359
|
-
return /* @__PURE__ */
|
12514
|
+
return /* @__PURE__ */ React86.createElement(Navigation.Item, __spreadValues({}, rest), icon && showNotification && /* @__PURE__ */ React86.createElement(Badge.Notification, null, /* @__PURE__ */ React86.createElement(InlineIcon, {
|
12360
12515
|
icon,
|
12361
12516
|
width: "20px",
|
12362
12517
|
height: "20px"
|
12363
|
-
})), icon && !showNotification && /* @__PURE__ */
|
12518
|
+
})), icon && !showNotification && /* @__PURE__ */ React86.createElement(InlineIcon, {
|
12364
12519
|
icon,
|
12365
12520
|
width: "20px",
|
12366
12521
|
height: "20px"
|
@@ -12373,33 +12528,32 @@ Navigation2.Header = Navigation.Header;
|
|
12373
12528
|
Navigation2.Section = Navigation.Section;
|
12374
12529
|
|
12375
12530
|
// src/molecules/PageHeader/PageHeader.tsx
|
12376
|
-
import
|
12531
|
+
import React88 from "react";
|
12377
12532
|
import castArray3 from "lodash/castArray";
|
12378
|
-
import omit15 from "lodash/omit";
|
12379
12533
|
|
12380
12534
|
// src/atoms/PageHeader/PageHeader.tsx
|
12381
|
-
import
|
12535
|
+
import React87 from "react";
|
12382
12536
|
var PageHeader = (_a) => {
|
12383
12537
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12384
|
-
return /* @__PURE__ */
|
12538
|
+
return /* @__PURE__ */ React87.createElement("div", __spreadValues({
|
12385
12539
|
className: classNames(tw("flex flex-row gap-4 pb-6"), className)
|
12386
12540
|
}, rest), children);
|
12387
12541
|
};
|
12388
12542
|
PageHeader.Container = (_a) => {
|
12389
12543
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12390
|
-
return /* @__PURE__ */
|
12544
|
+
return /* @__PURE__ */ React87.createElement("div", __spreadValues({
|
12391
12545
|
className: classNames(tw("flex flex-col grow gap-0"), className)
|
12392
12546
|
}, rest), children);
|
12393
12547
|
};
|
12394
12548
|
PageHeader.TitleContainer = (_a) => {
|
12395
12549
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12396
|
-
return /* @__PURE__ */
|
12550
|
+
return /* @__PURE__ */ React87.createElement("div", __spreadValues({
|
12397
12551
|
className: classNames(tw("flex flex-col justify-center gap-2"), className)
|
12398
12552
|
}, rest), children);
|
12399
12553
|
};
|
12400
12554
|
PageHeader.Title = (_a) => {
|
12401
12555
|
var _b = _a, { isSubHeader = false, children } = _b, rest = __objRest(_b, ["isSubHeader", "children"]);
|
12402
|
-
return /* @__PURE__ */
|
12556
|
+
return /* @__PURE__ */ React87.createElement(Typography2, __spreadProps(__spreadValues({}, rest), {
|
12403
12557
|
color: "grey-100",
|
12404
12558
|
variant: isSubHeader ? "subheading" : "heading",
|
12405
12559
|
htmlTag: isSubHeader ? "h2" : "h1"
|
@@ -12407,19 +12561,19 @@ PageHeader.Title = (_a) => {
|
|
12407
12561
|
};
|
12408
12562
|
PageHeader.Subtitle = (_a) => {
|
12409
12563
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
12410
|
-
return /* @__PURE__ */
|
12564
|
+
return /* @__PURE__ */ React87.createElement(Typography2.Small, __spreadProps(__spreadValues({}, rest), {
|
12411
12565
|
color: "grey-70"
|
12412
12566
|
}), children);
|
12413
12567
|
};
|
12414
12568
|
PageHeader.Chips = (_a) => {
|
12415
12569
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12416
|
-
return /* @__PURE__ */
|
12570
|
+
return /* @__PURE__ */ React87.createElement("div", __spreadValues({
|
12417
12571
|
className: classNames(tw("flex gap-3"), className)
|
12418
12572
|
}, rest), children);
|
12419
12573
|
};
|
12420
12574
|
PageHeader.Actions = (_a) => {
|
12421
12575
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12422
|
-
return /* @__PURE__ */
|
12576
|
+
return /* @__PURE__ */ React87.createElement("div", __spreadValues({
|
12423
12577
|
className: classNames(tw("flex flex-row gap-4 self-start"), className)
|
12424
12578
|
}, rest), children);
|
12425
12579
|
};
|
@@ -12437,80 +12591,69 @@ var CommonPageHeader = ({
|
|
12437
12591
|
chips = [],
|
12438
12592
|
breadcrumbs,
|
12439
12593
|
menu,
|
12440
|
-
menuLabel
|
12594
|
+
menuLabel,
|
12595
|
+
menuAriaLabel = menuLabel != null ? menuLabel : "Context menu",
|
12441
12596
|
onAction,
|
12442
12597
|
onMenuOpenChange,
|
12443
12598
|
isSubHeader = false
|
12444
12599
|
}) => {
|
12445
|
-
return /* @__PURE__ */
|
12600
|
+
return /* @__PURE__ */ React88.createElement(PageHeader, {
|
12446
12601
|
className: "Aquarium-PageHeader"
|
12447
|
-
}, /* @__PURE__ */
|
12602
|
+
}, /* @__PURE__ */ React88.createElement(PageHeader.Container, null, breadcrumbs && /* @__PURE__ */ React88.createElement(Box, {
|
12448
12603
|
marginBottom: "3"
|
12449
|
-
}, /* @__PURE__ */
|
12604
|
+
}, /* @__PURE__ */ React88.createElement(Breadcrumbs, null, breadcrumbs)), /* @__PURE__ */ React88.createElement(Spacing, {
|
12450
12605
|
row: true,
|
12451
12606
|
gap: "5"
|
12452
|
-
}, image && /* @__PURE__ */
|
12607
|
+
}, image && /* @__PURE__ */ React88.createElement("img", {
|
12453
12608
|
src: image,
|
12454
12609
|
alt: imageAlt,
|
12455
12610
|
className: tw("w-[56px] h-[56px]")
|
12456
|
-
}), /* @__PURE__ */
|
12611
|
+
}), /* @__PURE__ */ React88.createElement(PageHeader.TitleContainer, null, /* @__PURE__ */ React88.createElement(PageHeader.Title, {
|
12457
12612
|
isSubHeader
|
12458
|
-
}, title), chips.length > 0 && /* @__PURE__ */
|
12613
|
+
}, title), chips.length > 0 && /* @__PURE__ */ React88.createElement(PageHeader.Chips, null, chips.map((chip) => /* @__PURE__ */ React88.createElement(Chip2, {
|
12459
12614
|
key: chip,
|
12460
12615
|
dense: true,
|
12461
12616
|
text: chip
|
12462
|
-
}))), subtitle && /* @__PURE__ */
|
12617
|
+
}))), subtitle && /* @__PURE__ */ React88.createElement(PageHeader.Subtitle, null, subtitle)))), (secondaryActions || primaryAction || secondaryAction || menu) && /* @__PURE__ */ React88.createElement(PageHeader.Actions, null, menu && /* @__PURE__ */ React88.createElement(Box.Flex, {
|
12463
12618
|
alignItems: "center"
|
12464
|
-
}, /* @__PURE__ */
|
12619
|
+
}, /* @__PURE__ */ React88.createElement(DropdownMenu2, {
|
12465
12620
|
onAction: (action) => onAction == null ? void 0 : onAction(action),
|
12466
12621
|
onOpenChange: onMenuOpenChange
|
12467
|
-
}, /* @__PURE__ */
|
12468
|
-
"aria-label":
|
12622
|
+
}, /* @__PURE__ */ React88.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ React88.createElement(Button.Icon, {
|
12623
|
+
"aria-label": menuAriaLabel,
|
12469
12624
|
icon: import_more4.default
|
12470
|
-
})), menu)), secondaryActions && castArray3(secondaryActions).filter(Boolean).map(
|
12471
|
-
(action) => !isLink(action) ? /* @__PURE__ */ React87.createElement(Button.Secondary, __spreadValues({
|
12472
|
-
key: action.text
|
12473
|
-
}, omit15(action, "text")), action.text) : /* @__PURE__ */ React87.createElement(Button.ExternalLink, __spreadValues({
|
12474
|
-
key: action.text,
|
12475
|
-
kind: "secondary"
|
12476
|
-
}, omit15(action, "text")), action.text)
|
12477
|
-
), primaryAction && /* @__PURE__ */ React87.createElement(React87.Fragment, null, !isLink(primaryAction) && /* @__PURE__ */ React87.createElement(Button.Primary, __spreadValues({
|
12478
|
-
key: primaryAction.text
|
12479
|
-
}, omit15(primaryAction, "text")), primaryAction.text), isLink(primaryAction) && /* @__PURE__ */ React87.createElement(Button.ExternalLink, __spreadValues({
|
12480
|
-
key: primaryAction.text,
|
12481
|
-
kind: "primary"
|
12482
|
-
}, omit15(primaryAction, "text")), primaryAction.text))));
|
12625
|
+
})), menu)), secondaryActions && castArray3(secondaryActions).filter(Boolean).map((secondaryAction2) => renderAction("secondary", secondaryAction2)), primaryAction && renderAction("primary", primaryAction)));
|
12483
12626
|
};
|
12484
|
-
var PageHeader2 = (props) => /* @__PURE__ */
|
12627
|
+
var PageHeader2 = (props) => /* @__PURE__ */ React88.createElement(CommonPageHeader, __spreadValues({}, props));
|
12485
12628
|
PageHeader2.displayName = "PageHeader";
|
12486
|
-
var SubHeader = (props) => /* @__PURE__ */
|
12629
|
+
var SubHeader = (props) => /* @__PURE__ */ React88.createElement(CommonPageHeader, __spreadProps(__spreadValues({}, props), {
|
12487
12630
|
isSubHeader: true
|
12488
12631
|
}));
|
12489
12632
|
PageHeader2.SubHeader = SubHeader;
|
12490
12633
|
PageHeader2.SubHeader.displayName = "PageHeader.SubHeader";
|
12491
12634
|
|
12492
12635
|
// src/molecules/PopoverDialog/PopoverDialog.tsx
|
12493
|
-
import
|
12494
|
-
import
|
12636
|
+
import React90 from "react";
|
12637
|
+
import omit15 from "lodash/omit";
|
12495
12638
|
|
12496
12639
|
// src/atoms/PopoverDialog/PopoverDialog.tsx
|
12497
|
-
import
|
12640
|
+
import React89 from "react";
|
12498
12641
|
var Header2 = (_a) => {
|
12499
12642
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12500
|
-
return /* @__PURE__ */
|
12643
|
+
return /* @__PURE__ */ React89.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12501
12644
|
className: classNames(tw("p-5 gap-3 flex items-center"), className)
|
12502
12645
|
}), children);
|
12503
12646
|
};
|
12504
12647
|
var Title = (_a) => {
|
12505
12648
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12506
|
-
return /* @__PURE__ */
|
12649
|
+
return /* @__PURE__ */ React89.createElement(Typography, __spreadProps(__spreadValues({}, rest), {
|
12507
12650
|
htmlTag: "h1",
|
12508
12651
|
variant: "small-strong"
|
12509
12652
|
}), children);
|
12510
12653
|
};
|
12511
12654
|
var Body = (_a) => {
|
12512
12655
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12513
|
-
return /* @__PURE__ */
|
12656
|
+
return /* @__PURE__ */ React89.createElement(Typography, __spreadProps(__spreadValues({}, rest), {
|
12514
12657
|
htmlTag: "div",
|
12515
12658
|
variant: "caption",
|
12516
12659
|
className: classNames(tw("px-5 overflow-y-auto"), className)
|
@@ -12518,13 +12661,13 @@ var Body = (_a) => {
|
|
12518
12661
|
};
|
12519
12662
|
var Footer2 = (_a) => {
|
12520
12663
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12521
|
-
return /* @__PURE__ */
|
12664
|
+
return /* @__PURE__ */ React89.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12522
12665
|
className: classNames(tw("p-5"), className)
|
12523
12666
|
}), children);
|
12524
12667
|
};
|
12525
12668
|
var Actions2 = (_a) => {
|
12526
12669
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12527
|
-
return /* @__PURE__ */
|
12670
|
+
return /* @__PURE__ */ React89.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12528
12671
|
className: classNames(tw("flex gap-4"), className)
|
12529
12672
|
}), children);
|
12530
12673
|
};
|
@@ -12540,29 +12683,29 @@ var PopoverDialog = {
|
|
12540
12683
|
var PopoverDialog2 = ({ placement, open, title, secondaryAction, primaryAction, children }) => {
|
12541
12684
|
const wrapPromptWithBody = (child) => {
|
12542
12685
|
if (isComponentType(child, PopoverDialog2.Prompt)) {
|
12543
|
-
return /* @__PURE__ */
|
12686
|
+
return /* @__PURE__ */ React90.createElement(Popover2.Panel, {
|
12544
12687
|
className: classNames("Aquarium-PopoverDialog", tw("max-w-[300px]"))
|
12545
|
-
}, /* @__PURE__ */
|
12688
|
+
}, /* @__PURE__ */ React90.createElement(PopoverDialog.Header, null, /* @__PURE__ */ React90.createElement(PopoverDialog.Title, null, title)), child, /* @__PURE__ */ React90.createElement(PopoverDialog.Footer, null, /* @__PURE__ */ React90.createElement(PopoverDialog.Actions, null, secondaryAction && /* @__PURE__ */ React90.createElement(Popover2.Button, __spreadValues({
|
12546
12689
|
kind: "secondary-ghost",
|
12547
12690
|
key: secondaryAction.text,
|
12548
12691
|
dense: true
|
12549
|
-
},
|
12692
|
+
}, omit15(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */ React90.createElement(Popover2.Button, __spreadValues({
|
12550
12693
|
kind: "ghost",
|
12551
12694
|
key: primaryAction.text,
|
12552
12695
|
dense: true
|
12553
|
-
},
|
12696
|
+
}, omit15(primaryAction, "text")), primaryAction.text))));
|
12554
12697
|
}
|
12555
12698
|
return child;
|
12556
12699
|
};
|
12557
|
-
return /* @__PURE__ */
|
12700
|
+
return /* @__PURE__ */ React90.createElement(Popover2, {
|
12558
12701
|
type: "dialog",
|
12559
12702
|
isOpen: open,
|
12560
12703
|
placement,
|
12561
12704
|
containFocus: true
|
12562
|
-
},
|
12705
|
+
}, React90.Children.map(children, wrapPromptWithBody));
|
12563
12706
|
};
|
12564
12707
|
PopoverDialog2.Trigger = Popover2.Trigger;
|
12565
|
-
var Prompt = ({ children }) => /* @__PURE__ */
|
12708
|
+
var Prompt = ({ children }) => /* @__PURE__ */ React90.createElement(PopoverDialog.Body, null, children);
|
12566
12709
|
Prompt.displayName = "PopoverDialog.Prompt";
|
12567
12710
|
PopoverDialog2.Prompt = Prompt;
|
12568
12711
|
|
@@ -12571,14 +12714,14 @@ import { createPortal } from "react-dom";
|
|
12571
12714
|
var Portal = ({ children, to }) => createPortal(children, to);
|
12572
12715
|
|
12573
12716
|
// src/molecules/ProgressBar/ProgressBar.tsx
|
12574
|
-
import
|
12717
|
+
import React92 from "react";
|
12575
12718
|
|
12576
12719
|
// src/atoms/ProgressBar/ProgressBar.tsx
|
12577
|
-
import
|
12720
|
+
import React91 from "react";
|
12578
12721
|
import clamp3 from "lodash/clamp";
|
12579
12722
|
var ProgressBar = (_a) => {
|
12580
12723
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12581
|
-
return /* @__PURE__ */
|
12724
|
+
return /* @__PURE__ */ React91.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12582
12725
|
className: classNames(
|
12583
12726
|
tw("relative flex items-center w-full bg-grey-0 h-2 rounded-full overflow-hidden"),
|
12584
12727
|
className
|
@@ -12594,7 +12737,7 @@ var STATUS_COLORS = {
|
|
12594
12737
|
ProgressBar.Indicator = (_a) => {
|
12595
12738
|
var _b = _a, { min, max, value, "aria-label": ariaLabel, status, className } = _b, rest = __objRest(_b, ["min", "max", "value", "aria-label", "status", "className"]);
|
12596
12739
|
const completedPercentage = clamp3((value - min) / (max - min) * 100, 0, 100);
|
12597
|
-
return /* @__PURE__ */
|
12740
|
+
return /* @__PURE__ */ React91.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12598
12741
|
className: classNames(
|
12599
12742
|
tw("h-2 rounded-full transition-all ease-in-out delay-150"),
|
12600
12743
|
STATUS_COLORS[status],
|
@@ -12610,11 +12753,11 @@ ProgressBar.Indicator = (_a) => {
|
|
12610
12753
|
};
|
12611
12754
|
ProgressBar.Labels = (_a) => {
|
12612
12755
|
var _b = _a, { children, startLabel, endLabel, className } = _b, rest = __objRest(_b, ["children", "startLabel", "endLabel", "className"]);
|
12613
|
-
return /* @__PURE__ */
|
12756
|
+
return /* @__PURE__ */ React91.createElement("div", {
|
12614
12757
|
className: classNames(tw("flex flex-row"), className)
|
12615
|
-
}, /* @__PURE__ */
|
12758
|
+
}, /* @__PURE__ */ React91.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
12616
12759
|
className: tw("grow text-grey-70 typography-caption")
|
12617
|
-
}), startLabel), /* @__PURE__ */
|
12760
|
+
}), startLabel), /* @__PURE__ */ React91.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
12618
12761
|
className: tw("grow text-grey-70 typography-caption text-right")
|
12619
12762
|
}), endLabel));
|
12620
12763
|
};
|
@@ -12632,7 +12775,7 @@ var ProgressBar2 = (props) => {
|
|
12632
12775
|
if (min > max) {
|
12633
12776
|
throw new Error("`min` value provided to `ProgressBar` is greater than `max` value.");
|
12634
12777
|
}
|
12635
|
-
const progress = /* @__PURE__ */
|
12778
|
+
const progress = /* @__PURE__ */ React92.createElement(ProgressBar, null, /* @__PURE__ */ React92.createElement(ProgressBar.Indicator, {
|
12636
12779
|
status: value === max ? completedStatus : progresStatus,
|
12637
12780
|
min,
|
12638
12781
|
max,
|
@@ -12642,15 +12785,15 @@ var ProgressBar2 = (props) => {
|
|
12642
12785
|
if (props.dense) {
|
12643
12786
|
return progress;
|
12644
12787
|
}
|
12645
|
-
return /* @__PURE__ */
|
12788
|
+
return /* @__PURE__ */ React92.createElement("div", {
|
12646
12789
|
className: "Aquarium-ProgressBar"
|
12647
|
-
}, progress, /* @__PURE__ */
|
12790
|
+
}, progress, /* @__PURE__ */ React92.createElement(ProgressBar.Labels, {
|
12648
12791
|
className: tw("py-2"),
|
12649
12792
|
startLabel: props.startLabel,
|
12650
12793
|
endLabel: props.endLabel
|
12651
12794
|
}));
|
12652
12795
|
};
|
12653
|
-
var ProgressBarSkeleton = () => /* @__PURE__ */
|
12796
|
+
var ProgressBarSkeleton = () => /* @__PURE__ */ React92.createElement(Skeleton, {
|
12654
12797
|
height: 4,
|
12655
12798
|
display: "block"
|
12656
12799
|
});
|
@@ -12658,13 +12801,13 @@ ProgressBar2.Skeleton = ProgressBarSkeleton;
|
|
12658
12801
|
ProgressBar2.Skeleton.displayName = "ProgressBar.Skeleton";
|
12659
12802
|
|
12660
12803
|
// src/molecules/RadioButton/RadioButton.tsx
|
12661
|
-
import
|
12662
|
-
var RadioButton2 =
|
12804
|
+
import React93 from "react";
|
12805
|
+
var RadioButton2 = React93.forwardRef(
|
12663
12806
|
(_a, ref) => {
|
12664
12807
|
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"]);
|
12665
12808
|
var _a2;
|
12666
12809
|
const isChecked = (_a2 = props.checked) != null ? _a2 : props.defaultChecked;
|
12667
|
-
return !readOnly || isChecked ? /* @__PURE__ */
|
12810
|
+
return !readOnly || isChecked ? /* @__PURE__ */ React93.createElement(ControlLabel, {
|
12668
12811
|
htmlFor: id,
|
12669
12812
|
label: children,
|
12670
12813
|
"aria-label": ariaLabel,
|
@@ -12673,7 +12816,7 @@ var RadioButton2 = React92.forwardRef(
|
|
12673
12816
|
disabled,
|
12674
12817
|
style: { gap: "0 8px" },
|
12675
12818
|
className: "Aquarium-RadioButton"
|
12676
|
-
}, !readOnly && /* @__PURE__ */
|
12819
|
+
}, !readOnly && /* @__PURE__ */ React93.createElement(RadioButton, __spreadProps(__spreadValues({
|
12677
12820
|
id,
|
12678
12821
|
ref,
|
12679
12822
|
name
|
@@ -12684,12 +12827,12 @@ var RadioButton2 = React92.forwardRef(
|
|
12684
12827
|
}
|
12685
12828
|
);
|
12686
12829
|
RadioButton2.displayName = "RadioButton";
|
12687
|
-
var RadioButtonSkeleton = () => /* @__PURE__ */
|
12830
|
+
var RadioButtonSkeleton = () => /* @__PURE__ */ React93.createElement("div", {
|
12688
12831
|
className: tw("flex gap-3")
|
12689
|
-
}, /* @__PURE__ */
|
12832
|
+
}, /* @__PURE__ */ React93.createElement(Skeleton, {
|
12690
12833
|
height: 20,
|
12691
12834
|
width: 20
|
12692
|
-
}), /* @__PURE__ */
|
12835
|
+
}), /* @__PURE__ */ React93.createElement(Skeleton, {
|
12693
12836
|
height: 20,
|
12694
12837
|
width: 150
|
12695
12838
|
}));
|
@@ -12697,10 +12840,10 @@ RadioButton2.Skeleton = RadioButtonSkeleton;
|
|
12697
12840
|
RadioButton2.Skeleton.displayName = "RadioButton.Skeleton";
|
12698
12841
|
|
12699
12842
|
// src/molecules/RadioButtonGroup/RadioButtonGroup.tsx
|
12700
|
-
import
|
12843
|
+
import React94 from "react";
|
12701
12844
|
import uniqueId8 from "lodash/uniqueId";
|
12702
12845
|
var isRadioButton = (c) => {
|
12703
|
-
return
|
12846
|
+
return React94.isValidElement(c) && c.type === RadioButton2;
|
12704
12847
|
};
|
12705
12848
|
var RadioButtonGroup = (_a) => {
|
12706
12849
|
var _b = _a, {
|
@@ -12723,7 +12866,7 @@ var RadioButtonGroup = (_a) => {
|
|
12723
12866
|
"children"
|
12724
12867
|
]);
|
12725
12868
|
var _a2;
|
12726
|
-
const [value, setValue] =
|
12869
|
+
const [value, setValue] = React94.useState((_a2 = _value != null ? _value : defaultValue) != null ? _a2 : "");
|
12727
12870
|
const errorMessageId = uniqueId8();
|
12728
12871
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
12729
12872
|
const labelControlProps = getLabelControlProps(props);
|
@@ -12734,14 +12877,14 @@ var RadioButtonGroup = (_a) => {
|
|
12734
12877
|
setValue(e.target.value);
|
12735
12878
|
onChange == null ? void 0 : onChange(e.target.value);
|
12736
12879
|
};
|
12737
|
-
const content =
|
12880
|
+
const content = React94.Children.map(children, (c) => {
|
12738
12881
|
var _a3, _b2, _c;
|
12739
12882
|
if (!isRadioButton(c)) {
|
12740
12883
|
return null;
|
12741
12884
|
}
|
12742
12885
|
const defaultChecked = defaultValue === void 0 ? void 0 : c.props.value === defaultValue;
|
12743
12886
|
const checked = value === void 0 ? void 0 : c.props.value === value;
|
12744
|
-
return
|
12887
|
+
return React94.cloneElement(c, {
|
12745
12888
|
name,
|
12746
12889
|
defaultChecked: (_a3 = c.props.defaultChecked) != null ? _a3 : defaultChecked,
|
12747
12890
|
checked: (_b2 = c.props.checked) != null ? _b2 : checked,
|
@@ -12750,13 +12893,13 @@ var RadioButtonGroup = (_a) => {
|
|
12750
12893
|
readOnly
|
12751
12894
|
});
|
12752
12895
|
});
|
12753
|
-
return /* @__PURE__ */
|
12896
|
+
return /* @__PURE__ */ React94.createElement(LabelControl, __spreadProps(__spreadValues(__spreadValues({
|
12754
12897
|
fieldset: true
|
12755
12898
|
}, labelControlProps), errorProps), {
|
12756
12899
|
className: "Aquarium-RadioButtonGroup"
|
12757
|
-
}), cols && /* @__PURE__ */
|
12900
|
+
}), cols && /* @__PURE__ */ React94.createElement(InputGroup, {
|
12758
12901
|
cols
|
12759
|
-
}, content), !cols && /* @__PURE__ */
|
12902
|
+
}, content), !cols && /* @__PURE__ */ React94.createElement(Flexbox, {
|
12760
12903
|
direction,
|
12761
12904
|
alignItems: "flex-start",
|
12762
12905
|
colGap: "8",
|
@@ -12765,12 +12908,12 @@ var RadioButtonGroup = (_a) => {
|
|
12765
12908
|
}, content));
|
12766
12909
|
};
|
12767
12910
|
var RadioButtonGroupSkeleton = ({ direction = "row", options = 2 }) => {
|
12768
|
-
return /* @__PURE__ */
|
12911
|
+
return /* @__PURE__ */ React94.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React94.createElement("div", {
|
12769
12912
|
className: tw("flex flex-wrap", {
|
12770
12913
|
"flex-row gap-8": direction === "row",
|
12771
12914
|
"flex-col gap-2": direction === "column"
|
12772
12915
|
})
|
12773
|
-
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */
|
12916
|
+
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */ React94.createElement(RadioButton2.Skeleton, {
|
12774
12917
|
key
|
12775
12918
|
}))));
|
12776
12919
|
};
|
@@ -12778,16 +12921,118 @@ RadioButtonGroup.Skeleton = RadioButtonGroupSkeleton;
|
|
12778
12921
|
RadioButtonGroup.Skeleton.displayName = "RadioButtonGroup.Skeleton";
|
12779
12922
|
|
12780
12923
|
// src/molecules/Section/Section.tsx
|
12781
|
-
import
|
12924
|
+
import React100 from "react";
|
12782
12925
|
import { useId as useId3 } from "@react-aria/utils";
|
12783
12926
|
import { animated as animated3, useSpring as useSpring2 } from "@react-spring/web";
|
12784
12927
|
import castArray4 from "lodash/castArray";
|
12785
12928
|
import isUndefined8 from "lodash/isUndefined";
|
12786
12929
|
import noop from "lodash/noop";
|
12787
|
-
|
12930
|
+
|
12931
|
+
// src/molecules/Switch/Switch.tsx
|
12932
|
+
import React96 from "react";
|
12933
|
+
|
12934
|
+
// src/atoms/Switch/Switch.tsx
|
12935
|
+
import React95 from "react";
|
12936
|
+
var import_ban2 = __toESM(require_ban());
|
12937
|
+
var Switch = React95.forwardRef(
|
12938
|
+
(_a, ref) => {
|
12939
|
+
var _b = _a, { id, children, name, disabled = false, readOnly = false } = _b, props = __objRest(_b, ["id", "children", "name", "disabled", "readOnly"]);
|
12940
|
+
return /* @__PURE__ */ React95.createElement("span", {
|
12941
|
+
className: tw("relative inline-flex justify-center items-center self-center group")
|
12942
|
+
}, /* @__PURE__ */ React95.createElement("input", __spreadProps(__spreadValues({
|
12943
|
+
id,
|
12944
|
+
ref,
|
12945
|
+
type: "checkbox",
|
12946
|
+
name
|
12947
|
+
}, props), {
|
12948
|
+
className: classNames(
|
12949
|
+
tw(
|
12950
|
+
"appearance-none peer/switch rounded-full inline-block w-[34px] h-[20px] transition duration-300",
|
12951
|
+
"outline-none focusable bg-grey-10",
|
12952
|
+
"cursor-pointer disabled:cursor-not-allowed",
|
12953
|
+
{
|
12954
|
+
"hover:bg-grey-20 checked:bg-primary-80 hover:checked:bg-primary-70": !disabled,
|
12955
|
+
"bg-grey-5 checked:opacity-50 checked:bg-primary-40": disabled
|
12956
|
+
}
|
12957
|
+
)
|
12958
|
+
),
|
12959
|
+
readOnly,
|
12960
|
+
disabled
|
12961
|
+
})), /* @__PURE__ */ React95.createElement("span", {
|
12962
|
+
className: tw(
|
12963
|
+
"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",
|
12964
|
+
"bg-white left-2 peer-checked/switch:left-1 text-grey-30 peer-checked/switch:text-primary-60",
|
12965
|
+
{
|
12966
|
+
"shadow-4dp": !disabled
|
12967
|
+
}
|
12968
|
+
)
|
12969
|
+
}, disabled && /* @__PURE__ */ React95.createElement(Icon, {
|
12970
|
+
icon: import_ban2.default,
|
12971
|
+
width: "10px",
|
12972
|
+
height: "10px"
|
12973
|
+
})));
|
12974
|
+
}
|
12975
|
+
);
|
12976
|
+
|
12977
|
+
// src/molecules/Switch/Switch.tsx
|
12978
|
+
var Switch2 = React96.forwardRef(
|
12979
|
+
(_a, ref) => {
|
12980
|
+
var _b = _a, {
|
12981
|
+
id,
|
12982
|
+
name,
|
12983
|
+
caption,
|
12984
|
+
readOnly = false,
|
12985
|
+
disabled = false,
|
12986
|
+
children,
|
12987
|
+
"aria-label": ariaLabel,
|
12988
|
+
labelPlacement
|
12989
|
+
} = _b, props = __objRest(_b, [
|
12990
|
+
"id",
|
12991
|
+
"name",
|
12992
|
+
"caption",
|
12993
|
+
"readOnly",
|
12994
|
+
"disabled",
|
12995
|
+
"children",
|
12996
|
+
"aria-label",
|
12997
|
+
"labelPlacement"
|
12998
|
+
]);
|
12999
|
+
var _a2;
|
13000
|
+
const isChecked = (_a2 = props.checked) != null ? _a2 : props.defaultChecked;
|
13001
|
+
return !readOnly || isChecked ? /* @__PURE__ */ React96.createElement(ControlLabel, {
|
13002
|
+
htmlFor: id,
|
13003
|
+
label: children,
|
13004
|
+
"aria-label": ariaLabel,
|
13005
|
+
caption,
|
13006
|
+
readOnly,
|
13007
|
+
disabled,
|
13008
|
+
style: { gap: "0 8px" },
|
13009
|
+
labelPlacement,
|
13010
|
+
className: "Aquarium-Switch"
|
13011
|
+
}, !readOnly && /* @__PURE__ */ React96.createElement(Switch, __spreadProps(__spreadValues({
|
13012
|
+
id,
|
13013
|
+
ref,
|
13014
|
+
name
|
13015
|
+
}, props), {
|
13016
|
+
readOnly,
|
13017
|
+
disabled
|
13018
|
+
}))) : null;
|
13019
|
+
}
|
13020
|
+
);
|
13021
|
+
Switch2.displayName = "Switch";
|
13022
|
+
var SwitchSkeleton = () => /* @__PURE__ */ React96.createElement("div", {
|
13023
|
+
className: tw("flex gap-3")
|
13024
|
+
}, /* @__PURE__ */ React96.createElement(Skeleton, {
|
13025
|
+
height: 20,
|
13026
|
+
width: 35
|
13027
|
+
}), /* @__PURE__ */ React96.createElement(Skeleton, {
|
13028
|
+
height: 20,
|
13029
|
+
width: 150
|
13030
|
+
}));
|
13031
|
+
Switch2.Skeleton = SwitchSkeleton;
|
13032
|
+
Switch2.Skeleton.displayName = "Switch.Skeleton ";
|
12788
13033
|
|
12789
13034
|
// src/molecules/TagLabel/TagLabel.tsx
|
12790
|
-
import
|
13035
|
+
import React97 from "react";
|
12791
13036
|
var getVariantClassNames = (variant = "primary") => {
|
12792
13037
|
switch (variant) {
|
12793
13038
|
case "danger":
|
@@ -12801,7 +13046,7 @@ var getVariantClassNames = (variant = "primary") => {
|
|
12801
13046
|
};
|
12802
13047
|
var TagLabel = (_a) => {
|
12803
13048
|
var _b = _a, { title, dense = false, variant } = _b, rest = __objRest(_b, ["title", "dense", "variant"]);
|
12804
|
-
return /* @__PURE__ */
|
13049
|
+
return /* @__PURE__ */ React97.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
12805
13050
|
className: classNames(
|
12806
13051
|
"Aquarium-TagLabel",
|
12807
13052
|
getVariantClassNames(variant),
|
@@ -12814,41 +13059,42 @@ var TagLabel = (_a) => {
|
|
12814
13059
|
};
|
12815
13060
|
|
12816
13061
|
// src/atoms/Section/Section.tsx
|
12817
|
-
import
|
13062
|
+
import React98 from "react";
|
12818
13063
|
var import_caretUp2 = __toESM(require_caretUp());
|
12819
13064
|
var Section3 = (_a) => {
|
12820
13065
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
12821
|
-
return /* @__PURE__ */
|
13066
|
+
return /* @__PURE__ */ React98.createElement(Box, __spreadValues({
|
13067
|
+
component: "section",
|
12822
13068
|
borderColor: "grey-5",
|
12823
13069
|
borderWidth: "1px"
|
12824
13070
|
}, rest), children);
|
12825
13071
|
};
|
12826
13072
|
Section3.Header = (_a) => {
|
12827
13073
|
var _b = _a, { children, className, collapsible } = _b, rest = __objRest(_b, ["children", "className", "collapsible"]);
|
12828
|
-
return /* @__PURE__ */
|
13074
|
+
return /* @__PURE__ */ React98.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12829
13075
|
className: classNames(
|
12830
|
-
tw("px-6
|
13076
|
+
tw("px-6 flex gap-5 justify-between items-center h-[72px]", { "bg-grey-0": collapsible }),
|
12831
13077
|
className
|
12832
13078
|
)
|
12833
13079
|
}), children);
|
12834
13080
|
};
|
12835
13081
|
Section3.TitleContainer = (_a) => {
|
12836
13082
|
var _b = _a, { children, className, collapsible } = _b, rest = __objRest(_b, ["children", "className", "collapsible"]);
|
12837
|
-
return /* @__PURE__ */
|
13083
|
+
return /* @__PURE__ */ React98.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12838
13084
|
className: classNames(
|
12839
13085
|
tw("grow grid grid-cols-[auto_1fr] gap-y-2 gap-x-3 items-center", { "cursor-pointer": collapsible }),
|
12840
13086
|
className
|
12841
13087
|
)
|
12842
13088
|
}), children);
|
12843
13089
|
};
|
12844
|
-
Section3.Toggle = (props) => /* @__PURE__ */
|
13090
|
+
Section3.Toggle = (props) => /* @__PURE__ */ React98.createElement(Icon, __spreadProps(__spreadValues({}, props), {
|
12845
13091
|
icon: import_caretUp2.default,
|
12846
13092
|
height: 22,
|
12847
13093
|
width: 22
|
12848
13094
|
}));
|
12849
13095
|
Section3.Title = (_a) => {
|
12850
13096
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
12851
|
-
return /* @__PURE__ */
|
13097
|
+
return /* @__PURE__ */ React98.createElement(Typography2.Large, __spreadProps(__spreadValues({}, rest), {
|
12852
13098
|
htmlTag: "h2",
|
12853
13099
|
color: "black",
|
12854
13100
|
className: "flex gap-3 items-center"
|
@@ -12856,35 +13102,35 @@ Section3.Title = (_a) => {
|
|
12856
13102
|
};
|
12857
13103
|
Section3.Subtitle = (_a) => {
|
12858
13104
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
12859
|
-
return /* @__PURE__ */
|
13105
|
+
return /* @__PURE__ */ React98.createElement(Typography2.Small, __spreadProps(__spreadValues({}, rest), {
|
12860
13106
|
color: "grey-70"
|
12861
13107
|
}), children);
|
12862
13108
|
};
|
12863
13109
|
Section3.Actions = (_a) => {
|
12864
13110
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12865
|
-
return /* @__PURE__ */
|
13111
|
+
return /* @__PURE__ */ React98.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12866
13112
|
className: classNames(tw("flex gap-4 justify-end"), className)
|
12867
13113
|
}), children);
|
12868
13114
|
};
|
12869
13115
|
Section3.Body = (_a) => {
|
12870
13116
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12871
|
-
return /* @__PURE__ */
|
13117
|
+
return /* @__PURE__ */ React98.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12872
13118
|
className: classNames(tw("p-6"), className)
|
12873
|
-
}), /* @__PURE__ */
|
13119
|
+
}), /* @__PURE__ */ React98.createElement(Typography, {
|
12874
13120
|
htmlTag: "div",
|
12875
13121
|
color: "grey-70"
|
12876
13122
|
}, children));
|
12877
13123
|
};
|
12878
13124
|
|
12879
13125
|
// src/utils/useMeasure.ts
|
12880
|
-
import
|
13126
|
+
import React99 from "react";
|
12881
13127
|
function useMeasure() {
|
12882
|
-
const ref =
|
12883
|
-
const [rect, setRect] =
|
13128
|
+
const ref = React99.useRef(null);
|
13129
|
+
const [rect, setRect] = React99.useState({
|
12884
13130
|
width: null,
|
12885
13131
|
height: null
|
12886
13132
|
});
|
12887
|
-
|
13133
|
+
React99.useLayoutEffect(() => {
|
12888
13134
|
if (!ref.current || !window.ResizeObserver) {
|
12889
13135
|
return;
|
12890
13136
|
}
|
@@ -12905,15 +13151,20 @@ function useMeasure() {
|
|
12905
13151
|
}
|
12906
13152
|
|
12907
13153
|
// src/molecules/Section/Section.tsx
|
13154
|
+
var import_more5 = __toESM(require_more());
|
12908
13155
|
var Section4 = (props) => {
|
12909
|
-
var _a, _b, _c;
|
13156
|
+
var _a, _b, _c, _d, _e, _f;
|
12910
13157
|
const { title, subtitle, actions, children } = props;
|
12911
13158
|
const _collapsible = title ? (_a = props.collapsible) != null ? _a : false : false;
|
12912
13159
|
const _collapsed = title ? props.collapsed : void 0;
|
12913
13160
|
const _defaultCollapsed = title ? (_b = props.defaultCollapsed) != null ? _b : false : false;
|
12914
|
-
const [isCollapsed, setCollapsed] =
|
13161
|
+
const [isCollapsed, setCollapsed] = React100.useState(_collapsed != null ? _collapsed : _defaultCollapsed);
|
12915
13162
|
const [ref, { height }] = useMeasure();
|
12916
|
-
const
|
13163
|
+
const menu = title ? (_c = props.menu) != null ? _c : void 0 : void 0;
|
13164
|
+
const menuAriaLabel = title ? (_e = (_d = props.menuAriaLabel) != null ? _d : props.menuLabel) != null ? _e : "Context menu" : void 0;
|
13165
|
+
const onAction = title ? props.onAction : void 0;
|
13166
|
+
const onMenuOpenChange = title ? props.onMenuOpenChange : void 0;
|
13167
|
+
const _onCollapsedChanged = title && props.collapsible ? (_f = props.onCollapsedChange) != null ? _f : setCollapsed : noop;
|
12917
13168
|
if (title && !isUndefined8(props.collapsed) && props.collapsed !== isCollapsed) {
|
12918
13169
|
setCollapsed(props.collapsed);
|
12919
13170
|
}
|
@@ -12921,7 +13172,7 @@ var Section4 = (props) => {
|
|
12921
13172
|
_onCollapsedChanged(!isCollapsed);
|
12922
13173
|
};
|
12923
13174
|
const targetHeight = isCollapsed ? "0px" : `${height != null ? height : 0}px`;
|
12924
|
-
const
|
13175
|
+
const _g = useSpring2({
|
12925
13176
|
height: height !== null ? targetHeight : void 0,
|
12926
13177
|
opacity: isCollapsed ? 0 : 1,
|
12927
13178
|
transform: `rotate(${isCollapsed ? 0 : 180}deg)`,
|
@@ -12930,49 +13181,54 @@ var Section4 = (props) => {
|
|
12930
13181
|
duration: 150
|
12931
13182
|
},
|
12932
13183
|
immediate: !_collapsible
|
12933
|
-
}), { transform, backgroundColor } =
|
13184
|
+
}), { transform, backgroundColor } = _g, spring = __objRest(_g, ["transform", "backgroundColor"]);
|
12934
13185
|
const toggleId = useId3();
|
12935
13186
|
const regionId = useId3();
|
12936
|
-
return /* @__PURE__ */
|
13187
|
+
return /* @__PURE__ */ React100.createElement(Section3, {
|
13188
|
+
"aria-label": title,
|
12937
13189
|
className: "Aquarium-Section"
|
12938
|
-
}, title && /* @__PURE__ */
|
13190
|
+
}, title && /* @__PURE__ */ React100.createElement(React100.Fragment, null, /* @__PURE__ */ React100.createElement(Section3.Header, {
|
12939
13191
|
collapsible: _collapsible
|
12940
|
-
}, /* @__PURE__ */
|
13192
|
+
}, /* @__PURE__ */ React100.createElement(Section3.TitleContainer, {
|
12941
13193
|
role: _collapsible ? "button" : void 0,
|
12942
13194
|
id: toggleId,
|
12943
13195
|
collapsible: _collapsible,
|
12944
13196
|
onClick: handleTitleClick,
|
12945
13197
|
"aria-expanded": !isCollapsed,
|
12946
13198
|
"aria-controls": regionId
|
12947
|
-
}, _collapsible && /* @__PURE__ */
|
13199
|
+
}, _collapsible && /* @__PURE__ */ React100.createElement(animated3.div, {
|
12948
13200
|
style: { transform }
|
12949
|
-
}, /* @__PURE__ */
|
13201
|
+
}, /* @__PURE__ */ React100.createElement(Section3.Toggle, null)), /* @__PURE__ */ React100.createElement(Section3.Title, null, /* @__PURE__ */ React100.createElement(LineClamp2, {
|
13202
|
+
lines: 1
|
13203
|
+
}, title), props.tag && /* @__PURE__ */ React100.createElement(TagLabel, __spreadValues({}, props.tag)), props.badge && /* @__PURE__ */ React100.createElement(Chip2, {
|
12950
13204
|
text: props.badge
|
12951
|
-
}), props.chip && /* @__PURE__ */
|
13205
|
+
}), props.chip && /* @__PURE__ */ React100.createElement(StatusChip, __spreadValues({}, props.chip))), subtitle && /* @__PURE__ */ React100.createElement(Section3.Subtitle, {
|
12952
13206
|
className: tw("row-start-2", { "col-start-2": _collapsible })
|
12953
|
-
},
|
12954
|
-
|
12955
|
-
|
12956
|
-
|
12957
|
-
|
12958
|
-
|
12959
|
-
|
12960
|
-
|
13207
|
+
}, /* @__PURE__ */ React100.createElement(LineClamp2, {
|
13208
|
+
lines: 1
|
13209
|
+
}, subtitle))), !isCollapsed && /* @__PURE__ */ React100.createElement(Section3.Actions, null, menu && /* @__PURE__ */ React100.createElement(Box.Flex, {
|
13210
|
+
alignItems: "center"
|
13211
|
+
}, /* @__PURE__ */ React100.createElement(DropdownMenu2, {
|
13212
|
+
onAction: (action) => onAction == null ? void 0 : onAction(action),
|
13213
|
+
onOpenChange: onMenuOpenChange
|
13214
|
+
}, /* @__PURE__ */ React100.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ React100.createElement(Button.Icon, {
|
13215
|
+
"aria-label": menuAriaLabel,
|
13216
|
+
icon: import_more5.default
|
13217
|
+
})), menu)), actions && castArray4(actions).filter(Boolean).map((action) => renderAction("secondary", action)), props.switch && /* @__PURE__ */ React100.createElement(Switch2, __spreadValues({}, props.switch)))), /* @__PURE__ */ React100.createElement(animated3.div, {
|
12961
13218
|
className: tw(`h-[1px]`),
|
12962
13219
|
style: { backgroundColor }
|
12963
|
-
})), /* @__PURE__ */
|
13220
|
+
})), /* @__PURE__ */ React100.createElement(animated3.div, {
|
12964
13221
|
id: regionId,
|
12965
|
-
role: "region",
|
12966
13222
|
"aria-hidden": isCollapsed ? true : void 0,
|
12967
13223
|
style: spring,
|
12968
13224
|
className: tw({ "overflow-hidden": _collapsible })
|
12969
|
-
}, /* @__PURE__ */
|
13225
|
+
}, /* @__PURE__ */ React100.createElement("div", {
|
12970
13226
|
ref
|
12971
|
-
}, /* @__PURE__ */
|
13227
|
+
}, /* @__PURE__ */ React100.createElement(Section3.Body, null, children))));
|
12972
13228
|
};
|
12973
13229
|
|
12974
13230
|
// src/molecules/SegmentedControl/SegmentedControl.tsx
|
12975
|
-
import
|
13231
|
+
import React101 from "react";
|
12976
13232
|
var SegmentedControl = (_a) => {
|
12977
13233
|
var _b = _a, {
|
12978
13234
|
children,
|
@@ -12989,7 +13245,7 @@ var SegmentedControl = (_a) => {
|
|
12989
13245
|
"selected",
|
12990
13246
|
"className"
|
12991
13247
|
]);
|
12992
|
-
return /* @__PURE__ */
|
13248
|
+
return /* @__PURE__ */ React101.createElement("li", null, /* @__PURE__ */ React101.createElement("button", __spreadProps(__spreadValues({
|
12993
13249
|
type: "button"
|
12994
13250
|
}, rest), {
|
12995
13251
|
className: classNames(
|
@@ -13023,12 +13279,12 @@ var SegmentedControlGroup = (_a) => {
|
|
13023
13279
|
"border border-grey-20 text-grey-50": variant === "outlined",
|
13024
13280
|
"bg-grey-0": variant === "raised"
|
13025
13281
|
});
|
13026
|
-
return /* @__PURE__ */
|
13282
|
+
return /* @__PURE__ */ React101.createElement("ul", __spreadProps(__spreadValues({}, rest), {
|
13027
13283
|
"aria-label": ariaLabel,
|
13028
13284
|
className: classNames("Aquarium-SegmentedControl", classes2, className)
|
13029
|
-
}),
|
13285
|
+
}), React101.Children.map(
|
13030
13286
|
children,
|
13031
|
-
(child) =>
|
13287
|
+
(child) => React101.cloneElement(child, {
|
13032
13288
|
dense,
|
13033
13289
|
variant,
|
13034
13290
|
onClick: () => onChange(child.props.value),
|
@@ -13066,14 +13322,14 @@ var getCommonClassNames = (dense, selected) => tw(
|
|
13066
13322
|
);
|
13067
13323
|
|
13068
13324
|
// src/molecules/Stepper/Stepper.tsx
|
13069
|
-
import
|
13325
|
+
import React103 from "react";
|
13070
13326
|
|
13071
13327
|
// src/atoms/Stepper/Stepper.tsx
|
13072
|
-
import
|
13328
|
+
import React102 from "react";
|
13073
13329
|
var import_tick6 = __toESM(require_tick());
|
13074
13330
|
var Stepper = (_a) => {
|
13075
13331
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13076
|
-
return /* @__PURE__ */
|
13332
|
+
return /* @__PURE__ */ React102.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13077
13333
|
className: classNames(className)
|
13078
13334
|
}));
|
13079
13335
|
};
|
@@ -13087,7 +13343,7 @@ var ConnectorContainer = (_a) => {
|
|
13087
13343
|
"completed",
|
13088
13344
|
"dense"
|
13089
13345
|
]);
|
13090
|
-
return /* @__PURE__ */
|
13346
|
+
return /* @__PURE__ */ React102.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13091
13347
|
className: classNames(
|
13092
13348
|
tw("absolute w-full -left-1/2", {
|
13093
13349
|
"top-[3px] px-[14px]": Boolean(dense),
|
@@ -13099,7 +13355,7 @@ var ConnectorContainer = (_a) => {
|
|
13099
13355
|
};
|
13100
13356
|
var Connector = (_a) => {
|
13101
13357
|
var _b = _a, { children, className, completed, dense } = _b, rest = __objRest(_b, ["children", "className", "completed", "dense"]);
|
13102
|
-
return /* @__PURE__ */
|
13358
|
+
return /* @__PURE__ */ React102.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13103
13359
|
className: classNames(
|
13104
13360
|
tw("w-full", {
|
13105
13361
|
"bg-grey-20": !completed,
|
@@ -13113,7 +13369,7 @@ var Connector = (_a) => {
|
|
13113
13369
|
};
|
13114
13370
|
var Step = (_a) => {
|
13115
13371
|
var _b = _a, { className, state } = _b, rest = __objRest(_b, ["className", "state"]);
|
13116
|
-
return /* @__PURE__ */
|
13372
|
+
return /* @__PURE__ */ React102.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13117
13373
|
className: classNames(
|
13118
13374
|
tw("flex flex-col items-center text-grey-90 relative text-center", {
|
13119
13375
|
"text-grey-20": state === "inactive"
|
@@ -13134,13 +13390,13 @@ var getDenseClassNames = (state) => tw("h-[8px] w-[8px]", {
|
|
13134
13390
|
});
|
13135
13391
|
var Indicator = (_a) => {
|
13136
13392
|
var _b = _a, { children, className, state, dense } = _b, rest = __objRest(_b, ["children", "className", "state", "dense"]);
|
13137
|
-
return /* @__PURE__ */
|
13393
|
+
return /* @__PURE__ */ React102.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13138
13394
|
className: classNames(
|
13139
13395
|
tw("rounded-full flex justify-center items-center mx-2 mb-3"),
|
13140
13396
|
dense ? getDenseClassNames(state) : getClassNames(state),
|
13141
13397
|
className
|
13142
13398
|
)
|
13143
|
-
}), state === "completed" ? /* @__PURE__ */
|
13399
|
+
}), state === "completed" ? /* @__PURE__ */ React102.createElement(InlineIcon, {
|
13144
13400
|
icon: import_tick6.default
|
13145
13401
|
}) : dense ? null : children);
|
13146
13402
|
};
|
@@ -13151,26 +13407,26 @@ Stepper.ConnectorContainer = ConnectorContainer;
|
|
13151
13407
|
|
13152
13408
|
// src/molecules/Stepper/Stepper.tsx
|
13153
13409
|
var Stepper2 = ({ children, activeIndex, dense }) => {
|
13154
|
-
const steps =
|
13155
|
-
return /* @__PURE__ */
|
13410
|
+
const steps = React103.Children.count(children);
|
13411
|
+
return /* @__PURE__ */ React103.createElement(Stepper, {
|
13156
13412
|
role: "list",
|
13157
13413
|
className: "Aquarium-Stepper"
|
13158
|
-
}, /* @__PURE__ */
|
13414
|
+
}, /* @__PURE__ */ React103.createElement(Template, {
|
13159
13415
|
columns: steps
|
13160
|
-
},
|
13416
|
+
}, React103.Children.map(children, (child, index) => {
|
13161
13417
|
if (!isComponentType(child, Step2)) {
|
13162
13418
|
return new Error("<Stepper> can only have <Stepper.Step> components as children");
|
13163
13419
|
} else {
|
13164
13420
|
const state = index > activeIndex ? "inactive" : index === activeIndex ? "active" : "completed";
|
13165
|
-
return /* @__PURE__ */
|
13421
|
+
return /* @__PURE__ */ React103.createElement(Stepper.Step, {
|
13166
13422
|
state,
|
13167
13423
|
"aria-current": state === "active" ? "step" : false,
|
13168
13424
|
role: "listitem"
|
13169
|
-
}, index > 0 && index <= steps && /* @__PURE__ */
|
13425
|
+
}, index > 0 && index <= steps && /* @__PURE__ */ React103.createElement(Stepper.ConnectorContainer, {
|
13170
13426
|
dense
|
13171
|
-
}, /* @__PURE__ */
|
13427
|
+
}, /* @__PURE__ */ React103.createElement(Stepper.ConnectorContainer.Connector, {
|
13172
13428
|
completed: state === "completed" || state === "active"
|
13173
|
-
})), /* @__PURE__ */
|
13429
|
+
})), /* @__PURE__ */ React103.createElement(Stepper.Step.Indicator, {
|
13174
13430
|
state,
|
13175
13431
|
dense
|
13176
13432
|
}, index + 1), child.props.children);
|
@@ -13182,87 +13438,8 @@ var Step2 = () => null;
|
|
13182
13438
|
Step2.displayName = "Stepper.Step";
|
13183
13439
|
Stepper2.Step = Step2;
|
13184
13440
|
|
13185
|
-
// src/molecules/Switch/Switch.tsx
|
13186
|
-
import React102 from "react";
|
13187
|
-
|
13188
|
-
// src/atoms/Switch/Switch.tsx
|
13189
|
-
import React101 from "react";
|
13190
|
-
var Switch = React101.forwardRef(
|
13191
|
-
(_a, ref) => {
|
13192
|
-
var _b = _a, { id, children, name, disabled = false, readOnly = false } = _b, props = __objRest(_b, ["id", "children", "name", "disabled", "readOnly"]);
|
13193
|
-
return /* @__PURE__ */ React101.createElement("span", {
|
13194
|
-
className: tw("relative inline-flex justify-center items-center self-center group")
|
13195
|
-
}, /* @__PURE__ */ React101.createElement("input", __spreadProps(__spreadValues({
|
13196
|
-
id,
|
13197
|
-
ref,
|
13198
|
-
type: "checkbox",
|
13199
|
-
name
|
13200
|
-
}, props), {
|
13201
|
-
className: classNames(
|
13202
|
-
tw(
|
13203
|
-
"appearance-none peer/switch rounded-full inline-block w-[34px] h-[20px] transition duration-300",
|
13204
|
-
"outline-none focus:border border-info-70 bg-grey-20",
|
13205
|
-
"cursor-pointer disabled:cursor-not-allowed",
|
13206
|
-
{
|
13207
|
-
"hover:bg-grey-30 checked:bg-primary-80 hover:checked:bg-primary-80": !disabled,
|
13208
|
-
"bg-grey-5 checked:opacity-40 checked:bg-primary-40": disabled
|
13209
|
-
}
|
13210
|
-
)
|
13211
|
-
),
|
13212
|
-
readOnly,
|
13213
|
-
disabled
|
13214
|
-
})), /* @__PURE__ */ React101.createElement("span", {
|
13215
|
-
className: tw(
|
13216
|
-
"pointer-events-none rounded-full absolute inline-block transition duration-300 h-4 w-4 transform peer-checked/switch:translate-x-5",
|
13217
|
-
"bg-white peer-disabled/switch:bg-grey-0 left-2 peer-checked/switch:left-1",
|
13218
|
-
{
|
13219
|
-
"shadow-4dp": !disabled
|
13220
|
-
}
|
13221
|
-
)
|
13222
|
-
}));
|
13223
|
-
}
|
13224
|
-
);
|
13225
|
-
|
13226
|
-
// src/molecules/Switch/Switch.tsx
|
13227
|
-
var Switch2 = React102.forwardRef(
|
13228
|
-
(_a, ref) => {
|
13229
|
-
var _b = _a, { id, name, caption, readOnly = false, disabled = false, children, "aria-label": ariaLabel } = _b, props = __objRest(_b, ["id", "name", "caption", "readOnly", "disabled", "children", "aria-label"]);
|
13230
|
-
var _a2;
|
13231
|
-
const isChecked = (_a2 = props.checked) != null ? _a2 : props.defaultChecked;
|
13232
|
-
return !readOnly || isChecked ? /* @__PURE__ */ React102.createElement(ControlLabel, {
|
13233
|
-
htmlFor: id,
|
13234
|
-
label: children,
|
13235
|
-
"aria-label": ariaLabel,
|
13236
|
-
caption,
|
13237
|
-
readOnly,
|
13238
|
-
disabled,
|
13239
|
-
style: { gap: "0 8px" },
|
13240
|
-
className: "Aquarium-Switch"
|
13241
|
-
}, !readOnly && /* @__PURE__ */ React102.createElement(Switch, __spreadProps(__spreadValues({
|
13242
|
-
id,
|
13243
|
-
ref,
|
13244
|
-
name
|
13245
|
-
}, props), {
|
13246
|
-
readOnly,
|
13247
|
-
disabled
|
13248
|
-
}))) : null;
|
13249
|
-
}
|
13250
|
-
);
|
13251
|
-
Switch2.displayName = "Switch";
|
13252
|
-
var SwitchSkeleton = () => /* @__PURE__ */ React102.createElement("div", {
|
13253
|
-
className: tw("flex gap-3")
|
13254
|
-
}, /* @__PURE__ */ React102.createElement(Skeleton, {
|
13255
|
-
height: 20,
|
13256
|
-
width: 35
|
13257
|
-
}), /* @__PURE__ */ React102.createElement(Skeleton, {
|
13258
|
-
height: 20,
|
13259
|
-
width: 150
|
13260
|
-
}));
|
13261
|
-
Switch2.Skeleton = SwitchSkeleton;
|
13262
|
-
Switch2.Skeleton.displayName = "Switch.Skeleton ";
|
13263
|
-
|
13264
13441
|
// src/molecules/SwitchGroup/SwitchGroup.tsx
|
13265
|
-
import
|
13442
|
+
import React104, { useState as useState12 } from "react";
|
13266
13443
|
import uniqueId9 from "lodash/uniqueId";
|
13267
13444
|
var SwitchGroup = (_a) => {
|
13268
13445
|
var _b = _a, {
|
@@ -13294,13 +13471,13 @@ var SwitchGroup = (_a) => {
|
|
13294
13471
|
setSelectedItems(updated);
|
13295
13472
|
onChange == null ? void 0 : onChange(updated);
|
13296
13473
|
};
|
13297
|
-
return /* @__PURE__ */
|
13474
|
+
return /* @__PURE__ */ React104.createElement(LabelControl, __spreadProps(__spreadValues(__spreadValues({
|
13298
13475
|
fieldset: true
|
13299
13476
|
}, labelControlProps), errorProps), {
|
13300
13477
|
className: "Aquarium-SwitchGroup"
|
13301
|
-
}), /* @__PURE__ */
|
13478
|
+
}), /* @__PURE__ */ React104.createElement(InputGroup, {
|
13302
13479
|
cols
|
13303
|
-
},
|
13480
|
+
}, React104.Children.map(children, (c) => {
|
13304
13481
|
var _a3, _b2, _c, _d;
|
13305
13482
|
if (!isComponentType(c, Switch2)) {
|
13306
13483
|
return null;
|
@@ -13308,7 +13485,7 @@ var SwitchGroup = (_a) => {
|
|
13308
13485
|
const str = (_a3 = c.props.value) == null ? void 0 : _a3.toString();
|
13309
13486
|
const defaultChecked = defaultValue === void 0 ? void 0 : str !== void 0 && defaultValue.includes(str);
|
13310
13487
|
const checked = value === void 0 ? void 0 : str !== void 0 && value.includes(str);
|
13311
|
-
return
|
13488
|
+
return React104.cloneElement(c, {
|
13312
13489
|
defaultChecked: (_b2 = c.props.defaultChecked) != null ? _b2 : defaultChecked,
|
13313
13490
|
checked: (_c = c.props.checked) != null ? _c : checked,
|
13314
13491
|
onChange: (_d = c.props.onChange) != null ? _d : handleChange,
|
@@ -13318,9 +13495,9 @@ var SwitchGroup = (_a) => {
|
|
13318
13495
|
})));
|
13319
13496
|
};
|
13320
13497
|
var SwitchGroupSkeleton = ({ options = 2 }) => {
|
13321
|
-
return /* @__PURE__ */
|
13498
|
+
return /* @__PURE__ */ React104.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React104.createElement("div", {
|
13322
13499
|
className: tw("flex flex-wrap flex-col gap-2")
|
13323
|
-
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */
|
13500
|
+
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */ React104.createElement(Switch2.Skeleton, {
|
13324
13501
|
key
|
13325
13502
|
}))));
|
13326
13503
|
};
|
@@ -13328,14 +13505,14 @@ SwitchGroup.Skeleton = SwitchGroupSkeleton;
|
|
13328
13505
|
SwitchGroup.Skeleton.displayName = "SwitchGroup.Skeleton";
|
13329
13506
|
|
13330
13507
|
// src/molecules/Textarea/Textarea.tsx
|
13331
|
-
import
|
13332
|
-
import
|
13508
|
+
import React105, { useRef as useRef13, useState as useState13 } from "react";
|
13509
|
+
import omit16 from "lodash/omit";
|
13333
13510
|
import toString2 from "lodash/toString";
|
13334
13511
|
import uniqueId10 from "lodash/uniqueId";
|
13335
|
-
var TextareaBase =
|
13512
|
+
var TextareaBase = React105.forwardRef(
|
13336
13513
|
(_a, ref) => {
|
13337
13514
|
var _b = _a, { readOnly = false, valid = true } = _b, props = __objRest(_b, ["readOnly", "valid"]);
|
13338
|
-
return /* @__PURE__ */
|
13515
|
+
return /* @__PURE__ */ React105.createElement("textarea", __spreadProps(__spreadValues({
|
13339
13516
|
ref
|
13340
13517
|
}, props), {
|
13341
13518
|
readOnly,
|
@@ -13343,25 +13520,25 @@ var TextareaBase = React104.forwardRef(
|
|
13343
13520
|
}));
|
13344
13521
|
}
|
13345
13522
|
);
|
13346
|
-
TextareaBase.Skeleton = () => /* @__PURE__ */
|
13523
|
+
TextareaBase.Skeleton = () => /* @__PURE__ */ React105.createElement(Skeleton, {
|
13347
13524
|
height: 58
|
13348
13525
|
});
|
13349
|
-
var Textarea =
|
13526
|
+
var Textarea = React105.forwardRef((props, ref) => {
|
13350
13527
|
var _a, _b, _c;
|
13351
13528
|
const [value, setValue] = useState13((_b = (_a = props.value) != null ? _a : props.defaultValue) != null ? _b : "");
|
13352
13529
|
const id = useRef13((_c = props.id) != null ? _c : `textarea-${uniqueId10()}`);
|
13353
13530
|
const errorMessageId = uniqueId10();
|
13354
13531
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
13355
13532
|
const _d = getLabelControlProps(props), { "data-testid": dataTestId } = _d, labelControlProps = __objRest(_d, ["data-testid"]);
|
13356
|
-
const baseProps =
|
13357
|
-
return /* @__PURE__ */
|
13533
|
+
const baseProps = omit16(props, Object.keys(labelControlProps));
|
13534
|
+
return /* @__PURE__ */ React105.createElement(LabelControl, __spreadProps(__spreadValues({
|
13358
13535
|
id: `${id.current}-label`,
|
13359
13536
|
htmlFor: id.current,
|
13360
13537
|
messageId: errorMessageId,
|
13361
13538
|
length: value !== void 0 ? toString2(value).length : void 0
|
13362
13539
|
}, labelControlProps), {
|
13363
13540
|
className: "Aquarium-Textarea"
|
13364
|
-
}), /* @__PURE__ */
|
13541
|
+
}), /* @__PURE__ */ React105.createElement(TextareaBase, __spreadProps(__spreadValues(__spreadValues({
|
13365
13542
|
ref
|
13366
13543
|
}, baseProps), errorProps), {
|
13367
13544
|
id: id.current,
|
@@ -13378,48 +13555,48 @@ var Textarea = React104.forwardRef((props, ref) => {
|
|
13378
13555
|
})));
|
13379
13556
|
});
|
13380
13557
|
Textarea.displayName = "Textarea";
|
13381
|
-
var TextAreaSkeleton = () => /* @__PURE__ */
|
13558
|
+
var TextAreaSkeleton = () => /* @__PURE__ */ React105.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React105.createElement(TextareaBase.Skeleton, null));
|
13382
13559
|
Textarea.Skeleton = TextAreaSkeleton;
|
13383
13560
|
Textarea.Skeleton.displayName = "Textarea.Skeleton";
|
13384
13561
|
|
13385
13562
|
// src/molecules/Timeline/Timeline.tsx
|
13386
|
-
import
|
13563
|
+
import React107 from "react";
|
13387
13564
|
|
13388
13565
|
// src/atoms/Timeline/Timeline.tsx
|
13389
|
-
import
|
13566
|
+
import React106 from "react";
|
13390
13567
|
var Timeline = (_a) => {
|
13391
13568
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13392
|
-
return /* @__PURE__ */
|
13569
|
+
return /* @__PURE__ */ React106.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13393
13570
|
className: classNames(tw("grid grid-cols-[16px_1fr] gap-x-4"), className)
|
13394
13571
|
}));
|
13395
13572
|
};
|
13396
13573
|
var Content2 = (_a) => {
|
13397
13574
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13398
|
-
return /* @__PURE__ */
|
13575
|
+
return /* @__PURE__ */ React106.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13399
13576
|
className: classNames(tw("pb-6"), className)
|
13400
13577
|
}));
|
13401
13578
|
};
|
13402
13579
|
var Separator2 = (_a) => {
|
13403
13580
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13404
|
-
return /* @__PURE__ */
|
13581
|
+
return /* @__PURE__ */ React106.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13405
13582
|
className: classNames(tw("flex items-center justify-center h-5 w-5"), className)
|
13406
13583
|
}));
|
13407
13584
|
};
|
13408
13585
|
var LineContainer = (_a) => {
|
13409
13586
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13410
|
-
return /* @__PURE__ */
|
13587
|
+
return /* @__PURE__ */ React106.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13411
13588
|
className: classNames(tw("flex justify-center py-1"), className)
|
13412
13589
|
}));
|
13413
13590
|
};
|
13414
13591
|
var Line = (_a) => {
|
13415
13592
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13416
|
-
return /* @__PURE__ */
|
13593
|
+
return /* @__PURE__ */ React106.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13417
13594
|
className: classNames(tw("w-1 bg-grey-5 h-full justify-self-center"), className)
|
13418
13595
|
}));
|
13419
13596
|
};
|
13420
13597
|
var Dot = (_a) => {
|
13421
13598
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13422
|
-
return /* @__PURE__ */
|
13599
|
+
return /* @__PURE__ */ React106.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13423
13600
|
className: classNames(tw("bg-grey-30 h-[6px] w-[6px] rounded"), className)
|
13424
13601
|
}));
|
13425
13602
|
};
|
@@ -13434,54 +13611,54 @@ var import_error5 = __toESM(require_error());
|
|
13434
13611
|
var import_time2 = __toESM(require_time());
|
13435
13612
|
var import_warningSign5 = __toESM(require_warningSign());
|
13436
13613
|
var TimelineItem = () => null;
|
13437
|
-
var Timeline2 = ({ children }) => /* @__PURE__ */
|
13614
|
+
var Timeline2 = ({ children }) => /* @__PURE__ */ React107.createElement("div", {
|
13438
13615
|
className: "Aquarium-Timeline"
|
13439
|
-
},
|
13616
|
+
}, React107.Children.map(children, (item) => {
|
13440
13617
|
if (!isComponentType(item, TimelineItem)) {
|
13441
13618
|
throw new Error("<Timeline> can only have <Timeline.Item> components as children");
|
13442
13619
|
} else {
|
13443
13620
|
const { props, key } = item;
|
13444
|
-
return /* @__PURE__ */
|
13621
|
+
return /* @__PURE__ */ React107.createElement(Timeline, {
|
13445
13622
|
key: key != null ? key : props.title
|
13446
|
-
}, /* @__PURE__ */
|
13623
|
+
}, /* @__PURE__ */ React107.createElement(Timeline.Separator, null, props.variant === "error" ? /* @__PURE__ */ React107.createElement(Icon, {
|
13447
13624
|
icon: import_error5.default,
|
13448
13625
|
color: "error-30"
|
13449
|
-
}) : props.variant === "warning" ? /* @__PURE__ */
|
13626
|
+
}) : props.variant === "warning" ? /* @__PURE__ */ React107.createElement(Icon, {
|
13450
13627
|
icon: import_warningSign5.default,
|
13451
13628
|
color: "warning-30"
|
13452
|
-
}) : props.variant === "info" ? /* @__PURE__ */
|
13629
|
+
}) : props.variant === "info" ? /* @__PURE__ */ React107.createElement(Icon, {
|
13453
13630
|
icon: import_time2.default,
|
13454
13631
|
color: "info-30"
|
13455
|
-
}) : /* @__PURE__ */
|
13632
|
+
}) : /* @__PURE__ */ React107.createElement(Timeline.Separator.Dot, null)), /* @__PURE__ */ React107.createElement(Typography2.Caption, {
|
13456
13633
|
color: "grey-50"
|
13457
|
-
}, props.title), /* @__PURE__ */
|
13634
|
+
}, props.title), /* @__PURE__ */ React107.createElement(Timeline.LineContainer, null, /* @__PURE__ */ React107.createElement(Timeline.LineContainer.Line, null)), /* @__PURE__ */ React107.createElement(Timeline.Content, null, /* @__PURE__ */ React107.createElement(Typography2.Small, null, props.children)));
|
13458
13635
|
}
|
13459
13636
|
}));
|
13460
|
-
var TimelineItemSkeleton = () => /* @__PURE__ */
|
13637
|
+
var TimelineItemSkeleton = () => /* @__PURE__ */ React107.createElement(Timeline, null, /* @__PURE__ */ React107.createElement(Timeline.Separator, null, /* @__PURE__ */ React107.createElement(Skeleton, {
|
13461
13638
|
width: 6,
|
13462
13639
|
height: 6,
|
13463
13640
|
rounded: true
|
13464
|
-
})), /* @__PURE__ */
|
13641
|
+
})), /* @__PURE__ */ React107.createElement(Skeleton, {
|
13465
13642
|
height: 12,
|
13466
13643
|
width: 120
|
13467
|
-
}), /* @__PURE__ */
|
13644
|
+
}), /* @__PURE__ */ React107.createElement(Timeline.LineContainer, null, /* @__PURE__ */ React107.createElement(Skeleton, {
|
13468
13645
|
width: 2,
|
13469
13646
|
height: "100%"
|
13470
|
-
})), /* @__PURE__ */
|
13647
|
+
})), /* @__PURE__ */ React107.createElement(Timeline.Content, null, /* @__PURE__ */ React107.createElement(Box, {
|
13471
13648
|
display: "flex",
|
13472
13649
|
flexDirection: "column",
|
13473
13650
|
gap: "3"
|
13474
|
-
}, /* @__PURE__ */
|
13651
|
+
}, /* @__PURE__ */ React107.createElement(Skeleton, {
|
13475
13652
|
height: 32,
|
13476
13653
|
width: "100%"
|
13477
|
-
}), /* @__PURE__ */
|
13654
|
+
}), /* @__PURE__ */ React107.createElement(Skeleton, {
|
13478
13655
|
height: 32,
|
13479
13656
|
width: "73%"
|
13480
|
-
}), /* @__PURE__ */
|
13657
|
+
}), /* @__PURE__ */ React107.createElement(Skeleton, {
|
13481
13658
|
height: 32,
|
13482
13659
|
width: "80%"
|
13483
13660
|
}))));
|
13484
|
-
var TimelineSkeleton = ({ items = 3 }) => /* @__PURE__ */
|
13661
|
+
var TimelineSkeleton = ({ items = 3 }) => /* @__PURE__ */ React107.createElement("div", null, Array.from({ length: items }).map((_, key) => /* @__PURE__ */ React107.createElement(TimelineItemSkeleton, {
|
13485
13662
|
key
|
13486
13663
|
})));
|
13487
13664
|
Timeline2.Item = TimelineItem;
|
@@ -13489,9 +13666,9 @@ Timeline2.Skeleton = TimelineSkeleton;
|
|
13489
13666
|
Timeline2.Skeleton.displayName = "Timeline.Skeleton";
|
13490
13667
|
|
13491
13668
|
// src/utils/table/useTableSelect.ts
|
13492
|
-
import
|
13669
|
+
import React108 from "react";
|
13493
13670
|
var useTableSelect = (data, { key }) => {
|
13494
|
-
const [selected, setSelected] =
|
13671
|
+
const [selected, setSelected] = React108.useState([]);
|
13495
13672
|
const allSelected = selected.length === data.length;
|
13496
13673
|
const isSelected = (dot) => selected.includes(dot[key]);
|
13497
13674
|
const selectAll = () => setSelected(data.map((dot) => dot[key]));
|
@@ -13674,7 +13851,7 @@ export {
|
|
13674
13851
|
FormControl,
|
13675
13852
|
GhostButton,
|
13676
13853
|
Grid,
|
13677
|
-
GridItem,
|
13854
|
+
GridItem2 as GridItem,
|
13678
13855
|
HelperText,
|
13679
13856
|
Icon,
|
13680
13857
|
IconButton,
|