@aivenio/aquarium 1.76.3 → 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,
@@ -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
@@ -10377,7 +10389,8 @@ var createInput = (displayName, opts = {}) => {
10377
10389
  {
10378
10390
  "[&::-webkit-search-cancel-button]:appearance-none": opts.isSearch,
10379
10391
  "pl-7": opts.adornment,
10380
- "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
10381
10394
  },
10382
10395
  getCommonInputStyles({ readOnly, valid }),
10383
10396
  props.className
@@ -10395,57 +10408,68 @@ var createInput = (displayName, opts = {}) => {
10395
10408
  return InputComponent;
10396
10409
  };
10397
10410
  var InputBase = createInput("InputBase");
10411
+ var FileInputBase = createInput("FileInputBase", {
10412
+ adornment: /* @__PURE__ */ React57.createElement(UploadIcon, null),
10413
+ canReset: true,
10414
+ isFile: true
10415
+ });
10398
10416
  var SearchInput = createInput("SearchInput", {
10399
10417
  adornment: /* @__PURE__ */ React57.createElement(SearchIcon, null),
10400
10418
  canReset: true,
10401
10419
  isSearch: true
10402
10420
  });
10403
- var Input2 = React57.forwardRef((inputProps, ref) => {
10404
- var _b, _c;
10405
- const _a = inputProps, { readOnly = false, value: valueProp, onChange: onChangeProp } = _a, props = __objRest(_a, ["readOnly", "value", "onChange"]);
10406
- const isControlled = typeof valueProp !== "undefined";
10407
- const [valueState, setValueState] = useState7((_b = props.defaultValue) != null ? _b : "");
10408
- const value = isControlled ? valueProp : valueState;
10409
- const handleChange = useCallback(
10410
- (e) => {
10411
- const next = e.target.value;
10412
- if (!isControlled) {
10413
- setValueState(next);
10414
- }
10415
- onChangeProp == null ? void 0 : onChangeProp(e);
10416
- },
10417
- [isControlled, onChangeProp]
10418
- );
10419
- const defaultId = useId7();
10420
- const id = (_c = props.id) != null ? _c : defaultId;
10421
- const errorMessageId = useId7();
10422
- const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
10423
- const _d = getLabelControlProps(inputProps), { "data-testid": dataTestId } = _d, labelControlProps = __objRest(_d, ["data-testid"]);
10424
- const baseProps = omit5(
10425
- inputProps,
10426
- Object.keys(labelControlProps).concat(isControlled ? ["defaultValue"] : ["value"])
10427
- );
10428
- return /* @__PURE__ */ React57.createElement(LabelControl, __spreadProps(__spreadValues({
10429
- id: `${id}-label`,
10430
- htmlFor: id,
10431
- messageId: errorMessageId,
10432
- length: value !== void 0 ? toString(value).length : void 0
10433
- }, labelControlProps), {
10434
- className: "Aquarium-Input"
10435
- }), /* @__PURE__ */ React57.createElement(InputBase, __spreadProps(__spreadValues(__spreadValues({
10436
- ref
10437
- }, baseProps), errorProps), {
10438
- id,
10439
- "data-testid": dataTestId,
10440
- onChange: handleChange,
10441
- disabled: props.disabled,
10442
- maxLength: props.maxLength,
10443
- required: props.required,
10444
- valid: props.valid,
10445
- readOnly
10446
- })));
10447
- });
10448
- 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 });
10449
10473
  Input2.Skeleton = () => /* @__PURE__ */ React57.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React57.createElement(InputBase.Skeleton, null));
10450
10474
  Input2.Skeleton.displayName = "Input.Skeleton";
10451
10475
 
@@ -15923,6 +15947,7 @@ export {
15923
15947
  EmptyState,
15924
15948
  EmptyStateLayout,
15925
15949
  ExternalLinkButton,
15950
+ FileInput,
15926
15951
  Flexbox,
15927
15952
  FlexboxItem,
15928
15953
  FormControl,