@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.mjs CHANGED
@@ -4224,6 +4224,7 @@ __export(molecules_exports, {
4224
4224
  EmptyState: () => EmptyState,
4225
4225
  EmptyStateLayout: () => EmptyStateLayout,
4226
4226
  ExternalLinkButton: () => ExternalLinkButton,
4227
+ FileInput: () => FileInput,
4227
4228
  Flexbox: () => Flexbox,
4228
4229
  FlexboxItem: () => FlexboxItem,
4229
4230
  GhostButton: () => GhostButton,
@@ -4432,7 +4433,7 @@ var Menu = React2.forwardRef(
4432
4433
  return /* @__PURE__ */ React2.createElement("ul", __spreadValues({
4433
4434
  ref,
4434
4435
  style: { maxHeight },
4435
- className: classNames(className, tw("text-default"))
4436
+ className: classNames(className, tw("text-default bg-body"))
4436
4437
  }, props), children);
4437
4438
  }
4438
4439
  );
@@ -6872,8 +6873,8 @@ var Arrow = (props) => {
6872
6873
  var getCommonInputStyles = ({ readOnly, valid }) => tw(
6873
6874
  "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",
6874
6875
  {
6875
- "px-3 py-3": !readOnly,
6876
- "border-none resize-none cursor-default": readOnly,
6876
+ "px-3 py-3 bg-body": !readOnly,
6877
+ "border-none resize-none cursor-default bg-transparent": readOnly,
6877
6878
  "border border-danger-default": !valid && !readOnly,
6878
6879
  "border border-default hover:border-intense focus:border-info-default": valid && !readOnly
6879
6880
  }
@@ -6894,14 +6895,14 @@ var import_chevronDown3 = __toESM(require_chevronDown());
6894
6895
  var import_loading2 = __toESM(require_loading());
6895
6896
  var COLOR_CLASSNAMES = {
6896
6897
  "primary": tw(
6897
- "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"
6898
+ "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"
6898
6899
  ),
6899
6900
  "secondary": tw(
6900
- "text-primary-intense bg-body ring-1 ring-primary-80 ring-inset",
6901
- "active:bg-primary-active active:ring-primary-90 active:text-primary-intense",
6902
- "focus-visible:ring-2 focus-visible:ring-primary-90 focus-visible:text-primary-intense",
6903
- "hover:bg-primary-hover hover:ring-primary-90 hover:text-primary-intense",
6904
- "disabled:bg-body disabled:text-primary-inactive disabled:ring-primary-40"
6901
+ "text-primary-intense bg-transparent ring-1 ring-primary-default ring-inset",
6902
+ "active:bg-primary-active active:ring-primary-default active:text-primary-intense",
6903
+ "focus-visible:ring-2 focus-visible:ring-primary-default focus-visible:text-primary-intense",
6904
+ "hover:bg-primary-hover hover:ring-primary-default hover:text-primary-intense",
6905
+ "disabled:bg-body disabled:text-primary-inactive disabled:ring-primary-muted"
6905
6906
  ),
6906
6907
  "ghost": ghostButtonStyle,
6907
6908
  "text": linkStyle,
@@ -8032,8 +8033,8 @@ Banner.Dismiss = (_a) => {
8032
8033
  };
8033
8034
  Banner.Dismiss.displayName = "Alert.Banner.Dismiss";
8034
8035
  var ILLUSTRATION_COLORS = {
8035
- information: { stroke: tw("stroke-primary-60"), fill: tw("fill-primary-10") },
8036
- success: { stroke: tw("stroke-success-40"), fill: tw("fill-success-10") },
8036
+ information: { stroke: tw("stroke-primary-muted"), fill: tw("fill-primary-10") },
8037
+ success: { stroke: tw("stroke-success-default"), fill: tw("fill-success-10") },
8037
8038
  warning: { stroke: tw("stroke-warning-100"), fill: tw("fill-warning-20") },
8038
8039
  error: { stroke: tw("stroke-error-100"), fill: tw("fill-error-10") }
8039
8040
  };
@@ -8800,7 +8801,7 @@ var Checkbox = React33.forwardRef(
8800
8801
  name
8801
8802
  }, props), {
8802
8803
  className: classNames(
8803
- tw("peer appearance-none outline-none w-5 h-5", "rounded-sm border border-transparent", {
8804
+ tw("peer appearance-none outline-none w-5 h-5 rounded-sm border border-transparent", {
8804
8805
  "cursor-pointer checked:bg-primary-default": !disabled,
8805
8806
  "cursor-not-allowed bg-muted checked:bg-primary-muted": disabled
8806
8807
  })
@@ -8818,7 +8819,7 @@ var Checkbox = React33.forwardRef(
8818
8819
  "rounded-sm border border-default peer-focus:border-info-default"
8819
8820
  ),
8820
8821
  {
8821
- "peer-hover:border-intense peer-checked:text-white peer-checked:[&>path]:stroke-white peer-checked:border-primary-default": !disabled,
8822
+ "border-default peer-hover:border-intense peer-checked:text-white peer-checked:[&>path]:stroke-white peer-checked:border-primary-default": !disabled,
8822
8823
  "border-muted peer-checked:text-primary-default peer-checked:[&>path]:stroke-primary-70 peer-checked:border-transparent": disabled
8823
8824
  }
8824
8825
  )
@@ -9321,7 +9322,7 @@ var Carousel = ({
9321
9322
  tabIndex: 0,
9322
9323
  onScroll: handleScroll,
9323
9324
  className: tw(
9324
- "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"
9325
+ "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"
9325
9326
  ),
9326
9327
  style: { width }
9327
9328
  }, width !== 0 && React41.Children.map(children, (child, index) => /* @__PURE__ */ React41.createElement(CarouselItem, {
@@ -10293,6 +10294,7 @@ var import_cross5 = __toESM(require_cross());
10293
10294
  var import_error3 = __toESM(require_error());
10294
10295
  var import_search3 = __toESM(require_search());
10295
10296
  var import_tick4 = __toESM(require_tick());
10297
+ var import_upload2 = __toESM(require_upload());
10296
10298
  var InputAdornment = ({
10297
10299
  placement = "right",
10298
10300
  className,
@@ -10317,6 +10319,12 @@ var SearchIcon = ({ onClick }) => /* @__PURE__ */ React56.createElement(Icon, {
10317
10319
  "data-testid": "icon-search",
10318
10320
  onClick
10319
10321
  });
10322
+ var UploadIcon = ({ onClick }) => /* @__PURE__ */ React56.createElement(Icon, {
10323
+ icon: import_upload2.default,
10324
+ color: "primary-intense",
10325
+ "data-testid": "icon-upload",
10326
+ onClick
10327
+ });
10320
10328
  var ResetIcon = ({ onClick }) => /* @__PURE__ */ React56.createElement(Icon, {
10321
10329
  className: "hover:cursor-pointer",
10322
10330
  icon: import_cross5.default,
@@ -10347,11 +10355,14 @@ var createInput = (displayName, opts = {}) => {
10347
10355
  "type"
10348
10356
  ]);
10349
10357
  var _a2;
10350
- const inputType = opts.isSearch ? "search" : type;
10358
+ const inputType = opts.isSearch ? "search" : opts.isFile ? "file" : type;
10351
10359
  const inputRef = React57.useRef(null);
10352
10360
  useImperativeHandle(ref, () => inputRef.current);
10353
- const handleReset = () => {
10361
+ const handleReset = (e) => {
10354
10362
  var _a3;
10363
+ if (opts.isFile) {
10364
+ e.preventDefault();
10365
+ }
10355
10366
  const el = inputRef.current;
10356
10367
  if (el) {
10357
10368
  const lastValue = el.value;
@@ -10364,7 +10375,8 @@ var createInput = (displayName, opts = {}) => {
10364
10375
  return /* @__PURE__ */ React57.createElement("span", {
10365
10376
  className: classNames("Aquarium-InputBase", tw("relative block"))
10366
10377
  }, opts.adornment && /* @__PURE__ */ React57.createElement(InputAdornment, {
10367
- placement: "left"
10378
+ placement: "left",
10379
+ className: opts.isFile ? "icon-stroke-2" : void 0
10368
10380
  }, opts.adornment), /* @__PURE__ */ React57.createElement("input", __spreadProps(__spreadValues({
10369
10381
  ref: inputRef,
10370
10382
  type: inputType
@@ -10375,11 +10387,10 @@ var createInput = (displayName, opts = {}) => {
10375
10387
  readOnly,
10376
10388
  className: classNames(
10377
10389
  {
10378
- "bg-body": !readOnly,
10379
- "bg-transparent": readOnly,
10380
10390
  "[&::-webkit-search-cancel-button]:appearance-none": opts.isSearch,
10381
10391
  "pl-7": opts.adornment,
10382
- "pr-7": opts.canReset || endAdornment
10392
+ "pr-7": opts.canReset || endAdornment,
10393
+ "file:text-primary-intense file:typography-small-strong file:border-0 file:bg-transparent file:p-0 file:mr-4": opts.isFile
10383
10394
  },
10384
10395
  getCommonInputStyles({ readOnly, valid }),
10385
10396
  props.className
@@ -10397,57 +10408,68 @@ var createInput = (displayName, opts = {}) => {
10397
10408
  return InputComponent;
10398
10409
  };
10399
10410
  var InputBase = createInput("InputBase");
10411
+ var FileInputBase = createInput("FileInputBase", {
10412
+ adornment: /* @__PURE__ */ React57.createElement(UploadIcon, null),
10413
+ canReset: true,
10414
+ isFile: true
10415
+ });
10400
10416
  var SearchInput = createInput("SearchInput", {
10401
10417
  adornment: /* @__PURE__ */ React57.createElement(SearchIcon, null),
10402
10418
  canReset: true,
10403
10419
  isSearch: true
10404
10420
  });
10405
- var Input2 = React57.forwardRef((inputProps, ref) => {
10406
- var _b, _c;
10407
- const _a = inputProps, { readOnly = false, value: valueProp, onChange: onChangeProp } = _a, props = __objRest(_a, ["readOnly", "value", "onChange"]);
10408
- const isControlled = typeof valueProp !== "undefined";
10409
- const [valueState, setValueState] = useState7((_b = props.defaultValue) != null ? _b : "");
10410
- const value = isControlled ? valueProp : valueState;
10411
- const handleChange = useCallback(
10412
- (e) => {
10413
- const next = e.target.value;
10414
- if (!isControlled) {
10415
- setValueState(next);
10416
- }
10417
- onChangeProp == null ? void 0 : onChangeProp(e);
10418
- },
10419
- [isControlled, onChangeProp]
10420
- );
10421
- const defaultId = useId7();
10422
- const id = (_c = props.id) != null ? _c : defaultId;
10423
- const errorMessageId = useId7();
10424
- const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
10425
- const _d = getLabelControlProps(inputProps), { "data-testid": dataTestId } = _d, labelControlProps = __objRest(_d, ["data-testid"]);
10426
- const baseProps = omit5(
10427
- inputProps,
10428
- Object.keys(labelControlProps).concat(isControlled ? ["defaultValue"] : ["value"])
10429
- );
10430
- return /* @__PURE__ */ React57.createElement(LabelControl, __spreadProps(__spreadValues({
10431
- id: `${id}-label`,
10432
- htmlFor: id,
10433
- messageId: errorMessageId,
10434
- length: value !== void 0 ? toString(value).length : void 0
10435
- }, labelControlProps), {
10436
- className: "Aquarium-Input"
10437
- }), /* @__PURE__ */ React57.createElement(InputBase, __spreadProps(__spreadValues(__spreadValues({
10438
- ref
10439
- }, baseProps), errorProps), {
10440
- id,
10441
- "data-testid": dataTestId,
10442
- onChange: handleChange,
10443
- disabled: props.disabled,
10444
- maxLength: props.maxLength,
10445
- required: props.required,
10446
- valid: props.valid,
10447
- readOnly
10448
- })));
10449
- });
10450
- Input2.displayName = "Input";
10421
+ var createInputComponent = (displayName, options = {}) => {
10422
+ const InputComponentBase = options.input || InputBase;
10423
+ const InputComponent = React57.forwardRef((inputProps, ref) => {
10424
+ var _b, _c;
10425
+ const _a = inputProps, { readOnly = false, value: valueProp, onChange: onChangeProp } = _a, props = __objRest(_a, ["readOnly", "value", "onChange"]);
10426
+ const isControlled = typeof valueProp !== "undefined";
10427
+ const [valueState, setValueState] = useState7((_b = props.defaultValue) != null ? _b : "");
10428
+ const value = isControlled ? valueProp : valueState;
10429
+ const handleChange = useCallback(
10430
+ (e) => {
10431
+ const next = e.target.value;
10432
+ if (!isControlled) {
10433
+ setValueState(next);
10434
+ }
10435
+ onChangeProp == null ? void 0 : onChangeProp(e);
10436
+ },
10437
+ [isControlled, onChangeProp]
10438
+ );
10439
+ const defaultId = useId7();
10440
+ const id = (_c = props.id) != null ? _c : defaultId;
10441
+ const errorMessageId = useId7();
10442
+ const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
10443
+ const _d = getLabelControlProps(inputProps), { "data-testid": dataTestId } = _d, labelControlProps = __objRest(_d, ["data-testid"]);
10444
+ const baseProps = omit5(
10445
+ inputProps,
10446
+ Object.keys(labelControlProps).concat(isControlled ? ["defaultValue"] : ["value"])
10447
+ );
10448
+ return /* @__PURE__ */ React57.createElement(LabelControl, __spreadProps(__spreadValues({
10449
+ id: `${id}-label`,
10450
+ htmlFor: id,
10451
+ messageId: errorMessageId,
10452
+ length: value !== void 0 ? toString(value).length : void 0
10453
+ }, labelControlProps), {
10454
+ className: "Aquarium-Input"
10455
+ }), /* @__PURE__ */ React57.createElement(InputComponentBase, __spreadProps(__spreadValues(__spreadValues({
10456
+ ref
10457
+ }, baseProps), errorProps), {
10458
+ id,
10459
+ "data-testid": dataTestId,
10460
+ onChange: handleChange,
10461
+ disabled: props.disabled,
10462
+ maxLength: props.maxLength,
10463
+ required: props.required,
10464
+ valid: props.valid,
10465
+ readOnly
10466
+ })));
10467
+ });
10468
+ InputComponent.displayName = displayName;
10469
+ return InputComponent;
10470
+ };
10471
+ var FileInput = createInputComponent("FileInput", { input: FileInputBase });
10472
+ var Input2 = createInputComponent("Input", { input: InputBase });
10451
10473
  Input2.Skeleton = () => /* @__PURE__ */ React57.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React57.createElement(InputBase.Skeleton, null));
10452
10474
  Input2.Skeleton.displayName = "Input.Skeleton";
10453
10475
 
@@ -11440,7 +11462,7 @@ var DropdownMenu = React66.forwardRef(
11440
11462
  style: { minHeight, maxHeight, minWidth, maxWidth },
11441
11463
  className: classNames(
11442
11464
  className,
11443
- "bg-popover-content w-full flex flex-col overflow-x-hidden typography-small text-default"
11465
+ "Aquarium-DropdownMenu.Menu bg-popover-content w-full flex flex-col overflow-x-hidden typography-small text-default"
11444
11466
  )
11445
11467
  }, props), children);
11446
11468
  }
@@ -11465,7 +11487,10 @@ var Group2 = React66.forwardRef(
11465
11487
  return /* @__PURE__ */ React66.createElement("li", __spreadValues({
11466
11488
  ref
11467
11489
  }, props), title && /* @__PURE__ */ React66.createElement("div", __spreadValues({
11468
- className: classNames(className, "p-3 text-inactive uppercase cursor-default typography-caption")
11490
+ className: classNames(
11491
+ className,
11492
+ "Aquarium-DropdownMenu.Group p-3 text-inactive uppercase cursor-default typography-caption"
11493
+ )
11469
11494
  }, titleProps), title), children);
11470
11495
  }
11471
11496
  );
@@ -11475,7 +11500,7 @@ var Item3 = React66.forwardRef(
11475
11500
  var _b = _a, { kind, highlighted, selected, className, icon, showNotification = false, children } = _b, props = __objRest(_b, ["kind", "highlighted", "selected", "className", "icon", "showNotification", "children"]);
11476
11501
  return /* @__PURE__ */ React66.createElement("li", __spreadValues({
11477
11502
  ref,
11478
- className: classNames(className, "flex items-center gap-x-3 p-3 outline-none", {
11503
+ className: classNames(className, "Aquarium-DropdownMenu.Item flex items-center gap-x-3 p-3 outline-none", {
11479
11504
  "cursor-pointer hover:bg-muted": !props.disabled,
11480
11505
  "bg-muted": highlighted,
11481
11506
  "text-primary-intense": kind === "action" && !props.disabled,
@@ -12684,7 +12709,7 @@ var Modal = (_a) => {
12684
12709
  Modal.BackDrop = (_a) => {
12685
12710
  var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
12686
12711
  return /* @__PURE__ */ React76.createElement("div", __spreadProps(__spreadValues({}, rest), {
12687
- className: classNames(tw("-z-10 fixed min-w-full min-h-full bg-default opacity-80"), className)
12712
+ className: classNames(tw("-z-10 fixed min-w-full min-h-full bg-body-intense opacity-70"), className)
12688
12713
  }));
12689
12714
  };
12690
12715
  Modal.Dialog = React76.forwardRef(
@@ -13516,11 +13541,14 @@ var DropdownItem = (_a) => {
13516
13541
  onClick: handleClick,
13517
13542
  onKeyDown: handleKeyDown
13518
13543
  }, props), {
13519
- className: tw("typography-small flex items-center focus:ring-0", {
13520
- "text-default cursor-pointer hover:bg-muted": !disabled,
13521
- "text-inactive cursor-not-allowed": disabled,
13522
- "text-primary-default hover:text-primary-intense": color === "danger" && !disabled
13523
- })
13544
+ className: classNames(
13545
+ "Aquarium-Dropdown.Item",
13546
+ tw("typography-small flex items-center focus:ring-0", {
13547
+ "text-default cursor-pointer hover:bg-muted": !disabled,
13548
+ "text-inactive cursor-not-allowed": disabled,
13549
+ "text-danger-default": color === "danger" && !disabled
13550
+ })
13551
+ )
13524
13552
  }), tooltip ? /* @__PURE__ */ React82.createElement(Tooltip, {
13525
13553
  content: tooltip,
13526
13554
  placement: tooltipPlacement,
@@ -15389,7 +15417,7 @@ var getBaseSegmentedControlClassNames = (selected) => tw(
15389
15417
  "disabled:cursor-not-allowed disabled:text-inactive disabled:bg-muted",
15390
15418
  {
15391
15419
  "typography-small text-default bg-body": !selected,
15392
- "typography-small-strong text-primary-intense relative z-40 ring-1 ring-offset-0 ring-primary-80": selected
15420
+ "typography-small-strong text-primary-intense relative z-40 ring-1 ring-offset-0 ring-primary-default": selected
15393
15421
  }
15394
15422
  );
15395
15423
 
@@ -15919,6 +15947,7 @@ export {
15919
15947
  EmptyState,
15920
15948
  EmptyStateLayout,
15921
15949
  ExternalLinkButton,
15950
+ FileInput,
15922
15951
  Flexbox,
15923
15952
  FlexboxItem,
15924
15953
  FormControl,
@@ -53,6 +53,8 @@ module.exports = {
53
53
  extend: {
54
54
  backgroundColor,
55
55
  borderColor,
56
+ ringColor: borderColor,
57
+ stroke: borderColor,
56
58
  borderRadius,
57
59
  textColor,
58
60
  zIndex: {