@aivenio/aquarium 1.22.0-rc1 → 1.23.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 +14 -14
- package/dist/_variables_timescale.scss +2 -2
- package/dist/atoms.cjs +54 -51
- package/dist/atoms.mjs +54 -51
- package/dist/src/atoms/Alert/Alert.js +2 -2
- package/dist/src/atoms/Banner/Banner.js +3 -3
- package/dist/src/atoms/Checkbox/Checkbox.js +6 -6
- package/dist/src/atoms/RadioButton/RadioButton.js +4 -4
- package/dist/src/atoms/Switch/Switch.js +3 -3
- package/dist/src/molecules/Alert/Alert.js +2 -2
- package/dist/src/molecules/Banner/Banner.d.ts +3 -3
- package/dist/src/molecules/Banner/Banner.js +5 -3
- package/dist/src/molecules/Breadcrumbs/Breadcrumbs.js +2 -2
- package/dist/src/molecules/Button/Button.js +6 -7
- package/dist/src/molecules/DataList/DataList.d.ts +8 -2
- package/dist/src/molecules/DataList/DataList.js +5 -3
- package/dist/src/molecules/DataList/DataListSkeleton.d.ts +8 -0
- package/dist/src/molecules/DataList/DataListSkeleton.js +15 -0
- package/dist/src/molecules/DataTable/DataTable.d.ts +8 -2
- package/dist/src/molecules/DataTable/DataTable.js +5 -3
- package/dist/src/molecules/EmptyState/EmptyState.d.ts +5 -3
- package/dist/src/molecules/EmptyState/EmptyState.js +8 -3
- package/dist/src/molecules/Link/Link.js +1 -1
- package/dist/src/molecules/Navigation/Navigation.js +2 -2
- package/dist/src/molecules/PageHeader/PageHeader.d.ts +5 -3
- package/dist/src/molecules/PageHeader/PageHeader.js +6 -17
- package/dist/src/molecules/Section/Section.d.ts +3 -2
- package/dist/src/molecules/Section/Section.js +4 -16
- package/dist/src/molecules/Tabs/Tabs.js +3 -3
- package/dist/src/utils/ContrastRatio.d.ts +11 -0
- package/dist/src/utils/ContrastRatio.js +54 -0
- package/dist/src/utils/constants.js +3 -3
- package/dist/src/utils/link.d.ts +2 -0
- package/dist/src/utils/link.js +2 -0
- package/dist/src/utils/table/types.d.ts +4 -0
- package/dist/styles.css +133 -156
- package/dist/styles_timescaledb.css +112 -135
- package/dist/system.cjs +592 -533
- package/dist/system.mjs +552 -493
- package/dist/tailwind.config.js +0 -3
- package/dist/tailwind.theme.json +14 -14
- package/dist/tokens.json +16 -14
- package/dist/tsconfig.module.tsbuildinfo +1 -1
- package/dist/types/tailwindGenerated.d.ts +1 -1
- package/package.json +4 -4
package/dist/system.mjs
CHANGED
@@ -164,7 +164,8 @@ var require_tokens = __commonJS({
|
|
164
164
|
"primary-20": "#b4e5fb",
|
165
165
|
"primary-10": "#e0f5fe",
|
166
166
|
"primary-5": "#effaff",
|
167
|
-
"primary-0": "#f9fdff"
|
167
|
+
"primary-0": "#f9fdff",
|
168
|
+
"navyBlue-100": "#30375e"
|
168
169
|
},
|
169
170
|
typography: {
|
170
171
|
sizes: [
|
@@ -712,19 +713,20 @@ var require_tokens = __commonJS({
|
|
712
713
|
"secondary-10": "#fee8d0",
|
713
714
|
"secondary-5": "#fff3e8",
|
714
715
|
"secondary-0": "#fffbf8",
|
715
|
-
"primary-100": "
|
716
|
-
"primary-90": "#
|
717
|
-
"primary-80": "#
|
718
|
-
"primary-70": "#
|
719
|
-
"primary-60": "#
|
720
|
-
"primary-50": "#
|
721
|
-
"primary-40": "#
|
722
|
-
"primary-30": "#
|
723
|
-
"primary-20": "#
|
724
|
-
"primary-10": "#
|
725
|
-
"primary-5": "#
|
726
|
-
"primary-0": "#
|
727
|
-
"grey-20": "#d2d2d6"
|
716
|
+
"primary-100": "#a70045",
|
717
|
+
"primary-90": "#c60443",
|
718
|
+
"primary-80": "#e41a4a",
|
719
|
+
"primary-70": "#ff3554",
|
720
|
+
"primary-60": "#ff5275",
|
721
|
+
"primary-50": "#ff6f94",
|
722
|
+
"primary-40": "#ff8db0",
|
723
|
+
"primary-30": "#ffa9c9",
|
724
|
+
"primary-20": "#ffc4de",
|
725
|
+
"primary-10": "#ffdeef",
|
726
|
+
"primary-5": "#ffe8f4",
|
727
|
+
"primary-0": "#fff9fc",
|
728
|
+
"grey-20": "#d2d2d6",
|
729
|
+
"navyBlue-100": "#30375e"
|
728
730
|
},
|
729
731
|
typography: {
|
730
732
|
sizes: [
|
@@ -5656,24 +5658,24 @@ var tailwind_theme_default = {
|
|
5656
5658
|
"secondary-10": "var(--aquarium-colors-secondary-10, #fee8d0)",
|
5657
5659
|
"secondary-5": "var(--aquarium-colors-secondary-5, #fff3e8)",
|
5658
5660
|
"secondary-0": "var(--aquarium-colors-secondary-0, #fffbf8)",
|
5659
|
-
"primary-100": "var(--aquarium-colors-primary-100,
|
5660
|
-
"primary-90": "var(--aquarium-colors-primary-90, #
|
5661
|
-
"primary-80": "var(--aquarium-colors-primary-80, #
|
5662
|
-
"primary-70": "var(--aquarium-colors-primary-70, #
|
5663
|
-
"primary-60": "var(--aquarium-colors-primary-60, #
|
5664
|
-
"primary-50": "var(--aquarium-colors-primary-50, #
|
5665
|
-
"primary-40": "var(--aquarium-colors-primary-40, #
|
5666
|
-
"primary-30": "var(--aquarium-colors-primary-30, #
|
5667
|
-
"primary-20": "var(--aquarium-colors-primary-20, #
|
5668
|
-
"primary-10": "var(--aquarium-colors-primary-10, #
|
5669
|
-
"primary-5": "var(--aquarium-colors-primary-5, #
|
5670
|
-
"primary-0": "var(--aquarium-colors-primary-0, #
|
5661
|
+
"primary-100": "var(--aquarium-colors-primary-100, #a70045)",
|
5662
|
+
"primary-90": "var(--aquarium-colors-primary-90, #c60443)",
|
5663
|
+
"primary-80": "var(--aquarium-colors-primary-80, #e41a4a)",
|
5664
|
+
"primary-70": "var(--aquarium-colors-primary-70, #ff3554)",
|
5665
|
+
"primary-60": "var(--aquarium-colors-primary-60, #ff5275)",
|
5666
|
+
"primary-50": "var(--aquarium-colors-primary-50, #ff6f94)",
|
5667
|
+
"primary-40": "var(--aquarium-colors-primary-40, #ff8db0)",
|
5668
|
+
"primary-30": "var(--aquarium-colors-primary-30, #ffa9c9)",
|
5669
|
+
"primary-20": "var(--aquarium-colors-primary-20, #ffc4de)",
|
5670
|
+
"primary-10": "var(--aquarium-colors-primary-10, #ffdeef)",
|
5671
|
+
"primary-5": "var(--aquarium-colors-primary-5, #ffe8f4)",
|
5672
|
+
"primary-0": "var(--aquarium-colors-primary-0, #fff9fc)",
|
5671
5673
|
"grey-20": "var(--aquarium-colors-grey-20, #d2d2d6)",
|
5674
|
+
"navyBlue-100": "var(--aquarium-colors-navyBlue-100, #30375e)",
|
5672
5675
|
transparent: "var(--aquarium-colors-transparent, transparent)",
|
5673
5676
|
white: "var(--aquarium-colors-white, white)",
|
5674
5677
|
black: "var(--aquarium-colors-black, black)",
|
5675
|
-
current: "var(--aquarium-colors-current, currentColor)"
|
5676
|
-
"navyBlue-100": "#30375E"
|
5678
|
+
current: "var(--aquarium-colors-current, currentColor)"
|
5677
5679
|
},
|
5678
5680
|
gap: {
|
5679
5681
|
"0": "0",
|
@@ -6990,12 +6992,9 @@ var getCommonInputStyles = ({ readOnly, valid }) => tw(
|
|
6990
6992
|
}
|
6991
6993
|
);
|
6992
6994
|
var ghostButtonStyle = tw(
|
6993
|
-
"text-primary-80 active:text-primary-70 focus-visible:text-
|
6994
|
-
);
|
6995
|
-
var linkStyle = classNames(
|
6996
|
-
ghostButtonStyle,
|
6997
|
-
tw("visited:text-primary-80 underline hover:no-underline focusable")
|
6995
|
+
"text-primary-80 active:text-primary-70 focus-visible:text-grey-90 hover:text-primary-70 disabled:text-primary-40"
|
6998
6996
|
);
|
6997
|
+
var linkStyle = classNames(ghostButtonStyle, tw("visited:text-primary-80 focusable"));
|
6999
6998
|
|
7000
6999
|
// src/utils/string.ts
|
7001
7000
|
var capitalize = (a) => a.charAt(0).toUpperCase() + a.slice(1);
|
@@ -7005,12 +7004,12 @@ var import_chevronDown3 = __toESM(require_chevronDown());
|
|
7005
7004
|
var import_loading2 = __toESM(require_loading());
|
7006
7005
|
var COLOR_CLASSNAMES = {
|
7007
7006
|
"primary": tw(
|
7008
|
-
"text-white bg-primary-80 active:bg-primary-90 active:ring-0 focus-visible:ring-2 focus-visible:ring-primary-
|
7007
|
+
"text-white bg-primary-80 active:bg-primary-90 active:ring-0 focus-visible:ring-2 focus-visible:ring-primary-100 focus-visible:ring-inset hover:bg-primary-70 disabled:bg-primary-5"
|
7009
7008
|
),
|
7010
7009
|
"secondary": tw(
|
7011
|
-
"text-
|
7012
|
-
"focus-visible:ring-2 focus-visible:ring-
|
7013
|
-
"hover:ring-
|
7010
|
+
"text-grey-60 bg-white ring-1 ring-grey-30 ring-inset active:bg-grey-5 active:ring-grey-50 active:text-grey-80",
|
7011
|
+
"focus-visible:ring-2 focus-visible:ring-grey-50 focus-visible:text-grey-80",
|
7012
|
+
"hover:ring-grey-50 hover:text-grey-80 disabled:text-grey-30 disabled:bg-grey-0 disabled:ring-grey-20"
|
7014
7013
|
),
|
7015
7014
|
"ghost": ghostButtonStyle,
|
7016
7015
|
"text": ghostButtonStyle,
|
@@ -7018,12 +7017,15 @@ var COLOR_CLASSNAMES = {
|
|
7018
7017
|
"text-grey-60 active:text-grey-50 focus-visible:text-grey-80 hover:text-grey-80 disabled:text-grey-30"
|
7019
7018
|
)
|
7020
7019
|
};
|
7021
|
-
var LoadingSpinner = ({
|
7020
|
+
var LoadingSpinner = ({
|
7021
|
+
size = "20px",
|
7022
|
+
kind = "primary"
|
7023
|
+
}) => {
|
7022
7024
|
return /* @__PURE__ */ React15.createElement(InlineIcon, {
|
7023
7025
|
icon: import_loading2.default,
|
7024
7026
|
width: size,
|
7025
7027
|
height: size,
|
7026
|
-
color: "primary-
|
7028
|
+
color: kind === "primary" ? "primary-60" : "grey-60",
|
7027
7029
|
"data-testid": "loading-button"
|
7028
7030
|
});
|
7029
7031
|
};
|
@@ -7121,7 +7123,6 @@ var asButton = (Component, isDropdownButton) => {
|
|
7121
7123
|
"text-grey-70 p-2 active:text-grey-70 active:bg-transparent hover:text-grey-90 hover:bg-grey-0 focus-visible:text-grey-90 focus-visible:bg-grey-0 disabled:text-grey-20 disabled:bg-transparent": isIconOnlyButton,
|
7122
7124
|
"typography-default-strong": !dense && !isIconOnlyButton && kind !== "text",
|
7123
7125
|
"typography-small-strong": dense && !isIconOnlyButton && kind !== "text",
|
7124
|
-
"underline hover:no-underline": kind === "text",
|
7125
7126
|
"py-3 px-4": !dense && isButton,
|
7126
7127
|
"py-2 px-3": dense && isButton,
|
7127
7128
|
"py-3": !dense && isGhost,
|
@@ -7138,7 +7139,8 @@ var asButton = (Component, isDropdownButton) => {
|
|
7138
7139
|
className: tw("absolute left-1/2 top-0 bottom-0 flex"),
|
7139
7140
|
style: { transform: "translate(-50%)" }
|
7140
7141
|
}, /* @__PURE__ */ React15.createElement(LoadingSpinner, {
|
7141
|
-
size: iconSize
|
7142
|
+
size: iconSize,
|
7143
|
+
kind: kind === "primary" ? "primary" : "secondary"
|
7142
7144
|
})), /* @__PURE__ */ React15.createElement("div", {
|
7143
7145
|
className: tw({ invisible: loading2 })
|
7144
7146
|
}, buttonContent())) : buttonContent());
|
@@ -7298,6 +7300,7 @@ var Alert = (_a) => {
|
|
7298
7300
|
"dense"
|
7299
7301
|
]);
|
7300
7302
|
return /* @__PURE__ */ React17.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
7303
|
+
role: type === "error" || type === "warning" ? "alert" : "status",
|
7301
7304
|
className: classNames(
|
7302
7305
|
tw("rounded grid grid-cols-[auto_1fr_auto] items-center gap-x-3 gap-y-2", {
|
7303
7306
|
"bg-error-5": type === "error",
|
@@ -7354,8 +7357,10 @@ Alert.Dismiss = (_a) => {
|
|
7354
7357
|
})));
|
7355
7358
|
};
|
7356
7359
|
|
7357
|
-
// src/
|
7360
|
+
// src/utils/link.ts
|
7358
7361
|
var isLink = (action) => action.href !== void 0;
|
7362
|
+
|
7363
|
+
// src/molecules/Alert/Alert.tsx
|
7359
7364
|
var Alert2 = ({ description, type, title, onDismiss, children, action }) => /* @__PURE__ */ React18.createElement(Alert, {
|
7360
7365
|
className: "Aquarium-Alert",
|
7361
7366
|
type,
|
@@ -7514,10 +7519,10 @@ var Banner = (_a) => {
|
|
7514
7519
|
}), children);
|
7515
7520
|
};
|
7516
7521
|
Banner.Title = (_a) => {
|
7517
|
-
var _b = _a, { children, className, layout } = _b, rest = __objRest(_b, ["children", "className", "layout"]);
|
7522
|
+
var _b = _a, { children, className, layout, titleVariant = "primary" } = _b, rest = __objRest(_b, ["children", "className", "layout", "titleVariant"]);
|
7518
7523
|
return /* @__PURE__ */ React22.createElement(Typography, __spreadProps(__spreadValues({}, rest), {
|
7519
7524
|
variant: "subheading",
|
7520
|
-
color: "grey-100",
|
7525
|
+
color: titleVariant === "secondary" ? "primary-80" : "grey-100",
|
7521
7526
|
className: classNames(
|
7522
7527
|
className,
|
7523
7528
|
tw("whitespace-nowrap", {
|
@@ -7589,13 +7594,17 @@ var createBanner = (displayName, opts = {}) => {
|
|
7589
7594
|
}, /* @__PURE__ */ React23.createElement(Banner.ContentContainer, {
|
7590
7595
|
layout
|
7591
7596
|
}, /* @__PURE__ */ React23.createElement(Banner.Title, {
|
7592
|
-
layout
|
7597
|
+
layout,
|
7598
|
+
titleVariant: opts.isOneLineBanner ? "secondary" : "primary"
|
7593
7599
|
}, title), /* @__PURE__ */ React23.createElement(Banner.Description, {
|
7594
7600
|
flexGrow: isDismissable ? false : true
|
7595
7601
|
}, children || description), action && /* @__PURE__ */ React23.createElement(Banner.Actions, {
|
7596
7602
|
layout
|
7597
|
-
}, /* @__PURE__ */ React23.createElement(Button.Ghost, __spreadValues({
|
7603
|
+
}, !isLink(action) && /* @__PURE__ */ React23.createElement(Button.Ghost, __spreadValues({
|
7598
7604
|
dense: true
|
7605
|
+
}, omit3(action, "text")), action.text), isLink(action) && /* @__PURE__ */ React23.createElement(Button.ExternalLink, __spreadValues({
|
7606
|
+
dense: true,
|
7607
|
+
kind: "ghost"
|
7599
7608
|
}, omit3(action, "text")), action.text))), (props.layout === "vertical" || props.layout === void 0) && props.image !== void 0 && /* @__PURE__ */ React23.createElement(Banner.ImageContainer, null, props.image ? /* @__PURE__ */ React23.createElement("img", {
|
7600
7609
|
src: props.image,
|
7601
7610
|
alt: props.imageAlt,
|
@@ -7659,7 +7668,7 @@ var asCrumb = (Component, displayName, options = { isActive: false }) => {
|
|
7659
7668
|
}), /* @__PURE__ */ React24.createElement("span", {
|
7660
7669
|
className: classNames3(
|
7661
7670
|
tw("flex flex-row flex-nowrap items-center gap-x-3 ", {
|
7662
|
-
"text-primary-80 hover:text-primary-70
|
7671
|
+
"text-primary-80 hover:text-primary-70": !options.isActive,
|
7663
7672
|
"text-grey-90": options.isActive
|
7664
7673
|
})
|
7665
7674
|
)
|
@@ -8363,7 +8372,7 @@ var Checkbox = React34.forwardRef(
|
|
8363
8372
|
var _b = _a, { id, children, name, disabled = false, readOnly = false, indeterminate = false } = _b, props = __objRest(_b, ["id", "children", "name", "disabled", "readOnly", "indeterminate"]);
|
8364
8373
|
return /* @__PURE__ */ React34.createElement("span", {
|
8365
8374
|
className: classNames(tw("inline-flex justify-center items-center self-center relative"), {
|
8366
|
-
"hover:border-grey-50 peer-checked:border-
|
8375
|
+
"hover:border-grey-50 peer-checked:border-navyBlue-100": !disabled,
|
8367
8376
|
"border-grey-5": disabled
|
8368
8377
|
})
|
8369
8378
|
}, /* @__PURE__ */ React34.createElement("input", __spreadProps(__spreadValues({
|
@@ -8374,8 +8383,8 @@ var Checkbox = React34.forwardRef(
|
|
8374
8383
|
}, props), {
|
8375
8384
|
className: classNames(
|
8376
8385
|
tw("peer appearance-none outline-none w-5 h-5", "rounded-sm border border-transparent", {
|
8377
|
-
"cursor-pointer checked:bg-
|
8378
|
-
"cursor-not-allowed bg-grey-0
|
8386
|
+
"cursor-pointer checked:bg-navyBlue-100": !disabled,
|
8387
|
+
"cursor-not-allowed bg-grey-0": disabled
|
8379
8388
|
})
|
8380
8389
|
),
|
8381
8390
|
readOnly,
|
@@ -8390,8 +8399,8 @@ var Checkbox = React34.forwardRef(
|
|
8390
8399
|
"rounded-sm border border-grey-20 peer-focus:border-info-70"
|
8391
8400
|
),
|
8392
8401
|
{
|
8393
|
-
"peer-hover:border-grey-50 peer-checked:text-white peer-checked:[&>path]:stroke-white peer-checked:border-
|
8394
|
-
"border-grey-5 peer-checked:text-
|
8402
|
+
"peer-hover:border-grey-50 peer-checked:text-white peer-checked:[&>path]:stroke-white peer-checked:border-navyBlue-100": !disabled,
|
8403
|
+
"border-grey-5 peer-checked:text-grey-30 peer-checked:[&>path]:stroke-grey-30": disabled
|
8395
8404
|
}
|
8396
8405
|
)
|
8397
8406
|
}));
|
@@ -9125,7 +9134,7 @@ var Container2 = ({ maxWidth = "xl", children }) => /* @__PURE__ */ React47.crea
|
|
9125
9134
|
}, children);
|
9126
9135
|
|
9127
9136
|
// src/molecules/DataList/DataList.tsx
|
9128
|
-
import
|
9137
|
+
import React59 from "react";
|
9129
9138
|
import compact from "lodash/compact";
|
9130
9139
|
import isFunction from "lodash/isFunction";
|
9131
9140
|
|
@@ -9641,10 +9650,10 @@ var RadioButton = React54.forwardRef(
|
|
9641
9650
|
tw(
|
9642
9651
|
"inline-flex justify-center items-center self-center appearance-none",
|
9643
9652
|
"w-5 h-5 p-[3px] rounded-full cursor-pointer border border-grey-20",
|
9644
|
-
"outline-none focus:border-info-70 checked:bg-
|
9653
|
+
"outline-none focus:border-info-70 checked:bg-navyBlue-100 checked:shadow-whiteInset",
|
9645
9654
|
{
|
9646
|
-
"hover:border-grey-50 checked:border-
|
9647
|
-
"cursor-not-allowed border-grey-5 bg-grey-0 checked:bg-opacity-40
|
9655
|
+
"hover:border-grey-50 checked:border-navyBlue-100": !disabled,
|
9656
|
+
"cursor-not-allowed border-grey-5 bg-grey-0 checked:bg-opacity-40": disabled
|
9648
9657
|
}
|
9649
9658
|
)
|
9650
9659
|
),
|
@@ -9916,13 +9925,43 @@ var sortRowsBy = (rows, sort) => {
|
|
9916
9925
|
|
9917
9926
|
// src/molecules/DataList/DataList.tsx
|
9918
9927
|
var import_more2 = __toESM(require_more());
|
9928
|
+
|
9929
|
+
// src/molecules/DataList/DataListSkeleton.tsx
|
9930
|
+
import React58 from "react";
|
9931
|
+
var DataListSkeleton = ({ columns = ["1", "2", "2", 52], rows = 5 }) => {
|
9932
|
+
const columnsAmount = [...Array(typeof columns === "number" ? columns : columns.length).keys()];
|
9933
|
+
return /* @__PURE__ */ React58.createElement(Template, {
|
9934
|
+
columns
|
9935
|
+
}, columnsAmount.map((_, index) => /* @__PURE__ */ React58.createElement(DataList.HeadCell, {
|
9936
|
+
key: index
|
9937
|
+
}, /* @__PURE__ */ React58.createElement(Skeleton, {
|
9938
|
+
width: "100%",
|
9939
|
+
height: 17.5
|
9940
|
+
}))), /* @__PURE__ */ React58.createElement(List2, {
|
9941
|
+
items: [...Array(rows).keys()],
|
9942
|
+
renderItem: (item) => /* @__PURE__ */ React58.createElement(DataList.Row, {
|
9943
|
+
key: item
|
9944
|
+
}, /* @__PURE__ */ React58.createElement(List2, {
|
9945
|
+
items: columnsAmount,
|
9946
|
+
renderItem: (key) => /* @__PURE__ */ React58.createElement(DataList.Cell, {
|
9947
|
+
key
|
9948
|
+
}, /* @__PURE__ */ React58.createElement(Skeleton, {
|
9949
|
+
width: "100%",
|
9950
|
+
height: 17.5
|
9951
|
+
}))
|
9952
|
+
}))
|
9953
|
+
}));
|
9954
|
+
};
|
9955
|
+
|
9956
|
+
// src/molecules/DataList/DataList.tsx
|
9919
9957
|
var DataList2 = ({
|
9920
9958
|
columns,
|
9921
9959
|
rows,
|
9922
9960
|
sticky,
|
9923
9961
|
menu,
|
9924
9962
|
menuLabel = "Context menu",
|
9925
|
-
onAction
|
9963
|
+
onAction,
|
9964
|
+
onMenuOpenChange
|
9926
9965
|
}) => {
|
9927
9966
|
const [sort, updateSort] = useTableSort();
|
9928
9967
|
const sortedRows = sortRowsBy(rows, sort);
|
@@ -9933,55 +9972,57 @@ var DataList2 = ({
|
|
9933
9972
|
}),
|
9934
9973
|
menu ? "auto" : void 0
|
9935
9974
|
]);
|
9936
|
-
return /* @__PURE__ */
|
9975
|
+
return /* @__PURE__ */ React59.createElement(Template, {
|
9937
9976
|
className: "Aquarium-DataList",
|
9938
9977
|
columns: templateColumns
|
9939
9978
|
}, columns.map(
|
9940
|
-
(column) => columnIsFieldColumn(column) && column.sortable || column.sort ? /* @__PURE__ */
|
9979
|
+
(column) => columnIsFieldColumn(column) && column.sortable || column.sort ? /* @__PURE__ */ React59.createElement(DataList.SortCell, __spreadValues({
|
9941
9980
|
direction: sort && sort.column.headerName === column.headerName ? sort.direction : "none",
|
9942
9981
|
onClick: () => updateSort(column),
|
9943
9982
|
sticky
|
9944
|
-
}, cellProps(column)), column.headerName) : /* @__PURE__ */
|
9983
|
+
}, cellProps(column)), column.headerName) : /* @__PURE__ */ React59.createElement(DataList.HeadCell, __spreadProps(__spreadValues({}, cellProps(column)), {
|
9945
9984
|
sticky
|
9946
9985
|
}), column.headerName)
|
9947
|
-
), menu && /* @__PURE__ */
|
9986
|
+
), menu && /* @__PURE__ */ React59.createElement(DataList.HeadCell, {
|
9948
9987
|
align: "right",
|
9949
9988
|
"aria-label": menuLabel
|
9950
|
-
}), /* @__PURE__ */
|
9989
|
+
}), /* @__PURE__ */ React59.createElement(List2, {
|
9951
9990
|
items: sortedRows,
|
9952
|
-
renderItem: (row, index) => /* @__PURE__ */
|
9991
|
+
renderItem: (row, index) => /* @__PURE__ */ React59.createElement(DataList.Row, {
|
9953
9992
|
key: row.id
|
9954
|
-
}, /* @__PURE__ */
|
9993
|
+
}, /* @__PURE__ */ React59.createElement(List2, {
|
9955
9994
|
items: columns,
|
9956
|
-
renderItem: (column) => column.type === "status" ? /* @__PURE__ */
|
9995
|
+
renderItem: (column) => column.type === "status" ? /* @__PURE__ */ React59.createElement(DataList.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React59.createElement(StatusChip, __spreadValues({
|
9957
9996
|
dense: true
|
9958
|
-
}, column.status(row, index, sortedRows)))) : column.type === "action" ? /* @__PURE__ */
|
9997
|
+
}, column.status(row, index, sortedRows)))) : column.type === "action" ? /* @__PURE__ */ React59.createElement(DataList.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React59.createElement(Button.Secondary, __spreadValues({
|
9959
9998
|
dense: true
|
9960
|
-
}, renameProperty("text", "children", column.action(row, index, sortedRows))))) : column.type === "custom" ? /* @__PURE__ */
|
9961
|
-
}), menu && /* @__PURE__ */
|
9999
|
+
}, renameProperty("text", "children", column.action(row, index, sortedRows))))) : column.type === "custom" ? /* @__PURE__ */ React59.createElement(DataList.Cell, __spreadValues({}, cellProps(column)), column.UNSAFE_render(row, index, sortedRows)) : column.type === "item" ? /* @__PURE__ */ React59.createElement(DataList.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React59.createElement(Item4, __spreadValues({}, column.item(row, index, sortedRows)))) : /* @__PURE__ */ React59.createElement(DataList.Cell, __spreadValues({}, cellProps(column)), column.formatter ? column.formatter(row[column.field], row, index, sortedRows) : row[column.field])
|
10000
|
+
}), menu && /* @__PURE__ */ React59.createElement(DataList.Cell, {
|
9962
10001
|
align: "right"
|
9963
|
-
}, /* @__PURE__ */
|
9964
|
-
onAction: (action) => onAction == null ? void 0 : onAction(action, row, index)
|
9965
|
-
|
10002
|
+
}, /* @__PURE__ */ React59.createElement(DropdownMenu2, {
|
10003
|
+
onAction: (action) => onAction == null ? void 0 : onAction(action, row, index),
|
10004
|
+
onOpenChange: onMenuOpenChange
|
10005
|
+
}, /* @__PURE__ */ React59.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ React59.createElement(Button.Icon, {
|
9966
10006
|
"aria-label": menuLabel,
|
9967
10007
|
icon: import_more2.default
|
9968
10008
|
})), isFunction(menu) ? menu(row, index) : menu)))
|
9969
10009
|
}));
|
9970
10010
|
};
|
10011
|
+
DataList2.Skeleton = DataListSkeleton;
|
9971
10012
|
|
9972
10013
|
// src/molecules/DataTable/DataTable.tsx
|
9973
|
-
import
|
10014
|
+
import React62 from "react";
|
9974
10015
|
import compact2 from "lodash/compact";
|
9975
10016
|
import isFunction2 from "lodash/isFunction";
|
9976
10017
|
|
9977
10018
|
// src/molecules/Table/Table.tsx
|
9978
|
-
import
|
10019
|
+
import React61 from "react";
|
9979
10020
|
|
9980
10021
|
// src/utils/table/useScrollTarget.ts
|
9981
|
-
import
|
10022
|
+
import React60 from "react";
|
9982
10023
|
var useScrollTarget = (callback) => {
|
9983
|
-
const targetRef =
|
9984
|
-
|
10024
|
+
const targetRef = React60.useRef(null);
|
10025
|
+
React60.useLayoutEffect(() => {
|
9985
10026
|
const observer = new IntersectionObserver((entries) => entries[0].isIntersecting && callback && callback(), {
|
9986
10027
|
root: null,
|
9987
10028
|
rootMargin: `0px 0px 200px 0px`
|
@@ -9999,12 +10040,12 @@ var Table2 = (_a) => {
|
|
9999
10040
|
var _b = _a, { children, onPrev, onNext } = _b, rest = __objRest(_b, ["children", "onPrev", "onNext"]);
|
10000
10041
|
const bottomRef = useScrollTarget(onNext);
|
10001
10042
|
const topRef = useScrollTarget(onPrev);
|
10002
|
-
return /* @__PURE__ */
|
10043
|
+
return /* @__PURE__ */ React61.createElement("div", {
|
10003
10044
|
className: classNames("Aquarium-Table", tw("relative w-full"))
|
10004
|
-
}, /* @__PURE__ */
|
10045
|
+
}, /* @__PURE__ */ React61.createElement("div", {
|
10005
10046
|
ref: topRef,
|
10006
10047
|
className: tw("absolute top-0 h-1 w-full left-0 bg-transparent")
|
10007
|
-
}), /* @__PURE__ */
|
10048
|
+
}), /* @__PURE__ */ React61.createElement(Table, __spreadValues({}, rest), children), /* @__PURE__ */ React61.createElement("div", {
|
10008
10049
|
ref: bottomRef,
|
10009
10050
|
className: tw("absolute bottom-0 h-1 w-full left-0 bg-transparent")
|
10010
10051
|
}));
|
@@ -10027,7 +10068,8 @@ var DataTable = (_a) => {
|
|
10027
10068
|
sticky,
|
10028
10069
|
menu,
|
10029
10070
|
menuLabel = "Context menu",
|
10030
|
-
onAction
|
10071
|
+
onAction,
|
10072
|
+
onMenuOpenChange
|
10031
10073
|
} = _b, rest = __objRest(_b, [
|
10032
10074
|
"columns",
|
10033
10075
|
"rows",
|
@@ -10036,11 +10078,12 @@ var DataTable = (_a) => {
|
|
10036
10078
|
"sticky",
|
10037
10079
|
"menu",
|
10038
10080
|
"menuLabel",
|
10039
|
-
"onAction"
|
10081
|
+
"onAction",
|
10082
|
+
"onMenuOpenChange"
|
10040
10083
|
]);
|
10041
10084
|
const [sort, updateSort] = useTableSort();
|
10042
10085
|
const sortedRows = sortRowsBy(rows, sort);
|
10043
|
-
return /* @__PURE__ */
|
10086
|
+
return /* @__PURE__ */ React62.createElement(Table2, __spreadProps(__spreadValues({}, rest), {
|
10044
10087
|
className: classNames(
|
10045
10088
|
"Aquarium-DataTable",
|
10046
10089
|
tw({
|
@@ -10049,49 +10092,51 @@ var DataTable = (_a) => {
|
|
10049
10092
|
"table-fixed": layout === "fixed"
|
10050
10093
|
})
|
10051
10094
|
)
|
10052
|
-
}), /* @__PURE__ */
|
10095
|
+
}), /* @__PURE__ */ React62.createElement(Table2.Head, {
|
10053
10096
|
sticky
|
10054
10097
|
}, compact2([
|
10055
10098
|
...columns.map(
|
10056
|
-
(column) => columnIsFieldColumn(column) && column.sortable || column.sort ? /* @__PURE__ */
|
10099
|
+
(column) => columnIsFieldColumn(column) && column.sortable || column.sort ? /* @__PURE__ */ React62.createElement(Table2.SortCell, __spreadValues({
|
10057
10100
|
direction: sort && sort.column.headerName === column.headerName ? sort.direction : "none",
|
10058
10101
|
onClick: () => updateSort(column),
|
10059
10102
|
style: { width: column.width },
|
10060
10103
|
"aria-label": column.headerInvisible ? column.headerName : void 0
|
10061
|
-
}, cellProps(column)), !column.headerInvisible && column.headerName) : /* @__PURE__ */
|
10104
|
+
}, cellProps(column)), !column.headerInvisible && column.headerName) : /* @__PURE__ */ React62.createElement(Table2.Cell, __spreadProps(__spreadValues({}, cellProps(column)), {
|
10062
10105
|
style: { width: column.width },
|
10063
10106
|
"aria-label": column.headerInvisible ? column.headerName : void 0
|
10064
10107
|
}), !column.headerInvisible && column.headerName)
|
10065
10108
|
),
|
10066
|
-
menu ? /* @__PURE__ */
|
10109
|
+
menu ? /* @__PURE__ */ React62.createElement(Table2.Cell, {
|
10067
10110
|
key: "__contextMenu",
|
10068
10111
|
align: "right",
|
10069
10112
|
"aria-label": menuLabel
|
10070
10113
|
}) : null
|
10071
|
-
])), /* @__PURE__ */
|
10114
|
+
])), /* @__PURE__ */ React62.createElement(Table2.Body, null, /* @__PURE__ */ React62.createElement(List2, {
|
10072
10115
|
items: sortedRows,
|
10073
|
-
renderItem: (row, index) => /* @__PURE__ */
|
10116
|
+
renderItem: (row, index) => /* @__PURE__ */ React62.createElement(Table2.Row, {
|
10074
10117
|
key: row.id
|
10075
|
-
}, /* @__PURE__ */
|
10118
|
+
}, /* @__PURE__ */ React62.createElement(List2, {
|
10076
10119
|
items: columns,
|
10077
|
-
renderItem: (column) => column.type === "status" ? /* @__PURE__ */
|
10120
|
+
renderItem: (column) => column.type === "status" ? /* @__PURE__ */ React62.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React62.createElement(StatusChip, __spreadValues({
|
10078
10121
|
dense: true
|
10079
|
-
}, column.status(row, index, sortedRows)))) : column.type === "action" ? /* @__PURE__ */
|
10122
|
+
}, column.status(row, index, sortedRows)))) : column.type === "action" ? /* @__PURE__ */ React62.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React62.createElement(Button.Secondary, __spreadValues({
|
10080
10123
|
dense: true
|
10081
|
-
}, renameProperty("text", "children", column.action(row, index, sortedRows))))) : column.type === "custom" ? /* @__PURE__ */
|
10082
|
-
}), menu && /* @__PURE__ */
|
10124
|
+
}, renameProperty("text", "children", column.action(row, index, sortedRows))))) : column.type === "custom" ? /* @__PURE__ */ React62.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), column.UNSAFE_render(row, index, sortedRows)) : column.type === "item" ? /* @__PURE__ */ React62.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React62.createElement(Item4, __spreadValues({}, column.item(row, index, sortedRows)))) : /* @__PURE__ */ React62.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), column.formatter ? column.formatter(row[column.field], row, index, sortedRows) : row[column.field])
|
10125
|
+
}), menu && /* @__PURE__ */ React62.createElement(Table2.Cell, {
|
10083
10126
|
align: "right"
|
10084
|
-
}, /* @__PURE__ */
|
10085
|
-
onAction: (action) => onAction == null ? void 0 : onAction(action, row, index)
|
10086
|
-
|
10127
|
+
}, /* @__PURE__ */ React62.createElement(DropdownMenu2, {
|
10128
|
+
onAction: (action) => onAction == null ? void 0 : onAction(action, row, index),
|
10129
|
+
onOpenChange: onMenuOpenChange
|
10130
|
+
}, /* @__PURE__ */ React62.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ React62.createElement(Button.Icon, {
|
10087
10131
|
"aria-label": menuLabel,
|
10088
10132
|
icon: import_more3.default
|
10089
10133
|
})), isFunction2(menu) ? menu(row, index) : menu)))
|
10090
10134
|
})));
|
10091
10135
|
};
|
10136
|
+
DataTable.Skeleton = DataListSkeleton;
|
10092
10137
|
|
10093
10138
|
// src/molecules/Dialog/Dialog.tsx
|
10094
|
-
import
|
10139
|
+
import React64 from "react";
|
10095
10140
|
import { useDialog } from "@react-aria/dialog";
|
10096
10141
|
import { Overlay as Overlay2, useModalOverlay } from "@react-aria/overlays";
|
10097
10142
|
import { useId } from "@react-aria/utils";
|
@@ -10118,10 +10163,10 @@ var DIALOG_ICONS_AND_COLORS = {
|
|
10118
10163
|
};
|
10119
10164
|
|
10120
10165
|
// src/atoms/Modal/Modal.tsx
|
10121
|
-
import
|
10166
|
+
import React63 from "react";
|
10122
10167
|
var Modal = (_a) => {
|
10123
10168
|
var _b = _a, { children, className, open } = _b, rest = __objRest(_b, ["children", "className", "open"]);
|
10124
|
-
return open ? /* @__PURE__ */
|
10169
|
+
return open ? /* @__PURE__ */ React63.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
10125
10170
|
className: classNames(
|
10126
10171
|
tw("inset-0 overflow-y-auto z-modal flex justify-center items-center fixed py-7"),
|
10127
10172
|
className
|
@@ -10130,14 +10175,14 @@ var Modal = (_a) => {
|
|
10130
10175
|
};
|
10131
10176
|
Modal.BackDrop = (_a) => {
|
10132
10177
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
10133
|
-
return /* @__PURE__ */
|
10178
|
+
return /* @__PURE__ */ React63.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
10134
10179
|
className: classNames(tw("-z-10 fixed min-w-full min-h-full bg-navyBlue-100 opacity-70"), className)
|
10135
10180
|
}));
|
10136
10181
|
};
|
10137
|
-
Modal.Dialog =
|
10182
|
+
Modal.Dialog = React63.forwardRef(
|
10138
10183
|
(_a, ref) => {
|
10139
10184
|
var _b = _a, { children, className, size = "sm" } = _b, rest = __objRest(_b, ["children", "className", "size"]);
|
10140
|
-
return /* @__PURE__ */
|
10185
|
+
return /* @__PURE__ */ React63.createElement("div", __spreadProps(__spreadValues({
|
10141
10186
|
ref,
|
10142
10187
|
"aria-modal": "true"
|
10143
10188
|
}, rest), {
|
@@ -10155,31 +10200,31 @@ Modal.Dialog = React62.forwardRef(
|
|
10155
10200
|
);
|
10156
10201
|
Modal.Header = (_a) => {
|
10157
10202
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
10158
|
-
return /* @__PURE__ */
|
10203
|
+
return /* @__PURE__ */ React63.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
10159
10204
|
className: classNames(tw("px-7 py-6 gap-3 flex items-center"), className)
|
10160
10205
|
}), children);
|
10161
10206
|
};
|
10162
10207
|
Modal.HeaderImage = (_a) => {
|
10163
10208
|
var _b = _a, { backgroundImage, className } = _b, rest = __objRest(_b, ["backgroundImage", "className"]);
|
10164
10209
|
const common = tw("h-[120px] min-h-[120px] w-full ");
|
10165
|
-
return backgroundImage ? /* @__PURE__ */
|
10210
|
+
return backgroundImage ? /* @__PURE__ */ React63.createElement("img", __spreadProps(__spreadValues({
|
10166
10211
|
"aria-hidden": true,
|
10167
10212
|
src: backgroundImage != null ? backgroundImage : void 0
|
10168
10213
|
}, rest), {
|
10169
10214
|
className: classNames(common, tw("object-cover"), className)
|
10170
|
-
})) : /* @__PURE__ */
|
10215
|
+
})) : /* @__PURE__ */ React63.createElement("div", {
|
10171
10216
|
className: classNames(common, tw("bg-grey-5"), className)
|
10172
10217
|
});
|
10173
10218
|
};
|
10174
10219
|
Modal.CloseButtonContainer = (_a) => {
|
10175
10220
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
10176
|
-
return /* @__PURE__ */
|
10221
|
+
return /* @__PURE__ */ React63.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
10177
10222
|
className: classNames(tw("absolute top-[20px] right-[28px]"), className)
|
10178
10223
|
}));
|
10179
10224
|
};
|
10180
10225
|
Modal.Title = (_a) => {
|
10181
10226
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
10182
|
-
return /* @__PURE__ */
|
10227
|
+
return /* @__PURE__ */ React63.createElement(Typography, __spreadValues({
|
10183
10228
|
htmlTag: "h2",
|
10184
10229
|
variant: "subheading",
|
10185
10230
|
color: "grey-90",
|
@@ -10188,52 +10233,52 @@ Modal.Title = (_a) => {
|
|
10188
10233
|
};
|
10189
10234
|
Modal.Subtitle = (_a) => {
|
10190
10235
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
10191
|
-
return /* @__PURE__ */
|
10236
|
+
return /* @__PURE__ */ React63.createElement(Typography, __spreadValues({
|
10192
10237
|
variant: "small",
|
10193
10238
|
color: "grey-60"
|
10194
10239
|
}, rest), children);
|
10195
10240
|
};
|
10196
10241
|
Modal.TitleContainer = (_a) => {
|
10197
10242
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
10198
|
-
return /* @__PURE__ */
|
10243
|
+
return /* @__PURE__ */ React63.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
10199
10244
|
className: classNames(tw("flex flex-col grow gap-2"), className)
|
10200
10245
|
}), children);
|
10201
10246
|
};
|
10202
10247
|
Modal.Body = (_a) => {
|
10203
10248
|
var _b = _a, { children, className, noFooter = false, maxHeight, style } = _b, rest = __objRest(_b, ["children", "className", "noFooter", "maxHeight", "style"]);
|
10204
|
-
return /* @__PURE__ */
|
10249
|
+
return /* @__PURE__ */ React63.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
10205
10250
|
className: classNames(tw("px-7 grow overflow-y-auto", { "pb-6": noFooter }), className),
|
10206
10251
|
style: __spreadValues({ maxHeight }, style)
|
10207
10252
|
}), children);
|
10208
10253
|
};
|
10209
10254
|
Modal.Footer = (_a) => {
|
10210
10255
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
10211
|
-
return /* @__PURE__ */
|
10256
|
+
return /* @__PURE__ */ React63.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
10212
10257
|
className: classNames(tw("px-7 py-6"), className)
|
10213
10258
|
}), children);
|
10214
10259
|
};
|
10215
10260
|
Modal.Actions = (_a) => {
|
10216
10261
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
10217
|
-
return /* @__PURE__ */
|
10262
|
+
return /* @__PURE__ */ React63.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
10218
10263
|
className: classNames(tw("flex gap-4 justify-end"), className)
|
10219
10264
|
}), children);
|
10220
10265
|
};
|
10221
10266
|
|
10222
10267
|
// src/molecules/Dialog/Dialog.tsx
|
10223
10268
|
var Dialog = (props) => {
|
10224
|
-
const ref =
|
10269
|
+
const ref = React64.useRef(null);
|
10225
10270
|
const state = useOverlayTriggerState2({ isOpen: props.open });
|
10226
10271
|
const { modalProps, underlayProps } = useModalOverlay({}, state, ref);
|
10227
10272
|
if (!state.isOpen) {
|
10228
10273
|
return null;
|
10229
10274
|
}
|
10230
|
-
return /* @__PURE__ */
|
10275
|
+
return /* @__PURE__ */ React64.createElement(Overlay2, null, /* @__PURE__ */ React64.createElement(Modal, {
|
10231
10276
|
className: "Aquarium-Dialog",
|
10232
10277
|
open: true
|
10233
|
-
}, /* @__PURE__ */
|
10278
|
+
}, /* @__PURE__ */ React64.createElement(Modal.BackDrop, __spreadValues({}, underlayProps)), /* @__PURE__ */ React64.createElement(Modal.Dialog, __spreadValues({
|
10234
10279
|
ref,
|
10235
10280
|
size: "sm"
|
10236
|
-
}, modalProps), /* @__PURE__ */
|
10281
|
+
}, modalProps), /* @__PURE__ */ React64.createElement(DialogWrapper, __spreadValues({}, props)))));
|
10237
10282
|
};
|
10238
10283
|
var DialogWrapper = ({
|
10239
10284
|
title,
|
@@ -10242,36 +10287,36 @@ var DialogWrapper = ({
|
|
10242
10287
|
primaryAction,
|
10243
10288
|
secondaryAction
|
10244
10289
|
}) => {
|
10245
|
-
const ref =
|
10290
|
+
const ref = React64.useRef(null);
|
10246
10291
|
const labelledBy = useId();
|
10247
10292
|
const describedBy = useId();
|
10248
10293
|
const { dialogProps } = useDialog(
|
10249
10294
|
{ "role": "alertdialog", "aria-labelledby": labelledBy, "aria-describedby": describedBy },
|
10250
10295
|
ref
|
10251
10296
|
);
|
10252
|
-
return /* @__PURE__ */
|
10297
|
+
return /* @__PURE__ */ React64.createElement("div", __spreadProps(__spreadValues({
|
10253
10298
|
ref
|
10254
10299
|
}, dialogProps), {
|
10255
10300
|
className: tw("outline-none")
|
10256
|
-
}), /* @__PURE__ */
|
10301
|
+
}), /* @__PURE__ */ React64.createElement(Modal.Header, null, /* @__PURE__ */ React64.createElement(Icon, {
|
10257
10302
|
icon: DIALOG_ICONS_AND_COLORS[type].icon,
|
10258
10303
|
color: DIALOG_ICONS_AND_COLORS[type].color,
|
10259
10304
|
fontSize: 20
|
10260
|
-
}), /* @__PURE__ */
|
10305
|
+
}), /* @__PURE__ */ React64.createElement(Modal.Title, {
|
10261
10306
|
id: labelledBy,
|
10262
10307
|
variant: "large-strong",
|
10263
10308
|
color: DIALOG_ICONS_AND_COLORS[type].color
|
10264
|
-
}, title)), /* @__PURE__ */
|
10309
|
+
}, title)), /* @__PURE__ */ React64.createElement(Modal.Body, {
|
10265
10310
|
id: describedBy
|
10266
|
-
}, children), /* @__PURE__ */
|
10311
|
+
}, children), /* @__PURE__ */ React64.createElement(Modal.Footer, null, /* @__PURE__ */ React64.createElement(Modal.Actions, null, secondaryAction && /* @__PURE__ */ React64.createElement(Button.Ghost, __spreadValues({
|
10267
10312
|
key: secondaryAction.text
|
10268
|
-
}, omit8(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */
|
10313
|
+
}, omit8(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */ React64.createElement(Button.Secondary, __spreadValues({
|
10269
10314
|
key: primaryAction.text
|
10270
10315
|
}, omit8(primaryAction, "text")), primaryAction.text))));
|
10271
10316
|
};
|
10272
10317
|
|
10273
10318
|
// src/molecules/Divider/Divider.tsx
|
10274
|
-
import
|
10319
|
+
import React65 from "react";
|
10275
10320
|
var sizeClasses = {
|
10276
10321
|
horizontal: {
|
10277
10322
|
1: "h-1px",
|
@@ -10293,7 +10338,7 @@ var sizeClasses = {
|
|
10293
10338
|
var Divider2 = (_a) => {
|
10294
10339
|
var _b = _a, { direction = "horizontal", size = 1 } = _b, props = __objRest(_b, ["direction", "size"]);
|
10295
10340
|
const sizeClass = sizeClasses[direction][size];
|
10296
|
-
return /* @__PURE__ */
|
10341
|
+
return /* @__PURE__ */ React65.createElement("div", __spreadProps(__spreadValues({}, props), {
|
10297
10342
|
className: classNames(
|
10298
10343
|
"Aquarium-Divider",
|
10299
10344
|
tw(`bg-grey-5 ${sizeClass}`, {
|
@@ -10305,10 +10350,10 @@ var Divider2 = (_a) => {
|
|
10305
10350
|
};
|
10306
10351
|
|
10307
10352
|
// src/molecules/Dropdown/Dropdown.tsx
|
10308
|
-
import
|
10353
|
+
import React68 from "react";
|
10309
10354
|
|
10310
10355
|
// src/molecules/Popover/Popover.tsx
|
10311
|
-
import
|
10356
|
+
import React67, { useRef as useRef7 } from "react";
|
10312
10357
|
import { PressResponder as PressResponder2, usePress as usePress2 } from "@react-aria/interactions";
|
10313
10358
|
import { useOverlayTrigger } from "@react-aria/overlays";
|
10314
10359
|
import { mergeProps as mergeProps3 } from "@react-aria/utils";
|
@@ -10316,12 +10361,12 @@ import { useOverlayTriggerState as useOverlayTriggerState3 } from "@react-statel
|
|
10316
10361
|
import classNames7 from "classnames";
|
10317
10362
|
|
10318
10363
|
// src/molecules/Popover/Dialog.tsx
|
10319
|
-
import
|
10364
|
+
import React66 from "react";
|
10320
10365
|
import { useDialog as useDialog2 } from "@react-aria/dialog";
|
10321
10366
|
var Dialog2 = ({ children }) => {
|
10322
|
-
const ref =
|
10367
|
+
const ref = React66.useRef(null);
|
10323
10368
|
const { dialogProps } = useDialog2({}, ref);
|
10324
|
-
return /* @__PURE__ */
|
10369
|
+
return /* @__PURE__ */ React66.createElement("div", __spreadProps(__spreadValues({
|
10325
10370
|
ref
|
10326
10371
|
}, dialogProps), {
|
10327
10372
|
className: tw("outline-none")
|
@@ -10355,21 +10400,21 @@ var Popover2 = (props) => {
|
|
10355
10400
|
const triggerRef = useRef7(null);
|
10356
10401
|
const state = useOverlayTriggerState3(props);
|
10357
10402
|
const { triggerProps, overlayProps } = useOverlayTrigger({ type: type != null ? type : "dialog" }, state, triggerRef);
|
10358
|
-
return /* @__PURE__ */
|
10403
|
+
return /* @__PURE__ */ React67.createElement(PopoverContext.Provider, {
|
10359
10404
|
value: {
|
10360
10405
|
state
|
10361
10406
|
}
|
10362
|
-
},
|
10407
|
+
}, React67.Children.map(props.children, (child) => {
|
10363
10408
|
if (isComponentType(child, Popover2.Trigger)) {
|
10364
|
-
return /* @__PURE__ */
|
10409
|
+
return /* @__PURE__ */ React67.createElement(PressResponder2, __spreadValues({
|
10365
10410
|
ref: triggerRef
|
10366
|
-
}, triggerProps), /* @__PURE__ */
|
10411
|
+
}, triggerProps), /* @__PURE__ */ React67.createElement(PopoverTriggerWrapper, {
|
10367
10412
|
"data-testid": props["data-testid"],
|
10368
10413
|
"aria-controls": id
|
10369
10414
|
}, child.props.children));
|
10370
10415
|
}
|
10371
10416
|
if (isComponentType(child, Popover2.Panel)) {
|
10372
|
-
return state.isOpen && /* @__PURE__ */
|
10417
|
+
return state.isOpen && /* @__PURE__ */ React67.createElement(PopoverOverlay, __spreadValues({
|
10373
10418
|
triggerRef: targetRef != null ? targetRef : triggerRef,
|
10374
10419
|
state,
|
10375
10420
|
placement,
|
@@ -10380,7 +10425,7 @@ var Popover2 = (props) => {
|
|
10380
10425
|
offset,
|
10381
10426
|
crossOffset,
|
10382
10427
|
shouldFlip
|
10383
|
-
}, overlayProps), containFocus ? /* @__PURE__ */
|
10428
|
+
}, overlayProps), containFocus ? /* @__PURE__ */ React67.createElement(Dialog2, null, child.props.children) : child.props.children);
|
10384
10429
|
}
|
10385
10430
|
throw new Error("Invalid children element type");
|
10386
10431
|
}));
|
@@ -10399,7 +10444,7 @@ var asPopoverButton = (Component, displayName) => {
|
|
10399
10444
|
state.close();
|
10400
10445
|
onClick == null ? void 0 : onClick(e);
|
10401
10446
|
};
|
10402
|
-
return /* @__PURE__ */
|
10447
|
+
return /* @__PURE__ */ React67.createElement(Component, __spreadProps(__spreadValues({}, props), {
|
10403
10448
|
onClick: handleClick
|
10404
10449
|
}));
|
10405
10450
|
};
|
@@ -10412,9 +10457,9 @@ var PopoverTriggerWrapper = (_a) => {
|
|
10412
10457
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
10413
10458
|
var _a2;
|
10414
10459
|
const ref = useRef7(null);
|
10415
|
-
const trigger =
|
10460
|
+
const trigger = React67.Children.only(children);
|
10416
10461
|
const { pressProps } = usePress2(__spreadProps(__spreadValues({}, rest), { ref }));
|
10417
|
-
return
|
10462
|
+
return React67.cloneElement(trigger, __spreadProps(__spreadValues({
|
10418
10463
|
"ref": ref
|
10419
10464
|
}, mergeProps3(pressProps, trigger.props)), {
|
10420
10465
|
"aria-controls": (_a2 = rest["aria-controls"]) != null ? _a2 : pressProps["aria-controls"]
|
@@ -10423,10 +10468,10 @@ var PopoverTriggerWrapper = (_a) => {
|
|
10423
10468
|
|
10424
10469
|
// src/molecules/Dropdown/Dropdown.tsx
|
10425
10470
|
var Dropdown = ({ children, content, placement = "bottom-left" }) => {
|
10426
|
-
return /* @__PURE__ */
|
10471
|
+
return /* @__PURE__ */ React68.createElement(Popover2, {
|
10427
10472
|
type: "menu",
|
10428
10473
|
placement
|
10429
|
-
}, /* @__PURE__ */
|
10474
|
+
}, /* @__PURE__ */ React68.createElement(Popover2.Trigger, null, children), /* @__PURE__ */ React68.createElement(Popover2.Panel, {
|
10430
10475
|
className: "Aquarium-Dropdown"
|
10431
10476
|
}, content));
|
10432
10477
|
};
|
@@ -10437,26 +10482,26 @@ var DropdownMenu3 = ({
|
|
10437
10482
|
triggerId,
|
10438
10483
|
setClose = () => void 0
|
10439
10484
|
}) => {
|
10440
|
-
const menuRef =
|
10441
|
-
|
10485
|
+
const menuRef = React68.useRef(null);
|
10486
|
+
React68.useEffect(() => {
|
10442
10487
|
const id = setTimeout(() => {
|
10443
10488
|
var _a, _b, _c;
|
10444
10489
|
return (_c = (_b = (_a = menuRef.current) == null ? void 0 : _a.children) == null ? void 0 : _b[0]) == null ? void 0 : _c.focus();
|
10445
10490
|
});
|
10446
10491
|
return () => clearTimeout(id);
|
10447
10492
|
}, [menuRef.current]);
|
10448
|
-
return /* @__PURE__ */
|
10493
|
+
return /* @__PURE__ */ React68.createElement("div", {
|
10449
10494
|
style: { minWidth: "250px" },
|
10450
10495
|
className: tw("py-3 bg-white")
|
10451
|
-
}, !!title && /* @__PURE__ */
|
10496
|
+
}, !!title && /* @__PURE__ */ React68.createElement("div", {
|
10452
10497
|
className: tw("px-4 py-4 text-left text-grey-100 typography-default-strong")
|
10453
|
-
}, title), /* @__PURE__ */
|
10498
|
+
}, title), /* @__PURE__ */ React68.createElement("ol", {
|
10454
10499
|
role: "menu",
|
10455
10500
|
ref: menuRef,
|
10456
10501
|
id: contentId,
|
10457
10502
|
"aria-labelledby": triggerId
|
10458
|
-
},
|
10459
|
-
return
|
10503
|
+
}, React68.Children.map(children, (child) => {
|
10504
|
+
return React68.cloneElement(child, { setClose });
|
10460
10505
|
})));
|
10461
10506
|
};
|
10462
10507
|
var DropdownItem = (_a) => {
|
@@ -10511,10 +10556,10 @@ var DropdownItem = (_a) => {
|
|
10511
10556
|
handleSelect();
|
10512
10557
|
}
|
10513
10558
|
};
|
10514
|
-
const itemContent = /* @__PURE__ */
|
10559
|
+
const itemContent = /* @__PURE__ */ React68.createElement("div", {
|
10515
10560
|
className: tw("py-3 px-4")
|
10516
10561
|
}, children);
|
10517
|
-
return /* @__PURE__ */
|
10562
|
+
return /* @__PURE__ */ React68.createElement("li", __spreadProps(__spreadValues({
|
10518
10563
|
role: "menuitem",
|
10519
10564
|
tabIndex: -1,
|
10520
10565
|
onClick: handleClick,
|
@@ -10525,11 +10570,11 @@ var DropdownItem = (_a) => {
|
|
10525
10570
|
"text-grey-10 cursor-not-allowed": disabled,
|
10526
10571
|
"text-primary-70 hover:text-primary-80": color === "danger" && !disabled
|
10527
10572
|
})
|
10528
|
-
}), tooltip ? /* @__PURE__ */
|
10573
|
+
}), tooltip ? /* @__PURE__ */ React68.createElement(Tooltip, {
|
10529
10574
|
content: tooltip,
|
10530
10575
|
placement: tooltipPlacement,
|
10531
10576
|
inline: false
|
10532
|
-
}, /* @__PURE__ */
|
10577
|
+
}, /* @__PURE__ */ React68.createElement("div", {
|
10533
10578
|
tabIndex: 0,
|
10534
10579
|
className: tw("grow")
|
10535
10580
|
}, itemContent)) : itemContent);
|
@@ -10538,11 +10583,11 @@ Dropdown.Menu = DropdownMenu3;
|
|
10538
10583
|
Dropdown.Item = DropdownItem;
|
10539
10584
|
|
10540
10585
|
// src/molecules/EmptyState/EmptyState.tsx
|
10541
|
-
import
|
10586
|
+
import React70 from "react";
|
10542
10587
|
import omit9 from "lodash/omit";
|
10543
10588
|
|
10544
10589
|
// src/molecules/Flexbox/FlexboxItem.tsx
|
10545
|
-
import
|
10590
|
+
import React69 from "react";
|
10546
10591
|
var FlexboxItem = Tailwindify(
|
10547
10592
|
({ htmlTag = "div", className, style, children, display, flex, grow, shrink, order, alignSelf }) => {
|
10548
10593
|
const hookStyle = useStyle({
|
@@ -10554,7 +10599,7 @@ var FlexboxItem = Tailwindify(
|
|
10554
10599
|
alignSelf
|
10555
10600
|
});
|
10556
10601
|
const HtmlElement = htmlTag;
|
10557
|
-
return /* @__PURE__ */
|
10602
|
+
return /* @__PURE__ */ React69.createElement(HtmlElement, {
|
10558
10603
|
style: __spreadValues(__spreadValues({}, hookStyle), style),
|
10559
10604
|
className
|
10560
10605
|
}, children);
|
@@ -10612,7 +10657,7 @@ var EmptyState = ({
|
|
10612
10657
|
borderStyle = "dashed"
|
10613
10658
|
}) => {
|
10614
10659
|
const template = layoutStyle(layout);
|
10615
|
-
return /* @__PURE__ */
|
10660
|
+
return /* @__PURE__ */ React70.createElement(Box, {
|
10616
10661
|
className: classNames(
|
10617
10662
|
"Aquarium-EmptyState",
|
10618
10663
|
tw("rounded", {
|
@@ -10625,38 +10670,42 @@ var EmptyState = ({
|
|
10625
10670
|
backgroundColor: "transparent",
|
10626
10671
|
borderColor: "grey-10",
|
10627
10672
|
padding: "9"
|
10628
|
-
}, /* @__PURE__ */
|
10673
|
+
}, /* @__PURE__ */ React70.createElement(Flexbox, {
|
10629
10674
|
direction: template.layout,
|
10630
10675
|
justifyContent: template.justifyContent,
|
10631
10676
|
alignItems: template.layout === "row" ? "center" : template.alignItems,
|
10632
10677
|
colGap: "l5",
|
10633
10678
|
rowGap: "8"
|
10634
|
-
}, image && /* @__PURE__ */
|
10679
|
+
}, image && /* @__PURE__ */ React70.createElement(FlexboxItem, null, /* @__PURE__ */ React70.createElement("img", {
|
10635
10680
|
src: image,
|
10636
10681
|
alt: imageAlt,
|
10637
10682
|
style: { width: imageWidth ? `${imageWidth}px` : void 0, height: "auto" }
|
10638
|
-
})), /* @__PURE__ */
|
10683
|
+
})), /* @__PURE__ */ React70.createElement(Flexbox, {
|
10639
10684
|
style: { maxWidth: "610px" },
|
10640
10685
|
direction: "column",
|
10641
10686
|
justifyContent: template.justifyContent,
|
10642
10687
|
alignItems: template.alignItems
|
10643
|
-
}, /* @__PURE__ */
|
10688
|
+
}, /* @__PURE__ */ React70.createElement(Typography2, {
|
10644
10689
|
variant: "heading",
|
10645
10690
|
htmlTag: "h2"
|
10646
|
-
}, title), (description || children) && /* @__PURE__ */
|
10691
|
+
}, title), (description || children) && /* @__PURE__ */ React70.createElement(Box, {
|
10647
10692
|
marginTop: "5"
|
10648
|
-
}, /* @__PURE__ */
|
10693
|
+
}, /* @__PURE__ */ React70.createElement(Typography2, {
|
10649
10694
|
variant: "default",
|
10650
10695
|
color: "grey-60"
|
10651
|
-
}, children || description)), (secondaryAction || primaryAction) && /* @__PURE__ */
|
10696
|
+
}, children || description)), (secondaryAction || primaryAction) && /* @__PURE__ */ React70.createElement(Flexbox, {
|
10652
10697
|
marginTop: "7",
|
10653
10698
|
gap: "4",
|
10654
10699
|
justifyContent: "center",
|
10655
10700
|
alignItems: "center",
|
10656
10701
|
wrap: "wrap"
|
10657
|
-
}, primaryAction && /* @__PURE__ */
|
10702
|
+
}, primaryAction && /* @__PURE__ */ React70.createElement(React70.Fragment, null, !isLink(primaryAction) && /* @__PURE__ */ React70.createElement(Button.Primary, __spreadValues({}, omit9(primaryAction, "text")), primaryAction.text), isLink(primaryAction) && /* @__PURE__ */ React70.createElement(Button.ExternalLink, __spreadValues({
|
10703
|
+
kind: "primary"
|
10704
|
+
}, omit9(primaryAction, "text")), primaryAction.text)), secondaryAction && /* @__PURE__ */ React70.createElement(React70.Fragment, null, !isLink(secondaryAction) && /* @__PURE__ */ React70.createElement(Button.Secondary, __spreadValues({}, omit9(secondaryAction, "text")), secondaryAction.text), isLink(secondaryAction) && /* @__PURE__ */ React70.createElement(Button.ExternalLink, __spreadValues({
|
10705
|
+
kind: "secondary"
|
10706
|
+
}, omit9(secondaryAction, "text")), secondaryAction.text))), footer && /* @__PURE__ */ React70.createElement(Box, {
|
10658
10707
|
marginTop: "7"
|
10659
|
-
}, /* @__PURE__ */
|
10708
|
+
}, /* @__PURE__ */ React70.createElement(Typography2, {
|
10660
10709
|
htmlTag: "div",
|
10661
10710
|
variant: "small",
|
10662
10711
|
color: "grey-60"
|
@@ -10664,7 +10713,7 @@ var EmptyState = ({
|
|
10664
10713
|
};
|
10665
10714
|
|
10666
10715
|
// src/molecules/Grid/GridItem.tsx
|
10667
|
-
import
|
10716
|
+
import React71 from "react";
|
10668
10717
|
var GridItem = Tailwindify(
|
10669
10718
|
({
|
10670
10719
|
htmlTag = "div",
|
@@ -10695,7 +10744,7 @@ var GridItem = Tailwindify(
|
|
10695
10744
|
gridRowEnd: rowEnd
|
10696
10745
|
});
|
10697
10746
|
const HtmlElement = htmlTag;
|
10698
|
-
return /* @__PURE__ */
|
10747
|
+
return /* @__PURE__ */ React71.createElement(HtmlElement, {
|
10699
10748
|
style: __spreadValues(__spreadValues({}, hookStyle), style),
|
10700
10749
|
className
|
10701
10750
|
}, children);
|
@@ -10703,7 +10752,7 @@ var GridItem = Tailwindify(
|
|
10703
10752
|
);
|
10704
10753
|
|
10705
10754
|
// src/molecules/LineClamp/LineClamp.tsx
|
10706
|
-
import
|
10755
|
+
import React72 from "react";
|
10707
10756
|
var LineClamp2 = ({
|
10708
10757
|
lines,
|
10709
10758
|
children,
|
@@ -10712,10 +10761,10 @@ var LineClamp2 = ({
|
|
10712
10761
|
collapseLabel,
|
10713
10762
|
onClampedChange
|
10714
10763
|
}) => {
|
10715
|
-
const ref =
|
10716
|
-
const [clamped, setClamped] =
|
10717
|
-
const [isClampingEnabled, setClampingEnabled] =
|
10718
|
-
|
10764
|
+
const ref = React72.useRef(null);
|
10765
|
+
const [clamped, setClamped] = React72.useState(true);
|
10766
|
+
const [isClampingEnabled, setClampingEnabled] = React72.useState(false);
|
10767
|
+
React72.useEffect(() => {
|
10719
10768
|
var _a, _b;
|
10720
10769
|
const el = ref.current;
|
10721
10770
|
setClampingEnabled(((_a = el == null ? void 0 : el.scrollHeight) != null ? _a : 0) > ((_b = el == null ? void 0 : el.clientHeight) != null ? _b : 0));
|
@@ -10724,28 +10773,28 @@ var LineClamp2 = ({
|
|
10724
10773
|
setClamped(!clamped);
|
10725
10774
|
onClampedChange == null ? void 0 : onClampedChange(!clamped);
|
10726
10775
|
};
|
10727
|
-
return /* @__PURE__ */
|
10776
|
+
return /* @__PURE__ */ React72.createElement("div", {
|
10728
10777
|
className: "Aquarium-LineClamp"
|
10729
|
-
}, /* @__PURE__ */
|
10778
|
+
}, /* @__PURE__ */ React72.createElement(LineClamp, {
|
10730
10779
|
ref,
|
10731
10780
|
lines,
|
10732
10781
|
clamped,
|
10733
10782
|
wordBreak
|
10734
|
-
}, children), expandLabel && isClampingEnabled && /* @__PURE__ */
|
10783
|
+
}, children), expandLabel && isClampingEnabled && /* @__PURE__ */ React72.createElement(Button.Ghost, {
|
10735
10784
|
dense: true,
|
10736
10785
|
onClick: handleClampedChange
|
10737
10786
|
}, clamped ? expandLabel : collapseLabel));
|
10738
10787
|
};
|
10739
10788
|
|
10740
10789
|
// src/molecules/Link/Link.tsx
|
10741
|
-
import
|
10790
|
+
import React74 from "react";
|
10742
10791
|
import classNames8 from "classnames";
|
10743
10792
|
|
10744
10793
|
// src/atoms/Link/Link.tsx
|
10745
|
-
import
|
10794
|
+
import React73 from "react";
|
10746
10795
|
var Link = (_a) => {
|
10747
10796
|
var _b = _a, { children, className } = _b, props = __objRest(_b, ["children", "className"]);
|
10748
|
-
return /* @__PURE__ */
|
10797
|
+
return /* @__PURE__ */ React73.createElement("a", __spreadValues({
|
10749
10798
|
className: classNames(className, linkStyle)
|
10750
10799
|
}, props), children);
|
10751
10800
|
};
|
@@ -10753,22 +10802,22 @@ var Link = (_a) => {
|
|
10753
10802
|
// src/molecules/Link/Link.tsx
|
10754
10803
|
var Link2 = (_a) => {
|
10755
10804
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
10756
|
-
return /* @__PURE__ */
|
10805
|
+
return /* @__PURE__ */ React74.createElement(Link, __spreadValues({
|
10757
10806
|
className: classNames8("Aquarium-Link", className)
|
10758
10807
|
}, props));
|
10759
10808
|
};
|
10760
10809
|
|
10761
10810
|
// src/molecules/ListItem/ListItem.tsx
|
10762
|
-
import
|
10811
|
+
import React75 from "react";
|
10763
10812
|
var ListItem = ({ name, icon, active = false }) => {
|
10764
|
-
return /* @__PURE__ */
|
10813
|
+
return /* @__PURE__ */ React75.createElement(Flexbox, {
|
10765
10814
|
alignItems: "center"
|
10766
|
-
}, /* @__PURE__ */
|
10815
|
+
}, /* @__PURE__ */ React75.createElement(Typography2, {
|
10767
10816
|
variant: active ? "small-strong" : "small",
|
10768
10817
|
color: "grey-70",
|
10769
10818
|
htmlTag: "span",
|
10770
10819
|
className: `px-4 py-2 rounded-full ${active ? "bg-grey-5" : "hover:bg-grey-0"}`
|
10771
|
-
}, /* @__PURE__ */
|
10820
|
+
}, /* @__PURE__ */ React75.createElement("img", {
|
10772
10821
|
src: icon,
|
10773
10822
|
alt: name,
|
10774
10823
|
className: "inline mr-4",
|
@@ -10778,7 +10827,7 @@ var ListItem = ({ name, icon, active = false }) => {
|
|
10778
10827
|
};
|
10779
10828
|
|
10780
10829
|
// src/molecules/Modal/Modal.tsx
|
10781
|
-
import
|
10830
|
+
import React77 from "react";
|
10782
10831
|
import { useDialog as useDialog3 } from "@react-aria/dialog";
|
10783
10832
|
import { Overlay as Overlay3, useModalOverlay as useModalOverlay2 } from "@react-aria/overlays";
|
10784
10833
|
import { useId as useId2 } from "@react-aria/utils";
|
@@ -10787,18 +10836,18 @@ import castArray from "lodash/castArray";
|
|
10787
10836
|
import omit10 from "lodash/omit";
|
10788
10837
|
|
10789
10838
|
// src/molecules/Tabs/Tabs.tsx
|
10790
|
-
import
|
10839
|
+
import React76, { useEffect as useEffect7, useLayoutEffect as useLayoutEffect2, useRef as useRef8, useState as useState7 } from "react";
|
10791
10840
|
import isNumber5 from "lodash/isNumber";
|
10792
10841
|
import kebabCase from "lodash/kebabCase";
|
10793
10842
|
var import_chevronLeft3 = __toESM(require_chevronLeft());
|
10794
10843
|
var import_chevronRight3 = __toESM(require_chevronRight());
|
10795
10844
|
var import_warningSign4 = __toESM(require_warningSign());
|
10796
10845
|
var isTabComponent = (c) => {
|
10797
|
-
return
|
10846
|
+
return React76.isValidElement(c) && (c.type === Tab || c.type === ModalTab);
|
10798
10847
|
};
|
10799
|
-
var Tab =
|
10848
|
+
var Tab = React76.forwardRef(
|
10800
10849
|
({ className, id, title, children }, ref) => {
|
10801
|
-
return /* @__PURE__ */
|
10850
|
+
return /* @__PURE__ */ React76.createElement("div", {
|
10802
10851
|
ref,
|
10803
10852
|
id: `${id != null ? id : kebabCase(title)}-panel`,
|
10804
10853
|
className,
|
@@ -10810,14 +10859,14 @@ var Tab = React75.forwardRef(
|
|
10810
10859
|
);
|
10811
10860
|
var TabContainer = (_a) => {
|
10812
10861
|
var _b = _a, { className, children } = _b, rest = __objRest(_b, ["className", "children"]);
|
10813
|
-
return /* @__PURE__ */
|
10862
|
+
return /* @__PURE__ */ React76.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
10814
10863
|
className: classNames("py-6 z-0", className)
|
10815
10864
|
}), children);
|
10816
10865
|
};
|
10817
10866
|
var ModalTab = Tab;
|
10818
10867
|
var ModalTabContainer = TabContainer;
|
10819
10868
|
var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
10820
|
-
const Tab2 =
|
10869
|
+
const Tab2 = React76.forwardRef(
|
10821
10870
|
(_a, ref) => {
|
10822
10871
|
var _b = _a, {
|
10823
10872
|
id,
|
@@ -10847,17 +10896,17 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
10847
10896
|
const _id = id != null ? id : kebabCase(title);
|
10848
10897
|
let statusIcon = void 0;
|
10849
10898
|
if (status === "warning") {
|
10850
|
-
statusIcon = /* @__PURE__ */
|
10899
|
+
statusIcon = /* @__PURE__ */ React76.createElement(InlineIcon, {
|
10851
10900
|
icon: import_warningSign4.default,
|
10852
|
-
color:
|
10901
|
+
color: "warning-80"
|
10853
10902
|
});
|
10854
10903
|
} else if (status === "error") {
|
10855
|
-
statusIcon = /* @__PURE__ */
|
10904
|
+
statusIcon = /* @__PURE__ */ React76.createElement(InlineIcon, {
|
10856
10905
|
icon: import_warningSign4.default,
|
10857
|
-
color:
|
10906
|
+
color: "error-50"
|
10858
10907
|
});
|
10859
10908
|
}
|
10860
|
-
const tab = /* @__PURE__ */
|
10909
|
+
const tab = /* @__PURE__ */ React76.createElement(Component, __spreadValues({
|
10861
10910
|
ref,
|
10862
10911
|
id: `${_id}-tab`,
|
10863
10912
|
onClick: () => !disabled && onSelected(value != null ? value : index),
|
@@ -10874,24 +10923,24 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
10874
10923
|
"aria-selected": selected,
|
10875
10924
|
"aria-controls": `${_id}-panel`,
|
10876
10925
|
tabIndex: disabled ? void 0 : 0
|
10877
|
-
}, rest), /* @__PURE__ */
|
10926
|
+
}, rest), /* @__PURE__ */ React76.createElement(Typography2, {
|
10878
10927
|
htmlTag: "div",
|
10879
10928
|
variant: "small",
|
10880
10929
|
color: selected ? "primary-80" : disabled ? "grey-20" : "current",
|
10881
10930
|
className: tw("inline-flex items-center gap-3")
|
10882
|
-
}, /* @__PURE__ */
|
10931
|
+
}, /* @__PURE__ */ React76.createElement("span", {
|
10883
10932
|
className: tw("whitespace-nowrap")
|
10884
|
-
}, title), isNumber5(badge) && /* @__PURE__ */
|
10933
|
+
}, title), isNumber5(badge) && /* @__PURE__ */ React76.createElement(Typography2, {
|
10885
10934
|
htmlTag: "span",
|
10886
10935
|
variant: "small",
|
10887
10936
|
color: selected ? "primary-80" : "grey-5",
|
10888
10937
|
className: "leading-none"
|
10889
|
-
}, /* @__PURE__ */
|
10938
|
+
}, /* @__PURE__ */ React76.createElement(TabBadge, {
|
10890
10939
|
kind: "filled",
|
10891
10940
|
value: badge,
|
10892
10941
|
textClassname: classNames({ "text-white": selected, "text-grey-50": !selected })
|
10893
10942
|
})), statusIcon));
|
10894
|
-
return tooltip ? /* @__PURE__ */
|
10943
|
+
return tooltip ? /* @__PURE__ */ React76.createElement(Tooltip, {
|
10895
10944
|
content: tooltip
|
10896
10945
|
}, tab) : tab;
|
10897
10946
|
}
|
@@ -10905,7 +10954,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
10905
10954
|
const Tabs2 = (props) => {
|
10906
10955
|
var _a, _b;
|
10907
10956
|
const { className, value, defaultValue, onChange, children } = props;
|
10908
|
-
const childArr =
|
10957
|
+
const childArr = React76.Children.toArray(children);
|
10909
10958
|
const firstTab = childArr[0];
|
10910
10959
|
const firstTabValue = isTabComponent(firstTab) ? firstTab.props.value : -1;
|
10911
10960
|
const [selected, setSelected] = useState7((_b = (_a = value != null ? value : defaultValue) != null ? _a : firstTabValue) != null ? _b : 0);
|
@@ -10918,7 +10967,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
10918
10967
|
var _a2, _b2;
|
10919
10968
|
const container = containerRef.current;
|
10920
10969
|
const tabs = tabsRef.current;
|
10921
|
-
const values =
|
10970
|
+
const values = React76.Children.map(
|
10922
10971
|
children,
|
10923
10972
|
(tab, i) => {
|
10924
10973
|
var _a3;
|
@@ -10959,7 +11008,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
10959
11008
|
updateCarets();
|
10960
11009
|
setSelected(value);
|
10961
11010
|
revealSelectedTab({ smooth: value !== selected });
|
10962
|
-
}, [value,
|
11011
|
+
}, [value, React76.Children.count(children)]);
|
10963
11012
|
useLayoutEffect2(() => {
|
10964
11013
|
var _a2;
|
10965
11014
|
updateCarets();
|
@@ -11023,27 +11072,27 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
11023
11072
|
const handleSelected = (key) => {
|
11024
11073
|
(onChange != null ? onChange : setSelected)(key);
|
11025
11074
|
};
|
11026
|
-
|
11075
|
+
React76.Children.forEach(children, (c) => {
|
11027
11076
|
if (c && !isTabComponent(c)) {
|
11028
11077
|
throw new Error("<Tabs> can only have <Tabs.Tab> components as children");
|
11029
11078
|
}
|
11030
11079
|
});
|
11031
|
-
return /* @__PURE__ */
|
11080
|
+
return /* @__PURE__ */ React76.createElement("div", {
|
11032
11081
|
ref: parentRef,
|
11033
11082
|
className: classNames("Aquarium-Tabs", tw("h-full"), className)
|
11034
|
-
}, /* @__PURE__ */
|
11083
|
+
}, /* @__PURE__ */ React76.createElement("div", {
|
11035
11084
|
className: tw("relative flex items-center h-full border-b-2 border-grey-10")
|
11036
|
-
}, /* @__PURE__ */
|
11085
|
+
}, /* @__PURE__ */ React76.createElement("div", {
|
11037
11086
|
ref: containerRef,
|
11038
11087
|
className: tw("overflow-y-auto scrollbar-hide h-full mb-[-2px]")
|
11039
|
-
}, /* @__PURE__ */
|
11088
|
+
}, /* @__PURE__ */ React76.createElement("div", {
|
11040
11089
|
ref: tabsRef,
|
11041
11090
|
role: "tablist",
|
11042
11091
|
"aria-label": "tabs",
|
11043
11092
|
className: tw("inline-flex items-center cursor-pointer font-normal h-full")
|
11044
|
-
},
|
11093
|
+
}, React76.Children.map(
|
11045
11094
|
children,
|
11046
|
-
(tab, index) => tab ? /* @__PURE__ */
|
11095
|
+
(tab, index) => tab ? /* @__PURE__ */ React76.createElement(TabItemComponent, __spreadProps(__spreadValues({
|
11047
11096
|
key: tab.props.value
|
11048
11097
|
}, tab.props), {
|
11049
11098
|
index,
|
@@ -11051,20 +11100,20 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
11051
11100
|
onKeyDown: handleKeyDown,
|
11052
11101
|
onSelected: handleSelected
|
11053
11102
|
})) : void 0
|
11054
|
-
))), leftCaret && /* @__PURE__ */
|
11103
|
+
))), leftCaret && /* @__PURE__ */ React76.createElement("div", {
|
11055
11104
|
className: tw("absolute left-0 bg-gradient-to-r from-white via-white z-20 py-3 pr-4")
|
11056
|
-
}, /* @__PURE__ */
|
11105
|
+
}, /* @__PURE__ */ React76.createElement("div", {
|
11057
11106
|
onClick: () => handleScrollToNext("left"),
|
11058
11107
|
className: tw("hover:bg-grey-0 p-2 leading-none cursor-pointer")
|
11059
|
-
}, /* @__PURE__ */
|
11108
|
+
}, /* @__PURE__ */ React76.createElement(InlineIcon, {
|
11060
11109
|
icon: import_chevronLeft3.default
|
11061
|
-
}))), rightCaret && /* @__PURE__ */
|
11110
|
+
}))), rightCaret && /* @__PURE__ */ React76.createElement("div", {
|
11062
11111
|
onClick: () => handleScrollToNext("right"),
|
11063
11112
|
className: tw("absolute right-0 bg-gradient-to-l from-white via-white z-20 py-3 pl-4")
|
11064
|
-
}, /* @__PURE__ */
|
11113
|
+
}, /* @__PURE__ */ React76.createElement("div", {
|
11065
11114
|
onClick: () => handleScrollToNext("right"),
|
11066
11115
|
className: tw("hover:bg-grey-0 p-2 leading-none cursor-pointer")
|
11067
|
-
}, /* @__PURE__ */
|
11116
|
+
}, /* @__PURE__ */ React76.createElement(InlineIcon, {
|
11068
11117
|
icon: import_chevronRight3.default
|
11069
11118
|
})))), renderChildren(children, selected, props));
|
11070
11119
|
};
|
@@ -11072,7 +11121,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
11072
11121
|
Tabs2.Tab = TabComponent;
|
11073
11122
|
return Tabs2;
|
11074
11123
|
};
|
11075
|
-
var Tabs = createTabsComponent(Tab, TabItem, "Tabs", (children, selected) => /* @__PURE__ */
|
11124
|
+
var Tabs = createTabsComponent(Tab, TabItem, "Tabs", (children, selected) => /* @__PURE__ */ React76.createElement(TabContainer, null, children.find(
|
11076
11125
|
(node, index) => (node == null ? void 0 : node.props.value) === selected || index === selected
|
11077
11126
|
)));
|
11078
11127
|
|
@@ -11081,7 +11130,7 @@ var import_cross6 = __toESM(require_cross());
|
|
11081
11130
|
var Modal2 = (_a) => {
|
11082
11131
|
var _b = _a, { closeOnEsc = true } = _b, props = __objRest(_b, ["closeOnEsc"]);
|
11083
11132
|
const { open, onClose, size, portalContainer } = props;
|
11084
|
-
const ref =
|
11133
|
+
const ref = React77.useRef(null);
|
11085
11134
|
const state = useOverlayTriggerState4({ isOpen: open, onOpenChange: (isOpen) => !isOpen && onClose() });
|
11086
11135
|
const { modalProps, underlayProps } = useModalOverlay2(
|
11087
11136
|
{ isDismissable: false, isKeyboardDismissDisabled: !closeOnEsc },
|
@@ -11091,17 +11140,17 @@ var Modal2 = (_a) => {
|
|
11091
11140
|
if (!state.isOpen) {
|
11092
11141
|
return null;
|
11093
11142
|
}
|
11094
|
-
return /* @__PURE__ */
|
11143
|
+
return /* @__PURE__ */ React77.createElement(Overlay3, {
|
11095
11144
|
portalContainer
|
11096
|
-
}, /* @__PURE__ */
|
11145
|
+
}, /* @__PURE__ */ React77.createElement(Modal, {
|
11097
11146
|
className: "Aquarium-Modal",
|
11098
11147
|
open: true
|
11099
|
-
}, /* @__PURE__ */
|
11148
|
+
}, /* @__PURE__ */ React77.createElement(Modal.BackDrop, __spreadValues({}, underlayProps)), /* @__PURE__ */ React77.createElement(ModalWrapper, __spreadValues(__spreadValues({
|
11100
11149
|
ref,
|
11101
11150
|
size
|
11102
11151
|
}, props), modalProps))));
|
11103
11152
|
};
|
11104
|
-
var ModalWrapper =
|
11153
|
+
var ModalWrapper = React77.forwardRef(
|
11105
11154
|
(_a, ref) => {
|
11106
11155
|
var _b = _a, { title, subtitle, headerImage, primaryAction, secondaryActions, children, onClose } = _b, props = __objRest(_b, ["title", "subtitle", "headerImage", "primaryAction", "secondaryActions", "children", "onClose"]);
|
11107
11156
|
const labelledBy = useId2();
|
@@ -11110,30 +11159,30 @@ var ModalWrapper = React76.forwardRef(
|
|
11110
11159
|
{ "role": "dialog", "aria-labelledby": labelledBy, "aria-describedby": describedBy },
|
11111
11160
|
ref
|
11112
11161
|
);
|
11113
|
-
return /* @__PURE__ */
|
11162
|
+
return /* @__PURE__ */ React77.createElement(Modal.Dialog, __spreadProps(__spreadValues(__spreadValues({
|
11114
11163
|
ref
|
11115
11164
|
}, props), dialogProps), {
|
11116
11165
|
tabIndex: -1
|
11117
|
-
}), /* @__PURE__ */
|
11166
|
+
}), /* @__PURE__ */ React77.createElement(Modal.CloseButtonContainer, null, /* @__PURE__ */ React77.createElement(IconButton, {
|
11118
11167
|
"aria-label": "Close",
|
11119
11168
|
icon: import_cross6.default,
|
11120
11169
|
onClick: onClose
|
11121
|
-
})), headerImage !== void 0 && /* @__PURE__ */
|
11170
|
+
})), headerImage !== void 0 && /* @__PURE__ */ React77.createElement(Modal.HeaderImage, {
|
11122
11171
|
backgroundImage: headerImage
|
11123
|
-
}), /* @__PURE__ */
|
11172
|
+
}), /* @__PURE__ */ React77.createElement(Modal.Header, {
|
11124
11173
|
className: tw({ "pb-3": isComponentType(children, ModalTabs) })
|
11125
|
-
}, /* @__PURE__ */
|
11174
|
+
}, /* @__PURE__ */ React77.createElement(Modal.TitleContainer, null, /* @__PURE__ */ React77.createElement(Modal.Title, {
|
11126
11175
|
id: labelledBy
|
11127
|
-
}, title), subtitle && /* @__PURE__ */
|
11176
|
+
}, title), subtitle && /* @__PURE__ */ React77.createElement(Modal.Subtitle, null, subtitle))), isComponentType(children, ModalTabs) ? React77.cloneElement(children, { className: tw("[&>div:first-child]:px-5 grow") }) : /* @__PURE__ */ React77.createElement(Modal.Body, {
|
11128
11177
|
id: describedBy,
|
11129
11178
|
tabIndex: 0,
|
11130
11179
|
noFooter: !(secondaryActions || primaryAction)
|
11131
|
-
}, children), (secondaryActions || primaryAction) && /* @__PURE__ */
|
11180
|
+
}, children), (secondaryActions || primaryAction) && /* @__PURE__ */ React77.createElement(Modal.Footer, null, /* @__PURE__ */ React77.createElement(Modal.Actions, null, secondaryActions && castArray(secondaryActions).filter(Boolean).map((_a2) => {
|
11132
11181
|
var _b2 = _a2, { text } = _b2, action = __objRest(_b2, ["text"]);
|
11133
|
-
return /* @__PURE__ */
|
11182
|
+
return /* @__PURE__ */ React77.createElement(Button.Secondary, __spreadValues({
|
11134
11183
|
key: text
|
11135
11184
|
}, action), text);
|
11136
|
-
}), primaryAction && /* @__PURE__ */
|
11185
|
+
}), primaryAction && /* @__PURE__ */ React77.createElement(Button.Primary, __spreadValues({
|
11137
11186
|
key: primaryAction.text
|
11138
11187
|
}, omit10(primaryAction, "text")), primaryAction.text))));
|
11139
11188
|
}
|
@@ -11142,24 +11191,24 @@ var ModalTabs = createTabsComponent(
|
|
11142
11191
|
ModalTab,
|
11143
11192
|
TabItem,
|
11144
11193
|
"ModalTabs",
|
11145
|
-
(children, selected, props) => /* @__PURE__ */
|
11194
|
+
(children, selected, props) => /* @__PURE__ */ React77.createElement(Modal.Body, {
|
11146
11195
|
maxHeight: props.maxHeight
|
11147
|
-
}, /* @__PURE__ */
|
11196
|
+
}, /* @__PURE__ */ React77.createElement(ModalTabContainer, null, children.find(
|
11148
11197
|
(node, index) => (node == null ? void 0 : node.props.value) === selected || index === selected
|
11149
11198
|
)))
|
11150
11199
|
);
|
11151
11200
|
|
11152
11201
|
// src/molecules/MultiInput/MultiInput.tsx
|
11153
|
-
import
|
11202
|
+
import React79, { useEffect as useEffect8, useRef as useRef9, useState as useState8 } from "react";
|
11154
11203
|
import castArray2 from "lodash/castArray";
|
11155
11204
|
import identity from "lodash/identity";
|
11156
11205
|
import omit11 from "lodash/omit";
|
11157
11206
|
import uniqueId4 from "lodash/uniqueId";
|
11158
11207
|
|
11159
11208
|
// src/molecules/MultiInput/InputChip.tsx
|
11160
|
-
import
|
11209
|
+
import React78 from "react";
|
11161
11210
|
var import_smallCross2 = __toESM(require_smallCross());
|
11162
|
-
var InputChip =
|
11211
|
+
var InputChip = React78.forwardRef(
|
11163
11212
|
(_a, ref) => {
|
11164
11213
|
var _b = _a, { invalid = false, disabled, readOnly, className, onClick: _onClick, children } = _b, props = __objRest(_b, ["invalid", "disabled", "readOnly", "className", "onClick", "children"]);
|
11165
11214
|
const onClick = (e) => {
|
@@ -11167,18 +11216,18 @@ var InputChip = React77.forwardRef(
|
|
11167
11216
|
_onClick == null ? void 0 : _onClick(e);
|
11168
11217
|
}
|
11169
11218
|
};
|
11170
|
-
return /* @__PURE__ */
|
11219
|
+
return /* @__PURE__ */ React78.createElement("div", {
|
11171
11220
|
className: classNames(className, "inline-flex align-middle mx-1 items-stretch rounded-sm break-all", {
|
11172
11221
|
"bg-error-0 ": invalid,
|
11173
11222
|
"bg-grey-0 ": !invalid && !disabled,
|
11174
11223
|
"bg-grey-5": disabled
|
11175
11224
|
})
|
11176
|
-
}, /* @__PURE__ */
|
11225
|
+
}, /* @__PURE__ */ React78.createElement("div", {
|
11177
11226
|
className: tw("px-2 py-1")
|
11178
|
-
}, /* @__PURE__ */
|
11227
|
+
}, /* @__PURE__ */ React78.createElement(Typography2, {
|
11179
11228
|
variant: "small",
|
11180
11229
|
color: invalid ? "error-80" : disabled ? "grey-40" : "grey-70"
|
11181
|
-
}, children)), !readOnly && /* @__PURE__ */
|
11230
|
+
}, children)), !readOnly && /* @__PURE__ */ React78.createElement("div", __spreadProps(__spreadValues({
|
11182
11231
|
ref
|
11183
11232
|
}, props), {
|
11184
11233
|
onClick,
|
@@ -11189,7 +11238,7 @@ var InputChip = React77.forwardRef(
|
|
11189
11238
|
}),
|
11190
11239
|
role: "button",
|
11191
11240
|
"aria-label": `Remove ${children}`
|
11192
|
-
}), /* @__PURE__ */
|
11241
|
+
}), /* @__PURE__ */ React78.createElement(Icon, {
|
11193
11242
|
icon: import_smallCross2.default,
|
11194
11243
|
className: tw({
|
11195
11244
|
"text-error-70": invalid,
|
@@ -11330,7 +11379,7 @@ var MultiInputBase = (_a) => {
|
|
11330
11379
|
};
|
11331
11380
|
const renderChips = () => items == null ? void 0 : items.map((item, index) => {
|
11332
11381
|
var _a3;
|
11333
|
-
return /* @__PURE__ */
|
11382
|
+
return /* @__PURE__ */ React79.createElement(InputChip, {
|
11334
11383
|
key: `${itemToString(item)}.${index}`,
|
11335
11384
|
invalid: !((_a3 = isItemValid == null ? void 0 : isItemValid(item, index)) != null ? _a3 : true),
|
11336
11385
|
readOnly,
|
@@ -11341,13 +11390,13 @@ var MultiInputBase = (_a) => {
|
|
11341
11390
|
}
|
11342
11391
|
}, itemToString(item));
|
11343
11392
|
});
|
11344
|
-
return /* @__PURE__ */
|
11393
|
+
return /* @__PURE__ */ React79.createElement("div", {
|
11345
11394
|
className: "Aquarium-MultiInputBase"
|
11346
|
-
}, /* @__PURE__ */
|
11395
|
+
}, /* @__PURE__ */ React79.createElement(Select.InputContainer, {
|
11347
11396
|
variant: disabled ? "disabled" : valid === false ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default"
|
11348
|
-
}, /* @__PURE__ */
|
11397
|
+
}, /* @__PURE__ */ React79.createElement("div", {
|
11349
11398
|
className: "grow inline-flex flex-row flex-wrap gap-y-2"
|
11350
|
-
}, inline && renderChips(), /* @__PURE__ */
|
11399
|
+
}, inline && renderChips(), /* @__PURE__ */ React79.createElement(Select.Input, __spreadProps(__spreadValues({
|
11351
11400
|
ref: inputRef,
|
11352
11401
|
id: id != null ? id : name,
|
11353
11402
|
name,
|
@@ -11365,11 +11414,11 @@ var MultiInputBase = (_a) => {
|
|
11365
11414
|
onFocus: handleFocus,
|
11366
11415
|
onBlur: handleBlur,
|
11367
11416
|
autoComplete: "off"
|
11368
|
-
}))), endAdornment && /* @__PURE__ */
|
11417
|
+
}))), endAdornment && /* @__PURE__ */ React79.createElement(InputAdornment, null, endAdornment)), !inline && /* @__PURE__ */ React79.createElement("div", {
|
11369
11418
|
className: tw("flex flex-row flex-wrap gap-y-2 mt-2")
|
11370
11419
|
}, renderChips()));
|
11371
11420
|
};
|
11372
|
-
var BaseMultiInputSkeleton = () => /* @__PURE__ */
|
11421
|
+
var BaseMultiInputSkeleton = () => /* @__PURE__ */ React79.createElement(Skeleton, {
|
11373
11422
|
height: 38
|
11374
11423
|
});
|
11375
11424
|
MultiInputBase.Skeleton = BaseMultiInputSkeleton;
|
@@ -11386,7 +11435,7 @@ var MultiInput = (props) => {
|
|
11386
11435
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
11387
11436
|
const labelControlProps = getLabelControlProps(props);
|
11388
11437
|
const baseProps = omit11(props, Object.keys(labelControlProps));
|
11389
|
-
return /* @__PURE__ */
|
11438
|
+
return /* @__PURE__ */ React79.createElement(LabelControl, __spreadProps(__spreadValues({
|
11390
11439
|
id: `${id.current}-label`,
|
11391
11440
|
htmlFor: `${id.current}-input`,
|
11392
11441
|
messageId: errorMessageId
|
@@ -11394,7 +11443,7 @@ var MultiInput = (props) => {
|
|
11394
11443
|
length: value.length,
|
11395
11444
|
maxLength,
|
11396
11445
|
className: "Aquarium-MultiInput"
|
11397
|
-
}), /* @__PURE__ */
|
11446
|
+
}), /* @__PURE__ */ React79.createElement(MultiInputBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
|
11398
11447
|
id: `${id.current}-input`,
|
11399
11448
|
onChange: (value2) => {
|
11400
11449
|
var _a2;
|
@@ -11406,12 +11455,12 @@ var MultiInput = (props) => {
|
|
11406
11455
|
valid: props.valid
|
11407
11456
|
})));
|
11408
11457
|
};
|
11409
|
-
var MultiInputSkeleton = () => /* @__PURE__ */
|
11458
|
+
var MultiInputSkeleton = () => /* @__PURE__ */ React79.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React79.createElement(MultiInputBase.Skeleton, null));
|
11410
11459
|
MultiInput.Skeleton = MultiInputSkeleton;
|
11411
11460
|
MultiInput.Skeleton.displayName = "MultiInput.Skeleton";
|
11412
11461
|
|
11413
11462
|
// src/molecules/MultiSelect/MultiSelect.tsx
|
11414
|
-
import
|
11463
|
+
import React80, { useEffect as useEffect9, useRef as useRef10, useState as useState9 } from "react";
|
11415
11464
|
import { ariaHideOutside as ariaHideOutside2 } from "@react-aria/overlays";
|
11416
11465
|
import { useCombobox as useCombobox2, useMultipleSelection } from "downshift";
|
11417
11466
|
import isEqual from "lodash/isEqual";
|
@@ -11556,7 +11605,7 @@ var MultiSelectBase = (_a) => {
|
|
11556
11605
|
}
|
11557
11606
|
}, [state.isOpen, inputRef, popoverRef]);
|
11558
11607
|
const renderChips = () => {
|
11559
|
-
return selectedItems.map((selectedItem, index) => /* @__PURE__ */
|
11608
|
+
return selectedItems.map((selectedItem, index) => /* @__PURE__ */ React80.createElement(InputChip, __spreadProps(__spreadValues({
|
11560
11609
|
key: `${itemToString(selectedItem)}.chip`,
|
11561
11610
|
className: tw("mx-0"),
|
11562
11611
|
disabled,
|
@@ -11572,14 +11621,14 @@ var MultiSelectBase = (_a) => {
|
|
11572
11621
|
const hasNoResults = options.length === 0 || filteredOptions.length === 0;
|
11573
11622
|
const inputProps = getInputProps(getDropdownProps({ ref: inputRef, disabled: disabled || readOnly }));
|
11574
11623
|
const menuProps = getMenuProps({ ref: menuRef }, { suppressRefError: !isOpen });
|
11575
|
-
return /* @__PURE__ */
|
11624
|
+
return /* @__PURE__ */ React80.createElement("div", {
|
11576
11625
|
className: classNames("Aquarium-MultiSelectBase", tw("relative"))
|
11577
|
-
}, /* @__PURE__ */
|
11626
|
+
}, /* @__PURE__ */ React80.createElement(Select.InputContainer, {
|
11578
11627
|
ref: targetRef,
|
11579
11628
|
variant: disabled ? "disabled" : !valid ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default"
|
11580
|
-
}, /* @__PURE__ */
|
11629
|
+
}, /* @__PURE__ */ React80.createElement("div", {
|
11581
11630
|
className: "grow inline-flex flex-row flex-wrap gap-2"
|
11582
|
-
}, !hideChips && inline && renderChips(), /* @__PURE__ */
|
11631
|
+
}, !hideChips && inline && renderChips(), /* @__PURE__ */ React80.createElement(Select.Input, __spreadProps(__spreadValues(__spreadValues({
|
11583
11632
|
id,
|
11584
11633
|
ref: inputRef,
|
11585
11634
|
name,
|
@@ -11601,12 +11650,12 @@ var MultiSelectBase = (_a) => {
|
|
11601
11650
|
setFocus(false);
|
11602
11651
|
(_a3 = inputProps.onBlur) == null ? void 0 : _a3.call(inputProps, e);
|
11603
11652
|
}
|
11604
|
-
}))), !readOnly && /* @__PURE__ */
|
11653
|
+
}))), !readOnly && /* @__PURE__ */ React80.createElement(Select.Toggle, __spreadValues({
|
11605
11654
|
hasFocus,
|
11606
11655
|
isOpen
|
11607
|
-
}, getToggleButtonProps({ disabled })))), !hideChips && !inline && /* @__PURE__ */
|
11656
|
+
}, getToggleButtonProps({ disabled })))), !hideChips && !inline && /* @__PURE__ */ React80.createElement("div", {
|
11608
11657
|
className: tw("flex flex-row flex-wrap gap-2 mt-2")
|
11609
|
-
}, renderChips()), isOpen && /* @__PURE__ */
|
11658
|
+
}, renderChips()), isOpen && /* @__PURE__ */ React80.createElement(PopoverOverlay, {
|
11610
11659
|
ref: popoverRef,
|
11611
11660
|
triggerRef: targetRef,
|
11612
11661
|
state,
|
@@ -11614,16 +11663,16 @@ var MultiSelectBase = (_a) => {
|
|
11614
11663
|
shouldFlip: true,
|
11615
11664
|
isNonModal: true,
|
11616
11665
|
style: { width: (_a2 = targetRef.current) == null ? void 0 : _a2.offsetWidth }
|
11617
|
-
}, /* @__PURE__ */
|
11666
|
+
}, /* @__PURE__ */ React80.createElement(Select.Menu, __spreadValues({
|
11618
11667
|
ref: menuRef,
|
11619
11668
|
maxHeight
|
11620
|
-
}, menuProps), hasNoResults && /* @__PURE__ */
|
11669
|
+
}, menuProps), hasNoResults && /* @__PURE__ */ React80.createElement(Select.NoResults, null, noResults), filteredOptions.map((item, index) => /* @__PURE__ */ React80.createElement(Select.Item, __spreadValues({
|
11621
11670
|
key: itemToString(item),
|
11622
11671
|
highlighted: index === highlightedIndex,
|
11623
11672
|
selected: selectedItems.includes(item)
|
11624
11673
|
}, getItemProps({ item, index, disabled: isOptionDisabled(item, index) })), renderOption(item))))));
|
11625
11674
|
};
|
11626
|
-
var MultiSelectBaseSkeleton = () => /* @__PURE__ */
|
11675
|
+
var MultiSelectBaseSkeleton = () => /* @__PURE__ */ React80.createElement(Skeleton, {
|
11627
11676
|
height: 38
|
11628
11677
|
});
|
11629
11678
|
MultiSelectBase.Skeleton = MultiSelectBaseSkeleton;
|
@@ -11641,13 +11690,13 @@ var MultiSelect = (_a) => {
|
|
11641
11690
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
11642
11691
|
const labelControlProps = getLabelControlProps(props);
|
11643
11692
|
const baseProps = omit12(props, Object.keys(labelControlProps));
|
11644
|
-
return /* @__PURE__ */
|
11693
|
+
return /* @__PURE__ */ React80.createElement(LabelControl, __spreadProps(__spreadValues({
|
11645
11694
|
id: `${id.current}-label`,
|
11646
11695
|
htmlFor: `${id.current}-input`,
|
11647
11696
|
messageId: errorMessageId
|
11648
11697
|
}, labelControlProps), {
|
11649
11698
|
className: "Aquarium-MultiSelect"
|
11650
|
-
}), /* @__PURE__ */
|
11699
|
+
}), /* @__PURE__ */ React80.createElement(MultiSelectBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
|
11651
11700
|
id: id.current,
|
11652
11701
|
options,
|
11653
11702
|
noResults,
|
@@ -11655,16 +11704,16 @@ var MultiSelect = (_a) => {
|
|
11655
11704
|
valid: props.valid
|
11656
11705
|
})));
|
11657
11706
|
};
|
11658
|
-
var MultiSelectSkeleton = () => /* @__PURE__ */
|
11707
|
+
var MultiSelectSkeleton = () => /* @__PURE__ */ React80.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React80.createElement(MultiSelectBase.Skeleton, null));
|
11659
11708
|
MultiSelect.Skeleton = MultiSelectSkeleton;
|
11660
11709
|
MultiSelect.Skeleton.displayName = "MultiSelect.Skeleton";
|
11661
11710
|
|
11662
11711
|
// src/molecules/NativeSelect/NativeSelect.tsx
|
11663
|
-
import
|
11712
|
+
import React81, { useRef as useRef11 } from "react";
|
11664
11713
|
import omit13 from "lodash/omit";
|
11665
11714
|
import uniqueId6 from "lodash/uniqueId";
|
11666
11715
|
var import_caretDown2 = __toESM(require_caretDown());
|
11667
|
-
var NativeSelectBase =
|
11716
|
+
var NativeSelectBase = React81.forwardRef(
|
11668
11717
|
(_a, ref) => {
|
11669
11718
|
var _b = _a, { children, disabled = false, required = false, valid = true, readOnly = false } = _b, props = __objRest(_b, ["children", "disabled", "required", "valid", "readOnly"]);
|
11670
11719
|
const placeholderValue = uniqueId6("default_value_for_placeholder");
|
@@ -11681,16 +11730,16 @@ var NativeSelectBase = React80.forwardRef(
|
|
11681
11730
|
(_b2 = props.onBlur) == null ? void 0 : _b2.call(props, event);
|
11682
11731
|
}
|
11683
11732
|
};
|
11684
|
-
return /* @__PURE__ */
|
11733
|
+
return /* @__PURE__ */ React81.createElement("span", {
|
11685
11734
|
className: classNames("Aquarium-NativeSelectBase", tw("relative block"))
|
11686
|
-
}, !readOnly && /* @__PURE__ */
|
11735
|
+
}, !readOnly && /* @__PURE__ */ React81.createElement("span", {
|
11687
11736
|
className: tw(
|
11688
11737
|
"absolute right-0 inset-y-0 mr-4 text-grey-40 flex ml-3 pointer-events-none typography-default-strong mt-4"
|
11689
11738
|
)
|
11690
|
-
}, /* @__PURE__ */
|
11739
|
+
}, /* @__PURE__ */ React81.createElement(Icon, {
|
11691
11740
|
icon: import_caretDown2.default,
|
11692
11741
|
"data-testid": "icon-dropdown"
|
11693
|
-
})), /* @__PURE__ */
|
11742
|
+
})), /* @__PURE__ */ React81.createElement("select", __spreadProps(__spreadValues({
|
11694
11743
|
ref,
|
11695
11744
|
disabled: disabled || readOnly,
|
11696
11745
|
required
|
@@ -11709,16 +11758,16 @@ var NativeSelectBase = React80.forwardRef(
|
|
11709
11758
|
),
|
11710
11759
|
props.className
|
11711
11760
|
)
|
11712
|
-
}), props.placeholder && /* @__PURE__ */
|
11761
|
+
}), props.placeholder && /* @__PURE__ */ React81.createElement("option", {
|
11713
11762
|
value: placeholderValue,
|
11714
11763
|
disabled: true
|
11715
11764
|
}, props.placeholder), children));
|
11716
11765
|
}
|
11717
11766
|
);
|
11718
|
-
NativeSelectBase.Skeleton = () => /* @__PURE__ */
|
11767
|
+
NativeSelectBase.Skeleton = () => /* @__PURE__ */ React81.createElement(Skeleton, {
|
11719
11768
|
height: 38
|
11720
11769
|
});
|
11721
|
-
var NativeSelect =
|
11770
|
+
var NativeSelect = React81.forwardRef(
|
11722
11771
|
(_a, ref) => {
|
11723
11772
|
var _b = _a, { readOnly } = _b, props = __objRest(_b, ["readOnly"]);
|
11724
11773
|
var _a2;
|
@@ -11727,13 +11776,13 @@ var NativeSelect = React80.forwardRef(
|
|
11727
11776
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
11728
11777
|
const _b2 = getLabelControlProps(props), { "data-testid": dataTestId } = _b2, labelControlProps = __objRest(_b2, ["data-testid"]);
|
11729
11778
|
const baseProps = omit13(props, Object.keys(labelControlProps));
|
11730
|
-
return /* @__PURE__ */
|
11779
|
+
return /* @__PURE__ */ React81.createElement(LabelControl, __spreadProps(__spreadValues({
|
11731
11780
|
id: `${id.current}-label`,
|
11732
11781
|
htmlFor: id.current,
|
11733
11782
|
messageId: errorMessageId
|
11734
11783
|
}, labelControlProps), {
|
11735
11784
|
className: "Aquarium-NativeSelect"
|
11736
|
-
}), /* @__PURE__ */
|
11785
|
+
}), /* @__PURE__ */ React81.createElement(NativeSelectBase, __spreadProps(__spreadValues(__spreadValues({
|
11737
11786
|
ref
|
11738
11787
|
}, baseProps), errorProps), {
|
11739
11788
|
id: id.current,
|
@@ -11747,63 +11796,63 @@ var NativeSelect = React80.forwardRef(
|
|
11747
11796
|
}
|
11748
11797
|
);
|
11749
11798
|
NativeSelect.displayName = "NativeSelect";
|
11750
|
-
var Option =
|
11799
|
+
var Option = React81.forwardRef((_a, ref) => {
|
11751
11800
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
11752
|
-
return /* @__PURE__ */
|
11801
|
+
return /* @__PURE__ */ React81.createElement("option", __spreadValues({
|
11753
11802
|
ref
|
11754
11803
|
}, props), children);
|
11755
11804
|
});
|
11756
11805
|
Option.displayName = "Option";
|
11757
|
-
var NativeSelectSkeleton = () => /* @__PURE__ */
|
11806
|
+
var NativeSelectSkeleton = () => /* @__PURE__ */ React81.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React81.createElement(NativeSelectBase.Skeleton, null), /* @__PURE__ */ React81.createElement("div", {
|
11758
11807
|
style: { height: "1px" }
|
11759
11808
|
}));
|
11760
11809
|
NativeSelect.Skeleton = NativeSelectSkeleton;
|
11761
11810
|
NativeSelect.Skeleton.displayName = "NativeSelect.Skeleton";
|
11762
11811
|
|
11763
11812
|
// src/molecules/Navigation/Navigation.tsx
|
11764
|
-
import
|
11813
|
+
import React83 from "react";
|
11765
11814
|
import classNames9 from "classnames";
|
11766
11815
|
|
11767
11816
|
// src/atoms/Navigation/Navigation.tsx
|
11768
|
-
import
|
11817
|
+
import React82 from "react";
|
11769
11818
|
var Navigation = (_a) => {
|
11770
11819
|
var _b = _a, { className, children } = _b, rest = __objRest(_b, ["className", "children"]);
|
11771
|
-
return /* @__PURE__ */
|
11820
|
+
return /* @__PURE__ */ React82.createElement("nav", {
|
11772
11821
|
className: classNames(tw("bg-grey-0 h-full"))
|
11773
|
-
}, /* @__PURE__ */
|
11822
|
+
}, /* @__PURE__ */ React82.createElement("ul", __spreadProps(__spreadValues({}, rest), {
|
11774
11823
|
className: classNames(tw("flex flex-col h-full"), className),
|
11775
11824
|
role: "menu"
|
11776
11825
|
}), children));
|
11777
11826
|
};
|
11778
11827
|
var Header = (_a) => {
|
11779
11828
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
11780
|
-
return /* @__PURE__ */
|
11829
|
+
return /* @__PURE__ */ React82.createElement("li", __spreadProps(__spreadValues({}, rest), {
|
11781
11830
|
role: "presentation",
|
11782
11831
|
className: classNames(tw("px-6 py-5"), className)
|
11783
11832
|
}));
|
11784
11833
|
};
|
11785
11834
|
var Footer = (_a) => {
|
11786
11835
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
11787
|
-
return /* @__PURE__ */
|
11836
|
+
return /* @__PURE__ */ React82.createElement("li", __spreadProps(__spreadValues({}, rest), {
|
11788
11837
|
role: "presentation",
|
11789
11838
|
className: classNames(tw("px-6 py-5 mt-auto"), className)
|
11790
11839
|
}));
|
11791
11840
|
};
|
11792
11841
|
var Section2 = (_a) => {
|
11793
11842
|
var _b = _a, { title, className } = _b, rest = __objRest(_b, ["title", "className"]);
|
11794
|
-
return /* @__PURE__ */
|
11843
|
+
return /* @__PURE__ */ React82.createElement("li", {
|
11795
11844
|
role: "presentation",
|
11796
11845
|
className: tw("py-5")
|
11797
|
-
}, title && /* @__PURE__ */
|
11846
|
+
}, title && /* @__PURE__ */ React82.createElement("div", {
|
11798
11847
|
className: classNames(className, "py-2 px-6 text-grey-40 uppercase cursor-default typography-caption")
|
11799
|
-
}, title), /* @__PURE__ */
|
11848
|
+
}, title), /* @__PURE__ */ React82.createElement("ul", __spreadProps(__spreadValues({}, rest), {
|
11800
11849
|
role: "group",
|
11801
11850
|
className: classNames(tw("flex flex-col"), className)
|
11802
11851
|
})));
|
11803
11852
|
};
|
11804
11853
|
var Divider3 = (_a) => {
|
11805
11854
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
11806
|
-
return /* @__PURE__ */
|
11855
|
+
return /* @__PURE__ */ React82.createElement("li", __spreadProps(__spreadValues({
|
11807
11856
|
role: "separator"
|
11808
11857
|
}, rest), {
|
11809
11858
|
className: classNames(tw("border-t-2 border-grey-5"), className)
|
@@ -11811,9 +11860,9 @@ var Divider3 = (_a) => {
|
|
11811
11860
|
};
|
11812
11861
|
var Item5 = (_a) => {
|
11813
11862
|
var _b = _a, { className, active } = _b, rest = __objRest(_b, ["className", "active"]);
|
11814
|
-
return /* @__PURE__ */
|
11863
|
+
return /* @__PURE__ */ React82.createElement("li", {
|
11815
11864
|
role: "presentation"
|
11816
|
-
}, /* @__PURE__ */
|
11865
|
+
}, /* @__PURE__ */ React82.createElement("a", __spreadProps(__spreadValues({}, rest), {
|
11817
11866
|
role: "menuitem",
|
11818
11867
|
className: classNames(
|
11819
11868
|
tw("py-3 px-6 hover:bg-grey-5 cursor-pointer flex gap-4 items-center typography-small focusable", {
|
@@ -11833,14 +11882,16 @@ Navigation.Divider = Divider3;
|
|
11833
11882
|
// src/molecules/Navigation/Navigation.tsx
|
11834
11883
|
var Navigation2 = (_a) => {
|
11835
11884
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
11836
|
-
return /* @__PURE__ */
|
11885
|
+
return /* @__PURE__ */ React83.createElement(Navigation, __spreadValues({
|
11837
11886
|
className: classNames9("Aquarium-Navigation", className)
|
11838
11887
|
}, props));
|
11839
11888
|
};
|
11840
11889
|
var Item6 = (_a) => {
|
11841
11890
|
var _b = _a, { children, icon } = _b, rest = __objRest(_b, ["children", "icon"]);
|
11842
|
-
return /* @__PURE__ */
|
11843
|
-
icon
|
11891
|
+
return /* @__PURE__ */ React83.createElement(Navigation.Item, __spreadValues({}, rest), icon && /* @__PURE__ */ React83.createElement(InlineIcon, {
|
11892
|
+
icon,
|
11893
|
+
width: "20px",
|
11894
|
+
height: "20px"
|
11844
11895
|
}), children);
|
11845
11896
|
};
|
11846
11897
|
Navigation2.Item = Item6;
|
@@ -11850,51 +11901,51 @@ Navigation2.Header = Navigation.Header;
|
|
11850
11901
|
Navigation2.Section = Navigation.Section;
|
11851
11902
|
|
11852
11903
|
// src/molecules/PageHeader/PageHeader.tsx
|
11853
|
-
import
|
11904
|
+
import React85 from "react";
|
11854
11905
|
import castArray3 from "lodash/castArray";
|
11855
11906
|
import omit14 from "lodash/omit";
|
11856
11907
|
|
11857
11908
|
// src/atoms/PageHeader/PageHeader.tsx
|
11858
|
-
import
|
11909
|
+
import React84 from "react";
|
11859
11910
|
var PageHeader = (_a) => {
|
11860
11911
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
11861
|
-
return /* @__PURE__ */
|
11912
|
+
return /* @__PURE__ */ React84.createElement("div", __spreadValues({
|
11862
11913
|
className: classNames(tw("flex flex-row gap-4 pb-6"), className)
|
11863
11914
|
}, rest), children);
|
11864
11915
|
};
|
11865
11916
|
PageHeader.Container = (_a) => {
|
11866
11917
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
11867
|
-
return /* @__PURE__ */
|
11918
|
+
return /* @__PURE__ */ React84.createElement("div", __spreadValues({
|
11868
11919
|
className: classNames(tw("flex flex-col grow gap-0"), className)
|
11869
11920
|
}, rest), children);
|
11870
11921
|
};
|
11871
11922
|
PageHeader.TitleContainer = (_a) => {
|
11872
11923
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
11873
|
-
return /* @__PURE__ */
|
11924
|
+
return /* @__PURE__ */ React84.createElement("div", __spreadValues({
|
11874
11925
|
className: classNames(tw("flex flex-col justify-center gap-2"), className)
|
11875
11926
|
}, rest), children);
|
11876
11927
|
};
|
11877
11928
|
PageHeader.Title = (_a) => {
|
11878
11929
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
11879
|
-
return /* @__PURE__ */
|
11930
|
+
return /* @__PURE__ */ React84.createElement(Typography2.Heading, __spreadProps(__spreadValues({}, rest), {
|
11880
11931
|
color: "grey-100"
|
11881
11932
|
}), children);
|
11882
11933
|
};
|
11883
11934
|
PageHeader.Subtitle = (_a) => {
|
11884
11935
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
11885
|
-
return /* @__PURE__ */
|
11936
|
+
return /* @__PURE__ */ React84.createElement(Typography2.Small, __spreadProps(__spreadValues({}, rest), {
|
11886
11937
|
color: "grey-70"
|
11887
11938
|
}), children);
|
11888
11939
|
};
|
11889
11940
|
PageHeader.Chips = (_a) => {
|
11890
11941
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
11891
|
-
return /* @__PURE__ */
|
11942
|
+
return /* @__PURE__ */ React84.createElement("div", __spreadValues({
|
11892
11943
|
className: classNames(tw("flex gap-3"), className)
|
11893
11944
|
}, rest), children);
|
11894
11945
|
};
|
11895
11946
|
PageHeader.Actions = (_a) => {
|
11896
11947
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
11897
|
-
return /* @__PURE__ */
|
11948
|
+
return /* @__PURE__ */ React84.createElement("div", __spreadValues({
|
11898
11949
|
className: classNames(tw("flex flex-row gap-4 self-start"), className)
|
11899
11950
|
}, rest), children);
|
11900
11951
|
};
|
@@ -11910,36 +11961,41 @@ var PageHeader2 = ({
|
|
11910
11961
|
chips = [],
|
11911
11962
|
breadcrumbs
|
11912
11963
|
}) => {
|
11913
|
-
return /* @__PURE__ */
|
11964
|
+
return /* @__PURE__ */ React85.createElement(PageHeader, {
|
11914
11965
|
className: "Aquarium-PageHeader"
|
11915
|
-
}, /* @__PURE__ */
|
11966
|
+
}, /* @__PURE__ */ React85.createElement(PageHeader.Container, null, breadcrumbs && /* @__PURE__ */ React85.createElement(Box, {
|
11916
11967
|
marginBottom: image ? "3" : void 0
|
11917
|
-
}, /* @__PURE__ */
|
11968
|
+
}, /* @__PURE__ */ React85.createElement(Breadcrumbs, null, breadcrumbs)), /* @__PURE__ */ React85.createElement(Flexbox, {
|
11918
11969
|
gap: "5"
|
11919
|
-
}, image && /* @__PURE__ */
|
11970
|
+
}, image && /* @__PURE__ */ React85.createElement("img", {
|
11920
11971
|
src: image,
|
11921
11972
|
alt: imageAlt,
|
11922
11973
|
className: tw("w-[56px] h-[56px]")
|
11923
|
-
}), /* @__PURE__ */
|
11974
|
+
}), /* @__PURE__ */ React85.createElement(PageHeader.TitleContainer, null, /* @__PURE__ */ React85.createElement(PageHeader.Title, null, title), chips.length > 0 && /* @__PURE__ */ React85.createElement(PageHeader.Chips, null, chips.map((chip) => /* @__PURE__ */ React85.createElement(Chip2, {
|
11924
11975
|
key: chip,
|
11925
11976
|
dense: true,
|
11926
11977
|
text: chip
|
11927
|
-
}))), subtitle && /* @__PURE__ */
|
11928
|
-
|
11929
|
-
|
11930
|
-
|
11931
|
-
|
11932
|
-
|
11978
|
+
}))), subtitle && /* @__PURE__ */ React85.createElement(PageHeader.Subtitle, null, subtitle)))), (secondaryActions || primaryAction) && /* @__PURE__ */ React85.createElement(PageHeader.Actions, null, secondaryActions && castArray3(secondaryActions).filter(Boolean).map(
|
11979
|
+
(action) => !isLink(action) ? /* @__PURE__ */ React85.createElement(Button.Secondary, __spreadValues({
|
11980
|
+
key: action.text
|
11981
|
+
}, omit14(action, "text")), action.text) : /* @__PURE__ */ React85.createElement(Button.ExternalLink, __spreadValues({
|
11982
|
+
key: action.text,
|
11983
|
+
kind: "secondary"
|
11984
|
+
}, omit14(action, "text")), action.text)
|
11985
|
+
), primaryAction && /* @__PURE__ */ React85.createElement(React85.Fragment, null, !isLink(primaryAction) && /* @__PURE__ */ React85.createElement(Button.Primary, __spreadValues({
|
11933
11986
|
key: primaryAction.text
|
11934
|
-
}, omit14(primaryAction, "text")), primaryAction.text))
|
11987
|
+
}, omit14(primaryAction, "text")), primaryAction.text), isLink(primaryAction) && /* @__PURE__ */ React85.createElement(Button.ExternalLink, __spreadValues({
|
11988
|
+
key: primaryAction.text,
|
11989
|
+
kind: "primary"
|
11990
|
+
}, omit14(primaryAction, "text")), primaryAction.text))));
|
11935
11991
|
};
|
11936
11992
|
|
11937
11993
|
// src/molecules/Pagination/Pagination.tsx
|
11938
|
-
import
|
11994
|
+
import React87 from "react";
|
11939
11995
|
import clamp from "lodash/clamp";
|
11940
11996
|
|
11941
11997
|
// src/molecules/Select/Select.tsx
|
11942
|
-
import
|
11998
|
+
import React86, { useRef as useRef12, useState as useState10 } from "react";
|
11943
11999
|
import { useSelect } from "downshift";
|
11944
12000
|
import defaults from "lodash/defaults";
|
11945
12001
|
import isArray from "lodash/isArray";
|
@@ -11955,10 +12011,10 @@ var hasOptionGroups = (val) => {
|
|
11955
12011
|
};
|
11956
12012
|
var defaultRenderOption = (item, props, { selectedItem }, { getOptionKey, getValue, optionToString = getOptionLabelBuiltin }) => {
|
11957
12013
|
var _a, _b;
|
11958
|
-
return /* @__PURE__ */
|
12014
|
+
return /* @__PURE__ */ React86.createElement(Select.Item, __spreadValues({
|
11959
12015
|
key: (_b = (_a = getOptionKey == null ? void 0 : getOptionKey(item)) != null ? _a : getValue == null ? void 0 : getValue(item)) != null ? _b : optionToString(item),
|
11960
12016
|
selected: item === selectedItem
|
11961
|
-
}, props), hasIconProperty(item) && /* @__PURE__ */
|
12017
|
+
}, props), hasIconProperty(item) && /* @__PURE__ */ React86.createElement(InlineIcon, {
|
11962
12018
|
icon: item.icon
|
11963
12019
|
}), optionToString(item));
|
11964
12020
|
};
|
@@ -12077,13 +12133,13 @@ var _SelectBase = (props) => {
|
|
12077
12133
|
},
|
12078
12134
|
withDefaults
|
12079
12135
|
);
|
12080
|
-
const renderGroup = (group) => /* @__PURE__ */
|
12136
|
+
const renderGroup = (group) => /* @__PURE__ */ React86.createElement(React86.Fragment, {
|
12081
12137
|
key: group.label
|
12082
|
-
}, /* @__PURE__ */
|
12083
|
-
const input = /* @__PURE__ */
|
12138
|
+
}, /* @__PURE__ */ React86.createElement(Select.Group, null, group.label), group.options.map((opt) => renderItem(opt, items.indexOf(opt))));
|
12139
|
+
const input = /* @__PURE__ */ React86.createElement(Select.InputContainer, __spreadProps(__spreadValues({}, getToggleButtonProps({ disabled: disabled || readOnly, ref: targetRef })), {
|
12084
12140
|
variant: disabled ? "disabled" : !valid ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default",
|
12085
12141
|
tabIndex: 0
|
12086
|
-
}), /* @__PURE__ */
|
12142
|
+
}), /* @__PURE__ */ React86.createElement(Select.Input, __spreadProps(__spreadValues({
|
12087
12143
|
id,
|
12088
12144
|
name
|
12089
12145
|
}, rest), {
|
@@ -12095,26 +12151,26 @@ var _SelectBase = (props) => {
|
|
12095
12151
|
tabIndex: -1,
|
12096
12152
|
onFocus: () => setFocus(true),
|
12097
12153
|
onBlur: () => setFocus(false)
|
12098
|
-
})), !readOnly && /* @__PURE__ */
|
12154
|
+
})), !readOnly && /* @__PURE__ */ React86.createElement(Select.Toggle, {
|
12099
12155
|
disabled,
|
12100
12156
|
isOpen,
|
12101
12157
|
tabIndex: -1
|
12102
12158
|
}));
|
12103
12159
|
const menuProps = getMenuProps({ ref: menuRef }, { suppressRefError: !isOpen });
|
12104
|
-
return /* @__PURE__ */
|
12160
|
+
return /* @__PURE__ */ React86.createElement("div", {
|
12105
12161
|
className: classNames("Aquarium-SelectBase", tw("relative"))
|
12106
|
-
}, labelWrapper ?
|
12162
|
+
}, labelWrapper ? React86.cloneElement(labelWrapper, { children: input }) : input, isOpen && /* @__PURE__ */ React86.createElement(PopoverOverlay, {
|
12107
12163
|
state,
|
12108
12164
|
triggerRef: targetRef,
|
12109
12165
|
placement: "bottom-left",
|
12110
12166
|
shouldFlip: true,
|
12111
12167
|
style: { width: (_b = targetRef.current) == null ? void 0 : _b.offsetWidth }
|
12112
|
-
}, /* @__PURE__ */
|
12168
|
+
}, /* @__PURE__ */ React86.createElement(Select.Menu, __spreadValues({
|
12113
12169
|
ref: menuRef,
|
12114
12170
|
maxHeight
|
12115
|
-
}, menuProps), options.length === 0 && /* @__PURE__ */
|
12171
|
+
}, menuProps), options.length === 0 && /* @__PURE__ */ React86.createElement(Select.EmptyStateContainer, null, emptyState), options.length > 0 && !hasOptionGroups(options) && options.map(renderItem), options.length > 0 && hasOptionGroups(options) && options.map(renderGroup), actions.length > 0 && /* @__PURE__ */ React86.createElement(React86.Fragment, null, /* @__PURE__ */ React86.createElement(Select.Divider, {
|
12116
12172
|
onMouseOver: () => setHighlightedIndex(-1)
|
12117
|
-
}), actions.map((act, index) => /* @__PURE__ */
|
12173
|
+
}), actions.map((act, index) => /* @__PURE__ */ React86.createElement(Select.ActionItem, __spreadProps(__spreadValues({
|
12118
12174
|
key: `${index}`
|
12119
12175
|
}, act), {
|
12120
12176
|
onMouseOver: () => setHighlightedIndex(-1),
|
@@ -12124,10 +12180,10 @@ var _SelectBase = (props) => {
|
|
12124
12180
|
}
|
12125
12181
|
}), act.label))))));
|
12126
12182
|
};
|
12127
|
-
var SelectBase = (props) => /* @__PURE__ */
|
12183
|
+
var SelectBase = (props) => /* @__PURE__ */ React86.createElement(_SelectBase, __spreadProps(__spreadValues({}, props), {
|
12128
12184
|
labelWrapper: void 0
|
12129
12185
|
}));
|
12130
|
-
var SelectBaseSkeleton = () => /* @__PURE__ */
|
12186
|
+
var SelectBaseSkeleton = () => /* @__PURE__ */ React86.createElement(Skeleton, {
|
12131
12187
|
height: 38
|
12132
12188
|
});
|
12133
12189
|
SelectBase.Skeleton = SelectBaseSkeleton;
|
@@ -12145,21 +12201,21 @@ var Select2 = (_a) => {
|
|
12145
12201
|
const baseProps = omit15(props, Object.keys(labelProps));
|
12146
12202
|
const legacyError = labelProps.error !== void 0 && labelProps.valid === false;
|
12147
12203
|
const variant = !labelProps.valid || legacyError ? "error" : labelProps.disabled ? "disabled" : "default";
|
12148
|
-
const label = /* @__PURE__ */
|
12204
|
+
const label = /* @__PURE__ */ React86.createElement(Label, __spreadValues({
|
12149
12205
|
id: `${id.current}-label`,
|
12150
12206
|
htmlFor: `${id.current}-input`,
|
12151
12207
|
variant,
|
12152
12208
|
messageId: errorMessageId
|
12153
12209
|
}, labelProps));
|
12154
|
-
return /* @__PURE__ */
|
12210
|
+
return /* @__PURE__ */ React86.createElement(FormControl, {
|
12155
12211
|
className: "Aquarium-Select"
|
12156
|
-
}, /* @__PURE__ */
|
12212
|
+
}, /* @__PURE__ */ React86.createElement(_SelectBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
|
12157
12213
|
id: `${id.current}-input`,
|
12158
12214
|
options,
|
12159
12215
|
disabled: props.disabled,
|
12160
12216
|
valid: props.valid,
|
12161
12217
|
labelWrapper: label
|
12162
|
-
})), /* @__PURE__ */
|
12218
|
+
})), /* @__PURE__ */ React86.createElement(HelperText, {
|
12163
12219
|
messageId: errorMessageId,
|
12164
12220
|
error: !labelProps.valid,
|
12165
12221
|
helperText: labelProps.helperText,
|
@@ -12168,7 +12224,7 @@ var Select2 = (_a) => {
|
|
12168
12224
|
reserveSpaceForError: labelProps.reserveSpaceForError
|
12169
12225
|
}));
|
12170
12226
|
};
|
12171
|
-
var SelectSkeleton = () => /* @__PURE__ */
|
12227
|
+
var SelectSkeleton = () => /* @__PURE__ */ React86.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React86.createElement(SelectBase.Skeleton, null));
|
12172
12228
|
Select2.Skeleton = SelectSkeleton;
|
12173
12229
|
Select2.Skeleton.displayName = "Select.Skeleton";
|
12174
12230
|
|
@@ -12187,23 +12243,23 @@ var Pagination = ({
|
|
12187
12243
|
pageSizes,
|
12188
12244
|
onPageSizeChange
|
12189
12245
|
}) => {
|
12190
|
-
const [value, setValue] =
|
12191
|
-
|
12246
|
+
const [value, setValue] = React87.useState(currentPage);
|
12247
|
+
React87.useEffect(() => {
|
12192
12248
|
setValue(currentPage);
|
12193
12249
|
}, [currentPage]);
|
12194
|
-
return /* @__PURE__ */
|
12250
|
+
return /* @__PURE__ */ React87.createElement(Box, {
|
12195
12251
|
className: classNames("Aquarium-Pagination", tw("grid grid-cols-[200px_1fr_200px]")),
|
12196
12252
|
backgroundColor: "grey-0",
|
12197
12253
|
padding: "4"
|
12198
|
-
}, pageSizes && onPageSizeChange && typeof pageSize === "number" ? /* @__PURE__ */
|
12254
|
+
}, pageSizes && onPageSizeChange && typeof pageSize === "number" ? /* @__PURE__ */ React87.createElement(Box, {
|
12199
12255
|
display: "flex",
|
12200
12256
|
alignItems: "center",
|
12201
12257
|
gap: "4"
|
12202
|
-
}, /* @__PURE__ */
|
12258
|
+
}, /* @__PURE__ */ React87.createElement(Typography2.Small, {
|
12203
12259
|
color: "grey-50"
|
12204
|
-
}, "Items per page "), /* @__PURE__ */
|
12260
|
+
}, "Items per page "), /* @__PURE__ */ React87.createElement("div", {
|
12205
12261
|
className: tw("max-w-[70px]")
|
12206
|
-
}, /* @__PURE__ */
|
12262
|
+
}, /* @__PURE__ */ React87.createElement(SelectBase, {
|
12207
12263
|
options: pageSizes.map((size) => size.toString()),
|
12208
12264
|
value: pageSize.toString(),
|
12209
12265
|
onChange: (size) => {
|
@@ -12214,26 +12270,26 @@ var Pagination = ({
|
|
12214
12270
|
}
|
12215
12271
|
}
|
12216
12272
|
}
|
12217
|
-
}))) : /* @__PURE__ */
|
12273
|
+
}))) : /* @__PURE__ */ React87.createElement("div", null), /* @__PURE__ */ React87.createElement(Box, {
|
12218
12274
|
display: "flex",
|
12219
12275
|
justifyContent: "center",
|
12220
12276
|
alignItems: "center",
|
12221
12277
|
className: tw("grow")
|
12222
|
-
}, /* @__PURE__ */
|
12278
|
+
}, /* @__PURE__ */ React87.createElement(IconButton, {
|
12223
12279
|
"aria-label": "First",
|
12224
12280
|
onClick: () => onPageChange(1),
|
12225
12281
|
icon: import_chevronBackward2.default,
|
12226
12282
|
disabled: !hasPreviousPage
|
12227
|
-
}), /* @__PURE__ */
|
12283
|
+
}), /* @__PURE__ */ React87.createElement(IconButton, {
|
12228
12284
|
"aria-label": "Previous",
|
12229
12285
|
onClick: () => onPageChange(currentPage - 1),
|
12230
12286
|
icon: import_chevronLeft4.default,
|
12231
12287
|
disabled: !hasPreviousPage
|
12232
|
-
}), /* @__PURE__ */
|
12288
|
+
}), /* @__PURE__ */ React87.createElement(Box, {
|
12233
12289
|
paddingX: "4"
|
12234
|
-
}, /* @__PURE__ */
|
12290
|
+
}, /* @__PURE__ */ React87.createElement(Typography2.Small, {
|
12235
12291
|
color: "grey-60"
|
12236
|
-
}, "Page")), /* @__PURE__ */
|
12292
|
+
}, "Page")), /* @__PURE__ */ React87.createElement(InputBase, {
|
12237
12293
|
className: classNames(tw("text-center max-w-[40px]"), "no-arrows"),
|
12238
12294
|
type: "number",
|
12239
12295
|
min: 1,
|
@@ -12250,45 +12306,45 @@ var Pagination = ({
|
|
12250
12306
|
const newPage = !isNaN(numberValue) ? clamp(numberValue, 1, totalPages) : 1;
|
12251
12307
|
onPageChange(newPage);
|
12252
12308
|
}
|
12253
|
-
}), /* @__PURE__ */
|
12309
|
+
}), /* @__PURE__ */ React87.createElement(Box, {
|
12254
12310
|
paddingX: "4"
|
12255
|
-
}, /* @__PURE__ */
|
12311
|
+
}, /* @__PURE__ */ React87.createElement(Typography2.Small, {
|
12256
12312
|
color: "grey-60"
|
12257
|
-
}, "of ", totalPages)), /* @__PURE__ */
|
12313
|
+
}, "of ", totalPages)), /* @__PURE__ */ React87.createElement(IconButton, {
|
12258
12314
|
"aria-label": "Next",
|
12259
12315
|
onClick: () => onPageChange(currentPage + 1),
|
12260
12316
|
icon: import_chevronRight4.default,
|
12261
12317
|
disabled: !hasNextPage
|
12262
|
-
}), /* @__PURE__ */
|
12318
|
+
}), /* @__PURE__ */ React87.createElement(IconButton, {
|
12263
12319
|
"aria-label": "Last",
|
12264
12320
|
onClick: () => onPageChange(totalPages),
|
12265
12321
|
icon: import_chevronForward2.default,
|
12266
12322
|
disabled: !hasNextPage
|
12267
|
-
})), /* @__PURE__ */
|
12323
|
+
})), /* @__PURE__ */ React87.createElement("div", null));
|
12268
12324
|
};
|
12269
12325
|
|
12270
12326
|
// src/molecules/PopoverDialog/PopoverDialog.tsx
|
12271
|
-
import
|
12327
|
+
import React89 from "react";
|
12272
12328
|
import omit16 from "lodash/omit";
|
12273
12329
|
|
12274
12330
|
// src/atoms/PopoverDialog/PopoverDialog.tsx
|
12275
|
-
import
|
12331
|
+
import React88 from "react";
|
12276
12332
|
var Header2 = (_a) => {
|
12277
12333
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12278
|
-
return /* @__PURE__ */
|
12334
|
+
return /* @__PURE__ */ React88.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12279
12335
|
className: classNames(tw("p-5 gap-3 flex items-center"), className)
|
12280
12336
|
}), children);
|
12281
12337
|
};
|
12282
12338
|
var Title = (_a) => {
|
12283
12339
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12284
|
-
return /* @__PURE__ */
|
12340
|
+
return /* @__PURE__ */ React88.createElement(Typography, __spreadProps(__spreadValues({}, rest), {
|
12285
12341
|
htmlTag: "h1",
|
12286
12342
|
variant: "small-strong"
|
12287
12343
|
}), children);
|
12288
12344
|
};
|
12289
12345
|
var Body = (_a) => {
|
12290
12346
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12291
|
-
return /* @__PURE__ */
|
12347
|
+
return /* @__PURE__ */ React88.createElement(Typography, __spreadProps(__spreadValues({}, rest), {
|
12292
12348
|
htmlTag: "div",
|
12293
12349
|
variant: "caption",
|
12294
12350
|
className: classNames(tw("px-5 overflow-y-auto"), className)
|
@@ -12296,13 +12352,13 @@ var Body = (_a) => {
|
|
12296
12352
|
};
|
12297
12353
|
var Footer2 = (_a) => {
|
12298
12354
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12299
|
-
return /* @__PURE__ */
|
12355
|
+
return /* @__PURE__ */ React88.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12300
12356
|
className: classNames(tw("p-5"), className)
|
12301
12357
|
}), children);
|
12302
12358
|
};
|
12303
12359
|
var Actions2 = (_a) => {
|
12304
12360
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12305
|
-
return /* @__PURE__ */
|
12361
|
+
return /* @__PURE__ */ React88.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12306
12362
|
className: classNames(tw("flex gap-4"), className)
|
12307
12363
|
}), children);
|
12308
12364
|
};
|
@@ -12318,13 +12374,13 @@ var PopoverDialog = {
|
|
12318
12374
|
var PopoverDialog2 = ({ placement, open, title, secondaryAction, primaryAction, children }) => {
|
12319
12375
|
const wrapPromptWithBody = (child) => {
|
12320
12376
|
if (isComponentType(child, PopoverDialog2.Prompt)) {
|
12321
|
-
return /* @__PURE__ */
|
12377
|
+
return /* @__PURE__ */ React89.createElement(Popover2.Panel, {
|
12322
12378
|
className: classNames("Aquarium-PopoverDialog", tw("max-w-[300px]"))
|
12323
|
-
}, /* @__PURE__ */
|
12379
|
+
}, /* @__PURE__ */ React89.createElement(PopoverDialog.Header, null, /* @__PURE__ */ React89.createElement(PopoverDialog.Title, null, title)), child, /* @__PURE__ */ React89.createElement(PopoverDialog.Footer, null, /* @__PURE__ */ React89.createElement(PopoverDialog.Actions, null, secondaryAction && /* @__PURE__ */ React89.createElement(Popover2.Button, __spreadValues({
|
12324
12380
|
kind: "secondary-ghost",
|
12325
12381
|
key: secondaryAction.text,
|
12326
12382
|
dense: true
|
12327
|
-
}, omit16(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */
|
12383
|
+
}, omit16(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */ React89.createElement(Popover2.Button, __spreadValues({
|
12328
12384
|
kind: "ghost",
|
12329
12385
|
key: primaryAction.text,
|
12330
12386
|
dense: true
|
@@ -12332,15 +12388,15 @@ var PopoverDialog2 = ({ placement, open, title, secondaryAction, primaryAction,
|
|
12332
12388
|
}
|
12333
12389
|
return child;
|
12334
12390
|
};
|
12335
|
-
return /* @__PURE__ */
|
12391
|
+
return /* @__PURE__ */ React89.createElement(Popover2, {
|
12336
12392
|
type: "dialog",
|
12337
12393
|
isOpen: open,
|
12338
12394
|
placement,
|
12339
12395
|
containFocus: true
|
12340
|
-
},
|
12396
|
+
}, React89.Children.map(children, wrapPromptWithBody));
|
12341
12397
|
};
|
12342
12398
|
PopoverDialog2.Trigger = Popover2.Trigger;
|
12343
|
-
var Prompt = ({ children }) => /* @__PURE__ */
|
12399
|
+
var Prompt = ({ children }) => /* @__PURE__ */ React89.createElement(PopoverDialog.Body, null, children);
|
12344
12400
|
Prompt.displayName = "PopoverDialog.Prompt";
|
12345
12401
|
PopoverDialog2.Prompt = Prompt;
|
12346
12402
|
|
@@ -12349,14 +12405,14 @@ import { createPortal } from "react-dom";
|
|
12349
12405
|
var Portal = ({ children, to }) => createPortal(children, to);
|
12350
12406
|
|
12351
12407
|
// src/molecules/ProgressBar/ProgressBar.tsx
|
12352
|
-
import
|
12408
|
+
import React91 from "react";
|
12353
12409
|
|
12354
12410
|
// src/atoms/ProgressBar/ProgressBar.tsx
|
12355
|
-
import
|
12411
|
+
import React90 from "react";
|
12356
12412
|
import clamp2 from "lodash/clamp";
|
12357
12413
|
var ProgressBar = (_a) => {
|
12358
12414
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12359
|
-
return /* @__PURE__ */
|
12415
|
+
return /* @__PURE__ */ React90.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12360
12416
|
className: classNames(
|
12361
12417
|
tw("relative flex items-center w-full bg-grey-0 h-2 rounded-full overflow-hidden"),
|
12362
12418
|
className
|
@@ -12372,7 +12428,7 @@ var STATUS_COLORS = {
|
|
12372
12428
|
ProgressBar.Indicator = (_a) => {
|
12373
12429
|
var _b = _a, { min, max, value, "aria-label": ariaLabel, status, className } = _b, rest = __objRest(_b, ["min", "max", "value", "aria-label", "status", "className"]);
|
12374
12430
|
const completedPercentage = clamp2((value - min) / (max - min) * 100, 0, 100);
|
12375
|
-
return /* @__PURE__ */
|
12431
|
+
return /* @__PURE__ */ React90.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12376
12432
|
className: classNames(
|
12377
12433
|
tw("h-2 rounded-full transition-all ease-in-out delay-150"),
|
12378
12434
|
STATUS_COLORS[status],
|
@@ -12388,11 +12444,11 @@ ProgressBar.Indicator = (_a) => {
|
|
12388
12444
|
};
|
12389
12445
|
ProgressBar.Labels = (_a) => {
|
12390
12446
|
var _b = _a, { children, startLabel, endLabel, className } = _b, rest = __objRest(_b, ["children", "startLabel", "endLabel", "className"]);
|
12391
|
-
return /* @__PURE__ */
|
12447
|
+
return /* @__PURE__ */ React90.createElement("div", {
|
12392
12448
|
className: classNames(tw("flex flex-row"), className)
|
12393
|
-
}, /* @__PURE__ */
|
12449
|
+
}, /* @__PURE__ */ React90.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
12394
12450
|
className: tw("grow text-grey-70 typography-caption")
|
12395
|
-
}), startLabel), /* @__PURE__ */
|
12451
|
+
}), startLabel), /* @__PURE__ */ React90.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
12396
12452
|
className: tw("grow text-grey-70 typography-caption text-right")
|
12397
12453
|
}), endLabel));
|
12398
12454
|
};
|
@@ -12410,7 +12466,7 @@ var ProgressBar2 = (props) => {
|
|
12410
12466
|
if (min > max) {
|
12411
12467
|
throw new Error("`min` value provided to `ProgressBar` is greater than `max` value.");
|
12412
12468
|
}
|
12413
|
-
const progress = /* @__PURE__ */
|
12469
|
+
const progress = /* @__PURE__ */ React91.createElement(ProgressBar, null, /* @__PURE__ */ React91.createElement(ProgressBar.Indicator, {
|
12414
12470
|
status: value === max ? completedStatus : progresStatus,
|
12415
12471
|
min,
|
12416
12472
|
max,
|
@@ -12420,15 +12476,15 @@ var ProgressBar2 = (props) => {
|
|
12420
12476
|
if (props.dense) {
|
12421
12477
|
return progress;
|
12422
12478
|
}
|
12423
|
-
return /* @__PURE__ */
|
12479
|
+
return /* @__PURE__ */ React91.createElement("div", {
|
12424
12480
|
className: "Aquarium-ProgressBar"
|
12425
|
-
}, progress, /* @__PURE__ */
|
12481
|
+
}, progress, /* @__PURE__ */ React91.createElement(ProgressBar.Labels, {
|
12426
12482
|
className: tw("py-2"),
|
12427
12483
|
startLabel: props.startLabel,
|
12428
12484
|
endLabel: props.endLabel
|
12429
12485
|
}));
|
12430
12486
|
};
|
12431
|
-
var ProgressBarSkeleton = () => /* @__PURE__ */
|
12487
|
+
var ProgressBarSkeleton = () => /* @__PURE__ */ React91.createElement(Skeleton, {
|
12432
12488
|
height: 4,
|
12433
12489
|
display: "block"
|
12434
12490
|
});
|
@@ -12436,13 +12492,13 @@ ProgressBar2.Skeleton = ProgressBarSkeleton;
|
|
12436
12492
|
ProgressBar2.Skeleton.displayName = "ProgressBar.Skeleton";
|
12437
12493
|
|
12438
12494
|
// src/molecules/RadioButton/RadioButton.tsx
|
12439
|
-
import
|
12440
|
-
var RadioButton2 =
|
12495
|
+
import React92 from "react";
|
12496
|
+
var RadioButton2 = React92.forwardRef(
|
12441
12497
|
(_a, ref) => {
|
12442
12498
|
var _b = _a, { name, id, readOnly = false, disabled = false, caption, children, "aria-label": ariaLabel } = _b, props = __objRest(_b, ["name", "id", "readOnly", "disabled", "caption", "children", "aria-label"]);
|
12443
12499
|
var _a2;
|
12444
12500
|
const isChecked = (_a2 = props.checked) != null ? _a2 : props.defaultChecked;
|
12445
|
-
return !readOnly || isChecked ? /* @__PURE__ */
|
12501
|
+
return !readOnly || isChecked ? /* @__PURE__ */ React92.createElement(ControlLabel, {
|
12446
12502
|
htmlFor: id,
|
12447
12503
|
label: children,
|
12448
12504
|
"aria-label": ariaLabel,
|
@@ -12451,7 +12507,7 @@ var RadioButton2 = React91.forwardRef(
|
|
12451
12507
|
disabled,
|
12452
12508
|
style: { gap: "0 8px" },
|
12453
12509
|
className: "Aquarium-RadioButton"
|
12454
|
-
}, !readOnly && /* @__PURE__ */
|
12510
|
+
}, !readOnly && /* @__PURE__ */ React92.createElement(RadioButton, __spreadProps(__spreadValues({
|
12455
12511
|
id,
|
12456
12512
|
ref,
|
12457
12513
|
name
|
@@ -12462,12 +12518,12 @@ var RadioButton2 = React91.forwardRef(
|
|
12462
12518
|
}
|
12463
12519
|
);
|
12464
12520
|
RadioButton2.displayName = "RadioButton";
|
12465
|
-
var RadioButtonSkeleton = () => /* @__PURE__ */
|
12521
|
+
var RadioButtonSkeleton = () => /* @__PURE__ */ React92.createElement("div", {
|
12466
12522
|
className: tw("flex gap-3")
|
12467
|
-
}, /* @__PURE__ */
|
12523
|
+
}, /* @__PURE__ */ React92.createElement(Skeleton, {
|
12468
12524
|
height: 20,
|
12469
12525
|
width: 20
|
12470
|
-
}), /* @__PURE__ */
|
12526
|
+
}), /* @__PURE__ */ React92.createElement(Skeleton, {
|
12471
12527
|
height: 20,
|
12472
12528
|
width: 150
|
12473
12529
|
}));
|
@@ -12475,10 +12531,10 @@ RadioButton2.Skeleton = RadioButtonSkeleton;
|
|
12475
12531
|
RadioButton2.Skeleton.displayName = "RadioButton.Skeleton";
|
12476
12532
|
|
12477
12533
|
// src/molecules/RadioButtonGroup/RadioButtonGroup.tsx
|
12478
|
-
import
|
12534
|
+
import React93 from "react";
|
12479
12535
|
import uniqueId8 from "lodash/uniqueId";
|
12480
12536
|
var isRadioButton = (c) => {
|
12481
|
-
return
|
12537
|
+
return React93.isValidElement(c) && c.type === RadioButton2;
|
12482
12538
|
};
|
12483
12539
|
var RadioButtonGroup = (_a) => {
|
12484
12540
|
var _b = _a, {
|
@@ -12501,7 +12557,7 @@ var RadioButtonGroup = (_a) => {
|
|
12501
12557
|
"children"
|
12502
12558
|
]);
|
12503
12559
|
var _a2;
|
12504
|
-
const [value, setValue] =
|
12560
|
+
const [value, setValue] = React93.useState((_a2 = _value != null ? _value : defaultValue) != null ? _a2 : "");
|
12505
12561
|
const errorMessageId = uniqueId8();
|
12506
12562
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
12507
12563
|
const labelControlProps = getLabelControlProps(props);
|
@@ -12512,14 +12568,14 @@ var RadioButtonGroup = (_a) => {
|
|
12512
12568
|
setValue(e.target.value);
|
12513
12569
|
onChange == null ? void 0 : onChange(e.target.value);
|
12514
12570
|
};
|
12515
|
-
const content =
|
12571
|
+
const content = React93.Children.map(children, (c) => {
|
12516
12572
|
var _a3, _b2, _c;
|
12517
12573
|
if (!isRadioButton(c)) {
|
12518
12574
|
return null;
|
12519
12575
|
}
|
12520
12576
|
const defaultChecked = defaultValue === void 0 ? void 0 : c.props.value === defaultValue;
|
12521
12577
|
const checked = value === void 0 ? void 0 : c.props.value === value;
|
12522
|
-
return
|
12578
|
+
return React93.cloneElement(c, {
|
12523
12579
|
name,
|
12524
12580
|
defaultChecked: (_a3 = c.props.defaultChecked) != null ? _a3 : defaultChecked,
|
12525
12581
|
checked: (_b2 = c.props.checked) != null ? _b2 : checked,
|
@@ -12528,13 +12584,13 @@ var RadioButtonGroup = (_a) => {
|
|
12528
12584
|
readOnly
|
12529
12585
|
});
|
12530
12586
|
});
|
12531
|
-
return /* @__PURE__ */
|
12587
|
+
return /* @__PURE__ */ React93.createElement(LabelControl, __spreadProps(__spreadValues(__spreadValues({
|
12532
12588
|
fieldset: true
|
12533
12589
|
}, labelControlProps), errorProps), {
|
12534
12590
|
className: "Aquarium-RadioButtonGroup"
|
12535
|
-
}), cols && /* @__PURE__ */
|
12591
|
+
}), cols && /* @__PURE__ */ React93.createElement(InputGroup, {
|
12536
12592
|
cols
|
12537
|
-
}, content), !cols && /* @__PURE__ */
|
12593
|
+
}, content), !cols && /* @__PURE__ */ React93.createElement(Flexbox, {
|
12538
12594
|
direction,
|
12539
12595
|
alignItems: "flex-start",
|
12540
12596
|
colGap: "8",
|
@@ -12543,12 +12599,12 @@ var RadioButtonGroup = (_a) => {
|
|
12543
12599
|
}, content));
|
12544
12600
|
};
|
12545
12601
|
var RadioButtonGroupSkeleton = ({ direction = "row", options = 2 }) => {
|
12546
|
-
return /* @__PURE__ */
|
12602
|
+
return /* @__PURE__ */ React93.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React93.createElement("div", {
|
12547
12603
|
className: tw("flex flex-wrap", {
|
12548
12604
|
"flex-row gap-8": direction === "row",
|
12549
12605
|
"flex-col gap-2": direction === "column"
|
12550
12606
|
})
|
12551
|
-
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */
|
12607
|
+
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */ React93.createElement(RadioButton2.Skeleton, {
|
12552
12608
|
key
|
12553
12609
|
}))));
|
12554
12610
|
};
|
@@ -12556,70 +12612,73 @@ RadioButtonGroup.Skeleton = RadioButtonGroupSkeleton;
|
|
12556
12612
|
RadioButtonGroup.Skeleton.displayName = "RadioButtonGroup.Skeleton";
|
12557
12613
|
|
12558
12614
|
// src/molecules/Section/Section.tsx
|
12559
|
-
import
|
12615
|
+
import React95 from "react";
|
12560
12616
|
import castArray4 from "lodash/castArray";
|
12617
|
+
import omit17 from "lodash/omit";
|
12561
12618
|
|
12562
12619
|
// src/atoms/Section/Section.tsx
|
12563
|
-
import
|
12620
|
+
import React94 from "react";
|
12564
12621
|
var Section3 = (_a) => {
|
12565
12622
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
12566
|
-
return /* @__PURE__ */
|
12623
|
+
return /* @__PURE__ */ React94.createElement(Box, __spreadValues({
|
12567
12624
|
borderColor: "grey-5",
|
12568
12625
|
borderWidth: "1px"
|
12569
12626
|
}, rest), children);
|
12570
12627
|
};
|
12571
12628
|
Section3.Header = (_a) => {
|
12572
12629
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12573
|
-
return /* @__PURE__ */
|
12630
|
+
return /* @__PURE__ */ React94.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12574
12631
|
className: classNames(tw("px-6 py-5 flex gap-5 justify-between items-center"), className)
|
12575
12632
|
}), children);
|
12576
12633
|
};
|
12577
12634
|
Section3.TitleContainer = (_a) => {
|
12578
12635
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12579
|
-
return /* @__PURE__ */
|
12636
|
+
return /* @__PURE__ */ React94.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12580
12637
|
className: classNames(tw("flex flex-col grow gap-2"), className)
|
12581
12638
|
}), children);
|
12582
12639
|
};
|
12583
12640
|
Section3.Title = (_a) => {
|
12584
12641
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
12585
|
-
return /* @__PURE__ */
|
12642
|
+
return /* @__PURE__ */ React94.createElement(Typography2.Subheading, __spreadProps(__spreadValues({}, rest), {
|
12586
12643
|
color: "black"
|
12587
12644
|
}), children);
|
12588
12645
|
};
|
12589
12646
|
Section3.Subtitle = (_a) => {
|
12590
12647
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
12591
|
-
return /* @__PURE__ */
|
12648
|
+
return /* @__PURE__ */ React94.createElement(Typography2.SmallText, __spreadProps(__spreadValues({}, rest), {
|
12592
12649
|
color: "grey-70"
|
12593
12650
|
}), children);
|
12594
12651
|
};
|
12595
12652
|
Section3.Actions = (_a) => {
|
12596
12653
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12597
|
-
return /* @__PURE__ */
|
12654
|
+
return /* @__PURE__ */ React94.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12598
12655
|
className: classNames(tw("flex gap-4 justify-end"), className)
|
12599
12656
|
}), children);
|
12600
12657
|
};
|
12601
12658
|
Section3.Body = (_a) => {
|
12602
12659
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12603
|
-
return /* @__PURE__ */
|
12660
|
+
return /* @__PURE__ */ React94.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12604
12661
|
className: classNames(tw("p-6"), className)
|
12605
|
-
}), /* @__PURE__ */
|
12662
|
+
}), /* @__PURE__ */ React94.createElement(Typography, {
|
12606
12663
|
htmlTag: "div",
|
12607
12664
|
color: "grey-70"
|
12608
12665
|
}, children));
|
12609
12666
|
};
|
12610
12667
|
|
12611
12668
|
// src/molecules/Section/Section.tsx
|
12612
|
-
var Section4 = ({ title, subtitle, actions, children }) => /* @__PURE__ */
|
12669
|
+
var Section4 = ({ title, subtitle, actions, children }) => /* @__PURE__ */ React95.createElement(Section3, {
|
12613
12670
|
className: "Aquarium-Section"
|
12614
|
-
}, title && /* @__PURE__ */
|
12615
|
-
|
12616
|
-
|
12617
|
-
|
12618
|
-
|
12619
|
-
|
12671
|
+
}, title && /* @__PURE__ */ React95.createElement(React95.Fragment, null, /* @__PURE__ */ React95.createElement(Section3.Header, null, /* @__PURE__ */ React95.createElement(Section3.TitleContainer, null, /* @__PURE__ */ React95.createElement(Section3.Title, null, title), subtitle && /* @__PURE__ */ React95.createElement(Section3.Subtitle, null, subtitle)), /* @__PURE__ */ React95.createElement(Section3.Actions, null, actions && castArray4(actions).filter(Boolean).map(
|
12672
|
+
(action) => !isLink(action) ? /* @__PURE__ */ React95.createElement(Button.Secondary, __spreadValues({
|
12673
|
+
key: action.text
|
12674
|
+
}, omit17(action, "text")), action.text) : /* @__PURE__ */ React95.createElement(Button.ExternalLink, __spreadValues({
|
12675
|
+
key: action.text,
|
12676
|
+
kind: "secondary"
|
12677
|
+
}, omit17(action, "text")), action.text)
|
12678
|
+
))), /* @__PURE__ */ React95.createElement(Divider2, null)), /* @__PURE__ */ React95.createElement(Section3.Body, null, children));
|
12620
12679
|
|
12621
12680
|
// src/molecules/SegmentedControl/SegmentedControl.tsx
|
12622
|
-
import
|
12681
|
+
import React96 from "react";
|
12623
12682
|
var SegmentedControl = (_a) => {
|
12624
12683
|
var _b = _a, {
|
12625
12684
|
children,
|
@@ -12636,7 +12695,7 @@ var SegmentedControl = (_a) => {
|
|
12636
12695
|
"selected",
|
12637
12696
|
"className"
|
12638
12697
|
]);
|
12639
|
-
return /* @__PURE__ */
|
12698
|
+
return /* @__PURE__ */ React96.createElement("button", __spreadProps(__spreadValues({
|
12640
12699
|
type: "button"
|
12641
12700
|
}, rest), {
|
12642
12701
|
className: classNames(
|
@@ -12667,11 +12726,11 @@ var SegmentedControlGroup = (_a) => {
|
|
12667
12726
|
"border border-grey-20 text-grey-50": variant === "outlined",
|
12668
12727
|
"bg-grey-0": variant === "raised"
|
12669
12728
|
});
|
12670
|
-
return /* @__PURE__ */
|
12729
|
+
return /* @__PURE__ */ React96.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12671
12730
|
className: classNames("Aquarium-SegmentedControl", classes2, className)
|
12672
|
-
}),
|
12731
|
+
}), React96.Children.map(
|
12673
12732
|
children,
|
12674
|
-
(child) =>
|
12733
|
+
(child) => React96.cloneElement(child, {
|
12675
12734
|
dense,
|
12676
12735
|
variant,
|
12677
12736
|
onClick: () => onChange(child.props.value),
|
@@ -12709,14 +12768,14 @@ var getCommonClassNames = (dense, selected) => tw(
|
|
12709
12768
|
);
|
12710
12769
|
|
12711
12770
|
// src/molecules/Stepper/Stepper.tsx
|
12712
|
-
import
|
12771
|
+
import React98 from "react";
|
12713
12772
|
|
12714
12773
|
// src/atoms/Stepper/Stepper.tsx
|
12715
|
-
import
|
12774
|
+
import React97 from "react";
|
12716
12775
|
var import_tick6 = __toESM(require_tick());
|
12717
12776
|
var Stepper = (_a) => {
|
12718
12777
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
12719
|
-
return /* @__PURE__ */
|
12778
|
+
return /* @__PURE__ */ React97.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12720
12779
|
className: classNames(className)
|
12721
12780
|
}));
|
12722
12781
|
};
|
@@ -12730,7 +12789,7 @@ var ConnectorContainer = (_a) => {
|
|
12730
12789
|
"completed",
|
12731
12790
|
"dense"
|
12732
12791
|
]);
|
12733
|
-
return /* @__PURE__ */
|
12792
|
+
return /* @__PURE__ */ React97.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12734
12793
|
className: classNames(
|
12735
12794
|
tw("absolute w-full -left-1/2", {
|
12736
12795
|
"top-[3px] px-[14px]": Boolean(dense),
|
@@ -12742,7 +12801,7 @@ var ConnectorContainer = (_a) => {
|
|
12742
12801
|
};
|
12743
12802
|
var Connector = (_a) => {
|
12744
12803
|
var _b = _a, { children, className, completed, dense } = _b, rest = __objRest(_b, ["children", "className", "completed", "dense"]);
|
12745
|
-
return /* @__PURE__ */
|
12804
|
+
return /* @__PURE__ */ React97.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12746
12805
|
className: classNames(
|
12747
12806
|
tw("w-full", {
|
12748
12807
|
"bg-grey-20": !completed,
|
@@ -12756,7 +12815,7 @@ var Connector = (_a) => {
|
|
12756
12815
|
};
|
12757
12816
|
var Step = (_a) => {
|
12758
12817
|
var _b = _a, { className, state } = _b, rest = __objRest(_b, ["className", "state"]);
|
12759
|
-
return /* @__PURE__ */
|
12818
|
+
return /* @__PURE__ */ React97.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12760
12819
|
className: classNames(
|
12761
12820
|
tw("flex flex-col items-center text-grey-90 relative text-center", {
|
12762
12821
|
"text-grey-20": state === "inactive"
|
@@ -12777,13 +12836,13 @@ var getDenseClassNames = (state) => tw("h-[8px] w-[8px]", {
|
|
12777
12836
|
});
|
12778
12837
|
var Indicator = (_a) => {
|
12779
12838
|
var _b = _a, { children, className, state, dense } = _b, rest = __objRest(_b, ["children", "className", "state", "dense"]);
|
12780
|
-
return /* @__PURE__ */
|
12839
|
+
return /* @__PURE__ */ React97.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12781
12840
|
className: classNames(
|
12782
12841
|
tw("rounded-full flex justify-center items-center mx-2 mb-3"),
|
12783
12842
|
dense ? getDenseClassNames(state) : getClassNames(state),
|
12784
12843
|
className
|
12785
12844
|
)
|
12786
|
-
}), state === "completed" ? /* @__PURE__ */
|
12845
|
+
}), state === "completed" ? /* @__PURE__ */ React97.createElement(InlineIcon, {
|
12787
12846
|
icon: import_tick6.default
|
12788
12847
|
}) : dense ? null : children);
|
12789
12848
|
};
|
@@ -12794,26 +12853,26 @@ Stepper.ConnectorContainer = ConnectorContainer;
|
|
12794
12853
|
|
12795
12854
|
// src/molecules/Stepper/Stepper.tsx
|
12796
12855
|
var Stepper2 = ({ children, activeIndex, dense }) => {
|
12797
|
-
const steps =
|
12798
|
-
return /* @__PURE__ */
|
12856
|
+
const steps = React98.Children.count(children);
|
12857
|
+
return /* @__PURE__ */ React98.createElement(Stepper, {
|
12799
12858
|
role: "list",
|
12800
12859
|
className: "Aquarium-Stepper"
|
12801
|
-
}, /* @__PURE__ */
|
12860
|
+
}, /* @__PURE__ */ React98.createElement(Template, {
|
12802
12861
|
columns: steps
|
12803
|
-
},
|
12862
|
+
}, React98.Children.map(children, (child, index) => {
|
12804
12863
|
if (!isComponentType(child, Step2)) {
|
12805
12864
|
return new Error("<Stepper> can only have <Stepper.Step> components as children");
|
12806
12865
|
} else {
|
12807
12866
|
const state = index > activeIndex ? "inactive" : index === activeIndex ? "active" : "completed";
|
12808
|
-
return /* @__PURE__ */
|
12867
|
+
return /* @__PURE__ */ React98.createElement(Stepper.Step, {
|
12809
12868
|
state,
|
12810
12869
|
"aria-current": state === "active" ? "step" : false,
|
12811
12870
|
role: "listitem"
|
12812
|
-
}, index > 0 && index <= steps && /* @__PURE__ */
|
12871
|
+
}, index > 0 && index <= steps && /* @__PURE__ */ React98.createElement(Stepper.ConnectorContainer, {
|
12813
12872
|
dense
|
12814
|
-
}, /* @__PURE__ */
|
12873
|
+
}, /* @__PURE__ */ React98.createElement(Stepper.ConnectorContainer.Connector, {
|
12815
12874
|
completed: state === "completed" || state === "active"
|
12816
|
-
})), /* @__PURE__ */
|
12875
|
+
})), /* @__PURE__ */ React98.createElement(Stepper.Step.Indicator, {
|
12817
12876
|
state,
|
12818
12877
|
dense
|
12819
12878
|
}, index + 1), child.props.children);
|
@@ -12826,16 +12885,16 @@ Step2.displayName = "Stepper.Step";
|
|
12826
12885
|
Stepper2.Step = Step2;
|
12827
12886
|
|
12828
12887
|
// src/molecules/Switch/Switch.tsx
|
12829
|
-
import
|
12888
|
+
import React100 from "react";
|
12830
12889
|
|
12831
12890
|
// src/atoms/Switch/Switch.tsx
|
12832
|
-
import
|
12833
|
-
var Switch =
|
12891
|
+
import React99 from "react";
|
12892
|
+
var Switch = React99.forwardRef(
|
12834
12893
|
(_a, ref) => {
|
12835
12894
|
var _b = _a, { id, children, name, disabled = false, readOnly = false } = _b, props = __objRest(_b, ["id", "children", "name", "disabled", "readOnly"]);
|
12836
|
-
return /* @__PURE__ */
|
12895
|
+
return /* @__PURE__ */ React99.createElement("span", {
|
12837
12896
|
className: tw("relative inline-flex justify-center items-center self-center group")
|
12838
|
-
}, /* @__PURE__ */
|
12897
|
+
}, /* @__PURE__ */ React99.createElement("input", __spreadProps(__spreadValues({
|
12839
12898
|
id,
|
12840
12899
|
ref,
|
12841
12900
|
type: "checkbox",
|
@@ -12847,14 +12906,14 @@ var Switch = React98.forwardRef(
|
|
12847
12906
|
"outline-none focus:border border-info-70 bg-grey-20",
|
12848
12907
|
"cursor-pointer disabled:cursor-not-allowed",
|
12849
12908
|
{
|
12850
|
-
"hover:bg-grey-30 checked:bg-
|
12851
|
-
"bg-grey-5 checked:opacity-40
|
12909
|
+
"hover:bg-grey-30 checked:bg-navyBlue-100 hover:checked:bg-navyBlue-100": !disabled,
|
12910
|
+
"bg-grey-5 checked:opacity-40": disabled
|
12852
12911
|
}
|
12853
12912
|
)
|
12854
12913
|
),
|
12855
12914
|
readOnly,
|
12856
12915
|
disabled
|
12857
|
-
})), /* @__PURE__ */
|
12916
|
+
})), /* @__PURE__ */ React99.createElement("span", {
|
12858
12917
|
className: tw(
|
12859
12918
|
"pointer-events-none rounded-full absolute inline-block transition duration-300 h-4 w-4 transform peer-checked/switch:translate-x-5",
|
12860
12919
|
"bg-white peer-disabled/switch:bg-grey-0 left-2 peer-checked/switch:left-1",
|
@@ -12867,12 +12926,12 @@ var Switch = React98.forwardRef(
|
|
12867
12926
|
);
|
12868
12927
|
|
12869
12928
|
// src/molecules/Switch/Switch.tsx
|
12870
|
-
var Switch2 =
|
12929
|
+
var Switch2 = React100.forwardRef(
|
12871
12930
|
(_a, ref) => {
|
12872
12931
|
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"]);
|
12873
12932
|
var _a2;
|
12874
12933
|
const isChecked = (_a2 = props.checked) != null ? _a2 : props.defaultChecked;
|
12875
|
-
return !readOnly || isChecked ? /* @__PURE__ */
|
12934
|
+
return !readOnly || isChecked ? /* @__PURE__ */ React100.createElement(ControlLabel, {
|
12876
12935
|
htmlFor: id,
|
12877
12936
|
label: children,
|
12878
12937
|
"aria-label": ariaLabel,
|
@@ -12881,7 +12940,7 @@ var Switch2 = React99.forwardRef(
|
|
12881
12940
|
disabled,
|
12882
12941
|
style: { gap: "0 8px" },
|
12883
12942
|
className: "Aquarium-Switch"
|
12884
|
-
}, !readOnly && /* @__PURE__ */
|
12943
|
+
}, !readOnly && /* @__PURE__ */ React100.createElement(Switch, __spreadProps(__spreadValues({
|
12885
12944
|
id,
|
12886
12945
|
ref,
|
12887
12946
|
name
|
@@ -12892,12 +12951,12 @@ var Switch2 = React99.forwardRef(
|
|
12892
12951
|
}
|
12893
12952
|
);
|
12894
12953
|
Switch2.displayName = "Switch";
|
12895
|
-
var SwitchSkeleton = () => /* @__PURE__ */
|
12954
|
+
var SwitchSkeleton = () => /* @__PURE__ */ React100.createElement("div", {
|
12896
12955
|
className: tw("flex gap-3")
|
12897
|
-
}, /* @__PURE__ */
|
12956
|
+
}, /* @__PURE__ */ React100.createElement(Skeleton, {
|
12898
12957
|
height: 20,
|
12899
12958
|
width: 35
|
12900
|
-
}), /* @__PURE__ */
|
12959
|
+
}), /* @__PURE__ */ React100.createElement(Skeleton, {
|
12901
12960
|
height: 20,
|
12902
12961
|
width: 150
|
12903
12962
|
}));
|
@@ -12905,7 +12964,7 @@ Switch2.Skeleton = SwitchSkeleton;
|
|
12905
12964
|
Switch2.Skeleton.displayName = "Switch.Skeleton ";
|
12906
12965
|
|
12907
12966
|
// src/molecules/SwitchGroup/SwitchGroup.tsx
|
12908
|
-
import
|
12967
|
+
import React101, { useState as useState11 } from "react";
|
12909
12968
|
import uniqueId9 from "lodash/uniqueId";
|
12910
12969
|
var SwitchGroup = (_a) => {
|
12911
12970
|
var _b = _a, {
|
@@ -12937,13 +12996,13 @@ var SwitchGroup = (_a) => {
|
|
12937
12996
|
setSelectedItems(updated);
|
12938
12997
|
onChange == null ? void 0 : onChange(updated);
|
12939
12998
|
};
|
12940
|
-
return /* @__PURE__ */
|
12999
|
+
return /* @__PURE__ */ React101.createElement(LabelControl, __spreadProps(__spreadValues(__spreadValues({
|
12941
13000
|
fieldset: true
|
12942
13001
|
}, labelControlProps), errorProps), {
|
12943
13002
|
className: "Aquarium-SwitchGroup"
|
12944
|
-
}), /* @__PURE__ */
|
13003
|
+
}), /* @__PURE__ */ React101.createElement(InputGroup, {
|
12945
13004
|
cols
|
12946
|
-
},
|
13005
|
+
}, React101.Children.map(children, (c) => {
|
12947
13006
|
var _a3, _b2, _c, _d;
|
12948
13007
|
if (!isComponentType(c, Switch2)) {
|
12949
13008
|
return null;
|
@@ -12951,7 +13010,7 @@ var SwitchGroup = (_a) => {
|
|
12951
13010
|
const str = (_a3 = c.props.value) == null ? void 0 : _a3.toString();
|
12952
13011
|
const defaultChecked = defaultValue === void 0 ? void 0 : str !== void 0 && defaultValue.includes(str);
|
12953
13012
|
const checked = value === void 0 ? void 0 : str !== void 0 && value.includes(str);
|
12954
|
-
return
|
13013
|
+
return React101.cloneElement(c, {
|
12955
13014
|
defaultChecked: (_b2 = c.props.defaultChecked) != null ? _b2 : defaultChecked,
|
12956
13015
|
checked: (_c = c.props.checked) != null ? _c : checked,
|
12957
13016
|
onChange: (_d = c.props.onChange) != null ? _d : handleChange,
|
@@ -12961,9 +13020,9 @@ var SwitchGroup = (_a) => {
|
|
12961
13020
|
})));
|
12962
13021
|
};
|
12963
13022
|
var SwitchGroupSkeleton = ({ options = 2 }) => {
|
12964
|
-
return /* @__PURE__ */
|
13023
|
+
return /* @__PURE__ */ React101.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React101.createElement("div", {
|
12965
13024
|
className: tw("flex flex-wrap flex-col gap-2")
|
12966
|
-
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */
|
13025
|
+
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */ React101.createElement(Switch2.Skeleton, {
|
12967
13026
|
key
|
12968
13027
|
}))));
|
12969
13028
|
};
|
@@ -12971,10 +13030,10 @@ SwitchGroup.Skeleton = SwitchGroupSkeleton;
|
|
12971
13030
|
SwitchGroup.Skeleton.displayName = "SwitchGroup.Skeleton";
|
12972
13031
|
|
12973
13032
|
// src/molecules/TagLabel/TagLabel.tsx
|
12974
|
-
import
|
13033
|
+
import React102 from "react";
|
12975
13034
|
var TagLabel = (_a) => {
|
12976
13035
|
var _b = _a, { title, dense = false } = _b, rest = __objRest(_b, ["title", "dense"]);
|
12977
|
-
return /* @__PURE__ */
|
13036
|
+
return /* @__PURE__ */ React102.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
12978
13037
|
className: classNames(
|
12979
13038
|
"Aquarium-TagLabel",
|
12980
13039
|
tw("rounded-full text-white bg-primary-70", {
|
@@ -12986,14 +13045,14 @@ var TagLabel = (_a) => {
|
|
12986
13045
|
};
|
12987
13046
|
|
12988
13047
|
// src/molecules/Textarea/Textarea.tsx
|
12989
|
-
import
|
12990
|
-
import
|
13048
|
+
import React103, { useRef as useRef13, useState as useState12 } from "react";
|
13049
|
+
import omit18 from "lodash/omit";
|
12991
13050
|
import toString2 from "lodash/toString";
|
12992
13051
|
import uniqueId10 from "lodash/uniqueId";
|
12993
|
-
var TextareaBase =
|
13052
|
+
var TextareaBase = React103.forwardRef(
|
12994
13053
|
(_a, ref) => {
|
12995
13054
|
var _b = _a, { readOnly = false, valid = true } = _b, props = __objRest(_b, ["readOnly", "valid"]);
|
12996
|
-
return /* @__PURE__ */
|
13055
|
+
return /* @__PURE__ */ React103.createElement("textarea", __spreadProps(__spreadValues({
|
12997
13056
|
ref
|
12998
13057
|
}, props), {
|
12999
13058
|
readOnly,
|
@@ -13001,25 +13060,25 @@ var TextareaBase = React102.forwardRef(
|
|
13001
13060
|
}));
|
13002
13061
|
}
|
13003
13062
|
);
|
13004
|
-
TextareaBase.Skeleton = () => /* @__PURE__ */
|
13063
|
+
TextareaBase.Skeleton = () => /* @__PURE__ */ React103.createElement(Skeleton, {
|
13005
13064
|
height: 58
|
13006
13065
|
});
|
13007
|
-
var Textarea =
|
13066
|
+
var Textarea = React103.forwardRef((props, ref) => {
|
13008
13067
|
var _a, _b, _c;
|
13009
13068
|
const [value, setValue] = useState12((_b = (_a = props.value) != null ? _a : props.defaultValue) != null ? _b : "");
|
13010
13069
|
const id = useRef13((_c = props.id) != null ? _c : `textarea-${uniqueId10()}`);
|
13011
13070
|
const errorMessageId = uniqueId10();
|
13012
13071
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
13013
13072
|
const _d = getLabelControlProps(props), { "data-testid": dataTestId } = _d, labelControlProps = __objRest(_d, ["data-testid"]);
|
13014
|
-
const baseProps =
|
13015
|
-
return /* @__PURE__ */
|
13073
|
+
const baseProps = omit18(props, Object.keys(labelControlProps));
|
13074
|
+
return /* @__PURE__ */ React103.createElement(LabelControl, __spreadProps(__spreadValues({
|
13016
13075
|
id: `${id.current}-label`,
|
13017
13076
|
htmlFor: id.current,
|
13018
13077
|
messageId: errorMessageId,
|
13019
13078
|
length: value !== void 0 ? toString2(value).length : void 0
|
13020
13079
|
}, labelControlProps), {
|
13021
13080
|
className: "Aquarium-Textarea"
|
13022
|
-
}), /* @__PURE__ */
|
13081
|
+
}), /* @__PURE__ */ React103.createElement(TextareaBase, __spreadProps(__spreadValues(__spreadValues({
|
13023
13082
|
ref
|
13024
13083
|
}, baseProps), errorProps), {
|
13025
13084
|
id: id.current,
|
@@ -13036,48 +13095,48 @@ var Textarea = React102.forwardRef((props, ref) => {
|
|
13036
13095
|
})));
|
13037
13096
|
});
|
13038
13097
|
Textarea.displayName = "Textarea";
|
13039
|
-
var TextAreaSkeleton = () => /* @__PURE__ */
|
13098
|
+
var TextAreaSkeleton = () => /* @__PURE__ */ React103.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React103.createElement(TextareaBase.Skeleton, null));
|
13040
13099
|
Textarea.Skeleton = TextAreaSkeleton;
|
13041
13100
|
Textarea.Skeleton.displayName = "Textarea.Skeleton";
|
13042
13101
|
|
13043
13102
|
// src/molecules/Timeline/Timeline.tsx
|
13044
|
-
import
|
13103
|
+
import React105 from "react";
|
13045
13104
|
|
13046
13105
|
// src/atoms/Timeline/Timeline.tsx
|
13047
|
-
import
|
13106
|
+
import React104 from "react";
|
13048
13107
|
var Timeline = (_a) => {
|
13049
13108
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13050
|
-
return /* @__PURE__ */
|
13109
|
+
return /* @__PURE__ */ React104.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13051
13110
|
className: classNames(tw("grid grid-cols-[16px_1fr] gap-x-4"), className)
|
13052
13111
|
}));
|
13053
13112
|
};
|
13054
13113
|
var Content2 = (_a) => {
|
13055
13114
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13056
|
-
return /* @__PURE__ */
|
13115
|
+
return /* @__PURE__ */ React104.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13057
13116
|
className: classNames(tw("pb-6"), className)
|
13058
13117
|
}));
|
13059
13118
|
};
|
13060
13119
|
var Separator2 = (_a) => {
|
13061
13120
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13062
|
-
return /* @__PURE__ */
|
13121
|
+
return /* @__PURE__ */ React104.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13063
13122
|
className: classNames(tw("flex items-center justify-center h-5 w-5"), className)
|
13064
13123
|
}));
|
13065
13124
|
};
|
13066
13125
|
var LineContainer = (_a) => {
|
13067
13126
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13068
|
-
return /* @__PURE__ */
|
13127
|
+
return /* @__PURE__ */ React104.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13069
13128
|
className: classNames(tw("flex justify-center py-1"), className)
|
13070
13129
|
}));
|
13071
13130
|
};
|
13072
13131
|
var Line = (_a) => {
|
13073
13132
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13074
|
-
return /* @__PURE__ */
|
13133
|
+
return /* @__PURE__ */ React104.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13075
13134
|
className: classNames(tw("w-1 bg-grey-5 h-full justify-self-center"), className)
|
13076
13135
|
}));
|
13077
13136
|
};
|
13078
13137
|
var Dot = (_a) => {
|
13079
13138
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
13080
|
-
return /* @__PURE__ */
|
13139
|
+
return /* @__PURE__ */ React104.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
13081
13140
|
className: classNames(tw("bg-grey-30 h-[6px] w-[6px] rounded"), className)
|
13082
13141
|
}));
|
13083
13142
|
};
|
@@ -13092,54 +13151,54 @@ var import_error5 = __toESM(require_error());
|
|
13092
13151
|
var import_time2 = __toESM(require_time());
|
13093
13152
|
var import_warningSign5 = __toESM(require_warningSign());
|
13094
13153
|
var TimelineItem = () => null;
|
13095
|
-
var Timeline2 = ({ children }) => /* @__PURE__ */
|
13154
|
+
var Timeline2 = ({ children }) => /* @__PURE__ */ React105.createElement("div", {
|
13096
13155
|
className: "Aquarium-Timeline"
|
13097
|
-
},
|
13156
|
+
}, React105.Children.map(children, (item) => {
|
13098
13157
|
if (!isComponentType(item, TimelineItem)) {
|
13099
13158
|
throw new Error("<Timeline> can only have <Timeline.Item> components as children");
|
13100
13159
|
} else {
|
13101
13160
|
const { props, key } = item;
|
13102
|
-
return /* @__PURE__ */
|
13161
|
+
return /* @__PURE__ */ React105.createElement(Timeline, {
|
13103
13162
|
key: key != null ? key : props.title
|
13104
|
-
}, /* @__PURE__ */
|
13163
|
+
}, /* @__PURE__ */ React105.createElement(Timeline.Separator, null, props.variant === "error" ? /* @__PURE__ */ React105.createElement(Icon, {
|
13105
13164
|
icon: import_error5.default,
|
13106
13165
|
color: "error-30"
|
13107
|
-
}) : props.variant === "warning" ? /* @__PURE__ */
|
13166
|
+
}) : props.variant === "warning" ? /* @__PURE__ */ React105.createElement(Icon, {
|
13108
13167
|
icon: import_warningSign5.default,
|
13109
13168
|
color: "warning-30"
|
13110
|
-
}) : props.variant === "info" ? /* @__PURE__ */
|
13169
|
+
}) : props.variant === "info" ? /* @__PURE__ */ React105.createElement(Icon, {
|
13111
13170
|
icon: import_time2.default,
|
13112
13171
|
color: "info-30"
|
13113
|
-
}) : /* @__PURE__ */
|
13172
|
+
}) : /* @__PURE__ */ React105.createElement(Timeline.Separator.Dot, null)), /* @__PURE__ */ React105.createElement(Typography2.Caption, {
|
13114
13173
|
color: "grey-50"
|
13115
|
-
}, props.title), /* @__PURE__ */
|
13174
|
+
}, props.title), /* @__PURE__ */ React105.createElement(Timeline.LineContainer, null, /* @__PURE__ */ React105.createElement(Timeline.LineContainer.Line, null)), /* @__PURE__ */ React105.createElement(Timeline.Content, null, /* @__PURE__ */ React105.createElement(Typography2.Small, null, props.children)));
|
13116
13175
|
}
|
13117
13176
|
}));
|
13118
|
-
var TimelineItemSkeleton = () => /* @__PURE__ */
|
13177
|
+
var TimelineItemSkeleton = () => /* @__PURE__ */ React105.createElement(Timeline, null, /* @__PURE__ */ React105.createElement(Timeline.Separator, null, /* @__PURE__ */ React105.createElement(Skeleton, {
|
13119
13178
|
width: 6,
|
13120
13179
|
height: 6,
|
13121
13180
|
rounded: true
|
13122
|
-
})), /* @__PURE__ */
|
13181
|
+
})), /* @__PURE__ */ React105.createElement(Skeleton, {
|
13123
13182
|
height: 12,
|
13124
13183
|
width: 120
|
13125
|
-
}), /* @__PURE__ */
|
13184
|
+
}), /* @__PURE__ */ React105.createElement(Timeline.LineContainer, null, /* @__PURE__ */ React105.createElement(Skeleton, {
|
13126
13185
|
width: 2,
|
13127
13186
|
height: "100%"
|
13128
|
-
})), /* @__PURE__ */
|
13187
|
+
})), /* @__PURE__ */ React105.createElement(Timeline.Content, null, /* @__PURE__ */ React105.createElement(Box, {
|
13129
13188
|
display: "flex",
|
13130
13189
|
flexDirection: "column",
|
13131
13190
|
gap: "3"
|
13132
|
-
}, /* @__PURE__ */
|
13191
|
+
}, /* @__PURE__ */ React105.createElement(Skeleton, {
|
13133
13192
|
height: 32,
|
13134
13193
|
width: "100%"
|
13135
|
-
}), /* @__PURE__ */
|
13194
|
+
}), /* @__PURE__ */ React105.createElement(Skeleton, {
|
13136
13195
|
height: 32,
|
13137
13196
|
width: "73%"
|
13138
|
-
}), /* @__PURE__ */
|
13197
|
+
}), /* @__PURE__ */ React105.createElement(Skeleton, {
|
13139
13198
|
height: 32,
|
13140
13199
|
width: "80%"
|
13141
13200
|
}))));
|
13142
|
-
var TimelineSkeleton = ({ items = 3 }) => /* @__PURE__ */
|
13201
|
+
var TimelineSkeleton = ({ items = 3 }) => /* @__PURE__ */ React105.createElement("div", null, Array.from({ length: items }).map((_, key) => /* @__PURE__ */ React105.createElement(TimelineItemSkeleton, {
|
13143
13202
|
key
|
13144
13203
|
})));
|
13145
13204
|
Timeline2.Item = TimelineItem;
|
@@ -13147,9 +13206,9 @@ Timeline2.Skeleton = TimelineSkeleton;
|
|
13147
13206
|
Timeline2.Skeleton.displayName = "Timeline.Skeleton";
|
13148
13207
|
|
13149
13208
|
// src/utils/table/useTableSelect.ts
|
13150
|
-
import
|
13209
|
+
import React106 from "react";
|
13151
13210
|
var useTableSelect = (data, { key }) => {
|
13152
|
-
const [selected, setSelected] =
|
13211
|
+
const [selected, setSelected] = React106.useState([]);
|
13153
13212
|
const allSelected = selected.length === data.length;
|
13154
13213
|
const isSelected = (dot) => selected.includes(dot[key]);
|
13155
13214
|
const selectAll = () => setSelected(data.map((dot) => dot[key]));
|