@pismo/marola 1.0.0-beta.9 → 1.0.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.
Files changed (157) 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/Dialog.module-W7UCXlf3.js +29 -0
  4. package/dist/Group-DspH8hyO.js +30 -0
  5. package/dist/Popover.module-B4boCutS.js +10 -0
  6. package/dist/{Popup-lLWZt2wk.js → Popup-Ck3XlWMq.js} +3 -3
  7. package/dist/{Portal-B_Es6eUL.js → Portal-oY3enyAm.js} +2 -2
  8. package/dist/SelectButton-B38avP9u.js +75 -0
  9. package/dist/{Tabs.module-jkH1Qjn7.js → Tabs.module-BGGTkDc5.js} +7 -7
  10. package/dist/Toggle-MfR7l8Wn.js +190 -0
  11. package/dist/assets/Alert.css +1 -0
  12. package/dist/assets/Autocomplete.css +1 -1
  13. package/dist/assets/Avatar.css +1 -0
  14. package/dist/assets/Description.css +1 -0
  15. package/dist/assets/Dialog.css +1 -1
  16. package/dist/assets/EllipsisTooltip.css +1 -1
  17. package/dist/assets/Group.css +1 -1
  18. package/dist/assets/Input.css +1 -1
  19. package/dist/assets/PageHeader.css +1 -1
  20. package/dist/assets/Popover.css +1 -0
  21. package/dist/assets/RadioButton.css +1 -0
  22. package/dist/assets/ResultWithChips.css +1 -0
  23. package/dist/assets/SelectButton.css +1 -1
  24. package/dist/assets/Skeleton.css +1 -1
  25. package/dist/assets/Snackbar.css +1 -1
  26. package/dist/assets/StepperNavigator.css +1 -0
  27. package/dist/assets/Table.css +1 -1
  28. package/dist/assets/Tabs.css +1 -1
  29. package/dist/assets/Toggle2.css +1 -1
  30. package/dist/{combineHooksSlotProps-BtBYUV_B.js → combineHooksSlotProps-C-zYvfnF.js} +1 -1
  31. package/dist/components/Adornment/Adornment.d.ts +11 -2
  32. package/dist/components/Adornment/Adornment.js +6 -6
  33. package/dist/components/Adornment/Adornment.stories.d.ts +14 -0
  34. package/dist/components/Adornment/adornment.test.d.ts +1 -0
  35. package/dist/components/Advice/Advice.d.ts +2 -2
  36. package/dist/components/Alert/Alert.d.ts +11 -0
  37. package/dist/components/Alert/Alert.js +46 -0
  38. package/dist/components/Alert/Alert.stories.d.ts +24 -0
  39. package/dist/components/Alert/Alert.test.d.ts +1 -0
  40. package/dist/components/Autocomplete/Autocomplete.d.ts +12 -42
  41. package/dist/components/Autocomplete/Autocomplete.js +422 -432
  42. package/dist/components/Autocomplete/Autocomplete.stories.d.ts +3 -25
  43. package/dist/components/Avatar/Avatar.d.ts +15 -0
  44. package/dist/components/Avatar/Avatar.js +51 -0
  45. package/dist/components/Avatar/Avatar.stories.d.ts +25 -0
  46. package/dist/components/Button/Button.d.ts +2 -0
  47. package/dist/components/Button/Button.js +23 -21
  48. package/dist/components/Chip/Chip.d.ts +6 -4
  49. package/dist/components/Chip/Chip.js +10 -6
  50. package/dist/components/Chip/Chip.stories.d.ts +5 -14
  51. package/dist/components/ConfirmationDialog/ConfirmationDialog.d.ts +14 -0
  52. package/dist/components/ConfirmationDialog/ConfirmationDialog.js +37 -0
  53. package/dist/components/ConfirmationDialog/ConfirmationDialog.stories.d.ts +23 -0
  54. package/dist/components/ConfirmationDialog/ConfirmationModal.test.d.ts +1 -0
  55. package/dist/components/Description/Description.d.ts +21 -0
  56. package/dist/components/Description/Description.js +66 -0
  57. package/dist/components/Description/Description.stories.d.ts +22 -0
  58. package/dist/components/Description/Description.test.d.ts +1 -0
  59. package/dist/components/Dialog/Actions.js +1 -1
  60. package/dist/components/Dialog/Backdrop.d.ts +3 -3
  61. package/dist/components/Dialog/Backdrop.js +8 -7
  62. package/dist/components/Dialog/CloseIconButton.d.ts +1 -2
  63. package/dist/components/Dialog/CloseIconButton.js +15 -18
  64. package/dist/components/Dialog/Dialog.d.ts +16 -10
  65. package/dist/components/Dialog/Dialog.js +167 -167
  66. package/dist/components/Dialog/Dialog.stories.d.ts +73 -67
  67. package/dist/components/Dialog/DialogTitle.d.ts +5 -2
  68. package/dist/components/Dialog/DialogTitle.js +22 -16
  69. package/dist/components/EllipsisTooltip/EllipsisTooltip.js +30 -17
  70. package/dist/components/EllipsisTooltip/EllipsisTooltip.stories.d.ts +1 -0
  71. package/dist/components/Icon/Icon.js +331 -51
  72. package/dist/components/Icon/types.d.ts +1 -1
  73. package/dist/components/IconButton/IconButton.js +1 -1
  74. package/dist/components/Input/Input.d.ts +26 -5
  75. package/dist/components/Input/Input.js +514 -102
  76. package/dist/components/Input/Input.stories.d.ts +2 -21
  77. package/dist/components/InputSearch/InputSearch.d.ts +37 -7
  78. package/dist/components/InputSearch/InputSearch.js +27 -29
  79. package/dist/components/InputSearch/InputSearch.stories.d.ts +15 -3
  80. package/dist/components/PageHeader/PageHeader.d.ts +6 -2
  81. package/dist/components/PageHeader/PageHeader.js +77 -70
  82. package/dist/components/PageHeader/PageHeader.stories.d.ts +3 -1
  83. package/dist/components/PageHeader/PageHeader.test.d.ts +1 -0
  84. package/dist/components/Pagination/Pagination.d.ts +5 -1
  85. package/dist/components/Pagination/Pagination.js +45 -46
  86. package/dist/components/Pagination/Pagination.stories.d.ts +1 -1
  87. package/dist/components/Popover/Popover.d.ts +32 -0
  88. package/dist/components/Popover/Popover.js +24 -0
  89. package/dist/components/Popover/Popover.stories.d.ts +34 -0
  90. package/dist/components/Popover/PopoverBody.d.ts +6 -0
  91. package/dist/components/Popover/PopoverBody.js +6 -0
  92. package/dist/components/Popover/PopoverFooter.d.ts +6 -0
  93. package/dist/components/Popover/PopoverFooter.js +6 -0
  94. package/dist/components/Popover/PopoverHeader.d.ts +6 -0
  95. package/dist/components/Popover/PopoverHeader.js +6 -0
  96. package/dist/components/RadioButton/RadioButton.d.ts +19 -0
  97. package/dist/components/RadioButton/RadioButton.js +37 -0
  98. package/dist/components/RadioButton/RadioButton.stories.d.ts +24 -0
  99. package/dist/components/RadioButton/RadioButton.test.d.ts +1 -0
  100. package/dist/components/ResultWithChips/ResultWithChips.d.ts +12 -0
  101. package/dist/components/ResultWithChips/ResultWithChips.js +33 -0
  102. package/dist/components/RowItem/RowItem.d.ts +2 -2
  103. package/dist/components/RowItem/RowItem.js +9 -5
  104. package/dist/components/RowItem/RowItem.stories.d.ts +17 -0
  105. package/dist/components/RowItem/rowItem.test.d.ts +1 -0
  106. package/dist/components/Select/Select.d.ts +22 -0
  107. package/dist/components/Select/Select.js +476 -414
  108. package/dist/components/Select/SelectButton.d.ts +2 -0
  109. package/dist/components/Select/SelectButton.js +3 -2
  110. package/dist/components/Skeleton/Skeleton.d.ts +3 -1
  111. package/dist/components/Skeleton/Skeleton.js +20 -14
  112. package/dist/components/Skeleton/SkeletonTable.stories.d.ts +1 -1
  113. package/dist/components/Snackbar/Snackbar.js +119 -134
  114. package/dist/components/StepperNavigator/StepperNavigator.d.ts +58 -0
  115. package/dist/components/StepperNavigator/StepperNavigator.js +115 -0
  116. package/dist/components/StepperNavigator/StepperNavigator.stories.d.ts +18 -0
  117. package/dist/components/StepperNavigator/StepperNavigator.test.d.ts +1 -0
  118. package/dist/components/Table/Table.d.ts +3 -1
  119. package/dist/components/Table/Table.js +89 -101
  120. package/dist/components/Table/Table.stories.d.ts +1 -1
  121. package/dist/components/Tabs/Tab.d.ts +5 -3
  122. package/dist/components/Tabs/Tab.js +36 -35
  123. package/dist/components/Tabs/TabPanel.d.ts +4 -2
  124. package/dist/components/Tabs/TabPanel.js +48 -38
  125. package/dist/components/Tabs/Tabs.d.ts +6 -4
  126. package/dist/components/Tabs/Tabs.js +115 -112
  127. package/dist/components/TextDisplay/TextDisplay.d.ts +7 -3
  128. package/dist/components/TextDisplay/TextDisplay.js +44 -37
  129. package/dist/components/TextDisplay/TextDisplay.stories.d.ts +2 -1
  130. package/dist/components/Toggle/Toggle.js +1 -1
  131. package/dist/components/ToggleGroup/Group.d.ts +2 -0
  132. package/dist/components/ToggleGroup/Group.js +4 -2
  133. package/dist/components/ToggleGroup/Toggle.d.ts +2 -0
  134. package/dist/components/ToggleGroup/Toggle.js +8 -4
  135. package/dist/components/ToggleGroup/ToggleGroup.js +2 -2
  136. package/dist/components/ToggleGroup/ToggleGroup.stories.d.ts +2 -0
  137. package/dist/components/Tooltip/Tooltip.d.ts +3 -1
  138. package/dist/components/Tooltip/Tooltip.js +4 -4
  139. package/dist/components/Tooltip/Tooltip.stories.d.ts +1 -0
  140. package/dist/contexts/SnackbarProvider/SnackbarProvider.d.ts +2 -2
  141. package/dist/contexts/SnackbarProvider/SnackbarProvider.js +35 -30
  142. package/dist/contexts/SnackbarProvider/SnackbarProvider.stories.d.ts +1 -1
  143. package/dist/{index-D3Wj0eid.js → index-bQFToy-I.js} +1 -1
  144. package/dist/main.d.ts +8 -0
  145. package/dist/main.js +95 -79
  146. package/dist/marola.css +1 -1
  147. package/dist/{ownerDocument-B61GUaFs.js → ownerDocument-YGhwAnr1.js} +1 -1
  148. package/dist/test-utils/assertStyles.d.ts +1 -1
  149. package/dist/{useButton-Bn3MNH8I.js → useButton-DcihopJG.js} +1 -1
  150. package/dist/{useList-BpJT77u3.js → useList-B9C55YB7.js} +2 -2
  151. package/dist/{useSlotProps-kRhf7Gil.js → useSlotProps-C_I1kEHr.js} +73 -72
  152. package/package.json +22 -13
  153. package/dist/Dialog.module-DFcZsVAd.js +0 -30
  154. package/dist/Group-B3p31ftp.js +0 -26
  155. package/dist/Input.module-ZTRZRcNt.js +0 -405
  156. package/dist/SelectButton-CoOT2txy.js +0 -61
  157. package/dist/Toggle-f5brSwAI.js +0 -175
@@ -1,111 +1,523 @@
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: {
8
- fill: "currentcolor",
9
- color: "currentcolor",
10
- width: "1em",
11
- 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);
1
+ import '../../assets/Input.css';
2
+ import { jsxs as K, jsx as j } from "react/jsx-runtime";
3
+ import * as x from "react";
4
+ import { forwardRef as de, useState as ce, useId as _e, useMemo as he } from "react";
5
+ import { c as T } from "../../clsx-DB4S2d7J.js";
6
+ import { Icon as me } from "../Icon/Icon.js";
7
+ import { Typography as G } from "../Typography/Typography.js";
8
+ import { g as fe, a as ye, u as ge, f as J, b as f, _ as be, c as ee, i as Ce, P as e, d as we, e as xe } from "../../useSlotProps-C_I1kEHr.js";
9
+ function Ne(l) {
10
+ let i = "https://mui.com/production-error/?code=" + l;
11
+ for (let d = 1; d < arguments.length; d += 1)
12
+ i += "&args[]=" + encodeURIComponent(arguments[d]);
13
+ return "Minified MUI error #" + l + "; visit " + i + " for the full message.";
14
+ }
15
+ const ne = "Input";
16
+ function Pe(l) {
17
+ return fe(ne, l);
18
+ }
19
+ ye(ne, ["root", "formControl", "focused", "disabled", "error", "multiline", "input", "inputMultiline", "inputTypeSearch", "adornedStart", "adornedEnd"]);
20
+ const te = /* @__PURE__ */ x.createContext(void 0);
21
+ process.env.NODE_ENV !== "production" && (te.displayName = "FormControlContext");
22
+ function ve() {
23
+ return x.useContext(te);
24
+ }
25
+ function Re(l = {}) {
26
+ const {
27
+ defaultValue: i,
28
+ disabled: d = !1,
29
+ error: u = !1,
30
+ onBlur: c,
31
+ onChange: m,
32
+ onFocus: N,
33
+ required: P = !1,
34
+ value: v,
35
+ inputRef: R
36
+ } = l, t = ve();
37
+ let E, _, g, b, y;
38
+ if (t) {
39
+ var k, h, S;
40
+ if (E = void 0, _ = (k = t.disabled) != null ? k : !1, g = (h = t.error) != null ? h : !1, b = (S = t.required) != null ? S : !1, y = t.value, process.env.NODE_ENV !== "production") {
41
+ const n = ["defaultValue", "disabled", "error", "required", "value"].filter((r) => l[r] !== void 0);
42
+ n.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: ${n.join(", ")}`].join(`
43
+ `));
44
+ }
45
+ } else
46
+ E = i, _ = d, g = u, b = P, y = v;
47
+ const {
48
+ current: A
49
+ } = x.useRef(y != null), D = x.useCallback((n) => {
50
+ process.env.NODE_ENV !== "production" && n && n.nodeName !== "INPUT" && !n.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(`
51
+ `));
52
+ }, []), C = x.useRef(null), B = ge(C, R, D), [F, I] = x.useState(!1);
53
+ x.useEffect(() => {
54
+ !t && _ && F && (I(!1), c == null || c());
55
+ }, [t, _, F, c]);
56
+ const s = (n) => (r) => {
57
+ var o;
58
+ if (t != null && t.disabled) {
59
+ r.stopPropagation();
60
+ return;
61
+ }
62
+ if ((o = n.onFocus) == null || o.call(n, r), t && t.onFocus) {
63
+ var a;
64
+ t == null || (a = t.onFocus) == null || a.call(t);
65
+ } else
66
+ I(!0);
67
+ }, M = (n) => (r) => {
68
+ var o;
69
+ (o = n.onBlur) == null || o.call(n, r), t && t.onBlur ? t.onBlur() : I(!1);
70
+ }, H = (n) => (r, ...o) => {
71
+ var a, w;
72
+ if (!A && (r.target || C.current) == null)
73
+ 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." : Ne(17));
74
+ t == null || (a = t.onChange) == null || a.call(t, r), (w = n.onChange) == null || w.call(n, r, ...o);
75
+ }, q = (n) => (r) => {
76
+ var o;
77
+ C.current && r.currentTarget === r.target && C.current.focus(), (o = n.onClick) == null || o.call(n, r);
43
78
  };
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 })
79
+ return {
80
+ disabled: _,
81
+ error: g,
82
+ focused: F,
83
+ formControlContext: t,
84
+ getInputProps: (n = {}) => {
85
+ const o = f({}, {
86
+ onBlur: c,
87
+ onChange: m,
88
+ onFocus: N
89
+ }, J(n)), a = f({}, o, {
90
+ onBlur: M(o),
91
+ onChange: H(o),
92
+ onFocus: s(o)
93
+ });
94
+ return f({}, a, {
95
+ "aria-invalid": g || void 0,
96
+ defaultValue: E,
97
+ value: y,
98
+ required: b,
99
+ disabled: _
100
+ }, n, {
101
+ ref: B
102
+ }, a);
103
+ },
104
+ getRootProps: (n = {}) => {
105
+ const r = J(l, ["onBlur", "onChange", "onFocus"]), o = f({}, r, J(n));
106
+ return f({}, n, o, {
107
+ onClick: q(o)
108
+ });
109
+ },
110
+ inputRef: B,
111
+ required: b,
112
+ value: y
113
+ };
114
+ }
115
+ const Ee = ["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"], Fe = (l) => {
116
+ const {
117
+ disabled: i,
118
+ error: d,
119
+ focused: u,
120
+ formControlContext: c,
121
+ multiline: m,
122
+ startAdornment: N,
123
+ endAdornment: P
124
+ } = l;
125
+ return we({
126
+ root: ["root", i && "disabled", d && "error", u && "focused", !!c && "formControl", m && "multiline", !!N && "adornedStart", !!P && "adornedEnd"],
127
+ input: ["input", i && "disabled", m && "multiline"]
128
+ }, xe(Pe));
129
+ }, oe = /* @__PURE__ */ x.forwardRef(function(i, d) {
130
+ var u, c, m;
131
+ const {
132
+ "aria-describedby": N,
133
+ "aria-label": P,
134
+ "aria-labelledby": v,
135
+ autoComplete: R,
136
+ autoFocus: t,
137
+ className: E,
138
+ defaultValue: _,
139
+ disabled: g,
140
+ endAdornment: b,
141
+ error: y,
142
+ id: k,
143
+ multiline: h = !1,
144
+ name: S,
145
+ onClick: A,
146
+ onChange: D,
147
+ onKeyDown: C,
148
+ onKeyUp: B,
149
+ onFocus: F,
150
+ onBlur: I,
151
+ placeholder: s,
152
+ readOnly: M,
153
+ required: H,
154
+ startAdornment: q,
155
+ value: L,
156
+ type: U,
157
+ rows: n,
158
+ slotProps: r = {},
159
+ slots: o = {},
160
+ minRows: a,
161
+ maxRows: w
162
+ } = i, $ = be(i, Ee), {
163
+ getRootProps: O,
164
+ getInputProps: Y,
165
+ focused: V,
166
+ formControlContext: re,
167
+ error: ae,
168
+ disabled: se
169
+ } = Re({
170
+ disabled: g,
171
+ defaultValue: _,
172
+ error: y,
173
+ onBlur: I,
174
+ onClick: A,
175
+ onChange: D,
176
+ onFocus: F,
177
+ required: H,
178
+ value: L
179
+ }), Q = h ? void 0 : U ?? "text", W = f({}, i, {
180
+ disabled: se,
181
+ error: ae,
182
+ focused: V,
183
+ formControlContext: re,
184
+ multiline: h,
185
+ type: Q
186
+ }), X = Fe(W), le = {
187
+ "aria-describedby": N,
188
+ "aria-label": P,
189
+ "aria-labelledby": v,
190
+ autoComplete: R,
191
+ autoFocus: t,
192
+ id: k,
193
+ onKeyDown: C,
194
+ onKeyUp: B,
195
+ name: S,
196
+ placeholder: s,
197
+ readOnly: M,
198
+ type: Q
199
+ }, Z = (u = o.root) != null ? u : "div", ie = ee({
200
+ elementType: Z,
201
+ getSlotProps: O,
202
+ externalSlotProps: r.root,
203
+ externalForwardedProps: $,
204
+ additionalProps: {
205
+ ref: d
206
+ },
207
+ ownerState: W,
208
+ className: [X.root, E]
209
+ }), z = h ? (c = o.textarea) != null ? c : "textarea" : (m = o.input) != null ? m : "input", ue = ee({
210
+ elementType: z,
211
+ getSlotProps: (pe) => Y(f({}, le, pe)),
212
+ externalSlotProps: r.input,
213
+ additionalProps: f({
214
+ rows: h ? n : void 0
215
+ }, h && !Ce(z) && {
216
+ minRows: n || a,
217
+ maxRows: n || w
218
+ }),
219
+ ownerState: W,
220
+ className: X.input
221
+ });
222
+ return process.env.NODE_ENV !== "production" && h && n && (a || w) && console.warn("MUI: You can not use the `minRows` or `maxRows` props when the input `rows` prop is set."), /* @__PURE__ */ K(Z, f({}, ie, {
223
+ children: [q, /* @__PURE__ */ j(z, f({}, ue)), b]
224
+ }));
225
+ });
226
+ process.env.NODE_ENV !== "production" && (oe.propTypes = {
227
+ // ┌────────────────────────────── Warning ──────────────────────────────┐
228
+ // │ These PropTypes are generated from the TypeScript type definitions. │
229
+ // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
230
+ // └─────────────────────────────────────────────────────────────────────┘
231
+ /**
232
+ * @ignore
233
+ */
234
+ "aria-describedby": e.string,
235
+ /**
236
+ * @ignore
237
+ */
238
+ "aria-label": e.string,
239
+ /**
240
+ * @ignore
241
+ */
242
+ "aria-labelledby": e.string,
243
+ /**
244
+ * This prop helps users to fill forms faster, especially on mobile devices.
245
+ * The name can be confusing, as it's more like an autofill.
246
+ * You can learn more about it [following the specification](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill).
247
+ */
248
+ autoComplete: e.string,
249
+ /**
250
+ * If `true`, the `input` element is focused during the first mount.
251
+ */
252
+ autoFocus: e.bool,
253
+ /**
254
+ * Class name applied to the root element.
255
+ */
256
+ className: e.string,
257
+ /**
258
+ * The default value. Use when the component is not controlled.
259
+ */
260
+ defaultValue: e.any,
261
+ /**
262
+ * If `true`, the component is disabled.
263
+ * The prop defaults to the value (`false`) inherited from the parent FormControl component.
264
+ */
265
+ disabled: e.bool,
266
+ /**
267
+ * Trailing adornment for this input.
268
+ */
269
+ endAdornment: e.node,
270
+ /**
271
+ * 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.
272
+ * The prop defaults to the value (`false`) inherited from the parent FormControl component.
273
+ */
274
+ error: e.bool,
275
+ /**
276
+ * The id of the `input` element.
277
+ */
278
+ id: e.string,
279
+ /**
280
+ * @ignore
281
+ */
282
+ inputRef: e.oneOfType([e.func, e.shape({
283
+ current: e.object
284
+ })]),
285
+ /**
286
+ * Maximum number of rows to display when multiline option is set to true.
287
+ */
288
+ maxRows: e.number,
289
+ /**
290
+ * Minimum number of rows to display when multiline option is set to true.
291
+ */
292
+ minRows: e.number,
293
+ /**
294
+ * If `true`, a `textarea` element is rendered.
295
+ * @default false
296
+ */
297
+ multiline: e.bool,
298
+ /**
299
+ * Name attribute of the `input` element.
300
+ */
301
+ name: e.string,
302
+ /**
303
+ * @ignore
304
+ */
305
+ onBlur: e.func,
306
+ /**
307
+ * @ignore
308
+ */
309
+ onChange: e.func,
310
+ /**
311
+ * @ignore
312
+ */
313
+ onClick: e.func,
314
+ /**
315
+ * @ignore
316
+ */
317
+ onFocus: e.func,
318
+ /**
319
+ * @ignore
320
+ */
321
+ onKeyDown: e.func,
322
+ /**
323
+ * @ignore
324
+ */
325
+ onKeyUp: e.func,
326
+ /**
327
+ * The short hint displayed in the `input` before the user enters a value.
328
+ */
329
+ placeholder: e.string,
330
+ /**
331
+ * It prevents the user from changing the value of the field
332
+ * (not from interacting with the field).
333
+ */
334
+ readOnly: e.bool,
335
+ /**
336
+ * If `true`, the `input` element is required.
337
+ * The prop defaults to the value (`false`) inherited from the parent FormControl component.
338
+ */
339
+ required: e.bool,
340
+ /**
341
+ * Number of rows to display when multiline option is set to true.
342
+ */
343
+ rows: e.number,
344
+ /**
345
+ * The props used for each slot inside the Input.
346
+ * @default {}
347
+ */
348
+ slotProps: e.shape({
349
+ input: e.oneOfType([e.func, e.object]),
350
+ root: e.oneOfType([e.func, e.object])
351
+ }),
352
+ /**
353
+ * The components used for each slot inside the InputBase.
354
+ * Either a string to use a HTML element or a component.
355
+ * @default {}
356
+ */
357
+ slots: e.shape({
358
+ input: e.elementType,
359
+ root: e.elementType,
360
+ textarea: e.elementType
361
+ }),
362
+ /**
363
+ * Leading adornment for this input.
364
+ */
365
+ startAdornment: e.node,
366
+ /**
367
+ * 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).
368
+ * @default 'text'
369
+ */
370
+ 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"]),
371
+ /**
372
+ * The value of the `input` element, required for a controlled component.
373
+ */
374
+ value: e.any
375
+ });
376
+ const Ie = "_input_3n32h_57", Oe = "_input__label_3n32h_84", p = {
377
+ "u-typography-h1": "_u-typography-h1_3n32h_1",
378
+ "u-typography-h2": "_u-typography-h2_3n32h_8",
379
+ "u-typography-h3": "_u-typography-h3_3n32h_15",
380
+ "u-typography-h4": "_u-typography-h4_3n32h_22",
381
+ "u-typography-h5": "_u-typography-h5_3n32h_29",
382
+ "u-typography-h6": "_u-typography-h6_3n32h_36",
383
+ "u-typography-base": "_u-typography-base_3n32h_43",
384
+ "u-typography-base--xxl": "_u-typography-base--xxl_3n32h_49",
385
+ "u-typography-base--xl": "_u-typography-base--xl_3n32h_53",
386
+ "u-typography-base--lg": "_u-typography-base--lg_3n32h_57",
387
+ "input__input-el": "_input__input-el_3n32h_57",
388
+ "u-typography-base--sm": "_u-typography-base--sm_3n32h_61",
389
+ "u-typography-base--bold": "_u-typography-base--bold_3n32h_65",
390
+ "u-typography-base--strikethrough": "_u-typography-base--strikethrough_3n32h_68",
391
+ "u-typography-base--underlined": "_u-typography-base--underlined_3n32h_71",
392
+ "u-typography-base--strikethrough-underlined": "_u-typography-base--strikethrough-underlined_3n32h_74",
393
+ input: Ie,
394
+ "input__messages-wrapper": "_input__messages-wrapper_3n32h_81",
395
+ input__label: Oe,
396
+ "input__input-el-wrapper": "_input__input-el-wrapper_3n32h_89",
397
+ "input__left-icon": "_input__left-icon_3n32h_108",
398
+ "input__right-icon": "_input__right-icon_3n32h_108",
399
+ "input__info-message": "_input__info-message_3n32h_134",
400
+ "input__error-message": "_input__error-message_3n32h_134",
401
+ "input__chars-counter": "_input__chars-counter_3n32h_145",
402
+ "input--disabled": "_input--disabled_3n32h_150",
403
+ "input--focused": "_input--focused_3n32h_156",
404
+ "input--error": "_input--error_3n32h_159"
405
+ }, je = de(
406
+ ({
407
+ label: l,
408
+ infoMessage: i,
409
+ error: d,
410
+ errorMessage: u,
411
+ leftIcon: c,
412
+ rightIcon: m,
413
+ id: N,
414
+ disabled: P,
415
+ type: v = "text",
416
+ maxLength: R,
417
+ decimalLength: t = 10,
418
+ hideCharsCounter: E = !1,
419
+ onChange: _,
420
+ classNameWrapper: g,
421
+ classNameLabel: b,
422
+ classNameInput: y,
423
+ classNameInfoMessage: k,
424
+ classNameErrorMessage: h,
425
+ classNameCharsCounter: S,
426
+ "data-testid-wrapper": A,
427
+ "data-testid-label": D,
428
+ "data-testid-input": C,
429
+ "data-testid-infoMessage": B,
430
+ "data-testid-errorMessage": F,
431
+ "data-testid-charsCounter": I,
432
+ ...s
433
+ }, M) => {
434
+ const [H, q] = ce(0), L = _e(), U = N || `input_${L}`;
435
+ Object.assign(s, { "data-testid": C });
436
+ const n = R && !E, r = (a) => {
437
+ var w, $;
438
+ if (v === "number") {
439
+ let O = String(a.target.value);
440
+ const [Y, V] = O.split(".");
441
+ O !== "" && (V != null && V.length ? O = [Number(Y), V.slice(0, t)].join(".") : O = String(Number(Y))), a.target.value = O;
80
442
  }
81
- ),
82
- /* @__PURE__ */ n("div", { className: t["input__messages-wrapper"], children: [
83
- (i || d) && /* @__PURE__ */ n(
84
- c,
443
+ n && q(($ = (w = a == null ? void 0 : a.target) == null ? void 0 : w.value) == null ? void 0 : $.length), _ && _(a);
444
+ }, o = he(() => s.multiline !== !0 ? {
445
+ type: v,
446
+ multiline: s.multiline
447
+ } : {
448
+ type: void 0,
449
+ multiline: s.multiline,
450
+ rows: (s == null ? void 0 : s.rows) || 5,
451
+ minRows: s == null ? void 0 : s.minRows,
452
+ maxRows: s == null ? void 0 : s.maxRows
453
+ }, [s]);
454
+ return /* @__PURE__ */ K("div", { className: T(p.input, g), "data-testid": A, children: [
455
+ l && /* @__PURE__ */ j(
456
+ G,
85
457
  {
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
- ]
458
+ element: "label",
459
+ elementProps: { htmlFor: U },
460
+ className: T(p.input__label, b),
461
+ "data-testid": D,
462
+ children: l
92
463
  }
93
464
  ),
94
- l && !x && /* @__PURE__ */ n(
95
- c,
465
+ /* @__PURE__ */ j(
466
+ oe,
96
467
  {
97
- className: a(t["input__chars-counter"], z),
98
- "data-testid": B,
99
- children: [
100
- F,
101
- " / ",
102
- l
103
- ]
468
+ id: U,
469
+ disabled: P,
470
+ error: typeof d == "boolean" ? d : !!u,
471
+ "aria-label": l,
472
+ slotProps: {
473
+ root: (a) => ({
474
+ className: T(p["input__input-el-wrapper"], {
475
+ [p["input--disabled"]]: a.disabled,
476
+ [p["input--focused"]]: a.focused,
477
+ [p["input--error"]]: a.error
478
+ })
479
+ }),
480
+ input: {
481
+ ref: M,
482
+ className: T(p["input__input-el"], y),
483
+ maxLength: R,
484
+ onChange: r,
485
+ ...s
486
+ }
487
+ },
488
+ startAdornment: c && /* @__PURE__ */ j("span", { className: p["input__left-icon"], children: c }),
489
+ endAdornment: m && /* @__PURE__ */ j("span", { className: p["input__right-icon"], children: m }),
490
+ ...o
104
491
  }
105
- )
106
- ] })
107
- ] });
108
- };
492
+ ),
493
+ /* @__PURE__ */ K("div", { className: p["input__messages-wrapper"], children: [
494
+ (u || i) && /* @__PURE__ */ K(
495
+ G,
496
+ {
497
+ className: u ? T(p["input__error-message"], h) : T(p["input__info-message"], k),
498
+ "data-testid": u ? F : B,
499
+ children: [
500
+ /* @__PURE__ */ j(me, { icon: u ? "circle-exclamation" : "circle-info" }),
501
+ u || i
502
+ ]
503
+ }
504
+ ),
505
+ n && /* @__PURE__ */ K(
506
+ G,
507
+ {
508
+ className: T(p["input__chars-counter"], S),
509
+ "data-testid": I,
510
+ children: [
511
+ H,
512
+ " / ",
513
+ R
514
+ ]
515
+ }
516
+ )
517
+ ] })
518
+ ] });
519
+ }
520
+ );
109
521
  export {
110
- M as Input
522
+ je as Input
111
523
  };
@@ -2,27 +2,7 @@ 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> & {
6
- label?: string | undefined;
7
- infoMessage?: string | undefined;
8
- errorMessage?: string | undefined;
9
- leftIcon?: import('react').ReactNode;
10
- rightIcon?: import('react').ReactNode;
11
- type?: "search" | "text" | "password" | undefined;
12
- hideCharsCounter?: boolean | undefined;
13
- classNameWrapper?: string | undefined;
14
- classNameLabel?: string | undefined;
15
- classNameInput?: string | undefined;
16
- classNameInfoMessage?: string | undefined;
17
- classNameErrorMessage?: string | undefined;
18
- classNameCharsCounter?: string | undefined;
19
- 'data-testid-wrapper'?: string | undefined;
20
- 'data-testid-label'?: string | undefined;
21
- 'data-testid-input'?: string | undefined;
22
- 'data-testid-infoMessage'?: string | undefined;
23
- 'data-testid-errorMessage'?: string | undefined;
24
- 'data-testid-charsCounter'?: string | undefined;
25
- }) => import("react/jsx-runtime").JSX.Element;
5
+ component: import('react').ForwardRefExoticComponent<import('./Input').InputProps & import('react').RefAttributes<HTMLInputElement>>;
26
6
  tags: string[];
27
7
  parameters: {
28
8
  layout: string;
@@ -41,3 +21,4 @@ export declare const WithRightIconAndClickEvent: Story;
41
21
  export declare const WithBothIcons: Story;
42
22
  export declare const WithInfoMessage: Story;
43
23
  export declare const WithErrorMessage: Story;
24
+ export declare const Textarea: Story;