mimir-ui-kit 1.55.0 → 1.57.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.
@@ -1,232 +0,0 @@
1
- import { jsxs as B, jsx as s, Fragment as Z } from "react/jsx-runtime";
2
- import { c as o } from "./index-DIxK0V-G.js";
3
- import { memo as ee, forwardRef as ae, useState as z, useRef as te, useEffect as L } from "react";
4
- import { EInputVariant as se } from "./components/Input/constants.js";
5
- import { useMergeRefs as re } from "./hooks/useMergeRefs/useMergeRefs.js";
6
- import { Icon as le } from "./icons/Icon.js";
7
- import { Button as de } from "./components/Button/Button.js";
8
- import './assets/Input.css';const oe = "_label_1wf2d_26", ne = "_input_1wf2d_2", ce = "_focused_1wf2d_99", ie = "_disabled_1wf2d_105", ue = "_clear_1wf2d_147", _e = "_s_1wf2d_210", fe = "_m_1wf2d_225", me = "_l_1wf2d_26", pe = "_success_1wf2d_281", he = "_alarm_1wf2d_301", be = "_error_1wf2d_321", e = {
9
- "input-wrapper": "_input-wrapper_1wf2d_2",
10
- "required-mark": "_required-mark_1wf2d_16",
11
- label: oe,
12
- "has-left-slot": "_has-left-slot_1wf2d_45",
13
- "has-right-slot": "_has-right-slot_1wf2d_48",
14
- "active-label": "_active-label_1wf2d_53",
15
- "label-text-wrapper": "_label-text-wrapper_1wf2d_68",
16
- input: ne,
17
- focused: ce,
18
- "has-label": "_has-label_1wf2d_102",
19
- disabled: ie,
20
- "addon-icon": "_addon-icon_1wf2d_111",
21
- "left-slot": "_left-slot_1wf2d_115",
22
- "right-slot": "_right-slot_1wf2d_116",
23
- clear: ue,
24
- "border-radius-left": "_border-radius-left_1wf2d_198",
25
- "border-radius-right": "_border-radius-right_1wf2d_202",
26
- "border-radius-none": "_border-radius-none_1wf2d_206",
27
- s: _e,
28
- m: fe,
29
- l: me,
30
- "default-gray": "_default-gray_1wf2d_254",
31
- "default-white": "_default-white_1wf2d_266",
32
- success: pe,
33
- alarm: he,
34
- error: be
35
- }, j = (a) => {
36
- var f, r;
37
- if (!a)
38
- return null;
39
- switch (a.addonType) {
40
- case "icon": {
41
- const m = (f = a.addonContent) == null ? void 0 : f.includes("16px"), g = (r = a.addonContent) == null ? void 0 : r.includes("24px");
42
- return /* @__PURE__ */ s(
43
- le,
44
- {
45
- style: {
46
- "--icon-size": o({
47
- "16px": m,
48
- "24px": g
49
- })
50
- },
51
- className: e["addon-icon"],
52
- iconName: a.addonContent
53
- }
54
- );
55
- }
56
- case "text":
57
- return a.addonContent;
58
- case "react-node":
59
- return /* @__PURE__ */ s(Z, { children: a.addonContent });
60
- default:
61
- return null;
62
- }
63
- }, we = ee(
64
- ae(
65
- (a, f) => {
66
- const {
67
- value: r,
68
- className: m,
69
- wrapperClassName: g,
70
- rightSlotClassName: D,
71
- requiredMarkClassName: E,
72
- variant: A = se.DefaultGray,
73
- type: M = "text",
74
- autofocus: N,
75
- readonly: n,
76
- id: F,
77
- onFocus: x,
78
- onBlur: C,
79
- label: u,
80
- withClearButton: O,
81
- disabled: t,
82
- onChange: i,
83
- rightAddon: S,
84
- status: R,
85
- leftAddon: T,
86
- size: y = "m",
87
- numbersOnly: G,
88
- required: v,
89
- maxLength: I,
90
- autocomplete: P = "on",
91
- borderRadius: V = "all",
92
- ...W
93
- } = a, [_, k] = z(N), [p, h] = z(!!r), c = te(null), $ = re(c, f);
94
- L(() => {
95
- N && k(!0);
96
- }, [N]), L(() => {
97
- h(!!r);
98
- }, [r]);
99
- const H = (l) => {
100
- const d = l.currentTarget.value;
101
- C == null || C(l), k(!1), h(!!d);
102
- }, J = (l) => {
103
- n || (k(!0), x == null || x(l));
104
- }, K = () => {
105
- c != null && c.current && (c.current.value = "", c.current.focus(), h(!1), i == null || i({
106
- target: c.current
107
- }));
108
- }, Q = (l) => {
109
- let d = l.target.value;
110
- G && (d = d.replace(/\D/g, "")), I !== void 0 && (d = d.slice(0, I)), l.target.value = d, i == null || i(l), h(!!d);
111
- }, b = j(T), w = j(S), U = {
112
- [e.readonly]: t || n,
113
- [e.focused]: _,
114
- [e.disabled]: t || n,
115
- [e["has-label"]]: !!u,
116
- [e["has-left-slot"]]: !!b,
117
- [e["has-right-slot"]]: !!w
118
- }, q = _ || p || !!r, X = o(e.label, m, e[y], {
119
- [e["active-label"]]: q,
120
- [e.disabled]: t || n,
121
- [e["has-left-slot"]]: !!b,
122
- [e["has-right-slot"]]: !!w
123
- }), Y = o(e.input, U, m, [
124
- e[A],
125
- e[R ?? ""],
126
- e[y]
127
- ]);
128
- return /* @__PURE__ */ B(
129
- "div",
130
- {
131
- className: o(
132
- e["input-wrapper"],
133
- e[A],
134
- e[R ?? ""],
135
- e[y],
136
- {
137
- [e.disabled]: t || n,
138
- [e.focused]: _,
139
- [e[`border-radius-${V}`]]: V !== "all"
140
- },
141
- g
142
- ),
143
- children: [
144
- u && /* @__PURE__ */ B("label", { htmlFor: F, className: X, children: [
145
- /* @__PURE__ */ s("span", { className: e["label-text-wrapper"], children: u }),
146
- v && (p || _) && /* @__PURE__ */ s(
147
- "span",
148
- {
149
- className: e["required-mark"],
150
- "data-testid": "required-mark"
151
- }
152
- )
153
- ] }),
154
- b && /* @__PURE__ */ s(
155
- "span",
156
- {
157
- className: o(e["left-slot"], {
158
- [e.focused]: q,
159
- [e["has-label"]]: !!u,
160
- [e.disabled]: t
161
- }),
162
- children: b
163
- }
164
- ),
165
- /* @__PURE__ */ s(
166
- "input",
167
- {
168
- ref: $,
169
- type: M,
170
- id: F,
171
- className: Y,
172
- onFocus: J,
173
- onBlur: H,
174
- readOnly: n,
175
- value: r,
176
- onChange: Q,
177
- maxLength: I,
178
- disabled: t,
179
- required: v,
180
- autoComplete: P,
181
- ...W
182
- }
183
- ),
184
- w && /* @__PURE__ */ s(
185
- "span",
186
- {
187
- className: o(e["right-slot"], D, {
188
- [e.focused]: q,
189
- [e["has-label"]]: !!u,
190
- [e.disabled]: t
191
- }),
192
- children: w
193
- }
194
- ),
195
- v && !p && !_ && /* @__PURE__ */ s(
196
- "span",
197
- {
198
- className: o(
199
- e["required-mark"],
200
- E
201
- ),
202
- "data-testid": "required-mark"
203
- }
204
- ),
205
- O && p && /* @__PURE__ */ s(
206
- de,
207
- {
208
- tabIndex: -1,
209
- className: o(e.clear, {
210
- [e.disabled]: t
211
- }),
212
- isIconButton: !0,
213
- iconName: "Close16px",
214
- size: "m-s",
215
- clear: !0,
216
- disabled: t || n,
217
- variant: "secondary-gray",
218
- onClick: K,
219
- "data-testid": "clear-button"
220
- }
221
- )
222
- ]
223
- }
224
- );
225
- }
226
- )
227
- );
228
- we.displayName = "Input";
229
- export {
230
- we as I,
231
- e as c
232
- };