@aivenio/aquarium 1.35.0 → 1.36.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/dist/_variables.scss +1 -1
- package/dist/_variables_timescale.scss +1 -1
- package/dist/atoms.cjs +1 -1
- package/dist/atoms.mjs +1 -1
- package/dist/src/atoms/Chip/Chip.js +2 -2
- package/dist/src/atoms/Section/Section.d.ts +9 -3
- package/dist/src/atoms/Section/Section.js +10 -7
- package/dist/src/molecules/Modal/Modal.d.ts +1 -1
- package/dist/src/molecules/Section/Section.d.ts +41 -5
- package/dist/src/molecules/Section/Section.js +72 -14
- package/dist/src/molecules/TagLabel/TagLabel.d.ts +6 -0
- package/dist/src/molecules/TagLabel/TagLabel.js +14 -3
- package/dist/src/utils/useMeasure.d.ts +7 -0
- package/dist/src/utils/useMeasure.js +27 -0
- package/dist/styles.css +20 -6
- package/dist/styles_timescaledb.css +20 -6
- package/dist/system.cjs +231 -118
- package/dist/system.mjs +228 -115
- package/dist/tsconfig.module.tsbuildinfo +1 -1
- package/dist/types/tailwindGenerated.d.ts +1 -1
- package/package.json +2 -2
package/dist/system.mjs
CHANGED
@@ -7747,7 +7747,7 @@ var Container = React25.forwardRef(
|
|
7747
7747
|
ref,
|
7748
7748
|
className: classNames(
|
7749
7749
|
tw("inline-flex items-center rounded-sm transition whitespace-nowrap", {
|
7750
|
-
"typography-small py-2 px-3 gap-x-3": !dense,
|
7750
|
+
"typography-small py-2 px-3 gap-x-3 leading-tight": !dense,
|
7751
7751
|
"typography-caption py-1 px-2 gap-x-2": dense
|
7752
7752
|
}),
|
7753
7753
|
className
|
@@ -12778,73 +12778,201 @@ RadioButtonGroup.Skeleton = RadioButtonGroupSkeleton;
|
|
12778
12778
|
RadioButtonGroup.Skeleton.displayName = "RadioButtonGroup.Skeleton";
|
12779
12779
|
|
12780
12780
|
// src/molecules/Section/Section.tsx
|
12781
|
-
import
|
12781
|
+
import React97 from "react";
|
12782
|
+
import { useId as useId3 } from "@react-aria/utils";
|
12783
|
+
import { animated as animated3, useSpring as useSpring2 } from "@react-spring/web";
|
12782
12784
|
import castArray4 from "lodash/castArray";
|
12785
|
+
import isUndefined8 from "lodash/isUndefined";
|
12786
|
+
import noop from "lodash/noop";
|
12783
12787
|
import omit17 from "lodash/omit";
|
12784
12788
|
|
12785
|
-
// src/
|
12789
|
+
// src/molecules/TagLabel/TagLabel.tsx
|
12786
12790
|
import React94 from "react";
|
12791
|
+
var getVariantClassNames = (variant = "primary") => {
|
12792
|
+
switch (variant) {
|
12793
|
+
case "danger":
|
12794
|
+
return tw("bg-secondary-90");
|
12795
|
+
case "success":
|
12796
|
+
return tw("bg-success-90");
|
12797
|
+
case "primary":
|
12798
|
+
default:
|
12799
|
+
return tw("bg-primary-90");
|
12800
|
+
}
|
12801
|
+
};
|
12802
|
+
var TagLabel = (_a) => {
|
12803
|
+
var _b = _a, { title, dense = false, variant } = _b, rest = __objRest(_b, ["title", "dense", "variant"]);
|
12804
|
+
return /* @__PURE__ */ React94.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
12805
|
+
className: classNames(
|
12806
|
+
"Aquarium-TagLabel",
|
12807
|
+
getVariantClassNames(variant),
|
12808
|
+
tw("rounded-full text-white", {
|
12809
|
+
"py-2 px-4 typography-caption": !dense,
|
12810
|
+
"py-2 px-3 typography-caption-small": dense
|
12811
|
+
})
|
12812
|
+
)
|
12813
|
+
}), title);
|
12814
|
+
};
|
12815
|
+
|
12816
|
+
// src/atoms/Section/Section.tsx
|
12817
|
+
import React95 from "react";
|
12818
|
+
var import_caretUp2 = __toESM(require_caretUp());
|
12787
12819
|
var Section3 = (_a) => {
|
12788
12820
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
12789
|
-
return /* @__PURE__ */
|
12821
|
+
return /* @__PURE__ */ React95.createElement(Box, __spreadValues({
|
12790
12822
|
borderColor: "grey-5",
|
12791
12823
|
borderWidth: "1px"
|
12792
12824
|
}, rest), children);
|
12793
12825
|
};
|
12794
12826
|
Section3.Header = (_a) => {
|
12795
|
-
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12796
|
-
return /* @__PURE__ */
|
12797
|
-
className: classNames(
|
12827
|
+
var _b = _a, { children, className, collapsible } = _b, rest = __objRest(_b, ["children", "className", "collapsible"]);
|
12828
|
+
return /* @__PURE__ */ React95.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12829
|
+
className: classNames(
|
12830
|
+
tw("px-6 py-5 flex gap-5 justify-between items-center", { "bg-grey-0": collapsible }),
|
12831
|
+
className
|
12832
|
+
)
|
12798
12833
|
}), children);
|
12799
12834
|
};
|
12800
12835
|
Section3.TitleContainer = (_a) => {
|
12801
|
-
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12802
|
-
return /* @__PURE__ */
|
12803
|
-
className: classNames(
|
12836
|
+
var _b = _a, { children, className, collapsible } = _b, rest = __objRest(_b, ["children", "className", "collapsible"]);
|
12837
|
+
return /* @__PURE__ */ React95.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12838
|
+
className: classNames(
|
12839
|
+
tw("grow grid grid-cols-[auto_1fr] gap-y-2 gap-x-3 items-center", { "cursor-pointer": collapsible }),
|
12840
|
+
className
|
12841
|
+
)
|
12804
12842
|
}), children);
|
12805
12843
|
};
|
12844
|
+
Section3.Toggle = (props) => /* @__PURE__ */ React95.createElement(Icon, __spreadProps(__spreadValues({}, props), {
|
12845
|
+
icon: import_caretUp2.default,
|
12846
|
+
height: 22,
|
12847
|
+
width: 22
|
12848
|
+
}));
|
12806
12849
|
Section3.Title = (_a) => {
|
12807
12850
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
12808
|
-
return /* @__PURE__ */
|
12809
|
-
|
12851
|
+
return /* @__PURE__ */ React95.createElement(Typography2.Large, __spreadProps(__spreadValues({}, rest), {
|
12852
|
+
htmlTag: "h2",
|
12853
|
+
color: "black",
|
12854
|
+
className: "flex gap-3 items-center"
|
12810
12855
|
}), children);
|
12811
12856
|
};
|
12812
12857
|
Section3.Subtitle = (_a) => {
|
12813
12858
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
12814
|
-
return /* @__PURE__ */
|
12859
|
+
return /* @__PURE__ */ React95.createElement(Typography2.Small, __spreadProps(__spreadValues({}, rest), {
|
12815
12860
|
color: "grey-70"
|
12816
12861
|
}), children);
|
12817
12862
|
};
|
12818
12863
|
Section3.Actions = (_a) => {
|
12819
12864
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12820
|
-
return /* @__PURE__ */
|
12865
|
+
return /* @__PURE__ */ React95.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12821
12866
|
className: classNames(tw("flex gap-4 justify-end"), className)
|
12822
12867
|
}), children);
|
12823
12868
|
};
|
12824
12869
|
Section3.Body = (_a) => {
|
12825
12870
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12826
|
-
return /* @__PURE__ */
|
12871
|
+
return /* @__PURE__ */ React95.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12827
12872
|
className: classNames(tw("p-6"), className)
|
12828
|
-
}), /* @__PURE__ */
|
12873
|
+
}), /* @__PURE__ */ React95.createElement(Typography, {
|
12829
12874
|
htmlTag: "div",
|
12830
12875
|
color: "grey-70"
|
12831
12876
|
}, children));
|
12832
12877
|
};
|
12833
12878
|
|
12879
|
+
// src/utils/useMeasure.ts
|
12880
|
+
import React96 from "react";
|
12881
|
+
function useMeasure() {
|
12882
|
+
const ref = React96.useRef(null);
|
12883
|
+
const [rect, setRect] = React96.useState({
|
12884
|
+
width: null,
|
12885
|
+
height: null
|
12886
|
+
});
|
12887
|
+
React96.useLayoutEffect(() => {
|
12888
|
+
if (!ref.current || !window.ResizeObserver) {
|
12889
|
+
return;
|
12890
|
+
}
|
12891
|
+
const observer = new window.ResizeObserver(([entry]) => {
|
12892
|
+
if (entry == null ? void 0 : entry.contentRect) {
|
12893
|
+
setRect({
|
12894
|
+
width: entry.contentRect.width,
|
12895
|
+
height: entry.contentRect.height
|
12896
|
+
});
|
12897
|
+
}
|
12898
|
+
});
|
12899
|
+
observer.observe(ref.current);
|
12900
|
+
return () => {
|
12901
|
+
observer.disconnect();
|
12902
|
+
};
|
12903
|
+
}, []);
|
12904
|
+
return [ref, rect];
|
12905
|
+
}
|
12906
|
+
|
12834
12907
|
// src/molecules/Section/Section.tsx
|
12835
|
-
var Section4 = (
|
12836
|
-
|
12837
|
-
|
12838
|
-
(
|
12839
|
-
|
12840
|
-
|
12841
|
-
|
12842
|
-
|
12843
|
-
|
12844
|
-
|
12908
|
+
var Section4 = (props) => {
|
12909
|
+
var _a, _b, _c;
|
12910
|
+
const { title, subtitle, actions, children } = props;
|
12911
|
+
const _collapsible = title ? (_a = props.collapsible) != null ? _a : false : false;
|
12912
|
+
const _collapsed = title ? props.collapsed : void 0;
|
12913
|
+
const _defaultCollapsed = title ? (_b = props.defaultCollapsed) != null ? _b : false : false;
|
12914
|
+
const [isCollapsed, setCollapsed] = React97.useState(_collapsed != null ? _collapsed : _defaultCollapsed);
|
12915
|
+
const [ref, { height }] = useMeasure();
|
12916
|
+
const _onCollapsedChanged = title && props.collapsible ? (_c = props.onCollapsedChange) != null ? _c : setCollapsed : noop;
|
12917
|
+
if (title && !isUndefined8(props.collapsed) && props.collapsed !== isCollapsed) {
|
12918
|
+
setCollapsed(props.collapsed);
|
12919
|
+
}
|
12920
|
+
const handleTitleClick = () => {
|
12921
|
+
_onCollapsedChanged(!isCollapsed);
|
12922
|
+
};
|
12923
|
+
const targetHeight = isCollapsed ? "0px" : `${height != null ? height : 0}px`;
|
12924
|
+
const _d = useSpring2({
|
12925
|
+
height: height !== null ? targetHeight : void 0,
|
12926
|
+
opacity: isCollapsed ? 0 : 1,
|
12927
|
+
transform: `rotate(${isCollapsed ? 0 : 180}deg)`,
|
12928
|
+
backgroundColor: isCollapsed ? tailwind_theme_default.backgroundColor["grey-0"] : tailwind_theme_default.backgroundColor["grey-5"],
|
12929
|
+
config: {
|
12930
|
+
duration: 150
|
12931
|
+
},
|
12932
|
+
immediate: !_collapsible
|
12933
|
+
}), { transform, backgroundColor } = _d, spring = __objRest(_d, ["transform", "backgroundColor"]);
|
12934
|
+
const toggleId = useId3();
|
12935
|
+
const regionId = useId3();
|
12936
|
+
return /* @__PURE__ */ React97.createElement(Section3, {
|
12937
|
+
className: "Aquarium-Section"
|
12938
|
+
}, title && /* @__PURE__ */ React97.createElement(React97.Fragment, null, /* @__PURE__ */ React97.createElement(Section3.Header, {
|
12939
|
+
collapsible: _collapsible
|
12940
|
+
}, /* @__PURE__ */ React97.createElement(Section3.TitleContainer, {
|
12941
|
+
role: _collapsible ? "button" : void 0,
|
12942
|
+
id: toggleId,
|
12943
|
+
collapsible: _collapsible,
|
12944
|
+
onClick: handleTitleClick,
|
12945
|
+
"aria-expanded": !isCollapsed,
|
12946
|
+
"aria-controls": regionId
|
12947
|
+
}, _collapsible && /* @__PURE__ */ React97.createElement(animated3.div, {
|
12948
|
+
style: { transform }
|
12949
|
+
}, /* @__PURE__ */ React97.createElement(Section3.Toggle, null)), /* @__PURE__ */ React97.createElement(Section3.Title, null, title, props.tag && /* @__PURE__ */ React97.createElement(TagLabel, __spreadValues({}, props.tag)), props.badge && /* @__PURE__ */ React97.createElement(Chip2, {
|
12950
|
+
text: props.badge
|
12951
|
+
}), props.chip && /* @__PURE__ */ React97.createElement(StatusChip, __spreadValues({}, props.chip))), subtitle && /* @__PURE__ */ React97.createElement(Section3.Subtitle, {
|
12952
|
+
className: tw("row-start-2", { "col-start-2": _collapsible })
|
12953
|
+
}, subtitle)), /* @__PURE__ */ React97.createElement(Section3.Actions, null, actions && castArray4(actions).filter(Boolean).map(
|
12954
|
+
(action) => !isLink(action) ? /* @__PURE__ */ React97.createElement(Button.Secondary, __spreadValues({
|
12955
|
+
key: action.text
|
12956
|
+
}, omit17(action, "text")), action.text) : /* @__PURE__ */ React97.createElement(Button.ExternalLink, __spreadValues({
|
12957
|
+
key: action.text,
|
12958
|
+
kind: "secondary"
|
12959
|
+
}, omit17(action, "text")), action.text)
|
12960
|
+
))), /* @__PURE__ */ React97.createElement(animated3.div, {
|
12961
|
+
className: tw(`h-[1px]`),
|
12962
|
+
style: { backgroundColor }
|
12963
|
+
})), /* @__PURE__ */ React97.createElement(animated3.div, {
|
12964
|
+
id: regionId,
|
12965
|
+
role: "region",
|
12966
|
+
"aria-hidden": isCollapsed ? true : void 0,
|
12967
|
+
style: spring,
|
12968
|
+
className: tw({ "overflow-hidden": _collapsible })
|
12969
|
+
}, /* @__PURE__ */ React97.createElement("div", {
|
12970
|
+
ref
|
12971
|
+
}, /* @__PURE__ */ React97.createElement(Section3.Body, null, children))));
|
12972
|
+
};
|
12845
12973
|
|
12846
12974
|
// src/molecules/SegmentedControl/SegmentedControl.tsx
|
12847
|
-
import
|
12975
|
+
import React98 from "react";
|
12848
12976
|
var SegmentedControl = (_a) => {
|
12849
12977
|
var _b = _a, {
|
12850
12978
|
children,
|
@@ -12861,7 +12989,7 @@ var SegmentedControl = (_a) => {
|
|
12861
12989
|
"selected",
|
12862
12990
|
"className"
|
12863
12991
|
]);
|
12864
|
-
return /* @__PURE__ */
|
12992
|
+
return /* @__PURE__ */ React98.createElement("li", null, /* @__PURE__ */ React98.createElement("button", __spreadProps(__spreadValues({
|
12865
12993
|
type: "button"
|
12866
12994
|
}, rest), {
|
12867
12995
|
className: classNames(
|
@@ -12895,12 +13023,12 @@ var SegmentedControlGroup = (_a) => {
|
|
12895
13023
|
"border border-grey-20 text-grey-50": variant === "outlined",
|
12896
13024
|
"bg-grey-0": variant === "raised"
|
12897
13025
|
});
|
12898
|
-
return /* @__PURE__ */
|
13026
|
+
return /* @__PURE__ */ React98.createElement("ul", __spreadProps(__spreadValues({}, rest), {
|
12899
13027
|
"aria-label": ariaLabel,
|
12900
13028
|
className: classNames("Aquarium-SegmentedControl", classes2, className)
|
12901
|
-
}),
|
13029
|
+
}), React98.Children.map(
|
12902
13030
|
children,
|
12903
|
-
(child) =>
|
13031
|
+
(child) => React98.cloneElement(child, {
|
12904
13032
|
dense,
|
12905
13033
|
variant,
|
12906
13034
|
onClick: () => onChange(child.props.value),
|
@@ -12938,14 +13066,14 @@ var getCommonClassNames = (dense, selected) => tw(
|
|
12938
13066
|
);
|
12939
13067
|
|
12940
13068
|
// src/molecules/Stepper/Stepper.tsx
|
12941
|
-
import
|
13069
|
+
import React100 from "react";
|
12942
13070
|
|
12943
13071
|
// src/atoms/Stepper/Stepper.tsx
|
12944
|
-
import
|
13072
|
+
import React99 from "react";
|
12945
13073
|
var import_tick6 = __toESM(require_tick());
|
12946
13074
|
var Stepper = (_a) => {
|
12947
13075
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
12948
|
-
return /* @__PURE__ */
|
13076
|
+
return /* @__PURE__ */ React99.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12949
13077
|
className: classNames(className)
|
12950
13078
|
}));
|
12951
13079
|
};
|
@@ -12959,7 +13087,7 @@ var ConnectorContainer = (_a) => {
|
|
12959
13087
|
"completed",
|
12960
13088
|
"dense"
|
12961
13089
|
]);
|
12962
|
-
return /* @__PURE__ */
|
13090
|
+
return /* @__PURE__ */ React99.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12963
13091
|
className: classNames(
|
12964
13092
|
tw("absolute w-full -left-1/2", {
|
12965
13093
|
"top-[3px] px-[14px]": Boolean(dense),
|
@@ -12971,7 +13099,7 @@ var ConnectorContainer = (_a) => {
|
|
12971
13099
|
};
|
12972
13100
|
var Connector = (_a) => {
|
12973
13101
|
var _b = _a, { children, className, completed, dense } = _b, rest = __objRest(_b, ["children", "className", "completed", "dense"]);
|
12974
|
-
return /* @__PURE__ */
|
13102
|
+
return /* @__PURE__ */ React99.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12975
13103
|
className: classNames(
|
12976
13104
|
tw("w-full", {
|
12977
13105
|
"bg-grey-20": !completed,
|
@@ -12985,7 +13113,7 @@ var Connector = (_a) => {
|
|
12985
13113
|
};
|
12986
13114
|
var Step = (_a) => {
|
12987
13115
|
var _b = _a, { className, state } = _b, rest = __objRest(_b, ["className", "state"]);
|
12988
|
-
return /* @__PURE__ */
|
13116
|
+
return /* @__PURE__ */ React99.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12989
13117
|
className: classNames(
|
12990
13118
|
tw("flex flex-col items-center text-grey-90 relative text-center", {
|
12991
13119
|
"text-grey-20": state === "inactive"
|
@@ -13006,13 +13134,13 @@ var getDenseClassNames = (state) => tw("h-[8px] w-[8px]", {
|
|
13006
13134
|
});
|
13007
13135
|
var Indicator = (_a) => {
|
13008
13136
|
var _b = _a, { children, className, state, dense } = _b, rest = __objRest(_b, ["children", "className", "state", "dense"]);
|
13009
|
-
return /* @__PURE__ */
|
13137
|
+
return /* @__PURE__ */ React99.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13010
13138
|
className: classNames(
|
13011
13139
|
tw("rounded-full flex justify-center items-center mx-2 mb-3"),
|
13012
13140
|
dense ? getDenseClassNames(state) : getClassNames(state),
|
13013
13141
|
className
|
13014
13142
|
)
|
13015
|
-
}), state === "completed" ? /* @__PURE__ */
|
13143
|
+
}), state === "completed" ? /* @__PURE__ */ React99.createElement(InlineIcon, {
|
13016
13144
|
icon: import_tick6.default
|
13017
13145
|
}) : dense ? null : children);
|
13018
13146
|
};
|
@@ -13023,26 +13151,26 @@ Stepper.ConnectorContainer = ConnectorContainer;
|
|
13023
13151
|
|
13024
13152
|
// src/molecules/Stepper/Stepper.tsx
|
13025
13153
|
var Stepper2 = ({ children, activeIndex, dense }) => {
|
13026
|
-
const steps =
|
13027
|
-
return /* @__PURE__ */
|
13154
|
+
const steps = React100.Children.count(children);
|
13155
|
+
return /* @__PURE__ */ React100.createElement(Stepper, {
|
13028
13156
|
role: "list",
|
13029
13157
|
className: "Aquarium-Stepper"
|
13030
|
-
}, /* @__PURE__ */
|
13158
|
+
}, /* @__PURE__ */ React100.createElement(Template, {
|
13031
13159
|
columns: steps
|
13032
|
-
},
|
13160
|
+
}, React100.Children.map(children, (child, index) => {
|
13033
13161
|
if (!isComponentType(child, Step2)) {
|
13034
13162
|
return new Error("<Stepper> can only have <Stepper.Step> components as children");
|
13035
13163
|
} else {
|
13036
13164
|
const state = index > activeIndex ? "inactive" : index === activeIndex ? "active" : "completed";
|
13037
|
-
return /* @__PURE__ */
|
13165
|
+
return /* @__PURE__ */ React100.createElement(Stepper.Step, {
|
13038
13166
|
state,
|
13039
13167
|
"aria-current": state === "active" ? "step" : false,
|
13040
13168
|
role: "listitem"
|
13041
|
-
}, index > 0 && index <= steps && /* @__PURE__ */
|
13169
|
+
}, index > 0 && index <= steps && /* @__PURE__ */ React100.createElement(Stepper.ConnectorContainer, {
|
13042
13170
|
dense
|
13043
|
-
}, /* @__PURE__ */
|
13171
|
+
}, /* @__PURE__ */ React100.createElement(Stepper.ConnectorContainer.Connector, {
|
13044
13172
|
completed: state === "completed" || state === "active"
|
13045
|
-
})), /* @__PURE__ */
|
13173
|
+
})), /* @__PURE__ */ React100.createElement(Stepper.Step.Indicator, {
|
13046
13174
|
state,
|
13047
13175
|
dense
|
13048
13176
|
}, index + 1), child.props.children);
|
@@ -13055,16 +13183,16 @@ Step2.displayName = "Stepper.Step";
|
|
13055
13183
|
Stepper2.Step = Step2;
|
13056
13184
|
|
13057
13185
|
// src/molecules/Switch/Switch.tsx
|
13058
|
-
import
|
13186
|
+
import React102 from "react";
|
13059
13187
|
|
13060
13188
|
// src/atoms/Switch/Switch.tsx
|
13061
|
-
import
|
13062
|
-
var Switch =
|
13189
|
+
import React101 from "react";
|
13190
|
+
var Switch = React101.forwardRef(
|
13063
13191
|
(_a, ref) => {
|
13064
13192
|
var _b = _a, { id, children, name, disabled = false, readOnly = false } = _b, props = __objRest(_b, ["id", "children", "name", "disabled", "readOnly"]);
|
13065
|
-
return /* @__PURE__ */
|
13193
|
+
return /* @__PURE__ */ React101.createElement("span", {
|
13066
13194
|
className: tw("relative inline-flex justify-center items-center self-center group")
|
13067
|
-
}, /* @__PURE__ */
|
13195
|
+
}, /* @__PURE__ */ React101.createElement("input", __spreadProps(__spreadValues({
|
13068
13196
|
id,
|
13069
13197
|
ref,
|
13070
13198
|
type: "checkbox",
|
@@ -13083,7 +13211,7 @@ var Switch = React99.forwardRef(
|
|
13083
13211
|
),
|
13084
13212
|
readOnly,
|
13085
13213
|
disabled
|
13086
|
-
})), /* @__PURE__ */
|
13214
|
+
})), /* @__PURE__ */ React101.createElement("span", {
|
13087
13215
|
className: tw(
|
13088
13216
|
"pointer-events-none rounded-full absolute inline-block transition duration-300 h-4 w-4 transform peer-checked/switch:translate-x-5",
|
13089
13217
|
"bg-white peer-disabled/switch:bg-grey-0 left-2 peer-checked/switch:left-1",
|
@@ -13096,12 +13224,12 @@ var Switch = React99.forwardRef(
|
|
13096
13224
|
);
|
13097
13225
|
|
13098
13226
|
// src/molecules/Switch/Switch.tsx
|
13099
|
-
var Switch2 =
|
13227
|
+
var Switch2 = React102.forwardRef(
|
13100
13228
|
(_a, ref) => {
|
13101
13229
|
var _b = _a, { id, name, caption, readOnly = false, disabled = false, children, "aria-label": ariaLabel } = _b, props = __objRest(_b, ["id", "name", "caption", "readOnly", "disabled", "children", "aria-label"]);
|
13102
13230
|
var _a2;
|
13103
13231
|
const isChecked = (_a2 = props.checked) != null ? _a2 : props.defaultChecked;
|
13104
|
-
return !readOnly || isChecked ? /* @__PURE__ */
|
13232
|
+
return !readOnly || isChecked ? /* @__PURE__ */ React102.createElement(ControlLabel, {
|
13105
13233
|
htmlFor: id,
|
13106
13234
|
label: children,
|
13107
13235
|
"aria-label": ariaLabel,
|
@@ -13110,7 +13238,7 @@ var Switch2 = React100.forwardRef(
|
|
13110
13238
|
disabled,
|
13111
13239
|
style: { gap: "0 8px" },
|
13112
13240
|
className: "Aquarium-Switch"
|
13113
|
-
}, !readOnly && /* @__PURE__ */
|
13241
|
+
}, !readOnly && /* @__PURE__ */ React102.createElement(Switch, __spreadProps(__spreadValues({
|
13114
13242
|
id,
|
13115
13243
|
ref,
|
13116
13244
|
name
|
@@ -13121,12 +13249,12 @@ var Switch2 = React100.forwardRef(
|
|
13121
13249
|
}
|
13122
13250
|
);
|
13123
13251
|
Switch2.displayName = "Switch";
|
13124
|
-
var SwitchSkeleton = () => /* @__PURE__ */
|
13252
|
+
var SwitchSkeleton = () => /* @__PURE__ */ React102.createElement("div", {
|
13125
13253
|
className: tw("flex gap-3")
|
13126
|
-
}, /* @__PURE__ */
|
13254
|
+
}, /* @__PURE__ */ React102.createElement(Skeleton, {
|
13127
13255
|
height: 20,
|
13128
13256
|
width: 35
|
13129
|
-
}), /* @__PURE__ */
|
13257
|
+
}), /* @__PURE__ */ React102.createElement(Skeleton, {
|
13130
13258
|
height: 20,
|
13131
13259
|
width: 150
|
13132
13260
|
}));
|
@@ -13134,7 +13262,7 @@ Switch2.Skeleton = SwitchSkeleton;
|
|
13134
13262
|
Switch2.Skeleton.displayName = "Switch.Skeleton ";
|
13135
13263
|
|
13136
13264
|
// src/molecules/SwitchGroup/SwitchGroup.tsx
|
13137
|
-
import
|
13265
|
+
import React103, { useState as useState12 } from "react";
|
13138
13266
|
import uniqueId9 from "lodash/uniqueId";
|
13139
13267
|
var SwitchGroup = (_a) => {
|
13140
13268
|
var _b = _a, {
|
@@ -13166,13 +13294,13 @@ var SwitchGroup = (_a) => {
|
|
13166
13294
|
setSelectedItems(updated);
|
13167
13295
|
onChange == null ? void 0 : onChange(updated);
|
13168
13296
|
};
|
13169
|
-
return /* @__PURE__ */
|
13297
|
+
return /* @__PURE__ */ React103.createElement(LabelControl, __spreadProps(__spreadValues(__spreadValues({
|
13170
13298
|
fieldset: true
|
13171
13299
|
}, labelControlProps), errorProps), {
|
13172
13300
|
className: "Aquarium-SwitchGroup"
|
13173
|
-
}), /* @__PURE__ */
|
13301
|
+
}), /* @__PURE__ */ React103.createElement(InputGroup, {
|
13174
13302
|
cols
|
13175
|
-
},
|
13303
|
+
}, React103.Children.map(children, (c) => {
|
13176
13304
|
var _a3, _b2, _c, _d;
|
13177
13305
|
if (!isComponentType(c, Switch2)) {
|
13178
13306
|
return null;
|
@@ -13180,7 +13308,7 @@ var SwitchGroup = (_a) => {
|
|
13180
13308
|
const str = (_a3 = c.props.value) == null ? void 0 : _a3.toString();
|
13181
13309
|
const defaultChecked = defaultValue === void 0 ? void 0 : str !== void 0 && defaultValue.includes(str);
|
13182
13310
|
const checked = value === void 0 ? void 0 : str !== void 0 && value.includes(str);
|
13183
|
-
return
|
13311
|
+
return React103.cloneElement(c, {
|
13184
13312
|
defaultChecked: (_b2 = c.props.defaultChecked) != null ? _b2 : defaultChecked,
|
13185
13313
|
checked: (_c = c.props.checked) != null ? _c : checked,
|
13186
13314
|
onChange: (_d = c.props.onChange) != null ? _d : handleChange,
|
@@ -13190,39 +13318,24 @@ var SwitchGroup = (_a) => {
|
|
13190
13318
|
})));
|
13191
13319
|
};
|
13192
13320
|
var SwitchGroupSkeleton = ({ options = 2 }) => {
|
13193
|
-
return /* @__PURE__ */
|
13321
|
+
return /* @__PURE__ */ React103.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React103.createElement("div", {
|
13194
13322
|
className: tw("flex flex-wrap flex-col gap-2")
|
13195
|
-
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */
|
13323
|
+
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */ React103.createElement(Switch2.Skeleton, {
|
13196
13324
|
key
|
13197
13325
|
}))));
|
13198
13326
|
};
|
13199
13327
|
SwitchGroup.Skeleton = SwitchGroupSkeleton;
|
13200
13328
|
SwitchGroup.Skeleton.displayName = "SwitchGroup.Skeleton";
|
13201
13329
|
|
13202
|
-
// src/molecules/TagLabel/TagLabel.tsx
|
13203
|
-
import React102 from "react";
|
13204
|
-
var TagLabel = (_a) => {
|
13205
|
-
var _b = _a, { title, dense = false } = _b, rest = __objRest(_b, ["title", "dense"]);
|
13206
|
-
return /* @__PURE__ */ React102.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
13207
|
-
className: classNames(
|
13208
|
-
"Aquarium-TagLabel",
|
13209
|
-
tw("rounded-full text-white bg-primary-70", {
|
13210
|
-
"py-2 px-4 typography-caption": !dense,
|
13211
|
-
"py-2 px-3 typography-caption-small": dense
|
13212
|
-
})
|
13213
|
-
)
|
13214
|
-
}), title);
|
13215
|
-
};
|
13216
|
-
|
13217
13330
|
// src/molecules/Textarea/Textarea.tsx
|
13218
|
-
import
|
13331
|
+
import React104, { useRef as useRef13, useState as useState13 } from "react";
|
13219
13332
|
import omit18 from "lodash/omit";
|
13220
13333
|
import toString2 from "lodash/toString";
|
13221
13334
|
import uniqueId10 from "lodash/uniqueId";
|
13222
|
-
var TextareaBase =
|
13335
|
+
var TextareaBase = React104.forwardRef(
|
13223
13336
|
(_a, ref) => {
|
13224
13337
|
var _b = _a, { readOnly = false, valid = true } = _b, props = __objRest(_b, ["readOnly", "valid"]);
|
13225
|
-
return /* @__PURE__ */
|
13338
|
+
return /* @__PURE__ */ React104.createElement("textarea", __spreadProps(__spreadValues({
|
13226
13339
|
ref
|
13227
13340
|
}, props), {
|
13228
13341
|
readOnly,
|
@@ -13230,10 +13343,10 @@ var TextareaBase = React103.forwardRef(
|
|
13230
13343
|
}));
|
13231
13344
|
}
|
13232
13345
|
);
|
13233
|
-
TextareaBase.Skeleton = () => /* @__PURE__ */
|
13346
|
+
TextareaBase.Skeleton = () => /* @__PURE__ */ React104.createElement(Skeleton, {
|
13234
13347
|
height: 58
|
13235
13348
|
});
|
13236
|
-
var Textarea =
|
13349
|
+
var Textarea = React104.forwardRef((props, ref) => {
|
13237
13350
|
var _a, _b, _c;
|
13238
13351
|
const [value, setValue] = useState13((_b = (_a = props.value) != null ? _a : props.defaultValue) != null ? _b : "");
|
13239
13352
|
const id = useRef13((_c = props.id) != null ? _c : `textarea-${uniqueId10()}`);
|
@@ -13241,14 +13354,14 @@ var Textarea = React103.forwardRef((props, ref) => {
|
|
13241
13354
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
13242
13355
|
const _d = getLabelControlProps(props), { "data-testid": dataTestId } = _d, labelControlProps = __objRest(_d, ["data-testid"]);
|
13243
13356
|
const baseProps = omit18(props, Object.keys(labelControlProps));
|
13244
|
-
return /* @__PURE__ */
|
13357
|
+
return /* @__PURE__ */ React104.createElement(LabelControl, __spreadProps(__spreadValues({
|
13245
13358
|
id: `${id.current}-label`,
|
13246
13359
|
htmlFor: id.current,
|
13247
13360
|
messageId: errorMessageId,
|
13248
13361
|
length: value !== void 0 ? toString2(value).length : void 0
|
13249
13362
|
}, labelControlProps), {
|
13250
13363
|
className: "Aquarium-Textarea"
|
13251
|
-
}), /* @__PURE__ */
|
13364
|
+
}), /* @__PURE__ */ React104.createElement(TextareaBase, __spreadProps(__spreadValues(__spreadValues({
|
13252
13365
|
ref
|
13253
13366
|
}, baseProps), errorProps), {
|
13254
13367
|
id: id.current,
|
@@ -13265,48 +13378,48 @@ var Textarea = React103.forwardRef((props, ref) => {
|
|
13265
13378
|
})));
|
13266
13379
|
});
|
13267
13380
|
Textarea.displayName = "Textarea";
|
13268
|
-
var TextAreaSkeleton = () => /* @__PURE__ */
|
13381
|
+
var TextAreaSkeleton = () => /* @__PURE__ */ React104.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React104.createElement(TextareaBase.Skeleton, null));
|
13269
13382
|
Textarea.Skeleton = TextAreaSkeleton;
|
13270
13383
|
Textarea.Skeleton.displayName = "Textarea.Skeleton";
|
13271
13384
|
|
13272
13385
|
// src/molecules/Timeline/Timeline.tsx
|
13273
|
-
import
|
13386
|
+
import React106 from "react";
|
13274
13387
|
|
13275
13388
|
// src/atoms/Timeline/Timeline.tsx
|
13276
|
-
import
|
13389
|
+
import React105 from "react";
|
13277
13390
|
var Timeline = (_a) => {
|
13278
13391
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13279
|
-
return /* @__PURE__ */
|
13392
|
+
return /* @__PURE__ */ React105.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13280
13393
|
className: classNames(tw("grid grid-cols-[16px_1fr] gap-x-4"), className)
|
13281
13394
|
}));
|
13282
13395
|
};
|
13283
13396
|
var Content2 = (_a) => {
|
13284
13397
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13285
|
-
return /* @__PURE__ */
|
13398
|
+
return /* @__PURE__ */ React105.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13286
13399
|
className: classNames(tw("pb-6"), className)
|
13287
13400
|
}));
|
13288
13401
|
};
|
13289
13402
|
var Separator2 = (_a) => {
|
13290
13403
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13291
|
-
return /* @__PURE__ */
|
13404
|
+
return /* @__PURE__ */ React105.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13292
13405
|
className: classNames(tw("flex items-center justify-center h-5 w-5"), className)
|
13293
13406
|
}));
|
13294
13407
|
};
|
13295
13408
|
var LineContainer = (_a) => {
|
13296
13409
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13297
|
-
return /* @__PURE__ */
|
13410
|
+
return /* @__PURE__ */ React105.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13298
13411
|
className: classNames(tw("flex justify-center py-1"), className)
|
13299
13412
|
}));
|
13300
13413
|
};
|
13301
13414
|
var Line = (_a) => {
|
13302
13415
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13303
|
-
return /* @__PURE__ */
|
13416
|
+
return /* @__PURE__ */ React105.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13304
13417
|
className: classNames(tw("w-1 bg-grey-5 h-full justify-self-center"), className)
|
13305
13418
|
}));
|
13306
13419
|
};
|
13307
13420
|
var Dot = (_a) => {
|
13308
13421
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13309
|
-
return /* @__PURE__ */
|
13422
|
+
return /* @__PURE__ */ React105.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13310
13423
|
className: classNames(tw("bg-grey-30 h-[6px] w-[6px] rounded"), className)
|
13311
13424
|
}));
|
13312
13425
|
};
|
@@ -13321,54 +13434,54 @@ var import_error5 = __toESM(require_error());
|
|
13321
13434
|
var import_time2 = __toESM(require_time());
|
13322
13435
|
var import_warningSign5 = __toESM(require_warningSign());
|
13323
13436
|
var TimelineItem = () => null;
|
13324
|
-
var Timeline2 = ({ children }) => /* @__PURE__ */
|
13437
|
+
var Timeline2 = ({ children }) => /* @__PURE__ */ React106.createElement("div", {
|
13325
13438
|
className: "Aquarium-Timeline"
|
13326
|
-
},
|
13439
|
+
}, React106.Children.map(children, (item) => {
|
13327
13440
|
if (!isComponentType(item, TimelineItem)) {
|
13328
13441
|
throw new Error("<Timeline> can only have <Timeline.Item> components as children");
|
13329
13442
|
} else {
|
13330
13443
|
const { props, key } = item;
|
13331
|
-
return /* @__PURE__ */
|
13444
|
+
return /* @__PURE__ */ React106.createElement(Timeline, {
|
13332
13445
|
key: key != null ? key : props.title
|
13333
|
-
}, /* @__PURE__ */
|
13446
|
+
}, /* @__PURE__ */ React106.createElement(Timeline.Separator, null, props.variant === "error" ? /* @__PURE__ */ React106.createElement(Icon, {
|
13334
13447
|
icon: import_error5.default,
|
13335
13448
|
color: "error-30"
|
13336
|
-
}) : props.variant === "warning" ? /* @__PURE__ */
|
13449
|
+
}) : props.variant === "warning" ? /* @__PURE__ */ React106.createElement(Icon, {
|
13337
13450
|
icon: import_warningSign5.default,
|
13338
13451
|
color: "warning-30"
|
13339
|
-
}) : props.variant === "info" ? /* @__PURE__ */
|
13452
|
+
}) : props.variant === "info" ? /* @__PURE__ */ React106.createElement(Icon, {
|
13340
13453
|
icon: import_time2.default,
|
13341
13454
|
color: "info-30"
|
13342
|
-
}) : /* @__PURE__ */
|
13455
|
+
}) : /* @__PURE__ */ React106.createElement(Timeline.Separator.Dot, null)), /* @__PURE__ */ React106.createElement(Typography2.Caption, {
|
13343
13456
|
color: "grey-50"
|
13344
|
-
}, props.title), /* @__PURE__ */
|
13457
|
+
}, props.title), /* @__PURE__ */ React106.createElement(Timeline.LineContainer, null, /* @__PURE__ */ React106.createElement(Timeline.LineContainer.Line, null)), /* @__PURE__ */ React106.createElement(Timeline.Content, null, /* @__PURE__ */ React106.createElement(Typography2.Small, null, props.children)));
|
13345
13458
|
}
|
13346
13459
|
}));
|
13347
|
-
var TimelineItemSkeleton = () => /* @__PURE__ */
|
13460
|
+
var TimelineItemSkeleton = () => /* @__PURE__ */ React106.createElement(Timeline, null, /* @__PURE__ */ React106.createElement(Timeline.Separator, null, /* @__PURE__ */ React106.createElement(Skeleton, {
|
13348
13461
|
width: 6,
|
13349
13462
|
height: 6,
|
13350
13463
|
rounded: true
|
13351
|
-
})), /* @__PURE__ */
|
13464
|
+
})), /* @__PURE__ */ React106.createElement(Skeleton, {
|
13352
13465
|
height: 12,
|
13353
13466
|
width: 120
|
13354
|
-
}), /* @__PURE__ */
|
13467
|
+
}), /* @__PURE__ */ React106.createElement(Timeline.LineContainer, null, /* @__PURE__ */ React106.createElement(Skeleton, {
|
13355
13468
|
width: 2,
|
13356
13469
|
height: "100%"
|
13357
|
-
})), /* @__PURE__ */
|
13470
|
+
})), /* @__PURE__ */ React106.createElement(Timeline.Content, null, /* @__PURE__ */ React106.createElement(Box, {
|
13358
13471
|
display: "flex",
|
13359
13472
|
flexDirection: "column",
|
13360
13473
|
gap: "3"
|
13361
|
-
}, /* @__PURE__ */
|
13474
|
+
}, /* @__PURE__ */ React106.createElement(Skeleton, {
|
13362
13475
|
height: 32,
|
13363
13476
|
width: "100%"
|
13364
|
-
}), /* @__PURE__ */
|
13477
|
+
}), /* @__PURE__ */ React106.createElement(Skeleton, {
|
13365
13478
|
height: 32,
|
13366
13479
|
width: "73%"
|
13367
|
-
}), /* @__PURE__ */
|
13480
|
+
}), /* @__PURE__ */ React106.createElement(Skeleton, {
|
13368
13481
|
height: 32,
|
13369
13482
|
width: "80%"
|
13370
13483
|
}))));
|
13371
|
-
var TimelineSkeleton = ({ items = 3 }) => /* @__PURE__ */
|
13484
|
+
var TimelineSkeleton = ({ items = 3 }) => /* @__PURE__ */ React106.createElement("div", null, Array.from({ length: items }).map((_, key) => /* @__PURE__ */ React106.createElement(TimelineItemSkeleton, {
|
13372
13485
|
key
|
13373
13486
|
})));
|
13374
13487
|
Timeline2.Item = TimelineItem;
|
@@ -13376,9 +13489,9 @@ Timeline2.Skeleton = TimelineSkeleton;
|
|
13376
13489
|
Timeline2.Skeleton.displayName = "Timeline.Skeleton";
|
13377
13490
|
|
13378
13491
|
// src/utils/table/useTableSelect.ts
|
13379
|
-
import
|
13492
|
+
import React107 from "react";
|
13380
13493
|
var useTableSelect = (data, { key }) => {
|
13381
|
-
const [selected, setSelected] =
|
13494
|
+
const [selected, setSelected] = React107.useState([]);
|
13382
13495
|
const allSelected = selected.length === data.length;
|
13383
13496
|
const isSelected = (dot) => selected.includes(dot[key]);
|
13384
13497
|
const selectAll = () => setSelected(data.map((dot) => dot[key]));
|