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