@aivenio/aquarium 1.37.0 → 1.38.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -0
- 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/Combobox/Combobox.d.ts +10 -3
- package/dist/src/molecules/Combobox/Combobox.js +5 -5
- package/dist/src/molecules/ControlLabel/ControlLabel.js +2 -2
- 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 +2 -2
- 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/Section/Section.d.ts +20 -8
- package/dist/src/molecules/Section/Section.js +25 -14
- package/dist/src/test/config.js +2 -2
- package/dist/src/utils/form/Label/Label.js +1 -1
- package/dist/src/utils/table/types.d.ts +18 -5
- 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 +418 -284
- package/dist/system.mjs +410 -276
- package/dist/tsconfig.module.tsbuildinfo +1 -1
- package/dist/types/tailwindGenerated.d.ts +1 -1
- package/package.json +1 -1
package/dist/system.cjs
CHANGED
@@ -1734,6 +1734,22 @@ var require_banCircle = __commonJS({
|
|
1734
1734
|
}
|
1735
1735
|
});
|
1736
1736
|
|
1737
|
+
// src/icons/ban.js
|
1738
|
+
var require_ban = __commonJS({
|
1739
|
+
"src/icons/ban.js"(exports) {
|
1740
|
+
"use strict";
|
1741
|
+
var data = {
|
1742
|
+
"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>',
|
1743
|
+
"left": 0,
|
1744
|
+
"top": 0,
|
1745
|
+
"width": 10,
|
1746
|
+
"height": 10
|
1747
|
+
};
|
1748
|
+
exports.__esModule = true;
|
1749
|
+
exports.default = data;
|
1750
|
+
}
|
1751
|
+
});
|
1752
|
+
|
1737
1753
|
// src/icons/bankAccount.js
|
1738
1754
|
var require_bankAccount = __commonJS({
|
1739
1755
|
"src/icons/bankAccount.js"(exports) {
|
@@ -5024,7 +5040,7 @@ __export(system_exports, {
|
|
5024
5040
|
FormControl: () => FormControl,
|
5025
5041
|
GhostButton: () => GhostButton,
|
5026
5042
|
Grid: () => Grid,
|
5027
|
-
GridItem: () =>
|
5043
|
+
GridItem: () => GridItem2,
|
5028
5044
|
HelperText: () => HelperText,
|
5029
5045
|
Icon: () => Icon,
|
5030
5046
|
IconButton: () => IconButton,
|
@@ -5169,7 +5185,7 @@ __export(molecules_exports, {
|
|
5169
5185
|
FlexboxItem: () => FlexboxItem,
|
5170
5186
|
GhostButton: () => GhostButton,
|
5171
5187
|
Grid: () => Grid,
|
5172
|
-
GridItem: () =>
|
5188
|
+
GridItem: () => GridItem2,
|
5173
5189
|
Icon: () => Icon,
|
5174
5190
|
IconButton: () => IconButton,
|
5175
5191
|
IconExternalLinkButton: () => IconExternalLinkButton,
|
@@ -6367,6 +6383,7 @@ var import_attachment = __toESM(require_attachment());
|
|
6367
6383
|
var import_automaticUpdates = __toESM(require_automaticUpdates());
|
6368
6384
|
var import_badge = __toESM(require_badge());
|
6369
6385
|
var import_banCircle = __toESM(require_banCircle());
|
6386
|
+
var import_ban = __toESM(require_ban());
|
6370
6387
|
var import_bankAccount = __toESM(require_bankAccount());
|
6371
6388
|
var import_blockedPerson = __toESM(require_blockedPerson());
|
6372
6389
|
var import_book = __toESM(require_book());
|
@@ -7430,7 +7447,7 @@ var Typography = (_a) => {
|
|
7430
7447
|
"fontWeight"
|
7431
7448
|
]);
|
7432
7449
|
const HtmlElement = htmlTag;
|
7433
|
-
const resolvedColorName = (0, import_isUndefined6.default)(color) || color === "current" ? "grey-
|
7450
|
+
const resolvedColorName = (0, import_isUndefined6.default)(color) || color === "current" ? "grey-70" : color;
|
7434
7451
|
const style = useStyle({ fontWeight });
|
7435
7452
|
return /* @__PURE__ */ import_react20.default.createElement(HtmlElement, __spreadValues({
|
7436
7453
|
className: classNames(typographies[variant], `text-${resolvedColorName}`, className),
|
@@ -7724,7 +7741,6 @@ Banner.Description = (_a) => {
|
|
7724
7741
|
var _b = _a, { flexGrow, children, className } = _b, rest = __objRest(_b, ["flexGrow", "children", "className"]);
|
7725
7742
|
return /* @__PURE__ */ import_react26.default.createElement(Typography, __spreadProps(__spreadValues({}, rest), {
|
7726
7743
|
variant: "default",
|
7727
|
-
color: "grey-90",
|
7728
7744
|
className: classNames(className, tw({ "flex-grow": flexGrow }))
|
7729
7745
|
}), children);
|
7730
7746
|
};
|
@@ -8532,7 +8548,7 @@ var ControlLabel = (_a) => {
|
|
8532
8548
|
"style",
|
8533
8549
|
"className"
|
8534
8550
|
]);
|
8535
|
-
const textClass = disabled ? "text-grey-40" : "text-grey-
|
8551
|
+
const textClass = disabled ? "text-grey-40" : "text-grey-70";
|
8536
8552
|
const rtl = labelPlacement === "left";
|
8537
8553
|
const labelEl = label && /* @__PURE__ */ import_react38.default.createElement("span", {
|
8538
8554
|
className: tw("typography-small self-center", { "text-right": rtl })
|
@@ -8670,7 +8686,66 @@ var import_react42 = __toESM(require("react"));
|
|
8670
8686
|
|
8671
8687
|
// src/molecules/Grid/Grid.tsx
|
8672
8688
|
var import_react41 = __toESM(require("react"));
|
8673
|
-
var
|
8689
|
+
var import_isEmpty = __toESM(require("lodash/isEmpty"));
|
8690
|
+
var import_mapValues = __toESM(require("lodash/mapValues"));
|
8691
|
+
var import_pick = __toESM(require("lodash/pick"));
|
8692
|
+
var screenSizes = Object.keys(tailwind_theme_default.screens);
|
8693
|
+
var GridItem = Tailwindify(
|
8694
|
+
(_a) => {
|
8695
|
+
var _b = _a, {
|
8696
|
+
htmlTag = "div",
|
8697
|
+
className,
|
8698
|
+
style,
|
8699
|
+
children,
|
8700
|
+
display,
|
8701
|
+
justifySelf,
|
8702
|
+
alignSelf,
|
8703
|
+
placeSelf,
|
8704
|
+
colStart,
|
8705
|
+
colEnd,
|
8706
|
+
rowSpan,
|
8707
|
+
rowStart,
|
8708
|
+
rowEnd
|
8709
|
+
} = _b, props = __objRest(_b, [
|
8710
|
+
"htmlTag",
|
8711
|
+
"className",
|
8712
|
+
"style",
|
8713
|
+
"children",
|
8714
|
+
"display",
|
8715
|
+
"justifySelf",
|
8716
|
+
"alignSelf",
|
8717
|
+
"placeSelf",
|
8718
|
+
"colStart",
|
8719
|
+
"colEnd",
|
8720
|
+
"rowSpan",
|
8721
|
+
"rowStart",
|
8722
|
+
"rowEnd"
|
8723
|
+
]);
|
8724
|
+
const breakPointableProperties = (0, import_pick.default)(props, screenSizes);
|
8725
|
+
const gridColumn = !(0, import_isEmpty.default)(breakPointableProperties) ? (0, import_mapValues.default)(breakPointableProperties, (value) => value === "full" ? "1 / -1" : value ? `span-${value}` : "auto") : void 0;
|
8726
|
+
const hookStyle = useStyle({
|
8727
|
+
display,
|
8728
|
+
justifySelf,
|
8729
|
+
alignSelf,
|
8730
|
+
placeSelf,
|
8731
|
+
gridColumn,
|
8732
|
+
gridColumnStart: colStart,
|
8733
|
+
gridColumnEnd: colEnd,
|
8734
|
+
gridRow: rowSpan,
|
8735
|
+
gridRowStart: rowStart,
|
8736
|
+
gridRowEnd: rowEnd
|
8737
|
+
});
|
8738
|
+
const HtmlElement = htmlTag;
|
8739
|
+
return /* @__PURE__ */ import_react41.default.createElement(HtmlElement, {
|
8740
|
+
style: __spreadValues(__spreadValues({}, hookStyle), style),
|
8741
|
+
className
|
8742
|
+
}, children);
|
8743
|
+
}
|
8744
|
+
);
|
8745
|
+
var Grid = (props) => {
|
8746
|
+
return /* @__PURE__ */ import_react41.default.createElement(GridComponent, __spreadValues({}, props));
|
8747
|
+
};
|
8748
|
+
var GridComponent = Tailwindify(
|
8674
8749
|
({
|
8675
8750
|
htmlTag = "div",
|
8676
8751
|
className,
|
@@ -8728,6 +8803,7 @@ var Grid = Tailwindify(
|
|
8728
8803
|
}, children);
|
8729
8804
|
}
|
8730
8805
|
);
|
8806
|
+
Grid.Item = GridItem;
|
8731
8807
|
|
8732
8808
|
// src/atoms/InputGroup/InputGroup.tsx
|
8733
8809
|
var gridColumnStyles = {
|
@@ -8801,13 +8877,13 @@ var HelperText = ({
|
|
8801
8877
|
alignItems: "start",
|
8802
8878
|
autoCols: "min",
|
8803
8879
|
className: tw("mt-1 mb-3")
|
8804
|
-
}, /* @__PURE__ */ import_react45.default.createElement(
|
8880
|
+
}, /* @__PURE__ */ import_react45.default.createElement(GridItem2, {
|
8805
8881
|
colStart: "1",
|
8806
8882
|
colEnd: "2"
|
8807
8883
|
}, hasError && /* @__PURE__ */ import_react45.default.createElement("p", {
|
8808
8884
|
id: messageId,
|
8809
8885
|
className: tw("text-error-50 block typography-caption")
|
8810
|
-
}, helperText)), /* @__PURE__ */ import_react45.default.createElement(
|
8886
|
+
}, helperText)), /* @__PURE__ */ import_react45.default.createElement(GridItem2, {
|
8811
8887
|
colStart: "2",
|
8812
8888
|
colEnd: "3",
|
8813
8889
|
display: "flex"
|
@@ -8837,7 +8913,7 @@ var LabelText = ({
|
|
8837
8913
|
className: tw("block mb-2")
|
8838
8914
|
}, /* @__PURE__ */ import_react46.default.createElement("span", {
|
8839
8915
|
className: tw("inline-flex items-center typography-small-strong", {
|
8840
|
-
"text-grey-
|
8916
|
+
"text-grey-70": variant === "default",
|
8841
8917
|
"text-error-50": variant === "error",
|
8842
8918
|
"text-grey-40": variant === "disabled"
|
8843
8919
|
})
|
@@ -9165,6 +9241,7 @@ var ComboboxBase = (_a) => {
|
|
9165
9241
|
options,
|
9166
9242
|
optionKeys = ["label", "value"],
|
9167
9243
|
noResults,
|
9244
|
+
emptyState = noResults,
|
9168
9245
|
optionToString: itemToString = getOptionLabelBuiltin,
|
9169
9246
|
createOption,
|
9170
9247
|
renderOption = (opt) => itemToString(opt),
|
@@ -9184,6 +9261,7 @@ var ComboboxBase = (_a) => {
|
|
9184
9261
|
"options",
|
9185
9262
|
"optionKeys",
|
9186
9263
|
"noResults",
|
9264
|
+
"emptyState",
|
9187
9265
|
"optionToString",
|
9188
9266
|
"createOption",
|
9189
9267
|
"renderOption",
|
@@ -9299,7 +9377,7 @@ var ComboboxBase = (_a) => {
|
|
9299
9377
|
}, /* @__PURE__ */ import_react51.default.createElement(Select.Menu, __spreadValues({
|
9300
9378
|
ref: menuRef,
|
9301
9379
|
maxHeight
|
9302
|
-
}, menuProps), hasNoResults && /* @__PURE__ */ import_react51.default.createElement(Select.NoResults, null,
|
9380
|
+
}, menuProps), hasNoResults && /* @__PURE__ */ import_react51.default.createElement(Select.NoResults, null, emptyState), inputItems.map((item, index) => /* @__PURE__ */ import_react51.default.createElement(Select.Item, __spreadValues({
|
9303
9381
|
key: itemToString(item),
|
9304
9382
|
selected: item === selectedItem,
|
9305
9383
|
highlighted: index === highlightedIndex
|
@@ -9312,10 +9390,12 @@ ComboboxBase.Skeleton = ComboboxBaseSkeleton;
|
|
9312
9390
|
var Combobox = (_a) => {
|
9313
9391
|
var _b = _a, {
|
9314
9392
|
options,
|
9315
|
-
noResults
|
9393
|
+
noResults,
|
9394
|
+
emptyState = noResults
|
9316
9395
|
} = _b, props = __objRest(_b, [
|
9317
9396
|
"options",
|
9318
|
-
"noResults"
|
9397
|
+
"noResults",
|
9398
|
+
"emptyState"
|
9319
9399
|
]);
|
9320
9400
|
var _a2;
|
9321
9401
|
const id = (0, import_react51.useRef)((_a2 = props.id) != null ? _a2 : `combobox-${(0, import_uniqueId2.default)()}`);
|
@@ -9332,7 +9412,7 @@ var Combobox = (_a) => {
|
|
9332
9412
|
}), /* @__PURE__ */ import_react51.default.createElement(ComboboxBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
|
9333
9413
|
id: id.current,
|
9334
9414
|
options,
|
9335
|
-
|
9415
|
+
emptyState,
|
9336
9416
|
disabled: props.disabled,
|
9337
9417
|
valid: props.valid
|
9338
9418
|
})));
|
@@ -9361,7 +9441,6 @@ var Container2 = ({ maxWidth = "xl", children }) => /* @__PURE__ */ import_react
|
|
9361
9441
|
var import_react67 = __toESM(require("react"));
|
9362
9442
|
var import_compact = __toESM(require("lodash/compact"));
|
9363
9443
|
var import_isFunction = __toESM(require("lodash/isFunction"));
|
9364
|
-
var import_isObject = __toESM(require("lodash/isObject"));
|
9365
9444
|
|
9366
9445
|
// src/molecules/DropdownMenu/DropdownMenu.tsx
|
9367
9446
|
var import_react56 = __toESM(require("react"));
|
@@ -9462,7 +9541,8 @@ var createInput = (displayName, opts = {}) => {
|
|
9462
9541
|
readOnly,
|
9463
9542
|
className: classNames(
|
9464
9543
|
{
|
9465
|
-
"pl-7": opts.adornment
|
9544
|
+
"pl-7": opts.adornment,
|
9545
|
+
"pr-7": opts.canReset || endAdornment
|
9466
9546
|
},
|
9467
9547
|
getCommonInputStyles({ readOnly, valid }),
|
9468
9548
|
props.className
|
@@ -9817,22 +9897,15 @@ var getDisabledItemKeys = (children) => {
|
|
9817
9897
|
};
|
9818
9898
|
|
9819
9899
|
// src/molecules/List/List.tsx
|
9820
|
-
var
|
9821
|
-
var
|
9822
|
-
items,
|
9823
|
-
renderItem,
|
9824
|
-
container = import_react57.default.Fragment
|
9825
|
-
}) => {
|
9826
|
-
const Component = container;
|
9827
|
-
return /* @__PURE__ */ import_react57.default.createElement(Component, null, items.map(renderItem));
|
9828
|
-
};
|
9900
|
+
var import_react60 = __toESM(require("react"));
|
9901
|
+
var import_isObject = __toESM(require("lodash/isObject"));
|
9829
9902
|
|
9830
9903
|
// src/molecules/Pagination/Pagination.tsx
|
9831
|
-
var
|
9904
|
+
var import_react58 = __toESM(require("react"));
|
9832
9905
|
var import_clamp = __toESM(require("lodash/clamp"));
|
9833
9906
|
|
9834
9907
|
// src/molecules/Select/Select.tsx
|
9835
|
-
var
|
9908
|
+
var import_react57 = __toESM(require("react"));
|
9836
9909
|
var import_downshift2 = require("downshift");
|
9837
9910
|
var import_defaults = __toESM(require("lodash/defaults"));
|
9838
9911
|
var import_isArray = __toESM(require("lodash/isArray"));
|
@@ -9848,10 +9921,10 @@ var hasOptionGroups = (val) => {
|
|
9848
9921
|
};
|
9849
9922
|
var defaultRenderOption = (item, props, { selectedItem }, { getOptionKey, getValue, optionToString = getOptionLabelBuiltin }) => {
|
9850
9923
|
var _a, _b;
|
9851
|
-
return /* @__PURE__ */
|
9924
|
+
return /* @__PURE__ */ import_react57.default.createElement(Select.Item, __spreadValues({
|
9852
9925
|
key: (_b = (_a = getOptionKey == null ? void 0 : getOptionKey(item)) != null ? _a : getValue == null ? void 0 : getValue(item)) != null ? _b : optionToString(item),
|
9853
9926
|
selected: item === selectedItem
|
9854
|
-
}, props), hasIconProperty(item) && /* @__PURE__ */
|
9927
|
+
}, props), hasIconProperty(item) && /* @__PURE__ */ import_react57.default.createElement(InlineIcon, {
|
9855
9928
|
icon: item.icon
|
9856
9929
|
}), optionToString(item));
|
9857
9930
|
};
|
@@ -9922,9 +9995,9 @@ var _SelectBase = (props) => {
|
|
9922
9995
|
"children",
|
9923
9996
|
"labelWrapper"
|
9924
9997
|
]);
|
9925
|
-
const [hasFocus, setFocus] = (0,
|
9926
|
-
const targetRef = (0,
|
9927
|
-
const menuRef = (0,
|
9998
|
+
const [hasFocus, setFocus] = (0, import_react57.useState)(false);
|
9999
|
+
const targetRef = (0, import_react57.useRef)(null);
|
10000
|
+
const menuRef = (0, import_react57.useRef)(null);
|
9928
10001
|
const items = hasOptionGroups(options) ? options.flatMap((g) => g.options) : options;
|
9929
10002
|
const findItemByValue = (val) => {
|
9930
10003
|
if (val === null) {
|
@@ -9958,7 +10031,7 @@ var _SelectBase = (props) => {
|
|
9958
10031
|
toggle: toggleMenu,
|
9959
10032
|
setOpen: (isOpen2) => isOpen2 ? openMenu() : closeMenu()
|
9960
10033
|
};
|
9961
|
-
const
|
10034
|
+
const renderItem3 = (item, index) => UNSAFE_renderOption(
|
9962
10035
|
item,
|
9963
10036
|
__spreadValues({
|
9964
10037
|
highlighted: index === highlightedIndex
|
@@ -9970,13 +10043,13 @@ var _SelectBase = (props) => {
|
|
9970
10043
|
},
|
9971
10044
|
withDefaults
|
9972
10045
|
);
|
9973
|
-
const renderGroup = (group) => /* @__PURE__ */
|
10046
|
+
const renderGroup = (group) => /* @__PURE__ */ import_react57.default.createElement(import_react57.default.Fragment, {
|
9974
10047
|
key: group.label
|
9975
|
-
}, /* @__PURE__ */
|
9976
|
-
const input = /* @__PURE__ */
|
10048
|
+
}, /* @__PURE__ */ import_react57.default.createElement(Select.Group, null, group.label), group.options.map((opt) => renderItem3(opt, items.indexOf(opt))));
|
10049
|
+
const input = /* @__PURE__ */ import_react57.default.createElement(Select.InputContainer, __spreadProps(__spreadValues({}, getToggleButtonProps({ disabled: disabled || readOnly, ref: targetRef })), {
|
9977
10050
|
variant: disabled ? "disabled" : !valid ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default",
|
9978
10051
|
tabIndex: 0
|
9979
|
-
}), /* @__PURE__ */
|
10052
|
+
}), /* @__PURE__ */ import_react57.default.createElement(Select.Input, __spreadProps(__spreadValues({
|
9980
10053
|
id,
|
9981
10054
|
name
|
9982
10055
|
}, rest), {
|
@@ -9988,26 +10061,26 @@ var _SelectBase = (props) => {
|
|
9988
10061
|
tabIndex: -1,
|
9989
10062
|
onFocus: () => setFocus(true),
|
9990
10063
|
onBlur: () => setFocus(false)
|
9991
|
-
})), !readOnly && /* @__PURE__ */
|
10064
|
+
})), !readOnly && /* @__PURE__ */ import_react57.default.createElement(Select.Toggle, {
|
9992
10065
|
disabled,
|
9993
10066
|
isOpen,
|
9994
10067
|
tabIndex: -1
|
9995
10068
|
}));
|
9996
10069
|
const menuProps = getMenuProps({ ref: menuRef }, { suppressRefError: !isOpen });
|
9997
|
-
return /* @__PURE__ */
|
10070
|
+
return /* @__PURE__ */ import_react57.default.createElement("div", {
|
9998
10071
|
className: classNames("Aquarium-SelectBase", tw("relative"))
|
9999
|
-
}, labelWrapper ?
|
10072
|
+
}, labelWrapper ? import_react57.default.cloneElement(labelWrapper, { children: input }) : input, isOpen && /* @__PURE__ */ import_react57.default.createElement(PopoverOverlay, {
|
10000
10073
|
state,
|
10001
10074
|
triggerRef: targetRef,
|
10002
10075
|
placement: "bottom-left",
|
10003
10076
|
shouldFlip: true,
|
10004
10077
|
style: { width: (_b = targetRef.current) == null ? void 0 : _b.offsetWidth }
|
10005
|
-
}, /* @__PURE__ */
|
10078
|
+
}, /* @__PURE__ */ import_react57.default.createElement(Select.Menu, __spreadValues({
|
10006
10079
|
ref: menuRef,
|
10007
10080
|
maxHeight
|
10008
|
-
}, menuProps), options.length === 0 && /* @__PURE__ */
|
10081
|
+
}, menuProps), options.length === 0 && /* @__PURE__ */ import_react57.default.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__ */ import_react57.default.createElement(import_react57.default.Fragment, null, /* @__PURE__ */ import_react57.default.createElement(Select.Divider, {
|
10009
10082
|
onMouseOver: () => setHighlightedIndex(-1)
|
10010
|
-
}), actions.map((act, index) => /* @__PURE__ */
|
10083
|
+
}), actions.map((act, index) => /* @__PURE__ */ import_react57.default.createElement(Select.ActionItem, __spreadProps(__spreadValues({
|
10011
10084
|
key: `${index}`
|
10012
10085
|
}, act), {
|
10013
10086
|
onMouseOver: () => setHighlightedIndex(-1),
|
@@ -10017,10 +10090,10 @@ var _SelectBase = (props) => {
|
|
10017
10090
|
}
|
10018
10091
|
}), act.label))))));
|
10019
10092
|
};
|
10020
|
-
var SelectBase = (props) => /* @__PURE__ */
|
10093
|
+
var SelectBase = (props) => /* @__PURE__ */ import_react57.default.createElement(_SelectBase, __spreadProps(__spreadValues({}, props), {
|
10021
10094
|
labelWrapper: void 0
|
10022
10095
|
}));
|
10023
|
-
var SelectBaseSkeleton = () => /* @__PURE__ */
|
10096
|
+
var SelectBaseSkeleton = () => /* @__PURE__ */ import_react57.default.createElement(Skeleton, {
|
10024
10097
|
height: 38
|
10025
10098
|
});
|
10026
10099
|
SelectBase.Skeleton = SelectBaseSkeleton;
|
@@ -10031,28 +10104,28 @@ var Select2 = (_a) => {
|
|
10031
10104
|
"options"
|
10032
10105
|
]);
|
10033
10106
|
var _a2;
|
10034
|
-
const id = (0,
|
10107
|
+
const id = (0, import_react57.useRef)((_a2 = props.id) != null ? _a2 : `select-${(0, import_uniqueId4.default)()}`);
|
10035
10108
|
const errorMessageId = (0, import_uniqueId4.default)();
|
10036
10109
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
10037
10110
|
const labelProps = getLabelControlProps(props);
|
10038
10111
|
const baseProps = (0, import_omit7.default)(props, Object.keys(labelProps));
|
10039
10112
|
const legacyError = labelProps.error !== void 0 && labelProps.valid === false;
|
10040
10113
|
const variant = !labelProps.valid || legacyError ? "error" : labelProps.disabled ? "disabled" : "default";
|
10041
|
-
const label = /* @__PURE__ */
|
10114
|
+
const label = /* @__PURE__ */ import_react57.default.createElement(Label, __spreadValues({
|
10042
10115
|
id: `${id.current}-label`,
|
10043
10116
|
htmlFor: `${id.current}-input`,
|
10044
10117
|
variant,
|
10045
10118
|
messageId: errorMessageId
|
10046
10119
|
}, labelProps));
|
10047
|
-
return /* @__PURE__ */
|
10120
|
+
return /* @__PURE__ */ import_react57.default.createElement(FormControl, {
|
10048
10121
|
className: "Aquarium-Select"
|
10049
|
-
}, /* @__PURE__ */
|
10122
|
+
}, /* @__PURE__ */ import_react57.default.createElement(_SelectBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
|
10050
10123
|
id: `${id.current}-input`,
|
10051
10124
|
options,
|
10052
10125
|
disabled: props.disabled,
|
10053
10126
|
valid: props.valid,
|
10054
10127
|
labelWrapper: label
|
10055
|
-
})), /* @__PURE__ */
|
10128
|
+
})), /* @__PURE__ */ import_react57.default.createElement(HelperText, {
|
10056
10129
|
messageId: errorMessageId,
|
10057
10130
|
error: !labelProps.valid,
|
10058
10131
|
helperText: labelProps.helperText,
|
@@ -10061,7 +10134,7 @@ var Select2 = (_a) => {
|
|
10061
10134
|
reserveSpaceForError: labelProps.reserveSpaceForError
|
10062
10135
|
}));
|
10063
10136
|
};
|
10064
|
-
var SelectSkeleton = () => /* @__PURE__ */
|
10137
|
+
var SelectSkeleton = () => /* @__PURE__ */ import_react57.default.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ import_react57.default.createElement(SelectBase.Skeleton, null));
|
10065
10138
|
Select2.Skeleton = SelectSkeleton;
|
10066
10139
|
Select2.Skeleton.displayName = "Select.Skeleton";
|
10067
10140
|
|
@@ -10080,26 +10153,26 @@ var Pagination = ({
|
|
10080
10153
|
pageSizes,
|
10081
10154
|
onPageSizeChange
|
10082
10155
|
}) => {
|
10083
|
-
const [value, setValue] =
|
10084
|
-
|
10156
|
+
const [value, setValue] = import_react58.default.useState(currentPage);
|
10157
|
+
import_react58.default.useEffect(() => {
|
10085
10158
|
setValue(currentPage);
|
10086
10159
|
}, [currentPage]);
|
10087
|
-
return /* @__PURE__ */
|
10160
|
+
return /* @__PURE__ */ import_react58.default.createElement(Box, {
|
10088
10161
|
className: classNames(
|
10089
10162
|
"Aquarium-Pagination",
|
10090
10163
|
tw({ "grid grid-cols-[200px_1fr_200px]": !!pageSizes, "flex flex-nowrap justify-center": !pageSizes })
|
10091
10164
|
),
|
10092
10165
|
backgroundColor: "grey-0",
|
10093
10166
|
padding: "4"
|
10094
|
-
}, pageSizes && onPageSizeChange && typeof pageSize === "number" ? /* @__PURE__ */
|
10167
|
+
}, pageSizes && onPageSizeChange && typeof pageSize === "number" ? /* @__PURE__ */ import_react58.default.createElement(Box, {
|
10095
10168
|
display: "flex",
|
10096
10169
|
alignItems: "center",
|
10097
10170
|
gap: "4"
|
10098
|
-
}, /* @__PURE__ */
|
10171
|
+
}, /* @__PURE__ */ import_react58.default.createElement(Typography2.Small, {
|
10099
10172
|
color: "grey-50"
|
10100
|
-
}, "Items per page "), /* @__PURE__ */
|
10173
|
+
}, "Items per page "), /* @__PURE__ */ import_react58.default.createElement("div", {
|
10101
10174
|
className: tw("max-w-[70px]")
|
10102
|
-
}, /* @__PURE__ */
|
10175
|
+
}, /* @__PURE__ */ import_react58.default.createElement(SelectBase, {
|
10103
10176
|
options: pageSizes.map((size) => size.toString()),
|
10104
10177
|
value: pageSize.toString(),
|
10105
10178
|
onChange: (size) => {
|
@@ -10110,26 +10183,26 @@ var Pagination = ({
|
|
10110
10183
|
}
|
10111
10184
|
}
|
10112
10185
|
}
|
10113
|
-
}))) : /* @__PURE__ */
|
10186
|
+
}))) : /* @__PURE__ */ import_react58.default.createElement("div", null), /* @__PURE__ */ import_react58.default.createElement(Box, {
|
10114
10187
|
display: "flex",
|
10115
10188
|
justifyContent: "center",
|
10116
10189
|
alignItems: "center",
|
10117
10190
|
className: tw("grow")
|
10118
|
-
}, /* @__PURE__ */
|
10191
|
+
}, /* @__PURE__ */ import_react58.default.createElement(Button.Icon, {
|
10119
10192
|
"aria-label": "First",
|
10120
10193
|
onClick: () => onPageChange(1),
|
10121
10194
|
icon: import_chevronBackward2.default,
|
10122
10195
|
disabled: !hasPreviousPage
|
10123
|
-
}), /* @__PURE__ */
|
10196
|
+
}), /* @__PURE__ */ import_react58.default.createElement(Button.Icon, {
|
10124
10197
|
"aria-label": "Previous",
|
10125
10198
|
onClick: () => onPageChange(currentPage - 1),
|
10126
10199
|
icon: import_chevronLeft3.default,
|
10127
10200
|
disabled: !hasPreviousPage
|
10128
|
-
}), /* @__PURE__ */
|
10201
|
+
}), /* @__PURE__ */ import_react58.default.createElement(Box, {
|
10129
10202
|
paddingX: "4"
|
10130
|
-
}, /* @__PURE__ */
|
10203
|
+
}, /* @__PURE__ */ import_react58.default.createElement(Typography2.Small, {
|
10131
10204
|
color: "grey-60"
|
10132
|
-
}, "Page")), /* @__PURE__ */
|
10205
|
+
}, "Page")), /* @__PURE__ */ import_react58.default.createElement(InputBase, {
|
10133
10206
|
className: classNames(tw("text-center max-w-[40px]"), "no-arrows"),
|
10134
10207
|
type: "number",
|
10135
10208
|
min: 1,
|
@@ -10146,25 +10219,25 @@ var Pagination = ({
|
|
10146
10219
|
const newPage = !isNaN(numberValue) ? (0, import_clamp.default)(numberValue, 1, totalPages) : 1;
|
10147
10220
|
onPageChange(newPage);
|
10148
10221
|
}
|
10149
|
-
}), /* @__PURE__ */
|
10222
|
+
}), /* @__PURE__ */ import_react58.default.createElement(Box, {
|
10150
10223
|
paddingX: "4"
|
10151
|
-
}, /* @__PURE__ */
|
10224
|
+
}, /* @__PURE__ */ import_react58.default.createElement(Typography2.Small, {
|
10152
10225
|
color: "grey-60"
|
10153
|
-
}, "of ", totalPages)), /* @__PURE__ */
|
10226
|
+
}, "of ", totalPages)), /* @__PURE__ */ import_react58.default.createElement(Button.Icon, {
|
10154
10227
|
"aria-label": "Next",
|
10155
10228
|
onClick: () => onPageChange(currentPage + 1),
|
10156
10229
|
icon: import_chevronRight3.default,
|
10157
10230
|
disabled: !hasNextPage
|
10158
|
-
}), /* @__PURE__ */
|
10231
|
+
}), /* @__PURE__ */ import_react58.default.createElement(Button.Icon, {
|
10159
10232
|
"aria-label": "Last",
|
10160
10233
|
onClick: () => onPageChange(totalPages),
|
10161
10234
|
icon: import_chevronForward2.default,
|
10162
10235
|
disabled: !hasNextPage
|
10163
|
-
})), pageSizes && /* @__PURE__ */
|
10236
|
+
})), pageSizes && /* @__PURE__ */ import_react58.default.createElement("div", null));
|
10164
10237
|
};
|
10165
10238
|
|
10166
10239
|
// src/molecules/Pagination/usePagination.tsx
|
10167
|
-
var
|
10240
|
+
var import_react59 = require("react");
|
10168
10241
|
var import_clamp2 = __toESM(require("lodash/clamp"));
|
10169
10242
|
var initialState = {
|
10170
10243
|
currentPage: 1,
|
@@ -10172,8 +10245,8 @@ var initialState = {
|
|
10172
10245
|
};
|
10173
10246
|
var getPageIndex = (currentPage, pageSize) => currentPage === 0 ? 0 : (currentPage - 1) * pageSize;
|
10174
10247
|
var usePagination = (items, options) => {
|
10175
|
-
const [currentPage, setCurrentPage] = (0,
|
10176
|
-
const [pageSize, setPageSize] = (0,
|
10248
|
+
const [currentPage, setCurrentPage] = (0, import_react59.useState)((options == null ? void 0 : options.initialPage) || initialState.currentPage);
|
10249
|
+
const [pageSize, setPageSize] = (0, import_react59.useState)((options == null ? void 0 : options.initialPageSize) || initialState.pageSize);
|
10177
10250
|
const totalPages = items.length > 0 ? Math.ceil(items.length / pageSize) : 1;
|
10178
10251
|
const hasPreviousPage = currentPage > 1;
|
10179
10252
|
const hasNextPage = currentPage < totalPages;
|
@@ -10183,7 +10256,7 @@ var usePagination = (items, options) => {
|
|
10183
10256
|
setPageSize(pageSize2);
|
10184
10257
|
setCurrentPage((0, import_clamp2.default)((options == null ? void 0 : options.initialPage) || initialState.currentPage, 1, newTotalPages));
|
10185
10258
|
};
|
10186
|
-
(0,
|
10259
|
+
(0, import_react59.useEffect)(() => {
|
10187
10260
|
setCurrentPage((0, import_clamp2.default)((options == null ? void 0 : options.initialPage) || initialState.currentPage, 1, totalPages));
|
10188
10261
|
}, [items.length]);
|
10189
10262
|
return [
|
@@ -10200,6 +10273,22 @@ var usePagination = (items, options) => {
|
|
10200
10273
|
];
|
10201
10274
|
};
|
10202
10275
|
|
10276
|
+
// src/molecules/List/List.tsx
|
10277
|
+
var List2 = ({
|
10278
|
+
items,
|
10279
|
+
renderItem: renderItem3,
|
10280
|
+
container = import_react60.default.Fragment,
|
10281
|
+
paginationContainer = import_react60.default.Fragment,
|
10282
|
+
pagination
|
10283
|
+
}) => {
|
10284
|
+
const Component = container;
|
10285
|
+
const PaginationComponent = paginationContainer;
|
10286
|
+
const paginationProps = (0, import_isObject.default)(pagination) ? pagination : {};
|
10287
|
+
const [paginatedItems, paginationState] = usePagination(items, paginationProps);
|
10288
|
+
const listItems = pagination ? paginatedItems : items;
|
10289
|
+
return /* @__PURE__ */ import_react60.default.createElement(import_react60.default.Fragment, null, /* @__PURE__ */ import_react60.default.createElement(Component, null, listItems.map(renderItem3)), pagination && /* @__PURE__ */ import_react60.default.createElement(PaginationComponent, null, /* @__PURE__ */ import_react60.default.createElement(Pagination, __spreadValues({}, paginationState))));
|
10290
|
+
};
|
10291
|
+
|
10203
10292
|
// src/molecules/Template/Template.tsx
|
10204
10293
|
var import_react61 = __toESM(require("react"));
|
10205
10294
|
var Template = ({
|
@@ -10561,7 +10650,7 @@ var DataListSkeleton = ({ columns = ["1", "2", "2", 52], rows = 5 }) => {
|
|
10561
10650
|
// src/molecules/DataList/DataList.tsx
|
10562
10651
|
var DataList2 = ({
|
10563
10652
|
columns,
|
10564
|
-
rows
|
10653
|
+
rows,
|
10565
10654
|
sticky,
|
10566
10655
|
menu,
|
10567
10656
|
menuLabel,
|
@@ -10569,45 +10658,50 @@ var DataList2 = ({
|
|
10569
10658
|
menuHeaderName = "Actions",
|
10570
10659
|
onAction,
|
10571
10660
|
onMenuOpenChange,
|
10572
|
-
pagination
|
10661
|
+
pagination
|
10573
10662
|
}) => {
|
10574
10663
|
const [sort, updateSort] = useTableSort();
|
10575
|
-
const sortedRows = sortRowsBy(
|
10576
|
-
const _a = (0, import_isObject.default)(_pagination) ? _pagination : {}, { initialPage, initialPageSize } = _a, paginationProps = __objRest(_a, ["initialPage", "initialPageSize"]);
|
10577
|
-
const [paginatedItems, paginationState] = usePagination(sortedRows, { initialPage, initialPageSize });
|
10578
|
-
const rows = _pagination ? paginatedItems : sortedRows;
|
10664
|
+
const sortedRows = sortRowsBy(rows, sort);
|
10579
10665
|
const templateColumns = (0, import_compact.default)([
|
10580
10666
|
...columns.map((column) => {
|
10581
|
-
var
|
10582
|
-
return (
|
10667
|
+
var _a;
|
10668
|
+
return (_a = column.width) != null ? _a : "auto";
|
10583
10669
|
}),
|
10584
10670
|
menu ? "auto" : void 0
|
10585
10671
|
]);
|
10586
|
-
const
|
10672
|
+
const PaginationFooter = import_react67.default.useCallback(
|
10673
|
+
({ children }) => /* @__PURE__ */ import_react67.default.createElement("div", {
|
10674
|
+
style: { gridColumn: `span ${templateColumns.length}` }
|
10675
|
+
}, children),
|
10676
|
+
[templateColumns.length]
|
10677
|
+
);
|
10678
|
+
return /* @__PURE__ */ import_react67.default.createElement(Template, {
|
10587
10679
|
className: "Aquarium-DataList",
|
10588
10680
|
columns: templateColumns
|
10589
|
-
}, columns.map(
|
10590
|
-
|
10681
|
+
}, columns.map((column) => {
|
10682
|
+
const content = column.headerTooltip ? /* @__PURE__ */ import_react67.default.createElement(Tooltip, {
|
10683
|
+
placement: column.headerTooltip.placement,
|
10684
|
+
content: column.headerTooltip.content
|
10685
|
+
}, column.headerName) : column.headerName;
|
10686
|
+
return columnIsFieldColumn(column) && column.sortable || column.sort ? /* @__PURE__ */ import_react67.default.createElement(DataList.SortCell, __spreadValues({
|
10591
10687
|
direction: sort && sort.column.headerName === column.headerName ? sort.direction : "none",
|
10592
10688
|
onClick: () => updateSort(column),
|
10593
10689
|
sticky
|
10594
|
-
}, cellProps(column)),
|
10690
|
+
}, cellProps(column)), content) : /* @__PURE__ */ import_react67.default.createElement(DataList.HeadCell, __spreadProps(__spreadValues({}, cellProps(column)), {
|
10595
10691
|
sticky
|
10596
|
-
}),
|
10597
|
-
), menu && /* @__PURE__ */ import_react67.default.createElement(DataList.HeadCell, {
|
10692
|
+
}), content);
|
10693
|
+
}), menu && /* @__PURE__ */ import_react67.default.createElement(DataList.HeadCell, {
|
10598
10694
|
align: "right",
|
10599
10695
|
"aria-label": menuAriaLabel
|
10600
10696
|
}, menuHeaderName), /* @__PURE__ */ import_react67.default.createElement(List2, {
|
10601
|
-
|
10697
|
+
pagination,
|
10698
|
+
paginationContainer: PaginationFooter,
|
10699
|
+
items: sortedRows,
|
10602
10700
|
renderItem: (row, index) => /* @__PURE__ */ import_react67.default.createElement(DataList.Row, {
|
10603
10701
|
key: row.id
|
10604
10702
|
}, /* @__PURE__ */ import_react67.default.createElement(List2, {
|
10605
10703
|
items: columns,
|
10606
|
-
renderItem: (column) =>
|
10607
|
-
dense: true
|
10608
|
-
}, column.status(row, index, sortedRows)))) : column.type === "action" ? /* @__PURE__ */ import_react67.default.createElement(DataList.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ import_react67.default.createElement(Button.Secondary, __spreadValues({
|
10609
|
-
dense: true
|
10610
|
-
}, renameProperty("text", "children", column.action(row, index, sortedRows))))) : column.type === "custom" ? /* @__PURE__ */ import_react67.default.createElement(DataList.Cell, __spreadValues({}, cellProps(column)), column.UNSAFE_render(row, index, sortedRows)) : column.type === "item" ? /* @__PURE__ */ import_react67.default.createElement(DataList.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ import_react67.default.createElement(Item4, __spreadValues({}, column.item(row, index, sortedRows)))) : /* @__PURE__ */ import_react67.default.createElement(DataList.Cell, __spreadValues({}, cellProps(column)), column.formatter ? column.formatter(row[column.field], row, index, sortedRows) : row[column.field])
|
10704
|
+
renderItem: (column) => /* @__PURE__ */ import_react67.default.createElement(DataList.Cell, __spreadValues({}, cellProps(column)), renderItem(column, row, index, sortedRows))
|
10611
10705
|
}), menu && /* @__PURE__ */ import_react67.default.createElement(DataList.Cell, {
|
10612
10706
|
align: "right"
|
10613
10707
|
}, /* @__PURE__ */ import_react67.default.createElement(DropdownMenu2, {
|
@@ -10618,7 +10712,14 @@ var DataList2 = ({
|
|
10618
10712
|
icon: import_more2.default
|
10619
10713
|
})), (0, import_isFunction.default)(menu) ? menu(row, index) : menu)))
|
10620
10714
|
}));
|
10621
|
-
|
10715
|
+
};
|
10716
|
+
var renderItem = (column, row, index, sortedRows) => {
|
10717
|
+
const cellContent = column.type === "status" ? /* @__PURE__ */ import_react67.default.createElement(StatusChip, __spreadValues({
|
10718
|
+
dense: true
|
10719
|
+
}, column.status(row, index, sortedRows))) : column.type === "action" ? /* @__PURE__ */ import_react67.default.createElement(Button.Secondary, __spreadValues({
|
10720
|
+
dense: true
|
10721
|
+
}, renameProperty("text", "children", column.action(row, index, sortedRows)))) : column.type === "custom" ? column.UNSAFE_render(row, index, sortedRows) : column.type === "item" ? /* @__PURE__ */ import_react67.default.createElement(Item4, __spreadValues({}, column.item(row, index, sortedRows))) : column.formatter ? column.formatter(row[column.field], row, index, sortedRows) : row[column.field];
|
10722
|
+
return column.tooltip ? /* @__PURE__ */ import_react67.default.createElement(Tooltip, __spreadValues({}, column.tooltip(row, index, sortedRows)), cellContent) : cellContent;
|
10622
10723
|
};
|
10623
10724
|
DataList2.Skeleton = DataListSkeleton;
|
10624
10725
|
|
@@ -10626,7 +10727,6 @@ DataList2.Skeleton = DataListSkeleton;
|
|
10626
10727
|
var import_react70 = __toESM(require("react"));
|
10627
10728
|
var import_compact2 = __toESM(require("lodash/compact"));
|
10628
10729
|
var import_isFunction2 = __toESM(require("lodash/isFunction"));
|
10629
|
-
var import_isObject2 = __toESM(require("lodash/isObject"));
|
10630
10730
|
|
10631
10731
|
// src/molecules/Table/Table.tsx
|
10632
10732
|
var import_react69 = __toESM(require("react"));
|
@@ -10675,7 +10775,7 @@ var import_more3 = __toESM(require_more());
|
|
10675
10775
|
var DataTable = (_a) => {
|
10676
10776
|
var _b = _a, {
|
10677
10777
|
columns,
|
10678
|
-
rows
|
10778
|
+
rows,
|
10679
10779
|
noWrap = false,
|
10680
10780
|
layout = "auto",
|
10681
10781
|
sticky,
|
@@ -10685,7 +10785,7 @@ var DataTable = (_a) => {
|
|
10685
10785
|
menuHeaderName = "Actions",
|
10686
10786
|
onAction,
|
10687
10787
|
onMenuOpenChange,
|
10688
|
-
pagination
|
10788
|
+
pagination
|
10689
10789
|
} = _b, rest = __objRest(_b, [
|
10690
10790
|
"columns",
|
10691
10791
|
"rows",
|
@@ -10701,11 +10801,15 @@ var DataTable = (_a) => {
|
|
10701
10801
|
"pagination"
|
10702
10802
|
]);
|
10703
10803
|
const [sort, updateSort] = useTableSort();
|
10704
|
-
const sortedRows = sortRowsBy(
|
10705
|
-
const
|
10706
|
-
const
|
10707
|
-
|
10708
|
-
|
10804
|
+
const sortedRows = sortRowsBy(rows, sort);
|
10805
|
+
const amountOfColumns = columns.length + (menu ? 1 : 0);
|
10806
|
+
const PaginationFooter = import_react70.default.useCallback(
|
10807
|
+
({ children }) => /* @__PURE__ */ import_react70.default.createElement("tfoot", null, /* @__PURE__ */ import_react70.default.createElement("tr", null, /* @__PURE__ */ import_react70.default.createElement("td", {
|
10808
|
+
colSpan: amountOfColumns
|
10809
|
+
}, children))),
|
10810
|
+
[amountOfColumns]
|
10811
|
+
);
|
10812
|
+
return /* @__PURE__ */ import_react70.default.createElement(Table2, __spreadProps(__spreadValues({}, rest), {
|
10709
10813
|
className: classNames(
|
10710
10814
|
"Aquarium-DataTable",
|
10711
10815
|
tw({
|
@@ -10717,33 +10821,36 @@ var DataTable = (_a) => {
|
|
10717
10821
|
}), /* @__PURE__ */ import_react70.default.createElement(Table2.Head, {
|
10718
10822
|
sticky
|
10719
10823
|
}, (0, import_compact2.default)([
|
10720
|
-
...columns.map(
|
10721
|
-
|
10824
|
+
...columns.map((column) => {
|
10825
|
+
const content = column.headerTooltip && !column.headerInvisible ? /* @__PURE__ */ import_react70.default.createElement(Tooltip, {
|
10826
|
+
placement: column.headerTooltip.placement,
|
10827
|
+
content: column.headerTooltip.content
|
10828
|
+
}, column.headerName) : !column.headerInvisible && column.headerName;
|
10829
|
+
return columnIsFieldColumn(column) && column.sortable || column.sort ? /* @__PURE__ */ import_react70.default.createElement(Table2.SortCell, __spreadValues({
|
10722
10830
|
direction: sort && sort.column.headerName === column.headerName ? sort.direction : "none",
|
10723
10831
|
onClick: () => updateSort(column),
|
10724
10832
|
style: { width: column.width },
|
10725
10833
|
"aria-label": column.headerInvisible ? column.headerName : void 0
|
10726
|
-
}, cellProps(column)),
|
10834
|
+
}, cellProps(column)), content) : /* @__PURE__ */ import_react70.default.createElement(Table2.Cell, __spreadProps(__spreadValues({}, cellProps(column)), {
|
10727
10835
|
style: { width: column.width },
|
10728
10836
|
"aria-label": column.headerInvisible ? column.headerName : void 0
|
10729
|
-
}),
|
10730
|
-
),
|
10837
|
+
}), content);
|
10838
|
+
}),
|
10731
10839
|
menu ? /* @__PURE__ */ import_react70.default.createElement(Table2.Cell, {
|
10732
10840
|
key: "__contextMenu",
|
10733
10841
|
align: "right",
|
10734
10842
|
"aria-label": menuAriaLabel
|
10735
10843
|
}, menuHeaderName) : null
|
10736
|
-
])), /* @__PURE__ */ import_react70.default.createElement(
|
10737
|
-
|
10844
|
+
])), /* @__PURE__ */ import_react70.default.createElement(List2, {
|
10845
|
+
container: Table2.Body,
|
10846
|
+
paginationContainer: PaginationFooter,
|
10847
|
+
pagination,
|
10848
|
+
items: sortedRows,
|
10738
10849
|
renderItem: (row, index) => /* @__PURE__ */ import_react70.default.createElement(Table2.Row, {
|
10739
10850
|
key: row.id
|
10740
10851
|
}, /* @__PURE__ */ import_react70.default.createElement(List2, {
|
10741
10852
|
items: columns,
|
10742
|
-
renderItem: (column) =>
|
10743
|
-
dense: true
|
10744
|
-
}, column.status(row, index, sortedRows)))) : column.type === "action" ? /* @__PURE__ */ import_react70.default.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ import_react70.default.createElement(Button.Secondary, __spreadValues({
|
10745
|
-
dense: true
|
10746
|
-
}, renameProperty("text", "children", column.action(row, index, sortedRows))))) : column.type === "custom" ? /* @__PURE__ */ import_react70.default.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), column.UNSAFE_render(row, index, sortedRows)) : column.type === "item" ? /* @__PURE__ */ import_react70.default.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ import_react70.default.createElement(Item4, __spreadValues({}, column.item(row, index, sortedRows)))) : /* @__PURE__ */ import_react70.default.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), column.formatter ? column.formatter(row[column.field], row, index, sortedRows) : row[column.field])
|
10853
|
+
renderItem: (column) => /* @__PURE__ */ import_react70.default.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), renderItem2(column, row, index, sortedRows))
|
10747
10854
|
}), menu && /* @__PURE__ */ import_react70.default.createElement(Table2.Cell, {
|
10748
10855
|
align: "right"
|
10749
10856
|
}, /* @__PURE__ */ import_react70.default.createElement(DropdownMenu2, {
|
@@ -10753,8 +10860,15 @@ var DataTable = (_a) => {
|
|
10753
10860
|
"aria-label": menuAriaLabel,
|
10754
10861
|
icon: import_more3.default
|
10755
10862
|
})), (0, import_isFunction2.default)(menu) ? menu(row, index) : menu)))
|
10756
|
-
}))
|
10757
|
-
|
10863
|
+
}));
|
10864
|
+
};
|
10865
|
+
var renderItem2 = (column, row, index, sortedRows) => {
|
10866
|
+
const cellContent = column.type === "status" ? /* @__PURE__ */ import_react70.default.createElement(StatusChip, __spreadValues({
|
10867
|
+
dense: true
|
10868
|
+
}, column.status(row, index, sortedRows))) : column.type === "action" ? /* @__PURE__ */ import_react70.default.createElement(Button.Secondary, __spreadValues({
|
10869
|
+
dense: true
|
10870
|
+
}, renameProperty("text", "children", column.action(row, index, sortedRows)))) : column.type === "custom" ? column.UNSAFE_render(row, index, sortedRows) : column.type === "item" ? /* @__PURE__ */ import_react70.default.createElement(Item4, __spreadValues({}, column.item(row, index, sortedRows))) : column.formatter ? column.formatter(row[column.field], row, index, sortedRows) : row[column.field];
|
10871
|
+
return column.tooltip ? /* @__PURE__ */ import_react70.default.createElement(Tooltip, __spreadValues({}, column.tooltip(row, index, sortedRows)), cellContent) : cellContent;
|
10758
10872
|
};
|
10759
10873
|
DataTable.Skeleton = DataListSkeleton;
|
10760
10874
|
|
@@ -10921,17 +11035,19 @@ var DialogWrapper = ({
|
|
10921
11035
|
ref
|
10922
11036
|
}, dialogProps), {
|
10923
11037
|
className: tw("outline-none")
|
10924
|
-
}), /* @__PURE__ */ import_react72.default.createElement(Modal.Header,
|
11038
|
+
}), /* @__PURE__ */ import_react72.default.createElement(Modal.Header, {
|
11039
|
+
className: tw("icon-stroke-2")
|
11040
|
+
}, /* @__PURE__ */ import_react72.default.createElement(Icon, {
|
10925
11041
|
icon: DIALOG_ICONS_AND_COLORS[type].icon,
|
10926
11042
|
color: DIALOG_ICONS_AND_COLORS[type].color,
|
10927
11043
|
fontSize: 20
|
10928
11044
|
}), /* @__PURE__ */ import_react72.default.createElement(Modal.Title, {
|
10929
11045
|
id: labelledBy,
|
10930
|
-
variant: "large
|
11046
|
+
variant: "large",
|
10931
11047
|
color: DIALOG_ICONS_AND_COLORS[type].color
|
10932
11048
|
}, title)), /* @__PURE__ */ import_react72.default.createElement(Modal.Body, {
|
10933
11049
|
id: describedBy
|
10934
|
-
}, children), /* @__PURE__ */ import_react72.default.createElement(Modal.Footer, null, /* @__PURE__ */ import_react72.default.createElement(Modal.Actions, null, secondaryAction && /* @__PURE__ */ import_react72.default.createElement(Button.Ghost, __spreadValues({
|
11050
|
+
}, /* @__PURE__ */ import_react72.default.createElement(Typography2.Default, null, children)), /* @__PURE__ */ import_react72.default.createElement(Modal.Footer, null, /* @__PURE__ */ import_react72.default.createElement(Modal.Actions, null, secondaryAction && /* @__PURE__ */ import_react72.default.createElement(Button.Ghost, __spreadValues({
|
10935
11051
|
key: secondaryAction.text
|
10936
11052
|
}, (0, import_omit8.default)(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */ import_react72.default.createElement(Button.Secondary, __spreadValues({
|
10937
11053
|
key: primaryAction.text
|
@@ -11309,9 +11425,7 @@ var EmptyState = ({
|
|
11309
11425
|
htmlTag: "h2"
|
11310
11426
|
}, title), (description || children) && /* @__PURE__ */ import_react79.default.createElement(Box, {
|
11311
11427
|
marginTop: "5"
|
11312
|
-
}, /* @__PURE__ */ import_react79.default.createElement(Typography2.Default, {
|
11313
|
-
color: "grey-60"
|
11314
|
-
}, children || description)), (secondaryAction || primaryAction) && /* @__PURE__ */ import_react79.default.createElement(Box.Flex, {
|
11428
|
+
}, /* @__PURE__ */ import_react79.default.createElement(Typography2.Default, null, children || description)), (secondaryAction || primaryAction) && /* @__PURE__ */ import_react79.default.createElement(Box.Flex, {
|
11315
11429
|
marginTop: "7",
|
11316
11430
|
gap: "4",
|
11317
11431
|
justifyContent: "center",
|
@@ -11346,7 +11460,7 @@ var FlexboxItem = Tailwindify(
|
|
11346
11460
|
|
11347
11461
|
// src/molecules/Grid/GridItem.tsx
|
11348
11462
|
var import_react81 = __toESM(require("react"));
|
11349
|
-
var
|
11463
|
+
var GridItem2 = Tailwindify(
|
11350
11464
|
({
|
11351
11465
|
htmlTag = "div",
|
11352
11466
|
className,
|
@@ -12121,6 +12235,7 @@ var MultiSelectBase = (_a) => {
|
|
12121
12235
|
options,
|
12122
12236
|
optionKeys = ["label", "value"],
|
12123
12237
|
noResults,
|
12238
|
+
emptyState = noResults,
|
12124
12239
|
optionToString: itemToString = getOptionLabelBuiltin,
|
12125
12240
|
renderOption = (opt) => itemToString(opt),
|
12126
12241
|
isOptionDisabled = isOptionDisabledBuiltin,
|
@@ -12143,6 +12258,7 @@ var MultiSelectBase = (_a) => {
|
|
12143
12258
|
"options",
|
12144
12259
|
"optionKeys",
|
12145
12260
|
"noResults",
|
12261
|
+
"emptyState",
|
12146
12262
|
"optionToString",
|
12147
12263
|
"renderOption",
|
12148
12264
|
"isOptionDisabled",
|
@@ -12306,7 +12422,7 @@ var MultiSelectBase = (_a) => {
|
|
12306
12422
|
}, /* @__PURE__ */ import_react90.default.createElement(Select.Menu, __spreadValues({
|
12307
12423
|
ref: menuRef,
|
12308
12424
|
maxHeight
|
12309
|
-
}, menuProps), hasNoResults && /* @__PURE__ */ import_react90.default.createElement(Select.NoResults, null,
|
12425
|
+
}, menuProps), hasNoResults && /* @__PURE__ */ import_react90.default.createElement(Select.NoResults, null, emptyState), filteredOptions.map((item, index) => /* @__PURE__ */ import_react90.default.createElement(Select.Item, __spreadValues({
|
12310
12426
|
key: itemToString(item),
|
12311
12427
|
highlighted: index === highlightedIndex,
|
12312
12428
|
selected: selectedItems.includes(item)
|
@@ -12319,10 +12435,12 @@ MultiSelectBase.Skeleton = MultiSelectBaseSkeleton;
|
|
12319
12435
|
var MultiSelect = (_a) => {
|
12320
12436
|
var _b = _a, {
|
12321
12437
|
options,
|
12322
|
-
noResults
|
12438
|
+
noResults,
|
12439
|
+
emptyState = noResults
|
12323
12440
|
} = _b, props = __objRest(_b, [
|
12324
12441
|
"options",
|
12325
|
-
"noResults"
|
12442
|
+
"noResults",
|
12443
|
+
"emptyState"
|
12326
12444
|
]);
|
12327
12445
|
var _a2;
|
12328
12446
|
const id = (0, import_react90.useRef)((_a2 = props.id) != null ? _a2 : `multiselect-${(0, import_uniqueId6.default)()}`);
|
@@ -12339,7 +12457,7 @@ var MultiSelect = (_a) => {
|
|
12339
12457
|
}), /* @__PURE__ */ import_react90.default.createElement(MultiSelectBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
|
12340
12458
|
id: id.current,
|
12341
12459
|
options,
|
12342
|
-
|
12460
|
+
emptyState,
|
12343
12461
|
disabled: props.disabled,
|
12344
12462
|
valid: props.valid
|
12345
12463
|
})));
|
@@ -12946,15 +13064,117 @@ RadioButtonGroup.Skeleton = RadioButtonGroupSkeleton;
|
|
12946
13064
|
RadioButtonGroup.Skeleton.displayName = "RadioButtonGroup.Skeleton";
|
12947
13065
|
|
12948
13066
|
// src/molecules/Section/Section.tsx
|
12949
|
-
var
|
13067
|
+
var import_react107 = __toESM(require("react"));
|
12950
13068
|
var import_utils14 = require("@react-aria/utils");
|
12951
13069
|
var import_web3 = require("@react-spring/web");
|
12952
13070
|
var import_castArray4 = __toESM(require("lodash/castArray"));
|
12953
13071
|
var import_isUndefined8 = __toESM(require("lodash/isUndefined"));
|
12954
|
-
var import_noop = __toESM(require("lodash/noop"));
|
12955
13072
|
|
12956
|
-
// src/molecules/
|
13073
|
+
// src/molecules/Switch/Switch.tsx
|
13074
|
+
var import_react103 = __toESM(require("react"));
|
13075
|
+
|
13076
|
+
// src/atoms/Switch/Switch.tsx
|
12957
13077
|
var import_react102 = __toESM(require("react"));
|
13078
|
+
var import_ban2 = __toESM(require_ban());
|
13079
|
+
var Switch = import_react102.default.forwardRef(
|
13080
|
+
(_a, ref) => {
|
13081
|
+
var _b = _a, { id, children, name, disabled = false, readOnly = false } = _b, props = __objRest(_b, ["id", "children", "name", "disabled", "readOnly"]);
|
13082
|
+
return /* @__PURE__ */ import_react102.default.createElement("span", {
|
13083
|
+
className: tw("relative inline-flex justify-center items-center self-center group")
|
13084
|
+
}, /* @__PURE__ */ import_react102.default.createElement("input", __spreadProps(__spreadValues({
|
13085
|
+
id,
|
13086
|
+
ref,
|
13087
|
+
type: "checkbox",
|
13088
|
+
name
|
13089
|
+
}, props), {
|
13090
|
+
className: classNames(
|
13091
|
+
tw(
|
13092
|
+
"appearance-none peer/switch rounded-full inline-block w-[34px] h-[20px] transition duration-300",
|
13093
|
+
"outline-none focusable bg-grey-10",
|
13094
|
+
"cursor-pointer disabled:cursor-not-allowed",
|
13095
|
+
{
|
13096
|
+
"hover:bg-grey-20 checked:bg-primary-80 hover:checked:bg-primary-70": !disabled,
|
13097
|
+
"bg-grey-5 checked:opacity-50 checked:bg-primary-40": disabled
|
13098
|
+
}
|
13099
|
+
)
|
13100
|
+
),
|
13101
|
+
readOnly,
|
13102
|
+
disabled
|
13103
|
+
})), /* @__PURE__ */ import_react102.default.createElement("span", {
|
13104
|
+
className: tw(
|
13105
|
+
"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",
|
13106
|
+
"bg-white left-2 peer-checked/switch:left-1 text-grey-30 peer-checked/switch:text-primary-60",
|
13107
|
+
{
|
13108
|
+
"shadow-4dp": !disabled
|
13109
|
+
}
|
13110
|
+
)
|
13111
|
+
}, disabled && /* @__PURE__ */ import_react102.default.createElement(Icon, {
|
13112
|
+
icon: import_ban2.default,
|
13113
|
+
width: "10px",
|
13114
|
+
height: "10px"
|
13115
|
+
})));
|
13116
|
+
}
|
13117
|
+
);
|
13118
|
+
|
13119
|
+
// src/molecules/Switch/Switch.tsx
|
13120
|
+
var Switch2 = import_react103.default.forwardRef(
|
13121
|
+
(_a, ref) => {
|
13122
|
+
var _b = _a, {
|
13123
|
+
id,
|
13124
|
+
name,
|
13125
|
+
caption,
|
13126
|
+
readOnly = false,
|
13127
|
+
disabled = false,
|
13128
|
+
children,
|
13129
|
+
"aria-label": ariaLabel,
|
13130
|
+
labelPlacement
|
13131
|
+
} = _b, props = __objRest(_b, [
|
13132
|
+
"id",
|
13133
|
+
"name",
|
13134
|
+
"caption",
|
13135
|
+
"readOnly",
|
13136
|
+
"disabled",
|
13137
|
+
"children",
|
13138
|
+
"aria-label",
|
13139
|
+
"labelPlacement"
|
13140
|
+
]);
|
13141
|
+
var _a2;
|
13142
|
+
const isChecked = (_a2 = props.checked) != null ? _a2 : props.defaultChecked;
|
13143
|
+
return !readOnly || isChecked ? /* @__PURE__ */ import_react103.default.createElement(ControlLabel, {
|
13144
|
+
htmlFor: id,
|
13145
|
+
label: children,
|
13146
|
+
"aria-label": ariaLabel,
|
13147
|
+
caption,
|
13148
|
+
readOnly,
|
13149
|
+
disabled,
|
13150
|
+
style: { gap: "0 8px" },
|
13151
|
+
labelPlacement,
|
13152
|
+
className: "Aquarium-Switch"
|
13153
|
+
}, !readOnly && /* @__PURE__ */ import_react103.default.createElement(Switch, __spreadProps(__spreadValues({
|
13154
|
+
id,
|
13155
|
+
ref,
|
13156
|
+
name
|
13157
|
+
}, props), {
|
13158
|
+
readOnly,
|
13159
|
+
disabled
|
13160
|
+
}))) : null;
|
13161
|
+
}
|
13162
|
+
);
|
13163
|
+
Switch2.displayName = "Switch";
|
13164
|
+
var SwitchSkeleton = () => /* @__PURE__ */ import_react103.default.createElement("div", {
|
13165
|
+
className: tw("flex gap-3")
|
13166
|
+
}, /* @__PURE__ */ import_react103.default.createElement(Skeleton, {
|
13167
|
+
height: 20,
|
13168
|
+
width: 35
|
13169
|
+
}), /* @__PURE__ */ import_react103.default.createElement(Skeleton, {
|
13170
|
+
height: 20,
|
13171
|
+
width: 150
|
13172
|
+
}));
|
13173
|
+
Switch2.Skeleton = SwitchSkeleton;
|
13174
|
+
Switch2.Skeleton.displayName = "Switch.Skeleton ";
|
13175
|
+
|
13176
|
+
// src/molecules/TagLabel/TagLabel.tsx
|
13177
|
+
var import_react104 = __toESM(require("react"));
|
12958
13178
|
var getVariantClassNames = (variant = "primary") => {
|
12959
13179
|
switch (variant) {
|
12960
13180
|
case "danger":
|
@@ -12968,7 +13188,7 @@ var getVariantClassNames = (variant = "primary") => {
|
|
12968
13188
|
};
|
12969
13189
|
var TagLabel = (_a) => {
|
12970
13190
|
var _b = _a, { title, dense = false, variant } = _b, rest = __objRest(_b, ["title", "dense", "variant"]);
|
12971
|
-
return /* @__PURE__ */
|
13191
|
+
return /* @__PURE__ */ import_react104.default.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
12972
13192
|
className: classNames(
|
12973
13193
|
"Aquarium-TagLabel",
|
12974
13194
|
getVariantClassNames(variant),
|
@@ -12981,41 +13201,42 @@ var TagLabel = (_a) => {
|
|
12981
13201
|
};
|
12982
13202
|
|
12983
13203
|
// src/atoms/Section/Section.tsx
|
12984
|
-
var
|
13204
|
+
var import_react105 = __toESM(require("react"));
|
12985
13205
|
var import_caretUp2 = __toESM(require_caretUp());
|
12986
13206
|
var Section3 = (_a) => {
|
12987
13207
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
12988
|
-
return /* @__PURE__ */
|
13208
|
+
return /* @__PURE__ */ import_react105.default.createElement(Box, __spreadValues({
|
13209
|
+
component: "section",
|
12989
13210
|
borderColor: "grey-5",
|
12990
13211
|
borderWidth: "1px"
|
12991
13212
|
}, rest), children);
|
12992
13213
|
};
|
12993
13214
|
Section3.Header = (_a) => {
|
12994
13215
|
var _b = _a, { children, className, collapsible } = _b, rest = __objRest(_b, ["children", "className", "collapsible"]);
|
12995
|
-
return /* @__PURE__ */
|
13216
|
+
return /* @__PURE__ */ import_react105.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12996
13217
|
className: classNames(
|
12997
|
-
tw("px-6
|
13218
|
+
tw("px-6 flex gap-5 justify-between items-center h-[72px]", { "bg-grey-0": collapsible }),
|
12998
13219
|
className
|
12999
13220
|
)
|
13000
13221
|
}), children);
|
13001
13222
|
};
|
13002
13223
|
Section3.TitleContainer = (_a) => {
|
13003
13224
|
var _b = _a, { children, className, collapsible } = _b, rest = __objRest(_b, ["children", "className", "collapsible"]);
|
13004
|
-
return /* @__PURE__ */
|
13225
|
+
return /* @__PURE__ */ import_react105.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13005
13226
|
className: classNames(
|
13006
13227
|
tw("grow grid grid-cols-[auto_1fr] gap-y-2 gap-x-3 items-center", { "cursor-pointer": collapsible }),
|
13007
13228
|
className
|
13008
13229
|
)
|
13009
13230
|
}), children);
|
13010
13231
|
};
|
13011
|
-
Section3.Toggle = (props) => /* @__PURE__ */
|
13232
|
+
Section3.Toggle = (props) => /* @__PURE__ */ import_react105.default.createElement(Icon, __spreadProps(__spreadValues({}, props), {
|
13012
13233
|
icon: import_caretUp2.default,
|
13013
13234
|
height: 22,
|
13014
13235
|
width: 22
|
13015
13236
|
}));
|
13016
13237
|
Section3.Title = (_a) => {
|
13017
13238
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
13018
|
-
return /* @__PURE__ */
|
13239
|
+
return /* @__PURE__ */ import_react105.default.createElement(Typography2.Large, __spreadProps(__spreadValues({}, rest), {
|
13019
13240
|
htmlTag: "h2",
|
13020
13241
|
color: "black",
|
13021
13242
|
className: "flex gap-3 items-center"
|
@@ -13023,35 +13244,35 @@ Section3.Title = (_a) => {
|
|
13023
13244
|
};
|
13024
13245
|
Section3.Subtitle = (_a) => {
|
13025
13246
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
13026
|
-
return /* @__PURE__ */
|
13247
|
+
return /* @__PURE__ */ import_react105.default.createElement(Typography2.Small, __spreadProps(__spreadValues({}, rest), {
|
13027
13248
|
color: "grey-70"
|
13028
13249
|
}), children);
|
13029
13250
|
};
|
13030
13251
|
Section3.Actions = (_a) => {
|
13031
13252
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
13032
|
-
return /* @__PURE__ */
|
13253
|
+
return /* @__PURE__ */ import_react105.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13033
13254
|
className: classNames(tw("flex gap-4 justify-end"), className)
|
13034
13255
|
}), children);
|
13035
13256
|
};
|
13036
13257
|
Section3.Body = (_a) => {
|
13037
13258
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
13038
|
-
return /* @__PURE__ */
|
13259
|
+
return /* @__PURE__ */ import_react105.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13039
13260
|
className: classNames(tw("p-6"), className)
|
13040
|
-
}), /* @__PURE__ */
|
13261
|
+
}), /* @__PURE__ */ import_react105.default.createElement(Typography, {
|
13041
13262
|
htmlTag: "div",
|
13042
13263
|
color: "grey-70"
|
13043
13264
|
}, children));
|
13044
13265
|
};
|
13045
13266
|
|
13046
13267
|
// src/utils/useMeasure.ts
|
13047
|
-
var
|
13268
|
+
var import_react106 = __toESM(require("react"));
|
13048
13269
|
function useMeasure() {
|
13049
|
-
const ref =
|
13050
|
-
const [rect, setRect] =
|
13270
|
+
const ref = import_react106.default.useRef(null);
|
13271
|
+
const [rect, setRect] = import_react106.default.useState({
|
13051
13272
|
width: null,
|
13052
13273
|
height: null
|
13053
13274
|
});
|
13054
|
-
|
13275
|
+
import_react106.default.useLayoutEffect(() => {
|
13055
13276
|
if (!ref.current || !window.ResizeObserver) {
|
13056
13277
|
return;
|
13057
13278
|
}
|
@@ -13074,26 +13295,33 @@ function useMeasure() {
|
|
13074
13295
|
// src/molecules/Section/Section.tsx
|
13075
13296
|
var import_more5 = __toESM(require_more());
|
13076
13297
|
var Section4 = (props) => {
|
13077
|
-
var _a, _b, _c, _d, _e
|
13298
|
+
var _a, _b, _c, _d, _e;
|
13078
13299
|
const { title, subtitle, actions, children } = props;
|
13079
13300
|
const _collapsible = title ? (_a = props.collapsible) != null ? _a : false : false;
|
13080
13301
|
const _collapsed = title ? props.collapsed : void 0;
|
13081
13302
|
const _defaultCollapsed = title ? (_b = props.defaultCollapsed) != null ? _b : false : false;
|
13082
|
-
const [isCollapsed, setCollapsed] =
|
13303
|
+
const [isCollapsed, setCollapsed] = import_react107.default.useState(_collapsed != null ? _collapsed : _defaultCollapsed);
|
13083
13304
|
const [ref, { height }] = useMeasure();
|
13084
13305
|
const menu = title ? (_c = props.menu) != null ? _c : void 0 : void 0;
|
13085
13306
|
const menuAriaLabel = title ? (_e = (_d = props.menuAriaLabel) != null ? _d : props.menuLabel) != null ? _e : "Context menu" : void 0;
|
13086
13307
|
const onAction = title ? props.onAction : void 0;
|
13087
13308
|
const onMenuOpenChange = title ? props.onMenuOpenChange : void 0;
|
13088
|
-
const
|
13309
|
+
const onCollapsedChange = title ? props.onCollapsedChange : void 0;
|
13089
13310
|
if (title && !(0, import_isUndefined8.default)(props.collapsed) && props.collapsed !== isCollapsed) {
|
13090
13311
|
setCollapsed(props.collapsed);
|
13091
13312
|
}
|
13092
13313
|
const handleTitleClick = () => {
|
13093
|
-
|
13314
|
+
if (_collapsible) {
|
13315
|
+
if (onCollapsedChange) {
|
13316
|
+
onCollapsedChange(!isCollapsed);
|
13317
|
+
}
|
13318
|
+
if (_collapsed === void 0) {
|
13319
|
+
setCollapsed(!isCollapsed);
|
13320
|
+
}
|
13321
|
+
}
|
13094
13322
|
};
|
13095
13323
|
const targetHeight = isCollapsed ? "0px" : `${height != null ? height : 0}px`;
|
13096
|
-
const
|
13324
|
+
const _f = (0, import_web3.useSpring)({
|
13097
13325
|
height: height !== null ? targetHeight : void 0,
|
13098
13326
|
opacity: isCollapsed ? 0 : 1,
|
13099
13327
|
transform: `rotate(${isCollapsed ? 0 : 180}deg)`,
|
@@ -13102,50 +13330,54 @@ var Section4 = (props) => {
|
|
13102
13330
|
duration: 150
|
13103
13331
|
},
|
13104
13332
|
immediate: !_collapsible
|
13105
|
-
}), { transform, backgroundColor } =
|
13333
|
+
}), { transform, backgroundColor } = _f, spring = __objRest(_f, ["transform", "backgroundColor"]);
|
13106
13334
|
const toggleId = (0, import_utils14.useId)();
|
13107
13335
|
const regionId = (0, import_utils14.useId)();
|
13108
|
-
return /* @__PURE__ */
|
13336
|
+
return /* @__PURE__ */ import_react107.default.createElement(Section3, {
|
13337
|
+
"aria-label": title,
|
13109
13338
|
className: "Aquarium-Section"
|
13110
|
-
}, title && /* @__PURE__ */
|
13339
|
+
}, title && /* @__PURE__ */ import_react107.default.createElement(import_react107.default.Fragment, null, /* @__PURE__ */ import_react107.default.createElement(Section3.Header, {
|
13111
13340
|
collapsible: _collapsible
|
13112
|
-
}, /* @__PURE__ */
|
13341
|
+
}, /* @__PURE__ */ import_react107.default.createElement(Section3.TitleContainer, {
|
13113
13342
|
role: _collapsible ? "button" : void 0,
|
13114
13343
|
id: toggleId,
|
13115
13344
|
collapsible: _collapsible,
|
13116
13345
|
onClick: handleTitleClick,
|
13117
13346
|
"aria-expanded": !isCollapsed,
|
13118
13347
|
"aria-controls": regionId
|
13119
|
-
}, _collapsible && /* @__PURE__ */
|
13348
|
+
}, _collapsible && /* @__PURE__ */ import_react107.default.createElement(import_web3.animated.div, {
|
13120
13349
|
style: { transform }
|
13121
|
-
}, /* @__PURE__ */
|
13350
|
+
}, /* @__PURE__ */ import_react107.default.createElement(Section3.Toggle, null)), /* @__PURE__ */ import_react107.default.createElement(Section3.Title, null, /* @__PURE__ */ import_react107.default.createElement(LineClamp2, {
|
13351
|
+
lines: 1
|
13352
|
+
}, title), props.tag && /* @__PURE__ */ import_react107.default.createElement(TagLabel, __spreadValues({}, props.tag)), props.badge && /* @__PURE__ */ import_react107.default.createElement(Chip2, {
|
13122
13353
|
text: props.badge
|
13123
|
-
}), props.chip && /* @__PURE__ */
|
13354
|
+
}), props.chip && /* @__PURE__ */ import_react107.default.createElement(StatusChip, __spreadValues({}, props.chip))), subtitle && /* @__PURE__ */ import_react107.default.createElement(Section3.Subtitle, {
|
13124
13355
|
className: tw("row-start-2", { "col-start-2": _collapsible })
|
13125
|
-
},
|
13356
|
+
}, /* @__PURE__ */ import_react107.default.createElement(LineClamp2, {
|
13357
|
+
lines: 1
|
13358
|
+
}, subtitle))), !isCollapsed && /* @__PURE__ */ import_react107.default.createElement(Section3.Actions, null, menu && /* @__PURE__ */ import_react107.default.createElement(Box.Flex, {
|
13126
13359
|
alignItems: "center"
|
13127
|
-
}, /* @__PURE__ */
|
13360
|
+
}, /* @__PURE__ */ import_react107.default.createElement(DropdownMenu2, {
|
13128
13361
|
onAction: (action) => onAction == null ? void 0 : onAction(action),
|
13129
13362
|
onOpenChange: onMenuOpenChange
|
13130
|
-
}, /* @__PURE__ */
|
13363
|
+
}, /* @__PURE__ */ import_react107.default.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ import_react107.default.createElement(Button.Icon, {
|
13131
13364
|
"aria-label": menuAriaLabel,
|
13132
13365
|
icon: import_more5.default
|
13133
|
-
})), menu)), actions && (0, import_castArray4.default)(actions).filter(Boolean).map((action) => renderAction("secondary", action)))), /* @__PURE__ */
|
13366
|
+
})), menu)), actions && (0, import_castArray4.default)(actions).filter(Boolean).map((action) => renderAction("secondary", action)), props.switch && /* @__PURE__ */ import_react107.default.createElement(Switch2, __spreadValues({}, props.switch)))), /* @__PURE__ */ import_react107.default.createElement(import_web3.animated.div, {
|
13134
13367
|
className: tw(`h-[1px]`),
|
13135
13368
|
style: { backgroundColor }
|
13136
|
-
})), /* @__PURE__ */
|
13369
|
+
})), /* @__PURE__ */ import_react107.default.createElement(import_web3.animated.div, {
|
13137
13370
|
id: regionId,
|
13138
|
-
role: "region",
|
13139
13371
|
"aria-hidden": isCollapsed ? true : void 0,
|
13140
13372
|
style: spring,
|
13141
13373
|
className: tw({ "overflow-hidden": _collapsible })
|
13142
|
-
}, /* @__PURE__ */
|
13374
|
+
}, /* @__PURE__ */ import_react107.default.createElement("div", {
|
13143
13375
|
ref
|
13144
|
-
}, /* @__PURE__ */
|
13376
|
+
}, /* @__PURE__ */ import_react107.default.createElement(Section3.Body, null, children))));
|
13145
13377
|
};
|
13146
13378
|
|
13147
13379
|
// src/molecules/SegmentedControl/SegmentedControl.tsx
|
13148
|
-
var
|
13380
|
+
var import_react108 = __toESM(require("react"));
|
13149
13381
|
var SegmentedControl = (_a) => {
|
13150
13382
|
var _b = _a, {
|
13151
13383
|
children,
|
@@ -13162,7 +13394,7 @@ var SegmentedControl = (_a) => {
|
|
13162
13394
|
"selected",
|
13163
13395
|
"className"
|
13164
13396
|
]);
|
13165
|
-
return /* @__PURE__ */
|
13397
|
+
return /* @__PURE__ */ import_react108.default.createElement("li", null, /* @__PURE__ */ import_react108.default.createElement("button", __spreadProps(__spreadValues({
|
13166
13398
|
type: "button"
|
13167
13399
|
}, rest), {
|
13168
13400
|
className: classNames(
|
@@ -13196,12 +13428,12 @@ var SegmentedControlGroup = (_a) => {
|
|
13196
13428
|
"border border-grey-20 text-grey-50": variant === "outlined",
|
13197
13429
|
"bg-grey-0": variant === "raised"
|
13198
13430
|
});
|
13199
|
-
return /* @__PURE__ */
|
13431
|
+
return /* @__PURE__ */ import_react108.default.createElement("ul", __spreadProps(__spreadValues({}, rest), {
|
13200
13432
|
"aria-label": ariaLabel,
|
13201
13433
|
className: classNames("Aquarium-SegmentedControl", classes2, className)
|
13202
|
-
}),
|
13434
|
+
}), import_react108.default.Children.map(
|
13203
13435
|
children,
|
13204
|
-
(child) =>
|
13436
|
+
(child) => import_react108.default.cloneElement(child, {
|
13205
13437
|
dense,
|
13206
13438
|
variant,
|
13207
13439
|
onClick: () => onChange(child.props.value),
|
@@ -13239,14 +13471,14 @@ var getCommonClassNames = (dense, selected) => tw(
|
|
13239
13471
|
);
|
13240
13472
|
|
13241
13473
|
// src/molecules/Stepper/Stepper.tsx
|
13242
|
-
var
|
13474
|
+
var import_react110 = __toESM(require("react"));
|
13243
13475
|
|
13244
13476
|
// src/atoms/Stepper/Stepper.tsx
|
13245
|
-
var
|
13477
|
+
var import_react109 = __toESM(require("react"));
|
13246
13478
|
var import_tick6 = __toESM(require_tick());
|
13247
13479
|
var Stepper = (_a) => {
|
13248
13480
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13249
|
-
return /* @__PURE__ */
|
13481
|
+
return /* @__PURE__ */ import_react109.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13250
13482
|
className: classNames(className)
|
13251
13483
|
}));
|
13252
13484
|
};
|
@@ -13260,7 +13492,7 @@ var ConnectorContainer = (_a) => {
|
|
13260
13492
|
"completed",
|
13261
13493
|
"dense"
|
13262
13494
|
]);
|
13263
|
-
return /* @__PURE__ */
|
13495
|
+
return /* @__PURE__ */ import_react109.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13264
13496
|
className: classNames(
|
13265
13497
|
tw("absolute w-full -left-1/2", {
|
13266
13498
|
"top-[3px] px-[14px]": Boolean(dense),
|
@@ -13272,7 +13504,7 @@ var ConnectorContainer = (_a) => {
|
|
13272
13504
|
};
|
13273
13505
|
var Connector = (_a) => {
|
13274
13506
|
var _b = _a, { children, className, completed, dense } = _b, rest = __objRest(_b, ["children", "className", "completed", "dense"]);
|
13275
|
-
return /* @__PURE__ */
|
13507
|
+
return /* @__PURE__ */ import_react109.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13276
13508
|
className: classNames(
|
13277
13509
|
tw("w-full", {
|
13278
13510
|
"bg-grey-20": !completed,
|
@@ -13286,7 +13518,7 @@ var Connector = (_a) => {
|
|
13286
13518
|
};
|
13287
13519
|
var Step = (_a) => {
|
13288
13520
|
var _b = _a, { className, state } = _b, rest = __objRest(_b, ["className", "state"]);
|
13289
|
-
return /* @__PURE__ */
|
13521
|
+
return /* @__PURE__ */ import_react109.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13290
13522
|
className: classNames(
|
13291
13523
|
tw("flex flex-col items-center text-grey-90 relative text-center", {
|
13292
13524
|
"text-grey-20": state === "inactive"
|
@@ -13307,13 +13539,13 @@ var getDenseClassNames = (state) => tw("h-[8px] w-[8px]", {
|
|
13307
13539
|
});
|
13308
13540
|
var Indicator = (_a) => {
|
13309
13541
|
var _b = _a, { children, className, state, dense } = _b, rest = __objRest(_b, ["children", "className", "state", "dense"]);
|
13310
|
-
return /* @__PURE__ */
|
13542
|
+
return /* @__PURE__ */ import_react109.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13311
13543
|
className: classNames(
|
13312
13544
|
tw("rounded-full flex justify-center items-center mx-2 mb-3"),
|
13313
13545
|
dense ? getDenseClassNames(state) : getClassNames(state),
|
13314
13546
|
className
|
13315
13547
|
)
|
13316
|
-
}), state === "completed" ? /* @__PURE__ */
|
13548
|
+
}), state === "completed" ? /* @__PURE__ */ import_react109.default.createElement(InlineIcon, {
|
13317
13549
|
icon: import_tick6.default
|
13318
13550
|
}) : dense ? null : children);
|
13319
13551
|
};
|
@@ -13324,26 +13556,26 @@ Stepper.ConnectorContainer = ConnectorContainer;
|
|
13324
13556
|
|
13325
13557
|
// src/molecules/Stepper/Stepper.tsx
|
13326
13558
|
var Stepper2 = ({ children, activeIndex, dense }) => {
|
13327
|
-
const steps =
|
13328
|
-
return /* @__PURE__ */
|
13559
|
+
const steps = import_react110.default.Children.count(children);
|
13560
|
+
return /* @__PURE__ */ import_react110.default.createElement(Stepper, {
|
13329
13561
|
role: "list",
|
13330
13562
|
className: "Aquarium-Stepper"
|
13331
|
-
}, /* @__PURE__ */
|
13563
|
+
}, /* @__PURE__ */ import_react110.default.createElement(Template, {
|
13332
13564
|
columns: steps
|
13333
|
-
},
|
13565
|
+
}, import_react110.default.Children.map(children, (child, index) => {
|
13334
13566
|
if (!isComponentType(child, Step2)) {
|
13335
13567
|
return new Error("<Stepper> can only have <Stepper.Step> components as children");
|
13336
13568
|
} else {
|
13337
13569
|
const state = index > activeIndex ? "inactive" : index === activeIndex ? "active" : "completed";
|
13338
|
-
return /* @__PURE__ */
|
13570
|
+
return /* @__PURE__ */ import_react110.default.createElement(Stepper.Step, {
|
13339
13571
|
state,
|
13340
13572
|
"aria-current": state === "active" ? "step" : false,
|
13341
13573
|
role: "listitem"
|
13342
|
-
}, index > 0 && index <= steps && /* @__PURE__ */
|
13574
|
+
}, index > 0 && index <= steps && /* @__PURE__ */ import_react110.default.createElement(Stepper.ConnectorContainer, {
|
13343
13575
|
dense
|
13344
|
-
}, /* @__PURE__ */
|
13576
|
+
}, /* @__PURE__ */ import_react110.default.createElement(Stepper.ConnectorContainer.Connector, {
|
13345
13577
|
completed: state === "completed" || state === "active"
|
13346
|
-
})), /* @__PURE__ */
|
13578
|
+
})), /* @__PURE__ */ import_react110.default.createElement(Stepper.Step.Indicator, {
|
13347
13579
|
state,
|
13348
13580
|
dense
|
13349
13581
|
}, index + 1), child.props.children);
|
@@ -13355,104 +13587,6 @@ var Step2 = () => null;
|
|
13355
13587
|
Step2.displayName = "Stepper.Step";
|
13356
13588
|
Stepper2.Step = Step2;
|
13357
13589
|
|
13358
|
-
// src/molecules/Switch/Switch.tsx
|
13359
|
-
var import_react110 = __toESM(require("react"));
|
13360
|
-
|
13361
|
-
// src/atoms/Switch/Switch.tsx
|
13362
|
-
var import_react109 = __toESM(require("react"));
|
13363
|
-
var Switch = import_react109.default.forwardRef(
|
13364
|
-
(_a, ref) => {
|
13365
|
-
var _b = _a, { id, children, name, disabled = false, readOnly = false } = _b, props = __objRest(_b, ["id", "children", "name", "disabled", "readOnly"]);
|
13366
|
-
return /* @__PURE__ */ import_react109.default.createElement("span", {
|
13367
|
-
className: tw("relative inline-flex justify-center items-center self-center group")
|
13368
|
-
}, /* @__PURE__ */ import_react109.default.createElement("input", __spreadProps(__spreadValues({
|
13369
|
-
id,
|
13370
|
-
ref,
|
13371
|
-
type: "checkbox",
|
13372
|
-
name
|
13373
|
-
}, props), {
|
13374
|
-
className: classNames(
|
13375
|
-
tw(
|
13376
|
-
"appearance-none peer/switch rounded-full inline-block w-[34px] h-[20px] transition duration-300",
|
13377
|
-
"outline-none focus:border border-info-70 bg-grey-20",
|
13378
|
-
"cursor-pointer disabled:cursor-not-allowed",
|
13379
|
-
{
|
13380
|
-
"hover:bg-grey-30 checked:bg-primary-80 hover:checked:bg-primary-80": !disabled,
|
13381
|
-
"bg-grey-5 checked:opacity-40 checked:bg-primary-40": disabled
|
13382
|
-
}
|
13383
|
-
)
|
13384
|
-
),
|
13385
|
-
readOnly,
|
13386
|
-
disabled
|
13387
|
-
})), /* @__PURE__ */ import_react109.default.createElement("span", {
|
13388
|
-
className: tw(
|
13389
|
-
"pointer-events-none rounded-full absolute inline-block transition duration-300 h-4 w-4 transform peer-checked/switch:translate-x-5",
|
13390
|
-
"bg-white peer-disabled/switch:bg-grey-0 left-2 peer-checked/switch:left-1",
|
13391
|
-
{
|
13392
|
-
"shadow-4dp": !disabled
|
13393
|
-
}
|
13394
|
-
)
|
13395
|
-
}));
|
13396
|
-
}
|
13397
|
-
);
|
13398
|
-
|
13399
|
-
// src/molecules/Switch/Switch.tsx
|
13400
|
-
var Switch2 = import_react110.default.forwardRef(
|
13401
|
-
(_a, ref) => {
|
13402
|
-
var _b = _a, {
|
13403
|
-
id,
|
13404
|
-
name,
|
13405
|
-
caption,
|
13406
|
-
readOnly = false,
|
13407
|
-
disabled = false,
|
13408
|
-
children,
|
13409
|
-
"aria-label": ariaLabel,
|
13410
|
-
labelPlacement
|
13411
|
-
} = _b, props = __objRest(_b, [
|
13412
|
-
"id",
|
13413
|
-
"name",
|
13414
|
-
"caption",
|
13415
|
-
"readOnly",
|
13416
|
-
"disabled",
|
13417
|
-
"children",
|
13418
|
-
"aria-label",
|
13419
|
-
"labelPlacement"
|
13420
|
-
]);
|
13421
|
-
var _a2;
|
13422
|
-
const isChecked = (_a2 = props.checked) != null ? _a2 : props.defaultChecked;
|
13423
|
-
return !readOnly || isChecked ? /* @__PURE__ */ import_react110.default.createElement(ControlLabel, {
|
13424
|
-
htmlFor: id,
|
13425
|
-
label: children,
|
13426
|
-
"aria-label": ariaLabel,
|
13427
|
-
caption,
|
13428
|
-
readOnly,
|
13429
|
-
disabled,
|
13430
|
-
style: { gap: "0 8px" },
|
13431
|
-
labelPlacement,
|
13432
|
-
className: "Aquarium-Switch"
|
13433
|
-
}, !readOnly && /* @__PURE__ */ import_react110.default.createElement(Switch, __spreadProps(__spreadValues({
|
13434
|
-
id,
|
13435
|
-
ref,
|
13436
|
-
name
|
13437
|
-
}, props), {
|
13438
|
-
readOnly,
|
13439
|
-
disabled
|
13440
|
-
}))) : null;
|
13441
|
-
}
|
13442
|
-
);
|
13443
|
-
Switch2.displayName = "Switch";
|
13444
|
-
var SwitchSkeleton = () => /* @__PURE__ */ import_react110.default.createElement("div", {
|
13445
|
-
className: tw("flex gap-3")
|
13446
|
-
}, /* @__PURE__ */ import_react110.default.createElement(Skeleton, {
|
13447
|
-
height: 20,
|
13448
|
-
width: 35
|
13449
|
-
}), /* @__PURE__ */ import_react110.default.createElement(Skeleton, {
|
13450
|
-
height: 20,
|
13451
|
-
width: 150
|
13452
|
-
}));
|
13453
|
-
Switch2.Skeleton = SwitchSkeleton;
|
13454
|
-
Switch2.Skeleton.displayName = "Switch.Skeleton ";
|
13455
|
-
|
13456
13590
|
// src/molecules/SwitchGroup/SwitchGroup.tsx
|
13457
13591
|
var import_react111 = __toESM(require("react"));
|
13458
13592
|
var import_uniqueId9 = __toESM(require("lodash/uniqueId"));
|