@aivenio/aquarium 4.0.0 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/atoms.cjs +325 -168
- package/dist/atoms.mjs +332 -167
- package/dist/src/atoms/DropdownMenu/DropdownMenu.d.ts +149 -28
- package/dist/src/atoms/DropdownMenu/DropdownMenu.js +60 -32
- 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/Button/Button.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 +46 -171
- 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 +764 -923
- package/dist/system.mjs +676 -820
- 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,
|
@@ -7140,7 +7140,7 @@ var Button2 = React8.forwardRef(
|
|
7140
7140
|
dense,
|
7141
7141
|
loading: loading2,
|
7142
7142
|
className: UNSAFE_className,
|
7143
|
-
"aria-label": ariaLabel ?? tooltip,
|
7143
|
+
"aria-label": kind === "icon" ? ariaLabel ?? tooltip : ariaLabel,
|
7144
7144
|
...props
|
7145
7145
|
},
|
7146
7146
|
/* @__PURE__ */ React8.createElement(LoadingSpinner, { dense: true, loading: loading2 }, icon && iconPlacement === "left" && /* @__PURE__ */ React8.createElement(Icon2, { icon, dense }), children, icon && iconPlacement === "right" && /* @__PURE__ */ React8.createElement(Icon2, { icon, dense }))
|
@@ -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,113 @@ 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
|
-
|
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 = ({
|
11002
|
+
minHeight,
|
11003
|
+
maxHeight = "100%",
|
11004
|
+
minWidth = "125px",
|
11005
|
+
maxWidth,
|
11006
|
+
className,
|
11007
|
+
children,
|
11008
|
+
...props
|
11009
|
+
}) => {
|
11010
|
+
return /* @__PURE__ */ React67.createElement(
|
11011
|
+
AriaMenu,
|
10992
11012
|
{
|
10993
|
-
ref,
|
10994
11013
|
style: { minHeight, maxHeight, minWidth, maxWidth },
|
10995
|
-
className:
|
10996
|
-
className,
|
10997
|
-
"Aquarium-DropdownMenu.Menu bg-popover-content w-full flex flex-col overflow-x-hidden typography-small text-default"
|
10998
|
-
),
|
11014
|
+
className: dropdownMenuStyles({ className: ["Aquarium-DropdownMenu", className] }),
|
10999
11015
|
...props
|
11000
11016
|
},
|
11001
11017
|
children
|
11002
|
-
)
|
11003
|
-
|
11018
|
+
);
|
11019
|
+
};
|
11004
11020
|
var ContentContainer = ({ children }) => /* @__PURE__ */ React67.createElement("div", { className: tw("p-3 overflow-y-auto overflow-x-hidden") }, children);
|
11005
11021
|
DropdownMenu.ContentContainer = ContentContainer;
|
11006
|
-
var
|
11007
|
-
|
11008
|
-
|
11009
|
-
|
11010
|
-
|
11011
|
-
|
11012
|
-
"
|
11013
|
-
|
11014
|
-
|
11015
|
-
|
11016
|
-
|
11017
|
-
|
11018
|
-
|
11019
|
-
},
|
11020
|
-
title
|
11021
|
-
), children)
|
11022
|
-
);
|
11022
|
+
var dropdownMenuGroupStyles = tv6({
|
11023
|
+
slots: {
|
11024
|
+
base: [
|
11025
|
+
'[&:not(:first-child)]:before:content-[""] [&:not(:first-child)]:before:block',
|
11026
|
+
"[&:not(:first-child)]:before:h-[1px] [&:not(:first-child)]:before:bg-default [&:not(:first-child)]:before:m-3"
|
11027
|
+
],
|
11028
|
+
title: "p-3 text-inactive uppercase cursor-default typography-caption"
|
11029
|
+
}
|
11030
|
+
});
|
11031
|
+
var Group2 = ({ className, title, titleProps, children, ...props }) => {
|
11032
|
+
const styles = dropdownMenuGroupStyles();
|
11033
|
+
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));
|
11034
|
+
};
|
11023
11035
|
DropdownMenu.Group = Group2;
|
11024
|
-
var
|
11025
|
-
|
11026
|
-
|
11036
|
+
var dropdownMenuItemStyles = tv6({
|
11037
|
+
base: "group flex items-center gap-x-3 p-3 outline-none cursor-pointer",
|
11038
|
+
variants: {
|
11039
|
+
isDisabled: {
|
11040
|
+
true: "text-inactive cursor-not-allowed"
|
11041
|
+
},
|
11042
|
+
isFocused: {
|
11043
|
+
true: "bg-muted"
|
11044
|
+
},
|
11045
|
+
kind: {
|
11046
|
+
action: "",
|
11047
|
+
danger: "",
|
11048
|
+
default: ""
|
11049
|
+
}
|
11050
|
+
},
|
11051
|
+
compoundVariants: [
|
11027
11052
|
{
|
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
|
11053
|
+
kind: "action",
|
11054
|
+
disabled: false,
|
11055
|
+
className: "text-primary-intense"
|
11037
11056
|
},
|
11038
|
-
|
11039
|
-
|
11040
|
-
|
11041
|
-
|
11042
|
-
|
11057
|
+
{
|
11058
|
+
kind: "danger",
|
11059
|
+
disabled: false,
|
11060
|
+
className: "text-danger-default"
|
11061
|
+
}
|
11062
|
+
]
|
11063
|
+
});
|
11064
|
+
var Item3 = ({
|
11065
|
+
kind = "default",
|
11066
|
+
className,
|
11067
|
+
icon,
|
11068
|
+
description,
|
11069
|
+
showNotification = false,
|
11070
|
+
disabled,
|
11071
|
+
...props
|
11072
|
+
}) => /* @__PURE__ */ React67.createElement(
|
11073
|
+
AriaMenuItem,
|
11074
|
+
{
|
11075
|
+
className: (values) => dropdownMenuItemStyles({ ...values, kind, className: ["Aquarium-DropdownMenu.Item", className] }),
|
11076
|
+
isDisabled: disabled,
|
11077
|
+
...props
|
11078
|
+
},
|
11079
|
+
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
11080
|
);
|
11044
11081
|
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
11082
|
var EmptyStateContainer2 = ({ className, children, ...props }) => /* @__PURE__ */ React67.createElement("div", { className: classNames(tw("border border-dashed border-default p-3"), className), ...props }, children);
|
11052
11083
|
DropdownMenu.EmptyStateContainer = EmptyStateContainer2;
|
11053
11084
|
|
@@ -11066,250 +11097,116 @@ var Pressable = React68.forwardRef(({ children, ...props }, ref) => {
|
|
11066
11097
|
);
|
11067
11098
|
});
|
11068
11099
|
|
11069
|
-
// src/molecules/DropdownMenu/
|
11070
|
-
import
|
11071
|
-
|
11072
|
-
|
11073
|
-
|
11074
|
-
|
11075
|
-
|
11076
|
-
|
11077
|
-
|
11078
|
-
|
11079
|
-
|
11080
|
-
|
11081
|
-
|
11082
|
-
|
11083
|
-
|
11084
|
-
|
11100
|
+
// src/molecules/DropdownMenu/SearchField.tsx
|
11101
|
+
import React70 from "react";
|
11102
|
+
import {
|
11103
|
+
Button as AriaButton,
|
11104
|
+
Input as AriaInput,
|
11105
|
+
SearchField as AriaSearchField
|
11106
|
+
} from "react-aria-components";
|
11107
|
+
|
11108
|
+
// src/molecules/Field/Field.tsx
|
11109
|
+
import React69 from "react";
|
11110
|
+
import { Group as Group3 } from "react-aria-components";
|
11111
|
+
|
11112
|
+
// src/atoms/utils/index.ts
|
11113
|
+
import { tv as tv7 } from "tailwind-variants";
|
11114
|
+
var focusRing = tv7({
|
11115
|
+
base: "outline outline-primary-default outline-offset-2",
|
11116
|
+
variants: {
|
11117
|
+
isFocusVisible: {
|
11118
|
+
false: "outline-0",
|
11119
|
+
true: "outline-2"
|
11120
|
+
}
|
11121
|
+
}
|
11122
|
+
});
|
11123
|
+
var fieldBorder = tv7({
|
11124
|
+
variants: {
|
11125
|
+
isReadOnly: {
|
11126
|
+
true: "bg-primary-muted"
|
11127
|
+
},
|
11128
|
+
isFocusWithin: {
|
11129
|
+
false: "border-default hover:border-intense",
|
11130
|
+
true: "border-info-default"
|
11131
|
+
},
|
11132
|
+
isInvalid: {
|
11133
|
+
true: "border-danger-default"
|
11134
|
+
},
|
11135
|
+
isDisabled: {
|
11136
|
+
true: "bg-default cursor-not-allowed text-inactive"
|
11085
11137
|
}
|
11086
11138
|
}
|
11087
|
-
|
11139
|
+
});
|
11140
|
+
var fieldGroup = tv7({
|
11141
|
+
base: "group flex gap-3 items-center bg-transparent border rounded-sm typography-small text-default px-3 py-3 overflow-hidden",
|
11142
|
+
variants: fieldBorder.variants
|
11143
|
+
});
|
11144
|
+
|
11145
|
+
// src/molecules/Field/Field.tsx
|
11146
|
+
var FieldGroup = (props) => {
|
11147
|
+
return /* @__PURE__ */ React69.createElement(Group3, { ...props, className: (renderProps) => fieldGroup(renderProps) });
|
11148
|
+
};
|
11149
|
+
|
11150
|
+
// src/molecules/DropdownMenu/SearchField.tsx
|
11151
|
+
var SearchField = (props) => {
|
11152
|
+
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 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
11153
|
};
|
11089
11154
|
|
11090
11155
|
// 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
|
-
));
|
11156
|
+
var MenuPropsContext = createContext3({});
|
11157
|
+
var DropdownMenu2 = (props) => {
|
11158
|
+
return /* @__PURE__ */ React71.createElement(MenuPropsContext.Provider, { value: props }, /* @__PURE__ */ React71.createElement(AriaMenuTrigger, { defaultOpen: props.defaultOpen, isOpen: props.isOpen, onOpenChange: props.onOpenChange }, props.children));
|
11150
11159
|
};
|
11151
11160
|
DropdownMenu2.displayName = "DropdownMenu";
|
11152
|
-
var MenuTrigger = () =>
|
11153
|
-
|
11161
|
+
var MenuTrigger = ({ children }) => {
|
11162
|
+
const props = useContext6(MenuPropsContext);
|
11163
|
+
return /* @__PURE__ */ React71.createElement(Pressable, { "aria-haspopup": "true", isDisabled: props.disabled }, children);
|
11164
|
+
};
|
11154
11165
|
DropdownMenu2.Trigger = MenuTrigger;
|
11155
11166
|
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);
|
11167
|
+
var MenuItems = ({ children }) => {
|
11168
|
+
const props = useContext6(MenuPropsContext);
|
11184
11169
|
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,
|
11170
|
+
const childrenWithIds = React71.Children.map(children, mapKeyToId);
|
11171
|
+
const baseContent = /* @__PURE__ */ React71.createElement(
|
11172
|
+
DropdownMenu,
|
11242
11173
|
{
|
11243
|
-
|
11244
|
-
|
11245
|
-
|
11246
|
-
|
11247
|
-
|
11248
|
-
|
11249
|
-
|
11250
|
-
|
11251
|
-
|
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
|
11264
|
-
);
|
11265
|
-
const { icon, description, kind = "default", showNotification = false } = item.props;
|
11266
|
-
return /* @__PURE__ */ React69.createElement(
|
11267
|
-
DropdownMenu.Item,
|
11268
|
-
{
|
11269
|
-
ref,
|
11270
|
-
...menuItemProps,
|
11271
|
-
kind,
|
11272
|
-
selected: isSelected,
|
11273
|
-
highlighted: isFocused,
|
11274
|
-
disabled: isDisabled,
|
11275
|
-
icon,
|
11276
|
-
showNotification
|
11174
|
+
minHeight: props.minHeight,
|
11175
|
+
maxHeight: props.maxHeight,
|
11176
|
+
minWidth: props.minWidth,
|
11177
|
+
maxWidth: props.maxWidth,
|
11178
|
+
onAction: props.onAction,
|
11179
|
+
onSelectionChange: props.onSelectionChange,
|
11180
|
+
selectedKeys: props.selection,
|
11181
|
+
selectionMode: props.selectionMode,
|
11182
|
+
renderEmptyState: () => /* @__PURE__ */ React71.createElement(DropdownMenu.EmptyStateContainer, null, props.emptyState)
|
11277
11183
|
},
|
11278
|
-
|
11279
|
-
description && /* @__PURE__ */ React69.createElement(DropdownMenu.Description, { disabled: isDisabled, ...descriptionProps }, description)
|
11184
|
+
childrenWithIds
|
11280
11185
|
);
|
11186
|
+
return /* @__PURE__ */ React71.createElement(Popover, { placement: props.placement }, props.header, /* @__PURE__ */ React71.createElement(DropdownMenu.ContentContainer, 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), props.footer);
|
11281
11187
|
};
|
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 })))));
|
11188
|
+
DropdownMenu2.Items = MenuItems;
|
11189
|
+
DropdownMenu2.Items.displayName = "DropdownMenu.Items";
|
11190
|
+
var MenuItem = (props) => {
|
11191
|
+
const textValue = props.textValue || (typeof props.children === "string" ? props.children : void 0);
|
11192
|
+
return /* @__PURE__ */ React71.createElement(DropdownMenu.Item, { textValue, ...props });
|
11291
11193
|
};
|
11292
|
-
|
11293
|
-
|
11294
|
-
|
11295
|
-
|
11296
|
-
}
|
11297
|
-
return [trigger, items];
|
11194
|
+
DropdownMenu2.Item = MenuItem;
|
11195
|
+
DropdownMenu2.Item.displayName = "DropdownMenu.Item";
|
11196
|
+
var MenuSection = ({ children, ...props }) => {
|
11197
|
+
const childrenWithIds = React71.Children.map(children, mapKeyToId);
|
11198
|
+
return /* @__PURE__ */ React71.createElement(DropdownMenu.Group, { ...props }, childrenWithIds);
|
11298
11199
|
};
|
11299
|
-
|
11300
|
-
|
11301
|
-
|
11302
|
-
|
11303
|
-
|
11304
|
-
|
11305
|
-
|
11306
|
-
}
|
11307
|
-
|
11308
|
-
|
11309
|
-
}
|
11310
|
-
return null;
|
11311
|
-
});
|
11312
|
-
return (keys ?? []).flat().filter((key) => key !== null);
|
11200
|
+
DropdownMenu2.Section = MenuSection;
|
11201
|
+
DropdownMenu2.Section.displayName = "DropdownMenu.Section";
|
11202
|
+
var mapKeyToId = (child) => {
|
11203
|
+
if (typeof child === "boolean" || child === null || child === void 0) {
|
11204
|
+
return child;
|
11205
|
+
}
|
11206
|
+
if (isComponentType(child, MenuItem)) {
|
11207
|
+
return React71.cloneElement(child, { id: child.props.id ?? child.key ?? void 0 });
|
11208
|
+
}
|
11209
|
+
return child;
|
11313
11210
|
};
|
11314
11211
|
|
11315
11212
|
// src/utils/object.ts
|
@@ -11335,14 +11232,14 @@ var DataListRowMenu = ({
|
|
11335
11232
|
return null;
|
11336
11233
|
}
|
11337
11234
|
const menuContent = isFunction(menu) ? menu(row, index) : menu;
|
11338
|
-
return /* @__PURE__ */
|
11235
|
+
return /* @__PURE__ */ React72.createElement(DataList.Cell, { align: "right" }, menuContent && /* @__PURE__ */ React72.createElement(
|
11339
11236
|
DropdownMenu2,
|
11340
11237
|
{
|
11341
11238
|
placement: defaultContextualMenuPlacement,
|
11342
11239
|
onAction: (action) => onAction?.(action, row, index),
|
11343
11240
|
onOpenChange: onMenuOpenChange
|
11344
11241
|
},
|
11345
|
-
/* @__PURE__ */
|
11242
|
+
/* @__PURE__ */ React72.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ React72.createElement(Button2.Icon, { "aria-label": menuAriaLabel, icon: import_more2.default })),
|
11346
11243
|
menuContent
|
11347
11244
|
));
|
11348
11245
|
};
|
@@ -11371,7 +11268,7 @@ var DataListRow = ({
|
|
11371
11268
|
...resolvedAdditionalRowProps.style ?? {},
|
11372
11269
|
cursor: isRowClickable ? "pointer" : void 0
|
11373
11270
|
};
|
11374
|
-
return /* @__PURE__ */
|
11271
|
+
return /* @__PURE__ */ React72.createElement(
|
11375
11272
|
DataList.Row,
|
11376
11273
|
{
|
11377
11274
|
key: row.id,
|
@@ -11383,12 +11280,12 @@ var DataListRow = ({
|
|
11383
11280
|
onClick: isRowClickable ? onClick : void 0
|
11384
11281
|
},
|
11385
11282
|
renderFirstColumn?.(row, index, rows),
|
11386
|
-
/* @__PURE__ */
|
11283
|
+
/* @__PURE__ */ React72.createElement(
|
11387
11284
|
List,
|
11388
11285
|
{
|
11389
11286
|
items: columns,
|
11390
11287
|
renderItem: (column, columnIndex) => {
|
11391
|
-
const cell2 = /* @__PURE__ */
|
11288
|
+
const cell2 = /* @__PURE__ */ React72.createElement(
|
11392
11289
|
DataList.Cell,
|
11393
11290
|
{
|
11394
11291
|
key: column.key ?? column.headerName,
|
@@ -11396,7 +11293,7 @@ var DataListRow = ({
|
|
11396
11293
|
...additionalColumnProps(column, columnIndex, columns, row),
|
11397
11294
|
className: rowClassName?.(row, index, rows)
|
11398
11295
|
},
|
11399
|
-
/* @__PURE__ */
|
11296
|
+
/* @__PURE__ */ React72.createElement(DataListCell, { column, row, index, rows })
|
11400
11297
|
);
|
11401
11298
|
return createAnimatedCell({
|
11402
11299
|
cellElement: cell2,
|
@@ -11422,14 +11319,14 @@ var DataListCell = ({
|
|
11422
11319
|
case "status": {
|
11423
11320
|
const status = column.status(row, index, rows);
|
11424
11321
|
if (status) {
|
11425
|
-
cellContent = /* @__PURE__ */
|
11322
|
+
cellContent = /* @__PURE__ */ React72.createElement(StatusChip, { dense: true, ...status });
|
11426
11323
|
}
|
11427
11324
|
break;
|
11428
11325
|
}
|
11429
11326
|
case "action": {
|
11430
11327
|
const action = renameProperty("text", "children", column.action(row, index, rows));
|
11431
11328
|
if (action) {
|
11432
|
-
cellContent = /* @__PURE__ */
|
11329
|
+
cellContent = /* @__PURE__ */ React72.createElement(
|
11433
11330
|
Button2.Secondary,
|
11434
11331
|
{
|
11435
11332
|
dense: true,
|
@@ -11450,7 +11347,7 @@ var DataListCell = ({
|
|
11450
11347
|
case "item": {
|
11451
11348
|
const item = column.item(row, index, rows);
|
11452
11349
|
if (item) {
|
11453
|
-
cellContent = /* @__PURE__ */
|
11350
|
+
cellContent = /* @__PURE__ */ React72.createElement(Item2, { ...item });
|
11454
11351
|
}
|
11455
11352
|
break;
|
11456
11353
|
}
|
@@ -11459,13 +11356,13 @@ var DataListCell = ({
|
|
11459
11356
|
if (!menuContent) {
|
11460
11357
|
cellContent = null;
|
11461
11358
|
} else {
|
11462
|
-
cellContent = /* @__PURE__ */
|
11359
|
+
cellContent = /* @__PURE__ */ React72.createElement(
|
11463
11360
|
DropdownMenu2,
|
11464
11361
|
{
|
11465
11362
|
placement: defaultContextualMenuPlacement,
|
11466
11363
|
onAction: (action) => column.onAction(action, row, index)
|
11467
11364
|
},
|
11468
|
-
/* @__PURE__ */
|
11365
|
+
/* @__PURE__ */ React72.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ React72.createElement(Button2.Icon, { "aria-label": "action", icon: import_more2.default })),
|
11469
11366
|
menuContent
|
11470
11367
|
);
|
11471
11368
|
}
|
@@ -11479,17 +11376,17 @@ var DataListCell = ({
|
|
11479
11376
|
}
|
11480
11377
|
break;
|
11481
11378
|
}
|
11482
|
-
return column.tooltip ? /* @__PURE__ */
|
11379
|
+
return column.tooltip ? /* @__PURE__ */ React72.createElement(Tooltip, { ...column.tooltip(row, index, rows) }, cellContent) : /* @__PURE__ */ React72.createElement(React72.Fragment, null, cellContent);
|
11483
11380
|
};
|
11484
11381
|
|
11485
11382
|
// src/molecules/DataList/DataListContext.tsx
|
11486
|
-
import { createContext as
|
11487
|
-
var DataListContext =
|
11383
|
+
import { createContext as createContext4, useContext as useContext7 } from "react";
|
11384
|
+
var DataListContext = createContext4({
|
11488
11385
|
rows: [],
|
11489
11386
|
selectedRows: void 0
|
11490
11387
|
});
|
11491
11388
|
var useDataListContext = () => {
|
11492
|
-
const ctx =
|
11389
|
+
const ctx = useContext7(DataListContext);
|
11493
11390
|
if (!ctx) {
|
11494
11391
|
throw new Error("DataListContext was used outside of provider.");
|
11495
11392
|
}
|
@@ -11497,8 +11394,8 @@ var useDataListContext = () => {
|
|
11497
11394
|
};
|
11498
11395
|
|
11499
11396
|
// src/molecules/DataList/DataListGroup.tsx
|
11500
|
-
import
|
11501
|
-
import { isFunction as isFunction2 } from "lodash-es";
|
11397
|
+
import React73 from "react";
|
11398
|
+
import { isFunction as isFunction2, noop } from "lodash-es";
|
11502
11399
|
var import_infoSign3 = __toESM(require_infoSign());
|
11503
11400
|
|
11504
11401
|
// src/molecules/DataList/utils.ts
|
@@ -11510,8 +11407,8 @@ var INDENTATION = 28;
|
|
11510
11407
|
var sortGroupKeys = (groupKeys) => [...groupKeys].sort((a) => a === "undefined" ? -1 : 1);
|
11511
11408
|
var getDefaultRowSelectionLabel = () => "Select row";
|
11512
11409
|
var getDefaultGroupCheckboxLabel = (key) => `Select ${key}`;
|
11513
|
-
var renderDefaultGroupName = (key) => /* @__PURE__ */
|
11514
|
-
var renderDefaultEmptyGroup = () => /* @__PURE__ */
|
11410
|
+
var renderDefaultGroupName = (key) => /* @__PURE__ */ React73.createElement(React73.Fragment, null, "Group: ", /* @__PURE__ */ React73.createElement("b", null, key));
|
11411
|
+
var renderDefaultEmptyGroup = () => /* @__PURE__ */ React73.createElement(DataList.EmptyGroup, { icon: import_infoSign3.default }, "This group is empty");
|
11515
11412
|
var DataListGroup = ({
|
11516
11413
|
groups,
|
11517
11414
|
groupKey,
|
@@ -11549,15 +11446,15 @@ var DataListGroup = ({
|
|
11549
11446
|
if (!emptyGroupContent) {
|
11550
11447
|
return null;
|
11551
11448
|
}
|
11552
|
-
return /* @__PURE__ */
|
11449
|
+
return /* @__PURE__ */ React73.createElement(DataList.Row, { noDivider: isLastGroup }, selectable && /* @__PURE__ */ React73.createElement(DataList.Cell, null), /* @__PURE__ */ React73.createElement(
|
11553
11450
|
DataList.Cell,
|
11554
11451
|
{
|
11555
11452
|
style: { paddingLeft: `${2 + GAP + level * INDENTATION}px`, gridColumn: `${selectable ? 2 : 1} / -1` }
|
11556
11453
|
},
|
11557
|
-
/* @__PURE__ */
|
11454
|
+
/* @__PURE__ */ React73.createElement(Typography, { variant: "small", color: "muted" }, emptyGroupContent)
|
11558
11455
|
));
|
11559
11456
|
}
|
11560
|
-
return /* @__PURE__ */
|
11457
|
+
return /* @__PURE__ */ React73.createElement(
|
11561
11458
|
List,
|
11562
11459
|
{
|
11563
11460
|
items: groups,
|
@@ -11566,7 +11463,7 @@ var DataListGroup = ({
|
|
11566
11463
|
const isDisabled = disabled?.(row, index, rows);
|
11567
11464
|
const isSelectionDisabled = selectionDisabled(row, index, rows);
|
11568
11465
|
const isLastRow = isLastGroup && index === groups.length - 1;
|
11569
|
-
return /* @__PURE__ */
|
11466
|
+
return /* @__PURE__ */ React73.createElement(
|
11570
11467
|
DataListRow,
|
11571
11468
|
{
|
11572
11469
|
key: row.id,
|
@@ -11576,7 +11473,7 @@ var DataListGroup = ({
|
|
11576
11473
|
isLast: isLastRow,
|
11577
11474
|
rows,
|
11578
11475
|
active: selectable && isSelected,
|
11579
|
-
menu: /* @__PURE__ */
|
11476
|
+
menu: /* @__PURE__ */ React73.createElement(
|
11580
11477
|
DataListRowMenu,
|
11581
11478
|
{
|
11582
11479
|
row,
|
@@ -11599,16 +11496,16 @@ var DataListGroup = ({
|
|
11599
11496
|
}
|
11600
11497
|
} : {},
|
11601
11498
|
renderFirstColumn: (row2, index2) => {
|
11602
|
-
return /* @__PURE__ */
|
11499
|
+
return /* @__PURE__ */ React73.createElement(React73.Fragment, null, selectable && /* @__PURE__ */ React73.createElement(DataList.Cell, null, selectable === "single" && /* @__PURE__ */ React73.createElement(
|
11603
11500
|
RadioButton,
|
11604
11501
|
{
|
11605
11502
|
value: row2.id.toString(),
|
11606
11503
|
"aria-label": getRowSelectionLabel(row2, index2, isSelected, rows),
|
11607
|
-
onChange:
|
11504
|
+
onChange: noop,
|
11608
11505
|
checked: isSelected,
|
11609
11506
|
disabled: isDisabled || isSelectionDisabled
|
11610
11507
|
}
|
11611
|
-
), isMultiSelectionMode && /* @__PURE__ */
|
11508
|
+
), isMultiSelectionMode && /* @__PURE__ */ React73.createElement(
|
11612
11509
|
Checkbox,
|
11613
11510
|
{
|
11614
11511
|
"aria-label": getRowSelectionLabel(row2, index2, isSelected, rows),
|
@@ -11628,14 +11525,14 @@ var DataListGroup = ({
|
|
11628
11525
|
if (!groupKeys) {
|
11629
11526
|
return null;
|
11630
11527
|
}
|
11631
|
-
return /* @__PURE__ */
|
11528
|
+
return /* @__PURE__ */ React73.createElement(
|
11632
11529
|
List,
|
11633
11530
|
{
|
11634
11531
|
items: sortGroupKeys(groupKeys),
|
11635
11532
|
renderItem: (key, index) => {
|
11636
11533
|
const group = groups[key];
|
11637
11534
|
if (key === "undefined" || key === void 0) {
|
11638
|
-
return /* @__PURE__ */
|
11535
|
+
return /* @__PURE__ */ React73.createElement(
|
11639
11536
|
DataListGroup,
|
11640
11537
|
{
|
11641
11538
|
key: "undefined",
|
@@ -11654,7 +11551,7 @@ var DataListGroup = ({
|
|
11654
11551
|
const isChecked = nestedSelectedIds.length > 0;
|
11655
11552
|
const isActiveRow = !!openPanelId || selectable && isChecked;
|
11656
11553
|
const isLastRow = isLastGroup && index === groupKeys.length - 1 && !openPanelId;
|
11657
|
-
return /* @__PURE__ */
|
11554
|
+
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
11555
|
Checkbox,
|
11659
11556
|
{
|
11660
11557
|
"aria-label": getGroupCheckboxLabel(key, group, index, isChecked, rows),
|
@@ -11663,11 +11560,11 @@ var DataListGroup = ({
|
|
11663
11560
|
disabled: group.length === 0,
|
11664
11561
|
onChange: getOnSelectionChangeForId(nestedRowIds)
|
11665
11562
|
}
|
11666
|
-
)), /* @__PURE__ */
|
11563
|
+
)), /* @__PURE__ */ React73.createElement(
|
11667
11564
|
List,
|
11668
11565
|
{
|
11669
11566
|
items: columns,
|
11670
|
-
renderItem: (column, idx) => /* @__PURE__ */
|
11567
|
+
renderItem: (column, idx) => /* @__PURE__ */ React73.createElement(
|
11671
11568
|
DataList.Cell,
|
11672
11569
|
{
|
11673
11570
|
key: column.key ?? column.headerName,
|
@@ -11675,11 +11572,11 @@ var DataListGroup = ({
|
|
11675
11572
|
className: tw("gap-3"),
|
11676
11573
|
style: idx === 0 ? { paddingLeft: `${GAP + level * INDENTATION}px` } : void 0
|
11677
11574
|
},
|
11678
|
-
idx === 0 && /* @__PURE__ */
|
11679
|
-
/* @__PURE__ */
|
11575
|
+
idx === 0 && /* @__PURE__ */ React73.createElement(Accordion.Toggle, { panelId: key, onChange: onGroupToggled }),
|
11576
|
+
/* @__PURE__ */ React73.createElement(DataListCell, { column, row: getGroupRow(key, group), index: -1, rows: [] })
|
11680
11577
|
)
|
11681
11578
|
}
|
11682
|
-
), /* @__PURE__ */
|
11579
|
+
), /* @__PURE__ */ React73.createElement(
|
11683
11580
|
DataListRowMenu,
|
11684
11581
|
{
|
11685
11582
|
row: getGroupRow(key, group),
|
@@ -11689,7 +11586,7 @@ var DataListGroup = ({
|
|
11689
11586
|
onMenuOpenChange,
|
11690
11587
|
menuAriaLabel
|
11691
11588
|
}
|
11692
|
-
)), !hasCustomRowForGroup && /* @__PURE__ */
|
11589
|
+
)), !hasCustomRowForGroup && /* @__PURE__ */ React73.createElement(DataList.Row, { active: isActiveRow, noDivider: isLastRow }, isMultiSelectionMode && /* @__PURE__ */ React73.createElement(DataList.Cell, null, /* @__PURE__ */ React73.createElement(
|
11693
11590
|
Checkbox,
|
11694
11591
|
{
|
11695
11592
|
"aria-label": getGroupCheckboxLabel(key, group, index, isChecked, rows),
|
@@ -11698,15 +11595,15 @@ var DataListGroup = ({
|
|
11698
11595
|
disabled: group.length === 0,
|
11699
11596
|
onChange: getOnSelectionChangeForId(nestedRowIds)
|
11700
11597
|
}
|
11701
|
-
)), /* @__PURE__ */
|
11598
|
+
)), /* @__PURE__ */ React73.createElement(
|
11702
11599
|
DataList.Cell,
|
11703
11600
|
{
|
11704
11601
|
className: tw("gap-3"),
|
11705
11602
|
style: { paddingLeft: `${GAP + level * INDENTATION}px`, gridColumn: `${selectable ? 2 : 1} / -1` }
|
11706
11603
|
},
|
11707
|
-
/* @__PURE__ */
|
11604
|
+
/* @__PURE__ */ React73.createElement(Accordion.Toggle, { panelId: key, onChange: onGroupToggled }),
|
11708
11605
|
renderGroupName(key, group)
|
11709
|
-
)), /* @__PURE__ */
|
11606
|
+
)), /* @__PURE__ */ React73.createElement(Accordion.UnanimatedPanel, { panelId: key }, /* @__PURE__ */ React73.createElement(DataList.Row, { isGroup: true }, /* @__PURE__ */ React73.createElement(
|
11710
11607
|
DataListGroup,
|
11711
11608
|
{
|
11712
11609
|
key,
|
@@ -11723,18 +11620,18 @@ var DataListGroup = ({
|
|
11723
11620
|
};
|
11724
11621
|
|
11725
11622
|
// src/molecules/DataList/DataListSkeleton.tsx
|
11726
|
-
import
|
11623
|
+
import React74 from "react";
|
11727
11624
|
var DataListSkeleton = ({ columns = ["1", "2", "2", 52], rows = 5 }) => {
|
11728
11625
|
const columnsAmount = [...Array(typeof columns === "number" ? columns : columns.length).keys()];
|
11729
|
-
return /* @__PURE__ */
|
11626
|
+
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
11627
|
List,
|
11731
11628
|
{
|
11732
11629
|
items: [...Array(rows).keys()],
|
11733
|
-
renderItem: (item, index) => /* @__PURE__ */
|
11630
|
+
renderItem: (item, index) => /* @__PURE__ */ React74.createElement(DataList.Row, { key: item, noDivider: index === rows - 1 }, /* @__PURE__ */ React74.createElement(
|
11734
11631
|
List,
|
11735
11632
|
{
|
11736
11633
|
items: columnsAmount,
|
11737
|
-
renderItem: (key) => /* @__PURE__ */
|
11634
|
+
renderItem: (key) => /* @__PURE__ */ React74.createElement(DataList.Cell, { key }, /* @__PURE__ */ React74.createElement(Skeleton, { width: "100%", height: 17.5 }))
|
11738
11635
|
}
|
11739
11636
|
))
|
11740
11637
|
}
|
@@ -11742,7 +11639,7 @@ var DataListSkeleton = ({ columns = ["1", "2", "2", 52], rows = 5 }) => {
|
|
11742
11639
|
};
|
11743
11640
|
|
11744
11641
|
// src/molecules/DataList/DataListToolbar.tsx
|
11745
|
-
import
|
11642
|
+
import React75 from "react";
|
11746
11643
|
import { castArray } from "lodash-es";
|
11747
11644
|
var DataListToolbar = ({
|
11748
11645
|
actions: _actions,
|
@@ -11754,20 +11651,20 @@ var DataListToolbar = ({
|
|
11754
11651
|
}) => {
|
11755
11652
|
const { selectedRows } = useDataListContext();
|
11756
11653
|
const actions = castArray(_actions).filter(Boolean);
|
11757
|
-
return /* @__PURE__ */
|
11654
|
+
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
11655
|
(action) => renderAction({
|
11759
11656
|
kind: "ghost",
|
11760
11657
|
dense: true,
|
11761
11658
|
action: { ...action, onClick: () => action.onClick(selectedRows ?? []) }
|
11762
11659
|
})
|
11763
|
-
))), menu && /* @__PURE__ */
|
11660
|
+
))), menu && /* @__PURE__ */ React75.createElement(DataList.Toolbar.Group, null, /* @__PURE__ */ React75.createElement(
|
11764
11661
|
DropdownMenu2,
|
11765
11662
|
{
|
11766
11663
|
placement: defaultContextualMenuPlacement,
|
11767
11664
|
onAction: (key) => onAction(key, selectedRows ?? []),
|
11768
11665
|
onOpenChange: onMenuOpenChange
|
11769
11666
|
},
|
11770
|
-
/* @__PURE__ */
|
11667
|
+
/* @__PURE__ */ React75.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ React75.createElement(Button2.Dropdown, { kind: "ghost", dense: true }, menuLabel)),
|
11771
11668
|
menu
|
11772
11669
|
)));
|
11773
11670
|
};
|
@@ -11834,8 +11731,8 @@ var DataList2 = ({
|
|
11834
11731
|
...columns.map((column) => column.width ?? "auto"),
|
11835
11732
|
menu ? "fit-content(28px)" : void 0
|
11836
11733
|
]);
|
11837
|
-
const PaginationFooter =
|
11838
|
-
({ children }) => /* @__PURE__ */
|
11734
|
+
const PaginationFooter = React76.useCallback(
|
11735
|
+
({ children }) => /* @__PURE__ */ React76.createElement("div", { style: { gridColumn: "1 / -1" }, role: "row" }, /* @__PURE__ */ React76.createElement("div", { role: "cell" }, children)),
|
11839
11736
|
[]
|
11840
11737
|
);
|
11841
11738
|
const getOnSelectionChangeForId = (id) => (e) => {
|
@@ -11857,7 +11754,7 @@ var DataList2 = ({
|
|
11857
11754
|
)
|
11858
11755
|
);
|
11859
11756
|
const allRowsSelected = totalSelected >= allEnabledRowIds.length;
|
11860
|
-
const componentContent = /* @__PURE__ */
|
11757
|
+
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
11758
|
Checkbox,
|
11862
11759
|
{
|
11863
11760
|
"aria-label": "Select all rows",
|
@@ -11871,10 +11768,10 @@ var DataList2 = ({
|
|
11871
11768
|
}
|
11872
11769
|
}
|
11873
11770
|
}
|
11874
|
-
)), isCollapsible && /* @__PURE__ */
|
11875
|
-
const content = column.headerTooltip ? /* @__PURE__ */
|
11876
|
-
const headerContentAndIcon = column.icon ? /* @__PURE__ */
|
11877
|
-
const cell2 = columnHasSort(column) ? /* @__PURE__ */
|
11771
|
+
)), isCollapsible && /* @__PURE__ */ React76.createElement(DataList.HeadCell, { align: "left", sticky }), columns.map((column) => {
|
11772
|
+
const content = column.headerTooltip ? /* @__PURE__ */ React76.createElement(Tooltip, { placement: column.headerTooltip.placement, content: column.headerTooltip.content }, column.headerName) : column.headerName;
|
11773
|
+
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;
|
11774
|
+
const cell2 = columnHasSort(column) ? /* @__PURE__ */ React76.createElement(
|
11878
11775
|
DataList.SortCell,
|
11879
11776
|
{
|
11880
11777
|
direction: sort && sort.column.headerName === column.headerName ? sort.direction : "none",
|
@@ -11884,13 +11781,13 @@ var DataList2 = ({
|
|
11884
11781
|
...cellProps(column)
|
11885
11782
|
},
|
11886
11783
|
headerContentAndIcon
|
11887
|
-
) : /* @__PURE__ */
|
11784
|
+
) : /* @__PURE__ */ React76.createElement(DataList.HeadCell, { key: column.key ?? column.headerName, ...cellProps(column), sticky }, headerContentAndIcon);
|
11888
11785
|
return createAnimatedCell({
|
11889
11786
|
cellElement: cell2,
|
11890
11787
|
stickyStyles,
|
11891
11788
|
stickyColumn: cellProps(column).stickyColumn
|
11892
11789
|
});
|
11893
|
-
}), menu && /* @__PURE__ */
|
11790
|
+
}), menu && /* @__PURE__ */ React76.createElement(DataList.HeadCell, { align: "right", "aria-label": menuAriaLabel, sticky }, menuHeaderName)), toolbar), groups && /* @__PURE__ */ React76.createElement(
|
11894
11791
|
DataListGroup,
|
11895
11792
|
{
|
11896
11793
|
columns,
|
@@ -11917,7 +11814,7 @@ var DataList2 = ({
|
|
11917
11814
|
level: 0,
|
11918
11815
|
isLastGroup: true
|
11919
11816
|
}
|
11920
|
-
), !groups && /* @__PURE__ */
|
11817
|
+
), !groups && /* @__PURE__ */ React76.createElement(
|
11921
11818
|
List,
|
11922
11819
|
{
|
11923
11820
|
...rest,
|
@@ -11930,7 +11827,7 @@ var DataList2 = ({
|
|
11930
11827
|
const isDisabled = disabled?.(row, index, sortedRows);
|
11931
11828
|
const openPanelId = expandedGroupIds.find((id) => id === row.id.toString()) || null;
|
11932
11829
|
const isLastRow = index === sortedRows.length - 1;
|
11933
|
-
const content = /* @__PURE__ */
|
11830
|
+
const content = /* @__PURE__ */ React76.createElement(
|
11934
11831
|
DataListRow,
|
11935
11832
|
{
|
11936
11833
|
key: row.id,
|
@@ -11941,7 +11838,7 @@ var DataList2 = ({
|
|
11941
11838
|
active: selectable && isSelected,
|
11942
11839
|
isLast: isLastRow && !openPanelId,
|
11943
11840
|
stickyStyles,
|
11944
|
-
menu: /* @__PURE__ */
|
11841
|
+
menu: /* @__PURE__ */ React76.createElement(
|
11945
11842
|
DataListRowMenu,
|
11946
11843
|
{
|
11947
11844
|
row,
|
@@ -11959,16 +11856,16 @@ var DataList2 = ({
|
|
11959
11856
|
"aria-selected": selected?.includes(row2.id) ?? false
|
11960
11857
|
} : {},
|
11961
11858
|
renderFirstColumn: (row2, index2) => {
|
11962
|
-
return /* @__PURE__ */
|
11859
|
+
return /* @__PURE__ */ React76.createElement(React76.Fragment, null, selectable && /* @__PURE__ */ React76.createElement(DataList.Cell, null, selectable === "single" && /* @__PURE__ */ React76.createElement(
|
11963
11860
|
RadioButton,
|
11964
11861
|
{
|
11965
11862
|
value: row2.id.toString(),
|
11966
11863
|
"aria-label": getRowSelectionLabel(row2, index2, isSelected, sortedRows),
|
11967
|
-
onChange:
|
11864
|
+
onChange: noop2,
|
11968
11865
|
checked: isSelected,
|
11969
11866
|
disabled: isDisabled || isSelectionDisabled
|
11970
11867
|
}
|
11971
|
-
), isMultiSelectionMode && /* @__PURE__ */
|
11868
|
+
), isMultiSelectionMode && /* @__PURE__ */ React76.createElement(
|
11972
11869
|
Checkbox,
|
11973
11870
|
{
|
11974
11871
|
"aria-label": getRowSelectionLabel(row2, index2, isSelected, sortedRows),
|
@@ -11976,7 +11873,7 @@ var DataList2 = ({
|
|
11976
11873
|
checked: isSelected,
|
11977
11874
|
disabled: isDisabled || isSelectionDisabled
|
11978
11875
|
}
|
11979
|
-
)), rowDetails !== void 0 && /* @__PURE__ */
|
11876
|
+
)), rowDetails !== void 0 && /* @__PURE__ */ React76.createElement(DataList.Cell, null, details && /* @__PURE__ */ React76.createElement(Accordion.Toggle, { panelId: row2.id.toString(), onChange: onGroupToggled })));
|
11980
11877
|
},
|
11981
11878
|
onClick: selectable === "single" ? getOnSelectionChangeForId(row.id) : void 0
|
11982
11879
|
}
|
@@ -11984,7 +11881,7 @@ var DataList2 = ({
|
|
11984
11881
|
if (!details) {
|
11985
11882
|
return content;
|
11986
11883
|
}
|
11987
|
-
return /* @__PURE__ */
|
11884
|
+
return /* @__PURE__ */ React76.createElement(Accordion, { key: row.id, openPanelId }, content, /* @__PURE__ */ React76.createElement(
|
11988
11885
|
Accordion.Panel,
|
11989
11886
|
{
|
11990
11887
|
role: "row",
|
@@ -11995,13 +11892,13 @@ var DataList2 = ({
|
|
11995
11892
|
}),
|
11996
11893
|
"aria-label": `row ${row.id.toString()} details`
|
11997
11894
|
},
|
11998
|
-
/* @__PURE__ */
|
11895
|
+
/* @__PURE__ */ React76.createElement("div", { role: "cell" }, details)
|
11999
11896
|
));
|
12000
11897
|
}
|
12001
11898
|
}
|
12002
11899
|
));
|
12003
|
-
const wrappedContent = hasStickyColumns ? /* @__PURE__ */
|
12004
|
-
return /* @__PURE__ */
|
11900
|
+
const wrappedContent = hasStickyColumns ? /* @__PURE__ */ React76.createElement("div", { className: "relative w-full h-full overflow-auto", ref: containerRef }, componentContent) : componentContent;
|
11901
|
+
return /* @__PURE__ */ React76.createElement(
|
12005
11902
|
DataListContext.Provider,
|
12006
11903
|
{
|
12007
11904
|
value: {
|
@@ -12016,18 +11913,18 @@ DataList2.Skeleton = DataListSkeleton;
|
|
12016
11913
|
DataList2.Toolbar = DataListToolbar;
|
12017
11914
|
|
12018
11915
|
// src/molecules/DataTable/DataTable.tsx
|
12019
|
-
import
|
11916
|
+
import React79, { useRef as useRef9 } from "react";
|
12020
11917
|
import classNames10 from "classnames";
|
12021
11918
|
import { compact as compact2, isFunction as isFunction4 } from "lodash-es";
|
12022
11919
|
|
12023
11920
|
// src/molecules/Table/Table.tsx
|
12024
|
-
import
|
11921
|
+
import React78 from "react";
|
12025
11922
|
|
12026
11923
|
// src/utils/table/useScrollTarget.ts
|
12027
|
-
import
|
11924
|
+
import React77 from "react";
|
12028
11925
|
var useScrollTarget = (callback) => {
|
12029
|
-
const targetRef =
|
12030
|
-
|
11926
|
+
const targetRef = React77.useRef(null);
|
11927
|
+
React77.useLayoutEffect(() => {
|
12031
11928
|
const observer = new IntersectionObserver((entries) => entries[0].isIntersecting && callback && callback(), {
|
12032
11929
|
root: null,
|
12033
11930
|
rootMargin: `0px 0px 200px 0px`
|
@@ -12044,7 +11941,7 @@ var useScrollTarget = (callback) => {
|
|
12044
11941
|
var Table2 = ({ children, onPrev, onNext, ...rest }) => {
|
12045
11942
|
const bottomRef = useScrollTarget(onNext);
|
12046
11943
|
const topRef = useScrollTarget(onPrev);
|
12047
|
-
return /* @__PURE__ */
|
11944
|
+
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
11945
|
};
|
12049
11946
|
Table2.Head = Table.Head;
|
12050
11947
|
Table2.Body = Table.Body;
|
@@ -12084,11 +11981,11 @@ var DataTable = ({
|
|
12084
11981
|
const [sort, updateSort] = useTableSort({ ...initialSortState, onSortChanged });
|
12085
11982
|
const sortedRows = sortRowsBy(rows, sort);
|
12086
11983
|
const amountOfColumns = columns.length + (menu ? 1 : 0);
|
12087
|
-
const PaginationFooter =
|
12088
|
-
({ children }) => /* @__PURE__ */
|
11984
|
+
const PaginationFooter = React79.useCallback(
|
11985
|
+
({ children }) => /* @__PURE__ */ React79.createElement("tfoot", null, /* @__PURE__ */ React79.createElement("tr", null, /* @__PURE__ */ React79.createElement("td", { colSpan: amountOfColumns }, children))),
|
12089
11986
|
[amountOfColumns]
|
12090
11987
|
);
|
12091
|
-
const compponentContent = /* @__PURE__ */
|
11988
|
+
const compponentContent = /* @__PURE__ */ React79.createElement(
|
12092
11989
|
Table2,
|
12093
11990
|
{
|
12094
11991
|
ariaLabel,
|
@@ -12103,11 +12000,11 @@ var DataTable = ({
|
|
12103
12000
|
})
|
12104
12001
|
)
|
12105
12002
|
},
|
12106
|
-
/* @__PURE__ */
|
12003
|
+
/* @__PURE__ */ React79.createElement(Table2.Head, { sticky }, compact2([
|
12107
12004
|
...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__ */
|
12005
|
+
const content = column.headerTooltip && !column.headerInvisible ? /* @__PURE__ */ React79.createElement(Tooltip, { placement: column.headerTooltip.placement, content: column.headerTooltip.content }, column.headerName) : !column.headerInvisible && column.headerName;
|
12006
|
+
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;
|
12007
|
+
const cell2 = columnHasSort(column) ? /* @__PURE__ */ React79.createElement(
|
12111
12008
|
Table2.SortCell,
|
12112
12009
|
{
|
12113
12010
|
direction: sort && sort.column.headerName === column.headerName ? sort.direction : "none",
|
@@ -12118,7 +12015,7 @@ var DataTable = ({
|
|
12118
12015
|
...cellProps(column)
|
12119
12016
|
},
|
12120
12017
|
headerContentAndIcon
|
12121
|
-
) : /* @__PURE__ */
|
12018
|
+
) : /* @__PURE__ */ React79.createElement(
|
12122
12019
|
Table2.Cell,
|
12123
12020
|
{
|
12124
12021
|
key: column.key ?? column.headerName,
|
@@ -12134,9 +12031,9 @@ var DataTable = ({
|
|
12134
12031
|
stickyColumn: cellProps(column).stickyColumn
|
12135
12032
|
});
|
12136
12033
|
}),
|
12137
|
-
menu ? /* @__PURE__ */
|
12034
|
+
menu ? /* @__PURE__ */ React79.createElement(Table2.Cell, { key: "__contextMenu", align: "right", "aria-label": menuAriaLabel }, menuHeaderName) : null
|
12138
12035
|
])),
|
12139
|
-
/* @__PURE__ */
|
12036
|
+
/* @__PURE__ */ React79.createElement(
|
12140
12037
|
List,
|
12141
12038
|
{
|
12142
12039
|
container: Table2.Body,
|
@@ -12145,13 +12042,13 @@ var DataTable = ({
|
|
12145
12042
|
items: sortedRows,
|
12146
12043
|
renderItem: (row, index) => {
|
12147
12044
|
const isRowDisabled = disabled?.(row, index, sortedRows) ?? false;
|
12148
|
-
return /* @__PURE__ */
|
12045
|
+
return /* @__PURE__ */ React79.createElement(Table2.Row, { key: row.id, disabled: isRowDisabled }, /* @__PURE__ */ React79.createElement(
|
12149
12046
|
List,
|
12150
12047
|
{
|
12151
12048
|
items: columns,
|
12152
12049
|
renderItem: (column) => {
|
12153
12050
|
return createAnimatedCell({
|
12154
|
-
cellElement: /* @__PURE__ */
|
12051
|
+
cellElement: /* @__PURE__ */ React79.createElement(
|
12155
12052
|
Table2.Cell,
|
12156
12053
|
{
|
12157
12054
|
key: column.key ?? column.headerName,
|
@@ -12170,7 +12067,7 @@ var DataTable = ({
|
|
12170
12067
|
}
|
12171
12068
|
)
|
12172
12069
|
);
|
12173
|
-
return hasStickyColumns ? /* @__PURE__ */
|
12070
|
+
return hasStickyColumns ? /* @__PURE__ */ React79.createElement("div", { className: "relative w-full overflow-x-auto", ref: containerRef }, compponentContent) : compponentContent;
|
12174
12071
|
};
|
12175
12072
|
var renderRowMenu = (row, index, {
|
12176
12073
|
menu,
|
@@ -12180,14 +12077,14 @@ var renderRowMenu = (row, index, {
|
|
12180
12077
|
}) => {
|
12181
12078
|
if (menu) {
|
12182
12079
|
const menuContent = isFunction4(menu) ? menu(row, index) : menu;
|
12183
|
-
return /* @__PURE__ */
|
12080
|
+
return /* @__PURE__ */ React79.createElement(Table2.Cell, { align: "right" }, menuContent && /* @__PURE__ */ React79.createElement(
|
12184
12081
|
DropdownMenu2,
|
12185
12082
|
{
|
12186
12083
|
placement: defaultContextualMenuPlacement,
|
12187
12084
|
onAction: (action) => onAction?.(action, row, index),
|
12188
12085
|
onOpenChange: onMenuOpenChange
|
12189
12086
|
},
|
12190
|
-
/* @__PURE__ */
|
12087
|
+
/* @__PURE__ */ React79.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ React79.createElement(Button2.Icon, { "aria-label": menuAriaLabel, icon: import_more3.default })),
|
12191
12088
|
menuContent
|
12192
12089
|
));
|
12193
12090
|
}
|
@@ -12199,31 +12096,31 @@ var renderCell = (column, row, index, rows) => {
|
|
12199
12096
|
if (column.type === "status") {
|
12200
12097
|
const status = column.status(row, index, rows);
|
12201
12098
|
if (status) {
|
12202
|
-
cellContent = /* @__PURE__ */
|
12099
|
+
cellContent = /* @__PURE__ */ React79.createElement(StatusChip, { dense: true, ...status });
|
12203
12100
|
}
|
12204
12101
|
} else if (column.type === "action") {
|
12205
12102
|
const action = renameProperty("text", "children", column.action(row, index, rows));
|
12206
12103
|
if (action) {
|
12207
|
-
cellContent = /* @__PURE__ */
|
12104
|
+
cellContent = /* @__PURE__ */ React79.createElement(Button2.Secondary, { dense: true, ...action });
|
12208
12105
|
}
|
12209
12106
|
} else if (column.type === "custom") {
|
12210
12107
|
cellContent = column.UNSAFE_render(row, index, rows);
|
12211
12108
|
} else if (column.type === "item") {
|
12212
12109
|
const item = column.item(row, index, rows);
|
12213
12110
|
if (item) {
|
12214
|
-
cellContent = /* @__PURE__ */
|
12111
|
+
cellContent = /* @__PURE__ */ React79.createElement(Item2, { ...item });
|
12215
12112
|
}
|
12216
12113
|
} else if (column.formatter) {
|
12217
12114
|
cellContent = column.formatter(row[column.field], row, index, rows);
|
12218
12115
|
} else {
|
12219
12116
|
cellContent = row[column.field];
|
12220
12117
|
}
|
12221
|
-
return column.tooltip ? /* @__PURE__ */
|
12118
|
+
return column.tooltip ? /* @__PURE__ */ React79.createElement(Tooltip, { ...column.tooltip(row, index, rows) }, cellContent) : /* @__PURE__ */ React79.createElement(React79.Fragment, null, cellContent);
|
12222
12119
|
};
|
12223
12120
|
DataTable.Skeleton = DataListSkeleton;
|
12224
12121
|
|
12225
12122
|
// src/molecules/DatePicker/DatePicker.tsx
|
12226
|
-
import
|
12123
|
+
import React86 from "react";
|
12227
12124
|
import {
|
12228
12125
|
DatePicker as AriaDatePicker,
|
12229
12126
|
DatePickerStateContext,
|
@@ -12231,48 +12128,13 @@ import {
|
|
12231
12128
|
} from "react-aria-components";
|
12232
12129
|
import { useLabel as useLabel2 } from "@react-aria/label";
|
12233
12130
|
import { useId as useId10 } from "@react-aria/utils";
|
12234
|
-
import { omit as
|
12131
|
+
import { omit as omit8 } from "lodash-es";
|
12235
12132
|
|
12236
12133
|
// src/molecules/DateField/DateInput.tsx
|
12237
|
-
import
|
12134
|
+
import React80 from "react";
|
12238
12135
|
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({
|
12136
|
+
import { tv as tv8 } from "tailwind-variants";
|
12137
|
+
var segmentStyles = tv8({
|
12276
12138
|
base: "inline p-0.5 rounded outline outline-0 caret-transparent text-default",
|
12277
12139
|
variants: {
|
12278
12140
|
isPlaceholder: {
|
@@ -12287,47 +12149,40 @@ var segmentStyles = tv7({
|
|
12287
12149
|
}
|
12288
12150
|
});
|
12289
12151
|
function DateInput(props) {
|
12290
|
-
return /* @__PURE__ */
|
12152
|
+
return /* @__PURE__ */ React80.createElement(AriaDateInput, { className: (renderProps) => fieldGroup({ ...renderProps, class: "block" }), ...props }, (segment) => /* @__PURE__ */ React80.createElement(DateSegment, { segment, className: segmentStyles }));
|
12291
12153
|
}
|
12292
12154
|
|
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
12155
|
// src/molecules/TimeField/TimeField.tsx
|
12301
|
-
import
|
12156
|
+
import React81 from "react";
|
12302
12157
|
import {
|
12303
12158
|
TimeField as AriaTimeField
|
12304
12159
|
} from "react-aria-components";
|
12305
12160
|
import { useLabel } from "@react-aria/label";
|
12306
12161
|
import { useId as useId9 } from "@react-aria/utils";
|
12307
|
-
import { omit as
|
12162
|
+
import { omit as omit7 } from "lodash-es";
|
12308
12163
|
function TimeFieldBase({ disabled, valid, ...props }) {
|
12309
|
-
return /* @__PURE__ */
|
12164
|
+
return /* @__PURE__ */ React81.createElement(AriaTimeField, { ...props, isInvalid: valid === false, isDisabled: disabled }, /* @__PURE__ */ React81.createElement(DateInput, null));
|
12310
12165
|
}
|
12311
12166
|
function TimeField(props) {
|
12312
12167
|
const { labelProps, fieldProps } = useLabel({ label: props.labelText });
|
12313
12168
|
const errorMessageId = useId9();
|
12314
12169
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
12315
12170
|
const { "data-testid": dataTestId, ...labelControlProps } = getLabelControlProps(props);
|
12316
|
-
const baseProps =
|
12317
|
-
return /* @__PURE__ */
|
12171
|
+
const baseProps = omit7(props, Object.keys(labelControlProps));
|
12172
|
+
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
12173
|
}
|
12319
12174
|
|
12320
12175
|
// src/molecules/DatePicker/Button.tsx
|
12321
|
-
import
|
12322
|
-
import { Button as
|
12176
|
+
import React82 from "react";
|
12177
|
+
import { Button as AriaButton2, composeRenderProps as composeRenderProps3 } from "react-aria-components";
|
12323
12178
|
var import_calendar2 = __toESM(require_calendar());
|
12324
12179
|
var import_smallCross3 = __toESM(require_smallCross());
|
12325
12180
|
function Button3(props) {
|
12326
|
-
return /* @__PURE__ */
|
12327
|
-
|
12181
|
+
return /* @__PURE__ */ React82.createElement(
|
12182
|
+
AriaButton2,
|
12328
12183
|
{
|
12329
12184
|
...props,
|
12330
|
-
className:
|
12185
|
+
className: composeRenderProps3(
|
12331
12186
|
props.className,
|
12332
12187
|
(className, renderProps) => buttonClasses({ ...renderProps, className, dense: true, kind: "icon" })
|
12333
12188
|
)
|
@@ -12339,7 +12194,7 @@ var ButtonBase = ({
|
|
12339
12194
|
hideWhenParentIsNotHoveredOrFocused = true,
|
12340
12195
|
...props
|
12341
12196
|
}) => {
|
12342
|
-
return /* @__PURE__ */
|
12197
|
+
return /* @__PURE__ */ React82.createElement(
|
12343
12198
|
Button3,
|
12344
12199
|
{
|
12345
12200
|
...props,
|
@@ -12353,14 +12208,14 @@ var ButtonBase = ({
|
|
12353
12208
|
);
|
12354
12209
|
};
|
12355
12210
|
function ClearInputButton(props) {
|
12356
|
-
return /* @__PURE__ */
|
12211
|
+
return /* @__PURE__ */ React82.createElement(ButtonBase, { ...props, "aria-label": "Clear", slot: null, hideWhenParentIsNotHoveredOrFocused: false }, /* @__PURE__ */ React82.createElement(Icon2, { icon: import_smallCross3.default, dense: true }));
|
12357
12212
|
}
|
12358
12213
|
function CalendarButton(props) {
|
12359
|
-
return /* @__PURE__ */
|
12214
|
+
return /* @__PURE__ */ React82.createElement(ButtonBase, { ...props, "aria-label": "Calendar" }, /* @__PURE__ */ React82.createElement(Icon2, { icon: import_calendar2.default, dense: true }));
|
12360
12215
|
}
|
12361
12216
|
|
12362
12217
|
// src/molecules/DatePicker/Calendar.tsx
|
12363
|
-
import
|
12218
|
+
import React83 from "react";
|
12364
12219
|
import {
|
12365
12220
|
Calendar as AriaCalendar,
|
12366
12221
|
CalendarCell,
|
@@ -12370,10 +12225,10 @@ import {
|
|
12370
12225
|
CalendarHeaderCell,
|
12371
12226
|
Heading
|
12372
12227
|
} from "react-aria-components";
|
12373
|
-
import { tv as
|
12228
|
+
import { tv as tv9 } from "tailwind-variants";
|
12374
12229
|
var import_chevronLeft4 = __toESM(require_chevronLeft());
|
12375
12230
|
var import_chevronRight4 = __toESM(require_chevronRight());
|
12376
|
-
var cellStyles =
|
12231
|
+
var cellStyles = tv9({
|
12377
12232
|
extend: focusRing,
|
12378
12233
|
base: "w-8 h-8 typography-small cursor-default rounded-md flex items-center justify-center outside-month:hidden",
|
12379
12234
|
variants: {
|
@@ -12390,20 +12245,20 @@ var cellStyles = tv8({
|
|
12390
12245
|
}
|
12391
12246
|
});
|
12392
12247
|
var Calendar = (props) => {
|
12393
|
-
return /* @__PURE__ */
|
12248
|
+
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
12249
|
};
|
12395
12250
|
var CalendarHeader = () => {
|
12396
|
-
return /* @__PURE__ */
|
12251
|
+
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
12252
|
};
|
12398
12253
|
var CalendarGridHeader = () => {
|
12399
|
-
return /* @__PURE__ */
|
12254
|
+
return /* @__PURE__ */ React83.createElement(AriaCalendarGridHeader, null, (day) => /* @__PURE__ */ React83.createElement(CalendarHeaderCell, { className: "text-xs text-inactive typography-caption" }, day));
|
12400
12255
|
};
|
12401
12256
|
|
12402
12257
|
// src/molecules/DatePicker/Dialog.tsx
|
12403
|
-
import
|
12258
|
+
import React84 from "react";
|
12404
12259
|
import { Dialog as AriaDialog } from "react-aria-components";
|
12405
12260
|
function Dialog(props) {
|
12406
|
-
return /* @__PURE__ */
|
12261
|
+
return /* @__PURE__ */ React84.createElement(
|
12407
12262
|
AriaDialog,
|
12408
12263
|
{
|
12409
12264
|
...props,
|
@@ -12418,7 +12273,7 @@ function Dialog(props) {
|
|
12418
12273
|
}
|
12419
12274
|
|
12420
12275
|
// src/molecules/DatePicker/Popover.tsx
|
12421
|
-
import
|
12276
|
+
import React85 from "react";
|
12422
12277
|
import {
|
12423
12278
|
OverlayArrow as OverlayArrow2,
|
12424
12279
|
Popover as AriaPopover2,
|
@@ -12430,7 +12285,7 @@ var Popover2 = ({ children, showArrow, className, ...props }) => {
|
|
12430
12285
|
const isSubmenu = popoverContext?.trigger === "SubmenuTrigger";
|
12431
12286
|
let offset = showArrow ? 12 : 8;
|
12432
12287
|
offset = isSubmenu ? offset - 6 : offset;
|
12433
|
-
return /* @__PURE__ */
|
12288
|
+
return /* @__PURE__ */ React85.createElement(
|
12434
12289
|
AriaPopover2,
|
12435
12290
|
{
|
12436
12291
|
offset,
|
@@ -12439,7 +12294,7 @@ var Popover2 = ({ children, showArrow, className, ...props }) => {
|
|
12439
12294
|
"rounded-sm shadow-16dp bg-popover-content mt-1 overflow-y-auto flex flex-col border border-default outline-none"
|
12440
12295
|
)
|
12441
12296
|
},
|
12442
|
-
showArrow && /* @__PURE__ */
|
12297
|
+
showArrow && /* @__PURE__ */ React85.createElement(OverlayArrow2, { className: "group" }, /* @__PURE__ */ React85.createElement(
|
12443
12298
|
"svg",
|
12444
12299
|
{
|
12445
12300
|
width: 12,
|
@@ -12447,7 +12302,7 @@ var Popover2 = ({ children, showArrow, className, ...props }) => {
|
|
12447
12302
|
viewBox: "0 0 12 12",
|
12448
12303
|
className: "block fill-white stroke-1 stroke-black group-placement-bottom:rotate-180 group-placement-left:-rotate-90 group-placement-right:rotate-90"
|
12449
12304
|
},
|
12450
|
-
/* @__PURE__ */
|
12305
|
+
/* @__PURE__ */ React85.createElement("path", { d: "M0 0 L6 6 L12 0" })
|
12451
12306
|
)),
|
12452
12307
|
children
|
12453
12308
|
);
|
@@ -12455,14 +12310,14 @@ var Popover2 = ({ children, showArrow, className, ...props }) => {
|
|
12455
12310
|
|
12456
12311
|
// src/molecules/DatePicker/DatePicker.tsx
|
12457
12312
|
function DatePickerClearButton() {
|
12458
|
-
const state =
|
12313
|
+
const state = React86.useContext(DatePickerStateContext);
|
12459
12314
|
if (!state) {
|
12460
12315
|
throw new Error("DatePickerStateContext is missing a provider");
|
12461
12316
|
}
|
12462
12317
|
if (!state.value) {
|
12463
12318
|
return null;
|
12464
12319
|
}
|
12465
|
-
return /* @__PURE__ */
|
12320
|
+
return /* @__PURE__ */ React86.createElement(
|
12466
12321
|
ClearInputButton,
|
12467
12322
|
{
|
12468
12323
|
onPress: () => {
|
@@ -12481,7 +12336,7 @@ var createDatePickerBase = (variant) => ({
|
|
12481
12336
|
...props
|
12482
12337
|
}) => {
|
12483
12338
|
const hasSomeValue = props.value ?? props.defaultValue ?? props.placeholderValue;
|
12484
|
-
return /* @__PURE__ */
|
12339
|
+
return /* @__PURE__ */ React86.createElement(
|
12485
12340
|
AriaDatePicker,
|
12486
12341
|
{
|
12487
12342
|
...props,
|
@@ -12490,18 +12345,18 @@ var createDatePickerBase = (variant) => ({
|
|
12490
12345
|
isInvalid: valid === false,
|
12491
12346
|
granularity: granularity ?? (variant === "datetime" && !hasSomeValue ? "minute" : void 0)
|
12492
12347
|
},
|
12493
|
-
/* @__PURE__ */
|
12494
|
-
/* @__PURE__ */
|
12348
|
+
/* @__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))),
|
12349
|
+
/* @__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
12350
|
);
|
12496
12351
|
};
|
12497
12352
|
var DatePickerBase = createDatePickerBase("date");
|
12498
12353
|
var DateTimePickerBase = createDatePickerBase("datetime");
|
12499
12354
|
var PickerTimeField = ({ granularity }) => {
|
12500
|
-
const state =
|
12355
|
+
const state = React86.useContext(DatePickerStateContext);
|
12501
12356
|
if (!state) {
|
12502
12357
|
throw new Error("DatePickerStateContext is missing a provider");
|
12503
12358
|
}
|
12504
|
-
return /* @__PURE__ */
|
12359
|
+
return /* @__PURE__ */ React86.createElement(
|
12505
12360
|
TimeField,
|
12506
12361
|
{
|
12507
12362
|
labelText: "Time",
|
@@ -12517,15 +12372,15 @@ var createDatePicker = (variant) => (props) => {
|
|
12517
12372
|
const errorMessageId = useId10();
|
12518
12373
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId, "errorMessage": props.helperText ?? props.error } : {};
|
12519
12374
|
const { "data-testid": dataTestId, ...labelControlProps } = getLabelControlProps(props);
|
12520
|
-
const baseProps =
|
12375
|
+
const baseProps = omit8(props, Object.keys(labelControlProps));
|
12521
12376
|
const allProps = { ...baseProps, ...fieldProps, ...errorProps, disabled: props.disabled, valid: props.valid };
|
12522
|
-
return /* @__PURE__ */
|
12377
|
+
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
12378
|
};
|
12524
12379
|
var DatePicker = createDatePicker("date");
|
12525
12380
|
var DateTimePicker = createDatePicker("datetime");
|
12526
12381
|
|
12527
12382
|
// src/molecules/DatePicker/DateRangePicker.tsx
|
12528
|
-
import
|
12383
|
+
import React88 from "react";
|
12529
12384
|
import {
|
12530
12385
|
DateRangePicker as AriaDateRangePicker,
|
12531
12386
|
DateRangePickerStateContext,
|
@@ -12533,18 +12388,18 @@ import {
|
|
12533
12388
|
} from "react-aria-components";
|
12534
12389
|
import { useLabel as useLabel3 } from "@react-aria/label";
|
12535
12390
|
import { useId as useId11 } from "@react-aria/utils";
|
12536
|
-
import { omit as
|
12391
|
+
import { omit as omit9 } from "lodash-es";
|
12537
12392
|
|
12538
12393
|
// src/molecules/DatePicker/RangeCalendar.tsx
|
12539
|
-
import
|
12394
|
+
import React87 from "react";
|
12540
12395
|
import {
|
12541
12396
|
CalendarCell as CalendarCell2,
|
12542
12397
|
CalendarGrid as CalendarGrid2,
|
12543
12398
|
CalendarGridBody as CalendarGridBody2,
|
12544
12399
|
RangeCalendar as AriaRangeCalendar
|
12545
12400
|
} from "react-aria-components";
|
12546
|
-
import { tv as
|
12547
|
-
var cell =
|
12401
|
+
import { tv as tv10 } from "tailwind-variants";
|
12402
|
+
var cell = tv10({
|
12548
12403
|
extend: focusRing,
|
12549
12404
|
base: "w-full h-full flex items-center justify-center rounded-md text-default",
|
12550
12405
|
variants: {
|
@@ -12568,7 +12423,7 @@ var cell = tv9({
|
|
12568
12423
|
}
|
12569
12424
|
});
|
12570
12425
|
function RangeCalendar(props) {
|
12571
|
-
return /* @__PURE__ */
|
12426
|
+
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
12427
|
CalendarCell2,
|
12573
12428
|
{
|
12574
12429
|
date,
|
@@ -12579,7 +12434,7 @@ function RangeCalendar(props) {
|
|
12579
12434
|
"selection-start:rounded-s-md selection-end:rounded-e-md"
|
12580
12435
|
)
|
12581
12436
|
},
|
12582
|
-
({ formattedDate, isSelected, isSelectionStart, isSelectionEnd, ...rest }) => /* @__PURE__ */
|
12437
|
+
({ formattedDate, isSelected, isSelectionStart, isSelectionEnd, ...rest }) => /* @__PURE__ */ React87.createElement(
|
12583
12438
|
"span",
|
12584
12439
|
{
|
12585
12440
|
className: cell({
|
@@ -12594,14 +12449,14 @@ function RangeCalendar(props) {
|
|
12594
12449
|
|
12595
12450
|
// src/molecules/DatePicker/DateRangePicker.tsx
|
12596
12451
|
function DateRangePickerClearButton() {
|
12597
|
-
const state =
|
12452
|
+
const state = React88.useContext(DateRangePickerStateContext);
|
12598
12453
|
if (!state) {
|
12599
12454
|
throw new Error("DateRangePickerStateContext is missing a provider");
|
12600
12455
|
}
|
12601
12456
|
if (!state.value.start && !state.value.end) {
|
12602
12457
|
return null;
|
12603
12458
|
}
|
12604
|
-
return /* @__PURE__ */
|
12459
|
+
return /* @__PURE__ */ React88.createElement(
|
12605
12460
|
ClearInputButton,
|
12606
12461
|
{
|
12607
12462
|
onPress: () => {
|
@@ -12620,7 +12475,7 @@ var createDateRangePickerBase = (variant) => ({
|
|
12620
12475
|
...props
|
12621
12476
|
}) => {
|
12622
12477
|
const hasSomeValue = props.value ?? props.defaultValue ?? props.placeholderValue;
|
12623
|
-
return /* @__PURE__ */
|
12478
|
+
return /* @__PURE__ */ React88.createElement(
|
12624
12479
|
AriaDateRangePicker,
|
12625
12480
|
{
|
12626
12481
|
...props,
|
@@ -12630,13 +12485,13 @@ var createDateRangePickerBase = (variant) => ({
|
|
12630
12485
|
granularity: granularity ?? (variant === "datetime" && !hasSomeValue ? "minute" : void 0),
|
12631
12486
|
className: tw("group flex flex-col gap-1")
|
12632
12487
|
},
|
12633
|
-
/* @__PURE__ */
|
12634
|
-
/* @__PURE__ */
|
12488
|
+
/* @__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))),
|
12489
|
+
/* @__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
12490
|
);
|
12636
12491
|
};
|
12637
12492
|
var PickerTimeField2 = ({ granularity, part }) => {
|
12638
|
-
const ctx =
|
12639
|
-
return /* @__PURE__ */
|
12493
|
+
const ctx = React88.useContext(DateRangePickerStateContext);
|
12494
|
+
return /* @__PURE__ */ React88.createElement(
|
12640
12495
|
TimeField,
|
12641
12496
|
{
|
12642
12497
|
labelText: part === "start" ? "Start time" : "End time",
|
@@ -12654,23 +12509,23 @@ var createDateRangePicker = (variant) => (props) => {
|
|
12654
12509
|
const errorMessageId = useId11();
|
12655
12510
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId, "errorMessage": props.helperText ?? props.error } : {};
|
12656
12511
|
const { "data-testid": dataTestId, ...labelControlProps } = getLabelControlProps(props);
|
12657
|
-
const baseProps =
|
12512
|
+
const baseProps = omit9(props, Object.keys(labelControlProps));
|
12658
12513
|
const allProps = { ...baseProps, ...fieldProps, ...errorProps, disabled: props.disabled, valid: props.valid };
|
12659
|
-
return /* @__PURE__ */
|
12514
|
+
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
12515
|
};
|
12661
12516
|
var DateRangePicker = createDateRangePicker("date");
|
12662
12517
|
var DateTimeRangePicker = createDateRangePicker("datetime");
|
12663
12518
|
|
12664
12519
|
// src/molecules/Dialog/Dialog.tsx
|
12665
|
-
import
|
12520
|
+
import React91 from "react";
|
12666
12521
|
import { useDialog } from "@react-aria/dialog";
|
12667
12522
|
import { Overlay, useModalOverlay } from "@react-aria/overlays";
|
12668
12523
|
import { useId as useId12 } from "@react-aria/utils";
|
12669
12524
|
import { useOverlayTriggerState as useOverlayTriggerState2 } from "@react-stately/overlays";
|
12670
|
-
import { omit as
|
12525
|
+
import { omit as omit10 } from "lodash-es";
|
12671
12526
|
|
12672
12527
|
// src/atoms/Dialog/Dialog.tsx
|
12673
|
-
import
|
12528
|
+
import React89 from "react";
|
12674
12529
|
import { Dialog as AriaDialog2 } from "react-aria-components";
|
12675
12530
|
|
12676
12531
|
// node_modules/tailwind-merge/dist/bundle-mjs.mjs
|
@@ -15152,7 +15007,7 @@ var DIALOG_ICONS_AND_COLORS = {
|
|
15152
15007
|
}
|
15153
15008
|
};
|
15154
15009
|
var Dialog2 = (props) => {
|
15155
|
-
return /* @__PURE__ */
|
15010
|
+
return /* @__PURE__ */ React89.createElement(
|
15156
15011
|
AriaDialog2,
|
15157
15012
|
{
|
15158
15013
|
...props,
|
@@ -15162,9 +15017,9 @@ var Dialog2 = (props) => {
|
|
15162
15017
|
};
|
15163
15018
|
|
15164
15019
|
// src/atoms/Modal/Modal.tsx
|
15165
|
-
import
|
15166
|
-
import { tv as
|
15167
|
-
var modalStyles =
|
15020
|
+
import React90 from "react";
|
15021
|
+
import { tv as tv11 } from "tailwind-variants";
|
15022
|
+
var modalStyles = tv11({
|
15168
15023
|
slots: {
|
15169
15024
|
overlay: "inset-0 overflow-y-auto z-modal fixed",
|
15170
15025
|
backdrop: "-z-10 fixed min-w-full min-h-full bg-body-intense opacity-70",
|
@@ -15267,55 +15122,55 @@ var Modal = ({
|
|
15267
15122
|
...rest
|
15268
15123
|
}) => {
|
15269
15124
|
const { overlay } = modalStyles({ kind });
|
15270
|
-
return open ? /* @__PURE__ */
|
15125
|
+
return open ? /* @__PURE__ */ React90.createElement("div", { ...rest, className: overlay({ className }) }, children) : null;
|
15271
15126
|
};
|
15272
15127
|
Modal.BackDrop = ({ className, ...rest }) => {
|
15273
15128
|
const { backdrop } = modalStyles();
|
15274
|
-
return /* @__PURE__ */
|
15129
|
+
return /* @__PURE__ */ React90.createElement("div", { ...rest, className: backdrop({ className }) });
|
15275
15130
|
};
|
15276
|
-
Modal.Dialog =
|
15131
|
+
Modal.Dialog = React90.forwardRef(
|
15277
15132
|
({ kind = "dialog", children, className, size = "md", ...rest }, ref) => {
|
15278
15133
|
const { dialog } = modalStyles({ kind, size });
|
15279
|
-
return /* @__PURE__ */
|
15134
|
+
return /* @__PURE__ */ React90.createElement("div", { ref, "aria-modal": "true", ...rest, className: dialog({ className }) }, children);
|
15280
15135
|
}
|
15281
15136
|
);
|
15282
15137
|
Modal.Header = ({ kind = "dialog", size = "md", children, className, ...rest }) => {
|
15283
15138
|
const { header } = modalStyles({ kind, size });
|
15284
|
-
return /* @__PURE__ */
|
15139
|
+
return /* @__PURE__ */ React90.createElement("div", { ...rest, className: header({ className }) }, children);
|
15285
15140
|
};
|
15286
15141
|
Modal.HeaderImage = ({ backgroundImage, className, ...rest }) => {
|
15287
15142
|
const { headerImage } = modalStyles({ backgroundImage: Boolean(backgroundImage) });
|
15288
|
-
return backgroundImage ? /* @__PURE__ */
|
15143
|
+
return backgroundImage ? /* @__PURE__ */ React90.createElement("img", { "aria-hidden": true, src: backgroundImage, ...rest, className: headerImage({ className }) }) : /* @__PURE__ */ React90.createElement("div", { className: headerImage({ className }) });
|
15289
15144
|
};
|
15290
15145
|
Modal.CloseButtonContainer = ({ className, ...rest }) => {
|
15291
15146
|
const { closeButtonContainer } = modalStyles();
|
15292
|
-
return /* @__PURE__ */
|
15147
|
+
return /* @__PURE__ */ React90.createElement("div", { ...rest, className: closeButtonContainer({ className }) });
|
15293
15148
|
};
|
15294
15149
|
Modal.Title = ({ kind = "dialog", children, className, ...rest }) => {
|
15295
15150
|
const { title } = modalStyles({ kind });
|
15296
|
-
return /* @__PURE__ */
|
15151
|
+
return /* @__PURE__ */ React90.createElement(Typography, { htmlTag: "h2", variant: "subheading", color: "intense", className: title({ className }), ...rest }, children);
|
15297
15152
|
};
|
15298
|
-
Modal.Subtitle = ({ children, ...rest }) => /* @__PURE__ */
|
15153
|
+
Modal.Subtitle = ({ children, ...rest }) => /* @__PURE__ */ React90.createElement(Typography, { variant: "small", color: "default", ...rest }, children);
|
15299
15154
|
Modal.TitleContainer = ({ children, className, ...rest }) => {
|
15300
15155
|
const { titleContainer } = modalStyles();
|
15301
|
-
return /* @__PURE__ */
|
15156
|
+
return /* @__PURE__ */ React90.createElement("div", { ...rest, className: titleContainer({ className }) }, children);
|
15302
15157
|
};
|
15303
15158
|
Modal.Body = ({ children, className, noFooter = false, maxHeight, style, ...rest }) => {
|
15304
15159
|
const { body } = modalStyles();
|
15305
|
-
return /* @__PURE__ */
|
15160
|
+
return /* @__PURE__ */ React90.createElement("div", { ...rest, className: body({ noFooter, className }), style: { maxHeight, ...style } }, children);
|
15306
15161
|
};
|
15307
15162
|
Modal.Footer = ({ children, className, ...rest }) => {
|
15308
15163
|
const { footer } = modalStyles();
|
15309
|
-
return /* @__PURE__ */
|
15164
|
+
return /* @__PURE__ */ React90.createElement("div", { ...rest, className: footer({ className }) }, children);
|
15310
15165
|
};
|
15311
15166
|
Modal.Actions = ({ children, className, ...rest }) => {
|
15312
15167
|
const { actions } = modalStyles();
|
15313
|
-
return /* @__PURE__ */
|
15168
|
+
return /* @__PURE__ */ React90.createElement("div", { ...rest, className: actions({ className }) }, children);
|
15314
15169
|
};
|
15315
15170
|
|
15316
15171
|
// src/molecules/Dialog/Dialog.tsx
|
15317
15172
|
var Dialog3 = (props) => {
|
15318
|
-
const ref =
|
15173
|
+
const ref = React91.useRef(null);
|
15319
15174
|
const { open, onClose } = props;
|
15320
15175
|
const state = useOverlayTriggerState2({ isOpen: open, onOpenChange: (isOpen) => !isOpen && onClose?.() });
|
15321
15176
|
const { modalProps, underlayProps } = useModalOverlay(
|
@@ -15326,7 +15181,7 @@ var Dialog3 = (props) => {
|
|
15326
15181
|
if (!state.isOpen) {
|
15327
15182
|
return null;
|
15328
15183
|
}
|
15329
|
-
return /* @__PURE__ */
|
15184
|
+
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
15185
|
};
|
15331
15186
|
var DialogWrapper = ({
|
15332
15187
|
title,
|
@@ -15335,7 +15190,7 @@ var DialogWrapper = ({
|
|
15335
15190
|
primaryAction,
|
15336
15191
|
secondaryAction
|
15337
15192
|
}) => {
|
15338
|
-
const ref =
|
15193
|
+
const ref = React91.useRef(null);
|
15339
15194
|
const labelledBy = useId12();
|
15340
15195
|
const describedBy = useId12();
|
15341
15196
|
const { dialogProps } = useDialog(
|
@@ -15346,35 +15201,35 @@ var DialogWrapper = ({
|
|
15346
15201
|
},
|
15347
15202
|
ref
|
15348
15203
|
);
|
15349
|
-
return /* @__PURE__ */
|
15204
|
+
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
15205
|
};
|
15351
15206
|
|
15352
15207
|
// src/molecules/Drawer/Drawer.tsx
|
15353
|
-
import
|
15208
|
+
import React94 from "react";
|
15354
15209
|
import { Dialog as AriaDialog3, Modal as AriaModal, ModalOverlay as AriaModalOverlay } from "react-aria-components";
|
15355
15210
|
import { animated as animated5, useSpring as useSpring4 } from "@react-spring/web";
|
15356
|
-
import { castArray as castArray3, omit as
|
15211
|
+
import { castArray as castArray3, omit as omit11 } from "lodash-es";
|
15357
15212
|
|
15358
15213
|
// src/molecules/Modal/ModalTitle.tsx
|
15359
|
-
import
|
15214
|
+
import React92 from "react";
|
15360
15215
|
import { HeadingContext, useContextProps } from "react-aria-components";
|
15361
15216
|
var ModalTitle = ({ children, ...props }) => {
|
15362
15217
|
const [ctxProps] = useContextProps({ ...props, slot: "title" }, null, HeadingContext);
|
15363
|
-
return /* @__PURE__ */
|
15218
|
+
return /* @__PURE__ */ React92.createElement(Modal.Title, { id: ctxProps.id, ...props }, children);
|
15364
15219
|
};
|
15365
15220
|
|
15366
15221
|
// src/molecules/Tabs/Tabs.tsx
|
15367
|
-
import
|
15222
|
+
import React93, { useEffect as useEffect8, useLayoutEffect as useLayoutEffect2, useRef as useRef10, useState as useState11 } from "react";
|
15368
15223
|
import { isNumber as isNumber6, kebabCase } from "lodash-es";
|
15369
15224
|
var import_chevronLeft5 = __toESM(require_chevronLeft());
|
15370
15225
|
var import_chevronRight5 = __toESM(require_chevronRight());
|
15371
15226
|
var import_warningSign4 = __toESM(require_warningSign());
|
15372
15227
|
var isTabComponent = (c) => {
|
15373
|
-
return
|
15228
|
+
return React93.isValidElement(c) && (c.type === Tab || c.type === ModalTab);
|
15374
15229
|
};
|
15375
|
-
var Tab =
|
15230
|
+
var Tab = React93.forwardRef(
|
15376
15231
|
({ className, id, title, children }, ref) => {
|
15377
|
-
return /* @__PURE__ */
|
15232
|
+
return /* @__PURE__ */ React93.createElement(
|
15378
15233
|
"div",
|
15379
15234
|
{
|
15380
15235
|
ref,
|
@@ -15388,10 +15243,10 @@ var Tab = React92.forwardRef(
|
|
15388
15243
|
);
|
15389
15244
|
}
|
15390
15245
|
);
|
15391
|
-
var TabContainer = ({ className, children, ...rest }) => /* @__PURE__ */
|
15246
|
+
var TabContainer = ({ className, children, ...rest }) => /* @__PURE__ */ React93.createElement("div", { ...rest, className: classNames("py-6 z-0", className) }, children);
|
15392
15247
|
var ModalTab = Tab;
|
15393
15248
|
var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
15394
|
-
const Tab2 =
|
15249
|
+
const Tab2 = React93.forwardRef(
|
15395
15250
|
({
|
15396
15251
|
id,
|
15397
15252
|
value,
|
@@ -15410,11 +15265,11 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
15410
15265
|
const _id = id ?? kebabCase(title);
|
15411
15266
|
let statusIcon = void 0;
|
15412
15267
|
if (status === "warning") {
|
15413
|
-
statusIcon = /* @__PURE__ */
|
15268
|
+
statusIcon = /* @__PURE__ */ React93.createElement(InlineIcon, { icon: import_warningSign4.default, color: selected ? void 0 : "warning-default" });
|
15414
15269
|
} else if (status === "error") {
|
15415
|
-
statusIcon = /* @__PURE__ */
|
15270
|
+
statusIcon = /* @__PURE__ */ React93.createElement(InlineIcon, { icon: import_warningSign4.default, color: selected ? void 0 : "danger-default" });
|
15416
15271
|
}
|
15417
|
-
const tab = /* @__PURE__ */
|
15272
|
+
const tab = /* @__PURE__ */ React93.createElement(
|
15418
15273
|
Component,
|
15419
15274
|
{
|
15420
15275
|
ref,
|
@@ -15435,7 +15290,7 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
15435
15290
|
tabIndex: disabled ? void 0 : 0,
|
15436
15291
|
...rest
|
15437
15292
|
},
|
15438
|
-
/* @__PURE__ */
|
15293
|
+
/* @__PURE__ */ React93.createElement(
|
15439
15294
|
Typography2,
|
15440
15295
|
{
|
15441
15296
|
htmlTag: "div",
|
@@ -15443,8 +15298,8 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
15443
15298
|
color: selected ? "primary-default" : disabled ? "default" : "current",
|
15444
15299
|
className: tw("inline-flex items-center gap-3")
|
15445
15300
|
},
|
15446
|
-
showNotification ? /* @__PURE__ */
|
15447
|
-
isNumber6(badge) && /* @__PURE__ */
|
15301
|
+
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),
|
15302
|
+
isNumber6(badge) && /* @__PURE__ */ React93.createElement(
|
15448
15303
|
Typography2,
|
15449
15304
|
{
|
15450
15305
|
htmlTag: "span",
|
@@ -15452,7 +15307,7 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
15452
15307
|
color: selected ? "primary-intense" : "grey-5",
|
15453
15308
|
className: "leading-none"
|
15454
15309
|
},
|
15455
|
-
/* @__PURE__ */
|
15310
|
+
/* @__PURE__ */ React93.createElement(
|
15456
15311
|
TabBadge,
|
15457
15312
|
{
|
15458
15313
|
kind: "filled",
|
@@ -15464,7 +15319,7 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
15464
15319
|
statusIcon
|
15465
15320
|
)
|
15466
15321
|
);
|
15467
|
-
return tooltip ? /* @__PURE__ */
|
15322
|
+
return tooltip ? /* @__PURE__ */ React93.createElement(Tooltip, { content: tooltip }, tab) : tab;
|
15468
15323
|
}
|
15469
15324
|
);
|
15470
15325
|
Tab2.displayName = displayName;
|
@@ -15475,7 +15330,7 @@ var CARET_OFFSET = 24;
|
|
15475
15330
|
var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderChildren) => {
|
15476
15331
|
const Tabs2 = (props) => {
|
15477
15332
|
const { className, value, defaultValue, onChange, children } = props;
|
15478
|
-
const childArr =
|
15333
|
+
const childArr = React93.Children.toArray(children);
|
15479
15334
|
const firstTab = childArr[0];
|
15480
15335
|
const firstTabValue = isTabComponent(firstTab) ? firstTab.props.value : -1;
|
15481
15336
|
const [selected, setSelected] = useState11(value ?? defaultValue ?? firstTabValue ?? 0);
|
@@ -15487,7 +15342,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
15487
15342
|
const revealSelectedTab = ({ smooth }) => {
|
15488
15343
|
const container = containerRef.current;
|
15489
15344
|
const tabs = tabsRef.current;
|
15490
|
-
const values =
|
15345
|
+
const values = React93.Children.map(
|
15491
15346
|
children,
|
15492
15347
|
(tab, i) => tab?.props.value ?? i
|
15493
15348
|
);
|
@@ -15525,7 +15380,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
15525
15380
|
updateCarets();
|
15526
15381
|
setSelected(value);
|
15527
15382
|
revealSelectedTab({ smooth: value !== selected });
|
15528
|
-
}, [value,
|
15383
|
+
}, [value, React93.Children.count(children)]);
|
15529
15384
|
useLayoutEffect2(() => {
|
15530
15385
|
updateCarets();
|
15531
15386
|
containerRef.current?.addEventListener("scroll", updateCarets);
|
@@ -15587,12 +15442,12 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
15587
15442
|
const handleSelected = (key) => {
|
15588
15443
|
(onChange ?? setSelected)(key);
|
15589
15444
|
};
|
15590
|
-
|
15445
|
+
React93.Children.forEach(children, (c) => {
|
15591
15446
|
if (c && !isTabComponent(c)) {
|
15592
15447
|
throw new Error("<Tabs> can only have <Tabs.Tab> components as children");
|
15593
15448
|
}
|
15594
15449
|
});
|
15595
|
-
return /* @__PURE__ */
|
15450
|
+
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
15451
|
"div",
|
15597
15452
|
{
|
15598
15453
|
ref: tabsRef,
|
@@ -15600,9 +15455,9 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
15600
15455
|
"aria-label": "tabs",
|
15601
15456
|
className: tw("inline-flex items-center cursor-pointer font-normal h-full")
|
15602
15457
|
},
|
15603
|
-
|
15458
|
+
React93.Children.map(
|
15604
15459
|
children,
|
15605
|
-
(tab, index) => tab ? /* @__PURE__ */
|
15460
|
+
(tab, index) => tab ? /* @__PURE__ */ React93.createElement(
|
15606
15461
|
TabItemComponent,
|
15607
15462
|
{
|
15608
15463
|
key: tab.props.value,
|
@@ -15614,26 +15469,26 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
15614
15469
|
}
|
15615
15470
|
) : void 0
|
15616
15471
|
)
|
15617
|
-
)), leftCaret && /* @__PURE__ */
|
15472
|
+
)), 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
15473
|
"div",
|
15619
15474
|
{
|
15620
15475
|
onClick: () => handleScrollToNext("left"),
|
15621
15476
|
className: tw("hover:bg-muted p-2 leading-none cursor-pointer")
|
15622
15477
|
},
|
15623
|
-
/* @__PURE__ */
|
15624
|
-
)), rightCaret && /* @__PURE__ */
|
15478
|
+
/* @__PURE__ */ React93.createElement(InlineIcon, { icon: import_chevronLeft5.default })
|
15479
|
+
)), rightCaret && /* @__PURE__ */ React93.createElement(
|
15625
15480
|
"div",
|
15626
15481
|
{
|
15627
15482
|
onClick: () => handleScrollToNext("right"),
|
15628
15483
|
className: tw("absolute right-0 bg-gradient-to-l from-white via-white z-20 py-3 pl-4")
|
15629
15484
|
},
|
15630
|
-
/* @__PURE__ */
|
15485
|
+
/* @__PURE__ */ React93.createElement(
|
15631
15486
|
"div",
|
15632
15487
|
{
|
15633
15488
|
onClick: () => handleScrollToNext("right"),
|
15634
15489
|
className: tw("hover:bg-muted p-2 leading-none cursor-pointer")
|
15635
15490
|
},
|
15636
|
-
/* @__PURE__ */
|
15491
|
+
/* @__PURE__ */ React93.createElement(InlineIcon, { icon: import_chevronRight5.default })
|
15637
15492
|
)
|
15638
15493
|
)), renderChildren(children, selected, props));
|
15639
15494
|
};
|
@@ -15641,7 +15496,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
15641
15496
|
Tabs2.Tab = TabComponent;
|
15642
15497
|
return Tabs2;
|
15643
15498
|
};
|
15644
|
-
var Tabs = createTabsComponent(Tab, TabItem, "Tabs", (children, selected) => /* @__PURE__ */
|
15499
|
+
var Tabs = createTabsComponent(Tab, TabItem, "Tabs", (children, selected) => /* @__PURE__ */ React93.createElement(TabContainer, null, children.find(
|
15645
15500
|
(node, index) => node?.props.value === selected || index === selected
|
15646
15501
|
)));
|
15647
15502
|
|
@@ -15669,7 +15524,7 @@ var Drawer = ({
|
|
15669
15524
|
secondaryActions,
|
15670
15525
|
closeOnEsc = true
|
15671
15526
|
}) => {
|
15672
|
-
const [hidden, setHidden] =
|
15527
|
+
const [hidden, setHidden] = React94.useState(!open);
|
15673
15528
|
if (open && hidden) {
|
15674
15529
|
setHidden(!open);
|
15675
15530
|
}
|
@@ -15692,10 +15547,10 @@ var Drawer = ({
|
|
15692
15547
|
}
|
15693
15548
|
const dialogSize = size === "lg" ? "full" : size;
|
15694
15549
|
const styles = modalStyles({ kind: "drawer", size: dialogSize });
|
15695
|
-
const childElements =
|
15550
|
+
const childElements = React94.Children.toArray(children).filter(React94.isValidElement);
|
15696
15551
|
const onlyChild = childElements.length === 1 ? childElements[0] : null;
|
15697
15552
|
const hasTabs = isComponentType(onlyChild, Tabs);
|
15698
|
-
return /* @__PURE__ */
|
15553
|
+
return /* @__PURE__ */ React94.createElement(
|
15699
15554
|
AriaModalOverlay,
|
15700
15555
|
{
|
15701
15556
|
isOpen: !hidden,
|
@@ -15704,59 +15559,60 @@ var Drawer = ({
|
|
15704
15559
|
isKeyboardDismissDisabled: !closeOnEsc,
|
15705
15560
|
className: styles.overlay({ className: "Aquarium-Drawer" })
|
15706
15561
|
},
|
15707
|
-
/* @__PURE__ */
|
15708
|
-
/* @__PURE__ */
|
15562
|
+
/* @__PURE__ */ React94.createElement(AnimatedBackDrop, { style: { opacity } }),
|
15563
|
+
/* @__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
15564
|
DrawerTabs,
|
15710
15565
|
{
|
15711
15566
|
...onlyChild.props,
|
15712
15567
|
className: tw("[&>div:first-child]:px-5 grow flex flex-col overflow-y-auto")
|
15713
15568
|
}
|
15714
|
-
) : /* @__PURE__ */
|
15569
|
+
) : /* @__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
15570
|
);
|
15716
15571
|
};
|
15717
|
-
var DrawerTabs = createTabsComponent(ModalTab, TabItem, "DrawerTabs", (children, selected) => /* @__PURE__ */
|
15572
|
+
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
15573
|
(node, index) => node?.props.value === selected || index === selected
|
15719
15574
|
))));
|
15720
15575
|
|
15721
15576
|
// src/molecules/Dropdown/Dropdown.tsx
|
15722
|
-
import
|
15577
|
+
import React96 from "react";
|
15723
15578
|
import { OverlayTriggerStateContext as OverlayTriggerStateContext2 } from "react-aria-components";
|
15724
15579
|
|
15725
15580
|
// src/molecules/Popover/Popover.tsx
|
15726
|
-
import
|
15581
|
+
import React95, { createContext as createContext5 } from "react";
|
15727
15582
|
import { DialogTrigger, OverlayTriggerStateContext } from "react-aria-components";
|
15728
15583
|
import { mergeProps as mergeProps3 } from "@react-aria/utils";
|
15729
|
-
var PopoverPropsContext =
|
15584
|
+
var PopoverPropsContext = createContext5({});
|
15730
15585
|
var Popover3 = ({ children, onOpenChange: _onOpenChange, onClose, onOpen, ...props }) => {
|
15731
15586
|
const onOpenChange = (isOpen) => {
|
15732
15587
|
_onOpenChange?.(isOpen);
|
15733
15588
|
isOpen ? onOpen?.() : onClose?.();
|
15734
15589
|
};
|
15735
|
-
return /* @__PURE__ */
|
15590
|
+
return /* @__PURE__ */ React95.createElement(PopoverPropsContext.Provider, { value: props }, /* @__PURE__ */ React95.createElement(DialogTrigger, { ...props, onOpenChange }, children));
|
15736
15591
|
};
|
15592
|
+
Popover3.displayName = "Popover";
|
15737
15593
|
var Trigger = ({ children }) => {
|
15738
|
-
return /* @__PURE__ */
|
15594
|
+
return /* @__PURE__ */ React95.createElement(Pressable, { "aria-haspopup": "true" }, children);
|
15739
15595
|
};
|
15740
15596
|
Trigger.displayName = "Popover.Trigger";
|
15741
15597
|
Popover3.Trigger = Trigger;
|
15742
15598
|
var Panel = ({ className, children }) => {
|
15743
|
-
const { offset = 0, onOpenChange, ...props } =
|
15744
|
-
return /* @__PURE__ */
|
15599
|
+
const { offset = 0, onOpenChange, ...props } = React95.useContext(PopoverPropsContext);
|
15600
|
+
return /* @__PURE__ */ React95.createElement(Popover, { ...props, className, offset }, /* @__PURE__ */ React95.createElement(Dialog2, null, children));
|
15745
15601
|
};
|
15746
15602
|
Panel.displayName = "Popover.Panel";
|
15747
15603
|
Popover3.Panel = Panel;
|
15748
15604
|
var CloseToggle = ({ children }) => {
|
15749
|
-
const ctx =
|
15605
|
+
const ctx = React95.useContext(OverlayTriggerStateContext);
|
15750
15606
|
const onClick = ctx?.close;
|
15751
|
-
const child =
|
15752
|
-
return
|
15607
|
+
const child = React95.Children.only(children);
|
15608
|
+
return React95.cloneElement(child, { ...mergeProps3(child.props, { onClick }) });
|
15753
15609
|
};
|
15754
15610
|
CloseToggle.displayName = "Popover.CloseToggle";
|
15755
15611
|
Popover3.CloseToggle = CloseToggle;
|
15756
15612
|
|
15757
15613
|
// src/molecules/Dropdown/Dropdown.tsx
|
15758
15614
|
var Dropdown = ({ children, content, placement = "bottom-left" }) => {
|
15759
|
-
return /* @__PURE__ */
|
15615
|
+
return /* @__PURE__ */ React96.createElement(Popover3, { placement }, /* @__PURE__ */ React96.createElement(Popover3.Trigger, null, children), /* @__PURE__ */ React96.createElement(Popover3.Panel, { className: "Aquarium-Dropdown" }, content));
|
15760
15616
|
};
|
15761
15617
|
var DropdownMenu3 = ({
|
15762
15618
|
title,
|
@@ -15765,13 +15621,13 @@ var DropdownMenu3 = ({
|
|
15765
15621
|
triggerId,
|
15766
15622
|
setClose = () => void 0
|
15767
15623
|
}) => {
|
15768
|
-
const menuRef =
|
15769
|
-
|
15624
|
+
const menuRef = React96.useRef(null);
|
15625
|
+
React96.useEffect(() => {
|
15770
15626
|
const id = setTimeout(() => (menuRef.current?.children[0]).focus());
|
15771
15627
|
return () => clearTimeout(id);
|
15772
15628
|
}, [menuRef.current]);
|
15773
|
-
return /* @__PURE__ */
|
15774
|
-
return
|
15629
|
+
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) => {
|
15630
|
+
return React96.cloneElement(child, { setClose });
|
15775
15631
|
})));
|
15776
15632
|
};
|
15777
15633
|
var DropdownItem = ({
|
@@ -15784,7 +15640,7 @@ var DropdownItem = ({
|
|
15784
15640
|
setClose = () => void 0,
|
15785
15641
|
...props
|
15786
15642
|
}) => {
|
15787
|
-
const ctx =
|
15643
|
+
const ctx = React96.useContext(OverlayTriggerStateContext2);
|
15788
15644
|
const handleSelect = () => {
|
15789
15645
|
onSelect?.();
|
15790
15646
|
ctx?.close();
|
@@ -15818,8 +15674,8 @@ var DropdownItem = ({
|
|
15818
15674
|
handleSelect();
|
15819
15675
|
}
|
15820
15676
|
};
|
15821
|
-
const itemContent = /* @__PURE__ */
|
15822
|
-
return /* @__PURE__ */
|
15677
|
+
const itemContent = /* @__PURE__ */ React96.createElement("div", { className: tw("py-3 px-4") }, children);
|
15678
|
+
return /* @__PURE__ */ React96.createElement(
|
15823
15679
|
"li",
|
15824
15680
|
{
|
15825
15681
|
role: "menuitem",
|
@@ -15836,14 +15692,14 @@ var DropdownItem = ({
|
|
15836
15692
|
})
|
15837
15693
|
)
|
15838
15694
|
},
|
15839
|
-
tooltip ? /* @__PURE__ */
|
15695
|
+
tooltip ? /* @__PURE__ */ React96.createElement(Tooltip, { content: tooltip, placement: tooltipPlacement, display: "block" }, /* @__PURE__ */ React96.createElement("div", { tabIndex: 0, className: tw("grow") }, itemContent)) : itemContent
|
15840
15696
|
);
|
15841
15697
|
};
|
15842
15698
|
Dropdown.Menu = DropdownMenu3;
|
15843
15699
|
Dropdown.Item = DropdownItem;
|
15844
15700
|
|
15845
15701
|
// src/molecules/EmptyState/EmptyState.tsx
|
15846
|
-
import
|
15702
|
+
import React97 from "react";
|
15847
15703
|
var EmptyStateLayout = /* @__PURE__ */ ((EmptyStateLayout2) => {
|
15848
15704
|
EmptyStateLayout2["Vertical"] = "vertical";
|
15849
15705
|
EmptyStateLayout2["Horizontal"] = "horizontal";
|
@@ -15881,7 +15737,7 @@ var EmptyState = ({
|
|
15881
15737
|
fullHeight = isVerticalLayout(layout) ? true : false
|
15882
15738
|
}) => {
|
15883
15739
|
const template = layoutStyle(layout);
|
15884
|
-
return /* @__PURE__ */
|
15740
|
+
return /* @__PURE__ */ React97.createElement(
|
15885
15741
|
Box,
|
15886
15742
|
{
|
15887
15743
|
className: classNames(
|
@@ -15897,7 +15753,7 @@ var EmptyState = ({
|
|
15897
15753
|
backgroundColor: "transparent",
|
15898
15754
|
borderColor: "default"
|
15899
15755
|
},
|
15900
|
-
/* @__PURE__ */
|
15756
|
+
/* @__PURE__ */ React97.createElement(
|
15901
15757
|
Box.Flex,
|
15902
15758
|
{
|
15903
15759
|
style: { gap: "56px" },
|
@@ -15906,21 +15762,21 @@ var EmptyState = ({
|
|
15906
15762
|
alignItems: template.layout === "row" ? "center" : template.alignItems,
|
15907
15763
|
height: fullHeight ? "full" : void 0
|
15908
15764
|
},
|
15909
|
-
Image2 && (typeof Image2 === "string" ? /* @__PURE__ */
|
15765
|
+
Image2 && (typeof Image2 === "string" ? /* @__PURE__ */ React97.createElement(
|
15910
15766
|
"img",
|
15911
15767
|
{
|
15912
15768
|
src: Image2,
|
15913
15769
|
alt: imageAlt,
|
15914
15770
|
style: { width: imageWidth ? `${imageWidth}px` : void 0, height: "auto" }
|
15915
15771
|
}
|
15916
|
-
) : /* @__PURE__ */
|
15917
|
-
/* @__PURE__ */
|
15772
|
+
) : /* @__PURE__ */ React97.createElement("div", { className: tw("animate-draw") }, /* @__PURE__ */ React97.createElement(Image2, null))),
|
15773
|
+
/* @__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
15774
|
)
|
15919
15775
|
);
|
15920
15776
|
};
|
15921
15777
|
|
15922
15778
|
// src/molecules/LineClamp/LineClamp.tsx
|
15923
|
-
import
|
15779
|
+
import React98 from "react";
|
15924
15780
|
var LineClamp2 = ({
|
15925
15781
|
lines,
|
15926
15782
|
children,
|
@@ -15929,10 +15785,10 @@ var LineClamp2 = ({
|
|
15929
15785
|
collapseLabel,
|
15930
15786
|
onClampedChange
|
15931
15787
|
}) => {
|
15932
|
-
const ref =
|
15933
|
-
const [clamped, setClamped] =
|
15934
|
-
const [isClampingEnabled, setClampingEnabled] =
|
15935
|
-
|
15788
|
+
const ref = React98.useRef(null);
|
15789
|
+
const [clamped, setClamped] = React98.useState(true);
|
15790
|
+
const [isClampingEnabled, setClampingEnabled] = React98.useState(false);
|
15791
|
+
React98.useEffect(() => {
|
15936
15792
|
const el = ref.current;
|
15937
15793
|
setClampingEnabled((el?.scrollHeight ?? 0) > (el?.clientHeight ?? 0));
|
15938
15794
|
}, [ref.current]);
|
@@ -15940,25 +15796,25 @@ var LineClamp2 = ({
|
|
15940
15796
|
setClamped(!clamped);
|
15941
15797
|
onClampedChange?.(!clamped);
|
15942
15798
|
};
|
15943
|
-
return /* @__PURE__ */
|
15799
|
+
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
15800
|
};
|
15945
15801
|
|
15946
15802
|
// src/molecules/List/useStaticInfiniteList.ts
|
15947
|
-
import
|
15803
|
+
import React99 from "react";
|
15948
15804
|
var useStaticInfiniteList = ({
|
15949
15805
|
items,
|
15950
15806
|
pageSize,
|
15951
15807
|
autoReset = true
|
15952
15808
|
}) => {
|
15953
|
-
const [currentPage, setCurrentPage] =
|
15809
|
+
const [currentPage, setCurrentPage] = React99.useState(1);
|
15954
15810
|
const numberOfVisible = currentPage * pageSize;
|
15955
|
-
const next =
|
15811
|
+
const next = React99.useCallback(() => {
|
15956
15812
|
setCurrentPage((page) => page + 1);
|
15957
15813
|
}, [setCurrentPage]);
|
15958
|
-
const reset =
|
15814
|
+
const reset = React99.useCallback(() => {
|
15959
15815
|
setCurrentPage(1);
|
15960
15816
|
}, [setCurrentPage]);
|
15961
|
-
|
15817
|
+
React99.useEffect(() => {
|
15962
15818
|
if (autoReset) {
|
15963
15819
|
setCurrentPage(1);
|
15964
15820
|
}
|
@@ -15973,9 +15829,9 @@ var useStaticInfiniteList = ({
|
|
15973
15829
|
};
|
15974
15830
|
|
15975
15831
|
// src/molecules/ListItem/ListItem.tsx
|
15976
|
-
import
|
15832
|
+
import React100 from "react";
|
15977
15833
|
var ListItem = ({ name, icon, active = false }) => {
|
15978
|
-
return /* @__PURE__ */
|
15834
|
+
return /* @__PURE__ */ React100.createElement(Box.Flex, { className: "Aquarium-ListItem", alignItems: "center" }, /* @__PURE__ */ React100.createElement(
|
15979
15835
|
Typography2,
|
15980
15836
|
{
|
15981
15837
|
variant: active ? "small-strong" : "small",
|
@@ -15983,15 +15839,15 @@ var ListItem = ({ name, icon, active = false }) => {
|
|
15983
15839
|
htmlTag: "span",
|
15984
15840
|
className: `px-4 py-2 rounded-full ${active ? "bg-default" : "hover:bg-muted"}`
|
15985
15841
|
},
|
15986
|
-
/* @__PURE__ */
|
15842
|
+
/* @__PURE__ */ React100.createElement("img", { src: icon, alt: "", className: "inline mr-4", height: 28, width: 28 }),
|
15987
15843
|
name
|
15988
15844
|
));
|
15989
15845
|
};
|
15990
15846
|
|
15991
15847
|
// src/molecules/Modal/Modal.tsx
|
15992
|
-
import
|
15848
|
+
import React101 from "react";
|
15993
15849
|
import { Dialog as AriaDialog4, Modal as AriaModal2, ModalOverlay as AriaModalOverlay2 } from "react-aria-components";
|
15994
|
-
import { castArray as castArray4, omit as
|
15850
|
+
import { castArray as castArray4, omit as omit12 } from "lodash-es";
|
15995
15851
|
var import_cross7 = __toESM(require_cross());
|
15996
15852
|
var Modal2 = ({
|
15997
15853
|
open,
|
@@ -16010,7 +15866,7 @@ var Modal2 = ({
|
|
16010
15866
|
}
|
16011
15867
|
const styles = modalStyles({ kind: "dialog", size });
|
16012
15868
|
const hasTabs = isComponentType(children, ModalTabs);
|
16013
|
-
return /* @__PURE__ */
|
15869
|
+
return /* @__PURE__ */ React101.createElement(
|
16014
15870
|
AriaModalOverlay2,
|
16015
15871
|
{
|
16016
15872
|
isOpen: open,
|
@@ -16019,43 +15875,43 @@ var Modal2 = ({
|
|
16019
15875
|
isKeyboardDismissDisabled: !closeOnEsc,
|
16020
15876
|
className: styles.overlay({ className: "Aquarium-Modal" })
|
16021
15877
|
},
|
16022
|
-
size !== "screen" && /* @__PURE__ */
|
16023
|
-
/* @__PURE__ */
|
15878
|
+
size !== "screen" && /* @__PURE__ */ React101.createElement(Modal.BackDrop, { className: styles.backdrop() }),
|
15879
|
+
/* @__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
15880
|
Modal.Header,
|
16025
15881
|
{
|
16026
15882
|
kind: "dialog",
|
16027
15883
|
size,
|
16028
15884
|
className: tw({ "pb-3": isComponentType(children, ModalTabs) })
|
16029
15885
|
},
|
16030
|
-
/* @__PURE__ */
|
16031
|
-
), hasTabs ?
|
15886
|
+
/* @__PURE__ */ React101.createElement(Modal.TitleContainer, null, /* @__PURE__ */ React101.createElement(ModalTitle, { kind: "dialog" }, title), subtitle && /* @__PURE__ */ React101.createElement(Modal.Subtitle, null, subtitle))
|
15887
|
+
), 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
15888
|
);
|
16033
15889
|
};
|
16034
15890
|
var ModalTabs = createTabsComponent(
|
16035
15891
|
ModalTab,
|
16036
15892
|
TabItem,
|
16037
15893
|
"ModalTabs",
|
16038
|
-
(children, selected, props) => /* @__PURE__ */
|
15894
|
+
(children, selected, props) => /* @__PURE__ */ React101.createElement(Modal.Body, { maxHeight: props.maxHeight }, /* @__PURE__ */ React101.createElement(TabContainer, null, children.find(
|
16039
15895
|
(node, index) => node?.props.value === selected || index === selected
|
16040
15896
|
)))
|
16041
15897
|
);
|
16042
15898
|
|
16043
15899
|
// src/molecules/MultiInput/MultiInput.tsx
|
16044
|
-
import
|
15900
|
+
import React103, { useEffect as useEffect9, useRef as useRef11, useState as useState12 } from "react";
|
16045
15901
|
import { useId as useId13 } from "@react-aria/utils";
|
16046
|
-
import { castArray as castArray5, identity, omit as
|
15902
|
+
import { castArray as castArray5, identity, omit as omit13 } from "lodash-es";
|
16047
15903
|
|
16048
15904
|
// src/molecules/MultiInput/InputChip.tsx
|
16049
|
-
import
|
15905
|
+
import React102 from "react";
|
16050
15906
|
var import_smallCross4 = __toESM(require_smallCross());
|
16051
|
-
var InputChip =
|
15907
|
+
var InputChip = React102.forwardRef(
|
16052
15908
|
({ invalid = false, disabled, readOnly, className, onClick: _onClick, children, ...props }, ref) => {
|
16053
15909
|
const onClick = (e) => {
|
16054
15910
|
if (!disabled && !readOnly) {
|
16055
15911
|
_onClick?.(e);
|
16056
15912
|
}
|
16057
15913
|
};
|
16058
|
-
return /* @__PURE__ */
|
15914
|
+
return /* @__PURE__ */ React102.createElement(
|
16059
15915
|
"div",
|
16060
15916
|
{
|
16061
15917
|
className: classNames(
|
@@ -16068,8 +15924,8 @@ var InputChip = React101.forwardRef(
|
|
16068
15924
|
}
|
16069
15925
|
)
|
16070
15926
|
},
|
16071
|
-
/* @__PURE__ */
|
16072
|
-
!readOnly && /* @__PURE__ */
|
15927
|
+
/* @__PURE__ */ React102.createElement("div", { className: tw("px-2 py-1") }, /* @__PURE__ */ React102.createElement(Typography2, { variant: "small", color: invalid ? "danger-default" : disabled ? "inactive" : "default" }, children)),
|
15928
|
+
!readOnly && /* @__PURE__ */ React102.createElement(
|
16073
15929
|
"div",
|
16074
15930
|
{
|
16075
15931
|
ref,
|
@@ -16083,7 +15939,7 @@ var InputChip = React101.forwardRef(
|
|
16083
15939
|
role: "button",
|
16084
15940
|
"aria-label": `Remove ${String(children)}`
|
16085
15941
|
},
|
16086
|
-
!disabled && /* @__PURE__ */
|
15942
|
+
!disabled && /* @__PURE__ */ React102.createElement(
|
16087
15943
|
Icon,
|
16088
15944
|
{
|
16089
15945
|
icon: import_smallCross4.default,
|
@@ -16201,7 +16057,7 @@ var MultiInputBase = ({
|
|
16201
16057
|
}
|
16202
16058
|
onBlur?.();
|
16203
16059
|
};
|
16204
|
-
const renderChips = () => items.map((item, index) => /* @__PURE__ */
|
16060
|
+
const renderChips = () => items.map((item, index) => /* @__PURE__ */ React103.createElement(
|
16205
16061
|
InputChip,
|
16206
16062
|
{
|
16207
16063
|
key: `${itemToString(item)}.${index}`,
|
@@ -16215,12 +16071,12 @@ var MultiInputBase = ({
|
|
16215
16071
|
},
|
16216
16072
|
itemToString(item)
|
16217
16073
|
));
|
16218
|
-
return /* @__PURE__ */
|
16074
|
+
return /* @__PURE__ */ React103.createElement("div", { className: "Aquarium-MultiInputBase" }, /* @__PURE__ */ React103.createElement(
|
16219
16075
|
Select.InputContainer,
|
16220
16076
|
{
|
16221
16077
|
variant: disabled ? "disabled" : !valid ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default"
|
16222
16078
|
},
|
16223
|
-
/* @__PURE__ */
|
16079
|
+
/* @__PURE__ */ React103.createElement("div", { className: "grow inline-flex flex-row flex-wrap gap-y-2" }, inline && renderChips(), /* @__PURE__ */ React103.createElement(
|
16224
16080
|
Select.Input,
|
16225
16081
|
{
|
16226
16082
|
ref: inputRef,
|
@@ -16242,10 +16098,10 @@ var MultiInputBase = ({
|
|
16242
16098
|
autoComplete: "off"
|
16243
16099
|
}
|
16244
16100
|
)),
|
16245
|
-
endAdornment && /* @__PURE__ */
|
16246
|
-
), !inline && /* @__PURE__ */
|
16101
|
+
endAdornment && /* @__PURE__ */ React103.createElement(InputAdornment, null, endAdornment)
|
16102
|
+
), !inline && /* @__PURE__ */ React103.createElement("div", { className: tw("flex flex-row flex-wrap gap-y-2 mt-2") }, renderChips()));
|
16247
16103
|
};
|
16248
|
-
var BaseMultiInputSkeleton = () => /* @__PURE__ */
|
16104
|
+
var BaseMultiInputSkeleton = () => /* @__PURE__ */ React103.createElement(Skeleton, { height: 38 });
|
16249
16105
|
MultiInputBase.Skeleton = BaseMultiInputSkeleton;
|
16250
16106
|
var MultiInput = (props) => {
|
16251
16107
|
const [value, setValue] = useState12(props.value ?? props.defaultValue ?? []);
|
@@ -16257,8 +16113,8 @@ var MultiInput = (props) => {
|
|
16257
16113
|
const errorMessageId = useId13();
|
16258
16114
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
16259
16115
|
const labelControlProps = getLabelControlProps(props);
|
16260
|
-
const baseProps =
|
16261
|
-
return /* @__PURE__ */
|
16116
|
+
const baseProps = omit13(props, Object.keys(labelControlProps));
|
16117
|
+
return /* @__PURE__ */ React103.createElement(
|
16262
16118
|
LabelControl,
|
16263
16119
|
{
|
16264
16120
|
id: `${id}-label`,
|
@@ -16269,7 +16125,7 @@ var MultiInput = (props) => {
|
|
16269
16125
|
maxLength: props.maxLength,
|
16270
16126
|
className: "Aquarium-MultiInput"
|
16271
16127
|
},
|
16272
|
-
/* @__PURE__ */
|
16128
|
+
/* @__PURE__ */ React103.createElement(
|
16273
16129
|
MultiInputBase,
|
16274
16130
|
{
|
16275
16131
|
...baseProps,
|
@@ -16286,16 +16142,16 @@ var MultiInput = (props) => {
|
|
16286
16142
|
)
|
16287
16143
|
);
|
16288
16144
|
};
|
16289
|
-
var MultiInputSkeleton = () => /* @__PURE__ */
|
16145
|
+
var MultiInputSkeleton = () => /* @__PURE__ */ React103.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React103.createElement(MultiInputBase.Skeleton, null));
|
16290
16146
|
MultiInput.Skeleton = MultiInputSkeleton;
|
16291
16147
|
MultiInput.Skeleton.displayName = "MultiInput.Skeleton";
|
16292
16148
|
|
16293
16149
|
// src/molecules/MultiSelect/MultiSelect.tsx
|
16294
|
-
import
|
16150
|
+
import React104, { useEffect as useEffect10, useRef as useRef12, useState as useState13 } from "react";
|
16295
16151
|
import { ariaHideOutside as ariaHideOutside3 } from "@react-aria/overlays";
|
16296
16152
|
import { useId as useId14 } from "@react-aria/utils";
|
16297
16153
|
import { useCombobox as useCombobox2, useMultipleSelection } from "downshift";
|
16298
|
-
import { isEqual, isNil as isNil3, omit as
|
16154
|
+
import { isEqual, isNil as isNil3, omit as omit14, omitBy } from "lodash-es";
|
16299
16155
|
import { matchSorter as matchSorter2 } from "match-sorter";
|
16300
16156
|
var MultiSelectBase = ({
|
16301
16157
|
id,
|
@@ -16409,7 +16265,7 @@ var MultiSelectBase = ({
|
|
16409
16265
|
return ariaHideOutside3([inputRef.current, popoverRef.current]);
|
16410
16266
|
}
|
16411
16267
|
}, [isOpen, inputRef, popoverRef]);
|
16412
|
-
const renderItem = (item, index) => /* @__PURE__ */
|
16268
|
+
const renderItem = (item, index) => /* @__PURE__ */ React104.createElement(
|
16413
16269
|
Select.Item,
|
16414
16270
|
{
|
16415
16271
|
key: itemToString(item),
|
@@ -16419,9 +16275,9 @@ var MultiSelectBase = ({
|
|
16419
16275
|
},
|
16420
16276
|
renderOption(item)
|
16421
16277
|
);
|
16422
|
-
const renderGroup = (group) => group.options.length ? /* @__PURE__ */
|
16278
|
+
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
16279
|
const renderChips = () => {
|
16424
|
-
return selectedItems.map((selectedItem, index) => /* @__PURE__ */
|
16280
|
+
return selectedItems.map((selectedItem, index) => /* @__PURE__ */ React104.createElement(
|
16425
16281
|
InputChip,
|
16426
16282
|
{
|
16427
16283
|
key: `${itemToString(selectedItem)}.chip`,
|
@@ -16443,13 +16299,13 @@ var MultiSelectBase = ({
|
|
16443
16299
|
getDropdownProps({ ref: inputRef, disabled: disabled || readOnly, value: inputValue })
|
16444
16300
|
);
|
16445
16301
|
const menuProps = getMenuProps({ ref: menuRef }, { suppressRefError: !isOpen });
|
16446
|
-
return /* @__PURE__ */
|
16302
|
+
return /* @__PURE__ */ React104.createElement("div", { className: classNames("Aquarium-MultiSelectBase", tw("relative")) }, /* @__PURE__ */ React104.createElement(
|
16447
16303
|
Select.InputContainer,
|
16448
16304
|
{
|
16449
16305
|
ref: targetRef,
|
16450
16306
|
variant: disabled ? "disabled" : !valid ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default"
|
16451
16307
|
},
|
16452
|
-
/* @__PURE__ */
|
16308
|
+
/* @__PURE__ */ React104.createElement("div", { className: "grow inline-flex flex-row flex-wrap gap-2" }, !hideChips && inline && renderChips(), /* @__PURE__ */ React104.createElement(
|
16453
16309
|
Select.Input,
|
16454
16310
|
{
|
16455
16311
|
name,
|
@@ -16471,8 +16327,8 @@ var MultiSelectBase = ({
|
|
16471
16327
|
}
|
16472
16328
|
}
|
16473
16329
|
)),
|
16474
|
-
!readOnly && /* @__PURE__ */
|
16475
|
-
), !hideChips && !inline && /* @__PURE__ */
|
16330
|
+
!readOnly && /* @__PURE__ */ React104.createElement(Select.Toggle, { hasFocus, isOpen, ...getToggleButtonProps({ disabled }) })
|
16331
|
+
), !hideChips && !inline && /* @__PURE__ */ React104.createElement("div", { className: tw("flex flex-row flex-wrap gap-2 mt-2") }, renderChips()), /* @__PURE__ */ React104.createElement(
|
16476
16332
|
Popover,
|
16477
16333
|
{
|
16478
16334
|
ref: popoverRef,
|
@@ -16482,12 +16338,12 @@ var MultiSelectBase = ({
|
|
16482
16338
|
isNonModal: true,
|
16483
16339
|
style: { width: targetRef.current?.offsetWidth }
|
16484
16340
|
},
|
16485
|
-
/* @__PURE__ */
|
16341
|
+
/* @__PURE__ */ React104.createElement(Select.Menu, { maxHeight, ...menuProps }, hasNoResults && /* @__PURE__ */ React104.createElement(Select.NoResults, null, emptyState), filteredOptions.map(
|
16486
16342
|
(option, index) => isOptionGroup(option) ? renderGroup(option) : renderItem(option, index)
|
16487
16343
|
))
|
16488
16344
|
));
|
16489
16345
|
};
|
16490
|
-
var MultiSelectBaseSkeleton = () => /* @__PURE__ */
|
16346
|
+
var MultiSelectBaseSkeleton = () => /* @__PURE__ */ React104.createElement(Skeleton, { height: 38 });
|
16491
16347
|
MultiSelectBase.Skeleton = MultiSelectBaseSkeleton;
|
16492
16348
|
var MultiSelect = ({
|
16493
16349
|
options,
|
@@ -16499,8 +16355,8 @@ var MultiSelect = ({
|
|
16499
16355
|
const errorMessageId = useId14();
|
16500
16356
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
16501
16357
|
const labelControlProps = getLabelControlProps(props);
|
16502
|
-
const baseProps =
|
16503
|
-
return /* @__PURE__ */
|
16358
|
+
const baseProps = omit14(props, Object.keys(labelControlProps));
|
16359
|
+
return /* @__PURE__ */ React104.createElement(
|
16504
16360
|
LabelControl,
|
16505
16361
|
{
|
16506
16362
|
id: `${id}-label`,
|
@@ -16509,7 +16365,7 @@ var MultiSelect = ({
|
|
16509
16365
|
...labelControlProps,
|
16510
16366
|
className: "Aquarium-MultiSelect"
|
16511
16367
|
},
|
16512
|
-
/* @__PURE__ */
|
16368
|
+
/* @__PURE__ */ React104.createElement(
|
16513
16369
|
MultiSelectBase,
|
16514
16370
|
{
|
16515
16371
|
...baseProps,
|
@@ -16523,16 +16379,16 @@ var MultiSelect = ({
|
|
16523
16379
|
)
|
16524
16380
|
);
|
16525
16381
|
};
|
16526
|
-
var MultiSelectSkeleton = () => /* @__PURE__ */
|
16382
|
+
var MultiSelectSkeleton = () => /* @__PURE__ */ React104.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React104.createElement(MultiSelectBase.Skeleton, null));
|
16527
16383
|
MultiSelect.Skeleton = MultiSelectSkeleton;
|
16528
16384
|
MultiSelect.Skeleton.displayName = "MultiSelect.Skeleton";
|
16529
16385
|
|
16530
16386
|
// src/molecules/NativeSelect/NativeSelect.tsx
|
16531
|
-
import
|
16387
|
+
import React105 from "react";
|
16532
16388
|
import { useId as useId15 } from "@react-aria/utils";
|
16533
|
-
import { omit as
|
16389
|
+
import { omit as omit15, uniqueId } from "lodash-es";
|
16534
16390
|
var import_caretDown2 = __toESM(require_caretDown());
|
16535
|
-
var NativeSelectBase =
|
16391
|
+
var NativeSelectBase = React105.forwardRef(
|
16536
16392
|
({ children, disabled = false, required = false, valid = true, readOnly = false, ...props }, ref) => {
|
16537
16393
|
const placeholderValue = uniqueId("default_value_for_placeholder");
|
16538
16394
|
const defaultValue = props.defaultValue ? props.defaultValue : props.placeholder ? placeholderValue : void 0;
|
@@ -16549,15 +16405,15 @@ var NativeSelectBase = React104.forwardRef(
|
|
16549
16405
|
props.onBlur?.(event);
|
16550
16406
|
}
|
16551
16407
|
};
|
16552
|
-
return /* @__PURE__ */
|
16408
|
+
return /* @__PURE__ */ React105.createElement("span", { className: classNames("Aquarium-NativeSelectBase", tw("relative block")) }, !readOnly && /* @__PURE__ */ React105.createElement(
|
16553
16409
|
"span",
|
16554
16410
|
{
|
16555
16411
|
className: tw(
|
16556
16412
|
"absolute right-0 inset-y-0 mr-4 text-inactive flex ml-3 pointer-events-none typography-default-strong mt-4"
|
16557
16413
|
)
|
16558
16414
|
},
|
16559
|
-
/* @__PURE__ */
|
16560
|
-
), /* @__PURE__ */
|
16415
|
+
/* @__PURE__ */ React105.createElement(Icon, { icon: import_caretDown2.default, "data-testid": "icon-dropdown" })
|
16416
|
+
), /* @__PURE__ */ React105.createElement(
|
16561
16417
|
"select",
|
16562
16418
|
{
|
16563
16419
|
ref,
|
@@ -16579,21 +16435,21 @@ var NativeSelectBase = React104.forwardRef(
|
|
16579
16435
|
props.className
|
16580
16436
|
)
|
16581
16437
|
},
|
16582
|
-
props.placeholder && /* @__PURE__ */
|
16438
|
+
props.placeholder && /* @__PURE__ */ React105.createElement("option", { value: placeholderValue, disabled: true }, props.placeholder),
|
16583
16439
|
children
|
16584
16440
|
));
|
16585
16441
|
}
|
16586
16442
|
);
|
16587
|
-
NativeSelectBase.Skeleton = () => /* @__PURE__ */
|
16588
|
-
var NativeSelect =
|
16443
|
+
NativeSelectBase.Skeleton = () => /* @__PURE__ */ React105.createElement(Skeleton, { height: 38 });
|
16444
|
+
var NativeSelect = React105.forwardRef(
|
16589
16445
|
({ readOnly, ...props }, ref) => {
|
16590
16446
|
const defaultId = useId15();
|
16591
16447
|
const id = props.id ?? defaultId;
|
16592
16448
|
const errorMessageId = useId15();
|
16593
16449
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
16594
16450
|
const { "data-testid": dataTestId, ...labelControlProps } = getLabelControlProps(props);
|
16595
|
-
const baseProps =
|
16596
|
-
return /* @__PURE__ */
|
16451
|
+
const baseProps = omit15(props, Object.keys(labelControlProps));
|
16452
|
+
return /* @__PURE__ */ React105.createElement(
|
16597
16453
|
LabelControl,
|
16598
16454
|
{
|
16599
16455
|
id: `${id}-label`,
|
@@ -16602,7 +16458,7 @@ var NativeSelect = React104.forwardRef(
|
|
16602
16458
|
...labelControlProps,
|
16603
16459
|
className: "Aquarium-NativeSelect"
|
16604
16460
|
},
|
16605
|
-
/* @__PURE__ */
|
16461
|
+
/* @__PURE__ */ React105.createElement(
|
16606
16462
|
NativeSelectBase,
|
16607
16463
|
{
|
16608
16464
|
ref,
|
@@ -16621,34 +16477,34 @@ var NativeSelect = React104.forwardRef(
|
|
16621
16477
|
}
|
16622
16478
|
);
|
16623
16479
|
NativeSelect.displayName = "NativeSelect";
|
16624
|
-
var Option =
|
16625
|
-
return /* @__PURE__ */
|
16480
|
+
var Option = React105.forwardRef(({ children, ...props }, ref) => {
|
16481
|
+
return /* @__PURE__ */ React105.createElement("option", { ref, ...props }, children);
|
16626
16482
|
});
|
16627
16483
|
Option.displayName = "Option";
|
16628
|
-
var NativeSelectSkeleton = () => /* @__PURE__ */
|
16484
|
+
var NativeSelectSkeleton = () => /* @__PURE__ */ React105.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React105.createElement(NativeSelectBase.Skeleton, null), /* @__PURE__ */ React105.createElement("div", { style: { height: "1px" } }));
|
16629
16485
|
NativeSelect.Skeleton = NativeSelectSkeleton;
|
16630
16486
|
NativeSelect.Skeleton.displayName = "NativeSelect.Skeleton";
|
16631
16487
|
|
16632
16488
|
// src/molecules/Navigation/Navigation.tsx
|
16633
|
-
import
|
16489
|
+
import React107 from "react";
|
16634
16490
|
import classNames11 from "classnames";
|
16635
16491
|
import { uniqueId as uniqueId2 } from "lodash-es";
|
16636
16492
|
|
16637
16493
|
// src/atoms/Navigation/Navigation.tsx
|
16638
|
-
import
|
16494
|
+
import React106 from "react";
|
16639
16495
|
var Navigation = ({
|
16640
16496
|
className,
|
16641
16497
|
children,
|
16642
16498
|
"aria-label": ariaLabel,
|
16643
16499
|
...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
|
16500
|
+
}) => /* @__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));
|
16501
|
+
var Header = ({ className, ...rest }) => /* @__PURE__ */ React106.createElement("li", { ...rest, role: "presentation", className: classNames(tw("px-6 py-5"), className) });
|
16502
|
+
var Title2 = ({ className, ...props }) => /* @__PURE__ */ React106.createElement(Typography, { variant: "caption", className: classNames("uppercase text-muted", className), ...props });
|
16503
|
+
var Subtitle = ({ className, ...props }) => /* @__PURE__ */ React106.createElement(Typography, { variant: "small-strong", className: classNames("text-intense", className), ...props });
|
16504
|
+
var Footer = ({ className, ...rest }) => /* @__PURE__ */ React106.createElement("li", { ...rest, role: "presentation", className: classNames(tw("px-6 py-5 mt-auto"), className) });
|
16505
|
+
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) }));
|
16506
|
+
var Divider3 = ({ className, ...rest }) => /* @__PURE__ */ React106.createElement("li", { "aria-hidden": true, ...rest, className: classNames(tw("border-t-2 border-muted"), className) });
|
16507
|
+
var Item4 = ({ className, active, ...rest }) => /* @__PURE__ */ React106.createElement("li", { role: "presentation" }, /* @__PURE__ */ React106.createElement(
|
16652
16508
|
"a",
|
16653
16509
|
{
|
16654
16510
|
...rest,
|
@@ -16668,7 +16524,7 @@ var Submenu = ({
|
|
16668
16524
|
title,
|
16669
16525
|
id,
|
16670
16526
|
...rest
|
16671
|
-
}) => /* @__PURE__ */
|
16527
|
+
}) => /* @__PURE__ */ React106.createElement("li", { role: "presentation" }, /* @__PURE__ */ React106.createElement(
|
16672
16528
|
"a",
|
16673
16529
|
{
|
16674
16530
|
role: "menuitem",
|
@@ -16682,33 +16538,33 @@ var Submenu = ({
|
|
16682
16538
|
...rest
|
16683
16539
|
},
|
16684
16540
|
title
|
16685
|
-
), /* @__PURE__ */
|
16686
|
-
var SubmenuItem = ({ className, active, ...rest }) => /* @__PURE__ */
|
16541
|
+
), /* @__PURE__ */ React106.createElement("ul", { role: "menu", className: classNames(tw("flex flex-col")), "aria-labelledby": id }, children));
|
16542
|
+
var SubmenuItem = ({ className, active, ...rest }) => /* @__PURE__ */ React106.createElement(Navigation.Item, { ...rest, active, className: classNames(className, tw("pl-[56px]")) });
|
16687
16543
|
Header.Title = Title2;
|
16688
16544
|
Header.Subtitle = Subtitle;
|
16689
16545
|
Submenu.Item = SubmenuItem;
|
16690
16546
|
Navigation.Header = Header;
|
16691
16547
|
Navigation.Footer = Footer;
|
16692
|
-
Navigation.Section =
|
16693
|
-
Navigation.Item =
|
16548
|
+
Navigation.Section = Section;
|
16549
|
+
Navigation.Item = Item4;
|
16694
16550
|
Navigation.Submenu = Submenu;
|
16695
16551
|
Navigation.Divider = Divider3;
|
16696
16552
|
|
16697
16553
|
// src/molecules/Navigation/Navigation.tsx
|
16698
|
-
var Navigation2 = ({ className, ...props }) => /* @__PURE__ */
|
16699
|
-
var
|
16554
|
+
var Navigation2 = ({ className, ...props }) => /* @__PURE__ */ React107.createElement(Navigation, { className: classNames11("Aquarium-Navigation", className), ...props });
|
16555
|
+
var Item5 = ({
|
16700
16556
|
children,
|
16701
16557
|
icon,
|
16702
16558
|
showNotification = false,
|
16703
16559
|
...rest
|
16704
|
-
}) => /* @__PURE__ */
|
16560
|
+
}) => /* @__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
16561
|
var Submenu2 = ({ children, title, icon, defaultOpen = false }) => {
|
16706
|
-
const [open, setOpen] =
|
16562
|
+
const [open, setOpen] = React107.useState(defaultOpen);
|
16707
16563
|
const id = uniqueId2();
|
16708
|
-
return /* @__PURE__ */
|
16564
|
+
return /* @__PURE__ */ React107.createElement(
|
16709
16565
|
Navigation.Submenu,
|
16710
16566
|
{
|
16711
|
-
title: /* @__PURE__ */
|
16567
|
+
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
16568
|
"aria-expanded": open,
|
16713
16569
|
id,
|
16714
16570
|
onClick: (e) => {
|
@@ -16716,11 +16572,11 @@ var Submenu2 = ({ children, title, icon, defaultOpen = false }) => {
|
|
16716
16572
|
setOpen(!open);
|
16717
16573
|
}
|
16718
16574
|
},
|
16719
|
-
open && /* @__PURE__ */
|
16575
|
+
open && /* @__PURE__ */ React107.createElement("ul", { role: "menu", className: classNames11(tw("flex flex-col")), "aria-labelledby": id }, children)
|
16720
16576
|
);
|
16721
16577
|
};
|
16722
16578
|
Submenu2.Item = Navigation.Submenu.Item;
|
16723
|
-
Navigation2.Item =
|
16579
|
+
Navigation2.Item = Item5;
|
16724
16580
|
Navigation2.Divider = Navigation.Divider;
|
16725
16581
|
Navigation2.Footer = Navigation.Footer;
|
16726
16582
|
Navigation2.Header = Navigation.Header;
|
@@ -16728,15 +16584,15 @@ Navigation2.Section = Navigation.Section;
|
|
16728
16584
|
Navigation2.Submenu = Submenu2;
|
16729
16585
|
|
16730
16586
|
// src/molecules/PageHeader/PageHeader.tsx
|
16731
|
-
import
|
16587
|
+
import React109 from "react";
|
16732
16588
|
import { castArray as castArray6 } from "lodash-es";
|
16733
16589
|
|
16734
16590
|
// 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__ */
|
16591
|
+
import React108 from "react";
|
16592
|
+
var PageHeader = ({ children, className, ...rest }) => /* @__PURE__ */ React108.createElement("div", { className: classNames(tw("flex flex-row gap-4 pb-6"), className), ...rest }, children);
|
16593
|
+
PageHeader.Container = ({ children, className, ...rest }) => /* @__PURE__ */ React108.createElement("div", { className: classNames(tw("flex flex-col grow gap-0"), className), ...rest }, children);
|
16594
|
+
PageHeader.TitleContainer = ({ children, className, ...rest }) => /* @__PURE__ */ React108.createElement("div", { className: classNames(tw("flex flex-col justify-center gap-2"), className), ...rest }, children);
|
16595
|
+
PageHeader.Title = ({ isSubHeader = false, children, ...rest }) => /* @__PURE__ */ React108.createElement(
|
16740
16596
|
Typography2,
|
16741
16597
|
{
|
16742
16598
|
...rest,
|
@@ -16746,9 +16602,9 @@ PageHeader.Title = ({ isSubHeader = false, children, ...rest }) => /* @__PURE__
|
|
16746
16602
|
},
|
16747
16603
|
children
|
16748
16604
|
);
|
16749
|
-
PageHeader.Subtitle = ({ children, ...rest }) => /* @__PURE__ */
|
16750
|
-
PageHeader.Chips = ({ children, className, ...rest }) => /* @__PURE__ */
|
16751
|
-
PageHeader.Actions = ({ children, className, ...rest }) => /* @__PURE__ */
|
16605
|
+
PageHeader.Subtitle = ({ children, ...rest }) => /* @__PURE__ */ React108.createElement(Typography2.Small, { ...rest, color: "default" }, children);
|
16606
|
+
PageHeader.Chips = ({ children, className, ...rest }) => /* @__PURE__ */ React108.createElement("div", { className: classNames(tw("flex gap-3"), className), ...rest }, children);
|
16607
|
+
PageHeader.Actions = ({ children, className, ...rest }) => /* @__PURE__ */ React108.createElement("div", { className: classNames(tw("flex flex-row gap-4 self-start"), className), ...rest }, children);
|
16752
16608
|
|
16753
16609
|
// src/molecules/PageHeader/PageHeader.tsx
|
16754
16610
|
var import_more5 = __toESM(require_more());
|
@@ -16774,28 +16630,28 @@ var CommonPageHeader = ({
|
|
16774
16630
|
"Limit the combined `primaryAction` and `secondaryActions` to 2 actions. Use the `menu` prop for additional actions."
|
16775
16631
|
);
|
16776
16632
|
}
|
16777
|
-
return /* @__PURE__ */
|
16633
|
+
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
16634
|
DropdownMenu2,
|
16779
16635
|
{
|
16780
16636
|
placement: defaultContextualMenuPlacement,
|
16781
16637
|
onAction: (action) => onAction(action),
|
16782
16638
|
onOpenChange: onMenuOpenChange
|
16783
16639
|
},
|
16784
|
-
/* @__PURE__ */
|
16640
|
+
/* @__PURE__ */ React109.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ React109.createElement(Button2.Icon, { "aria-label": menuAriaLabel, icon: import_more5.default })),
|
16785
16641
|
menu
|
16786
16642
|
)), secondaryActions && castArray6(secondaryActions).filter(Boolean).map((secondaryAction2) => renderAction({ kind: "secondary", action: secondaryAction2 })), primaryAction && renderAction({ kind: "primary", action: primaryAction })));
|
16787
16643
|
};
|
16788
|
-
var PageHeader2 = (props) => /* @__PURE__ */
|
16644
|
+
var PageHeader2 = (props) => /* @__PURE__ */ React109.createElement(CommonPageHeader, { ...props });
|
16789
16645
|
PageHeader2.displayName = "PageHeader";
|
16790
|
-
var SubHeader = (props) => /* @__PURE__ */
|
16646
|
+
var SubHeader = (props) => /* @__PURE__ */ React109.createElement(CommonPageHeader, { ...props, isSubHeader: true });
|
16791
16647
|
PageHeader2.SubHeader = SubHeader;
|
16792
16648
|
PageHeader2.SubHeader.displayName = "PageHeader.SubHeader";
|
16793
16649
|
|
16794
16650
|
// src/molecules/Popover/PopoverContext.tsx
|
16795
|
-
import { createContext as
|
16796
|
-
var PopoverContext2 =
|
16651
|
+
import { createContext as createContext6, useContext as useContext8 } from "react";
|
16652
|
+
var PopoverContext2 = createContext6(null);
|
16797
16653
|
var usePopoverContext = () => {
|
16798
|
-
const ctx =
|
16654
|
+
const ctx = useContext8(PopoverContext2);
|
16799
16655
|
if (ctx === null) {
|
16800
16656
|
throw new Error("PopoverContext was used outside of provider.");
|
16801
16657
|
}
|
@@ -16803,16 +16659,16 @@ var usePopoverContext = () => {
|
|
16803
16659
|
};
|
16804
16660
|
|
16805
16661
|
// src/molecules/PopoverDialog/PopoverDialog.tsx
|
16806
|
-
import
|
16807
|
-
import { noop, omit as
|
16662
|
+
import React111, { createContext as createContext7 } from "react";
|
16663
|
+
import { noop as noop3, omit as omit16 } from "lodash-es";
|
16808
16664
|
|
16809
16665
|
// 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__ */
|
16666
|
+
import React110 from "react";
|
16667
|
+
var Header2 = ({ children, className, ...rest }) => /* @__PURE__ */ React110.createElement("div", { ...rest, className: classNames(tw("p-5 gap-3 flex items-center"), className) }, children);
|
16668
|
+
var Title3 = ({ children, className, ...rest }) => /* @__PURE__ */ React110.createElement(Typography, { ...rest, htmlTag: "h1", variant: "small-strong" }, children);
|
16669
|
+
var Body = ({ children, className, ...rest }) => /* @__PURE__ */ React110.createElement(Typography, { ...rest, htmlTag: "div", variant: "caption", className: classNames(tw("px-5 overflow-y-auto"), className) }, children);
|
16670
|
+
var Footer2 = ({ children, className, ...rest }) => /* @__PURE__ */ React110.createElement("div", { ...rest, className: classNames(tw("p-5"), className) }, children);
|
16671
|
+
var Actions2 = ({ children, className, ...rest }) => /* @__PURE__ */ React110.createElement("div", { ...rest, className: classNames(tw("flex gap-4"), className) }, children);
|
16816
16672
|
var PopoverDialog = {
|
16817
16673
|
Header: Header2,
|
16818
16674
|
Title: Title3,
|
@@ -16822,17 +16678,17 @@ var PopoverDialog = {
|
|
16822
16678
|
};
|
16823
16679
|
|
16824
16680
|
// src/molecules/PopoverDialog/PopoverDialog.tsx
|
16825
|
-
var PopoverDialogPropsContext =
|
16681
|
+
var PopoverDialogPropsContext = createContext7({
|
16826
16682
|
title: "",
|
16827
|
-
primaryAction: { text: "", onClick:
|
16683
|
+
primaryAction: { text: "", onClick: noop3 }
|
16828
16684
|
});
|
16829
16685
|
var PopoverDialog2 = ({ placement, open, children, ...props }) => {
|
16830
|
-
return /* @__PURE__ */
|
16686
|
+
return /* @__PURE__ */ React111.createElement(Popover3, { placement }, /* @__PURE__ */ React111.createElement(PopoverDialogPropsContext.Provider, { value: props }, children));
|
16831
16687
|
};
|
16832
16688
|
PopoverDialog2.Trigger = Popover3.Trigger;
|
16833
16689
|
var Prompt = ({ children }) => {
|
16834
|
-
const { title, primaryAction, secondaryAction } =
|
16835
|
-
return /* @__PURE__ */
|
16690
|
+
const { title, primaryAction, secondaryAction } = React111.useContext(PopoverDialogPropsContext);
|
16691
|
+
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
16692
|
};
|
16837
16693
|
Prompt.displayName = "PopoverDialog.Prompt";
|
16838
16694
|
PopoverDialog2.Prompt = Prompt;
|
@@ -16842,12 +16698,12 @@ import { createPortal } from "react-dom";
|
|
16842
16698
|
var Portal = ({ children, to }) => createPortal(children, to);
|
16843
16699
|
|
16844
16700
|
// src/molecules/ProgressBar/ProgressBar.tsx
|
16845
|
-
import
|
16701
|
+
import React113 from "react";
|
16846
16702
|
|
16847
16703
|
// src/atoms/ProgressBar/ProgressBar.tsx
|
16848
|
-
import
|
16704
|
+
import React112 from "react";
|
16849
16705
|
import { clamp as clamp3 } from "lodash-es";
|
16850
|
-
var ProgressBar = ({ children, className, ...rest }) => /* @__PURE__ */
|
16706
|
+
var ProgressBar = ({ children, className, ...rest }) => /* @__PURE__ */ React112.createElement(
|
16851
16707
|
"div",
|
16852
16708
|
{
|
16853
16709
|
...rest,
|
@@ -16863,7 +16719,7 @@ var STATUS_COLORS = {
|
|
16863
16719
|
};
|
16864
16720
|
ProgressBar.Indicator = ({ min, max, value, "aria-label": ariaLabel, status, className, ...rest }) => {
|
16865
16721
|
const completedPercentage = clamp3((value - min) / (max - min) * 100, 0, 100);
|
16866
|
-
return /* @__PURE__ */
|
16722
|
+
return /* @__PURE__ */ React112.createElement(
|
16867
16723
|
"div",
|
16868
16724
|
{
|
16869
16725
|
...rest,
|
@@ -16881,7 +16737,7 @@ ProgressBar.Indicator = ({ min, max, value, "aria-label": ariaLabel, status, cla
|
|
16881
16737
|
}
|
16882
16738
|
);
|
16883
16739
|
};
|
16884
|
-
ProgressBar.Labels = ({ children, startLabel, endLabel, className, ...rest }) => /* @__PURE__ */
|
16740
|
+
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
16741
|
|
16886
16742
|
// src/molecules/ProgressBar/ProgressBar.tsx
|
16887
16743
|
var ProgressBar2 = (props) => {
|
@@ -16896,7 +16752,7 @@ var ProgressBar2 = (props) => {
|
|
16896
16752
|
if (min > max) {
|
16897
16753
|
throw new Error("`min` value provided to `ProgressBar` is greater than `max` value.");
|
16898
16754
|
}
|
16899
|
-
const progress = /* @__PURE__ */
|
16755
|
+
const progress = /* @__PURE__ */ React113.createElement(ProgressBar, null, /* @__PURE__ */ React113.createElement(
|
16900
16756
|
ProgressBar.Indicator,
|
16901
16757
|
{
|
16902
16758
|
status: value === max ? completedStatus : progresStatus,
|
@@ -16909,18 +16765,18 @@ var ProgressBar2 = (props) => {
|
|
16909
16765
|
if (props.dense) {
|
16910
16766
|
return progress;
|
16911
16767
|
}
|
16912
|
-
return /* @__PURE__ */
|
16768
|
+
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
16769
|
};
|
16914
|
-
var ProgressBarSkeleton = () => /* @__PURE__ */
|
16770
|
+
var ProgressBarSkeleton = () => /* @__PURE__ */ React113.createElement(Skeleton, { height: 4, display: "block" });
|
16915
16771
|
ProgressBar2.Skeleton = ProgressBarSkeleton;
|
16916
16772
|
ProgressBar2.Skeleton.displayName = "ProgressBar.Skeleton";
|
16917
16773
|
|
16918
16774
|
// src/molecules/RadioButton/RadioButton.tsx
|
16919
|
-
import
|
16920
|
-
var RadioButton2 =
|
16775
|
+
import React114 from "react";
|
16776
|
+
var RadioButton2 = React114.forwardRef(
|
16921
16777
|
({ name, id, readOnly = false, disabled = false, caption, children, "aria-label": ariaLabel, ...props }, ref) => {
|
16922
16778
|
const isChecked = props.checked ?? props.defaultChecked;
|
16923
|
-
return !readOnly || isChecked ? /* @__PURE__ */
|
16779
|
+
return !readOnly || isChecked ? /* @__PURE__ */ React114.createElement(
|
16924
16780
|
ControlLabel,
|
16925
16781
|
{
|
16926
16782
|
htmlFor: id,
|
@@ -16932,20 +16788,20 @@ var RadioButton2 = React113.forwardRef(
|
|
16932
16788
|
style: { gap: "0 8px" },
|
16933
16789
|
className: "Aquarium-RadioButton"
|
16934
16790
|
},
|
16935
|
-
!readOnly && /* @__PURE__ */
|
16791
|
+
!readOnly && /* @__PURE__ */ React114.createElement(RadioButton, { id, ref, name, ...props, readOnly, disabled })
|
16936
16792
|
) : null;
|
16937
16793
|
}
|
16938
16794
|
);
|
16939
16795
|
RadioButton2.displayName = "RadioButton";
|
16940
|
-
var RadioButtonSkeleton = () => /* @__PURE__ */
|
16796
|
+
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
16797
|
RadioButton2.Skeleton = RadioButtonSkeleton;
|
16942
16798
|
RadioButton2.Skeleton.displayName = "RadioButton.Skeleton";
|
16943
16799
|
|
16944
16800
|
// src/molecules/RadioButtonGroup/RadioButtonGroup.tsx
|
16945
|
-
import
|
16801
|
+
import React115 from "react";
|
16946
16802
|
import { useId as useId16 } from "@react-aria/utils";
|
16947
16803
|
var isRadioButton = (c) => {
|
16948
|
-
return
|
16804
|
+
return React115.isValidElement(c) && c.type === RadioButton2;
|
16949
16805
|
};
|
16950
16806
|
var RadioButtonGroup = ({
|
16951
16807
|
name,
|
@@ -16957,7 +16813,7 @@ var RadioButtonGroup = ({
|
|
16957
16813
|
children,
|
16958
16814
|
...props
|
16959
16815
|
}) => {
|
16960
|
-
const [value, setValue] =
|
16816
|
+
const [value, setValue] = React115.useState(_value ?? defaultValue ?? "");
|
16961
16817
|
const errorMessageId = useId16();
|
16962
16818
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
16963
16819
|
const labelControlProps = getLabelControlProps(props);
|
@@ -16968,13 +16824,13 @@ var RadioButtonGroup = ({
|
|
16968
16824
|
setValue(e.target.value);
|
16969
16825
|
onChange?.(e.target.value);
|
16970
16826
|
};
|
16971
|
-
const content =
|
16827
|
+
const content = React115.Children.map(children, (c) => {
|
16972
16828
|
if (!isRadioButton(c)) {
|
16973
16829
|
return null;
|
16974
16830
|
}
|
16975
16831
|
const defaultChecked = defaultValue === void 0 ? void 0 : c.props.value === defaultValue;
|
16976
16832
|
const checked = value === void 0 ? void 0 : c.props.value === value;
|
16977
|
-
return
|
16833
|
+
return React115.cloneElement(c, {
|
16978
16834
|
name,
|
16979
16835
|
defaultChecked: c.props.defaultChecked ?? defaultChecked,
|
16980
16836
|
checked: c.props.checked ?? checked,
|
@@ -16983,11 +16839,11 @@ var RadioButtonGroup = ({
|
|
16983
16839
|
readOnly
|
16984
16840
|
});
|
16985
16841
|
});
|
16986
|
-
return /* @__PURE__ */
|
16842
|
+
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
16843
|
};
|
16988
16844
|
var RadioButtonGroupSkeleton = ({ cols, options = 2 }) => {
|
16989
16845
|
const isRow = !cols || parseInt(cols, 10) > 1;
|
16990
|
-
return /* @__PURE__ */
|
16846
|
+
return /* @__PURE__ */ React115.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React115.createElement(
|
16991
16847
|
"div",
|
16992
16848
|
{
|
16993
16849
|
className: tw("flex flex-wrap", {
|
@@ -16995,27 +16851,27 @@ var RadioButtonGroupSkeleton = ({ cols, options = 2 }) => {
|
|
16995
16851
|
"flex-col gap-2": !isRow
|
16996
16852
|
})
|
16997
16853
|
},
|
16998
|
-
Array.from({ length: options }).map((_, key) => /* @__PURE__ */
|
16854
|
+
Array.from({ length: options }).map((_, key) => /* @__PURE__ */ React115.createElement(RadioButton2.Skeleton, { key }))
|
16999
16855
|
));
|
17000
16856
|
};
|
17001
16857
|
RadioButtonGroup.Skeleton = RadioButtonGroupSkeleton;
|
17002
16858
|
RadioButtonGroup.Skeleton.displayName = "RadioButtonGroup.Skeleton";
|
17003
16859
|
|
17004
16860
|
// src/molecules/Section/Section.tsx
|
17005
|
-
import
|
16861
|
+
import React120, { useRef as useRef13 } from "react";
|
17006
16862
|
import { useButton as useButton4 } from "@react-aria/button";
|
17007
16863
|
import { useId as useId17 } from "@react-aria/utils";
|
17008
16864
|
import { animated as animated6, useSpring as useSpring5 } from "@react-spring/web";
|
17009
16865
|
import { castArray as castArray7, isUndefined as isUndefined9 } from "lodash-es";
|
17010
16866
|
|
17011
16867
|
// src/molecules/Switch/Switch.tsx
|
17012
|
-
import
|
16868
|
+
import React117 from "react";
|
17013
16869
|
|
17014
16870
|
// src/atoms/Switch/Switch.tsx
|
17015
|
-
import
|
16871
|
+
import React116 from "react";
|
17016
16872
|
var import_ban2 = __toESM(require_ban());
|
17017
|
-
var Switch =
|
17018
|
-
({ id, children, name, disabled = false, readOnly = false, ...props }, ref) => /* @__PURE__ */
|
16873
|
+
var Switch = React116.forwardRef(
|
16874
|
+
({ 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
16875
|
"input",
|
17020
16876
|
{
|
17021
16877
|
id,
|
@@ -17037,7 +16893,7 @@ var Switch = React115.forwardRef(
|
|
17037
16893
|
readOnly,
|
17038
16894
|
disabled
|
17039
16895
|
}
|
17040
|
-
), /* @__PURE__ */
|
16896
|
+
), /* @__PURE__ */ React116.createElement(
|
17041
16897
|
"span",
|
17042
16898
|
{
|
17043
16899
|
className: tw(
|
@@ -17048,12 +16904,12 @@ var Switch = React115.forwardRef(
|
|
17048
16904
|
}
|
17049
16905
|
)
|
17050
16906
|
},
|
17051
|
-
disabled && /* @__PURE__ */
|
16907
|
+
disabled && /* @__PURE__ */ React116.createElement(Icon, { icon: import_ban2.default, width: "10px", height: "10px" })
|
17052
16908
|
))
|
17053
16909
|
);
|
17054
16910
|
|
17055
16911
|
// src/molecules/Switch/Switch.tsx
|
17056
|
-
var Switch2 =
|
16912
|
+
var Switch2 = React117.forwardRef(
|
17057
16913
|
({
|
17058
16914
|
id,
|
17059
16915
|
name,
|
@@ -17066,7 +16922,7 @@ var Switch2 = React116.forwardRef(
|
|
17066
16922
|
...props
|
17067
16923
|
}, ref) => {
|
17068
16924
|
const isChecked = props.checked ?? props.defaultChecked;
|
17069
|
-
return !readOnly || isChecked ? /* @__PURE__ */
|
16925
|
+
return !readOnly || isChecked ? /* @__PURE__ */ React117.createElement(
|
17070
16926
|
ControlLabel,
|
17071
16927
|
{
|
17072
16928
|
htmlFor: id,
|
@@ -17079,17 +16935,17 @@ var Switch2 = React116.forwardRef(
|
|
17079
16935
|
labelPlacement,
|
17080
16936
|
className: "Aquarium-Switch"
|
17081
16937
|
},
|
17082
|
-
!readOnly && /* @__PURE__ */
|
16938
|
+
!readOnly && /* @__PURE__ */ React117.createElement(Switch, { id, ref, name, ...props, readOnly, disabled })
|
17083
16939
|
) : null;
|
17084
16940
|
}
|
17085
16941
|
);
|
17086
16942
|
Switch2.displayName = "Switch";
|
17087
|
-
var SwitchSkeleton = () => /* @__PURE__ */
|
16943
|
+
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
16944
|
Switch2.Skeleton = SwitchSkeleton;
|
17089
16945
|
Switch2.Skeleton.displayName = "Switch.Skeleton ";
|
17090
16946
|
|
17091
16947
|
// src/molecules/TagLabel/TagLabel.tsx
|
17092
|
-
import
|
16948
|
+
import React118 from "react";
|
17093
16949
|
var getVariantClassNames = (variant = "primary") => {
|
17094
16950
|
switch (variant) {
|
17095
16951
|
case "neutral":
|
@@ -17103,7 +16959,7 @@ var getVariantClassNames = (variant = "primary") => {
|
|
17103
16959
|
return tw("bg-primary-default");
|
17104
16960
|
}
|
17105
16961
|
};
|
17106
|
-
var TagLabel = ({ title, dense = false, variant, ...rest }) => /* @__PURE__ */
|
16962
|
+
var TagLabel = ({ title, dense = false, variant, ...rest }) => /* @__PURE__ */ React118.createElement(
|
17107
16963
|
"span",
|
17108
16964
|
{
|
17109
16965
|
...rest,
|
@@ -17121,14 +16977,14 @@ var TagLabel = ({ title, dense = false, variant, ...rest }) => /* @__PURE__ */ R
|
|
17121
16977
|
);
|
17122
16978
|
|
17123
16979
|
// src/atoms/Section/Section.tsx
|
17124
|
-
import
|
16980
|
+
import React119 from "react";
|
17125
16981
|
var import_caretUp2 = __toESM(require_caretUp());
|
17126
|
-
var
|
16982
|
+
var Section2 = ({
|
17127
16983
|
children,
|
17128
16984
|
className,
|
17129
16985
|
...rest
|
17130
|
-
}) => /* @__PURE__ */
|
17131
|
-
|
16986
|
+
}) => /* @__PURE__ */ React119.createElement(Box, { component: "section", ...rest, className: classNames(tw("border border-muted"), className) }, children);
|
16987
|
+
Section2.Header = ({ children, className, expanded, ...rest }) => /* @__PURE__ */ React119.createElement(
|
17132
16988
|
"div",
|
17133
16989
|
{
|
17134
16990
|
...rest,
|
@@ -17141,8 +16997,8 @@ Section3.Header = ({ children, className, expanded, ...rest }) => /* @__PURE__ *
|
|
17141
16997
|
},
|
17142
16998
|
children
|
17143
16999
|
);
|
17144
|
-
|
17145
|
-
({ children, className, collapsible, ...rest }, ref) => /* @__PURE__ */
|
17000
|
+
Section2.TitleContainer = React119.forwardRef(
|
17001
|
+
({ children, className, collapsible, ...rest }, ref) => /* @__PURE__ */ React119.createElement(
|
17146
17002
|
"div",
|
17147
17003
|
{
|
17148
17004
|
...rest,
|
@@ -17157,25 +17013,25 @@ Section3.TitleContainer = React118.forwardRef(
|
|
17157
17013
|
children
|
17158
17014
|
)
|
17159
17015
|
);
|
17160
|
-
|
17161
|
-
|
17162
|
-
|
17163
|
-
|
17164
|
-
|
17016
|
+
Section2.Toggle = (props) => /* @__PURE__ */ React119.createElement(Icon, { ...props, icon: import_caretUp2.default, height: 22, width: 22 });
|
17017
|
+
Section2.Title = ({ children, ...rest }) => /* @__PURE__ */ React119.createElement(Typography2.Large, { ...rest, htmlTag: "h2", color: "intense", className: "flex gap-3 items-center" }, children);
|
17018
|
+
Section2.Subtitle = ({ children, ...rest }) => /* @__PURE__ */ React119.createElement(Typography2.Small, { ...rest, color: "default" }, children);
|
17019
|
+
Section2.Actions = ({ children, className, ...rest }) => /* @__PURE__ */ React119.createElement("div", { ...rest, className: classNames(tw("flex gap-4 justify-end"), className) }, children);
|
17020
|
+
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
17021
|
|
17166
17022
|
// src/molecules/Section/Section.tsx
|
17167
17023
|
var import_more6 = __toESM(require_more());
|
17168
|
-
var
|
17024
|
+
var Section3 = (props) => {
|
17169
17025
|
const { title, subtitle, children } = props;
|
17170
17026
|
const _collapsible = title ? props.collapsible ?? false : false;
|
17171
17027
|
const _collapsed = title ? props.collapsed : void 0;
|
17172
17028
|
const _defaultCollapsed = title ? props.defaultCollapsed ?? false : false;
|
17173
|
-
const [isCollapsed, setCollapsed] =
|
17174
|
-
const [isResting, setResting] =
|
17029
|
+
const [isCollapsed, setCollapsed] = React120.useState(_collapsed ?? _defaultCollapsed);
|
17030
|
+
const [isResting, setResting] = React120.useState(true);
|
17175
17031
|
const [ref, { height }] = useMeasure();
|
17176
17032
|
const toggleAreaRef = useRef13(null);
|
17177
17033
|
const isMounted = useRef13(true);
|
17178
|
-
|
17034
|
+
React120.useEffect(
|
17179
17035
|
() => () => {
|
17180
17036
|
isMounted.current = false;
|
17181
17037
|
},
|
@@ -17219,8 +17075,8 @@ var Section4 = (props) => {
|
|
17219
17075
|
{ "elementType": "div", "onPress": handleTitleClick, "aria-expanded": !isCollapsed, "aria-controls": regionId },
|
17220
17076
|
toggleAreaRef
|
17221
17077
|
);
|
17222
|
-
return /* @__PURE__ */
|
17223
|
-
|
17078
|
+
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(
|
17079
|
+
Section2.TitleContainer,
|
17224
17080
|
{
|
17225
17081
|
..._collapsible ? {
|
17226
17082
|
...buttonProps,
|
@@ -17234,20 +17090,20 @@ var Section4 = (props) => {
|
|
17234
17090
|
collapsible: _collapsible
|
17235
17091
|
},
|
17236
17092
|
_collapsible && // @ts-expect-error React spring does not yet support R19 types
|
17237
|
-
/* @__PURE__ */
|
17238
|
-
/* @__PURE__ */
|
17239
|
-
subtitle && /* @__PURE__ */
|
17240
|
-
), !isCollapsed && /* @__PURE__ */
|
17093
|
+
/* @__PURE__ */ React120.createElement(animated6.div, { style: { transform } }, /* @__PURE__ */ React120.createElement(Section2.Toggle, null)),
|
17094
|
+
/* @__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 })),
|
17095
|
+
subtitle && /* @__PURE__ */ React120.createElement(Section2.Subtitle, { className: tw("row-start-2", { "col-start-2": _collapsible }) }, /* @__PURE__ */ React120.createElement(LineClamp2, { lines: 1 }, subtitle))
|
17096
|
+
), !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
17097
|
DropdownMenu2,
|
17242
17098
|
{
|
17243
17099
|
onAction: (action) => onAction?.(action),
|
17244
17100
|
onOpenChange: onMenuOpenChange,
|
17245
17101
|
placement: defaultContextualMenuPlacement
|
17246
17102
|
},
|
17247
|
-
/* @__PURE__ */
|
17103
|
+
/* @__PURE__ */ React120.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ React120.createElement(Button2.Icon, { "aria-label": menuAriaLabel, icon: import_more6.default })),
|
17248
17104
|
menu
|
17249
|
-
)), props.actions && castArray7(props.actions).filter(Boolean).map((action) => renderAction({ kind: "secondary", action })), props.select && /* @__PURE__ */
|
17250
|
-
/* @__PURE__ */
|
17105
|
+
)), 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
|
17106
|
+
/* @__PURE__ */ React120.createElement(animated6.div, { className: tw(`h-[1px]`), style: { backgroundColor: "var(--aquarium-border-color-muted)" } })), /* @__PURE__ */ React120.createElement(
|
17251
17107
|
animated6.div,
|
17252
17108
|
{
|
17253
17109
|
id: regionId,
|
@@ -17255,28 +17111,28 @@ var Section4 = (props) => {
|
|
17255
17111
|
style: spring,
|
17256
17112
|
className: tw({ "overflow-hidden": _collapsible && (isCollapsed || !isResting) })
|
17257
17113
|
},
|
17258
|
-
/* @__PURE__ */
|
17114
|
+
/* @__PURE__ */ React120.createElement("div", { ref }, hasTabs ? /* @__PURE__ */ React120.createElement(
|
17259
17115
|
SectionTabs,
|
17260
17116
|
{
|
17261
17117
|
...children.props,
|
17262
17118
|
className: tw("[&>div:first-child]:px-3 grow flex flex-col overflow-y-auto", { "mt-4": _collapsible })
|
17263
17119
|
}
|
17264
|
-
) : /* @__PURE__ */
|
17120
|
+
) : /* @__PURE__ */ React120.createElement(Section2.Body, null, children))
|
17265
17121
|
));
|
17266
17122
|
};
|
17267
|
-
var SectionTabs = createTabsComponent(ModalTab, TabItem, "SectionTabs", (children, selected) => /* @__PURE__ */
|
17123
|
+
var SectionTabs = createTabsComponent(ModalTab, TabItem, "SectionTabs", (children, selected) => /* @__PURE__ */ React120.createElement(Section2.Body, null, children.find(
|
17268
17124
|
(node, index) => node?.props.value === selected || index === selected
|
17269
17125
|
)));
|
17270
17126
|
|
17271
17127
|
// src/molecules/SegmentedControl/SegmentedControl.tsx
|
17272
|
-
import
|
17128
|
+
import React121 from "react";
|
17273
17129
|
var SegmentedControl = ({
|
17274
17130
|
children,
|
17275
17131
|
value,
|
17276
17132
|
selected = false,
|
17277
17133
|
className,
|
17278
17134
|
...rest
|
17279
|
-
}) => /* @__PURE__ */
|
17135
|
+
}) => /* @__PURE__ */ React121.createElement("li", null, /* @__PURE__ */ React121.createElement(
|
17280
17136
|
"button",
|
17281
17137
|
{
|
17282
17138
|
type: "button",
|
@@ -17294,7 +17150,7 @@ var SegmentedControlGroup = ({
|
|
17294
17150
|
ariaLabel,
|
17295
17151
|
...rest
|
17296
17152
|
}) => {
|
17297
|
-
return /* @__PURE__ */
|
17153
|
+
return /* @__PURE__ */ React121.createElement(
|
17298
17154
|
"ul",
|
17299
17155
|
{
|
17300
17156
|
...rest,
|
@@ -17305,9 +17161,9 @@ var SegmentedControlGroup = ({
|
|
17305
17161
|
className
|
17306
17162
|
)
|
17307
17163
|
},
|
17308
|
-
|
17164
|
+
React121.Children.map(
|
17309
17165
|
children,
|
17310
|
-
(child) =>
|
17166
|
+
(child) => React121.cloneElement(child, {
|
17311
17167
|
onClick: () => onChange(child.props.value),
|
17312
17168
|
selected: child.props.value === value
|
17313
17169
|
})
|
@@ -17325,18 +17181,18 @@ var getBaseSegmentedControlClassNames = (selected) => tw(
|
|
17325
17181
|
);
|
17326
17182
|
|
17327
17183
|
// src/molecules/Stepper/Stepper.tsx
|
17328
|
-
import
|
17184
|
+
import React123 from "react";
|
17329
17185
|
|
17330
17186
|
// src/atoms/Stepper/Stepper.tsx
|
17331
|
-
import
|
17187
|
+
import React122 from "react";
|
17332
17188
|
var import_tick6 = __toESM(require_tick());
|
17333
|
-
var Stepper = ({ className, ...rest }) => /* @__PURE__ */
|
17189
|
+
var Stepper = ({ className, ...rest }) => /* @__PURE__ */ React122.createElement("div", { ...rest, className: classNames(className) });
|
17334
17190
|
var ConnectorContainer = ({
|
17335
17191
|
className,
|
17336
17192
|
completed,
|
17337
17193
|
dense,
|
17338
17194
|
...rest
|
17339
|
-
}) => /* @__PURE__ */
|
17195
|
+
}) => /* @__PURE__ */ React122.createElement(
|
17340
17196
|
"div",
|
17341
17197
|
{
|
17342
17198
|
...rest,
|
@@ -17349,7 +17205,7 @@ var ConnectorContainer = ({
|
|
17349
17205
|
)
|
17350
17206
|
}
|
17351
17207
|
);
|
17352
|
-
var Connector = ({ children, className, completed, dense, ...rest }) => /* @__PURE__ */
|
17208
|
+
var Connector = ({ children, className, completed, dense, ...rest }) => /* @__PURE__ */ React122.createElement(
|
17353
17209
|
"div",
|
17354
17210
|
{
|
17355
17211
|
...rest,
|
@@ -17364,7 +17220,7 @@ var Connector = ({ children, className, completed, dense, ...rest }) => /* @__PU
|
|
17364
17220
|
)
|
17365
17221
|
}
|
17366
17222
|
);
|
17367
|
-
var Step = ({ className, state, ...rest }) => /* @__PURE__ */
|
17223
|
+
var Step = ({ className, state, ...rest }) => /* @__PURE__ */ React122.createElement(
|
17368
17224
|
"div",
|
17369
17225
|
{
|
17370
17226
|
...rest,
|
@@ -17387,7 +17243,7 @@ var getDenseClassNames = (state) => tw("h-[8px] w-[8px]", {
|
|
17387
17243
|
"bg-intense": state === "inactive",
|
17388
17244
|
"text-success-default": state === "completed"
|
17389
17245
|
});
|
17390
|
-
var Indicator = ({ children, className, state, dense, ...rest }) => /* @__PURE__ */
|
17246
|
+
var Indicator = ({ children, className, state, dense, ...rest }) => /* @__PURE__ */ React122.createElement(
|
17391
17247
|
"div",
|
17392
17248
|
{
|
17393
17249
|
...rest,
|
@@ -17398,7 +17254,7 @@ var Indicator = ({ children, className, state, dense, ...rest }) => /* @__PURE__
|
|
17398
17254
|
className
|
17399
17255
|
)
|
17400
17256
|
},
|
17401
|
-
state === "completed" ? /* @__PURE__ */
|
17257
|
+
state === "completed" ? /* @__PURE__ */ React122.createElement(InlineIcon, { icon: import_tick6.default }) : dense ? null : children
|
17402
17258
|
);
|
17403
17259
|
Step.Indicator = Indicator;
|
17404
17260
|
Stepper.Step = Step;
|
@@ -17407,13 +17263,13 @@ Stepper.ConnectorContainer = ConnectorContainer;
|
|
17407
17263
|
|
17408
17264
|
// src/molecules/Stepper/Stepper.tsx
|
17409
17265
|
var Stepper2 = ({ children, activeIndex, dense }) => {
|
17410
|
-
const steps =
|
17411
|
-
return /* @__PURE__ */
|
17266
|
+
const steps = React123.Children.count(children);
|
17267
|
+
return /* @__PURE__ */ React123.createElement(Stepper, { role: "list", className: "Aquarium-Stepper" }, /* @__PURE__ */ React123.createElement(Template, { columns: steps }, React123.Children.map(children, (child, index) => {
|
17412
17268
|
if (!isComponentType(child, Step2)) {
|
17413
17269
|
throw new Error("<Stepper> can only have <Stepper.Step> components as children");
|
17414
17270
|
} else {
|
17415
17271
|
const state = index > activeIndex ? "inactive" : index === activeIndex ? "active" : "completed";
|
17416
|
-
return /* @__PURE__ */
|
17272
|
+
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
17273
|
}
|
17418
17274
|
})));
|
17419
17275
|
};
|
@@ -17423,7 +17279,7 @@ Step2.displayName = "Stepper.Step";
|
|
17423
17279
|
Stepper2.Step = Step2;
|
17424
17280
|
|
17425
17281
|
// src/molecules/SwitchGroup/SwitchGroup.tsx
|
17426
|
-
import
|
17282
|
+
import React124, { useState as useState14 } from "react";
|
17427
17283
|
import { useId as useId18 } from "@react-aria/utils";
|
17428
17284
|
var SwitchGroup = ({
|
17429
17285
|
value,
|
@@ -17447,14 +17303,14 @@ var SwitchGroup = ({
|
|
17447
17303
|
setSelectedItems(updated);
|
17448
17304
|
onChange?.(updated);
|
17449
17305
|
};
|
17450
|
-
return /* @__PURE__ */
|
17306
|
+
return /* @__PURE__ */ React124.createElement(LabelControl, { fieldset: true, ...labelControlProps, ...errorProps, className: "Aquarium-SwitchGroup" }, /* @__PURE__ */ React124.createElement(InputGroup, { cols }, React124.Children.map(children, (c) => {
|
17451
17307
|
if (!isComponentType(c, Switch2)) {
|
17452
17308
|
return null;
|
17453
17309
|
}
|
17454
17310
|
const str = c.props.value?.toString();
|
17455
17311
|
const defaultChecked = defaultValue === void 0 ? void 0 : str !== void 0 && defaultValue.includes(str);
|
17456
17312
|
const checked = value === void 0 ? void 0 : str !== void 0 && value.includes(str);
|
17457
|
-
return
|
17313
|
+
return React124.cloneElement(c, {
|
17458
17314
|
defaultChecked: c.props.defaultChecked ?? defaultChecked,
|
17459
17315
|
checked: c.props.checked ?? checked,
|
17460
17316
|
onChange: c.props.onChange ?? handleChange,
|
@@ -17464,17 +17320,17 @@ var SwitchGroup = ({
|
|
17464
17320
|
})));
|
17465
17321
|
};
|
17466
17322
|
var SwitchGroupSkeleton = ({ options = 2 }) => {
|
17467
|
-
return /* @__PURE__ */
|
17323
|
+
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
17324
|
};
|
17469
17325
|
SwitchGroup.Skeleton = SwitchGroupSkeleton;
|
17470
17326
|
SwitchGroup.Skeleton.displayName = "SwitchGroup.Skeleton";
|
17471
17327
|
|
17472
17328
|
// src/molecules/Textarea/Textarea.tsx
|
17473
|
-
import
|
17329
|
+
import React125, { useState as useState15 } from "react";
|
17474
17330
|
import { useId as useId19 } from "@react-aria/utils";
|
17475
|
-
import { omit as
|
17476
|
-
var TextareaBase =
|
17477
|
-
({ readOnly = false, valid = true, ...props }, ref) => /* @__PURE__ */
|
17331
|
+
import { omit as omit17, toString as toString2 } from "lodash-es";
|
17332
|
+
var TextareaBase = React125.forwardRef(
|
17333
|
+
({ readOnly = false, valid = true, ...props }, ref) => /* @__PURE__ */ React125.createElement(
|
17478
17334
|
"textarea",
|
17479
17335
|
{
|
17480
17336
|
ref,
|
@@ -17484,16 +17340,16 @@ var TextareaBase = React124.forwardRef(
|
|
17484
17340
|
}
|
17485
17341
|
)
|
17486
17342
|
);
|
17487
|
-
TextareaBase.Skeleton = () => /* @__PURE__ */
|
17488
|
-
var Textarea =
|
17343
|
+
TextareaBase.Skeleton = () => /* @__PURE__ */ React125.createElement(Skeleton, { height: 58 });
|
17344
|
+
var Textarea = React125.forwardRef((props, ref) => {
|
17489
17345
|
const [value, setValue] = useState15(props.value ?? props.defaultValue ?? "");
|
17490
17346
|
const defaultId = useId19();
|
17491
17347
|
const id = props.id ?? defaultId;
|
17492
17348
|
const errorMessageId = useId19();
|
17493
17349
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
17494
17350
|
const { "data-testid": dataTestId, ...labelControlProps } = getLabelControlProps(props);
|
17495
|
-
const baseProps =
|
17496
|
-
return /* @__PURE__ */
|
17351
|
+
const baseProps = omit17(props, Object.keys(labelControlProps));
|
17352
|
+
return /* @__PURE__ */ React125.createElement(
|
17497
17353
|
LabelControl,
|
17498
17354
|
{
|
17499
17355
|
id: `${id}-label`,
|
@@ -17503,7 +17359,7 @@ var Textarea = React124.forwardRef((props, ref) => {
|
|
17503
17359
|
...labelControlProps,
|
17504
17360
|
className: "Aquarium-Textarea"
|
17505
17361
|
},
|
17506
|
-
/* @__PURE__ */
|
17362
|
+
/* @__PURE__ */ React125.createElement(
|
17507
17363
|
TextareaBase,
|
17508
17364
|
{
|
17509
17365
|
ref,
|
@@ -17524,24 +17380,24 @@ var Textarea = React124.forwardRef((props, ref) => {
|
|
17524
17380
|
);
|
17525
17381
|
});
|
17526
17382
|
Textarea.displayName = "Textarea";
|
17527
|
-
var TextAreaSkeleton = () => /* @__PURE__ */
|
17383
|
+
var TextAreaSkeleton = () => /* @__PURE__ */ React125.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React125.createElement(TextareaBase.Skeleton, null));
|
17528
17384
|
Textarea.Skeleton = TextAreaSkeleton;
|
17529
17385
|
Textarea.Skeleton.displayName = "Textarea.Skeleton";
|
17530
17386
|
|
17531
17387
|
// src/molecules/Timeline/Timeline.tsx
|
17532
|
-
import
|
17388
|
+
import React127 from "react";
|
17533
17389
|
|
17534
17390
|
// 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
|
-
|
17391
|
+
import React126 from "react";
|
17392
|
+
var Timeline = ({ className, ...rest }) => /* @__PURE__ */ React126.createElement("div", { ...rest, className: classNames(tw("grid grid-cols-[16px_1fr] gap-x-4"), className) });
|
17393
|
+
var Content2 = ({ className, ...rest }) => /* @__PURE__ */ React126.createElement("div", { ...rest, className: classNames(tw("pb-6"), className) });
|
17394
|
+
var Separator = ({ className, ...rest }) => /* @__PURE__ */ React126.createElement("div", { ...rest, className: classNames(tw("flex items-center justify-center h-5 w-5"), className) });
|
17395
|
+
var LineContainer = ({ className, ...rest }) => /* @__PURE__ */ React126.createElement("div", { ...rest, className: classNames(tw("flex justify-center py-1"), className) });
|
17396
|
+
var Line = ({ className, ...rest }) => /* @__PURE__ */ React126.createElement("div", { ...rest, className: classNames(tw("w-1 bg-default h-full justify-self-center"), className) });
|
17397
|
+
var Dot = ({ className, ...rest }) => /* @__PURE__ */ React126.createElement("div", { ...rest, className: classNames(tw("bg-intense h-[6px] w-[6px] rounded"), className) });
|
17398
|
+
Separator.Dot = Dot;
|
17543
17399
|
LineContainer.Line = Line;
|
17544
|
-
Timeline.Separator =
|
17400
|
+
Timeline.Separator = Separator;
|
17545
17401
|
Timeline.LineContainer = LineContainer;
|
17546
17402
|
Timeline.Content = Content2;
|
17547
17403
|
|
@@ -17550,23 +17406,23 @@ var import_error5 = __toESM(require_error());
|
|
17550
17406
|
var import_time2 = __toESM(require_time());
|
17551
17407
|
var import_warningSign5 = __toESM(require_warningSign());
|
17552
17408
|
var TimelineItem = () => null;
|
17553
|
-
var Timeline2 = ({ children }) => /* @__PURE__ */
|
17409
|
+
var Timeline2 = ({ children }) => /* @__PURE__ */ React127.createElement("div", { className: "Aquarium-Timeline" }, React127.Children.map(children, (item) => {
|
17554
17410
|
if (!isComponentType(item, TimelineItem)) {
|
17555
17411
|
throw new Error("<Timeline> can only have <Timeline.Item> components as children");
|
17556
17412
|
} else {
|
17557
17413
|
const { props, key } = item;
|
17558
|
-
return /* @__PURE__ */
|
17414
|
+
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
17415
|
}
|
17560
17416
|
}));
|
17561
|
-
var TimelineItemSkeleton = () => /* @__PURE__ */
|
17562
|
-
var TimelineSkeleton = ({ items = 3 }) => /* @__PURE__ */
|
17417
|
+
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%" }))));
|
17418
|
+
var TimelineSkeleton = ({ items = 3 }) => /* @__PURE__ */ React127.createElement("div", null, Array.from({ length: items }).map((_, key) => /* @__PURE__ */ React127.createElement(TimelineItemSkeleton, { key })));
|
17563
17419
|
Timeline2.Item = TimelineItem;
|
17564
17420
|
Timeline2.Skeleton = TimelineSkeleton;
|
17565
17421
|
Timeline2.Skeleton.displayName = "Timeline.Skeleton";
|
17566
17422
|
|
17567
17423
|
// src/molecules/TimePicker/TimePicker.tsx
|
17568
|
-
import
|
17569
|
-
var TimePicker = (props) => /* @__PURE__ */
|
17424
|
+
import React128 from "react";
|
17425
|
+
var TimePicker = (props) => /* @__PURE__ */ React128.createElement(TimeField, { ...props });
|
17570
17426
|
|
17571
17427
|
// src/utils/table/sortByColumn.ts
|
17572
17428
|
var sortByColumn = (items, column, sortState) => {
|
@@ -17588,13 +17444,13 @@ var sortByColumn = (items, column, sortState) => {
|
|
17588
17444
|
};
|
17589
17445
|
|
17590
17446
|
// src/utils/table/useSortState.ts
|
17591
|
-
import
|
17592
|
-
var useSortState = (initialSortState) =>
|
17447
|
+
import React129 from "react";
|
17448
|
+
var useSortState = (initialSortState) => React129.useState(initialSortState);
|
17593
17449
|
|
17594
17450
|
// src/utils/table/useTableSelect.ts
|
17595
|
-
import
|
17451
|
+
import React130 from "react";
|
17596
17452
|
var useTableSelect = (data, { key }) => {
|
17597
|
-
const [selected, setSelected] =
|
17453
|
+
const [selected, setSelected] = React130.useState([]);
|
17598
17454
|
const allSelected = selected.length === data.length;
|
17599
17455
|
const isSelected = (dot) => selected.includes(dot[key]);
|
17600
17456
|
const selectAll = () => setSelected(data.map((dot) => dot[key]));
|
@@ -17619,7 +17475,7 @@ var useTableSelect = (data, { key }) => {
|
|
17619
17475
|
};
|
17620
17476
|
|
17621
17477
|
// src/molecules/ItemList/ItemList.tsx
|
17622
|
-
import
|
17478
|
+
import React131 from "react";
|
17623
17479
|
var ItemList = ({
|
17624
17480
|
columns,
|
17625
17481
|
items,
|
@@ -17631,9 +17487,9 @@ var ItemList = ({
|
|
17631
17487
|
const templateColumns = columns.map((column) => column.width ?? "auto");
|
17632
17488
|
const [sortState, setSortState] = useSortState(defaultSort);
|
17633
17489
|
const sortedItems = onSortChanged ? items : sortByColumn(items, columns, sortState);
|
17634
|
-
return /* @__PURE__ */
|
17490
|
+
return /* @__PURE__ */ React131.createElement(Template, { className: "Aquarium-ItemList", columns: templateColumns, role: "table" }, /* @__PURE__ */ React131.createElement(DataList.Row, { header: true }, columns.map((column) => {
|
17635
17491
|
if (columnHasSort(column)) {
|
17636
|
-
return /* @__PURE__ */
|
17492
|
+
return /* @__PURE__ */ React131.createElement(
|
17637
17493
|
DataList.SortCell,
|
17638
17494
|
{
|
17639
17495
|
sticky,
|
@@ -17661,11 +17517,11 @@ var ItemList = ({
|
|
17661
17517
|
column.headerName
|
17662
17518
|
);
|
17663
17519
|
}
|
17664
|
-
return /* @__PURE__ */
|
17665
|
-
})), /* @__PURE__ */
|
17520
|
+
return /* @__PURE__ */ React131.createElement(DataList.HeadCell, { key: column.key ?? column.headerName, ...cellProps(column), sticky }, column.headerName);
|
17521
|
+
})), /* @__PURE__ */ React131.createElement(Rows, { columns, items: sortedItems, level: 0, ...infiniteProps }));
|
17666
17522
|
};
|
17667
17523
|
var Rows = ({ columns, items, level, isLastGroup, ...infiniteProps }) => {
|
17668
|
-
return /* @__PURE__ */
|
17524
|
+
return /* @__PURE__ */ React131.createElement(
|
17669
17525
|
List,
|
17670
17526
|
{
|
17671
17527
|
...level === 0 ? infiniteProps : {},
|
@@ -17674,22 +17530,22 @@ var Rows = ({ columns, items, level, isLastGroup, ...infiniteProps }) => {
|
|
17674
17530
|
const hasSubItems = item.items && item.items.length > 0;
|
17675
17531
|
const isLastItem = itemIndex === items.length - 1;
|
17676
17532
|
const noDivider = level === 0 && isLastItem || level > 0 && (isLastGroup || !isLastItem) || hasSubItems;
|
17677
|
-
return /* @__PURE__ */
|
17533
|
+
return /* @__PURE__ */ React131.createElement(React131.Fragment, { key: item.id }, /* @__PURE__ */ React131.createElement(DataList.Row, { noDivider }, /* @__PURE__ */ React131.createElement(
|
17678
17534
|
List,
|
17679
17535
|
{
|
17680
17536
|
items: columns,
|
17681
|
-
renderItem: (column, columnIndex) => /* @__PURE__ */
|
17537
|
+
renderItem: (column, columnIndex) => /* @__PURE__ */ React131.createElement(
|
17682
17538
|
DataList.Cell,
|
17683
17539
|
{
|
17684
17540
|
key: column.key ?? column.headerName,
|
17685
17541
|
...cellProps(column),
|
17686
17542
|
style: level > 1 && columnIndex === 0 ? { paddingLeft: (level - 1) * 60 } : void 0
|
17687
17543
|
},
|
17688
|
-
level > 0 && columnIndex === 0 && /* @__PURE__ */
|
17689
|
-
/* @__PURE__ */
|
17544
|
+
level > 0 && columnIndex === 0 && /* @__PURE__ */ React131.createElement(DataList.TreeLine, { isLast: itemIndex === items.length - 1 }),
|
17545
|
+
/* @__PURE__ */ React131.createElement(DataListCell, { column, row: item, index: columnIndex, rows: items })
|
17690
17546
|
)
|
17691
17547
|
}
|
17692
|
-
)), item.items && /* @__PURE__ */
|
17548
|
+
)), item.items && /* @__PURE__ */ React131.createElement(WithGroup, { level }, /* @__PURE__ */ React131.createElement(
|
17693
17549
|
Rows,
|
17694
17550
|
{
|
17695
17551
|
columns,
|
@@ -17702,7 +17558,7 @@ var Rows = ({ columns, items, level, isLastGroup, ...infiniteProps }) => {
|
|
17702
17558
|
}
|
17703
17559
|
);
|
17704
17560
|
};
|
17705
|
-
var WithGroup = ({ level, children }) => level === 0 ? /* @__PURE__ */
|
17561
|
+
var WithGroup = ({ level, children }) => level === 0 ? /* @__PURE__ */ React131.createElement(DataList.Row, { isGroup: true }, children) : /* @__PURE__ */ React131.createElement(React131.Fragment, null, children);
|
17706
17562
|
|
17707
17563
|
// src/molecules/index.ts
|
17708
17564
|
var SelectItem = Select.Item;
|
@@ -17902,7 +17758,7 @@ export {
|
|
17902
17758
|
RadioButton2 as RadioButton,
|
17903
17759
|
RadioButtonGroup,
|
17904
17760
|
SearchInput,
|
17905
|
-
|
17761
|
+
Section3 as Section,
|
17906
17762
|
SegmentedControl,
|
17907
17763
|
SegmentedControlGroup,
|
17908
17764
|
Select2 as Select,
|