mimir-ui-kit 1.38.20 → 1.38.22
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Input-CQ7LgZWK.js +227 -0
- package/dist/assets/Input.css +1 -1
- package/dist/components/AnchorLink/Link.d.ts +16 -2
- package/dist/components/DatePicker/DatePicker.js +1 -1
- package/dist/components/Drawer/Drawer.d.ts +4 -2
- package/dist/components/Drawer/Drawer.js +154 -143
- 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 +39 -37
- package/dist/components/MultiSelectSearch/utils.js +1 -1
- package/dist/components/OtpInput/OtpInput.js +1 -1
- package/dist/components/SelectSearch/SelectSearch.js +1 -1
- package/dist/components/SelectSearch/utils.js +1 -1
- package/dist/components/TextArea/TextArea.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/index.js +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/propsWithAs.d.ts +6 -7
- package/package.json +4 -1
- package/dist/Input-BYrIS5GU.js +0 -225
@@ -0,0 +1,227 @@
|
|
1
|
+
import { jsxs as V, jsx as s, Fragment as Z } from "react/jsx-runtime";
|
2
|
+
import { c as o } from "./index-DIxK0V-G.js";
|
3
|
+
import { memo as $, forwardRef as ee, useState as B, useRef as te, useEffect as R } from "react";
|
4
|
+
import { EInputVariant as ae } from "./components/Input/constants.js";
|
5
|
+
import { useMergeRefs as se } from "./hooks/useMergeRefs/useMergeRefs.js";
|
6
|
+
import { Icon as le } from "./icons/Icon.js";
|
7
|
+
import { Button as re } from "./components/Button/Button.js";
|
8
|
+
import './assets/Input.css';const ne = "_label_1y1tj_27", oe = "_input_1y1tj_3", ce = "_focused_1y1tj_100", ie = "_disabled_1y1tj_106", de = "_clear_1y1tj_148", ue = "_s_1y1tj_199", _e = "_m_1y1tj_214", me = "_l_1y1tj_27", pe = "_success_1y1tj_270", fe = "_alarm_1y1tj_290", he = "_error_1y1tj_310", e = {
|
9
|
+
"input-wrapper": "_input-wrapper_1y1tj_3",
|
10
|
+
"required-mark": "_required-mark_1y1tj_17",
|
11
|
+
label: ne,
|
12
|
+
"has-left-slot": "_has-left-slot_1y1tj_46",
|
13
|
+
"has-right-slot": "_has-right-slot_1y1tj_49",
|
14
|
+
"active-label": "_active-label_1y1tj_54",
|
15
|
+
"label-text-wrapper": "_label-text-wrapper_1y1tj_69",
|
16
|
+
input: oe,
|
17
|
+
focused: ce,
|
18
|
+
"has-label": "_has-label_1y1tj_103",
|
19
|
+
disabled: ie,
|
20
|
+
"addon-icon": "_addon-icon_1y1tj_112",
|
21
|
+
"left-slot": "_left-slot_1y1tj_116",
|
22
|
+
"right-slot": "_right-slot_1y1tj_117",
|
23
|
+
clear: de,
|
24
|
+
s: ue,
|
25
|
+
m: _e,
|
26
|
+
l: me,
|
27
|
+
"default-gray": "_default-gray_1y1tj_243",
|
28
|
+
"default-white": "_default-white_1y1tj_255",
|
29
|
+
success: pe,
|
30
|
+
alarm: fe,
|
31
|
+
error: he
|
32
|
+
}, z = (t) => {
|
33
|
+
var m, l;
|
34
|
+
if (!t)
|
35
|
+
return null;
|
36
|
+
switch (t.addonType) {
|
37
|
+
case "icon": {
|
38
|
+
const p = (m = t.addonContent) == null ? void 0 : m.includes("16px"), j = (l = t.addonContent) == null ? void 0 : l.includes("24px");
|
39
|
+
return /* @__PURE__ */ s(
|
40
|
+
le,
|
41
|
+
{
|
42
|
+
style: {
|
43
|
+
"--icon-size": o({
|
44
|
+
"16px": p,
|
45
|
+
"24px": j
|
46
|
+
})
|
47
|
+
},
|
48
|
+
className: e["addon-icon"],
|
49
|
+
iconName: t.addonContent
|
50
|
+
}
|
51
|
+
);
|
52
|
+
}
|
53
|
+
case "text":
|
54
|
+
return t.addonContent;
|
55
|
+
case "react-node":
|
56
|
+
return /* @__PURE__ */ s(Z, { children: t.addonContent });
|
57
|
+
default:
|
58
|
+
return null;
|
59
|
+
}
|
60
|
+
}, ye = $(
|
61
|
+
ee(
|
62
|
+
(t, m) => {
|
63
|
+
const {
|
64
|
+
value: l,
|
65
|
+
className: p,
|
66
|
+
wrapperClassName: j,
|
67
|
+
rightSlotClassName: L,
|
68
|
+
requiredMarkClassName: D,
|
69
|
+
variant: q = ae.DefaultGray,
|
70
|
+
type: E = "text",
|
71
|
+
autofocus: g,
|
72
|
+
readonly: c,
|
73
|
+
id: A,
|
74
|
+
onFocus: N,
|
75
|
+
onBlur: x,
|
76
|
+
label: u,
|
77
|
+
withClearButton: M,
|
78
|
+
disabled: a,
|
79
|
+
onChange: i,
|
80
|
+
rightAddon: O,
|
81
|
+
status: F,
|
82
|
+
leftAddon: S,
|
83
|
+
size: w = "m",
|
84
|
+
numbersOnly: T,
|
85
|
+
required: C,
|
86
|
+
maxLength: v,
|
87
|
+
autocomplete: G = "on",
|
88
|
+
...P
|
89
|
+
} = t, [_, I] = B(g), [f, h] = B(!!l), d = te(null), W = se(d, m);
|
90
|
+
R(() => {
|
91
|
+
g && I(!0);
|
92
|
+
}, [g]), R(() => {
|
93
|
+
h(!!l);
|
94
|
+
}, [l]);
|
95
|
+
const H = (r) => {
|
96
|
+
const n = r.currentTarget.value;
|
97
|
+
x == null || x(r), I(!1), h(!!n);
|
98
|
+
}, J = (r) => {
|
99
|
+
c || (I(!0), N == null || N(r));
|
100
|
+
}, K = () => {
|
101
|
+
d != null && d.current && (d.current.value = "", d.current.focus(), h(!1), i == null || i({
|
102
|
+
target: { value: "" }
|
103
|
+
}));
|
104
|
+
}, Q = (r) => {
|
105
|
+
let n = r.target.value;
|
106
|
+
T && (n = n.replace(/\D/g, "")), v !== void 0 && (n = n.slice(0, v)), r.target.value = n, i == null || i(r), h(!!n);
|
107
|
+
}, y = z(S), b = z(O), U = {
|
108
|
+
[e.readonly]: a || c,
|
109
|
+
[e.focused]: _,
|
110
|
+
[e.disabled]: a || c,
|
111
|
+
[e["has-label"]]: !!u,
|
112
|
+
[e["has-left-slot"]]: !!y,
|
113
|
+
[e["has-right-slot"]]: !!b
|
114
|
+
}, k = _ || f || !!l, X = o(e.label, p, e[w], {
|
115
|
+
[e["active-label"]]: k,
|
116
|
+
[e.disabled]: a || c,
|
117
|
+
[e["has-left-slot"]]: !!y,
|
118
|
+
[e["has-right-slot"]]: !!b
|
119
|
+
}), Y = o(e.input, U, p, [
|
120
|
+
e[q],
|
121
|
+
e[F ?? ""],
|
122
|
+
e[w]
|
123
|
+
]);
|
124
|
+
return /* @__PURE__ */ V(
|
125
|
+
"div",
|
126
|
+
{
|
127
|
+
className: o(
|
128
|
+
e["input-wrapper"],
|
129
|
+
e[q],
|
130
|
+
e[F ?? ""],
|
131
|
+
e[w],
|
132
|
+
{
|
133
|
+
[e.disabled]: a || c,
|
134
|
+
[e.focused]: _
|
135
|
+
},
|
136
|
+
j
|
137
|
+
),
|
138
|
+
children: [
|
139
|
+
u && /* @__PURE__ */ V("label", { htmlFor: A, className: X, children: [
|
140
|
+
/* @__PURE__ */ s("span", { className: e["label-text-wrapper"], children: u }),
|
141
|
+
C && (f || _) && /* @__PURE__ */ s(
|
142
|
+
"span",
|
143
|
+
{
|
144
|
+
className: e["required-mark"],
|
145
|
+
"data-testid": "required-mark"
|
146
|
+
}
|
147
|
+
)
|
148
|
+
] }),
|
149
|
+
y && /* @__PURE__ */ s(
|
150
|
+
"span",
|
151
|
+
{
|
152
|
+
className: o(e["left-slot"], {
|
153
|
+
[e.focused]: k,
|
154
|
+
[e["has-label"]]: !!u,
|
155
|
+
[e.disabled]: a
|
156
|
+
}),
|
157
|
+
children: y
|
158
|
+
}
|
159
|
+
),
|
160
|
+
/* @__PURE__ */ s(
|
161
|
+
"input",
|
162
|
+
{
|
163
|
+
ref: W,
|
164
|
+
type: E,
|
165
|
+
id: A,
|
166
|
+
className: Y,
|
167
|
+
onFocus: J,
|
168
|
+
onBlur: H,
|
169
|
+
readOnly: c,
|
170
|
+
value: l,
|
171
|
+
onChange: Q,
|
172
|
+
maxLength: v,
|
173
|
+
disabled: a,
|
174
|
+
required: C,
|
175
|
+
autoComplete: G,
|
176
|
+
...P
|
177
|
+
}
|
178
|
+
),
|
179
|
+
b && /* @__PURE__ */ s(
|
180
|
+
"span",
|
181
|
+
{
|
182
|
+
className: o(e["right-slot"], L, {
|
183
|
+
[e.focused]: k,
|
184
|
+
[e["has-label"]]: !!u,
|
185
|
+
[e.disabled]: a
|
186
|
+
}),
|
187
|
+
children: b
|
188
|
+
}
|
189
|
+
),
|
190
|
+
C && !f && !_ && /* @__PURE__ */ s(
|
191
|
+
"span",
|
192
|
+
{
|
193
|
+
className: o(
|
194
|
+
e["required-mark"],
|
195
|
+
D
|
196
|
+
),
|
197
|
+
"data-testid": "required-mark"
|
198
|
+
}
|
199
|
+
),
|
200
|
+
M && f && /* @__PURE__ */ s(
|
201
|
+
re,
|
202
|
+
{
|
203
|
+
tabIndex: -1,
|
204
|
+
className: o(e.clear, {
|
205
|
+
[e.disabled]: a
|
206
|
+
}),
|
207
|
+
isIconButton: !0,
|
208
|
+
iconName: "Close16px",
|
209
|
+
size: "m-s",
|
210
|
+
clear: !0,
|
211
|
+
disabled: a || c,
|
212
|
+
variant: "secondary-gray",
|
213
|
+
onClick: K,
|
214
|
+
"data-testid": "clear-button"
|
215
|
+
}
|
216
|
+
)
|
217
|
+
]
|
218
|
+
}
|
219
|
+
);
|
220
|
+
}
|
221
|
+
)
|
222
|
+
);
|
223
|
+
ye.displayName = "Input";
|
224
|
+
export {
|
225
|
+
ye as I,
|
226
|
+
e as c
|
227
|
+
};
|
package/dist/assets/Input.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
._input-wrapper_zg2ds_3{--input-border-radius-l: 8px;--input-border-radius-m: 6px;--input-border-radius-s: 6px;--input-required-mark-size: 8px;position:relative;display:flex;padding:0 var(--mimir-space-m);overflow:hidden;background-color:var(--input-bg-color);border-bottom:1px solid transparent;border-radius:var(--input-border-radius);transition:background-color .2s ease,border-color .15s ease,box-shadow .15s ease,color .15s ease,fill .15s ease}._input-wrapper_zg2ds_3 ._required-mark_zg2ds_17{display:block;flex:0 0 var(--input-required-mark-size);align-self:center;width:var(--input-required-mark-size);height:var(--input-required-mark-size);margin-left:var(--mimir-space-m);background-color:var(--citrine-normal);border-radius:50%}._input-wrapper_zg2ds_3 ._label_zg2ds_27{--input-required-mark-size: 6px;position:absolute;top:calc(var(--input-height) / 2 - var(--input-font-size) / 2);left:var(--mimir-space-m);z-index:1;display:flex;color:var(--label-color);font-size:var(--input-font-size);white-space:nowrap;-moz-column-gap:var(--mimir-space-xs);column-gap:var(--mimir-space-xs);transform-origin:left center;transition:transform .15s ease-out,font-size .15s ease-out,left .15s ease-out,color .15s ease-out;pointer-events:none}._input-wrapper_zg2ds_3 ._label_zg2ds_27._has-left-slot_zg2ds_42{left:calc(var(--mimir-space-m) + var(--icon-size) + var(--clear-button-mg))}._input-wrapper_zg2ds_3 ._label_zg2ds_27._active-label_zg2ds_45{font-size:var(--label-font-size-active);transform:translateY(calc(var(--label-font-size-active) * -1))}._input-wrapper_zg2ds_3 ._label_zg2ds_27._active-label_zg2ds_45._has-left-slot_zg2ds_42{left:var(--mimir-space-m)}._input-wrapper_zg2ds_3 ._label_zg2ds_27._active-label_zg2ds_45 ._required-mark_zg2ds_17{margin-left:0}._input-wrapper_zg2ds_3 ._input_zg2ds_3{position:relative;display:block;flex:1;width:100%;min-width:0;height:var(--input-height);color:var(--dark-text);font-size:var(--input-font-size);font-family:var(--mimir-font-inter);line-height:var(--input-line-height);letter-spacing:-.42px;text-overflow:ellipsis;background-color:inherit;border-radius:var(--input-border-radius);outline:none;cursor:var(--input-cursor);transition:border-color .15s ease,box-shadow .15s ease,color .15s ease,fill .15s ease;-webkit-appearance:none;-moz-appearance:none;appearance:none;font-feature-settings:"zero"}._input-wrapper_zg2ds_3 ._input_zg2ds_3._has-left-slot_zg2ds_42{padding-left:0}._input-wrapper_zg2ds_3 ._input_zg2ds_3._has-right-slot_zg2ds_79{padding-right:0}._input-wrapper_zg2ds_3 ._input_zg2ds_3._focused_zg2ds_82{padding-top:0}._input-wrapper_zg2ds_3 ._input_zg2ds_3._has-label_zg2ds_85{padding-top:var(--input-padding-position)}._input-wrapper_zg2ds_3 ._input_zg2ds_3._disabled_zg2ds_88{color:var(--light-text)}._input-wrapper_zg2ds_3 ._input_zg2ds_3._disabled_zg2ds_88:hover,._input-wrapper_zg2ds_3 ._input_zg2ds_3._disabled_zg2ds_88:active,._input-wrapper_zg2ds_3 ._input_zg2ds_3._disabled_zg2ds_88:focus{color:var(--light-text)}._input-wrapper_zg2ds_3 ._addon-icon_zg2ds_94{width:var(--icon-size);height:var(--icon-size)}._input-wrapper_zg2ds_3 ._left-slot_zg2ds_98,._input-wrapper_zg2ds_3 ._right-slot_zg2ds_99{display:flex;align-items:center;height:var(--input-height);color:var(--black-60);font-size:var(--input-font-size);font-family:var(--mimir-font-inter);line-height:var(--input-line-height);background-color:inherit;transition:padding-top .15s ease-out}._input-wrapper_zg2ds_3 ._left-slot_zg2ds_98._focused_zg2ds_82._has-label_zg2ds_85,._input-wrapper_zg2ds_3 ._right-slot_zg2ds_99._focused_zg2ds_82._has-label_zg2ds_85{padding-top:var(--input-padding-position)}._input-wrapper_zg2ds_3 ._left-slot_zg2ds_98._disabled_zg2ds_88,._input-wrapper_zg2ds_3 ._right-slot_zg2ds_99._disabled_zg2ds_88{color:var(--white);cursor:not-allowed}._input-wrapper_zg2ds_3 ._left-slot_zg2ds_98._disabled_zg2ds_88 ._addon-icon_zg2ds_94 path,._input-wrapper_zg2ds_3 ._right-slot_zg2ds_99._disabled_zg2ds_88 ._addon-icon_zg2ds_94 path{fill:var(--white)}._input-wrapper_zg2ds_3 ._left-slot_zg2ds_98{justify-content:flex-end;margin-right:var(--clear-button-mg)}._input-wrapper_zg2ds_3 ._right-slot_zg2ds_99{margin-left:var(--clear-button-mg)}._input-wrapper_zg2ds_3 ._clear_zg2ds_130{align-self:center;width:16px;height:16px;margin-left:var(--clear-button-mg)}._input-wrapper_zg2ds_3 ._clear_zg2ds_130._disabled_zg2ds_88{cursor:not-allowed}._input-wrapper_zg2ds_3 svg{color:currentcolor;fill:currentcolor}._input-wrapper_zg2ds_3:hover ._label_zg2ds_27,._input-wrapper_zg2ds_3:focus-within ._label_zg2ds_27{color:var(--label-color)}._input-wrapper_zg2ds_3:hover{background-color:var(--input-bg-color-hover)}._input-wrapper_zg2ds_3:focus-within{background-color:var(--input-bg-color-active);border-bottom:1px solid var(--input-bottom-color-active)}._input-wrapper_zg2ds_3._focused_zg2ds_82{color:var(--input-color-active);background-color:var(--input-bg-color-active)}._input-wrapper_zg2ds_3._focused_zg2ds_82:hover{background-color:var(--input-bg-color-hover)}._input-wrapper_zg2ds_3._disabled_zg2ds_88{--input-cursor: not-allowed;--label-color: var(--light-text);color:var(--light-text);background-color:var(--black-20);border-bottom:1px solid transparent}._input-wrapper_zg2ds_3._disabled_zg2ds_88:hover,._input-wrapper_zg2ds_3._disabled_zg2ds_88:active,._input-wrapper_zg2ds_3._disabled_zg2ds_88:focus{--label-color: var(--light-text);color:var(--light-text);background-color:var(--black-20);border-bottom:1px solid transparent;box-shadow:none}._input-wrapper_zg2ds_3._disabled_zg2ds_88::-moz-placeholder{color:var(--light-text)}._input-wrapper_zg2ds_3._disabled_zg2ds_88::placeholder{color:var(--light-text)}._input-wrapper_zg2ds_3._disabled_zg2ds_88:hover::-moz-placeholder{color:var(--light-text)}._input-wrapper_zg2ds_3._disabled_zg2ds_88:hover::placeholder{color:var(--light-text)}._s_zg2ds_181{--input-height: var(--mimir-space-xxl);--input-font-size: var(--mimir-control-text-size-m);--input-line-height: var(--mimir-line-height-text-xs);--input-padding: var(--mimir-space-m);--input-padding-position: var(--mimir-space-1xs);--input-border-radius: var(--input-border-radius-s);--label-font-size-active: var(--mimir-size-text-xs);--label-spacing: var(--mimir-space-1xs);--input-required-mark-size: 6px;--clear-button-mg: var(--mimir-space-2xs);--icon-size: 16px;--left-addon-position: 0px}._m_zg2ds_196{--input-height: var(--mimir-space-4xl);--input-font-size: var(--mimir-control-text-size-l);--input-line-height: var(--mimir-line-height-text-s1);--input-padding: var(--mimir-space-m);--input-padding-position: var(--mimir-space-xs);--input-border-radius: var(--input-border-radius-m);--label-font-size-active: var(--mimir-size-text-s);--label-spacing: var(--mimir-space-xs);--input-required-mark-size: 6px;--clear-button-mg: var(--mimir-space-2xs);--icon-size: 16px;--left-addon-position: var(--mimir-space-3xs)}._l_zg2ds_27{--input-height: var(--mimir-space-4xxl);--input-font-size: var(--mimir-control-text-size-2xl);--input-line-height: var(--mimir-line-height-text-l);--input-padding: var(--mimir-space-m);--input-padding-position: var(--mimir-space-s);--input-border-radius: var(--input-border-radius-l);--label-font-size-active: var(--mimir-size-text-s);--label-spacing: var(--mimir-space-s);--clear-button-mg: var(--mimir-space-xs);--icon-size: 24px;--left-addon-position: var(--mimir-space-s)}._default-gray_zg2ds_225{--input-bg-color: var(--black-5);--input-bg-color-active: var(--black-10);--input-bg-color-hover: var(--black-10);--input-color: var(--dark-text);--input-color-hover: var(--dark-text);--input-color-active: var(--dark-text);--input-border: transparent;--input-bottom-color-active: var(--citrine-normal);--label-color: var(--black-60)}._default-white_zg2ds_237{--input-bg-color: var(--white);--input-bg-color-hover: var(--black-10);--input-bg-color-active: var(--white);--input-color: var(--dark-text);--input-color-hover: var(--dark-text);--input-color-active: var(--dark-text);--input-border: transparent;--input-bottom-color-active: var(--citrine-normal);--label-color: var(--black-60)}._default-white_zg2ds_237:hover{--label-color: var(--dark-text)}._default-gray_zg2ds_225._success_zg2ds_252,._default-white_zg2ds_237._success_zg2ds_252{--input-bg-color: var(--success-bg-active);--input-bg-color-hover: var(--success-bg-hover);--input-bg-color-active: var(--success-bg-active);--input-color: var(--dark-text);--input-color-hover: var(--dark-text);--input-color-active: var(--dark-text);--input-border: transparent;--input-bottom-color-active: var(--success-normal);--label-color: var(--black-60)}._default-gray_zg2ds_225._success_zg2ds_252::-moz-placeholder,._default-white_zg2ds_237._success_zg2ds_252::-moz-placeholder{color:var(--input-color)}._default-gray_zg2ds_225._success_zg2ds_252::placeholder,._default-white_zg2ds_237._success_zg2ds_252::placeholder{color:var(--input-color)}._default-gray_zg2ds_225._success_zg2ds_252:hover::-moz-placeholder,._default-white_zg2ds_237._success_zg2ds_252:hover::-moz-placeholder{color:var(--input-color)}._default-gray_zg2ds_225._success_zg2ds_252:hover::placeholder,._default-white_zg2ds_237._success_zg2ds_252:hover::placeholder{color:var(--input-color)}._default-gray_zg2ds_225._alarm_zg2ds_272,._default-white_zg2ds_237._alarm_zg2ds_272{--input-bg-color: var(--alarm-bg-active);--input-bg-color-hover: var(--alarm-bg-hover);--input-bg-color-active: var(--alarm-bg-active);--input-color: var(--dark-text);--input-color-hover: var(--dark-text);--input-color-active: var(--dark-text);--input-border: transparent;--input-bottom-color-active: var(--alarm-normal);--label-color: var(--black-60)}._default-gray_zg2ds_225._alarm_zg2ds_272::-moz-placeholder,._default-white_zg2ds_237._alarm_zg2ds_272::-moz-placeholder{color:var(--input-color)}._default-gray_zg2ds_225._alarm_zg2ds_272::placeholder,._default-white_zg2ds_237._alarm_zg2ds_272::placeholder{color:var(--input-color)}._default-gray_zg2ds_225._alarm_zg2ds_272:hover::-moz-placeholder,._default-white_zg2ds_237._alarm_zg2ds_272:hover::-moz-placeholder{color:var(--input-color)}._default-gray_zg2ds_225._alarm_zg2ds_272:hover::placeholder,._default-white_zg2ds_237._alarm_zg2ds_272:hover::placeholder{color:var(--input-color)}._default-gray_zg2ds_225._error_zg2ds_292,._default-white_zg2ds_237._error_zg2ds_292{--input-bg-color: var(--error-bg-active);--input-bg-color-hover: var(--error-bg-hover);--input-bg-color-active: var(--error-bg-active);--input-color: var(--dark-text);--input-color-hover: var(--dark-text);--input-color-active: var(--dark-text);--input-border: transparent;--input-bottom-color-active: var(--error-normal);--label-color: var(--black-60)}._default-gray_zg2ds_225._error_zg2ds_292::-moz-placeholder,._default-white_zg2ds_237._error_zg2ds_292::-moz-placeholder{color:var(--input-color)}._default-gray_zg2ds_225._error_zg2ds_292::placeholder,._default-white_zg2ds_237._error_zg2ds_292::placeholder{color:var(--input-color)}._default-gray_zg2ds_225._error_zg2ds_292:hover::-moz-placeholder,._default-white_zg2ds_237._error_zg2ds_292:hover::-moz-placeholder{color:var(--input-color)}._default-gray_zg2ds_225._error_zg2ds_292:hover::placeholder,._default-white_zg2ds_237._error_zg2ds_292:hover::placeholder{color:var(--input-color)}
|
1
|
+
._input-wrapper_1y1tj_3{--input-border-radius-l: 8px;--input-border-radius-m: 6px;--input-border-radius-s: 6px;--input-required-mark-size: 8px;position:relative;display:flex;padding:0 var(--mimir-space-m);overflow:hidden;background-color:var(--input-bg-color);border-bottom:1px solid transparent;border-radius:var(--input-border-radius);transition:background-color .2s ease,border-color .15s ease,box-shadow .15s ease,color .15s ease,fill .15s ease}._input-wrapper_1y1tj_3 ._required-mark_1y1tj_17{display:block;flex:0 0 var(--input-required-mark-size);align-self:center;width:var(--input-required-mark-size);height:var(--input-required-mark-size);margin-left:var(--mimir-space-m);background-color:var(--citrine-normal);border-radius:50%}._input-wrapper_1y1tj_3 ._label_1y1tj_27{--input-required-mark-size: 6px;--label-default-max-width: calc( 100% - calc(var(--input-padding) + var(--mimir-space-xxl)) );position:absolute;top:calc(var(--input-height) / 2 - var(--input-font-size) / 2);left:var(--mimir-space-m);z-index:1;display:flex;max-width:var(--label-default-max-width);color:var(--label-color);font-size:var(--input-font-size);white-space:nowrap;-moz-column-gap:var(--mimir-space-xs);column-gap:var(--mimir-space-xs);transform-origin:left center;transition:transform .15s ease-out,font-size .15s ease-out,left .15s ease-out,color .15s ease-out;pointer-events:none}._input-wrapper_1y1tj_3 ._label_1y1tj_27._has-left-slot_1y1tj_46{left:calc(var(--mimir-space-m) + var(--icon-size) + var(--clear-button-mg))}._input-wrapper_1y1tj_3 ._label_1y1tj_27._has-right-slot_1y1tj_49{--label-default-max-width: calc( 100% - calc(calc(var(--input-padding) * 2) + var(--mimir-space-xxl)) )}._input-wrapper_1y1tj_3 ._label_1y1tj_27._active-label_1y1tj_54{font-size:var(--label-font-size-active);transform:translateY(calc(var(--label-font-size-active) * -1))}._input-wrapper_1y1tj_3 ._label_1y1tj_27._active-label_1y1tj_54._has-left-slot_1y1tj_46{left:var(--mimir-space-m)}._input-wrapper_1y1tj_3 ._label_1y1tj_27._active-label_1y1tj_54._has-right-slot_1y1tj_49{--label-default-max-width: calc( 100% - calc(calc(var(--input-padding) * 2)) )}._input-wrapper_1y1tj_3 ._label_1y1tj_27._active-label_1y1tj_54 ._required-mark_1y1tj_17{margin-left:0}._input-wrapper_1y1tj_3 ._label_1y1tj_27 ._label-text-wrapper_1y1tj_69{overflow:hidden;text-overflow:ellipsis}._input-wrapper_1y1tj_3 ._input_1y1tj_3{position:relative;display:block;flex:1;width:100%;min-width:0;height:var(--input-height);color:var(--dark-text);font-size:var(--input-font-size);font-family:var(--mimir-font-inter);line-height:var(--input-line-height);letter-spacing:-.42px;text-overflow:ellipsis;background-color:inherit;border-radius:var(--input-border-radius);outline:none;cursor:var(--input-cursor);transition:border-color .15s ease,box-shadow .15s ease,color .15s ease,fill .15s ease;-webkit-appearance:none;-moz-appearance:none;appearance:none;font-feature-settings:"zero"}._input-wrapper_1y1tj_3 ._input_1y1tj_3._has-left-slot_1y1tj_46{padding-left:0}._input-wrapper_1y1tj_3 ._input_1y1tj_3._has-right-slot_1y1tj_49{padding-right:0}._input-wrapper_1y1tj_3 ._input_1y1tj_3._focused_1y1tj_100{padding-top:0}._input-wrapper_1y1tj_3 ._input_1y1tj_3._has-label_1y1tj_103{padding-top:var(--input-padding-position)}._input-wrapper_1y1tj_3 ._input_1y1tj_3._disabled_1y1tj_106{color:var(--light-text)}._input-wrapper_1y1tj_3 ._input_1y1tj_3._disabled_1y1tj_106:hover,._input-wrapper_1y1tj_3 ._input_1y1tj_3._disabled_1y1tj_106:active,._input-wrapper_1y1tj_3 ._input_1y1tj_3._disabled_1y1tj_106:focus{color:var(--light-text)}._input-wrapper_1y1tj_3 ._addon-icon_1y1tj_112{width:var(--icon-size);height:var(--icon-size)}._input-wrapper_1y1tj_3 ._left-slot_1y1tj_116,._input-wrapper_1y1tj_3 ._right-slot_1y1tj_117{display:flex;align-items:center;height:var(--input-height);color:var(--black-60);font-size:var(--input-font-size);font-family:var(--mimir-font-inter);line-height:var(--input-line-height);background-color:inherit;transition:padding-top .15s ease-out}._input-wrapper_1y1tj_3 ._left-slot_1y1tj_116._focused_1y1tj_100._has-label_1y1tj_103,._input-wrapper_1y1tj_3 ._right-slot_1y1tj_117._focused_1y1tj_100._has-label_1y1tj_103{padding-top:var(--input-padding-position)}._input-wrapper_1y1tj_3 ._left-slot_1y1tj_116._disabled_1y1tj_106,._input-wrapper_1y1tj_3 ._right-slot_1y1tj_117._disabled_1y1tj_106{color:var(--white);cursor:not-allowed}._input-wrapper_1y1tj_3 ._left-slot_1y1tj_116._disabled_1y1tj_106 ._addon-icon_1y1tj_112 path,._input-wrapper_1y1tj_3 ._right-slot_1y1tj_117._disabled_1y1tj_106 ._addon-icon_1y1tj_112 path{fill:var(--white)}._input-wrapper_1y1tj_3 ._left-slot_1y1tj_116{justify-content:flex-end;margin-right:var(--clear-button-mg)}._input-wrapper_1y1tj_3 ._right-slot_1y1tj_117{margin-left:var(--clear-button-mg)}._input-wrapper_1y1tj_3 ._clear_1y1tj_148{align-self:center;width:16px;height:16px;margin-left:var(--clear-button-mg)}._input-wrapper_1y1tj_3 ._clear_1y1tj_148._disabled_1y1tj_106{cursor:not-allowed}._input-wrapper_1y1tj_3 svg{color:currentcolor;fill:currentcolor}._input-wrapper_1y1tj_3:hover ._label_1y1tj_27,._input-wrapper_1y1tj_3:focus-within ._label_1y1tj_27{color:var(--label-color)}._input-wrapper_1y1tj_3:hover{background-color:var(--input-bg-color-hover)}._input-wrapper_1y1tj_3:focus-within{background-color:var(--input-bg-color-active);border-bottom:1px solid var(--input-bottom-color-active)}._input-wrapper_1y1tj_3._focused_1y1tj_100{color:var(--input-color-active);background-color:var(--input-bg-color-active)}._input-wrapper_1y1tj_3._focused_1y1tj_100:hover{background-color:var(--input-bg-color-hover)}._input-wrapper_1y1tj_3._disabled_1y1tj_106{--input-cursor: not-allowed;--label-color: var(--light-text);color:var(--light-text);background-color:var(--black-20);border-bottom:1px solid transparent}._input-wrapper_1y1tj_3._disabled_1y1tj_106:hover,._input-wrapper_1y1tj_3._disabled_1y1tj_106:active,._input-wrapper_1y1tj_3._disabled_1y1tj_106:focus{--label-color: var(--light-text);color:var(--light-text);background-color:var(--black-20);border-bottom:1px solid transparent;box-shadow:none}._input-wrapper_1y1tj_3._disabled_1y1tj_106::-moz-placeholder{color:var(--light-text)}._input-wrapper_1y1tj_3._disabled_1y1tj_106::placeholder{color:var(--light-text)}._input-wrapper_1y1tj_3._disabled_1y1tj_106:hover::-moz-placeholder{color:var(--light-text)}._input-wrapper_1y1tj_3._disabled_1y1tj_106:hover::placeholder{color:var(--light-text)}._s_1y1tj_199{--input-height: var(--mimir-space-xxl);--input-font-size: var(--mimir-control-text-size-m);--input-line-height: var(--mimir-line-height-text-xs);--input-padding: var(--mimir-space-m);--input-padding-position: var(--mimir-space-1xs);--input-border-radius: var(--input-border-radius-s);--label-font-size-active: var(--mimir-size-text-xs);--label-spacing: var(--mimir-space-1xs);--input-required-mark-size: 6px;--clear-button-mg: var(--mimir-space-2xs);--icon-size: 16px;--left-addon-position: 0px}._m_1y1tj_214{--input-height: var(--mimir-space-4xl);--input-font-size: var(--mimir-control-text-size-l);--input-line-height: var(--mimir-line-height-text-s1);--input-padding: var(--mimir-space-m);--input-padding-position: var(--mimir-space-xs);--input-border-radius: var(--input-border-radius-m);--label-font-size-active: var(--mimir-size-text-s);--label-spacing: var(--mimir-space-xs);--input-required-mark-size: 6px;--clear-button-mg: var(--mimir-space-2xs);--icon-size: 16px;--left-addon-position: var(--mimir-space-3xs)}._l_1y1tj_27{--input-height: var(--mimir-space-4xxl);--input-font-size: var(--mimir-control-text-size-2xl);--input-line-height: var(--mimir-line-height-text-l);--input-padding: var(--mimir-space-m);--input-padding-position: var(--mimir-space-s);--input-border-radius: var(--input-border-radius-l);--label-font-size-active: var(--mimir-size-text-s);--label-spacing: var(--mimir-space-s);--clear-button-mg: var(--mimir-space-xs);--icon-size: 24px;--left-addon-position: var(--mimir-space-s)}._default-gray_1y1tj_243{--input-bg-color: var(--black-5);--input-bg-color-active: var(--black-10);--input-bg-color-hover: var(--black-10);--input-color: var(--dark-text);--input-color-hover: var(--dark-text);--input-color-active: var(--dark-text);--input-border: transparent;--input-bottom-color-active: var(--citrine-normal);--label-color: var(--black-60)}._default-white_1y1tj_255{--input-bg-color: var(--white);--input-bg-color-hover: var(--black-10);--input-bg-color-active: var(--white);--input-color: var(--dark-text);--input-color-hover: var(--dark-text);--input-color-active: var(--dark-text);--input-border: transparent;--input-bottom-color-active: var(--citrine-normal);--label-color: var(--black-60)}._default-white_1y1tj_255:hover{--label-color: var(--dark-text)}._default-gray_1y1tj_243._success_1y1tj_270,._default-white_1y1tj_255._success_1y1tj_270{--input-bg-color: var(--success-bg-active);--input-bg-color-hover: var(--success-bg-hover);--input-bg-color-active: var(--success-bg-active);--input-color: var(--dark-text);--input-color-hover: var(--dark-text);--input-color-active: var(--dark-text);--input-border: transparent;--input-bottom-color-active: var(--success-normal);--label-color: var(--black-60)}._default-gray_1y1tj_243._success_1y1tj_270::-moz-placeholder,._default-white_1y1tj_255._success_1y1tj_270::-moz-placeholder{color:var(--input-color)}._default-gray_1y1tj_243._success_1y1tj_270::placeholder,._default-white_1y1tj_255._success_1y1tj_270::placeholder{color:var(--input-color)}._default-gray_1y1tj_243._success_1y1tj_270:hover::-moz-placeholder,._default-white_1y1tj_255._success_1y1tj_270:hover::-moz-placeholder{color:var(--input-color)}._default-gray_1y1tj_243._success_1y1tj_270:hover::placeholder,._default-white_1y1tj_255._success_1y1tj_270:hover::placeholder{color:var(--input-color)}._default-gray_1y1tj_243._alarm_1y1tj_290,._default-white_1y1tj_255._alarm_1y1tj_290{--input-bg-color: var(--alarm-bg-active);--input-bg-color-hover: var(--alarm-bg-hover);--input-bg-color-active: var(--alarm-bg-active);--input-color: var(--dark-text);--input-color-hover: var(--dark-text);--input-color-active: var(--dark-text);--input-border: transparent;--input-bottom-color-active: var(--alarm-normal);--label-color: var(--black-60)}._default-gray_1y1tj_243._alarm_1y1tj_290::-moz-placeholder,._default-white_1y1tj_255._alarm_1y1tj_290::-moz-placeholder{color:var(--input-color)}._default-gray_1y1tj_243._alarm_1y1tj_290::placeholder,._default-white_1y1tj_255._alarm_1y1tj_290::placeholder{color:var(--input-color)}._default-gray_1y1tj_243._alarm_1y1tj_290:hover::-moz-placeholder,._default-white_1y1tj_255._alarm_1y1tj_290:hover::-moz-placeholder{color:var(--input-color)}._default-gray_1y1tj_243._alarm_1y1tj_290:hover::placeholder,._default-white_1y1tj_255._alarm_1y1tj_290:hover::placeholder{color:var(--input-color)}._default-gray_1y1tj_243._error_1y1tj_310,._default-white_1y1tj_255._error_1y1tj_310{--input-bg-color: var(--error-bg-active);--input-bg-color-hover: var(--error-bg-hover);--input-bg-color-active: var(--error-bg-active);--input-color: var(--dark-text);--input-color-hover: var(--dark-text);--input-color-active: var(--dark-text);--input-border: transparent;--input-bottom-color-active: var(--error-normal);--label-color: var(--black-60)}._default-gray_1y1tj_243._error_1y1tj_310::-moz-placeholder,._default-white_1y1tj_255._error_1y1tj_310::-moz-placeholder{color:var(--input-color)}._default-gray_1y1tj_243._error_1y1tj_310::placeholder,._default-white_1y1tj_255._error_1y1tj_310::placeholder{color:var(--input-color)}._default-gray_1y1tj_243._error_1y1tj_310:hover::-moz-placeholder,._default-white_1y1tj_255._error_1y1tj_310:hover::-moz-placeholder{color:var(--input-color)}._default-gray_1y1tj_243._error_1y1tj_310:hover::placeholder,._default-white_1y1tj_255._error_1y1tj_310:hover::placeholder{color:var(--input-color)}
|
@@ -1,3 +1,17 @@
|
|
1
|
-
import {
|
1
|
+
import { ElementType, ReactElement, ReactNode } from 'react';
|
2
|
+
import { ELinkSize, ELinkVariant } from './constants';
|
3
|
+
import { TIconProps } from '../../icons';
|
4
|
+
import { Props } from '../../types/propsWithAs';
|
2
5
|
|
3
|
-
|
6
|
+
type TProps = {
|
7
|
+
variant?: ELinkVariant | `${ELinkVariant}`;
|
8
|
+
size?: ELinkSize | `${ELinkSize}`;
|
9
|
+
leftIcon?: TIconProps;
|
10
|
+
rightIcon?: TIconProps;
|
11
|
+
disabled?: boolean;
|
12
|
+
className?: string;
|
13
|
+
children?: ReactNode;
|
14
|
+
};
|
15
|
+
type TLinkComponent = <C extends ElementType = 'span'>(props: Props<C, TProps>) => ReactElement | ReactNode;
|
16
|
+
export declare const Link: TLinkComponent;
|
17
|
+
export {};
|
@@ -10,7 +10,7 @@ import { YearPickerModal as at } from "./YearPickerModal.js";
|
|
10
10
|
import { useClickOutside as mt } from "../../hooks/useClickOutside/useClickOutside.js";
|
11
11
|
import { Icon as X } from "../../icons/Icon.js";
|
12
12
|
import { formating as l } from "../../utils/index.js";
|
13
|
-
import { I as pt } from "../../Input-
|
13
|
+
import { I as pt } from "../../Input-CQ7LgZWK.js";
|
14
14
|
import { EInputStatus as dt, EInputSize as E } from "../Input/constants.js";
|
15
15
|
const ft = {
|
16
16
|
days: ot,
|
@@ -1,5 +1,6 @@
|
|
1
|
-
import {
|
1
|
+
import { ElementType, ReactElement, ReactNode } from 'react';
|
2
2
|
import { EDrawerPosition } from './constants';
|
3
|
+
import { Props } from '../../types/propsWithAs';
|
3
4
|
|
4
5
|
export declare const ANIMATION_DELAY = 300;
|
5
6
|
type TProps = {
|
@@ -78,8 +79,9 @@ type TProps = {
|
|
78
79
|
*/
|
79
80
|
showCloseButton?: boolean;
|
80
81
|
};
|
82
|
+
type TDrawerComponent = <C extends ElementType = 'div'>(props: Props<C, TProps>) => ReactElement | ReactNode;
|
81
83
|
/**
|
82
84
|
* Компонент шторки, который может выезжать слева, справа или внизу.
|
83
85
|
*/
|
84
|
-
export declare const Drawer:
|
86
|
+
export declare const Drawer: TDrawerComponent;
|
85
87
|
export {};
|
@@ -1,155 +1,166 @@
|
|
1
|
-
import { jsxs as
|
1
|
+
import { jsxs as _, jsx as o, Fragment as G } from "react/jsx-runtime";
|
2
2
|
import { c as s } from "../../index-DIxK0V-G.js";
|
3
|
-
import { useState as
|
4
|
-
import { EDrawerPosition as
|
5
|
-
import { useMediaQuery as
|
6
|
-
import { EMediaQuery as
|
7
|
-
import { useLockBodyScroll as
|
8
|
-
import { useResizeObserver as
|
3
|
+
import { forwardRef as K, useState as w, useRef as V, useCallback as u, useEffect as W } from "react";
|
4
|
+
import { EDrawerPosition as v } from "./constants.js";
|
5
|
+
import { useMediaQuery as Y } from "../../hooks/useMediaQuery/useMediaQuery.js";
|
6
|
+
import { EMediaQuery as q } from "../../hooks/useMediaQuery/constants.js";
|
7
|
+
import { useLockBodyScroll as J } from "../../hooks/useLockBodyScroll/useLockBodyScroll.js";
|
8
|
+
import { useResizeObserver as U } from "../../hooks/useResizeObserver/useResizeObserver.js";
|
9
9
|
import { Button as k } from "../Button/Button.js";
|
10
|
-
import { EButtonVariantDefault as
|
11
|
-
import { Loader as
|
12
|
-
import { Portal as
|
13
|
-
import '../../assets/Drawer.css';const
|
14
|
-
drawer:
|
15
|
-
content:
|
10
|
+
import { EButtonVariantDefault as Z, EButtonSize as r } from "../Button/constants.js";
|
11
|
+
import { Loader as $ } from "../Loader/Loader.js";
|
12
|
+
import { Portal as ee } from "../Portal/Portal.js";
|
13
|
+
import '../../assets/Drawer.css';const oe = "_drawer_1xs4d_3", te = "_content_1xs4d_27", se = "_header_1xs4d_45", ne = "_title_1xs4d_59", re = "_space_1xs4d_73", ie = "_inner_1xs4d_84", ae = "_button_1xs4d_87", le = "_footer_1xs4d_92", ce = "_left_1xs4d_105", de = "_right_1xs4d_109", me = "_full_1xs4d_113", _e = "_bottom_1xs4d_123", ue = "_opened_1xs4d_140", fe = "_overlay_1xs4d_196", he = "_unmount_1xs4d_212", e = {
|
14
|
+
drawer: oe,
|
15
|
+
content: te,
|
16
16
|
"is-loading": "_is-loading_1xs4d_41",
|
17
|
-
header:
|
17
|
+
header: se,
|
18
18
|
"sticky-header": "_sticky-header_1xs4d_53",
|
19
|
-
title:
|
20
|
-
space:
|
21
|
-
inner:
|
22
|
-
button:
|
23
|
-
footer:
|
19
|
+
title: ne,
|
20
|
+
space: re,
|
21
|
+
inner: ie,
|
22
|
+
button: ae,
|
23
|
+
footer: le,
|
24
24
|
"footer-button": "_footer-button_1xs4d_101",
|
25
|
-
left:
|
26
|
-
right:
|
27
|
-
full:
|
28
|
-
bottom:
|
25
|
+
left: ce,
|
26
|
+
right: de,
|
27
|
+
full: me,
|
28
|
+
bottom: _e,
|
29
29
|
"full-bottom-height": "_full-bottom-height_1xs4d_134",
|
30
|
-
opened:
|
30
|
+
opened: ue,
|
31
31
|
"is-closing": "_is-closing_1xs4d_159",
|
32
|
-
overlay:
|
33
|
-
unmount:
|
34
|
-
},
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
(
|
70
|
-
|
71
|
-
},
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
[
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
"
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
32
|
+
overlay: fe,
|
33
|
+
unmount: he
|
34
|
+
}, pe = 300, Oe = K(
|
35
|
+
(C, B) => {
|
36
|
+
const {
|
37
|
+
as: E = "div",
|
38
|
+
isOpen: n,
|
39
|
+
onClose: i,
|
40
|
+
title: M,
|
41
|
+
className: O,
|
42
|
+
unmount: f = !0,
|
43
|
+
isLoading: a = !1,
|
44
|
+
stickyHeader: I,
|
45
|
+
fullBottomHeight: L = !1,
|
46
|
+
position: l = v.RIGHT,
|
47
|
+
paddingRight: R = 8,
|
48
|
+
footer: c,
|
49
|
+
children: T,
|
50
|
+
classNameTitle: S,
|
51
|
+
classNameHeader: D,
|
52
|
+
classNameInner: z,
|
53
|
+
classNameContent: H,
|
54
|
+
classNameFooter: A,
|
55
|
+
closeOnClickOutside: h = !0,
|
56
|
+
showCloseButton: p = !0,
|
57
|
+
...P
|
58
|
+
} = C, [x, g] = w(!1), [X, N] = w(!1), y = V(), d = Y(q.XS1), { ref: j } = U({
|
59
|
+
enabled: l === v.BOTTOM
|
60
|
+
});
|
61
|
+
J({
|
62
|
+
on: n && !x,
|
63
|
+
paddingRight: R
|
64
|
+
});
|
65
|
+
const t = u(() => {
|
66
|
+
i && (g(!0), y.current = setTimeout(() => {
|
67
|
+
i(), g(!1);
|
68
|
+
}, pe));
|
69
|
+
}, [i]), F = u(() => {
|
70
|
+
h && t();
|
71
|
+
}, [h, t]), m = u(
|
72
|
+
(Q) => {
|
73
|
+
Q.key === "Escape" && t();
|
74
|
+
},
|
75
|
+
[t]
|
76
|
+
);
|
77
|
+
W(() => (n && (N(!0), window.addEventListener("keydown", m)), () => {
|
78
|
+
N(!1), clearTimeout(y.current), window.removeEventListener("keydown", m);
|
79
|
+
}), [n, m]);
|
80
|
+
const b = {
|
81
|
+
[e.opened]: X,
|
82
|
+
[e["is-closing"]]: x,
|
83
|
+
[e["full-bottom-height"]]: L,
|
84
|
+
[e["is-loading"]]: a
|
85
|
+
};
|
86
|
+
return !n && f ? null : /* @__PURE__ */ _(ee, { children: [
|
87
|
+
/* @__PURE__ */ o(
|
88
|
+
E,
|
89
|
+
{
|
90
|
+
ref: B,
|
91
|
+
"aria-hidden": !n,
|
92
|
+
role: "dialog",
|
93
|
+
className: s(e.drawer, e[l], b, O),
|
94
|
+
...P,
|
95
|
+
children: /* @__PURE__ */ o(
|
96
|
+
"section",
|
97
|
+
{
|
98
|
+
ref: j,
|
99
|
+
className: s(
|
100
|
+
e.content,
|
101
|
+
H,
|
102
|
+
e[l],
|
100
103
|
{
|
101
|
-
|
102
|
-
[e["sticky-header"]]: B
|
103
|
-
}),
|
104
|
-
children: [
|
105
|
-
/* @__PURE__ */ t("h2", { className: s(e.title, C), children: E }),
|
106
|
-
/* @__PURE__ */ t("div", { className: e.space, children: x && /* @__PURE__ */ t(
|
107
|
-
k,
|
108
|
-
{
|
109
|
-
variant: Y.SecondaryWhite,
|
110
|
-
isIconButton: !0,
|
111
|
-
size: d ? n.S : n.M,
|
112
|
-
iconName: "Close16px",
|
113
|
-
onClick: o,
|
114
|
-
className: e.button
|
115
|
-
}
|
116
|
-
) })
|
117
|
-
]
|
104
|
+
[e["is-loading"]]: !!a
|
118
105
|
}
|
119
106
|
),
|
120
|
-
/* @__PURE__ */
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
107
|
+
children: a ? /* @__PURE__ */ o($, {}) : /* @__PURE__ */ _(G, { children: [
|
108
|
+
/* @__PURE__ */ _(
|
109
|
+
"header",
|
110
|
+
{
|
111
|
+
className: s(e.header, D, {
|
112
|
+
[e["sticky-header"]]: I
|
113
|
+
}),
|
114
|
+
children: [
|
115
|
+
/* @__PURE__ */ o("h2", { className: s(e.title, S), children: M }),
|
116
|
+
/* @__PURE__ */ o("div", { className: e.space, children: p && /* @__PURE__ */ o(
|
117
|
+
k,
|
118
|
+
{
|
119
|
+
variant: Z.SecondaryWhite,
|
120
|
+
isIconButton: !0,
|
121
|
+
size: d ? r.S : r.M,
|
122
|
+
iconName: "Close16px",
|
123
|
+
onClick: t,
|
124
|
+
className: e.button
|
125
|
+
}
|
126
|
+
) })
|
127
|
+
]
|
128
|
+
}
|
129
|
+
),
|
130
|
+
/* @__PURE__ */ o("div", { className: s(e.inner, z), children: T }),
|
131
|
+
/* @__PURE__ */ o("footer", { className: s(e.footer, A), children: typeof c == "function" ? c({ handleClose: t }) : c || p && /* @__PURE__ */ o(
|
132
|
+
k,
|
133
|
+
{
|
134
|
+
size: d ? r.M : r.XXL,
|
135
|
+
full: d,
|
136
|
+
onClick: t,
|
137
|
+
className: e["footer-button"],
|
138
|
+
children: "Закрыть"
|
139
|
+
}
|
140
|
+
) })
|
141
|
+
] })
|
142
|
+
}
|
143
|
+
)
|
144
|
+
}
|
145
|
+
),
|
146
|
+
/* @__PURE__ */ o(
|
147
|
+
"div",
|
148
|
+
{
|
149
|
+
className: s(
|
150
|
+
e.overlay,
|
151
|
+
{
|
152
|
+
[e.unmount]: !f
|
153
|
+
},
|
154
|
+
b
|
155
|
+
),
|
156
|
+
"data-testid": "drawer-overlay",
|
157
|
+
onClick: F
|
158
|
+
}
|
159
|
+
)
|
160
|
+
] });
|
161
|
+
}
|
162
|
+
);
|
152
163
|
export {
|
153
|
-
|
154
|
-
|
164
|
+
pe as ANIMATION_DELAY,
|
165
|
+
Oe as Drawer
|
155
166
|
};
|
@@ -2,7 +2,7 @@ import "react/jsx-runtime";
|
|
2
2
|
import "../../index-DIxK0V-G.js";
|
3
3
|
import "react";
|
4
4
|
import "./constants.js";
|
5
|
-
import { I as f } from "../../Input-
|
5
|
+
import { I as f } from "../../Input-CQ7LgZWK.js";
|
6
6
|
import "../../hooks/useMergeRefs/useMergeRefs.js";
|
7
7
|
import "../../icons/Icon.js";
|
8
8
|
import "../Button/Button.js";
|
@@ -3,7 +3,7 @@ import { c } from "../../index-DIxK0V-G.js";
|
|
3
3
|
import { memo as w, forwardRef as u, useState as m } from "react";
|
4
4
|
import { Icon as d } from "../../icons/Icon.js";
|
5
5
|
import { Button as _ } from "../Button/Button.js";
|
6
|
-
import { I as l } from "../../Input-
|
6
|
+
import { I as l } from "../../Input-CQ7LgZWK.js";
|
7
7
|
import '../../assets/InputPassword.css';const b = "_input_7b9x2_2", x = "_wrapper_7b9x2_6", h = "_button_7b9x2_17", f = "_icon_7b9x2_33", N = "_show_7b9x2_38", t = {
|
8
8
|
input: b,
|
9
9
|
wrapper: x,
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { jsx as d } from "react/jsx-runtime";
|
2
2
|
import { memo as I, forwardRef as i, useState as c, useCallback as f, useImperativeHandle as P } from "react";
|
3
3
|
import { getMaskedInputPhoneValue as m, getUnmaskedInputValue as o } from "./utils.js";
|
4
|
-
import { I as b } from "../../Input-
|
4
|
+
import { I as b } from "../../Input-CQ7LgZWK.js";
|
5
5
|
const h = I(
|
6
6
|
i(
|
7
7
|
({ value: s = "", onChange: e, ...p }, a) => {
|
@@ -7,7 +7,7 @@ import { Icon as Le } from "../../icons/Icon.js";
|
|
7
7
|
import { Button as Te } from "../Button/Button.js";
|
8
8
|
import { CheckboxMimir as ke } from "../CheckboxMimir/CheckboxMimir.js";
|
9
9
|
import { Chip as ye } from "../Chip/Chip.js";
|
10
|
-
import { I as oe } from "../../Input-
|
10
|
+
import { I as oe } from "../../Input-CQ7LgZWK.js";
|
11
11
|
import { EInputVariant as ze } from "../Input/constants.js";
|
12
12
|
import { H as Ae, U as ne, G as ie, K as Oe, W as Ve } from "../../combobox-CVtJDVoZ.js";
|
13
13
|
import '../../assets/MultiSelectSearch.css';const xe = "_disabled_io0c8_5", De = "_container_io0c8_9", Pe = "_full_io0c8_27", qe = "_button_io0c8_39", Re = "_options_io0c8_53", Be = "_visible_io0c8_66", Fe = "_top_io0c8_69", je = "_bottom_io0c8_74", Ge = "_m_io0c8_2", Ue = "_l_io0c8_116", We = "_focused_io0c8_134", He = "_option_io0c8_53", Je = "_chip_io0c8_163", Ke = "_clear_io0c8_188", t = {
|
@@ -46,7 +46,7 @@ import '../../assets/MultiSelectSearch.css';const xe = "_disabled_io0c8_5", De =
|
|
46
46
|
const {
|
47
47
|
placeholder: P,
|
48
48
|
size: i = D.L,
|
49
|
-
value:
|
49
|
+
value: p,
|
50
50
|
onChange: s,
|
51
51
|
full: le,
|
52
52
|
showArrow: re = !0,
|
@@ -67,29 +67,29 @@ import '../../assets/MultiSelectSearch.css';const xe = "_disabled_io0c8_5", De =
|
|
67
67
|
id: pe,
|
68
68
|
autoPlacement: z = !1,
|
69
69
|
onIsOpen: v
|
70
|
-
} = se, me = Ne(),
|
71
|
-
() => Y(
|
70
|
+
} = se, me = Ne(), m = pe || `multiselect-${me}`, N = X(null), b = X(null), [a, _] = w(!1), [S, C] = w(
|
71
|
+
() => Y(p, f)
|
72
72
|
), [c, M] = w(
|
73
|
-
|
73
|
+
p || []
|
74
74
|
), [A, j] = w(g), [O, G] = w(!1), [_e, U] = w(!1);
|
75
75
|
T(() => {
|
76
|
-
|
77
|
-
}, [
|
76
|
+
p && (M(p), JSON.stringify(p) !== JSON.stringify(c) && C(Y(p, f)));
|
77
|
+
}, [p, f, c]);
|
78
78
|
const W = Se(() => {
|
79
79
|
var o;
|
80
80
|
if (!q) return h;
|
81
81
|
const e = ((o = S.split(",").pop()) == null ? void 0 : o.trim().toLowerCase()) ?? "";
|
82
82
|
return c.length > 0 && c[c.length - 1].name.toLowerCase() === e ? h : h.filter(
|
83
|
-
(
|
83
|
+
(u) => u.name.toLowerCase().includes(e)
|
84
84
|
);
|
85
85
|
}, [q, h, S, c]), he = (e) => {
|
86
86
|
M(e), s == null || s(e);
|
87
87
|
const o = te(e, f);
|
88
|
-
C(o), _(!0), L(
|
88
|
+
C(o), _(!0), L(m), setTimeout(() => {
|
89
89
|
if (b.current) {
|
90
90
|
b.current.focus(), b.current.scrollLeft = b.current.scrollWidth;
|
91
|
-
const
|
92
|
-
b.current.setSelectionRange(
|
91
|
+
const u = o.length;
|
92
|
+
b.current.setSelectionRange(u, u);
|
93
93
|
}
|
94
94
|
}, 0);
|
95
95
|
}, H = (e) => {
|
@@ -97,20 +97,20 @@ import '../../assets/MultiSelectSearch.css';const xe = "_disabled_io0c8_5", De =
|
|
97
97
|
if (I) return;
|
98
98
|
const o = e.target.value;
|
99
99
|
C(o), k == null || k(o);
|
100
|
-
const
|
101
|
-
(x) =>
|
100
|
+
const u = o.split(",").map((x) => x.trim()).filter(Boolean), K = h.filter(
|
101
|
+
(x) => u.includes(x[f])
|
102
102
|
);
|
103
|
-
M(K), s == null || s(K), _(!0), L(
|
103
|
+
M(K), s == null || s(K), _(!0), L(m);
|
104
104
|
const V = ($ = N.current) == null ? void 0 : $.querySelector(
|
105
105
|
`.${t.options}`
|
106
106
|
);
|
107
107
|
V && typeof V.scrollTo == "function" && V.scrollTo({ top: 0, behavior: "smooth" });
|
108
108
|
}, fe = (e) => {
|
109
109
|
const o = c.filter(
|
110
|
-
(
|
110
|
+
(u) => u.id !== e.id
|
111
111
|
);
|
112
112
|
M(o), s == null || s(o), C(te(o, f));
|
113
|
-
},
|
113
|
+
}, d = Ce(() => {
|
114
114
|
if (!z) {
|
115
115
|
j(g);
|
116
116
|
return;
|
@@ -118,8 +118,8 @@ import '../../assets/MultiSelectSearch.css';const xe = "_disabled_io0c8_5", De =
|
|
118
118
|
const e = Me(N, i);
|
119
119
|
j(e ? "top" : g);
|
120
120
|
}, [z, g, i]), J = () => {
|
121
|
-
const e = !
|
122
|
-
e && (
|
121
|
+
const e = !a;
|
122
|
+
e && (d(), L(m)), _(e), v == null || v(e);
|
123
123
|
}, ve = (e) => {
|
124
124
|
e.preventDefault(), e.currentTarget.focus();
|
125
125
|
const o = e.currentTarget.value.length;
|
@@ -133,18 +133,20 @@ import '../../assets/MultiSelectSearch.css';const xe = "_disabled_io0c8_5", De =
|
|
133
133
|
e.target.blur();
|
134
134
|
return;
|
135
135
|
}
|
136
|
-
|
136
|
+
d(), _(!0), L(m);
|
137
137
|
};
|
138
138
|
return T(() => {
|
139
|
+
if (a) {
|
140
|
+
const e = (o) => {
|
141
|
+
N.current && !N.current.contains(o.target) && !o.defaultPrevented && (_(!1), v == null || v(!1));
|
142
|
+
};
|
143
|
+
return document.addEventListener("mousedown", e), () => {
|
144
|
+
document.removeEventListener("mousedown", e);
|
145
|
+
};
|
146
|
+
}
|
147
|
+
}, [a]), T(() => {
|
139
148
|
const e = (o) => {
|
140
|
-
|
141
|
-
};
|
142
|
-
return document.addEventListener("mousedown", e), () => {
|
143
|
-
document.removeEventListener("mousedown", e);
|
144
|
-
};
|
145
|
-
}, []), T(() => {
|
146
|
-
const e = (o) => {
|
147
|
-
o.detail !== p && _(!1);
|
149
|
+
o.detail !== m && _(!1);
|
148
150
|
};
|
149
151
|
return window.addEventListener(
|
150
152
|
Z,
|
@@ -155,18 +157,18 @@ import '../../assets/MultiSelectSearch.css';const xe = "_disabled_io0c8_5", De =
|
|
155
157
|
e
|
156
158
|
);
|
157
159
|
};
|
158
|
-
}, [
|
159
|
-
if (
|
160
|
-
|
160
|
+
}, [m]), T(() => {
|
161
|
+
if (a) {
|
162
|
+
d(), window.addEventListener("scroll", d), window.addEventListener("resize", d);
|
161
163
|
const e = requestAnimationFrame(() => {
|
162
164
|
U(!0), G(!0);
|
163
165
|
});
|
164
166
|
return () => {
|
165
|
-
window.removeEventListener("scroll",
|
167
|
+
window.removeEventListener("scroll", d), window.removeEventListener("resize", d), cancelAnimationFrame(e);
|
166
168
|
};
|
167
169
|
} else
|
168
170
|
G(!1), U(!1);
|
169
|
-
}, [
|
171
|
+
}, [a, g, z, i, d]), /* @__PURE__ */ E("div", { ref: N, children: [
|
170
172
|
/* @__PURE__ */ n(
|
171
173
|
Ae,
|
172
174
|
{
|
@@ -185,7 +187,7 @@ import '../../assets/MultiSelectSearch.css';const xe = "_disabled_io0c8_5", De =
|
|
185
187
|
"div",
|
186
188
|
{
|
187
189
|
className: l(t.container, t[i], {
|
188
|
-
[t["container-open"]]:
|
190
|
+
[t["container-open"]]: a
|
189
191
|
}),
|
190
192
|
children: [
|
191
193
|
I && /* @__PURE__ */ E("div", { className: t["input-container"], children: [
|
@@ -214,7 +216,7 @@ import '../../assets/MultiSelectSearch.css';const xe = "_disabled_io0c8_5", De =
|
|
214
216
|
onFocus: ge,
|
215
217
|
rightAddon: {
|
216
218
|
addonType: "icon",
|
217
|
-
addonContent: Ee(
|
219
|
+
addonContent: Ee(a, i)
|
218
220
|
},
|
219
221
|
autocomplete: F,
|
220
222
|
...B
|
@@ -255,7 +257,7 @@ import '../../assets/MultiSelectSearch.css';const xe = "_disabled_io0c8_5", De =
|
|
255
257
|
variant: R,
|
256
258
|
withClearButton: y,
|
257
259
|
onFocus: () => {
|
258
|
-
_(!0), L(
|
260
|
+
_(!0), L(m);
|
259
261
|
},
|
260
262
|
onMouseDown: ve,
|
261
263
|
onChange: H,
|
@@ -275,7 +277,7 @@ import '../../assets/MultiSelectSearch.css';const xe = "_disabled_io0c8_5", De =
|
|
275
277
|
{
|
276
278
|
iconName: i == D.M ? "DropdownArrowBottom16px" : "DropdownArrowDown24px",
|
277
279
|
className: l(t["selector-icon"], {
|
278
|
-
[t["selector-icon-open"]]:
|
280
|
+
[t["selector-icon-open"]]: a
|
279
281
|
})
|
280
282
|
}
|
281
283
|
)
|
@@ -287,7 +289,7 @@ import '../../assets/MultiSelectSearch.css';const xe = "_disabled_io0c8_5", De =
|
|
287
289
|
...B
|
288
290
|
}
|
289
291
|
),
|
290
|
-
|
292
|
+
a && _e && /* @__PURE__ */ n(Q, { children: h.length ? W.length ? /* @__PURE__ */ n(
|
291
293
|
Oe,
|
292
294
|
{
|
293
295
|
className: l(
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { EMultiSelectSearchSize as o, MOBILE_MENU_HEIGHT as u, DESKTOP_MENU_HEIGHT as w } from "./constants.js";
|
2
|
-
import "../../Input-
|
2
|
+
import "../../Input-CQ7LgZWK.js";
|
3
3
|
import { EInputSize as r } from "../Input/constants.js";
|
4
4
|
const m = (t) => {
|
5
5
|
switch (t) {
|
@@ -3,7 +3,7 @@ import { c as u } from "../../index-DIxK0V-G.js";
|
|
3
3
|
import { forwardRef as P, useImperativeHandle as R, Fragment as T } from "react";
|
4
4
|
import { ITEMS_PER_SEPARATOR as q, DEFAULT_VALUE_LENGTH as v } from "./constants.js";
|
5
5
|
import { useOTPInput as y } from "./hooks.js";
|
6
|
-
import { I as A } from "../../Input-
|
6
|
+
import { I as A } from "../../Input-CQ7LgZWK.js";
|
7
7
|
import '../../assets/OtpInput.css';const C = "_otp_1shq3_3", F = "_input_1shq3_14", L = "_separator_1shq3_28", r = {
|
8
8
|
otp: C,
|
9
9
|
"input-wrapper": "_input-wrapper_1shq3_14",
|
@@ -5,7 +5,7 @@ import { ESelectSearchSize as g } from "./constants.js";
|
|
5
5
|
import { mapSizeToInputSize as A, getDropdownArrowIcon as J } from "./utils.js";
|
6
6
|
import { Icon as O } from "../../icons/Icon.js";
|
7
7
|
import { Button as Q } from "../Button/Button.js";
|
8
|
-
import { I as B } from "../../Input-
|
8
|
+
import { I as B } from "../../Input-CQ7LgZWK.js";
|
9
9
|
import { EInputVariant as X } from "../Input/constants.js";
|
10
10
|
import { H as Y, U as M, G as j, K as Z, W as ee } from "../../combobox-CVtJDVoZ.js";
|
11
11
|
import '../../assets/SelectSearch.css';const te = "_disabled_1bph7_6", oe = "_container_1bph7_13", ne = "_full_1bph7_28", se = "_button_1bph7_40", ae = "_options_1bph7_54", ie = "_top_1bph7_65", le = "_bottom_1bph7_71", re = "_m_1bph7_98", ce = "_l_1bph7_113", de = "_option_1bph7_54", pe = "_clear_1bph7_167", e = {
|
@@ -5,7 +5,7 @@ import { useAutoResizeTextArea as Z } from "./hooks.js";
|
|
5
5
|
import { useMergeRefs as $ } from "../../hooks/useMergeRefs/useMergeRefs.js";
|
6
6
|
import { Icon as ee } from "../../icons/Icon.js";
|
7
7
|
import { Button as te } from "../Button/Button.js";
|
8
|
-
import { c as e } from "../../Input-
|
8
|
+
import { c as e } from "../../Input-CQ7LgZWK.js";
|
9
9
|
import { EInputVariant as ae } from "../Input/constants.js";
|
10
10
|
import '../../assets/TextArea.css';const re = "_textarea_rk5xe_2", se = "_clear_rk5xe_11", le = "_label_rk5xe_26", ne = "_s_rk5xe_71", oe = "_m_rk5xe_84", ce = "_l_rk5xe_26", t = {
|
11
11
|
"textarea-wrapper": "_textarea-wrapper_rk5xe_2",
|
package/dist/components/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { Button as e } from "./Button/Button.js";
|
2
2
|
import { EButtonForm as p, EButtonSize as a, EButtonVariantBorderless as i, EButtonVariantDefault as m, EButtonVariantOutline as f, EButtonVariantRound as x } from "./Button/constants.js";
|
3
|
-
import { I as S } from "../Input-
|
3
|
+
import { I as S } from "../Input-CQ7LgZWK.js";
|
4
4
|
import { EInputSize as E, EInputStatus as l, EInputVariant as u } from "./Input/constants.js";
|
5
5
|
import { TextArea as c } from "./TextArea/TextArea.js";
|
6
6
|
import { ETextAreaInputSize as g } from "./TextArea/constants.js";
|
package/dist/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { Button as e } from "./components/Button/Button.js";
|
2
2
|
import { EButtonForm as p, EButtonSize as a, EButtonVariantBorderless as m, EButtonVariantDefault as f, EButtonVariantOutline as i, EButtonVariantRound as x } from "./components/Button/constants.js";
|
3
|
-
import { I as s } from "./Input-
|
3
|
+
import { I as s } from "./Input-CQ7LgZWK.js";
|
4
4
|
import { EInputSize as S, EInputStatus as l, EInputVariant as E } from "./components/Input/constants.js";
|
5
5
|
import { TextArea as c } from "./components/TextArea/TextArea.js";
|
6
6
|
import { ETextAreaInputSize as g } from "./components/TextArea/constants.js";
|
package/dist/types/index.d.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export type { Props, PolymorphicRef
|
1
|
+
export type { Props, PolymorphicRef } from './propsWithAs';
|
@@ -1,16 +1,15 @@
|
|
1
|
-
import { ElementType, ComponentPropsWithoutRef, ComponentPropsWithRef, JSXElementConstructor
|
1
|
+
import { ElementType, ComponentPropsWithoutRef, ComponentPropsWithRef, JSXElementConstructor } from 'react';
|
2
2
|
|
3
3
|
export type PropsOf<C extends keyof JSX.IntrinsicElements | JSXElementConstructor<unknown>> = JSX.LibraryManagedAttributes<C, ComponentPropsWithoutRef<C>>;
|
4
4
|
type AsProp<C extends ElementType> = {
|
5
5
|
as?: C;
|
6
6
|
};
|
7
|
-
export type ExtendableProps<ExtendedProps =
|
8
|
-
export type InheritableElementProps<C extends ElementType, Props =
|
9
|
-
export type PolymorphicComponentProps<C extends ElementType, Props =
|
7
|
+
export type ExtendableProps<ExtendedProps = object, OverrideProps = object> = OverrideProps & Omit<ExtendedProps, keyof OverrideProps>;
|
8
|
+
export type InheritableElementProps<C extends ElementType, Props = object> = ExtendableProps<PropsOf<C>, Props>;
|
9
|
+
export type PolymorphicComponentProps<C extends ElementType, Props = object> = InheritableElementProps<C, Props & AsProp<C>>;
|
10
10
|
export type PolymorphicRef<C extends ElementType> = ComponentPropsWithRef<C>['ref'];
|
11
|
-
export type PolymorphicComponentPropsWithRef<C extends ElementType, Props
|
11
|
+
export type PolymorphicComponentPropsWithRef<C extends ElementType, Props extends object> = PolymorphicComponentProps<C, Props> & {
|
12
12
|
ref?: PolymorphicRef<C>;
|
13
13
|
};
|
14
|
-
export type Props<C extends ElementType, P> = PolymorphicComponentPropsWithRef<C, P>;
|
15
|
-
export type ComponentCustomProps = <C extends ElementType = 'span', P = NonNullable<unknown>>(props: Props<C, P>) => ReactElement | ReactNode;
|
14
|
+
export type Props<C extends ElementType, P extends object> = PolymorphicComponentPropsWithRef<C, P>;
|
16
15
|
export {};
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "mimir-ui-kit",
|
3
3
|
"private": false,
|
4
|
-
"version": "1.38.
|
4
|
+
"version": "1.38.22",
|
5
5
|
"type": "module",
|
6
6
|
"exports": {
|
7
7
|
".": {
|
@@ -22,6 +22,9 @@
|
|
22
22
|
},
|
23
23
|
"./styles": {
|
24
24
|
"default": "./dist/assets/index.css"
|
25
|
+
},
|
26
|
+
"./types": {
|
27
|
+
"types": "./dist/index.d.ts"
|
25
28
|
}
|
26
29
|
},
|
27
30
|
"module": "./dist/index.js",
|
package/dist/Input-BYrIS5GU.js
DELETED
@@ -1,225 +0,0 @@
|
|
1
|
-
import { jsxs as V, jsx as n, Fragment as Z } from "react/jsx-runtime";
|
2
|
-
import { c as o } from "./index-DIxK0V-G.js";
|
3
|
-
import { memo as $, forwardRef as ee, useState as B, useRef as se, useEffect as R } from "react";
|
4
|
-
import { EInputVariant as te } from "./components/Input/constants.js";
|
5
|
-
import { useMergeRefs as ae } from "./hooks/useMergeRefs/useMergeRefs.js";
|
6
|
-
import { Icon as le } from "./icons/Icon.js";
|
7
|
-
import { Button as re } from "./components/Button/Button.js";
|
8
|
-
import './assets/Input.css';const oe = "_label_zg2ds_27", ne = "_input_zg2ds_3", de = "_focused_zg2ds_82", ce = "_disabled_zg2ds_88", ie = "_clear_zg2ds_130", ue = "_s_zg2ds_181", _e = "_m_zg2ds_196", me = "_l_zg2ds_27", fe = "_success_zg2ds_252", pe = "_alarm_zg2ds_272", ge = "_error_zg2ds_292", e = {
|
9
|
-
"input-wrapper": "_input-wrapper_zg2ds_3",
|
10
|
-
"required-mark": "_required-mark_zg2ds_17",
|
11
|
-
label: oe,
|
12
|
-
"has-left-slot": "_has-left-slot_zg2ds_42",
|
13
|
-
"active-label": "_active-label_zg2ds_45",
|
14
|
-
input: ne,
|
15
|
-
"has-right-slot": "_has-right-slot_zg2ds_79",
|
16
|
-
focused: de,
|
17
|
-
"has-label": "_has-label_zg2ds_85",
|
18
|
-
disabled: ce,
|
19
|
-
"addon-icon": "_addon-icon_zg2ds_94",
|
20
|
-
"left-slot": "_left-slot_zg2ds_98",
|
21
|
-
"right-slot": "_right-slot_zg2ds_99",
|
22
|
-
clear: ie,
|
23
|
-
s: ue,
|
24
|
-
m: _e,
|
25
|
-
l: me,
|
26
|
-
"default-gray": "_default-gray_zg2ds_225",
|
27
|
-
"default-white": "_default-white_zg2ds_237",
|
28
|
-
success: fe,
|
29
|
-
alarm: pe,
|
30
|
-
error: ge
|
31
|
-
}, L = (s) => {
|
32
|
-
var m, a;
|
33
|
-
if (!s)
|
34
|
-
return null;
|
35
|
-
switch (s.addonType) {
|
36
|
-
case "icon": {
|
37
|
-
const f = (m = s.addonContent) == null ? void 0 : m.includes("16px"), b = (a = s.addonContent) == null ? void 0 : a.includes("24px");
|
38
|
-
return /* @__PURE__ */ n(
|
39
|
-
le,
|
40
|
-
{
|
41
|
-
style: {
|
42
|
-
"--icon-size": o({
|
43
|
-
"16px": f,
|
44
|
-
"24px": b
|
45
|
-
})
|
46
|
-
},
|
47
|
-
className: e["addon-icon"],
|
48
|
-
iconName: s.addonContent
|
49
|
-
}
|
50
|
-
);
|
51
|
-
}
|
52
|
-
case "text":
|
53
|
-
return s.addonContent;
|
54
|
-
case "react-node":
|
55
|
-
return /* @__PURE__ */ n(Z, { children: s.addonContent });
|
56
|
-
default:
|
57
|
-
return null;
|
58
|
-
}
|
59
|
-
}, he = $(
|
60
|
-
ee(
|
61
|
-
(s, m) => {
|
62
|
-
const {
|
63
|
-
value: a,
|
64
|
-
className: f,
|
65
|
-
wrapperClassName: b,
|
66
|
-
rightSlotClassName: j,
|
67
|
-
requiredMarkClassName: D,
|
68
|
-
variant: q = te.DefaultGray,
|
69
|
-
type: E = "text",
|
70
|
-
autofocus: z,
|
71
|
-
readonly: d,
|
72
|
-
id: A,
|
73
|
-
onFocus: N,
|
74
|
-
onBlur: x,
|
75
|
-
label: u,
|
76
|
-
withClearButton: M,
|
77
|
-
disabled: t,
|
78
|
-
onChange: c,
|
79
|
-
rightAddon: O,
|
80
|
-
status: F,
|
81
|
-
leftAddon: S,
|
82
|
-
size: C = "m",
|
83
|
-
numbersOnly: T,
|
84
|
-
required: y,
|
85
|
-
maxLength: v,
|
86
|
-
autocomplete: G = "on",
|
87
|
-
...P
|
88
|
-
} = s, [_, w] = B(z), [p, g] = B(!!a), i = se(null), W = ae(i, m);
|
89
|
-
R(() => {
|
90
|
-
z && w(!0);
|
91
|
-
}, [z]), R(() => {
|
92
|
-
g(!!a);
|
93
|
-
}, [a]);
|
94
|
-
const H = (l) => {
|
95
|
-
const r = l.currentTarget.value;
|
96
|
-
x == null || x(l), w(!1), g(!!r);
|
97
|
-
}, J = (l) => {
|
98
|
-
d || (w(!0), N == null || N(l));
|
99
|
-
}, K = () => {
|
100
|
-
i != null && i.current && (i.current.value = "", i.current.focus(), g(!1), c == null || c({
|
101
|
-
target: { value: "" }
|
102
|
-
}));
|
103
|
-
}, Q = (l) => {
|
104
|
-
let r = l.target.value;
|
105
|
-
T && (r = r.replace(/\D/g, "")), v !== void 0 && (r = r.slice(0, v)), l.target.value = r, c == null || c(l), g(!!r);
|
106
|
-
}, h = L(S), I = L(O), U = {
|
107
|
-
[e.readonly]: t || d,
|
108
|
-
[e.focused]: _,
|
109
|
-
[e.disabled]: t || d,
|
110
|
-
[e["has-label"]]: !!u,
|
111
|
-
[e["has-left-slot"]]: !!h,
|
112
|
-
[e["has-right-slot"]]: !!I
|
113
|
-
}, k = _ || p || !!a, X = o(e.label, f, e[C], {
|
114
|
-
[e["active-label"]]: k,
|
115
|
-
[e.disabled]: t || d,
|
116
|
-
[e["has-left-slot"]]: !!h
|
117
|
-
}), Y = o(e.input, U, f, [
|
118
|
-
e[q],
|
119
|
-
e[F ?? ""],
|
120
|
-
e[C]
|
121
|
-
]);
|
122
|
-
return /* @__PURE__ */ V(
|
123
|
-
"div",
|
124
|
-
{
|
125
|
-
className: o(
|
126
|
-
e["input-wrapper"],
|
127
|
-
e[q],
|
128
|
-
e[F ?? ""],
|
129
|
-
e[C],
|
130
|
-
{
|
131
|
-
[e.disabled]: t || d,
|
132
|
-
[e.focused]: _
|
133
|
-
},
|
134
|
-
b
|
135
|
-
),
|
136
|
-
children: [
|
137
|
-
u && /* @__PURE__ */ V("label", { htmlFor: A, className: X, children: [
|
138
|
-
u,
|
139
|
-
y && (p || _) && /* @__PURE__ */ n(
|
140
|
-
"span",
|
141
|
-
{
|
142
|
-
className: e["required-mark"],
|
143
|
-
"data-testid": "required-mark"
|
144
|
-
}
|
145
|
-
)
|
146
|
-
] }),
|
147
|
-
h && /* @__PURE__ */ n(
|
148
|
-
"span",
|
149
|
-
{
|
150
|
-
className: o(e["left-slot"], {
|
151
|
-
[e.focused]: k,
|
152
|
-
[e["has-label"]]: !!u,
|
153
|
-
[e.disabled]: t
|
154
|
-
}),
|
155
|
-
children: h
|
156
|
-
}
|
157
|
-
),
|
158
|
-
/* @__PURE__ */ n(
|
159
|
-
"input",
|
160
|
-
{
|
161
|
-
ref: W,
|
162
|
-
type: E,
|
163
|
-
id: A,
|
164
|
-
className: Y,
|
165
|
-
onFocus: J,
|
166
|
-
onBlur: H,
|
167
|
-
readOnly: d,
|
168
|
-
value: a,
|
169
|
-
onChange: Q,
|
170
|
-
maxLength: v,
|
171
|
-
disabled: t,
|
172
|
-
required: y,
|
173
|
-
autoComplete: G,
|
174
|
-
...P
|
175
|
-
}
|
176
|
-
),
|
177
|
-
I && /* @__PURE__ */ n(
|
178
|
-
"span",
|
179
|
-
{
|
180
|
-
className: o(e["right-slot"], j, {
|
181
|
-
[e.focused]: k,
|
182
|
-
[e["has-label"]]: !!u,
|
183
|
-
[e.disabled]: t
|
184
|
-
}),
|
185
|
-
children: I
|
186
|
-
}
|
187
|
-
),
|
188
|
-
y && !p && !_ && /* @__PURE__ */ n(
|
189
|
-
"span",
|
190
|
-
{
|
191
|
-
className: o(
|
192
|
-
e["required-mark"],
|
193
|
-
D
|
194
|
-
),
|
195
|
-
"data-testid": "required-mark"
|
196
|
-
}
|
197
|
-
),
|
198
|
-
M && p && /* @__PURE__ */ n(
|
199
|
-
re,
|
200
|
-
{
|
201
|
-
tabIndex: -1,
|
202
|
-
className: o(e.clear, {
|
203
|
-
[e.disabled]: t
|
204
|
-
}),
|
205
|
-
isIconButton: !0,
|
206
|
-
iconName: "Close16px",
|
207
|
-
size: "m-s",
|
208
|
-
clear: !0,
|
209
|
-
disabled: t || d,
|
210
|
-
variant: "secondary-gray",
|
211
|
-
onClick: K,
|
212
|
-
"data-testid": "clear-button"
|
213
|
-
}
|
214
|
-
)
|
215
|
-
]
|
216
|
-
}
|
217
|
-
);
|
218
|
-
}
|
219
|
-
)
|
220
|
-
);
|
221
|
-
he.displayName = "Input";
|
222
|
-
export {
|
223
|
-
he as I,
|
224
|
-
e as c
|
225
|
-
};
|