@pismo/marola 1.0.0-beta.42 → 1.0.0-beta.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/SelectButton-rvRI0bTU.js +73 -0
- package/dist/assets/Input.css +1 -1
- package/dist/assets/SelectButton.css +1 -1
- package/dist/components/Icon/Icon.js +77 -71
- package/dist/components/Icon/types.d.ts +1 -1
- package/dist/components/Input/Input.js +197 -201
- package/dist/components/Popover/Popover.d.ts +3 -1
- package/dist/components/Popover/Popover.js +17 -15
- package/dist/components/Popover/Popover.stories.d.ts +1 -1
- package/dist/components/Select/Select.d.ts +14 -0
- package/dist/components/Select/Select.js +433 -414
- package/dist/components/Select/SelectButton.js +3 -2
- package/package.json +1 -1
- package/dist/SelectButton-BlVl6pJn.js +0 -70
|
@@ -1,225 +1,226 @@
|
|
|
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 q from "react";
|
|
4
4
|
import { forwardRef as de, useState as ce, useId as _e, useMemo as me } from "react";
|
|
5
|
-
import { c as
|
|
5
|
+
import { c as R } from "../../clsx-DB4S2d7J.js";
|
|
6
|
+
import { Icon as fe } from "../Icon/Icon.js";
|
|
6
7
|
import { Typography as L } from "../Typography/Typography.js";
|
|
7
|
-
import { g as he, a as
|
|
8
|
-
function
|
|
8
|
+
import { g as he, a as ye, u as ge, f as Y, b as h, _ as be, c as Q, i as Ce, P as e, d as we, e as qe } from "../../useSlotProps-C_I1kEHr.js";
|
|
9
|
+
function xe(s) {
|
|
9
10
|
let l = "https://mui.com/production-error/?code=" + s;
|
|
10
|
-
for (let
|
|
11
|
-
l += "&args[]=" + encodeURIComponent(arguments[
|
|
11
|
+
for (let d = 1; d < arguments.length; d += 1)
|
|
12
|
+
l += "&args[]=" + encodeURIComponent(arguments[d]);
|
|
12
13
|
return "Minified MUI error #" + s + "; visit " + l + " for the full message.";
|
|
13
14
|
}
|
|
14
15
|
const X = "Input";
|
|
15
|
-
function
|
|
16
|
+
function Pe(s) {
|
|
16
17
|
return he(X, s);
|
|
17
18
|
}
|
|
18
|
-
|
|
19
|
-
const Z = /* @__PURE__ */
|
|
19
|
+
ye(X, ["root", "formControl", "focused", "disabled", "error", "multiline", "input", "inputMultiline", "inputTypeSearch", "adornedStart", "adornedEnd"]);
|
|
20
|
+
const Z = /* @__PURE__ */ q.createContext(void 0);
|
|
20
21
|
process.env.NODE_ENV !== "production" && (Z.displayName = "FormControlContext");
|
|
21
|
-
function
|
|
22
|
-
return
|
|
22
|
+
function Ne() {
|
|
23
|
+
return q.useContext(Z);
|
|
23
24
|
}
|
|
24
|
-
function
|
|
25
|
+
function ve(s = {}) {
|
|
25
26
|
const {
|
|
26
27
|
defaultValue: l,
|
|
27
|
-
disabled:
|
|
28
|
-
error:
|
|
28
|
+
disabled: d = !1,
|
|
29
|
+
error: u = !1,
|
|
29
30
|
onBlur: c,
|
|
30
31
|
onChange: m,
|
|
31
32
|
onFocus: x,
|
|
32
33
|
required: P = !1,
|
|
33
|
-
value:
|
|
34
|
+
value: E,
|
|
34
35
|
inputRef: N
|
|
35
|
-
} = s, n =
|
|
36
|
-
let
|
|
36
|
+
} = s, n = Ne();
|
|
37
|
+
let g, f, b, C, y;
|
|
37
38
|
if (n) {
|
|
38
|
-
var
|
|
39
|
-
if (
|
|
40
|
-
const
|
|
41
|
-
|
|
39
|
+
var F, _, I;
|
|
40
|
+
if (g = void 0, f = (F = n.disabled) != null ? F : !1, b = (_ = n.error) != null ? _ : !1, C = (I = n.required) != null ? I : !1, y = n.value, process.env.NODE_ENV !== "production") {
|
|
41
|
+
const o = ["defaultValue", "disabled", "error", "required", "value"].filter((t) => s[t] !== void 0);
|
|
42
|
+
o.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: ${o.join(", ")}`].join(`
|
|
42
43
|
`));
|
|
43
44
|
}
|
|
44
45
|
} else
|
|
45
|
-
|
|
46
|
+
g = l, f = d, b = u, C = P, y = E;
|
|
46
47
|
const {
|
|
47
48
|
current: k
|
|
48
|
-
} =
|
|
49
|
-
process.env.NODE_ENV !== "production" &&
|
|
49
|
+
} = q.useRef(y != null), B = q.useCallback((o) => {
|
|
50
|
+
process.env.NODE_ENV !== "production" && o && o.nodeName !== "INPUT" && !o.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
|
`));
|
|
51
|
-
}, []),
|
|
52
|
-
|
|
53
|
-
!n &&
|
|
54
|
-
}, [n,
|
|
55
|
-
const
|
|
52
|
+
}, []), w = q.useRef(null), O = ge(w, N, B), [v, a] = q.useState(!1);
|
|
53
|
+
q.useEffect(() => {
|
|
54
|
+
!n && f && v && (a(!1), c == null || c());
|
|
55
|
+
}, [n, f, v, c]);
|
|
56
|
+
const U = (o) => (t) => {
|
|
56
57
|
var r;
|
|
57
58
|
if (n != null && n.disabled) {
|
|
58
|
-
|
|
59
|
+
t.stopPropagation();
|
|
59
60
|
return;
|
|
60
61
|
}
|
|
61
|
-
if ((r =
|
|
62
|
+
if ((r = o.onFocus) == null || r.call(o, t), n && n.onFocus) {
|
|
62
63
|
var i;
|
|
63
64
|
n == null || (i = n.onFocus) == null || i.call(n);
|
|
64
65
|
} else
|
|
65
66
|
a(!0);
|
|
66
|
-
},
|
|
67
|
+
}, V = (o) => (t) => {
|
|
67
68
|
var r;
|
|
68
|
-
(r =
|
|
69
|
-
},
|
|
70
|
-
var i,
|
|
71
|
-
if (!k && (
|
|
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." :
|
|
73
|
-
n == null || (i = n.onChange) == null || i.call(n,
|
|
74
|
-
}, A = (
|
|
69
|
+
(r = o.onBlur) == null || r.call(o, t), n && n.onBlur ? n.onBlur() : a(!1);
|
|
70
|
+
}, S = (o) => (t, ...r) => {
|
|
71
|
+
var i, M;
|
|
72
|
+
if (!k && (t.target || w.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." : xe(17));
|
|
74
|
+
n == null || (i = n.onChange) == null || i.call(n, t), (M = o.onChange) == null || M.call(o, t, ...r);
|
|
75
|
+
}, A = (o) => (t) => {
|
|
75
76
|
var r;
|
|
76
|
-
|
|
77
|
+
w.current && t.currentTarget === t.target && w.current.focus(), (r = o.onClick) == null || r.call(o, t);
|
|
77
78
|
};
|
|
78
79
|
return {
|
|
79
|
-
disabled:
|
|
80
|
-
error:
|
|
81
|
-
focused:
|
|
80
|
+
disabled: f,
|
|
81
|
+
error: b,
|
|
82
|
+
focused: v,
|
|
82
83
|
formControlContext: n,
|
|
83
|
-
getInputProps: (
|
|
84
|
-
const r =
|
|
84
|
+
getInputProps: (o = {}) => {
|
|
85
|
+
const r = h({}, {
|
|
85
86
|
onBlur: c,
|
|
86
87
|
onChange: m,
|
|
87
88
|
onFocus: x
|
|
88
|
-
},
|
|
89
|
-
onBlur:
|
|
90
|
-
onChange:
|
|
91
|
-
onFocus:
|
|
89
|
+
}, Y(o)), i = h({}, r, {
|
|
90
|
+
onBlur: V(r),
|
|
91
|
+
onChange: S(r),
|
|
92
|
+
onFocus: U(r)
|
|
92
93
|
});
|
|
93
|
-
return
|
|
94
|
-
"aria-invalid":
|
|
95
|
-
defaultValue:
|
|
96
|
-
value:
|
|
97
|
-
required:
|
|
98
|
-
disabled:
|
|
99
|
-
},
|
|
100
|
-
ref:
|
|
94
|
+
return h({}, i, {
|
|
95
|
+
"aria-invalid": b || void 0,
|
|
96
|
+
defaultValue: g,
|
|
97
|
+
value: y,
|
|
98
|
+
required: C,
|
|
99
|
+
disabled: f
|
|
100
|
+
}, o, {
|
|
101
|
+
ref: O
|
|
101
102
|
}, i);
|
|
102
103
|
},
|
|
103
|
-
getRootProps: (
|
|
104
|
-
const
|
|
105
|
-
return
|
|
104
|
+
getRootProps: (o = {}) => {
|
|
105
|
+
const t = Y(s, ["onBlur", "onChange", "onFocus"]), r = h({}, t, Y(o));
|
|
106
|
+
return h({}, o, r, {
|
|
106
107
|
onClick: A(r)
|
|
107
108
|
});
|
|
108
109
|
},
|
|
109
|
-
inputRef:
|
|
110
|
-
required:
|
|
111
|
-
value:
|
|
110
|
+
inputRef: O,
|
|
111
|
+
required: C,
|
|
112
|
+
value: y
|
|
112
113
|
};
|
|
113
114
|
}
|
|
114
115
|
const Re = ["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"], Ee = (s) => {
|
|
115
116
|
const {
|
|
116
117
|
disabled: l,
|
|
117
|
-
error:
|
|
118
|
-
focused:
|
|
118
|
+
error: d,
|
|
119
|
+
focused: u,
|
|
119
120
|
formControlContext: c,
|
|
120
121
|
multiline: m,
|
|
121
122
|
startAdornment: x,
|
|
122
123
|
endAdornment: P
|
|
123
124
|
} = s;
|
|
124
|
-
return
|
|
125
|
-
root: ["root", l && "disabled",
|
|
125
|
+
return we({
|
|
126
|
+
root: ["root", l && "disabled", d && "error", u && "focused", !!c && "formControl", m && "multiline", !!x && "adornedStart", !!P && "adornedEnd"],
|
|
126
127
|
input: ["input", l && "disabled", m && "multiline"]
|
|
127
|
-
},
|
|
128
|
-
}, ee = /* @__PURE__ */
|
|
129
|
-
var
|
|
128
|
+
}, qe(Pe));
|
|
129
|
+
}, ee = /* @__PURE__ */ q.forwardRef(function(l, d) {
|
|
130
|
+
var u, c, m;
|
|
130
131
|
const {
|
|
131
132
|
"aria-describedby": x,
|
|
132
133
|
"aria-label": P,
|
|
133
|
-
"aria-labelledby":
|
|
134
|
+
"aria-labelledby": E,
|
|
134
135
|
autoComplete: N,
|
|
135
136
|
autoFocus: n,
|
|
136
|
-
className:
|
|
137
|
-
defaultValue:
|
|
138
|
-
disabled:
|
|
139
|
-
endAdornment:
|
|
140
|
-
error:
|
|
141
|
-
id:
|
|
137
|
+
className: g,
|
|
138
|
+
defaultValue: f,
|
|
139
|
+
disabled: b,
|
|
140
|
+
endAdornment: C,
|
|
141
|
+
error: y,
|
|
142
|
+
id: F,
|
|
142
143
|
multiline: _ = !1,
|
|
143
|
-
name:
|
|
144
|
+
name: I,
|
|
144
145
|
onClick: k,
|
|
145
146
|
onChange: B,
|
|
146
|
-
onKeyDown:
|
|
147
|
-
onKeyUp:
|
|
148
|
-
onFocus:
|
|
147
|
+
onKeyDown: w,
|
|
148
|
+
onKeyUp: O,
|
|
149
|
+
onFocus: v,
|
|
149
150
|
onBlur: a,
|
|
150
|
-
placeholder:
|
|
151
|
-
readOnly:
|
|
152
|
-
required:
|
|
151
|
+
placeholder: U,
|
|
152
|
+
readOnly: V,
|
|
153
|
+
required: S,
|
|
153
154
|
startAdornment: A,
|
|
154
155
|
value: D,
|
|
155
156
|
type: j,
|
|
156
|
-
rows:
|
|
157
|
-
slotProps:
|
|
157
|
+
rows: o,
|
|
158
|
+
slotProps: t = {},
|
|
158
159
|
slots: r = {},
|
|
159
160
|
minRows: i,
|
|
160
|
-
maxRows:
|
|
161
|
-
} = l,
|
|
162
|
-
getRootProps:
|
|
163
|
-
getInputProps:
|
|
161
|
+
maxRows: M
|
|
162
|
+
} = l, W = be(l, Re), {
|
|
163
|
+
getRootProps: oe,
|
|
164
|
+
getInputProps: te,
|
|
164
165
|
focused: ne,
|
|
165
166
|
formControlContext: re,
|
|
166
167
|
error: ae,
|
|
167
168
|
disabled: se
|
|
168
|
-
} =
|
|
169
|
-
disabled:
|
|
170
|
-
defaultValue:
|
|
171
|
-
error:
|
|
169
|
+
} = ve({
|
|
170
|
+
disabled: b,
|
|
171
|
+
defaultValue: f,
|
|
172
|
+
error: y,
|
|
172
173
|
onBlur: a,
|
|
173
174
|
onClick: k,
|
|
174
175
|
onChange: B,
|
|
175
|
-
onFocus:
|
|
176
|
-
required:
|
|
176
|
+
onFocus: v,
|
|
177
|
+
required: S,
|
|
177
178
|
value: D
|
|
178
|
-
}),
|
|
179
|
+
}), z = _ ? void 0 : j ?? "text", $ = h({}, l, {
|
|
179
180
|
disabled: se,
|
|
180
181
|
error: ae,
|
|
181
182
|
focused: ne,
|
|
182
183
|
formControlContext: re,
|
|
183
184
|
multiline: _,
|
|
184
|
-
type:
|
|
185
|
+
type: z
|
|
185
186
|
}), G = Ee($), le = {
|
|
186
187
|
"aria-describedby": x,
|
|
187
188
|
"aria-label": P,
|
|
188
|
-
"aria-labelledby":
|
|
189
|
+
"aria-labelledby": E,
|
|
189
190
|
autoComplete: N,
|
|
190
191
|
autoFocus: n,
|
|
191
|
-
id:
|
|
192
|
-
onKeyDown:
|
|
193
|
-
onKeyUp:
|
|
194
|
-
name:
|
|
195
|
-
placeholder:
|
|
196
|
-
readOnly:
|
|
197
|
-
type:
|
|
198
|
-
}, J = (
|
|
192
|
+
id: F,
|
|
193
|
+
onKeyDown: w,
|
|
194
|
+
onKeyUp: O,
|
|
195
|
+
name: I,
|
|
196
|
+
placeholder: U,
|
|
197
|
+
readOnly: V,
|
|
198
|
+
type: z
|
|
199
|
+
}, J = (u = r.root) != null ? u : "div", ie = Q({
|
|
199
200
|
elementType: J,
|
|
200
|
-
getSlotProps:
|
|
201
|
-
externalSlotProps:
|
|
202
|
-
externalForwardedProps:
|
|
201
|
+
getSlotProps: oe,
|
|
202
|
+
externalSlotProps: t.root,
|
|
203
|
+
externalForwardedProps: W,
|
|
203
204
|
additionalProps: {
|
|
204
|
-
ref:
|
|
205
|
+
ref: d
|
|
205
206
|
},
|
|
206
207
|
ownerState: $,
|
|
207
|
-
className: [G.root,
|
|
208
|
+
className: [G.root, g]
|
|
208
209
|
}), K = _ ? (c = r.textarea) != null ? c : "textarea" : (m = r.input) != null ? m : "input", ue = Q({
|
|
209
210
|
elementType: K,
|
|
210
|
-
getSlotProps: (pe) =>
|
|
211
|
-
externalSlotProps:
|
|
212
|
-
additionalProps:
|
|
213
|
-
rows: _ ?
|
|
214
|
-
}, _ && !
|
|
215
|
-
minRows:
|
|
216
|
-
maxRows:
|
|
211
|
+
getSlotProps: (pe) => te(h({}, le, pe)),
|
|
212
|
+
externalSlotProps: t.input,
|
|
213
|
+
additionalProps: h({
|
|
214
|
+
rows: _ ? o : void 0
|
|
215
|
+
}, _ && !Ce(K) && {
|
|
216
|
+
minRows: o || i,
|
|
217
|
+
maxRows: o || M
|
|
217
218
|
}),
|
|
218
219
|
ownerState: $,
|
|
219
220
|
className: G.input
|
|
220
221
|
});
|
|
221
|
-
return process.env.NODE_ENV !== "production" && _ &&
|
|
222
|
-
children: [A, /* @__PURE__ */
|
|
222
|
+
return process.env.NODE_ENV !== "production" && _ && o && (i || M) && console.warn("MUI: You can not use the `minRows` or `maxRows` props when the input `rows` prop is set."), /* @__PURE__ */ H(J, h({}, ie, {
|
|
223
|
+
children: [A, /* @__PURE__ */ T(K, h({}, ue)), C]
|
|
223
224
|
}));
|
|
224
225
|
});
|
|
225
226
|
process.env.NODE_ENV !== "production" && (ee.propTypes = {
|
|
@@ -372,75 +373,70 @@ process.env.NODE_ENV !== "production" && (ee.propTypes = {
|
|
|
372
373
|
*/
|
|
373
374
|
value: e.any
|
|
374
375
|
});
|
|
375
|
-
const Fe =
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
"u-typography-
|
|
382
|
-
"u-typography-
|
|
383
|
-
"u-typography-
|
|
384
|
-
"u-typography-
|
|
385
|
-
"u-typography-
|
|
386
|
-
"
|
|
387
|
-
"u-typography-base": "_u-typography-
|
|
388
|
-
"u-typography-base--
|
|
389
|
-
"u-typography-base--
|
|
390
|
-
"u-typography-base--
|
|
391
|
-
"
|
|
392
|
-
|
|
393
|
-
"u-typography-base--bold": "_u-typography-base--bold_6va87_65",
|
|
394
|
-
"u-typography-base--strikethrough": "_u-typography-base--strikethrough_6va87_68",
|
|
395
|
-
"u-typography-base--underlined": "_u-typography-base--underlined_6va87_71",
|
|
396
|
-
"u-typography-base--strikethrough-underlined": "_u-typography-base--strikethrough-underlined_6va87_74",
|
|
376
|
+
const Fe = "_input_1iqdc_57", Ie = "_input__label_1iqdc_81", p = {
|
|
377
|
+
"u-typography-h1": "_u-typography-h1_1iqdc_1",
|
|
378
|
+
"u-typography-h2": "_u-typography-h2_1iqdc_8",
|
|
379
|
+
"u-typography-h3": "_u-typography-h3_1iqdc_15",
|
|
380
|
+
"u-typography-h4": "_u-typography-h4_1iqdc_22",
|
|
381
|
+
"u-typography-h5": "_u-typography-h5_1iqdc_29",
|
|
382
|
+
"u-typography-h6": "_u-typography-h6_1iqdc_36",
|
|
383
|
+
"u-typography-base": "_u-typography-base_1iqdc_43",
|
|
384
|
+
"u-typography-base--xxl": "_u-typography-base--xxl_1iqdc_49",
|
|
385
|
+
"u-typography-base--xl": "_u-typography-base--xl_1iqdc_53",
|
|
386
|
+
"u-typography-base--lg": "_u-typography-base--lg_1iqdc_57",
|
|
387
|
+
"input__input-el": "_input__input-el_1iqdc_57",
|
|
388
|
+
"u-typography-base--sm": "_u-typography-base--sm_1iqdc_61",
|
|
389
|
+
"u-typography-base--bold": "_u-typography-base--bold_1iqdc_65",
|
|
390
|
+
"u-typography-base--strikethrough": "_u-typography-base--strikethrough_1iqdc_68",
|
|
391
|
+
"u-typography-base--underlined": "_u-typography-base--underlined_1iqdc_71",
|
|
392
|
+
"u-typography-base--strikethrough-underlined": "_u-typography-base--strikethrough-underlined_1iqdc_74",
|
|
393
|
+
input: Fe,
|
|
397
394
|
input__label: Ie,
|
|
398
|
-
"input__input-el-wrapper": "_input__input-el-
|
|
399
|
-
"input__left-icon": "_input__left-
|
|
400
|
-
"input__right-icon": "_input__right-
|
|
401
|
-
"input__messages-wrapper": "_input__messages-
|
|
402
|
-
"input__info-message": "_input__info-
|
|
403
|
-
"input__error-message": "_input__error-
|
|
404
|
-
"input__chars-counter": "_input__chars-
|
|
405
|
-
"input--disabled": "_input--
|
|
406
|
-
input:
|
|
407
|
-
"input--
|
|
408
|
-
|
|
409
|
-
}, Me = de(
|
|
395
|
+
"input__input-el-wrapper": "_input__input-el-wrapper_1iqdc_86",
|
|
396
|
+
"input__left-icon": "_input__left-icon_1iqdc_105",
|
|
397
|
+
"input__right-icon": "_input__right-icon_1iqdc_105",
|
|
398
|
+
"input__messages-wrapper": "_input__messages-wrapper_1iqdc_117",
|
|
399
|
+
"input__info-message": "_input__info-message_1iqdc_130",
|
|
400
|
+
"input__error-message": "_input__error-message_1iqdc_130",
|
|
401
|
+
"input__chars-counter": "_input__chars-counter_1iqdc_141",
|
|
402
|
+
"input--disabled": "_input--disabled_1iqdc_145",
|
|
403
|
+
"input--focused": "_input--focused_1iqdc_151",
|
|
404
|
+
"input--error": "_input--error_1iqdc_154"
|
|
405
|
+
}, Se = de(
|
|
410
406
|
({
|
|
411
407
|
label: s,
|
|
412
408
|
infoMessage: l,
|
|
413
|
-
error:
|
|
414
|
-
errorMessage:
|
|
409
|
+
error: d,
|
|
410
|
+
errorMessage: u,
|
|
415
411
|
leftIcon: c,
|
|
416
412
|
rightIcon: m,
|
|
417
413
|
id: x,
|
|
418
414
|
disabled: P,
|
|
419
|
-
type:
|
|
415
|
+
type: E = "text",
|
|
420
416
|
maxLength: N,
|
|
421
417
|
hideCharsCounter: n = !1,
|
|
422
|
-
onChange:
|
|
423
|
-
classNameWrapper:
|
|
424
|
-
classNameLabel:
|
|
425
|
-
classNameInput:
|
|
426
|
-
classNameInfoMessage:
|
|
427
|
-
classNameErrorMessage:
|
|
418
|
+
onChange: g,
|
|
419
|
+
classNameWrapper: f,
|
|
420
|
+
classNameLabel: b,
|
|
421
|
+
classNameInput: C,
|
|
422
|
+
classNameInfoMessage: y,
|
|
423
|
+
classNameErrorMessage: F,
|
|
428
424
|
classNameCharsCounter: _,
|
|
429
|
-
"data-testid-wrapper":
|
|
425
|
+
"data-testid-wrapper": I,
|
|
430
426
|
"data-testid-label": k,
|
|
431
427
|
"data-testid-input": B,
|
|
432
|
-
"data-testid-infoMessage":
|
|
433
|
-
"data-testid-errorMessage":
|
|
434
|
-
"data-testid-charsCounter":
|
|
428
|
+
"data-testid-infoMessage": w,
|
|
429
|
+
"data-testid-errorMessage": O,
|
|
430
|
+
"data-testid-charsCounter": v,
|
|
435
431
|
...a
|
|
436
|
-
},
|
|
437
|
-
const [
|
|
432
|
+
}, U) => {
|
|
433
|
+
const [V, S] = ce(0), A = _e(), D = x || `input_${A}`;
|
|
438
434
|
Object.assign(a, { "data-testid": B });
|
|
439
|
-
const j = (
|
|
435
|
+
const j = (t) => {
|
|
440
436
|
var r, i;
|
|
441
|
-
|
|
442
|
-
},
|
|
443
|
-
type:
|
|
437
|
+
S((i = (r = t == null ? void 0 : t.target) == null ? void 0 : r.value) == null ? void 0 : i.length), g && g(t);
|
|
438
|
+
}, o = me(() => a.multiline !== !0 ? {
|
|
439
|
+
type: E,
|
|
444
440
|
multiline: a.multiline
|
|
445
441
|
} : {
|
|
446
442
|
type: void 0,
|
|
@@ -449,64 +445,64 @@ const Fe = (s) => /* @__PURE__ */ f.createElement("svg", { xmlns: "http://www.w3
|
|
|
449
445
|
minRows: a == null ? void 0 : a.minRows,
|
|
450
446
|
maxRows: a == null ? void 0 : a.maxRows
|
|
451
447
|
}, [a]);
|
|
452
|
-
return /* @__PURE__ */
|
|
453
|
-
s && /* @__PURE__ */
|
|
448
|
+
return /* @__PURE__ */ H("div", { className: R(p.input, f), "data-testid": I, children: [
|
|
449
|
+
s && /* @__PURE__ */ T(
|
|
454
450
|
L,
|
|
455
451
|
{
|
|
456
452
|
element: "label",
|
|
457
453
|
elementProps: { htmlFor: D },
|
|
458
|
-
className:
|
|
454
|
+
className: R(p.input__label, b),
|
|
459
455
|
"data-testid": k,
|
|
460
456
|
children: s
|
|
461
457
|
}
|
|
462
458
|
),
|
|
463
|
-
/* @__PURE__ */
|
|
459
|
+
/* @__PURE__ */ T(
|
|
464
460
|
ee,
|
|
465
461
|
{
|
|
466
462
|
id: D,
|
|
467
463
|
disabled: P,
|
|
468
|
-
error: typeof
|
|
464
|
+
error: typeof d == "boolean" ? d : !!u,
|
|
469
465
|
"aria-label": s,
|
|
470
466
|
slotProps: {
|
|
471
|
-
root: (
|
|
472
|
-
className:
|
|
473
|
-
[
|
|
474
|
-
[
|
|
475
|
-
[
|
|
467
|
+
root: (t) => ({
|
|
468
|
+
className: R(p["input__input-el-wrapper"], {
|
|
469
|
+
[p["input--disabled"]]: t.disabled,
|
|
470
|
+
[p["input--focused"]]: t.focused,
|
|
471
|
+
[p["input--error"]]: t.error
|
|
476
472
|
})
|
|
477
473
|
}),
|
|
478
474
|
input: {
|
|
479
|
-
ref:
|
|
480
|
-
className:
|
|
475
|
+
ref: U,
|
|
476
|
+
className: R(p["input__input-el"], C),
|
|
481
477
|
maxLength: N,
|
|
482
478
|
onChange: j,
|
|
483
479
|
...a
|
|
484
480
|
}
|
|
485
481
|
},
|
|
486
|
-
startAdornment: c && /* @__PURE__ */
|
|
487
|
-
endAdornment: m && /* @__PURE__ */
|
|
488
|
-
...
|
|
482
|
+
startAdornment: c && /* @__PURE__ */ T("span", { className: p["input__left-icon"], children: c }),
|
|
483
|
+
endAdornment: m && /* @__PURE__ */ T("span", { className: p["input__right-icon"], children: m }),
|
|
484
|
+
...o
|
|
489
485
|
}
|
|
490
486
|
),
|
|
491
|
-
/* @__PURE__ */
|
|
492
|
-
(
|
|
487
|
+
/* @__PURE__ */ H("div", { className: p["input__messages-wrapper"], children: [
|
|
488
|
+
(u || l) && /* @__PURE__ */ H(
|
|
493
489
|
L,
|
|
494
490
|
{
|
|
495
|
-
className:
|
|
496
|
-
"data-testid":
|
|
491
|
+
className: u ? R(p["input__error-message"], F) : R(p["input__info-message"], y),
|
|
492
|
+
"data-testid": u ? O : w,
|
|
497
493
|
children: [
|
|
498
|
-
/* @__PURE__ */
|
|
499
|
-
|
|
494
|
+
/* @__PURE__ */ T(fe, { icon: u ? "circle-exclamation" : "circle-info" }),
|
|
495
|
+
u || l
|
|
500
496
|
]
|
|
501
497
|
}
|
|
502
498
|
),
|
|
503
|
-
N && !n && /* @__PURE__ */
|
|
499
|
+
N && !n && /* @__PURE__ */ H(
|
|
504
500
|
L,
|
|
505
501
|
{
|
|
506
|
-
className:
|
|
507
|
-
"data-testid":
|
|
502
|
+
className: R(p["input__chars-counter"], _),
|
|
503
|
+
"data-testid": v,
|
|
508
504
|
children: [
|
|
509
|
-
|
|
505
|
+
V,
|
|
510
506
|
" / ",
|
|
511
507
|
N
|
|
512
508
|
]
|
|
@@ -517,5 +513,5 @@ const Fe = (s) => /* @__PURE__ */ f.createElement("svg", { xmlns: "http://www.w3
|
|
|
517
513
|
}
|
|
518
514
|
);
|
|
519
515
|
export {
|
|
520
|
-
|
|
516
|
+
Se as Input
|
|
521
517
|
};
|
|
@@ -15,9 +15,11 @@ export type PopoverProps = {
|
|
|
15
15
|
className?: string;
|
|
16
16
|
/** Id to be applied as `data-testid` on the root element */
|
|
17
17
|
'data-testid'?: string;
|
|
18
|
+
/** Callback fired when a "click away" event is detected. */
|
|
19
|
+
onClickAway?: (event: MouseEvent | TouchEvent) => void;
|
|
18
20
|
};
|
|
19
21
|
export declare const Popover: {
|
|
20
|
-
({ anchorRef, open, children, placement, className, offset, "data-testid": dataTestId, }: PopoverProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
({ anchorRef, open, children, placement, className, offset, "data-testid": dataTestId, onClickAway, }: PopoverProps): import("react/jsx-runtime").JSX.Element;
|
|
21
23
|
Header: ({ children }: {
|
|
22
24
|
children: import('react').ReactNode;
|
|
23
25
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { c as
|
|
3
|
-
import { s as
|
|
4
|
-
import { PopoverBody as
|
|
5
|
-
import { PopoverFooter as
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { c as f } from "../../clsx-DB4S2d7J.js";
|
|
3
|
+
import { s as v } from "../../Popover.module-B4boCutS.js";
|
|
4
|
+
import { PopoverBody as l } from "./PopoverBody.js";
|
|
5
|
+
import { PopoverFooter as n } from "./PopoverFooter.js";
|
|
6
6
|
import { PopoverHeader as P } from "./PopoverHeader.js";
|
|
7
|
-
import { P as
|
|
8
|
-
|
|
7
|
+
import { P as y } from "../../Popup-Ck3XlWMq.js";
|
|
8
|
+
import { C as h } from "../../ClickAwayListener-DbEYZpyh.js";
|
|
9
|
+
const r = ({
|
|
9
10
|
anchorRef: t,
|
|
10
|
-
open:
|
|
11
|
+
open: m,
|
|
11
12
|
children: p,
|
|
12
|
-
placement:
|
|
13
|
+
placement: i,
|
|
13
14
|
className: s,
|
|
14
15
|
offset: a,
|
|
15
|
-
"data-testid":
|
|
16
|
-
|
|
17
|
-
o.
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
"data-testid": d,
|
|
17
|
+
onClickAway: e
|
|
18
|
+
}) => /* @__PURE__ */ o(h, { onClickAway: (c) => e ? e(c) : void 0, children: /* @__PURE__ */ o(y, { offset: a, placement: i, open: m, anchor: t, children: /* @__PURE__ */ o("div", { "data-testid": d, className: f(v.popover, s), children: p }) }) });
|
|
19
|
+
r.Header = P;
|
|
20
|
+
r.Footer = n;
|
|
21
|
+
r.Body = l;
|
|
20
22
|
export {
|
|
21
|
-
|
|
23
|
+
r as Popover
|
|
22
24
|
};
|
|
@@ -4,7 +4,7 @@ import { StoryObj } from '@storybook/react';
|
|
|
4
4
|
declare const meta: {
|
|
5
5
|
title: string;
|
|
6
6
|
component: {
|
|
7
|
-
({ anchorRef, open, children, placement, className, offset, "data-testid": dataTestId, }: PopoverProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
({ anchorRef, open, children, placement, className, offset, "data-testid": dataTestId, onClickAway, }: PopoverProps): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
Header: ({ children }: {
|
|
9
9
|
children: import('react').ReactNode;
|
|
10
10
|
}) => import("react/jsx-runtime").JSX.Element;
|