@pismo/marola 1.0.0-beta.27 → 1.0.0-beta.28
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.
|
@@ -7,7 +7,9 @@ export type InputProps = InputHTMLAttributes<HTMLInputElement> & {
|
|
|
7
7
|
label?: string;
|
|
8
8
|
/** Info message text */
|
|
9
9
|
infoMessage?: string;
|
|
10
|
-
/**
|
|
10
|
+
/** Show the field layout as an error */
|
|
11
|
+
error?: boolean;
|
|
12
|
+
/** Error message text, if has "errorMessage", the "error" props will be "true" */
|
|
11
13
|
errorMessage?: string;
|
|
12
14
|
/** Left icon element */
|
|
13
15
|
leftIcon?: ReactNode;
|
|
@@ -47,7 +49,9 @@ export declare const Input: import('react').ForwardRefExoticComponent<InputHTMLA
|
|
|
47
49
|
label?: string | undefined;
|
|
48
50
|
/** Info message text */
|
|
49
51
|
infoMessage?: string | undefined;
|
|
50
|
-
/**
|
|
52
|
+
/** Show the field layout as an error */
|
|
53
|
+
error?: boolean | undefined;
|
|
54
|
+
/** Error message text, if has "errorMessage", the "error" props will be "true" */
|
|
51
55
|
errorMessage?: string | undefined;
|
|
52
56
|
/** Left icon element */
|
|
53
57
|
leftIcon?: ReactNode;
|
|
@@ -1,164 +1,164 @@
|
|
|
1
1
|
import '../../assets/Input.css';
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import * as
|
|
2
|
+
import { jsxs as H, jsx as T } from "react/jsx-runtime";
|
|
3
|
+
import * as f from "react";
|
|
4
4
|
import { forwardRef as de, useState as ce, useId as _e } from "react";
|
|
5
|
-
import { c as
|
|
5
|
+
import { c as E } from "../../clsx-DB4S2d7J.js";
|
|
6
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
|
|
7
|
+
import { g as he, a as fe, u as me, f as z, b as m, _ as ye, c as Q, i as ge, P as e, d as be, e as Ce } from "../../useSlotProps-C_I1kEHr.js";
|
|
8
8
|
function we(a) {
|
|
9
|
-
let
|
|
10
|
-
for (let
|
|
11
|
-
|
|
12
|
-
return "Minified MUI error #" + a + "; visit " +
|
|
9
|
+
let s = "https://mui.com/production-error/?code=" + a;
|
|
10
|
+
for (let u = 1; u < arguments.length; u += 1)
|
|
11
|
+
s += "&args[]=" + encodeURIComponent(arguments[u]);
|
|
12
|
+
return "Minified MUI error #" + a + "; visit " + s + " for the full message.";
|
|
13
13
|
}
|
|
14
14
|
const X = "Input";
|
|
15
15
|
function ve(a) {
|
|
16
16
|
return he(X, a);
|
|
17
17
|
}
|
|
18
18
|
fe(X, ["root", "formControl", "focused", "disabled", "error", "multiline", "input", "inputMultiline", "inputTypeSearch", "adornedStart", "adornedEnd"]);
|
|
19
|
-
const Z = /* @__PURE__ */
|
|
19
|
+
const Z = /* @__PURE__ */ f.createContext(void 0);
|
|
20
20
|
process.env.NODE_ENV !== "production" && (Z.displayName = "FormControlContext");
|
|
21
21
|
function xe() {
|
|
22
|
-
return
|
|
22
|
+
return f.useContext(Z);
|
|
23
23
|
}
|
|
24
24
|
function qe(a = {}) {
|
|
25
25
|
const {
|
|
26
|
-
defaultValue:
|
|
27
|
-
disabled:
|
|
28
|
-
error:
|
|
29
|
-
onBlur:
|
|
30
|
-
onChange:
|
|
31
|
-
onFocus:
|
|
32
|
-
required:
|
|
33
|
-
value:
|
|
34
|
-
inputRef:
|
|
26
|
+
defaultValue: s,
|
|
27
|
+
disabled: u = !1,
|
|
28
|
+
error: i = !1,
|
|
29
|
+
onBlur: p,
|
|
30
|
+
onChange: _,
|
|
31
|
+
onFocus: x,
|
|
32
|
+
required: q = !1,
|
|
33
|
+
value: R,
|
|
34
|
+
inputRef: N
|
|
35
35
|
} = a, o = xe();
|
|
36
|
-
let
|
|
36
|
+
let g, h, b, C, y;
|
|
37
37
|
if (o) {
|
|
38
38
|
var F, d, I;
|
|
39
|
-
if (
|
|
40
|
-
const t = ["defaultValue", "disabled", "error", "required", "value"].filter((
|
|
39
|
+
if (g = void 0, h = (F = o.disabled) != null ? F : !1, b = (d = o.error) != null ? d : !1, C = (I = o.required) != null ? I : !1, y = o.value, process.env.NODE_ENV !== "production") {
|
|
40
|
+
const t = ["defaultValue", "disabled", "error", "required", "value"].filter((r) => a[r] !== void 0);
|
|
41
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
42
|
`));
|
|
43
43
|
}
|
|
44
44
|
} else
|
|
45
|
-
|
|
45
|
+
g = s, h = u, b = i, C = q, y = R;
|
|
46
46
|
const {
|
|
47
|
-
current:
|
|
48
|
-
} =
|
|
47
|
+
current: S
|
|
48
|
+
} = f.useRef(y != null), k = f.useCallback((t) => {
|
|
49
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
50
|
`));
|
|
51
|
-
}, []),
|
|
52
|
-
|
|
53
|
-
!o &&
|
|
54
|
-
}, [o,
|
|
55
|
-
const
|
|
56
|
-
var
|
|
51
|
+
}, []), w = f.useRef(null), O = me(w, N, k), [P, v] = f.useState(!1);
|
|
52
|
+
f.useEffect(() => {
|
|
53
|
+
!o && h && P && (v(!1), p == null || p());
|
|
54
|
+
}, [o, h, P, p]);
|
|
55
|
+
const B = (t) => (r) => {
|
|
56
|
+
var n;
|
|
57
57
|
if (o != null && o.disabled) {
|
|
58
|
-
|
|
58
|
+
r.stopPropagation();
|
|
59
59
|
return;
|
|
60
60
|
}
|
|
61
|
-
if ((
|
|
61
|
+
if ((n = t.onFocus) == null || n.call(t, r), o && o.onFocus) {
|
|
62
62
|
var c;
|
|
63
63
|
o == null || (c = o.onFocus) == null || c.call(o);
|
|
64
64
|
} else
|
|
65
|
-
|
|
66
|
-
},
|
|
67
|
-
var
|
|
68
|
-
(
|
|
69
|
-
},
|
|
70
|
-
var c,
|
|
71
|
-
if (!
|
|
65
|
+
v(!0);
|
|
66
|
+
}, V = (t) => (r) => {
|
|
67
|
+
var n;
|
|
68
|
+
(n = t.onBlur) == null || n.call(t, r), o && o.onBlur ? o.onBlur() : v(!1);
|
|
69
|
+
}, U = (t) => (r, ...n) => {
|
|
70
|
+
var c, j;
|
|
71
|
+
if (!S && (r.target || w.current) == null)
|
|
72
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,
|
|
74
|
-
},
|
|
75
|
-
var
|
|
76
|
-
|
|
73
|
+
o == null || (c = o.onChange) == null || c.call(o, r), (j = t.onChange) == null || j.call(t, r, ...n);
|
|
74
|
+
}, M = (t) => (r) => {
|
|
75
|
+
var n;
|
|
76
|
+
w.current && r.currentTarget === r.target && w.current.focus(), (n = t.onClick) == null || n.call(t, r);
|
|
77
77
|
};
|
|
78
78
|
return {
|
|
79
|
-
disabled:
|
|
80
|
-
error:
|
|
81
|
-
focused:
|
|
79
|
+
disabled: h,
|
|
80
|
+
error: b,
|
|
81
|
+
focused: P,
|
|
82
82
|
formControlContext: o,
|
|
83
83
|
getInputProps: (t = {}) => {
|
|
84
|
-
const
|
|
85
|
-
onBlur:
|
|
86
|
-
onChange:
|
|
87
|
-
onFocus:
|
|
88
|
-
}, z(t)), c =
|
|
89
|
-
onBlur:
|
|
90
|
-
onChange:
|
|
91
|
-
onFocus:
|
|
84
|
+
const n = m({}, {
|
|
85
|
+
onBlur: p,
|
|
86
|
+
onChange: _,
|
|
87
|
+
onFocus: x
|
|
88
|
+
}, z(t)), c = m({}, n, {
|
|
89
|
+
onBlur: V(n),
|
|
90
|
+
onChange: U(n),
|
|
91
|
+
onFocus: B(n)
|
|
92
92
|
});
|
|
93
|
-
return
|
|
94
|
-
"aria-invalid":
|
|
95
|
-
defaultValue:
|
|
96
|
-
value:
|
|
97
|
-
required:
|
|
98
|
-
disabled:
|
|
93
|
+
return m({}, c, {
|
|
94
|
+
"aria-invalid": b || void 0,
|
|
95
|
+
defaultValue: g,
|
|
96
|
+
value: y,
|
|
97
|
+
required: C,
|
|
98
|
+
disabled: h
|
|
99
99
|
}, t, {
|
|
100
100
|
ref: O
|
|
101
101
|
}, c);
|
|
102
102
|
},
|
|
103
103
|
getRootProps: (t = {}) => {
|
|
104
|
-
const
|
|
105
|
-
return
|
|
106
|
-
onClick:
|
|
104
|
+
const r = z(a, ["onBlur", "onChange", "onFocus"]), n = m({}, r, z(t));
|
|
105
|
+
return m({}, t, n, {
|
|
106
|
+
onClick: M(n)
|
|
107
107
|
});
|
|
108
108
|
},
|
|
109
109
|
inputRef: O,
|
|
110
|
-
required:
|
|
111
|
-
value:
|
|
110
|
+
required: C,
|
|
111
|
+
value: y
|
|
112
112
|
};
|
|
113
113
|
}
|
|
114
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
115
|
const {
|
|
116
|
-
disabled:
|
|
117
|
-
error:
|
|
118
|
-
focused:
|
|
119
|
-
formControlContext:
|
|
120
|
-
multiline:
|
|
121
|
-
startAdornment:
|
|
122
|
-
endAdornment:
|
|
116
|
+
disabled: s,
|
|
117
|
+
error: u,
|
|
118
|
+
focused: i,
|
|
119
|
+
formControlContext: p,
|
|
120
|
+
multiline: _,
|
|
121
|
+
startAdornment: x,
|
|
122
|
+
endAdornment: q
|
|
123
123
|
} = a;
|
|
124
124
|
return be({
|
|
125
|
-
root: ["root",
|
|
126
|
-
input: ["input",
|
|
125
|
+
root: ["root", s && "disabled", u && "error", i && "focused", !!p && "formControl", _ && "multiline", !!x && "adornedStart", !!q && "adornedEnd"],
|
|
126
|
+
input: ["input", s && "disabled", _ && "multiline"]
|
|
127
127
|
}, Ce(ve));
|
|
128
|
-
}, ee = /* @__PURE__ */
|
|
129
|
-
var
|
|
128
|
+
}, ee = /* @__PURE__ */ f.forwardRef(function(s, u) {
|
|
129
|
+
var i, p, _;
|
|
130
130
|
const {
|
|
131
|
-
"aria-describedby":
|
|
132
|
-
"aria-label":
|
|
133
|
-
"aria-labelledby":
|
|
134
|
-
autoComplete:
|
|
131
|
+
"aria-describedby": x,
|
|
132
|
+
"aria-label": q,
|
|
133
|
+
"aria-labelledby": R,
|
|
134
|
+
autoComplete: N,
|
|
135
135
|
autoFocus: o,
|
|
136
|
-
className:
|
|
137
|
-
defaultValue:
|
|
138
|
-
disabled:
|
|
139
|
-
endAdornment:
|
|
140
|
-
error:
|
|
136
|
+
className: g,
|
|
137
|
+
defaultValue: h,
|
|
138
|
+
disabled: b,
|
|
139
|
+
endAdornment: C,
|
|
140
|
+
error: y,
|
|
141
141
|
id: F,
|
|
142
142
|
multiline: d = !1,
|
|
143
143
|
name: I,
|
|
144
|
-
onClick:
|
|
145
|
-
onChange:
|
|
146
|
-
onKeyDown:
|
|
144
|
+
onClick: S,
|
|
145
|
+
onChange: k,
|
|
146
|
+
onKeyDown: w,
|
|
147
147
|
onKeyUp: O,
|
|
148
|
-
onFocus:
|
|
149
|
-
onBlur:
|
|
150
|
-
placeholder:
|
|
151
|
-
readOnly:
|
|
152
|
-
required:
|
|
153
|
-
startAdornment:
|
|
154
|
-
value:
|
|
155
|
-
type:
|
|
148
|
+
onFocus: P,
|
|
149
|
+
onBlur: v,
|
|
150
|
+
placeholder: B,
|
|
151
|
+
readOnly: V,
|
|
152
|
+
required: U,
|
|
153
|
+
startAdornment: M,
|
|
154
|
+
value: A,
|
|
155
|
+
type: D,
|
|
156
156
|
rows: t,
|
|
157
|
-
slotProps:
|
|
158
|
-
slots:
|
|
157
|
+
slotProps: r = {},
|
|
158
|
+
slots: n = {},
|
|
159
159
|
minRows: c,
|
|
160
|
-
maxRows:
|
|
161
|
-
} =
|
|
160
|
+
maxRows: j
|
|
161
|
+
} = s, Y = ye(s, Ne), {
|
|
162
162
|
getRootProps: te,
|
|
163
163
|
getInputProps: oe,
|
|
164
164
|
focused: ne,
|
|
@@ -166,16 +166,16 @@ const Ne = ["aria-describedby", "aria-label", "aria-labelledby", "autoComplete",
|
|
|
166
166
|
error: ae,
|
|
167
167
|
disabled: se
|
|
168
168
|
} = qe({
|
|
169
|
-
disabled:
|
|
170
|
-
defaultValue:
|
|
171
|
-
error:
|
|
172
|
-
onBlur:
|
|
173
|
-
onClick:
|
|
174
|
-
onChange:
|
|
175
|
-
onFocus:
|
|
176
|
-
required:
|
|
177
|
-
value:
|
|
178
|
-
}), W = d ? void 0 :
|
|
169
|
+
disabled: b,
|
|
170
|
+
defaultValue: h,
|
|
171
|
+
error: y,
|
|
172
|
+
onBlur: v,
|
|
173
|
+
onClick: S,
|
|
174
|
+
onChange: k,
|
|
175
|
+
onFocus: P,
|
|
176
|
+
required: U,
|
|
177
|
+
value: A
|
|
178
|
+
}), W = d ? void 0 : D ?? "text", $ = m({}, s, {
|
|
179
179
|
disabled: se,
|
|
180
180
|
error: ae,
|
|
181
181
|
focused: ne,
|
|
@@ -183,43 +183,43 @@ const Ne = ["aria-describedby", "aria-label", "aria-labelledby", "autoComplete",
|
|
|
183
183
|
multiline: d,
|
|
184
184
|
type: W
|
|
185
185
|
}), G = Pe($), le = {
|
|
186
|
-
"aria-describedby":
|
|
187
|
-
"aria-label":
|
|
188
|
-
"aria-labelledby":
|
|
189
|
-
autoComplete:
|
|
186
|
+
"aria-describedby": x,
|
|
187
|
+
"aria-label": q,
|
|
188
|
+
"aria-labelledby": R,
|
|
189
|
+
autoComplete: N,
|
|
190
190
|
autoFocus: o,
|
|
191
191
|
id: F,
|
|
192
|
-
onKeyDown:
|
|
192
|
+
onKeyDown: w,
|
|
193
193
|
onKeyUp: O,
|
|
194
194
|
name: I,
|
|
195
|
-
placeholder:
|
|
196
|
-
readOnly:
|
|
195
|
+
placeholder: B,
|
|
196
|
+
readOnly: V,
|
|
197
197
|
type: W
|
|
198
|
-
}, J = (
|
|
198
|
+
}, J = (i = n.root) != null ? i : "div", ue = Q({
|
|
199
199
|
elementType: J,
|
|
200
200
|
getSlotProps: te,
|
|
201
|
-
externalSlotProps:
|
|
201
|
+
externalSlotProps: r.root,
|
|
202
202
|
externalForwardedProps: Y,
|
|
203
203
|
additionalProps: {
|
|
204
|
-
ref:
|
|
204
|
+
ref: u
|
|
205
205
|
},
|
|
206
206
|
ownerState: $,
|
|
207
|
-
className: [G.root,
|
|
208
|
-
}), K = d ? (
|
|
207
|
+
className: [G.root, g]
|
|
208
|
+
}), K = d ? (p = n.textarea) != null ? p : "textarea" : (_ = n.input) != null ? _ : "input", ie = Q({
|
|
209
209
|
elementType: K,
|
|
210
|
-
getSlotProps: (pe) => oe(
|
|
211
|
-
externalSlotProps:
|
|
212
|
-
additionalProps:
|
|
210
|
+
getSlotProps: (pe) => oe(m({}, le, pe)),
|
|
211
|
+
externalSlotProps: r.input,
|
|
212
|
+
additionalProps: m({
|
|
213
213
|
rows: d ? t : void 0
|
|
214
214
|
}, d && !ge(K) && {
|
|
215
215
|
minRows: t || c,
|
|
216
|
-
maxRows: t ||
|
|
216
|
+
maxRows: t || j
|
|
217
217
|
}),
|
|
218
218
|
ownerState: $,
|
|
219
219
|
className: G.input
|
|
220
220
|
});
|
|
221
|
-
return process.env.NODE_ENV !== "production" && d && t && (c ||
|
|
222
|
-
children: [
|
|
221
|
+
return process.env.NODE_ENV !== "production" && d && t && (c || j) && console.warn("MUI: You can not use the `minRows` or `maxRows` props when the input `rows` prop is set."), /* @__PURE__ */ H(J, m({}, ue, {
|
|
222
|
+
children: [M, /* @__PURE__ */ T(K, m({}, ie)), C]
|
|
223
223
|
}));
|
|
224
224
|
});
|
|
225
225
|
process.env.NODE_ENV !== "production" && (ee.propTypes = {
|
|
@@ -372,12 +372,12 @@ process.env.NODE_ENV !== "production" && (ee.propTypes = {
|
|
|
372
372
|
*/
|
|
373
373
|
value: e.any
|
|
374
374
|
});
|
|
375
|
-
const Ee = (a) => /* @__PURE__ */
|
|
375
|
+
const Ee = (a) => /* @__PURE__ */ f.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: {
|
|
376
376
|
fill: "currentcolor",
|
|
377
377
|
color: "currentcolor",
|
|
378
378
|
width: "1em",
|
|
379
379
|
height: "1em"
|
|
380
|
-
}, ...a }, /* @__PURE__ */
|
|
380
|
+
}, ...a }, /* @__PURE__ */ f.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", l = {
|
|
381
381
|
"u-typography-h1": "_u-typography-h1_1lq2e_1",
|
|
382
382
|
"u-typography-h2": "_u-typography-h2_1lq2e_8",
|
|
383
383
|
"u-typography-h3": "_u-typography-h3_1lq2e_15",
|
|
@@ -409,96 +409,97 @@ const Ee = (a) => /* @__PURE__ */ h.createElement("svg", { xmlns: "http://www.w3
|
|
|
409
409
|
}, Be = de(
|
|
410
410
|
({
|
|
411
411
|
label: a,
|
|
412
|
-
infoMessage:
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
412
|
+
infoMessage: s,
|
|
413
|
+
error: u,
|
|
414
|
+
errorMessage: i,
|
|
415
|
+
leftIcon: p,
|
|
416
|
+
rightIcon: _,
|
|
417
|
+
id: x,
|
|
417
418
|
disabled: q,
|
|
418
|
-
type:
|
|
419
|
-
maxLength:
|
|
420
|
-
hideCharsCounter:
|
|
421
|
-
onChange:
|
|
422
|
-
classNameWrapper:
|
|
423
|
-
classNameLabel:
|
|
419
|
+
type: R = "text",
|
|
420
|
+
maxLength: N,
|
|
421
|
+
hideCharsCounter: o = !1,
|
|
422
|
+
onChange: g,
|
|
423
|
+
classNameWrapper: h,
|
|
424
|
+
classNameLabel: b,
|
|
424
425
|
classNameInput: C,
|
|
425
|
-
classNameInfoMessage:
|
|
426
|
-
classNameErrorMessage:
|
|
427
|
-
classNameCharsCounter:
|
|
428
|
-
"data-testid-wrapper":
|
|
429
|
-
"data-testid-label":
|
|
430
|
-
"data-testid-input":
|
|
431
|
-
"data-testid-infoMessage":
|
|
432
|
-
"data-testid-errorMessage":
|
|
433
|
-
"data-testid-charsCounter":
|
|
434
|
-
...
|
|
435
|
-
},
|
|
436
|
-
const [
|
|
437
|
-
Object.assign(
|
|
438
|
-
const
|
|
439
|
-
var
|
|
440
|
-
|
|
426
|
+
classNameInfoMessage: y,
|
|
427
|
+
classNameErrorMessage: F,
|
|
428
|
+
classNameCharsCounter: d,
|
|
429
|
+
"data-testid-wrapper": I,
|
|
430
|
+
"data-testid-label": S,
|
|
431
|
+
"data-testid-input": k,
|
|
432
|
+
"data-testid-infoMessage": w,
|
|
433
|
+
"data-testid-errorMessage": O,
|
|
434
|
+
"data-testid-charsCounter": P,
|
|
435
|
+
...v
|
|
436
|
+
}, B) => {
|
|
437
|
+
const [V, U] = ce(0), M = _e(), A = x || `input_${M}`;
|
|
438
|
+
Object.assign(v, { "data-testid": k });
|
|
439
|
+
const D = (t) => {
|
|
440
|
+
var r, n;
|
|
441
|
+
U((n = (r = t == null ? void 0 : t.target) == null ? void 0 : r.value) == null ? void 0 : n.length), g && g(t);
|
|
441
442
|
};
|
|
442
|
-
return /* @__PURE__ */
|
|
443
|
-
a && /* @__PURE__ */
|
|
443
|
+
return /* @__PURE__ */ H("div", { className: E(l.input, h), "data-testid": I, children: [
|
|
444
|
+
a && /* @__PURE__ */ T(
|
|
444
445
|
L,
|
|
445
446
|
{
|
|
446
447
|
element: "label",
|
|
447
|
-
elementProps: { htmlFor:
|
|
448
|
-
className:
|
|
449
|
-
"data-testid":
|
|
448
|
+
elementProps: { htmlFor: A },
|
|
449
|
+
className: E(l.input__label, b),
|
|
450
|
+
"data-testid": S,
|
|
450
451
|
children: a
|
|
451
452
|
}
|
|
452
453
|
),
|
|
453
|
-
/* @__PURE__ */
|
|
454
|
+
/* @__PURE__ */ T(
|
|
454
455
|
ee,
|
|
455
456
|
{
|
|
456
|
-
id:
|
|
457
|
-
type:
|
|
457
|
+
id: A,
|
|
458
|
+
type: R,
|
|
458
459
|
disabled: q,
|
|
459
|
-
error: !!
|
|
460
|
+
error: typeof u == "boolean" ? u : !!i,
|
|
460
461
|
"aria-label": a,
|
|
461
462
|
slotProps: {
|
|
462
|
-
root: (
|
|
463
|
-
className:
|
|
464
|
-
[
|
|
465
|
-
[
|
|
466
|
-
[
|
|
463
|
+
root: (t) => ({
|
|
464
|
+
className: E(l["input__input-el-wrapper"], {
|
|
465
|
+
[l["input--disabled"]]: t.disabled,
|
|
466
|
+
[l["input--focused"]]: t.focused,
|
|
467
|
+
[l["input--error"]]: t.error
|
|
467
468
|
})
|
|
468
469
|
}),
|
|
469
470
|
input: {
|
|
470
|
-
ref:
|
|
471
|
-
className:
|
|
472
|
-
maxLength:
|
|
473
|
-
onChange:
|
|
474
|
-
...
|
|
471
|
+
ref: B,
|
|
472
|
+
className: E(l["input__input-el"], C),
|
|
473
|
+
maxLength: N,
|
|
474
|
+
onChange: D,
|
|
475
|
+
...v
|
|
475
476
|
}
|
|
476
477
|
},
|
|
477
|
-
startAdornment:
|
|
478
|
-
endAdornment:
|
|
478
|
+
startAdornment: p && /* @__PURE__ */ T("span", { className: l["input__left-icon"], children: p }),
|
|
479
|
+
endAdornment: _ && /* @__PURE__ */ T("span", { className: l["input__right-icon"], children: _ })
|
|
479
480
|
}
|
|
480
481
|
),
|
|
481
|
-
/* @__PURE__ */
|
|
482
|
-
(
|
|
482
|
+
/* @__PURE__ */ H("div", { className: l["input__messages-wrapper"], children: [
|
|
483
|
+
(i || s) && /* @__PURE__ */ H(
|
|
483
484
|
L,
|
|
484
485
|
{
|
|
485
|
-
className:
|
|
486
|
-
"data-testid":
|
|
486
|
+
className: i ? E(l["input__error-message"], F) : E(l["input__info-message"], y),
|
|
487
|
+
"data-testid": i ? O : w,
|
|
487
488
|
children: [
|
|
488
|
-
/* @__PURE__ */
|
|
489
|
-
|
|
489
|
+
/* @__PURE__ */ T(Ee, {}),
|
|
490
|
+
i || s
|
|
490
491
|
]
|
|
491
492
|
}
|
|
492
493
|
),
|
|
493
|
-
|
|
494
|
+
N && !o && /* @__PURE__ */ H(
|
|
494
495
|
L,
|
|
495
496
|
{
|
|
496
|
-
className:
|
|
497
|
-
"data-testid":
|
|
497
|
+
className: E(l["input__chars-counter"], d),
|
|
498
|
+
"data-testid": P,
|
|
498
499
|
children: [
|
|
499
|
-
|
|
500
|
+
V,
|
|
500
501
|
" / ",
|
|
501
|
-
|
|
502
|
+
N
|
|
502
503
|
]
|
|
503
504
|
}
|
|
504
505
|
)
|
|
@@ -5,6 +5,7 @@ declare const meta: {
|
|
|
5
5
|
component: import('react').ForwardRefExoticComponent<import('react').InputHTMLAttributes<HTMLInputElement> & {
|
|
6
6
|
label?: string | undefined;
|
|
7
7
|
infoMessage?: string | undefined;
|
|
8
|
+
error?: boolean | undefined;
|
|
8
9
|
errorMessage?: string | undefined;
|
|
9
10
|
leftIcon?: import('react').ReactNode;
|
|
10
11
|
rightIcon?: import('react').ReactNode;
|
|
@@ -7,6 +7,7 @@ declare const meta: {
|
|
|
7
7
|
} & import('react').InputHTMLAttributes<HTMLInputElement> & {
|
|
8
8
|
label?: string | undefined;
|
|
9
9
|
infoMessage?: string | undefined;
|
|
10
|
+
error?: boolean | undefined;
|
|
10
11
|
errorMessage?: string | undefined;
|
|
11
12
|
leftIcon?: import('react').ReactNode;
|
|
12
13
|
rightIcon?: import('react').ReactNode;
|
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.
|
|
4
|
+
"version": "1.0.0-beta.28",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/main.js",
|
|
7
7
|
"types": "dist/main.d.ts",
|
|
@@ -60,6 +60,7 @@
|
|
|
60
60
|
"@types/react-dom": "^18.2.22",
|
|
61
61
|
"@typescript-eslint/eslint-plugin": "^7.6.0",
|
|
62
62
|
"@typescript-eslint/parser": "^7.6.0",
|
|
63
|
+
"@vitest/coverage-v8": "^1.4.0",
|
|
63
64
|
"@vitejs/plugin-react": "^4.2.1",
|
|
64
65
|
"clsx": "^2.1.0",
|
|
65
66
|
"commitlint": "^19.2.1",
|