@aivenio/aquarium 1.76.2 → 1.77.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
@@ -4227,6 +4227,7 @@ __export(system_exports, {
4227
4227
  EmptyState: () => EmptyState,
4228
4228
  EmptyStateLayout: () => EmptyStateLayout,
4229
4229
  ExternalLinkButton: () => ExternalLinkButton,
4230
+ FileInput: () => FileInput,
4230
4231
  Flexbox: () => Flexbox,
4231
4232
  FlexboxItem: () => FlexboxItem,
4232
4233
  FormControl: () => FormControl,
@@ -4377,6 +4378,7 @@ __export(molecules_exports, {
4377
4378
  EmptyState: () => EmptyState,
4378
4379
  EmptyStateLayout: () => EmptyStateLayout,
4379
4380
  ExternalLinkButton: () => ExternalLinkButton,
4381
+ FileInput: () => FileInput,
4380
4382
  Flexbox: () => Flexbox,
4381
4383
  FlexboxItem: () => FlexboxItem,
4382
4384
  GhostButton: () => GhostButton,
@@ -4582,7 +4584,7 @@ var Menu = import_react3.default.forwardRef(
4582
4584
  return /* @__PURE__ */ import_react3.default.createElement("ul", __spreadValues({
4583
4585
  ref,
4584
4586
  style: { maxHeight },
4585
- className: classNames(className, tw("text-default"))
4587
+ className: classNames(className, tw("text-default bg-body"))
4586
4588
  }, props), children);
4587
4589
  }
4588
4590
  );
@@ -7022,8 +7024,8 @@ var Arrow = (props) => {
7022
7024
  var getCommonInputStyles = ({ readOnly, valid }) => tw(
7023
7025
  "block w-full rounded-sm disabled:cursor-not-allowed disabled:border-default disabled:bg-default typography-small text-default disabled:text-inactive placeholder:text-inactive focus:outline-none",
7024
7026
  {
7025
- "px-3 py-3": !readOnly,
7026
- "border-none resize-none cursor-default": readOnly,
7027
+ "px-3 py-3 bg-body": !readOnly,
7028
+ "border-none resize-none cursor-default bg-transparent": readOnly,
7027
7029
  "border border-danger-default": !valid && !readOnly,
7028
7030
  "border border-default hover:border-intense focus:border-info-default": valid && !readOnly
7029
7031
  }
@@ -7044,14 +7046,14 @@ var import_chevronDown3 = __toESM(require_chevronDown());
7044
7046
  var import_loading2 = __toESM(require_loading());
7045
7047
  var COLOR_CLASSNAMES = {
7046
7048
  "primary": tw(
7047
- "text-white bg-primary-default active:bg-primary-intense active:ring-0 focus-visible:ring-2 focus-visible:ring-primary-100 focus-visible:ring-inset hover:bg-primary-intense disabled:bg-primary-muted"
7049
+ "text-white bg-primary-default active:bg-primary-intense active:ring-0 focus-visible:ring-2 focus-visible:ring-primary-intense focus-visible:ring-inset hover:bg-primary-intense disabled:bg-primary-muted"
7048
7050
  ),
7049
7051
  "secondary": tw(
7050
- "text-primary-intense bg-body ring-1 ring-primary-80 ring-inset",
7051
- "active:bg-primary-active active:ring-primary-90 active:text-primary-intense",
7052
- "focus-visible:ring-2 focus-visible:ring-primary-90 focus-visible:text-primary-intense",
7053
- "hover:bg-primary-hover hover:ring-primary-90 hover:text-primary-intense",
7054
- "disabled:bg-body disabled:text-primary-inactive disabled:ring-primary-40"
7052
+ "text-primary-intense bg-transparent ring-1 ring-primary-default ring-inset",
7053
+ "active:bg-primary-active active:ring-primary-default active:text-primary-intense",
7054
+ "focus-visible:ring-2 focus-visible:ring-primary-default focus-visible:text-primary-intense",
7055
+ "hover:bg-primary-hover hover:ring-primary-default hover:text-primary-intense",
7056
+ "disabled:bg-body disabled:text-primary-inactive disabled:ring-primary-muted"
7055
7057
  ),
7056
7058
  "ghost": ghostButtonStyle,
7057
7059
  "text": linkStyle,
@@ -8182,8 +8184,8 @@ Banner.Dismiss = (_a) => {
8182
8184
  };
8183
8185
  Banner.Dismiss.displayName = "Alert.Banner.Dismiss";
8184
8186
  var ILLUSTRATION_COLORS = {
8185
- information: { stroke: tw("stroke-primary-60"), fill: tw("fill-primary-10") },
8186
- success: { stroke: tw("stroke-success-40"), fill: tw("fill-success-10") },
8187
+ information: { stroke: tw("stroke-primary-muted"), fill: tw("fill-primary-10") },
8188
+ success: { stroke: tw("stroke-success-default"), fill: tw("fill-success-10") },
8187
8189
  warning: { stroke: tw("stroke-warning-100"), fill: tw("fill-warning-20") },
8188
8190
  error: { stroke: tw("stroke-error-100"), fill: tw("fill-error-10") }
8189
8191
  };
@@ -8950,7 +8952,7 @@ var Checkbox = import_react39.default.forwardRef(
8950
8952
  name
8951
8953
  }, props), {
8952
8954
  className: classNames(
8953
- tw("peer appearance-none outline-none w-5 h-5", "rounded-sm border border-transparent", {
8955
+ tw("peer appearance-none outline-none w-5 h-5 rounded-sm border border-transparent", {
8954
8956
  "cursor-pointer checked:bg-primary-default": !disabled,
8955
8957
  "cursor-not-allowed bg-muted checked:bg-primary-muted": disabled
8956
8958
  })
@@ -8968,7 +8970,7 @@ var Checkbox = import_react39.default.forwardRef(
8968
8970
  "rounded-sm border border-default peer-focus:border-info-default"
8969
8971
  ),
8970
8972
  {
8971
- "peer-hover:border-intense peer-checked:text-white peer-checked:[&>path]:stroke-white peer-checked:border-primary-default": !disabled,
8973
+ "border-default peer-hover:border-intense peer-checked:text-white peer-checked:[&>path]:stroke-white peer-checked:border-primary-default": !disabled,
8972
8974
  "border-muted peer-checked:text-primary-default peer-checked:[&>path]:stroke-primary-70 peer-checked:border-transparent": disabled
8973
8975
  }
8974
8976
  )
@@ -9471,7 +9473,7 @@ var Carousel = ({
9471
9473
  tabIndex: 0,
9472
9474
  onScroll: handleScroll,
9473
9475
  className: tw(
9474
- "grid items-stretch grid-flow-col overflow-x-scroll scroll-smooth snap-x snap-mandatory scrollbar-hide focus-visible:outline-0 focus-visible:ring-1 focus-visible:ring-info-70"
9476
+ "grid items-stretch grid-flow-col overflow-x-scroll scroll-smooth snap-x snap-mandatory scrollbar-hide focus-visible:outline-0 focus-visible:ring-1 focus-visible:ring-info-default"
9475
9477
  ),
9476
9478
  style: { width }
9477
9479
  }, width !== 0 && import_react47.default.Children.map(children, (child, index) => /* @__PURE__ */ import_react47.default.createElement(CarouselItem, {
@@ -10443,6 +10445,7 @@ var import_cross5 = __toESM(require_cross());
10443
10445
  var import_error3 = __toESM(require_error());
10444
10446
  var import_search3 = __toESM(require_search());
10445
10447
  var import_tick4 = __toESM(require_tick());
10448
+ var import_upload2 = __toESM(require_upload());
10446
10449
  var InputAdornment = ({
10447
10450
  placement = "right",
10448
10451
  className,
@@ -10467,6 +10470,12 @@ var SearchIcon = ({ onClick }) => /* @__PURE__ */ import_react62.default.createE
10467
10470
  "data-testid": "icon-search",
10468
10471
  onClick
10469
10472
  });
10473
+ var UploadIcon = ({ onClick }) => /* @__PURE__ */ import_react62.default.createElement(Icon, {
10474
+ icon: import_upload2.default,
10475
+ color: "primary-intense",
10476
+ "data-testid": "icon-upload",
10477
+ onClick
10478
+ });
10470
10479
  var ResetIcon = ({ onClick }) => /* @__PURE__ */ import_react62.default.createElement(Icon, {
10471
10480
  className: "hover:cursor-pointer",
10472
10481
  icon: import_cross5.default,
@@ -10497,11 +10506,14 @@ var createInput = (displayName, opts = {}) => {
10497
10506
  "type"
10498
10507
  ]);
10499
10508
  var _a2;
10500
- const inputType = opts.isSearch ? "search" : type;
10509
+ const inputType = opts.isSearch ? "search" : opts.isFile ? "file" : type;
10501
10510
  const inputRef = import_react63.default.useRef(null);
10502
10511
  (0, import_react63.useImperativeHandle)(ref, () => inputRef.current);
10503
- const handleReset = () => {
10512
+ const handleReset = (e) => {
10504
10513
  var _a3;
10514
+ if (opts.isFile) {
10515
+ e.preventDefault();
10516
+ }
10505
10517
  const el = inputRef.current;
10506
10518
  if (el) {
10507
10519
  const lastValue = el.value;
@@ -10514,7 +10526,8 @@ var createInput = (displayName, opts = {}) => {
10514
10526
  return /* @__PURE__ */ import_react63.default.createElement("span", {
10515
10527
  className: classNames("Aquarium-InputBase", tw("relative block"))
10516
10528
  }, opts.adornment && /* @__PURE__ */ import_react63.default.createElement(InputAdornment, {
10517
- placement: "left"
10529
+ placement: "left",
10530
+ className: opts.isFile ? "icon-stroke-2" : void 0
10518
10531
  }, opts.adornment), /* @__PURE__ */ import_react63.default.createElement("input", __spreadProps(__spreadValues({
10519
10532
  ref: inputRef,
10520
10533
  type: inputType
@@ -10525,11 +10538,10 @@ var createInput = (displayName, opts = {}) => {
10525
10538
  readOnly,
10526
10539
  className: classNames(
10527
10540
  {
10528
- "bg-body": !readOnly,
10529
- "bg-transparent": readOnly,
10530
10541
  "[&::-webkit-search-cancel-button]:appearance-none": opts.isSearch,
10531
10542
  "pl-7": opts.adornment,
10532
- "pr-7": opts.canReset || endAdornment
10543
+ "pr-7": opts.canReset || endAdornment,
10544
+ "file:text-primary-intense file:typography-small-strong file:border-0 file:bg-transparent file:p-0 file:mr-4": opts.isFile
10533
10545
  },
10534
10546
  getCommonInputStyles({ readOnly, valid }),
10535
10547
  props.className
@@ -10547,57 +10559,68 @@ var createInput = (displayName, opts = {}) => {
10547
10559
  return InputComponent;
10548
10560
  };
10549
10561
  var InputBase = createInput("InputBase");
10562
+ var FileInputBase = createInput("FileInputBase", {
10563
+ adornment: /* @__PURE__ */ import_react63.default.createElement(UploadIcon, null),
10564
+ canReset: true,
10565
+ isFile: true
10566
+ });
10550
10567
  var SearchInput = createInput("SearchInput", {
10551
10568
  adornment: /* @__PURE__ */ import_react63.default.createElement(SearchIcon, null),
10552
10569
  canReset: true,
10553
10570
  isSearch: true
10554
10571
  });
10555
- var Input2 = import_react63.default.forwardRef((inputProps, ref) => {
10556
- var _b, _c;
10557
- const _a = inputProps, { readOnly = false, value: valueProp, onChange: onChangeProp } = _a, props = __objRest(_a, ["readOnly", "value", "onChange"]);
10558
- const isControlled = typeof valueProp !== "undefined";
10559
- const [valueState, setValueState] = (0, import_react63.useState)((_b = props.defaultValue) != null ? _b : "");
10560
- const value = isControlled ? valueProp : valueState;
10561
- const handleChange = (0, import_react63.useCallback)(
10562
- (e) => {
10563
- const next = e.target.value;
10564
- if (!isControlled) {
10565
- setValueState(next);
10566
- }
10567
- onChangeProp == null ? void 0 : onChangeProp(e);
10568
- },
10569
- [isControlled, onChangeProp]
10570
- );
10571
- const defaultId = (0, import_utils9.useId)();
10572
- const id = (_c = props.id) != null ? _c : defaultId;
10573
- const errorMessageId = (0, import_utils9.useId)();
10574
- const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
10575
- const _d = getLabelControlProps(inputProps), { "data-testid": dataTestId } = _d, labelControlProps = __objRest(_d, ["data-testid"]);
10576
- const baseProps = (0, import_omit5.default)(
10577
- inputProps,
10578
- Object.keys(labelControlProps).concat(isControlled ? ["defaultValue"] : ["value"])
10579
- );
10580
- return /* @__PURE__ */ import_react63.default.createElement(LabelControl, __spreadProps(__spreadValues({
10581
- id: `${id}-label`,
10582
- htmlFor: id,
10583
- messageId: errorMessageId,
10584
- length: value !== void 0 ? (0, import_toString.default)(value).length : void 0
10585
- }, labelControlProps), {
10586
- className: "Aquarium-Input"
10587
- }), /* @__PURE__ */ import_react63.default.createElement(InputBase, __spreadProps(__spreadValues(__spreadValues({
10588
- ref
10589
- }, baseProps), errorProps), {
10590
- id,
10591
- "data-testid": dataTestId,
10592
- onChange: handleChange,
10593
- disabled: props.disabled,
10594
- maxLength: props.maxLength,
10595
- required: props.required,
10596
- valid: props.valid,
10597
- readOnly
10598
- })));
10599
- });
10600
- Input2.displayName = "Input";
10572
+ var createInputComponent = (displayName, options = {}) => {
10573
+ const InputComponentBase = options.input || InputBase;
10574
+ const InputComponent = import_react63.default.forwardRef((inputProps, ref) => {
10575
+ var _b, _c;
10576
+ const _a = inputProps, { readOnly = false, value: valueProp, onChange: onChangeProp } = _a, props = __objRest(_a, ["readOnly", "value", "onChange"]);
10577
+ const isControlled = typeof valueProp !== "undefined";
10578
+ const [valueState, setValueState] = (0, import_react63.useState)((_b = props.defaultValue) != null ? _b : "");
10579
+ const value = isControlled ? valueProp : valueState;
10580
+ const handleChange = (0, import_react63.useCallback)(
10581
+ (e) => {
10582
+ const next = e.target.value;
10583
+ if (!isControlled) {
10584
+ setValueState(next);
10585
+ }
10586
+ onChangeProp == null ? void 0 : onChangeProp(e);
10587
+ },
10588
+ [isControlled, onChangeProp]
10589
+ );
10590
+ const defaultId = (0, import_utils9.useId)();
10591
+ const id = (_c = props.id) != null ? _c : defaultId;
10592
+ const errorMessageId = (0, import_utils9.useId)();
10593
+ const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
10594
+ const _d = getLabelControlProps(inputProps), { "data-testid": dataTestId } = _d, labelControlProps = __objRest(_d, ["data-testid"]);
10595
+ const baseProps = (0, import_omit5.default)(
10596
+ inputProps,
10597
+ Object.keys(labelControlProps).concat(isControlled ? ["defaultValue"] : ["value"])
10598
+ );
10599
+ return /* @__PURE__ */ import_react63.default.createElement(LabelControl, __spreadProps(__spreadValues({
10600
+ id: `${id}-label`,
10601
+ htmlFor: id,
10602
+ messageId: errorMessageId,
10603
+ length: value !== void 0 ? (0, import_toString.default)(value).length : void 0
10604
+ }, labelControlProps), {
10605
+ className: "Aquarium-Input"
10606
+ }), /* @__PURE__ */ import_react63.default.createElement(InputComponentBase, __spreadProps(__spreadValues(__spreadValues({
10607
+ ref
10608
+ }, baseProps), errorProps), {
10609
+ id,
10610
+ "data-testid": dataTestId,
10611
+ onChange: handleChange,
10612
+ disabled: props.disabled,
10613
+ maxLength: props.maxLength,
10614
+ required: props.required,
10615
+ valid: props.valid,
10616
+ readOnly
10617
+ })));
10618
+ });
10619
+ InputComponent.displayName = displayName;
10620
+ return InputComponent;
10621
+ };
10622
+ var FileInput = createInputComponent("FileInput", { input: FileInputBase });
10623
+ var Input2 = createInputComponent("Input", { input: InputBase });
10601
10624
  Input2.Skeleton = () => /* @__PURE__ */ import_react63.default.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ import_react63.default.createElement(InputBase.Skeleton, null));
10602
10625
  Input2.Skeleton.displayName = "Input.Skeleton";
10603
10626
 
@@ -11590,7 +11613,7 @@ var DropdownMenu = import_react73.default.forwardRef(
11590
11613
  style: { minHeight, maxHeight, minWidth, maxWidth },
11591
11614
  className: classNames(
11592
11615
  className,
11593
- "bg-popover-content w-full flex flex-col overflow-x-hidden typography-small text-default"
11616
+ "Aquarium-DropdownMenu.Menu bg-popover-content w-full flex flex-col overflow-x-hidden typography-small text-default"
11594
11617
  )
11595
11618
  }, props), children);
11596
11619
  }
@@ -11615,7 +11638,10 @@ var Group2 = import_react73.default.forwardRef(
11615
11638
  return /* @__PURE__ */ import_react73.default.createElement("li", __spreadValues({
11616
11639
  ref
11617
11640
  }, props), title && /* @__PURE__ */ import_react73.default.createElement("div", __spreadValues({
11618
- className: classNames(className, "p-3 text-inactive uppercase cursor-default typography-caption")
11641
+ className: classNames(
11642
+ className,
11643
+ "Aquarium-DropdownMenu.Group p-3 text-inactive uppercase cursor-default typography-caption"
11644
+ )
11619
11645
  }, titleProps), title), children);
11620
11646
  }
11621
11647
  );
@@ -11625,7 +11651,7 @@ var Item3 = import_react73.default.forwardRef(
11625
11651
  var _b = _a, { kind, highlighted, selected, className, icon, showNotification = false, children } = _b, props = __objRest(_b, ["kind", "highlighted", "selected", "className", "icon", "showNotification", "children"]);
11626
11652
  return /* @__PURE__ */ import_react73.default.createElement("li", __spreadValues({
11627
11653
  ref,
11628
- className: classNames(className, "flex items-center gap-x-3 p-3 outline-none", {
11654
+ className: classNames(className, "Aquarium-DropdownMenu.Item flex items-center gap-x-3 p-3 outline-none", {
11629
11655
  "cursor-pointer hover:bg-muted": !props.disabled,
11630
11656
  "bg-muted": highlighted,
11631
11657
  "text-primary-intense": kind === "action" && !props.disabled,
@@ -12834,7 +12860,7 @@ var Modal = (_a) => {
12834
12860
  Modal.BackDrop = (_a) => {
12835
12861
  var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
12836
12862
  return /* @__PURE__ */ import_react84.default.createElement("div", __spreadProps(__spreadValues({}, rest), {
12837
- className: classNames(tw("-z-10 fixed min-w-full min-h-full bg-default opacity-80"), className)
12863
+ className: classNames(tw("-z-10 fixed min-w-full min-h-full bg-body-intense opacity-70"), className)
12838
12864
  }));
12839
12865
  };
12840
12866
  Modal.Dialog = import_react84.default.forwardRef(
@@ -13666,11 +13692,14 @@ var DropdownItem = (_a) => {
13666
13692
  onClick: handleClick,
13667
13693
  onKeyDown: handleKeyDown
13668
13694
  }, props), {
13669
- className: tw("typography-small flex items-center focus:ring-0", {
13670
- "text-default cursor-pointer hover:bg-muted": !disabled,
13671
- "text-inactive cursor-not-allowed": disabled,
13672
- "text-primary-default hover:text-primary-intense": color === "danger" && !disabled
13673
- })
13695
+ className: classNames(
13696
+ "Aquarium-Dropdown.Item",
13697
+ tw("typography-small flex items-center focus:ring-0", {
13698
+ "text-default cursor-pointer hover:bg-muted": !disabled,
13699
+ "text-inactive cursor-not-allowed": disabled,
13700
+ "text-danger-default": color === "danger" && !disabled
13701
+ })
13702
+ )
13674
13703
  }), tooltip ? /* @__PURE__ */ import_react91.default.createElement(Tooltip, {
13675
13704
  content: tooltip,
13676
13705
  placement: tooltipPlacement,
@@ -15539,7 +15568,7 @@ var getBaseSegmentedControlClassNames = (selected) => tw(
15539
15568
  "disabled:cursor-not-allowed disabled:text-inactive disabled:bg-muted",
15540
15569
  {
15541
15570
  "typography-small text-default bg-body": !selected,
15542
- "typography-small-strong text-primary-intense relative z-40 ring-1 ring-offset-0 ring-primary-80": selected
15571
+ "typography-small-strong text-primary-intense relative z-40 ring-1 ring-offset-0 ring-primary-default": selected
15543
15572
  }
15544
15573
  );
15545
15574
 
@@ -16070,6 +16099,7 @@ var system_default = __spreadValues({}, molecules_exports);
16070
16099
  EmptyState,
16071
16100
  EmptyStateLayout,
16072
16101
  ExternalLinkButton,
16102
+ FileInput,
16073
16103
  Flexbox,
16074
16104
  FlexboxItem,
16075
16105
  FormControl,