@aivenio/aquarium 4.0.1 → 4.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/atoms.cjs +315 -172
- package/dist/atoms.mjs +322 -171
- package/dist/src/atoms/DropdownMenu/DropdownMenu.d.ts +155 -32
- package/dist/src/atoms/DropdownMenu/DropdownMenu.js +64 -34
- package/dist/src/atoms/Filter/Filter.d.ts +39 -0
- package/dist/src/atoms/Filter/Filter.js +127 -0
- package/dist/src/atoms/index.d.ts +1 -0
- package/dist/src/atoms/index.js +2 -1
- package/dist/src/atoms/utils/index.d.ts +2 -2
- package/dist/src/atoms/utils/index.js +2 -2
- package/dist/src/molecules/Card/Card.d.ts +7 -3
- package/dist/src/molecules/Card/Card.js +6 -5
- package/dist/src/molecules/DataList/DataList.js +16 -3
- package/dist/src/molecules/DataList/DataListGroup.js +16 -3
- package/dist/src/molecules/DropdownMenu/DropdownMenu.d.ts +14 -14
- package/dist/src/molecules/DropdownMenu/DropdownMenu.js +48 -172
- package/dist/src/molecules/DropdownMenu/SearchField.d.ts +5 -0
- package/dist/src/molecules/DropdownMenu/SearchField.js +13 -0
- package/dist/src/molecules/Popover/Popover.js +2 -1
- package/dist/styles.css +62 -9
- package/dist/system.cjs +761 -927
- package/dist/system.mjs +673 -824
- package/dist/tsconfig.module.tsbuildinfo +1 -1
- package/dist/types/tailwindGenerated.d.ts +1 -1
- package/package.json +1 -1
package/dist/system.mjs
CHANGED
@@ -4360,7 +4360,7 @@ __export(molecules_exports, {
|
|
4360
4360
|
RadioButton: () => RadioButton2,
|
4361
4361
|
RadioButtonGroup: () => RadioButtonGroup,
|
4362
4362
|
SearchInput: () => SearchInput,
|
4363
|
-
Section: () =>
|
4363
|
+
Section: () => Section3,
|
4364
4364
|
SegmentedControl: () => SegmentedControl,
|
4365
4365
|
SegmentedControlGroup: () => SegmentedControlGroup,
|
4366
4366
|
Select: () => Select2,
|
@@ -8288,6 +8288,7 @@ Breadcrumbs.Crumb = Crumb;
|
|
8288
8288
|
import React41, { useContext as useContext5, useRef as useRef4 } from "react";
|
8289
8289
|
import { useFocusVisible as useFocusVisible2 } from "react-aria";
|
8290
8290
|
import { useButton as useButton3 } from "@react-aria/button";
|
8291
|
+
import { isString } from "lodash-es";
|
8291
8292
|
|
8292
8293
|
// src/molecules/Chip/Chip.tsx
|
8293
8294
|
import React31 from "react";
|
@@ -8853,9 +8854,11 @@ var Card2 = ({
|
|
8853
8854
|
if (checkable && controlled !== void 0 && controlled !== checked) {
|
8854
8855
|
setChecked(controlled);
|
8855
8856
|
}
|
8856
|
-
const chipElements = chips.length > 0 && /* @__PURE__ */ React41.createElement(ChipContainer, { dense: true }, chips.map(
|
8857
|
+
const chipElements = chips.length > 0 && /* @__PURE__ */ React41.createElement(ChipContainer, { dense: true }, chips.map(
|
8858
|
+
(chip) => isString(chip) ? /* @__PURE__ */ React41.createElement(Chip2, { key: chip, text: chip }) : "status" in chip ? /* @__PURE__ */ React41.createElement(StatusChip, { key: chip.text, ...chip }) : /* @__PURE__ */ React41.createElement(Chip2, { key: chip.text, ...chip })
|
8859
|
+
));
|
8857
8860
|
const iconElements = icons.length > 0 && /* @__PURE__ */ React41.createElement(AvatarStack, { images: icons });
|
8858
|
-
const imageElement = image !== void 0 && (imageHeight ? /* @__PURE__ */ React41.createElement(CardImage, { image, imageAlt, imageHeight }) : /* @__PURE__ */ React41.createElement(CardImage, { image, imageAlt, fullSize:
|
8861
|
+
const imageElement = image !== void 0 && (imageHeight ? /* @__PURE__ */ React41.createElement(CardImage, { image, imageAlt, imageHeight }) : /* @__PURE__ */ React41.createElement(CardImage, { image, imageAlt, fullSize: !chipElements }));
|
8859
8862
|
const inputProps = {
|
8860
8863
|
name: groupContext?.name,
|
8861
8864
|
value: value ?? "",
|
@@ -8871,7 +8874,7 @@ var Card2 = ({
|
|
8871
8874
|
* If any of the "additional features" in `<Card>` are used, we want to enable
|
8872
8875
|
* min width to make sure it doesn't
|
8873
8876
|
*/
|
8874
|
-
enableMinWidth: Boolean(image ||
|
8877
|
+
enableMinWidth: Boolean(image || chipElements || icons.length),
|
8875
8878
|
disabled
|
8876
8879
|
};
|
8877
8880
|
if (checkable) {
|
@@ -9919,13 +9922,13 @@ var Container2 = ({ maxWidth = "xl", children }) => /* @__PURE__ */ React56.crea
|
|
9919
9922
|
);
|
9920
9923
|
|
9921
9924
|
// src/molecules/DataList/DataList.tsx
|
9922
|
-
import
|
9925
|
+
import React76, { useRef as useRef8 } from "react";
|
9923
9926
|
import { useControlledState } from "@react-stately/utils";
|
9924
|
-
import { castArray as castArray2, compact, groupBy as groupBy2, isArray as isArray2, isFunction as isFunction3 } from "lodash-es";
|
9927
|
+
import { castArray as castArray2, compact, groupBy as groupBy2, isArray as isArray2, isFunction as isFunction3, noop as noop2 } from "lodash-es";
|
9925
9928
|
|
9926
9929
|
// src/molecules/List/List.tsx
|
9927
9930
|
import React62 from "react";
|
9928
|
-
import { isObject, isString } from "lodash-es";
|
9931
|
+
import { isObject, isString as isString2 } from "lodash-es";
|
9929
9932
|
|
9930
9933
|
// src/molecules/Pagination/Pagination.tsx
|
9931
9934
|
import React60 from "react";
|
@@ -10519,7 +10522,7 @@ var List = ({
|
|
10519
10522
|
ref,
|
10520
10523
|
"aria-hidden": !isLoading,
|
10521
10524
|
"aria-busy": isLoading,
|
10522
|
-
"aria-label":
|
10525
|
+
"aria-label": isString2(loadingIndicator) ? loadingIndicator : void 0,
|
10523
10526
|
className: tw(
|
10524
10527
|
"flex gap-4 py-3 justify-center items-center transition-opacity duration-200",
|
10525
10528
|
isLoading ? "opacity-100" : "opacity-0"
|
@@ -10969,85 +10972,99 @@ var sortRowsBy = (rows, sort) => {
|
|
10969
10972
|
};
|
10970
10973
|
|
10971
10974
|
// src/molecules/DataList/DataListComponents.tsx
|
10972
|
-
import
|
10975
|
+
import React72 from "react";
|
10973
10976
|
import { isFunction } from "lodash-es";
|
10974
10977
|
|
10975
10978
|
// src/molecules/DropdownMenu/DropdownMenu.tsx
|
10976
|
-
import
|
10977
|
-
import {
|
10978
|
-
|
10979
|
-
|
10980
|
-
|
10981
|
-
|
10982
|
-
import { useMenuTriggerState } from "@react-stately/menu";
|
10983
|
-
import { useTreeState } from "@react-stately/tree";
|
10984
|
-
import { omit as omit7 } from "lodash-es";
|
10979
|
+
import React71, { createContext as createContext3, useContext as useContext6 } from "react";
|
10980
|
+
import {
|
10981
|
+
Autocomplete as AriaAutocomplete,
|
10982
|
+
MenuTrigger as AriaMenuTrigger,
|
10983
|
+
useFilter
|
10984
|
+
} from "react-aria-components";
|
10985
10985
|
|
10986
10986
|
// src/atoms/DropdownMenu/DropdownMenu.tsx
|
10987
10987
|
import React67 from "react";
|
10988
|
+
import {
|
10989
|
+
Collection as AriaCollection,
|
10990
|
+
composeRenderProps as composeRenderProps2,
|
10991
|
+
Header as AriaHeader,
|
10992
|
+
Menu as AriaMenu,
|
10993
|
+
MenuItem as AriaMenuItem,
|
10994
|
+
MenuSection as AriaMenuSection
|
10995
|
+
} from "react-aria-components";
|
10996
|
+
import { tv as tv6 } from "tailwind-variants";
|
10988
10997
|
var import_tick5 = __toESM(require_tick());
|
10989
|
-
var
|
10990
|
-
|
10991
|
-
|
10992
|
-
|
10993
|
-
|
10994
|
-
|
10995
|
-
|
10996
|
-
|
10997
|
-
|
10998
|
-
|
10999
|
-
|
10998
|
+
var dropdownMenuStyles = tv6({
|
10999
|
+
base: "bg-popover-content w-full flex flex-col overflow-x-hidden typography-small text-default"
|
11000
|
+
});
|
11001
|
+
var DropdownMenu = ({ className, children, ...props }) => {
|
11002
|
+
return /* @__PURE__ */ React67.createElement(AriaMenu, { className: dropdownMenuStyles({ className: ["Aquarium-DropdownMenu", className] }), ...props }, children);
|
11003
|
+
};
|
11004
|
+
var MenuContainer = ({ minHeight, maxHeight = "100%", minWidth = "125px", maxWidth, children }) => /* @__PURE__ */ React67.createElement("div", { style: { minHeight, maxHeight, minWidth, maxWidth }, className: tw("overflow-x-hidden flex flex-col") }, children);
|
11005
|
+
DropdownMenu.MenuContainer = MenuContainer;
|
11006
|
+
var ScrollableContentContainer = ({ children }) => /* @__PURE__ */ React67.createElement("div", { className: tw("p-3 overflow-y-auto overflow-x-hidden") }, children);
|
11007
|
+
DropdownMenu.ScrollableContentContainer = ScrollableContentContainer;
|
11008
|
+
var dropdownMenuGroupStyles = tv6({
|
11009
|
+
slots: {
|
11010
|
+
base: [
|
11011
|
+
'[&:not(:first-child)]:before:content-[""] [&:not(:first-child)]:before:block',
|
11012
|
+
"[&:not(:first-child)]:before:h-[1px] [&:not(:first-child)]:before:bg-default [&:not(:first-child)]:before:m-3"
|
11013
|
+
],
|
11014
|
+
title: "p-3 text-inactive uppercase cursor-default typography-caption"
|
11015
|
+
}
|
11016
|
+
});
|
11017
|
+
var Group2 = ({ className, title, titleProps, children, ...props }) => {
|
11018
|
+
const styles = dropdownMenuGroupStyles();
|
11019
|
+
return /* @__PURE__ */ React67.createElement(AriaMenuSection, { className: styles.base({ className: "Aquarium-DropdownMenu.Group" }), ...props }, title && /* @__PURE__ */ React67.createElement(AriaHeader, { className: styles.title(), ...titleProps }, title), /* @__PURE__ */ React67.createElement(AriaCollection, null, children));
|
11020
|
+
};
|
11021
|
+
DropdownMenu.Group = Group2;
|
11022
|
+
var dropdownMenuItemStyles = tv6({
|
11023
|
+
base: "group flex items-center gap-x-3 p-3 outline-none cursor-pointer",
|
11024
|
+
variants: {
|
11025
|
+
isDisabled: {
|
11026
|
+
true: "text-inactive cursor-not-allowed"
|
11000
11027
|
},
|
11001
|
-
|
11002
|
-
|
11003
|
-
);
|
11004
|
-
var ContentContainer = ({ children }) => /* @__PURE__ */ React67.createElement("div", { className: tw("p-3 overflow-y-auto overflow-x-hidden") }, children);
|
11005
|
-
DropdownMenu.ContentContainer = ContentContainer;
|
11006
|
-
var List2 = React67.forwardRef(
|
11007
|
-
({ children, className, ...props }, ref) => /* @__PURE__ */ React67.createElement("ul", { ref, className: classNames(className, "outline-none ring-0"), ...props }, children)
|
11008
|
-
);
|
11009
|
-
DropdownMenu.List = List2;
|
11010
|
-
var Group2 = React67.forwardRef(
|
11011
|
-
({ className, title, titleProps, children, ...props }, ref) => /* @__PURE__ */ React67.createElement("li", { ref, ...props }, title && /* @__PURE__ */ React67.createElement(
|
11012
|
-
"div",
|
11013
|
-
{
|
11014
|
-
className: classNames(
|
11015
|
-
className,
|
11016
|
-
"Aquarium-DropdownMenu.Group p-3 text-inactive uppercase cursor-default typography-caption"
|
11017
|
-
),
|
11018
|
-
...titleProps
|
11028
|
+
isFocused: {
|
11029
|
+
true: "bg-muted"
|
11019
11030
|
},
|
11020
|
-
|
11021
|
-
|
11022
|
-
|
11023
|
-
|
11024
|
-
|
11025
|
-
|
11026
|
-
|
11031
|
+
kind: {
|
11032
|
+
action: "",
|
11033
|
+
danger: "",
|
11034
|
+
default: ""
|
11035
|
+
}
|
11036
|
+
},
|
11037
|
+
compoundVariants: [
|
11027
11038
|
{
|
11028
|
-
|
11029
|
-
|
11030
|
-
|
11031
|
-
"bg-muted": highlighted,
|
11032
|
-
"text-primary-intense": kind === "action" && !props.disabled,
|
11033
|
-
"text-danger-default": kind === "danger" && !props.disabled,
|
11034
|
-
"text-inactive cursor-not-allowed": props.disabled
|
11035
|
-
}),
|
11036
|
-
...props
|
11039
|
+
kind: "action",
|
11040
|
+
disabled: false,
|
11041
|
+
className: "text-primary-intense"
|
11037
11042
|
},
|
11038
|
-
|
11039
|
-
|
11040
|
-
|
11041
|
-
|
11042
|
-
|
11043
|
+
{
|
11044
|
+
kind: "danger",
|
11045
|
+
disabled: false,
|
11046
|
+
className: "text-danger-default"
|
11047
|
+
}
|
11048
|
+
]
|
11049
|
+
});
|
11050
|
+
var Item3 = ({
|
11051
|
+
kind = "default",
|
11052
|
+
className,
|
11053
|
+
icon,
|
11054
|
+
description,
|
11055
|
+
showNotification = false,
|
11056
|
+
disabled,
|
11057
|
+
...props
|
11058
|
+
}) => /* @__PURE__ */ React67.createElement(
|
11059
|
+
AriaMenuItem,
|
11060
|
+
{
|
11061
|
+
className: (values) => dropdownMenuItemStyles({ ...values, kind, className: ["Aquarium-DropdownMenu.Item", className] }),
|
11062
|
+
isDisabled: disabled,
|
11063
|
+
...props
|
11064
|
+
},
|
11065
|
+
composeRenderProps2(props.children, (children, { selectionMode, isSelected, isDisabled }) => /* @__PURE__ */ React67.createElement(React67.Fragment, null, icon && showNotification && /* @__PURE__ */ React67.createElement(Badge.Notification, null, /* @__PURE__ */ React67.createElement(InlineIcon, { icon })), icon && !showNotification && /* @__PURE__ */ React67.createElement(InlineIcon, { icon }), /* @__PURE__ */ React67.createElement("span", { className: tw("grow") }, children, description && /* @__PURE__ */ React67.createElement(Typography2.Caption, { color: isDisabled ? "inactive" : "muted" }, description)), selectionMode !== "none" && isSelected && /* @__PURE__ */ React67.createElement(InlineIcon, { icon: import_tick5.default })))
|
11043
11066
|
);
|
11044
11067
|
DropdownMenu.Item = Item3;
|
11045
|
-
var Description = ({ disabled, children }) => /* @__PURE__ */ React67.createElement(Typography2.Caption, { color: disabled ? "inactive" : "muted" }, children);
|
11046
|
-
DropdownMenu.Description = Description;
|
11047
|
-
var Separator = ({ className, ...props }) => {
|
11048
|
-
return /* @__PURE__ */ React67.createElement("li", { ...props, className: classNames(className, tw("m-3 block bg-default h-[1px]")) });
|
11049
|
-
};
|
11050
|
-
DropdownMenu.Separator = Separator;
|
11051
11068
|
var EmptyStateContainer2 = ({ className, children, ...props }) => /* @__PURE__ */ React67.createElement("div", { className: classNames(tw("border border-dashed border-default p-3"), className), ...props }, children);
|
11052
11069
|
DropdownMenu.EmptyStateContainer = EmptyStateContainer2;
|
11053
11070
|
|
@@ -11066,250 +11083,123 @@ var Pressable = React68.forwardRef(({ children, ...props }, ref) => {
|
|
11066
11083
|
);
|
11067
11084
|
});
|
11068
11085
|
|
11069
|
-
// src/molecules/DropdownMenu/
|
11070
|
-
import
|
11071
|
-
|
11072
|
-
|
11073
|
-
|
11074
|
-
|
11075
|
-
|
11076
|
-
|
11077
|
-
|
11078
|
-
|
11079
|
-
|
11080
|
-
|
11081
|
-
|
11082
|
-
|
11083
|
-
|
11084
|
-
|
11086
|
+
// src/molecules/DropdownMenu/SearchField.tsx
|
11087
|
+
import React70 from "react";
|
11088
|
+
import {
|
11089
|
+
Button as AriaButton,
|
11090
|
+
Input as AriaInput,
|
11091
|
+
SearchField as AriaSearchField
|
11092
|
+
} from "react-aria-components";
|
11093
|
+
|
11094
|
+
// src/molecules/Field/Field.tsx
|
11095
|
+
import React69 from "react";
|
11096
|
+
import { Group as Group3 } from "react-aria-components";
|
11097
|
+
|
11098
|
+
// src/atoms/utils/index.ts
|
11099
|
+
import { tv as tv7 } from "tailwind-variants";
|
11100
|
+
var focusRing = tv7({
|
11101
|
+
base: "outline outline-primary-default outline-offset-2",
|
11102
|
+
variants: {
|
11103
|
+
isFocusVisible: {
|
11104
|
+
false: "outline-0",
|
11105
|
+
true: "outline-2"
|
11106
|
+
}
|
11107
|
+
}
|
11108
|
+
});
|
11109
|
+
var fieldBorder = tv7({
|
11110
|
+
variants: {
|
11111
|
+
isReadOnly: {
|
11112
|
+
true: "bg-primary-muted"
|
11113
|
+
},
|
11114
|
+
isFocusWithin: {
|
11115
|
+
false: "border-default hover:border-intense",
|
11116
|
+
true: "border-info-default"
|
11117
|
+
},
|
11118
|
+
isInvalid: {
|
11119
|
+
true: "border-danger-default"
|
11120
|
+
},
|
11121
|
+
isDisabled: {
|
11122
|
+
true: "bg-default cursor-not-allowed text-inactive"
|
11085
11123
|
}
|
11086
11124
|
}
|
11087
|
-
|
11125
|
+
});
|
11126
|
+
var fieldGroup = tv7({
|
11127
|
+
base: "group flex gap-3 items-center bg-transparent border rounded-sm typography-small text-default px-3 py-3 overflow-hidden",
|
11128
|
+
variants: fieldBorder.variants
|
11129
|
+
});
|
11130
|
+
|
11131
|
+
// src/molecules/Field/Field.tsx
|
11132
|
+
var FieldGroup = (props) => {
|
11133
|
+
return /* @__PURE__ */ React69.createElement(Group3, { ...props, className: (renderProps) => fieldGroup(renderProps) });
|
11134
|
+
};
|
11135
|
+
|
11136
|
+
// src/molecules/DropdownMenu/SearchField.tsx
|
11137
|
+
var SearchField = (props) => {
|
11138
|
+
return /* @__PURE__ */ React70.createElement(AriaSearchField, { ...props }, /* @__PURE__ */ React70.createElement(FieldGroup, null, /* @__PURE__ */ React70.createElement(SearchIcon, { "aria-hidden": true }), /* @__PURE__ */ React70.createElement(AriaInput, { className: "outline-none grow bg-transparent [&::-webkit-search-cancel-button]:hidden" }), /* @__PURE__ */ React70.createElement(AriaButton, { "aria-label": "Clear", className: "group-empty:invisible" }, /* @__PURE__ */ React70.createElement(ResetIcon, { "aria-hidden": true }))));
|
11088
11139
|
};
|
11089
11140
|
|
11090
11141
|
// src/molecules/DropdownMenu/DropdownMenu.tsx
|
11091
|
-
var
|
11092
|
-
|
11093
|
-
|
11094
|
-
selection,
|
11095
|
-
onSelectionChange,
|
11096
|
-
disabled,
|
11097
|
-
placement = "bottom-left",
|
11098
|
-
minWidth,
|
11099
|
-
maxWidth,
|
11100
|
-
minHeight,
|
11101
|
-
maxHeight,
|
11102
|
-
searchable = false,
|
11103
|
-
emptyState,
|
11104
|
-
header,
|
11105
|
-
footer,
|
11106
|
-
children,
|
11107
|
-
...props
|
11108
|
-
}) => {
|
11109
|
-
const triggerRef = React69.useRef(null);
|
11110
|
-
const [trigger, items] = extractTriggerAndItems(children);
|
11111
|
-
const state = useMenuTriggerState(props);
|
11112
|
-
const { menuTriggerProps, menuProps } = useMenuTrigger({}, state, triggerRef);
|
11113
|
-
return /* @__PURE__ */ React69.createElement("div", null, /* @__PURE__ */ React69.createElement(
|
11114
|
-
PressResponder,
|
11115
|
-
{
|
11116
|
-
ref: triggerRef,
|
11117
|
-
onPress: () => state.toggle(),
|
11118
|
-
...omit7(menuTriggerProps, ["id", "aria-expanded"])
|
11119
|
-
},
|
11120
|
-
/* @__PURE__ */ React69.createElement(Pressable, { "aria-expanded": menuTriggerProps["aria-expanded"], isDisabled: disabled }, trigger.props.children)
|
11121
|
-
), /* @__PURE__ */ React69.createElement(
|
11122
|
-
Popover,
|
11123
|
-
{
|
11124
|
-
isOpen: state.isOpen,
|
11125
|
-
onOpenChange: (isOpen) => isOpen ? state.open() : state.close(),
|
11126
|
-
className: "Aquarium-DropdownMenu",
|
11127
|
-
triggerRef,
|
11128
|
-
placement
|
11129
|
-
},
|
11130
|
-
/* @__PURE__ */ React69.createElement(
|
11131
|
-
MenuWrapper,
|
11132
|
-
{
|
11133
|
-
onAction,
|
11134
|
-
selectionMode,
|
11135
|
-
selection,
|
11136
|
-
onSelectionChange,
|
11137
|
-
searchable,
|
11138
|
-
emptyState,
|
11139
|
-
minWidth,
|
11140
|
-
maxWidth,
|
11141
|
-
maxHeight,
|
11142
|
-
minHeight,
|
11143
|
-
header,
|
11144
|
-
footer,
|
11145
|
-
...menuProps
|
11146
|
-
},
|
11147
|
-
items.props.children
|
11148
|
-
)
|
11149
|
-
));
|
11142
|
+
var MenuPropsContext = createContext3({});
|
11143
|
+
var DropdownMenu2 = (props) => {
|
11144
|
+
return /* @__PURE__ */ React71.createElement(MenuPropsContext.Provider, { value: props }, /* @__PURE__ */ React71.createElement(AriaMenuTrigger, { defaultOpen: props.defaultOpen, isOpen: props.isOpen, onOpenChange: props.onOpenChange }, props.children));
|
11150
11145
|
};
|
11151
11146
|
DropdownMenu2.displayName = "DropdownMenu";
|
11152
|
-
var MenuTrigger = () =>
|
11153
|
-
|
11147
|
+
var MenuTrigger = ({ children }) => {
|
11148
|
+
const props = useContext6(MenuPropsContext);
|
11149
|
+
return /* @__PURE__ */ React71.createElement(Pressable, { "aria-haspopup": "true", isDisabled: props.disabled }, children);
|
11150
|
+
};
|
11154
11151
|
DropdownMenu2.Trigger = MenuTrigger;
|
11155
11152
|
DropdownMenu2.Trigger.displayName = "DropdownMenu.Trigger";
|
11156
|
-
|
11157
|
-
|
11158
|
-
DropdownMenu2.Item = Item4;
|
11159
|
-
DropdownMenu2.Item.displayName = "DropdownMenu.Item";
|
11160
|
-
DropdownMenu2.Section = Section;
|
11161
|
-
DropdownMenu2.Section.displayName = "DropdownMenu.Section";
|
11162
|
-
var isSectionNode = (item) => item.type === "section";
|
11163
|
-
var isItemNode = (item) => item.type === "item";
|
11164
|
-
var MenuWrapper = ({
|
11165
|
-
selection: selectedKeys,
|
11166
|
-
minWidth,
|
11167
|
-
maxWidth,
|
11168
|
-
minHeight,
|
11169
|
-
maxHeight,
|
11170
|
-
searchable,
|
11171
|
-
emptyState,
|
11172
|
-
header,
|
11173
|
-
footer,
|
11174
|
-
...props
|
11175
|
-
}) => {
|
11176
|
-
const baseListRef = React69.useRef(null);
|
11177
|
-
const disabledKeys = getDisabledItemKeys(props.children);
|
11178
|
-
const state = useTreeState({
|
11179
|
-
disabledKeys,
|
11180
|
-
selectedKeys,
|
11181
|
-
...props
|
11182
|
-
});
|
11183
|
-
const { menuProps } = useMenu(props, state, baseListRef);
|
11153
|
+
var MenuItems = ({ children }) => {
|
11154
|
+
const props = useContext6(MenuPropsContext);
|
11184
11155
|
const { contains } = useFilter({ sensitivity: "base" });
|
11185
|
-
const
|
11186
|
-
const
|
11187
|
-
|
11188
|
-
() => searchable ? filterCollection(state.collection, search, contains) : state.collection,
|
11189
|
-
[searchable, state.collection, search, contains]
|
11190
|
-
);
|
11191
|
-
const focusOnSearchInput = useCallback2(() => {
|
11192
|
-
searchInputRef.current?.focus();
|
11193
|
-
}, []);
|
11194
|
-
const focusOnBaseList = useCallback2(() => {
|
11195
|
-
baseListRef.current?.focus();
|
11196
|
-
}, []);
|
11197
|
-
React69.useEffect(() => {
|
11198
|
-
if (searchable) {
|
11199
|
-
requestAnimationFrame(focusOnSearchInput);
|
11200
|
-
}
|
11201
|
-
}, [searchable, focusOnSearchInput]);
|
11202
|
-
const onSearchInputKeyDown = useCallback2(
|
11203
|
-
(event) => {
|
11204
|
-
if (event.code === "ArrowDown") {
|
11205
|
-
focusOnBaseList();
|
11206
|
-
}
|
11207
|
-
},
|
11208
|
-
[focusOnBaseList]
|
11209
|
-
);
|
11210
|
-
const onMenuItemsKeyDown = useCallback2(
|
11211
|
-
(event) => {
|
11212
|
-
if (!searchable) {
|
11213
|
-
return;
|
11214
|
-
}
|
11215
|
-
if (
|
11216
|
-
// This means the user just pressed shift without other buttons, so they weren't typing a letter/number/symbol:
|
11217
|
-
event.shiftKey && event.code.startsWith("Shift") || // This means the user just pressed alt/option without other buttons, so they weren't typing a letter/number/symbol:
|
11218
|
-
event.altKey && event.code.startsWith("Alt") || // Any control/meta keys we don't care about:
|
11219
|
-
event.ctrlKey || event.metaKey || // All of these should retain the default dropdown behaviors:
|
11220
|
-
[
|
11221
|
-
"ArrowUp",
|
11222
|
-
"ArrowDown",
|
11223
|
-
"ArrowLeft",
|
11224
|
-
"ArrowRight",
|
11225
|
-
"PageUp",
|
11226
|
-
"PageDown",
|
11227
|
-
"Home",
|
11228
|
-
"End",
|
11229
|
-
"Tab",
|
11230
|
-
"Enter",
|
11231
|
-
"Space"
|
11232
|
-
].includes(event.code)
|
11233
|
-
) {
|
11234
|
-
return;
|
11235
|
-
}
|
11236
|
-
focusOnSearchInput();
|
11237
|
-
},
|
11238
|
-
[searchable, focusOnSearchInput]
|
11239
|
-
);
|
11240
|
-
return /* @__PURE__ */ React69.createElement(DropdownMenu, { minWidth, maxWidth, minHeight, maxHeight }, header, /* @__PURE__ */ React69.createElement(DropdownMenu.ContentContainer, null, searchable && /* @__PURE__ */ React69.createElement(
|
11241
|
-
SearchInput,
|
11156
|
+
const childrenWithIds = React71.Children.map(children, mapKeyToId);
|
11157
|
+
const baseContent = /* @__PURE__ */ React71.createElement(
|
11158
|
+
DropdownMenu,
|
11242
11159
|
{
|
11243
|
-
|
11244
|
-
|
11245
|
-
|
11246
|
-
|
11247
|
-
|
11248
|
-
|
11249
|
-
|
11250
|
-
), filteredCollection.size === 0 && emptyState && /* @__PURE__ */ React69.createElement(DropdownMenu.EmptyStateContainer, null, emptyState), /* @__PURE__ */ React69.createElement("div", { onKeyDown: onMenuItemsKeyDown }, /* @__PURE__ */ React69.createElement(DropdownMenu.List, { ref: baseListRef, ...menuProps }, Array.from(filteredCollection).map((item) => {
|
11251
|
-
if (isSectionNode(item)) {
|
11252
|
-
return /* @__PURE__ */ React69.createElement(SectionWrapper, { key: item.key, section: item, state });
|
11253
|
-
} else if (isItemNode(item)) {
|
11254
|
-
return /* @__PURE__ */ React69.createElement(ItemWrapper, { key: item.key, item, state });
|
11255
|
-
}
|
11256
|
-
})))), footer);
|
11257
|
-
};
|
11258
|
-
var ItemWrapper = ({ item, state }) => {
|
11259
|
-
const ref = React69.useRef(null);
|
11260
|
-
const { menuItemProps, descriptionProps, isSelected, isFocused, isDisabled } = useMenuItem(
|
11261
|
-
{ key: item.key, closeOnSelect: item.props.closeOnSelect, ["aria-label"]: item["aria-label"] },
|
11262
|
-
state,
|
11263
|
-
ref
|
11160
|
+
onAction: props.onAction,
|
11161
|
+
onSelectionChange: props.onSelectionChange,
|
11162
|
+
selectedKeys: props.selection,
|
11163
|
+
selectionMode: props.selectionMode,
|
11164
|
+
renderEmptyState: () => /* @__PURE__ */ React71.createElement(DropdownMenu.EmptyStateContainer, null, props.emptyState)
|
11165
|
+
},
|
11166
|
+
childrenWithIds
|
11264
11167
|
);
|
11265
|
-
|
11266
|
-
|
11267
|
-
DropdownMenu.Item,
|
11168
|
+
return /* @__PURE__ */ React71.createElement(Popover, { placement: props.placement }, /* @__PURE__ */ React71.createElement(
|
11169
|
+
DropdownMenu.MenuContainer,
|
11268
11170
|
{
|
11269
|
-
|
11270
|
-
|
11271
|
-
|
11272
|
-
|
11273
|
-
highlighted: isFocused,
|
11274
|
-
disabled: isDisabled,
|
11275
|
-
icon,
|
11276
|
-
showNotification
|
11171
|
+
minHeight: props.minHeight,
|
11172
|
+
maxHeight: props.maxHeight,
|
11173
|
+
minWidth: props.minWidth,
|
11174
|
+
maxWidth: props.maxWidth
|
11277
11175
|
},
|
11278
|
-
|
11279
|
-
|
11280
|
-
|
11176
|
+
props.header,
|
11177
|
+
/* @__PURE__ */ React71.createElement(DropdownMenu.ScrollableContentContainer, null, props.searchable && /* @__PURE__ */ React71.createElement(AriaAutocomplete, { filter: contains }, /* @__PURE__ */ React71.createElement(SearchField, { "aria-label": "Search menu items", className: "mb-5" }), baseContent), !props.searchable && baseContent),
|
11178
|
+
props.footer
|
11179
|
+
));
|
11281
11180
|
};
|
11282
|
-
|
11283
|
-
|
11284
|
-
|
11285
|
-
|
11286
|
-
});
|
11287
|
-
const { separatorProps } = useSeparator({
|
11288
|
-
elementType: "li"
|
11289
|
-
});
|
11290
|
-
return /* @__PURE__ */ React69.createElement(React69.Fragment, null, section.key !== state.collection.getFirstKey() && /* @__PURE__ */ React69.createElement(DropdownMenu.Separator, { ...separatorProps }), /* @__PURE__ */ React69.createElement(DropdownMenu.Group, { title: section.rendered, titleProps: headingProps, ...itemProps }, /* @__PURE__ */ React69.createElement("ul", { ...groupProps }, Array.from(section.childNodes).map((node) => /* @__PURE__ */ React69.createElement(ItemWrapper, { key: node.key, item: node, state })))));
|
11181
|
+
DropdownMenu2.Items = MenuItems;
|
11182
|
+
DropdownMenu2.Items.displayName = "DropdownMenu.Items";
|
11183
|
+
var MenuItem = (props) => {
|
11184
|
+
const textValue = props.textValue || (typeof props.children === "string" ? props.children : void 0);
|
11185
|
+
return /* @__PURE__ */ React71.createElement(DropdownMenu.Item, { textValue, ...props });
|
11291
11186
|
};
|
11292
|
-
|
11293
|
-
|
11294
|
-
|
11295
|
-
|
11296
|
-
}
|
11297
|
-
return [trigger, items];
|
11187
|
+
DropdownMenu2.Item = MenuItem;
|
11188
|
+
DropdownMenu2.Item.displayName = "DropdownMenu.Item";
|
11189
|
+
var MenuSection = ({ children, ...props }) => {
|
11190
|
+
const childrenWithIds = React71.Children.map(children, mapKeyToId);
|
11191
|
+
return /* @__PURE__ */ React71.createElement(DropdownMenu.Group, { ...props }, childrenWithIds);
|
11298
11192
|
};
|
11299
|
-
|
11300
|
-
|
11301
|
-
|
11302
|
-
|
11303
|
-
|
11304
|
-
|
11305
|
-
|
11306
|
-
}
|
11307
|
-
|
11308
|
-
|
11309
|
-
}
|
11310
|
-
return null;
|
11311
|
-
});
|
11312
|
-
return (keys ?? []).flat().filter((key) => key !== null);
|
11193
|
+
DropdownMenu2.Section = MenuSection;
|
11194
|
+
DropdownMenu2.Section.displayName = "DropdownMenu.Section";
|
11195
|
+
var mapKeyToId = (child) => {
|
11196
|
+
if (typeof child === "boolean" || child === null || child === void 0) {
|
11197
|
+
return child;
|
11198
|
+
}
|
11199
|
+
if (isComponentType(child, MenuItem)) {
|
11200
|
+
return React71.cloneElement(child, { id: child.props.id ?? child.key ?? void 0 });
|
11201
|
+
}
|
11202
|
+
return child;
|
11313
11203
|
};
|
11314
11204
|
|
11315
11205
|
// src/utils/object.ts
|
@@ -11335,14 +11225,14 @@ var DataListRowMenu = ({
|
|
11335
11225
|
return null;
|
11336
11226
|
}
|
11337
11227
|
const menuContent = isFunction(menu) ? menu(row, index) : menu;
|
11338
|
-
return /* @__PURE__ */
|
11228
|
+
return /* @__PURE__ */ React72.createElement(DataList.Cell, { align: "right" }, menuContent && /* @__PURE__ */ React72.createElement(
|
11339
11229
|
DropdownMenu2,
|
11340
11230
|
{
|
11341
11231
|
placement: defaultContextualMenuPlacement,
|
11342
11232
|
onAction: (action) => onAction?.(action, row, index),
|
11343
11233
|
onOpenChange: onMenuOpenChange
|
11344
11234
|
},
|
11345
|
-
/* @__PURE__ */
|
11235
|
+
/* @__PURE__ */ React72.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ React72.createElement(Button2.Icon, { "aria-label": menuAriaLabel, icon: import_more2.default })),
|
11346
11236
|
menuContent
|
11347
11237
|
));
|
11348
11238
|
};
|
@@ -11371,7 +11261,7 @@ var DataListRow = ({
|
|
11371
11261
|
...resolvedAdditionalRowProps.style ?? {},
|
11372
11262
|
cursor: isRowClickable ? "pointer" : void 0
|
11373
11263
|
};
|
11374
|
-
return /* @__PURE__ */
|
11264
|
+
return /* @__PURE__ */ React72.createElement(
|
11375
11265
|
DataList.Row,
|
11376
11266
|
{
|
11377
11267
|
key: row.id,
|
@@ -11383,12 +11273,12 @@ var DataListRow = ({
|
|
11383
11273
|
onClick: isRowClickable ? onClick : void 0
|
11384
11274
|
},
|
11385
11275
|
renderFirstColumn?.(row, index, rows),
|
11386
|
-
/* @__PURE__ */
|
11276
|
+
/* @__PURE__ */ React72.createElement(
|
11387
11277
|
List,
|
11388
11278
|
{
|
11389
11279
|
items: columns,
|
11390
11280
|
renderItem: (column, columnIndex) => {
|
11391
|
-
const cell2 = /* @__PURE__ */
|
11281
|
+
const cell2 = /* @__PURE__ */ React72.createElement(
|
11392
11282
|
DataList.Cell,
|
11393
11283
|
{
|
11394
11284
|
key: column.key ?? column.headerName,
|
@@ -11396,7 +11286,7 @@ var DataListRow = ({
|
|
11396
11286
|
...additionalColumnProps(column, columnIndex, columns, row),
|
11397
11287
|
className: rowClassName?.(row, index, rows)
|
11398
11288
|
},
|
11399
|
-
/* @__PURE__ */
|
11289
|
+
/* @__PURE__ */ React72.createElement(DataListCell, { column, row, index, rows })
|
11400
11290
|
);
|
11401
11291
|
return createAnimatedCell({
|
11402
11292
|
cellElement: cell2,
|
@@ -11422,14 +11312,14 @@ var DataListCell = ({
|
|
11422
11312
|
case "status": {
|
11423
11313
|
const status = column.status(row, index, rows);
|
11424
11314
|
if (status) {
|
11425
|
-
cellContent = /* @__PURE__ */
|
11315
|
+
cellContent = /* @__PURE__ */ React72.createElement(StatusChip, { dense: true, ...status });
|
11426
11316
|
}
|
11427
11317
|
break;
|
11428
11318
|
}
|
11429
11319
|
case "action": {
|
11430
11320
|
const action = renameProperty("text", "children", column.action(row, index, rows));
|
11431
11321
|
if (action) {
|
11432
|
-
cellContent = /* @__PURE__ */
|
11322
|
+
cellContent = /* @__PURE__ */ React72.createElement(
|
11433
11323
|
Button2.Secondary,
|
11434
11324
|
{
|
11435
11325
|
dense: true,
|
@@ -11450,7 +11340,7 @@ var DataListCell = ({
|
|
11450
11340
|
case "item": {
|
11451
11341
|
const item = column.item(row, index, rows);
|
11452
11342
|
if (item) {
|
11453
|
-
cellContent = /* @__PURE__ */
|
11343
|
+
cellContent = /* @__PURE__ */ React72.createElement(Item2, { ...item });
|
11454
11344
|
}
|
11455
11345
|
break;
|
11456
11346
|
}
|
@@ -11459,13 +11349,13 @@ var DataListCell = ({
|
|
11459
11349
|
if (!menuContent) {
|
11460
11350
|
cellContent = null;
|
11461
11351
|
} else {
|
11462
|
-
cellContent = /* @__PURE__ */
|
11352
|
+
cellContent = /* @__PURE__ */ React72.createElement(
|
11463
11353
|
DropdownMenu2,
|
11464
11354
|
{
|
11465
11355
|
placement: defaultContextualMenuPlacement,
|
11466
11356
|
onAction: (action) => column.onAction(action, row, index)
|
11467
11357
|
},
|
11468
|
-
/* @__PURE__ */
|
11358
|
+
/* @__PURE__ */ React72.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ React72.createElement(Button2.Icon, { "aria-label": "action", icon: import_more2.default })),
|
11469
11359
|
menuContent
|
11470
11360
|
);
|
11471
11361
|
}
|
@@ -11479,17 +11369,17 @@ var DataListCell = ({
|
|
11479
11369
|
}
|
11480
11370
|
break;
|
11481
11371
|
}
|
11482
|
-
return column.tooltip ? /* @__PURE__ */
|
11372
|
+
return column.tooltip ? /* @__PURE__ */ React72.createElement(Tooltip, { ...column.tooltip(row, index, rows) }, cellContent) : /* @__PURE__ */ React72.createElement(React72.Fragment, null, cellContent);
|
11483
11373
|
};
|
11484
11374
|
|
11485
11375
|
// src/molecules/DataList/DataListContext.tsx
|
11486
|
-
import { createContext as
|
11487
|
-
var DataListContext =
|
11376
|
+
import { createContext as createContext4, useContext as useContext7 } from "react";
|
11377
|
+
var DataListContext = createContext4({
|
11488
11378
|
rows: [],
|
11489
11379
|
selectedRows: void 0
|
11490
11380
|
});
|
11491
11381
|
var useDataListContext = () => {
|
11492
|
-
const ctx =
|
11382
|
+
const ctx = useContext7(DataListContext);
|
11493
11383
|
if (!ctx) {
|
11494
11384
|
throw new Error("DataListContext was used outside of provider.");
|
11495
11385
|
}
|
@@ -11497,8 +11387,8 @@ var useDataListContext = () => {
|
|
11497
11387
|
};
|
11498
11388
|
|
11499
11389
|
// src/molecules/DataList/DataListGroup.tsx
|
11500
|
-
import
|
11501
|
-
import { isFunction as isFunction2 } from "lodash-es";
|
11390
|
+
import React73 from "react";
|
11391
|
+
import { isFunction as isFunction2, noop } from "lodash-es";
|
11502
11392
|
var import_infoSign3 = __toESM(require_infoSign());
|
11503
11393
|
|
11504
11394
|
// src/molecules/DataList/utils.ts
|
@@ -11510,8 +11400,8 @@ var INDENTATION = 28;
|
|
11510
11400
|
var sortGroupKeys = (groupKeys) => [...groupKeys].sort((a) => a === "undefined" ? -1 : 1);
|
11511
11401
|
var getDefaultRowSelectionLabel = () => "Select row";
|
11512
11402
|
var getDefaultGroupCheckboxLabel = (key) => `Select ${key}`;
|
11513
|
-
var renderDefaultGroupName = (key) => /* @__PURE__ */
|
11514
|
-
var renderDefaultEmptyGroup = () => /* @__PURE__ */
|
11403
|
+
var renderDefaultGroupName = (key) => /* @__PURE__ */ React73.createElement(React73.Fragment, null, "Group: ", /* @__PURE__ */ React73.createElement("b", null, key));
|
11404
|
+
var renderDefaultEmptyGroup = () => /* @__PURE__ */ React73.createElement(DataList.EmptyGroup, { icon: import_infoSign3.default }, "This group is empty");
|
11515
11405
|
var DataListGroup = ({
|
11516
11406
|
groups,
|
11517
11407
|
groupKey,
|
@@ -11549,15 +11439,15 @@ var DataListGroup = ({
|
|
11549
11439
|
if (!emptyGroupContent) {
|
11550
11440
|
return null;
|
11551
11441
|
}
|
11552
|
-
return /* @__PURE__ */
|
11442
|
+
return /* @__PURE__ */ React73.createElement(DataList.Row, { noDivider: isLastGroup }, selectable && /* @__PURE__ */ React73.createElement(DataList.Cell, null), /* @__PURE__ */ React73.createElement(
|
11553
11443
|
DataList.Cell,
|
11554
11444
|
{
|
11555
11445
|
style: { paddingLeft: `${2 + GAP + level * INDENTATION}px`, gridColumn: `${selectable ? 2 : 1} / -1` }
|
11556
11446
|
},
|
11557
|
-
/* @__PURE__ */
|
11447
|
+
/* @__PURE__ */ React73.createElement(Typography, { variant: "small", color: "muted" }, emptyGroupContent)
|
11558
11448
|
));
|
11559
11449
|
}
|
11560
|
-
return /* @__PURE__ */
|
11450
|
+
return /* @__PURE__ */ React73.createElement(
|
11561
11451
|
List,
|
11562
11452
|
{
|
11563
11453
|
items: groups,
|
@@ -11566,7 +11456,7 @@ var DataListGroup = ({
|
|
11566
11456
|
const isDisabled = disabled?.(row, index, rows);
|
11567
11457
|
const isSelectionDisabled = selectionDisabled(row, index, rows);
|
11568
11458
|
const isLastRow = isLastGroup && index === groups.length - 1;
|
11569
|
-
return /* @__PURE__ */
|
11459
|
+
return /* @__PURE__ */ React73.createElement(
|
11570
11460
|
DataListRow,
|
11571
11461
|
{
|
11572
11462
|
key: row.id,
|
@@ -11576,7 +11466,7 @@ var DataListGroup = ({
|
|
11576
11466
|
isLast: isLastRow,
|
11577
11467
|
rows,
|
11578
11468
|
active: selectable && isSelected,
|
11579
|
-
menu: /* @__PURE__ */
|
11469
|
+
menu: /* @__PURE__ */ React73.createElement(
|
11580
11470
|
DataListRowMenu,
|
11581
11471
|
{
|
11582
11472
|
row,
|
@@ -11599,16 +11489,16 @@ var DataListGroup = ({
|
|
11599
11489
|
}
|
11600
11490
|
} : {},
|
11601
11491
|
renderFirstColumn: (row2, index2) => {
|
11602
|
-
return /* @__PURE__ */
|
11492
|
+
return /* @__PURE__ */ React73.createElement(React73.Fragment, null, selectable && /* @__PURE__ */ React73.createElement(DataList.Cell, null, selectable === "single" && /* @__PURE__ */ React73.createElement(
|
11603
11493
|
RadioButton,
|
11604
11494
|
{
|
11605
11495
|
value: row2.id.toString(),
|
11606
11496
|
"aria-label": getRowSelectionLabel(row2, index2, isSelected, rows),
|
11607
|
-
onChange:
|
11497
|
+
onChange: noop,
|
11608
11498
|
checked: isSelected,
|
11609
11499
|
disabled: isDisabled || isSelectionDisabled
|
11610
11500
|
}
|
11611
|
-
), isMultiSelectionMode && /* @__PURE__ */
|
11501
|
+
), isMultiSelectionMode && /* @__PURE__ */ React73.createElement(
|
11612
11502
|
Checkbox,
|
11613
11503
|
{
|
11614
11504
|
"aria-label": getRowSelectionLabel(row2, index2, isSelected, rows),
|
@@ -11628,14 +11518,14 @@ var DataListGroup = ({
|
|
11628
11518
|
if (!groupKeys) {
|
11629
11519
|
return null;
|
11630
11520
|
}
|
11631
|
-
return /* @__PURE__ */
|
11521
|
+
return /* @__PURE__ */ React73.createElement(
|
11632
11522
|
List,
|
11633
11523
|
{
|
11634
11524
|
items: sortGroupKeys(groupKeys),
|
11635
11525
|
renderItem: (key, index) => {
|
11636
11526
|
const group = groups[key];
|
11637
11527
|
if (key === "undefined" || key === void 0) {
|
11638
|
-
return /* @__PURE__ */
|
11528
|
+
return /* @__PURE__ */ React73.createElement(
|
11639
11529
|
DataListGroup,
|
11640
11530
|
{
|
11641
11531
|
key: "undefined",
|
@@ -11654,7 +11544,7 @@ var DataListGroup = ({
|
|
11654
11544
|
const isChecked = nestedSelectedIds.length > 0;
|
11655
11545
|
const isActiveRow = !!openPanelId || selectable && isChecked;
|
11656
11546
|
const isLastRow = isLastGroup && index === groupKeys.length - 1 && !openPanelId;
|
11657
|
-
return /* @__PURE__ */
|
11547
|
+
return /* @__PURE__ */ React73.createElement(Accordion, { key, openPanelId }, hasCustomRowForGroup && /* @__PURE__ */ React73.createElement(DataList.Row, { active: isActiveRow, noDivider: isLastRow }, selectable && /* @__PURE__ */ React73.createElement(DataList.Cell, null, isMultiSelectionMode && /* @__PURE__ */ React73.createElement(
|
11658
11548
|
Checkbox,
|
11659
11549
|
{
|
11660
11550
|
"aria-label": getGroupCheckboxLabel(key, group, index, isChecked, rows),
|
@@ -11663,11 +11553,11 @@ var DataListGroup = ({
|
|
11663
11553
|
disabled: group.length === 0,
|
11664
11554
|
onChange: getOnSelectionChangeForId(nestedRowIds)
|
11665
11555
|
}
|
11666
|
-
)), /* @__PURE__ */
|
11556
|
+
)), /* @__PURE__ */ React73.createElement(
|
11667
11557
|
List,
|
11668
11558
|
{
|
11669
11559
|
items: columns,
|
11670
|
-
renderItem: (column, idx) => /* @__PURE__ */
|
11560
|
+
renderItem: (column, idx) => /* @__PURE__ */ React73.createElement(
|
11671
11561
|
DataList.Cell,
|
11672
11562
|
{
|
11673
11563
|
key: column.key ?? column.headerName,
|
@@ -11675,11 +11565,11 @@ var DataListGroup = ({
|
|
11675
11565
|
className: tw("gap-3"),
|
11676
11566
|
style: idx === 0 ? { paddingLeft: `${GAP + level * INDENTATION}px` } : void 0
|
11677
11567
|
},
|
11678
|
-
idx === 0 && /* @__PURE__ */
|
11679
|
-
/* @__PURE__ */
|
11568
|
+
idx === 0 && /* @__PURE__ */ React73.createElement(Accordion.Toggle, { panelId: key, onChange: onGroupToggled }),
|
11569
|
+
/* @__PURE__ */ React73.createElement(DataListCell, { column, row: getGroupRow(key, group), index: -1, rows: [] })
|
11680
11570
|
)
|
11681
11571
|
}
|
11682
|
-
), /* @__PURE__ */
|
11572
|
+
), /* @__PURE__ */ React73.createElement(
|
11683
11573
|
DataListRowMenu,
|
11684
11574
|
{
|
11685
11575
|
row: getGroupRow(key, group),
|
@@ -11689,7 +11579,7 @@ var DataListGroup = ({
|
|
11689
11579
|
onMenuOpenChange,
|
11690
11580
|
menuAriaLabel
|
11691
11581
|
}
|
11692
|
-
)), !hasCustomRowForGroup && /* @__PURE__ */
|
11582
|
+
)), !hasCustomRowForGroup && /* @__PURE__ */ React73.createElement(DataList.Row, { active: isActiveRow, noDivider: isLastRow }, isMultiSelectionMode && /* @__PURE__ */ React73.createElement(DataList.Cell, null, /* @__PURE__ */ React73.createElement(
|
11693
11583
|
Checkbox,
|
11694
11584
|
{
|
11695
11585
|
"aria-label": getGroupCheckboxLabel(key, group, index, isChecked, rows),
|
@@ -11698,15 +11588,15 @@ var DataListGroup = ({
|
|
11698
11588
|
disabled: group.length === 0,
|
11699
11589
|
onChange: getOnSelectionChangeForId(nestedRowIds)
|
11700
11590
|
}
|
11701
|
-
)), /* @__PURE__ */
|
11591
|
+
)), /* @__PURE__ */ React73.createElement(
|
11702
11592
|
DataList.Cell,
|
11703
11593
|
{
|
11704
11594
|
className: tw("gap-3"),
|
11705
11595
|
style: { paddingLeft: `${GAP + level * INDENTATION}px`, gridColumn: `${selectable ? 2 : 1} / -1` }
|
11706
11596
|
},
|
11707
|
-
/* @__PURE__ */
|
11597
|
+
/* @__PURE__ */ React73.createElement(Accordion.Toggle, { panelId: key, onChange: onGroupToggled }),
|
11708
11598
|
renderGroupName(key, group)
|
11709
|
-
)), /* @__PURE__ */
|
11599
|
+
)), /* @__PURE__ */ React73.createElement(Accordion.UnanimatedPanel, { panelId: key }, /* @__PURE__ */ React73.createElement(DataList.Row, { isGroup: true }, /* @__PURE__ */ React73.createElement(
|
11710
11600
|
DataListGroup,
|
11711
11601
|
{
|
11712
11602
|
key,
|
@@ -11723,18 +11613,18 @@ var DataListGroup = ({
|
|
11723
11613
|
};
|
11724
11614
|
|
11725
11615
|
// src/molecules/DataList/DataListSkeleton.tsx
|
11726
|
-
import
|
11616
|
+
import React74 from "react";
|
11727
11617
|
var DataListSkeleton = ({ columns = ["1", "2", "2", 52], rows = 5 }) => {
|
11728
11618
|
const columnsAmount = [...Array(typeof columns === "number" ? columns : columns.length).keys()];
|
11729
|
-
return /* @__PURE__ */
|
11619
|
+
return /* @__PURE__ */ React74.createElement(Template, { role: "table", columns }, /* @__PURE__ */ React74.createElement(DataList.Row, null, columnsAmount.map((_, index) => /* @__PURE__ */ React74.createElement(DataList.HeadCell, { key: index }, /* @__PURE__ */ React74.createElement(Skeleton, { width: "100%", height: 17.5 })))), /* @__PURE__ */ React74.createElement(
|
11730
11620
|
List,
|
11731
11621
|
{
|
11732
11622
|
items: [...Array(rows).keys()],
|
11733
|
-
renderItem: (item, index) => /* @__PURE__ */
|
11623
|
+
renderItem: (item, index) => /* @__PURE__ */ React74.createElement(DataList.Row, { key: item, noDivider: index === rows - 1 }, /* @__PURE__ */ React74.createElement(
|
11734
11624
|
List,
|
11735
11625
|
{
|
11736
11626
|
items: columnsAmount,
|
11737
|
-
renderItem: (key) => /* @__PURE__ */
|
11627
|
+
renderItem: (key) => /* @__PURE__ */ React74.createElement(DataList.Cell, { key }, /* @__PURE__ */ React74.createElement(Skeleton, { width: "100%", height: 17.5 }))
|
11738
11628
|
}
|
11739
11629
|
))
|
11740
11630
|
}
|
@@ -11742,7 +11632,7 @@ var DataListSkeleton = ({ columns = ["1", "2", "2", 52], rows = 5 }) => {
|
|
11742
11632
|
};
|
11743
11633
|
|
11744
11634
|
// src/molecules/DataList/DataListToolbar.tsx
|
11745
|
-
import
|
11635
|
+
import React75 from "react";
|
11746
11636
|
import { castArray } from "lodash-es";
|
11747
11637
|
var DataListToolbar = ({
|
11748
11638
|
actions: _actions,
|
@@ -11754,20 +11644,20 @@ var DataListToolbar = ({
|
|
11754
11644
|
}) => {
|
11755
11645
|
const { selectedRows } = useDataListContext();
|
11756
11646
|
const actions = castArray(_actions).filter(Boolean);
|
11757
|
-
return /* @__PURE__ */
|
11647
|
+
return /* @__PURE__ */ React75.createElement(DataList.Toolbar.Container, { sticky }, /* @__PURE__ */ React75.createElement(DataList.Toolbar.Group, null, /* @__PURE__ */ React75.createElement(DataList.Toolbar.SelectionCount, null, selectedRows?.length ?? 0, " selected")), actions.length > 0 && /* @__PURE__ */ React75.createElement(DataList.Toolbar.Group, null, /* @__PURE__ */ React75.createElement(DataList.Toolbar.Actions, null, actions.map(
|
11758
11648
|
(action) => renderAction({
|
11759
11649
|
kind: "ghost",
|
11760
11650
|
dense: true,
|
11761
11651
|
action: { ...action, onClick: () => action.onClick(selectedRows ?? []) }
|
11762
11652
|
})
|
11763
|
-
))), menu && /* @__PURE__ */
|
11653
|
+
))), menu && /* @__PURE__ */ React75.createElement(DataList.Toolbar.Group, null, /* @__PURE__ */ React75.createElement(
|
11764
11654
|
DropdownMenu2,
|
11765
11655
|
{
|
11766
11656
|
placement: defaultContextualMenuPlacement,
|
11767
11657
|
onAction: (key) => onAction(key, selectedRows ?? []),
|
11768
11658
|
onOpenChange: onMenuOpenChange
|
11769
11659
|
},
|
11770
|
-
/* @__PURE__ */
|
11660
|
+
/* @__PURE__ */ React75.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ React75.createElement(Button2.Dropdown, { kind: "ghost", dense: true }, menuLabel)),
|
11771
11661
|
menu
|
11772
11662
|
)));
|
11773
11663
|
};
|
@@ -11834,8 +11724,8 @@ var DataList2 = ({
|
|
11834
11724
|
...columns.map((column) => column.width ?? "auto"),
|
11835
11725
|
menu ? "fit-content(28px)" : void 0
|
11836
11726
|
]);
|
11837
|
-
const PaginationFooter =
|
11838
|
-
({ children }) => /* @__PURE__ */
|
11727
|
+
const PaginationFooter = React76.useCallback(
|
11728
|
+
({ children }) => /* @__PURE__ */ React76.createElement("div", { style: { gridColumn: "1 / -1" }, role: "row" }, /* @__PURE__ */ React76.createElement("div", { role: "cell" }, children)),
|
11839
11729
|
[]
|
11840
11730
|
);
|
11841
11731
|
const getOnSelectionChangeForId = (id) => (e) => {
|
@@ -11857,7 +11747,7 @@ var DataList2 = ({
|
|
11857
11747
|
)
|
11858
11748
|
);
|
11859
11749
|
const allRowsSelected = totalSelected >= allEnabledRowIds.length;
|
11860
|
-
const componentContent = /* @__PURE__ */
|
11750
|
+
const componentContent = /* @__PURE__ */ React76.createElement(Template, { className: "Aquarium-DataList", columns: templateColumns, role: "table" }, !hideHeader && /* @__PURE__ */ React76.createElement(React76.Fragment, null, /* @__PURE__ */ React76.createElement(DataList.Row, { header: true }, selectable && /* @__PURE__ */ React76.createElement(DataList.HeadCell, { align: "left", sticky }, selectable === "multiple" && /* @__PURE__ */ React76.createElement(
|
11861
11751
|
Checkbox,
|
11862
11752
|
{
|
11863
11753
|
"aria-label": "Select all rows",
|
@@ -11871,10 +11761,10 @@ var DataList2 = ({
|
|
11871
11761
|
}
|
11872
11762
|
}
|
11873
11763
|
}
|
11874
|
-
)), isCollapsible && /* @__PURE__ */
|
11875
|
-
const content = column.headerTooltip ? /* @__PURE__ */
|
11876
|
-
const headerContentAndIcon = column.icon ? /* @__PURE__ */
|
11877
|
-
const cell2 = columnHasSort(column) ? /* @__PURE__ */
|
11764
|
+
)), isCollapsible && /* @__PURE__ */ React76.createElement(DataList.HeadCell, { align: "left", sticky }), columns.map((column) => {
|
11765
|
+
const content = column.headerTooltip ? /* @__PURE__ */ React76.createElement(Tooltip, { placement: column.headerTooltip.placement, content: column.headerTooltip.content }, column.headerName) : column.headerName;
|
11766
|
+
const headerContentAndIcon = column.icon ? /* @__PURE__ */ React76.createElement(Box.Flex, { flexDirection: "row", gap: "3", alignItems: "center" }, /* @__PURE__ */ React76.createElement(InlineIcon, { icon: column.icon, height: "22", color: "muted", "aria-hidden": true }), content) : content;
|
11767
|
+
const cell2 = columnHasSort(column) ? /* @__PURE__ */ React76.createElement(
|
11878
11768
|
DataList.SortCell,
|
11879
11769
|
{
|
11880
11770
|
direction: sort && sort.column.headerName === column.headerName ? sort.direction : "none",
|
@@ -11884,13 +11774,13 @@ var DataList2 = ({
|
|
11884
11774
|
...cellProps(column)
|
11885
11775
|
},
|
11886
11776
|
headerContentAndIcon
|
11887
|
-
) : /* @__PURE__ */
|
11777
|
+
) : /* @__PURE__ */ React76.createElement(DataList.HeadCell, { key: column.key ?? column.headerName, ...cellProps(column), sticky }, headerContentAndIcon);
|
11888
11778
|
return createAnimatedCell({
|
11889
11779
|
cellElement: cell2,
|
11890
11780
|
stickyStyles,
|
11891
11781
|
stickyColumn: cellProps(column).stickyColumn
|
11892
11782
|
});
|
11893
|
-
}), menu && /* @__PURE__ */
|
11783
|
+
}), menu && /* @__PURE__ */ React76.createElement(DataList.HeadCell, { align: "right", "aria-label": menuAriaLabel, sticky }, menuHeaderName)), toolbar), groups && /* @__PURE__ */ React76.createElement(
|
11894
11784
|
DataListGroup,
|
11895
11785
|
{
|
11896
11786
|
columns,
|
@@ -11917,7 +11807,7 @@ var DataList2 = ({
|
|
11917
11807
|
level: 0,
|
11918
11808
|
isLastGroup: true
|
11919
11809
|
}
|
11920
|
-
), !groups && /* @__PURE__ */
|
11810
|
+
), !groups && /* @__PURE__ */ React76.createElement(
|
11921
11811
|
List,
|
11922
11812
|
{
|
11923
11813
|
...rest,
|
@@ -11930,7 +11820,7 @@ var DataList2 = ({
|
|
11930
11820
|
const isDisabled = disabled?.(row, index, sortedRows);
|
11931
11821
|
const openPanelId = expandedGroupIds.find((id) => id === row.id.toString()) || null;
|
11932
11822
|
const isLastRow = index === sortedRows.length - 1;
|
11933
|
-
const content = /* @__PURE__ */
|
11823
|
+
const content = /* @__PURE__ */ React76.createElement(
|
11934
11824
|
DataListRow,
|
11935
11825
|
{
|
11936
11826
|
key: row.id,
|
@@ -11941,7 +11831,7 @@ var DataList2 = ({
|
|
11941
11831
|
active: selectable && isSelected,
|
11942
11832
|
isLast: isLastRow && !openPanelId,
|
11943
11833
|
stickyStyles,
|
11944
|
-
menu: /* @__PURE__ */
|
11834
|
+
menu: /* @__PURE__ */ React76.createElement(
|
11945
11835
|
DataListRowMenu,
|
11946
11836
|
{
|
11947
11837
|
row,
|
@@ -11959,16 +11849,16 @@ var DataList2 = ({
|
|
11959
11849
|
"aria-selected": selected?.includes(row2.id) ?? false
|
11960
11850
|
} : {},
|
11961
11851
|
renderFirstColumn: (row2, index2) => {
|
11962
|
-
return /* @__PURE__ */
|
11852
|
+
return /* @__PURE__ */ React76.createElement(React76.Fragment, null, selectable && /* @__PURE__ */ React76.createElement(DataList.Cell, null, selectable === "single" && /* @__PURE__ */ React76.createElement(
|
11963
11853
|
RadioButton,
|
11964
11854
|
{
|
11965
11855
|
value: row2.id.toString(),
|
11966
11856
|
"aria-label": getRowSelectionLabel(row2, index2, isSelected, sortedRows),
|
11967
|
-
onChange:
|
11857
|
+
onChange: noop2,
|
11968
11858
|
checked: isSelected,
|
11969
11859
|
disabled: isDisabled || isSelectionDisabled
|
11970
11860
|
}
|
11971
|
-
), isMultiSelectionMode && /* @__PURE__ */
|
11861
|
+
), isMultiSelectionMode && /* @__PURE__ */ React76.createElement(
|
11972
11862
|
Checkbox,
|
11973
11863
|
{
|
11974
11864
|
"aria-label": getRowSelectionLabel(row2, index2, isSelected, sortedRows),
|
@@ -11976,7 +11866,7 @@ var DataList2 = ({
|
|
11976
11866
|
checked: isSelected,
|
11977
11867
|
disabled: isDisabled || isSelectionDisabled
|
11978
11868
|
}
|
11979
|
-
)), rowDetails !== void 0 && /* @__PURE__ */
|
11869
|
+
)), rowDetails !== void 0 && /* @__PURE__ */ React76.createElement(DataList.Cell, null, details && /* @__PURE__ */ React76.createElement(Accordion.Toggle, { panelId: row2.id.toString(), onChange: onGroupToggled })));
|
11980
11870
|
},
|
11981
11871
|
onClick: selectable === "single" ? getOnSelectionChangeForId(row.id) : void 0
|
11982
11872
|
}
|
@@ -11984,7 +11874,7 @@ var DataList2 = ({
|
|
11984
11874
|
if (!details) {
|
11985
11875
|
return content;
|
11986
11876
|
}
|
11987
|
-
return /* @__PURE__ */
|
11877
|
+
return /* @__PURE__ */ React76.createElement(Accordion, { key: row.id, openPanelId }, content, /* @__PURE__ */ React76.createElement(
|
11988
11878
|
Accordion.Panel,
|
11989
11879
|
{
|
11990
11880
|
role: "row",
|
@@ -11995,13 +11885,13 @@ var DataList2 = ({
|
|
11995
11885
|
}),
|
11996
11886
|
"aria-label": `row ${row.id.toString()} details`
|
11997
11887
|
},
|
11998
|
-
/* @__PURE__ */
|
11888
|
+
/* @__PURE__ */ React76.createElement("div", { role: "cell" }, details)
|
11999
11889
|
));
|
12000
11890
|
}
|
12001
11891
|
}
|
12002
11892
|
));
|
12003
|
-
const wrappedContent = hasStickyColumns ? /* @__PURE__ */
|
12004
|
-
return /* @__PURE__ */
|
11893
|
+
const wrappedContent = hasStickyColumns ? /* @__PURE__ */ React76.createElement("div", { className: "relative w-full h-full overflow-auto", ref: containerRef }, componentContent) : componentContent;
|
11894
|
+
return /* @__PURE__ */ React76.createElement(
|
12005
11895
|
DataListContext.Provider,
|
12006
11896
|
{
|
12007
11897
|
value: {
|
@@ -12016,18 +11906,18 @@ DataList2.Skeleton = DataListSkeleton;
|
|
12016
11906
|
DataList2.Toolbar = DataListToolbar;
|
12017
11907
|
|
12018
11908
|
// src/molecules/DataTable/DataTable.tsx
|
12019
|
-
import
|
11909
|
+
import React79, { useRef as useRef9 } from "react";
|
12020
11910
|
import classNames10 from "classnames";
|
12021
11911
|
import { compact as compact2, isFunction as isFunction4 } from "lodash-es";
|
12022
11912
|
|
12023
11913
|
// src/molecules/Table/Table.tsx
|
12024
|
-
import
|
11914
|
+
import React78 from "react";
|
12025
11915
|
|
12026
11916
|
// src/utils/table/useScrollTarget.ts
|
12027
|
-
import
|
11917
|
+
import React77 from "react";
|
12028
11918
|
var useScrollTarget = (callback) => {
|
12029
|
-
const targetRef =
|
12030
|
-
|
11919
|
+
const targetRef = React77.useRef(null);
|
11920
|
+
React77.useLayoutEffect(() => {
|
12031
11921
|
const observer = new IntersectionObserver((entries) => entries[0].isIntersecting && callback && callback(), {
|
12032
11922
|
root: null,
|
12033
11923
|
rootMargin: `0px 0px 200px 0px`
|
@@ -12044,7 +11934,7 @@ var useScrollTarget = (callback) => {
|
|
12044
11934
|
var Table2 = ({ children, onPrev, onNext, ...rest }) => {
|
12045
11935
|
const bottomRef = useScrollTarget(onNext);
|
12046
11936
|
const topRef = useScrollTarget(onPrev);
|
12047
|
-
return /* @__PURE__ */
|
11937
|
+
return /* @__PURE__ */ React78.createElement("div", { className: classNames("Aquarium-Table", tw("relative w-full")) }, /* @__PURE__ */ React78.createElement("div", { ref: topRef, className: tw("absolute top-0 h-1 w-full left-0 bg-transparent") }), /* @__PURE__ */ React78.createElement(Table, { ...rest }, children), /* @__PURE__ */ React78.createElement("div", { ref: bottomRef, className: tw("absolute bottom-0 h-1 w-full left-0 bg-transparent") }));
|
12048
11938
|
};
|
12049
11939
|
Table2.Head = Table.Head;
|
12050
11940
|
Table2.Body = Table.Body;
|
@@ -12084,11 +11974,11 @@ var DataTable = ({
|
|
12084
11974
|
const [sort, updateSort] = useTableSort({ ...initialSortState, onSortChanged });
|
12085
11975
|
const sortedRows = sortRowsBy(rows, sort);
|
12086
11976
|
const amountOfColumns = columns.length + (menu ? 1 : 0);
|
12087
|
-
const PaginationFooter =
|
12088
|
-
({ children }) => /* @__PURE__ */
|
11977
|
+
const PaginationFooter = React79.useCallback(
|
11978
|
+
({ children }) => /* @__PURE__ */ React79.createElement("tfoot", null, /* @__PURE__ */ React79.createElement("tr", null, /* @__PURE__ */ React79.createElement("td", { colSpan: amountOfColumns }, children))),
|
12089
11979
|
[amountOfColumns]
|
12090
11980
|
);
|
12091
|
-
const compponentContent = /* @__PURE__ */
|
11981
|
+
const compponentContent = /* @__PURE__ */ React79.createElement(
|
12092
11982
|
Table2,
|
12093
11983
|
{
|
12094
11984
|
ariaLabel,
|
@@ -12103,11 +11993,11 @@ var DataTable = ({
|
|
12103
11993
|
})
|
12104
11994
|
)
|
12105
11995
|
},
|
12106
|
-
/* @__PURE__ */
|
11996
|
+
/* @__PURE__ */ React79.createElement(Table2.Head, { sticky }, compact2([
|
12107
11997
|
...columns.map((column) => {
|
12108
|
-
const content = column.headerTooltip && !column.headerInvisible ? /* @__PURE__ */
|
12109
|
-
const headerContentAndIcon = !column.headerInvisible && column.icon ? /* @__PURE__ */
|
12110
|
-
const cell2 = columnHasSort(column) ? /* @__PURE__ */
|
11998
|
+
const content = column.headerTooltip && !column.headerInvisible ? /* @__PURE__ */ React79.createElement(Tooltip, { placement: column.headerTooltip.placement, content: column.headerTooltip.content }, column.headerName) : !column.headerInvisible && column.headerName;
|
11999
|
+
const headerContentAndIcon = !column.headerInvisible && column.icon ? /* @__PURE__ */ React79.createElement(Box.Flex, { flexDirection: "row", gap: "3", alignItems: "center" }, /* @__PURE__ */ React79.createElement(InlineIcon, { icon: column.icon, height: "22", color: "default", "aria-hidden": true }), content) : content;
|
12000
|
+
const cell2 = columnHasSort(column) ? /* @__PURE__ */ React79.createElement(
|
12111
12001
|
Table2.SortCell,
|
12112
12002
|
{
|
12113
12003
|
direction: sort && sort.column.headerName === column.headerName ? sort.direction : "none",
|
@@ -12118,7 +12008,7 @@ var DataTable = ({
|
|
12118
12008
|
...cellProps(column)
|
12119
12009
|
},
|
12120
12010
|
headerContentAndIcon
|
12121
|
-
) : /* @__PURE__ */
|
12011
|
+
) : /* @__PURE__ */ React79.createElement(
|
12122
12012
|
Table2.Cell,
|
12123
12013
|
{
|
12124
12014
|
key: column.key ?? column.headerName,
|
@@ -12134,9 +12024,9 @@ var DataTable = ({
|
|
12134
12024
|
stickyColumn: cellProps(column).stickyColumn
|
12135
12025
|
});
|
12136
12026
|
}),
|
12137
|
-
menu ? /* @__PURE__ */
|
12027
|
+
menu ? /* @__PURE__ */ React79.createElement(Table2.Cell, { key: "__contextMenu", align: "right", "aria-label": menuAriaLabel }, menuHeaderName) : null
|
12138
12028
|
])),
|
12139
|
-
/* @__PURE__ */
|
12029
|
+
/* @__PURE__ */ React79.createElement(
|
12140
12030
|
List,
|
12141
12031
|
{
|
12142
12032
|
container: Table2.Body,
|
@@ -12145,13 +12035,13 @@ var DataTable = ({
|
|
12145
12035
|
items: sortedRows,
|
12146
12036
|
renderItem: (row, index) => {
|
12147
12037
|
const isRowDisabled = disabled?.(row, index, sortedRows) ?? false;
|
12148
|
-
return /* @__PURE__ */
|
12038
|
+
return /* @__PURE__ */ React79.createElement(Table2.Row, { key: row.id, disabled: isRowDisabled }, /* @__PURE__ */ React79.createElement(
|
12149
12039
|
List,
|
12150
12040
|
{
|
12151
12041
|
items: columns,
|
12152
12042
|
renderItem: (column) => {
|
12153
12043
|
return createAnimatedCell({
|
12154
|
-
cellElement: /* @__PURE__ */
|
12044
|
+
cellElement: /* @__PURE__ */ React79.createElement(
|
12155
12045
|
Table2.Cell,
|
12156
12046
|
{
|
12157
12047
|
key: column.key ?? column.headerName,
|
@@ -12170,7 +12060,7 @@ var DataTable = ({
|
|
12170
12060
|
}
|
12171
12061
|
)
|
12172
12062
|
);
|
12173
|
-
return hasStickyColumns ? /* @__PURE__ */
|
12063
|
+
return hasStickyColumns ? /* @__PURE__ */ React79.createElement("div", { className: "relative w-full overflow-x-auto", ref: containerRef }, compponentContent) : compponentContent;
|
12174
12064
|
};
|
12175
12065
|
var renderRowMenu = (row, index, {
|
12176
12066
|
menu,
|
@@ -12180,14 +12070,14 @@ var renderRowMenu = (row, index, {
|
|
12180
12070
|
}) => {
|
12181
12071
|
if (menu) {
|
12182
12072
|
const menuContent = isFunction4(menu) ? menu(row, index) : menu;
|
12183
|
-
return /* @__PURE__ */
|
12073
|
+
return /* @__PURE__ */ React79.createElement(Table2.Cell, { align: "right" }, menuContent && /* @__PURE__ */ React79.createElement(
|
12184
12074
|
DropdownMenu2,
|
12185
12075
|
{
|
12186
12076
|
placement: defaultContextualMenuPlacement,
|
12187
12077
|
onAction: (action) => onAction?.(action, row, index),
|
12188
12078
|
onOpenChange: onMenuOpenChange
|
12189
12079
|
},
|
12190
|
-
/* @__PURE__ */
|
12080
|
+
/* @__PURE__ */ React79.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ React79.createElement(Button2.Icon, { "aria-label": menuAriaLabel, icon: import_more3.default })),
|
12191
12081
|
menuContent
|
12192
12082
|
));
|
12193
12083
|
}
|
@@ -12199,31 +12089,31 @@ var renderCell = (column, row, index, rows) => {
|
|
12199
12089
|
if (column.type === "status") {
|
12200
12090
|
const status = column.status(row, index, rows);
|
12201
12091
|
if (status) {
|
12202
|
-
cellContent = /* @__PURE__ */
|
12092
|
+
cellContent = /* @__PURE__ */ React79.createElement(StatusChip, { dense: true, ...status });
|
12203
12093
|
}
|
12204
12094
|
} else if (column.type === "action") {
|
12205
12095
|
const action = renameProperty("text", "children", column.action(row, index, rows));
|
12206
12096
|
if (action) {
|
12207
|
-
cellContent = /* @__PURE__ */
|
12097
|
+
cellContent = /* @__PURE__ */ React79.createElement(Button2.Secondary, { dense: true, ...action });
|
12208
12098
|
}
|
12209
12099
|
} else if (column.type === "custom") {
|
12210
12100
|
cellContent = column.UNSAFE_render(row, index, rows);
|
12211
12101
|
} else if (column.type === "item") {
|
12212
12102
|
const item = column.item(row, index, rows);
|
12213
12103
|
if (item) {
|
12214
|
-
cellContent = /* @__PURE__ */
|
12104
|
+
cellContent = /* @__PURE__ */ React79.createElement(Item2, { ...item });
|
12215
12105
|
}
|
12216
12106
|
} else if (column.formatter) {
|
12217
12107
|
cellContent = column.formatter(row[column.field], row, index, rows);
|
12218
12108
|
} else {
|
12219
12109
|
cellContent = row[column.field];
|
12220
12110
|
}
|
12221
|
-
return column.tooltip ? /* @__PURE__ */
|
12111
|
+
return column.tooltip ? /* @__PURE__ */ React79.createElement(Tooltip, { ...column.tooltip(row, index, rows) }, cellContent) : /* @__PURE__ */ React79.createElement(React79.Fragment, null, cellContent);
|
12222
12112
|
};
|
12223
12113
|
DataTable.Skeleton = DataListSkeleton;
|
12224
12114
|
|
12225
12115
|
// src/molecules/DatePicker/DatePicker.tsx
|
12226
|
-
import
|
12116
|
+
import React86 from "react";
|
12227
12117
|
import {
|
12228
12118
|
DatePicker as AriaDatePicker,
|
12229
12119
|
DatePickerStateContext,
|
@@ -12231,48 +12121,13 @@ import {
|
|
12231
12121
|
} from "react-aria-components";
|
12232
12122
|
import { useLabel as useLabel2 } from "@react-aria/label";
|
12233
12123
|
import { useId as useId10 } from "@react-aria/utils";
|
12234
|
-
import { omit as
|
12124
|
+
import { omit as omit8 } from "lodash-es";
|
12235
12125
|
|
12236
12126
|
// src/molecules/DateField/DateInput.tsx
|
12237
|
-
import
|
12127
|
+
import React80 from "react";
|
12238
12128
|
import { DateInput as AriaDateInput, DateSegment } from "react-aria-components";
|
12239
|
-
import { tv as
|
12240
|
-
|
12241
|
-
// src/atoms/utils/index.ts
|
12242
|
-
import { tv as tv6 } from "tailwind-variants";
|
12243
|
-
var focusRing = tv6({
|
12244
|
-
base: "outline outline-primary-default outline-offset-2",
|
12245
|
-
variants: {
|
12246
|
-
isFocusVisible: {
|
12247
|
-
false: "outline-0",
|
12248
|
-
true: "outline-2"
|
12249
|
-
}
|
12250
|
-
}
|
12251
|
-
});
|
12252
|
-
var fieldBorder = tv6({
|
12253
|
-
variants: {
|
12254
|
-
isReadOnly: {
|
12255
|
-
true: "bg-primary-muted"
|
12256
|
-
},
|
12257
|
-
isFocusWithin: {
|
12258
|
-
false: "border-default hover:border-intense",
|
12259
|
-
true: "border-info-default"
|
12260
|
-
},
|
12261
|
-
isInvalid: {
|
12262
|
-
true: "border-danger-default"
|
12263
|
-
},
|
12264
|
-
isDisabled: {
|
12265
|
-
true: "bg-default cursor-not-allowed text-inactive"
|
12266
|
-
}
|
12267
|
-
}
|
12268
|
-
});
|
12269
|
-
var fieldGroup = tv6({
|
12270
|
-
base: "group flex items-center bg-transparent border rounded-sm typography-small text-default px-3 py-3 overflow-hidden",
|
12271
|
-
variants: fieldBorder.variants
|
12272
|
-
});
|
12273
|
-
|
12274
|
-
// src/molecules/DateField/DateInput.tsx
|
12275
|
-
var segmentStyles = tv7({
|
12129
|
+
import { tv as tv8 } from "tailwind-variants";
|
12130
|
+
var segmentStyles = tv8({
|
12276
12131
|
base: "inline p-0.5 rounded outline outline-0 caret-transparent text-default",
|
12277
12132
|
variants: {
|
12278
12133
|
isPlaceholder: {
|
@@ -12287,47 +12142,40 @@ var segmentStyles = tv7({
|
|
12287
12142
|
}
|
12288
12143
|
});
|
12289
12144
|
function DateInput(props) {
|
12290
|
-
return /* @__PURE__ */
|
12145
|
+
return /* @__PURE__ */ React80.createElement(AriaDateInput, { className: (renderProps) => fieldGroup({ ...renderProps, class: "block" }), ...props }, (segment) => /* @__PURE__ */ React80.createElement(DateSegment, { segment, className: segmentStyles }));
|
12291
12146
|
}
|
12292
12147
|
|
12293
|
-
// src/molecules/Field/Field.tsx
|
12294
|
-
import React79 from "react";
|
12295
|
-
import { Group as Group3 } from "react-aria-components";
|
12296
|
-
var FieldGroup = (props) => {
|
12297
|
-
return /* @__PURE__ */ React79.createElement(Group3, { ...props, className: (renderProps) => fieldGroup(renderProps) });
|
12298
|
-
};
|
12299
|
-
|
12300
12148
|
// src/molecules/TimeField/TimeField.tsx
|
12301
|
-
import
|
12149
|
+
import React81 from "react";
|
12302
12150
|
import {
|
12303
12151
|
TimeField as AriaTimeField
|
12304
12152
|
} from "react-aria-components";
|
12305
12153
|
import { useLabel } from "@react-aria/label";
|
12306
12154
|
import { useId as useId9 } from "@react-aria/utils";
|
12307
|
-
import { omit as
|
12155
|
+
import { omit as omit7 } from "lodash-es";
|
12308
12156
|
function TimeFieldBase({ disabled, valid, ...props }) {
|
12309
|
-
return /* @__PURE__ */
|
12157
|
+
return /* @__PURE__ */ React81.createElement(AriaTimeField, { ...props, isInvalid: valid === false, isDisabled: disabled }, /* @__PURE__ */ React81.createElement(DateInput, null));
|
12310
12158
|
}
|
12311
12159
|
function TimeField(props) {
|
12312
12160
|
const { labelProps, fieldProps } = useLabel({ label: props.labelText });
|
12313
12161
|
const errorMessageId = useId9();
|
12314
12162
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
12315
12163
|
const { "data-testid": dataTestId, ...labelControlProps } = getLabelControlProps(props);
|
12316
|
-
const baseProps =
|
12317
|
-
return /* @__PURE__ */
|
12164
|
+
const baseProps = omit7(props, Object.keys(labelControlProps));
|
12165
|
+
return /* @__PURE__ */ React81.createElement(LabelControl, { ...labelProps, ...labelControlProps, messageId: errorMessageId, className: "Aquarium-TimeField" }, /* @__PURE__ */ React81.createElement(TimeFieldBase, { ...baseProps, ...fieldProps, ...errorProps, disabled: props.disabled, valid: props.valid }));
|
12318
12166
|
}
|
12319
12167
|
|
12320
12168
|
// src/molecules/DatePicker/Button.tsx
|
12321
|
-
import
|
12322
|
-
import { Button as
|
12169
|
+
import React82 from "react";
|
12170
|
+
import { Button as AriaButton2, composeRenderProps as composeRenderProps3 } from "react-aria-components";
|
12323
12171
|
var import_calendar2 = __toESM(require_calendar());
|
12324
12172
|
var import_smallCross3 = __toESM(require_smallCross());
|
12325
12173
|
function Button3(props) {
|
12326
|
-
return /* @__PURE__ */
|
12327
|
-
|
12174
|
+
return /* @__PURE__ */ React82.createElement(
|
12175
|
+
AriaButton2,
|
12328
12176
|
{
|
12329
12177
|
...props,
|
12330
|
-
className:
|
12178
|
+
className: composeRenderProps3(
|
12331
12179
|
props.className,
|
12332
12180
|
(className, renderProps) => buttonClasses({ ...renderProps, className, dense: true, kind: "icon" })
|
12333
12181
|
)
|
@@ -12339,7 +12187,7 @@ var ButtonBase = ({
|
|
12339
12187
|
hideWhenParentIsNotHoveredOrFocused = true,
|
12340
12188
|
...props
|
12341
12189
|
}) => {
|
12342
|
-
return /* @__PURE__ */
|
12190
|
+
return /* @__PURE__ */ React82.createElement(
|
12343
12191
|
Button3,
|
12344
12192
|
{
|
12345
12193
|
...props,
|
@@ -12353,14 +12201,14 @@ var ButtonBase = ({
|
|
12353
12201
|
);
|
12354
12202
|
};
|
12355
12203
|
function ClearInputButton(props) {
|
12356
|
-
return /* @__PURE__ */
|
12204
|
+
return /* @__PURE__ */ React82.createElement(ButtonBase, { ...props, "aria-label": "Clear", slot: null, hideWhenParentIsNotHoveredOrFocused: false }, /* @__PURE__ */ React82.createElement(Icon2, { icon: import_smallCross3.default, dense: true }));
|
12357
12205
|
}
|
12358
12206
|
function CalendarButton(props) {
|
12359
|
-
return /* @__PURE__ */
|
12207
|
+
return /* @__PURE__ */ React82.createElement(ButtonBase, { ...props, "aria-label": "Calendar" }, /* @__PURE__ */ React82.createElement(Icon2, { icon: import_calendar2.default, dense: true }));
|
12360
12208
|
}
|
12361
12209
|
|
12362
12210
|
// src/molecules/DatePicker/Calendar.tsx
|
12363
|
-
import
|
12211
|
+
import React83 from "react";
|
12364
12212
|
import {
|
12365
12213
|
Calendar as AriaCalendar,
|
12366
12214
|
CalendarCell,
|
@@ -12370,10 +12218,10 @@ import {
|
|
12370
12218
|
CalendarHeaderCell,
|
12371
12219
|
Heading
|
12372
12220
|
} from "react-aria-components";
|
12373
|
-
import { tv as
|
12221
|
+
import { tv as tv9 } from "tailwind-variants";
|
12374
12222
|
var import_chevronLeft4 = __toESM(require_chevronLeft());
|
12375
12223
|
var import_chevronRight4 = __toESM(require_chevronRight());
|
12376
|
-
var cellStyles =
|
12224
|
+
var cellStyles = tv9({
|
12377
12225
|
extend: focusRing,
|
12378
12226
|
base: "w-8 h-8 typography-small cursor-default rounded-md flex items-center justify-center outside-month:hidden",
|
12379
12227
|
variants: {
|
@@ -12390,20 +12238,20 @@ var cellStyles = tv8({
|
|
12390
12238
|
}
|
12391
12239
|
});
|
12392
12240
|
var Calendar = (props) => {
|
12393
|
-
return /* @__PURE__ */
|
12241
|
+
return /* @__PURE__ */ React83.createElement(AriaCalendar, { ...props }, /* @__PURE__ */ React83.createElement(CalendarHeader, null), /* @__PURE__ */ React83.createElement(CalendarGrid, null, /* @__PURE__ */ React83.createElement(CalendarGridHeader, null), /* @__PURE__ */ React83.createElement(CalendarGridBody, null, (date) => /* @__PURE__ */ React83.createElement(CalendarCell, { date, className: cellStyles }))));
|
12394
12242
|
};
|
12395
12243
|
var CalendarHeader = () => {
|
12396
|
-
return /* @__PURE__ */
|
12244
|
+
return /* @__PURE__ */ React83.createElement("header", { className: "flex items-center gap-1 pb-5 w-full" }, /* @__PURE__ */ React83.createElement(Button3, { slot: "previous", className: "p-3" }, /* @__PURE__ */ React83.createElement(Icon, { icon: import_chevronLeft4.default })), /* @__PURE__ */ React83.createElement(Heading, { className: tw("flex-1 typography-default-strong text-center") }), /* @__PURE__ */ React83.createElement(Button3, { slot: "next", className: "p-3" }, /* @__PURE__ */ React83.createElement(Icon, { icon: import_chevronRight4.default })));
|
12397
12245
|
};
|
12398
12246
|
var CalendarGridHeader = () => {
|
12399
|
-
return /* @__PURE__ */
|
12247
|
+
return /* @__PURE__ */ React83.createElement(AriaCalendarGridHeader, null, (day) => /* @__PURE__ */ React83.createElement(CalendarHeaderCell, { className: "text-xs text-inactive typography-caption" }, day));
|
12400
12248
|
};
|
12401
12249
|
|
12402
12250
|
// src/molecules/DatePicker/Dialog.tsx
|
12403
|
-
import
|
12251
|
+
import React84 from "react";
|
12404
12252
|
import { Dialog as AriaDialog } from "react-aria-components";
|
12405
12253
|
function Dialog(props) {
|
12406
|
-
return /* @__PURE__ */
|
12254
|
+
return /* @__PURE__ */ React84.createElement(
|
12407
12255
|
AriaDialog,
|
12408
12256
|
{
|
12409
12257
|
...props,
|
@@ -12418,7 +12266,7 @@ function Dialog(props) {
|
|
12418
12266
|
}
|
12419
12267
|
|
12420
12268
|
// src/molecules/DatePicker/Popover.tsx
|
12421
|
-
import
|
12269
|
+
import React85 from "react";
|
12422
12270
|
import {
|
12423
12271
|
OverlayArrow as OverlayArrow2,
|
12424
12272
|
Popover as AriaPopover2,
|
@@ -12430,7 +12278,7 @@ var Popover2 = ({ children, showArrow, className, ...props }) => {
|
|
12430
12278
|
const isSubmenu = popoverContext?.trigger === "SubmenuTrigger";
|
12431
12279
|
let offset = showArrow ? 12 : 8;
|
12432
12280
|
offset = isSubmenu ? offset - 6 : offset;
|
12433
|
-
return /* @__PURE__ */
|
12281
|
+
return /* @__PURE__ */ React85.createElement(
|
12434
12282
|
AriaPopover2,
|
12435
12283
|
{
|
12436
12284
|
offset,
|
@@ -12439,7 +12287,7 @@ var Popover2 = ({ children, showArrow, className, ...props }) => {
|
|
12439
12287
|
"rounded-sm shadow-16dp bg-popover-content mt-1 overflow-y-auto flex flex-col border border-default outline-none"
|
12440
12288
|
)
|
12441
12289
|
},
|
12442
|
-
showArrow && /* @__PURE__ */
|
12290
|
+
showArrow && /* @__PURE__ */ React85.createElement(OverlayArrow2, { className: "group" }, /* @__PURE__ */ React85.createElement(
|
12443
12291
|
"svg",
|
12444
12292
|
{
|
12445
12293
|
width: 12,
|
@@ -12447,7 +12295,7 @@ var Popover2 = ({ children, showArrow, className, ...props }) => {
|
|
12447
12295
|
viewBox: "0 0 12 12",
|
12448
12296
|
className: "block fill-white stroke-1 stroke-black group-placement-bottom:rotate-180 group-placement-left:-rotate-90 group-placement-right:rotate-90"
|
12449
12297
|
},
|
12450
|
-
/* @__PURE__ */
|
12298
|
+
/* @__PURE__ */ React85.createElement("path", { d: "M0 0 L6 6 L12 0" })
|
12451
12299
|
)),
|
12452
12300
|
children
|
12453
12301
|
);
|
@@ -12455,14 +12303,14 @@ var Popover2 = ({ children, showArrow, className, ...props }) => {
|
|
12455
12303
|
|
12456
12304
|
// src/molecules/DatePicker/DatePicker.tsx
|
12457
12305
|
function DatePickerClearButton() {
|
12458
|
-
const state =
|
12306
|
+
const state = React86.useContext(DatePickerStateContext);
|
12459
12307
|
if (!state) {
|
12460
12308
|
throw new Error("DatePickerStateContext is missing a provider");
|
12461
12309
|
}
|
12462
12310
|
if (!state.value) {
|
12463
12311
|
return null;
|
12464
12312
|
}
|
12465
|
-
return /* @__PURE__ */
|
12313
|
+
return /* @__PURE__ */ React86.createElement(
|
12466
12314
|
ClearInputButton,
|
12467
12315
|
{
|
12468
12316
|
onPress: () => {
|
@@ -12481,7 +12329,7 @@ var createDatePickerBase = (variant) => ({
|
|
12481
12329
|
...props
|
12482
12330
|
}) => {
|
12483
12331
|
const hasSomeValue = props.value ?? props.defaultValue ?? props.placeholderValue;
|
12484
|
-
return /* @__PURE__ */
|
12332
|
+
return /* @__PURE__ */ React86.createElement(
|
12485
12333
|
AriaDatePicker,
|
12486
12334
|
{
|
12487
12335
|
...props,
|
@@ -12490,18 +12338,18 @@ var createDatePickerBase = (variant) => ({
|
|
12490
12338
|
isInvalid: valid === false,
|
12491
12339
|
granularity: granularity ?? (variant === "datetime" && !hasSomeValue ? "minute" : void 0)
|
12492
12340
|
},
|
12493
|
-
/* @__PURE__ */
|
12494
|
-
/* @__PURE__ */
|
12341
|
+
/* @__PURE__ */ React86.createElement(FieldGroup, { className: tw("min-w-[210px] w-auto") }, /* @__PURE__ */ React86.createElement(DateInput, { className: tw("flex-1") }), /* @__PURE__ */ React86.createElement(Box.Flex, { alignItems: "center", gap: "2" }, clearSelectionEnabled && !disabled && /* @__PURE__ */ React86.createElement(DatePickerClearButton, null), /* @__PURE__ */ React86.createElement(CalendarButton, null))),
|
12342
|
+
/* @__PURE__ */ React86.createElement(Popover2, { offset: 0 }, /* @__PURE__ */ React86.createElement(Dialog, null, /* @__PURE__ */ React86.createElement(Spacing, { gap: "3" }, /* @__PURE__ */ React86.createElement(Calendar, null), variant === "datetime" && /* @__PURE__ */ React86.createElement(PickerTimeField, { granularity }), errorMessage && /* @__PURE__ */ React86.createElement(Text, { slot: "errorMessage", className: tw("typography-caption text-danger-default max-w-[300px]") }, errorMessage))))
|
12495
12343
|
);
|
12496
12344
|
};
|
12497
12345
|
var DatePickerBase = createDatePickerBase("date");
|
12498
12346
|
var DateTimePickerBase = createDatePickerBase("datetime");
|
12499
12347
|
var PickerTimeField = ({ granularity }) => {
|
12500
|
-
const state =
|
12348
|
+
const state = React86.useContext(DatePickerStateContext);
|
12501
12349
|
if (!state) {
|
12502
12350
|
throw new Error("DatePickerStateContext is missing a provider");
|
12503
12351
|
}
|
12504
|
-
return /* @__PURE__ */
|
12352
|
+
return /* @__PURE__ */ React86.createElement(
|
12505
12353
|
TimeField,
|
12506
12354
|
{
|
12507
12355
|
labelText: "Time",
|
@@ -12517,15 +12365,15 @@ var createDatePicker = (variant) => (props) => {
|
|
12517
12365
|
const errorMessageId = useId10();
|
12518
12366
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId, "errorMessage": props.helperText ?? props.error } : {};
|
12519
12367
|
const { "data-testid": dataTestId, ...labelControlProps } = getLabelControlProps(props);
|
12520
|
-
const baseProps =
|
12368
|
+
const baseProps = omit8(props, Object.keys(labelControlProps));
|
12521
12369
|
const allProps = { ...baseProps, ...fieldProps, ...errorProps, disabled: props.disabled, valid: props.valid };
|
12522
|
-
return /* @__PURE__ */
|
12370
|
+
return /* @__PURE__ */ React86.createElement(LabelControl, { ...labelProps, ...labelControlProps, messageId: errorMessageId, className: "Aquarium-DatePicker" }, variant === "date" ? /* @__PURE__ */ React86.createElement(DatePickerBase, { ...allProps }) : /* @__PURE__ */ React86.createElement(DateTimePickerBase, { ...allProps }));
|
12523
12371
|
};
|
12524
12372
|
var DatePicker = createDatePicker("date");
|
12525
12373
|
var DateTimePicker = createDatePicker("datetime");
|
12526
12374
|
|
12527
12375
|
// src/molecules/DatePicker/DateRangePicker.tsx
|
12528
|
-
import
|
12376
|
+
import React88 from "react";
|
12529
12377
|
import {
|
12530
12378
|
DateRangePicker as AriaDateRangePicker,
|
12531
12379
|
DateRangePickerStateContext,
|
@@ -12533,18 +12381,18 @@ import {
|
|
12533
12381
|
} from "react-aria-components";
|
12534
12382
|
import { useLabel as useLabel3 } from "@react-aria/label";
|
12535
12383
|
import { useId as useId11 } from "@react-aria/utils";
|
12536
|
-
import { omit as
|
12384
|
+
import { omit as omit9 } from "lodash-es";
|
12537
12385
|
|
12538
12386
|
// src/molecules/DatePicker/RangeCalendar.tsx
|
12539
|
-
import
|
12387
|
+
import React87 from "react";
|
12540
12388
|
import {
|
12541
12389
|
CalendarCell as CalendarCell2,
|
12542
12390
|
CalendarGrid as CalendarGrid2,
|
12543
12391
|
CalendarGridBody as CalendarGridBody2,
|
12544
12392
|
RangeCalendar as AriaRangeCalendar
|
12545
12393
|
} from "react-aria-components";
|
12546
|
-
import { tv as
|
12547
|
-
var cell =
|
12394
|
+
import { tv as tv10 } from "tailwind-variants";
|
12395
|
+
var cell = tv10({
|
12548
12396
|
extend: focusRing,
|
12549
12397
|
base: "w-full h-full flex items-center justify-center rounded-md text-default",
|
12550
12398
|
variants: {
|
@@ -12568,7 +12416,7 @@ var cell = tv9({
|
|
12568
12416
|
}
|
12569
12417
|
});
|
12570
12418
|
function RangeCalendar(props) {
|
12571
|
-
return /* @__PURE__ */
|
12419
|
+
return /* @__PURE__ */ React87.createElement(AriaRangeCalendar, { ...props }, /* @__PURE__ */ React87.createElement(CalendarHeader, null), /* @__PURE__ */ React87.createElement(CalendarGrid2, { className: "[&_td]:px-0" }, /* @__PURE__ */ React87.createElement(CalendarGridHeader, null), /* @__PURE__ */ React87.createElement(CalendarGridBody2, null, (date) => /* @__PURE__ */ React87.createElement(
|
12572
12420
|
CalendarCell2,
|
12573
12421
|
{
|
12574
12422
|
date,
|
@@ -12579,7 +12427,7 @@ function RangeCalendar(props) {
|
|
12579
12427
|
"selection-start:rounded-s-md selection-end:rounded-e-md"
|
12580
12428
|
)
|
12581
12429
|
},
|
12582
|
-
({ formattedDate, isSelected, isSelectionStart, isSelectionEnd, ...rest }) => /* @__PURE__ */
|
12430
|
+
({ formattedDate, isSelected, isSelectionStart, isSelectionEnd, ...rest }) => /* @__PURE__ */ React87.createElement(
|
12583
12431
|
"span",
|
12584
12432
|
{
|
12585
12433
|
className: cell({
|
@@ -12594,14 +12442,14 @@ function RangeCalendar(props) {
|
|
12594
12442
|
|
12595
12443
|
// src/molecules/DatePicker/DateRangePicker.tsx
|
12596
12444
|
function DateRangePickerClearButton() {
|
12597
|
-
const state =
|
12445
|
+
const state = React88.useContext(DateRangePickerStateContext);
|
12598
12446
|
if (!state) {
|
12599
12447
|
throw new Error("DateRangePickerStateContext is missing a provider");
|
12600
12448
|
}
|
12601
12449
|
if (!state.value.start && !state.value.end) {
|
12602
12450
|
return null;
|
12603
12451
|
}
|
12604
|
-
return /* @__PURE__ */
|
12452
|
+
return /* @__PURE__ */ React88.createElement(
|
12605
12453
|
ClearInputButton,
|
12606
12454
|
{
|
12607
12455
|
onPress: () => {
|
@@ -12620,7 +12468,7 @@ var createDateRangePickerBase = (variant) => ({
|
|
12620
12468
|
...props
|
12621
12469
|
}) => {
|
12622
12470
|
const hasSomeValue = props.value ?? props.defaultValue ?? props.placeholderValue;
|
12623
|
-
return /* @__PURE__ */
|
12471
|
+
return /* @__PURE__ */ React88.createElement(
|
12624
12472
|
AriaDateRangePicker,
|
12625
12473
|
{
|
12626
12474
|
...props,
|
@@ -12630,13 +12478,13 @@ var createDateRangePickerBase = (variant) => ({
|
|
12630
12478
|
granularity: granularity ?? (variant === "datetime" && !hasSomeValue ? "minute" : void 0),
|
12631
12479
|
className: tw("group flex flex-col gap-1")
|
12632
12480
|
},
|
12633
|
-
/* @__PURE__ */
|
12634
|
-
/* @__PURE__ */
|
12481
|
+
/* @__PURE__ */ React88.createElement(FieldGroup, { className: tw("min-w-[200px] w-auto gap-2") }, /* @__PURE__ */ React88.createElement(DateInput, { slot: "start", className: tw("px-2 py-1") }), /* @__PURE__ */ React88.createElement("span", { "aria-hidden": true, className: tw("text-muted") }, "-"), /* @__PURE__ */ React88.createElement(DateInput, { slot: "end", className: tw("flex-1 px-2 py-1") }), /* @__PURE__ */ React88.createElement(Box.Flex, { alignItems: "center", gap: "2" }, clearSelectionEnabled && !disabled && /* @__PURE__ */ React88.createElement(DateRangePickerClearButton, null), /* @__PURE__ */ React88.createElement(CalendarButton, null))),
|
12482
|
+
/* @__PURE__ */ React88.createElement(Popover2, { offset: 0 }, /* @__PURE__ */ React88.createElement(Dialog, null, /* @__PURE__ */ React88.createElement(Spacing, { gap: "3" }, /* @__PURE__ */ React88.createElement(RangeCalendar, null), variant === "datetime" && /* @__PURE__ */ React88.createElement(Box.Flex, { gap: "6" }, /* @__PURE__ */ React88.createElement("div", { className: tw("flex-1") }, /* @__PURE__ */ React88.createElement(PickerTimeField2, { granularity, part: "start" })), /* @__PURE__ */ React88.createElement("div", { className: tw("flex-1") }, /* @__PURE__ */ React88.createElement(PickerTimeField2, { granularity, part: "end" }))), errorMessage && /* @__PURE__ */ React88.createElement(Text2, { slot: "errorMessage", className: tw("typography-caption text-danger-default max-w-[300px]") }, errorMessage))))
|
12635
12483
|
);
|
12636
12484
|
};
|
12637
12485
|
var PickerTimeField2 = ({ granularity, part }) => {
|
12638
|
-
const ctx =
|
12639
|
-
return /* @__PURE__ */
|
12486
|
+
const ctx = React88.useContext(DateRangePickerStateContext);
|
12487
|
+
return /* @__PURE__ */ React88.createElement(
|
12640
12488
|
TimeField,
|
12641
12489
|
{
|
12642
12490
|
labelText: part === "start" ? "Start time" : "End time",
|
@@ -12654,23 +12502,23 @@ var createDateRangePicker = (variant) => (props) => {
|
|
12654
12502
|
const errorMessageId = useId11();
|
12655
12503
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId, "errorMessage": props.helperText ?? props.error } : {};
|
12656
12504
|
const { "data-testid": dataTestId, ...labelControlProps } = getLabelControlProps(props);
|
12657
|
-
const baseProps =
|
12505
|
+
const baseProps = omit9(props, Object.keys(labelControlProps));
|
12658
12506
|
const allProps = { ...baseProps, ...fieldProps, ...errorProps, disabled: props.disabled, valid: props.valid };
|
12659
|
-
return /* @__PURE__ */
|
12507
|
+
return /* @__PURE__ */ React88.createElement(LabelControl, { ...labelProps, ...labelControlProps, messageId: errorMessageId, className: "Aquarium-DatePicker" }, variant === "date" ? /* @__PURE__ */ React88.createElement(DateRangePickerBase, { ...allProps }) : /* @__PURE__ */ React88.createElement(DateTimeRangePickerBase, { ...allProps }));
|
12660
12508
|
};
|
12661
12509
|
var DateRangePicker = createDateRangePicker("date");
|
12662
12510
|
var DateTimeRangePicker = createDateRangePicker("datetime");
|
12663
12511
|
|
12664
12512
|
// src/molecules/Dialog/Dialog.tsx
|
12665
|
-
import
|
12513
|
+
import React91 from "react";
|
12666
12514
|
import { useDialog } from "@react-aria/dialog";
|
12667
12515
|
import { Overlay, useModalOverlay } from "@react-aria/overlays";
|
12668
12516
|
import { useId as useId12 } from "@react-aria/utils";
|
12669
12517
|
import { useOverlayTriggerState as useOverlayTriggerState2 } from "@react-stately/overlays";
|
12670
|
-
import { omit as
|
12518
|
+
import { omit as omit10 } from "lodash-es";
|
12671
12519
|
|
12672
12520
|
// src/atoms/Dialog/Dialog.tsx
|
12673
|
-
import
|
12521
|
+
import React89 from "react";
|
12674
12522
|
import { Dialog as AriaDialog2 } from "react-aria-components";
|
12675
12523
|
|
12676
12524
|
// node_modules/tailwind-merge/dist/bundle-mjs.mjs
|
@@ -15152,7 +15000,7 @@ var DIALOG_ICONS_AND_COLORS = {
|
|
15152
15000
|
}
|
15153
15001
|
};
|
15154
15002
|
var Dialog2 = (props) => {
|
15155
|
-
return /* @__PURE__ */
|
15003
|
+
return /* @__PURE__ */ React89.createElement(
|
15156
15004
|
AriaDialog2,
|
15157
15005
|
{
|
15158
15006
|
...props,
|
@@ -15162,9 +15010,9 @@ var Dialog2 = (props) => {
|
|
15162
15010
|
};
|
15163
15011
|
|
15164
15012
|
// src/atoms/Modal/Modal.tsx
|
15165
|
-
import
|
15166
|
-
import { tv as
|
15167
|
-
var modalStyles =
|
15013
|
+
import React90 from "react";
|
15014
|
+
import { tv as tv11 } from "tailwind-variants";
|
15015
|
+
var modalStyles = tv11({
|
15168
15016
|
slots: {
|
15169
15017
|
overlay: "inset-0 overflow-y-auto z-modal fixed",
|
15170
15018
|
backdrop: "-z-10 fixed min-w-full min-h-full bg-body-intense opacity-70",
|
@@ -15267,55 +15115,55 @@ var Modal = ({
|
|
15267
15115
|
...rest
|
15268
15116
|
}) => {
|
15269
15117
|
const { overlay } = modalStyles({ kind });
|
15270
|
-
return open ? /* @__PURE__ */
|
15118
|
+
return open ? /* @__PURE__ */ React90.createElement("div", { ...rest, className: overlay({ className }) }, children) : null;
|
15271
15119
|
};
|
15272
15120
|
Modal.BackDrop = ({ className, ...rest }) => {
|
15273
15121
|
const { backdrop } = modalStyles();
|
15274
|
-
return /* @__PURE__ */
|
15122
|
+
return /* @__PURE__ */ React90.createElement("div", { ...rest, className: backdrop({ className }) });
|
15275
15123
|
};
|
15276
|
-
Modal.Dialog =
|
15124
|
+
Modal.Dialog = React90.forwardRef(
|
15277
15125
|
({ kind = "dialog", children, className, size = "md", ...rest }, ref) => {
|
15278
15126
|
const { dialog } = modalStyles({ kind, size });
|
15279
|
-
return /* @__PURE__ */
|
15127
|
+
return /* @__PURE__ */ React90.createElement("div", { ref, "aria-modal": "true", ...rest, className: dialog({ className }) }, children);
|
15280
15128
|
}
|
15281
15129
|
);
|
15282
15130
|
Modal.Header = ({ kind = "dialog", size = "md", children, className, ...rest }) => {
|
15283
15131
|
const { header } = modalStyles({ kind, size });
|
15284
|
-
return /* @__PURE__ */
|
15132
|
+
return /* @__PURE__ */ React90.createElement("div", { ...rest, className: header({ className }) }, children);
|
15285
15133
|
};
|
15286
15134
|
Modal.HeaderImage = ({ backgroundImage, className, ...rest }) => {
|
15287
15135
|
const { headerImage } = modalStyles({ backgroundImage: Boolean(backgroundImage) });
|
15288
|
-
return backgroundImage ? /* @__PURE__ */
|
15136
|
+
return backgroundImage ? /* @__PURE__ */ React90.createElement("img", { "aria-hidden": true, src: backgroundImage, ...rest, className: headerImage({ className }) }) : /* @__PURE__ */ React90.createElement("div", { className: headerImage({ className }) });
|
15289
15137
|
};
|
15290
15138
|
Modal.CloseButtonContainer = ({ className, ...rest }) => {
|
15291
15139
|
const { closeButtonContainer } = modalStyles();
|
15292
|
-
return /* @__PURE__ */
|
15140
|
+
return /* @__PURE__ */ React90.createElement("div", { ...rest, className: closeButtonContainer({ className }) });
|
15293
15141
|
};
|
15294
15142
|
Modal.Title = ({ kind = "dialog", children, className, ...rest }) => {
|
15295
15143
|
const { title } = modalStyles({ kind });
|
15296
|
-
return /* @__PURE__ */
|
15144
|
+
return /* @__PURE__ */ React90.createElement(Typography, { htmlTag: "h2", variant: "subheading", color: "intense", className: title({ className }), ...rest }, children);
|
15297
15145
|
};
|
15298
|
-
Modal.Subtitle = ({ children, ...rest }) => /* @__PURE__ */
|
15146
|
+
Modal.Subtitle = ({ children, ...rest }) => /* @__PURE__ */ React90.createElement(Typography, { variant: "small", color: "default", ...rest }, children);
|
15299
15147
|
Modal.TitleContainer = ({ children, className, ...rest }) => {
|
15300
15148
|
const { titleContainer } = modalStyles();
|
15301
|
-
return /* @__PURE__ */
|
15149
|
+
return /* @__PURE__ */ React90.createElement("div", { ...rest, className: titleContainer({ className }) }, children);
|
15302
15150
|
};
|
15303
15151
|
Modal.Body = ({ children, className, noFooter = false, maxHeight, style, ...rest }) => {
|
15304
15152
|
const { body } = modalStyles();
|
15305
|
-
return /* @__PURE__ */
|
15153
|
+
return /* @__PURE__ */ React90.createElement("div", { ...rest, className: body({ noFooter, className }), style: { maxHeight, ...style } }, children);
|
15306
15154
|
};
|
15307
15155
|
Modal.Footer = ({ children, className, ...rest }) => {
|
15308
15156
|
const { footer } = modalStyles();
|
15309
|
-
return /* @__PURE__ */
|
15157
|
+
return /* @__PURE__ */ React90.createElement("div", { ...rest, className: footer({ className }) }, children);
|
15310
15158
|
};
|
15311
15159
|
Modal.Actions = ({ children, className, ...rest }) => {
|
15312
15160
|
const { actions } = modalStyles();
|
15313
|
-
return /* @__PURE__ */
|
15161
|
+
return /* @__PURE__ */ React90.createElement("div", { ...rest, className: actions({ className }) }, children);
|
15314
15162
|
};
|
15315
15163
|
|
15316
15164
|
// src/molecules/Dialog/Dialog.tsx
|
15317
15165
|
var Dialog3 = (props) => {
|
15318
|
-
const ref =
|
15166
|
+
const ref = React91.useRef(null);
|
15319
15167
|
const { open, onClose } = props;
|
15320
15168
|
const state = useOverlayTriggerState2({ isOpen: open, onOpenChange: (isOpen) => !isOpen && onClose?.() });
|
15321
15169
|
const { modalProps, underlayProps } = useModalOverlay(
|
@@ -15326,7 +15174,7 @@ var Dialog3 = (props) => {
|
|
15326
15174
|
if (!state.isOpen) {
|
15327
15175
|
return null;
|
15328
15176
|
}
|
15329
|
-
return /* @__PURE__ */
|
15177
|
+
return /* @__PURE__ */ React91.createElement(Overlay, null, /* @__PURE__ */ React91.createElement(Modal, { className: "Aquarium-Dialog", open: true }, /* @__PURE__ */ React91.createElement(Modal.BackDrop, { ...underlayProps }), /* @__PURE__ */ React91.createElement(Modal.Dialog, { ref, size: "sm", ...modalProps }, /* @__PURE__ */ React91.createElement(DialogWrapper, { ...props }))));
|
15330
15178
|
};
|
15331
15179
|
var DialogWrapper = ({
|
15332
15180
|
title,
|
@@ -15335,7 +15183,7 @@ var DialogWrapper = ({
|
|
15335
15183
|
primaryAction,
|
15336
15184
|
secondaryAction
|
15337
15185
|
}) => {
|
15338
|
-
const ref =
|
15186
|
+
const ref = React91.useRef(null);
|
15339
15187
|
const labelledBy = useId12();
|
15340
15188
|
const describedBy = useId12();
|
15341
15189
|
const { dialogProps } = useDialog(
|
@@ -15346,35 +15194,35 @@ var DialogWrapper = ({
|
|
15346
15194
|
},
|
15347
15195
|
ref
|
15348
15196
|
);
|
15349
|
-
return /* @__PURE__ */
|
15197
|
+
return /* @__PURE__ */ React91.createElement("div", { ref, ...dialogProps, className: tw("outline-none") }, /* @__PURE__ */ React91.createElement(Modal.Header, { className: tw("icon-stroke-2") }, /* @__PURE__ */ React91.createElement(Icon, { icon: DIALOG_ICONS_AND_COLORS[type].icon, color: DIALOG_ICONS_AND_COLORS[type].color, fontSize: 20 }), /* @__PURE__ */ React91.createElement(Modal.Title, { id: labelledBy, variant: "large", color: DIALOG_ICONS_AND_COLORS[type].color }, title)), /* @__PURE__ */ React91.createElement(Modal.Body, { id: describedBy }, /* @__PURE__ */ React91.createElement(Typography2.Default, null, children)), /* @__PURE__ */ React91.createElement(Modal.Footer, null, /* @__PURE__ */ React91.createElement(Modal.Actions, null, secondaryAction && /* @__PURE__ */ React91.createElement(Button2.Ghost, { key: secondaryAction.text, ...omit10(secondaryAction, "text") }, secondaryAction.text), /* @__PURE__ */ React91.createElement(Button2.Secondary, { key: primaryAction.text, ...omit10(primaryAction, "text") }, primaryAction.text))));
|
15350
15198
|
};
|
15351
15199
|
|
15352
15200
|
// src/molecules/Drawer/Drawer.tsx
|
15353
|
-
import
|
15201
|
+
import React94 from "react";
|
15354
15202
|
import { Dialog as AriaDialog3, Modal as AriaModal, ModalOverlay as AriaModalOverlay } from "react-aria-components";
|
15355
15203
|
import { animated as animated5, useSpring as useSpring4 } from "@react-spring/web";
|
15356
|
-
import { castArray as castArray3, omit as
|
15204
|
+
import { castArray as castArray3, omit as omit11 } from "lodash-es";
|
15357
15205
|
|
15358
15206
|
// src/molecules/Modal/ModalTitle.tsx
|
15359
|
-
import
|
15207
|
+
import React92 from "react";
|
15360
15208
|
import { HeadingContext, useContextProps } from "react-aria-components";
|
15361
15209
|
var ModalTitle = ({ children, ...props }) => {
|
15362
15210
|
const [ctxProps] = useContextProps({ ...props, slot: "title" }, null, HeadingContext);
|
15363
|
-
return /* @__PURE__ */
|
15211
|
+
return /* @__PURE__ */ React92.createElement(Modal.Title, { id: ctxProps.id, ...props }, children);
|
15364
15212
|
};
|
15365
15213
|
|
15366
15214
|
// src/molecules/Tabs/Tabs.tsx
|
15367
|
-
import
|
15215
|
+
import React93, { useEffect as useEffect8, useLayoutEffect as useLayoutEffect2, useRef as useRef10, useState as useState11 } from "react";
|
15368
15216
|
import { isNumber as isNumber6, kebabCase } from "lodash-es";
|
15369
15217
|
var import_chevronLeft5 = __toESM(require_chevronLeft());
|
15370
15218
|
var import_chevronRight5 = __toESM(require_chevronRight());
|
15371
15219
|
var import_warningSign4 = __toESM(require_warningSign());
|
15372
15220
|
var isTabComponent = (c) => {
|
15373
|
-
return
|
15221
|
+
return React93.isValidElement(c) && (c.type === Tab || c.type === ModalTab);
|
15374
15222
|
};
|
15375
|
-
var Tab =
|
15223
|
+
var Tab = React93.forwardRef(
|
15376
15224
|
({ className, id, title, children }, ref) => {
|
15377
|
-
return /* @__PURE__ */
|
15225
|
+
return /* @__PURE__ */ React93.createElement(
|
15378
15226
|
"div",
|
15379
15227
|
{
|
15380
15228
|
ref,
|
@@ -15388,10 +15236,10 @@ var Tab = React92.forwardRef(
|
|
15388
15236
|
);
|
15389
15237
|
}
|
15390
15238
|
);
|
15391
|
-
var TabContainer = ({ className, children, ...rest }) => /* @__PURE__ */
|
15239
|
+
var TabContainer = ({ className, children, ...rest }) => /* @__PURE__ */ React93.createElement("div", { ...rest, className: classNames("py-6 z-0", className) }, children);
|
15392
15240
|
var ModalTab = Tab;
|
15393
15241
|
var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
15394
|
-
const Tab2 =
|
15242
|
+
const Tab2 = React93.forwardRef(
|
15395
15243
|
({
|
15396
15244
|
id,
|
15397
15245
|
value,
|
@@ -15410,11 +15258,11 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
15410
15258
|
const _id = id ?? kebabCase(title);
|
15411
15259
|
let statusIcon = void 0;
|
15412
15260
|
if (status === "warning") {
|
15413
|
-
statusIcon = /* @__PURE__ */
|
15261
|
+
statusIcon = /* @__PURE__ */ React93.createElement(InlineIcon, { icon: import_warningSign4.default, color: selected ? void 0 : "warning-default" });
|
15414
15262
|
} else if (status === "error") {
|
15415
|
-
statusIcon = /* @__PURE__ */
|
15263
|
+
statusIcon = /* @__PURE__ */ React93.createElement(InlineIcon, { icon: import_warningSign4.default, color: selected ? void 0 : "danger-default" });
|
15416
15264
|
}
|
15417
|
-
const tab = /* @__PURE__ */
|
15265
|
+
const tab = /* @__PURE__ */ React93.createElement(
|
15418
15266
|
Component,
|
15419
15267
|
{
|
15420
15268
|
ref,
|
@@ -15435,7 +15283,7 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
15435
15283
|
tabIndex: disabled ? void 0 : 0,
|
15436
15284
|
...rest
|
15437
15285
|
},
|
15438
|
-
/* @__PURE__ */
|
15286
|
+
/* @__PURE__ */ React93.createElement(
|
15439
15287
|
Typography2,
|
15440
15288
|
{
|
15441
15289
|
htmlTag: "div",
|
@@ -15443,8 +15291,8 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
15443
15291
|
color: selected ? "primary-default" : disabled ? "default" : "current",
|
15444
15292
|
className: tw("inline-flex items-center gap-3")
|
15445
15293
|
},
|
15446
|
-
showNotification ? /* @__PURE__ */
|
15447
|
-
isNumber6(badge) && /* @__PURE__ */
|
15294
|
+
showNotification ? /* @__PURE__ */ React93.createElement(Badge.Notification, { right: "-4px", top: "3px" }, /* @__PURE__ */ React93.createElement("span", { className: tw("whitespace-nowrap") }, title)) : /* @__PURE__ */ React93.createElement("span", { className: tw("whitespace-nowrap") }, title),
|
15295
|
+
isNumber6(badge) && /* @__PURE__ */ React93.createElement(
|
15448
15296
|
Typography2,
|
15449
15297
|
{
|
15450
15298
|
htmlTag: "span",
|
@@ -15452,7 +15300,7 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
15452
15300
|
color: selected ? "primary-intense" : "grey-5",
|
15453
15301
|
className: "leading-none"
|
15454
15302
|
},
|
15455
|
-
/* @__PURE__ */
|
15303
|
+
/* @__PURE__ */ React93.createElement(
|
15456
15304
|
TabBadge,
|
15457
15305
|
{
|
15458
15306
|
kind: "filled",
|
@@ -15464,7 +15312,7 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
15464
15312
|
statusIcon
|
15465
15313
|
)
|
15466
15314
|
);
|
15467
|
-
return tooltip ? /* @__PURE__ */
|
15315
|
+
return tooltip ? /* @__PURE__ */ React93.createElement(Tooltip, { content: tooltip }, tab) : tab;
|
15468
15316
|
}
|
15469
15317
|
);
|
15470
15318
|
Tab2.displayName = displayName;
|
@@ -15475,7 +15323,7 @@ var CARET_OFFSET = 24;
|
|
15475
15323
|
var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderChildren) => {
|
15476
15324
|
const Tabs2 = (props) => {
|
15477
15325
|
const { className, value, defaultValue, onChange, children } = props;
|
15478
|
-
const childArr =
|
15326
|
+
const childArr = React93.Children.toArray(children);
|
15479
15327
|
const firstTab = childArr[0];
|
15480
15328
|
const firstTabValue = isTabComponent(firstTab) ? firstTab.props.value : -1;
|
15481
15329
|
const [selected, setSelected] = useState11(value ?? defaultValue ?? firstTabValue ?? 0);
|
@@ -15487,7 +15335,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
15487
15335
|
const revealSelectedTab = ({ smooth }) => {
|
15488
15336
|
const container = containerRef.current;
|
15489
15337
|
const tabs = tabsRef.current;
|
15490
|
-
const values =
|
15338
|
+
const values = React93.Children.map(
|
15491
15339
|
children,
|
15492
15340
|
(tab, i) => tab?.props.value ?? i
|
15493
15341
|
);
|
@@ -15525,7 +15373,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
15525
15373
|
updateCarets();
|
15526
15374
|
setSelected(value);
|
15527
15375
|
revealSelectedTab({ smooth: value !== selected });
|
15528
|
-
}, [value,
|
15376
|
+
}, [value, React93.Children.count(children)]);
|
15529
15377
|
useLayoutEffect2(() => {
|
15530
15378
|
updateCarets();
|
15531
15379
|
containerRef.current?.addEventListener("scroll", updateCarets);
|
@@ -15587,12 +15435,12 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
15587
15435
|
const handleSelected = (key) => {
|
15588
15436
|
(onChange ?? setSelected)(key);
|
15589
15437
|
};
|
15590
|
-
|
15438
|
+
React93.Children.forEach(children, (c) => {
|
15591
15439
|
if (c && !isTabComponent(c)) {
|
15592
15440
|
throw new Error("<Tabs> can only have <Tabs.Tab> components as children");
|
15593
15441
|
}
|
15594
15442
|
});
|
15595
|
-
return /* @__PURE__ */
|
15443
|
+
return /* @__PURE__ */ React93.createElement("div", { ref: parentRef, className: classNames("Aquarium-Tabs", tw("h-full"), className) }, /* @__PURE__ */ React93.createElement("div", { className: tw("relative flex items-center border-b-2 border-default") }, /* @__PURE__ */ React93.createElement("div", { ref: containerRef, className: tw("overflow-y-auto scrollbar-hide mb-[-2px] h-auto") }, /* @__PURE__ */ React93.createElement(
|
15596
15444
|
"div",
|
15597
15445
|
{
|
15598
15446
|
ref: tabsRef,
|
@@ -15600,9 +15448,9 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
15600
15448
|
"aria-label": "tabs",
|
15601
15449
|
className: tw("inline-flex items-center cursor-pointer font-normal h-full")
|
15602
15450
|
},
|
15603
|
-
|
15451
|
+
React93.Children.map(
|
15604
15452
|
children,
|
15605
|
-
(tab, index) => tab ? /* @__PURE__ */
|
15453
|
+
(tab, index) => tab ? /* @__PURE__ */ React93.createElement(
|
15606
15454
|
TabItemComponent,
|
15607
15455
|
{
|
15608
15456
|
key: tab.props.value,
|
@@ -15614,26 +15462,26 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
15614
15462
|
}
|
15615
15463
|
) : void 0
|
15616
15464
|
)
|
15617
|
-
)), leftCaret && /* @__PURE__ */
|
15465
|
+
)), leftCaret && /* @__PURE__ */ React93.createElement("div", { className: tw("absolute left-0 bg-gradient-to-r from-white via-white z-20 py-3 pr-4") }, /* @__PURE__ */ React93.createElement(
|
15618
15466
|
"div",
|
15619
15467
|
{
|
15620
15468
|
onClick: () => handleScrollToNext("left"),
|
15621
15469
|
className: tw("hover:bg-muted p-2 leading-none cursor-pointer")
|
15622
15470
|
},
|
15623
|
-
/* @__PURE__ */
|
15624
|
-
)), rightCaret && /* @__PURE__ */
|
15471
|
+
/* @__PURE__ */ React93.createElement(InlineIcon, { icon: import_chevronLeft5.default })
|
15472
|
+
)), rightCaret && /* @__PURE__ */ React93.createElement(
|
15625
15473
|
"div",
|
15626
15474
|
{
|
15627
15475
|
onClick: () => handleScrollToNext("right"),
|
15628
15476
|
className: tw("absolute right-0 bg-gradient-to-l from-white via-white z-20 py-3 pl-4")
|
15629
15477
|
},
|
15630
|
-
/* @__PURE__ */
|
15478
|
+
/* @__PURE__ */ React93.createElement(
|
15631
15479
|
"div",
|
15632
15480
|
{
|
15633
15481
|
onClick: () => handleScrollToNext("right"),
|
15634
15482
|
className: tw("hover:bg-muted p-2 leading-none cursor-pointer")
|
15635
15483
|
},
|
15636
|
-
/* @__PURE__ */
|
15484
|
+
/* @__PURE__ */ React93.createElement(InlineIcon, { icon: import_chevronRight5.default })
|
15637
15485
|
)
|
15638
15486
|
)), renderChildren(children, selected, props));
|
15639
15487
|
};
|
@@ -15641,7 +15489,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
15641
15489
|
Tabs2.Tab = TabComponent;
|
15642
15490
|
return Tabs2;
|
15643
15491
|
};
|
15644
|
-
var Tabs = createTabsComponent(Tab, TabItem, "Tabs", (children, selected) => /* @__PURE__ */
|
15492
|
+
var Tabs = createTabsComponent(Tab, TabItem, "Tabs", (children, selected) => /* @__PURE__ */ React93.createElement(TabContainer, null, children.find(
|
15645
15493
|
(node, index) => node?.props.value === selected || index === selected
|
15646
15494
|
)));
|
15647
15495
|
|
@@ -15669,7 +15517,7 @@ var Drawer = ({
|
|
15669
15517
|
secondaryActions,
|
15670
15518
|
closeOnEsc = true
|
15671
15519
|
}) => {
|
15672
|
-
const [hidden, setHidden] =
|
15520
|
+
const [hidden, setHidden] = React94.useState(!open);
|
15673
15521
|
if (open && hidden) {
|
15674
15522
|
setHidden(!open);
|
15675
15523
|
}
|
@@ -15692,10 +15540,10 @@ var Drawer = ({
|
|
15692
15540
|
}
|
15693
15541
|
const dialogSize = size === "lg" ? "full" : size;
|
15694
15542
|
const styles = modalStyles({ kind: "drawer", size: dialogSize });
|
15695
|
-
const childElements =
|
15543
|
+
const childElements = React94.Children.toArray(children).filter(React94.isValidElement);
|
15696
15544
|
const onlyChild = childElements.length === 1 ? childElements[0] : null;
|
15697
15545
|
const hasTabs = isComponentType(onlyChild, Tabs);
|
15698
|
-
return /* @__PURE__ */
|
15546
|
+
return /* @__PURE__ */ React94.createElement(
|
15699
15547
|
AriaModalOverlay,
|
15700
15548
|
{
|
15701
15549
|
isOpen: !hidden,
|
@@ -15704,59 +15552,60 @@ var Drawer = ({
|
|
15704
15552
|
isKeyboardDismissDisabled: !closeOnEsc,
|
15705
15553
|
className: styles.overlay({ className: "Aquarium-Drawer" })
|
15706
15554
|
},
|
15707
|
-
/* @__PURE__ */
|
15708
|
-
/* @__PURE__ */
|
15555
|
+
/* @__PURE__ */ React94.createElement(AnimatedBackDrop, { style: { opacity } }),
|
15556
|
+
/* @__PURE__ */ React94.createElement(AriaModal, null, /* @__PURE__ */ React94.createElement(AnimatedDialog, { kind: "drawer", "aria-modal": "true", size: dialogSize, style: { position: "fixed", right } }, /* @__PURE__ */ React94.createElement(AriaDialog3, { className: "flex flex-col grow overflow-y-auto" }, ({ close }) => /* @__PURE__ */ React94.createElement(React94.Fragment, null, /* @__PURE__ */ React94.createElement(Modal.CloseButtonContainer, null, /* @__PURE__ */ React94.createElement(Button2.Icon, { "aria-label": "Close", icon: import_cross6.default, onClick: close })), /* @__PURE__ */ React94.createElement(Modal.Header, { className: tw({ "pb-3": hasTabs }) }, /* @__PURE__ */ React94.createElement(ModalTitle, { kind: "drawer" }, title)), hasTabs ? /* @__PURE__ */ React94.createElement(
|
15709
15557
|
DrawerTabs,
|
15710
15558
|
{
|
15711
15559
|
...onlyChild.props,
|
15712
15560
|
className: tw("[&>div:first-child]:px-5 grow flex flex-col overflow-y-auto")
|
15713
15561
|
}
|
15714
|
-
) : /* @__PURE__ */
|
15562
|
+
) : /* @__PURE__ */ React94.createElement(Modal.Body, { tabIndex: 0, noFooter: !(secondaryActions ?? primaryAction) }, children), (secondaryActions ?? primaryAction) && /* @__PURE__ */ React94.createElement(Modal.Footer, null, /* @__PURE__ */ React94.createElement(Modal.Actions, { className: size === "sm" ? tw("flex-col") : void 0 }, size !== "sm" && menu && /* @__PURE__ */ React94.createElement(Box.Flex, { alignItems: "center" }, /* @__PURE__ */ React94.createElement(DropdownMenu2, { onAction: (action) => onAction(action), onOpenChange: onMenuOpenChange }, /* @__PURE__ */ React94.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ React94.createElement(Button2.Icon, { "aria-label": menuAriaLabel ?? "Context menu", icon: import_more4.default })), menu)), secondaryActions && castArray3(secondaryActions).filter(Boolean).map(({ text, ...action }) => /* @__PURE__ */ React94.createElement(Button2.Secondary, { key: text, ...action }, text)), primaryAction && /* @__PURE__ */ React94.createElement(Button2.Primary, { key: primaryAction.text, ...omit11(primaryAction, "text") }, primaryAction.text)))))))
|
15715
15563
|
);
|
15716
15564
|
};
|
15717
|
-
var DrawerTabs = createTabsComponent(ModalTab, TabItem, "DrawerTabs", (children, selected) => /* @__PURE__ */
|
15565
|
+
var DrawerTabs = createTabsComponent(ModalTab, TabItem, "DrawerTabs", (children, selected) => /* @__PURE__ */ React94.createElement(Modal.Body, { className: tw("h-full") }, /* @__PURE__ */ React94.createElement(TabContainer, null, children.find(
|
15718
15566
|
(node, index) => node?.props.value === selected || index === selected
|
15719
15567
|
))));
|
15720
15568
|
|
15721
15569
|
// src/molecules/Dropdown/Dropdown.tsx
|
15722
|
-
import
|
15570
|
+
import React96 from "react";
|
15723
15571
|
import { OverlayTriggerStateContext as OverlayTriggerStateContext2 } from "react-aria-components";
|
15724
15572
|
|
15725
15573
|
// src/molecules/Popover/Popover.tsx
|
15726
|
-
import
|
15574
|
+
import React95, { createContext as createContext5 } from "react";
|
15727
15575
|
import { DialogTrigger, OverlayTriggerStateContext } from "react-aria-components";
|
15728
15576
|
import { mergeProps as mergeProps3 } from "@react-aria/utils";
|
15729
|
-
var PopoverPropsContext =
|
15577
|
+
var PopoverPropsContext = createContext5({});
|
15730
15578
|
var Popover3 = ({ children, onOpenChange: _onOpenChange, onClose, onOpen, ...props }) => {
|
15731
15579
|
const onOpenChange = (isOpen) => {
|
15732
15580
|
_onOpenChange?.(isOpen);
|
15733
15581
|
isOpen ? onOpen?.() : onClose?.();
|
15734
15582
|
};
|
15735
|
-
return /* @__PURE__ */
|
15583
|
+
return /* @__PURE__ */ React95.createElement(PopoverPropsContext.Provider, { value: props }, /* @__PURE__ */ React95.createElement(DialogTrigger, { ...props, onOpenChange }, children));
|
15736
15584
|
};
|
15585
|
+
Popover3.displayName = "Popover";
|
15737
15586
|
var Trigger = ({ children }) => {
|
15738
|
-
return /* @__PURE__ */
|
15587
|
+
return /* @__PURE__ */ React95.createElement(Pressable, { "aria-haspopup": "true" }, children);
|
15739
15588
|
};
|
15740
15589
|
Trigger.displayName = "Popover.Trigger";
|
15741
15590
|
Popover3.Trigger = Trigger;
|
15742
15591
|
var Panel = ({ className, children }) => {
|
15743
|
-
const { offset = 0, onOpenChange, ...props } =
|
15744
|
-
return /* @__PURE__ */
|
15592
|
+
const { offset = 0, onOpenChange, ...props } = React95.useContext(PopoverPropsContext);
|
15593
|
+
return /* @__PURE__ */ React95.createElement(Popover, { ...props, className, offset }, /* @__PURE__ */ React95.createElement(Dialog2, null, children));
|
15745
15594
|
};
|
15746
15595
|
Panel.displayName = "Popover.Panel";
|
15747
15596
|
Popover3.Panel = Panel;
|
15748
15597
|
var CloseToggle = ({ children }) => {
|
15749
|
-
const ctx =
|
15598
|
+
const ctx = React95.useContext(OverlayTriggerStateContext);
|
15750
15599
|
const onClick = ctx?.close;
|
15751
|
-
const child =
|
15752
|
-
return
|
15600
|
+
const child = React95.Children.only(children);
|
15601
|
+
return React95.cloneElement(child, { ...mergeProps3(child.props, { onClick }) });
|
15753
15602
|
};
|
15754
15603
|
CloseToggle.displayName = "Popover.CloseToggle";
|
15755
15604
|
Popover3.CloseToggle = CloseToggle;
|
15756
15605
|
|
15757
15606
|
// src/molecules/Dropdown/Dropdown.tsx
|
15758
15607
|
var Dropdown = ({ children, content, placement = "bottom-left" }) => {
|
15759
|
-
return /* @__PURE__ */
|
15608
|
+
return /* @__PURE__ */ React96.createElement(Popover3, { placement }, /* @__PURE__ */ React96.createElement(Popover3.Trigger, null, children), /* @__PURE__ */ React96.createElement(Popover3.Panel, { className: "Aquarium-Dropdown" }, content));
|
15760
15609
|
};
|
15761
15610
|
var DropdownMenu3 = ({
|
15762
15611
|
title,
|
@@ -15765,13 +15614,13 @@ var DropdownMenu3 = ({
|
|
15765
15614
|
triggerId,
|
15766
15615
|
setClose = () => void 0
|
15767
15616
|
}) => {
|
15768
|
-
const menuRef =
|
15769
|
-
|
15617
|
+
const menuRef = React96.useRef(null);
|
15618
|
+
React96.useEffect(() => {
|
15770
15619
|
const id = setTimeout(() => (menuRef.current?.children[0]).focus());
|
15771
15620
|
return () => clearTimeout(id);
|
15772
15621
|
}, [menuRef.current]);
|
15773
|
-
return /* @__PURE__ */
|
15774
|
-
return
|
15622
|
+
return /* @__PURE__ */ React96.createElement("div", { style: { minWidth: "250px" }, className: tw("py-3 bg-popover-content") }, !!title && /* @__PURE__ */ React96.createElement("div", { className: tw("px-4 py-4 text-left text-intense typography-default-strong") }, title), /* @__PURE__ */ React96.createElement("ol", { role: "menu", ref: menuRef, id: contentId, "aria-labelledby": triggerId }, React96.Children.map(children, (child) => {
|
15623
|
+
return React96.cloneElement(child, { setClose });
|
15775
15624
|
})));
|
15776
15625
|
};
|
15777
15626
|
var DropdownItem = ({
|
@@ -15784,7 +15633,7 @@ var DropdownItem = ({
|
|
15784
15633
|
setClose = () => void 0,
|
15785
15634
|
...props
|
15786
15635
|
}) => {
|
15787
|
-
const ctx =
|
15636
|
+
const ctx = React96.useContext(OverlayTriggerStateContext2);
|
15788
15637
|
const handleSelect = () => {
|
15789
15638
|
onSelect?.();
|
15790
15639
|
ctx?.close();
|
@@ -15818,8 +15667,8 @@ var DropdownItem = ({
|
|
15818
15667
|
handleSelect();
|
15819
15668
|
}
|
15820
15669
|
};
|
15821
|
-
const itemContent = /* @__PURE__ */
|
15822
|
-
return /* @__PURE__ */
|
15670
|
+
const itemContent = /* @__PURE__ */ React96.createElement("div", { className: tw("py-3 px-4") }, children);
|
15671
|
+
return /* @__PURE__ */ React96.createElement(
|
15823
15672
|
"li",
|
15824
15673
|
{
|
15825
15674
|
role: "menuitem",
|
@@ -15836,14 +15685,14 @@ var DropdownItem = ({
|
|
15836
15685
|
})
|
15837
15686
|
)
|
15838
15687
|
},
|
15839
|
-
tooltip ? /* @__PURE__ */
|
15688
|
+
tooltip ? /* @__PURE__ */ React96.createElement(Tooltip, { content: tooltip, placement: tooltipPlacement, display: "block" }, /* @__PURE__ */ React96.createElement("div", { tabIndex: 0, className: tw("grow") }, itemContent)) : itemContent
|
15840
15689
|
);
|
15841
15690
|
};
|
15842
15691
|
Dropdown.Menu = DropdownMenu3;
|
15843
15692
|
Dropdown.Item = DropdownItem;
|
15844
15693
|
|
15845
15694
|
// src/molecules/EmptyState/EmptyState.tsx
|
15846
|
-
import
|
15695
|
+
import React97 from "react";
|
15847
15696
|
var EmptyStateLayout = /* @__PURE__ */ ((EmptyStateLayout2) => {
|
15848
15697
|
EmptyStateLayout2["Vertical"] = "vertical";
|
15849
15698
|
EmptyStateLayout2["Horizontal"] = "horizontal";
|
@@ -15881,7 +15730,7 @@ var EmptyState = ({
|
|
15881
15730
|
fullHeight = isVerticalLayout(layout) ? true : false
|
15882
15731
|
}) => {
|
15883
15732
|
const template = layoutStyle(layout);
|
15884
|
-
return /* @__PURE__ */
|
15733
|
+
return /* @__PURE__ */ React97.createElement(
|
15885
15734
|
Box,
|
15886
15735
|
{
|
15887
15736
|
className: classNames(
|
@@ -15897,7 +15746,7 @@ var EmptyState = ({
|
|
15897
15746
|
backgroundColor: "transparent",
|
15898
15747
|
borderColor: "default"
|
15899
15748
|
},
|
15900
|
-
/* @__PURE__ */
|
15749
|
+
/* @__PURE__ */ React97.createElement(
|
15901
15750
|
Box.Flex,
|
15902
15751
|
{
|
15903
15752
|
style: { gap: "56px" },
|
@@ -15906,21 +15755,21 @@ var EmptyState = ({
|
|
15906
15755
|
alignItems: template.layout === "row" ? "center" : template.alignItems,
|
15907
15756
|
height: fullHeight ? "full" : void 0
|
15908
15757
|
},
|
15909
|
-
Image2 && (typeof Image2 === "string" ? /* @__PURE__ */
|
15758
|
+
Image2 && (typeof Image2 === "string" ? /* @__PURE__ */ React97.createElement(
|
15910
15759
|
"img",
|
15911
15760
|
{
|
15912
15761
|
src: Image2,
|
15913
15762
|
alt: imageAlt,
|
15914
15763
|
style: { width: imageWidth ? `${imageWidth}px` : void 0, height: "auto" }
|
15915
15764
|
}
|
15916
|
-
) : /* @__PURE__ */
|
15917
|
-
/* @__PURE__ */
|
15765
|
+
) : /* @__PURE__ */ React97.createElement("div", { className: tw("animate-draw") }, /* @__PURE__ */ React97.createElement(Image2, null))),
|
15766
|
+
/* @__PURE__ */ React97.createElement(Box.Flex, { flexDirection: "column", justifyContent: template.justifyContent, alignItems: template.alignItems }, /* @__PURE__ */ React97.createElement(Typography2.Heading, { htmlTag: "h2" }, title), children && /* @__PURE__ */ React97.createElement(Box, { marginTop: "5" }, /* @__PURE__ */ React97.createElement(Typography2.Default, null, children)), (secondaryAction ?? primaryAction) && /* @__PURE__ */ React97.createElement(Box.Flex, { marginTop: "7", gap: "4", justifyContent: "center", alignItems: "center", flexWrap: "wrap" }, primaryAction && renderAction({ kind: "primary", action: primaryAction }), secondaryAction && renderAction({ kind: "secondary", action: secondaryAction })), footer && /* @__PURE__ */ React97.createElement(Box, { marginTop: "5" }, /* @__PURE__ */ React97.createElement(Typography2.Small, { color: "default" }, footer)))
|
15918
15767
|
)
|
15919
15768
|
);
|
15920
15769
|
};
|
15921
15770
|
|
15922
15771
|
// src/molecules/LineClamp/LineClamp.tsx
|
15923
|
-
import
|
15772
|
+
import React98 from "react";
|
15924
15773
|
var LineClamp2 = ({
|
15925
15774
|
lines,
|
15926
15775
|
children,
|
@@ -15929,10 +15778,10 @@ var LineClamp2 = ({
|
|
15929
15778
|
collapseLabel,
|
15930
15779
|
onClampedChange
|
15931
15780
|
}) => {
|
15932
|
-
const ref =
|
15933
|
-
const [clamped, setClamped] =
|
15934
|
-
const [isClampingEnabled, setClampingEnabled] =
|
15935
|
-
|
15781
|
+
const ref = React98.useRef(null);
|
15782
|
+
const [clamped, setClamped] = React98.useState(true);
|
15783
|
+
const [isClampingEnabled, setClampingEnabled] = React98.useState(false);
|
15784
|
+
React98.useEffect(() => {
|
15936
15785
|
const el = ref.current;
|
15937
15786
|
setClampingEnabled((el?.scrollHeight ?? 0) > (el?.clientHeight ?? 0));
|
15938
15787
|
}, [ref.current]);
|
@@ -15940,25 +15789,25 @@ var LineClamp2 = ({
|
|
15940
15789
|
setClamped(!clamped);
|
15941
15790
|
onClampedChange?.(!clamped);
|
15942
15791
|
};
|
15943
|
-
return /* @__PURE__ */
|
15792
|
+
return /* @__PURE__ */ React98.createElement("div", { className: "Aquarium-LineClamp" }, /* @__PURE__ */ React98.createElement(LineClamp, { ref, lines, clamped, wordBreak }, children), expandLabel && isClampingEnabled && /* @__PURE__ */ React98.createElement(Button2.Ghost, { dense: true, onClick: handleClampedChange }, clamped ? expandLabel : collapseLabel));
|
15944
15793
|
};
|
15945
15794
|
|
15946
15795
|
// src/molecules/List/useStaticInfiniteList.ts
|
15947
|
-
import
|
15796
|
+
import React99 from "react";
|
15948
15797
|
var useStaticInfiniteList = ({
|
15949
15798
|
items,
|
15950
15799
|
pageSize,
|
15951
15800
|
autoReset = true
|
15952
15801
|
}) => {
|
15953
|
-
const [currentPage, setCurrentPage] =
|
15802
|
+
const [currentPage, setCurrentPage] = React99.useState(1);
|
15954
15803
|
const numberOfVisible = currentPage * pageSize;
|
15955
|
-
const next =
|
15804
|
+
const next = React99.useCallback(() => {
|
15956
15805
|
setCurrentPage((page) => page + 1);
|
15957
15806
|
}, [setCurrentPage]);
|
15958
|
-
const reset =
|
15807
|
+
const reset = React99.useCallback(() => {
|
15959
15808
|
setCurrentPage(1);
|
15960
15809
|
}, [setCurrentPage]);
|
15961
|
-
|
15810
|
+
React99.useEffect(() => {
|
15962
15811
|
if (autoReset) {
|
15963
15812
|
setCurrentPage(1);
|
15964
15813
|
}
|
@@ -15973,9 +15822,9 @@ var useStaticInfiniteList = ({
|
|
15973
15822
|
};
|
15974
15823
|
|
15975
15824
|
// src/molecules/ListItem/ListItem.tsx
|
15976
|
-
import
|
15825
|
+
import React100 from "react";
|
15977
15826
|
var ListItem = ({ name, icon, active = false }) => {
|
15978
|
-
return /* @__PURE__ */
|
15827
|
+
return /* @__PURE__ */ React100.createElement(Box.Flex, { className: "Aquarium-ListItem", alignItems: "center" }, /* @__PURE__ */ React100.createElement(
|
15979
15828
|
Typography2,
|
15980
15829
|
{
|
15981
15830
|
variant: active ? "small-strong" : "small",
|
@@ -15983,15 +15832,15 @@ var ListItem = ({ name, icon, active = false }) => {
|
|
15983
15832
|
htmlTag: "span",
|
15984
15833
|
className: `px-4 py-2 rounded-full ${active ? "bg-default" : "hover:bg-muted"}`
|
15985
15834
|
},
|
15986
|
-
/* @__PURE__ */
|
15835
|
+
/* @__PURE__ */ React100.createElement("img", { src: icon, alt: "", className: "inline mr-4", height: 28, width: 28 }),
|
15987
15836
|
name
|
15988
15837
|
));
|
15989
15838
|
};
|
15990
15839
|
|
15991
15840
|
// src/molecules/Modal/Modal.tsx
|
15992
|
-
import
|
15841
|
+
import React101 from "react";
|
15993
15842
|
import { Dialog as AriaDialog4, Modal as AriaModal2, ModalOverlay as AriaModalOverlay2 } from "react-aria-components";
|
15994
|
-
import { castArray as castArray4, omit as
|
15843
|
+
import { castArray as castArray4, omit as omit12 } from "lodash-es";
|
15995
15844
|
var import_cross7 = __toESM(require_cross());
|
15996
15845
|
var Modal2 = ({
|
15997
15846
|
open,
|
@@ -16010,7 +15859,7 @@ var Modal2 = ({
|
|
16010
15859
|
}
|
16011
15860
|
const styles = modalStyles({ kind: "dialog", size });
|
16012
15861
|
const hasTabs = isComponentType(children, ModalTabs);
|
16013
|
-
return /* @__PURE__ */
|
15862
|
+
return /* @__PURE__ */ React101.createElement(
|
16014
15863
|
AriaModalOverlay2,
|
16015
15864
|
{
|
16016
15865
|
isOpen: open,
|
@@ -16019,43 +15868,43 @@ var Modal2 = ({
|
|
16019
15868
|
isKeyboardDismissDisabled: !closeOnEsc,
|
16020
15869
|
className: styles.overlay({ className: "Aquarium-Modal" })
|
16021
15870
|
},
|
16022
|
-
size !== "screen" && /* @__PURE__ */
|
16023
|
-
/* @__PURE__ */
|
15871
|
+
size !== "screen" && /* @__PURE__ */ React101.createElement(Modal.BackDrop, { className: styles.backdrop() }),
|
15872
|
+
/* @__PURE__ */ React101.createElement(AriaModal2, { className: styles.dialog() }, /* @__PURE__ */ React101.createElement(AriaDialog4, { className: "flex flex-col grow overflow-y-auto" }, ({ close }) => /* @__PURE__ */ React101.createElement(React101.Fragment, null, /* @__PURE__ */ React101.createElement(Modal.CloseButtonContainer, null, /* @__PURE__ */ React101.createElement(Button2.Icon, { "aria-label": "Close", icon: import_cross7.default, onClick: close })), headerImage !== void 0 && /* @__PURE__ */ React101.createElement(Modal.HeaderImage, { backgroundImage: headerImage }), /* @__PURE__ */ React101.createElement(
|
16024
15873
|
Modal.Header,
|
16025
15874
|
{
|
16026
15875
|
kind: "dialog",
|
16027
15876
|
size,
|
16028
15877
|
className: tw({ "pb-3": isComponentType(children, ModalTabs) })
|
16029
15878
|
},
|
16030
|
-
/* @__PURE__ */
|
16031
|
-
), hasTabs ?
|
15879
|
+
/* @__PURE__ */ React101.createElement(Modal.TitleContainer, null, /* @__PURE__ */ React101.createElement(ModalTitle, { kind: "dialog" }, title), subtitle && /* @__PURE__ */ React101.createElement(Modal.Subtitle, null, subtitle))
|
15880
|
+
), hasTabs ? React101.cloneElement(children, { className: tw("[&>div:first-child]:px-5 grow") }) : /* @__PURE__ */ React101.createElement(Modal.Body, { tabIndex: 0, noFooter: !(secondaryActions ?? primaryAction) }, children), (secondaryActions ?? primaryAction) && /* @__PURE__ */ React101.createElement(Modal.Footer, null, /* @__PURE__ */ React101.createElement(Modal.Actions, null, secondaryActions && castArray4(secondaryActions).filter(Boolean).map(({ text, ...action }) => /* @__PURE__ */ React101.createElement(Button2.Secondary, { key: text, ...action }, text)), primaryAction && /* @__PURE__ */ React101.createElement(Button2.Primary, { key: primaryAction.text, ...omit12(primaryAction, "text") }, primaryAction.text))))))
|
16032
15881
|
);
|
16033
15882
|
};
|
16034
15883
|
var ModalTabs = createTabsComponent(
|
16035
15884
|
ModalTab,
|
16036
15885
|
TabItem,
|
16037
15886
|
"ModalTabs",
|
16038
|
-
(children, selected, props) => /* @__PURE__ */
|
15887
|
+
(children, selected, props) => /* @__PURE__ */ React101.createElement(Modal.Body, { maxHeight: props.maxHeight }, /* @__PURE__ */ React101.createElement(TabContainer, null, children.find(
|
16039
15888
|
(node, index) => node?.props.value === selected || index === selected
|
16040
15889
|
)))
|
16041
15890
|
);
|
16042
15891
|
|
16043
15892
|
// src/molecules/MultiInput/MultiInput.tsx
|
16044
|
-
import
|
15893
|
+
import React103, { useEffect as useEffect9, useRef as useRef11, useState as useState12 } from "react";
|
16045
15894
|
import { useId as useId13 } from "@react-aria/utils";
|
16046
|
-
import { castArray as castArray5, identity, omit as
|
15895
|
+
import { castArray as castArray5, identity, omit as omit13 } from "lodash-es";
|
16047
15896
|
|
16048
15897
|
// src/molecules/MultiInput/InputChip.tsx
|
16049
|
-
import
|
15898
|
+
import React102 from "react";
|
16050
15899
|
var import_smallCross4 = __toESM(require_smallCross());
|
16051
|
-
var InputChip =
|
15900
|
+
var InputChip = React102.forwardRef(
|
16052
15901
|
({ invalid = false, disabled, readOnly, className, onClick: _onClick, children, ...props }, ref) => {
|
16053
15902
|
const onClick = (e) => {
|
16054
15903
|
if (!disabled && !readOnly) {
|
16055
15904
|
_onClick?.(e);
|
16056
15905
|
}
|
16057
15906
|
};
|
16058
|
-
return /* @__PURE__ */
|
15907
|
+
return /* @__PURE__ */ React102.createElement(
|
16059
15908
|
"div",
|
16060
15909
|
{
|
16061
15910
|
className: classNames(
|
@@ -16068,8 +15917,8 @@ var InputChip = React101.forwardRef(
|
|
16068
15917
|
}
|
16069
15918
|
)
|
16070
15919
|
},
|
16071
|
-
/* @__PURE__ */
|
16072
|
-
!readOnly && /* @__PURE__ */
|
15920
|
+
/* @__PURE__ */ React102.createElement("div", { className: tw("px-2 py-1") }, /* @__PURE__ */ React102.createElement(Typography2, { variant: "small", color: invalid ? "danger-default" : disabled ? "inactive" : "default" }, children)),
|
15921
|
+
!readOnly && /* @__PURE__ */ React102.createElement(
|
16073
15922
|
"div",
|
16074
15923
|
{
|
16075
15924
|
ref,
|
@@ -16083,7 +15932,7 @@ var InputChip = React101.forwardRef(
|
|
16083
15932
|
role: "button",
|
16084
15933
|
"aria-label": `Remove ${String(children)}`
|
16085
15934
|
},
|
16086
|
-
!disabled && /* @__PURE__ */
|
15935
|
+
!disabled && /* @__PURE__ */ React102.createElement(
|
16087
15936
|
Icon,
|
16088
15937
|
{
|
16089
15938
|
icon: import_smallCross4.default,
|
@@ -16201,7 +16050,7 @@ var MultiInputBase = ({
|
|
16201
16050
|
}
|
16202
16051
|
onBlur?.();
|
16203
16052
|
};
|
16204
|
-
const renderChips = () => items.map((item, index) => /* @__PURE__ */
|
16053
|
+
const renderChips = () => items.map((item, index) => /* @__PURE__ */ React103.createElement(
|
16205
16054
|
InputChip,
|
16206
16055
|
{
|
16207
16056
|
key: `${itemToString(item)}.${index}`,
|
@@ -16215,12 +16064,12 @@ var MultiInputBase = ({
|
|
16215
16064
|
},
|
16216
16065
|
itemToString(item)
|
16217
16066
|
));
|
16218
|
-
return /* @__PURE__ */
|
16067
|
+
return /* @__PURE__ */ React103.createElement("div", { className: "Aquarium-MultiInputBase" }, /* @__PURE__ */ React103.createElement(
|
16219
16068
|
Select.InputContainer,
|
16220
16069
|
{
|
16221
16070
|
variant: disabled ? "disabled" : !valid ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default"
|
16222
16071
|
},
|
16223
|
-
/* @__PURE__ */
|
16072
|
+
/* @__PURE__ */ React103.createElement("div", { className: "grow inline-flex flex-row flex-wrap gap-y-2" }, inline && renderChips(), /* @__PURE__ */ React103.createElement(
|
16224
16073
|
Select.Input,
|
16225
16074
|
{
|
16226
16075
|
ref: inputRef,
|
@@ -16242,10 +16091,10 @@ var MultiInputBase = ({
|
|
16242
16091
|
autoComplete: "off"
|
16243
16092
|
}
|
16244
16093
|
)),
|
16245
|
-
endAdornment && /* @__PURE__ */
|
16246
|
-
), !inline && /* @__PURE__ */
|
16094
|
+
endAdornment && /* @__PURE__ */ React103.createElement(InputAdornment, null, endAdornment)
|
16095
|
+
), !inline && /* @__PURE__ */ React103.createElement("div", { className: tw("flex flex-row flex-wrap gap-y-2 mt-2") }, renderChips()));
|
16247
16096
|
};
|
16248
|
-
var BaseMultiInputSkeleton = () => /* @__PURE__ */
|
16097
|
+
var BaseMultiInputSkeleton = () => /* @__PURE__ */ React103.createElement(Skeleton, { height: 38 });
|
16249
16098
|
MultiInputBase.Skeleton = BaseMultiInputSkeleton;
|
16250
16099
|
var MultiInput = (props) => {
|
16251
16100
|
const [value, setValue] = useState12(props.value ?? props.defaultValue ?? []);
|
@@ -16257,8 +16106,8 @@ var MultiInput = (props) => {
|
|
16257
16106
|
const errorMessageId = useId13();
|
16258
16107
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
16259
16108
|
const labelControlProps = getLabelControlProps(props);
|
16260
|
-
const baseProps =
|
16261
|
-
return /* @__PURE__ */
|
16109
|
+
const baseProps = omit13(props, Object.keys(labelControlProps));
|
16110
|
+
return /* @__PURE__ */ React103.createElement(
|
16262
16111
|
LabelControl,
|
16263
16112
|
{
|
16264
16113
|
id: `${id}-label`,
|
@@ -16269,7 +16118,7 @@ var MultiInput = (props) => {
|
|
16269
16118
|
maxLength: props.maxLength,
|
16270
16119
|
className: "Aquarium-MultiInput"
|
16271
16120
|
},
|
16272
|
-
/* @__PURE__ */
|
16121
|
+
/* @__PURE__ */ React103.createElement(
|
16273
16122
|
MultiInputBase,
|
16274
16123
|
{
|
16275
16124
|
...baseProps,
|
@@ -16286,16 +16135,16 @@ var MultiInput = (props) => {
|
|
16286
16135
|
)
|
16287
16136
|
);
|
16288
16137
|
};
|
16289
|
-
var MultiInputSkeleton = () => /* @__PURE__ */
|
16138
|
+
var MultiInputSkeleton = () => /* @__PURE__ */ React103.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React103.createElement(MultiInputBase.Skeleton, null));
|
16290
16139
|
MultiInput.Skeleton = MultiInputSkeleton;
|
16291
16140
|
MultiInput.Skeleton.displayName = "MultiInput.Skeleton";
|
16292
16141
|
|
16293
16142
|
// src/molecules/MultiSelect/MultiSelect.tsx
|
16294
|
-
import
|
16143
|
+
import React104, { useEffect as useEffect10, useRef as useRef12, useState as useState13 } from "react";
|
16295
16144
|
import { ariaHideOutside as ariaHideOutside3 } from "@react-aria/overlays";
|
16296
16145
|
import { useId as useId14 } from "@react-aria/utils";
|
16297
16146
|
import { useCombobox as useCombobox2, useMultipleSelection } from "downshift";
|
16298
|
-
import { isEqual, isNil as isNil3, omit as
|
16147
|
+
import { isEqual, isNil as isNil3, omit as omit14, omitBy } from "lodash-es";
|
16299
16148
|
import { matchSorter as matchSorter2 } from "match-sorter";
|
16300
16149
|
var MultiSelectBase = ({
|
16301
16150
|
id,
|
@@ -16409,7 +16258,7 @@ var MultiSelectBase = ({
|
|
16409
16258
|
return ariaHideOutside3([inputRef.current, popoverRef.current]);
|
16410
16259
|
}
|
16411
16260
|
}, [isOpen, inputRef, popoverRef]);
|
16412
|
-
const renderItem = (item, index) => /* @__PURE__ */
|
16261
|
+
const renderItem = (item, index) => /* @__PURE__ */ React104.createElement(
|
16413
16262
|
Select.Item,
|
16414
16263
|
{
|
16415
16264
|
key: itemToString(item),
|
@@ -16419,9 +16268,9 @@ var MultiSelectBase = ({
|
|
16419
16268
|
},
|
16420
16269
|
renderOption(item)
|
16421
16270
|
);
|
16422
|
-
const renderGroup = (group) => group.options.length ? /* @__PURE__ */
|
16271
|
+
const renderGroup = (group) => group.options.length ? /* @__PURE__ */ React104.createElement(React104.Fragment, { key: group.label }, /* @__PURE__ */ React104.createElement(Select.Group, null, group.label), group.options.map((opt) => renderItem(opt, flattenedOptions.indexOf(opt)))) : null;
|
16423
16272
|
const renderChips = () => {
|
16424
|
-
return selectedItems.map((selectedItem, index) => /* @__PURE__ */
|
16273
|
+
return selectedItems.map((selectedItem, index) => /* @__PURE__ */ React104.createElement(
|
16425
16274
|
InputChip,
|
16426
16275
|
{
|
16427
16276
|
key: `${itemToString(selectedItem)}.chip`,
|
@@ -16443,13 +16292,13 @@ var MultiSelectBase = ({
|
|
16443
16292
|
getDropdownProps({ ref: inputRef, disabled: disabled || readOnly, value: inputValue })
|
16444
16293
|
);
|
16445
16294
|
const menuProps = getMenuProps({ ref: menuRef }, { suppressRefError: !isOpen });
|
16446
|
-
return /* @__PURE__ */
|
16295
|
+
return /* @__PURE__ */ React104.createElement("div", { className: classNames("Aquarium-MultiSelectBase", tw("relative")) }, /* @__PURE__ */ React104.createElement(
|
16447
16296
|
Select.InputContainer,
|
16448
16297
|
{
|
16449
16298
|
ref: targetRef,
|
16450
16299
|
variant: disabled ? "disabled" : !valid ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default"
|
16451
16300
|
},
|
16452
|
-
/* @__PURE__ */
|
16301
|
+
/* @__PURE__ */ React104.createElement("div", { className: "grow inline-flex flex-row flex-wrap gap-2" }, !hideChips && inline && renderChips(), /* @__PURE__ */ React104.createElement(
|
16453
16302
|
Select.Input,
|
16454
16303
|
{
|
16455
16304
|
name,
|
@@ -16471,8 +16320,8 @@ var MultiSelectBase = ({
|
|
16471
16320
|
}
|
16472
16321
|
}
|
16473
16322
|
)),
|
16474
|
-
!readOnly && /* @__PURE__ */
|
16475
|
-
), !hideChips && !inline && /* @__PURE__ */
|
16323
|
+
!readOnly && /* @__PURE__ */ React104.createElement(Select.Toggle, { hasFocus, isOpen, ...getToggleButtonProps({ disabled }) })
|
16324
|
+
), !hideChips && !inline && /* @__PURE__ */ React104.createElement("div", { className: tw("flex flex-row flex-wrap gap-2 mt-2") }, renderChips()), /* @__PURE__ */ React104.createElement(
|
16476
16325
|
Popover,
|
16477
16326
|
{
|
16478
16327
|
ref: popoverRef,
|
@@ -16482,12 +16331,12 @@ var MultiSelectBase = ({
|
|
16482
16331
|
isNonModal: true,
|
16483
16332
|
style: { width: targetRef.current?.offsetWidth }
|
16484
16333
|
},
|
16485
|
-
/* @__PURE__ */
|
16334
|
+
/* @__PURE__ */ React104.createElement(Select.Menu, { maxHeight, ...menuProps }, hasNoResults && /* @__PURE__ */ React104.createElement(Select.NoResults, null, emptyState), filteredOptions.map(
|
16486
16335
|
(option, index) => isOptionGroup(option) ? renderGroup(option) : renderItem(option, index)
|
16487
16336
|
))
|
16488
16337
|
));
|
16489
16338
|
};
|
16490
|
-
var MultiSelectBaseSkeleton = () => /* @__PURE__ */
|
16339
|
+
var MultiSelectBaseSkeleton = () => /* @__PURE__ */ React104.createElement(Skeleton, { height: 38 });
|
16491
16340
|
MultiSelectBase.Skeleton = MultiSelectBaseSkeleton;
|
16492
16341
|
var MultiSelect = ({
|
16493
16342
|
options,
|
@@ -16499,8 +16348,8 @@ var MultiSelect = ({
|
|
16499
16348
|
const errorMessageId = useId14();
|
16500
16349
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
16501
16350
|
const labelControlProps = getLabelControlProps(props);
|
16502
|
-
const baseProps =
|
16503
|
-
return /* @__PURE__ */
|
16351
|
+
const baseProps = omit14(props, Object.keys(labelControlProps));
|
16352
|
+
return /* @__PURE__ */ React104.createElement(
|
16504
16353
|
LabelControl,
|
16505
16354
|
{
|
16506
16355
|
id: `${id}-label`,
|
@@ -16509,7 +16358,7 @@ var MultiSelect = ({
|
|
16509
16358
|
...labelControlProps,
|
16510
16359
|
className: "Aquarium-MultiSelect"
|
16511
16360
|
},
|
16512
|
-
/* @__PURE__ */
|
16361
|
+
/* @__PURE__ */ React104.createElement(
|
16513
16362
|
MultiSelectBase,
|
16514
16363
|
{
|
16515
16364
|
...baseProps,
|
@@ -16523,16 +16372,16 @@ var MultiSelect = ({
|
|
16523
16372
|
)
|
16524
16373
|
);
|
16525
16374
|
};
|
16526
|
-
var MultiSelectSkeleton = () => /* @__PURE__ */
|
16375
|
+
var MultiSelectSkeleton = () => /* @__PURE__ */ React104.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React104.createElement(MultiSelectBase.Skeleton, null));
|
16527
16376
|
MultiSelect.Skeleton = MultiSelectSkeleton;
|
16528
16377
|
MultiSelect.Skeleton.displayName = "MultiSelect.Skeleton";
|
16529
16378
|
|
16530
16379
|
// src/molecules/NativeSelect/NativeSelect.tsx
|
16531
|
-
import
|
16380
|
+
import React105 from "react";
|
16532
16381
|
import { useId as useId15 } from "@react-aria/utils";
|
16533
|
-
import { omit as
|
16382
|
+
import { omit as omit15, uniqueId } from "lodash-es";
|
16534
16383
|
var import_caretDown2 = __toESM(require_caretDown());
|
16535
|
-
var NativeSelectBase =
|
16384
|
+
var NativeSelectBase = React105.forwardRef(
|
16536
16385
|
({ children, disabled = false, required = false, valid = true, readOnly = false, ...props }, ref) => {
|
16537
16386
|
const placeholderValue = uniqueId("default_value_for_placeholder");
|
16538
16387
|
const defaultValue = props.defaultValue ? props.defaultValue : props.placeholder ? placeholderValue : void 0;
|
@@ -16549,15 +16398,15 @@ var NativeSelectBase = React104.forwardRef(
|
|
16549
16398
|
props.onBlur?.(event);
|
16550
16399
|
}
|
16551
16400
|
};
|
16552
|
-
return /* @__PURE__ */
|
16401
|
+
return /* @__PURE__ */ React105.createElement("span", { className: classNames("Aquarium-NativeSelectBase", tw("relative block")) }, !readOnly && /* @__PURE__ */ React105.createElement(
|
16553
16402
|
"span",
|
16554
16403
|
{
|
16555
16404
|
className: tw(
|
16556
16405
|
"absolute right-0 inset-y-0 mr-4 text-inactive flex ml-3 pointer-events-none typography-default-strong mt-4"
|
16557
16406
|
)
|
16558
16407
|
},
|
16559
|
-
/* @__PURE__ */
|
16560
|
-
), /* @__PURE__ */
|
16408
|
+
/* @__PURE__ */ React105.createElement(Icon, { icon: import_caretDown2.default, "data-testid": "icon-dropdown" })
|
16409
|
+
), /* @__PURE__ */ React105.createElement(
|
16561
16410
|
"select",
|
16562
16411
|
{
|
16563
16412
|
ref,
|
@@ -16579,21 +16428,21 @@ var NativeSelectBase = React104.forwardRef(
|
|
16579
16428
|
props.className
|
16580
16429
|
)
|
16581
16430
|
},
|
16582
|
-
props.placeholder && /* @__PURE__ */
|
16431
|
+
props.placeholder && /* @__PURE__ */ React105.createElement("option", { value: placeholderValue, disabled: true }, props.placeholder),
|
16583
16432
|
children
|
16584
16433
|
));
|
16585
16434
|
}
|
16586
16435
|
);
|
16587
|
-
NativeSelectBase.Skeleton = () => /* @__PURE__ */
|
16588
|
-
var NativeSelect =
|
16436
|
+
NativeSelectBase.Skeleton = () => /* @__PURE__ */ React105.createElement(Skeleton, { height: 38 });
|
16437
|
+
var NativeSelect = React105.forwardRef(
|
16589
16438
|
({ readOnly, ...props }, ref) => {
|
16590
16439
|
const defaultId = useId15();
|
16591
16440
|
const id = props.id ?? defaultId;
|
16592
16441
|
const errorMessageId = useId15();
|
16593
16442
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
16594
16443
|
const { "data-testid": dataTestId, ...labelControlProps } = getLabelControlProps(props);
|
16595
|
-
const baseProps =
|
16596
|
-
return /* @__PURE__ */
|
16444
|
+
const baseProps = omit15(props, Object.keys(labelControlProps));
|
16445
|
+
return /* @__PURE__ */ React105.createElement(
|
16597
16446
|
LabelControl,
|
16598
16447
|
{
|
16599
16448
|
id: `${id}-label`,
|
@@ -16602,7 +16451,7 @@ var NativeSelect = React104.forwardRef(
|
|
16602
16451
|
...labelControlProps,
|
16603
16452
|
className: "Aquarium-NativeSelect"
|
16604
16453
|
},
|
16605
|
-
/* @__PURE__ */
|
16454
|
+
/* @__PURE__ */ React105.createElement(
|
16606
16455
|
NativeSelectBase,
|
16607
16456
|
{
|
16608
16457
|
ref,
|
@@ -16621,34 +16470,34 @@ var NativeSelect = React104.forwardRef(
|
|
16621
16470
|
}
|
16622
16471
|
);
|
16623
16472
|
NativeSelect.displayName = "NativeSelect";
|
16624
|
-
var Option =
|
16625
|
-
return /* @__PURE__ */
|
16473
|
+
var Option = React105.forwardRef(({ children, ...props }, ref) => {
|
16474
|
+
return /* @__PURE__ */ React105.createElement("option", { ref, ...props }, children);
|
16626
16475
|
});
|
16627
16476
|
Option.displayName = "Option";
|
16628
|
-
var NativeSelectSkeleton = () => /* @__PURE__ */
|
16477
|
+
var NativeSelectSkeleton = () => /* @__PURE__ */ React105.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React105.createElement(NativeSelectBase.Skeleton, null), /* @__PURE__ */ React105.createElement("div", { style: { height: "1px" } }));
|
16629
16478
|
NativeSelect.Skeleton = NativeSelectSkeleton;
|
16630
16479
|
NativeSelect.Skeleton.displayName = "NativeSelect.Skeleton";
|
16631
16480
|
|
16632
16481
|
// src/molecules/Navigation/Navigation.tsx
|
16633
|
-
import
|
16482
|
+
import React107 from "react";
|
16634
16483
|
import classNames11 from "classnames";
|
16635
16484
|
import { uniqueId as uniqueId2 } from "lodash-es";
|
16636
16485
|
|
16637
16486
|
// src/atoms/Navigation/Navigation.tsx
|
16638
|
-
import
|
16487
|
+
import React106 from "react";
|
16639
16488
|
var Navigation = ({
|
16640
16489
|
className,
|
16641
16490
|
children,
|
16642
16491
|
"aria-label": ariaLabel,
|
16643
16492
|
...rest
|
16644
|
-
}) => /* @__PURE__ */
|
16645
|
-
var Header = ({ className, ...rest }) => /* @__PURE__ */
|
16646
|
-
var Title2 = ({ className, ...props }) => /* @__PURE__ */
|
16647
|
-
var Subtitle = ({ className, ...props }) => /* @__PURE__ */
|
16648
|
-
var Footer = ({ className, ...rest }) => /* @__PURE__ */
|
16649
|
-
var
|
16650
|
-
var Divider3 = ({ className, ...rest }) => /* @__PURE__ */
|
16651
|
-
var
|
16493
|
+
}) => /* @__PURE__ */ React106.createElement("nav", { className: classNames(tw("bg-muted h-full")), "aria-label": ariaLabel }, /* @__PURE__ */ React106.createElement("ul", { ...rest, className: classNames(tw("flex flex-col h-full"), className), role: "menubar" }, children));
|
16494
|
+
var Header = ({ className, ...rest }) => /* @__PURE__ */ React106.createElement("li", { ...rest, role: "presentation", className: classNames(tw("px-6 py-5"), className) });
|
16495
|
+
var Title2 = ({ className, ...props }) => /* @__PURE__ */ React106.createElement(Typography, { variant: "caption", className: classNames("uppercase text-muted", className), ...props });
|
16496
|
+
var Subtitle = ({ className, ...props }) => /* @__PURE__ */ React106.createElement(Typography, { variant: "small-strong", className: classNames("text-intense", className), ...props });
|
16497
|
+
var Footer = ({ className, ...rest }) => /* @__PURE__ */ React106.createElement("li", { ...rest, role: "presentation", className: classNames(tw("px-6 py-5 mt-auto"), className) });
|
16498
|
+
var Section = ({ title, className, ...rest }) => /* @__PURE__ */ React106.createElement("li", { role: "presentation", className: tw("py-5") }, title && /* @__PURE__ */ React106.createElement("div", { className: classNames(className, "py-2 px-6 text-inactive uppercase cursor-default typography-caption") }, title), /* @__PURE__ */ React106.createElement("ul", { ...rest, role: "group", className: classNames(tw("flex flex-col"), className) }));
|
16499
|
+
var Divider3 = ({ className, ...rest }) => /* @__PURE__ */ React106.createElement("li", { "aria-hidden": true, ...rest, className: classNames(tw("border-t-2 border-muted"), className) });
|
16500
|
+
var Item4 = ({ className, active, ...rest }) => /* @__PURE__ */ React106.createElement("li", { role: "presentation" }, /* @__PURE__ */ React106.createElement(
|
16652
16501
|
"a",
|
16653
16502
|
{
|
16654
16503
|
...rest,
|
@@ -16668,7 +16517,7 @@ var Submenu = ({
|
|
16668
16517
|
title,
|
16669
16518
|
id,
|
16670
16519
|
...rest
|
16671
|
-
}) => /* @__PURE__ */
|
16520
|
+
}) => /* @__PURE__ */ React106.createElement("li", { role: "presentation" }, /* @__PURE__ */ React106.createElement(
|
16672
16521
|
"a",
|
16673
16522
|
{
|
16674
16523
|
role: "menuitem",
|
@@ -16682,33 +16531,33 @@ var Submenu = ({
|
|
16682
16531
|
...rest
|
16683
16532
|
},
|
16684
16533
|
title
|
16685
|
-
), /* @__PURE__ */
|
16686
|
-
var SubmenuItem = ({ className, active, ...rest }) => /* @__PURE__ */
|
16534
|
+
), /* @__PURE__ */ React106.createElement("ul", { role: "menu", className: classNames(tw("flex flex-col")), "aria-labelledby": id }, children));
|
16535
|
+
var SubmenuItem = ({ className, active, ...rest }) => /* @__PURE__ */ React106.createElement(Navigation.Item, { ...rest, active, className: classNames(className, tw("pl-[56px]")) });
|
16687
16536
|
Header.Title = Title2;
|
16688
16537
|
Header.Subtitle = Subtitle;
|
16689
16538
|
Submenu.Item = SubmenuItem;
|
16690
16539
|
Navigation.Header = Header;
|
16691
16540
|
Navigation.Footer = Footer;
|
16692
|
-
Navigation.Section =
|
16693
|
-
Navigation.Item =
|
16541
|
+
Navigation.Section = Section;
|
16542
|
+
Navigation.Item = Item4;
|
16694
16543
|
Navigation.Submenu = Submenu;
|
16695
16544
|
Navigation.Divider = Divider3;
|
16696
16545
|
|
16697
16546
|
// src/molecules/Navigation/Navigation.tsx
|
16698
|
-
var Navigation2 = ({ className, ...props }) => /* @__PURE__ */
|
16699
|
-
var
|
16547
|
+
var Navigation2 = ({ className, ...props }) => /* @__PURE__ */ React107.createElement(Navigation, { className: classNames11("Aquarium-Navigation", className), ...props });
|
16548
|
+
var Item5 = ({
|
16700
16549
|
children,
|
16701
16550
|
icon,
|
16702
16551
|
showNotification = false,
|
16703
16552
|
...rest
|
16704
|
-
}) => /* @__PURE__ */
|
16553
|
+
}) => /* @__PURE__ */ React107.createElement(Navigation.Item, { ...rest }, icon && showNotification && /* @__PURE__ */ React107.createElement(Badge.Notification, null, /* @__PURE__ */ React107.createElement(InlineIcon, { icon, width: "20px", height: "20px" })), icon && !showNotification && /* @__PURE__ */ React107.createElement(InlineIcon, { icon, width: "20px", height: "20px" }), children);
|
16705
16554
|
var Submenu2 = ({ children, title, icon, defaultOpen = false }) => {
|
16706
|
-
const [open, setOpen] =
|
16555
|
+
const [open, setOpen] = React107.useState(defaultOpen);
|
16707
16556
|
const id = uniqueId2();
|
16708
|
-
return /* @__PURE__ */
|
16557
|
+
return /* @__PURE__ */ React107.createElement(
|
16709
16558
|
Navigation.Submenu,
|
16710
16559
|
{
|
16711
|
-
title: /* @__PURE__ */
|
16560
|
+
title: /* @__PURE__ */ React107.createElement(React107.Fragment, null, /* @__PURE__ */ React107.createElement(InlineIcon, { icon: open ? import_caretUpFilled.default : import_caretDownFilled.default, width: "12px", height: "12px", className: "mr-1" }), /* @__PURE__ */ React107.createElement(Box.Flex, { paddingX: "1", gap: "4" }, icon && /* @__PURE__ */ React107.createElement(InlineIcon, { icon, width: "20px", height: "20px" }), title)),
|
16712
16561
|
"aria-expanded": open,
|
16713
16562
|
id,
|
16714
16563
|
onClick: (e) => {
|
@@ -16716,11 +16565,11 @@ var Submenu2 = ({ children, title, icon, defaultOpen = false }) => {
|
|
16716
16565
|
setOpen(!open);
|
16717
16566
|
}
|
16718
16567
|
},
|
16719
|
-
open && /* @__PURE__ */
|
16568
|
+
open && /* @__PURE__ */ React107.createElement("ul", { role: "menu", className: classNames11(tw("flex flex-col")), "aria-labelledby": id }, children)
|
16720
16569
|
);
|
16721
16570
|
};
|
16722
16571
|
Submenu2.Item = Navigation.Submenu.Item;
|
16723
|
-
Navigation2.Item =
|
16572
|
+
Navigation2.Item = Item5;
|
16724
16573
|
Navigation2.Divider = Navigation.Divider;
|
16725
16574
|
Navigation2.Footer = Navigation.Footer;
|
16726
16575
|
Navigation2.Header = Navigation.Header;
|
@@ -16728,15 +16577,15 @@ Navigation2.Section = Navigation.Section;
|
|
16728
16577
|
Navigation2.Submenu = Submenu2;
|
16729
16578
|
|
16730
16579
|
// src/molecules/PageHeader/PageHeader.tsx
|
16731
|
-
import
|
16580
|
+
import React109 from "react";
|
16732
16581
|
import { castArray as castArray6 } from "lodash-es";
|
16733
16582
|
|
16734
16583
|
// src/atoms/PageHeader/PageHeader.tsx
|
16735
|
-
import
|
16736
|
-
var PageHeader = ({ children, className, ...rest }) => /* @__PURE__ */
|
16737
|
-
PageHeader.Container = ({ children, className, ...rest }) => /* @__PURE__ */
|
16738
|
-
PageHeader.TitleContainer = ({ children, className, ...rest }) => /* @__PURE__ */
|
16739
|
-
PageHeader.Title = ({ isSubHeader = false, children, ...rest }) => /* @__PURE__ */
|
16584
|
+
import React108 from "react";
|
16585
|
+
var PageHeader = ({ children, className, ...rest }) => /* @__PURE__ */ React108.createElement("div", { className: classNames(tw("flex flex-row gap-4 pb-6"), className), ...rest }, children);
|
16586
|
+
PageHeader.Container = ({ children, className, ...rest }) => /* @__PURE__ */ React108.createElement("div", { className: classNames(tw("flex flex-col grow gap-0"), className), ...rest }, children);
|
16587
|
+
PageHeader.TitleContainer = ({ children, className, ...rest }) => /* @__PURE__ */ React108.createElement("div", { className: classNames(tw("flex flex-col justify-center gap-2"), className), ...rest }, children);
|
16588
|
+
PageHeader.Title = ({ isSubHeader = false, children, ...rest }) => /* @__PURE__ */ React108.createElement(
|
16740
16589
|
Typography2,
|
16741
16590
|
{
|
16742
16591
|
...rest,
|
@@ -16746,9 +16595,9 @@ PageHeader.Title = ({ isSubHeader = false, children, ...rest }) => /* @__PURE__
|
|
16746
16595
|
},
|
16747
16596
|
children
|
16748
16597
|
);
|
16749
|
-
PageHeader.Subtitle = ({ children, ...rest }) => /* @__PURE__ */
|
16750
|
-
PageHeader.Chips = ({ children, className, ...rest }) => /* @__PURE__ */
|
16751
|
-
PageHeader.Actions = ({ children, className, ...rest }) => /* @__PURE__ */
|
16598
|
+
PageHeader.Subtitle = ({ children, ...rest }) => /* @__PURE__ */ React108.createElement(Typography2.Small, { ...rest, color: "default" }, children);
|
16599
|
+
PageHeader.Chips = ({ children, className, ...rest }) => /* @__PURE__ */ React108.createElement("div", { className: classNames(tw("flex gap-3"), className), ...rest }, children);
|
16600
|
+
PageHeader.Actions = ({ children, className, ...rest }) => /* @__PURE__ */ React108.createElement("div", { className: classNames(tw("flex flex-row gap-4 self-start"), className), ...rest }, children);
|
16752
16601
|
|
16753
16602
|
// src/molecules/PageHeader/PageHeader.tsx
|
16754
16603
|
var import_more5 = __toESM(require_more());
|
@@ -16774,28 +16623,28 @@ var CommonPageHeader = ({
|
|
16774
16623
|
"Limit the combined `primaryAction` and `secondaryActions` to 2 actions. Use the `menu` prop for additional actions."
|
16775
16624
|
);
|
16776
16625
|
}
|
16777
|
-
return /* @__PURE__ */
|
16626
|
+
return /* @__PURE__ */ React109.createElement(PageHeader, { className: "Aquarium-PageHeader" }, /* @__PURE__ */ React109.createElement(PageHeader.Container, null, breadcrumbs && /* @__PURE__ */ React109.createElement(Box, { marginBottom: "3" }, /* @__PURE__ */ React109.createElement(Breadcrumbs, null, breadcrumbs)), /* @__PURE__ */ React109.createElement(Spacing, { row: true, gap: "5" }, image && /* @__PURE__ */ React109.createElement("img", { src: image, alt: imageAlt ?? "", className: tw("w-[56px] h-[56px]") }), /* @__PURE__ */ React109.createElement(PageHeader.TitleContainer, null, /* @__PURE__ */ React109.createElement(PageHeader.Title, { isSubHeader }, title), chips.length > 0 && /* @__PURE__ */ React109.createElement(PageHeader.Chips, null, chips.map((chip) => /* @__PURE__ */ React109.createElement(Chip2, { key: chip, dense: true, text: chip }))), subtitle && /* @__PURE__ */ React109.createElement(PageHeader.Subtitle, null, subtitle)))), (secondaryActions ?? primaryAction ?? secondaryAction ?? menu) && /* @__PURE__ */ React109.createElement(PageHeader.Actions, null, menu && /* @__PURE__ */ React109.createElement(Box.Flex, { alignItems: "center" }, /* @__PURE__ */ React109.createElement(
|
16778
16627
|
DropdownMenu2,
|
16779
16628
|
{
|
16780
16629
|
placement: defaultContextualMenuPlacement,
|
16781
16630
|
onAction: (action) => onAction(action),
|
16782
16631
|
onOpenChange: onMenuOpenChange
|
16783
16632
|
},
|
16784
|
-
/* @__PURE__ */
|
16633
|
+
/* @__PURE__ */ React109.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ React109.createElement(Button2.Icon, { "aria-label": menuAriaLabel, icon: import_more5.default })),
|
16785
16634
|
menu
|
16786
16635
|
)), secondaryActions && castArray6(secondaryActions).filter(Boolean).map((secondaryAction2) => renderAction({ kind: "secondary", action: secondaryAction2 })), primaryAction && renderAction({ kind: "primary", action: primaryAction })));
|
16787
16636
|
};
|
16788
|
-
var PageHeader2 = (props) => /* @__PURE__ */
|
16637
|
+
var PageHeader2 = (props) => /* @__PURE__ */ React109.createElement(CommonPageHeader, { ...props });
|
16789
16638
|
PageHeader2.displayName = "PageHeader";
|
16790
|
-
var SubHeader = (props) => /* @__PURE__ */
|
16639
|
+
var SubHeader = (props) => /* @__PURE__ */ React109.createElement(CommonPageHeader, { ...props, isSubHeader: true });
|
16791
16640
|
PageHeader2.SubHeader = SubHeader;
|
16792
16641
|
PageHeader2.SubHeader.displayName = "PageHeader.SubHeader";
|
16793
16642
|
|
16794
16643
|
// src/molecules/Popover/PopoverContext.tsx
|
16795
|
-
import { createContext as
|
16796
|
-
var PopoverContext2 =
|
16644
|
+
import { createContext as createContext6, useContext as useContext8 } from "react";
|
16645
|
+
var PopoverContext2 = createContext6(null);
|
16797
16646
|
var usePopoverContext = () => {
|
16798
|
-
const ctx =
|
16647
|
+
const ctx = useContext8(PopoverContext2);
|
16799
16648
|
if (ctx === null) {
|
16800
16649
|
throw new Error("PopoverContext was used outside of provider.");
|
16801
16650
|
}
|
@@ -16803,16 +16652,16 @@ var usePopoverContext = () => {
|
|
16803
16652
|
};
|
16804
16653
|
|
16805
16654
|
// src/molecules/PopoverDialog/PopoverDialog.tsx
|
16806
|
-
import
|
16807
|
-
import { noop, omit as
|
16655
|
+
import React111, { createContext as createContext7 } from "react";
|
16656
|
+
import { noop as noop3, omit as omit16 } from "lodash-es";
|
16808
16657
|
|
16809
16658
|
// src/atoms/PopoverDialog/PopoverDialog.tsx
|
16810
|
-
import
|
16811
|
-
var Header2 = ({ children, className, ...rest }) => /* @__PURE__ */
|
16812
|
-
var Title3 = ({ children, className, ...rest }) => /* @__PURE__ */
|
16813
|
-
var Body = ({ children, className, ...rest }) => /* @__PURE__ */
|
16814
|
-
var Footer2 = ({ children, className, ...rest }) => /* @__PURE__ */
|
16815
|
-
var Actions2 = ({ children, className, ...rest }) => /* @__PURE__ */
|
16659
|
+
import React110 from "react";
|
16660
|
+
var Header2 = ({ children, className, ...rest }) => /* @__PURE__ */ React110.createElement("div", { ...rest, className: classNames(tw("p-5 gap-3 flex items-center"), className) }, children);
|
16661
|
+
var Title3 = ({ children, className, ...rest }) => /* @__PURE__ */ React110.createElement(Typography, { ...rest, htmlTag: "h1", variant: "small-strong" }, children);
|
16662
|
+
var Body = ({ children, className, ...rest }) => /* @__PURE__ */ React110.createElement(Typography, { ...rest, htmlTag: "div", variant: "caption", className: classNames(tw("px-5 overflow-y-auto"), className) }, children);
|
16663
|
+
var Footer2 = ({ children, className, ...rest }) => /* @__PURE__ */ React110.createElement("div", { ...rest, className: classNames(tw("p-5"), className) }, children);
|
16664
|
+
var Actions2 = ({ children, className, ...rest }) => /* @__PURE__ */ React110.createElement("div", { ...rest, className: classNames(tw("flex gap-4"), className) }, children);
|
16816
16665
|
var PopoverDialog = {
|
16817
16666
|
Header: Header2,
|
16818
16667
|
Title: Title3,
|
@@ -16822,17 +16671,17 @@ var PopoverDialog = {
|
|
16822
16671
|
};
|
16823
16672
|
|
16824
16673
|
// src/molecules/PopoverDialog/PopoverDialog.tsx
|
16825
|
-
var PopoverDialogPropsContext =
|
16674
|
+
var PopoverDialogPropsContext = createContext7({
|
16826
16675
|
title: "",
|
16827
|
-
primaryAction: { text: "", onClick:
|
16676
|
+
primaryAction: { text: "", onClick: noop3 }
|
16828
16677
|
});
|
16829
16678
|
var PopoverDialog2 = ({ placement, open, children, ...props }) => {
|
16830
|
-
return /* @__PURE__ */
|
16679
|
+
return /* @__PURE__ */ React111.createElement(Popover3, { placement }, /* @__PURE__ */ React111.createElement(PopoverDialogPropsContext.Provider, { value: props }, children));
|
16831
16680
|
};
|
16832
16681
|
PopoverDialog2.Trigger = Popover3.Trigger;
|
16833
16682
|
var Prompt = ({ children }) => {
|
16834
|
-
const { title, primaryAction, secondaryAction } =
|
16835
|
-
return /* @__PURE__ */
|
16683
|
+
const { title, primaryAction, secondaryAction } = React111.useContext(PopoverDialogPropsContext);
|
16684
|
+
return /* @__PURE__ */ React111.createElement(Popover3.Panel, { className: "Aquarium-PopoverDialog max-w-[300px]" }, /* @__PURE__ */ React111.createElement(PopoverDialog.Header, null, /* @__PURE__ */ React111.createElement(PopoverDialog.Title, null, title)), /* @__PURE__ */ React111.createElement(PopoverDialog.Body, null, children), /* @__PURE__ */ React111.createElement(PopoverDialog.Footer, null, /* @__PURE__ */ React111.createElement(PopoverDialog.Actions, null, secondaryAction && /* @__PURE__ */ React111.createElement(Popover3.CloseToggle, null, /* @__PURE__ */ React111.createElement(Button2, { key: secondaryAction.text, kind: "secondary", dense: true, ...omit16(secondaryAction, "text") }, secondaryAction.text)), /* @__PURE__ */ React111.createElement(Popover3.CloseToggle, null, /* @__PURE__ */ React111.createElement(Button2, { key: primaryAction.text, kind: "ghost", dense: true, ...omit16(primaryAction, "text") }, primaryAction.text)))));
|
16836
16685
|
};
|
16837
16686
|
Prompt.displayName = "PopoverDialog.Prompt";
|
16838
16687
|
PopoverDialog2.Prompt = Prompt;
|
@@ -16842,12 +16691,12 @@ import { createPortal } from "react-dom";
|
|
16842
16691
|
var Portal = ({ children, to }) => createPortal(children, to);
|
16843
16692
|
|
16844
16693
|
// src/molecules/ProgressBar/ProgressBar.tsx
|
16845
|
-
import
|
16694
|
+
import React113 from "react";
|
16846
16695
|
|
16847
16696
|
// src/atoms/ProgressBar/ProgressBar.tsx
|
16848
|
-
import
|
16697
|
+
import React112 from "react";
|
16849
16698
|
import { clamp as clamp3 } from "lodash-es";
|
16850
|
-
var ProgressBar = ({ children, className, ...rest }) => /* @__PURE__ */
|
16699
|
+
var ProgressBar = ({ children, className, ...rest }) => /* @__PURE__ */ React112.createElement(
|
16851
16700
|
"div",
|
16852
16701
|
{
|
16853
16702
|
...rest,
|
@@ -16863,7 +16712,7 @@ var STATUS_COLORS = {
|
|
16863
16712
|
};
|
16864
16713
|
ProgressBar.Indicator = ({ min, max, value, "aria-label": ariaLabel, status, className, ...rest }) => {
|
16865
16714
|
const completedPercentage = clamp3((value - min) / (max - min) * 100, 0, 100);
|
16866
|
-
return /* @__PURE__ */
|
16715
|
+
return /* @__PURE__ */ React112.createElement(
|
16867
16716
|
"div",
|
16868
16717
|
{
|
16869
16718
|
...rest,
|
@@ -16881,7 +16730,7 @@ ProgressBar.Indicator = ({ min, max, value, "aria-label": ariaLabel, status, cla
|
|
16881
16730
|
}
|
16882
16731
|
);
|
16883
16732
|
};
|
16884
|
-
ProgressBar.Labels = ({ children, startLabel, endLabel, className, ...rest }) => /* @__PURE__ */
|
16733
|
+
ProgressBar.Labels = ({ children, startLabel, endLabel, className, ...rest }) => /* @__PURE__ */ React112.createElement("div", { className: classNames(tw("flex flex-row"), className) }, /* @__PURE__ */ React112.createElement("span", { ...rest, className: tw("grow text-default typography-caption") }, startLabel), /* @__PURE__ */ React112.createElement("span", { ...rest, className: tw("grow text-default typography-caption text-right") }, endLabel));
|
16885
16734
|
|
16886
16735
|
// src/molecules/ProgressBar/ProgressBar.tsx
|
16887
16736
|
var ProgressBar2 = (props) => {
|
@@ -16896,7 +16745,7 @@ var ProgressBar2 = (props) => {
|
|
16896
16745
|
if (min > max) {
|
16897
16746
|
throw new Error("`min` value provided to `ProgressBar` is greater than `max` value.");
|
16898
16747
|
}
|
16899
|
-
const progress = /* @__PURE__ */
|
16748
|
+
const progress = /* @__PURE__ */ React113.createElement(ProgressBar, null, /* @__PURE__ */ React113.createElement(
|
16900
16749
|
ProgressBar.Indicator,
|
16901
16750
|
{
|
16902
16751
|
status: value === max ? completedStatus : progresStatus,
|
@@ -16909,18 +16758,18 @@ var ProgressBar2 = (props) => {
|
|
16909
16758
|
if (props.dense) {
|
16910
16759
|
return progress;
|
16911
16760
|
}
|
16912
|
-
return /* @__PURE__ */
|
16761
|
+
return /* @__PURE__ */ React113.createElement("div", { className: "Aquarium-ProgressBar" }, progress, /* @__PURE__ */ React113.createElement(ProgressBar.Labels, { className: tw("py-2"), startLabel: props.startLabel, endLabel: props.endLabel }));
|
16913
16762
|
};
|
16914
|
-
var ProgressBarSkeleton = () => /* @__PURE__ */
|
16763
|
+
var ProgressBarSkeleton = () => /* @__PURE__ */ React113.createElement(Skeleton, { height: 4, display: "block" });
|
16915
16764
|
ProgressBar2.Skeleton = ProgressBarSkeleton;
|
16916
16765
|
ProgressBar2.Skeleton.displayName = "ProgressBar.Skeleton";
|
16917
16766
|
|
16918
16767
|
// src/molecules/RadioButton/RadioButton.tsx
|
16919
|
-
import
|
16920
|
-
var RadioButton2 =
|
16768
|
+
import React114 from "react";
|
16769
|
+
var RadioButton2 = React114.forwardRef(
|
16921
16770
|
({ name, id, readOnly = false, disabled = false, caption, children, "aria-label": ariaLabel, ...props }, ref) => {
|
16922
16771
|
const isChecked = props.checked ?? props.defaultChecked;
|
16923
|
-
return !readOnly || isChecked ? /* @__PURE__ */
|
16772
|
+
return !readOnly || isChecked ? /* @__PURE__ */ React114.createElement(
|
16924
16773
|
ControlLabel,
|
16925
16774
|
{
|
16926
16775
|
htmlFor: id,
|
@@ -16932,20 +16781,20 @@ var RadioButton2 = React113.forwardRef(
|
|
16932
16781
|
style: { gap: "0 8px" },
|
16933
16782
|
className: "Aquarium-RadioButton"
|
16934
16783
|
},
|
16935
|
-
!readOnly && /* @__PURE__ */
|
16784
|
+
!readOnly && /* @__PURE__ */ React114.createElement(RadioButton, { id, ref, name, ...props, readOnly, disabled })
|
16936
16785
|
) : null;
|
16937
16786
|
}
|
16938
16787
|
);
|
16939
16788
|
RadioButton2.displayName = "RadioButton";
|
16940
|
-
var RadioButtonSkeleton = () => /* @__PURE__ */
|
16789
|
+
var RadioButtonSkeleton = () => /* @__PURE__ */ React114.createElement("div", { className: tw("flex gap-3") }, /* @__PURE__ */ React114.createElement(Skeleton, { height: 20, width: 20 }), /* @__PURE__ */ React114.createElement(Skeleton, { height: 20, width: 150 }));
|
16941
16790
|
RadioButton2.Skeleton = RadioButtonSkeleton;
|
16942
16791
|
RadioButton2.Skeleton.displayName = "RadioButton.Skeleton";
|
16943
16792
|
|
16944
16793
|
// src/molecules/RadioButtonGroup/RadioButtonGroup.tsx
|
16945
|
-
import
|
16794
|
+
import React115 from "react";
|
16946
16795
|
import { useId as useId16 } from "@react-aria/utils";
|
16947
16796
|
var isRadioButton = (c) => {
|
16948
|
-
return
|
16797
|
+
return React115.isValidElement(c) && c.type === RadioButton2;
|
16949
16798
|
};
|
16950
16799
|
var RadioButtonGroup = ({
|
16951
16800
|
name,
|
@@ -16957,7 +16806,7 @@ var RadioButtonGroup = ({
|
|
16957
16806
|
children,
|
16958
16807
|
...props
|
16959
16808
|
}) => {
|
16960
|
-
const [value, setValue] =
|
16809
|
+
const [value, setValue] = React115.useState(_value ?? defaultValue ?? "");
|
16961
16810
|
const errorMessageId = useId16();
|
16962
16811
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
16963
16812
|
const labelControlProps = getLabelControlProps(props);
|
@@ -16968,13 +16817,13 @@ var RadioButtonGroup = ({
|
|
16968
16817
|
setValue(e.target.value);
|
16969
16818
|
onChange?.(e.target.value);
|
16970
16819
|
};
|
16971
|
-
const content =
|
16820
|
+
const content = React115.Children.map(children, (c) => {
|
16972
16821
|
if (!isRadioButton(c)) {
|
16973
16822
|
return null;
|
16974
16823
|
}
|
16975
16824
|
const defaultChecked = defaultValue === void 0 ? void 0 : c.props.value === defaultValue;
|
16976
16825
|
const checked = value === void 0 ? void 0 : c.props.value === value;
|
16977
|
-
return
|
16826
|
+
return React115.cloneElement(c, {
|
16978
16827
|
name,
|
16979
16828
|
defaultChecked: c.props.defaultChecked ?? defaultChecked,
|
16980
16829
|
checked: c.props.checked ?? checked,
|
@@ -16983,11 +16832,11 @@ var RadioButtonGroup = ({
|
|
16983
16832
|
readOnly
|
16984
16833
|
});
|
16985
16834
|
});
|
16986
|
-
return /* @__PURE__ */
|
16835
|
+
return /* @__PURE__ */ React115.createElement(LabelControl, { fieldset: true, ...labelControlProps, ...errorProps, className: "Aquarium-RadioButtonGroup" }, cols && /* @__PURE__ */ React115.createElement(InputGroup, { cols }, content), !cols && /* @__PURE__ */ React115.createElement(Box.Flex, { flexDirection: "row", alignItems: "flex-start", colGap: "8", rowGap: "3", flexWrap: "wrap" }, content));
|
16987
16836
|
};
|
16988
16837
|
var RadioButtonGroupSkeleton = ({ cols, options = 2 }) => {
|
16989
16838
|
const isRow = !cols || parseInt(cols, 10) > 1;
|
16990
|
-
return /* @__PURE__ */
|
16839
|
+
return /* @__PURE__ */ React115.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React115.createElement(
|
16991
16840
|
"div",
|
16992
16841
|
{
|
16993
16842
|
className: tw("flex flex-wrap", {
|
@@ -16995,27 +16844,27 @@ var RadioButtonGroupSkeleton = ({ cols, options = 2 }) => {
|
|
16995
16844
|
"flex-col gap-2": !isRow
|
16996
16845
|
})
|
16997
16846
|
},
|
16998
|
-
Array.from({ length: options }).map((_, key) => /* @__PURE__ */
|
16847
|
+
Array.from({ length: options }).map((_, key) => /* @__PURE__ */ React115.createElement(RadioButton2.Skeleton, { key }))
|
16999
16848
|
));
|
17000
16849
|
};
|
17001
16850
|
RadioButtonGroup.Skeleton = RadioButtonGroupSkeleton;
|
17002
16851
|
RadioButtonGroup.Skeleton.displayName = "RadioButtonGroup.Skeleton";
|
17003
16852
|
|
17004
16853
|
// src/molecules/Section/Section.tsx
|
17005
|
-
import
|
16854
|
+
import React120, { useRef as useRef13 } from "react";
|
17006
16855
|
import { useButton as useButton4 } from "@react-aria/button";
|
17007
16856
|
import { useId as useId17 } from "@react-aria/utils";
|
17008
16857
|
import { animated as animated6, useSpring as useSpring5 } from "@react-spring/web";
|
17009
16858
|
import { castArray as castArray7, isUndefined as isUndefined9 } from "lodash-es";
|
17010
16859
|
|
17011
16860
|
// src/molecules/Switch/Switch.tsx
|
17012
|
-
import
|
16861
|
+
import React117 from "react";
|
17013
16862
|
|
17014
16863
|
// src/atoms/Switch/Switch.tsx
|
17015
|
-
import
|
16864
|
+
import React116 from "react";
|
17016
16865
|
var import_ban2 = __toESM(require_ban());
|
17017
|
-
var Switch =
|
17018
|
-
({ id, children, name, disabled = false, readOnly = false, ...props }, ref) => /* @__PURE__ */
|
16866
|
+
var Switch = React116.forwardRef(
|
16867
|
+
({ id, children, name, disabled = false, readOnly = false, ...props }, ref) => /* @__PURE__ */ React116.createElement("span", { className: tw("relative inline-flex justify-center items-center self-center group") }, /* @__PURE__ */ React116.createElement(
|
17019
16868
|
"input",
|
17020
16869
|
{
|
17021
16870
|
id,
|
@@ -17037,7 +16886,7 @@ var Switch = React115.forwardRef(
|
|
17037
16886
|
readOnly,
|
17038
16887
|
disabled
|
17039
16888
|
}
|
17040
|
-
), /* @__PURE__ */
|
16889
|
+
), /* @__PURE__ */ React116.createElement(
|
17041
16890
|
"span",
|
17042
16891
|
{
|
17043
16892
|
className: tw(
|
@@ -17048,12 +16897,12 @@ var Switch = React115.forwardRef(
|
|
17048
16897
|
}
|
17049
16898
|
)
|
17050
16899
|
},
|
17051
|
-
disabled && /* @__PURE__ */
|
16900
|
+
disabled && /* @__PURE__ */ React116.createElement(Icon, { icon: import_ban2.default, width: "10px", height: "10px" })
|
17052
16901
|
))
|
17053
16902
|
);
|
17054
16903
|
|
17055
16904
|
// src/molecules/Switch/Switch.tsx
|
17056
|
-
var Switch2 =
|
16905
|
+
var Switch2 = React117.forwardRef(
|
17057
16906
|
({
|
17058
16907
|
id,
|
17059
16908
|
name,
|
@@ -17066,7 +16915,7 @@ var Switch2 = React116.forwardRef(
|
|
17066
16915
|
...props
|
17067
16916
|
}, ref) => {
|
17068
16917
|
const isChecked = props.checked ?? props.defaultChecked;
|
17069
|
-
return !readOnly || isChecked ? /* @__PURE__ */
|
16918
|
+
return !readOnly || isChecked ? /* @__PURE__ */ React117.createElement(
|
17070
16919
|
ControlLabel,
|
17071
16920
|
{
|
17072
16921
|
htmlFor: id,
|
@@ -17079,17 +16928,17 @@ var Switch2 = React116.forwardRef(
|
|
17079
16928
|
labelPlacement,
|
17080
16929
|
className: "Aquarium-Switch"
|
17081
16930
|
},
|
17082
|
-
!readOnly && /* @__PURE__ */
|
16931
|
+
!readOnly && /* @__PURE__ */ React117.createElement(Switch, { id, ref, name, ...props, readOnly, disabled })
|
17083
16932
|
) : null;
|
17084
16933
|
}
|
17085
16934
|
);
|
17086
16935
|
Switch2.displayName = "Switch";
|
17087
|
-
var SwitchSkeleton = () => /* @__PURE__ */
|
16936
|
+
var SwitchSkeleton = () => /* @__PURE__ */ React117.createElement("div", { className: tw("flex gap-3") }, /* @__PURE__ */ React117.createElement(Skeleton, { height: 20, width: 35 }), /* @__PURE__ */ React117.createElement(Skeleton, { height: 20, width: 150 }));
|
17088
16937
|
Switch2.Skeleton = SwitchSkeleton;
|
17089
16938
|
Switch2.Skeleton.displayName = "Switch.Skeleton ";
|
17090
16939
|
|
17091
16940
|
// src/molecules/TagLabel/TagLabel.tsx
|
17092
|
-
import
|
16941
|
+
import React118 from "react";
|
17093
16942
|
var getVariantClassNames = (variant = "primary") => {
|
17094
16943
|
switch (variant) {
|
17095
16944
|
case "neutral":
|
@@ -17103,7 +16952,7 @@ var getVariantClassNames = (variant = "primary") => {
|
|
17103
16952
|
return tw("bg-primary-default");
|
17104
16953
|
}
|
17105
16954
|
};
|
17106
|
-
var TagLabel = ({ title, dense = false, variant, ...rest }) => /* @__PURE__ */
|
16955
|
+
var TagLabel = ({ title, dense = false, variant, ...rest }) => /* @__PURE__ */ React118.createElement(
|
17107
16956
|
"span",
|
17108
16957
|
{
|
17109
16958
|
...rest,
|
@@ -17121,14 +16970,14 @@ var TagLabel = ({ title, dense = false, variant, ...rest }) => /* @__PURE__ */ R
|
|
17121
16970
|
);
|
17122
16971
|
|
17123
16972
|
// src/atoms/Section/Section.tsx
|
17124
|
-
import
|
16973
|
+
import React119 from "react";
|
17125
16974
|
var import_caretUp2 = __toESM(require_caretUp());
|
17126
|
-
var
|
16975
|
+
var Section2 = ({
|
17127
16976
|
children,
|
17128
16977
|
className,
|
17129
16978
|
...rest
|
17130
|
-
}) => /* @__PURE__ */
|
17131
|
-
|
16979
|
+
}) => /* @__PURE__ */ React119.createElement(Box, { component: "section", ...rest, className: classNames(tw("border border-muted"), className) }, children);
|
16980
|
+
Section2.Header = ({ children, className, expanded, ...rest }) => /* @__PURE__ */ React119.createElement(
|
17132
16981
|
"div",
|
17133
16982
|
{
|
17134
16983
|
...rest,
|
@@ -17141,8 +16990,8 @@ Section3.Header = ({ children, className, expanded, ...rest }) => /* @__PURE__ *
|
|
17141
16990
|
},
|
17142
16991
|
children
|
17143
16992
|
);
|
17144
|
-
|
17145
|
-
({ children, className, collapsible, ...rest }, ref) => /* @__PURE__ */
|
16993
|
+
Section2.TitleContainer = React119.forwardRef(
|
16994
|
+
({ children, className, collapsible, ...rest }, ref) => /* @__PURE__ */ React119.createElement(
|
17146
16995
|
"div",
|
17147
16996
|
{
|
17148
16997
|
...rest,
|
@@ -17157,25 +17006,25 @@ Section3.TitleContainer = React118.forwardRef(
|
|
17157
17006
|
children
|
17158
17007
|
)
|
17159
17008
|
);
|
17160
|
-
|
17161
|
-
|
17162
|
-
|
17163
|
-
|
17164
|
-
|
17009
|
+
Section2.Toggle = (props) => /* @__PURE__ */ React119.createElement(Icon, { ...props, icon: import_caretUp2.default, height: 22, width: 22 });
|
17010
|
+
Section2.Title = ({ children, ...rest }) => /* @__PURE__ */ React119.createElement(Typography2.Large, { ...rest, htmlTag: "h2", color: "intense", className: "flex gap-3 items-center" }, children);
|
17011
|
+
Section2.Subtitle = ({ children, ...rest }) => /* @__PURE__ */ React119.createElement(Typography2.Small, { ...rest, color: "default" }, children);
|
17012
|
+
Section2.Actions = ({ children, className, ...rest }) => /* @__PURE__ */ React119.createElement("div", { ...rest, className: classNames(tw("flex gap-4 justify-end"), className) }, children);
|
17013
|
+
Section2.Body = ({ children, className, ...rest }) => /* @__PURE__ */ React119.createElement("div", { ...rest, className: classNames(tw("p-6"), className) }, /* @__PURE__ */ React119.createElement(Typography, { htmlTag: "div", color: "default" }, children));
|
17165
17014
|
|
17166
17015
|
// src/molecules/Section/Section.tsx
|
17167
17016
|
var import_more6 = __toESM(require_more());
|
17168
|
-
var
|
17017
|
+
var Section3 = (props) => {
|
17169
17018
|
const { title, subtitle, children } = props;
|
17170
17019
|
const _collapsible = title ? props.collapsible ?? false : false;
|
17171
17020
|
const _collapsed = title ? props.collapsed : void 0;
|
17172
17021
|
const _defaultCollapsed = title ? props.defaultCollapsed ?? false : false;
|
17173
|
-
const [isCollapsed, setCollapsed] =
|
17174
|
-
const [isResting, setResting] =
|
17022
|
+
const [isCollapsed, setCollapsed] = React120.useState(_collapsed ?? _defaultCollapsed);
|
17023
|
+
const [isResting, setResting] = React120.useState(true);
|
17175
17024
|
const [ref, { height }] = useMeasure();
|
17176
17025
|
const toggleAreaRef = useRef13(null);
|
17177
17026
|
const isMounted = useRef13(true);
|
17178
|
-
|
17027
|
+
React120.useEffect(
|
17179
17028
|
() => () => {
|
17180
17029
|
isMounted.current = false;
|
17181
17030
|
},
|
@@ -17219,8 +17068,8 @@ var Section4 = (props) => {
|
|
17219
17068
|
{ "elementType": "div", "onPress": handleTitleClick, "aria-expanded": !isCollapsed, "aria-controls": regionId },
|
17220
17069
|
toggleAreaRef
|
17221
17070
|
);
|
17222
|
-
return /* @__PURE__ */
|
17223
|
-
|
17071
|
+
return /* @__PURE__ */ React120.createElement(Section2, { "aria-label": title, className: _collapsible ? "Aquarium-Collapsible-Section" : "Aquarium-Section" }, title && /* @__PURE__ */ React120.createElement(React120.Fragment, null, /* @__PURE__ */ React120.createElement(Section2.Header, { expanded: _collapsible && !isCollapsed }, /* @__PURE__ */ React120.createElement(
|
17072
|
+
Section2.TitleContainer,
|
17224
17073
|
{
|
17225
17074
|
..._collapsible ? {
|
17226
17075
|
...buttonProps,
|
@@ -17234,20 +17083,20 @@ var Section4 = (props) => {
|
|
17234
17083
|
collapsible: _collapsible
|
17235
17084
|
},
|
17236
17085
|
_collapsible && // @ts-expect-error React spring does not yet support R19 types
|
17237
|
-
/* @__PURE__ */
|
17238
|
-
/* @__PURE__ */
|
17239
|
-
subtitle && /* @__PURE__ */
|
17240
|
-
), !isCollapsed && /* @__PURE__ */
|
17086
|
+
/* @__PURE__ */ React120.createElement(animated6.div, { style: { transform } }, /* @__PURE__ */ React120.createElement(Section2.Toggle, null)),
|
17087
|
+
/* @__PURE__ */ React120.createElement(Section2.Title, { id: titleId }, /* @__PURE__ */ React120.createElement(LineClamp2, { lines: 1 }, title), props.tag && /* @__PURE__ */ React120.createElement(TagLabel, { ...props.tag }), props.badge && /* @__PURE__ */ React120.createElement(Chip2, { text: props.badge }), props.chip && /* @__PURE__ */ React120.createElement(StatusChip, { ...props.chip })),
|
17088
|
+
subtitle && /* @__PURE__ */ React120.createElement(Section2.Subtitle, { className: tw("row-start-2", { "col-start-2": _collapsible }) }, /* @__PURE__ */ React120.createElement(LineClamp2, { lines: 1 }, subtitle))
|
17089
|
+
), !isCollapsed && /* @__PURE__ */ React120.createElement(Section2.Actions, null, props.switch && /* @__PURE__ */ React120.createElement(Switch2, { ...props.switch }), menu && /* @__PURE__ */ React120.createElement(Box.Flex, { alignItems: "center" }, /* @__PURE__ */ React120.createElement(
|
17241
17090
|
DropdownMenu2,
|
17242
17091
|
{
|
17243
17092
|
onAction: (action) => onAction?.(action),
|
17244
17093
|
onOpenChange: onMenuOpenChange,
|
17245
17094
|
placement: defaultContextualMenuPlacement
|
17246
17095
|
},
|
17247
|
-
/* @__PURE__ */
|
17096
|
+
/* @__PURE__ */ React120.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ React120.createElement(Button2.Icon, { "aria-label": menuAriaLabel, icon: import_more6.default })),
|
17248
17097
|
menu
|
17249
|
-
)), props.actions && castArray7(props.actions).filter(Boolean).map((action) => renderAction({ kind: "secondary", action })), props.select && /* @__PURE__ */
|
17250
|
-
/* @__PURE__ */
|
17098
|
+
)), props.actions && castArray7(props.actions).filter(Boolean).map((action) => renderAction({ kind: "secondary", action })), props.select && /* @__PURE__ */ React120.createElement(SelectBase, { "aria-labelledby": titleId, ...props.select }))), !hasTabs && !isCollapsed && // @ts-expect-error React spring does not yet support R19 types
|
17099
|
+
/* @__PURE__ */ React120.createElement(animated6.div, { className: tw(`h-[1px]`), style: { backgroundColor: "var(--aquarium-border-color-muted)" } })), /* @__PURE__ */ React120.createElement(
|
17251
17100
|
animated6.div,
|
17252
17101
|
{
|
17253
17102
|
id: regionId,
|
@@ -17255,28 +17104,28 @@ var Section4 = (props) => {
|
|
17255
17104
|
style: spring,
|
17256
17105
|
className: tw({ "overflow-hidden": _collapsible && (isCollapsed || !isResting) })
|
17257
17106
|
},
|
17258
|
-
/* @__PURE__ */
|
17107
|
+
/* @__PURE__ */ React120.createElement("div", { ref }, hasTabs ? /* @__PURE__ */ React120.createElement(
|
17259
17108
|
SectionTabs,
|
17260
17109
|
{
|
17261
17110
|
...children.props,
|
17262
17111
|
className: tw("[&>div:first-child]:px-3 grow flex flex-col overflow-y-auto", { "mt-4": _collapsible })
|
17263
17112
|
}
|
17264
|
-
) : /* @__PURE__ */
|
17113
|
+
) : /* @__PURE__ */ React120.createElement(Section2.Body, null, children))
|
17265
17114
|
));
|
17266
17115
|
};
|
17267
|
-
var SectionTabs = createTabsComponent(ModalTab, TabItem, "SectionTabs", (children, selected) => /* @__PURE__ */
|
17116
|
+
var SectionTabs = createTabsComponent(ModalTab, TabItem, "SectionTabs", (children, selected) => /* @__PURE__ */ React120.createElement(Section2.Body, null, children.find(
|
17268
17117
|
(node, index) => node?.props.value === selected || index === selected
|
17269
17118
|
)));
|
17270
17119
|
|
17271
17120
|
// src/molecules/SegmentedControl/SegmentedControl.tsx
|
17272
|
-
import
|
17121
|
+
import React121 from "react";
|
17273
17122
|
var SegmentedControl = ({
|
17274
17123
|
children,
|
17275
17124
|
value,
|
17276
17125
|
selected = false,
|
17277
17126
|
className,
|
17278
17127
|
...rest
|
17279
|
-
}) => /* @__PURE__ */
|
17128
|
+
}) => /* @__PURE__ */ React121.createElement("li", null, /* @__PURE__ */ React121.createElement(
|
17280
17129
|
"button",
|
17281
17130
|
{
|
17282
17131
|
type: "button",
|
@@ -17294,7 +17143,7 @@ var SegmentedControlGroup = ({
|
|
17294
17143
|
ariaLabel,
|
17295
17144
|
...rest
|
17296
17145
|
}) => {
|
17297
|
-
return /* @__PURE__ */
|
17146
|
+
return /* @__PURE__ */ React121.createElement(
|
17298
17147
|
"ul",
|
17299
17148
|
{
|
17300
17149
|
...rest,
|
@@ -17305,9 +17154,9 @@ var SegmentedControlGroup = ({
|
|
17305
17154
|
className
|
17306
17155
|
)
|
17307
17156
|
},
|
17308
|
-
|
17157
|
+
React121.Children.map(
|
17309
17158
|
children,
|
17310
|
-
(child) =>
|
17159
|
+
(child) => React121.cloneElement(child, {
|
17311
17160
|
onClick: () => onChange(child.props.value),
|
17312
17161
|
selected: child.props.value === value
|
17313
17162
|
})
|
@@ -17325,18 +17174,18 @@ var getBaseSegmentedControlClassNames = (selected) => tw(
|
|
17325
17174
|
);
|
17326
17175
|
|
17327
17176
|
// src/molecules/Stepper/Stepper.tsx
|
17328
|
-
import
|
17177
|
+
import React123 from "react";
|
17329
17178
|
|
17330
17179
|
// src/atoms/Stepper/Stepper.tsx
|
17331
|
-
import
|
17180
|
+
import React122 from "react";
|
17332
17181
|
var import_tick6 = __toESM(require_tick());
|
17333
|
-
var Stepper = ({ className, ...rest }) => /* @__PURE__ */
|
17182
|
+
var Stepper = ({ className, ...rest }) => /* @__PURE__ */ React122.createElement("div", { ...rest, className: classNames(className) });
|
17334
17183
|
var ConnectorContainer = ({
|
17335
17184
|
className,
|
17336
17185
|
completed,
|
17337
17186
|
dense,
|
17338
17187
|
...rest
|
17339
|
-
}) => /* @__PURE__ */
|
17188
|
+
}) => /* @__PURE__ */ React122.createElement(
|
17340
17189
|
"div",
|
17341
17190
|
{
|
17342
17191
|
...rest,
|
@@ -17349,7 +17198,7 @@ var ConnectorContainer = ({
|
|
17349
17198
|
)
|
17350
17199
|
}
|
17351
17200
|
);
|
17352
|
-
var Connector = ({ children, className, completed, dense, ...rest }) => /* @__PURE__ */
|
17201
|
+
var Connector = ({ children, className, completed, dense, ...rest }) => /* @__PURE__ */ React122.createElement(
|
17353
17202
|
"div",
|
17354
17203
|
{
|
17355
17204
|
...rest,
|
@@ -17364,7 +17213,7 @@ var Connector = ({ children, className, completed, dense, ...rest }) => /* @__PU
|
|
17364
17213
|
)
|
17365
17214
|
}
|
17366
17215
|
);
|
17367
|
-
var Step = ({ className, state, ...rest }) => /* @__PURE__ */
|
17216
|
+
var Step = ({ className, state, ...rest }) => /* @__PURE__ */ React122.createElement(
|
17368
17217
|
"div",
|
17369
17218
|
{
|
17370
17219
|
...rest,
|
@@ -17387,7 +17236,7 @@ var getDenseClassNames = (state) => tw("h-[8px] w-[8px]", {
|
|
17387
17236
|
"bg-intense": state === "inactive",
|
17388
17237
|
"text-success-default": state === "completed"
|
17389
17238
|
});
|
17390
|
-
var Indicator = ({ children, className, state, dense, ...rest }) => /* @__PURE__ */
|
17239
|
+
var Indicator = ({ children, className, state, dense, ...rest }) => /* @__PURE__ */ React122.createElement(
|
17391
17240
|
"div",
|
17392
17241
|
{
|
17393
17242
|
...rest,
|
@@ -17398,7 +17247,7 @@ var Indicator = ({ children, className, state, dense, ...rest }) => /* @__PURE__
|
|
17398
17247
|
className
|
17399
17248
|
)
|
17400
17249
|
},
|
17401
|
-
state === "completed" ? /* @__PURE__ */
|
17250
|
+
state === "completed" ? /* @__PURE__ */ React122.createElement(InlineIcon, { icon: import_tick6.default }) : dense ? null : children
|
17402
17251
|
);
|
17403
17252
|
Step.Indicator = Indicator;
|
17404
17253
|
Stepper.Step = Step;
|
@@ -17407,13 +17256,13 @@ Stepper.ConnectorContainer = ConnectorContainer;
|
|
17407
17256
|
|
17408
17257
|
// src/molecules/Stepper/Stepper.tsx
|
17409
17258
|
var Stepper2 = ({ children, activeIndex, dense }) => {
|
17410
|
-
const steps =
|
17411
|
-
return /* @__PURE__ */
|
17259
|
+
const steps = React123.Children.count(children);
|
17260
|
+
return /* @__PURE__ */ React123.createElement(Stepper, { role: "list", className: "Aquarium-Stepper" }, /* @__PURE__ */ React123.createElement(Template, { columns: steps }, React123.Children.map(children, (child, index) => {
|
17412
17261
|
if (!isComponentType(child, Step2)) {
|
17413
17262
|
throw new Error("<Stepper> can only have <Stepper.Step> components as children");
|
17414
17263
|
} else {
|
17415
17264
|
const state = index > activeIndex ? "inactive" : index === activeIndex ? "active" : "completed";
|
17416
|
-
return /* @__PURE__ */
|
17265
|
+
return /* @__PURE__ */ React123.createElement(Stepper.Step, { state, "aria-current": state === "active" ? "step" : false, role: "listitem" }, index > 0 && index <= steps && /* @__PURE__ */ React123.createElement(Stepper.ConnectorContainer, { dense }, /* @__PURE__ */ React123.createElement(Stepper.ConnectorContainer.Connector, { completed: state === "completed" || state === "active" })), /* @__PURE__ */ React123.createElement(Stepper.Step.Indicator, { state, dense }, index + 1), child.props.children);
|
17417
17266
|
}
|
17418
17267
|
})));
|
17419
17268
|
};
|
@@ -17423,7 +17272,7 @@ Step2.displayName = "Stepper.Step";
|
|
17423
17272
|
Stepper2.Step = Step2;
|
17424
17273
|
|
17425
17274
|
// src/molecules/SwitchGroup/SwitchGroup.tsx
|
17426
|
-
import
|
17275
|
+
import React124, { useState as useState14 } from "react";
|
17427
17276
|
import { useId as useId18 } from "@react-aria/utils";
|
17428
17277
|
var SwitchGroup = ({
|
17429
17278
|
value,
|
@@ -17447,14 +17296,14 @@ var SwitchGroup = ({
|
|
17447
17296
|
setSelectedItems(updated);
|
17448
17297
|
onChange?.(updated);
|
17449
17298
|
};
|
17450
|
-
return /* @__PURE__ */
|
17299
|
+
return /* @__PURE__ */ React124.createElement(LabelControl, { fieldset: true, ...labelControlProps, ...errorProps, className: "Aquarium-SwitchGroup" }, /* @__PURE__ */ React124.createElement(InputGroup, { cols }, React124.Children.map(children, (c) => {
|
17451
17300
|
if (!isComponentType(c, Switch2)) {
|
17452
17301
|
return null;
|
17453
17302
|
}
|
17454
17303
|
const str = c.props.value?.toString();
|
17455
17304
|
const defaultChecked = defaultValue === void 0 ? void 0 : str !== void 0 && defaultValue.includes(str);
|
17456
17305
|
const checked = value === void 0 ? void 0 : str !== void 0 && value.includes(str);
|
17457
|
-
return
|
17306
|
+
return React124.cloneElement(c, {
|
17458
17307
|
defaultChecked: c.props.defaultChecked ?? defaultChecked,
|
17459
17308
|
checked: c.props.checked ?? checked,
|
17460
17309
|
onChange: c.props.onChange ?? handleChange,
|
@@ -17464,17 +17313,17 @@ var SwitchGroup = ({
|
|
17464
17313
|
})));
|
17465
17314
|
};
|
17466
17315
|
var SwitchGroupSkeleton = ({ options = 2 }) => {
|
17467
|
-
return /* @__PURE__ */
|
17316
|
+
return /* @__PURE__ */ React124.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React124.createElement("div", { className: tw("flex flex-wrap flex-col gap-2") }, Array.from({ length: options }).map((_, key) => /* @__PURE__ */ React124.createElement(Switch2.Skeleton, { key }))));
|
17468
17317
|
};
|
17469
17318
|
SwitchGroup.Skeleton = SwitchGroupSkeleton;
|
17470
17319
|
SwitchGroup.Skeleton.displayName = "SwitchGroup.Skeleton";
|
17471
17320
|
|
17472
17321
|
// src/molecules/Textarea/Textarea.tsx
|
17473
|
-
import
|
17322
|
+
import React125, { useState as useState15 } from "react";
|
17474
17323
|
import { useId as useId19 } from "@react-aria/utils";
|
17475
|
-
import { omit as
|
17476
|
-
var TextareaBase =
|
17477
|
-
({ readOnly = false, valid = true, ...props }, ref) => /* @__PURE__ */
|
17324
|
+
import { omit as omit17, toString as toString2 } from "lodash-es";
|
17325
|
+
var TextareaBase = React125.forwardRef(
|
17326
|
+
({ readOnly = false, valid = true, ...props }, ref) => /* @__PURE__ */ React125.createElement(
|
17478
17327
|
"textarea",
|
17479
17328
|
{
|
17480
17329
|
ref,
|
@@ -17484,16 +17333,16 @@ var TextareaBase = React124.forwardRef(
|
|
17484
17333
|
}
|
17485
17334
|
)
|
17486
17335
|
);
|
17487
|
-
TextareaBase.Skeleton = () => /* @__PURE__ */
|
17488
|
-
var Textarea =
|
17336
|
+
TextareaBase.Skeleton = () => /* @__PURE__ */ React125.createElement(Skeleton, { height: 58 });
|
17337
|
+
var Textarea = React125.forwardRef((props, ref) => {
|
17489
17338
|
const [value, setValue] = useState15(props.value ?? props.defaultValue ?? "");
|
17490
17339
|
const defaultId = useId19();
|
17491
17340
|
const id = props.id ?? defaultId;
|
17492
17341
|
const errorMessageId = useId19();
|
17493
17342
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
17494
17343
|
const { "data-testid": dataTestId, ...labelControlProps } = getLabelControlProps(props);
|
17495
|
-
const baseProps =
|
17496
|
-
return /* @__PURE__ */
|
17344
|
+
const baseProps = omit17(props, Object.keys(labelControlProps));
|
17345
|
+
return /* @__PURE__ */ React125.createElement(
|
17497
17346
|
LabelControl,
|
17498
17347
|
{
|
17499
17348
|
id: `${id}-label`,
|
@@ -17503,7 +17352,7 @@ var Textarea = React124.forwardRef((props, ref) => {
|
|
17503
17352
|
...labelControlProps,
|
17504
17353
|
className: "Aquarium-Textarea"
|
17505
17354
|
},
|
17506
|
-
/* @__PURE__ */
|
17355
|
+
/* @__PURE__ */ React125.createElement(
|
17507
17356
|
TextareaBase,
|
17508
17357
|
{
|
17509
17358
|
ref,
|
@@ -17524,24 +17373,24 @@ var Textarea = React124.forwardRef((props, ref) => {
|
|
17524
17373
|
);
|
17525
17374
|
});
|
17526
17375
|
Textarea.displayName = "Textarea";
|
17527
|
-
var TextAreaSkeleton = () => /* @__PURE__ */
|
17376
|
+
var TextAreaSkeleton = () => /* @__PURE__ */ React125.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React125.createElement(TextareaBase.Skeleton, null));
|
17528
17377
|
Textarea.Skeleton = TextAreaSkeleton;
|
17529
17378
|
Textarea.Skeleton.displayName = "Textarea.Skeleton";
|
17530
17379
|
|
17531
17380
|
// src/molecules/Timeline/Timeline.tsx
|
17532
|
-
import
|
17381
|
+
import React127 from "react";
|
17533
17382
|
|
17534
17383
|
// src/atoms/Timeline/Timeline.tsx
|
17535
|
-
import
|
17536
|
-
var Timeline = ({ className, ...rest }) => /* @__PURE__ */
|
17537
|
-
var Content2 = ({ className, ...rest }) => /* @__PURE__ */
|
17538
|
-
var
|
17539
|
-
var LineContainer = ({ className, ...rest }) => /* @__PURE__ */
|
17540
|
-
var Line = ({ className, ...rest }) => /* @__PURE__ */
|
17541
|
-
var Dot = ({ className, ...rest }) => /* @__PURE__ */
|
17542
|
-
|
17384
|
+
import React126 from "react";
|
17385
|
+
var Timeline = ({ className, ...rest }) => /* @__PURE__ */ React126.createElement("div", { ...rest, className: classNames(tw("grid grid-cols-[16px_1fr] gap-x-4"), className) });
|
17386
|
+
var Content2 = ({ className, ...rest }) => /* @__PURE__ */ React126.createElement("div", { ...rest, className: classNames(tw("pb-6"), className) });
|
17387
|
+
var Separator = ({ className, ...rest }) => /* @__PURE__ */ React126.createElement("div", { ...rest, className: classNames(tw("flex items-center justify-center h-5 w-5"), className) });
|
17388
|
+
var LineContainer = ({ className, ...rest }) => /* @__PURE__ */ React126.createElement("div", { ...rest, className: classNames(tw("flex justify-center py-1"), className) });
|
17389
|
+
var Line = ({ className, ...rest }) => /* @__PURE__ */ React126.createElement("div", { ...rest, className: classNames(tw("w-1 bg-default h-full justify-self-center"), className) });
|
17390
|
+
var Dot = ({ className, ...rest }) => /* @__PURE__ */ React126.createElement("div", { ...rest, className: classNames(tw("bg-intense h-[6px] w-[6px] rounded"), className) });
|
17391
|
+
Separator.Dot = Dot;
|
17543
17392
|
LineContainer.Line = Line;
|
17544
|
-
Timeline.Separator =
|
17393
|
+
Timeline.Separator = Separator;
|
17545
17394
|
Timeline.LineContainer = LineContainer;
|
17546
17395
|
Timeline.Content = Content2;
|
17547
17396
|
|
@@ -17550,23 +17399,23 @@ var import_error5 = __toESM(require_error());
|
|
17550
17399
|
var import_time2 = __toESM(require_time());
|
17551
17400
|
var import_warningSign5 = __toESM(require_warningSign());
|
17552
17401
|
var TimelineItem = () => null;
|
17553
|
-
var Timeline2 = ({ children }) => /* @__PURE__ */
|
17402
|
+
var Timeline2 = ({ children }) => /* @__PURE__ */ React127.createElement("div", { className: "Aquarium-Timeline" }, React127.Children.map(children, (item) => {
|
17554
17403
|
if (!isComponentType(item, TimelineItem)) {
|
17555
17404
|
throw new Error("<Timeline> can only have <Timeline.Item> components as children");
|
17556
17405
|
} else {
|
17557
17406
|
const { props, key } = item;
|
17558
|
-
return /* @__PURE__ */
|
17407
|
+
return /* @__PURE__ */ React127.createElement(Timeline, { key: key ?? props.title }, /* @__PURE__ */ React127.createElement(Timeline.Separator, null, props.variant === "error" ? /* @__PURE__ */ React127.createElement(Icon, { icon: import_error5.default, color: "danger-default" }) : props.variant === "warning" ? /* @__PURE__ */ React127.createElement(Icon, { icon: import_warningSign5.default, color: "warning-default" }) : props.variant === "info" ? /* @__PURE__ */ React127.createElement(Icon, { icon: import_time2.default, color: "info-default" }) : /* @__PURE__ */ React127.createElement(Timeline.Separator.Dot, null)), /* @__PURE__ */ React127.createElement(Typography2.Caption, { color: "muted" }, props.title), /* @__PURE__ */ React127.createElement(Timeline.LineContainer, null, /* @__PURE__ */ React127.createElement(Timeline.LineContainer.Line, null)), /* @__PURE__ */ React127.createElement(Timeline.Content, null, /* @__PURE__ */ React127.createElement(Typography2.Small, null, props.children)));
|
17559
17408
|
}
|
17560
17409
|
}));
|
17561
|
-
var TimelineItemSkeleton = () => /* @__PURE__ */
|
17562
|
-
var TimelineSkeleton = ({ items = 3 }) => /* @__PURE__ */
|
17410
|
+
var TimelineItemSkeleton = () => /* @__PURE__ */ React127.createElement(Timeline, null, /* @__PURE__ */ React127.createElement(Timeline.Separator, null, /* @__PURE__ */ React127.createElement(Skeleton, { width: 6, height: 6, rounded: true })), /* @__PURE__ */ React127.createElement(Skeleton, { height: 12, width: 120 }), /* @__PURE__ */ React127.createElement(Timeline.LineContainer, null, /* @__PURE__ */ React127.createElement(Skeleton, { width: 2, height: "100%" })), /* @__PURE__ */ React127.createElement(Timeline.Content, null, /* @__PURE__ */ React127.createElement(Box, { display: "flex", flexDirection: "column", gap: "3" }, /* @__PURE__ */ React127.createElement(Skeleton, { height: 32, width: "100%" }), /* @__PURE__ */ React127.createElement(Skeleton, { height: 32, width: "73%" }), /* @__PURE__ */ React127.createElement(Skeleton, { height: 32, width: "80%" }))));
|
17411
|
+
var TimelineSkeleton = ({ items = 3 }) => /* @__PURE__ */ React127.createElement("div", null, Array.from({ length: items }).map((_, key) => /* @__PURE__ */ React127.createElement(TimelineItemSkeleton, { key })));
|
17563
17412
|
Timeline2.Item = TimelineItem;
|
17564
17413
|
Timeline2.Skeleton = TimelineSkeleton;
|
17565
17414
|
Timeline2.Skeleton.displayName = "Timeline.Skeleton";
|
17566
17415
|
|
17567
17416
|
// src/molecules/TimePicker/TimePicker.tsx
|
17568
|
-
import
|
17569
|
-
var TimePicker = (props) => /* @__PURE__ */
|
17417
|
+
import React128 from "react";
|
17418
|
+
var TimePicker = (props) => /* @__PURE__ */ React128.createElement(TimeField, { ...props });
|
17570
17419
|
|
17571
17420
|
// src/utils/table/sortByColumn.ts
|
17572
17421
|
var sortByColumn = (items, column, sortState) => {
|
@@ -17588,13 +17437,13 @@ var sortByColumn = (items, column, sortState) => {
|
|
17588
17437
|
};
|
17589
17438
|
|
17590
17439
|
// src/utils/table/useSortState.ts
|
17591
|
-
import
|
17592
|
-
var useSortState = (initialSortState) =>
|
17440
|
+
import React129 from "react";
|
17441
|
+
var useSortState = (initialSortState) => React129.useState(initialSortState);
|
17593
17442
|
|
17594
17443
|
// src/utils/table/useTableSelect.ts
|
17595
|
-
import
|
17444
|
+
import React130 from "react";
|
17596
17445
|
var useTableSelect = (data, { key }) => {
|
17597
|
-
const [selected, setSelected] =
|
17446
|
+
const [selected, setSelected] = React130.useState([]);
|
17598
17447
|
const allSelected = selected.length === data.length;
|
17599
17448
|
const isSelected = (dot) => selected.includes(dot[key]);
|
17600
17449
|
const selectAll = () => setSelected(data.map((dot) => dot[key]));
|
@@ -17619,7 +17468,7 @@ var useTableSelect = (data, { key }) => {
|
|
17619
17468
|
};
|
17620
17469
|
|
17621
17470
|
// src/molecules/ItemList/ItemList.tsx
|
17622
|
-
import
|
17471
|
+
import React131 from "react";
|
17623
17472
|
var ItemList = ({
|
17624
17473
|
columns,
|
17625
17474
|
items,
|
@@ -17631,9 +17480,9 @@ var ItemList = ({
|
|
17631
17480
|
const templateColumns = columns.map((column) => column.width ?? "auto");
|
17632
17481
|
const [sortState, setSortState] = useSortState(defaultSort);
|
17633
17482
|
const sortedItems = onSortChanged ? items : sortByColumn(items, columns, sortState);
|
17634
|
-
return /* @__PURE__ */
|
17483
|
+
return /* @__PURE__ */ React131.createElement(Template, { className: "Aquarium-ItemList", columns: templateColumns, role: "table" }, /* @__PURE__ */ React131.createElement(DataList.Row, { header: true }, columns.map((column) => {
|
17635
17484
|
if (columnHasSort(column)) {
|
17636
|
-
return /* @__PURE__ */
|
17485
|
+
return /* @__PURE__ */ React131.createElement(
|
17637
17486
|
DataList.SortCell,
|
17638
17487
|
{
|
17639
17488
|
sticky,
|
@@ -17661,11 +17510,11 @@ var ItemList = ({
|
|
17661
17510
|
column.headerName
|
17662
17511
|
);
|
17663
17512
|
}
|
17664
|
-
return /* @__PURE__ */
|
17665
|
-
})), /* @__PURE__ */
|
17513
|
+
return /* @__PURE__ */ React131.createElement(DataList.HeadCell, { key: column.key ?? column.headerName, ...cellProps(column), sticky }, column.headerName);
|
17514
|
+
})), /* @__PURE__ */ React131.createElement(Rows, { columns, items: sortedItems, level: 0, ...infiniteProps }));
|
17666
17515
|
};
|
17667
17516
|
var Rows = ({ columns, items, level, isLastGroup, ...infiniteProps }) => {
|
17668
|
-
return /* @__PURE__ */
|
17517
|
+
return /* @__PURE__ */ React131.createElement(
|
17669
17518
|
List,
|
17670
17519
|
{
|
17671
17520
|
...level === 0 ? infiniteProps : {},
|
@@ -17674,22 +17523,22 @@ var Rows = ({ columns, items, level, isLastGroup, ...infiniteProps }) => {
|
|
17674
17523
|
const hasSubItems = item.items && item.items.length > 0;
|
17675
17524
|
const isLastItem = itemIndex === items.length - 1;
|
17676
17525
|
const noDivider = level === 0 && isLastItem || level > 0 && (isLastGroup || !isLastItem) || hasSubItems;
|
17677
|
-
return /* @__PURE__ */
|
17526
|
+
return /* @__PURE__ */ React131.createElement(React131.Fragment, { key: item.id }, /* @__PURE__ */ React131.createElement(DataList.Row, { noDivider }, /* @__PURE__ */ React131.createElement(
|
17678
17527
|
List,
|
17679
17528
|
{
|
17680
17529
|
items: columns,
|
17681
|
-
renderItem: (column, columnIndex) => /* @__PURE__ */
|
17530
|
+
renderItem: (column, columnIndex) => /* @__PURE__ */ React131.createElement(
|
17682
17531
|
DataList.Cell,
|
17683
17532
|
{
|
17684
17533
|
key: column.key ?? column.headerName,
|
17685
17534
|
...cellProps(column),
|
17686
17535
|
style: level > 1 && columnIndex === 0 ? { paddingLeft: (level - 1) * 60 } : void 0
|
17687
17536
|
},
|
17688
|
-
level > 0 && columnIndex === 0 && /* @__PURE__ */
|
17689
|
-
/* @__PURE__ */
|
17537
|
+
level > 0 && columnIndex === 0 && /* @__PURE__ */ React131.createElement(DataList.TreeLine, { isLast: itemIndex === items.length - 1 }),
|
17538
|
+
/* @__PURE__ */ React131.createElement(DataListCell, { column, row: item, index: columnIndex, rows: items })
|
17690
17539
|
)
|
17691
17540
|
}
|
17692
|
-
)), item.items && /* @__PURE__ */
|
17541
|
+
)), item.items && /* @__PURE__ */ React131.createElement(WithGroup, { level }, /* @__PURE__ */ React131.createElement(
|
17693
17542
|
Rows,
|
17694
17543
|
{
|
17695
17544
|
columns,
|
@@ -17702,7 +17551,7 @@ var Rows = ({ columns, items, level, isLastGroup, ...infiniteProps }) => {
|
|
17702
17551
|
}
|
17703
17552
|
);
|
17704
17553
|
};
|
17705
|
-
var WithGroup = ({ level, children }) => level === 0 ? /* @__PURE__ */
|
17554
|
+
var WithGroup = ({ level, children }) => level === 0 ? /* @__PURE__ */ React131.createElement(DataList.Row, { isGroup: true }, children) : /* @__PURE__ */ React131.createElement(React131.Fragment, null, children);
|
17706
17555
|
|
17707
17556
|
// src/molecules/index.ts
|
17708
17557
|
var SelectItem = Select.Item;
|
@@ -17902,7 +17751,7 @@ export {
|
|
17902
17751
|
RadioButton2 as RadioButton,
|
17903
17752
|
RadioButtonGroup,
|
17904
17753
|
SearchInput,
|
17905
|
-
|
17754
|
+
Section3 as Section,
|
17906
17755
|
SegmentedControl,
|
17907
17756
|
SegmentedControlGroup,
|
17908
17757
|
Select2 as Select,
|