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

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.
Files changed (39) hide show
  1. package/dist/{Button-DiLqcAJG.js → Button-BAljjMv3.js} +2 -2
  2. package/dist/{ClickAwayListener-BaJ-OV_7.js → ClickAwayListener-DbEYZpyh.js} +3 -3
  3. package/dist/{Popup-lLWZt2wk.js → Popup-Ck3XlWMq.js} +3 -3
  4. package/dist/{Portal-B_Es6eUL.js → Portal-oY3enyAm.js} +2 -2
  5. package/dist/{Toggle-CRfZgFJp.js → Toggle-Buew6bzm.js} +8 -7
  6. package/dist/assets/Autocomplete.css +1 -1
  7. package/dist/{combineHooksSlotProps-BtBYUV_B.js → combineHooksSlotProps-C-zYvfnF.js} +1 -1
  8. package/dist/components/Autocomplete/Autocomplete.d.ts +10 -42
  9. package/dist/components/Autocomplete/Autocomplete.js +373 -403
  10. package/dist/components/Autocomplete/Autocomplete.stories.d.ts +3 -26
  11. package/dist/components/Button/Button.js +1 -1
  12. package/dist/components/Chip/Chip.js +4 -3
  13. package/dist/components/Dialog/CloseIconButton.js +1 -1
  14. package/dist/components/Dialog/Dialog.js +4 -4
  15. package/dist/components/Dialog/Dialog.stories.d.ts +1 -1
  16. package/dist/components/IconButton/IconButton.js +1 -1
  17. package/dist/components/Input/Input.d.ts +41 -2
  18. package/dist/components/Input/Input.js +500 -100
  19. package/dist/components/Input/Input.stories.d.ts +3 -3
  20. package/dist/components/InputSearch/InputSearch.stories.d.ts +2 -2
  21. package/dist/components/ResultWithChips/ResultWithChips.js +1 -1
  22. package/dist/components/RowItem/RowItem.js +4 -3
  23. package/dist/components/Select/Select.js +5 -5
  24. package/dist/components/Snackbar/Snackbar.js +3 -3
  25. package/dist/components/Tabs/Tab.js +3 -3
  26. package/dist/components/Tabs/TabPanel.js +1 -1
  27. package/dist/components/Tabs/Tabs.js +3 -3
  28. package/dist/components/Toggle/Toggle.js +1 -1
  29. package/dist/components/ToggleGroup/Toggle.js +3 -2
  30. package/dist/components/ToggleGroup/ToggleGroup.js +1 -1
  31. package/dist/components/Tooltip/Tooltip.js +3 -3
  32. package/dist/{index-D3Wj0eid.js → index-bQFToy-I.js} +1 -1
  33. package/dist/main.js +1 -1
  34. package/dist/{ownerDocument-B61GUaFs.js → ownerDocument-YGhwAnr1.js} +1 -1
  35. package/dist/{useButton-Bn3MNH8I.js → useButton-DcihopJG.js} +1 -1
  36. package/dist/{useList-BpJT77u3.js → useList-B9C55YB7.js} +2 -2
  37. package/dist/{useSlotProps-kRhf7Gil.js → useSlotProps-C_I1kEHr.js} +73 -72
  38. package/package.json +1 -1
  39. package/dist/Input.module-ZTRZRcNt.js +0 -405
@@ -1,111 +1,511 @@
1
- import { jsxs as n, jsx as r } from "react/jsx-runtime";
2
- import * as g from "react";
3
- import { useState as V, useId as k } from "react";
4
- import { c as a } from "../../clsx-DB4S2d7J.js";
5
- import { Typography as c } from "../Typography/Typography.js";
6
- import { s as t, I as q } from "../../Input.module-ZTRZRcNt.js";
7
- const D = (s) => /* @__PURE__ */ g.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", "data-waves-icon": "fa/solid/circle-exclamation", fill: "currentColor", color: "currentColor", width: "1em", height: "1em", style: {
1
+ import '../../assets/Input.css';
2
+ import { jsxs as j, jsx as S } from "react/jsx-runtime";
3
+ import * as h from "react";
4
+ import { forwardRef as de, useState as ce, useId as _e } from "react";
5
+ import { c as R } from "../../clsx-DB4S2d7J.js";
6
+ import { Typography as L } from "../Typography/Typography.js";
7
+ import { g as he, a as fe, u as me, f as z, b as f, _ as ye, c as Q, i as ge, P as e, d as be, e as Ce } from "../../useSlotProps-C_I1kEHr.js";
8
+ function we(a) {
9
+ let l = "https://mui.com/production-error/?code=" + a;
10
+ for (let s = 1; s < arguments.length; s += 1)
11
+ l += "&args[]=" + encodeURIComponent(arguments[s]);
12
+ return "Minified MUI error #" + a + "; visit " + l + " for the full message.";
13
+ }
14
+ const X = "Input";
15
+ function ve(a) {
16
+ return he(X, a);
17
+ }
18
+ fe(X, ["root", "formControl", "focused", "disabled", "error", "multiline", "input", "inputMultiline", "inputTypeSearch", "adornedStart", "adornedEnd"]);
19
+ const Z = /* @__PURE__ */ h.createContext(void 0);
20
+ process.env.NODE_ENV !== "production" && (Z.displayName = "FormControlContext");
21
+ function xe() {
22
+ return h.useContext(Z);
23
+ }
24
+ function qe(a = {}) {
25
+ const {
26
+ defaultValue: l,
27
+ disabled: s = !1,
28
+ error: m = !1,
29
+ onBlur: i,
30
+ onChange: y,
31
+ onFocus: q,
32
+ required: N = !1,
33
+ value: b,
34
+ inputRef: k
35
+ } = a, o = xe();
36
+ let P, _, C, w, g;
37
+ if (o) {
38
+ var F, d, I;
39
+ if (P = void 0, _ = (F = o.disabled) != null ? F : !1, C = (d = o.error) != null ? d : !1, w = (I = o.required) != null ? I : !1, g = o.value, process.env.NODE_ENV !== "production") {
40
+ const t = ["defaultValue", "disabled", "error", "required", "value"].filter((n) => a[n] !== void 0);
41
+ t.length > 0 && console.warn(["MUI: You have set props on an input that is inside a FormControl.", "Set these props on a FormControl instead. Otherwise they will be ignored.", `Ignored props: ${t.join(", ")}`].join(`
42
+ `));
43
+ }
44
+ } else
45
+ P = l, _ = s, C = m, w = N, g = b;
46
+ const {
47
+ current: B
48
+ } = h.useRef(g != null), V = h.useCallback((t) => {
49
+ process.env.NODE_ENV !== "production" && t && t.nodeName !== "INPUT" && !t.focus && console.error(["MUI: You have provided a `slots.input` to the input component", "that does not correctly handle the `ref` prop.", "Make sure the `ref` prop is called with a HTMLInputElement."].join(`
50
+ `));
51
+ }, []), v = h.useRef(null), O = me(v, k, V), [x, E] = h.useState(!1);
52
+ h.useEffect(() => {
53
+ !o && _ && x && (E(!1), i == null || i());
54
+ }, [o, _, x, i]);
55
+ const U = (t) => (n) => {
56
+ var r;
57
+ if (o != null && o.disabled) {
58
+ n.stopPropagation();
59
+ return;
60
+ }
61
+ if ((r = t.onFocus) == null || r.call(t, n), o && o.onFocus) {
62
+ var c;
63
+ o == null || (c = o.onFocus) == null || c.call(o);
64
+ } else
65
+ E(!0);
66
+ }, M = (t) => (n) => {
67
+ var r;
68
+ (r = t.onBlur) == null || r.call(t, n), o && o.onBlur ? o.onBlur() : E(!1);
69
+ }, A = (t) => (n, ...r) => {
70
+ var c, D;
71
+ if (!B && (n.target || v.current) == null)
72
+ throw new Error(process.env.NODE_ENV !== "production" ? "MUI: Expected valid input target. Did you use a custom `slots.input` and forget to forward refs? See https://mui.com/r/input-component-ref-interface for more info." : we(17));
73
+ o == null || (c = o.onChange) == null || c.call(o, n), (D = t.onChange) == null || D.call(t, n, ...r);
74
+ }, T = (t) => (n) => {
75
+ var r;
76
+ v.current && n.currentTarget === n.target && v.current.focus(), (r = t.onClick) == null || r.call(t, n);
77
+ };
78
+ return {
79
+ disabled: _,
80
+ error: C,
81
+ focused: x,
82
+ formControlContext: o,
83
+ getInputProps: (t = {}) => {
84
+ const r = f({}, {
85
+ onBlur: i,
86
+ onChange: y,
87
+ onFocus: q
88
+ }, z(t)), c = f({}, r, {
89
+ onBlur: M(r),
90
+ onChange: A(r),
91
+ onFocus: U(r)
92
+ });
93
+ return f({}, c, {
94
+ "aria-invalid": C || void 0,
95
+ defaultValue: P,
96
+ value: g,
97
+ required: w,
98
+ disabled: _
99
+ }, t, {
100
+ ref: O
101
+ }, c);
102
+ },
103
+ getRootProps: (t = {}) => {
104
+ const n = z(a, ["onBlur", "onChange", "onFocus"]), r = f({}, n, z(t));
105
+ return f({}, t, r, {
106
+ onClick: T(r)
107
+ });
108
+ },
109
+ inputRef: O,
110
+ required: w,
111
+ value: g
112
+ };
113
+ }
114
+ const Ne = ["aria-describedby", "aria-label", "aria-labelledby", "autoComplete", "autoFocus", "className", "defaultValue", "disabled", "endAdornment", "error", "id", "multiline", "name", "onClick", "onChange", "onKeyDown", "onKeyUp", "onFocus", "onBlur", "placeholder", "readOnly", "required", "startAdornment", "value", "type", "rows", "slotProps", "slots", "minRows", "maxRows"], Pe = (a) => {
115
+ const {
116
+ disabled: l,
117
+ error: s,
118
+ focused: m,
119
+ formControlContext: i,
120
+ multiline: y,
121
+ startAdornment: q,
122
+ endAdornment: N
123
+ } = a;
124
+ return be({
125
+ root: ["root", l && "disabled", s && "error", m && "focused", !!i && "formControl", y && "multiline", !!q && "adornedStart", !!N && "adornedEnd"],
126
+ input: ["input", l && "disabled", y && "multiline"]
127
+ }, Ce(ve));
128
+ }, ee = /* @__PURE__ */ h.forwardRef(function(l, s) {
129
+ var m, i, y;
130
+ const {
131
+ "aria-describedby": q,
132
+ "aria-label": N,
133
+ "aria-labelledby": b,
134
+ autoComplete: k,
135
+ autoFocus: o,
136
+ className: P,
137
+ defaultValue: _,
138
+ disabled: C,
139
+ endAdornment: w,
140
+ error: g,
141
+ id: F,
142
+ multiline: d = !1,
143
+ name: I,
144
+ onClick: B,
145
+ onChange: V,
146
+ onKeyDown: v,
147
+ onKeyUp: O,
148
+ onFocus: x,
149
+ onBlur: E,
150
+ placeholder: U,
151
+ readOnly: M,
152
+ required: A,
153
+ startAdornment: T,
154
+ value: H,
155
+ type: p,
156
+ rows: t,
157
+ slotProps: n = {},
158
+ slots: r = {},
159
+ minRows: c,
160
+ maxRows: D
161
+ } = l, Y = ye(l, Ne), {
162
+ getRootProps: te,
163
+ getInputProps: oe,
164
+ focused: ne,
165
+ formControlContext: re,
166
+ error: ae,
167
+ disabled: se
168
+ } = qe({
169
+ disabled: C,
170
+ defaultValue: _,
171
+ error: g,
172
+ onBlur: E,
173
+ onClick: B,
174
+ onChange: V,
175
+ onFocus: x,
176
+ required: A,
177
+ value: H
178
+ }), W = d ? void 0 : p ?? "text", $ = f({}, l, {
179
+ disabled: se,
180
+ error: ae,
181
+ focused: ne,
182
+ formControlContext: re,
183
+ multiline: d,
184
+ type: W
185
+ }), G = Pe($), le = {
186
+ "aria-describedby": q,
187
+ "aria-label": N,
188
+ "aria-labelledby": b,
189
+ autoComplete: k,
190
+ autoFocus: o,
191
+ id: F,
192
+ onKeyDown: v,
193
+ onKeyUp: O,
194
+ name: I,
195
+ placeholder: U,
196
+ readOnly: M,
197
+ type: W
198
+ }, J = (m = r.root) != null ? m : "div", ue = Q({
199
+ elementType: J,
200
+ getSlotProps: te,
201
+ externalSlotProps: n.root,
202
+ externalForwardedProps: Y,
203
+ additionalProps: {
204
+ ref: s
205
+ },
206
+ ownerState: $,
207
+ className: [G.root, P]
208
+ }), K = d ? (i = r.textarea) != null ? i : "textarea" : (y = r.input) != null ? y : "input", ie = Q({
209
+ elementType: K,
210
+ getSlotProps: (pe) => oe(f({}, le, pe)),
211
+ externalSlotProps: n.input,
212
+ additionalProps: f({
213
+ rows: d ? t : void 0
214
+ }, d && !ge(K) && {
215
+ minRows: t || c,
216
+ maxRows: t || D
217
+ }),
218
+ ownerState: $,
219
+ className: G.input
220
+ });
221
+ return process.env.NODE_ENV !== "production" && d && t && (c || D) && console.warn("MUI: You can not use the `minRows` or `maxRows` props when the input `rows` prop is set."), /* @__PURE__ */ j(J, f({}, ue, {
222
+ children: [T, /* @__PURE__ */ S(K, f({}, ie)), w]
223
+ }));
224
+ });
225
+ process.env.NODE_ENV !== "production" && (ee.propTypes = {
226
+ // ┌────────────────────────────── Warning ──────────────────────────────┐
227
+ // │ These PropTypes are generated from the TypeScript type definitions. │
228
+ // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
229
+ // └─────────────────────────────────────────────────────────────────────┘
230
+ /**
231
+ * @ignore
232
+ */
233
+ "aria-describedby": e.string,
234
+ /**
235
+ * @ignore
236
+ */
237
+ "aria-label": e.string,
238
+ /**
239
+ * @ignore
240
+ */
241
+ "aria-labelledby": e.string,
242
+ /**
243
+ * This prop helps users to fill forms faster, especially on mobile devices.
244
+ * The name can be confusing, as it's more like an autofill.
245
+ * You can learn more about it [following the specification](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill).
246
+ */
247
+ autoComplete: e.string,
248
+ /**
249
+ * If `true`, the `input` element is focused during the first mount.
250
+ */
251
+ autoFocus: e.bool,
252
+ /**
253
+ * Class name applied to the root element.
254
+ */
255
+ className: e.string,
256
+ /**
257
+ * The default value. Use when the component is not controlled.
258
+ */
259
+ defaultValue: e.any,
260
+ /**
261
+ * If `true`, the component is disabled.
262
+ * The prop defaults to the value (`false`) inherited from the parent FormControl component.
263
+ */
264
+ disabled: e.bool,
265
+ /**
266
+ * Trailing adornment for this input.
267
+ */
268
+ endAdornment: e.node,
269
+ /**
270
+ * If `true`, the `input` will indicate an error by setting the `aria-invalid` attribute on the input and the `baseui--error` class on the root element.
271
+ * The prop defaults to the value (`false`) inherited from the parent FormControl component.
272
+ */
273
+ error: e.bool,
274
+ /**
275
+ * The id of the `input` element.
276
+ */
277
+ id: e.string,
278
+ /**
279
+ * @ignore
280
+ */
281
+ inputRef: e.oneOfType([e.func, e.shape({
282
+ current: e.object
283
+ })]),
284
+ /**
285
+ * Maximum number of rows to display when multiline option is set to true.
286
+ */
287
+ maxRows: e.number,
288
+ /**
289
+ * Minimum number of rows to display when multiline option is set to true.
290
+ */
291
+ minRows: e.number,
292
+ /**
293
+ * If `true`, a `textarea` element is rendered.
294
+ * @default false
295
+ */
296
+ multiline: e.bool,
297
+ /**
298
+ * Name attribute of the `input` element.
299
+ */
300
+ name: e.string,
301
+ /**
302
+ * @ignore
303
+ */
304
+ onBlur: e.func,
305
+ /**
306
+ * @ignore
307
+ */
308
+ onChange: e.func,
309
+ /**
310
+ * @ignore
311
+ */
312
+ onClick: e.func,
313
+ /**
314
+ * @ignore
315
+ */
316
+ onFocus: e.func,
317
+ /**
318
+ * @ignore
319
+ */
320
+ onKeyDown: e.func,
321
+ /**
322
+ * @ignore
323
+ */
324
+ onKeyUp: e.func,
325
+ /**
326
+ * The short hint displayed in the `input` before the user enters a value.
327
+ */
328
+ placeholder: e.string,
329
+ /**
330
+ * It prevents the user from changing the value of the field
331
+ * (not from interacting with the field).
332
+ */
333
+ readOnly: e.bool,
334
+ /**
335
+ * If `true`, the `input` element is required.
336
+ * The prop defaults to the value (`false`) inherited from the parent FormControl component.
337
+ */
338
+ required: e.bool,
339
+ /**
340
+ * Number of rows to display when multiline option is set to true.
341
+ */
342
+ rows: e.number,
343
+ /**
344
+ * The props used for each slot inside the Input.
345
+ * @default {}
346
+ */
347
+ slotProps: e.shape({
348
+ input: e.oneOfType([e.func, e.object]),
349
+ root: e.oneOfType([e.func, e.object])
350
+ }),
351
+ /**
352
+ * The components used for each slot inside the InputBase.
353
+ * Either a string to use a HTML element or a component.
354
+ * @default {}
355
+ */
356
+ slots: e.shape({
357
+ input: e.elementType,
358
+ root: e.elementType,
359
+ textarea: e.elementType
360
+ }),
361
+ /**
362
+ * Leading adornment for this input.
363
+ */
364
+ startAdornment: e.node,
365
+ /**
366
+ * Type of the `input` element. It should be [a valid HTML5 input type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types).
367
+ * @default 'text'
368
+ */
369
+ type: e.oneOf(["button", "checkbox", "color", "date", "datetime-local", "email", "file", "hidden", "image", "month", "number", "password", "radio", "range", "reset", "search", "submit", "tel", "text", "time", "url", "week"]),
370
+ /**
371
+ * The value of the `input` element, required for a controlled component.
372
+ */
373
+ value: e.any
374
+ });
375
+ const Ee = (a) => /* @__PURE__ */ h.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", "data-waves-icon": "fa/solid/circle-exclamation", fill: "currentColor", color: "currentColor", width: "1em", height: "1em", style: {
8
376
  fill: "currentcolor",
9
377
  color: "currentcolor",
10
378
  width: "1em",
11
379
  height: "1em"
12
- }, ...s }, /* @__PURE__ */ g.createElement("path", { d: "M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256s256-114.6 256-256S397.4 0 256 0zM232 152C232 138.8 242.8 128 256 128s24 10.75 24 24v128c0 13.25-10.75 24-24 24S232 293.3 232 280V152zM256 400c-17.36 0-31.44-14.08-31.44-31.44c0-17.36 14.07-31.44 31.44-31.44s31.44 14.08 31.44 31.44C287.4 385.9 273.4 400 256 400z" })), M = ({
13
- label: s,
14
- infoMessage: d,
15
- errorMessage: i,
16
- leftIcon: o,
17
- rightIcon: p,
18
- id: w,
19
- disabled: C,
20
- type: N = "text",
21
- maxLength: l,
22
- hideCharsCounter: x = !1,
23
- onChange: m,
24
- classNameWrapper: b,
25
- classNameLabel: v,
26
- classNameInput: y,
27
- classNameInfoMessage: I,
28
- classNameErrorMessage: j,
29
- classNameCharsCounter: z,
30
- "data-testid-wrapper": E,
31
- "data-testid-label": A,
32
- "data-testid-input": P,
33
- "data-testid-infoMessage": S,
34
- "data-testid-errorMessage": $,
35
- "data-testid-charsCounter": B,
36
- ...u
37
- }) => {
38
- const [F, O] = V(0), R = k(), h = w || `input_${R}`;
39
- Object.assign(u, { "data-testid": P });
40
- const T = (e) => {
41
- var _, f;
42
- O((f = (_ = e == null ? void 0 : e.target) == null ? void 0 : _.value) == null ? void 0 : f.length), m && m(e);
43
- };
44
- return /* @__PURE__ */ n("div", { className: a(t.input, b), "data-testid": E, children: [
45
- s && /* @__PURE__ */ r(
46
- c,
47
- {
48
- element: "label",
49
- elementProps: { htmlFor: h },
50
- className: a(t.input__label, v),
51
- "data-testid": A,
52
- children: s
53
- }
54
- ),
55
- /* @__PURE__ */ r(
56
- q,
57
- {
58
- id: h,
59
- type: N,
60
- disabled: C,
61
- error: !!i,
62
- "aria-label": s,
63
- slotProps: {
64
- root: (e) => ({
65
- className: a(t["input__input-el-wrapper"], {
66
- [t["input--disabled"]]: e.disabled,
67
- [t["input--focused"]]: e.focused,
68
- [t["input--error"]]: e.error
69
- })
70
- }),
71
- input: {
72
- className: a(t["input__input-el"], y),
73
- maxLength: l,
74
- onChange: T,
75
- ...u
76
- }
77
- },
78
- startAdornment: o && /* @__PURE__ */ r("span", { className: t["input__left-icon"], children: o }),
79
- endAdornment: p && /* @__PURE__ */ r("span", { className: t["input__right-icon"], children: p })
80
- }
81
- ),
82
- /* @__PURE__ */ n("div", { className: t["input__messages-wrapper"], children: [
83
- (i || d) && /* @__PURE__ */ n(
84
- c,
380
+ }, ...a }, /* @__PURE__ */ h.createElement("path", { d: "M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256s256-114.6 256-256S397.4 0 256 0zM232 152C232 138.8 242.8 128 256 128s24 10.75 24 24v128c0 13.25-10.75 24-24 24S232 293.3 232 280V152zM256 400c-17.36 0-31.44-14.08-31.44-31.44c0-17.36 14.07-31.44 31.44-31.44s31.44 14.08 31.44 31.44C287.4 385.9 273.4 400 256 400z" })), Re = "_input__label_1lq2e_78", Fe = "_input_1lq2e_57", u = {
381
+ "u-typography-h1": "_u-typography-h1_1lq2e_1",
382
+ "u-typography-h2": "_u-typography-h2_1lq2e_8",
383
+ "u-typography-h3": "_u-typography-h3_1lq2e_15",
384
+ "u-typography-h4": "_u-typography-h4_1lq2e_22",
385
+ "u-typography-h5": "_u-typography-h5_1lq2e_29",
386
+ "u-typography-h6": "_u-typography-h6_1lq2e_36",
387
+ "u-typography-base": "_u-typography-base_1lq2e_43",
388
+ "u-typography-base--xxl": "_u-typography-base--xxl_1lq2e_49",
389
+ "u-typography-base--xl": "_u-typography-base--xl_1lq2e_53",
390
+ "u-typography-base--lg": "_u-typography-base--lg_1lq2e_57",
391
+ "input__input-el": "_input__input-el_1lq2e_57",
392
+ "u-typography-base--sm": "_u-typography-base--sm_1lq2e_61",
393
+ "u-typography-base--bold": "_u-typography-base--bold_1lq2e_65",
394
+ "u-typography-base--strikethrough": "_u-typography-base--strikethrough_1lq2e_68",
395
+ "u-typography-base--underlined": "_u-typography-base--underlined_1lq2e_71",
396
+ "u-typography-base--strikethrough-underlined": "_u-typography-base--strikethrough-underlined_1lq2e_74",
397
+ input__label: Re,
398
+ "input__input-el-wrapper": "_input__input-el-wrapper_1lq2e_83",
399
+ "input__left-icon": "_input__left-icon_1lq2e_101",
400
+ "input__right-icon": "_input__right-icon_1lq2e_101",
401
+ "input__messages-wrapper": "_input__messages-wrapper_1lq2e_113",
402
+ "input__info-message": "_input__info-message_1lq2e_121",
403
+ "input__error-message": "_input__error-message_1lq2e_121",
404
+ "input__chars-counter": "_input__chars-counter_1lq2e_132",
405
+ "input--disabled": "_input--disabled_1lq2e_136",
406
+ input: Fe,
407
+ "input--focused": "_input--focused_1lq2e_142",
408
+ "input--error": "_input--error_1lq2e_145"
409
+ }, Be = de(
410
+ ({
411
+ label: a,
412
+ infoMessage: l,
413
+ errorMessage: s,
414
+ leftIcon: m,
415
+ rightIcon: i,
416
+ id: y,
417
+ disabled: q,
418
+ type: N = "text",
419
+ maxLength: b,
420
+ hideCharsCounter: k = !1,
421
+ onChange: o,
422
+ classNameWrapper: P,
423
+ classNameLabel: _,
424
+ classNameInput: C,
425
+ classNameInfoMessage: w,
426
+ classNameErrorMessage: g,
427
+ classNameCharsCounter: F,
428
+ "data-testid-wrapper": d,
429
+ "data-testid-label": I,
430
+ "data-testid-input": B,
431
+ "data-testid-infoMessage": V,
432
+ "data-testid-errorMessage": v,
433
+ "data-testid-charsCounter": O,
434
+ ...x
435
+ }, E) => {
436
+ const [U, M] = ce(0), A = _e(), T = y || `input_${A}`;
437
+ Object.assign(x, { "data-testid": B });
438
+ const H = (p) => {
439
+ var t, n;
440
+ M((n = (t = p == null ? void 0 : p.target) == null ? void 0 : t.value) == null ? void 0 : n.length), o && o(p);
441
+ };
442
+ return /* @__PURE__ */ j("div", { className: R(u.input, P), "data-testid": d, children: [
443
+ a && /* @__PURE__ */ S(
444
+ L,
85
445
  {
86
- className: i ? a(t["input__error-message"], j) : a(t["input__info-message"], I),
87
- "data-testid": i ? $ : S,
88
- children: [
89
- /* @__PURE__ */ r(D, {}),
90
- i || d
91
- ]
446
+ element: "label",
447
+ elementProps: { htmlFor: T },
448
+ className: R(u.input__label, _),
449
+ "data-testid": I,
450
+ children: a
92
451
  }
93
452
  ),
94
- l && !x && /* @__PURE__ */ n(
95
- c,
453
+ /* @__PURE__ */ S(
454
+ ee,
96
455
  {
97
- className: a(t["input__chars-counter"], z),
98
- "data-testid": B,
99
- children: [
100
- F,
101
- " / ",
102
- l
103
- ]
456
+ id: T,
457
+ type: N,
458
+ disabled: q,
459
+ error: !!s,
460
+ "aria-label": a,
461
+ slotProps: {
462
+ root: (p) => ({
463
+ className: R(u["input__input-el-wrapper"], {
464
+ [u["input--disabled"]]: p.disabled,
465
+ [u["input--focused"]]: p.focused,
466
+ [u["input--error"]]: p.error
467
+ })
468
+ }),
469
+ input: {
470
+ ref: E,
471
+ className: R(u["input__input-el"], C),
472
+ maxLength: b,
473
+ onChange: H,
474
+ ...x
475
+ }
476
+ },
477
+ startAdornment: m && /* @__PURE__ */ S("span", { className: u["input__left-icon"], children: m }),
478
+ endAdornment: i && /* @__PURE__ */ S("span", { className: u["input__right-icon"], children: i })
104
479
  }
105
- )
106
- ] })
107
- ] });
108
- };
480
+ ),
481
+ /* @__PURE__ */ j("div", { className: u["input__messages-wrapper"], children: [
482
+ (s || l) && /* @__PURE__ */ j(
483
+ L,
484
+ {
485
+ className: s ? R(u["input__error-message"], g) : R(u["input__info-message"], w),
486
+ "data-testid": s ? v : V,
487
+ children: [
488
+ /* @__PURE__ */ S(Ee, {}),
489
+ s || l
490
+ ]
491
+ }
492
+ ),
493
+ b && !k && /* @__PURE__ */ j(
494
+ L,
495
+ {
496
+ className: R(u["input__chars-counter"], F),
497
+ "data-testid": O,
498
+ children: [
499
+ U,
500
+ " / ",
501
+ b
502
+ ]
503
+ }
504
+ )
505
+ ] })
506
+ ] });
507
+ }
508
+ );
109
509
  export {
110
- M as Input
510
+ Be as Input
111
511
  };
@@ -2,13 +2,13 @@ import { StoryObj } from '@storybook/react';
2
2
 
3
3
  declare const meta: {
4
4
  title: string;
5
- component: ({ label, infoMessage, errorMessage, leftIcon, rightIcon, id, disabled, type, maxLength, hideCharsCounter, onChange, classNameWrapper, classNameLabel, classNameInput, classNameInfoMessage, classNameErrorMessage, classNameCharsCounter, "data-testid-wrapper": testIdWrapper, "data-testid-label": testIdLabel, "data-testid-input": testIdInput, "data-testid-infoMessage": testIdInfoMessage, "data-testid-errorMessage": testIdErrorMessage, "data-testid-charsCounter": testIdCharsCounter, ...rest }: import('react').InputHTMLAttributes<HTMLInputElement> & {
5
+ component: import('react').ForwardRefExoticComponent<import('react').InputHTMLAttributes<HTMLInputElement> & {
6
6
  label?: string | undefined;
7
7
  infoMessage?: string | undefined;
8
8
  errorMessage?: string | undefined;
9
9
  leftIcon?: import('react').ReactNode;
10
10
  rightIcon?: import('react').ReactNode;
11
- type?: ("number" | "url" | "file" | "color" | "search" | (string & {}) | "button" | "time" | "image" | "text" | "reset" | "tel" | "email" | "date" | "hidden" | "range" | "password" | "datetime-local" | "month" | "week") | undefined;
11
+ type?: ("number" | "url" | "file" | "color" | "search" | (string & {}) | "button" | "time" | "image" | "text" | "reset" | "tel" | "email" | "date" | "hidden" | "range" | "datetime-local" | "month" | "password" | "week") | undefined;
12
12
  hideCharsCounter?: boolean | undefined;
13
13
  classNameWrapper?: string | undefined;
14
14
  classNameLabel?: string | undefined;
@@ -22,7 +22,7 @@ declare const meta: {
22
22
  'data-testid-infoMessage'?: string | undefined;
23
23
  'data-testid-errorMessage'?: string | undefined;
24
24
  'data-testid-charsCounter'?: string | undefined;
25
- }) => import("react/jsx-runtime").JSX.Element;
25
+ } & import('react').RefAttributes<HTMLInputElement>>;
26
26
  tags: string[];
27
27
  parameters: {
28
28
  layout: string;
@@ -10,7 +10,7 @@ declare const meta: {
10
10
  errorMessage?: string | undefined;
11
11
  leftIcon?: import('react').ReactNode;
12
12
  rightIcon?: import('react').ReactNode;
13
- type?: ("number" | "url" | "file" | "color" | "search" | (string & {}) | "button" | "time" | "image" | "text" | "reset" | "tel" | "email" | "date" | "hidden" | "range" | "password" | "datetime-local" | "month" | "week") | undefined;
13
+ type?: ("number" | "url" | "file" | "color" | "search" | (string & {}) | "button" | "time" | "image" | "text" | "reset" | "tel" | "email" | "date" | "hidden" | "range" | "datetime-local" | "month" | "password" | "week") | undefined;
14
14
  hideCharsCounter?: boolean | undefined;
15
15
  classNameWrapper?: string | undefined;
16
16
  classNameLabel?: string | undefined;
@@ -24,7 +24,7 @@ declare const meta: {
24
24
  'data-testid-infoMessage'?: string | undefined;
25
25
  'data-testid-errorMessage'?: string | undefined;
26
26
  'data-testid-charsCounter'?: string | undefined;
27
- }) => import("react/jsx-runtime").JSX.Element;
27
+ } & import('react').RefAttributes<HTMLInputElement>) => import("react/jsx-runtime").JSX.Element;
28
28
  tags: string[];
29
29
  parameters: {
30
30
  layout: string;
@@ -1,6 +1,6 @@
1
1
  import '../../assets/ResultWithChips.css';
2
2
  import { jsxs as i, jsx as e } from "react/jsx-runtime";
3
- import { C as t } from "../../Toggle-CRfZgFJp.js";
3
+ import { C as t } from "../../Toggle-Buew6bzm.js";
4
4
  const r = "_container_hgp0p_1", o = "_label_hgp0p_17", a = {
5
5
  container: r,
6
6
  "chip-item-wrapper": "_chip-item-wrapper_hgp0p_8",