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