@pismo/marola 2.1.63 → 2.1.64
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/assets/Input.css +1 -1
- package/dist/components/Input/Input.d.ts +2 -0
- package/dist/components/Input/Input.js +320 -314
- package/dist/components/Input/Input.stories.d.ts +2 -0
- package/dist/components/InputSearch/InputSearch.d.ts +1 -0
- package/dist/components/InputSearch/InputSearch.stories.d.ts +1 -0
- package/package.json +5 -4
package/dist/assets/Input.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
._u-typography-
|
|
1
|
+
._u-typography-h1_14020_2{font-size:var(--heading-font-size-1);font-weight:var(--heading-font-weight);line-height:var(--heading-line-height-1);margin:0}._u-typography-h2_14020_9{font-size:var(--heading-font-size-2);font-weight:var(--heading-font-weight);line-height:var(--heading-line-height-2);margin:0}._u-typography-h3_14020_16{font-size:var(--heading-font-size-3);font-weight:var(--heading-font-weight);line-height:var(--heading-line-height-3);margin:0}._u-typography-h4_14020_23{font-size:var(--heading-font-size-4);font-weight:var(--heading-font-weight);line-height:var(--heading-line-height-4);margin:0}._u-typography-h5_14020_30{font-size:var(--heading-font-size-5);font-weight:var(--heading-font-weight);line-height:var(--heading-line-height-5);margin:0}._u-typography-h6_14020_37{font-size:var(--heading-font-size-6);font-weight:var(--heading-font-weight);line-height:var(--heading-line-height-6);margin:0}._u-typography-base_14020_44{margin:0;font-size:var(--base-font-size);font-weight:var(--base-weight);line-height:var(--base-line-height)}._u-typography-base--xxl_14020_50{font-size:var(--base-font-size-xxl);line-height:var(--base-line-height-xxl)}._u-typography-base--xl_14020_54{font-size:var(--base-font-size-xl);line-height:var(--base-line-height-xl)}._u-typography-base--lg_14020_58,._input__input-el_14020_58{font-size:var(--base-font-size-lg);line-height:var(--base-line-height-lg)}._u-typography-base--sm_14020_62{font-size:var(--base-font-size-sm);line-height:var(--base-line-height-sm)}._u-typography-base--bold_14020_66,._input__input-el_14020_58{font-weight:var(--base-bold)}._u-typography-base--strikethrough_14020_69{text-decoration:line-through}._u-typography-base--underlined_14020_72{text-decoration:underline}._u-typography-base--strikethrough-underlined_14020_75{text-decoration:underline line-through}._input_14020_58{position:relative}._input_14020_58:has(._input__messages-wrapper_14020_82:not(:empty)){padding-bottom:1.6875rem}._input__labelWrapper_14020_85{display:flex;gap:.5rem;align-items:center;margin-bottom:.3125rem}._input__label_14020_85{display:block;color:var(--colors-neutral-text-color-text)}._input__labelHelp_14020_95{display:inline-flex;align-items:center;color:var(--colors-neutral-text-color-secondary)}._input__input-el-wrapper_14020_100{display:flex;align-items:center;height:2.5rem;border:solid .0625rem var(--gray-25);border-radius:.375rem;transition:all .3s}._input__input-el-wrapper_14020_100:has(textarea){height:auto}._input__input-el-wrapper_14020_100:has(input:disabled){background-color:var(--colors-neutral-bg-color-bg-container-disabled)}._input__input-el_14020_58{all:unset;width:100%;height:2.5rem;padding:0 1rem;color:var(--gray-90);outline:none}._input__input-el_14020_58::placeholder{color:var(--gray-50)}._input__left-icon_14020_125,._input__right-icon_14020_125{display:flex;align-items:center;justify-content:center;height:1rem}._input__left-icon_14020_125{padding-left:1rem}._input__right-icon_14020_125{padding-right:1rem}._input__messages-wrapper_14020_82{position:absolute;display:flex;gap:1rem;justify-content:space-between;width:100%}._input__messages-wrapper_14020_82:not(:empty){margin-top:.3125rem}._input__messages-wrapper_14020_82 svg{min-width:1rem;min-height:1rem}._input__info-message_14020_151,._input__error-message_14020_151{display:flex;gap:.375rem;align-items:center}._input__info-message_14020_151{color:var(--gray-75)}._input__error-message_14020_151{color:var(--alert)}._input__chars-counter_14020_162{margin-left:auto;color:var(--gray-75);white-space:nowrap}._input--disabled_14020_167 ._input__input-el_14020_58{color:var(--gray-50)}._input_14020_58:has(._input--disabled_14020_167) ._input__label_14020_85{color:var(--gray-25)}._input--focused_14020_173._input__input-el-wrapper_14020_100{border-color:var(--accent)}._input--error_14020_176._input__input-el-wrapper_14020_100{border-color:var(--alert)}._input__input-el-wrapper_14020_100:hover:not(._input--disabled_14020_167,._input--focused_14020_173,._input--error_14020_176){border-color:var(--gray-75)}textarea._input__input-el_14020_58{height:auto;padding:.5rem 1rem;overflow:hidden;resize:vertical}
|
|
@@ -4,6 +4,8 @@ type CustomInputTypeAttribute = Exclude<HTMLInputTypeAttribute, ExcludedInputTyp
|
|
|
4
4
|
export type SingleInputProps = InputHTMLAttributes<HTMLInputElement> & {
|
|
5
5
|
/** Label text */
|
|
6
6
|
label?: string;
|
|
7
|
+
/** Label help element */
|
|
8
|
+
labelHelp?: React.ReactNode;
|
|
7
9
|
/** Info message text */
|
|
8
10
|
infoMessage?: React.ReactNode;
|
|
9
11
|
/** Show the field layout as an error */
|
|
@@ -1,229 +1,229 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { formatDecimalValue as
|
|
5
|
-
import { c as
|
|
6
|
-
import { Icon as
|
|
7
|
-
import { Typography as
|
|
8
|
-
import { g as
|
|
9
|
-
import '../../assets/Input.css';function
|
|
1
|
+
import { jsxs as j, jsx as A } from "react/jsx-runtime";
|
|
2
|
+
import * as F from "react";
|
|
3
|
+
import { forwardRef as ye, useState as Ce, useId as ve, useRef as xe, useMemo as se } from "react";
|
|
4
|
+
import { formatDecimalValue as _e, allowOnlyIntegerNumbers as Pe, allowOnlyNumbers as Re, parseToInteger as Ee } from "../../utils/inputNumberAsText.js";
|
|
5
|
+
import { c as U } from "../../clsx-OuTLNxxd.js";
|
|
6
|
+
import { Icon as Ve } from "../Icon/Icon.js";
|
|
7
|
+
import { Typography as de } from "../Typography/Typography.js";
|
|
8
|
+
import { g as Fe, a as Se, u as Oe, f as pe, _ as y, b as Te, c as be, i as Ie, d as Be, e as Ue, P as n } from "../../useSlotProps-CYHDC4TN.js";
|
|
9
|
+
import '../../assets/Input.css';function je(r) {
|
|
10
10
|
let i = "https://mui.com/production-error/?code=" + r;
|
|
11
|
-
for (let
|
|
12
|
-
i += "&args[]=" + encodeURIComponent(arguments[
|
|
11
|
+
for (let f = 1; f < arguments.length; f += 1)
|
|
12
|
+
i += "&args[]=" + encodeURIComponent(arguments[f]);
|
|
13
13
|
return "Minified MUI error #" + r + "; visit " + i + " for the full message.";
|
|
14
14
|
}
|
|
15
15
|
const ge = "Input";
|
|
16
|
-
function
|
|
17
|
-
return
|
|
16
|
+
function Ae(r) {
|
|
17
|
+
return Fe(ge, r);
|
|
18
18
|
}
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
process.env.NODE_ENV !== "production" && (
|
|
22
|
-
function
|
|
23
|
-
return
|
|
19
|
+
Se(ge, ["root", "formControl", "focused", "disabled", "error", "multiline", "input", "inputMultiline", "inputTypeSearch", "adornedStart", "adornedEnd"]);
|
|
20
|
+
const he = /* @__PURE__ */ F.createContext(void 0);
|
|
21
|
+
process.env.NODE_ENV !== "production" && (he.displayName = "FormControlContext");
|
|
22
|
+
function ke() {
|
|
23
|
+
return F.useContext(he);
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function He(r = {}) {
|
|
26
26
|
const {
|
|
27
27
|
defaultValue: i,
|
|
28
|
-
disabled:
|
|
29
|
-
error:
|
|
30
|
-
onBlur:
|
|
28
|
+
disabled: f = !1,
|
|
29
|
+
error: C = !1,
|
|
30
|
+
onBlur: u,
|
|
31
31
|
onChange: h,
|
|
32
|
-
onFocus:
|
|
33
|
-
required:
|
|
34
|
-
value:
|
|
35
|
-
inputRef:
|
|
36
|
-
} = r,
|
|
37
|
-
let
|
|
38
|
-
if (
|
|
39
|
-
var
|
|
40
|
-
if (
|
|
41
|
-
const
|
|
42
|
-
|
|
32
|
+
onFocus: x,
|
|
33
|
+
required: S = !1,
|
|
34
|
+
value: k,
|
|
35
|
+
inputRef: m
|
|
36
|
+
} = r, l = ke();
|
|
37
|
+
let P, p, _, v, b;
|
|
38
|
+
if (l) {
|
|
39
|
+
var H, g, N;
|
|
40
|
+
if (P = void 0, p = (H = l.disabled) != null ? H : !1, _ = (g = l.error) != null ? g : !1, v = (N = l.required) != null ? N : !1, b = l.value, process.env.NODE_ENV !== "production") {
|
|
41
|
+
const o = ["defaultValue", "disabled", "error", "required", "value"].filter((e) => r[e] !== 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(`
|
|
43
43
|
`));
|
|
44
44
|
}
|
|
45
45
|
} else
|
|
46
|
-
|
|
46
|
+
P = i, p = f, _ = C, v = S, b = k;
|
|
47
47
|
const {
|
|
48
|
-
current:
|
|
49
|
-
} =
|
|
50
|
-
process.env.NODE_ENV !== "production" &&
|
|
48
|
+
current: R
|
|
49
|
+
} = F.useRef(b != null), q = F.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(`
|
|
51
51
|
`));
|
|
52
|
-
}, []),
|
|
53
|
-
|
|
54
|
-
!
|
|
55
|
-
}, [
|
|
56
|
-
const D = (
|
|
57
|
-
var
|
|
58
|
-
if (
|
|
59
|
-
|
|
52
|
+
}, []), E = F.useRef(null), M = Oe(E, m, q), [O, T] = F.useState(!1);
|
|
53
|
+
F.useEffect(() => {
|
|
54
|
+
!l && p && O && (T(!1), u == null || u());
|
|
55
|
+
}, [l, p, O, u]);
|
|
56
|
+
const D = (o) => (e) => {
|
|
57
|
+
var a;
|
|
58
|
+
if (l != null && l.disabled) {
|
|
59
|
+
e.stopPropagation();
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
62
|
-
if ((
|
|
63
|
-
var
|
|
64
|
-
|
|
62
|
+
if ((a = o.onFocus) == null || a.call(o, e), l && l.onFocus) {
|
|
63
|
+
var c;
|
|
64
|
+
l == null || (c = l.onFocus) == null || c.call(l);
|
|
65
65
|
} else
|
|
66
|
-
|
|
67
|
-
}, $ = (
|
|
68
|
-
var
|
|
69
|
-
(
|
|
70
|
-
},
|
|
71
|
-
var
|
|
72
|
-
if (!
|
|
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." :
|
|
74
|
-
|
|
75
|
-
},
|
|
76
|
-
var
|
|
77
|
-
|
|
66
|
+
T(!0);
|
|
67
|
+
}, $ = (o) => (e) => {
|
|
68
|
+
var a;
|
|
69
|
+
(a = o.onBlur) == null || a.call(o, e), l && l.onBlur ? l.onBlur() : T(!1);
|
|
70
|
+
}, W = (o) => (e, ...a) => {
|
|
71
|
+
var c, V;
|
|
72
|
+
if (!R && (e.target || E.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." : je(17));
|
|
74
|
+
l == null || (c = l.onChange) == null || c.call(l, e), (V = o.onChange) == null || V.call(o, e, ...a);
|
|
75
|
+
}, Y = (o) => (e) => {
|
|
76
|
+
var a;
|
|
77
|
+
E.current && e.currentTarget === e.target && E.current.focus(), (a = o.onClick) == null || a.call(o, e);
|
|
78
78
|
};
|
|
79
79
|
return {
|
|
80
|
-
disabled:
|
|
81
|
-
error:
|
|
82
|
-
focused:
|
|
83
|
-
formControlContext:
|
|
84
|
-
getInputProps: (
|
|
85
|
-
const
|
|
86
|
-
onBlur:
|
|
80
|
+
disabled: p,
|
|
81
|
+
error: _,
|
|
82
|
+
focused: O,
|
|
83
|
+
formControlContext: l,
|
|
84
|
+
getInputProps: (o = {}) => {
|
|
85
|
+
const a = y({}, {
|
|
86
|
+
onBlur: u,
|
|
87
87
|
onChange: h,
|
|
88
|
-
onFocus:
|
|
89
|
-
},
|
|
90
|
-
onBlur: $(
|
|
91
|
-
onChange:
|
|
92
|
-
onFocus: D(
|
|
88
|
+
onFocus: x
|
|
89
|
+
}, pe(o)), c = y({}, a, {
|
|
90
|
+
onBlur: $(a),
|
|
91
|
+
onChange: W(a),
|
|
92
|
+
onFocus: D(a)
|
|
93
93
|
});
|
|
94
|
-
return y({},
|
|
95
|
-
"aria-invalid":
|
|
96
|
-
defaultValue:
|
|
97
|
-
value:
|
|
98
|
-
required:
|
|
99
|
-
disabled:
|
|
100
|
-
},
|
|
101
|
-
ref:
|
|
102
|
-
},
|
|
94
|
+
return y({}, c, {
|
|
95
|
+
"aria-invalid": _ || void 0,
|
|
96
|
+
defaultValue: P,
|
|
97
|
+
value: b,
|
|
98
|
+
required: v,
|
|
99
|
+
disabled: p
|
|
100
|
+
}, o, {
|
|
101
|
+
ref: M
|
|
102
|
+
}, c);
|
|
103
103
|
},
|
|
104
|
-
getRootProps: (
|
|
105
|
-
const
|
|
106
|
-
return y({},
|
|
107
|
-
onClick:
|
|
104
|
+
getRootProps: (o = {}) => {
|
|
105
|
+
const e = pe(r, ["onBlur", "onChange", "onFocus"]), a = y({}, e, pe(o));
|
|
106
|
+
return y({}, o, a, {
|
|
107
|
+
onClick: Y(a)
|
|
108
108
|
});
|
|
109
109
|
},
|
|
110
|
-
inputRef:
|
|
111
|
-
required:
|
|
112
|
-
value:
|
|
110
|
+
inputRef: M,
|
|
111
|
+
required: v,
|
|
112
|
+
value: b
|
|
113
113
|
};
|
|
114
114
|
}
|
|
115
|
-
const Me = ["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"],
|
|
115
|
+
const Me = ["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"], Ke = (r) => {
|
|
116
116
|
const {
|
|
117
117
|
disabled: i,
|
|
118
|
-
error:
|
|
119
|
-
focused:
|
|
120
|
-
formControlContext:
|
|
118
|
+
error: f,
|
|
119
|
+
focused: C,
|
|
120
|
+
formControlContext: u,
|
|
121
121
|
multiline: h,
|
|
122
|
-
startAdornment:
|
|
123
|
-
endAdornment:
|
|
122
|
+
startAdornment: x,
|
|
123
|
+
endAdornment: S
|
|
124
124
|
} = r;
|
|
125
|
-
return
|
|
126
|
-
root: ["root", i && "disabled",
|
|
125
|
+
return Be({
|
|
126
|
+
root: ["root", i && "disabled", f && "error", C && "focused", !!u && "formControl", h && "multiline", !!x && "adornedStart", !!S && "adornedEnd"],
|
|
127
127
|
input: ["input", i && "disabled", h && "multiline"]
|
|
128
|
-
},
|
|
129
|
-
},
|
|
130
|
-
var
|
|
128
|
+
}, Ue(Ae));
|
|
129
|
+
}, Ne = /* @__PURE__ */ F.forwardRef(function(i, f) {
|
|
130
|
+
var C, u, h;
|
|
131
131
|
const {
|
|
132
|
-
"aria-describedby":
|
|
133
|
-
"aria-label":
|
|
134
|
-
"aria-labelledby":
|
|
135
|
-
autoComplete:
|
|
136
|
-
autoFocus:
|
|
137
|
-
className:
|
|
138
|
-
defaultValue:
|
|
139
|
-
disabled:
|
|
140
|
-
endAdornment:
|
|
141
|
-
error:
|
|
142
|
-
id:
|
|
143
|
-
multiline:
|
|
144
|
-
name:
|
|
145
|
-
onClick:
|
|
132
|
+
"aria-describedby": x,
|
|
133
|
+
"aria-label": S,
|
|
134
|
+
"aria-labelledby": k,
|
|
135
|
+
autoComplete: m,
|
|
136
|
+
autoFocus: l,
|
|
137
|
+
className: P,
|
|
138
|
+
defaultValue: p,
|
|
139
|
+
disabled: _,
|
|
140
|
+
endAdornment: v,
|
|
141
|
+
error: b,
|
|
142
|
+
id: H,
|
|
143
|
+
multiline: g = !1,
|
|
144
|
+
name: N,
|
|
145
|
+
onClick: R,
|
|
146
146
|
onChange: q,
|
|
147
|
-
onKeyDown:
|
|
148
|
-
onKeyUp:
|
|
149
|
-
onFocus:
|
|
150
|
-
onBlur:
|
|
147
|
+
onKeyDown: E,
|
|
148
|
+
onKeyUp: M,
|
|
149
|
+
onFocus: O,
|
|
150
|
+
onBlur: T,
|
|
151
151
|
placeholder: D,
|
|
152
152
|
readOnly: $,
|
|
153
|
-
required:
|
|
154
|
-
startAdornment:
|
|
155
|
-
value:
|
|
156
|
-
type:
|
|
157
|
-
rows:
|
|
158
|
-
slotProps:
|
|
159
|
-
slots:
|
|
160
|
-
minRows:
|
|
161
|
-
maxRows:
|
|
162
|
-
} = i,
|
|
163
|
-
getRootProps:
|
|
164
|
-
getInputProps:
|
|
165
|
-
focused:
|
|
166
|
-
formControlContext:
|
|
167
|
-
error:
|
|
153
|
+
required: W,
|
|
154
|
+
startAdornment: Y,
|
|
155
|
+
value: X,
|
|
156
|
+
type: L,
|
|
157
|
+
rows: o,
|
|
158
|
+
slotProps: e = {},
|
|
159
|
+
slots: a = {},
|
|
160
|
+
minRows: c,
|
|
161
|
+
maxRows: V
|
|
162
|
+
} = i, Z = Te(i, Me), {
|
|
163
|
+
getRootProps: ee,
|
|
164
|
+
getInputProps: z,
|
|
165
|
+
focused: G,
|
|
166
|
+
formControlContext: re,
|
|
167
|
+
error: ne,
|
|
168
168
|
disabled: ue
|
|
169
|
-
} =
|
|
170
|
-
disabled:
|
|
171
|
-
defaultValue:
|
|
172
|
-
error:
|
|
173
|
-
onBlur:
|
|
174
|
-
onClick:
|
|
169
|
+
} = He({
|
|
170
|
+
disabled: _,
|
|
171
|
+
defaultValue: p,
|
|
172
|
+
error: b,
|
|
173
|
+
onBlur: T,
|
|
174
|
+
onClick: R,
|
|
175
175
|
onChange: q,
|
|
176
|
-
onFocus:
|
|
177
|
-
required:
|
|
178
|
-
value:
|
|
179
|
-
}),
|
|
176
|
+
onFocus: O,
|
|
177
|
+
required: W,
|
|
178
|
+
value: X
|
|
179
|
+
}), te = g ? void 0 : L ?? "text", J = y({}, i, {
|
|
180
180
|
disabled: ue,
|
|
181
|
-
error:
|
|
182
|
-
focused:
|
|
183
|
-
formControlContext:
|
|
184
|
-
multiline:
|
|
185
|
-
type:
|
|
186
|
-
}),
|
|
187
|
-
"aria-describedby":
|
|
188
|
-
"aria-label":
|
|
189
|
-
"aria-labelledby":
|
|
190
|
-
autoComplete:
|
|
191
|
-
autoFocus:
|
|
192
|
-
id:
|
|
193
|
-
onKeyDown:
|
|
194
|
-
onKeyUp:
|
|
195
|
-
name:
|
|
181
|
+
error: ne,
|
|
182
|
+
focused: G,
|
|
183
|
+
formControlContext: re,
|
|
184
|
+
multiline: g,
|
|
185
|
+
type: te
|
|
186
|
+
}), oe = Ke(J), ie = {
|
|
187
|
+
"aria-describedby": x,
|
|
188
|
+
"aria-label": S,
|
|
189
|
+
"aria-labelledby": k,
|
|
190
|
+
autoComplete: m,
|
|
191
|
+
autoFocus: l,
|
|
192
|
+
id: H,
|
|
193
|
+
onKeyDown: E,
|
|
194
|
+
onKeyUp: M,
|
|
195
|
+
name: N,
|
|
196
196
|
placeholder: D,
|
|
197
197
|
readOnly: $,
|
|
198
|
-
type:
|
|
199
|
-
},
|
|
200
|
-
elementType:
|
|
201
|
-
getSlotProps:
|
|
202
|
-
externalSlotProps:
|
|
203
|
-
externalForwardedProps:
|
|
198
|
+
type: te
|
|
199
|
+
}, Q = (C = a.root) != null ? C : "div", le = be({
|
|
200
|
+
elementType: Q,
|
|
201
|
+
getSlotProps: ee,
|
|
202
|
+
externalSlotProps: e.root,
|
|
203
|
+
externalForwardedProps: Z,
|
|
204
204
|
additionalProps: {
|
|
205
|
-
ref:
|
|
205
|
+
ref: f
|
|
206
206
|
},
|
|
207
|
-
ownerState:
|
|
208
|
-
className: [
|
|
209
|
-
}),
|
|
210
|
-
elementType:
|
|
211
|
-
getSlotProps: (
|
|
212
|
-
externalSlotProps:
|
|
207
|
+
ownerState: J,
|
|
208
|
+
className: [oe.root, P]
|
|
209
|
+
}), t = g ? (u = a.textarea) != null ? u : "textarea" : (h = a.input) != null ? h : "input", w = be({
|
|
210
|
+
elementType: t,
|
|
211
|
+
getSlotProps: (I) => z(y({}, ie, I)),
|
|
212
|
+
externalSlotProps: e.input,
|
|
213
213
|
additionalProps: y({
|
|
214
|
-
rows:
|
|
215
|
-
},
|
|
216
|
-
minRows:
|
|
217
|
-
maxRows:
|
|
214
|
+
rows: g ? o : void 0
|
|
215
|
+
}, g && !Ie(t) && {
|
|
216
|
+
minRows: o || c,
|
|
217
|
+
maxRows: o || V
|
|
218
218
|
}),
|
|
219
|
-
ownerState:
|
|
220
|
-
className:
|
|
219
|
+
ownerState: J,
|
|
220
|
+
className: oe.input
|
|
221
221
|
});
|
|
222
|
-
return process.env.NODE_ENV !== "production" &&
|
|
223
|
-
children: [
|
|
222
|
+
return process.env.NODE_ENV !== "production" && g && o && (c || V) && console.warn("MUI: You can not use the `minRows` or `maxRows` props when the input `rows` prop is set."), /* @__PURE__ */ j(Q, y({}, le, {
|
|
223
|
+
children: [Y, /* @__PURE__ */ A(t, y({}, w)), v]
|
|
224
224
|
}));
|
|
225
225
|
});
|
|
226
|
-
process.env.NODE_ENV !== "production" && (
|
|
226
|
+
process.env.NODE_ENV !== "production" && (Ne.propTypes = {
|
|
227
227
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
228
228
|
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
229
229
|
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
@@ -373,103 +373,106 @@ process.env.NODE_ENV !== "production" && (he.propTypes = {
|
|
|
373
373
|
*/
|
|
374
374
|
value: n.any
|
|
375
375
|
});
|
|
376
|
-
const
|
|
377
|
-
"input__input-el": "_input__input-
|
|
378
|
-
input:
|
|
379
|
-
"input__messages-wrapper": "_input__messages-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
"
|
|
384
|
-
"
|
|
385
|
-
"
|
|
386
|
-
"
|
|
387
|
-
"
|
|
388
|
-
"
|
|
389
|
-
"input--
|
|
390
|
-
|
|
376
|
+
const qe = "_input_14020_58", De = "_input__labelWrapper_14020_85", $e = "_input__label_14020_85", We = "_input__labelHelp_14020_95", s = {
|
|
377
|
+
"input__input-el": "_input__input-el_14020_58",
|
|
378
|
+
input: qe,
|
|
379
|
+
"input__messages-wrapper": "_input__messages-wrapper_14020_82",
|
|
380
|
+
input__labelWrapper: De,
|
|
381
|
+
input__label: $e,
|
|
382
|
+
input__labelHelp: We,
|
|
383
|
+
"input__input-el-wrapper": "_input__input-el-wrapper_14020_100",
|
|
384
|
+
"input__left-icon": "_input__left-icon_14020_125",
|
|
385
|
+
"input__right-icon": "_input__right-icon_14020_125",
|
|
386
|
+
"input__info-message": "_input__info-message_14020_151",
|
|
387
|
+
"input__error-message": "_input__error-message_14020_151",
|
|
388
|
+
"input__chars-counter": "_input__chars-counter_14020_162",
|
|
389
|
+
"input--disabled": "_input--disabled_14020_167",
|
|
390
|
+
"input--focused": "_input--focused_14020_173",
|
|
391
|
+
"input--error": "_input--error_14020_176"
|
|
392
|
+
}, Ze = ye(
|
|
391
393
|
({
|
|
392
394
|
label: r,
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
"data-testid-
|
|
395
|
+
labelHelp: i,
|
|
396
|
+
infoMessage: f,
|
|
397
|
+
error: C,
|
|
398
|
+
errorMessage: u,
|
|
399
|
+
leftIcon: h,
|
|
400
|
+
rightIcon: x,
|
|
401
|
+
id: S,
|
|
402
|
+
disabled: k,
|
|
403
|
+
type: m = "text",
|
|
404
|
+
maxLength: l,
|
|
405
|
+
allowLeadingZeros: P = !1,
|
|
406
|
+
isInteger: p,
|
|
407
|
+
useCommaInDecimal: _,
|
|
408
|
+
allowNegativeNumbers: v = !1,
|
|
409
|
+
decimalLength: b = 10,
|
|
410
|
+
hideCharsCounter: H = !1,
|
|
411
|
+
required: g,
|
|
412
|
+
onChange: N,
|
|
413
|
+
triggerDelay: R,
|
|
414
|
+
classNameWrapper: q,
|
|
415
|
+
classNameLabel: E,
|
|
416
|
+
classNameInput: M,
|
|
417
|
+
classNameInfoMessage: O,
|
|
418
|
+
classNameErrorMessage: T,
|
|
419
|
+
classNameCharsCounter: D,
|
|
420
|
+
"data-testid-wrapper": $,
|
|
421
|
+
"data-testid-label": W,
|
|
419
422
|
"data-testid-input": Y,
|
|
420
|
-
"data-testid-infoMessage":
|
|
421
|
-
"data-testid-errorMessage":
|
|
422
|
-
"data-testid-charsCounter":
|
|
423
|
+
"data-testid-infoMessage": X,
|
|
424
|
+
"data-testid-errorMessage": L,
|
|
425
|
+
"data-testid-charsCounter": o,
|
|
423
426
|
...e
|
|
424
427
|
}, a) => {
|
|
425
|
-
var
|
|
426
|
-
const [
|
|
427
|
-
((
|
|
428
|
-
),
|
|
428
|
+
var Q, le;
|
|
429
|
+
const [c, V] = Ce(
|
|
430
|
+
((Q = e.value) == null ? void 0 : Q.length) || ((le = e.defaultValue) == null ? void 0 : le.length) || 0
|
|
431
|
+
), Z = ve(), ee = S || `input_${Z}`;
|
|
429
432
|
Object.assign(e, { "data-testid": Y });
|
|
430
|
-
const
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
},
|
|
434
|
-
},
|
|
435
|
-
var
|
|
436
|
-
if (
|
|
437
|
-
let
|
|
438
|
-
if (!
|
|
439
|
-
const
|
|
440
|
-
|
|
433
|
+
const z = l && !H, G = xe(), re = (t) => {
|
|
434
|
+
G.current && clearTimeout(G.current), G.current = setTimeout(() => {
|
|
435
|
+
ne(t);
|
|
436
|
+
}, R);
|
|
437
|
+
}, ne = (t) => {
|
|
438
|
+
var w, I, B, ce;
|
|
439
|
+
if (m === "number-as-text") {
|
|
440
|
+
let d = p ? Ee(t.target.value, P) : _ ? t.target.value.replace(".", ",") : t.target.value.replace(",", ".");
|
|
441
|
+
if (!p && b > 0) {
|
|
442
|
+
const fe = String(d), [we, me] = fe.split(/,|\./);
|
|
443
|
+
fe !== "" && me && (d = [we, me.slice(0, b)].join(_ ? "," : "."));
|
|
441
444
|
}
|
|
442
|
-
t.target.value = String(
|
|
443
|
-
const
|
|
444
|
-
|
|
445
|
+
t.target.value = String(d);
|
|
446
|
+
const ae = !isNaN(Number(String(d).replace(",", "."))), K = String(d).length ? String(d).replace(",", ".") : "";
|
|
447
|
+
N == null || N({
|
|
445
448
|
...t,
|
|
446
449
|
target: {
|
|
447
450
|
...t.target,
|
|
448
|
-
value:
|
|
449
|
-
valueAsNumber:
|
|
451
|
+
value: K,
|
|
452
|
+
valueAsNumber: ae && String(d).length ? Number(String(d).replace(",", ".")) : NaN
|
|
450
453
|
}
|
|
451
|
-
}),
|
|
454
|
+
}), z && V((I = (w = t == null ? void 0 : t.target) == null ? void 0 : w.value) == null ? void 0 : I.length);
|
|
452
455
|
return;
|
|
453
456
|
}
|
|
454
|
-
if (
|
|
455
|
-
let
|
|
456
|
-
const [
|
|
457
|
-
|
|
457
|
+
if (m === "number") {
|
|
458
|
+
let d = String(t.target.value);
|
|
459
|
+
const [ae, K] = d.split(".");
|
|
460
|
+
d !== "" && (K != null && K.length ? d = [Number(ae), K.slice(0, b)].join(".") : d = String(Number(ae))), t.target.value = d;
|
|
458
461
|
}
|
|
459
|
-
|
|
460
|
-
}, re = (t) => {
|
|
461
|
-
var b;
|
|
462
|
-
f === "number-as-text" && (w ? ve(t, C) : Pe(t, C)), (b = e == null ? void 0 : e.onKeyDown) == null || b.call(e, t);
|
|
462
|
+
z && V((ce = (B = t == null ? void 0 : t.target) == null ? void 0 : B.value) == null ? void 0 : ce.length), N && N(t);
|
|
463
463
|
}, ue = (t) => {
|
|
464
|
-
var
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
464
|
+
var w;
|
|
465
|
+
m === "number-as-text" && (p ? Pe(t, v) : Re(t, v)), (w = e == null ? void 0 : e.onKeyDown) == null || w.call(e, t);
|
|
466
|
+
}, te = (t) => {
|
|
467
|
+
var w;
|
|
468
|
+
if (m === "number-as-text" && t.target.value.length) {
|
|
469
|
+
const I = p ? t.target.value.replace(/(,\.)/gi, "") : t.target.value.replace(",", ".");
|
|
470
|
+
let B = String(P ? I : Number(I));
|
|
471
|
+
isNaN(Number(B)) && (B = ""), t.target.value = _ ? B.replace(".", ",") : B;
|
|
469
472
|
}
|
|
470
|
-
(
|
|
471
|
-
},
|
|
472
|
-
type:
|
|
473
|
+
(w = e == null ? void 0 : e.onBlur) == null || w.call(e, t);
|
|
474
|
+
}, J = se(() => e.multiline !== !0 ? {
|
|
475
|
+
type: m === "number-as-text" ? "text" : m,
|
|
473
476
|
multiline: e.multiline
|
|
474
477
|
} : {
|
|
475
478
|
type: void 0,
|
|
@@ -477,81 +480,84 @@ const Ke = "_input_1u4jg_58", qe = "_input__label_1u4jg_85", m = {
|
|
|
477
480
|
rows: (e == null ? void 0 : e.rows) || 5,
|
|
478
481
|
minRows: e == null ? void 0 : e.minRows,
|
|
479
482
|
maxRows: e == null ? void 0 : e.maxRows
|
|
480
|
-
}, [e]),
|
|
481
|
-
const t =
|
|
482
|
-
return
|
|
483
|
-
}, [e.defaultValue]),
|
|
484
|
-
if (!
|
|
485
|
-
return
|
|
483
|
+
}, [e]), oe = se(() => {
|
|
484
|
+
const t = R ? (e == null ? void 0 : e.value) ?? (e == null ? void 0 : e.defaultValue) : e == null ? void 0 : e.defaultValue;
|
|
485
|
+
return m === "number-as-text" && t ? _e(t, _) : t;
|
|
486
|
+
}, [e.defaultValue]), ie = se(() => {
|
|
487
|
+
if (!R)
|
|
488
|
+
return m === "number-as-text" && (e != null && e.value) ? _e(e == null ? void 0 : e.value, _) : e == null ? void 0 : e.value;
|
|
486
489
|
}, [e.value]);
|
|
487
|
-
return /* @__PURE__ */
|
|
488
|
-
r && /* @__PURE__ */
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
490
|
+
return /* @__PURE__ */ j("div", { className: U(s.input, q), "data-testid": $, children: [
|
|
491
|
+
(r || i) && /* @__PURE__ */ j("div", { className: s.input__labelWrapper, children: [
|
|
492
|
+
r && /* @__PURE__ */ j(
|
|
493
|
+
de,
|
|
494
|
+
{
|
|
495
|
+
bold: !0,
|
|
496
|
+
element: "label",
|
|
497
|
+
elementProps: { htmlFor: ee },
|
|
498
|
+
className: U(s.input__label, E),
|
|
499
|
+
"data-testid": W,
|
|
500
|
+
children: [
|
|
501
|
+
r,
|
|
502
|
+
g && /* @__PURE__ */ A("span", { children: "*" })
|
|
503
|
+
]
|
|
504
|
+
}
|
|
505
|
+
),
|
|
506
|
+
i && /* @__PURE__ */ A("div", { className: s.input__labelHelp, children: i })
|
|
507
|
+
] }),
|
|
508
|
+
/* @__PURE__ */ A(
|
|
509
|
+
Ne,
|
|
504
510
|
{
|
|
505
|
-
id:
|
|
506
|
-
disabled:
|
|
507
|
-
error: typeof
|
|
511
|
+
id: ee,
|
|
512
|
+
disabled: k,
|
|
513
|
+
error: typeof C == "boolean" ? C : !!u,
|
|
508
514
|
"aria-label": r,
|
|
509
515
|
slotProps: {
|
|
510
516
|
root: (t) => ({
|
|
511
|
-
className:
|
|
512
|
-
[
|
|
513
|
-
[
|
|
514
|
-
[
|
|
517
|
+
className: U(s["input__input-el-wrapper"], {
|
|
518
|
+
[s["input--disabled"]]: t.disabled,
|
|
519
|
+
[s["input--focused"]]: t.focused,
|
|
520
|
+
[s["input--error"]]: t.error
|
|
515
521
|
})
|
|
516
522
|
}),
|
|
517
523
|
input: {
|
|
518
524
|
ref: a,
|
|
519
|
-
className:
|
|
520
|
-
maxLength:
|
|
521
|
-
onChange:
|
|
525
|
+
className: U(s["input__input-el"], M),
|
|
526
|
+
maxLength: l,
|
|
527
|
+
onChange: R ? re : ne,
|
|
522
528
|
...e,
|
|
523
|
-
onKeyDown:
|
|
524
|
-
onBlur:
|
|
525
|
-
defaultValue:
|
|
526
|
-
value:
|
|
529
|
+
onKeyDown: ue,
|
|
530
|
+
onBlur: te,
|
|
531
|
+
defaultValue: oe,
|
|
532
|
+
value: ie
|
|
527
533
|
}
|
|
528
534
|
},
|
|
529
|
-
startAdornment:
|
|
530
|
-
endAdornment:
|
|
531
|
-
...
|
|
535
|
+
startAdornment: h && /* @__PURE__ */ A("span", { className: s["input__left-icon"], children: h }),
|
|
536
|
+
endAdornment: x && /* @__PURE__ */ A("span", { className: s["input__right-icon"], children: x }),
|
|
537
|
+
...J
|
|
532
538
|
}
|
|
533
539
|
),
|
|
534
|
-
/* @__PURE__ */
|
|
535
|
-
(
|
|
536
|
-
|
|
540
|
+
/* @__PURE__ */ j("div", { className: s["input__messages-wrapper"], children: [
|
|
541
|
+
(u || f) && /* @__PURE__ */ j(
|
|
542
|
+
de,
|
|
537
543
|
{
|
|
538
|
-
className:
|
|
539
|
-
"data-testid":
|
|
544
|
+
className: u ? U(s["input__error-message"], T) : U(s["input__info-message"], O),
|
|
545
|
+
"data-testid": u ? L : X,
|
|
540
546
|
children: [
|
|
541
|
-
/* @__PURE__ */
|
|
542
|
-
|
|
547
|
+
/* @__PURE__ */ A(Ve, { icon: u ? "circle-exclamation" : "circle-info" }),
|
|
548
|
+
u || f
|
|
543
549
|
]
|
|
544
550
|
}
|
|
545
551
|
),
|
|
546
|
-
|
|
547
|
-
|
|
552
|
+
z && /* @__PURE__ */ j(
|
|
553
|
+
de,
|
|
548
554
|
{
|
|
549
|
-
className:
|
|
550
|
-
"data-testid":
|
|
555
|
+
className: U(s["input__chars-counter"], D),
|
|
556
|
+
"data-testid": o,
|
|
551
557
|
children: [
|
|
552
|
-
|
|
558
|
+
c,
|
|
553
559
|
" / ",
|
|
554
|
-
|
|
560
|
+
l
|
|
555
561
|
]
|
|
556
562
|
}
|
|
557
563
|
)
|
|
@@ -560,5 +566,5 @@ const Ke = "_input_1u4jg_58", qe = "_input__label_1u4jg_85", m = {
|
|
|
560
566
|
}
|
|
561
567
|
);
|
|
562
568
|
export {
|
|
563
|
-
|
|
569
|
+
Ze as Input
|
|
564
570
|
};
|
|
@@ -13,6 +13,8 @@ export declare const Simple: Story;
|
|
|
13
13
|
export declare const SimpleNumberAsText: Story;
|
|
14
14
|
export declare const WithLabel: Story;
|
|
15
15
|
export declare const WithRequiredLabel: Story;
|
|
16
|
+
export declare const WithLabelHelp: Story;
|
|
17
|
+
export declare const WithLabelHelpSimple: Story;
|
|
16
18
|
export declare const WithPlaceholder: Story;
|
|
17
19
|
export declare const Disabled: Story;
|
|
18
20
|
export declare const WithMaxLength: Story;
|
|
@@ -3,6 +3,7 @@ export declare const InputSearch: import('react').ForwardRefExoticComponent<(Omi
|
|
|
3
3
|
ref?: ForwardedRef<HTMLInputElement> | undefined;
|
|
4
4
|
} & import('react').InputHTMLAttributes<HTMLInputElement> & {
|
|
5
5
|
label?: string | undefined;
|
|
6
|
+
labelHelp?: import('react').ReactNode;
|
|
6
7
|
infoMessage?: import('react').ReactNode;
|
|
7
8
|
error?: boolean | undefined;
|
|
8
9
|
errorMessage?: import('react').ReactNode;
|
|
@@ -5,6 +5,7 @@ declare const meta: {
|
|
|
5
5
|
ref?: import('react').ForwardedRef<HTMLInputElement> | undefined;
|
|
6
6
|
} & import('react').InputHTMLAttributes<HTMLInputElement> & {
|
|
7
7
|
label?: string | undefined;
|
|
8
|
+
labelHelp?: import('react').ReactNode;
|
|
8
9
|
infoMessage?: import('react').ReactNode;
|
|
9
10
|
error?: boolean | undefined;
|
|
10
11
|
errorMessage?: 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": "2.1.
|
|
4
|
+
"version": "2.1.64",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/main.js",
|
|
7
7
|
"types": "dist/main.d.ts",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"eslint-plugin-react-refresh": "^0.4.6",
|
|
75
75
|
"eslint-plugin-simple-import-sort": "^12.0.0",
|
|
76
76
|
"eslint-plugin-storybook": "^0.9.0",
|
|
77
|
-
"glob": "^
|
|
77
|
+
"glob": "^11.1.0",
|
|
78
78
|
"husky": "^9.0.11",
|
|
79
79
|
"jsdom": "^26.0.0",
|
|
80
80
|
"lint-staged": "^15.2.7",
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
"esbuild": "^0.25.3",
|
|
112
112
|
"express": "^5.1.0",
|
|
113
113
|
"form-data": "^4.0.2",
|
|
114
|
-
"glob": "^
|
|
114
|
+
"glob": "^11.1.0",
|
|
115
115
|
"micromatch": "^4.0.8",
|
|
116
116
|
"nanoid": "^3.3.11",
|
|
117
117
|
"path-to-regexp": "^0.1.12",
|
|
@@ -122,6 +122,7 @@
|
|
|
122
122
|
"ws": "^8.18.1",
|
|
123
123
|
"tmp": "^0.2.5",
|
|
124
124
|
"brace-expansion": "^2.0.2",
|
|
125
|
-
"debug": "^4.4.3"
|
|
125
|
+
"debug": "^4.4.3",
|
|
126
|
+
"js-yaml": "^4.1.1"
|
|
126
127
|
}
|
|
127
128
|
}
|