@aivenio/aquarium 1.37.0 → 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/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 +11 -7
- 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 +406 -278
- package/dist/system.mjs +398 -270
- package/dist/tsconfig.module.tsbuildinfo +1 -1
- package/dist/types/tailwindGenerated.d.ts +1 -1
- package/package.json +1 -1
package/dist/system.mjs
CHANGED
@@ -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
|
};
|
@@ -8389,7 +8405,7 @@ var ControlLabel = (_a) => {
|
|
8389
8405
|
"style",
|
8390
8406
|
"className"
|
8391
8407
|
]);
|
8392
|
-
const textClass = disabled ? "text-grey-40" : "text-grey-
|
8408
|
+
const textClass = disabled ? "text-grey-40" : "text-grey-70";
|
8393
8409
|
const rtl = labelPlacement === "left";
|
8394
8410
|
const labelEl = label && /* @__PURE__ */ React33.createElement("span", {
|
8395
8411
|
className: tw("typography-small self-center", { "text-right": rtl })
|
@@ -8527,7 +8543,66 @@ import React37 from "react";
|
|
8527
8543
|
|
8528
8544
|
// src/molecules/Grid/Grid.tsx
|
8529
8545
|
import React36 from "react";
|
8530
|
-
|
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(
|
8531
8606
|
({
|
8532
8607
|
htmlTag = "div",
|
8533
8608
|
className,
|
@@ -8585,6 +8660,7 @@ var Grid = Tailwindify(
|
|
8585
8660
|
}, children);
|
8586
8661
|
}
|
8587
8662
|
);
|
8663
|
+
Grid.Item = GridItem;
|
8588
8664
|
|
8589
8665
|
// src/atoms/InputGroup/InputGroup.tsx
|
8590
8666
|
var gridColumnStyles = {
|
@@ -8658,13 +8734,13 @@ var HelperText = ({
|
|
8658
8734
|
alignItems: "start",
|
8659
8735
|
autoCols: "min",
|
8660
8736
|
className: tw("mt-1 mb-3")
|
8661
|
-
}, /* @__PURE__ */ React40.createElement(
|
8737
|
+
}, /* @__PURE__ */ React40.createElement(GridItem2, {
|
8662
8738
|
colStart: "1",
|
8663
8739
|
colEnd: "2"
|
8664
8740
|
}, hasError && /* @__PURE__ */ React40.createElement("p", {
|
8665
8741
|
id: messageId,
|
8666
8742
|
className: tw("text-error-50 block typography-caption")
|
8667
|
-
}, helperText)), /* @__PURE__ */ React40.createElement(
|
8743
|
+
}, helperText)), /* @__PURE__ */ React40.createElement(GridItem2, {
|
8668
8744
|
colStart: "2",
|
8669
8745
|
colEnd: "3",
|
8670
8746
|
display: "flex"
|
@@ -8694,7 +8770,7 @@ var LabelText = ({
|
|
8694
8770
|
className: tw("block mb-2")
|
8695
8771
|
}, /* @__PURE__ */ React41.createElement("span", {
|
8696
8772
|
className: tw("inline-flex items-center typography-small-strong", {
|
8697
|
-
"text-grey-
|
8773
|
+
"text-grey-70": variant === "default",
|
8698
8774
|
"text-error-50": variant === "error",
|
8699
8775
|
"text-grey-40": variant === "disabled"
|
8700
8776
|
})
|
@@ -9022,6 +9098,7 @@ var ComboboxBase = (_a) => {
|
|
9022
9098
|
options,
|
9023
9099
|
optionKeys = ["label", "value"],
|
9024
9100
|
noResults,
|
9101
|
+
emptyState = noResults,
|
9025
9102
|
optionToString: itemToString = getOptionLabelBuiltin,
|
9026
9103
|
createOption,
|
9027
9104
|
renderOption = (opt) => itemToString(opt),
|
@@ -9041,6 +9118,7 @@ var ComboboxBase = (_a) => {
|
|
9041
9118
|
"options",
|
9042
9119
|
"optionKeys",
|
9043
9120
|
"noResults",
|
9121
|
+
"emptyState",
|
9044
9122
|
"optionToString",
|
9045
9123
|
"createOption",
|
9046
9124
|
"renderOption",
|
@@ -9156,7 +9234,7 @@ var ComboboxBase = (_a) => {
|
|
9156
9234
|
}, /* @__PURE__ */ React46.createElement(Select.Menu, __spreadValues({
|
9157
9235
|
ref: menuRef,
|
9158
9236
|
maxHeight
|
9159
|
-
}, 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({
|
9160
9238
|
key: itemToString(item),
|
9161
9239
|
selected: item === selectedItem,
|
9162
9240
|
highlighted: index === highlightedIndex
|
@@ -9169,10 +9247,12 @@ ComboboxBase.Skeleton = ComboboxBaseSkeleton;
|
|
9169
9247
|
var Combobox = (_a) => {
|
9170
9248
|
var _b = _a, {
|
9171
9249
|
options,
|
9172
|
-
noResults
|
9250
|
+
noResults,
|
9251
|
+
emptyState = noResults
|
9173
9252
|
} = _b, props = __objRest(_b, [
|
9174
9253
|
"options",
|
9175
|
-
"noResults"
|
9254
|
+
"noResults",
|
9255
|
+
"emptyState"
|
9176
9256
|
]);
|
9177
9257
|
var _a2;
|
9178
9258
|
const id = useRef5((_a2 = props.id) != null ? _a2 : `combobox-${uniqueId2()}`);
|
@@ -9189,7 +9269,7 @@ var Combobox = (_a) => {
|
|
9189
9269
|
}), /* @__PURE__ */ React46.createElement(ComboboxBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
|
9190
9270
|
id: id.current,
|
9191
9271
|
options,
|
9192
|
-
|
9272
|
+
emptyState,
|
9193
9273
|
disabled: props.disabled,
|
9194
9274
|
valid: props.valid
|
9195
9275
|
})));
|
@@ -9218,7 +9298,6 @@ var Container2 = ({ maxWidth = "xl", children }) => /* @__PURE__ */ React47.crea
|
|
9218
9298
|
import React61 from "react";
|
9219
9299
|
import compact from "lodash/compact";
|
9220
9300
|
import isFunction from "lodash/isFunction";
|
9221
|
-
import isObject from "lodash/isObject";
|
9222
9301
|
|
9223
9302
|
// src/molecules/DropdownMenu/DropdownMenu.tsx
|
9224
9303
|
import React51 from "react";
|
@@ -9319,7 +9398,8 @@ var createInput = (displayName, opts = {}) => {
|
|
9319
9398
|
readOnly,
|
9320
9399
|
className: classNames(
|
9321
9400
|
{
|
9322
|
-
"pl-7": opts.adornment
|
9401
|
+
"pl-7": opts.adornment,
|
9402
|
+
"pr-7": opts.canReset || endAdornment
|
9323
9403
|
},
|
9324
9404
|
getCommonInputStyles({ readOnly, valid }),
|
9325
9405
|
props.className
|
@@ -9674,22 +9754,15 @@ var getDisabledItemKeys = (children) => {
|
|
9674
9754
|
};
|
9675
9755
|
|
9676
9756
|
// src/molecules/List/List.tsx
|
9677
|
-
import
|
9678
|
-
|
9679
|
-
items,
|
9680
|
-
renderItem,
|
9681
|
-
container = React52.Fragment
|
9682
|
-
}) => {
|
9683
|
-
const Component = container;
|
9684
|
-
return /* @__PURE__ */ React52.createElement(Component, null, items.map(renderItem));
|
9685
|
-
};
|
9757
|
+
import React54 from "react";
|
9758
|
+
import isObject from "lodash/isObject";
|
9686
9759
|
|
9687
9760
|
// src/molecules/Pagination/Pagination.tsx
|
9688
|
-
import
|
9761
|
+
import React53 from "react";
|
9689
9762
|
import clamp from "lodash/clamp";
|
9690
9763
|
|
9691
9764
|
// src/molecules/Select/Select.tsx
|
9692
|
-
import
|
9765
|
+
import React52, { useRef as useRef7, useState as useState7 } from "react";
|
9693
9766
|
import { useSelect } from "downshift";
|
9694
9767
|
import defaults from "lodash/defaults";
|
9695
9768
|
import isArray from "lodash/isArray";
|
@@ -9705,10 +9778,10 @@ var hasOptionGroups = (val) => {
|
|
9705
9778
|
};
|
9706
9779
|
var defaultRenderOption = (item, props, { selectedItem }, { getOptionKey, getValue, optionToString = getOptionLabelBuiltin }) => {
|
9707
9780
|
var _a, _b;
|
9708
|
-
return /* @__PURE__ */
|
9781
|
+
return /* @__PURE__ */ React52.createElement(Select.Item, __spreadValues({
|
9709
9782
|
key: (_b = (_a = getOptionKey == null ? void 0 : getOptionKey(item)) != null ? _a : getValue == null ? void 0 : getValue(item)) != null ? _b : optionToString(item),
|
9710
9783
|
selected: item === selectedItem
|
9711
|
-
}, props), hasIconProperty(item) && /* @__PURE__ */
|
9784
|
+
}, props), hasIconProperty(item) && /* @__PURE__ */ React52.createElement(InlineIcon, {
|
9712
9785
|
icon: item.icon
|
9713
9786
|
}), optionToString(item));
|
9714
9787
|
};
|
@@ -9815,7 +9888,7 @@ var _SelectBase = (props) => {
|
|
9815
9888
|
toggle: toggleMenu,
|
9816
9889
|
setOpen: (isOpen2) => isOpen2 ? openMenu() : closeMenu()
|
9817
9890
|
};
|
9818
|
-
const
|
9891
|
+
const renderItem3 = (item, index) => UNSAFE_renderOption(
|
9819
9892
|
item,
|
9820
9893
|
__spreadValues({
|
9821
9894
|
highlighted: index === highlightedIndex
|
@@ -9827,13 +9900,13 @@ var _SelectBase = (props) => {
|
|
9827
9900
|
},
|
9828
9901
|
withDefaults
|
9829
9902
|
);
|
9830
|
-
const renderGroup = (group) => /* @__PURE__ */
|
9903
|
+
const renderGroup = (group) => /* @__PURE__ */ React52.createElement(React52.Fragment, {
|
9831
9904
|
key: group.label
|
9832
|
-
}, /* @__PURE__ */
|
9833
|
-
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 })), {
|
9834
9907
|
variant: disabled ? "disabled" : !valid ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default",
|
9835
9908
|
tabIndex: 0
|
9836
|
-
}), /* @__PURE__ */
|
9909
|
+
}), /* @__PURE__ */ React52.createElement(Select.Input, __spreadProps(__spreadValues({
|
9837
9910
|
id,
|
9838
9911
|
name
|
9839
9912
|
}, rest), {
|
@@ -9845,26 +9918,26 @@ var _SelectBase = (props) => {
|
|
9845
9918
|
tabIndex: -1,
|
9846
9919
|
onFocus: () => setFocus(true),
|
9847
9920
|
onBlur: () => setFocus(false)
|
9848
|
-
})), !readOnly && /* @__PURE__ */
|
9921
|
+
})), !readOnly && /* @__PURE__ */ React52.createElement(Select.Toggle, {
|
9849
9922
|
disabled,
|
9850
9923
|
isOpen,
|
9851
9924
|
tabIndex: -1
|
9852
9925
|
}));
|
9853
9926
|
const menuProps = getMenuProps({ ref: menuRef }, { suppressRefError: !isOpen });
|
9854
|
-
return /* @__PURE__ */
|
9927
|
+
return /* @__PURE__ */ React52.createElement("div", {
|
9855
9928
|
className: classNames("Aquarium-SelectBase", tw("relative"))
|
9856
|
-
}, labelWrapper ?
|
9929
|
+
}, labelWrapper ? React52.cloneElement(labelWrapper, { children: input }) : input, isOpen && /* @__PURE__ */ React52.createElement(PopoverOverlay, {
|
9857
9930
|
state,
|
9858
9931
|
triggerRef: targetRef,
|
9859
9932
|
placement: "bottom-left",
|
9860
9933
|
shouldFlip: true,
|
9861
9934
|
style: { width: (_b = targetRef.current) == null ? void 0 : _b.offsetWidth }
|
9862
|
-
}, /* @__PURE__ */
|
9935
|
+
}, /* @__PURE__ */ React52.createElement(Select.Menu, __spreadValues({
|
9863
9936
|
ref: menuRef,
|
9864
9937
|
maxHeight
|
9865
|
-
}, 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, {
|
9866
9939
|
onMouseOver: () => setHighlightedIndex(-1)
|
9867
|
-
}), actions.map((act, index) => /* @__PURE__ */
|
9940
|
+
}), actions.map((act, index) => /* @__PURE__ */ React52.createElement(Select.ActionItem, __spreadProps(__spreadValues({
|
9868
9941
|
key: `${index}`
|
9869
9942
|
}, act), {
|
9870
9943
|
onMouseOver: () => setHighlightedIndex(-1),
|
@@ -9874,10 +9947,10 @@ var _SelectBase = (props) => {
|
|
9874
9947
|
}
|
9875
9948
|
}), act.label))))));
|
9876
9949
|
};
|
9877
|
-
var SelectBase = (props) => /* @__PURE__ */
|
9950
|
+
var SelectBase = (props) => /* @__PURE__ */ React52.createElement(_SelectBase, __spreadProps(__spreadValues({}, props), {
|
9878
9951
|
labelWrapper: void 0
|
9879
9952
|
}));
|
9880
|
-
var SelectBaseSkeleton = () => /* @__PURE__ */
|
9953
|
+
var SelectBaseSkeleton = () => /* @__PURE__ */ React52.createElement(Skeleton, {
|
9881
9954
|
height: 38
|
9882
9955
|
});
|
9883
9956
|
SelectBase.Skeleton = SelectBaseSkeleton;
|
@@ -9895,21 +9968,21 @@ var Select2 = (_a) => {
|
|
9895
9968
|
const baseProps = omit8(props, Object.keys(labelProps));
|
9896
9969
|
const legacyError = labelProps.error !== void 0 && labelProps.valid === false;
|
9897
9970
|
const variant = !labelProps.valid || legacyError ? "error" : labelProps.disabled ? "disabled" : "default";
|
9898
|
-
const label = /* @__PURE__ */
|
9971
|
+
const label = /* @__PURE__ */ React52.createElement(Label, __spreadValues({
|
9899
9972
|
id: `${id.current}-label`,
|
9900
9973
|
htmlFor: `${id.current}-input`,
|
9901
9974
|
variant,
|
9902
9975
|
messageId: errorMessageId
|
9903
9976
|
}, labelProps));
|
9904
|
-
return /* @__PURE__ */
|
9977
|
+
return /* @__PURE__ */ React52.createElement(FormControl, {
|
9905
9978
|
className: "Aquarium-Select"
|
9906
|
-
}, /* @__PURE__ */
|
9979
|
+
}, /* @__PURE__ */ React52.createElement(_SelectBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
|
9907
9980
|
id: `${id.current}-input`,
|
9908
9981
|
options,
|
9909
9982
|
disabled: props.disabled,
|
9910
9983
|
valid: props.valid,
|
9911
9984
|
labelWrapper: label
|
9912
|
-
})), /* @__PURE__ */
|
9985
|
+
})), /* @__PURE__ */ React52.createElement(HelperText, {
|
9913
9986
|
messageId: errorMessageId,
|
9914
9987
|
error: !labelProps.valid,
|
9915
9988
|
helperText: labelProps.helperText,
|
@@ -9918,7 +9991,7 @@ var Select2 = (_a) => {
|
|
9918
9991
|
reserveSpaceForError: labelProps.reserveSpaceForError
|
9919
9992
|
}));
|
9920
9993
|
};
|
9921
|
-
var SelectSkeleton = () => /* @__PURE__ */
|
9994
|
+
var SelectSkeleton = () => /* @__PURE__ */ React52.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React52.createElement(SelectBase.Skeleton, null));
|
9922
9995
|
Select2.Skeleton = SelectSkeleton;
|
9923
9996
|
Select2.Skeleton.displayName = "Select.Skeleton";
|
9924
9997
|
|
@@ -9937,26 +10010,26 @@ var Pagination = ({
|
|
9937
10010
|
pageSizes,
|
9938
10011
|
onPageSizeChange
|
9939
10012
|
}) => {
|
9940
|
-
const [value, setValue] =
|
9941
|
-
|
10013
|
+
const [value, setValue] = React53.useState(currentPage);
|
10014
|
+
React53.useEffect(() => {
|
9942
10015
|
setValue(currentPage);
|
9943
10016
|
}, [currentPage]);
|
9944
|
-
return /* @__PURE__ */
|
10017
|
+
return /* @__PURE__ */ React53.createElement(Box, {
|
9945
10018
|
className: classNames(
|
9946
10019
|
"Aquarium-Pagination",
|
9947
10020
|
tw({ "grid grid-cols-[200px_1fr_200px]": !!pageSizes, "flex flex-nowrap justify-center": !pageSizes })
|
9948
10021
|
),
|
9949
10022
|
backgroundColor: "grey-0",
|
9950
10023
|
padding: "4"
|
9951
|
-
}, pageSizes && onPageSizeChange && typeof pageSize === "number" ? /* @__PURE__ */
|
10024
|
+
}, pageSizes && onPageSizeChange && typeof pageSize === "number" ? /* @__PURE__ */ React53.createElement(Box, {
|
9952
10025
|
display: "flex",
|
9953
10026
|
alignItems: "center",
|
9954
10027
|
gap: "4"
|
9955
|
-
}, /* @__PURE__ */
|
10028
|
+
}, /* @__PURE__ */ React53.createElement(Typography2.Small, {
|
9956
10029
|
color: "grey-50"
|
9957
|
-
}, "Items per page "), /* @__PURE__ */
|
10030
|
+
}, "Items per page "), /* @__PURE__ */ React53.createElement("div", {
|
9958
10031
|
className: tw("max-w-[70px]")
|
9959
|
-
}, /* @__PURE__ */
|
10032
|
+
}, /* @__PURE__ */ React53.createElement(SelectBase, {
|
9960
10033
|
options: pageSizes.map((size) => size.toString()),
|
9961
10034
|
value: pageSize.toString(),
|
9962
10035
|
onChange: (size) => {
|
@@ -9967,26 +10040,26 @@ var Pagination = ({
|
|
9967
10040
|
}
|
9968
10041
|
}
|
9969
10042
|
}
|
9970
|
-
}))) : /* @__PURE__ */
|
10043
|
+
}))) : /* @__PURE__ */ React53.createElement("div", null), /* @__PURE__ */ React53.createElement(Box, {
|
9971
10044
|
display: "flex",
|
9972
10045
|
justifyContent: "center",
|
9973
10046
|
alignItems: "center",
|
9974
10047
|
className: tw("grow")
|
9975
|
-
}, /* @__PURE__ */
|
10048
|
+
}, /* @__PURE__ */ React53.createElement(Button.Icon, {
|
9976
10049
|
"aria-label": "First",
|
9977
10050
|
onClick: () => onPageChange(1),
|
9978
10051
|
icon: import_chevronBackward2.default,
|
9979
10052
|
disabled: !hasPreviousPage
|
9980
|
-
}), /* @__PURE__ */
|
10053
|
+
}), /* @__PURE__ */ React53.createElement(Button.Icon, {
|
9981
10054
|
"aria-label": "Previous",
|
9982
10055
|
onClick: () => onPageChange(currentPage - 1),
|
9983
10056
|
icon: import_chevronLeft3.default,
|
9984
10057
|
disabled: !hasPreviousPage
|
9985
|
-
}), /* @__PURE__ */
|
10058
|
+
}), /* @__PURE__ */ React53.createElement(Box, {
|
9986
10059
|
paddingX: "4"
|
9987
|
-
}, /* @__PURE__ */
|
10060
|
+
}, /* @__PURE__ */ React53.createElement(Typography2.Small, {
|
9988
10061
|
color: "grey-60"
|
9989
|
-
}, "Page")), /* @__PURE__ */
|
10062
|
+
}, "Page")), /* @__PURE__ */ React53.createElement(InputBase, {
|
9990
10063
|
className: classNames(tw("text-center max-w-[40px]"), "no-arrows"),
|
9991
10064
|
type: "number",
|
9992
10065
|
min: 1,
|
@@ -10003,21 +10076,21 @@ var Pagination = ({
|
|
10003
10076
|
const newPage = !isNaN(numberValue) ? clamp(numberValue, 1, totalPages) : 1;
|
10004
10077
|
onPageChange(newPage);
|
10005
10078
|
}
|
10006
|
-
}), /* @__PURE__ */
|
10079
|
+
}), /* @__PURE__ */ React53.createElement(Box, {
|
10007
10080
|
paddingX: "4"
|
10008
|
-
}, /* @__PURE__ */
|
10081
|
+
}, /* @__PURE__ */ React53.createElement(Typography2.Small, {
|
10009
10082
|
color: "grey-60"
|
10010
|
-
}, "of ", totalPages)), /* @__PURE__ */
|
10083
|
+
}, "of ", totalPages)), /* @__PURE__ */ React53.createElement(Button.Icon, {
|
10011
10084
|
"aria-label": "Next",
|
10012
10085
|
onClick: () => onPageChange(currentPage + 1),
|
10013
10086
|
icon: import_chevronRight3.default,
|
10014
10087
|
disabled: !hasNextPage
|
10015
|
-
}), /* @__PURE__ */
|
10088
|
+
}), /* @__PURE__ */ React53.createElement(Button.Icon, {
|
10016
10089
|
"aria-label": "Last",
|
10017
10090
|
onClick: () => onPageChange(totalPages),
|
10018
10091
|
icon: import_chevronForward2.default,
|
10019
10092
|
disabled: !hasNextPage
|
10020
|
-
})), pageSizes && /* @__PURE__ */
|
10093
|
+
})), pageSizes && /* @__PURE__ */ React53.createElement("div", null));
|
10021
10094
|
};
|
10022
10095
|
|
10023
10096
|
// src/molecules/Pagination/usePagination.tsx
|
@@ -10057,6 +10130,22 @@ var usePagination = (items, options) => {
|
|
10057
10130
|
];
|
10058
10131
|
};
|
10059
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
|
+
|
10060
10149
|
// src/molecules/Template/Template.tsx
|
10061
10150
|
import React55 from "react";
|
10062
10151
|
var Template = ({
|
@@ -10418,7 +10507,7 @@ var DataListSkeleton = ({ columns = ["1", "2", "2", 52], rows = 5 }) => {
|
|
10418
10507
|
// src/molecules/DataList/DataList.tsx
|
10419
10508
|
var DataList2 = ({
|
10420
10509
|
columns,
|
10421
|
-
rows
|
10510
|
+
rows,
|
10422
10511
|
sticky,
|
10423
10512
|
menu,
|
10424
10513
|
menuLabel,
|
@@ -10426,45 +10515,50 @@ var DataList2 = ({
|
|
10426
10515
|
menuHeaderName = "Actions",
|
10427
10516
|
onAction,
|
10428
10517
|
onMenuOpenChange,
|
10429
|
-
pagination
|
10518
|
+
pagination
|
10430
10519
|
}) => {
|
10431
10520
|
const [sort, updateSort] = useTableSort();
|
10432
|
-
const sortedRows = sortRowsBy(
|
10433
|
-
const _a = isObject(_pagination) ? _pagination : {}, { initialPage, initialPageSize } = _a, paginationProps = __objRest(_a, ["initialPage", "initialPageSize"]);
|
10434
|
-
const [paginatedItems, paginationState] = usePagination(sortedRows, { initialPage, initialPageSize });
|
10435
|
-
const rows = _pagination ? paginatedItems : sortedRows;
|
10521
|
+
const sortedRows = sortRowsBy(rows, sort);
|
10436
10522
|
const templateColumns = compact([
|
10437
10523
|
...columns.map((column) => {
|
10438
|
-
var
|
10439
|
-
return (
|
10524
|
+
var _a;
|
10525
|
+
return (_a = column.width) != null ? _a : "auto";
|
10440
10526
|
}),
|
10441
10527
|
menu ? "auto" : void 0
|
10442
10528
|
]);
|
10443
|
-
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, {
|
10444
10536
|
className: "Aquarium-DataList",
|
10445
10537
|
columns: templateColumns
|
10446
|
-
}, columns.map(
|
10447
|
-
|
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({
|
10448
10544
|
direction: sort && sort.column.headerName === column.headerName ? sort.direction : "none",
|
10449
10545
|
onClick: () => updateSort(column),
|
10450
10546
|
sticky
|
10451
|
-
}, cellProps(column)),
|
10547
|
+
}, cellProps(column)), content) : /* @__PURE__ */ React61.createElement(DataList.HeadCell, __spreadProps(__spreadValues({}, cellProps(column)), {
|
10452
10548
|
sticky
|
10453
|
-
}),
|
10454
|
-
), menu && /* @__PURE__ */ React61.createElement(DataList.HeadCell, {
|
10549
|
+
}), content);
|
10550
|
+
}), menu && /* @__PURE__ */ React61.createElement(DataList.HeadCell, {
|
10455
10551
|
align: "right",
|
10456
10552
|
"aria-label": menuAriaLabel
|
10457
10553
|
}, menuHeaderName), /* @__PURE__ */ React61.createElement(List2, {
|
10458
|
-
|
10554
|
+
pagination,
|
10555
|
+
paginationContainer: PaginationFooter,
|
10556
|
+
items: sortedRows,
|
10459
10557
|
renderItem: (row, index) => /* @__PURE__ */ React61.createElement(DataList.Row, {
|
10460
10558
|
key: row.id
|
10461
10559
|
}, /* @__PURE__ */ React61.createElement(List2, {
|
10462
10560
|
items: columns,
|
10463
|
-
renderItem: (column) =>
|
10464
|
-
dense: true
|
10465
|
-
}, column.status(row, index, sortedRows)))) : column.type === "action" ? /* @__PURE__ */ React61.createElement(DataList.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React61.createElement(Button.Secondary, __spreadValues({
|
10466
|
-
dense: true
|
10467
|
-
}, 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))
|
10468
10562
|
}), menu && /* @__PURE__ */ React61.createElement(DataList.Cell, {
|
10469
10563
|
align: "right"
|
10470
10564
|
}, /* @__PURE__ */ React61.createElement(DropdownMenu2, {
|
@@ -10475,7 +10569,14 @@ var DataList2 = ({
|
|
10475
10569
|
icon: import_more2.default
|
10476
10570
|
})), isFunction(menu) ? menu(row, index) : menu)))
|
10477
10571
|
}));
|
10478
|
-
|
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;
|
10479
10580
|
};
|
10480
10581
|
DataList2.Skeleton = DataListSkeleton;
|
10481
10582
|
|
@@ -10483,7 +10584,6 @@ DataList2.Skeleton = DataListSkeleton;
|
|
10483
10584
|
import React64 from "react";
|
10484
10585
|
import compact2 from "lodash/compact";
|
10485
10586
|
import isFunction2 from "lodash/isFunction";
|
10486
|
-
import isObject2 from "lodash/isObject";
|
10487
10587
|
|
10488
10588
|
// src/molecules/Table/Table.tsx
|
10489
10589
|
import React63 from "react";
|
@@ -10532,7 +10632,7 @@ var import_more3 = __toESM(require_more());
|
|
10532
10632
|
var DataTable = (_a) => {
|
10533
10633
|
var _b = _a, {
|
10534
10634
|
columns,
|
10535
|
-
rows
|
10635
|
+
rows,
|
10536
10636
|
noWrap = false,
|
10537
10637
|
layout = "auto",
|
10538
10638
|
sticky,
|
@@ -10542,7 +10642,7 @@ var DataTable = (_a) => {
|
|
10542
10642
|
menuHeaderName = "Actions",
|
10543
10643
|
onAction,
|
10544
10644
|
onMenuOpenChange,
|
10545
|
-
pagination
|
10645
|
+
pagination
|
10546
10646
|
} = _b, rest = __objRest(_b, [
|
10547
10647
|
"columns",
|
10548
10648
|
"rows",
|
@@ -10558,11 +10658,15 @@ var DataTable = (_a) => {
|
|
10558
10658
|
"pagination"
|
10559
10659
|
]);
|
10560
10660
|
const [sort, updateSort] = useTableSort();
|
10561
|
-
const sortedRows = sortRowsBy(
|
10562
|
-
const
|
10563
|
-
const
|
10564
|
-
|
10565
|
-
|
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), {
|
10566
10670
|
className: classNames(
|
10567
10671
|
"Aquarium-DataTable",
|
10568
10672
|
tw({
|
@@ -10574,33 +10678,36 @@ var DataTable = (_a) => {
|
|
10574
10678
|
}), /* @__PURE__ */ React64.createElement(Table2.Head, {
|
10575
10679
|
sticky
|
10576
10680
|
}, compact2([
|
10577
|
-
...columns.map(
|
10578
|
-
|
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({
|
10579
10687
|
direction: sort && sort.column.headerName === column.headerName ? sort.direction : "none",
|
10580
10688
|
onClick: () => updateSort(column),
|
10581
10689
|
style: { width: column.width },
|
10582
10690
|
"aria-label": column.headerInvisible ? column.headerName : void 0
|
10583
|
-
}, cellProps(column)),
|
10691
|
+
}, cellProps(column)), content) : /* @__PURE__ */ React64.createElement(Table2.Cell, __spreadProps(__spreadValues({}, cellProps(column)), {
|
10584
10692
|
style: { width: column.width },
|
10585
10693
|
"aria-label": column.headerInvisible ? column.headerName : void 0
|
10586
|
-
}),
|
10587
|
-
),
|
10694
|
+
}), content);
|
10695
|
+
}),
|
10588
10696
|
menu ? /* @__PURE__ */ React64.createElement(Table2.Cell, {
|
10589
10697
|
key: "__contextMenu",
|
10590
10698
|
align: "right",
|
10591
10699
|
"aria-label": menuAriaLabel
|
10592
10700
|
}, menuHeaderName) : null
|
10593
|
-
])), /* @__PURE__ */ React64.createElement(
|
10594
|
-
|
10701
|
+
])), /* @__PURE__ */ React64.createElement(List2, {
|
10702
|
+
container: Table2.Body,
|
10703
|
+
paginationContainer: PaginationFooter,
|
10704
|
+
pagination,
|
10705
|
+
items: sortedRows,
|
10595
10706
|
renderItem: (row, index) => /* @__PURE__ */ React64.createElement(Table2.Row, {
|
10596
10707
|
key: row.id
|
10597
10708
|
}, /* @__PURE__ */ React64.createElement(List2, {
|
10598
10709
|
items: columns,
|
10599
|
-
renderItem: (column) =>
|
10600
|
-
dense: true
|
10601
|
-
}, column.status(row, index, sortedRows)))) : column.type === "action" ? /* @__PURE__ */ React64.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React64.createElement(Button.Secondary, __spreadValues({
|
10602
|
-
dense: true
|
10603
|
-
}, 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))
|
10604
10711
|
}), menu && /* @__PURE__ */ React64.createElement(Table2.Cell, {
|
10605
10712
|
align: "right"
|
10606
10713
|
}, /* @__PURE__ */ React64.createElement(DropdownMenu2, {
|
@@ -10610,8 +10717,15 @@ var DataTable = (_a) => {
|
|
10610
10717
|
"aria-label": menuAriaLabel,
|
10611
10718
|
icon: import_more3.default
|
10612
10719
|
})), isFunction2(menu) ? menu(row, index) : menu)))
|
10613
|
-
}))
|
10614
|
-
|
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;
|
10615
10729
|
};
|
10616
10730
|
DataTable.Skeleton = DataListSkeleton;
|
10617
10731
|
|
@@ -10778,17 +10892,19 @@ var DialogWrapper = ({
|
|
10778
10892
|
ref
|
10779
10893
|
}, dialogProps), {
|
10780
10894
|
className: tw("outline-none")
|
10781
|
-
}), /* @__PURE__ */ React66.createElement(Modal.Header,
|
10895
|
+
}), /* @__PURE__ */ React66.createElement(Modal.Header, {
|
10896
|
+
className: tw("icon-stroke-2")
|
10897
|
+
}, /* @__PURE__ */ React66.createElement(Icon, {
|
10782
10898
|
icon: DIALOG_ICONS_AND_COLORS[type].icon,
|
10783
10899
|
color: DIALOG_ICONS_AND_COLORS[type].color,
|
10784
10900
|
fontSize: 20
|
10785
10901
|
}), /* @__PURE__ */ React66.createElement(Modal.Title, {
|
10786
10902
|
id: labelledBy,
|
10787
|
-
variant: "large
|
10903
|
+
variant: "large",
|
10788
10904
|
color: DIALOG_ICONS_AND_COLORS[type].color
|
10789
10905
|
}, title)), /* @__PURE__ */ React66.createElement(Modal.Body, {
|
10790
10906
|
id: describedBy
|
10791
|
-
}, 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({
|
10792
10908
|
key: secondaryAction.text
|
10793
10909
|
}, omit9(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */ React66.createElement(Button.Secondary, __spreadValues({
|
10794
10910
|
key: primaryAction.text
|
@@ -11166,9 +11282,7 @@ var EmptyState = ({
|
|
11166
11282
|
htmlTag: "h2"
|
11167
11283
|
}, title), (description || children) && /* @__PURE__ */ React72.createElement(Box, {
|
11168
11284
|
marginTop: "5"
|
11169
|
-
}, /* @__PURE__ */ React72.createElement(Typography2.Default, {
|
11170
|
-
color: "grey-60"
|
11171
|
-
}, children || description)), (secondaryAction || primaryAction) && /* @__PURE__ */ React72.createElement(Box.Flex, {
|
11285
|
+
}, /* @__PURE__ */ React72.createElement(Typography2.Default, null, children || description)), (secondaryAction || primaryAction) && /* @__PURE__ */ React72.createElement(Box.Flex, {
|
11172
11286
|
marginTop: "7",
|
11173
11287
|
gap: "4",
|
11174
11288
|
justifyContent: "center",
|
@@ -11203,7 +11317,7 @@ var FlexboxItem = Tailwindify(
|
|
11203
11317
|
|
11204
11318
|
// src/molecules/Grid/GridItem.tsx
|
11205
11319
|
import React74 from "react";
|
11206
|
-
var
|
11320
|
+
var GridItem2 = Tailwindify(
|
11207
11321
|
({
|
11208
11322
|
htmlTag = "div",
|
11209
11323
|
className,
|
@@ -11978,6 +12092,7 @@ var MultiSelectBase = (_a) => {
|
|
11978
12092
|
options,
|
11979
12093
|
optionKeys = ["label", "value"],
|
11980
12094
|
noResults,
|
12095
|
+
emptyState = noResults,
|
11981
12096
|
optionToString: itemToString = getOptionLabelBuiltin,
|
11982
12097
|
renderOption = (opt) => itemToString(opt),
|
11983
12098
|
isOptionDisabled = isOptionDisabledBuiltin,
|
@@ -12000,6 +12115,7 @@ var MultiSelectBase = (_a) => {
|
|
12000
12115
|
"options",
|
12001
12116
|
"optionKeys",
|
12002
12117
|
"noResults",
|
12118
|
+
"emptyState",
|
12003
12119
|
"optionToString",
|
12004
12120
|
"renderOption",
|
12005
12121
|
"isOptionDisabled",
|
@@ -12163,7 +12279,7 @@ var MultiSelectBase = (_a) => {
|
|
12163
12279
|
}, /* @__PURE__ */ React83.createElement(Select.Menu, __spreadValues({
|
12164
12280
|
ref: menuRef,
|
12165
12281
|
maxHeight
|
12166
|
-
}, menuProps), hasNoResults && /* @__PURE__ */ React83.createElement(Select.NoResults, null,
|
12282
|
+
}, menuProps), hasNoResults && /* @__PURE__ */ React83.createElement(Select.NoResults, null, emptyState), filteredOptions.map((item, index) => /* @__PURE__ */ React83.createElement(Select.Item, __spreadValues({
|
12167
12283
|
key: itemToString(item),
|
12168
12284
|
highlighted: index === highlightedIndex,
|
12169
12285
|
selected: selectedItems.includes(item)
|
@@ -12176,10 +12292,12 @@ MultiSelectBase.Skeleton = MultiSelectBaseSkeleton;
|
|
12176
12292
|
var MultiSelect = (_a) => {
|
12177
12293
|
var _b = _a, {
|
12178
12294
|
options,
|
12179
|
-
noResults
|
12295
|
+
noResults,
|
12296
|
+
emptyState = noResults
|
12180
12297
|
} = _b, props = __objRest(_b, [
|
12181
12298
|
"options",
|
12182
|
-
"noResults"
|
12299
|
+
"noResults",
|
12300
|
+
"emptyState"
|
12183
12301
|
]);
|
12184
12302
|
var _a2;
|
12185
12303
|
const id = useRef11((_a2 = props.id) != null ? _a2 : `multiselect-${uniqueId6()}`);
|
@@ -12196,7 +12314,7 @@ var MultiSelect = (_a) => {
|
|
12196
12314
|
}), /* @__PURE__ */ React83.createElement(MultiSelectBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
|
12197
12315
|
id: id.current,
|
12198
12316
|
options,
|
12199
|
-
|
12317
|
+
emptyState,
|
12200
12318
|
disabled: props.disabled,
|
12201
12319
|
valid: props.valid
|
12202
12320
|
})));
|
@@ -12803,15 +12921,118 @@ RadioButtonGroup.Skeleton = RadioButtonGroupSkeleton;
|
|
12803
12921
|
RadioButtonGroup.Skeleton.displayName = "RadioButtonGroup.Skeleton";
|
12804
12922
|
|
12805
12923
|
// src/molecules/Section/Section.tsx
|
12806
|
-
import
|
12924
|
+
import React100 from "react";
|
12807
12925
|
import { useId as useId3 } from "@react-aria/utils";
|
12808
12926
|
import { animated as animated3, useSpring as useSpring2 } from "@react-spring/web";
|
12809
12927
|
import castArray4 from "lodash/castArray";
|
12810
12928
|
import isUndefined8 from "lodash/isUndefined";
|
12811
12929
|
import noop from "lodash/noop";
|
12812
12930
|
|
12813
|
-
// src/molecules/
|
12931
|
+
// src/molecules/Switch/Switch.tsx
|
12932
|
+
import React96 from "react";
|
12933
|
+
|
12934
|
+
// src/atoms/Switch/Switch.tsx
|
12814
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 ";
|
13033
|
+
|
13034
|
+
// src/molecules/TagLabel/TagLabel.tsx
|
13035
|
+
import React97 from "react";
|
12815
13036
|
var getVariantClassNames = (variant = "primary") => {
|
12816
13037
|
switch (variant) {
|
12817
13038
|
case "danger":
|
@@ -12825,7 +13046,7 @@ var getVariantClassNames = (variant = "primary") => {
|
|
12825
13046
|
};
|
12826
13047
|
var TagLabel = (_a) => {
|
12827
13048
|
var _b = _a, { title, dense = false, variant } = _b, rest = __objRest(_b, ["title", "dense", "variant"]);
|
12828
|
-
return /* @__PURE__ */
|
13049
|
+
return /* @__PURE__ */ React97.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
12829
13050
|
className: classNames(
|
12830
13051
|
"Aquarium-TagLabel",
|
12831
13052
|
getVariantClassNames(variant),
|
@@ -12838,41 +13059,42 @@ var TagLabel = (_a) => {
|
|
12838
13059
|
};
|
12839
13060
|
|
12840
13061
|
// src/atoms/Section/Section.tsx
|
12841
|
-
import
|
13062
|
+
import React98 from "react";
|
12842
13063
|
var import_caretUp2 = __toESM(require_caretUp());
|
12843
13064
|
var Section3 = (_a) => {
|
12844
13065
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
12845
|
-
return /* @__PURE__ */
|
13066
|
+
return /* @__PURE__ */ React98.createElement(Box, __spreadValues({
|
13067
|
+
component: "section",
|
12846
13068
|
borderColor: "grey-5",
|
12847
13069
|
borderWidth: "1px"
|
12848
13070
|
}, rest), children);
|
12849
13071
|
};
|
12850
13072
|
Section3.Header = (_a) => {
|
12851
13073
|
var _b = _a, { children, className, collapsible } = _b, rest = __objRest(_b, ["children", "className", "collapsible"]);
|
12852
|
-
return /* @__PURE__ */
|
13074
|
+
return /* @__PURE__ */ React98.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12853
13075
|
className: classNames(
|
12854
|
-
tw("px-6
|
13076
|
+
tw("px-6 flex gap-5 justify-between items-center h-[72px]", { "bg-grey-0": collapsible }),
|
12855
13077
|
className
|
12856
13078
|
)
|
12857
13079
|
}), children);
|
12858
13080
|
};
|
12859
13081
|
Section3.TitleContainer = (_a) => {
|
12860
13082
|
var _b = _a, { children, className, collapsible } = _b, rest = __objRest(_b, ["children", "className", "collapsible"]);
|
12861
|
-
return /* @__PURE__ */
|
13083
|
+
return /* @__PURE__ */ React98.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12862
13084
|
className: classNames(
|
12863
13085
|
tw("grow grid grid-cols-[auto_1fr] gap-y-2 gap-x-3 items-center", { "cursor-pointer": collapsible }),
|
12864
13086
|
className
|
12865
13087
|
)
|
12866
13088
|
}), children);
|
12867
13089
|
};
|
12868
|
-
Section3.Toggle = (props) => /* @__PURE__ */
|
13090
|
+
Section3.Toggle = (props) => /* @__PURE__ */ React98.createElement(Icon, __spreadProps(__spreadValues({}, props), {
|
12869
13091
|
icon: import_caretUp2.default,
|
12870
13092
|
height: 22,
|
12871
13093
|
width: 22
|
12872
13094
|
}));
|
12873
13095
|
Section3.Title = (_a) => {
|
12874
13096
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
12875
|
-
return /* @__PURE__ */
|
13097
|
+
return /* @__PURE__ */ React98.createElement(Typography2.Large, __spreadProps(__spreadValues({}, rest), {
|
12876
13098
|
htmlTag: "h2",
|
12877
13099
|
color: "black",
|
12878
13100
|
className: "flex gap-3 items-center"
|
@@ -12880,35 +13102,35 @@ Section3.Title = (_a) => {
|
|
12880
13102
|
};
|
12881
13103
|
Section3.Subtitle = (_a) => {
|
12882
13104
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
12883
|
-
return /* @__PURE__ */
|
13105
|
+
return /* @__PURE__ */ React98.createElement(Typography2.Small, __spreadProps(__spreadValues({}, rest), {
|
12884
13106
|
color: "grey-70"
|
12885
13107
|
}), children);
|
12886
13108
|
};
|
12887
13109
|
Section3.Actions = (_a) => {
|
12888
13110
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12889
|
-
return /* @__PURE__ */
|
13111
|
+
return /* @__PURE__ */ React98.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12890
13112
|
className: classNames(tw("flex gap-4 justify-end"), className)
|
12891
13113
|
}), children);
|
12892
13114
|
};
|
12893
13115
|
Section3.Body = (_a) => {
|
12894
13116
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12895
|
-
return /* @__PURE__ */
|
13117
|
+
return /* @__PURE__ */ React98.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12896
13118
|
className: classNames(tw("p-6"), className)
|
12897
|
-
}), /* @__PURE__ */
|
13119
|
+
}), /* @__PURE__ */ React98.createElement(Typography, {
|
12898
13120
|
htmlTag: "div",
|
12899
13121
|
color: "grey-70"
|
12900
13122
|
}, children));
|
12901
13123
|
};
|
12902
13124
|
|
12903
13125
|
// src/utils/useMeasure.ts
|
12904
|
-
import
|
13126
|
+
import React99 from "react";
|
12905
13127
|
function useMeasure() {
|
12906
|
-
const ref =
|
12907
|
-
const [rect, setRect] =
|
13128
|
+
const ref = React99.useRef(null);
|
13129
|
+
const [rect, setRect] = React99.useState({
|
12908
13130
|
width: null,
|
12909
13131
|
height: null
|
12910
13132
|
});
|
12911
|
-
|
13133
|
+
React99.useLayoutEffect(() => {
|
12912
13134
|
if (!ref.current || !window.ResizeObserver) {
|
12913
13135
|
return;
|
12914
13136
|
}
|
@@ -12936,7 +13158,7 @@ var Section4 = (props) => {
|
|
12936
13158
|
const _collapsible = title ? (_a = props.collapsible) != null ? _a : false : false;
|
12937
13159
|
const _collapsed = title ? props.collapsed : void 0;
|
12938
13160
|
const _defaultCollapsed = title ? (_b = props.defaultCollapsed) != null ? _b : false : false;
|
12939
|
-
const [isCollapsed, setCollapsed] =
|
13161
|
+
const [isCollapsed, setCollapsed] = React100.useState(_collapsed != null ? _collapsed : _defaultCollapsed);
|
12940
13162
|
const [ref, { height }] = useMeasure();
|
12941
13163
|
const menu = title ? (_c = props.menu) != null ? _c : void 0 : void 0;
|
12942
13164
|
const menuAriaLabel = title ? (_e = (_d = props.menuAriaLabel) != null ? _d : props.menuLabel) != null ? _e : "Context menu" : void 0;
|
@@ -12962,47 +13184,51 @@ var Section4 = (props) => {
|
|
12962
13184
|
}), { transform, backgroundColor } = _g, spring = __objRest(_g, ["transform", "backgroundColor"]);
|
12963
13185
|
const toggleId = useId3();
|
12964
13186
|
const regionId = useId3();
|
12965
|
-
return /* @__PURE__ */
|
13187
|
+
return /* @__PURE__ */ React100.createElement(Section3, {
|
13188
|
+
"aria-label": title,
|
12966
13189
|
className: "Aquarium-Section"
|
12967
|
-
}, title && /* @__PURE__ */
|
13190
|
+
}, title && /* @__PURE__ */ React100.createElement(React100.Fragment, null, /* @__PURE__ */ React100.createElement(Section3.Header, {
|
12968
13191
|
collapsible: _collapsible
|
12969
|
-
}, /* @__PURE__ */
|
13192
|
+
}, /* @__PURE__ */ React100.createElement(Section3.TitleContainer, {
|
12970
13193
|
role: _collapsible ? "button" : void 0,
|
12971
13194
|
id: toggleId,
|
12972
13195
|
collapsible: _collapsible,
|
12973
13196
|
onClick: handleTitleClick,
|
12974
13197
|
"aria-expanded": !isCollapsed,
|
12975
13198
|
"aria-controls": regionId
|
12976
|
-
}, _collapsible && /* @__PURE__ */
|
13199
|
+
}, _collapsible && /* @__PURE__ */ React100.createElement(animated3.div, {
|
12977
13200
|
style: { transform }
|
12978
|
-
}, /* @__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, {
|
12979
13204
|
text: props.badge
|
12980
|
-
}), props.chip && /* @__PURE__ */
|
13205
|
+
}), props.chip && /* @__PURE__ */ React100.createElement(StatusChip, __spreadValues({}, props.chip))), subtitle && /* @__PURE__ */ React100.createElement(Section3.Subtitle, {
|
12981
13206
|
className: tw("row-start-2", { "col-start-2": _collapsible })
|
12982
|
-
},
|
13207
|
+
}, /* @__PURE__ */ React100.createElement(LineClamp2, {
|
13208
|
+
lines: 1
|
13209
|
+
}, subtitle))), !isCollapsed && /* @__PURE__ */ React100.createElement(Section3.Actions, null, menu && /* @__PURE__ */ React100.createElement(Box.Flex, {
|
12983
13210
|
alignItems: "center"
|
12984
|
-
}, /* @__PURE__ */
|
13211
|
+
}, /* @__PURE__ */ React100.createElement(DropdownMenu2, {
|
12985
13212
|
onAction: (action) => onAction == null ? void 0 : onAction(action),
|
12986
13213
|
onOpenChange: onMenuOpenChange
|
12987
|
-
}, /* @__PURE__ */
|
13214
|
+
}, /* @__PURE__ */ React100.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ React100.createElement(Button.Icon, {
|
12988
13215
|
"aria-label": menuAriaLabel,
|
12989
13216
|
icon: import_more5.default
|
12990
|
-
})), menu)), actions && castArray4(actions).filter(Boolean).map((action) => renderAction("secondary", action)))), /* @__PURE__ */
|
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, {
|
12991
13218
|
className: tw(`h-[1px]`),
|
12992
13219
|
style: { backgroundColor }
|
12993
|
-
})), /* @__PURE__ */
|
13220
|
+
})), /* @__PURE__ */ React100.createElement(animated3.div, {
|
12994
13221
|
id: regionId,
|
12995
|
-
role: "region",
|
12996
13222
|
"aria-hidden": isCollapsed ? true : void 0,
|
12997
13223
|
style: spring,
|
12998
13224
|
className: tw({ "overflow-hidden": _collapsible })
|
12999
|
-
}, /* @__PURE__ */
|
13225
|
+
}, /* @__PURE__ */ React100.createElement("div", {
|
13000
13226
|
ref
|
13001
|
-
}, /* @__PURE__ */
|
13227
|
+
}, /* @__PURE__ */ React100.createElement(Section3.Body, null, children))));
|
13002
13228
|
};
|
13003
13229
|
|
13004
13230
|
// src/molecules/SegmentedControl/SegmentedControl.tsx
|
13005
|
-
import
|
13231
|
+
import React101 from "react";
|
13006
13232
|
var SegmentedControl = (_a) => {
|
13007
13233
|
var _b = _a, {
|
13008
13234
|
children,
|
@@ -13019,7 +13245,7 @@ var SegmentedControl = (_a) => {
|
|
13019
13245
|
"selected",
|
13020
13246
|
"className"
|
13021
13247
|
]);
|
13022
|
-
return /* @__PURE__ */
|
13248
|
+
return /* @__PURE__ */ React101.createElement("li", null, /* @__PURE__ */ React101.createElement("button", __spreadProps(__spreadValues({
|
13023
13249
|
type: "button"
|
13024
13250
|
}, rest), {
|
13025
13251
|
className: classNames(
|
@@ -13053,12 +13279,12 @@ var SegmentedControlGroup = (_a) => {
|
|
13053
13279
|
"border border-grey-20 text-grey-50": variant === "outlined",
|
13054
13280
|
"bg-grey-0": variant === "raised"
|
13055
13281
|
});
|
13056
|
-
return /* @__PURE__ */
|
13282
|
+
return /* @__PURE__ */ React101.createElement("ul", __spreadProps(__spreadValues({}, rest), {
|
13057
13283
|
"aria-label": ariaLabel,
|
13058
13284
|
className: classNames("Aquarium-SegmentedControl", classes2, className)
|
13059
|
-
}),
|
13285
|
+
}), React101.Children.map(
|
13060
13286
|
children,
|
13061
|
-
(child) =>
|
13287
|
+
(child) => React101.cloneElement(child, {
|
13062
13288
|
dense,
|
13063
13289
|
variant,
|
13064
13290
|
onClick: () => onChange(child.props.value),
|
@@ -13096,14 +13322,14 @@ var getCommonClassNames = (dense, selected) => tw(
|
|
13096
13322
|
);
|
13097
13323
|
|
13098
13324
|
// src/molecules/Stepper/Stepper.tsx
|
13099
|
-
import
|
13325
|
+
import React103 from "react";
|
13100
13326
|
|
13101
13327
|
// src/atoms/Stepper/Stepper.tsx
|
13102
|
-
import
|
13328
|
+
import React102 from "react";
|
13103
13329
|
var import_tick6 = __toESM(require_tick());
|
13104
13330
|
var Stepper = (_a) => {
|
13105
13331
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13106
|
-
return /* @__PURE__ */
|
13332
|
+
return /* @__PURE__ */ React102.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13107
13333
|
className: classNames(className)
|
13108
13334
|
}));
|
13109
13335
|
};
|
@@ -13117,7 +13343,7 @@ var ConnectorContainer = (_a) => {
|
|
13117
13343
|
"completed",
|
13118
13344
|
"dense"
|
13119
13345
|
]);
|
13120
|
-
return /* @__PURE__ */
|
13346
|
+
return /* @__PURE__ */ React102.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13121
13347
|
className: classNames(
|
13122
13348
|
tw("absolute w-full -left-1/2", {
|
13123
13349
|
"top-[3px] px-[14px]": Boolean(dense),
|
@@ -13129,7 +13355,7 @@ var ConnectorContainer = (_a) => {
|
|
13129
13355
|
};
|
13130
13356
|
var Connector = (_a) => {
|
13131
13357
|
var _b = _a, { children, className, completed, dense } = _b, rest = __objRest(_b, ["children", "className", "completed", "dense"]);
|
13132
|
-
return /* @__PURE__ */
|
13358
|
+
return /* @__PURE__ */ React102.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13133
13359
|
className: classNames(
|
13134
13360
|
tw("w-full", {
|
13135
13361
|
"bg-grey-20": !completed,
|
@@ -13143,7 +13369,7 @@ var Connector = (_a) => {
|
|
13143
13369
|
};
|
13144
13370
|
var Step = (_a) => {
|
13145
13371
|
var _b = _a, { className, state } = _b, rest = __objRest(_b, ["className", "state"]);
|
13146
|
-
return /* @__PURE__ */
|
13372
|
+
return /* @__PURE__ */ React102.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13147
13373
|
className: classNames(
|
13148
13374
|
tw("flex flex-col items-center text-grey-90 relative text-center", {
|
13149
13375
|
"text-grey-20": state === "inactive"
|
@@ -13164,13 +13390,13 @@ var getDenseClassNames = (state) => tw("h-[8px] w-[8px]", {
|
|
13164
13390
|
});
|
13165
13391
|
var Indicator = (_a) => {
|
13166
13392
|
var _b = _a, { children, className, state, dense } = _b, rest = __objRest(_b, ["children", "className", "state", "dense"]);
|
13167
|
-
return /* @__PURE__ */
|
13393
|
+
return /* @__PURE__ */ React102.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13168
13394
|
className: classNames(
|
13169
13395
|
tw("rounded-full flex justify-center items-center mx-2 mb-3"),
|
13170
13396
|
dense ? getDenseClassNames(state) : getClassNames(state),
|
13171
13397
|
className
|
13172
13398
|
)
|
13173
|
-
}), state === "completed" ? /* @__PURE__ */
|
13399
|
+
}), state === "completed" ? /* @__PURE__ */ React102.createElement(InlineIcon, {
|
13174
13400
|
icon: import_tick6.default
|
13175
13401
|
}) : dense ? null : children);
|
13176
13402
|
};
|
@@ -13181,26 +13407,26 @@ Stepper.ConnectorContainer = ConnectorContainer;
|
|
13181
13407
|
|
13182
13408
|
// src/molecules/Stepper/Stepper.tsx
|
13183
13409
|
var Stepper2 = ({ children, activeIndex, dense }) => {
|
13184
|
-
const steps =
|
13185
|
-
return /* @__PURE__ */
|
13410
|
+
const steps = React103.Children.count(children);
|
13411
|
+
return /* @__PURE__ */ React103.createElement(Stepper, {
|
13186
13412
|
role: "list",
|
13187
13413
|
className: "Aquarium-Stepper"
|
13188
|
-
}, /* @__PURE__ */
|
13414
|
+
}, /* @__PURE__ */ React103.createElement(Template, {
|
13189
13415
|
columns: steps
|
13190
|
-
},
|
13416
|
+
}, React103.Children.map(children, (child, index) => {
|
13191
13417
|
if (!isComponentType(child, Step2)) {
|
13192
13418
|
return new Error("<Stepper> can only have <Stepper.Step> components as children");
|
13193
13419
|
} else {
|
13194
13420
|
const state = index > activeIndex ? "inactive" : index === activeIndex ? "active" : "completed";
|
13195
|
-
return /* @__PURE__ */
|
13421
|
+
return /* @__PURE__ */ React103.createElement(Stepper.Step, {
|
13196
13422
|
state,
|
13197
13423
|
"aria-current": state === "active" ? "step" : false,
|
13198
13424
|
role: "listitem"
|
13199
|
-
}, index > 0 && index <= steps && /* @__PURE__ */
|
13425
|
+
}, index > 0 && index <= steps && /* @__PURE__ */ React103.createElement(Stepper.ConnectorContainer, {
|
13200
13426
|
dense
|
13201
|
-
}, /* @__PURE__ */
|
13427
|
+
}, /* @__PURE__ */ React103.createElement(Stepper.ConnectorContainer.Connector, {
|
13202
13428
|
completed: state === "completed" || state === "active"
|
13203
|
-
})), /* @__PURE__ */
|
13429
|
+
})), /* @__PURE__ */ React103.createElement(Stepper.Step.Indicator, {
|
13204
13430
|
state,
|
13205
13431
|
dense
|
13206
13432
|
}, index + 1), child.props.children);
|
@@ -13212,104 +13438,6 @@ var Step2 = () => null;
|
|
13212
13438
|
Step2.displayName = "Stepper.Step";
|
13213
13439
|
Stepper2.Step = Step2;
|
13214
13440
|
|
13215
|
-
// src/molecules/Switch/Switch.tsx
|
13216
|
-
import React103 from "react";
|
13217
|
-
|
13218
|
-
// src/atoms/Switch/Switch.tsx
|
13219
|
-
import React102 from "react";
|
13220
|
-
var Switch = React102.forwardRef(
|
13221
|
-
(_a, ref) => {
|
13222
|
-
var _b = _a, { id, children, name, disabled = false, readOnly = false } = _b, props = __objRest(_b, ["id", "children", "name", "disabled", "readOnly"]);
|
13223
|
-
return /* @__PURE__ */ React102.createElement("span", {
|
13224
|
-
className: tw("relative inline-flex justify-center items-center self-center group")
|
13225
|
-
}, /* @__PURE__ */ React102.createElement("input", __spreadProps(__spreadValues({
|
13226
|
-
id,
|
13227
|
-
ref,
|
13228
|
-
type: "checkbox",
|
13229
|
-
name
|
13230
|
-
}, props), {
|
13231
|
-
className: classNames(
|
13232
|
-
tw(
|
13233
|
-
"appearance-none peer/switch rounded-full inline-block w-[34px] h-[20px] transition duration-300",
|
13234
|
-
"outline-none focus:border border-info-70 bg-grey-20",
|
13235
|
-
"cursor-pointer disabled:cursor-not-allowed",
|
13236
|
-
{
|
13237
|
-
"hover:bg-grey-30 checked:bg-primary-80 hover:checked:bg-primary-80": !disabled,
|
13238
|
-
"bg-grey-5 checked:opacity-40 checked:bg-primary-40": disabled
|
13239
|
-
}
|
13240
|
-
)
|
13241
|
-
),
|
13242
|
-
readOnly,
|
13243
|
-
disabled
|
13244
|
-
})), /* @__PURE__ */ React102.createElement("span", {
|
13245
|
-
className: tw(
|
13246
|
-
"pointer-events-none rounded-full absolute inline-block transition duration-300 h-4 w-4 transform peer-checked/switch:translate-x-5",
|
13247
|
-
"bg-white peer-disabled/switch:bg-grey-0 left-2 peer-checked/switch:left-1",
|
13248
|
-
{
|
13249
|
-
"shadow-4dp": !disabled
|
13250
|
-
}
|
13251
|
-
)
|
13252
|
-
}));
|
13253
|
-
}
|
13254
|
-
);
|
13255
|
-
|
13256
|
-
// src/molecules/Switch/Switch.tsx
|
13257
|
-
var Switch2 = React103.forwardRef(
|
13258
|
-
(_a, ref) => {
|
13259
|
-
var _b = _a, {
|
13260
|
-
id,
|
13261
|
-
name,
|
13262
|
-
caption,
|
13263
|
-
readOnly = false,
|
13264
|
-
disabled = false,
|
13265
|
-
children,
|
13266
|
-
"aria-label": ariaLabel,
|
13267
|
-
labelPlacement
|
13268
|
-
} = _b, props = __objRest(_b, [
|
13269
|
-
"id",
|
13270
|
-
"name",
|
13271
|
-
"caption",
|
13272
|
-
"readOnly",
|
13273
|
-
"disabled",
|
13274
|
-
"children",
|
13275
|
-
"aria-label",
|
13276
|
-
"labelPlacement"
|
13277
|
-
]);
|
13278
|
-
var _a2;
|
13279
|
-
const isChecked = (_a2 = props.checked) != null ? _a2 : props.defaultChecked;
|
13280
|
-
return !readOnly || isChecked ? /* @__PURE__ */ React103.createElement(ControlLabel, {
|
13281
|
-
htmlFor: id,
|
13282
|
-
label: children,
|
13283
|
-
"aria-label": ariaLabel,
|
13284
|
-
caption,
|
13285
|
-
readOnly,
|
13286
|
-
disabled,
|
13287
|
-
style: { gap: "0 8px" },
|
13288
|
-
labelPlacement,
|
13289
|
-
className: "Aquarium-Switch"
|
13290
|
-
}, !readOnly && /* @__PURE__ */ React103.createElement(Switch, __spreadProps(__spreadValues({
|
13291
|
-
id,
|
13292
|
-
ref,
|
13293
|
-
name
|
13294
|
-
}, props), {
|
13295
|
-
readOnly,
|
13296
|
-
disabled
|
13297
|
-
}))) : null;
|
13298
|
-
}
|
13299
|
-
);
|
13300
|
-
Switch2.displayName = "Switch";
|
13301
|
-
var SwitchSkeleton = () => /* @__PURE__ */ React103.createElement("div", {
|
13302
|
-
className: tw("flex gap-3")
|
13303
|
-
}, /* @__PURE__ */ React103.createElement(Skeleton, {
|
13304
|
-
height: 20,
|
13305
|
-
width: 35
|
13306
|
-
}), /* @__PURE__ */ React103.createElement(Skeleton, {
|
13307
|
-
height: 20,
|
13308
|
-
width: 150
|
13309
|
-
}));
|
13310
|
-
Switch2.Skeleton = SwitchSkeleton;
|
13311
|
-
Switch2.Skeleton.displayName = "Switch.Skeleton ";
|
13312
|
-
|
13313
13441
|
// src/molecules/SwitchGroup/SwitchGroup.tsx
|
13314
13442
|
import React104, { useState as useState12 } from "react";
|
13315
13443
|
import uniqueId9 from "lodash/uniqueId";
|
@@ -13723,7 +13851,7 @@ export {
|
|
13723
13851
|
FormControl,
|
13724
13852
|
GhostButton,
|
13725
13853
|
Grid,
|
13726
|
-
GridItem,
|
13854
|
+
GridItem2 as GridItem,
|
13727
13855
|
HelperText,
|
13728
13856
|
Icon,
|
13729
13857
|
IconButton,
|