@pismo/marola 1.0.0-beta.20 → 1.0.0-beta.21

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.
@@ -1 +1 @@
1
- ._autocomplete_1k4ph_1{margin-bottom:16px;position:relative}._autocomplete__dropdown-list_1k4ph_5{position:absolute;background-color:var(--white-100);margin-top:.1rem;border:solid .0625rem var(--gray-25);border-radius:.375rem}._autocomplete__dropdown-list_1k4ph_5:hover{border-color:var(--gray-75)}._autocomplete__dropdown-item_1k4ph_15{background-color:var(--white-100);padding:.375rem;list-style-type:none;cursor:pointer}._autocomplete__dropdown-item_1k4ph_15:hover{color:var(--accent)}
1
+ ._autocomplete_19kw3_1{margin-bottom:16px}._autocomplete__dropdown-list_19kw3_4{padding:0;margin-top:.1rem;border:solid .0625rem var(--gray-25);border-radius:.375rem}._autocomplete__dropdown-item_19kw3_10{padding:.375rem 1rem;list-style-type:none;cursor:pointer}._autocomplete__dropdown-item_19kw3_10:hover{color:var(--accent)}
@@ -1,8 +1,10 @@
1
1
  import { InputHTMLAttributes, ReactNode, SyntheticEvent } from 'react';
2
2
 
3
- type AutocompleteProps<T> = Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'> & {
3
+ export type AutocompleteProps<T> = Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'> & {
4
4
  /** Label text */
5
5
  label?: string;
6
+ /** Object key to be used as label when options are an array of object */
7
+ labelKey?: T extends object ? keyof T : never;
6
8
  /** Options array */
7
9
  options?: Array<T>;
8
10
  /** callback for new option selected */
@@ -46,7 +48,4 @@ type AutocompleteProps<T> = Omit<InputHTMLAttributes<HTMLInputElement>, 'onChang
46
48
  /** Id to be applied as `data-testid` on the chars counter element */
47
49
  'data-testid-charsCounter'?: string;
48
50
  };
49
- export declare const Autocomplete: <T extends string | (object & {
50
- label: string;
51
- })>({ label, type, options, infoMessage, errorMessage, leftIcon, rightIcon, id, disabled, maxLength, onChange, onInputChange, classNameLabel, classNameInput, classNameErrorMessage, classNameInfoMessage, "data-testid-label": testIdLabel, "data-testid-input": testIdInput, "data-testid-infoMessage": testIdInfoMessage, "data-testid-errorMessage": testIdErrorMessage, ...rest }: AutocompleteProps<T>) => import("react/jsx-runtime").JSX.Element;
52
- export {};
51
+ export declare const Autocomplete: <T extends string | object>({ label, type, labelKey, options, infoMessage, errorMessage, leftIcon, rightIcon, id, disabled, maxLength, onChange, onInputChange, classNameLabel, classNameInput, classNameErrorMessage, classNameInfoMessage, "data-testid-label": testIdLabel, "data-testid-input": testIdInput, "data-testid-infoMessage": testIdInfoMessage, "data-testid-errorMessage": testIdErrorMessage, ...rest }: AutocompleteProps<T>) => import("react/jsx-runtime").JSX.Element;
@@ -1,11 +1,11 @@
1
1
  import '../../assets/Autocomplete.css';
2
- import { jsxs as qe, jsx as $ } from "react/jsx-runtime";
2
+ import { jsxs as qe, jsx as A } from "react/jsx-runtime";
3
3
  import * as g from "react";
4
4
  import { useId as pt, useState as Be } from "react";
5
5
  import { c as ee } from "../../clsx-DB4S2d7J.js";
6
- import { Icon as Ke } from "../Icon/Icon.js";
7
- import { s as P, I as gt } from "../../Input.module-ZTRZRcNt.js";
8
- import { Typography as Ue } from "../Typography/Typography.js";
6
+ import { Icon as Ue } from "../Icon/Icon.js";
7
+ import { s as T, I as gt } from "../../Input.module-ZTRZRcNt.js";
8
+ import { Typography as Ke } from "../Typography/Typography.js";
9
9
  import { b as je, s as ht } from "../../useSlotProps-kRhf7Gil.js";
10
10
  import { u as mt } from "../../useId-BW-oWmul.js";
11
11
  import { u as $e } from "../../useControlled-CCMYYdCM.js";
@@ -23,22 +23,22 @@ function xt(u = {}) {
23
23
  const {
24
24
  ignoreAccents: b = !0,
25
25
  ignoreCase: h = !0,
26
- limit: A,
27
- matchFrom: D = "any",
28
- stringify: H,
29
- trim: V = !1
26
+ limit: V,
27
+ matchFrom: B = "any",
28
+ stringify: $,
29
+ trim: M = !1
30
30
  } = u;
31
- return (M, {
32
- inputValue: F,
31
+ return (D, {
32
+ inputValue: U,
33
33
  getOptionLabel: m
34
34
  }) => {
35
- let I = V ? F.trim() : F;
36
- h && (I = I.toLowerCase()), b && (I = ze(I));
37
- const q = I ? M.filter((Y) => {
38
- let _ = (H || m)(Y);
39
- return h && (_ = _.toLowerCase()), b && (_ = ze(_)), D === "start" ? _.indexOf(I) === 0 : _.indexOf(I) > -1;
40
- }) : M;
41
- return typeof A == "number" ? q.slice(0, A) : q;
35
+ let k = M ? U.trim() : U;
36
+ h && (k = k.toLowerCase()), b && (k = ze(k));
37
+ const H = k ? D.filter((K) => {
38
+ let I = ($ || m)(K);
39
+ return h && (I = I.toLowerCase()), b && (I = ze(I)), B === "start" ? I.indexOf(k) === 0 : I.indexOf(k) > -1;
40
+ }) : D;
41
+ return typeof V == "number" ? H.slice(0, V) : H;
42
42
  };
43
43
  }
44
44
  function be(u, b) {
@@ -57,50 +57,50 @@ function It(u) {
57
57
  unstable_isActiveElementInListbox: b = Ot,
58
58
  // eslint-disable-next-line @typescript-eslint/naming-convention
59
59
  unstable_classNamePrefix: h = "Mui",
60
- autoComplete: A = !1,
61
- autoHighlight: D = !1,
62
- autoSelect: H = !1,
63
- blurOnSelect: V = !1,
64
- clearOnBlur: M = !u.freeSolo,
65
- clearOnEscape: F = !1,
60
+ autoComplete: V = !1,
61
+ autoHighlight: B = !1,
62
+ autoSelect: $ = !1,
63
+ blurOnSelect: M = !1,
64
+ clearOnBlur: D = !u.freeSolo,
65
+ clearOnEscape: U = !1,
66
66
  componentName: m = "useAutocomplete",
67
- defaultValue: I = u.multiple ? [] : null,
68
- disableClearable: q = !1,
69
- disableCloseOnSelect: Y = !1,
70
- disabled: _,
67
+ defaultValue: k = u.multiple ? [] : null,
68
+ disableClearable: H = !1,
69
+ disableCloseOnSelect: K = !1,
70
+ disabled: I,
71
71
  disabledItemsFocusable: xe = !1,
72
72
  disableListWrap: te = !1,
73
73
  filterOptions: ye = yt,
74
74
  filterSelectedOptions: ne = !1,
75
75
  freeSolo: R = !1,
76
- getOptionDisabled: U,
77
- getOptionKey: W,
78
- getOptionLabel: re = (t) => {
76
+ getOptionDisabled: j,
77
+ getOptionKey: oe,
78
+ getOptionLabel: W = (t) => {
79
79
  var e;
80
80
  return (e = t.label) != null ? e : t;
81
81
  },
82
- groupBy: j,
83
- handleHomeEndKeys: oe = !u.freeSolo,
82
+ groupBy: z,
83
+ handleHomeEndKeys: re = !u.freeSolo,
84
84
  id: Oe,
85
85
  includeInputInList: se = !1,
86
86
  inputValue: Ie,
87
87
  isOptionEqualToValue: E = (t, e) => t === e,
88
88
  multiple: i = !1,
89
89
  onChange: ie,
90
- onClose: X,
91
- onHighlightChange: le,
90
+ onClose: le,
91
+ onHighlightChange: X,
92
92
  onInputChange: v,
93
93
  onOpen: ae,
94
- open: c,
95
- openOnFocus: T = !1,
96
- options: _e,
94
+ open: we,
95
+ openOnFocus: p = !1,
96
+ options: w,
97
97
  readOnly: G = !1,
98
98
  selectOnFocus: Ye = !u.freeSolo,
99
99
  value: We
100
- } = u, k = mt(Oe);
101
- let y = re;
100
+ } = u, S = mt(Oe);
101
+ let y = W;
102
102
  y = (t) => {
103
- const e = re(t);
103
+ const e = W(t);
104
104
  if (typeof e != "string") {
105
105
  if (process.env.NODE_ENV !== "production") {
106
106
  const n = e === void 0 ? "undefined" : `${typeof e} (${e})`;
@@ -110,9 +110,9 @@ function It(u) {
110
110
  }
111
111
  return e;
112
112
  };
113
- const we = g.useRef(!1), ke = g.useRef(!0), d = g.useRef(null), N = g.useRef(null), [ue, Xe] = g.useState(null), [S, Ne] = g.useState(-1), De = D ? 0 : -1, x = g.useRef(De), [r, Ge] = $e({
113
+ const _e = g.useRef(!1), ke = g.useRef(!0), f = g.useRef(null), N = g.useRef(null), [ue, Xe] = g.useState(null), [P, Se] = g.useState(-1), De = B ? 0 : -1, x = g.useRef(De), [o, Ge] = $e({
114
114
  controlled: We,
115
- default: I,
115
+ default: k,
116
116
  name: m
117
117
  }), [a, ce] = $e({
118
118
  controlled: Ie,
@@ -120,25 +120,25 @@ function It(u) {
120
120
  name: m,
121
121
  state: "inputValue"
122
122
  }), [fe, Ee] = g.useState(!1), de = g.useCallback((t, e) => {
123
- if (!(i ? r.length < e.length : e !== null) && !M)
123
+ if (!(i ? o.length < e.length : e !== null) && !D)
124
124
  return;
125
- let o;
125
+ let r;
126
126
  if (i)
127
- o = "";
127
+ r = "";
128
128
  else if (e == null)
129
- o = "";
129
+ r = "";
130
130
  else {
131
131
  const s = y(e);
132
- o = typeof s == "string" ? s : "";
132
+ r = typeof s == "string" ? s : "";
133
133
  }
134
- a !== o && (ce(o), v && v(t, o, "reset"));
135
- }, [y, a, i, v, ce, M, r]), [z, ve] = $e({
136
- controlled: c,
134
+ a !== r && (ce(r), v && v(t, r, "reset"));
135
+ }, [y, a, i, v, ce, D, o]), [J, ve] = $e({
136
+ controlled: we,
137
137
  default: !1,
138
138
  name: m,
139
139
  state: "open"
140
- }), [Qe, Ce] = g.useState(!0), Le = !i && r != null && a === y(r), w = z && !G, f = w ? ye(
141
- _e.filter((t) => !(ne && (i ? r : [r]).some((e) => e !== null && E(t, e)))),
140
+ }), [Qe, Ce] = g.useState(!0), Le = !i && o != null && a === y(o), _ = J && !G, c = _ ? ye(
141
+ w.filter((t) => !(ne && (i ? o : [o]).some((e) => e !== null && E(t, e)))),
142
142
  // we use the empty string to manipulate `filterOptions` to not filter any options
143
143
  // i.e. the filter predicate always returns true
144
144
  {
@@ -146,47 +146,47 @@ function It(u) {
146
146
  getOptionLabel: y
147
147
  }
148
148
  ) : [], C = bt({
149
- filteredOptions: f,
150
- value: r,
149
+ filteredOptions: c,
150
+ value: o,
151
151
  inputValue: a
152
152
  });
153
153
  g.useEffect(() => {
154
- const t = r !== C.value;
155
- fe && !t || R && !t || de(null, r);
156
- }, [r, de, fe, C.value, R]);
157
- const Se = z && f.length > 0 && !G;
158
- if (process.env.NODE_ENV !== "production" && r !== null && !R && _e.length > 0) {
159
- const t = (i ? r : [r]).filter((e) => !_e.some((n) => E(n, e)));
154
+ const t = o !== C.value;
155
+ fe && !t || R && !t || de(null, o);
156
+ }, [o, de, fe, C.value, R]);
157
+ const Ne = J && c.length > 0 && !G;
158
+ if (process.env.NODE_ENV !== "production" && o !== null && !R && w.length > 0) {
159
+ const t = (i ? o : [o]).filter((e) => !w.some((n) => E(n, e)));
160
160
  t.length > 0 && console.warn([`MUI: The value provided to ${m} is invalid.`, `None of the options match with \`${t.length > 1 ? JSON.stringify(t) : JSON.stringify(t[0])}\`.`, "You can use the `isOptionEqualToValue` prop to customize the equality test."].join(`
161
161
  `));
162
162
  }
163
163
  const pe = me((t) => {
164
- t === -1 ? d.current.focus() : ue.querySelector(`[data-tag-index="${t}"]`).focus();
164
+ t === -1 ? f.current.focus() : ue.querySelector(`[data-tag-index="${t}"]`).focus();
165
165
  });
166
166
  g.useEffect(() => {
167
- i && S > r.length - 1 && (Ne(-1), pe(-1));
168
- }, [r, i, S, pe]);
167
+ i && P > o.length - 1 && (Se(-1), pe(-1));
168
+ }, [o, i, P, pe]);
169
169
  function Ze(t, e) {
170
- if (!N.current || t < 0 || t >= f.length)
170
+ if (!N.current || t < 0 || t >= c.length)
171
171
  return -1;
172
172
  let n = t;
173
173
  for (; ; ) {
174
- const o = N.current.querySelector(`[data-option-index="${n}"]`), s = xe ? !1 : !o || o.disabled || o.getAttribute("aria-disabled") === "true";
175
- if (o && o.hasAttribute("tabindex") && !s)
174
+ const r = N.current.querySelector(`[data-option-index="${n}"]`), s = xe ? !1 : !r || r.disabled || r.getAttribute("aria-disabled") === "true";
175
+ if (r && r.hasAttribute("tabindex") && !s)
176
176
  return n;
177
- if (e === "next" ? n = (n + 1) % f.length : n = (n - 1 + f.length) % f.length, n === t)
177
+ if (e === "next" ? n = (n + 1) % c.length : n = (n - 1 + c.length) % c.length, n === t)
178
178
  return -1;
179
179
  }
180
180
  }
181
- const B = me(({
181
+ const F = me(({
182
182
  event: t,
183
183
  index: e,
184
184
  reason: n = "auto"
185
185
  }) => {
186
- if (x.current = e, e === -1 ? d.current.removeAttribute("aria-activedescendant") : d.current.setAttribute("aria-activedescendant", `${k}-option-${e}`), le && le(t, e === -1 ? null : f[e], n), !N.current)
186
+ if (x.current = e, e === -1 ? f.current.removeAttribute("aria-activedescendant") : f.current.setAttribute("aria-activedescendant", `${S}-option-${e}`), X && X(t, e === -1 ? null : c[e], n), !N.current)
187
187
  return;
188
- const o = N.current.querySelector(`[role="option"].${h}-focused`);
189
- o && (o.classList.remove(`${h}-focused`), o.classList.remove(`${h}-focusVisible`));
188
+ const r = N.current.querySelector(`[role="option"].${h}-focused`);
189
+ r && (r.classList.remove(`${h}-focused`), r.classList.remove(`${h}-focusVisible`));
190
190
  let s = N.current;
191
191
  if (N.current.getAttribute("role") !== "listbox" && (s = N.current.parentElement.querySelector('[role="listbox"]')), !s)
192
192
  return;
@@ -196,60 +196,60 @@ function It(u) {
196
196
  }
197
197
  const l = N.current.querySelector(`[data-option-index="${e}"]`);
198
198
  if (l && (l.classList.add(`${h}-focused`), n === "keyboard" && l.classList.add(`${h}-focusVisible`), s.scrollHeight > s.clientHeight && n !== "mouse" && n !== "touch")) {
199
- const p = l, O = s.clientHeight + s.scrollTop, he = p.offsetTop + p.offsetHeight;
200
- he > O ? s.scrollTop = he - s.clientHeight : p.offsetTop - p.offsetHeight * (j ? 1.3 : 0) < s.scrollTop && (s.scrollTop = p.offsetTop - p.offsetHeight * (j ? 1.3 : 0));
199
+ const d = l, O = s.clientHeight + s.scrollTop, he = d.offsetTop + d.offsetHeight;
200
+ he > O ? s.scrollTop = he - s.clientHeight : d.offsetTop - d.offsetHeight * (z ? 1.3 : 0) < s.scrollTop && (s.scrollTop = d.offsetTop - d.offsetHeight * (z ? 1.3 : 0));
201
201
  }
202
202
  }), L = me(({
203
203
  event: t,
204
204
  diff: e,
205
205
  direction: n = "next",
206
- reason: o = "auto"
206
+ reason: r = "auto"
207
207
  }) => {
208
- if (!w)
208
+ if (!_)
209
209
  return;
210
210
  const l = Ze((() => {
211
- const p = f.length - 1;
211
+ const d = c.length - 1;
212
212
  if (e === "reset")
213
213
  return De;
214
214
  if (e === "start")
215
215
  return 0;
216
216
  if (e === "end")
217
- return p;
217
+ return d;
218
218
  const O = x.current + e;
219
- return O < 0 ? O === -1 && se ? -1 : te && x.current !== -1 || Math.abs(e) > 1 ? 0 : p : O > p ? O === p + 1 && se ? -1 : te || Math.abs(e) > 1 ? p : 0 : O;
219
+ return O < 0 ? O === -1 && se ? -1 : te && x.current !== -1 || Math.abs(e) > 1 ? 0 : d : O > d ? O === d + 1 && se ? -1 : te || Math.abs(e) > 1 ? d : 0 : O;
220
220
  })(), n);
221
- if (B({
221
+ if (F({
222
222
  index: l,
223
- reason: o,
223
+ reason: r,
224
224
  event: t
225
- }), A && e !== "reset")
225
+ }), V && e !== "reset")
226
226
  if (l === -1)
227
- d.current.value = a;
227
+ f.current.value = a;
228
228
  else {
229
- const p = y(f[l]);
230
- d.current.value = p, p.toLowerCase().indexOf(a.toLowerCase()) === 0 && a.length > 0 && d.current.setSelectionRange(a.length, p.length);
229
+ const d = y(c[l]);
230
+ f.current.value = d, d.toLowerCase().indexOf(a.toLowerCase()) === 0 && a.length > 0 && f.current.setSelectionRange(a.length, d.length);
231
231
  }
232
232
  }), et = () => {
233
233
  const t = (e, n) => {
234
- const o = e ? y(e) : "", s = n ? y(n) : "";
235
- return o === s;
234
+ const r = e ? y(e) : "", s = n ? y(n) : "";
235
+ return r === s;
236
236
  };
237
- if (x.current !== -1 && C.filteredOptions && C.filteredOptions.length !== f.length && C.inputValue === a && (i ? r.length === C.value.length && C.value.every((e, n) => y(r[n]) === y(e)) : t(C.value, r))) {
237
+ if (x.current !== -1 && C.filteredOptions && C.filteredOptions.length !== c.length && C.inputValue === a && (i ? o.length === C.value.length && C.value.every((e, n) => y(o[n]) === y(e)) : t(C.value, o))) {
238
238
  const e = C.filteredOptions[x.current];
239
239
  if (e)
240
- return be(f, (n) => y(n) === y(e));
240
+ return be(c, (n) => y(n) === y(e));
241
241
  }
242
242
  return -1;
243
243
  }, Pe = g.useCallback(() => {
244
- if (!w)
244
+ if (!_)
245
245
  return;
246
246
  const t = et();
247
247
  if (t !== -1) {
248
248
  x.current = t;
249
249
  return;
250
250
  }
251
- const e = i ? r[0] : r;
252
- if (f.length === 0 || e == null) {
251
+ const e = i ? o[0] : o;
252
+ if (c.length === 0 || e == null) {
253
253
  L({
254
254
  diff: "reset"
255
255
  });
@@ -257,84 +257,84 @@ function It(u) {
257
257
  }
258
258
  if (N.current) {
259
259
  if (e != null) {
260
- const n = f[x.current];
261
- if (i && n && be(r, (s) => E(n, s)) !== -1)
260
+ const n = c[x.current];
261
+ if (i && n && be(o, (s) => E(n, s)) !== -1)
262
262
  return;
263
- const o = be(f, (s) => E(s, e));
264
- o === -1 ? L({
263
+ const r = be(c, (s) => E(s, e));
264
+ r === -1 ? L({
265
265
  diff: "reset"
266
- }) : B({
267
- index: o
266
+ }) : F({
267
+ index: r
268
268
  });
269
269
  return;
270
270
  }
271
- if (x.current >= f.length - 1) {
272
- B({
273
- index: f.length - 1
271
+ if (x.current >= c.length - 1) {
272
+ F({
273
+ index: c.length - 1
274
274
  });
275
275
  return;
276
276
  }
277
- B({
277
+ F({
278
278
  index: x.current
279
279
  });
280
280
  }
281
281
  }, [
282
282
  // Only sync the highlighted index when the option switch between empty and not
283
- f.length,
283
+ c.length,
284
284
  // Don't sync the highlighted index with the value when multiple
285
285
  // eslint-disable-next-line react-hooks/exhaustive-deps
286
- i ? !1 : r,
286
+ i ? !1 : o,
287
287
  ne,
288
288
  L,
289
- B,
290
- w,
289
+ F,
290
+ _,
291
291
  a,
292
292
  i
293
293
  ]), tt = me((t) => {
294
294
  ht(N, t), t && Pe();
295
295
  });
296
296
  process.env.NODE_ENV !== "production" && g.useEffect(() => {
297
- (!d.current || d.current.nodeName !== "INPUT") && (d.current && d.current.nodeName === "TEXTAREA" ? console.warn([`A textarea element was provided to ${m} where input was expected.`, "This is not a supported scenario but it may work under certain conditions.", "A textarea keyboard navigation may conflict with Autocomplete controls (for example enter and arrow keys).", "Make sure to test keyboard navigation and add custom event handlers if necessary."].join(`
298
- `)) : console.error([`MUI: Unable to find the input element. It was resolved to ${d.current} while an HTMLInputElement was expected.`, `Instead, ${m} expects an input element.`, "", m === "useAutocomplete" ? "Make sure you have bound getInputProps correctly and that the normal ref/effect resolutions order is guaranteed." : "Make sure you have customized the input component correctly."].join(`
297
+ (!f.current || f.current.nodeName !== "INPUT") && (f.current && f.current.nodeName === "TEXTAREA" ? console.warn([`A textarea element was provided to ${m} where input was expected.`, "This is not a supported scenario but it may work under certain conditions.", "A textarea keyboard navigation may conflict with Autocomplete controls (for example enter and arrow keys).", "Make sure to test keyboard navigation and add custom event handlers if necessary."].join(`
298
+ `)) : console.error([`MUI: Unable to find the input element. It was resolved to ${f.current} while an HTMLInputElement was expected.`, `Instead, ${m} expects an input element.`, "", m === "useAutocomplete" ? "Make sure you have bound getInputProps correctly and that the normal ref/effect resolutions order is guaranteed." : "Make sure you have customized the input component correctly."].join(`
299
299
  `)));
300
300
  }, [m]), g.useEffect(() => {
301
301
  Pe();
302
302
  }, [Pe]);
303
- const K = (t) => {
304
- z || (ve(!0), Ce(!0), ae && ae(t));
303
+ const q = (t) => {
304
+ J || (ve(!0), Ce(!0), ae && ae(t));
305
305
  }, Q = (t, e) => {
306
- z && (ve(!1), X && X(t, e));
307
- }, J = (t, e, n, o) => {
306
+ J && (ve(!1), le && le(t, e));
307
+ }, Y = (t, e, n, r) => {
308
308
  if (i) {
309
- if (r.length === e.length && r.every((s, l) => s === e[l]))
309
+ if (o.length === e.length && o.every((s, l) => s === e[l]))
310
310
  return;
311
- } else if (r === e)
311
+ } else if (o === e)
312
312
  return;
313
- ie && ie(t, e, n, o), Ge(e);
314
- }, ge = g.useRef(!1), Z = (t, e, n = "selectOption", o = "options") => {
313
+ ie && ie(t, e, n, r), Ge(e);
314
+ }, ge = g.useRef(!1), Z = (t, e, n = "selectOption", r = "options") => {
315
315
  let s = n, l = e;
316
316
  if (i) {
317
- if (l = Array.isArray(r) ? r.slice() : [], process.env.NODE_ENV !== "production") {
317
+ if (l = Array.isArray(o) ? o.slice() : [], process.env.NODE_ENV !== "production") {
318
318
  const O = l.filter((he) => E(e, he));
319
319
  O.length > 1 && console.error([`MUI: The \`isOptionEqualToValue\` method of ${m} does not handle the arguments correctly.`, `The component expects a single value to match a given option but found ${O.length} matches.`].join(`
320
320
  `));
321
321
  }
322
- const p = be(l, (O) => E(e, O));
323
- p === -1 ? l.push(e) : o !== "freeSolo" && (l.splice(p, 1), s = "removeOption");
322
+ const d = be(l, (O) => E(e, O));
323
+ d === -1 ? l.push(e) : r !== "freeSolo" && (l.splice(d, 1), s = "removeOption");
324
324
  }
325
- de(t, l), J(t, l, s, {
325
+ de(t, l), Y(t, l, s, {
326
326
  option: e
327
- }), !Y && (!t || !t.ctrlKey && !t.metaKey) && Q(t, s), (V === !0 || V === "touch" && ge.current || V === "mouse" && !ge.current) && d.current.blur();
327
+ }), !K && (!t || !t.ctrlKey && !t.metaKey) && Q(t, s), (M === !0 || M === "touch" && ge.current || M === "mouse" && !ge.current) && f.current.blur();
328
328
  };
329
329
  function nt(t, e) {
330
330
  if (t === -1)
331
331
  return -1;
332
332
  let n = t;
333
333
  for (; ; ) {
334
- if (e === "next" && n === r.length || e === "previous" && n === -1)
334
+ if (e === "next" && n === o.length || e === "previous" && n === -1)
335
335
  return -1;
336
- const o = ue.querySelector(`[data-tag-index="${n}"]`);
337
- if (!o || !o.hasAttribute("tabindex") || o.disabled || o.getAttribute("aria-disabled") === "true")
336
+ const r = ue.querySelector(`[data-tag-index="${n}"]`);
337
+ if (!r || !r.hasAttribute("tabindex") || r.disabled || r.getAttribute("aria-disabled") === "true")
338
338
  n += e === "next" ? 1 : -1;
339
339
  else
340
340
  return n;
@@ -344,15 +344,15 @@ function It(u) {
344
344
  if (!i)
345
345
  return;
346
346
  a === "" && Q(t, "toggleInput");
347
- let n = S;
348
- S === -1 ? a === "" && e === "previous" && (n = r.length - 1) : (n += e === "next" ? 1 : -1, n < 0 && (n = 0), n === r.length && (n = -1)), n = nt(n, e), Ne(n), pe(n);
347
+ let n = P;
348
+ P === -1 ? a === "" && e === "previous" && (n = o.length - 1) : (n += e === "next" ? 1 : -1, n < 0 && (n = 0), n === o.length && (n = -1)), n = nt(n, e), Se(n), pe(n);
349
349
  }, Me = (t) => {
350
- we.current = !0, ce(""), v && v(t, "", "clear"), J(t, i ? [] : null, "clear");
351
- }, rt = (t) => (e) => {
352
- if (t.onKeyDown && t.onKeyDown(e), !e.defaultMuiPrevented && (S !== -1 && ["ArrowLeft", "ArrowRight"].indexOf(e.key) === -1 && (Ne(-1), pe(-1)), e.which !== 229))
350
+ _e.current = !0, ce(""), v && v(t, "", "clear"), Y(t, i ? [] : null, "clear");
351
+ }, ot = (t) => (e) => {
352
+ if (t.onKeyDown && t.onKeyDown(e), !e.defaultMuiPrevented && (P !== -1 && ["ArrowLeft", "ArrowRight"].indexOf(e.key) === -1 && (Se(-1), pe(-1)), e.which !== 229))
353
353
  switch (e.key) {
354
354
  case "Home":
355
- w && oe && (e.preventDefault(), L({
355
+ _ && re && (e.preventDefault(), L({
356
356
  diff: "start",
357
357
  direction: "next",
358
358
  reason: "keyboard",
@@ -360,7 +360,7 @@ function It(u) {
360
360
  }));
361
361
  break;
362
362
  case "End":
363
- w && oe && (e.preventDefault(), L({
363
+ _ && re && (e.preventDefault(), L({
364
364
  diff: "end",
365
365
  direction: "previous",
366
366
  reason: "keyboard",
@@ -373,7 +373,7 @@ function It(u) {
373
373
  direction: "previous",
374
374
  reason: "keyboard",
375
375
  event: e
376
- }), K(e);
376
+ }), q(e);
377
377
  break;
378
378
  case "PageDown":
379
379
  e.preventDefault(), L({
@@ -381,7 +381,7 @@ function It(u) {
381
381
  direction: "next",
382
382
  reason: "keyboard",
383
383
  event: e
384
- }), K(e);
384
+ }), q(e);
385
385
  break;
386
386
  case "ArrowDown":
387
387
  e.preventDefault(), L({
@@ -389,7 +389,7 @@ function It(u) {
389
389
  direction: "next",
390
390
  reason: "keyboard",
391
391
  event: e
392
- }), K(e);
392
+ }), q(e);
393
393
  break;
394
394
  case "ArrowUp":
395
395
  e.preventDefault(), L({
@@ -397,7 +397,7 @@ function It(u) {
397
397
  direction: "previous",
398
398
  reason: "keyboard",
399
399
  event: e
400
- }), K(e);
400
+ }), q(e);
401
401
  break;
402
402
  case "ArrowLeft":
403
403
  Ve(e, "previous");
@@ -406,124 +406,124 @@ function It(u) {
406
406
  Ve(e, "next");
407
407
  break;
408
408
  case "Enter":
409
- if (x.current !== -1 && w) {
410
- const n = f[x.current], o = U ? U(n) : !1;
411
- if (e.preventDefault(), o)
409
+ if (x.current !== -1 && _) {
410
+ const n = c[x.current], r = j ? j(n) : !1;
411
+ if (e.preventDefault(), r)
412
412
  return;
413
- Z(e, n, "selectOption"), A && d.current.setSelectionRange(d.current.value.length, d.current.value.length);
413
+ Z(e, n, "selectOption"), V && f.current.setSelectionRange(f.current.value.length, f.current.value.length);
414
414
  } else
415
415
  R && a !== "" && Le === !1 && (i && e.preventDefault(), Z(e, a, "createOption", "freeSolo"));
416
416
  break;
417
417
  case "Escape":
418
- w ? (e.preventDefault(), e.stopPropagation(), Q(e, "escape")) : F && (a !== "" || i && r.length > 0) && (e.preventDefault(), e.stopPropagation(), Me(e));
418
+ _ ? (e.preventDefault(), e.stopPropagation(), Q(e, "escape")) : U && (a !== "" || i && o.length > 0) && (e.preventDefault(), e.stopPropagation(), Me(e));
419
419
  break;
420
420
  case "Backspace":
421
- if (i && !G && a === "" && r.length > 0) {
422
- const n = S === -1 ? r.length - 1 : S, o = r.slice();
423
- o.splice(n, 1), J(e, o, "removeOption", {
424
- option: r[n]
421
+ if (i && !G && a === "" && o.length > 0) {
422
+ const n = P === -1 ? o.length - 1 : P, r = o.slice();
423
+ r.splice(n, 1), Y(e, r, "removeOption", {
424
+ option: o[n]
425
425
  });
426
426
  }
427
427
  break;
428
428
  case "Delete":
429
- if (i && !G && a === "" && r.length > 0 && S !== -1) {
430
- const n = S, o = r.slice();
431
- o.splice(n, 1), J(e, o, "removeOption", {
432
- option: r[n]
429
+ if (i && !G && a === "" && o.length > 0 && P !== -1) {
430
+ const n = P, r = o.slice();
431
+ r.splice(n, 1), Y(e, r, "removeOption", {
432
+ option: o[n]
433
433
  });
434
434
  }
435
435
  break;
436
436
  }
437
- }, ot = (t) => {
438
- Ee(!0), T && !we.current && K(t);
437
+ }, rt = (t) => {
438
+ Ee(!0), p && !_e.current && q(t);
439
439
  }, Re = (t) => {
440
440
  if (b(N)) {
441
- d.current.focus();
441
+ f.current.focus();
442
442
  return;
443
443
  }
444
- Ee(!1), ke.current = !0, we.current = !1, H && x.current !== -1 && w ? Z(t, f[x.current], "blur") : H && R && a !== "" ? Z(t, a, "blur", "freeSolo") : M && de(t, r), Q(t, "blur");
444
+ Ee(!1), ke.current = !0, _e.current = !1, $ && x.current !== -1 && _ ? Z(t, c[x.current], "blur") : $ && R && a !== "" ? Z(t, a, "blur", "freeSolo") : D && de(t, o), Q(t, "blur");
445
445
  }, st = (t) => {
446
446
  const e = t.target.value;
447
- a !== e && (ce(e), Ce(!1), v && v(t, e, "input")), e === "" ? !q && !i && J(t, null, "clear") : K(t);
447
+ a !== e && (ce(e), Ce(!1), v && v(t, e, "input")), e === "" ? !H && !i && Y(t, null, "clear") : q(t);
448
448
  }, it = (t) => {
449
449
  const e = Number(t.currentTarget.getAttribute("data-option-index"));
450
- x.current !== e && B({
450
+ x.current !== e && F({
451
451
  event: t,
452
452
  index: e,
453
453
  reason: "mouse"
454
454
  });
455
455
  }, lt = (t) => {
456
- B({
456
+ F({
457
457
  event: t,
458
458
  index: Number(t.currentTarget.getAttribute("data-option-index")),
459
459
  reason: "touch"
460
460
  }), ge.current = !0;
461
461
  }, at = (t) => {
462
462
  const e = Number(t.currentTarget.getAttribute("data-option-index"));
463
- Z(t, f[e], "selectOption"), ge.current = !1;
463
+ Z(t, c[e], "selectOption"), ge.current = !1;
464
464
  }, ut = (t) => (e) => {
465
- const n = r.slice();
466
- n.splice(t, 1), J(e, n, "removeOption", {
467
- option: r[t]
465
+ const n = o.slice();
466
+ n.splice(t, 1), Y(e, n, "removeOption", {
467
+ option: o[t]
468
468
  });
469
469
  }, He = (t) => {
470
- z ? Q(t, "toggleInput") : K(t);
470
+ J ? Q(t, "toggleInput") : q(t);
471
471
  }, ct = (t) => {
472
- t.currentTarget.contains(t.target) && t.target.getAttribute("id") !== k && t.preventDefault();
472
+ t.currentTarget.contains(t.target) && t.target.getAttribute("id") !== S && t.preventDefault();
473
473
  }, ft = (t) => {
474
- t.currentTarget.contains(t.target) && (d.current.focus(), Ye && ke.current && d.current.selectionEnd - d.current.selectionStart === 0 && d.current.select(), ke.current = !1);
474
+ t.currentTarget.contains(t.target) && (f.current.focus(), Ye && ke.current && f.current.selectionEnd - f.current.selectionStart === 0 && f.current.select(), ke.current = !1);
475
475
  }, dt = (t) => {
476
- !_ && (a === "" || !z) && He(t);
476
+ !I && (a === "" || !J) && He(t);
477
477
  };
478
478
  let Te = R && a.length > 0;
479
- Te = Te || (i ? r.length > 0 : r !== null);
480
- let Fe = f;
481
- if (j) {
479
+ Te = Te || (i ? o.length > 0 : o !== null);
480
+ let Fe = c;
481
+ if (z) {
482
482
  const t = /* @__PURE__ */ new Map();
483
483
  let e = !1;
484
- Fe = f.reduce((n, o, s) => {
485
- const l = j(o);
486
- return n.length > 0 && n[n.length - 1].group === l ? n[n.length - 1].options.push(o) : (process.env.NODE_ENV !== "production" && (t.get(l) && !e && (console.warn(`MUI: The options provided combined with the \`groupBy\` method of ${m} returns duplicated headers.`, "You can solve the issue by sorting the options with the output of `groupBy`."), e = !0), t.set(l, !0)), n.push({
484
+ Fe = c.reduce((n, r, s) => {
485
+ const l = z(r);
486
+ return n.length > 0 && n[n.length - 1].group === l ? n[n.length - 1].options.push(r) : (process.env.NODE_ENV !== "production" && (t.get(l) && !e && (console.warn(`MUI: The options provided combined with the \`groupBy\` method of ${m} returns duplicated headers.`, "You can solve the issue by sorting the options with the output of `groupBy`."), e = !0), t.set(l, !0)), n.push({
487
487
  key: s,
488
488
  index: s,
489
489
  group: l,
490
- options: [o]
490
+ options: [r]
491
491
  })), n;
492
492
  }, []);
493
493
  }
494
- return _ && fe && Re(), {
494
+ return I && fe && Re(), {
495
495
  getRootProps: (t = {}) => je({
496
- "aria-owns": Se ? `${k}-listbox` : null
496
+ "aria-owns": Ne ? `${S}-listbox` : null
497
497
  }, t, {
498
- onKeyDown: rt(t),
498
+ onKeyDown: ot(t),
499
499
  onMouseDown: ct,
500
500
  onClick: ft
501
501
  }),
502
502
  getInputLabelProps: () => ({
503
- id: `${k}-label`,
504
- htmlFor: k
503
+ id: `${S}-label`,
504
+ htmlFor: S
505
505
  }),
506
506
  getInputProps: () => ({
507
- id: k,
507
+ id: S,
508
508
  value: a,
509
509
  onBlur: Re,
510
- onFocus: ot,
510
+ onFocus: rt,
511
511
  onChange: st,
512
512
  onMouseDown: dt,
513
513
  // if open then this is handled imperatively so don't let react override
514
514
  // only have an opinion about this when closed
515
- "aria-activedescendant": w ? "" : null,
516
- "aria-autocomplete": A ? "both" : "list",
517
- "aria-controls": Se ? `${k}-listbox` : void 0,
518
- "aria-expanded": Se,
515
+ "aria-activedescendant": _ ? "" : null,
516
+ "aria-autocomplete": V ? "both" : "list",
517
+ "aria-controls": Ne ? `${S}-listbox` : void 0,
518
+ "aria-expanded": Ne,
519
519
  // Disable browser's suggestion that might overlap with the popup.
520
520
  // Handle autocomplete but not autofill.
521
521
  autoComplete: "off",
522
- ref: d,
522
+ ref: f,
523
523
  autoCapitalize: "none",
524
524
  spellCheck: "false",
525
525
  role: "combobox",
526
- disabled: _
526
+ disabled: I
527
527
  }),
528
528
  getClearProps: () => ({
529
529
  tabIndex: -1,
@@ -546,8 +546,8 @@ function It(u) {
546
546
  }),
547
547
  getListboxProps: () => ({
548
548
  role: "listbox",
549
- id: `${k}-listbox`,
550
- "aria-labelledby": `${k}-label`,
549
+ id: `${S}-listbox`,
550
+ "aria-labelledby": `${S}-label`,
551
551
  ref: tt,
552
552
  onMouseDown: (t) => {
553
553
  t.preventDefault();
@@ -558,128 +558,129 @@ function It(u) {
558
558
  option: e
559
559
  }) => {
560
560
  var n;
561
- const o = (i ? r : [r]).some((l) => l != null && E(e, l)), s = U ? U(e) : !1;
561
+ const r = (i ? o : [o]).some((l) => l != null && E(e, l)), s = j ? j(e) : !1;
562
562
  return {
563
- key: (n = W == null ? void 0 : W(e)) != null ? n : y(e),
563
+ key: (n = oe == null ? void 0 : oe(e)) != null ? n : y(e),
564
564
  tabIndex: -1,
565
565
  role: "option",
566
- id: `${k}-option-${t}`,
566
+ id: `${S}-option-${t}`,
567
567
  onMouseMove: it,
568
568
  onClick: at,
569
569
  onTouchStart: lt,
570
570
  "data-option-index": t,
571
571
  "aria-disabled": s,
572
- "aria-selected": o
572
+ "aria-selected": r
573
573
  };
574
574
  },
575
- id: k,
575
+ id: S,
576
576
  inputValue: a,
577
- value: r,
577
+ value: o,
578
578
  dirty: Te,
579
- expanded: w && ue,
580
- popupOpen: w,
581
- focused: fe || S !== -1,
579
+ expanded: _ && ue,
580
+ popupOpen: _,
581
+ focused: fe || P !== -1,
582
582
  anchorEl: ue,
583
583
  setAnchorEl: Xe,
584
- focusedTag: S,
584
+ focusedTag: P,
585
585
  groupedOptions: Fe
586
586
  };
587
587
  }
588
- const _t = "_autocomplete_1k4ph_1", Ae = {
589
- autocomplete: _t,
590
- "autocomplete__dropdown-list": "_autocomplete__dropdown-list_1k4ph_5",
591
- "autocomplete__dropdown-item": "_autocomplete__dropdown-item_1k4ph_15"
588
+ const wt = "_autocomplete_19kw3_1", Ae = {
589
+ autocomplete: wt,
590
+ "autocomplete__dropdown-list": "_autocomplete__dropdown-list_19kw3_4",
591
+ "autocomplete__dropdown-item": "_autocomplete__dropdown-item_19kw3_10"
592
592
  }, vt = ({
593
593
  label: u,
594
594
  type: b,
595
- options: h,
596
- infoMessage: A,
597
- errorMessage: D,
598
- leftIcon: H,
599
- rightIcon: V,
600
- id: M,
601
- disabled: F,
602
- maxLength: m,
603
- onChange: I,
604
- onInputChange: q,
605
- classNameLabel: Y,
606
- classNameInput: _,
607
- classNameErrorMessage: xe,
608
- classNameInfoMessage: te,
609
- "data-testid-label": ye,
610
- "data-testid-input": ne,
611
- "data-testid-infoMessage": R,
612
- "data-testid-errorMessage": U,
595
+ labelKey: h,
596
+ options: V,
597
+ infoMessage: B,
598
+ errorMessage: $,
599
+ leftIcon: M,
600
+ rightIcon: D,
601
+ id: U,
602
+ disabled: m,
603
+ maxLength: k,
604
+ onChange: H,
605
+ onInputChange: K,
606
+ classNameLabel: I,
607
+ classNameInput: xe,
608
+ classNameErrorMessage: te,
609
+ classNameInfoMessage: ye,
610
+ "data-testid-label": ne,
611
+ "data-testid-input": R,
612
+ "data-testid-infoMessage": j,
613
+ "data-testid-errorMessage": oe,
613
614
  ...W
614
615
  }) => {
615
- const re = pt(), j = M || `input_${re}`;
616
- Object.assign(W, { "data-testid": ne });
617
- const [oe, Oe] = Be(), [se, Ie] = Be(""), { getRootProps: E, getInputProps: i, getOptionProps: ie, groupedOptions: X, getListboxProps: le, focused: v, getInputLabelProps: ae } = It({
618
- id: j,
619
- options: h,
620
- getOptionLabel: (c) => typeof c == "string" ? c : c == null ? void 0 : c.label,
621
- value: oe,
622
- inputValue: se,
623
- onChange: (c, T) => {
624
- I && I(c, T), Oe(T);
616
+ const z = pt(), re = U || `input_${z}`;
617
+ Object.assign(W, { "data-testid": R });
618
+ const [Oe, se] = Be(), [Ie, E] = Be(""), { getRootProps: i, getInputProps: ie, getOptionProps: le, groupedOptions: X, getListboxProps: v, focused: ae, getInputLabelProps: we } = It({
619
+ id: re,
620
+ options: V,
621
+ getOptionLabel: (p) => typeof p == "string" ? p : String(p[h || "label"]),
622
+ value: Oe,
623
+ inputValue: Ie,
624
+ onChange: (p, w) => {
625
+ H && H(p, w), se(w);
625
626
  },
626
- onInputChange: (c, T) => {
627
- q && q(c, T), Ie(T);
627
+ onInputChange: (p, w) => {
628
+ K && K(p, w), E(w);
628
629
  }
629
630
  });
630
631
  return /* @__PURE__ */ qe("div", { className: Ae.autocomplete, children: [
631
- u && /* @__PURE__ */ $(
632
- Ue,
632
+ u && /* @__PURE__ */ A(
633
+ Ke,
633
634
  {
634
635
  element: "label",
635
- elementProps: { ...ae() },
636
- className: ee(P.input__label, Y),
637
- "data-testid": ye,
636
+ elementProps: { ...we() },
637
+ className: ee(T.input__label, I),
638
+ "data-testid": ne,
638
639
  children: u
639
640
  }
640
641
  ),
641
- /* @__PURE__ */ $("div", { ...E(), className: v ? "Mui-focused" : "", children: /* @__PURE__ */ $(
642
+ /* @__PURE__ */ A("div", { ...i(), className: ae ? "Mui-focused" : "", children: /* @__PURE__ */ A(
642
643
  gt,
643
644
  {
644
- disabled: F,
645
- error: !!D,
645
+ disabled: m,
646
+ error: !!$,
646
647
  "aria-label": u,
647
648
  slotProps: {
648
- root: (c) => ({
649
- className: ee(P["input__input-el-wrapper"], {
650
- [P["input--disabled"]]: c.disabled,
651
- [P["input--focused"]]: c.focused,
652
- [P["input--error"]]: c.error
649
+ root: (p) => ({
650
+ className: ee(T["input__input-el-wrapper"], {
651
+ [T["input--disabled"]]: p.disabled,
652
+ [T["input--focused"]]: p.focused,
653
+ [T["input--error"]]: p.error
653
654
  })
654
655
  }),
655
656
  input: {
656
- ...i(),
657
- className: ee(P["input__input-el"], _),
658
- maxLength: m,
657
+ ...ie(),
658
+ className: ee(T["input__input-el"], xe),
659
+ maxLength: k,
659
660
  ...W
660
661
  }
661
662
  },
662
- startAdornment: H && /* @__PURE__ */ $("span", { className: P["input__left-icon"], children: H }),
663
- endAdornment: b === "search" ? /* @__PURE__ */ $("span", { className: P["input__right-icon"], children: /* @__PURE__ */ $(Ke, { color: "var(--accent)", icon: "magnifying-glass" }) }) : V && /* @__PURE__ */ $("span", { className: P["input__right-icon"], children: V })
663
+ startAdornment: M && /* @__PURE__ */ A("span", { className: T["input__left-icon"], children: M }),
664
+ endAdornment: b === "search" ? /* @__PURE__ */ A("span", { className: T["input__right-icon"], children: /* @__PURE__ */ A(Ue, { color: "var(--accent)", icon: "magnifying-glass" }) }) : D && /* @__PURE__ */ A("span", { className: T["input__right-icon"], children: D })
664
665
  }
665
666
  ) }),
666
- X.length > 0 && !F && /* @__PURE__ */ $("ul", { ...le(), className: Ae["autocomplete__dropdown-list"], children: X.map((c, T) => /* @__PURE__ */ $(
667
+ X.length > 0 && !m && /* @__PURE__ */ A("ul", { ...v(), className: Ae["autocomplete__dropdown-list"], children: X.map((p, w) => /* @__PURE__ */ A(
667
668
  "li",
668
669
  {
669
- tabIndex: T,
670
+ tabIndex: w,
670
671
  className: Ae["autocomplete__dropdown-item"],
671
- ...ie({ option: c, index: T }),
672
- children: typeof c == "string" ? c : c == null ? void 0 : c.label
672
+ ...le({ option: p, index: w }),
673
+ children: typeof p == "string" ? p : String(p[h || "label"])
673
674
  }
674
675
  )) }),
675
- (D || A) && /* @__PURE__ */ qe(
676
- Ue,
676
+ ($ || B) && /* @__PURE__ */ qe(
677
+ Ke,
677
678
  {
678
- className: D ? ee(P["input__error-message"], xe) : ee(P["input__info-message"], te),
679
- "data-testid": D ? U : R,
679
+ className: $ ? ee(T["input__error-message"], te) : ee(T["input__info-message"], ye),
680
+ "data-testid": $ ? oe : j,
680
681
  children: [
681
- /* @__PURE__ */ $(Ke, { icon: "circle-exclamation" }),
682
- D || A
682
+ /* @__PURE__ */ A(Ue, { icon: "circle-exclamation" }),
683
+ $ || B
683
684
  ]
684
685
  }
685
686
  )
@@ -2,32 +2,7 @@ import { StoryObj } from '@storybook/react';
2
2
 
3
3
  declare const meta: {
4
4
  title: string;
5
- component: <T extends string | (object & {
6
- label: string;
7
- })>({ label, type, options, infoMessage, errorMessage, leftIcon, rightIcon, id, disabled, maxLength, onChange, onInputChange, classNameLabel, classNameInput, classNameErrorMessage, classNameInfoMessage, "data-testid-label": testIdLabel, "data-testid-input": testIdInput, "data-testid-infoMessage": testIdInfoMessage, "data-testid-errorMessage": testIdErrorMessage, ...rest }: Omit<import('react').InputHTMLAttributes<HTMLInputElement>, "onChange"> & {
8
- label?: string | undefined;
9
- options?: T[] | undefined;
10
- onChange?: ((event: import('react').SyntheticEvent<Element, Event>, newValue: T) => void) | undefined;
11
- onInputChange?: ((event: import('react').SyntheticEvent<Element, Event>, newValue: string) => void) | undefined;
12
- infoMessage?: string | undefined;
13
- errorMessage?: string | undefined;
14
- leftIcon?: import('react').ReactNode;
15
- rightIcon?: import('react').ReactNode;
16
- type?: "search" | "text" | "password" | undefined;
17
- hideCharsCounter?: boolean | undefined;
18
- classNameWrapper?: string | undefined;
19
- classNameLabel?: string | undefined;
20
- classNameInput?: string | undefined;
21
- classNameInfoMessage?: string | undefined;
22
- classNameErrorMessage?: string | undefined;
23
- classNameCharsCounter?: string | undefined;
24
- 'data-testid-wrapper'?: string | undefined;
25
- 'data-testid-label'?: string | undefined;
26
- 'data-testid-input'?: string | undefined;
27
- 'data-testid-infoMessage'?: string | undefined;
28
- 'data-testid-errorMessage'?: string | undefined;
29
- 'data-testid-charsCounter'?: string | undefined;
30
- }) => import("react/jsx-runtime").JSX.Element;
5
+ component: <T extends string | object>({ label, type, labelKey, options, infoMessage, errorMessage, leftIcon, rightIcon, id, disabled, maxLength, onChange, onInputChange, classNameLabel, classNameInput, classNameErrorMessage, classNameInfoMessage, "data-testid-label": testIdLabel, "data-testid-input": testIdInput, "data-testid-infoMessage": testIdInfoMessage, "data-testid-errorMessage": testIdErrorMessage, ...rest }: import('./Autocomplete.tsx').AutocompleteProps<T>) => import("react/jsx-runtime").JSX.Element;
31
6
  tags: string[];
32
7
  parameters: {
33
8
  layout: string;
@@ -36,6 +11,7 @@ declare const meta: {
36
11
  export default meta;
37
12
  type Story = StoryObj<typeof meta>;
38
13
  export declare const Simple: Story;
14
+ export declare const WithObjectsOptions: Story;
39
15
  export declare const WithLabel: Story;
40
16
  export declare const WithSearch: Story;
41
17
  export declare const WithPlaceholder: Story;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pismo/marola",
3
3
  "description": "CDX tribe component library",
4
- "version": "1.0.0-beta.20",
4
+ "version": "1.0.0-beta.21",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",
7
7
  "types": "dist/main.d.ts",