@aivenio/aquarium 2.11.0 → 2.12.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/system.cjs CHANGED
@@ -4668,7 +4668,15 @@ var Input = import_react3.default.forwardRef((_a, ref) => {
4668
4668
  var Menu = import_react3.default.forwardRef(
4669
4669
  (_a, ref) => {
4670
4670
  var _b = _a, { maxHeight = "450px", className, children } = _b, props = __objRest(_b, ["maxHeight", "className", "children"]);
4671
- return /* @__PURE__ */ import_react3.default.createElement("ul", __spreadValues({ ref, style: { maxHeight }, className: classNames(className, tw("text-default bg-body")) }, props), children);
4671
+ return /* @__PURE__ */ import_react3.default.createElement(
4672
+ "ul",
4673
+ __spreadValues({
4674
+ ref,
4675
+ style: { maxHeight },
4676
+ className: classNames(className, tw("text-default bg-body overflow-y-auto"))
4677
+ }, props),
4678
+ children
4679
+ );
4672
4680
  }
4673
4681
  );
4674
4682
  var NoResults = import_react3.default.forwardRef(
@@ -10133,6 +10141,7 @@ var ComboboxBase = (_a) => {
10133
10141
  createOption,
10134
10142
  renderOption = (opt) => itemToString(opt),
10135
10143
  isOptionDisabled = isOptionDisabledBuiltin,
10144
+ clearSelectionEnabled = true,
10136
10145
  getValue = defaultGetValue,
10137
10146
  getOptionKey,
10138
10147
  defaultValue,
@@ -10156,6 +10165,7 @@ var ComboboxBase = (_a) => {
10156
10165
  "createOption",
10157
10166
  "renderOption",
10158
10167
  "isOptionDisabled",
10168
+ "clearSelectionEnabled",
10159
10169
  "getValue",
10160
10170
  "getOptionKey",
10161
10171
  "defaultValue",
@@ -10306,7 +10316,7 @@ var ComboboxBase = (_a) => {
10306
10316
  onKeyUp: (e) => e.stopPropagation()
10307
10317
  })
10308
10318
  ),
10309
- !readOnly && /* @__PURE__ */ import_react60.default.createElement(Box.Flex, { alignItems: "center", gap: "2" }, !!inputProps.value && !disabled && /* @__PURE__ */ import_react60.default.createElement(
10319
+ !readOnly && /* @__PURE__ */ import_react60.default.createElement(Box.Flex, { alignItems: "center", gap: "2" }, clearSelectionEnabled && !!inputProps.value && !disabled && /* @__PURE__ */ import_react60.default.createElement(
10310
10320
  Button.Icon,
10311
10321
  {
10312
10322
  UNSAFE_className: tw("group-hover:opacity-100 py-1", {
@@ -11909,7 +11919,7 @@ var getDisabledItemKeys = (children) => {
11909
11919
  }
11910
11920
  return null;
11911
11921
  });
11912
- return keys.flat().filter((key) => key !== null);
11922
+ return (keys != null ? keys : []).flat().filter((key) => key !== null);
11913
11923
  };
11914
11924
 
11915
11925
  // src/utils/object.ts
@@ -13099,8 +13109,8 @@ var PickerTimeField = ({ granularity }) => {
13099
13109
  {
13100
13110
  labelText: "Time",
13101
13111
  granularity: granularity !== "day" ? granularity : void 0,
13102
- value: state.timeValue,
13103
- onChange: state.setTimeValue,
13112
+ value: state == null ? void 0 : state.timeValue,
13113
+ onChange: (value) => value && (state == null ? void 0 : state.setTimeValue(value)),
13104
13114
  reserveSpaceForError: false
13105
13115
  }
13106
13116
  );
@@ -13211,15 +13221,15 @@ var createDateRangePickerBase = (variant) => (_a) => {
13211
13221
  );
13212
13222
  };
13213
13223
  var PickerTimeField2 = ({ granularity, part }) => {
13214
- var _a;
13215
- const { timeRange, setTime } = import_react93.default.useContext(import_react_aria_components10.DateRangePickerStateContext);
13224
+ var _a, _b;
13225
+ const ctx = import_react93.default.useContext(import_react_aria_components10.DateRangePickerStateContext);
13216
13226
  return /* @__PURE__ */ import_react93.default.createElement(
13217
13227
  TimeField,
13218
13228
  {
13219
13229
  labelText: part === "start" ? "Start time" : "End time",
13220
13230
  granularity: granularity !== "day" ? granularity : void 0,
13221
- value: (_a = timeRange == null ? void 0 : timeRange[part]) != null ? _a : null,
13222
- onChange: (value) => setTime(part, value),
13231
+ value: (_b = (_a = ctx == null ? void 0 : ctx.timeRange) == null ? void 0 : _a[part]) != null ? _b : null,
13232
+ onChange: (value) => ctx == null ? void 0 : ctx.setTime(part, value),
13223
13233
  reserveSpaceForError: false
13224
13234
  }
13225
13235
  );
@@ -15049,12 +15059,10 @@ NativeSelect.Skeleton.displayName = "NativeSelect.Skeleton";
15049
15059
  // src/molecules/Navigation/Navigation.tsx
15050
15060
  var import_react117 = __toESM(require("react"));
15051
15061
  var import_classnames12 = __toESM(require("classnames"));
15062
+ var import_lodash_es39 = require("lodash-es");
15052
15063
 
15053
15064
  // src/atoms/Navigation/Navigation.tsx
15054
15065
  var import_react116 = __toESM(require("react"));
15055
- var import_lodash_es39 = require("lodash-es");
15056
- var import_caretDownFilled2 = __toESM(require_caretDownFilled());
15057
- var import_caretUpFilled2 = __toESM(require_caretUpFilled());
15058
15066
  var Navigation = (_a) => {
15059
15067
  var _b = _a, {
15060
15068
  className,
@@ -15099,39 +15107,43 @@ var Item5 = (_a) => {
15099
15107
  })
15100
15108
  ));
15101
15109
  };
15102
- var Submenu = ({ title, icon, children }) => {
15103
- const [open, setOpen] = import_react116.default.useState(false);
15104
- const submenuTitleId = (0, import_lodash_es39.uniqueId)();
15110
+ var Submenu = (_a) => {
15111
+ var _b = _a, {
15112
+ children,
15113
+ className,
15114
+ title,
15115
+ id
15116
+ } = _b, rest = __objRest(_b, [
15117
+ "children",
15118
+ "className",
15119
+ "title",
15120
+ "id"
15121
+ ]);
15105
15122
  return /* @__PURE__ */ import_react116.default.createElement("li", { role: "presentation" }, /* @__PURE__ */ import_react116.default.createElement(
15106
15123
  "a",
15107
- {
15124
+ __spreadValues({
15108
15125
  role: "menuitem",
15109
15126
  "aria-haspopup": "true",
15110
- "aria-expanded": open,
15111
- onClick: (e) => {
15112
- e.preventDefault();
15113
- setOpen((prev) => !prev);
15114
- },
15115
- className: classNames(
15116
- tw("py-3 pr-6 pl-3 hover:bg-default cursor-pointer typography-small focusable flex items-center w-full")
15117
- ),
15118
15127
  href: "#",
15119
- id: submenuTitleId
15120
- },
15121
- /* @__PURE__ */ import_react116.default.createElement(InlineIcon, { icon: open ? import_caretUpFilled2.default : import_caretDownFilled2.default, width: "12px", height: "12px", className: "mr-1" }),
15122
- /* @__PURE__ */ import_react116.default.createElement(Box.Flex, { paddingX: "1", gap: "4" }, icon && /* @__PURE__ */ import_react116.default.createElement(InlineIcon, { icon, width: "20px", height: "20px" }), title)
15123
- ), open && /* @__PURE__ */ import_react116.default.createElement("ul", { role: "menu", className: classNames(tw("flex flex-col")), "aria-labelledby": submenuTitleId }, children));
15128
+ id,
15129
+ className: classNames(
15130
+ tw("py-3 pr-6 pl-3 hover:bg-default cursor-pointer typography-small focusable flex items-center w-full"),
15131
+ className
15132
+ )
15133
+ }, rest),
15134
+ title
15135
+ ), /* @__PURE__ */ import_react116.default.createElement("ul", { role: "menu", className: classNames(tw("flex flex-col")), "aria-labelledby": id }, children));
15124
15136
  };
15125
15137
  var SubmenuItem = (_a) => {
15126
15138
  var _b = _a, { className, active } = _b, rest = __objRest(_b, ["className", "active"]);
15127
15139
  return /* @__PURE__ */ import_react116.default.createElement(Navigation.Item, __spreadProps(__spreadValues({}, rest), { active, className: classNames(className, tw("pl-[56px]")) }));
15128
15140
  };
15141
+ Submenu.Item = SubmenuItem;
15129
15142
  Navigation.Header = Header;
15130
15143
  Navigation.Footer = Footer;
15131
15144
  Navigation.Section = Section2;
15132
15145
  Navigation.Item = Item5;
15133
15146
  Navigation.Submenu = Submenu;
15134
- Submenu.Item = SubmenuItem;
15135
15147
  Navigation.Divider = Divider3;
15136
15148
 
15137
15149
  // src/molecules/Navigation/Navigation.tsx
@@ -15151,13 +15163,30 @@ var Item6 = (_a) => {
15151
15163
  ]);
15152
15164
  return /* @__PURE__ */ import_react117.default.createElement(Navigation.Item, __spreadValues({}, rest), icon && showNotification && /* @__PURE__ */ import_react117.default.createElement(Badge.Notification, null, /* @__PURE__ */ import_react117.default.createElement(InlineIcon, { icon, width: "20px", height: "20px" })), icon && !showNotification && /* @__PURE__ */ import_react117.default.createElement(InlineIcon, { icon, width: "20px", height: "20px" }), children);
15153
15165
  };
15166
+ var Submenu2 = ({ children, title, icon, defaultOpen = false }) => {
15167
+ const [open, setOpen] = import_react117.default.useState(defaultOpen);
15168
+ const id = (0, import_lodash_es39.uniqueId)();
15169
+ return /* @__PURE__ */ import_react117.default.createElement(
15170
+ Navigation.Submenu,
15171
+ {
15172
+ title: /* @__PURE__ */ import_react117.default.createElement(import_react117.default.Fragment, null, /* @__PURE__ */ import_react117.default.createElement(InlineIcon, { icon: open ? import_caretUpFilled.default : import_caretDownFilled.default, width: "12px", height: "12px", className: "mr-1" }), /* @__PURE__ */ import_react117.default.createElement(Box.Flex, { paddingX: "1", gap: "4" }, icon && /* @__PURE__ */ import_react117.default.createElement(InlineIcon, { icon, width: "20px", height: "20px" }), title)),
15173
+ "aria-expanded": open,
15174
+ id,
15175
+ onClick: (e) => {
15176
+ e.preventDefault();
15177
+ setOpen(!open);
15178
+ }
15179
+ },
15180
+ open && /* @__PURE__ */ import_react117.default.createElement("ul", { role: "menu", className: (0, import_classnames12.default)(tw("flex flex-col")), "aria-labelledby": id }, children)
15181
+ );
15182
+ };
15183
+ Submenu2.Item = Navigation.Submenu.Item;
15154
15184
  Navigation2.Item = Item6;
15155
- Navigation2.Submenu = Navigation.Submenu;
15156
- Navigation2.Submenu.Item = Navigation.Submenu.Item;
15157
15185
  Navigation2.Divider = Navigation.Divider;
15158
15186
  Navigation2.Footer = Navigation.Footer;
15159
15187
  Navigation2.Header = Navigation.Header;
15160
15188
  Navigation2.Section = Navigation.Section;
15189
+ Navigation2.Submenu = Submenu2;
15161
15190
 
15162
15191
  // src/molecules/PageHeader/PageHeader.tsx
15163
15192
  var import_react119 = __toESM(require("react"));
package/dist/system.mjs CHANGED
@@ -4505,7 +4505,15 @@ var Input = React2.forwardRef((_a, ref) => {
4505
4505
  var Menu = React2.forwardRef(
4506
4506
  (_a, ref) => {
4507
4507
  var _b = _a, { maxHeight = "450px", className, children } = _b, props = __objRest(_b, ["maxHeight", "className", "children"]);
4508
- return /* @__PURE__ */ React2.createElement("ul", __spreadValues({ ref, style: { maxHeight }, className: classNames(className, tw("text-default bg-body")) }, props), children);
4508
+ return /* @__PURE__ */ React2.createElement(
4509
+ "ul",
4510
+ __spreadValues({
4511
+ ref,
4512
+ style: { maxHeight },
4513
+ className: classNames(className, tw("text-default bg-body overflow-y-auto"))
4514
+ }, props),
4515
+ children
4516
+ );
4509
4517
  }
4510
4518
  );
4511
4519
  var NoResults = React2.forwardRef(
@@ -9970,6 +9978,7 @@ var ComboboxBase = (_a) => {
9970
9978
  createOption,
9971
9979
  renderOption = (opt) => itemToString(opt),
9972
9980
  isOptionDisabled = isOptionDisabledBuiltin,
9981
+ clearSelectionEnabled = true,
9973
9982
  getValue = defaultGetValue,
9974
9983
  getOptionKey,
9975
9984
  defaultValue,
@@ -9993,6 +10002,7 @@ var ComboboxBase = (_a) => {
9993
10002
  "createOption",
9994
10003
  "renderOption",
9995
10004
  "isOptionDisabled",
10005
+ "clearSelectionEnabled",
9996
10006
  "getValue",
9997
10007
  "getOptionKey",
9998
10008
  "defaultValue",
@@ -10143,7 +10153,7 @@ var ComboboxBase = (_a) => {
10143
10153
  onKeyUp: (e) => e.stopPropagation()
10144
10154
  })
10145
10155
  ),
10146
- !readOnly && /* @__PURE__ */ React54.createElement(Box.Flex, { alignItems: "center", gap: "2" }, !!inputProps.value && !disabled && /* @__PURE__ */ React54.createElement(
10156
+ !readOnly && /* @__PURE__ */ React54.createElement(Box.Flex, { alignItems: "center", gap: "2" }, clearSelectionEnabled && !!inputProps.value && !disabled && /* @__PURE__ */ React54.createElement(
10147
10157
  Button.Icon,
10148
10158
  {
10149
10159
  UNSAFE_className: tw("group-hover:opacity-100 py-1", {
@@ -11746,7 +11756,7 @@ var getDisabledItemKeys = (children) => {
11746
11756
  }
11747
11757
  return null;
11748
11758
  });
11749
- return keys.flat().filter((key) => key !== null);
11759
+ return (keys != null ? keys : []).flat().filter((key) => key !== null);
11750
11760
  };
11751
11761
 
11752
11762
  // src/utils/object.ts
@@ -12955,8 +12965,8 @@ var PickerTimeField = ({ granularity }) => {
12955
12965
  {
12956
12966
  labelText: "Time",
12957
12967
  granularity: granularity !== "day" ? granularity : void 0,
12958
- value: state.timeValue,
12959
- onChange: state.setTimeValue,
12968
+ value: state == null ? void 0 : state.timeValue,
12969
+ onChange: (value) => value && (state == null ? void 0 : state.setTimeValue(value)),
12960
12970
  reserveSpaceForError: false
12961
12971
  }
12962
12972
  );
@@ -13076,15 +13086,15 @@ var createDateRangePickerBase = (variant) => (_a) => {
13076
13086
  );
13077
13087
  };
13078
13088
  var PickerTimeField2 = ({ granularity, part }) => {
13079
- var _a;
13080
- const { timeRange, setTime } = React85.useContext(DateRangePickerStateContext);
13089
+ var _a, _b;
13090
+ const ctx = React85.useContext(DateRangePickerStateContext);
13081
13091
  return /* @__PURE__ */ React85.createElement(
13082
13092
  TimeField,
13083
13093
  {
13084
13094
  labelText: part === "start" ? "Start time" : "End time",
13085
13095
  granularity: granularity !== "day" ? granularity : void 0,
13086
- value: (_a = timeRange == null ? void 0 : timeRange[part]) != null ? _a : null,
13087
- onChange: (value) => setTime(part, value),
13096
+ value: (_b = (_a = ctx == null ? void 0 : ctx.timeRange) == null ? void 0 : _a[part]) != null ? _b : null,
13097
+ onChange: (value) => ctx == null ? void 0 : ctx.setTime(part, value),
13088
13098
  reserveSpaceForError: false
13089
13099
  }
13090
13100
  );
@@ -14914,12 +14924,10 @@ NativeSelect.Skeleton.displayName = "NativeSelect.Skeleton";
14914
14924
  // src/molecules/Navigation/Navigation.tsx
14915
14925
  import React108 from "react";
14916
14926
  import classNames12 from "classnames";
14927
+ import { uniqueId as uniqueId2 } from "lodash-es";
14917
14928
 
14918
14929
  // src/atoms/Navigation/Navigation.tsx
14919
14930
  import React107 from "react";
14920
- import { uniqueId as uniqueId2 } from "lodash-es";
14921
- var import_caretDownFilled2 = __toESM(require_caretDownFilled());
14922
- var import_caretUpFilled2 = __toESM(require_caretUpFilled());
14923
14931
  var Navigation = (_a) => {
14924
14932
  var _b = _a, {
14925
14933
  className,
@@ -14964,39 +14972,43 @@ var Item5 = (_a) => {
14964
14972
  })
14965
14973
  ));
14966
14974
  };
14967
- var Submenu = ({ title, icon, children }) => {
14968
- const [open, setOpen] = React107.useState(false);
14969
- const submenuTitleId = uniqueId2();
14975
+ var Submenu = (_a) => {
14976
+ var _b = _a, {
14977
+ children,
14978
+ className,
14979
+ title,
14980
+ id
14981
+ } = _b, rest = __objRest(_b, [
14982
+ "children",
14983
+ "className",
14984
+ "title",
14985
+ "id"
14986
+ ]);
14970
14987
  return /* @__PURE__ */ React107.createElement("li", { role: "presentation" }, /* @__PURE__ */ React107.createElement(
14971
14988
  "a",
14972
- {
14989
+ __spreadValues({
14973
14990
  role: "menuitem",
14974
14991
  "aria-haspopup": "true",
14975
- "aria-expanded": open,
14976
- onClick: (e) => {
14977
- e.preventDefault();
14978
- setOpen((prev) => !prev);
14979
- },
14980
- className: classNames(
14981
- tw("py-3 pr-6 pl-3 hover:bg-default cursor-pointer typography-small focusable flex items-center w-full")
14982
- ),
14983
14992
  href: "#",
14984
- id: submenuTitleId
14985
- },
14986
- /* @__PURE__ */ React107.createElement(InlineIcon, { icon: open ? import_caretUpFilled2.default : import_caretDownFilled2.default, width: "12px", height: "12px", className: "mr-1" }),
14987
- /* @__PURE__ */ React107.createElement(Box.Flex, { paddingX: "1", gap: "4" }, icon && /* @__PURE__ */ React107.createElement(InlineIcon, { icon, width: "20px", height: "20px" }), title)
14988
- ), open && /* @__PURE__ */ React107.createElement("ul", { role: "menu", className: classNames(tw("flex flex-col")), "aria-labelledby": submenuTitleId }, children));
14993
+ id,
14994
+ className: classNames(
14995
+ tw("py-3 pr-6 pl-3 hover:bg-default cursor-pointer typography-small focusable flex items-center w-full"),
14996
+ className
14997
+ )
14998
+ }, rest),
14999
+ title
15000
+ ), /* @__PURE__ */ React107.createElement("ul", { role: "menu", className: classNames(tw("flex flex-col")), "aria-labelledby": id }, children));
14989
15001
  };
14990
15002
  var SubmenuItem = (_a) => {
14991
15003
  var _b = _a, { className, active } = _b, rest = __objRest(_b, ["className", "active"]);
14992
15004
  return /* @__PURE__ */ React107.createElement(Navigation.Item, __spreadProps(__spreadValues({}, rest), { active, className: classNames(className, tw("pl-[56px]")) }));
14993
15005
  };
15006
+ Submenu.Item = SubmenuItem;
14994
15007
  Navigation.Header = Header;
14995
15008
  Navigation.Footer = Footer;
14996
15009
  Navigation.Section = Section2;
14997
15010
  Navigation.Item = Item5;
14998
15011
  Navigation.Submenu = Submenu;
14999
- Submenu.Item = SubmenuItem;
15000
15012
  Navigation.Divider = Divider3;
15001
15013
 
15002
15014
  // src/molecules/Navigation/Navigation.tsx
@@ -15016,13 +15028,30 @@ var Item6 = (_a) => {
15016
15028
  ]);
15017
15029
  return /* @__PURE__ */ React108.createElement(Navigation.Item, __spreadValues({}, rest), icon && showNotification && /* @__PURE__ */ React108.createElement(Badge.Notification, null, /* @__PURE__ */ React108.createElement(InlineIcon, { icon, width: "20px", height: "20px" })), icon && !showNotification && /* @__PURE__ */ React108.createElement(InlineIcon, { icon, width: "20px", height: "20px" }), children);
15018
15030
  };
15031
+ var Submenu2 = ({ children, title, icon, defaultOpen = false }) => {
15032
+ const [open, setOpen] = React108.useState(defaultOpen);
15033
+ const id = uniqueId2();
15034
+ return /* @__PURE__ */ React108.createElement(
15035
+ Navigation.Submenu,
15036
+ {
15037
+ title: /* @__PURE__ */ React108.createElement(React108.Fragment, null, /* @__PURE__ */ React108.createElement(InlineIcon, { icon: open ? import_caretUpFilled.default : import_caretDownFilled.default, width: "12px", height: "12px", className: "mr-1" }), /* @__PURE__ */ React108.createElement(Box.Flex, { paddingX: "1", gap: "4" }, icon && /* @__PURE__ */ React108.createElement(InlineIcon, { icon, width: "20px", height: "20px" }), title)),
15038
+ "aria-expanded": open,
15039
+ id,
15040
+ onClick: (e) => {
15041
+ e.preventDefault();
15042
+ setOpen(!open);
15043
+ }
15044
+ },
15045
+ open && /* @__PURE__ */ React108.createElement("ul", { role: "menu", className: classNames12(tw("flex flex-col")), "aria-labelledby": id }, children)
15046
+ );
15047
+ };
15048
+ Submenu2.Item = Navigation.Submenu.Item;
15019
15049
  Navigation2.Item = Item6;
15020
- Navigation2.Submenu = Navigation.Submenu;
15021
- Navigation2.Submenu.Item = Navigation.Submenu.Item;
15022
15050
  Navigation2.Divider = Navigation.Divider;
15023
15051
  Navigation2.Footer = Navigation.Footer;
15024
15052
  Navigation2.Header = Navigation.Header;
15025
15053
  Navigation2.Section = Navigation.Section;
15054
+ Navigation2.Submenu = Submenu2;
15026
15055
 
15027
15056
  // src/molecules/PageHeader/PageHeader.tsx
15028
15057
  import React110 from "react";