@aivenio/aquarium 1.67.0 → 1.68.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_variables.scss +1 -1
- package/dist/atoms.cjs +76 -67
- package/dist/atoms.mjs +76 -67
- package/dist/charts.cjs +2 -2
- package/dist/charts.mjs +2 -2
- package/dist/src/atoms/Alert/Alert.js +2 -2
- package/dist/src/atoms/Banner/Banner.js +2 -2
- package/dist/src/atoms/Card/Card.d.ts +3 -3
- package/dist/src/atoms/Card/Card.js +2 -2
- package/dist/src/atoms/Checkbox/Checkbox.js +2 -2
- package/dist/src/atoms/DropdownMenu/DropdownMenu.js +2 -2
- package/dist/src/atoms/Modal/Modal.js +2 -2
- package/dist/src/atoms/Navigation/Navigation.js +1 -1
- package/dist/src/atoms/PageHeader/PageHeader.js +3 -3
- package/dist/src/atoms/Section/Section.js +4 -4
- package/dist/src/atoms/Stepper/Stepper.js +3 -3
- package/dist/src/atoms/Table/Table.d.ts +2 -2
- package/dist/src/atoms/Table/Table.js +8 -8
- package/dist/src/charts/PieChart/ChartValue.js +1 -1
- package/dist/src/charts/Tooltip/Tooltip.js +2 -2
- package/dist/src/icons/warningSign.js +2 -2
- package/dist/src/molecules/Accordion/Accordion.js +2 -2
- package/dist/src/molecules/Box/Box.d.ts +4 -1
- package/dist/src/molecules/Box/Box.js +4 -4
- package/dist/src/molecules/Button/Button.js +1 -1
- package/dist/src/molecules/Card/Card.js +3 -3
- package/dist/src/molecules/Card/Compact.js +3 -3
- package/dist/src/molecules/Card/types.d.ts +3 -2
- package/dist/src/molecules/Chip/Chip.js +2 -2
- package/dist/src/molecules/ChoiceChip/ChoiceChip.js +3 -3
- package/dist/src/molecules/ControlLabel/ControlLabel.js +2 -2
- package/dist/src/molecules/DataList/DataList.js +63 -53
- package/dist/src/molecules/DataList/DataListComponents.d.ts +3 -1
- package/dist/src/molecules/DataList/DataListComponents.js +12 -4
- package/dist/src/molecules/DataTable/DataTable.js +42 -25
- package/dist/src/molecules/EmptyState/EmptyState.js +2 -2
- package/dist/src/molecules/List/List.js +1 -1
- package/dist/src/molecules/ListItem/ListItem.js +1 -1
- package/dist/src/molecules/MultiInput/InputChip.js +2 -2
- package/dist/src/molecules/Pagination/Pagination.js +4 -4
- package/dist/src/molecules/Tabs/Tabs.js +5 -3
- package/dist/src/molecules/Timeline/Timeline.js +2 -2
- package/dist/src/utils/ContrastRatio.js +7 -7
- package/dist/src/utils/stickyStyles.d.ts +64 -0
- package/dist/src/utils/stickyStyles.js +74 -0
- package/dist/styles.css +13 -15
- package/dist/system.cjs +829 -690
- package/dist/system.mjs +818 -679
- package/dist/tsconfig.module.tsbuildinfo +1 -1
- package/dist/types/designTokens.d.ts +2 -0
- package/dist/types/tailwindGenerated.d.ts +1 -1
- package/package.json +1 -1
package/dist/system.mjs
CHANGED
@@ -4709,7 +4709,7 @@ var require_warningSign = __commonJS({
|
|
4709
4709
|
"src/icons/warningSign.js"(exports) {
|
4710
4710
|
"use strict";
|
4711
4711
|
var data = {
|
4712
|
-
"body": '<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M11 8.25v3.
|
4712
|
+
"body": '<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M11 8.25v3.667M11 16l.009-1.5M9.73 3.567 2.191 16.59c-.418.723-.627 1.084-.596 1.38a.917.917 0 00.372.646c.241.176.659.176 1.493.176h15.08c.834 0 1.251 0 1.492-.176a.917.917 0 00.373-.646c.03-.296-.178-.657-.596-1.38l-7.54-13.023c-.417-.72-.625-1.08-.897-1.2a.917.917 0 00-.745 0c-.272.12-.48.48-.897 1.2Z"/>',
|
4713
4713
|
"left": 0,
|
4714
4714
|
"top": 0,
|
4715
4715
|
"width": 22,
|
@@ -4861,8 +4861,8 @@ import {
|
|
4861
4861
|
|
4862
4862
|
// src/utils/tailwind.ts
|
4863
4863
|
import originalClassNames from "classnames";
|
4864
|
-
function cleanClassNames(
|
4865
|
-
const tokens =
|
4864
|
+
function cleanClassNames(classNames12) {
|
4865
|
+
const tokens = classNames12.split(/\s+/);
|
4866
4866
|
return tokens.filter((item) => item).join(" ");
|
4867
4867
|
}
|
4868
4868
|
function tw(classesOrModifiers1, classesOrModifiers2, classesOrModifiers3, classesOrModifiers4, classesOrModifiers5, classesOrModifiers6, classesOrModifiers7, classesOrModifiers8, classesOrModifiers9, classesOrModifiers10) {
|
@@ -6077,8 +6077,8 @@ var Box = (_a) => {
|
|
6077
6077
|
const styles = useStyle({
|
6078
6078
|
padding,
|
6079
6079
|
display,
|
6080
|
-
color,
|
6081
|
-
borderColor: borderColor ? tailwind_theme_default.
|
6080
|
+
color: color ? tailwind_theme_default.textColor[color] : "",
|
6081
|
+
borderColor: borderColor ? tailwind_theme_default.borderColor[borderColor] : "",
|
6082
6082
|
borderRadius,
|
6083
6083
|
borderWidth,
|
6084
6084
|
justifyContent,
|
@@ -6120,11 +6120,7 @@ var FlexBox = (props) => /* @__PURE__ */ React5.createElement(Box, __spreadValue
|
|
6120
6120
|
}, props));
|
6121
6121
|
FlexBox.displayName = "Box.Flex";
|
6122
6122
|
Box.Flex = FlexBox;
|
6123
|
-
var BorderBox = createSimpleComponent(
|
6124
|
-
Box,
|
6125
|
-
{ className: "rounded border", borderColor: "grey-10" },
|
6126
|
-
"BorderBox"
|
6127
|
-
);
|
6123
|
+
var BorderBox = createSimpleComponent(Box, { className: "rounded border", borderColor: "muted" }, "BorderBox");
|
6128
6124
|
|
6129
6125
|
// src/molecules/Spacing/Spacing.tsx
|
6130
6126
|
var Spacing = (_a) => {
|
@@ -7084,7 +7080,7 @@ var COLOR_CLASSNAMES = {
|
|
7084
7080
|
"ghost": ghostButtonStyle,
|
7085
7081
|
"text": linkStyle,
|
7086
7082
|
"secondary-ghost": tw(
|
7087
|
-
"text-
|
7083
|
+
"text-default active:text-muted focus-visible:text-intense hover:text-intense disabled:text-inactive"
|
7088
7084
|
)
|
7089
7085
|
};
|
7090
7086
|
var LoadingSpinner = ({ size = "20px" }) => {
|
@@ -7539,7 +7535,7 @@ Alert.Title = (_a) => {
|
|
7539
7535
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
7540
7536
|
return /* @__PURE__ */ React18.createElement(Typography, __spreadProps(__spreadValues({}, rest), {
|
7541
7537
|
variant: "default-strong",
|
7542
|
-
color: "
|
7538
|
+
color: "intense",
|
7543
7539
|
className: classNames(tw("col-start-2"), className)
|
7544
7540
|
}), children);
|
7545
7541
|
};
|
@@ -7547,7 +7543,7 @@ Alert.Description = (_a) => {
|
|
7547
7543
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
7548
7544
|
return /* @__PURE__ */ React18.createElement(Typography, __spreadProps(__spreadValues({}, rest), {
|
7549
7545
|
variant: "small",
|
7550
|
-
color: "
|
7546
|
+
color: "default",
|
7551
7547
|
className: classNames(tw("col-start-2"), className)
|
7552
7548
|
}), children);
|
7553
7549
|
};
|
@@ -7923,7 +7919,7 @@ Banner3.Title = (_a) => {
|
|
7923
7919
|
var _b = _a, { children, className, layout } = _b, rest = __objRest(_b, ["children", "className", "layout"]);
|
7924
7920
|
return /* @__PURE__ */ React23.createElement(Typography, __spreadProps(__spreadValues({}, rest), {
|
7925
7921
|
variant: "subheading",
|
7926
|
-
color: "
|
7922
|
+
color: "intense",
|
7927
7923
|
className: classNames(
|
7928
7924
|
className,
|
7929
7925
|
tw({
|
@@ -8158,7 +8154,7 @@ var Chip2 = (_a) => {
|
|
8158
8154
|
"Aquarium-Chip",
|
8159
8155
|
tw({
|
8160
8156
|
"bg-muted text-default": !locked,
|
8161
|
-
"bg-
|
8157
|
+
"bg-muted text-inactive": locked
|
8162
8158
|
})
|
8163
8159
|
)
|
8164
8160
|
}, rest), icon && /* @__PURE__ */ React27.createElement(InlineIcon, {
|
@@ -8294,7 +8290,13 @@ var Label = (props) => {
|
|
8294
8290
|
}), children);
|
8295
8291
|
};
|
8296
8292
|
var ColorHighlight = (_a) => {
|
8297
|
-
var _b = _a, {
|
8293
|
+
var _b = _a, {
|
8294
|
+
color,
|
8295
|
+
className
|
8296
|
+
} = _b, rest = __objRest(_b, [
|
8297
|
+
"color",
|
8298
|
+
"className"
|
8299
|
+
]);
|
8298
8300
|
return /* @__PURE__ */ React29.createElement(Box, __spreadProps(__spreadValues({}, rest), {
|
8299
8301
|
backgroundColor: color,
|
8300
8302
|
className: classNames(tw("h-1 w-full absolute top-0 left-0 right-0"), className)
|
@@ -8344,7 +8346,7 @@ Card.Content = Content;
|
|
8344
8346
|
Card.Actions = Actions;
|
8345
8347
|
Card.ImageContainer = ImageContainer;
|
8346
8348
|
Card.Image = Image;
|
8347
|
-
Card.
|
8349
|
+
Card.ColorHighlight = ColorHighlight;
|
8348
8350
|
var isCardTitleComponent = (c) => {
|
8349
8351
|
return React29.isValidElement(c) && c.type === Card.Title;
|
8350
8352
|
};
|
@@ -8597,7 +8599,7 @@ var CompactCard = ({
|
|
8597
8599
|
disabled
|
8598
8600
|
};
|
8599
8601
|
const checkableElement = isRadioButton2 ? /* @__PURE__ */ React36.createElement(RadioButton, __spreadValues({}, inputProps)) : checkable ? /* @__PURE__ */ React36.createElement(Checkbox, __spreadValues({}, inputProps)) : void 0;
|
8600
|
-
const commonContent = /* @__PURE__ */ React36.createElement(React36.Fragment, null, color && /* @__PURE__ */ React36.createElement(Card.
|
8602
|
+
const commonContent = /* @__PURE__ */ React36.createElement(React36.Fragment, null, color && /* @__PURE__ */ React36.createElement(Card.ColorHighlight, {
|
8601
8603
|
color
|
8602
8604
|
}), chipElements ? /* @__PURE__ */ React36.createElement(CardInputWrapper, {
|
8603
8605
|
input: checkableElement
|
@@ -8611,7 +8613,7 @@ var CompactCard = ({
|
|
8611
8613
|
}, !chipElements ? /* @__PURE__ */ React36.createElement(CardInputWrapper, {
|
8612
8614
|
input: checkableElement
|
8613
8615
|
}, getTitleContent({ title, clampTitle })) : getTitleContent({ title, clampTitle }), /* @__PURE__ */ React36.createElement(Typography2.Caption, {
|
8614
|
-
color: "
|
8616
|
+
color: "default"
|
8615
8617
|
}, children))));
|
8616
8618
|
const commonProps = {
|
8617
8619
|
fullWidth,
|
@@ -8746,7 +8748,7 @@ var Card2 = ({
|
|
8746
8748
|
disabled
|
8747
8749
|
};
|
8748
8750
|
const checkableElement = isRadioButton2 ? /* @__PURE__ */ React37.createElement(RadioButton, __spreadValues({}, inputProps)) : checkable ? /* @__PURE__ */ React37.createElement(Checkbox, __spreadValues({}, inputProps)) : void 0;
|
8749
|
-
const commonContent = /* @__PURE__ */ React37.createElement(React37.Fragment, null, color && /* @__PURE__ */ React37.createElement(Card.
|
8751
|
+
const commonContent = /* @__PURE__ */ React37.createElement(React37.Fragment, null, color && /* @__PURE__ */ React37.createElement(Card.ColorHighlight, {
|
8750
8752
|
color
|
8751
8753
|
}), chipElements && /* @__PURE__ */ React37.createElement(CardInputWrapper, {
|
8752
8754
|
input: checkableElement
|
@@ -8755,7 +8757,7 @@ var Card2 = ({
|
|
8755
8757
|
}, iconElements) : iconElements, imageElement, /* @__PURE__ */ React37.createElement(Card.Content, null, !chipElements && !iconElements ? /* @__PURE__ */ React37.createElement(CardInputWrapper, {
|
8756
8758
|
input: checkableElement
|
8757
8759
|
}, getTitleContent({ title, clampTitle })) : getTitleContent({ title, clampTitle }), /* @__PURE__ */ React37.createElement(Typography2.Caption, {
|
8758
|
-
color: "
|
8760
|
+
color: "default"
|
8759
8761
|
}, children || description)));
|
8760
8762
|
const commonProps = {
|
8761
8763
|
fullWidth,
|
@@ -8994,7 +8996,7 @@ var ControlLabel = (_a) => {
|
|
8994
8996
|
}, rest), rtl ? labelEl : children, rtl ? children : labelEl, caption && /* @__PURE__ */ React39.createElement(Typography2, {
|
8995
8997
|
className: tw({ "col-start-2": !rtl }),
|
8996
8998
|
variant: "caption",
|
8997
|
-
color: disabled ? "
|
8999
|
+
color: disabled ? "inactive" : "default"
|
8998
9000
|
}, caption));
|
8999
9001
|
};
|
9000
9002
|
|
@@ -9501,8 +9503,8 @@ var ChoiceChip = (_a) => {
|
|
9501
9503
|
className: classNames(
|
9502
9504
|
"Aquarium-ChoiceChip",
|
9503
9505
|
tw("inline-flex items-center border rounded-sm transition whitespace-nowrap cursor-pointer", {
|
9504
|
-
"bg-body border-default text-
|
9505
|
-
"bg-muted border-
|
9506
|
+
"bg-body border-default text-default": !selected,
|
9507
|
+
"bg-muted border-intense text-intense": selected,
|
9506
9508
|
"typography-small py-2 px-3 gap-x-3": !dense,
|
9507
9509
|
"typography-caption py-1 px-2 gap-x-2": Boolean(dense)
|
9508
9510
|
})
|
@@ -9837,7 +9839,7 @@ var Container2 = ({ maxWidth = "xl", children }) => /* @__PURE__ */ React52.crea
|
|
9837
9839
|
}, children);
|
9838
9840
|
|
9839
9841
|
// src/molecules/DataList/DataList.tsx
|
9840
|
-
import
|
9842
|
+
import React72, { useRef as useRef7 } from "react";
|
9841
9843
|
import { useControlledState } from "@react-stately/utils";
|
9842
9844
|
import castArray2 from "lodash/castArray";
|
9843
9845
|
import compact from "lodash/compact";
|
@@ -10012,7 +10014,7 @@ var AccordionSummary = (_a) => {
|
|
10012
10014
|
padding: "4",
|
10013
10015
|
id: `${id}-summary`
|
10014
10016
|
}, rest), /* @__PURE__ */ React55.createElement(Typography2, null, title), /* @__PURE__ */ React55.createElement(Typography2.Small, {
|
10015
|
-
color: "
|
10017
|
+
color: "muted"
|
10016
10018
|
}, description), toggle);
|
10017
10019
|
};
|
10018
10020
|
var AccordionContainer = (_a) => {
|
@@ -10477,7 +10479,7 @@ var Pagination = ({
|
|
10477
10479
|
alignItems: "center",
|
10478
10480
|
gap: "4"
|
10479
10481
|
}, /* @__PURE__ */ React59.createElement(Typography2.Small, {
|
10480
|
-
color: "
|
10482
|
+
color: "muted"
|
10481
10483
|
}, "Items per page "), /* @__PURE__ */ React59.createElement("div", {
|
10482
10484
|
className: tw("max-w-[70px]")
|
10483
10485
|
}, /* @__PURE__ */ React59.createElement(SelectBase, {
|
@@ -10510,7 +10512,7 @@ var Pagination = ({
|
|
10510
10512
|
}), /* @__PURE__ */ React59.createElement(Box, {
|
10511
10513
|
paddingX: "4"
|
10512
10514
|
}, /* @__PURE__ */ React59.createElement(Typography2.Small, {
|
10513
|
-
color: "
|
10515
|
+
color: "default"
|
10514
10516
|
}, "Page")), /* @__PURE__ */ React59.createElement(InputBase, {
|
10515
10517
|
"aria-label": "Page",
|
10516
10518
|
className: classNames(tw("text-center max-w-[40px]"), "no-arrows"),
|
@@ -10532,7 +10534,7 @@ var Pagination = ({
|
|
10532
10534
|
}), /* @__PURE__ */ React59.createElement(Box, {
|
10533
10535
|
paddingX: "4"
|
10534
10536
|
}, /* @__PURE__ */ React59.createElement(Typography2.Small, {
|
10535
|
-
color: "
|
10537
|
+
color: "default"
|
10536
10538
|
}, "of ", totalPages)), /* @__PURE__ */ React59.createElement(Button.Icon, {
|
10537
10539
|
"aria-label": "Next",
|
10538
10540
|
onClick: () => onPageChange(currentPage + 1),
|
@@ -10686,7 +10688,7 @@ var List = (_a) => {
|
|
10686
10688
|
icon: import_loading3.default,
|
10687
10689
|
className: tw("text-muted")
|
10688
10690
|
}), /* @__PURE__ */ React61.createElement(Typography2.Small, {
|
10689
|
-
color: "
|
10691
|
+
color: "default"
|
10690
10692
|
}, loadingIndicator)), pagination && /* @__PURE__ */ React61.createElement(Pagination, __spreadValues(__spreadValues({}, paginationState), paginationProps))));
|
10691
10693
|
};
|
10692
10694
|
|
@@ -10698,7 +10700,7 @@ import React62 from "react";
|
|
10698
10700
|
var import_chevronDown4 = __toESM(require_chevronDown());
|
10699
10701
|
var import_chevronUp3 = __toESM(require_chevronUp());
|
10700
10702
|
var HeadContext = React62.createContext(null);
|
10701
|
-
var tableClassNames = tw("w-full relative typography-default border-spacing-0");
|
10703
|
+
var tableClassNames = tw("w-full relative typography-default border-spacing-0 border-separate");
|
10702
10704
|
var Table = (_a) => {
|
10703
10705
|
var _b = _a, { children, ariaLabel, className } = _b, rest = __objRest(_b, ["children", "ariaLabel", "className"]);
|
10704
10706
|
return /* @__PURE__ */ React62.createElement("table", __spreadProps(__spreadValues({}, rest), {
|
@@ -10746,25 +10748,29 @@ var getHeadCellClassNames = (sticky = true, stickyColumn) => {
|
|
10746
10748
|
})
|
10747
10749
|
) : common;
|
10748
10750
|
};
|
10749
|
-
var TableCell = (
|
10750
|
-
|
10751
|
-
|
10752
|
-
|
10753
|
-
|
10754
|
-
|
10755
|
-
|
10756
|
-
|
10757
|
-
|
10758
|
-
|
10759
|
-
|
10760
|
-
|
10761
|
-
|
10762
|
-
|
10763
|
-
|
10764
|
-
|
10765
|
-
|
10766
|
-
|
10767
|
-
|
10751
|
+
var TableCell = React62.forwardRef(
|
10752
|
+
(_a, ref) => {
|
10753
|
+
var _b = _a, { children, className, stickyColumn, align = "left" } = _b, rest = __objRest(_b, ["children", "className", "stickyColumn", "align"]);
|
10754
|
+
const headContext = React62.useContext(HeadContext);
|
10755
|
+
return headContext ? /* @__PURE__ */ React62.createElement("th", __spreadProps(__spreadValues({}, rest), {
|
10756
|
+
ref,
|
10757
|
+
className: classNames(
|
10758
|
+
cellClassNames,
|
10759
|
+
getHeadCellClassNames(headContext.sticky, stickyColumn),
|
10760
|
+
getAlignClassNames(align),
|
10761
|
+
className
|
10762
|
+
)
|
10763
|
+
}), children) : /* @__PURE__ */ React62.createElement("td", __spreadProps(__spreadValues({}, rest), {
|
10764
|
+
ref,
|
10765
|
+
className: classNames(
|
10766
|
+
cellClassNames,
|
10767
|
+
getBodyCellClassNames(true, stickyColumn),
|
10768
|
+
getAlignClassNames(align),
|
10769
|
+
className
|
10770
|
+
)
|
10771
|
+
}), children);
|
10772
|
+
}
|
10773
|
+
);
|
10768
10774
|
var TableSelectCell = (_a) => {
|
10769
10775
|
var _b = _a, { ariaLabel } = _b, props = __objRest(_b, ["ariaLabel"]);
|
10770
10776
|
return /* @__PURE__ */ React62.createElement(Table.Cell, {
|
@@ -10779,28 +10785,31 @@ var getSortCellButtonClassNames = (align) => tw("group flex items-center gap-x-4
|
|
10779
10785
|
var getSortCellIconClassNames = (active) => {
|
10780
10786
|
return tw("text-[9px]", active ? "text-default" : "text-inactive");
|
10781
10787
|
};
|
10782
|
-
var TableSortCell = (
|
10783
|
-
|
10784
|
-
|
10785
|
-
|
10786
|
-
|
10787
|
-
|
10788
|
-
|
10789
|
-
|
10790
|
-
|
10791
|
-
|
10792
|
-
|
10793
|
-
|
10794
|
-
"
|
10795
|
-
|
10796
|
-
|
10797
|
-
|
10798
|
-
|
10799
|
-
|
10800
|
-
|
10801
|
-
|
10802
|
-
|
10803
|
-
|
10788
|
+
var TableSortCell = React62.forwardRef(
|
10789
|
+
(_a, ref) => {
|
10790
|
+
var _b = _a, { children, direction = "none", onClick } = _b, rest = __objRest(_b, ["children", "direction", "onClick"]);
|
10791
|
+
return /* @__PURE__ */ React62.createElement(Table.Cell, __spreadProps(__spreadValues({}, rest), {
|
10792
|
+
"aria-sort": direction,
|
10793
|
+
ref
|
10794
|
+
}), /* @__PURE__ */ React62.createElement("span", {
|
10795
|
+
className: getSortCellButtonClassNames(rest.align),
|
10796
|
+
role: "button",
|
10797
|
+
tabIndex: -1,
|
10798
|
+
onClick
|
10799
|
+
}, children, /* @__PURE__ */ React62.createElement("div", {
|
10800
|
+
"data-sort-icons": true,
|
10801
|
+
className: tw("flex flex-col", {
|
10802
|
+
"invisible group-hover:visible": direction === "none"
|
10803
|
+
})
|
10804
|
+
}, /* @__PURE__ */ React62.createElement(InlineIcon, {
|
10805
|
+
icon: import_chevronUp3.default,
|
10806
|
+
className: getSortCellIconClassNames(direction === "ascending")
|
10807
|
+
}), /* @__PURE__ */ React62.createElement(InlineIcon, {
|
10808
|
+
icon: import_chevronDown4.default,
|
10809
|
+
className: getSortCellIconClassNames(direction === "descending")
|
10810
|
+
}))));
|
10811
|
+
}
|
10812
|
+
);
|
10804
10813
|
var Caption = ({ children }) => /* @__PURE__ */ React62.createElement(Typography2.Caption, {
|
10805
10814
|
htmlTag: "caption"
|
10806
10815
|
}, children);
|
@@ -10992,6 +11001,98 @@ DataList.Toolbar = {
|
|
10992
11001
|
SelectionCount: ToolbarSelectionCount
|
10993
11002
|
};
|
10994
11003
|
|
11004
|
+
// src/utils/stickyStyles.tsx
|
11005
|
+
import React64, { useMemo as useMemo3, useState as useState10 } from "react";
|
11006
|
+
import { animated as animated4, useScroll, useSpring as useSpring3 } from "@react-spring/web";
|
11007
|
+
import throttle from "lodash/throttle";
|
11008
|
+
function useStickyStyles(scrollProgress, axis, { borderColor, boxShadowColor }) {
|
11009
|
+
const { startValue, endValue } = useMemo3(() => {
|
11010
|
+
if (scrollProgress === null) {
|
11011
|
+
return { startValue: 0, endValue: 0 };
|
11012
|
+
}
|
11013
|
+
const startValue2 = scrollProgress;
|
11014
|
+
const endValue2 = 1 - scrollProgress;
|
11015
|
+
return { startValue: startValue2, endValue: endValue2 };
|
11016
|
+
}, [scrollProgress]);
|
11017
|
+
const springStyles = useSpring3({
|
11018
|
+
borderColorStart: `rgba(${borderColor}, ${startValue})`,
|
11019
|
+
borderColorEnd: `rgba(${borderColor}, ${endValue})`,
|
11020
|
+
boxShadowColorStart: `rgba(${boxShadowColor}, ${Math.min(startValue / 0.3, 0.1)})`,
|
11021
|
+
boxShadowColorEnd: `rgba(${boxShadowColor}, ${Math.min(endValue / 0.3, 0.1)})`
|
11022
|
+
});
|
11023
|
+
return axis === "horizontal" ? {
|
11024
|
+
left: {
|
11025
|
+
borderRight: springStyles.borderColorStart.to(
|
11026
|
+
(borderColor2) => `${Math.min(startValue / 0.3, 1)}px solid ${borderColor2}`
|
11027
|
+
),
|
11028
|
+
boxShadow: springStyles.boxShadowColorStart.to((boxShadowColor2) => `${boxShadowColor2} 7px 0px 5px 0px`)
|
11029
|
+
},
|
11030
|
+
right: {
|
11031
|
+
borderLeft: springStyles.borderColorEnd.to(
|
11032
|
+
(borderColor2) => `${Math.min(endValue / 0.3, 1)}px solid ${borderColor2}`
|
11033
|
+
),
|
11034
|
+
boxShadow: springStyles.boxShadowColorEnd.to((boxShadowColor2) => `${boxShadowColor2} -7px 0px 5px 0px`)
|
11035
|
+
}
|
11036
|
+
} : {
|
11037
|
+
top: {
|
11038
|
+
borderBottom: springStyles.borderColorStart.to(
|
11039
|
+
(borderColor2) => `${Math.min(startValue / 0.3, 1)}px solid ${borderColor2}`
|
11040
|
+
),
|
11041
|
+
boxShadow: springStyles.boxShadowColorStart.to((boxShadowColor2) => `${boxShadowColor2} 0px 7px 5px 0px`)
|
11042
|
+
},
|
11043
|
+
bottom: {
|
11044
|
+
borderTop: springStyles.borderColorEnd.to(
|
11045
|
+
(borderColor2) => `${Math.min(endValue / 0.3, 1)}px solid ${borderColor2}`
|
11046
|
+
),
|
11047
|
+
boxShadow: springStyles.boxShadowColorEnd.to((boxShadowColor2) => `${boxShadowColor2} 0px -7px 5px 0px`)
|
11048
|
+
}
|
11049
|
+
};
|
11050
|
+
}
|
11051
|
+
function useScrollProgress({ containerRef, skip }) {
|
11052
|
+
const [scrollState, setScrollState] = useState10(null);
|
11053
|
+
const throttledSetScrollState = throttle(({ scrollX, scrollXProgress }) => {
|
11054
|
+
setScrollState({ scrollX, scrollXProgress });
|
11055
|
+
}, 50);
|
11056
|
+
useScroll({
|
11057
|
+
container: containerRef,
|
11058
|
+
onChange: ({ value: { scrollX, scrollXProgress } }) => {
|
11059
|
+
throttledSetScrollState({ scrollX, scrollXProgress });
|
11060
|
+
},
|
11061
|
+
default: {
|
11062
|
+
immediate: true
|
11063
|
+
},
|
11064
|
+
pause: skip
|
11065
|
+
});
|
11066
|
+
const isContainerUnscrollable = scrollState && scrollState.scrollX === 0 && (scrollState == null ? void 0 : scrollState.scrollXProgress) === 1;
|
11067
|
+
if (!scrollState || isContainerUnscrollable) {
|
11068
|
+
return null;
|
11069
|
+
}
|
11070
|
+
return scrollState.scrollXProgress;
|
11071
|
+
}
|
11072
|
+
function createAnimatedCell({
|
11073
|
+
cellElement,
|
11074
|
+
stickyStyles,
|
11075
|
+
stickyColumn
|
11076
|
+
}) {
|
11077
|
+
if (!stickyColumn || !stickyStyles) {
|
11078
|
+
return cellElement;
|
11079
|
+
}
|
11080
|
+
const AnimatedCell = animated4(cellElement.type);
|
11081
|
+
return /* @__PURE__ */ React64.createElement(AnimatedCell, __spreadProps(__spreadValues({}, cellElement.props), {
|
11082
|
+
key: cellElement.key,
|
11083
|
+
style: __spreadValues(__spreadValues({}, cellElement.props.style), stickyStyles[stickyColumn])
|
11084
|
+
}), cellElement.props.children);
|
11085
|
+
}
|
11086
|
+
function useScrollStyles({
|
11087
|
+
containerRef,
|
11088
|
+
skip = false,
|
11089
|
+
direction = "horizontal",
|
11090
|
+
options = { borderColor: "210, 210, 214", boxShadowColor: "58, 58, 68" }
|
11091
|
+
}) {
|
11092
|
+
const scrollXProgress = useScrollProgress({ containerRef, skip });
|
11093
|
+
return useStickyStyles(scrollXProgress, direction, options);
|
11094
|
+
}
|
11095
|
+
|
10995
11096
|
// src/utils/table/types.ts
|
10996
11097
|
import isArray2 from "lodash/isArray";
|
10997
11098
|
var areRowsGrouped = (rows) => {
|
@@ -11027,11 +11128,11 @@ function isOnSortChangedDirection(value) {
|
|
11027
11128
|
}
|
11028
11129
|
|
11029
11130
|
// src/utils/table/useTableSort.tsx
|
11030
|
-
import
|
11131
|
+
import React65 from "react";
|
11031
11132
|
var getDefaultSort = (props) => "defaultSort" in props ? props.defaultSort : "column" in props && "direction" in props && Object.keys(props).length === 2 ? { column: props.column, direction: props.direction } : void 0;
|
11032
11133
|
var useTableSort = (props) => {
|
11033
11134
|
const onSortChanged = props && "onSortChanged" in props ? props.onSortChanged : void 0;
|
11034
|
-
const [sort, setSort] =
|
11135
|
+
const [sort, setSort] = React65.useState(props && getDefaultSort(props));
|
11035
11136
|
const setSortAndEmitOnSortChangedEvent = (sort2) => {
|
11036
11137
|
setSort(sort2);
|
11037
11138
|
if (onSortChanged) {
|
@@ -11072,11 +11173,11 @@ var sortRowsBy = (rows, sort) => {
|
|
11072
11173
|
};
|
11073
11174
|
|
11074
11175
|
// src/molecules/DataList/DataListComponents.tsx
|
11075
|
-
import
|
11176
|
+
import React68 from "react";
|
11076
11177
|
import isFunction from "lodash/isFunction";
|
11077
11178
|
|
11078
11179
|
// src/molecules/DropdownMenu/DropdownMenu.tsx
|
11079
|
-
import
|
11180
|
+
import React67 from "react";
|
11080
11181
|
import { useFilter } from "@react-aria/i18n";
|
11081
11182
|
import { PressResponder, usePress } from "@react-aria/interactions";
|
11082
11183
|
import { useMenu, useMenuItem, useMenuSection, useMenuTrigger } from "@react-aria/menu";
|
@@ -11088,12 +11189,12 @@ import { useTreeState } from "@react-stately/tree";
|
|
11088
11189
|
import omit7 from "lodash/omit";
|
11089
11190
|
|
11090
11191
|
// src/atoms/DropdownMenu/DropdownMenu.tsx
|
11091
|
-
import
|
11192
|
+
import React66 from "react";
|
11092
11193
|
var import_tick5 = __toESM(require_tick());
|
11093
|
-
var DropdownMenu =
|
11194
|
+
var DropdownMenu = React66.forwardRef(
|
11094
11195
|
(_a, ref) => {
|
11095
11196
|
var _b = _a, { minHeight, maxHeight = "100%", minWidth = "125px", maxWidth, className, children } = _b, props = __objRest(_b, ["minHeight", "maxHeight", "minWidth", "maxWidth", "className", "children"]);
|
11096
|
-
return /* @__PURE__ */
|
11197
|
+
return /* @__PURE__ */ React66.createElement("div", __spreadValues({
|
11097
11198
|
ref,
|
11098
11199
|
style: { minHeight, maxHeight, minWidth, maxWidth },
|
11099
11200
|
className: classNames(
|
@@ -11103,35 +11204,35 @@ var DropdownMenu = React65.forwardRef(
|
|
11103
11204
|
}, props), children);
|
11104
11205
|
}
|
11105
11206
|
);
|
11106
|
-
var ContentContainer = ({ children }) => /* @__PURE__ */
|
11207
|
+
var ContentContainer = ({ children }) => /* @__PURE__ */ React66.createElement("div", {
|
11107
11208
|
className: tw("p-3 overflow-y-auto overflow-x-hidden")
|
11108
11209
|
}, children);
|
11109
11210
|
DropdownMenu.ContentContainer = ContentContainer;
|
11110
|
-
var List2 =
|
11211
|
+
var List2 = React66.forwardRef(
|
11111
11212
|
(_a, ref) => {
|
11112
11213
|
var _b = _a, { children, className } = _b, props = __objRest(_b, ["children", "className"]);
|
11113
|
-
return /* @__PURE__ */
|
11214
|
+
return /* @__PURE__ */ React66.createElement("ul", __spreadValues({
|
11114
11215
|
ref,
|
11115
11216
|
className: classNames(className, "outline-none ring-0")
|
11116
11217
|
}, props), children);
|
11117
11218
|
}
|
11118
11219
|
);
|
11119
11220
|
DropdownMenu.List = List2;
|
11120
|
-
var Group2 =
|
11221
|
+
var Group2 = React66.forwardRef(
|
11121
11222
|
(_a, ref) => {
|
11122
11223
|
var _b = _a, { className, title, titleProps, children } = _b, props = __objRest(_b, ["className", "title", "titleProps", "children"]);
|
11123
|
-
return /* @__PURE__ */
|
11224
|
+
return /* @__PURE__ */ React66.createElement("li", __spreadValues({
|
11124
11225
|
ref
|
11125
|
-
}, props), title && /* @__PURE__ */
|
11226
|
+
}, props), title && /* @__PURE__ */ React66.createElement("div", __spreadValues({
|
11126
11227
|
className: classNames(className, "p-3 text-inactive uppercase cursor-default typography-caption")
|
11127
11228
|
}, titleProps), title), children);
|
11128
11229
|
}
|
11129
11230
|
);
|
11130
11231
|
DropdownMenu.Group = Group2;
|
11131
|
-
var Item3 =
|
11232
|
+
var Item3 = React66.forwardRef(
|
11132
11233
|
(_a, ref) => {
|
11133
11234
|
var _b = _a, { kind, highlighted, selected, className, icon, showNotification = false, children } = _b, props = __objRest(_b, ["kind", "highlighted", "selected", "className", "icon", "showNotification", "children"]);
|
11134
|
-
return /* @__PURE__ */
|
11235
|
+
return /* @__PURE__ */ React66.createElement("li", __spreadValues({
|
11135
11236
|
ref,
|
11136
11237
|
className: classNames(className, "flex items-center gap-x-3 p-3 outline-none", {
|
11137
11238
|
"cursor-pointer hover:bg-muted": !props.disabled,
|
@@ -11139,32 +11240,32 @@ var Item3 = React65.forwardRef(
|
|
11139
11240
|
"text-primary-intense": kind === "action",
|
11140
11241
|
"text-inactive cursor-not-allowed": props.disabled
|
11141
11242
|
})
|
11142
|
-
}, props), icon && showNotification && /* @__PURE__ */
|
11243
|
+
}, props), icon && showNotification && /* @__PURE__ */ React66.createElement(Badge.Notification, null, /* @__PURE__ */ React66.createElement(InlineIcon, {
|
11143
11244
|
icon
|
11144
|
-
})), icon && !showNotification && /* @__PURE__ */
|
11245
|
+
})), icon && !showNotification && /* @__PURE__ */ React66.createElement(InlineIcon, {
|
11145
11246
|
icon
|
11146
|
-
}), /* @__PURE__ */
|
11247
|
+
}), /* @__PURE__ */ React66.createElement("span", {
|
11147
11248
|
className: tw("grow")
|
11148
|
-
}, children), selected && /* @__PURE__ */
|
11249
|
+
}, children), selected && /* @__PURE__ */ React66.createElement(InlineIcon, {
|
11149
11250
|
icon: import_tick5.default
|
11150
11251
|
}));
|
11151
11252
|
}
|
11152
11253
|
);
|
11153
11254
|
DropdownMenu.Item = Item3;
|
11154
|
-
var Description = ({ disabled, children }) => /* @__PURE__ */
|
11155
|
-
color: disabled ? "
|
11255
|
+
var Description = ({ disabled, children }) => /* @__PURE__ */ React66.createElement(Typography2.Caption, {
|
11256
|
+
color: disabled ? "inactive" : "muted"
|
11156
11257
|
}, children);
|
11157
11258
|
DropdownMenu.Description = Description;
|
11158
11259
|
var Separator = (_a) => {
|
11159
11260
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
11160
|
-
return /* @__PURE__ */
|
11261
|
+
return /* @__PURE__ */ React66.createElement("li", __spreadProps(__spreadValues({}, props), {
|
11161
11262
|
className: classNames(className, tw("m-3 block bg-default h-[1px]"))
|
11162
11263
|
}));
|
11163
11264
|
};
|
11164
11265
|
DropdownMenu.Separator = Separator;
|
11165
11266
|
var EmptyStateContainer2 = (_a) => {
|
11166
11267
|
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
11167
|
-
return /* @__PURE__ */
|
11268
|
+
return /* @__PURE__ */ React66.createElement("div", __spreadValues({
|
11168
11269
|
className: classNames(tw("border border-dashed border-default p-3"), className)
|
11169
11270
|
}, props), children);
|
11170
11271
|
};
|
@@ -11226,23 +11327,23 @@ var DropdownMenu2 = (_a) => {
|
|
11226
11327
|
"footer",
|
11227
11328
|
"children"
|
11228
11329
|
]);
|
11229
|
-
const triggerRef =
|
11330
|
+
const triggerRef = React67.useRef(null);
|
11230
11331
|
const [trigger, items] = extractTriggerAndItems(children);
|
11231
11332
|
const state = useMenuTriggerState(props);
|
11232
11333
|
const { menuTriggerProps, menuProps } = useMenuTrigger({}, state, triggerRef);
|
11233
|
-
return /* @__PURE__ */
|
11334
|
+
return /* @__PURE__ */ React67.createElement("div", null, /* @__PURE__ */ React67.createElement(PressResponder, __spreadValues({
|
11234
11335
|
ref: triggerRef,
|
11235
11336
|
onPress: () => state.toggle()
|
11236
|
-
}, omit7(menuTriggerProps, ["id", "aria-expanded"])), /* @__PURE__ */
|
11337
|
+
}, omit7(menuTriggerProps, ["id", "aria-expanded"])), /* @__PURE__ */ React67.createElement(TriggerWrapper, {
|
11237
11338
|
"aria-expanded": menuTriggerProps["aria-expanded"],
|
11238
11339
|
disabled
|
11239
|
-
}, trigger.props.children)), state.isOpen && /* @__PURE__ */
|
11340
|
+
}, trigger.props.children)), state.isOpen && /* @__PURE__ */ React67.createElement(PopoverOverlay, {
|
11240
11341
|
className: "Aquarium-DropdownMenu",
|
11241
11342
|
triggerRef,
|
11242
11343
|
state,
|
11243
11344
|
placement,
|
11244
11345
|
focusable: false
|
11245
|
-
}, /* @__PURE__ */
|
11346
|
+
}, /* @__PURE__ */ React67.createElement(MenuWrapper, __spreadValues({
|
11246
11347
|
onAction,
|
11247
11348
|
selectionMode,
|
11248
11349
|
selection,
|
@@ -11270,13 +11371,13 @@ DropdownMenu2.Section = Section;
|
|
11270
11371
|
DropdownMenu2.Section.displayName = "DropdownMenu.Section";
|
11271
11372
|
var TriggerWrapper = (_a) => {
|
11272
11373
|
var _b = _a, { children, disabled } = _b, props = __objRest(_b, ["children", "disabled"]);
|
11273
|
-
const ref =
|
11374
|
+
const ref = React67.useRef(null);
|
11274
11375
|
const { pressProps } = usePress(__spreadProps(__spreadValues({}, props), { isDisabled: disabled, ref }));
|
11275
|
-
const trigger =
|
11276
|
-
if (!trigger || !
|
11376
|
+
const trigger = React67.Children.only(children);
|
11377
|
+
if (!trigger || !React67.isValidElement(trigger)) {
|
11277
11378
|
throw new Error("<DropdownMenu.Trigger> must have valid child");
|
11278
11379
|
}
|
11279
|
-
return
|
11380
|
+
return React67.cloneElement(trigger, __spreadValues({ ref }, mergeProps2(pressProps, props)));
|
11280
11381
|
};
|
11281
11382
|
var isSectionNode = (item) => item.type === "section";
|
11282
11383
|
var isItemNode = (item) => item.type === "item";
|
@@ -11302,7 +11403,7 @@ var MenuWrapper = (_a) => {
|
|
11302
11403
|
"header",
|
11303
11404
|
"footer"
|
11304
11405
|
]);
|
11305
|
-
const ref =
|
11406
|
+
const ref = React67.useRef(null);
|
11306
11407
|
const disabledKeys = getDisabledItemKeys(props.children);
|
11307
11408
|
const state = useTreeState(__spreadValues({
|
11308
11409
|
disabledKeys,
|
@@ -11310,40 +11411,40 @@ var MenuWrapper = (_a) => {
|
|
11310
11411
|
}, props));
|
11311
11412
|
const { menuProps } = useMenu(props, state, ref);
|
11312
11413
|
const { contains } = useFilter({ sensitivity: "base" });
|
11313
|
-
const [search, setSearch] =
|
11314
|
-
const searchInputRef =
|
11315
|
-
const filteredCollection =
|
11414
|
+
const [search, setSearch] = React67.useState("");
|
11415
|
+
const searchInputRef = React67.useRef(null);
|
11416
|
+
const filteredCollection = React67.useMemo(
|
11316
11417
|
() => searchable ? filterCollection(state.collection, search, contains) : state.collection,
|
11317
11418
|
[searchable, state.collection, search, contains]
|
11318
11419
|
);
|
11319
|
-
|
11420
|
+
React67.useEffect(() => {
|
11320
11421
|
var _a2;
|
11321
11422
|
if (searchable) {
|
11322
11423
|
(_a2 = searchInputRef.current) == null ? void 0 : _a2.focus();
|
11323
11424
|
}
|
11324
11425
|
}, [searchable]);
|
11325
|
-
return /* @__PURE__ */
|
11426
|
+
return /* @__PURE__ */ React67.createElement(DropdownMenu, {
|
11326
11427
|
minWidth,
|
11327
11428
|
maxWidth,
|
11328
11429
|
minHeight,
|
11329
11430
|
maxHeight
|
11330
|
-
}, header, /* @__PURE__ */
|
11431
|
+
}, header, /* @__PURE__ */ React67.createElement(DropdownMenu.ContentContainer, null, searchable && /* @__PURE__ */ React67.createElement(SearchInput, {
|
11331
11432
|
"aria-label": "search",
|
11332
11433
|
value: search,
|
11333
11434
|
onChange: (e) => setSearch(e.target.value),
|
11334
11435
|
className: tw("mb-5"),
|
11335
11436
|
ref: searchInputRef
|
11336
|
-
}), filteredCollection.size === 0 && emptyState && /* @__PURE__ */
|
11437
|
+
}), filteredCollection.size === 0 && emptyState && /* @__PURE__ */ React67.createElement(DropdownMenu.EmptyStateContainer, null, emptyState), /* @__PURE__ */ React67.createElement(DropdownMenu.List, __spreadValues({
|
11337
11438
|
ref
|
11338
11439
|
}, menuProps), Array.from(filteredCollection).map((item) => {
|
11339
11440
|
if (isSectionNode(item)) {
|
11340
|
-
return /* @__PURE__ */
|
11441
|
+
return /* @__PURE__ */ React67.createElement(SectionWrapper, {
|
11341
11442
|
key: item.key,
|
11342
11443
|
section: item,
|
11343
11444
|
state
|
11344
11445
|
});
|
11345
11446
|
} else if (isItemNode(item)) {
|
11346
|
-
return /* @__PURE__ */
|
11447
|
+
return /* @__PURE__ */ React67.createElement(ItemWrapper, {
|
11347
11448
|
key: item.key,
|
11348
11449
|
item,
|
11349
11450
|
state
|
@@ -11352,14 +11453,14 @@ var MenuWrapper = (_a) => {
|
|
11352
11453
|
}))), footer);
|
11353
11454
|
};
|
11354
11455
|
var ItemWrapper = ({ item, state }) => {
|
11355
|
-
const ref =
|
11456
|
+
const ref = React67.useRef(null);
|
11356
11457
|
const { menuItemProps, descriptionProps, isSelected, isFocused, isDisabled } = useMenuItem(
|
11357
11458
|
{ key: item.key, closeOnSelect: item.props.closeOnSelect, ["aria-label"]: item["aria-label"] },
|
11358
11459
|
state,
|
11359
11460
|
ref
|
11360
11461
|
);
|
11361
11462
|
const { icon, description, kind = "default", showNotification = false } = item.props;
|
11362
|
-
return /* @__PURE__ */
|
11463
|
+
return /* @__PURE__ */ React67.createElement(DropdownMenu.Item, __spreadProps(__spreadValues({
|
11363
11464
|
ref
|
11364
11465
|
}, menuItemProps), {
|
11365
11466
|
kind,
|
@@ -11368,7 +11469,7 @@ var ItemWrapper = ({ item, state }) => {
|
|
11368
11469
|
disabled: isDisabled,
|
11369
11470
|
icon,
|
11370
11471
|
showNotification
|
11371
|
-
}), item.rendered, description && /* @__PURE__ */
|
11472
|
+
}), item.rendered, description && /* @__PURE__ */ React67.createElement(DropdownMenu.Description, __spreadValues({
|
11372
11473
|
disabled: isDisabled
|
11373
11474
|
}, descriptionProps), description));
|
11374
11475
|
};
|
@@ -11380,24 +11481,24 @@ var SectionWrapper = ({ section, state }) => {
|
|
11380
11481
|
const { separatorProps } = useSeparator({
|
11381
11482
|
elementType: "li"
|
11382
11483
|
});
|
11383
|
-
return /* @__PURE__ */
|
11484
|
+
return /* @__PURE__ */ React67.createElement(React67.Fragment, null, section.key !== state.collection.getFirstKey() && /* @__PURE__ */ React67.createElement(DropdownMenu.Separator, __spreadValues({}, separatorProps)), /* @__PURE__ */ React67.createElement(DropdownMenu.Group, __spreadValues({
|
11384
11485
|
title: section.rendered,
|
11385
11486
|
titleProps: headingProps
|
11386
|
-
}, itemProps), /* @__PURE__ */
|
11487
|
+
}, itemProps), /* @__PURE__ */ React67.createElement("ul", __spreadValues({}, groupProps), Array.from(section.childNodes).map((node) => /* @__PURE__ */ React67.createElement(ItemWrapper, {
|
11387
11488
|
key: node.key,
|
11388
11489
|
item: node,
|
11389
11490
|
state
|
11390
11491
|
})))));
|
11391
11492
|
};
|
11392
11493
|
var extractTriggerAndItems = (children) => {
|
11393
|
-
const [trigger, items] =
|
11494
|
+
const [trigger, items] = React67.Children.toArray(children);
|
11394
11495
|
if (!isComponentType(trigger, MenuTrigger) || !isComponentType(items, MenuItems)) {
|
11395
11496
|
throw new Error("<DropdownMenu> must have <DropdownMenu.Trigger> and <DropdownMenu.Items> defined");
|
11396
11497
|
}
|
11397
11498
|
return [trigger, items];
|
11398
11499
|
};
|
11399
11500
|
var getDisabledItemKeys = (children) => {
|
11400
|
-
const keys =
|
11501
|
+
const keys = React67.Children.map(children, (child) => {
|
11401
11502
|
var _a, _b;
|
11402
11503
|
if (!child || typeof child === "function") {
|
11403
11504
|
return null;
|
@@ -11438,13 +11539,13 @@ var DataListRowMenu = ({
|
|
11438
11539
|
return null;
|
11439
11540
|
}
|
11440
11541
|
const menuContent = isFunction(menu) ? menu(row, index) : menu;
|
11441
|
-
return /* @__PURE__ */
|
11542
|
+
return /* @__PURE__ */ React68.createElement(DataList.Cell, {
|
11442
11543
|
align: "right"
|
11443
|
-
}, menuContent && /* @__PURE__ */
|
11544
|
+
}, menuContent && /* @__PURE__ */ React68.createElement(DropdownMenu2, {
|
11444
11545
|
placement: defaultContextualMenuPlacement,
|
11445
11546
|
onAction: (action) => onAction == null ? void 0 : onAction(action, row, index),
|
11446
11547
|
onOpenChange: onMenuOpenChange
|
11447
|
-
}, /* @__PURE__ */
|
11548
|
+
}, /* @__PURE__ */ React68.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ React68.createElement(Button.Icon, {
|
11448
11549
|
"aria-label": menuAriaLabel,
|
11449
11550
|
icon: import_more2.default
|
11450
11551
|
})), menuContent));
|
@@ -11459,22 +11560,30 @@ var DataListRow = ({
|
|
11459
11560
|
disabled,
|
11460
11561
|
renderFirstColumn,
|
11461
11562
|
additionalRowProps = () => ({}),
|
11462
|
-
additionalColumnProps = () => ({})
|
11563
|
+
additionalColumnProps = () => ({}),
|
11564
|
+
stickyStyles
|
11463
11565
|
}) => {
|
11464
11566
|
var _a;
|
11465
11567
|
const isRowDisabled = (_a = disabled == null ? void 0 : disabled(row, index, rows)) != null ? _a : false;
|
11466
|
-
return /* @__PURE__ */
|
11568
|
+
return /* @__PURE__ */ React68.createElement(DataList.Row, __spreadValues({
|
11467
11569
|
key: row.id,
|
11468
11570
|
disabled: isRowDisabled,
|
11469
11571
|
active
|
11470
|
-
}, additionalRowProps(row, index, rows)), renderFirstColumn == null ? void 0 : renderFirstColumn(row, index, rows), /* @__PURE__ */
|
11572
|
+
}, additionalRowProps(row, index, rows)), renderFirstColumn == null ? void 0 : renderFirstColumn(row, index, rows), /* @__PURE__ */ React68.createElement(List, {
|
11471
11573
|
items: columns,
|
11472
|
-
renderItem: (column, columnIndex) =>
|
11473
|
-
column,
|
11474
|
-
|
11475
|
-
|
11476
|
-
|
11477
|
-
|
11574
|
+
renderItem: (column, columnIndex) => {
|
11575
|
+
const cell = /* @__PURE__ */ React68.createElement(DataList.Cell, __spreadValues(__spreadValues({}, cellProps(column)), additionalColumnProps(column, columnIndex, columns, row)), /* @__PURE__ */ React68.createElement(DataListCell, {
|
11576
|
+
column,
|
11577
|
+
row,
|
11578
|
+
index,
|
11579
|
+
rows
|
11580
|
+
}));
|
11581
|
+
return createAnimatedCell({
|
11582
|
+
cellElement: cell,
|
11583
|
+
stickyStyles,
|
11584
|
+
stickyColumn: cellProps(column).stickyColumn
|
11585
|
+
});
|
11586
|
+
}
|
11478
11587
|
}), menu);
|
11479
11588
|
};
|
11480
11589
|
var DEFAULT_CONTENT = "";
|
@@ -11490,7 +11599,7 @@ var DataListCell = ({
|
|
11490
11599
|
case "status": {
|
11491
11600
|
const status = column.status(row, index, rows);
|
11492
11601
|
if (status) {
|
11493
|
-
cellContent = /* @__PURE__ */
|
11602
|
+
cellContent = /* @__PURE__ */ React68.createElement(StatusChip, __spreadValues({
|
11494
11603
|
dense: true
|
11495
11604
|
}, status));
|
11496
11605
|
}
|
@@ -11499,7 +11608,7 @@ var DataListCell = ({
|
|
11499
11608
|
case "action": {
|
11500
11609
|
const action = renameProperty("text", "children", column.action(row, index, rows));
|
11501
11610
|
if (action) {
|
11502
|
-
cellContent = /* @__PURE__ */
|
11611
|
+
cellContent = /* @__PURE__ */ React68.createElement(Button.Secondary, __spreadValues({
|
11503
11612
|
dense: true
|
11504
11613
|
}, action));
|
11505
11614
|
}
|
@@ -11512,7 +11621,7 @@ var DataListCell = ({
|
|
11512
11621
|
case "item": {
|
11513
11622
|
const item = column.item(row, index, rows);
|
11514
11623
|
if (item) {
|
11515
|
-
cellContent = /* @__PURE__ */
|
11624
|
+
cellContent = /* @__PURE__ */ React68.createElement(Item2, __spreadValues({}, item));
|
11516
11625
|
}
|
11517
11626
|
break;
|
11518
11627
|
}
|
@@ -11524,7 +11633,7 @@ var DataListCell = ({
|
|
11524
11633
|
}
|
11525
11634
|
break;
|
11526
11635
|
}
|
11527
|
-
return column.tooltip ? /* @__PURE__ */
|
11636
|
+
return column.tooltip ? /* @__PURE__ */ React68.createElement(Tooltip, __spreadValues({}, column.tooltip(row, index, rows)), cellContent) : /* @__PURE__ */ React68.createElement(React68.Fragment, null, cellContent);
|
11528
11637
|
};
|
11529
11638
|
|
11530
11639
|
// src/molecules/DataList/DataListContext.tsx
|
@@ -11542,7 +11651,7 @@ var useDataListContext = () => {
|
|
11542
11651
|
};
|
11543
11652
|
|
11544
11653
|
// src/molecules/DataList/DataListGroup.tsx
|
11545
|
-
import
|
11654
|
+
import React69 from "react";
|
11546
11655
|
import isFunction2 from "lodash/isFunction";
|
11547
11656
|
var import_infoSign3 = __toESM(require_infoSign());
|
11548
11657
|
|
@@ -11555,8 +11664,8 @@ var INDENTATION = 28;
|
|
11555
11664
|
var sortGroupKeys = (groupKeys) => [...groupKeys].sort((a) => a === "undefined" ? -1 : 1);
|
11556
11665
|
var getDefaultRowCheckboxLabel = () => "Select row";
|
11557
11666
|
var getDefaultGroupCheckboxLabel = (key) => `Select ${key}`;
|
11558
|
-
var renderDefaultGroupName = (key) => /* @__PURE__ */
|
11559
|
-
var renderDefaultEmptyGroup = () => /* @__PURE__ */
|
11667
|
+
var renderDefaultGroupName = (key) => /* @__PURE__ */ React69.createElement(React69.Fragment, null, "Group: ", /* @__PURE__ */ React69.createElement("b", null, key));
|
11668
|
+
var renderDefaultEmptyGroup = () => /* @__PURE__ */ React69.createElement(DataList.EmptyGroup, {
|
11560
11669
|
icon: import_infoSign3.default
|
11561
11670
|
}, "This group is empty");
|
11562
11671
|
var DataListGroup = (_a) => {
|
@@ -11593,28 +11702,28 @@ var DataListGroup = (_a) => {
|
|
11593
11702
|
const hasCustomRowForGroup = isFunction2(getGroupRow);
|
11594
11703
|
if (!areRowsGrouped(groups)) {
|
11595
11704
|
if (groups.length === 0 && groupKey && groupKey !== "undefined") {
|
11596
|
-
return /* @__PURE__ */
|
11705
|
+
return /* @__PURE__ */ React69.createElement(DataList.Row, null, selectable && /* @__PURE__ */ React69.createElement(DataList.Cell, null), /* @__PURE__ */ React69.createElement(DataList.Cell, {
|
11597
11706
|
style: { paddingLeft: `${2 + GAP + level * INDENTATION}px`, gridColumn: `${selectable ? 2 : 1} / -1` }
|
11598
|
-
}, /* @__PURE__ */
|
11707
|
+
}, /* @__PURE__ */ React69.createElement(Typography, {
|
11599
11708
|
variant: "small",
|
11600
11709
|
color: "muted"
|
11601
11710
|
}, renderEmptyGroup(groupKey))));
|
11602
11711
|
}
|
11603
|
-
return /* @__PURE__ */
|
11712
|
+
return /* @__PURE__ */ React69.createElement(List, {
|
11604
11713
|
items: groups,
|
11605
11714
|
renderItem: (row, index) => {
|
11606
11715
|
var _a2;
|
11607
11716
|
const isChecked = (_a2 = selectedRows == null ? void 0 : selectedRows.includes(row.id)) != null ? _a2 : false;
|
11608
11717
|
const isDisabled = disabled == null ? void 0 : disabled(row, index, rows);
|
11609
11718
|
const isSelectionDisabled = selectionDisabled(row, index, rows);
|
11610
|
-
return /* @__PURE__ */
|
11719
|
+
return /* @__PURE__ */ React69.createElement(DataListRow, {
|
11611
11720
|
key: row.id,
|
11612
11721
|
columns,
|
11613
11722
|
row,
|
11614
11723
|
index,
|
11615
11724
|
rows,
|
11616
11725
|
active: selectable && isChecked,
|
11617
|
-
menu: /* @__PURE__ */
|
11726
|
+
menu: /* @__PURE__ */ React69.createElement(DataListRowMenu, {
|
11618
11727
|
row,
|
11619
11728
|
index,
|
11620
11729
|
menu,
|
@@ -11632,7 +11741,7 @@ var DataListGroup = (_a) => {
|
|
11632
11741
|
}
|
11633
11742
|
} : {},
|
11634
11743
|
renderFirstColumn: (row2, index2) => {
|
11635
|
-
return /* @__PURE__ */
|
11744
|
+
return /* @__PURE__ */ React69.createElement(React69.Fragment, null, selectable && /* @__PURE__ */ React69.createElement(DataList.Cell, null, /* @__PURE__ */ React69.createElement(Checkbox, {
|
11636
11745
|
"aria-label": getRowCheckboxLabel(row2, index2, isChecked, rows),
|
11637
11746
|
onChange: onSelectionChange(row2.id),
|
11638
11747
|
checked: isChecked,
|
@@ -11646,13 +11755,13 @@ var DataListGroup = (_a) => {
|
|
11646
11755
|
if (!groupKeys) {
|
11647
11756
|
return null;
|
11648
11757
|
}
|
11649
|
-
return /* @__PURE__ */
|
11758
|
+
return /* @__PURE__ */ React69.createElement(List, {
|
11650
11759
|
items: sortGroupKeys(groupKeys),
|
11651
11760
|
renderItem: (key, index) => {
|
11652
11761
|
var _a2, _b2;
|
11653
11762
|
const group = groups[key];
|
11654
11763
|
if (key === "undefined" || key === void 0) {
|
11655
|
-
return /* @__PURE__ */
|
11764
|
+
return /* @__PURE__ */ React69.createElement(DataListGroup, __spreadProps(__spreadValues({
|
11656
11765
|
key: "undefined",
|
11657
11766
|
groupKey: "undefined",
|
11658
11767
|
level
|
@@ -11665,57 +11774,57 @@ var DataListGroup = (_a) => {
|
|
11665
11774
|
const nestedSelectedIds = (_b2 = selectedRows == null ? void 0 : selectedRows.filter((id) => nestedRowIds.includes(id))) != null ? _b2 : [];
|
11666
11775
|
const allSelected = nestedRowIds.length === nestedSelectedIds.length;
|
11667
11776
|
const isChecked = nestedSelectedIds.length > 0;
|
11668
|
-
return /* @__PURE__ */
|
11777
|
+
return /* @__PURE__ */ React69.createElement(Accordion, {
|
11669
11778
|
key,
|
11670
11779
|
openPanelId
|
11671
|
-
}, hasCustomRowForGroup && /* @__PURE__ */
|
11780
|
+
}, hasCustomRowForGroup && /* @__PURE__ */ React69.createElement(DataList.Row, {
|
11672
11781
|
active: !!openPanelId || selectable && isChecked
|
11673
|
-
}, selectable && /* @__PURE__ */
|
11782
|
+
}, selectable && /* @__PURE__ */ React69.createElement(DataList.Cell, null, /* @__PURE__ */ React69.createElement(Checkbox, {
|
11674
11783
|
"aria-label": getGroupCheckboxLabel(key, group, index, isChecked, rows),
|
11675
11784
|
checked: isChecked,
|
11676
11785
|
indeterminate: isChecked && !allSelected,
|
11677
11786
|
disabled: group.length === 0,
|
11678
11787
|
onChange: onSelectionChange(nestedRowIds)
|
11679
|
-
})), /* @__PURE__ */
|
11788
|
+
})), /* @__PURE__ */ React69.createElement(List, {
|
11680
11789
|
items: columns,
|
11681
|
-
renderItem: (column, idx) => /* @__PURE__ */
|
11790
|
+
renderItem: (column, idx) => /* @__PURE__ */ React69.createElement(DataList.Cell, __spreadProps(__spreadValues({}, cellProps(column)), {
|
11682
11791
|
className: tw("gap-3"),
|
11683
11792
|
style: idx === 0 ? { paddingLeft: `${GAP + level * INDENTATION}px` } : void 0
|
11684
|
-
}), idx === 0 && /* @__PURE__ */
|
11793
|
+
}), idx === 0 && /* @__PURE__ */ React69.createElement(Accordion.Toggle, {
|
11685
11794
|
panelId: key,
|
11686
11795
|
onChange: onGroupToggled
|
11687
|
-
}), /* @__PURE__ */
|
11796
|
+
}), /* @__PURE__ */ React69.createElement(DataListCell, {
|
11688
11797
|
column,
|
11689
11798
|
row: getGroupRow(key, group),
|
11690
11799
|
index: -1,
|
11691
11800
|
rows: []
|
11692
11801
|
}))
|
11693
|
-
}), /* @__PURE__ */
|
11802
|
+
}), /* @__PURE__ */ React69.createElement(DataListRowMenu, {
|
11694
11803
|
row: getGroupRow(key, group),
|
11695
11804
|
index: -1,
|
11696
11805
|
menu,
|
11697
11806
|
onAction,
|
11698
11807
|
onMenuOpenChange,
|
11699
11808
|
menuAriaLabel
|
11700
|
-
})), !hasCustomRowForGroup && /* @__PURE__ */
|
11809
|
+
})), !hasCustomRowForGroup && /* @__PURE__ */ React69.createElement(DataList.Row, {
|
11701
11810
|
active: !!openPanelId || selectable && isChecked
|
11702
|
-
}, selectable && /* @__PURE__ */
|
11811
|
+
}, selectable && /* @__PURE__ */ React69.createElement(DataList.Cell, null, /* @__PURE__ */ React69.createElement(Checkbox, {
|
11703
11812
|
"aria-label": getGroupCheckboxLabel(key, group, index, isChecked, rows),
|
11704
11813
|
checked: isChecked,
|
11705
11814
|
indeterminate: isChecked && !allSelected,
|
11706
11815
|
disabled: group.length === 0,
|
11707
11816
|
onChange: onSelectionChange(nestedRowIds)
|
11708
|
-
})), /* @__PURE__ */
|
11817
|
+
})), /* @__PURE__ */ React69.createElement(DataList.Cell, {
|
11709
11818
|
className: tw("gap-3"),
|
11710
11819
|
style: { paddingLeft: `${GAP + level * INDENTATION}px`, gridColumn: `${selectable ? 2 : 1} / -1` }
|
11711
|
-
}, /* @__PURE__ */
|
11820
|
+
}, /* @__PURE__ */ React69.createElement(Accordion.Toggle, {
|
11712
11821
|
panelId: key,
|
11713
11822
|
onChange: onGroupToggled
|
11714
|
-
}), renderGroupName(key, group))), /* @__PURE__ */
|
11823
|
+
}), renderGroupName(key, group))), /* @__PURE__ */ React69.createElement(DataList.Row, {
|
11715
11824
|
subgroup: true
|
11716
|
-
}, /* @__PURE__ */
|
11825
|
+
}, /* @__PURE__ */ React69.createElement(Accordion.UnanimatedPanel, {
|
11717
11826
|
panelId: key
|
11718
|
-
}, /* @__PURE__ */
|
11827
|
+
}, /* @__PURE__ */ React69.createElement(DataListGroup, __spreadProps(__spreadValues({
|
11719
11828
|
key,
|
11720
11829
|
groupKey: key,
|
11721
11830
|
level: level + 1
|
@@ -11727,26 +11836,26 @@ var DataListGroup = (_a) => {
|
|
11727
11836
|
};
|
11728
11837
|
|
11729
11838
|
// src/molecules/DataList/DataListSkeleton.tsx
|
11730
|
-
import
|
11839
|
+
import React70 from "react";
|
11731
11840
|
var DataListSkeleton = ({ columns = ["1", "2", "2", 52], rows = 5 }) => {
|
11732
11841
|
const columnsAmount = [...Array(typeof columns === "number" ? columns : columns.length).keys()];
|
11733
|
-
return /* @__PURE__ */
|
11842
|
+
return /* @__PURE__ */ React70.createElement(Template, {
|
11734
11843
|
role: "table",
|
11735
11844
|
columns
|
11736
|
-
}, /* @__PURE__ */
|
11845
|
+
}, /* @__PURE__ */ React70.createElement(DataList.Row, null, columnsAmount.map((_, index) => /* @__PURE__ */ React70.createElement(DataList.HeadCell, {
|
11737
11846
|
key: index
|
11738
|
-
}, /* @__PURE__ */
|
11847
|
+
}, /* @__PURE__ */ React70.createElement(Skeleton, {
|
11739
11848
|
width: "100%",
|
11740
11849
|
height: 17.5
|
11741
|
-
})))), /* @__PURE__ */
|
11850
|
+
})))), /* @__PURE__ */ React70.createElement(List, {
|
11742
11851
|
items: [...Array(rows).keys()],
|
11743
|
-
renderItem: (item) => /* @__PURE__ */
|
11852
|
+
renderItem: (item) => /* @__PURE__ */ React70.createElement(DataList.Row, {
|
11744
11853
|
key: item
|
11745
|
-
}, /* @__PURE__ */
|
11854
|
+
}, /* @__PURE__ */ React70.createElement(List, {
|
11746
11855
|
items: columnsAmount,
|
11747
|
-
renderItem: (key) => /* @__PURE__ */
|
11856
|
+
renderItem: (key) => /* @__PURE__ */ React70.createElement(DataList.Cell, {
|
11748
11857
|
key
|
11749
|
-
}, /* @__PURE__ */
|
11858
|
+
}, /* @__PURE__ */ React70.createElement(Skeleton, {
|
11750
11859
|
width: "100%",
|
11751
11860
|
height: 17.5
|
11752
11861
|
}))
|
@@ -11755,7 +11864,7 @@ var DataListSkeleton = ({ columns = ["1", "2", "2", 52], rows = 5 }) => {
|
|
11755
11864
|
};
|
11756
11865
|
|
11757
11866
|
// src/molecules/DataList/DataListToolbar.tsx
|
11758
|
-
import
|
11867
|
+
import React71 from "react";
|
11759
11868
|
import castArray from "lodash/castArray";
|
11760
11869
|
var DataListToolbar = ({
|
11761
11870
|
actions: _actions,
|
@@ -11768,19 +11877,19 @@ var DataListToolbar = ({
|
|
11768
11877
|
var _a;
|
11769
11878
|
const { selectedRows } = useDataListContext();
|
11770
11879
|
const actions = castArray(_actions).filter(Boolean);
|
11771
|
-
return /* @__PURE__ */
|
11880
|
+
return /* @__PURE__ */ React71.createElement(DataList.Toolbar.Container, {
|
11772
11881
|
sticky
|
11773
|
-
}, /* @__PURE__ */
|
11882
|
+
}, /* @__PURE__ */ React71.createElement(DataList.Toolbar.Group, null, /* @__PURE__ */ React71.createElement(DataList.Toolbar.SelectionCount, null, (_a = selectedRows == null ? void 0 : selectedRows.length) != null ? _a : 0, " selected")), actions.length > 0 && /* @__PURE__ */ React71.createElement(DataList.Toolbar.Group, null, /* @__PURE__ */ React71.createElement(DataList.Toolbar.Actions, null, actions.map(
|
11774
11883
|
(action) => renderAction({
|
11775
11884
|
kind: "ghost",
|
11776
11885
|
dense: true,
|
11777
11886
|
action: __spreadProps(__spreadValues({}, action), { onClick: () => action.onClick(selectedRows != null ? selectedRows : []) })
|
11778
11887
|
})
|
11779
|
-
))), menu && /* @__PURE__ */
|
11888
|
+
))), menu && /* @__PURE__ */ React71.createElement(DataList.Toolbar.Group, null, /* @__PURE__ */ React71.createElement(DropdownMenu2, {
|
11780
11889
|
placement: defaultContextualMenuPlacement,
|
11781
11890
|
onAction: (key) => onAction == null ? void 0 : onAction(key, selectedRows != null ? selectedRows : []),
|
11782
11891
|
onOpenChange: onMenuOpenChange
|
11783
|
-
}, /* @__PURE__ */
|
11892
|
+
}, /* @__PURE__ */ React71.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ React71.createElement(Button.GhostDropdown, {
|
11784
11893
|
dense: true
|
11785
11894
|
}, menuLabel)), menu)));
|
11786
11895
|
};
|
@@ -11848,6 +11957,9 @@ var DataList2 = (_a) => {
|
|
11848
11957
|
"toolbar"
|
11849
11958
|
]);
|
11850
11959
|
var _a2, _b2;
|
11960
|
+
const containerRef = useRef7(null);
|
11961
|
+
const hasStickyColumns = columns.some((column) => column.sticky);
|
11962
|
+
const stickyStyles = useScrollStyles({ containerRef, skip: !hasStickyColumns });
|
11851
11963
|
const [selected, setSelected] = useControlledState(
|
11852
11964
|
selectedRows,
|
11853
11965
|
defaultSelectedRows,
|
@@ -11870,11 +11982,11 @@ var DataList2 = (_a) => {
|
|
11870
11982
|
}),
|
11871
11983
|
menu ? "fit-content(28px)" : void 0
|
11872
11984
|
]);
|
11873
|
-
const PaginationFooter =
|
11874
|
-
({ children }) => /* @__PURE__ */
|
11985
|
+
const PaginationFooter = React72.useCallback(
|
11986
|
+
({ children }) => /* @__PURE__ */ React72.createElement("div", {
|
11875
11987
|
style: { gridColumn: "1 / -1" },
|
11876
11988
|
role: "row"
|
11877
|
-
}, /* @__PURE__ */
|
11989
|
+
}, /* @__PURE__ */ React72.createElement("div", {
|
11878
11990
|
role: "cell"
|
11879
11991
|
}, children)),
|
11880
11992
|
[]
|
@@ -11893,21 +12005,24 @@ var DataList2 = (_a) => {
|
|
11893
12005
|
allRows.map((row, index) => (disabled == null ? void 0 : disabled(row, index, sortedRows)) ? void 0 : row.id)
|
11894
12006
|
);
|
11895
12007
|
const allRowsSelected = totalSelected >= allEnabledRowIds.length;
|
11896
|
-
return /* @__PURE__ */
|
12008
|
+
return /* @__PURE__ */ React72.createElement(DataListContext.Provider, {
|
11897
12009
|
value: {
|
11898
12010
|
rows: isArray3(rows) ? sortedRows : rows,
|
11899
12011
|
selectedRows: selected
|
11900
12012
|
}
|
11901
|
-
}, /* @__PURE__ */
|
12013
|
+
}, /* @__PURE__ */ React72.createElement("div", {
|
12014
|
+
className: "relative w-full overflow-x-auto",
|
12015
|
+
ref: containerRef
|
12016
|
+
}, /* @__PURE__ */ React72.createElement(Template, {
|
11902
12017
|
className: "Aquarium-DataList",
|
11903
12018
|
columns: templateColumns,
|
11904
12019
|
role: "table"
|
11905
|
-
}, !hideHeader && /* @__PURE__ */
|
12020
|
+
}, !hideHeader && /* @__PURE__ */ React72.createElement(React72.Fragment, null, /* @__PURE__ */ React72.createElement(DataList.Row, {
|
11906
12021
|
header: true
|
11907
|
-
}, selectable && /* @__PURE__ */
|
12022
|
+
}, selectable && /* @__PURE__ */ React72.createElement(DataList.HeadCell, {
|
11908
12023
|
align: "left",
|
11909
12024
|
sticky
|
11910
|
-
}, /* @__PURE__ */
|
12025
|
+
}, /* @__PURE__ */ React72.createElement(Checkbox, {
|
11911
12026
|
"aria-label": "Select all rows",
|
11912
12027
|
indeterminate: totalSelected > 0 && totalSelected < allRows.length,
|
11913
12028
|
checked: totalSelected > 0,
|
@@ -11918,36 +12033,41 @@ var DataList2 = (_a) => {
|
|
11918
12033
|
setSelected([]);
|
11919
12034
|
}
|
11920
12035
|
}
|
11921
|
-
})), isCollapsible && /* @__PURE__ */
|
12036
|
+
})), isCollapsible && /* @__PURE__ */ React72.createElement(DataList.HeadCell, {
|
11922
12037
|
align: "left",
|
11923
12038
|
sticky
|
11924
12039
|
}), columns.map((column) => {
|
11925
|
-
const content = column.headerTooltip ? /* @__PURE__ */
|
12040
|
+
const content = column.headerTooltip ? /* @__PURE__ */ React72.createElement(Tooltip, {
|
11926
12041
|
placement: column.headerTooltip.placement,
|
11927
12042
|
content: column.headerTooltip.content
|
11928
12043
|
}, column.headerName) : column.headerName;
|
11929
|
-
const headerContentAndIcon = column.icon ? /* @__PURE__ */
|
12044
|
+
const headerContentAndIcon = column.icon ? /* @__PURE__ */ React72.createElement(Box.Flex, {
|
11930
12045
|
flexDirection: "row",
|
11931
12046
|
gap: "3",
|
11932
12047
|
alignItems: "center"
|
11933
|
-
}, /* @__PURE__ */
|
12048
|
+
}, /* @__PURE__ */ React72.createElement(InlineIcon, {
|
11934
12049
|
icon: column.icon,
|
11935
12050
|
height: "22",
|
11936
12051
|
color: "default",
|
11937
12052
|
"aria-hidden": true
|
11938
12053
|
}), content) : content;
|
11939
|
-
|
12054
|
+
const cell = columnIsFieldColumn(column) && column.sortable || column.sort ? /* @__PURE__ */ React72.createElement(DataList.SortCell, __spreadValues({
|
11940
12055
|
direction: sort && sort.column.headerName === column.headerName ? sort.direction : "none",
|
11941
12056
|
onClick: () => updateSort(column),
|
11942
12057
|
sticky
|
11943
|
-
}, cellProps(column)), headerContentAndIcon) : /* @__PURE__ */
|
12058
|
+
}, cellProps(column)), headerContentAndIcon) : /* @__PURE__ */ React72.createElement(DataList.HeadCell, __spreadProps(__spreadValues({}, cellProps(column)), {
|
11944
12059
|
sticky
|
11945
12060
|
}), headerContentAndIcon);
|
11946
|
-
|
12061
|
+
return createAnimatedCell({
|
12062
|
+
cellElement: cell,
|
12063
|
+
stickyStyles,
|
12064
|
+
stickyColumn: cellProps(column).stickyColumn
|
12065
|
+
});
|
12066
|
+
}), menu && /* @__PURE__ */ React72.createElement(DataList.HeadCell, {
|
11947
12067
|
align: "right",
|
11948
12068
|
"aria-label": menuAriaLabel,
|
11949
12069
|
sticky
|
11950
|
-
}, menuHeaderName)), toolbar), groups && /* @__PURE__ */
|
12070
|
+
}, menuHeaderName)), toolbar), groups && /* @__PURE__ */ React72.createElement(DataListGroup, {
|
11951
12071
|
columns,
|
11952
12072
|
disabled,
|
11953
12073
|
getGroupRow,
|
@@ -11969,7 +12089,7 @@ var DataList2 = (_a) => {
|
|
11969
12089
|
groups,
|
11970
12090
|
groupKey: void 0,
|
11971
12091
|
level: 0
|
11972
|
-
}), !groups && /* @__PURE__ */
|
12092
|
+
}), !groups && /* @__PURE__ */ React72.createElement(List, __spreadProps(__spreadValues({}, rest), {
|
11973
12093
|
paginationContainer: PaginationFooter,
|
11974
12094
|
items: sortedRows,
|
11975
12095
|
renderItem: (row, index) => {
|
@@ -11978,14 +12098,15 @@ var DataList2 = (_a) => {
|
|
11978
12098
|
const isChecked = (_a3 = selected == null ? void 0 : selected.includes(row.id)) != null ? _a3 : false;
|
11979
12099
|
const isSelectionDisabled = selectionDisabled == null ? void 0 : selectionDisabled(row, index, sortedRows);
|
11980
12100
|
const isDisabled = disabled == null ? void 0 : disabled(row, index, sortedRows);
|
11981
|
-
const content = /* @__PURE__ */
|
12101
|
+
const content = /* @__PURE__ */ React72.createElement(DataListRow, {
|
11982
12102
|
key: row.id,
|
11983
12103
|
columns,
|
11984
12104
|
row,
|
11985
12105
|
index,
|
11986
12106
|
rows: sortedRows,
|
11987
12107
|
active: selectable && isChecked,
|
11988
|
-
|
12108
|
+
stickyStyles,
|
12109
|
+
menu: /* @__PURE__ */ React72.createElement(DataListRowMenu, {
|
11989
12110
|
row,
|
11990
12111
|
index,
|
11991
12112
|
menu,
|
@@ -12001,12 +12122,12 @@ var DataList2 = (_a) => {
|
|
12001
12122
|
} : {};
|
12002
12123
|
},
|
12003
12124
|
renderFirstColumn: (row2, index2) => {
|
12004
|
-
return /* @__PURE__ */
|
12125
|
+
return /* @__PURE__ */ React72.createElement(React72.Fragment, null, selectable && /* @__PURE__ */ React72.createElement(DataList.Cell, null, /* @__PURE__ */ React72.createElement(Checkbox, {
|
12005
12126
|
"aria-label": getRowCheckboxLabel(row2, index2, isChecked, sortedRows),
|
12006
12127
|
onChange: handleSelectionChange(row2.id),
|
12007
12128
|
checked: isChecked,
|
12008
12129
|
disabled: isDisabled || isSelectionDisabled
|
12009
|
-
})), rowDetails !== void 0 && /* @__PURE__ */
|
12130
|
+
})), rowDetails !== void 0 && /* @__PURE__ */ React72.createElement(DataList.Cell, null, details && /* @__PURE__ */ React72.createElement(Accordion.Toggle, {
|
12010
12131
|
panelId: row2.id.toString(),
|
12011
12132
|
onChange: onGroupToggled
|
12012
12133
|
})));
|
@@ -12015,36 +12136,37 @@ var DataList2 = (_a) => {
|
|
12015
12136
|
if (!details) {
|
12016
12137
|
return content;
|
12017
12138
|
}
|
12018
|
-
return /* @__PURE__ */
|
12139
|
+
return /* @__PURE__ */ React72.createElement(Accordion, {
|
12019
12140
|
key: row.id,
|
12020
12141
|
openPanelId: expandedGroupIds ? expandedGroupIds.find((id) => id === row.id) || null : void 0
|
12021
|
-
}, content, /* @__PURE__ */
|
12142
|
+
}, content, /* @__PURE__ */ React72.createElement(Accordion.Panel, {
|
12022
12143
|
role: "row",
|
12023
12144
|
panelId: row.id.toString(),
|
12024
12145
|
className: tw("col-span-full bg-muted border-b border-default"),
|
12025
12146
|
"aria-label": `row ${row.id.toString()} details`
|
12026
|
-
}, /* @__PURE__ */
|
12147
|
+
}, /* @__PURE__ */ React72.createElement("div", {
|
12027
12148
|
role: "cell"
|
12028
12149
|
}, details)));
|
12029
12150
|
}
|
12030
|
-
}))));
|
12151
|
+
})))));
|
12031
12152
|
};
|
12032
12153
|
DataList2.Skeleton = DataListSkeleton;
|
12033
12154
|
DataList2.Toolbar = DataListToolbar;
|
12034
12155
|
|
12035
12156
|
// src/molecules/DataTable/DataTable.tsx
|
12036
|
-
import
|
12157
|
+
import React75, { useRef as useRef8 } from "react";
|
12158
|
+
import classNames8 from "classnames";
|
12037
12159
|
import compact2 from "lodash/compact";
|
12038
12160
|
import isFunction4 from "lodash/isFunction";
|
12039
12161
|
|
12040
12162
|
// src/molecules/Table/Table.tsx
|
12041
|
-
import
|
12163
|
+
import React74 from "react";
|
12042
12164
|
|
12043
12165
|
// src/utils/table/useScrollTarget.ts
|
12044
|
-
import
|
12166
|
+
import React73 from "react";
|
12045
12167
|
var useScrollTarget = (callback) => {
|
12046
|
-
const targetRef =
|
12047
|
-
|
12168
|
+
const targetRef = React73.useRef(null);
|
12169
|
+
React73.useLayoutEffect(() => {
|
12048
12170
|
const observer = new IntersectionObserver((entries) => entries[0].isIntersecting && callback && callback(), {
|
12049
12171
|
root: null,
|
12050
12172
|
rootMargin: `0px 0px 200px 0px`
|
@@ -12062,12 +12184,12 @@ var Table2 = (_a) => {
|
|
12062
12184
|
var _b = _a, { children, onPrev, onNext } = _b, rest = __objRest(_b, ["children", "onPrev", "onNext"]);
|
12063
12185
|
const bottomRef = useScrollTarget(onNext);
|
12064
12186
|
const topRef = useScrollTarget(onPrev);
|
12065
|
-
return /* @__PURE__ */
|
12187
|
+
return /* @__PURE__ */ React74.createElement("div", {
|
12066
12188
|
className: classNames("Aquarium-Table", tw("relative w-full"))
|
12067
|
-
}, /* @__PURE__ */
|
12189
|
+
}, /* @__PURE__ */ React74.createElement("div", {
|
12068
12190
|
ref: topRef,
|
12069
12191
|
className: tw("absolute top-0 h-1 w-full left-0 bg-transparent")
|
12070
|
-
}), /* @__PURE__ */
|
12192
|
+
}), /* @__PURE__ */ React74.createElement(Table, __spreadValues({}, rest), children), /* @__PURE__ */ React74.createElement("div", {
|
12071
12193
|
ref: bottomRef,
|
12072
12194
|
className: tw("absolute bottom-0 h-1 w-full left-0 bg-transparent")
|
12073
12195
|
}));
|
@@ -12121,6 +12243,9 @@ var DataTable = (_a) => {
|
|
12121
12243
|
"onPrev"
|
12122
12244
|
]);
|
12123
12245
|
var _a2;
|
12246
|
+
const containerRef = useRef8(null);
|
12247
|
+
const hasStickyColumns = columns.some((column) => column.sticky);
|
12248
|
+
const stickyStyles = useScrollStyles({ containerRef, skip: !hasStickyColumns });
|
12124
12249
|
const defaultSortedColumn = columns.find((c) => c.headerName === (defaultSort == null ? void 0 : defaultSort.headerName));
|
12125
12250
|
const initialSortState = defaultSortedColumn ? { column: defaultSortedColumn, direction: (_a2 = defaultSort == null ? void 0 : defaultSort.direction) != null ? _a2 : "ascending" } : void 0;
|
12126
12251
|
const [sort, updateSort] = useTableSort(
|
@@ -12128,17 +12253,20 @@ var DataTable = (_a) => {
|
|
12128
12253
|
);
|
12129
12254
|
const sortedRows = sortRowsBy(rows, sort);
|
12130
12255
|
const amountOfColumns = columns.length + (menu ? 1 : 0);
|
12131
|
-
const PaginationFooter =
|
12132
|
-
({ children }) => /* @__PURE__ */
|
12256
|
+
const PaginationFooter = React75.useCallback(
|
12257
|
+
({ children }) => /* @__PURE__ */ React75.createElement("tfoot", null, /* @__PURE__ */ React75.createElement("tr", null, /* @__PURE__ */ React75.createElement("td", {
|
12133
12258
|
colSpan: amountOfColumns
|
12134
12259
|
}, children))),
|
12135
12260
|
[amountOfColumns]
|
12136
12261
|
);
|
12137
|
-
return /* @__PURE__ */
|
12262
|
+
return /* @__PURE__ */ React75.createElement("div", {
|
12263
|
+
className: "relative w-full overflow-x-auto",
|
12264
|
+
ref: containerRef
|
12265
|
+
}, /* @__PURE__ */ React75.createElement(Table2, {
|
12138
12266
|
ariaLabel,
|
12139
12267
|
onNext,
|
12140
12268
|
onPrev,
|
12141
|
-
className:
|
12269
|
+
className: classNames8(
|
12142
12270
|
"Aquarium-DataTable",
|
12143
12271
|
tw({
|
12144
12272
|
"whitespace-nowrap": noWrap,
|
@@ -12146,40 +12274,45 @@ var DataTable = (_a) => {
|
|
12146
12274
|
"table-fixed": layout === "fixed"
|
12147
12275
|
})
|
12148
12276
|
)
|
12149
|
-
}, /* @__PURE__ */
|
12277
|
+
}, /* @__PURE__ */ React75.createElement(Table2.Head, {
|
12150
12278
|
sticky
|
12151
12279
|
}, compact2([
|
12152
12280
|
...columns.map((column) => {
|
12153
|
-
const content = column.headerTooltip && !column.headerInvisible ? /* @__PURE__ */
|
12281
|
+
const content = column.headerTooltip && !column.headerInvisible ? /* @__PURE__ */ React75.createElement(Tooltip, {
|
12154
12282
|
placement: column.headerTooltip.placement,
|
12155
12283
|
content: column.headerTooltip.content
|
12156
12284
|
}, column.headerName) : !column.headerInvisible && column.headerName;
|
12157
|
-
const headerContentAndIcon = !column.headerInvisible && column.icon ? /* @__PURE__ */
|
12285
|
+
const headerContentAndIcon = !column.headerInvisible && column.icon ? /* @__PURE__ */ React75.createElement(Box.Flex, {
|
12158
12286
|
flexDirection: "row",
|
12159
12287
|
gap: "3",
|
12160
12288
|
alignItems: "center"
|
12161
|
-
}, /* @__PURE__ */
|
12289
|
+
}, /* @__PURE__ */ React75.createElement(InlineIcon, {
|
12162
12290
|
icon: column.icon,
|
12163
12291
|
height: "22",
|
12164
12292
|
color: "default",
|
12165
12293
|
"aria-hidden": true
|
12166
12294
|
}), content) : content;
|
12167
|
-
|
12295
|
+
const cell = columnIsFieldColumn(column) && column.sortable || column.sort ? /* @__PURE__ */ React75.createElement(Table2.SortCell, __spreadValues({
|
12168
12296
|
direction: sort && sort.column.headerName === column.headerName ? sort.direction : "none",
|
12169
12297
|
onClick: () => updateSort(column),
|
12170
12298
|
style: { width: column.width },
|
12171
12299
|
"aria-label": column.headerInvisible ? column.headerName : void 0
|
12172
|
-
}, cellProps(column)), headerContentAndIcon) : /* @__PURE__ */
|
12300
|
+
}, cellProps(column)), headerContentAndIcon) : /* @__PURE__ */ React75.createElement(Table2.Cell, __spreadProps(__spreadValues({}, cellProps(column)), {
|
12173
12301
|
style: { width: column.width },
|
12174
12302
|
"aria-label": column.headerInvisible ? column.headerName : void 0
|
12175
12303
|
}), headerContentAndIcon);
|
12304
|
+
return createAnimatedCell({
|
12305
|
+
cellElement: cell,
|
12306
|
+
stickyStyles,
|
12307
|
+
stickyColumn: cellProps(column).stickyColumn
|
12308
|
+
});
|
12176
12309
|
}),
|
12177
|
-
menu ? /* @__PURE__ */
|
12310
|
+
menu ? /* @__PURE__ */ React75.createElement(Table2.Cell, {
|
12178
12311
|
key: "__contextMenu",
|
12179
12312
|
align: "right",
|
12180
12313
|
"aria-label": menuAriaLabel
|
12181
12314
|
}, menuHeaderName) : null
|
12182
|
-
])), /* @__PURE__ */
|
12315
|
+
])), /* @__PURE__ */ React75.createElement(List, __spreadProps(__spreadValues({
|
12183
12316
|
container: Table2.Body,
|
12184
12317
|
paginationContainer: PaginationFooter
|
12185
12318
|
}, rest), {
|
@@ -12187,15 +12320,21 @@ var DataTable = (_a) => {
|
|
12187
12320
|
renderItem: (row, index) => {
|
12188
12321
|
var _a3;
|
12189
12322
|
const isRowDisabled = (_a3 = disabled == null ? void 0 : disabled(row, index, sortedRows)) != null ? _a3 : false;
|
12190
|
-
return /* @__PURE__ */
|
12323
|
+
return /* @__PURE__ */ React75.createElement(Table2.Row, {
|
12191
12324
|
key: row.id,
|
12192
12325
|
disabled: isRowDisabled
|
12193
|
-
}, /* @__PURE__ */
|
12326
|
+
}, /* @__PURE__ */ React75.createElement(List, {
|
12194
12327
|
items: columns,
|
12195
|
-
renderItem: (column) =>
|
12328
|
+
renderItem: (column) => {
|
12329
|
+
return createAnimatedCell({
|
12330
|
+
cellElement: /* @__PURE__ */ React75.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), renderCell(column, row, index, sortedRows)),
|
12331
|
+
stickyStyles,
|
12332
|
+
stickyColumn: cellProps(column).stickyColumn
|
12333
|
+
});
|
12334
|
+
}
|
12196
12335
|
}), renderRowMenu(row, index, { menu, menuAriaLabel, onAction, onMenuOpenChange }));
|
12197
12336
|
}
|
12198
|
-
})));
|
12337
|
+
}))));
|
12199
12338
|
};
|
12200
12339
|
var renderRowMenu = (row, index, {
|
12201
12340
|
menu,
|
@@ -12205,13 +12344,13 @@ var renderRowMenu = (row, index, {
|
|
12205
12344
|
}) => {
|
12206
12345
|
if (menu) {
|
12207
12346
|
const menuContent = isFunction4(menu) ? menu(row, index) : menu;
|
12208
|
-
return /* @__PURE__ */
|
12347
|
+
return /* @__PURE__ */ React75.createElement(Table2.Cell, {
|
12209
12348
|
align: "right"
|
12210
|
-
}, menuContent && /* @__PURE__ */
|
12349
|
+
}, menuContent && /* @__PURE__ */ React75.createElement(DropdownMenu2, {
|
12211
12350
|
placement: defaultContextualMenuPlacement,
|
12212
12351
|
onAction: (action) => onAction == null ? void 0 : onAction(action, row, index),
|
12213
12352
|
onOpenChange: onMenuOpenChange
|
12214
|
-
}, /* @__PURE__ */
|
12353
|
+
}, /* @__PURE__ */ React75.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ React75.createElement(Button.Icon, {
|
12215
12354
|
"aria-label": menuAriaLabel,
|
12216
12355
|
icon: import_more3.default
|
12217
12356
|
})), menuContent));
|
@@ -12224,14 +12363,14 @@ var renderCell = (column, row, index, rows) => {
|
|
12224
12363
|
if (column.type === "status") {
|
12225
12364
|
const status = column.status(row, index, rows);
|
12226
12365
|
if (status) {
|
12227
|
-
cellContent = /* @__PURE__ */
|
12366
|
+
cellContent = /* @__PURE__ */ React75.createElement(StatusChip, __spreadValues({
|
12228
12367
|
dense: true
|
12229
12368
|
}, status));
|
12230
12369
|
}
|
12231
12370
|
} else if (column.type === "action") {
|
12232
12371
|
const action = renameProperty("text", "children", column.action(row, index, rows));
|
12233
12372
|
if (action) {
|
12234
|
-
cellContent = /* @__PURE__ */
|
12373
|
+
cellContent = /* @__PURE__ */ React75.createElement(Button.Secondary, __spreadValues({
|
12235
12374
|
dense: true
|
12236
12375
|
}, action));
|
12237
12376
|
}
|
@@ -12240,19 +12379,19 @@ var renderCell = (column, row, index, rows) => {
|
|
12240
12379
|
} else if (column.type === "item") {
|
12241
12380
|
const item = column.item(row, index, rows);
|
12242
12381
|
if (item) {
|
12243
|
-
cellContent = /* @__PURE__ */
|
12382
|
+
cellContent = /* @__PURE__ */ React75.createElement(Item2, __spreadValues({}, item));
|
12244
12383
|
}
|
12245
12384
|
} else if (column.formatter) {
|
12246
12385
|
cellContent = column.formatter(row[column.field], row, index, rows);
|
12247
12386
|
} else {
|
12248
12387
|
cellContent = row[column.field];
|
12249
12388
|
}
|
12250
|
-
return column.tooltip ? /* @__PURE__ */
|
12389
|
+
return column.tooltip ? /* @__PURE__ */ React75.createElement(Tooltip, __spreadValues({}, column.tooltip(row, index, rows)), cellContent) : cellContent;
|
12251
12390
|
};
|
12252
12391
|
DataTable.Skeleton = DataListSkeleton;
|
12253
12392
|
|
12254
12393
|
// src/molecules/Dialog/Dialog.tsx
|
12255
|
-
import
|
12394
|
+
import React77 from "react";
|
12256
12395
|
import { useDialog } from "@react-aria/dialog";
|
12257
12396
|
import { Overlay as Overlay2, useModalOverlay } from "@react-aria/overlays";
|
12258
12397
|
import { useId as useId9 } from "@react-aria/utils";
|
@@ -12279,7 +12418,7 @@ var DIALOG_ICONS_AND_COLORS = {
|
|
12279
12418
|
};
|
12280
12419
|
|
12281
12420
|
// src/atoms/Modal/Modal.tsx
|
12282
|
-
import
|
12421
|
+
import React76 from "react";
|
12283
12422
|
var Modal = (_a) => {
|
12284
12423
|
var _b = _a, {
|
12285
12424
|
children,
|
@@ -12292,7 +12431,7 @@ var Modal = (_a) => {
|
|
12292
12431
|
"className",
|
12293
12432
|
"open"
|
12294
12433
|
]);
|
12295
|
-
return open ? /* @__PURE__ */
|
12434
|
+
return open ? /* @__PURE__ */ React76.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12296
12435
|
className: classNames(
|
12297
12436
|
tw("inset-0 overflow-y-auto z-modal fixed"),
|
12298
12437
|
{
|
@@ -12304,11 +12443,11 @@ var Modal = (_a) => {
|
|
12304
12443
|
};
|
12305
12444
|
Modal.BackDrop = (_a) => {
|
12306
12445
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
12307
|
-
return /* @__PURE__ */
|
12446
|
+
return /* @__PURE__ */ React76.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12308
12447
|
className: classNames(tw("-z-10 fixed min-w-full min-h-full bg-primary-intense opacity-60"), className)
|
12309
12448
|
}));
|
12310
12449
|
};
|
12311
|
-
Modal.Dialog =
|
12450
|
+
Modal.Dialog = React76.forwardRef(
|
12312
12451
|
(_a, ref) => {
|
12313
12452
|
var _b = _a, { kind = "dialog", children, className, size = "sm" } = _b, rest = __objRest(_b, ["kind", "children", "className", "size"]);
|
12314
12453
|
const commonClasses = tw("bg-popover-content max-h-full flex flex-col");
|
@@ -12322,7 +12461,7 @@ Modal.Dialog = React75.forwardRef(
|
|
12322
12461
|
"w-[560px]": size === "md",
|
12323
12462
|
"w-[1080px]": size === "full"
|
12324
12463
|
});
|
12325
|
-
return /* @__PURE__ */
|
12464
|
+
return /* @__PURE__ */ React76.createElement("div", __spreadProps(__spreadValues({
|
12326
12465
|
ref,
|
12327
12466
|
"aria-modal": "true"
|
12328
12467
|
}, rest), {
|
@@ -12332,34 +12471,34 @@ Modal.Dialog = React75.forwardRef(
|
|
12332
12471
|
);
|
12333
12472
|
Modal.Header = (_a) => {
|
12334
12473
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12335
|
-
return /* @__PURE__ */
|
12474
|
+
return /* @__PURE__ */ React76.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12336
12475
|
className: classNames(tw("pl-7 pr-[64px] py-6 gap-3 flex items-center"), className)
|
12337
12476
|
}), children);
|
12338
12477
|
};
|
12339
12478
|
Modal.HeaderImage = (_a) => {
|
12340
12479
|
var _b = _a, { backgroundImage, className } = _b, rest = __objRest(_b, ["backgroundImage", "className"]);
|
12341
12480
|
const common = tw("h-[120px] min-h-[120px] w-full ");
|
12342
|
-
return backgroundImage ? /* @__PURE__ */
|
12481
|
+
return backgroundImage ? /* @__PURE__ */ React76.createElement("img", __spreadProps(__spreadValues({
|
12343
12482
|
"aria-hidden": true,
|
12344
12483
|
src: backgroundImage != null ? backgroundImage : void 0
|
12345
12484
|
}, rest), {
|
12346
12485
|
className: classNames(common, tw("object-cover"), className)
|
12347
|
-
})) : /* @__PURE__ */
|
12486
|
+
})) : /* @__PURE__ */ React76.createElement("div", {
|
12348
12487
|
className: classNames(common, tw("bg-default"), className)
|
12349
12488
|
});
|
12350
12489
|
};
|
12351
12490
|
Modal.CloseButtonContainer = (_a) => {
|
12352
12491
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
12353
|
-
return /* @__PURE__ */
|
12492
|
+
return /* @__PURE__ */ React76.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12354
12493
|
className: classNames(tw("absolute top-[24px] right-[28px]"), className)
|
12355
12494
|
}));
|
12356
12495
|
};
|
12357
12496
|
Modal.Title = (_a) => {
|
12358
12497
|
var _b = _a, { kind = "dialog", children, className } = _b, rest = __objRest(_b, ["kind", "children", "className"]);
|
12359
|
-
return /* @__PURE__ */
|
12498
|
+
return /* @__PURE__ */ React76.createElement(Typography, __spreadValues({
|
12360
12499
|
htmlTag: "h2",
|
12361
12500
|
variant: "subheading",
|
12362
|
-
color: "
|
12501
|
+
color: "intense",
|
12363
12502
|
className: classNames(
|
12364
12503
|
tw({
|
12365
12504
|
"text-ellipsis overflow-x-hidden whitespace-nowrap": kind === "drawer"
|
@@ -12370,40 +12509,40 @@ Modal.Title = (_a) => {
|
|
12370
12509
|
};
|
12371
12510
|
Modal.Subtitle = (_a) => {
|
12372
12511
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
12373
|
-
return /* @__PURE__ */
|
12512
|
+
return /* @__PURE__ */ React76.createElement(Typography, __spreadValues({
|
12374
12513
|
variant: "small",
|
12375
|
-
color: "
|
12514
|
+
color: "default"
|
12376
12515
|
}, rest), children);
|
12377
12516
|
};
|
12378
12517
|
Modal.TitleContainer = (_a) => {
|
12379
12518
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12380
|
-
return /* @__PURE__ */
|
12519
|
+
return /* @__PURE__ */ React76.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12381
12520
|
className: classNames(tw("flex flex-col grow"), className)
|
12382
12521
|
}), children);
|
12383
12522
|
};
|
12384
12523
|
Modal.Body = (_a) => {
|
12385
12524
|
var _b = _a, { children, className, noFooter = false, maxHeight, style } = _b, rest = __objRest(_b, ["children", "className", "noFooter", "maxHeight", "style"]);
|
12386
|
-
return /* @__PURE__ */
|
12525
|
+
return /* @__PURE__ */ React76.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12387
12526
|
className: classNames(tw("px-7 grow overflow-y-auto", { "pb-6": noFooter }), className),
|
12388
12527
|
style: __spreadValues({ maxHeight }, style)
|
12389
12528
|
}), children);
|
12390
12529
|
};
|
12391
12530
|
Modal.Footer = (_a) => {
|
12392
12531
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12393
|
-
return /* @__PURE__ */
|
12532
|
+
return /* @__PURE__ */ React76.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12394
12533
|
className: classNames(tw("px-7 py-6"), className)
|
12395
12534
|
}), children);
|
12396
12535
|
};
|
12397
12536
|
Modal.Actions = (_a) => {
|
12398
12537
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
12399
|
-
return /* @__PURE__ */
|
12538
|
+
return /* @__PURE__ */ React76.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12400
12539
|
className: classNames(tw("flex gap-4 justify-end"), className)
|
12401
12540
|
}), children);
|
12402
12541
|
};
|
12403
12542
|
|
12404
12543
|
// src/molecules/Dialog/Dialog.tsx
|
12405
12544
|
var Dialog = (props) => {
|
12406
|
-
const ref =
|
12545
|
+
const ref = React77.useRef(null);
|
12407
12546
|
const { open, onClose } = props;
|
12408
12547
|
const state = useOverlayTriggerState2({ isOpen: open, onOpenChange: (isOpen) => !isOpen && (onClose == null ? void 0 : onClose()) });
|
12409
12548
|
const { modalProps, underlayProps } = useModalOverlay(
|
@@ -12414,13 +12553,13 @@ var Dialog = (props) => {
|
|
12414
12553
|
if (!state.isOpen) {
|
12415
12554
|
return null;
|
12416
12555
|
}
|
12417
|
-
return /* @__PURE__ */
|
12556
|
+
return /* @__PURE__ */ React77.createElement(Overlay2, null, /* @__PURE__ */ React77.createElement(Modal, {
|
12418
12557
|
className: "Aquarium-Dialog",
|
12419
12558
|
open: true
|
12420
|
-
}, /* @__PURE__ */
|
12559
|
+
}, /* @__PURE__ */ React77.createElement(Modal.BackDrop, __spreadValues({}, underlayProps)), /* @__PURE__ */ React77.createElement(Modal.Dialog, __spreadValues({
|
12421
12560
|
ref,
|
12422
12561
|
size: "sm"
|
12423
|
-
}, modalProps), /* @__PURE__ */
|
12562
|
+
}, modalProps), /* @__PURE__ */ React77.createElement(DialogWrapper, __spreadValues({}, props)))));
|
12424
12563
|
};
|
12425
12564
|
var DialogWrapper = ({
|
12426
12565
|
title,
|
@@ -12429,7 +12568,7 @@ var DialogWrapper = ({
|
|
12429
12568
|
primaryAction,
|
12430
12569
|
secondaryAction
|
12431
12570
|
}) => {
|
12432
|
-
const ref =
|
12571
|
+
const ref = React77.useRef(null);
|
12433
12572
|
const labelledBy = useId9();
|
12434
12573
|
const describedBy = useId9();
|
12435
12574
|
const { dialogProps } = useDialog(
|
@@ -12440,52 +12579,52 @@ var DialogWrapper = ({
|
|
12440
12579
|
},
|
12441
12580
|
ref
|
12442
12581
|
);
|
12443
|
-
return /* @__PURE__ */
|
12582
|
+
return /* @__PURE__ */ React77.createElement("div", __spreadProps(__spreadValues({
|
12444
12583
|
ref
|
12445
12584
|
}, dialogProps), {
|
12446
12585
|
className: tw("outline-none")
|
12447
|
-
}), /* @__PURE__ */
|
12586
|
+
}), /* @__PURE__ */ React77.createElement(Modal.Header, {
|
12448
12587
|
className: tw("icon-stroke-2")
|
12449
|
-
}, /* @__PURE__ */
|
12588
|
+
}, /* @__PURE__ */ React77.createElement(Icon, {
|
12450
12589
|
icon: DIALOG_ICONS_AND_COLORS[type].icon,
|
12451
12590
|
color: DIALOG_ICONS_AND_COLORS[type].color,
|
12452
12591
|
fontSize: 20
|
12453
|
-
}), /* @__PURE__ */
|
12592
|
+
}), /* @__PURE__ */ React77.createElement(Modal.Title, {
|
12454
12593
|
id: labelledBy,
|
12455
12594
|
variant: "large",
|
12456
12595
|
color: DIALOG_ICONS_AND_COLORS[type].color
|
12457
|
-
}, title)), /* @__PURE__ */
|
12596
|
+
}, title)), /* @__PURE__ */ React77.createElement(Modal.Body, {
|
12458
12597
|
id: describedBy
|
12459
|
-
}, /* @__PURE__ */
|
12598
|
+
}, /* @__PURE__ */ React77.createElement(Typography2.Default, null, children)), /* @__PURE__ */ React77.createElement(Modal.Footer, null, /* @__PURE__ */ React77.createElement(Modal.Actions, null, secondaryAction && /* @__PURE__ */ React77.createElement(Button.Ghost, __spreadValues({
|
12460
12599
|
key: secondaryAction.text
|
12461
|
-
}, omit8(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */
|
12600
|
+
}, omit8(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */ React77.createElement(Button.Secondary, __spreadValues({
|
12462
12601
|
key: primaryAction.text
|
12463
12602
|
}, omit8(primaryAction, "text")), primaryAction.text))));
|
12464
12603
|
};
|
12465
12604
|
|
12466
12605
|
// src/molecules/Drawer/Drawer.tsx
|
12467
|
-
import
|
12606
|
+
import React79 from "react";
|
12468
12607
|
import { useOverlayTriggerState as useOverlayTriggerState3 } from "react-stately";
|
12469
12608
|
import { useDialog as useDialog2 } from "@react-aria/dialog";
|
12470
12609
|
import { Overlay as Overlay3, useModalOverlay as useModalOverlay2 } from "@react-aria/overlays";
|
12471
12610
|
import { useId as useId10 } from "@react-aria/utils";
|
12472
|
-
import { animated as
|
12611
|
+
import { animated as animated5, useSpring as useSpring4 } from "@react-spring/web";
|
12473
12612
|
import castArray3 from "lodash/castArray";
|
12474
12613
|
import omit9 from "lodash/omit";
|
12475
12614
|
|
12476
12615
|
// src/molecules/Tabs/Tabs.tsx
|
12477
|
-
import
|
12616
|
+
import React78, { useEffect as useEffect8, useLayoutEffect as useLayoutEffect2, useRef as useRef9, useState as useState11 } from "react";
|
12478
12617
|
import isNumber5 from "lodash/isNumber";
|
12479
12618
|
import kebabCase from "lodash/kebabCase";
|
12480
12619
|
var import_chevronLeft4 = __toESM(require_chevronLeft());
|
12481
12620
|
var import_chevronRight4 = __toESM(require_chevronRight());
|
12482
12621
|
var import_warningSign4 = __toESM(require_warningSign());
|
12483
12622
|
var isTabComponent = (c) => {
|
12484
|
-
return
|
12623
|
+
return React78.isValidElement(c) && (c.type === Tab || c.type === ModalTab);
|
12485
12624
|
};
|
12486
|
-
var Tab =
|
12625
|
+
var Tab = React78.forwardRef(
|
12487
12626
|
({ className, id, title, children }, ref) => {
|
12488
|
-
return /* @__PURE__ */
|
12627
|
+
return /* @__PURE__ */ React78.createElement("div", {
|
12489
12628
|
ref,
|
12490
12629
|
id: `${id != null ? id : kebabCase(title)}-panel`,
|
12491
12630
|
className,
|
@@ -12497,14 +12636,14 @@ var Tab = React77.forwardRef(
|
|
12497
12636
|
);
|
12498
12637
|
var TabContainer = (_a) => {
|
12499
12638
|
var _b = _a, { className, children } = _b, rest = __objRest(_b, ["className", "children"]);
|
12500
|
-
return /* @__PURE__ */
|
12639
|
+
return /* @__PURE__ */ React78.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
12501
12640
|
className: classNames("py-6 z-0", className)
|
12502
12641
|
}), children);
|
12503
12642
|
};
|
12504
12643
|
var ModalTab = Tab;
|
12505
12644
|
var ModalTabContainer = TabContainer;
|
12506
12645
|
var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
12507
|
-
const Tab2 =
|
12646
|
+
const Tab2 = React78.forwardRef(
|
12508
12647
|
(_a, ref) => {
|
12509
12648
|
var _b = _a, {
|
12510
12649
|
id,
|
@@ -12536,17 +12675,17 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
12536
12675
|
const _id = id != null ? id : kebabCase(title);
|
12537
12676
|
let statusIcon = void 0;
|
12538
12677
|
if (status === "warning") {
|
12539
|
-
statusIcon = /* @__PURE__ */
|
12678
|
+
statusIcon = /* @__PURE__ */ React78.createElement(InlineIcon, {
|
12540
12679
|
icon: import_warningSign4.default,
|
12541
12680
|
color: selected ? void 0 : "warning-default"
|
12542
12681
|
});
|
12543
12682
|
} else if (status === "error") {
|
12544
|
-
statusIcon = /* @__PURE__ */
|
12683
|
+
statusIcon = /* @__PURE__ */ React78.createElement(InlineIcon, {
|
12545
12684
|
icon: import_warningSign4.default,
|
12546
12685
|
color: selected ? void 0 : "danger-default"
|
12547
12686
|
});
|
12548
12687
|
}
|
12549
|
-
const tab = /* @__PURE__ */
|
12688
|
+
const tab = /* @__PURE__ */ React78.createElement(Component, __spreadValues({
|
12550
12689
|
ref,
|
12551
12690
|
id: `${_id}-tab`,
|
12552
12691
|
onClick: () => !disabled && onSelected(value != null ? value : index),
|
@@ -12563,29 +12702,29 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
12563
12702
|
"aria-selected": selected,
|
12564
12703
|
"aria-controls": `${_id}-panel`,
|
12565
12704
|
tabIndex: disabled ? void 0 : 0
|
12566
|
-
}, rest), /* @__PURE__ */
|
12705
|
+
}, rest), /* @__PURE__ */ React78.createElement(Typography2, {
|
12567
12706
|
htmlTag: "div",
|
12568
12707
|
variant: "small-strong",
|
12569
|
-
color: selected ? "primary-
|
12708
|
+
color: selected ? "primary-default" : disabled ? "default" : "current",
|
12570
12709
|
className: tw("inline-flex items-center gap-3")
|
12571
|
-
}, showNotification ? /* @__PURE__ */
|
12710
|
+
}, showNotification ? /* @__PURE__ */ React78.createElement(Badge.Notification, {
|
12572
12711
|
right: "-4px",
|
12573
12712
|
top: "3px"
|
12574
|
-
}, /* @__PURE__ */
|
12713
|
+
}, /* @__PURE__ */ React78.createElement("span", {
|
12575
12714
|
className: tw("whitespace-nowrap")
|
12576
|
-
}, title)) : /* @__PURE__ */
|
12715
|
+
}, title)) : /* @__PURE__ */ React78.createElement("span", {
|
12577
12716
|
className: tw("whitespace-nowrap")
|
12578
|
-
}, title), isNumber5(badge) && /* @__PURE__ */
|
12717
|
+
}, title), isNumber5(badge) && /* @__PURE__ */ React78.createElement(Typography2, {
|
12579
12718
|
htmlTag: "span",
|
12580
12719
|
variant: "small",
|
12581
|
-
color: selected ? "primary-
|
12720
|
+
color: selected ? "primary-intense" : "grey-5",
|
12582
12721
|
className: "leading-none"
|
12583
|
-
}, /* @__PURE__ */
|
12722
|
+
}, /* @__PURE__ */ React78.createElement(TabBadge, {
|
12584
12723
|
kind: "filled",
|
12585
12724
|
value: badge,
|
12586
12725
|
textClassname: classNames({ "text-white": selected, "text-muted": !selected })
|
12587
12726
|
})), statusIcon));
|
12588
|
-
return tooltip ? /* @__PURE__ */
|
12727
|
+
return tooltip ? /* @__PURE__ */ React78.createElement(Tooltip, {
|
12589
12728
|
content: tooltip
|
12590
12729
|
}, tab) : tab;
|
12591
12730
|
}
|
@@ -12599,20 +12738,20 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
12599
12738
|
const Tabs2 = (props) => {
|
12600
12739
|
var _a, _b;
|
12601
12740
|
const { className, value, defaultValue, onChange, children } = props;
|
12602
|
-
const childArr =
|
12741
|
+
const childArr = React78.Children.toArray(children);
|
12603
12742
|
const firstTab = childArr[0];
|
12604
12743
|
const firstTabValue = isTabComponent(firstTab) ? firstTab.props.value : -1;
|
12605
|
-
const [selected, setSelected] =
|
12606
|
-
const [leftCaret, showLeftCaret] =
|
12607
|
-
const [rightCaret, showRightCaret] =
|
12608
|
-
const parentRef =
|
12609
|
-
const containerRef =
|
12610
|
-
const tabsRef =
|
12744
|
+
const [selected, setSelected] = useState11((_b = (_a = value != null ? value : defaultValue) != null ? _a : firstTabValue) != null ? _b : 0);
|
12745
|
+
const [leftCaret, showLeftCaret] = useState11(false);
|
12746
|
+
const [rightCaret, showRightCaret] = useState11(false);
|
12747
|
+
const parentRef = useRef9(null);
|
12748
|
+
const containerRef = useRef9(null);
|
12749
|
+
const tabsRef = useRef9(null);
|
12611
12750
|
const revealSelectedTab = ({ smooth }) => {
|
12612
12751
|
var _a2, _b2;
|
12613
12752
|
const container = containerRef.current;
|
12614
12753
|
const tabs = tabsRef.current;
|
12615
|
-
const values =
|
12754
|
+
const values = React78.Children.map(
|
12616
12755
|
children,
|
12617
12756
|
(tab, i) => {
|
12618
12757
|
var _a3;
|
@@ -12653,7 +12792,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
12653
12792
|
updateCarets();
|
12654
12793
|
setSelected(value);
|
12655
12794
|
revealSelectedTab({ smooth: value !== selected });
|
12656
|
-
}, [value,
|
12795
|
+
}, [value, React78.Children.count(children)]);
|
12657
12796
|
useLayoutEffect2(() => {
|
12658
12797
|
var _a2;
|
12659
12798
|
updateCarets();
|
@@ -12717,27 +12856,27 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
12717
12856
|
const handleSelected = (key) => {
|
12718
12857
|
(onChange != null ? onChange : setSelected)(key);
|
12719
12858
|
};
|
12720
|
-
|
12859
|
+
React78.Children.forEach(children, (c) => {
|
12721
12860
|
if (c && !isTabComponent(c)) {
|
12722
12861
|
throw new Error("<Tabs> can only have <Tabs.Tab> components as children");
|
12723
12862
|
}
|
12724
12863
|
});
|
12725
|
-
return /* @__PURE__ */
|
12864
|
+
return /* @__PURE__ */ React78.createElement("div", {
|
12726
12865
|
ref: parentRef,
|
12727
12866
|
className: classNames("Aquarium-Tabs", tw("h-full"), className)
|
12728
|
-
}, /* @__PURE__ */
|
12867
|
+
}, /* @__PURE__ */ React78.createElement("div", {
|
12729
12868
|
className: tw("relative flex items-center border-b-2 border-default")
|
12730
|
-
}, /* @__PURE__ */
|
12869
|
+
}, /* @__PURE__ */ React78.createElement("div", {
|
12731
12870
|
ref: containerRef,
|
12732
12871
|
className: tw("overflow-y-auto scrollbar-hide mb-[-2px] h-auto")
|
12733
|
-
}, /* @__PURE__ */
|
12872
|
+
}, /* @__PURE__ */ React78.createElement("div", {
|
12734
12873
|
ref: tabsRef,
|
12735
12874
|
role: "tablist",
|
12736
12875
|
"aria-label": "tabs",
|
12737
12876
|
className: tw("inline-flex items-center cursor-pointer font-normal h-full")
|
12738
|
-
},
|
12877
|
+
}, React78.Children.map(
|
12739
12878
|
children,
|
12740
|
-
(tab, index) => tab ? /* @__PURE__ */
|
12879
|
+
(tab, index) => tab ? /* @__PURE__ */ React78.createElement(TabItemComponent, __spreadProps(__spreadValues({
|
12741
12880
|
key: tab.props.value
|
12742
12881
|
}, tab.props), {
|
12743
12882
|
index,
|
@@ -12745,20 +12884,20 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
12745
12884
|
onKeyDown: handleKeyDown,
|
12746
12885
|
onSelected: handleSelected
|
12747
12886
|
})) : void 0
|
12748
|
-
))), leftCaret && /* @__PURE__ */
|
12887
|
+
))), leftCaret && /* @__PURE__ */ React78.createElement("div", {
|
12749
12888
|
className: tw("absolute left-0 bg-gradient-to-r from-white via-white z-20 py-3 pr-4")
|
12750
|
-
}, /* @__PURE__ */
|
12889
|
+
}, /* @__PURE__ */ React78.createElement("div", {
|
12751
12890
|
onClick: () => handleScrollToNext("left"),
|
12752
12891
|
className: tw("hover:bg-muted p-2 leading-none cursor-pointer")
|
12753
|
-
}, /* @__PURE__ */
|
12892
|
+
}, /* @__PURE__ */ React78.createElement(InlineIcon, {
|
12754
12893
|
icon: import_chevronLeft4.default
|
12755
|
-
}))), rightCaret && /* @__PURE__ */
|
12894
|
+
}))), rightCaret && /* @__PURE__ */ React78.createElement("div", {
|
12756
12895
|
onClick: () => handleScrollToNext("right"),
|
12757
12896
|
className: tw("absolute right-0 bg-gradient-to-l from-white via-white z-20 py-3 pl-4")
|
12758
|
-
}, /* @__PURE__ */
|
12897
|
+
}, /* @__PURE__ */ React78.createElement("div", {
|
12759
12898
|
onClick: () => handleScrollToNext("right"),
|
12760
12899
|
className: tw("hover:bg-muted p-2 leading-none cursor-pointer")
|
12761
|
-
}, /* @__PURE__ */
|
12900
|
+
}, /* @__PURE__ */ React78.createElement(InlineIcon, {
|
12762
12901
|
icon: import_chevronRight4.default
|
12763
12902
|
})))), renderChildren(children, selected, props));
|
12764
12903
|
};
|
@@ -12766,15 +12905,15 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
12766
12905
|
Tabs2.Tab = TabComponent;
|
12767
12906
|
return Tabs2;
|
12768
12907
|
};
|
12769
|
-
var Tabs = createTabsComponent(Tab, TabItem, "Tabs", (children, selected) => /* @__PURE__ */
|
12908
|
+
var Tabs = createTabsComponent(Tab, TabItem, "Tabs", (children, selected) => /* @__PURE__ */ React78.createElement(TabContainer, null, children.find(
|
12770
12909
|
(node, index) => (node == null ? void 0 : node.props.value) === selected || index === selected
|
12771
12910
|
)));
|
12772
12911
|
|
12773
12912
|
// src/molecules/Drawer/Drawer.tsx
|
12774
12913
|
var import_cross6 = __toESM(require_cross());
|
12775
12914
|
var import_more4 = __toESM(require_more());
|
12776
|
-
var AnimatedBackDrop =
|
12777
|
-
var AnimatedDialog =
|
12915
|
+
var AnimatedBackDrop = animated5(Modal.BackDrop);
|
12916
|
+
var AnimatedDialog = animated5(Modal.Dialog);
|
12778
12917
|
var WIDTHS = {
|
12779
12918
|
sm: 360,
|
12780
12919
|
md: 560,
|
@@ -12783,8 +12922,8 @@ var WIDTHS = {
|
|
12783
12922
|
var Drawer = (_a) => {
|
12784
12923
|
var _b = _a, { open, closeOnEsc = true } = _b, props = __objRest(_b, ["open", "closeOnEsc"]);
|
12785
12924
|
const { onClose, size = "sm", portalContainer } = props;
|
12786
|
-
const [hidden, setHidden] =
|
12787
|
-
const ref =
|
12925
|
+
const [hidden, setHidden] = React79.useState(!open);
|
12926
|
+
const ref = React79.useRef(null);
|
12788
12927
|
const state = useOverlayTriggerState3({ isOpen: !hidden, onOpenChange: (isOpen) => !isOpen && onClose() });
|
12789
12928
|
if (open && hidden) {
|
12790
12929
|
setHidden(!open);
|
@@ -12794,7 +12933,7 @@ var Drawer = (_a) => {
|
|
12794
12933
|
state,
|
12795
12934
|
ref
|
12796
12935
|
);
|
12797
|
-
const { opacity, right } =
|
12936
|
+
const { opacity, right } = useSpring4({
|
12798
12937
|
right: open ? "0px" : `-${WIDTHS[size]}px`,
|
12799
12938
|
opacity: open ? 0.6 : 0,
|
12800
12939
|
config: {
|
@@ -12811,21 +12950,21 @@ var Drawer = (_a) => {
|
|
12811
12950
|
if (!state.isOpen) {
|
12812
12951
|
return null;
|
12813
12952
|
}
|
12814
|
-
return /* @__PURE__ */
|
12953
|
+
return /* @__PURE__ */ React79.createElement(Overlay3, {
|
12815
12954
|
portalContainer
|
12816
|
-
}, /* @__PURE__ */
|
12955
|
+
}, /* @__PURE__ */ React79.createElement(Modal, {
|
12817
12956
|
kind: "drawer",
|
12818
12957
|
className: "Aquarium-Drawer overflow-x-hidden",
|
12819
12958
|
open: true
|
12820
|
-
}, /* @__PURE__ */
|
12959
|
+
}, /* @__PURE__ */ React79.createElement(AnimatedBackDrop, __spreadValues({
|
12821
12960
|
style: { opacity }
|
12822
|
-
}, underlayProps)), /* @__PURE__ */
|
12961
|
+
}, underlayProps)), /* @__PURE__ */ React79.createElement(DrawerWrapper, __spreadProps(__spreadValues(__spreadValues({
|
12823
12962
|
ref
|
12824
12963
|
}, props), modalProps), {
|
12825
12964
|
spring: { right }
|
12826
12965
|
}))));
|
12827
12966
|
};
|
12828
|
-
var DrawerWrapper =
|
12967
|
+
var DrawerWrapper = React79.forwardRef(
|
12829
12968
|
(_a, ref) => {
|
12830
12969
|
var _b = _a, {
|
12831
12970
|
title,
|
@@ -12862,76 +13001,76 @@ var DrawerWrapper = React78.forwardRef(
|
|
12862
13001
|
ref
|
12863
13002
|
);
|
12864
13003
|
const dialogSize = size === "lg" ? "full" : size;
|
12865
|
-
const childElements =
|
13004
|
+
const childElements = React79.Children.toArray(children).filter(React79.isValidElement);
|
12866
13005
|
const onlyChild = childElements.length === 1 ? childElements[0] : null;
|
12867
13006
|
const hasTabs = isComponentType(onlyChild, Tabs);
|
12868
|
-
return /* @__PURE__ */
|
13007
|
+
return /* @__PURE__ */ React79.createElement(AnimatedDialog, __spreadProps(__spreadValues(__spreadValues({
|
12869
13008
|
ref,
|
12870
13009
|
kind: "drawer",
|
12871
13010
|
"aria-modal": "true",
|
12872
13011
|
size: dialogSize
|
12873
13012
|
}, props), dialogProps), {
|
12874
13013
|
style: { position: "fixed", right: spring.right }
|
12875
|
-
}), /* @__PURE__ */
|
13014
|
+
}), /* @__PURE__ */ React79.createElement(Modal.CloseButtonContainer, null, /* @__PURE__ */ React79.createElement(Button.Icon, {
|
12876
13015
|
"aria-label": "Close",
|
12877
13016
|
icon: import_cross6.default,
|
12878
13017
|
onClick: onClose
|
12879
|
-
})), /* @__PURE__ */
|
13018
|
+
})), /* @__PURE__ */ React79.createElement(Modal.Header, {
|
12880
13019
|
className: tw({ "pb-3": hasTabs })
|
12881
|
-
}, /* @__PURE__ */
|
13020
|
+
}, /* @__PURE__ */ React79.createElement(Modal.Title, {
|
12882
13021
|
id: labelledBy,
|
12883
13022
|
kind: "drawer"
|
12884
|
-
}, title)), hasTabs ? /* @__PURE__ */
|
13023
|
+
}, title)), hasTabs ? /* @__PURE__ */ React79.createElement(DrawerTabs, __spreadProps(__spreadValues({}, onlyChild.props), {
|
12885
13024
|
className: tw("[&>div:first-child]:px-5 grow flex flex-col overflow-y-auto")
|
12886
|
-
})) : /* @__PURE__ */
|
13025
|
+
})) : /* @__PURE__ */ React79.createElement(Modal.Body, {
|
12887
13026
|
id: describedBy,
|
12888
13027
|
tabIndex: 0,
|
12889
13028
|
noFooter: !(secondaryActions || primaryAction)
|
12890
|
-
}, children), (secondaryActions || primaryAction) && /* @__PURE__ */
|
13029
|
+
}, children), (secondaryActions || primaryAction) && /* @__PURE__ */ React79.createElement(Modal.Footer, null, /* @__PURE__ */ React79.createElement(Modal.Actions, {
|
12891
13030
|
className: size === "sm" ? tw("flex-col") : void 0
|
12892
|
-
}, size !== "sm" && menu && /* @__PURE__ */
|
13031
|
+
}, size !== "sm" && menu && /* @__PURE__ */ React79.createElement(Box.Flex, {
|
12893
13032
|
alignItems: "center"
|
12894
|
-
}, /* @__PURE__ */
|
13033
|
+
}, /* @__PURE__ */ React79.createElement(DropdownMenu2, {
|
12895
13034
|
onAction: (action) => onAction == null ? void 0 : onAction(action),
|
12896
13035
|
onOpenChange: onMenuOpenChange
|
12897
|
-
}, /* @__PURE__ */
|
13036
|
+
}, /* @__PURE__ */ React79.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ React79.createElement(Button.Icon, {
|
12898
13037
|
"aria-label": (_a2 = menuAriaLabel != null ? menuAriaLabel : menuLabel) != null ? _a2 : "Context menu",
|
12899
13038
|
icon: import_more4.default
|
12900
13039
|
})), menu)), secondaryActions && castArray3(secondaryActions).filter(Boolean).map((_b2) => {
|
12901
13040
|
var _c = _b2, { text } = _c, action = __objRest(_c, ["text"]);
|
12902
|
-
return /* @__PURE__ */
|
13041
|
+
return /* @__PURE__ */ React79.createElement(Button.Secondary, __spreadValues({
|
12903
13042
|
key: text
|
12904
13043
|
}, action), text);
|
12905
|
-
}), primaryAction && /* @__PURE__ */
|
13044
|
+
}), primaryAction && /* @__PURE__ */ React79.createElement(Button.Primary, __spreadValues({
|
12906
13045
|
key: primaryAction.text
|
12907
13046
|
}, omit9(primaryAction, "text")), primaryAction.text))));
|
12908
13047
|
}
|
12909
13048
|
);
|
12910
|
-
var DrawerTabs = createTabsComponent(ModalTab, TabItem, "DrawerTabs", (children, selected) => /* @__PURE__ */
|
13049
|
+
var DrawerTabs = createTabsComponent(ModalTab, TabItem, "DrawerTabs", (children, selected) => /* @__PURE__ */ React79.createElement(Modal.Body, {
|
12911
13050
|
className: tw("h-full")
|
12912
|
-
}, /* @__PURE__ */
|
13051
|
+
}, /* @__PURE__ */ React79.createElement(ModalTabContainer, null, children.find(
|
12913
13052
|
(node, index) => (node == null ? void 0 : node.props.value) === selected || index === selected
|
12914
13053
|
))));
|
12915
13054
|
|
12916
13055
|
// src/molecules/Dropdown/Dropdown.tsx
|
12917
|
-
import
|
13056
|
+
import React82 from "react";
|
12918
13057
|
|
12919
13058
|
// src/molecules/Popover/Popover.tsx
|
12920
|
-
import
|
13059
|
+
import React81, { useRef as useRef10 } from "react";
|
12921
13060
|
import { PressResponder as PressResponder2, usePress as usePress2 } from "@react-aria/interactions";
|
12922
13061
|
import { useOverlayTrigger } from "@react-aria/overlays";
|
12923
13062
|
import { mergeProps as mergeProps3 } from "@react-aria/utils";
|
12924
13063
|
import { useOverlayTriggerState as useOverlayTriggerState4 } from "@react-stately/overlays";
|
12925
|
-
import
|
13064
|
+
import classNames9 from "classnames";
|
12926
13065
|
import omit10 from "lodash/omit";
|
12927
13066
|
|
12928
13067
|
// src/molecules/Popover/Dialog.tsx
|
12929
|
-
import
|
13068
|
+
import React80 from "react";
|
12930
13069
|
import { useDialog as useDialog3 } from "@react-aria/dialog";
|
12931
13070
|
var Dialog2 = ({ children }) => {
|
12932
|
-
const ref =
|
13071
|
+
const ref = React80.useRef(null);
|
12933
13072
|
const { dialogProps } = useDialog3({}, ref);
|
12934
|
-
return /* @__PURE__ */
|
13073
|
+
return /* @__PURE__ */ React80.createElement("div", __spreadProps(__spreadValues({
|
12935
13074
|
ref
|
12936
13075
|
}, dialogProps), {
|
12937
13076
|
className: tw("outline-none")
|
@@ -12962,36 +13101,36 @@ var Popover2 = (props) => {
|
|
12962
13101
|
crossOffset,
|
12963
13102
|
shouldFlip
|
12964
13103
|
} = props;
|
12965
|
-
const triggerRef =
|
13104
|
+
const triggerRef = useRef10(null);
|
12966
13105
|
const state = useOverlayTriggerState4(props);
|
12967
13106
|
const { triggerProps, overlayProps } = useOverlayTrigger({ type: type != null ? type : "dialog" }, state, triggerRef);
|
12968
|
-
return /* @__PURE__ */
|
13107
|
+
return /* @__PURE__ */ React81.createElement(PopoverContext.Provider, {
|
12969
13108
|
value: {
|
12970
13109
|
state
|
12971
13110
|
}
|
12972
|
-
},
|
13111
|
+
}, React81.Children.map(props.children, (child) => {
|
12973
13112
|
if (isComponentType(child, Popover2.Trigger)) {
|
12974
|
-
return /* @__PURE__ */
|
13113
|
+
return /* @__PURE__ */ React81.createElement(PressResponder2, __spreadValues({
|
12975
13114
|
ref: triggerRef
|
12976
|
-
}, omit10(triggerProps, "aria-expanded")), /* @__PURE__ */
|
13115
|
+
}, omit10(triggerProps, "aria-expanded")), /* @__PURE__ */ React81.createElement(PopoverTriggerWrapper, {
|
12977
13116
|
"data-testid": props["data-testid"],
|
12978
13117
|
"aria-controls": id,
|
12979
13118
|
"aria-expanded": triggerProps["aria-expanded"]
|
12980
13119
|
}, child.props.children));
|
12981
13120
|
}
|
12982
13121
|
if (isComponentType(child, Popover2.Panel)) {
|
12983
|
-
return state.isOpen && /* @__PURE__ */
|
13122
|
+
return state.isOpen && /* @__PURE__ */ React81.createElement(PopoverOverlay, __spreadValues({
|
12984
13123
|
triggerRef: targetRef != null ? targetRef : triggerRef,
|
12985
13124
|
state,
|
12986
13125
|
placement,
|
12987
13126
|
isNonModal: !containFocus,
|
12988
13127
|
autoFocus: !containFocus,
|
12989
13128
|
isKeyboardDismissDisabled,
|
12990
|
-
className:
|
13129
|
+
className: classNames9("Aquarium-Popover", child.props.className),
|
12991
13130
|
offset,
|
12992
13131
|
crossOffset,
|
12993
13132
|
shouldFlip
|
12994
|
-
}, overlayProps), containFocus ? /* @__PURE__ */
|
13133
|
+
}, overlayProps), containFocus ? /* @__PURE__ */ React81.createElement(Dialog2, null, child.props.children) : child.props.children);
|
12995
13134
|
}
|
12996
13135
|
throw new Error("Invalid children element type");
|
12997
13136
|
}));
|
@@ -13010,7 +13149,7 @@ var asPopoverButton = (Component, displayName) => {
|
|
13010
13149
|
state.close();
|
13011
13150
|
onClick == null ? void 0 : onClick(e);
|
13012
13151
|
};
|
13013
|
-
return /* @__PURE__ */
|
13152
|
+
return /* @__PURE__ */ React81.createElement(Component, __spreadProps(__spreadValues({}, props), {
|
13014
13153
|
onClick: handleClick
|
13015
13154
|
}));
|
13016
13155
|
};
|
@@ -13022,10 +13161,10 @@ Popover2.Button = PopoverButton;
|
|
13022
13161
|
var PopoverTriggerWrapper = (_a) => {
|
13023
13162
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
13024
13163
|
var _a2;
|
13025
|
-
const ref =
|
13026
|
-
const trigger =
|
13164
|
+
const ref = useRef10(null);
|
13165
|
+
const trigger = React81.Children.only(children);
|
13027
13166
|
const { pressProps } = usePress2(__spreadProps(__spreadValues({}, rest), { ref }));
|
13028
|
-
return
|
13167
|
+
return React81.cloneElement(trigger, __spreadProps(__spreadValues({
|
13029
13168
|
"ref": ref
|
13030
13169
|
}, mergeProps3(pressProps, trigger.props)), {
|
13031
13170
|
"aria-controls": (_a2 = rest["aria-controls"]) != null ? _a2 : pressProps["aria-controls"]
|
@@ -13034,10 +13173,10 @@ var PopoverTriggerWrapper = (_a) => {
|
|
13034
13173
|
|
13035
13174
|
// src/molecules/Dropdown/Dropdown.tsx
|
13036
13175
|
var Dropdown = ({ children, content, placement = "bottom-left" }) => {
|
13037
|
-
return /* @__PURE__ */
|
13176
|
+
return /* @__PURE__ */ React82.createElement(Popover2, {
|
13038
13177
|
type: "menu",
|
13039
13178
|
placement
|
13040
|
-
}, /* @__PURE__ */
|
13179
|
+
}, /* @__PURE__ */ React82.createElement(Popover2.Trigger, null, children), /* @__PURE__ */ React82.createElement(Popover2.Panel, {
|
13041
13180
|
className: "Aquarium-Dropdown"
|
13042
13181
|
}, content));
|
13043
13182
|
};
|
@@ -13048,26 +13187,26 @@ var DropdownMenu3 = ({
|
|
13048
13187
|
triggerId,
|
13049
13188
|
setClose = () => void 0
|
13050
13189
|
}) => {
|
13051
|
-
const menuRef =
|
13052
|
-
|
13190
|
+
const menuRef = React82.useRef(null);
|
13191
|
+
React82.useEffect(() => {
|
13053
13192
|
const id = setTimeout(() => {
|
13054
13193
|
var _a, _b, _c;
|
13055
13194
|
return (_c = (_b = (_a = menuRef.current) == null ? void 0 : _a.children) == null ? void 0 : _b[0]) == null ? void 0 : _c.focus();
|
13056
13195
|
});
|
13057
13196
|
return () => clearTimeout(id);
|
13058
13197
|
}, [menuRef.current]);
|
13059
|
-
return /* @__PURE__ */
|
13198
|
+
return /* @__PURE__ */ React82.createElement("div", {
|
13060
13199
|
style: { minWidth: "250px" },
|
13061
13200
|
className: tw("py-3 bg-popover-content")
|
13062
|
-
}, !!title && /* @__PURE__ */
|
13201
|
+
}, !!title && /* @__PURE__ */ React82.createElement("div", {
|
13063
13202
|
className: tw("px-4 py-4 text-left text-intense typography-default-strong")
|
13064
|
-
}, title), /* @__PURE__ */
|
13203
|
+
}, title), /* @__PURE__ */ React82.createElement("ol", {
|
13065
13204
|
role: "menu",
|
13066
13205
|
ref: menuRef,
|
13067
13206
|
id: contentId,
|
13068
13207
|
"aria-labelledby": triggerId
|
13069
|
-
},
|
13070
|
-
return
|
13208
|
+
}, React82.Children.map(children, (child) => {
|
13209
|
+
return React82.cloneElement(child, { setClose });
|
13071
13210
|
})));
|
13072
13211
|
};
|
13073
13212
|
var DropdownItem = (_a) => {
|
@@ -13122,10 +13261,10 @@ var DropdownItem = (_a) => {
|
|
13122
13261
|
handleSelect();
|
13123
13262
|
}
|
13124
13263
|
};
|
13125
|
-
const itemContent = /* @__PURE__ */
|
13264
|
+
const itemContent = /* @__PURE__ */ React82.createElement("div", {
|
13126
13265
|
className: tw("py-3 px-4")
|
13127
13266
|
}, children);
|
13128
|
-
return /* @__PURE__ */
|
13267
|
+
return /* @__PURE__ */ React82.createElement("li", __spreadProps(__spreadValues({
|
13129
13268
|
role: "menuitem",
|
13130
13269
|
tabIndex: -1,
|
13131
13270
|
onClick: handleClick,
|
@@ -13136,11 +13275,11 @@ var DropdownItem = (_a) => {
|
|
13136
13275
|
"text-inactive cursor-not-allowed": disabled,
|
13137
13276
|
"text-primary-default hover:text-primary-intense": color === "danger" && !disabled
|
13138
13277
|
})
|
13139
|
-
}), tooltip ? /* @__PURE__ */
|
13278
|
+
}), tooltip ? /* @__PURE__ */ React82.createElement(Tooltip, {
|
13140
13279
|
content: tooltip,
|
13141
13280
|
placement: tooltipPlacement,
|
13142
13281
|
inline: false
|
13143
|
-
}, /* @__PURE__ */
|
13282
|
+
}, /* @__PURE__ */ React82.createElement("div", {
|
13144
13283
|
tabIndex: 0,
|
13145
13284
|
className: tw("grow")
|
13146
13285
|
}, itemContent)) : itemContent);
|
@@ -13149,7 +13288,7 @@ Dropdown.Menu = DropdownMenu3;
|
|
13149
13288
|
Dropdown.Item = DropdownItem;
|
13150
13289
|
|
13151
13290
|
// src/molecules/EmptyState/EmptyState.tsx
|
13152
|
-
import
|
13291
|
+
import React83 from "react";
|
13153
13292
|
var EmptyStateLayout = /* @__PURE__ */ ((EmptyStateLayout2) => {
|
13154
13293
|
EmptyStateLayout2["Vertical"] = "vertical";
|
13155
13294
|
EmptyStateLayout2["Horizontal"] = "horizontal";
|
@@ -13206,7 +13345,7 @@ var EmptyState = ({
|
|
13206
13345
|
fullHeight = isVerticalLayout(layout) ? true : false
|
13207
13346
|
}) => {
|
13208
13347
|
const template = layoutStyle(layout);
|
13209
|
-
return /* @__PURE__ */
|
13348
|
+
return /* @__PURE__ */ React83.createElement(Box, {
|
13210
13349
|
className: classNames(
|
13211
13350
|
"Aquarium-EmptyState",
|
13212
13351
|
tw("rounded p-[56px]", {
|
@@ -13218,40 +13357,40 @@ var EmptyState = ({
|
|
13218
13357
|
})
|
13219
13358
|
),
|
13220
13359
|
backgroundColor: "transparent",
|
13221
|
-
borderColor: "
|
13222
|
-
}, /* @__PURE__ */
|
13360
|
+
borderColor: "default"
|
13361
|
+
}, /* @__PURE__ */ React83.createElement(Box.Flex, {
|
13223
13362
|
style: { gap: "56px" },
|
13224
13363
|
flexDirection: template.layout,
|
13225
13364
|
justifyContent: template.justifyContent,
|
13226
13365
|
alignItems: template.layout === "row" ? "center" : template.alignItems,
|
13227
13366
|
height: fullHeight ? "full" : void 0
|
13228
|
-
}, image && /* @__PURE__ */
|
13367
|
+
}, image && /* @__PURE__ */ React83.createElement("img", {
|
13229
13368
|
src: image,
|
13230
13369
|
alt: imageAlt,
|
13231
13370
|
style: { width: imageWidth ? `${imageWidth}px` : void 0, height: "auto" }
|
13232
|
-
}), /* @__PURE__ */
|
13371
|
+
}), /* @__PURE__ */ React83.createElement(Box.Flex, {
|
13233
13372
|
flexDirection: "column",
|
13234
13373
|
justifyContent: template.justifyContent,
|
13235
13374
|
alignItems: template.alignItems
|
13236
|
-
}, /* @__PURE__ */
|
13375
|
+
}, /* @__PURE__ */ React83.createElement(Typography2.Heading, {
|
13237
13376
|
htmlTag: "h2"
|
13238
|
-
}, title), (description || children) && /* @__PURE__ */
|
13377
|
+
}, title), (description || children) && /* @__PURE__ */ React83.createElement(Box, {
|
13239
13378
|
marginTop: "5"
|
13240
|
-
}, /* @__PURE__ */
|
13379
|
+
}, /* @__PURE__ */ React83.createElement(Typography2.Default, null, children || description)), (secondaryAction || primaryAction) && /* @__PURE__ */ React83.createElement(Box.Flex, {
|
13241
13380
|
marginTop: "7",
|
13242
13381
|
gap: "4",
|
13243
13382
|
justifyContent: "center",
|
13244
13383
|
alignItems: "center",
|
13245
13384
|
flexWrap: "wrap"
|
13246
|
-
}, primaryAction && renderAction({ kind: "primary", action: primaryAction }), secondaryAction && renderAction({ kind: "secondary", action: secondaryAction })), footer && /* @__PURE__ */
|
13385
|
+
}, primaryAction && renderAction({ kind: "primary", action: primaryAction }), secondaryAction && renderAction({ kind: "secondary", action: secondaryAction })), footer && /* @__PURE__ */ React83.createElement(Box, {
|
13247
13386
|
marginTop: "5"
|
13248
|
-
}, /* @__PURE__ */
|
13249
|
-
color: "
|
13387
|
+
}, /* @__PURE__ */ React83.createElement(Typography2.Small, {
|
13388
|
+
color: "default"
|
13250
13389
|
}, footer)))));
|
13251
13390
|
};
|
13252
13391
|
|
13253
13392
|
// src/molecules/Flexbox/FlexboxItem.tsx
|
13254
|
-
import
|
13393
|
+
import React84 from "react";
|
13255
13394
|
var FlexboxItem = Tailwindify(
|
13256
13395
|
({ htmlTag = "div", className, style, children, display, flex, grow, shrink, order, alignSelf }) => {
|
13257
13396
|
const hookStyle = useStyle({
|
@@ -13263,7 +13402,7 @@ var FlexboxItem = Tailwindify(
|
|
13263
13402
|
alignSelf
|
13264
13403
|
});
|
13265
13404
|
const HtmlElement = htmlTag;
|
13266
|
-
return /* @__PURE__ */
|
13405
|
+
return /* @__PURE__ */ React84.createElement(HtmlElement, {
|
13267
13406
|
style: __spreadValues(__spreadValues({}, hookStyle), style),
|
13268
13407
|
className
|
13269
13408
|
}, children);
|
@@ -13271,7 +13410,7 @@ var FlexboxItem = Tailwindify(
|
|
13271
13410
|
);
|
13272
13411
|
|
13273
13412
|
// src/molecules/Grid/GridItem.tsx
|
13274
|
-
import
|
13413
|
+
import React85 from "react";
|
13275
13414
|
var GridItem2 = Tailwindify(
|
13276
13415
|
({
|
13277
13416
|
htmlTag = "div",
|
@@ -13302,7 +13441,7 @@ var GridItem2 = Tailwindify(
|
|
13302
13441
|
gridRowEnd: rowEnd
|
13303
13442
|
});
|
13304
13443
|
const HtmlElement = htmlTag;
|
13305
|
-
return /* @__PURE__ */
|
13444
|
+
return /* @__PURE__ */ React85.createElement(HtmlElement, {
|
13306
13445
|
style: __spreadValues(__spreadValues({}, hookStyle), style),
|
13307
13446
|
className
|
13308
13447
|
}, children);
|
@@ -13310,7 +13449,7 @@ var GridItem2 = Tailwindify(
|
|
13310
13449
|
);
|
13311
13450
|
|
13312
13451
|
// src/molecules/LineClamp/LineClamp.tsx
|
13313
|
-
import
|
13452
|
+
import React86 from "react";
|
13314
13453
|
var LineClamp2 = ({
|
13315
13454
|
lines,
|
13316
13455
|
children,
|
@@ -13319,10 +13458,10 @@ var LineClamp2 = ({
|
|
13319
13458
|
collapseLabel,
|
13320
13459
|
onClampedChange
|
13321
13460
|
}) => {
|
13322
|
-
const ref =
|
13323
|
-
const [clamped, setClamped] =
|
13324
|
-
const [isClampingEnabled, setClampingEnabled] =
|
13325
|
-
|
13461
|
+
const ref = React86.useRef(null);
|
13462
|
+
const [clamped, setClamped] = React86.useState(true);
|
13463
|
+
const [isClampingEnabled, setClampingEnabled] = React86.useState(false);
|
13464
|
+
React86.useEffect(() => {
|
13326
13465
|
var _a, _b;
|
13327
13466
|
const el = ref.current;
|
13328
13467
|
setClampingEnabled(((_a = el == null ? void 0 : el.scrollHeight) != null ? _a : 0) > ((_b = el == null ? void 0 : el.clientHeight) != null ? _b : 0));
|
@@ -13331,28 +13470,28 @@ var LineClamp2 = ({
|
|
13331
13470
|
setClamped(!clamped);
|
13332
13471
|
onClampedChange == null ? void 0 : onClampedChange(!clamped);
|
13333
13472
|
};
|
13334
|
-
return /* @__PURE__ */
|
13473
|
+
return /* @__PURE__ */ React86.createElement("div", {
|
13335
13474
|
className: "Aquarium-LineClamp"
|
13336
|
-
}, /* @__PURE__ */
|
13475
|
+
}, /* @__PURE__ */ React86.createElement(LineClamp, {
|
13337
13476
|
ref,
|
13338
13477
|
lines,
|
13339
13478
|
clamped,
|
13340
13479
|
wordBreak
|
13341
|
-
}, children), expandLabel && isClampingEnabled && /* @__PURE__ */
|
13480
|
+
}, children), expandLabel && isClampingEnabled && /* @__PURE__ */ React86.createElement(Button.Ghost, {
|
13342
13481
|
dense: true,
|
13343
13482
|
onClick: handleClampedChange
|
13344
13483
|
}, clamped ? expandLabel : collapseLabel));
|
13345
13484
|
};
|
13346
13485
|
|
13347
13486
|
// src/molecules/Link/Link.tsx
|
13348
|
-
import
|
13349
|
-
import
|
13487
|
+
import React88 from "react";
|
13488
|
+
import classNames10 from "classnames";
|
13350
13489
|
|
13351
13490
|
// src/atoms/Link/Link.tsx
|
13352
|
-
import
|
13491
|
+
import React87 from "react";
|
13353
13492
|
var Link = (_a) => {
|
13354
13493
|
var _b = _a, { children, className } = _b, props = __objRest(_b, ["children", "className"]);
|
13355
|
-
return /* @__PURE__ */
|
13494
|
+
return /* @__PURE__ */ React87.createElement("a", __spreadValues({
|
13356
13495
|
className: classNames(className, linkStyle)
|
13357
13496
|
}, props), children);
|
13358
13497
|
};
|
@@ -13360,27 +13499,27 @@ var Link = (_a) => {
|
|
13360
13499
|
// src/molecules/Link/Link.tsx
|
13361
13500
|
var Link2 = (_a) => {
|
13362
13501
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
13363
|
-
return /* @__PURE__ */
|
13364
|
-
className:
|
13502
|
+
return /* @__PURE__ */ React88.createElement(Link, __spreadValues({
|
13503
|
+
className: classNames10("Aquarium-Link", className)
|
13365
13504
|
}, props));
|
13366
13505
|
};
|
13367
13506
|
|
13368
13507
|
// src/molecules/List/useStaticInfiniteList.ts
|
13369
|
-
import
|
13508
|
+
import React89 from "react";
|
13370
13509
|
var useStaticInfiniteList = ({
|
13371
13510
|
items,
|
13372
13511
|
pageSize,
|
13373
13512
|
autoReset = true
|
13374
13513
|
}) => {
|
13375
|
-
const [currentPage, setCurrentPage] =
|
13514
|
+
const [currentPage, setCurrentPage] = React89.useState(1);
|
13376
13515
|
const numberOfVisible = currentPage * pageSize;
|
13377
|
-
const next =
|
13516
|
+
const next = React89.useCallback(() => {
|
13378
13517
|
setCurrentPage((page) => page + 1);
|
13379
13518
|
}, [setCurrentPage]);
|
13380
|
-
const reset =
|
13519
|
+
const reset = React89.useCallback(() => {
|
13381
13520
|
setCurrentPage(1);
|
13382
13521
|
}, [setCurrentPage]);
|
13383
|
-
|
13522
|
+
React89.useEffect(() => {
|
13384
13523
|
if (autoReset) {
|
13385
13524
|
setCurrentPage(1);
|
13386
13525
|
}
|
@@ -13395,17 +13534,17 @@ var useStaticInfiniteList = ({
|
|
13395
13534
|
};
|
13396
13535
|
|
13397
13536
|
// src/molecules/ListItem/ListItem.tsx
|
13398
|
-
import
|
13537
|
+
import React90 from "react";
|
13399
13538
|
var ListItem = ({ name, icon, active = false }) => {
|
13400
|
-
return /* @__PURE__ */
|
13539
|
+
return /* @__PURE__ */ React90.createElement(Box.Flex, {
|
13401
13540
|
className: "Aquarium-ListItem",
|
13402
13541
|
alignItems: "center"
|
13403
|
-
}, /* @__PURE__ */
|
13542
|
+
}, /* @__PURE__ */ React90.createElement(Typography2, {
|
13404
13543
|
variant: active ? "small-strong" : "small",
|
13405
|
-
color: "
|
13544
|
+
color: "default",
|
13406
13545
|
htmlTag: "span",
|
13407
13546
|
className: `px-4 py-2 rounded-full ${active ? "bg-default" : "hover:bg-muted"}`
|
13408
|
-
}, /* @__PURE__ */
|
13547
|
+
}, /* @__PURE__ */ React90.createElement("img", {
|
13409
13548
|
src: icon,
|
13410
13549
|
alt: "",
|
13411
13550
|
className: "inline mr-4",
|
@@ -13415,7 +13554,7 @@ var ListItem = ({ name, icon, active = false }) => {
|
|
13415
13554
|
};
|
13416
13555
|
|
13417
13556
|
// src/molecules/Modal/Modal.tsx
|
13418
|
-
import
|
13557
|
+
import React91 from "react";
|
13419
13558
|
import { useDialog as useDialog4 } from "@react-aria/dialog";
|
13420
13559
|
import { Overlay as Overlay4, useModalOverlay as useModalOverlay3 } from "@react-aria/overlays";
|
13421
13560
|
import { useId as useId11 } from "@react-aria/utils";
|
@@ -13426,7 +13565,7 @@ var import_cross7 = __toESM(require_cross());
|
|
13426
13565
|
var Modal2 = (_a) => {
|
13427
13566
|
var _b = _a, { closeOnEsc = true } = _b, props = __objRest(_b, ["closeOnEsc"]);
|
13428
13567
|
const { open, onClose, size, portalContainer } = props;
|
13429
|
-
const ref =
|
13568
|
+
const ref = React91.useRef(null);
|
13430
13569
|
const state = useOverlayTriggerState5({ isOpen: open, onOpenChange: (isOpen) => !isOpen && onClose() });
|
13431
13570
|
const { modalProps, underlayProps } = useModalOverlay3(
|
13432
13571
|
{ isDismissable: false, isKeyboardDismissDisabled: !closeOnEsc },
|
@@ -13436,17 +13575,17 @@ var Modal2 = (_a) => {
|
|
13436
13575
|
if (!state.isOpen) {
|
13437
13576
|
return null;
|
13438
13577
|
}
|
13439
|
-
return /* @__PURE__ */
|
13578
|
+
return /* @__PURE__ */ React91.createElement(Overlay4, {
|
13440
13579
|
portalContainer
|
13441
|
-
}, /* @__PURE__ */
|
13580
|
+
}, /* @__PURE__ */ React91.createElement(Modal, {
|
13442
13581
|
className: "Aquarium-Modal",
|
13443
13582
|
open: true
|
13444
|
-
}, /* @__PURE__ */
|
13583
|
+
}, /* @__PURE__ */ React91.createElement(Modal.BackDrop, __spreadValues({}, underlayProps)), /* @__PURE__ */ React91.createElement(ModalWrapper, __spreadValues(__spreadValues({
|
13445
13584
|
ref,
|
13446
13585
|
size
|
13447
13586
|
}, props), modalProps))));
|
13448
13587
|
};
|
13449
|
-
var ModalWrapper =
|
13588
|
+
var ModalWrapper = React91.forwardRef(
|
13450
13589
|
(_a, ref) => {
|
13451
13590
|
var _b = _a, { title, subtitle, headerImage, primaryAction, secondaryActions, children, onClose } = _b, props = __objRest(_b, ["title", "subtitle", "headerImage", "primaryAction", "secondaryActions", "children", "onClose"]);
|
13452
13591
|
const labelledBy = useId11();
|
@@ -13455,30 +13594,30 @@ var ModalWrapper = React90.forwardRef(
|
|
13455
13594
|
{ "role": "dialog", "aria-labelledby": labelledBy, "aria-describedby": describedBy },
|
13456
13595
|
ref
|
13457
13596
|
);
|
13458
|
-
return /* @__PURE__ */
|
13597
|
+
return /* @__PURE__ */ React91.createElement(Modal.Dialog, __spreadProps(__spreadValues(__spreadValues({
|
13459
13598
|
ref
|
13460
13599
|
}, props), dialogProps), {
|
13461
13600
|
tabIndex: -1
|
13462
|
-
}), /* @__PURE__ */
|
13601
|
+
}), /* @__PURE__ */ React91.createElement(Modal.CloseButtonContainer, null, /* @__PURE__ */ React91.createElement(IconButton, {
|
13463
13602
|
"aria-label": "Close",
|
13464
13603
|
icon: import_cross7.default,
|
13465
13604
|
onClick: onClose
|
13466
|
-
})), headerImage !== void 0 && /* @__PURE__ */
|
13605
|
+
})), headerImage !== void 0 && /* @__PURE__ */ React91.createElement(Modal.HeaderImage, {
|
13467
13606
|
backgroundImage: headerImage
|
13468
|
-
}), /* @__PURE__ */
|
13607
|
+
}), /* @__PURE__ */ React91.createElement(Modal.Header, {
|
13469
13608
|
className: tw({ "pb-3": isComponentType(children, ModalTabs) })
|
13470
|
-
}, /* @__PURE__ */
|
13609
|
+
}, /* @__PURE__ */ React91.createElement(Modal.TitleContainer, null, /* @__PURE__ */ React91.createElement(Modal.Title, {
|
13471
13610
|
id: labelledBy
|
13472
|
-
}, title), subtitle && /* @__PURE__ */
|
13611
|
+
}, title), subtitle && /* @__PURE__ */ React91.createElement(Modal.Subtitle, null, subtitle))), isComponentType(children, ModalTabs) ? React91.cloneElement(children, { className: tw("[&>div:first-child]:px-5 grow") }) : /* @__PURE__ */ React91.createElement(Modal.Body, {
|
13473
13612
|
id: describedBy,
|
13474
13613
|
tabIndex: 0,
|
13475
13614
|
noFooter: !(secondaryActions || primaryAction)
|
13476
|
-
}, children), (secondaryActions || primaryAction) && /* @__PURE__ */
|
13615
|
+
}, children), (secondaryActions || primaryAction) && /* @__PURE__ */ React91.createElement(Modal.Footer, null, /* @__PURE__ */ React91.createElement(Modal.Actions, null, secondaryActions && castArray4(secondaryActions).filter(Boolean).map((_a2) => {
|
13477
13616
|
var _b2 = _a2, { text } = _b2, action = __objRest(_b2, ["text"]);
|
13478
|
-
return /* @__PURE__ */
|
13617
|
+
return /* @__PURE__ */ React91.createElement(Button.Secondary, __spreadValues({
|
13479
13618
|
key: text
|
13480
13619
|
}, action), text);
|
13481
|
-
}), primaryAction && /* @__PURE__ */
|
13620
|
+
}), primaryAction && /* @__PURE__ */ React91.createElement(Button.Primary, __spreadValues({
|
13482
13621
|
key: primaryAction.text
|
13483
13622
|
}, omit11(primaryAction, "text")), primaryAction.text))));
|
13484
13623
|
}
|
@@ -13487,24 +13626,24 @@ var ModalTabs = createTabsComponent(
|
|
13487
13626
|
ModalTab,
|
13488
13627
|
TabItem,
|
13489
13628
|
"ModalTabs",
|
13490
|
-
(children, selected, props) => /* @__PURE__ */
|
13629
|
+
(children, selected, props) => /* @__PURE__ */ React91.createElement(Modal.Body, {
|
13491
13630
|
maxHeight: props.maxHeight
|
13492
|
-
}, /* @__PURE__ */
|
13631
|
+
}, /* @__PURE__ */ React91.createElement(ModalTabContainer, null, children.find(
|
13493
13632
|
(node, index) => (node == null ? void 0 : node.props.value) === selected || index === selected
|
13494
13633
|
)))
|
13495
13634
|
);
|
13496
13635
|
|
13497
13636
|
// src/molecules/MultiInput/MultiInput.tsx
|
13498
|
-
import
|
13637
|
+
import React93, { useEffect as useEffect9, useRef as useRef11, useState as useState12 } from "react";
|
13499
13638
|
import { useId as useId12 } from "@react-aria/utils";
|
13500
13639
|
import castArray5 from "lodash/castArray";
|
13501
13640
|
import identity from "lodash/identity";
|
13502
13641
|
import omit12 from "lodash/omit";
|
13503
13642
|
|
13504
13643
|
// src/molecules/MultiInput/InputChip.tsx
|
13505
|
-
import
|
13644
|
+
import React92 from "react";
|
13506
13645
|
var import_smallCross2 = __toESM(require_smallCross());
|
13507
|
-
var InputChip =
|
13646
|
+
var InputChip = React92.forwardRef(
|
13508
13647
|
(_a, ref) => {
|
13509
13648
|
var _b = _a, { invalid = false, disabled, readOnly, className, onClick: _onClick, children } = _b, props = __objRest(_b, ["invalid", "disabled", "readOnly", "className", "onClick", "children"]);
|
13510
13649
|
const onClick = (e) => {
|
@@ -13512,18 +13651,18 @@ var InputChip = React91.forwardRef(
|
|
13512
13651
|
_onClick == null ? void 0 : _onClick(e);
|
13513
13652
|
}
|
13514
13653
|
};
|
13515
|
-
return /* @__PURE__ */
|
13654
|
+
return /* @__PURE__ */ React92.createElement("div", {
|
13516
13655
|
className: classNames(className, "inline-flex align-middle mx-1 items-stretch rounded-sm break-all", {
|
13517
13656
|
"bg-status-danger ": invalid,
|
13518
13657
|
"bg-muted ": !invalid && !disabled,
|
13519
13658
|
"bg-default": disabled
|
13520
13659
|
})
|
13521
|
-
}, /* @__PURE__ */
|
13660
|
+
}, /* @__PURE__ */ React92.createElement("div", {
|
13522
13661
|
className: tw("px-2 py-1")
|
13523
|
-
}, /* @__PURE__ */
|
13662
|
+
}, /* @__PURE__ */ React92.createElement(Typography2, {
|
13524
13663
|
variant: "small",
|
13525
|
-
color: invalid ? "
|
13526
|
-
}, children)), !readOnly && /* @__PURE__ */
|
13664
|
+
color: invalid ? "warning-default" : disabled ? "inactive" : "default"
|
13665
|
+
}, children)), !readOnly && /* @__PURE__ */ React92.createElement("div", __spreadProps(__spreadValues({
|
13527
13666
|
ref
|
13528
13667
|
}, props), {
|
13529
13668
|
onClick,
|
@@ -13534,7 +13673,7 @@ var InputChip = React91.forwardRef(
|
|
13534
13673
|
}),
|
13535
13674
|
role: "button",
|
13536
13675
|
"aria-label": `Remove ${String(children)}`
|
13537
|
-
}), !disabled && /* @__PURE__ */
|
13676
|
+
}), !disabled && /* @__PURE__ */ React92.createElement(Icon, {
|
13538
13677
|
icon: import_smallCross2.default,
|
13539
13678
|
className: tw({
|
13540
13679
|
"text-danger-default": invalid,
|
@@ -13592,9 +13731,9 @@ var MultiInputBase = (_a) => {
|
|
13592
13731
|
"valid"
|
13593
13732
|
]);
|
13594
13733
|
var _a2;
|
13595
|
-
const inputRef =
|
13596
|
-
const [items, setItems] =
|
13597
|
-
const [hasFocus, setFocus] =
|
13734
|
+
const inputRef = useRef11(null);
|
13735
|
+
const [items, setItems] = useState12((_a2 = value != null ? value : defaultValue) != null ? _a2 : []);
|
13736
|
+
const [hasFocus, setFocus] = useState12(false);
|
13598
13737
|
const keyCodes = [delimiter !== "enter" ? " " : null, delimiter !== "space" ? "Enter" : null].filter(identity);
|
13599
13738
|
useEffect9(() => {
|
13600
13739
|
const requiresUpdate = value !== void 0 || defaultValue === void 0;
|
@@ -13675,7 +13814,7 @@ var MultiInputBase = (_a) => {
|
|
13675
13814
|
};
|
13676
13815
|
const renderChips = () => items == null ? void 0 : items.map((item, index) => {
|
13677
13816
|
var _a3;
|
13678
|
-
return /* @__PURE__ */
|
13817
|
+
return /* @__PURE__ */ React93.createElement(InputChip, {
|
13679
13818
|
key: `${itemToString(item)}.${index}`,
|
13680
13819
|
invalid: !((_a3 = isItemValid == null ? void 0 : isItemValid(item, index)) != null ? _a3 : true),
|
13681
13820
|
readOnly,
|
@@ -13686,13 +13825,13 @@ var MultiInputBase = (_a) => {
|
|
13686
13825
|
}
|
13687
13826
|
}, itemToString(item));
|
13688
13827
|
});
|
13689
|
-
return /* @__PURE__ */
|
13828
|
+
return /* @__PURE__ */ React93.createElement("div", {
|
13690
13829
|
className: "Aquarium-MultiInputBase"
|
13691
|
-
}, /* @__PURE__ */
|
13830
|
+
}, /* @__PURE__ */ React93.createElement(Select.InputContainer, {
|
13692
13831
|
variant: disabled ? "disabled" : !valid ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default"
|
13693
|
-
}, /* @__PURE__ */
|
13832
|
+
}, /* @__PURE__ */ React93.createElement("div", {
|
13694
13833
|
className: "grow inline-flex flex-row flex-wrap gap-y-2"
|
13695
|
-
}, inline && renderChips(), /* @__PURE__ */
|
13834
|
+
}, inline && renderChips(), /* @__PURE__ */ React93.createElement(Select.Input, __spreadProps(__spreadValues({
|
13696
13835
|
ref: inputRef,
|
13697
13836
|
id: id != null ? id : name,
|
13698
13837
|
name,
|
@@ -13710,18 +13849,18 @@ var MultiInputBase = (_a) => {
|
|
13710
13849
|
onFocus: handleFocus,
|
13711
13850
|
onBlur: handleBlur,
|
13712
13851
|
autoComplete: "off"
|
13713
|
-
}))), endAdornment && /* @__PURE__ */
|
13852
|
+
}))), endAdornment && /* @__PURE__ */ React93.createElement(InputAdornment, null, endAdornment)), !inline && /* @__PURE__ */ React93.createElement("div", {
|
13714
13853
|
className: tw("flex flex-row flex-wrap gap-y-2 mt-2")
|
13715
13854
|
}, renderChips()));
|
13716
13855
|
};
|
13717
|
-
var BaseMultiInputSkeleton = () => /* @__PURE__ */
|
13856
|
+
var BaseMultiInputSkeleton = () => /* @__PURE__ */ React93.createElement(Skeleton, {
|
13718
13857
|
height: 38
|
13719
13858
|
});
|
13720
13859
|
MultiInputBase.Skeleton = BaseMultiInputSkeleton;
|
13721
13860
|
var MultiInput = (props) => {
|
13722
13861
|
var _a, _b, _c, _d, _e;
|
13723
13862
|
const maxLength = (_a = props.maxLength) != null ? _a : props.max;
|
13724
|
-
const [value, setValue] =
|
13863
|
+
const [value, setValue] = useState12((_c = (_b = props.value) != null ? _b : props.defaultValue) != null ? _c : []);
|
13725
13864
|
useEffect9(() => {
|
13726
13865
|
var _a2;
|
13727
13866
|
setValue((_a2 = props.value) != null ? _a2 : []);
|
@@ -13732,7 +13871,7 @@ var MultiInput = (props) => {
|
|
13732
13871
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
13733
13872
|
const labelControlProps = getLabelControlProps(props);
|
13734
13873
|
const baseProps = omit12(props, Object.keys(labelControlProps));
|
13735
|
-
return /* @__PURE__ */
|
13874
|
+
return /* @__PURE__ */ React93.createElement(LabelControl, __spreadProps(__spreadValues({
|
13736
13875
|
id: `${id}-label`,
|
13737
13876
|
htmlFor: `${id}-input`,
|
13738
13877
|
messageId: errorMessageId
|
@@ -13740,7 +13879,7 @@ var MultiInput = (props) => {
|
|
13740
13879
|
length: value.length,
|
13741
13880
|
maxLength,
|
13742
13881
|
className: "Aquarium-MultiInput"
|
13743
|
-
}), /* @__PURE__ */
|
13882
|
+
}), /* @__PURE__ */ React93.createElement(MultiInputBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
|
13744
13883
|
id: `${id}-input`,
|
13745
13884
|
onChange: (value2) => {
|
13746
13885
|
var _a2;
|
@@ -13752,12 +13891,12 @@ var MultiInput = (props) => {
|
|
13752
13891
|
valid: props.valid
|
13753
13892
|
})));
|
13754
13893
|
};
|
13755
|
-
var MultiInputSkeleton = () => /* @__PURE__ */
|
13894
|
+
var MultiInputSkeleton = () => /* @__PURE__ */ React93.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React93.createElement(MultiInputBase.Skeleton, null));
|
13756
13895
|
MultiInput.Skeleton = MultiInputSkeleton;
|
13757
13896
|
MultiInput.Skeleton.displayName = "MultiInput.Skeleton";
|
13758
13897
|
|
13759
13898
|
// src/molecules/MultiSelect/MultiSelect.tsx
|
13760
|
-
import
|
13899
|
+
import React94, { useEffect as useEffect10, useRef as useRef12, useState as useState13 } from "react";
|
13761
13900
|
import { ariaHideOutside as ariaHideOutside2 } from "@react-aria/overlays";
|
13762
13901
|
import { useId as useId13 } from "@react-aria/utils";
|
13763
13902
|
import { useCombobox as useCombobox2, useMultipleSelection } from "downshift";
|
@@ -13823,12 +13962,12 @@ var MultiSelectBase = (_a) => {
|
|
13823
13962
|
"children"
|
13824
13963
|
]);
|
13825
13964
|
var _a2;
|
13826
|
-
const popoverRef =
|
13827
|
-
const targetRef =
|
13828
|
-
const menuRef =
|
13829
|
-
const inputRef =
|
13830
|
-
const [inputValue, setInputValue] =
|
13831
|
-
const [hasFocus, setFocus] =
|
13965
|
+
const popoverRef = useRef12(null);
|
13966
|
+
const targetRef = useRef12(null);
|
13967
|
+
const menuRef = useRef12(null);
|
13968
|
+
const inputRef = useRef12(null);
|
13969
|
+
const [inputValue, setInputValue] = useState13("");
|
13970
|
+
const [hasFocus, setFocus] = useState13(false);
|
13832
13971
|
const { selectedItems, addSelectedItem, removeSelectedItem, getDropdownProps, getSelectedItemProps } = useMultipleSelection(
|
13833
13972
|
omitBy(
|
13834
13973
|
{
|
@@ -13917,16 +14056,16 @@ var MultiSelectBase = (_a) => {
|
|
13917
14056
|
return ariaHideOutside2([inputRef.current, popoverRef.current]);
|
13918
14057
|
}
|
13919
14058
|
}, [state.isOpen, inputRef, popoverRef]);
|
13920
|
-
const renderItem = (item, index) => /* @__PURE__ */
|
14059
|
+
const renderItem = (item, index) => /* @__PURE__ */ React94.createElement(Select.Item, __spreadValues({
|
13921
14060
|
key: itemToString(item),
|
13922
14061
|
highlighted: index === highlightedIndex,
|
13923
14062
|
selected: selectedItems.includes(item)
|
13924
14063
|
}, getItemProps({ item, index })), renderOption(item));
|
13925
|
-
const renderGroup = (group) => group.options.length ? /* @__PURE__ */
|
14064
|
+
const renderGroup = (group) => group.options.length ? /* @__PURE__ */ React94.createElement(React94.Fragment, {
|
13926
14065
|
key: group.label
|
13927
|
-
}, /* @__PURE__ */
|
14066
|
+
}, /* @__PURE__ */ React94.createElement(Select.Group, null, group.label), group.options.map((opt) => renderItem(opt, flattenedOptions.indexOf(opt)))) : null;
|
13928
14067
|
const renderChips = () => {
|
13929
|
-
return selectedItems.map((selectedItem, index) => /* @__PURE__ */
|
14068
|
+
return selectedItems.map((selectedItem, index) => /* @__PURE__ */ React94.createElement(InputChip, __spreadProps(__spreadValues({
|
13930
14069
|
key: `${itemToString(selectedItem)}.chip`,
|
13931
14070
|
className: tw("mx-0"),
|
13932
14071
|
disabled,
|
@@ -13944,14 +14083,14 @@ var MultiSelectBase = (_a) => {
|
|
13944
14083
|
getDropdownProps({ ref: inputRef, disabled: disabled || readOnly, value: inputValue })
|
13945
14084
|
);
|
13946
14085
|
const menuProps = getMenuProps({ ref: menuRef }, { suppressRefError: !isOpen });
|
13947
|
-
return /* @__PURE__ */
|
14086
|
+
return /* @__PURE__ */ React94.createElement("div", {
|
13948
14087
|
className: classNames("Aquarium-MultiSelectBase", tw("relative"))
|
13949
|
-
}, /* @__PURE__ */
|
14088
|
+
}, /* @__PURE__ */ React94.createElement(Select.InputContainer, {
|
13950
14089
|
ref: targetRef,
|
13951
14090
|
variant: disabled ? "disabled" : !valid ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default"
|
13952
|
-
}, /* @__PURE__ */
|
14091
|
+
}, /* @__PURE__ */ React94.createElement("div", {
|
13953
14092
|
className: "grow inline-flex flex-row flex-wrap gap-2"
|
13954
|
-
}, !hideChips && inline && renderChips(), /* @__PURE__ */
|
14093
|
+
}, !hideChips && inline && renderChips(), /* @__PURE__ */ React94.createElement(Select.Input, __spreadProps(__spreadValues(__spreadValues({
|
13955
14094
|
name,
|
13956
14095
|
placeholder: selectedItems.length === 0 && !readOnly ? placeholder : ""
|
13957
14096
|
}, inputProps), props), {
|
@@ -13970,12 +14109,12 @@ var MultiSelectBase = (_a) => {
|
|
13970
14109
|
setFocus(false);
|
13971
14110
|
(_a3 = inputProps.onBlur) == null ? void 0 : _a3.call(inputProps, e);
|
13972
14111
|
}
|
13973
|
-
}))), !readOnly && /* @__PURE__ */
|
14112
|
+
}))), !readOnly && /* @__PURE__ */ React94.createElement(Select.Toggle, __spreadValues({
|
13974
14113
|
hasFocus,
|
13975
14114
|
isOpen
|
13976
|
-
}, getToggleButtonProps({ disabled })))), !hideChips && !inline && /* @__PURE__ */
|
14115
|
+
}, getToggleButtonProps({ disabled })))), !hideChips && !inline && /* @__PURE__ */ React94.createElement("div", {
|
13977
14116
|
className: tw("flex flex-row flex-wrap gap-2 mt-2")
|
13978
|
-
}, renderChips()), isOpen && /* @__PURE__ */
|
14117
|
+
}, renderChips()), isOpen && /* @__PURE__ */ React94.createElement(PopoverOverlay, {
|
13979
14118
|
ref: popoverRef,
|
13980
14119
|
triggerRef: targetRef,
|
13981
14120
|
state,
|
@@ -13983,13 +14122,13 @@ var MultiSelectBase = (_a) => {
|
|
13983
14122
|
shouldFlip: true,
|
13984
14123
|
isNonModal: true,
|
13985
14124
|
style: { width: (_a2 = targetRef.current) == null ? void 0 : _a2.offsetWidth }
|
13986
|
-
}, /* @__PURE__ */
|
14125
|
+
}, /* @__PURE__ */ React94.createElement(Select.Menu, __spreadValues({
|
13987
14126
|
maxHeight
|
13988
|
-
}, menuProps), hasNoResults && /* @__PURE__ */
|
14127
|
+
}, menuProps), hasNoResults && /* @__PURE__ */ React94.createElement(Select.NoResults, null, emptyState), filteredOptions.map(
|
13989
14128
|
(option, index) => isOptionGroup(option) ? renderGroup(option) : renderItem(option, index)
|
13990
14129
|
))));
|
13991
14130
|
};
|
13992
|
-
var MultiSelectBaseSkeleton = () => /* @__PURE__ */
|
14131
|
+
var MultiSelectBaseSkeleton = () => /* @__PURE__ */ React94.createElement(Skeleton, {
|
13993
14132
|
height: 38
|
13994
14133
|
});
|
13995
14134
|
MultiSelectBase.Skeleton = MultiSelectBaseSkeleton;
|
@@ -14010,13 +14149,13 @@ var MultiSelect = (_a) => {
|
|
14010
14149
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
14011
14150
|
const labelControlProps = getLabelControlProps(props);
|
14012
14151
|
const baseProps = omit13(props, Object.keys(labelControlProps));
|
14013
|
-
return /* @__PURE__ */
|
14152
|
+
return /* @__PURE__ */ React94.createElement(LabelControl, __spreadProps(__spreadValues({
|
14014
14153
|
id: `${id}-label`,
|
14015
14154
|
htmlFor: `${id}-input`,
|
14016
14155
|
messageId: errorMessageId
|
14017
14156
|
}, labelControlProps), {
|
14018
14157
|
className: "Aquarium-MultiSelect"
|
14019
|
-
}), /* @__PURE__ */
|
14158
|
+
}), /* @__PURE__ */ React94.createElement(MultiSelectBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
|
14020
14159
|
id,
|
14021
14160
|
options,
|
14022
14161
|
emptyState,
|
@@ -14024,17 +14163,17 @@ var MultiSelect = (_a) => {
|
|
14024
14163
|
valid: props.valid
|
14025
14164
|
})));
|
14026
14165
|
};
|
14027
|
-
var MultiSelectSkeleton = () => /* @__PURE__ */
|
14166
|
+
var MultiSelectSkeleton = () => /* @__PURE__ */ React94.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React94.createElement(MultiSelectBase.Skeleton, null));
|
14028
14167
|
MultiSelect.Skeleton = MultiSelectSkeleton;
|
14029
14168
|
MultiSelect.Skeleton.displayName = "MultiSelect.Skeleton";
|
14030
14169
|
|
14031
14170
|
// src/molecules/NativeSelect/NativeSelect.tsx
|
14032
|
-
import
|
14171
|
+
import React95 from "react";
|
14033
14172
|
import { useId as useId14 } from "@react-aria/utils";
|
14034
14173
|
import omit14 from "lodash/omit";
|
14035
14174
|
import uniqueId from "lodash/uniqueId";
|
14036
14175
|
var import_caretDown2 = __toESM(require_caretDown());
|
14037
|
-
var NativeSelectBase =
|
14176
|
+
var NativeSelectBase = React95.forwardRef(
|
14038
14177
|
(_a, ref) => {
|
14039
14178
|
var _b = _a, { children, disabled = false, required = false, valid = true, readOnly = false } = _b, props = __objRest(_b, ["children", "disabled", "required", "valid", "readOnly"]);
|
14040
14179
|
const placeholderValue = uniqueId("default_value_for_placeholder");
|
@@ -14051,16 +14190,16 @@ var NativeSelectBase = React94.forwardRef(
|
|
14051
14190
|
(_b2 = props.onBlur) == null ? void 0 : _b2.call(props, event);
|
14052
14191
|
}
|
14053
14192
|
};
|
14054
|
-
return /* @__PURE__ */
|
14193
|
+
return /* @__PURE__ */ React95.createElement("span", {
|
14055
14194
|
className: classNames("Aquarium-NativeSelectBase", tw("relative block"))
|
14056
|
-
}, !readOnly && /* @__PURE__ */
|
14195
|
+
}, !readOnly && /* @__PURE__ */ React95.createElement("span", {
|
14057
14196
|
className: tw(
|
14058
14197
|
"absolute right-0 inset-y-0 mr-4 text-inactive flex ml-3 pointer-events-none typography-default-strong mt-4"
|
14059
14198
|
)
|
14060
|
-
}, /* @__PURE__ */
|
14199
|
+
}, /* @__PURE__ */ React95.createElement(Icon, {
|
14061
14200
|
icon: import_caretDown2.default,
|
14062
14201
|
"data-testid": "icon-dropdown"
|
14063
|
-
})), /* @__PURE__ */
|
14202
|
+
})), /* @__PURE__ */ React95.createElement("select", __spreadProps(__spreadValues({
|
14064
14203
|
ref,
|
14065
14204
|
disabled: disabled || readOnly,
|
14066
14205
|
required
|
@@ -14079,16 +14218,16 @@ var NativeSelectBase = React94.forwardRef(
|
|
14079
14218
|
),
|
14080
14219
|
props.className
|
14081
14220
|
)
|
14082
|
-
}), props.placeholder && /* @__PURE__ */
|
14221
|
+
}), props.placeholder && /* @__PURE__ */ React95.createElement("option", {
|
14083
14222
|
value: placeholderValue,
|
14084
14223
|
disabled: true
|
14085
14224
|
}, props.placeholder), children));
|
14086
14225
|
}
|
14087
14226
|
);
|
14088
|
-
NativeSelectBase.Skeleton = () => /* @__PURE__ */
|
14227
|
+
NativeSelectBase.Skeleton = () => /* @__PURE__ */ React95.createElement(Skeleton, {
|
14089
14228
|
height: 38
|
14090
14229
|
});
|
14091
|
-
var NativeSelect =
|
14230
|
+
var NativeSelect = React95.forwardRef(
|
14092
14231
|
(_a, ref) => {
|
14093
14232
|
var _b = _a, { readOnly } = _b, props = __objRest(_b, ["readOnly"]);
|
14094
14233
|
var _a2;
|
@@ -14098,13 +14237,13 @@ var NativeSelect = React94.forwardRef(
|
|
14098
14237
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
14099
14238
|
const _b2 = getLabelControlProps(props), { "data-testid": dataTestId } = _b2, labelControlProps = __objRest(_b2, ["data-testid"]);
|
14100
14239
|
const baseProps = omit14(props, Object.keys(labelControlProps));
|
14101
|
-
return /* @__PURE__ */
|
14240
|
+
return /* @__PURE__ */ React95.createElement(LabelControl, __spreadProps(__spreadValues({
|
14102
14241
|
id: `${id}-label`,
|
14103
14242
|
htmlFor: id,
|
14104
14243
|
messageId: errorMessageId
|
14105
14244
|
}, labelControlProps), {
|
14106
14245
|
className: "Aquarium-NativeSelect"
|
14107
|
-
}), /* @__PURE__ */
|
14246
|
+
}), /* @__PURE__ */ React95.createElement(NativeSelectBase, __spreadProps(__spreadValues(__spreadValues({
|
14108
14247
|
ref
|
14109
14248
|
}, baseProps), errorProps), {
|
14110
14249
|
id,
|
@@ -14118,63 +14257,63 @@ var NativeSelect = React94.forwardRef(
|
|
14118
14257
|
}
|
14119
14258
|
);
|
14120
14259
|
NativeSelect.displayName = "NativeSelect";
|
14121
|
-
var Option =
|
14260
|
+
var Option = React95.forwardRef((_a, ref) => {
|
14122
14261
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
14123
|
-
return /* @__PURE__ */
|
14262
|
+
return /* @__PURE__ */ React95.createElement("option", __spreadValues({
|
14124
14263
|
ref
|
14125
14264
|
}, props), children);
|
14126
14265
|
});
|
14127
14266
|
Option.displayName = "Option";
|
14128
|
-
var NativeSelectSkeleton = () => /* @__PURE__ */
|
14267
|
+
var NativeSelectSkeleton = () => /* @__PURE__ */ React95.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React95.createElement(NativeSelectBase.Skeleton, null), /* @__PURE__ */ React95.createElement("div", {
|
14129
14268
|
style: { height: "1px" }
|
14130
14269
|
}));
|
14131
14270
|
NativeSelect.Skeleton = NativeSelectSkeleton;
|
14132
14271
|
NativeSelect.Skeleton.displayName = "NativeSelect.Skeleton";
|
14133
14272
|
|
14134
14273
|
// src/molecules/Navigation/Navigation.tsx
|
14135
|
-
import
|
14136
|
-
import
|
14274
|
+
import React97 from "react";
|
14275
|
+
import classNames11 from "classnames";
|
14137
14276
|
|
14138
14277
|
// src/atoms/Navigation/Navigation.tsx
|
14139
|
-
import
|
14278
|
+
import React96 from "react";
|
14140
14279
|
var Navigation = (_a) => {
|
14141
14280
|
var _b = _a, { className, children } = _b, rest = __objRest(_b, ["className", "children"]);
|
14142
|
-
return /* @__PURE__ */
|
14281
|
+
return /* @__PURE__ */ React96.createElement("nav", {
|
14143
14282
|
className: classNames(tw("bg-muted h-full"))
|
14144
|
-
}, /* @__PURE__ */
|
14283
|
+
}, /* @__PURE__ */ React96.createElement("ul", __spreadProps(__spreadValues({}, rest), {
|
14145
14284
|
className: classNames(tw("flex flex-col h-full"), className),
|
14146
14285
|
role: "menubar"
|
14147
14286
|
}), children));
|
14148
14287
|
};
|
14149
14288
|
var Header = (_a) => {
|
14150
14289
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
14151
|
-
return /* @__PURE__ */
|
14290
|
+
return /* @__PURE__ */ React96.createElement("li", __spreadProps(__spreadValues({}, rest), {
|
14152
14291
|
role: "presentation",
|
14153
14292
|
className: classNames(tw("px-6 py-5"), className)
|
14154
14293
|
}));
|
14155
14294
|
};
|
14156
14295
|
var Footer = (_a) => {
|
14157
14296
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
14158
|
-
return /* @__PURE__ */
|
14297
|
+
return /* @__PURE__ */ React96.createElement("li", __spreadProps(__spreadValues({}, rest), {
|
14159
14298
|
role: "presentation",
|
14160
14299
|
className: classNames(tw("px-6 py-5 mt-auto"), className)
|
14161
14300
|
}));
|
14162
14301
|
};
|
14163
14302
|
var Section2 = (_a) => {
|
14164
14303
|
var _b = _a, { title, className } = _b, rest = __objRest(_b, ["title", "className"]);
|
14165
|
-
return /* @__PURE__ */
|
14304
|
+
return /* @__PURE__ */ React96.createElement("li", {
|
14166
14305
|
role: "presentation",
|
14167
14306
|
className: tw("py-5")
|
14168
|
-
}, title && /* @__PURE__ */
|
14307
|
+
}, title && /* @__PURE__ */ React96.createElement("div", {
|
14169
14308
|
className: classNames(className, "py-2 px-6 text-inactive uppercase cursor-default typography-caption")
|
14170
|
-
}, title), /* @__PURE__ */
|
14309
|
+
}, title), /* @__PURE__ */ React96.createElement("ul", __spreadProps(__spreadValues({}, rest), {
|
14171
14310
|
role: "group",
|
14172
14311
|
className: classNames(tw("flex flex-col"), className)
|
14173
14312
|
})));
|
14174
14313
|
};
|
14175
14314
|
var Divider3 = (_a) => {
|
14176
14315
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
14177
|
-
return /* @__PURE__ */
|
14316
|
+
return /* @__PURE__ */ React96.createElement("li", __spreadProps(__spreadValues({
|
14178
14317
|
role: "separator"
|
14179
14318
|
}, rest), {
|
14180
14319
|
className: classNames(tw("border-t-2 border-muted"), className)
|
@@ -14182,13 +14321,13 @@ var Divider3 = (_a) => {
|
|
14182
14321
|
};
|
14183
14322
|
var Item5 = (_a) => {
|
14184
14323
|
var _b = _a, { className, active } = _b, rest = __objRest(_b, ["className", "active"]);
|
14185
|
-
return /* @__PURE__ */
|
14324
|
+
return /* @__PURE__ */ React96.createElement("li", {
|
14186
14325
|
role: "presentation"
|
14187
|
-
}, /* @__PURE__ */
|
14326
|
+
}, /* @__PURE__ */ React96.createElement("a", __spreadProps(__spreadValues({}, rest), {
|
14188
14327
|
role: "menuitem",
|
14189
14328
|
className: classNames(
|
14190
14329
|
tw("py-3 px-6 hover:bg-default cursor-pointer flex gap-4 items-center typography-small focusable", {
|
14191
|
-
"text-
|
14330
|
+
"text-default": !active,
|
14192
14331
|
"text-primary-intense": !!active
|
14193
14332
|
}),
|
14194
14333
|
className
|
@@ -14204,8 +14343,8 @@ Navigation.Divider = Divider3;
|
|
14204
14343
|
// src/molecules/Navigation/Navigation.tsx
|
14205
14344
|
var Navigation2 = (_a) => {
|
14206
14345
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
14207
|
-
return /* @__PURE__ */
|
14208
|
-
className:
|
14346
|
+
return /* @__PURE__ */ React97.createElement(Navigation, __spreadValues({
|
14347
|
+
className: classNames11("Aquarium-Navigation", className)
|
14209
14348
|
}, props));
|
14210
14349
|
};
|
14211
14350
|
var Item6 = (_a) => {
|
@@ -14218,11 +14357,11 @@ var Item6 = (_a) => {
|
|
14218
14357
|
"icon",
|
14219
14358
|
"showNotification"
|
14220
14359
|
]);
|
14221
|
-
return /* @__PURE__ */
|
14360
|
+
return /* @__PURE__ */ React97.createElement(Navigation.Item, __spreadValues({}, rest), icon && showNotification && /* @__PURE__ */ React97.createElement(Badge.Notification, null, /* @__PURE__ */ React97.createElement(InlineIcon, {
|
14222
14361
|
icon,
|
14223
14362
|
width: "20px",
|
14224
14363
|
height: "20px"
|
14225
|
-
})), icon && !showNotification && /* @__PURE__ */
|
14364
|
+
})), icon && !showNotification && /* @__PURE__ */ React97.createElement(InlineIcon, {
|
14226
14365
|
icon,
|
14227
14366
|
width: "20px",
|
14228
14367
|
height: "20px"
|
@@ -14235,52 +14374,52 @@ Navigation2.Header = Navigation.Header;
|
|
14235
14374
|
Navigation2.Section = Navigation.Section;
|
14236
14375
|
|
14237
14376
|
// src/molecules/PageHeader/PageHeader.tsx
|
14238
|
-
import
|
14377
|
+
import React99 from "react";
|
14239
14378
|
import castArray6 from "lodash/castArray";
|
14240
14379
|
|
14241
14380
|
// src/atoms/PageHeader/PageHeader.tsx
|
14242
|
-
import
|
14381
|
+
import React98 from "react";
|
14243
14382
|
var PageHeader = (_a) => {
|
14244
14383
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
14245
|
-
return /* @__PURE__ */
|
14384
|
+
return /* @__PURE__ */ React98.createElement("div", __spreadValues({
|
14246
14385
|
className: classNames(tw("flex flex-row gap-4 pb-6"), className)
|
14247
14386
|
}, rest), children);
|
14248
14387
|
};
|
14249
14388
|
PageHeader.Container = (_a) => {
|
14250
14389
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
14251
|
-
return /* @__PURE__ */
|
14390
|
+
return /* @__PURE__ */ React98.createElement("div", __spreadValues({
|
14252
14391
|
className: classNames(tw("flex flex-col grow gap-0"), className)
|
14253
14392
|
}, rest), children);
|
14254
14393
|
};
|
14255
14394
|
PageHeader.TitleContainer = (_a) => {
|
14256
14395
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
14257
|
-
return /* @__PURE__ */
|
14396
|
+
return /* @__PURE__ */ React98.createElement("div", __spreadValues({
|
14258
14397
|
className: classNames(tw("flex flex-col justify-center gap-2"), className)
|
14259
14398
|
}, rest), children);
|
14260
14399
|
};
|
14261
14400
|
PageHeader.Title = (_a) => {
|
14262
14401
|
var _b = _a, { isSubHeader = false, children } = _b, rest = __objRest(_b, ["isSubHeader", "children"]);
|
14263
|
-
return /* @__PURE__ */
|
14264
|
-
color: "
|
14402
|
+
return /* @__PURE__ */ React98.createElement(Typography2, __spreadProps(__spreadValues({}, rest), {
|
14403
|
+
color: "intense",
|
14265
14404
|
variant: isSubHeader ? "subheading" : "heading",
|
14266
14405
|
htmlTag: isSubHeader ? "h2" : "h1"
|
14267
14406
|
}), children);
|
14268
14407
|
};
|
14269
14408
|
PageHeader.Subtitle = (_a) => {
|
14270
14409
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
14271
|
-
return /* @__PURE__ */
|
14272
|
-
color: "
|
14410
|
+
return /* @__PURE__ */ React98.createElement(Typography2.Small, __spreadProps(__spreadValues({}, rest), {
|
14411
|
+
color: "default"
|
14273
14412
|
}), children);
|
14274
14413
|
};
|
14275
14414
|
PageHeader.Chips = (_a) => {
|
14276
14415
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
14277
|
-
return /* @__PURE__ */
|
14416
|
+
return /* @__PURE__ */ React98.createElement("div", __spreadValues({
|
14278
14417
|
className: classNames(tw("flex gap-3"), className)
|
14279
14418
|
}, rest), children);
|
14280
14419
|
};
|
14281
14420
|
PageHeader.Actions = (_a) => {
|
14282
14421
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
14283
|
-
return /* @__PURE__ */
|
14422
|
+
return /* @__PURE__ */ React98.createElement("div", __spreadValues({
|
14284
14423
|
className: classNames(tw("flex flex-row gap-4 self-start"), className)
|
14285
14424
|
}, rest), children);
|
14286
14425
|
};
|
@@ -14304,64 +14443,64 @@ var CommonPageHeader = ({
|
|
14304
14443
|
onMenuOpenChange,
|
14305
14444
|
isSubHeader = false
|
14306
14445
|
}) => {
|
14307
|
-
return /* @__PURE__ */
|
14446
|
+
return /* @__PURE__ */ React99.createElement(PageHeader, {
|
14308
14447
|
className: "Aquarium-PageHeader"
|
14309
|
-
}, /* @__PURE__ */
|
14448
|
+
}, /* @__PURE__ */ React99.createElement(PageHeader.Container, null, breadcrumbs && /* @__PURE__ */ React99.createElement(Box, {
|
14310
14449
|
marginBottom: "3"
|
14311
|
-
}, /* @__PURE__ */
|
14450
|
+
}, /* @__PURE__ */ React99.createElement(Breadcrumbs, null, breadcrumbs)), /* @__PURE__ */ React99.createElement(Spacing, {
|
14312
14451
|
row: true,
|
14313
14452
|
gap: "5"
|
14314
|
-
}, image && /* @__PURE__ */
|
14453
|
+
}, image && /* @__PURE__ */ React99.createElement("img", {
|
14315
14454
|
src: image,
|
14316
14455
|
alt: imageAlt != null ? imageAlt : "",
|
14317
14456
|
className: tw("w-[56px] h-[56px]")
|
14318
|
-
}), /* @__PURE__ */
|
14457
|
+
}), /* @__PURE__ */ React99.createElement(PageHeader.TitleContainer, null, /* @__PURE__ */ React99.createElement(PageHeader.Title, {
|
14319
14458
|
isSubHeader
|
14320
|
-
}, title), chips.length > 0 && /* @__PURE__ */
|
14459
|
+
}, title), chips.length > 0 && /* @__PURE__ */ React99.createElement(PageHeader.Chips, null, chips.map((chip) => /* @__PURE__ */ React99.createElement(Chip2, {
|
14321
14460
|
key: chip,
|
14322
14461
|
dense: true,
|
14323
14462
|
text: chip
|
14324
|
-
}))), subtitle && /* @__PURE__ */
|
14463
|
+
}))), subtitle && /* @__PURE__ */ React99.createElement(PageHeader.Subtitle, null, subtitle)))), (secondaryActions || primaryAction || secondaryAction || menu) && /* @__PURE__ */ React99.createElement(PageHeader.Actions, null, menu && /* @__PURE__ */ React99.createElement(Box.Flex, {
|
14325
14464
|
alignItems: "center"
|
14326
|
-
}, /* @__PURE__ */
|
14465
|
+
}, /* @__PURE__ */ React99.createElement(DropdownMenu2, {
|
14327
14466
|
placement: defaultContextualMenuPlacement,
|
14328
14467
|
onAction: (action) => onAction == null ? void 0 : onAction(action),
|
14329
14468
|
onOpenChange: onMenuOpenChange
|
14330
|
-
}, /* @__PURE__ */
|
14469
|
+
}, /* @__PURE__ */ React99.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ React99.createElement(Button.Icon, {
|
14331
14470
|
"aria-label": menuAriaLabel,
|
14332
14471
|
icon: import_more5.default
|
14333
14472
|
})), menu)), secondaryActions && castArray6(secondaryActions).filter(Boolean).map((secondaryAction2) => renderAction({ kind: "secondary", action: secondaryAction2 })), primaryAction && renderAction({ kind: "primary", action: primaryAction })));
|
14334
14473
|
};
|
14335
|
-
var PageHeader2 = (props) => /* @__PURE__ */
|
14474
|
+
var PageHeader2 = (props) => /* @__PURE__ */ React99.createElement(CommonPageHeader, __spreadValues({}, props));
|
14336
14475
|
PageHeader2.displayName = "PageHeader";
|
14337
|
-
var SubHeader = (props) => /* @__PURE__ */
|
14476
|
+
var SubHeader = (props) => /* @__PURE__ */ React99.createElement(CommonPageHeader, __spreadProps(__spreadValues({}, props), {
|
14338
14477
|
isSubHeader: true
|
14339
14478
|
}));
|
14340
14479
|
PageHeader2.SubHeader = SubHeader;
|
14341
14480
|
PageHeader2.SubHeader.displayName = "PageHeader.SubHeader";
|
14342
14481
|
|
14343
14482
|
// src/molecules/PopoverDialog/PopoverDialog.tsx
|
14344
|
-
import
|
14483
|
+
import React101 from "react";
|
14345
14484
|
import omit15 from "lodash/omit";
|
14346
14485
|
|
14347
14486
|
// src/atoms/PopoverDialog/PopoverDialog.tsx
|
14348
|
-
import
|
14487
|
+
import React100 from "react";
|
14349
14488
|
var Header2 = (_a) => {
|
14350
14489
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
14351
|
-
return /* @__PURE__ */
|
14490
|
+
return /* @__PURE__ */ React100.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
14352
14491
|
className: classNames(tw("p-5 gap-3 flex items-center"), className)
|
14353
14492
|
}), children);
|
14354
14493
|
};
|
14355
14494
|
var Title2 = (_a) => {
|
14356
14495
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
14357
|
-
return /* @__PURE__ */
|
14496
|
+
return /* @__PURE__ */ React100.createElement(Typography, __spreadProps(__spreadValues({}, rest), {
|
14358
14497
|
htmlTag: "h1",
|
14359
14498
|
variant: "small-strong"
|
14360
14499
|
}), children);
|
14361
14500
|
};
|
14362
14501
|
var Body = (_a) => {
|
14363
14502
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
14364
|
-
return /* @__PURE__ */
|
14503
|
+
return /* @__PURE__ */ React100.createElement(Typography, __spreadProps(__spreadValues({}, rest), {
|
14365
14504
|
htmlTag: "div",
|
14366
14505
|
variant: "caption",
|
14367
14506
|
className: classNames(tw("px-5 overflow-y-auto"), className)
|
@@ -14369,13 +14508,13 @@ var Body = (_a) => {
|
|
14369
14508
|
};
|
14370
14509
|
var Footer2 = (_a) => {
|
14371
14510
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
14372
|
-
return /* @__PURE__ */
|
14511
|
+
return /* @__PURE__ */ React100.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
14373
14512
|
className: classNames(tw("p-5"), className)
|
14374
14513
|
}), children);
|
14375
14514
|
};
|
14376
14515
|
var Actions2 = (_a) => {
|
14377
14516
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
14378
|
-
return /* @__PURE__ */
|
14517
|
+
return /* @__PURE__ */ React100.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
14379
14518
|
className: classNames(tw("flex gap-4"), className)
|
14380
14519
|
}), children);
|
14381
14520
|
};
|
@@ -14391,13 +14530,13 @@ var PopoverDialog = {
|
|
14391
14530
|
var PopoverDialog2 = ({ placement, open, title, secondaryAction, primaryAction, children }) => {
|
14392
14531
|
const wrapPromptWithBody = (child) => {
|
14393
14532
|
if (isComponentType(child, PopoverDialog2.Prompt)) {
|
14394
|
-
return /* @__PURE__ */
|
14533
|
+
return /* @__PURE__ */ React101.createElement(Popover2.Panel, {
|
14395
14534
|
className: classNames("Aquarium-PopoverDialog", tw("max-w-[300px]"))
|
14396
|
-
}, /* @__PURE__ */
|
14535
|
+
}, /* @__PURE__ */ React101.createElement(PopoverDialog.Header, null, /* @__PURE__ */ React101.createElement(PopoverDialog.Title, null, title)), child, /* @__PURE__ */ React101.createElement(PopoverDialog.Footer, null, /* @__PURE__ */ React101.createElement(PopoverDialog.Actions, null, secondaryAction && /* @__PURE__ */ React101.createElement(Popover2.Button, __spreadValues({
|
14397
14536
|
kind: "secondary-ghost",
|
14398
14537
|
key: secondaryAction.text,
|
14399
14538
|
dense: true
|
14400
|
-
}, omit15(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */
|
14539
|
+
}, omit15(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */ React101.createElement(Popover2.Button, __spreadValues({
|
14401
14540
|
kind: "ghost",
|
14402
14541
|
key: primaryAction.text,
|
14403
14542
|
dense: true
|
@@ -14405,15 +14544,15 @@ var PopoverDialog2 = ({ placement, open, title, secondaryAction, primaryAction,
|
|
14405
14544
|
}
|
14406
14545
|
return child;
|
14407
14546
|
};
|
14408
|
-
return /* @__PURE__ */
|
14547
|
+
return /* @__PURE__ */ React101.createElement(Popover2, {
|
14409
14548
|
type: "dialog",
|
14410
14549
|
isOpen: open,
|
14411
14550
|
placement,
|
14412
14551
|
containFocus: true
|
14413
|
-
},
|
14552
|
+
}, React101.Children.map(children, wrapPromptWithBody));
|
14414
14553
|
};
|
14415
14554
|
PopoverDialog2.Trigger = Popover2.Trigger;
|
14416
|
-
var Prompt = ({ children }) => /* @__PURE__ */
|
14555
|
+
var Prompt = ({ children }) => /* @__PURE__ */ React101.createElement(PopoverDialog.Body, null, children);
|
14417
14556
|
Prompt.displayName = "PopoverDialog.Prompt";
|
14418
14557
|
PopoverDialog2.Prompt = Prompt;
|
14419
14558
|
|
@@ -14422,14 +14561,14 @@ import { createPortal } from "react-dom";
|
|
14422
14561
|
var Portal = ({ children, to }) => createPortal(children, to);
|
14423
14562
|
|
14424
14563
|
// src/molecules/ProgressBar/ProgressBar.tsx
|
14425
|
-
import
|
14564
|
+
import React103 from "react";
|
14426
14565
|
|
14427
14566
|
// src/atoms/ProgressBar/ProgressBar.tsx
|
14428
|
-
import
|
14567
|
+
import React102 from "react";
|
14429
14568
|
import clamp3 from "lodash/clamp";
|
14430
14569
|
var ProgressBar = (_a) => {
|
14431
14570
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
14432
|
-
return /* @__PURE__ */
|
14571
|
+
return /* @__PURE__ */ React102.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
14433
14572
|
className: classNames(tw("relative flex items-center w-full bg-muted h-2 rounded-full overflow-hidden"), className)
|
14434
14573
|
}), children);
|
14435
14574
|
};
|
@@ -14442,7 +14581,7 @@ var STATUS_COLORS = {
|
|
14442
14581
|
ProgressBar.Indicator = (_a) => {
|
14443
14582
|
var _b = _a, { min, max, value, "aria-label": ariaLabel, status, className } = _b, rest = __objRest(_b, ["min", "max", "value", "aria-label", "status", "className"]);
|
14444
14583
|
const completedPercentage = clamp3((value - min) / (max - min) * 100, 0, 100);
|
14445
|
-
return /* @__PURE__ */
|
14584
|
+
return /* @__PURE__ */ React102.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
14446
14585
|
className: classNames(
|
14447
14586
|
tw("h-2 rounded-full transition-all ease-in-out delay-150"),
|
14448
14587
|
STATUS_COLORS[status],
|
@@ -14458,11 +14597,11 @@ ProgressBar.Indicator = (_a) => {
|
|
14458
14597
|
};
|
14459
14598
|
ProgressBar.Labels = (_a) => {
|
14460
14599
|
var _b = _a, { children, startLabel, endLabel, className } = _b, rest = __objRest(_b, ["children", "startLabel", "endLabel", "className"]);
|
14461
|
-
return /* @__PURE__ */
|
14600
|
+
return /* @__PURE__ */ React102.createElement("div", {
|
14462
14601
|
className: classNames(tw("flex flex-row"), className)
|
14463
|
-
}, /* @__PURE__ */
|
14602
|
+
}, /* @__PURE__ */ React102.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
14464
14603
|
className: tw("grow text-default typography-caption")
|
14465
|
-
}), startLabel), /* @__PURE__ */
|
14604
|
+
}), startLabel), /* @__PURE__ */ React102.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
14466
14605
|
className: tw("grow text-default typography-caption text-right")
|
14467
14606
|
}), endLabel));
|
14468
14607
|
};
|
@@ -14480,7 +14619,7 @@ var ProgressBar2 = (props) => {
|
|
14480
14619
|
if (min > max) {
|
14481
14620
|
throw new Error("`min` value provided to `ProgressBar` is greater than `max` value.");
|
14482
14621
|
}
|
14483
|
-
const progress = /* @__PURE__ */
|
14622
|
+
const progress = /* @__PURE__ */ React103.createElement(ProgressBar, null, /* @__PURE__ */ React103.createElement(ProgressBar.Indicator, {
|
14484
14623
|
status: value === max ? completedStatus : progresStatus,
|
14485
14624
|
min,
|
14486
14625
|
max,
|
@@ -14490,15 +14629,15 @@ var ProgressBar2 = (props) => {
|
|
14490
14629
|
if (props.dense) {
|
14491
14630
|
return progress;
|
14492
14631
|
}
|
14493
|
-
return /* @__PURE__ */
|
14632
|
+
return /* @__PURE__ */ React103.createElement("div", {
|
14494
14633
|
className: "Aquarium-ProgressBar"
|
14495
|
-
}, progress, /* @__PURE__ */
|
14634
|
+
}, progress, /* @__PURE__ */ React103.createElement(ProgressBar.Labels, {
|
14496
14635
|
className: tw("py-2"),
|
14497
14636
|
startLabel: props.startLabel,
|
14498
14637
|
endLabel: props.endLabel
|
14499
14638
|
}));
|
14500
14639
|
};
|
14501
|
-
var ProgressBarSkeleton = () => /* @__PURE__ */
|
14640
|
+
var ProgressBarSkeleton = () => /* @__PURE__ */ React103.createElement(Skeleton, {
|
14502
14641
|
height: 4,
|
14503
14642
|
display: "block"
|
14504
14643
|
});
|
@@ -14506,13 +14645,13 @@ ProgressBar2.Skeleton = ProgressBarSkeleton;
|
|
14506
14645
|
ProgressBar2.Skeleton.displayName = "ProgressBar.Skeleton";
|
14507
14646
|
|
14508
14647
|
// src/molecules/RadioButton/RadioButton.tsx
|
14509
|
-
import
|
14510
|
-
var RadioButton2 =
|
14648
|
+
import React104 from "react";
|
14649
|
+
var RadioButton2 = React104.forwardRef(
|
14511
14650
|
(_a, ref) => {
|
14512
14651
|
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"]);
|
14513
14652
|
var _a2;
|
14514
14653
|
const isChecked = (_a2 = props.checked) != null ? _a2 : props.defaultChecked;
|
14515
|
-
return !readOnly || isChecked ? /* @__PURE__ */
|
14654
|
+
return !readOnly || isChecked ? /* @__PURE__ */ React104.createElement(ControlLabel, {
|
14516
14655
|
htmlFor: id,
|
14517
14656
|
label: children,
|
14518
14657
|
"aria-label": ariaLabel,
|
@@ -14521,7 +14660,7 @@ var RadioButton2 = React103.forwardRef(
|
|
14521
14660
|
disabled,
|
14522
14661
|
style: { gap: "0 8px" },
|
14523
14662
|
className: "Aquarium-RadioButton"
|
14524
|
-
}, !readOnly && /* @__PURE__ */
|
14663
|
+
}, !readOnly && /* @__PURE__ */ React104.createElement(RadioButton, __spreadProps(__spreadValues({
|
14525
14664
|
id,
|
14526
14665
|
ref,
|
14527
14666
|
name
|
@@ -14532,12 +14671,12 @@ var RadioButton2 = React103.forwardRef(
|
|
14532
14671
|
}
|
14533
14672
|
);
|
14534
14673
|
RadioButton2.displayName = "RadioButton";
|
14535
|
-
var RadioButtonSkeleton = () => /* @__PURE__ */
|
14674
|
+
var RadioButtonSkeleton = () => /* @__PURE__ */ React104.createElement("div", {
|
14536
14675
|
className: tw("flex gap-3")
|
14537
|
-
}, /* @__PURE__ */
|
14676
|
+
}, /* @__PURE__ */ React104.createElement(Skeleton, {
|
14538
14677
|
height: 20,
|
14539
14678
|
width: 20
|
14540
|
-
}), /* @__PURE__ */
|
14679
|
+
}), /* @__PURE__ */ React104.createElement(Skeleton, {
|
14541
14680
|
height: 20,
|
14542
14681
|
width: 150
|
14543
14682
|
}));
|
@@ -14545,10 +14684,10 @@ RadioButton2.Skeleton = RadioButtonSkeleton;
|
|
14545
14684
|
RadioButton2.Skeleton.displayName = "RadioButton.Skeleton";
|
14546
14685
|
|
14547
14686
|
// src/molecules/RadioButtonGroup/RadioButtonGroup.tsx
|
14548
|
-
import
|
14687
|
+
import React105 from "react";
|
14549
14688
|
import { useId as useId15 } from "@react-aria/utils";
|
14550
14689
|
var isRadioButton = (c) => {
|
14551
|
-
return
|
14690
|
+
return React105.isValidElement(c) && c.type === RadioButton2;
|
14552
14691
|
};
|
14553
14692
|
var RadioButtonGroup = (_a) => {
|
14554
14693
|
var _b = _a, {
|
@@ -14571,7 +14710,7 @@ var RadioButtonGroup = (_a) => {
|
|
14571
14710
|
"children"
|
14572
14711
|
]);
|
14573
14712
|
var _a2;
|
14574
|
-
const [value, setValue] =
|
14713
|
+
const [value, setValue] = React105.useState((_a2 = _value != null ? _value : defaultValue) != null ? _a2 : "");
|
14575
14714
|
const errorMessageId = useId15();
|
14576
14715
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
14577
14716
|
const labelControlProps = getLabelControlProps(props);
|
@@ -14582,14 +14721,14 @@ var RadioButtonGroup = (_a) => {
|
|
14582
14721
|
setValue(e.target.value);
|
14583
14722
|
onChange == null ? void 0 : onChange(e.target.value);
|
14584
14723
|
};
|
14585
|
-
const content =
|
14724
|
+
const content = React105.Children.map(children, (c) => {
|
14586
14725
|
var _a3, _b2, _c;
|
14587
14726
|
if (!isRadioButton(c)) {
|
14588
14727
|
return null;
|
14589
14728
|
}
|
14590
14729
|
const defaultChecked = defaultValue === void 0 ? void 0 : c.props.value === defaultValue;
|
14591
14730
|
const checked = value === void 0 ? void 0 : c.props.value === value;
|
14592
|
-
return
|
14731
|
+
return React105.cloneElement(c, {
|
14593
14732
|
name,
|
14594
14733
|
defaultChecked: (_a3 = c.props.defaultChecked) != null ? _a3 : defaultChecked,
|
14595
14734
|
checked: (_b2 = c.props.checked) != null ? _b2 : checked,
|
@@ -14598,13 +14737,13 @@ var RadioButtonGroup = (_a) => {
|
|
14598
14737
|
readOnly
|
14599
14738
|
});
|
14600
14739
|
});
|
14601
|
-
return /* @__PURE__ */
|
14740
|
+
return /* @__PURE__ */ React105.createElement(LabelControl, __spreadProps(__spreadValues(__spreadValues({
|
14602
14741
|
fieldset: true
|
14603
14742
|
}, labelControlProps), errorProps), {
|
14604
14743
|
className: "Aquarium-RadioButtonGroup"
|
14605
|
-
}), cols && /* @__PURE__ */
|
14744
|
+
}), cols && /* @__PURE__ */ React105.createElement(InputGroup, {
|
14606
14745
|
cols
|
14607
|
-
}, content), !cols && /* @__PURE__ */
|
14746
|
+
}, content), !cols && /* @__PURE__ */ React105.createElement(Flexbox, {
|
14608
14747
|
direction,
|
14609
14748
|
alignItems: "flex-start",
|
14610
14749
|
colGap: "8",
|
@@ -14613,12 +14752,12 @@ var RadioButtonGroup = (_a) => {
|
|
14613
14752
|
}, content));
|
14614
14753
|
};
|
14615
14754
|
var RadioButtonGroupSkeleton = ({ direction = "row", options = 2 }) => {
|
14616
|
-
return /* @__PURE__ */
|
14755
|
+
return /* @__PURE__ */ React105.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React105.createElement("div", {
|
14617
14756
|
className: tw("flex flex-wrap", {
|
14618
14757
|
"flex-row gap-8": direction === "row",
|
14619
14758
|
"flex-col gap-2": direction === "column"
|
14620
14759
|
})
|
14621
|
-
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */
|
14760
|
+
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */ React105.createElement(RadioButton2.Skeleton, {
|
14622
14761
|
key
|
14623
14762
|
}))));
|
14624
14763
|
};
|
@@ -14626,24 +14765,24 @@ RadioButtonGroup.Skeleton = RadioButtonGroupSkeleton;
|
|
14626
14765
|
RadioButtonGroup.Skeleton.displayName = "RadioButtonGroup.Skeleton";
|
14627
14766
|
|
14628
14767
|
// src/molecules/Section/Section.tsx
|
14629
|
-
import
|
14768
|
+
import React110 from "react";
|
14630
14769
|
import { useId as useId16 } from "@react-aria/utils";
|
14631
|
-
import { animated as
|
14770
|
+
import { animated as animated6, useSpring as useSpring5 } from "@react-spring/web";
|
14632
14771
|
import castArray7 from "lodash/castArray";
|
14633
14772
|
import isUndefined9 from "lodash/isUndefined";
|
14634
14773
|
|
14635
14774
|
// src/molecules/Switch/Switch.tsx
|
14636
|
-
import
|
14775
|
+
import React107 from "react";
|
14637
14776
|
|
14638
14777
|
// src/atoms/Switch/Switch.tsx
|
14639
|
-
import
|
14778
|
+
import React106 from "react";
|
14640
14779
|
var import_ban2 = __toESM(require_ban());
|
14641
|
-
var Switch =
|
14780
|
+
var Switch = React106.forwardRef(
|
14642
14781
|
(_a, ref) => {
|
14643
14782
|
var _b = _a, { id, children, name, disabled = false, readOnly = false } = _b, props = __objRest(_b, ["id", "children", "name", "disabled", "readOnly"]);
|
14644
|
-
return /* @__PURE__ */
|
14783
|
+
return /* @__PURE__ */ React106.createElement("span", {
|
14645
14784
|
className: tw("relative inline-flex justify-center items-center self-center group")
|
14646
|
-
}, /* @__PURE__ */
|
14785
|
+
}, /* @__PURE__ */ React106.createElement("input", __spreadProps(__spreadValues({
|
14647
14786
|
id,
|
14648
14787
|
ref,
|
14649
14788
|
type: "checkbox",
|
@@ -14662,7 +14801,7 @@ var Switch = React105.forwardRef(
|
|
14662
14801
|
),
|
14663
14802
|
readOnly,
|
14664
14803
|
disabled
|
14665
|
-
})), /* @__PURE__ */
|
14804
|
+
})), /* @__PURE__ */ React106.createElement("span", {
|
14666
14805
|
className: tw(
|
14667
14806
|
"pointer-events-none rounded-full absolute inline-flex justify-center items-center transition duration-300 h-4 w-4 transform peer-checked/switch:translate-x-5",
|
14668
14807
|
"bg-white left-2 peer-checked/switch:left-1 text-inactive peer-checked/switch:text-primary-muted",
|
@@ -14670,7 +14809,7 @@ var Switch = React105.forwardRef(
|
|
14670
14809
|
"shadow-4dp": !disabled
|
14671
14810
|
}
|
14672
14811
|
)
|
14673
|
-
}, disabled && /* @__PURE__ */
|
14812
|
+
}, disabled && /* @__PURE__ */ React106.createElement(Icon, {
|
14674
14813
|
icon: import_ban2.default,
|
14675
14814
|
width: "10px",
|
14676
14815
|
height: "10px"
|
@@ -14679,7 +14818,7 @@ var Switch = React105.forwardRef(
|
|
14679
14818
|
);
|
14680
14819
|
|
14681
14820
|
// src/molecules/Switch/Switch.tsx
|
14682
|
-
var Switch2 =
|
14821
|
+
var Switch2 = React107.forwardRef(
|
14683
14822
|
(_a, ref) => {
|
14684
14823
|
var _b = _a, {
|
14685
14824
|
id,
|
@@ -14702,7 +14841,7 @@ var Switch2 = React106.forwardRef(
|
|
14702
14841
|
]);
|
14703
14842
|
var _a2;
|
14704
14843
|
const isChecked = (_a2 = props.checked) != null ? _a2 : props.defaultChecked;
|
14705
|
-
return !readOnly || isChecked ? /* @__PURE__ */
|
14844
|
+
return !readOnly || isChecked ? /* @__PURE__ */ React107.createElement(ControlLabel, {
|
14706
14845
|
htmlFor: id,
|
14707
14846
|
label: children,
|
14708
14847
|
"aria-label": ariaLabel,
|
@@ -14712,7 +14851,7 @@ var Switch2 = React106.forwardRef(
|
|
14712
14851
|
style: { gap: "0 8px" },
|
14713
14852
|
labelPlacement,
|
14714
14853
|
className: "Aquarium-Switch"
|
14715
|
-
}, !readOnly && /* @__PURE__ */
|
14854
|
+
}, !readOnly && /* @__PURE__ */ React107.createElement(Switch, __spreadProps(__spreadValues({
|
14716
14855
|
id,
|
14717
14856
|
ref,
|
14718
14857
|
name
|
@@ -14723,12 +14862,12 @@ var Switch2 = React106.forwardRef(
|
|
14723
14862
|
}
|
14724
14863
|
);
|
14725
14864
|
Switch2.displayName = "Switch";
|
14726
|
-
var SwitchSkeleton = () => /* @__PURE__ */
|
14865
|
+
var SwitchSkeleton = () => /* @__PURE__ */ React107.createElement("div", {
|
14727
14866
|
className: tw("flex gap-3")
|
14728
|
-
}, /* @__PURE__ */
|
14867
|
+
}, /* @__PURE__ */ React107.createElement(Skeleton, {
|
14729
14868
|
height: 20,
|
14730
14869
|
width: 35
|
14731
|
-
}), /* @__PURE__ */
|
14870
|
+
}), /* @__PURE__ */ React107.createElement(Skeleton, {
|
14732
14871
|
height: 20,
|
14733
14872
|
width: 150
|
14734
14873
|
}));
|
@@ -14736,7 +14875,7 @@ Switch2.Skeleton = SwitchSkeleton;
|
|
14736
14875
|
Switch2.Skeleton.displayName = "Switch.Skeleton ";
|
14737
14876
|
|
14738
14877
|
// src/molecules/TagLabel/TagLabel.tsx
|
14739
|
-
import
|
14878
|
+
import React108 from "react";
|
14740
14879
|
var getVariantClassNames = (variant = "primary") => {
|
14741
14880
|
switch (variant) {
|
14742
14881
|
case "danger":
|
@@ -14750,7 +14889,7 @@ var getVariantClassNames = (variant = "primary") => {
|
|
14750
14889
|
};
|
14751
14890
|
var TagLabel = (_a) => {
|
14752
14891
|
var _b = _a, { title, dense = false, variant } = _b, rest = __objRest(_b, ["title", "dense", "variant"]);
|
14753
|
-
return /* @__PURE__ */
|
14892
|
+
return /* @__PURE__ */ React108.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
14754
14893
|
className: classNames(
|
14755
14894
|
"Aquarium-TagLabel",
|
14756
14895
|
getVariantClassNames(variant),
|
@@ -14763,11 +14902,11 @@ var TagLabel = (_a) => {
|
|
14763
14902
|
};
|
14764
14903
|
|
14765
14904
|
// src/atoms/Section/Section.tsx
|
14766
|
-
import
|
14905
|
+
import React109 from "react";
|
14767
14906
|
var import_caretUp2 = __toESM(require_caretUp());
|
14768
14907
|
var Section3 = (_a) => {
|
14769
14908
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
14770
|
-
return /* @__PURE__ */
|
14909
|
+
return /* @__PURE__ */ React109.createElement(Box, __spreadValues({
|
14771
14910
|
component: "section",
|
14772
14911
|
borderColor: "grey-5",
|
14773
14912
|
borderWidth: "1px"
|
@@ -14775,7 +14914,7 @@ var Section3 = (_a) => {
|
|
14775
14914
|
};
|
14776
14915
|
Section3.Header = (_a) => {
|
14777
14916
|
var _b = _a, { children, className, expanded } = _b, rest = __objRest(_b, ["children", "className", "expanded"]);
|
14778
|
-
return /* @__PURE__ */
|
14917
|
+
return /* @__PURE__ */ React109.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
14779
14918
|
className: classNames(
|
14780
14919
|
tw("px-6 flex gap-5 justify-between items-center h-[72px]", { "bg-muted": expanded }),
|
14781
14920
|
className
|
@@ -14784,45 +14923,45 @@ Section3.Header = (_a) => {
|
|
14784
14923
|
};
|
14785
14924
|
Section3.TitleContainer = (_a) => {
|
14786
14925
|
var _b = _a, { children, className, collapsible } = _b, rest = __objRest(_b, ["children", "className", "collapsible"]);
|
14787
|
-
return /* @__PURE__ */
|
14926
|
+
return /* @__PURE__ */ React109.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
14788
14927
|
className: classNames(
|
14789
14928
|
tw("grow grid grid-cols-[auto_1fr] gap-x-3 items-center", { "cursor-pointer": collapsible }),
|
14790
14929
|
className
|
14791
14930
|
)
|
14792
14931
|
}), children);
|
14793
14932
|
};
|
14794
|
-
Section3.Toggle = (props) => /* @__PURE__ */
|
14933
|
+
Section3.Toggle = (props) => /* @__PURE__ */ React109.createElement(Icon, __spreadProps(__spreadValues({}, props), {
|
14795
14934
|
icon: import_caretUp2.default,
|
14796
14935
|
height: 22,
|
14797
14936
|
width: 22
|
14798
14937
|
}));
|
14799
14938
|
Section3.Title = (_a) => {
|
14800
14939
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
14801
|
-
return /* @__PURE__ */
|
14940
|
+
return /* @__PURE__ */ React109.createElement(Typography2.Large, __spreadProps(__spreadValues({}, rest), {
|
14802
14941
|
htmlTag: "h2",
|
14803
|
-
color: "
|
14942
|
+
color: "intense",
|
14804
14943
|
className: "flex gap-3 items-center"
|
14805
14944
|
}), children);
|
14806
14945
|
};
|
14807
14946
|
Section3.Subtitle = (_a) => {
|
14808
14947
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
14809
|
-
return /* @__PURE__ */
|
14810
|
-
color: "
|
14948
|
+
return /* @__PURE__ */ React109.createElement(Typography2.Small, __spreadProps(__spreadValues({}, rest), {
|
14949
|
+
color: "default"
|
14811
14950
|
}), children);
|
14812
14951
|
};
|
14813
14952
|
Section3.Actions = (_a) => {
|
14814
14953
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
14815
|
-
return /* @__PURE__ */
|
14954
|
+
return /* @__PURE__ */ React109.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
14816
14955
|
className: classNames(tw("flex gap-4 justify-end"), className)
|
14817
14956
|
}), children);
|
14818
14957
|
};
|
14819
14958
|
Section3.Body = (_a) => {
|
14820
14959
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
14821
|
-
return /* @__PURE__ */
|
14960
|
+
return /* @__PURE__ */ React109.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
14822
14961
|
className: classNames(tw("p-6"), className)
|
14823
|
-
}), /* @__PURE__ */
|
14962
|
+
}), /* @__PURE__ */ React109.createElement(Typography, {
|
14824
14963
|
htmlTag: "div",
|
14825
|
-
color: "
|
14964
|
+
color: "default"
|
14826
14965
|
}, children));
|
14827
14966
|
};
|
14828
14967
|
|
@@ -14834,7 +14973,7 @@ var Section4 = (props) => {
|
|
14834
14973
|
const _collapsible = title ? (_a = props.collapsible) != null ? _a : false : false;
|
14835
14974
|
const _collapsed = title ? props.collapsed : void 0;
|
14836
14975
|
const _defaultCollapsed = title ? (_b = props.defaultCollapsed) != null ? _b : false : false;
|
14837
|
-
const [isCollapsed, setCollapsed] =
|
14976
|
+
const [isCollapsed, setCollapsed] = React110.useState(_collapsed != null ? _collapsed : _defaultCollapsed);
|
14838
14977
|
const [ref, { height }] = useMeasure();
|
14839
14978
|
const menu = title ? (_c = props.menu) != null ? _c : void 0 : void 0;
|
14840
14979
|
const menuAriaLabel = title ? (_e = (_d = props.menuAriaLabel) != null ? _d : props.menuLabel) != null ? _e : "Context menu" : void 0;
|
@@ -14855,7 +14994,7 @@ var Section4 = (props) => {
|
|
14855
14994
|
}
|
14856
14995
|
};
|
14857
14996
|
const targetHeight = isCollapsed ? "0px" : `${height != null ? height : 0}px`;
|
14858
|
-
const _f =
|
14997
|
+
const _f = useSpring5({
|
14859
14998
|
height: height !== null ? targetHeight : void 0,
|
14860
14999
|
opacity: isCollapsed ? 0 : 1,
|
14861
15000
|
transform: `rotate(${isCollapsed ? 90 : 180}deg)`,
|
@@ -14869,61 +15008,61 @@ var Section4 = (props) => {
|
|
14869
15008
|
const regionId = useId16();
|
14870
15009
|
const titleId = useId16();
|
14871
15010
|
const hasTabs = isComponentType(children, Tabs);
|
14872
|
-
return /* @__PURE__ */
|
15011
|
+
return /* @__PURE__ */ React110.createElement(Section3, {
|
14873
15012
|
"aria-label": title,
|
14874
15013
|
className: "Aquarium-Section"
|
14875
|
-
}, title && /* @__PURE__ */
|
15014
|
+
}, title && /* @__PURE__ */ React110.createElement(React110.Fragment, null, /* @__PURE__ */ React110.createElement(Section3.Header, {
|
14876
15015
|
expanded: _collapsible && !isCollapsed
|
14877
|
-
}, /* @__PURE__ */
|
15016
|
+
}, /* @__PURE__ */ React110.createElement(Section3.TitleContainer, {
|
14878
15017
|
role: _collapsible ? "button" : void 0,
|
14879
15018
|
id: toggleId,
|
14880
15019
|
collapsible: _collapsible,
|
14881
15020
|
onClick: handleTitleClick,
|
14882
15021
|
"aria-expanded": _collapsible ? !isCollapsed : void 0,
|
14883
15022
|
"aria-controls": _collapsible ? regionId : void 0
|
14884
|
-
}, _collapsible && /* @__PURE__ */
|
15023
|
+
}, _collapsible && /* @__PURE__ */ React110.createElement(animated6.div, {
|
14885
15024
|
style: { transform }
|
14886
|
-
}, /* @__PURE__ */
|
15025
|
+
}, /* @__PURE__ */ React110.createElement(Section3.Toggle, null)), /* @__PURE__ */ React110.createElement(Section3.Title, {
|
14887
15026
|
id: titleId
|
14888
|
-
}, /* @__PURE__ */
|
15027
|
+
}, /* @__PURE__ */ React110.createElement(LineClamp2, {
|
14889
15028
|
lines: 1
|
14890
|
-
}, title), props.tag && /* @__PURE__ */
|
15029
|
+
}, title), props.tag && /* @__PURE__ */ React110.createElement(TagLabel, __spreadValues({}, props.tag)), props.badge && /* @__PURE__ */ React110.createElement(Chip2, {
|
14891
15030
|
text: props.badge
|
14892
|
-
}), props.chip && /* @__PURE__ */
|
15031
|
+
}), props.chip && /* @__PURE__ */ React110.createElement(StatusChip, __spreadValues({}, props.chip))), subtitle && /* @__PURE__ */ React110.createElement(Section3.Subtitle, {
|
14893
15032
|
className: tw("row-start-2", { "col-start-2": _collapsible })
|
14894
|
-
}, /* @__PURE__ */
|
15033
|
+
}, /* @__PURE__ */ React110.createElement(LineClamp2, {
|
14895
15034
|
lines: 1
|
14896
|
-
}, subtitle))), !isCollapsed && /* @__PURE__ */
|
15035
|
+
}, subtitle))), !isCollapsed && /* @__PURE__ */ React110.createElement(Section3.Actions, null, menu && /* @__PURE__ */ React110.createElement(Box.Flex, {
|
14897
15036
|
alignItems: "center"
|
14898
|
-
}, /* @__PURE__ */
|
15037
|
+
}, /* @__PURE__ */ React110.createElement(DropdownMenu2, {
|
14899
15038
|
onAction: (action) => onAction == null ? void 0 : onAction(action),
|
14900
15039
|
onOpenChange: onMenuOpenChange,
|
14901
15040
|
placement: defaultContextualMenuPlacement
|
14902
|
-
}, /* @__PURE__ */
|
15041
|
+
}, /* @__PURE__ */ React110.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ React110.createElement(Button.Icon, {
|
14903
15042
|
"aria-label": menuAriaLabel,
|
14904
15043
|
icon: import_more6.default
|
14905
|
-
})), menu)), props.actions && castArray7(props.actions).filter(Boolean).map((action) => renderAction({ kind: "secondary", action })), props.switch && /* @__PURE__ */
|
15044
|
+
})), menu)), props.actions && castArray7(props.actions).filter(Boolean).map((action) => renderAction({ kind: "secondary", action })), props.switch && /* @__PURE__ */ React110.createElement(Switch2, __spreadValues({}, props.switch)), props.select && /* @__PURE__ */ React110.createElement(SelectBase, __spreadValues({
|
14906
15045
|
"aria-labelledby": titleId
|
14907
|
-
}, props.select)))), !hasTabs && /* @__PURE__ */
|
15046
|
+
}, props.select)))), !hasTabs && /* @__PURE__ */ React110.createElement(animated6.div, {
|
14908
15047
|
className: tw(`h-[1px]`),
|
14909
15048
|
style: { backgroundColor }
|
14910
|
-
})), /* @__PURE__ */
|
15049
|
+
})), /* @__PURE__ */ React110.createElement(animated6.div, {
|
14911
15050
|
id: regionId,
|
14912
15051
|
"aria-hidden": _collapsible ? isCollapsed ? true : void 0 : void 0,
|
14913
15052
|
style: spring,
|
14914
15053
|
className: tw({ "overflow-hidden": _collapsible })
|
14915
|
-
}, /* @__PURE__ */
|
15054
|
+
}, /* @__PURE__ */ React110.createElement("div", {
|
14916
15055
|
ref
|
14917
|
-
}, hasTabs ? /* @__PURE__ */
|
15056
|
+
}, hasTabs ? /* @__PURE__ */ React110.createElement(SectionTabs, __spreadProps(__spreadValues({}, children.props), {
|
14918
15057
|
className: tw("[&>div:first-child]:px-3 grow flex flex-col overflow-y-auto", { "mt-4": _collapsible })
|
14919
|
-
})) : /* @__PURE__ */
|
15058
|
+
})) : /* @__PURE__ */ React110.createElement(Section3.Body, null, children))));
|
14920
15059
|
};
|
14921
|
-
var SectionTabs = createTabsComponent(ModalTab, TabItem, "SectionTabs", (children, selected) => /* @__PURE__ */
|
15060
|
+
var SectionTabs = createTabsComponent(ModalTab, TabItem, "SectionTabs", (children, selected) => /* @__PURE__ */ React110.createElement(Section3.Body, null, children.find(
|
14922
15061
|
(node, index) => (node == null ? void 0 : node.props.value) === selected || index === selected
|
14923
15062
|
)));
|
14924
15063
|
|
14925
15064
|
// src/molecules/SegmentedControl/SegmentedControl.tsx
|
14926
|
-
import
|
15065
|
+
import React111 from "react";
|
14927
15066
|
var SegmentedControl = (_a) => {
|
14928
15067
|
var _b = _a, {
|
14929
15068
|
children,
|
@@ -14940,7 +15079,7 @@ var SegmentedControl = (_a) => {
|
|
14940
15079
|
"selected",
|
14941
15080
|
"className"
|
14942
15081
|
]);
|
14943
|
-
return /* @__PURE__ */
|
15082
|
+
return /* @__PURE__ */ React111.createElement("li", null, /* @__PURE__ */ React111.createElement("button", __spreadProps(__spreadValues({
|
14944
15083
|
type: "button"
|
14945
15084
|
}, rest), {
|
14946
15085
|
className: classNames(
|
@@ -14974,12 +15113,12 @@ var SegmentedControlGroup = (_a) => {
|
|
14974
15113
|
"border border-default text-muted": variant === "outlined",
|
14975
15114
|
"bg-muted": variant === "raised"
|
14976
15115
|
});
|
14977
|
-
return /* @__PURE__ */
|
15116
|
+
return /* @__PURE__ */ React111.createElement("ul", __spreadProps(__spreadValues({}, rest), {
|
14978
15117
|
"aria-label": ariaLabel,
|
14979
15118
|
className: classNames("Aquarium-SegmentedControl", classes2, className)
|
14980
|
-
}),
|
15119
|
+
}), React111.Children.map(
|
14981
15120
|
children,
|
14982
|
-
(child) =>
|
15121
|
+
(child) => React111.cloneElement(child, {
|
14983
15122
|
dense,
|
14984
15123
|
variant,
|
14985
15124
|
onClick: () => onChange(child.props.value),
|
@@ -15017,14 +15156,14 @@ var getCommonClassNames = (dense, selected) => tw(
|
|
15017
15156
|
);
|
15018
15157
|
|
15019
15158
|
// src/molecules/Stepper/Stepper.tsx
|
15020
|
-
import
|
15159
|
+
import React113 from "react";
|
15021
15160
|
|
15022
15161
|
// src/atoms/Stepper/Stepper.tsx
|
15023
|
-
import
|
15162
|
+
import React112 from "react";
|
15024
15163
|
var import_tick6 = __toESM(require_tick());
|
15025
15164
|
var Stepper = (_a) => {
|
15026
15165
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
15027
|
-
return /* @__PURE__ */
|
15166
|
+
return /* @__PURE__ */ React112.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
15028
15167
|
className: classNames(className)
|
15029
15168
|
}));
|
15030
15169
|
};
|
@@ -15038,7 +15177,7 @@ var ConnectorContainer = (_a) => {
|
|
15038
15177
|
"completed",
|
15039
15178
|
"dense"
|
15040
15179
|
]);
|
15041
|
-
return /* @__PURE__ */
|
15180
|
+
return /* @__PURE__ */ React112.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
15042
15181
|
className: classNames(
|
15043
15182
|
tw("absolute w-full -left-1/2", {
|
15044
15183
|
"top-[3px] px-[14px]": Boolean(dense),
|
@@ -15050,7 +15189,7 @@ var ConnectorContainer = (_a) => {
|
|
15050
15189
|
};
|
15051
15190
|
var Connector = (_a) => {
|
15052
15191
|
var _b = _a, { children, className, completed, dense } = _b, rest = __objRest(_b, ["children", "className", "completed", "dense"]);
|
15053
|
-
return /* @__PURE__ */
|
15192
|
+
return /* @__PURE__ */ React112.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
15054
15193
|
className: classNames(
|
15055
15194
|
tw("w-full", {
|
15056
15195
|
"bg-intense": !completed,
|
@@ -15064,7 +15203,7 @@ var Connector = (_a) => {
|
|
15064
15203
|
};
|
15065
15204
|
var Step = (_a) => {
|
15066
15205
|
var _b = _a, { className, state } = _b, rest = __objRest(_b, ["className", "state"]);
|
15067
|
-
return /* @__PURE__ */
|
15206
|
+
return /* @__PURE__ */ React112.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
15068
15207
|
className: classNames(
|
15069
15208
|
tw("flex flex-col items-center relative text-center", {
|
15070
15209
|
"text-intense": state !== "inactive",
|
@@ -15075,8 +15214,8 @@ var Step = (_a) => {
|
|
15075
15214
|
}));
|
15076
15215
|
};
|
15077
15216
|
var getClassNames = (state) => tw("h-[32px] w-[32px] border-2", {
|
15078
|
-
"border-
|
15079
|
-
"border-default
|
15217
|
+
"border-intense": state === "active",
|
15218
|
+
"border-default": state === "inactive",
|
15080
15219
|
"text-white bg-success-default border-success-intense": state === "completed"
|
15081
15220
|
});
|
15082
15221
|
var getDenseClassNames = (state) => tw("h-[8px] w-[8px]", {
|
@@ -15086,13 +15225,13 @@ var getDenseClassNames = (state) => tw("h-[8px] w-[8px]", {
|
|
15086
15225
|
});
|
15087
15226
|
var Indicator = (_a) => {
|
15088
15227
|
var _b = _a, { children, className, state, dense } = _b, rest = __objRest(_b, ["children", "className", "state", "dense"]);
|
15089
|
-
return /* @__PURE__ */
|
15228
|
+
return /* @__PURE__ */ React112.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
15090
15229
|
className: classNames(
|
15091
15230
|
tw("rounded-full flex justify-center items-center mx-2 mb-3"),
|
15092
15231
|
dense ? getDenseClassNames(state) : getClassNames(state),
|
15093
15232
|
className
|
15094
15233
|
)
|
15095
|
-
}), state === "completed" ? /* @__PURE__ */
|
15234
|
+
}), state === "completed" ? /* @__PURE__ */ React112.createElement(InlineIcon, {
|
15096
15235
|
icon: import_tick6.default
|
15097
15236
|
}) : dense ? null : children);
|
15098
15237
|
};
|
@@ -15103,26 +15242,26 @@ Stepper.ConnectorContainer = ConnectorContainer;
|
|
15103
15242
|
|
15104
15243
|
// src/molecules/Stepper/Stepper.tsx
|
15105
15244
|
var Stepper2 = ({ children, activeIndex, dense }) => {
|
15106
|
-
const steps =
|
15107
|
-
return /* @__PURE__ */
|
15245
|
+
const steps = React113.Children.count(children);
|
15246
|
+
return /* @__PURE__ */ React113.createElement(Stepper, {
|
15108
15247
|
role: "list",
|
15109
15248
|
className: "Aquarium-Stepper"
|
15110
|
-
}, /* @__PURE__ */
|
15249
|
+
}, /* @__PURE__ */ React113.createElement(Template, {
|
15111
15250
|
columns: steps
|
15112
|
-
},
|
15251
|
+
}, React113.Children.map(children, (child, index) => {
|
15113
15252
|
if (!isComponentType(child, Step2)) {
|
15114
15253
|
throw new Error("<Stepper> can only have <Stepper.Step> components as children");
|
15115
15254
|
} else {
|
15116
15255
|
const state = index > activeIndex ? "inactive" : index === activeIndex ? "active" : "completed";
|
15117
|
-
return /* @__PURE__ */
|
15256
|
+
return /* @__PURE__ */ React113.createElement(Stepper.Step, {
|
15118
15257
|
state,
|
15119
15258
|
"aria-current": state === "active" ? "step" : false,
|
15120
15259
|
role: "listitem"
|
15121
|
-
}, index > 0 && index <= steps && /* @__PURE__ */
|
15260
|
+
}, index > 0 && index <= steps && /* @__PURE__ */ React113.createElement(Stepper.ConnectorContainer, {
|
15122
15261
|
dense
|
15123
|
-
}, /* @__PURE__ */
|
15262
|
+
}, /* @__PURE__ */ React113.createElement(Stepper.ConnectorContainer.Connector, {
|
15124
15263
|
completed: state === "completed" || state === "active"
|
15125
|
-
})), /* @__PURE__ */
|
15264
|
+
})), /* @__PURE__ */ React113.createElement(Stepper.Step.Indicator, {
|
15126
15265
|
state,
|
15127
15266
|
dense
|
15128
15267
|
}, index + 1), child.props.children);
|
@@ -15135,7 +15274,7 @@ Step2.displayName = "Stepper.Step";
|
|
15135
15274
|
Stepper2.Step = Step2;
|
15136
15275
|
|
15137
15276
|
// src/molecules/SwitchGroup/SwitchGroup.tsx
|
15138
|
-
import
|
15277
|
+
import React114, { useState as useState14 } from "react";
|
15139
15278
|
import { useId as useId17 } from "@react-aria/utils";
|
15140
15279
|
var SwitchGroup = (_a) => {
|
15141
15280
|
var _b = _a, {
|
@@ -15154,7 +15293,7 @@ var SwitchGroup = (_a) => {
|
|
15154
15293
|
"children"
|
15155
15294
|
]);
|
15156
15295
|
var _a2;
|
15157
|
-
const [selectedItems, setSelectedItems] =
|
15296
|
+
const [selectedItems, setSelectedItems] = useState14((_a2 = value != null ? value : defaultValue) != null ? _a2 : []);
|
15158
15297
|
if (value !== void 0 && value !== selectedItems) {
|
15159
15298
|
setSelectedItems(value);
|
15160
15299
|
}
|
@@ -15167,13 +15306,13 @@ var SwitchGroup = (_a) => {
|
|
15167
15306
|
setSelectedItems(updated);
|
15168
15307
|
onChange == null ? void 0 : onChange(updated);
|
15169
15308
|
};
|
15170
|
-
return /* @__PURE__ */
|
15309
|
+
return /* @__PURE__ */ React114.createElement(LabelControl, __spreadProps(__spreadValues(__spreadValues({
|
15171
15310
|
fieldset: true
|
15172
15311
|
}, labelControlProps), errorProps), {
|
15173
15312
|
className: "Aquarium-SwitchGroup"
|
15174
|
-
}), /* @__PURE__ */
|
15313
|
+
}), /* @__PURE__ */ React114.createElement(InputGroup, {
|
15175
15314
|
cols
|
15176
|
-
},
|
15315
|
+
}, React114.Children.map(children, (c) => {
|
15177
15316
|
var _a3, _b2, _c, _d;
|
15178
15317
|
if (!isComponentType(c, Switch2)) {
|
15179
15318
|
return null;
|
@@ -15181,7 +15320,7 @@ var SwitchGroup = (_a) => {
|
|
15181
15320
|
const str = (_a3 = c.props.value) == null ? void 0 : _a3.toString();
|
15182
15321
|
const defaultChecked = defaultValue === void 0 ? void 0 : str !== void 0 && defaultValue.includes(str);
|
15183
15322
|
const checked = value === void 0 ? void 0 : str !== void 0 && value.includes(str);
|
15184
|
-
return
|
15323
|
+
return React114.cloneElement(c, {
|
15185
15324
|
defaultChecked: (_b2 = c.props.defaultChecked) != null ? _b2 : defaultChecked,
|
15186
15325
|
checked: (_c = c.props.checked) != null ? _c : checked,
|
15187
15326
|
onChange: (_d = c.props.onChange) != null ? _d : handleChange,
|
@@ -15191,9 +15330,9 @@ var SwitchGroup = (_a) => {
|
|
15191
15330
|
})));
|
15192
15331
|
};
|
15193
15332
|
var SwitchGroupSkeleton = ({ options = 2 }) => {
|
15194
|
-
return /* @__PURE__ */
|
15333
|
+
return /* @__PURE__ */ React114.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React114.createElement("div", {
|
15195
15334
|
className: tw("flex flex-wrap flex-col gap-2")
|
15196
|
-
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */
|
15335
|
+
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */ React114.createElement(Switch2.Skeleton, {
|
15197
15336
|
key
|
15198
15337
|
}))));
|
15199
15338
|
};
|
@@ -15201,14 +15340,14 @@ SwitchGroup.Skeleton = SwitchGroupSkeleton;
|
|
15201
15340
|
SwitchGroup.Skeleton.displayName = "SwitchGroup.Skeleton";
|
15202
15341
|
|
15203
15342
|
// src/molecules/Textarea/Textarea.tsx
|
15204
|
-
import
|
15343
|
+
import React115, { useState as useState15 } from "react";
|
15205
15344
|
import { useId as useId18 } from "@react-aria/utils";
|
15206
15345
|
import omit16 from "lodash/omit";
|
15207
15346
|
import toString2 from "lodash/toString";
|
15208
|
-
var TextareaBase =
|
15347
|
+
var TextareaBase = React115.forwardRef(
|
15209
15348
|
(_a, ref) => {
|
15210
15349
|
var _b = _a, { readOnly = false, valid = true } = _b, props = __objRest(_b, ["readOnly", "valid"]);
|
15211
|
-
return /* @__PURE__ */
|
15350
|
+
return /* @__PURE__ */ React115.createElement("textarea", __spreadProps(__spreadValues({
|
15212
15351
|
ref
|
15213
15352
|
}, props), {
|
15214
15353
|
readOnly,
|
@@ -15216,26 +15355,26 @@ var TextareaBase = React114.forwardRef(
|
|
15216
15355
|
}));
|
15217
15356
|
}
|
15218
15357
|
);
|
15219
|
-
TextareaBase.Skeleton = () => /* @__PURE__ */
|
15358
|
+
TextareaBase.Skeleton = () => /* @__PURE__ */ React115.createElement(Skeleton, {
|
15220
15359
|
height: 58
|
15221
15360
|
});
|
15222
|
-
var Textarea =
|
15361
|
+
var Textarea = React115.forwardRef((props, ref) => {
|
15223
15362
|
var _a, _b, _c;
|
15224
|
-
const [value, setValue] =
|
15363
|
+
const [value, setValue] = useState15((_b = (_a = props.value) != null ? _a : props.defaultValue) != null ? _b : "");
|
15225
15364
|
const defaultId = useId18();
|
15226
15365
|
const id = (_c = props.id) != null ? _c : defaultId;
|
15227
15366
|
const errorMessageId = useId18();
|
15228
15367
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
15229
15368
|
const _d = getLabelControlProps(props), { "data-testid": dataTestId } = _d, labelControlProps = __objRest(_d, ["data-testid"]);
|
15230
15369
|
const baseProps = omit16(props, Object.keys(labelControlProps));
|
15231
|
-
return /* @__PURE__ */
|
15370
|
+
return /* @__PURE__ */ React115.createElement(LabelControl, __spreadProps(__spreadValues({
|
15232
15371
|
id: `${id}-label`,
|
15233
15372
|
htmlFor: id,
|
15234
15373
|
messageId: errorMessageId,
|
15235
15374
|
length: value !== void 0 ? toString2(value).length : void 0
|
15236
15375
|
}, labelControlProps), {
|
15237
15376
|
className: "Aquarium-Textarea"
|
15238
|
-
}), /* @__PURE__ */
|
15377
|
+
}), /* @__PURE__ */ React115.createElement(TextareaBase, __spreadProps(__spreadValues(__spreadValues({
|
15239
15378
|
ref
|
15240
15379
|
}, baseProps), errorProps), {
|
15241
15380
|
id,
|
@@ -15252,48 +15391,48 @@ var Textarea = React114.forwardRef((props, ref) => {
|
|
15252
15391
|
})));
|
15253
15392
|
});
|
15254
15393
|
Textarea.displayName = "Textarea";
|
15255
|
-
var TextAreaSkeleton = () => /* @__PURE__ */
|
15394
|
+
var TextAreaSkeleton = () => /* @__PURE__ */ React115.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React115.createElement(TextareaBase.Skeleton, null));
|
15256
15395
|
Textarea.Skeleton = TextAreaSkeleton;
|
15257
15396
|
Textarea.Skeleton.displayName = "Textarea.Skeleton";
|
15258
15397
|
|
15259
15398
|
// src/molecules/Timeline/Timeline.tsx
|
15260
|
-
import
|
15399
|
+
import React117 from "react";
|
15261
15400
|
|
15262
15401
|
// src/atoms/Timeline/Timeline.tsx
|
15263
|
-
import
|
15402
|
+
import React116 from "react";
|
15264
15403
|
var Timeline = (_a) => {
|
15265
15404
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
15266
|
-
return /* @__PURE__ */
|
15405
|
+
return /* @__PURE__ */ React116.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
15267
15406
|
className: classNames(tw("grid grid-cols-[16px_1fr] gap-x-4"), className)
|
15268
15407
|
}));
|
15269
15408
|
};
|
15270
15409
|
var Content2 = (_a) => {
|
15271
15410
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
15272
|
-
return /* @__PURE__ */
|
15411
|
+
return /* @__PURE__ */ React116.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
15273
15412
|
className: classNames(tw("pb-6"), className)
|
15274
15413
|
}));
|
15275
15414
|
};
|
15276
15415
|
var Separator2 = (_a) => {
|
15277
15416
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
15278
|
-
return /* @__PURE__ */
|
15417
|
+
return /* @__PURE__ */ React116.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
15279
15418
|
className: classNames(tw("flex items-center justify-center h-5 w-5"), className)
|
15280
15419
|
}));
|
15281
15420
|
};
|
15282
15421
|
var LineContainer = (_a) => {
|
15283
15422
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
15284
|
-
return /* @__PURE__ */
|
15423
|
+
return /* @__PURE__ */ React116.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
15285
15424
|
className: classNames(tw("flex justify-center py-1"), className)
|
15286
15425
|
}));
|
15287
15426
|
};
|
15288
15427
|
var Line = (_a) => {
|
15289
15428
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
15290
|
-
return /* @__PURE__ */
|
15429
|
+
return /* @__PURE__ */ React116.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
15291
15430
|
className: classNames(tw("w-1 bg-default h-full justify-self-center"), className)
|
15292
15431
|
}));
|
15293
15432
|
};
|
15294
15433
|
var Dot = (_a) => {
|
15295
15434
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
15296
|
-
return /* @__PURE__ */
|
15435
|
+
return /* @__PURE__ */ React116.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
15297
15436
|
className: classNames(tw("bg-intense h-[6px] w-[6px] rounded"), className)
|
15298
15437
|
}));
|
15299
15438
|
};
|
@@ -15308,54 +15447,54 @@ var import_error5 = __toESM(require_error());
|
|
15308
15447
|
var import_time2 = __toESM(require_time());
|
15309
15448
|
var import_warningSign5 = __toESM(require_warningSign());
|
15310
15449
|
var TimelineItem = () => null;
|
15311
|
-
var Timeline2 = ({ children }) => /* @__PURE__ */
|
15450
|
+
var Timeline2 = ({ children }) => /* @__PURE__ */ React117.createElement("div", {
|
15312
15451
|
className: "Aquarium-Timeline"
|
15313
|
-
},
|
15452
|
+
}, React117.Children.map(children, (item) => {
|
15314
15453
|
if (!isComponentType(item, TimelineItem)) {
|
15315
15454
|
throw new Error("<Timeline> can only have <Timeline.Item> components as children");
|
15316
15455
|
} else {
|
15317
15456
|
const { props, key } = item;
|
15318
|
-
return /* @__PURE__ */
|
15457
|
+
return /* @__PURE__ */ React117.createElement(Timeline, {
|
15319
15458
|
key: key != null ? key : props.title
|
15320
|
-
}, /* @__PURE__ */
|
15459
|
+
}, /* @__PURE__ */ React117.createElement(Timeline.Separator, null, props.variant === "error" ? /* @__PURE__ */ React117.createElement(Icon, {
|
15321
15460
|
icon: import_error5.default,
|
15322
15461
|
color: "danger-default"
|
15323
|
-
}) : props.variant === "warning" ? /* @__PURE__ */
|
15462
|
+
}) : props.variant === "warning" ? /* @__PURE__ */ React117.createElement(Icon, {
|
15324
15463
|
icon: import_warningSign5.default,
|
15325
15464
|
color: "warning-default"
|
15326
|
-
}) : props.variant === "info" ? /* @__PURE__ */
|
15465
|
+
}) : props.variant === "info" ? /* @__PURE__ */ React117.createElement(Icon, {
|
15327
15466
|
icon: import_time2.default,
|
15328
15467
|
color: "info-default"
|
15329
|
-
}) : /* @__PURE__ */
|
15330
|
-
color: "
|
15331
|
-
}, props.title), /* @__PURE__ */
|
15468
|
+
}) : /* @__PURE__ */ React117.createElement(Timeline.Separator.Dot, null)), /* @__PURE__ */ React117.createElement(Typography2.Caption, {
|
15469
|
+
color: "muted"
|
15470
|
+
}, props.title), /* @__PURE__ */ React117.createElement(Timeline.LineContainer, null, /* @__PURE__ */ React117.createElement(Timeline.LineContainer.Line, null)), /* @__PURE__ */ React117.createElement(Timeline.Content, null, /* @__PURE__ */ React117.createElement(Typography2.Small, null, props.children)));
|
15332
15471
|
}
|
15333
15472
|
}));
|
15334
|
-
var TimelineItemSkeleton = () => /* @__PURE__ */
|
15473
|
+
var TimelineItemSkeleton = () => /* @__PURE__ */ React117.createElement(Timeline, null, /* @__PURE__ */ React117.createElement(Timeline.Separator, null, /* @__PURE__ */ React117.createElement(Skeleton, {
|
15335
15474
|
width: 6,
|
15336
15475
|
height: 6,
|
15337
15476
|
rounded: true
|
15338
|
-
})), /* @__PURE__ */
|
15477
|
+
})), /* @__PURE__ */ React117.createElement(Skeleton, {
|
15339
15478
|
height: 12,
|
15340
15479
|
width: 120
|
15341
|
-
}), /* @__PURE__ */
|
15480
|
+
}), /* @__PURE__ */ React117.createElement(Timeline.LineContainer, null, /* @__PURE__ */ React117.createElement(Skeleton, {
|
15342
15481
|
width: 2,
|
15343
15482
|
height: "100%"
|
15344
|
-
})), /* @__PURE__ */
|
15483
|
+
})), /* @__PURE__ */ React117.createElement(Timeline.Content, null, /* @__PURE__ */ React117.createElement(Box, {
|
15345
15484
|
display: "flex",
|
15346
15485
|
flexDirection: "column",
|
15347
15486
|
gap: "3"
|
15348
|
-
}, /* @__PURE__ */
|
15487
|
+
}, /* @__PURE__ */ React117.createElement(Skeleton, {
|
15349
15488
|
height: 32,
|
15350
15489
|
width: "100%"
|
15351
|
-
}), /* @__PURE__ */
|
15490
|
+
}), /* @__PURE__ */ React117.createElement(Skeleton, {
|
15352
15491
|
height: 32,
|
15353
15492
|
width: "73%"
|
15354
|
-
}), /* @__PURE__ */
|
15493
|
+
}), /* @__PURE__ */ React117.createElement(Skeleton, {
|
15355
15494
|
height: 32,
|
15356
15495
|
width: "80%"
|
15357
15496
|
}))));
|
15358
|
-
var TimelineSkeleton = ({ items = 3 }) => /* @__PURE__ */
|
15497
|
+
var TimelineSkeleton = ({ items = 3 }) => /* @__PURE__ */ React117.createElement("div", null, Array.from({ length: items }).map((_, key) => /* @__PURE__ */ React117.createElement(TimelineItemSkeleton, {
|
15359
15498
|
key
|
15360
15499
|
})));
|
15361
15500
|
Timeline2.Item = TimelineItem;
|
@@ -15363,9 +15502,9 @@ Timeline2.Skeleton = TimelineSkeleton;
|
|
15363
15502
|
Timeline2.Skeleton.displayName = "Timeline.Skeleton";
|
15364
15503
|
|
15365
15504
|
// src/utils/table/useTableSelect.ts
|
15366
|
-
import
|
15505
|
+
import React118 from "react";
|
15367
15506
|
var useTableSelect = (data, { key }) => {
|
15368
|
-
const [selected, setSelected] =
|
15507
|
+
const [selected, setSelected] = React118.useState([]);
|
15369
15508
|
const allSelected = selected.length === data.length;
|
15370
15509
|
const isSelected = (dot) => selected.includes(dot[key]);
|
15371
15510
|
const selectAll = () => setSelected(data.map((dot) => dot[key]));
|