mimir-ui-kit 1.36.4 → 1.36.6
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Input-WnjLXNpw.js +224 -0
- package/dist/assets/Input.css +1 -1
- package/dist/{combobox-CDU06zJj.js → combobox-BpYucpxz.js} +1121 -1080
- package/dist/components/Accordion/Accordion.js +15 -15
- package/dist/components/CheckboxMimir/CheckboxMimir.js +4 -4
- package/dist/components/DatePicker/DatePicker.js +1 -1
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/Input/index.js +1 -1
- package/dist/components/InputPassword/InputPassword.js +1 -1
- package/dist/components/InputPhoneNumber/InputPhoneNumber.js +1 -1
- package/dist/components/MultiSelectSearch/MultiSelectSearch.js +22 -22
- package/dist/components/MultiSelectSearch/utils.js +1 -1
- package/dist/components/OtpInput/OtpInput.js +1 -1
- package/dist/components/RadioGroup/RadioGroup.js +3 -3
- package/dist/components/SelectSearch/SelectSearch.js +27 -27
- package/dist/components/SelectSearch/utils.js +1 -1
- package/dist/components/Switcher/Switcher.js +4 -4
- package/dist/components/TabTrail/TabTrail.js +4 -4
- package/dist/components/TextArea/TextArea.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/{field-FJ34aSs4.js → field-C1kt7aNM.js} +2 -2
- package/dist/{focus-management-XwV-9qkO.js → focus-management-DOYCPyGg.js} +1 -1
- package/dist/{hidden-DbgtYPOH.js → hidden-PvGXrYUY.js} +1 -1
- package/dist/index.js +1 -1
- package/dist/{keyboard-B0lm_zyn.js → keyboard-mgWkd2Vh.js} +114 -111
- package/dist/{label-y3ANLTNC.js → label-D4GFpe5F.js} +2 -2
- package/dist/open-closed-D2VjDhAN.js +86 -0
- package/dist/{use-active-press-86hajhdd.js → use-active-press-CqLGIFz7.js} +1 -1
- package/package.json +1 -3
- package/dist/Input-DlGNMuUD.js +0 -222
- package/dist/open-closed-CdldUPoq.js +0 -86
package/dist/Input-DlGNMuUD.js
DELETED
@@ -1,222 +0,0 @@
|
|
1
|
-
import { jsxs as B, jsx as n, Fragment as X } from "react/jsx-runtime";
|
2
|
-
import { c as r } from "./index-DIxK0V-G.js";
|
3
|
-
import { memo as Y, forwardRef as Z, useState as R, useRef as $, useEffect as ee } from "react";
|
4
|
-
import { EInputVariant as se } from "./components/Input/constants.js";
|
5
|
-
import { useMergeRefs as te } from "./hooks/useMergeRefs/useMergeRefs.js";
|
6
|
-
import { Icon as ae } from "./icons/Icon.js";
|
7
|
-
import { Button as le } from "./components/Button/Button.js";
|
8
|
-
import './assets/Input.css';const re = "_label_1son2_27", ne = "_input_1son2_3", oe = "_focused_1son2_83", ce = "_disabled_1son2_89", ie = "_clear_1son2_138", de = "_s_1son2_189", ue = "_m_1son2_204", _e = "_l_1son2_27", me = "_success_1son2_261", fe = "_alarm_1son2_281", pe = "_error_1son2_301", e = {
|
9
|
-
"input-wrapper": "_input-wrapper_1son2_3",
|
10
|
-
"required-mark": "_required-mark_1son2_17",
|
11
|
-
label: re,
|
12
|
-
"has-left-slot": "_has-left-slot_1son2_42",
|
13
|
-
"active-label": "_active-label_1son2_45",
|
14
|
-
input: ne,
|
15
|
-
"has-right-slot": "_has-right-slot_1son2_80",
|
16
|
-
focused: oe,
|
17
|
-
"has-label": "_has-label_1son2_86",
|
18
|
-
disabled: ce,
|
19
|
-
"auto-height": "_auto-height_1son2_95",
|
20
|
-
"addon-icon": "_addon-icon_1son2_102",
|
21
|
-
"left-slot": "_left-slot_1son2_106",
|
22
|
-
"right-slot": "_right-slot_1son2_107",
|
23
|
-
clear: ie,
|
24
|
-
s: de,
|
25
|
-
m: ue,
|
26
|
-
l: _e,
|
27
|
-
"default-gray": "_default-gray_1son2_234",
|
28
|
-
"default-white": "_default-white_1son2_246",
|
29
|
-
success: me,
|
30
|
-
alarm: fe,
|
31
|
-
error: pe
|
32
|
-
}, z = (s) => {
|
33
|
-
var m, c;
|
34
|
-
if (!s)
|
35
|
-
return null;
|
36
|
-
switch (s.addonType) {
|
37
|
-
case "icon": {
|
38
|
-
const f = (m = s.addonContent) == null ? void 0 : m.includes("16px"), b = (c = s.addonContent) == null ? void 0 : c.includes("24px");
|
39
|
-
return /* @__PURE__ */ n(
|
40
|
-
ae,
|
41
|
-
{
|
42
|
-
style: {
|
43
|
-
"--icon-size": r({
|
44
|
-
"16px": f,
|
45
|
-
"24px": b
|
46
|
-
})
|
47
|
-
},
|
48
|
-
className: e["addon-icon"],
|
49
|
-
iconName: s.addonContent
|
50
|
-
}
|
51
|
-
);
|
52
|
-
}
|
53
|
-
case "text":
|
54
|
-
return s.addonContent;
|
55
|
-
case "react-node":
|
56
|
-
return /* @__PURE__ */ n(X, { children: s.addonContent });
|
57
|
-
default:
|
58
|
-
return null;
|
59
|
-
}
|
60
|
-
}, he = Y(
|
61
|
-
Z(
|
62
|
-
(s, m) => {
|
63
|
-
const {
|
64
|
-
value: c,
|
65
|
-
className: f,
|
66
|
-
wrapperClassName: b,
|
67
|
-
rightSlotClassName: L,
|
68
|
-
requiredMarkClassName: j,
|
69
|
-
variant: A = se.DefaultGray,
|
70
|
-
type: D = "text",
|
71
|
-
autofocus: g,
|
72
|
-
readonly: o,
|
73
|
-
id: F,
|
74
|
-
onFocus: N,
|
75
|
-
onBlur: x,
|
76
|
-
label: u,
|
77
|
-
withClearButton: E,
|
78
|
-
disabled: t,
|
79
|
-
onChange: i,
|
80
|
-
rightAddon: M,
|
81
|
-
status: V,
|
82
|
-
leftAddon: O,
|
83
|
-
size: y = "m",
|
84
|
-
numbersOnly: S,
|
85
|
-
required: C,
|
86
|
-
maxLength: v,
|
87
|
-
...T
|
88
|
-
} = s, [_, w] = R(g), [p, I] = R(!!c), d = $(null), G = te(d, m);
|
89
|
-
ee(() => {
|
90
|
-
g && w(!0);
|
91
|
-
}, [g]);
|
92
|
-
const P = (a) => {
|
93
|
-
const l = a.currentTarget.value;
|
94
|
-
x == null || x(a), w(!1), I(!!l);
|
95
|
-
}, W = (a) => {
|
96
|
-
o || (w(!0), N == null || N(a));
|
97
|
-
}, H = () => {
|
98
|
-
d != null && d.current && (d.current.value = "", d.current.focus(), I(!1), i == null || i({
|
99
|
-
target: { value: "" }
|
100
|
-
}));
|
101
|
-
}, J = (a) => {
|
102
|
-
let l = a.target.value;
|
103
|
-
S && (l = l.replace(/\D/g, "")), v !== void 0 && (l = l.slice(0, v)), a.target.value = l, i == null || i(a), I(!!l);
|
104
|
-
}, h = z(O), k = z(M), K = {
|
105
|
-
[e.readonly]: t || o,
|
106
|
-
[e.focused]: _,
|
107
|
-
[e.disabled]: t || o,
|
108
|
-
[e["has-label"]]: !!u,
|
109
|
-
[e["has-left-slot"]]: !!h,
|
110
|
-
[e["has-right-slot"]]: !!k
|
111
|
-
}, q = _ || p || !!c, Q = r(e.label, f, e[y], {
|
112
|
-
[e["active-label"]]: q,
|
113
|
-
[e.disabled]: t || o,
|
114
|
-
[e["has-left-slot"]]: !!h
|
115
|
-
}), U = r(e.input, K, f, [
|
116
|
-
e[A],
|
117
|
-
e[V ?? ""],
|
118
|
-
e[y]
|
119
|
-
]);
|
120
|
-
return /* @__PURE__ */ B(
|
121
|
-
"div",
|
122
|
-
{
|
123
|
-
className: r(
|
124
|
-
e["input-wrapper"],
|
125
|
-
e[A],
|
126
|
-
e[V ?? ""],
|
127
|
-
e[y],
|
128
|
-
{
|
129
|
-
[e.disabled]: t || o,
|
130
|
-
[e.focused]: _
|
131
|
-
},
|
132
|
-
b
|
133
|
-
),
|
134
|
-
children: [
|
135
|
-
u && /* @__PURE__ */ B("label", { htmlFor: F, className: Q, children: [
|
136
|
-
u,
|
137
|
-
C && (p || _) && /* @__PURE__ */ n(
|
138
|
-
"span",
|
139
|
-
{
|
140
|
-
className: e["required-mark"],
|
141
|
-
"data-testid": "required-mark"
|
142
|
-
}
|
143
|
-
)
|
144
|
-
] }),
|
145
|
-
h && /* @__PURE__ */ n(
|
146
|
-
"span",
|
147
|
-
{
|
148
|
-
className: r(e["left-slot"], {
|
149
|
-
[e.focused]: q,
|
150
|
-
[e["has-label"]]: !!u,
|
151
|
-
[e.disabled]: t
|
152
|
-
}),
|
153
|
-
children: h
|
154
|
-
}
|
155
|
-
),
|
156
|
-
/* @__PURE__ */ n(
|
157
|
-
"input",
|
158
|
-
{
|
159
|
-
ref: G,
|
160
|
-
type: D,
|
161
|
-
id: F,
|
162
|
-
className: U,
|
163
|
-
onFocus: W,
|
164
|
-
onBlur: P,
|
165
|
-
readOnly: o,
|
166
|
-
value: c,
|
167
|
-
onChange: J,
|
168
|
-
maxLength: v,
|
169
|
-
disabled: t,
|
170
|
-
required: C,
|
171
|
-
...T
|
172
|
-
}
|
173
|
-
),
|
174
|
-
k && /* @__PURE__ */ n(
|
175
|
-
"span",
|
176
|
-
{
|
177
|
-
className: r(e["right-slot"], L, {
|
178
|
-
[e.focused]: q,
|
179
|
-
[e["has-label"]]: !!u,
|
180
|
-
[e.disabled]: t
|
181
|
-
}),
|
182
|
-
children: k
|
183
|
-
}
|
184
|
-
),
|
185
|
-
C && !p && !_ && /* @__PURE__ */ n(
|
186
|
-
"span",
|
187
|
-
{
|
188
|
-
className: r(
|
189
|
-
e["required-mark"],
|
190
|
-
j
|
191
|
-
),
|
192
|
-
"data-testid": "required-mark"
|
193
|
-
}
|
194
|
-
),
|
195
|
-
E && p && /* @__PURE__ */ n(
|
196
|
-
le,
|
197
|
-
{
|
198
|
-
tabIndex: -1,
|
199
|
-
className: r(e.clear, {
|
200
|
-
[e.disabled]: t
|
201
|
-
}),
|
202
|
-
isIconButton: !0,
|
203
|
-
iconName: "Close16px",
|
204
|
-
size: "m-s",
|
205
|
-
clear: !0,
|
206
|
-
disabled: t || o,
|
207
|
-
variant: "secondary-gray",
|
208
|
-
onClick: H,
|
209
|
-
"data-testid": "clear-button"
|
210
|
-
}
|
211
|
-
)
|
212
|
-
]
|
213
|
-
}
|
214
|
-
);
|
215
|
-
}
|
216
|
-
)
|
217
|
-
);
|
218
|
-
he.displayName = "Input";
|
219
|
-
export {
|
220
|
-
he as I,
|
221
|
-
e as c
|
222
|
-
};
|
@@ -1,86 +0,0 @@
|
|
1
|
-
import h, { useState as F, useCallback as c, useRef as m, createContext as A, useContext as E } from "react";
|
2
|
-
import { p as x, n as O, d as y } from "./keyboard-B0lm_zyn.js";
|
3
|
-
function k(e = 0) {
|
4
|
-
let [t, n] = F(e), l = c((o) => n(o), [t]), s = c((o) => n((u) => u | o), [t]), r = c((o) => (t & o) === o, [t]), a = c((o) => n((u) => u & ~o), [n]), i = c((o) => n((u) => u ^ o), [n]);
|
5
|
-
return { flags: t, setFlag: l, addFlag: s, hasFlag: r, removeFlag: a, toggleFlag: i };
|
6
|
-
}
|
7
|
-
var v;
|
8
|
-
typeof process < "u" && typeof globalThis < "u" && ((v = process == null ? void 0 : process.env) == null ? void 0 : v.NODE_ENV) === "test" && typeof Element.prototype.getAnimations > "u" && (Element.prototype.getAnimations = function() {
|
9
|
-
return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.", "Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.", "", "Example usage:", "```js", "import { mockAnimationsApi } from 'jsdom-testing-mocks'", "mockAnimationsApi()", "```"].join(`
|
10
|
-
`)), [];
|
11
|
-
});
|
12
|
-
var N = ((e) => (e[e.None = 0] = "None", e[e.Closed = 1] = "Closed", e[e.Enter = 2] = "Enter", e[e.Leave = 4] = "Leave", e))(N || {});
|
13
|
-
function L(e) {
|
14
|
-
let t = {};
|
15
|
-
for (let n in e) e[n] === !0 && (t[`data-${n}`] = "");
|
16
|
-
return t;
|
17
|
-
}
|
18
|
-
function R(e, t, n, l) {
|
19
|
-
let [s, r] = F(n), { hasFlag: a, addFlag: i, removeFlag: o } = k(e && s ? 3 : 0), u = m(!1), d = m(!1), C = x();
|
20
|
-
return O(() => {
|
21
|
-
var f;
|
22
|
-
if (e) {
|
23
|
-
if (n && r(!0), !t) {
|
24
|
-
n && i(3);
|
25
|
-
return;
|
26
|
-
}
|
27
|
-
return (f = void 0) == null || f.call(l, n), $(t, { inFlight: u, prepare() {
|
28
|
-
d.current ? d.current = !1 : d.current = u.current, u.current = !0, !d.current && (n ? (i(3), o(4)) : (i(4), o(2)));
|
29
|
-
}, run() {
|
30
|
-
d.current ? n ? (o(3), i(4)) : (o(4), i(3)) : n ? o(1) : i(1);
|
31
|
-
}, done() {
|
32
|
-
var g;
|
33
|
-
d.current && typeof t.getAnimations == "function" && t.getAnimations().length > 0 || (u.current = !1, o(7), n || r(!1), (g = void 0) == null || g.call(l, n));
|
34
|
-
} });
|
35
|
-
}
|
36
|
-
}, [e, n, t, C]), e ? [s, { closed: a(1), enter: a(2), leave: a(4), transition: a(2) || a(4) }] : [n, { closed: void 0, enter: void 0, leave: void 0, transition: void 0 }];
|
37
|
-
}
|
38
|
-
function $(e, { prepare: t, run: n, done: l, inFlight: s }) {
|
39
|
-
let r = y();
|
40
|
-
return P(e, { prepare: t, inFlight: s }), r.nextFrame(() => {
|
41
|
-
n(), r.requestAnimationFrame(() => {
|
42
|
-
r.add(j(e, l));
|
43
|
-
});
|
44
|
-
}), r.dispose;
|
45
|
-
}
|
46
|
-
function j(e, t) {
|
47
|
-
var n, l;
|
48
|
-
let s = y();
|
49
|
-
if (!e) return s.dispose;
|
50
|
-
let r = !1;
|
51
|
-
s.add(() => {
|
52
|
-
r = !0;
|
53
|
-
});
|
54
|
-
let a = (l = (n = e.getAnimations) == null ? void 0 : n.call(e).filter((i) => i instanceof CSSTransition)) != null ? l : [];
|
55
|
-
return a.length === 0 ? (t(), s.dispose) : (Promise.allSettled(a.map((i) => i.finished)).then(() => {
|
56
|
-
r || t();
|
57
|
-
}), s.dispose);
|
58
|
-
}
|
59
|
-
function P(e, { inFlight: t, prepare: n }) {
|
60
|
-
if (t != null && t.current) {
|
61
|
-
n();
|
62
|
-
return;
|
63
|
-
}
|
64
|
-
let l = e.style.transition;
|
65
|
-
e.style.transition = "none", n(), e.offsetHeight, e.style.transition = l;
|
66
|
-
}
|
67
|
-
let p = A(null);
|
68
|
-
p.displayName = "OpenClosedContext";
|
69
|
-
var S = ((e) => (e[e.Open = 1] = "Open", e[e.Closed = 2] = "Closed", e[e.Closing = 4] = "Closing", e[e.Opening = 8] = "Opening", e))(S || {});
|
70
|
-
function T() {
|
71
|
-
return E(p);
|
72
|
-
}
|
73
|
-
function _({ value: e, children: t }) {
|
74
|
-
return h.createElement(p.Provider, { value: e }, t);
|
75
|
-
}
|
76
|
-
function w({ children: e }) {
|
77
|
-
return h.createElement(p.Provider, { value: null }, e);
|
78
|
-
}
|
79
|
-
export {
|
80
|
-
L as H,
|
81
|
-
R,
|
82
|
-
_ as c,
|
83
|
-
S as i,
|
84
|
-
w as s,
|
85
|
-
T as u
|
86
|
-
};
|