mimir-ui-kit 1.62.0 → 1.63.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.
- package/dist/Input-CqNPT8os.js +243 -0
- package/dist/components/Accordion/Accordion.d.ts +5 -0
- package/dist/components/Accordion/Accordion.js +242 -220
- package/dist/components/Accordion/AccordionItem/AccordionItem.d.ts +6 -1
- package/dist/components/Accordion/AccordionItem/AccordionItem.js +19 -8
- package/dist/components/Button/Button.d.ts +37 -0
- package/dist/components/Button/Button.js +77 -61
- package/dist/components/CheckboxMimir/CheckboxMimir.d.ts +9 -0
- package/dist/components/CheckboxMimir/CheckboxMimir.js +90 -59
- package/dist/components/DatePicker/DatePicker.js +1 -1
- package/dist/components/Drawer/Drawer.d.ts +5 -0
- package/dist/components/Drawer/Drawer.js +141 -135
- package/dist/components/GosZnak/GosZnak.d.ts +1 -1
- package/dist/components/GosZnak/GosZnak.js +88 -67
- package/dist/components/GosZnak/types.d.ts +5 -0
- package/dist/components/Image/Image.d.ts +5 -0
- package/dist/components/Image/Image.js +55 -50
- package/dist/components/Input/Input.d.ts +5 -0
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/Input/index.js +1 -1
- package/dist/components/InputPassword/InputPassword.d.ts +5 -0
- package/dist/components/InputPassword/InputPassword.js +80 -69
- package/dist/components/InputPhoneNumber/InputPhoneNumber.d.ts +5 -1
- package/dist/components/InputPhoneNumber/InputPhoneNumber.js +39 -32
- package/dist/components/Loader/Loader.d.ts +6 -1
- package/dist/components/Loader/Loader.js +37 -14
- package/dist/components/MultiSelectSearch/MultiSelectSearch.js +1 -1
- package/dist/components/MultiSelectSearch/utils.js +1 -1
- package/dist/components/OtpInput/OtpInput.js +1 -1
- package/dist/components/RadioGroup/RadioGroup.d.ts +9 -0
- package/dist/components/RadioGroup/RadioGroup.js +142 -129
- package/dist/components/SelectSearch/SelectSearch.d.ts +1 -0
- package/dist/components/SelectSearch/SelectSearch.js +299 -277
- package/dist/components/SelectSearch/types.d.ts +5 -0
- package/dist/components/SelectSearch/utils.js +1 -1
- package/dist/components/TextArea/TextArea.d.ts +1 -1
- package/dist/components/TextArea/TextArea.js +1 -1
- package/dist/components/TextAreaV2/TextArea.js +155 -142
- package/dist/components/TextAreaV2/types.d.ts +5 -0
- package/dist/components/UniversalUploader/UniversalUploader.d.ts +1 -0
- package/dist/components/UniversalUploader/UniversalUploader.js +89 -86
- package/dist/components/UniversalUploader/types.d.ts +5 -0
- package/dist/components/Uploader/Uploader.d.ts +5 -0
- package/dist/components/Uploader/Uploader.js +116 -87
- package/dist/components/UploaderFiles/UploaderFiles.js +88 -79
- package/dist/components/UploaderFiles/types.d.ts +5 -0
- package/dist/components/UploaderPhotos/UploaderPhotos.d.ts +5 -0
- package/dist/components/UploaderPhotos/UploaderPhotos.js +60 -57
- package/dist/components/index.js +1 -1
- package/dist/index.js +1 -1
- package/dist/types/dataTestId.d.ts +1 -0
- package/dist/types/dataTestId.js +1 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
- package/dist/Input-DPnH8pKc.js +0 -227
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import { jsxs as z, jsx as a, Fragment as R } from "react/jsx-runtime";
|
|
2
|
+
import { c } from "./index-DIxK0V-G.js";
|
|
3
|
+
import { memo as M, forwardRef as T, useState as ee, useRef as re, useEffect as F } from "react";
|
|
4
|
+
import { EInputVariant as te } 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 ae } from "./components/Button/Button.js";
|
|
8
|
+
import './assets/Input.css';const oe = "_label_1peof_26", ne = "_input_1peof_2", ie = "_disabled_1peof_117", ce = "_clear_1peof_158", ue = "_s_1peof_218", de = "_m_1peof_233", _e = "_l_1peof_26", fe = "_success_1peof_289", pe = "_alarm_1peof_309", me = "_error_1peof_329", e = {
|
|
9
|
+
"input-wrapper": "_input-wrapper_1peof_2",
|
|
10
|
+
"required-mark": "_required-mark_1peof_16",
|
|
11
|
+
label: oe,
|
|
12
|
+
"has-left-slot": "_has-left-slot_1peof_45",
|
|
13
|
+
"has-right-slot": "_has-right-slot_1peof_48",
|
|
14
|
+
"active-label": "_active-label_1peof_53",
|
|
15
|
+
"label-text-wrapper": "_label-text-wrapper_1peof_68",
|
|
16
|
+
input: ne,
|
|
17
|
+
"has-label": "_has-label_1peof_114",
|
|
18
|
+
disabled: ie,
|
|
19
|
+
"addon-icon": "_addon-icon_1peof_123",
|
|
20
|
+
"left-slot": "_left-slot_1peof_127",
|
|
21
|
+
"right-slot": "_right-slot_1peof_128",
|
|
22
|
+
clear: ce,
|
|
23
|
+
"border-radius-left": "_border-radius-left_1peof_206",
|
|
24
|
+
"border-radius-right": "_border-radius-right_1peof_210",
|
|
25
|
+
"border-radius-none": "_border-radius-none_1peof_214",
|
|
26
|
+
s: ue,
|
|
27
|
+
m: de,
|
|
28
|
+
l: _e,
|
|
29
|
+
"default-gray": "_default-gray_1peof_262",
|
|
30
|
+
"default-white": "_default-white_1peof_274",
|
|
31
|
+
success: fe,
|
|
32
|
+
alarm: pe,
|
|
33
|
+
error: me
|
|
34
|
+
}, L = (t) => {
|
|
35
|
+
var f, o;
|
|
36
|
+
if (!t)
|
|
37
|
+
return null;
|
|
38
|
+
switch (t.addonType) {
|
|
39
|
+
case "icon": {
|
|
40
|
+
const p = (f = t.addonContent) == null ? void 0 : f.includes("16px"), N = (o = t.addonContent) == null ? void 0 : o.includes("24px");
|
|
41
|
+
return /* @__PURE__ */ a(
|
|
42
|
+
le,
|
|
43
|
+
{
|
|
44
|
+
style: {
|
|
45
|
+
"--icon-size": c({
|
|
46
|
+
"16px": p,
|
|
47
|
+
"24px": N
|
|
48
|
+
})
|
|
49
|
+
},
|
|
50
|
+
className: e["addon-icon"],
|
|
51
|
+
iconName: t.addonContent
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
case "text":
|
|
56
|
+
return t.addonContent;
|
|
57
|
+
case "react-node":
|
|
58
|
+
return /* @__PURE__ */ a(R, { children: t.addonContent });
|
|
59
|
+
default:
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
}, he = M(
|
|
63
|
+
T(
|
|
64
|
+
(t, f) => {
|
|
65
|
+
const {
|
|
66
|
+
value: o,
|
|
67
|
+
className: p,
|
|
68
|
+
wrapperClassName: N,
|
|
69
|
+
rightSlotClassName: j,
|
|
70
|
+
requiredMarkClassName: D,
|
|
71
|
+
variant: v = te.DefaultGray,
|
|
72
|
+
type: E = "text",
|
|
73
|
+
autofocus: A,
|
|
74
|
+
readonly: u,
|
|
75
|
+
id: B,
|
|
76
|
+
onFocus: x,
|
|
77
|
+
onBlur: w,
|
|
78
|
+
label: _,
|
|
79
|
+
withClearButton: O,
|
|
80
|
+
disabled: s,
|
|
81
|
+
onChange: d,
|
|
82
|
+
rightAddon: G,
|
|
83
|
+
status: V,
|
|
84
|
+
leftAddon: P,
|
|
85
|
+
size: C = "m",
|
|
86
|
+
numbersOnly: W,
|
|
87
|
+
required: y,
|
|
88
|
+
maxLength: k,
|
|
89
|
+
autocomplete: $ = "on",
|
|
90
|
+
borderRadius: S = "all",
|
|
91
|
+
dataTestIdReactMap: r,
|
|
92
|
+
...H
|
|
93
|
+
} = t, [m, h] = ee(!!o), l = re(null), J = se(l, f);
|
|
94
|
+
F(() => {
|
|
95
|
+
A && l.current && l.current.focus();
|
|
96
|
+
}, [A]), F(() => {
|
|
97
|
+
h(!!o);
|
|
98
|
+
}, [o]);
|
|
99
|
+
const K = (n) => {
|
|
100
|
+
const i = n.currentTarget.value;
|
|
101
|
+
w == null || w(n), h(!!i);
|
|
102
|
+
}, Q = (n) => {
|
|
103
|
+
u || x == null || x(n);
|
|
104
|
+
}, U = () => {
|
|
105
|
+
l != null && l.current && (l.current.value = "", l.current.focus(), h(!1), d == null || d({
|
|
106
|
+
target: l.current
|
|
107
|
+
}));
|
|
108
|
+
}, X = (n) => {
|
|
109
|
+
let i = n.target.value;
|
|
110
|
+
W && (i = i.replace(/\D/g, "")), k !== void 0 && (i = i.slice(0, k)), n.target.value = i, d == null || d(n), h(!!i);
|
|
111
|
+
}, b = L(P), g = L(G), Y = {
|
|
112
|
+
[e.readonly]: s || u,
|
|
113
|
+
[e.disabled]: s || u,
|
|
114
|
+
[e["has-label"]]: !!_,
|
|
115
|
+
[e["has-left-slot"]]: !!b,
|
|
116
|
+
[e["has-right-slot"]]: !!g
|
|
117
|
+
}, q = m || !!o, Z = c(e.label, p, e[C], {
|
|
118
|
+
[e["active-label"]]: q,
|
|
119
|
+
[e.disabled]: s || u,
|
|
120
|
+
[e["has-left-slot"]]: !!b,
|
|
121
|
+
[e["has-right-slot"]]: !!g
|
|
122
|
+
}), I = c(e.input, Y, p, [
|
|
123
|
+
e[v],
|
|
124
|
+
e[V ?? ""],
|
|
125
|
+
e[C]
|
|
126
|
+
]);
|
|
127
|
+
return /* @__PURE__ */ z(
|
|
128
|
+
"div",
|
|
129
|
+
{
|
|
130
|
+
"data-testid-react": r == null ? void 0 : r.wrapper,
|
|
131
|
+
className: c(
|
|
132
|
+
e["input-wrapper"],
|
|
133
|
+
e[v],
|
|
134
|
+
e[V ?? ""],
|
|
135
|
+
e[C],
|
|
136
|
+
{
|
|
137
|
+
[e.disabled]: s || u,
|
|
138
|
+
[e[`border-radius-${S}`]]: S !== "all"
|
|
139
|
+
},
|
|
140
|
+
N
|
|
141
|
+
),
|
|
142
|
+
children: [
|
|
143
|
+
_ && /* @__PURE__ */ z(
|
|
144
|
+
"label",
|
|
145
|
+
{
|
|
146
|
+
"data-testid-react": r == null ? void 0 : r.label,
|
|
147
|
+
htmlFor: B,
|
|
148
|
+
className: Z,
|
|
149
|
+
children: [
|
|
150
|
+
/* @__PURE__ */ a("span", { className: e["label-text-wrapper"], children: _ }),
|
|
151
|
+
y && (m || q) && /* @__PURE__ */ a(
|
|
152
|
+
"span",
|
|
153
|
+
{
|
|
154
|
+
className: e["required-mark"],
|
|
155
|
+
"data-testid-react": r == null ? void 0 : r.requiredMark,
|
|
156
|
+
"data-testid": "required-mark"
|
|
157
|
+
}
|
|
158
|
+
)
|
|
159
|
+
]
|
|
160
|
+
}
|
|
161
|
+
),
|
|
162
|
+
b && /* @__PURE__ */ a(
|
|
163
|
+
"span",
|
|
164
|
+
{
|
|
165
|
+
"data-testid-react": r == null ? void 0 : r.leftSlot,
|
|
166
|
+
className: c(e["left-slot"], {
|
|
167
|
+
[e["has-label"]]: !!_,
|
|
168
|
+
[e.disabled]: s
|
|
169
|
+
}),
|
|
170
|
+
children: b
|
|
171
|
+
}
|
|
172
|
+
),
|
|
173
|
+
/* @__PURE__ */ a(
|
|
174
|
+
"input",
|
|
175
|
+
{
|
|
176
|
+
"data-testid-react": r == null ? void 0 : r.input,
|
|
177
|
+
ref: J,
|
|
178
|
+
type: E,
|
|
179
|
+
id: B,
|
|
180
|
+
className: I,
|
|
181
|
+
onFocus: Q,
|
|
182
|
+
onBlur: K,
|
|
183
|
+
readOnly: u,
|
|
184
|
+
value: o,
|
|
185
|
+
onChange: X,
|
|
186
|
+
maxLength: k,
|
|
187
|
+
disabled: s,
|
|
188
|
+
required: y,
|
|
189
|
+
autoComplete: $,
|
|
190
|
+
...H
|
|
191
|
+
}
|
|
192
|
+
),
|
|
193
|
+
g && /* @__PURE__ */ a(
|
|
194
|
+
"span",
|
|
195
|
+
{
|
|
196
|
+
"data-testid-react": r == null ? void 0 : r.rightSlot,
|
|
197
|
+
className: c(e["right-slot"], j, {
|
|
198
|
+
[e["has-label"]]: !!_,
|
|
199
|
+
[e.disabled]: s
|
|
200
|
+
}),
|
|
201
|
+
children: g
|
|
202
|
+
}
|
|
203
|
+
),
|
|
204
|
+
y && !m && !q && /* @__PURE__ */ a(
|
|
205
|
+
"span",
|
|
206
|
+
{
|
|
207
|
+
className: c(
|
|
208
|
+
e["required-mark"],
|
|
209
|
+
D
|
|
210
|
+
),
|
|
211
|
+
"data-testid-react": r == null ? void 0 : r.requiredMark,
|
|
212
|
+
"data-testid": "required-mark"
|
|
213
|
+
}
|
|
214
|
+
),
|
|
215
|
+
O && m && /* @__PURE__ */ a(
|
|
216
|
+
ae,
|
|
217
|
+
{
|
|
218
|
+
dataTestIdReactMap: { button: r == null ? void 0 : r.clearButton },
|
|
219
|
+
tabIndex: -1,
|
|
220
|
+
className: c(e.clear, {
|
|
221
|
+
[e.disabled]: s
|
|
222
|
+
}),
|
|
223
|
+
isIconButton: !0,
|
|
224
|
+
iconName: "Close16px",
|
|
225
|
+
size: "m-s",
|
|
226
|
+
clear: !0,
|
|
227
|
+
disabled: s || u,
|
|
228
|
+
variant: "secondary-gray",
|
|
229
|
+
onClick: U,
|
|
230
|
+
"data-testid": "clear-button"
|
|
231
|
+
}
|
|
232
|
+
)
|
|
233
|
+
]
|
|
234
|
+
}
|
|
235
|
+
);
|
|
236
|
+
}
|
|
237
|
+
)
|
|
238
|
+
);
|
|
239
|
+
he.displayName = "Input";
|
|
240
|
+
export {
|
|
241
|
+
he as I,
|
|
242
|
+
e as c
|
|
243
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { EAccordionButtonStyle, EAccordionButtonType, EAccordionContentPosition, EAccordionIconType, EAccordionSize } from './constants';
|
|
3
|
+
import { TDataTestIdReactMap } from '../../types';
|
|
3
4
|
|
|
4
5
|
type TChildrenProps = {
|
|
5
6
|
open?: boolean;
|
|
@@ -50,6 +51,10 @@ export type TProps = {
|
|
|
50
51
|
contentPosition?: EAccordionContentPosition | `${EAccordionContentPosition}`;
|
|
51
52
|
/** Флаг, указывающий, нужно ли останавливать распространение события */
|
|
52
53
|
needStopPropagation?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Объект, для передачи в компонент и его элементы data-testid-react, для автоматизированного тестирования
|
|
56
|
+
*/
|
|
57
|
+
dataTestIdReactMap?: TDataTestIdReactMap<'accordion' | 'disclosure' | 'button' | 'title' | 'iconContainer' | 'icon' | 'panel' | 'contentItem' | 'subtitleContainer'>;
|
|
53
58
|
};
|
|
54
59
|
export declare const Accordion: import('react').ForwardRefExoticComponent<TProps & import('react').RefAttributes<HTMLElement>>;
|
|
55
60
|
export {};
|