md-components-mdigial-azamat 0.0.62 → 0.0.63
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,52 +1,38 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
1
|
+
import { jsxs as a, jsx as e, Fragment as _ } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as S, useState as k } from "react";
|
|
3
3
|
import { u as I } from "../../index.esm-67811428.js";
|
|
4
|
-
import { B as
|
|
5
|
-
import { a as
|
|
6
|
-
import { c as
|
|
7
|
-
const
|
|
8
|
-
({ className:
|
|
9
|
-
/* @__PURE__ */
|
|
10
|
-
/* @__PURE__ */
|
|
4
|
+
import { B as L } from "../../index-875e92ce.js";
|
|
5
|
+
import { a as P, b as R } from "../../const-53dff524.js";
|
|
6
|
+
import { c as x } from "../../cn-6a4bf187.js";
|
|
7
|
+
const B = S(
|
|
8
|
+
({ className: n, label: s, error: o, ...l }, i) => /* @__PURE__ */ a("div", { className: "w-full", children: [
|
|
9
|
+
/* @__PURE__ */ a("label", { className: "flex items-start gap-3 cursor-pointer group", children: [
|
|
10
|
+
/* @__PURE__ */ a("div", { className: "relative flex items-center justify-center mt-0.5", children: [
|
|
11
11
|
/* @__PURE__ */ e(
|
|
12
12
|
"input",
|
|
13
13
|
{
|
|
14
14
|
type: "checkbox",
|
|
15
15
|
className: "peer sr-only",
|
|
16
|
-
ref:
|
|
17
|
-
...
|
|
16
|
+
ref: i,
|
|
17
|
+
...l
|
|
18
18
|
}
|
|
19
19
|
),
|
|
20
20
|
/* @__PURE__ */ e(
|
|
21
21
|
"div",
|
|
22
22
|
{
|
|
23
|
-
className:
|
|
24
|
-
"flex items-center justify-center w-5 h-5 rounded-md border-2 transition-all duration-200",
|
|
23
|
+
className: x(
|
|
24
|
+
"relative flex items-center justify-center w-5 h-5 rounded-md border-2 transition-all duration-200",
|
|
25
25
|
"border-grayBlue5 bg-white",
|
|
26
26
|
"peer-checked:bg-greenLight peer-checked:border-greenLight",
|
|
27
|
-
"peer-focus:
|
|
27
|
+
"peer-focus:outline-none peer-focus:border-greenLight",
|
|
28
28
|
"peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
|
|
29
29
|
"group-hover:border-greenLight",
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
className: "w-3.5 h-3.5 text-white opacity-0 peer-checked:opacity-100 transition-opacity duration-200",
|
|
37
|
-
fill: "none",
|
|
38
|
-
stroke: "currentColor",
|
|
39
|
-
viewBox: "0 0 24 24",
|
|
40
|
-
children: /* @__PURE__ */ e(
|
|
41
|
-
"path",
|
|
42
|
-
{
|
|
43
|
-
strokeLinecap: "round",
|
|
44
|
-
strokeLinejoin: "round",
|
|
45
|
-
strokeWidth: 3,
|
|
46
|
-
d: "M5 13l4 4L19 7"
|
|
47
|
-
}
|
|
48
|
-
)
|
|
49
|
-
}
|
|
30
|
+
'after:content-[""] after:absolute after:opacity-0 after:transition-opacity after:duration-200',
|
|
31
|
+
"after:w-[6px] after:h-[10px] after:border-r-2 after:border-b-2 after:border-white",
|
|
32
|
+
"after:rotate-45 after:-translate-x-[2px] after:translate-y-[-2px] after:top-1/2 after:left-1/2",
|
|
33
|
+
"after:translate-y-[-50%] after:translate-x-[-50%] peer-checked:after:opacity-100",
|
|
34
|
+
o && "border-red-500",
|
|
35
|
+
n
|
|
50
36
|
)
|
|
51
37
|
}
|
|
52
38
|
)
|
|
@@ -54,106 +40,58 @@ const _ = b(
|
|
|
54
40
|
s && /* @__PURE__ */ e(
|
|
55
41
|
"span",
|
|
56
42
|
{
|
|
57
|
-
className:
|
|
43
|
+
className: x(
|
|
58
44
|
"text-sm leading-5 text-graySoft select-none",
|
|
59
45
|
"group-hover:text-blackBG transition-colors duration-200",
|
|
60
|
-
|
|
46
|
+
o && "text-red-500"
|
|
61
47
|
),
|
|
62
48
|
children: s
|
|
63
49
|
}
|
|
64
50
|
)
|
|
65
51
|
] }),
|
|
66
|
-
|
|
52
|
+
o && /* @__PURE__ */ e("p", { className: "mt-2 text-sm text-red-500", children: o })
|
|
67
53
|
] })
|
|
68
54
|
);
|
|
69
|
-
|
|
70
|
-
const
|
|
71
|
-
({ className:
|
|
72
|
-
|
|
55
|
+
B.displayName = "Checkbox";
|
|
56
|
+
const p = S(
|
|
57
|
+
({ className: n, type: s, error: o, label: l, ...i }, m) => /* @__PURE__ */ a("div", { className: "w-full", children: [
|
|
58
|
+
l && /* @__PURE__ */ e("label", { className: "block text-sm font-medium text-blackBG mb-2", children: l }),
|
|
73
59
|
/* @__PURE__ */ e(
|
|
74
60
|
"input",
|
|
75
61
|
{
|
|
76
62
|
type: s,
|
|
77
|
-
className:
|
|
78
|
-
"flex h-14 w-full rounded-2xl border-
|
|
63
|
+
className: x(
|
|
64
|
+
"flex h-14 w-full rounded-2xl border-[1px] border-grayBlue bg-white px-[16px] py-[16px] text-base",
|
|
79
65
|
"placeholder:text-gray2 placeholder:opacity-60",
|
|
80
66
|
"transition-all duration-300 ease-in-out",
|
|
81
67
|
"hover:border-greenLight hover:shadow-[0_0_0_4px_rgba(22,163,74,0.1)]",
|
|
82
68
|
"focus:border-greenLight focus:outline-none focus:shadow-[0_0_0_4px_rgba(22,163,74,0.15)] focus:ring-0",
|
|
83
69
|
"disabled:cursor-not-allowed disabled:opacity-50 disabled:bg-lightGray",
|
|
84
|
-
|
|
85
|
-
|
|
70
|
+
o && "border-red-500 hover:border-red-500 focus:border-red-500 focus:shadow-[0_0_0_4px_rgba(239,68,68,0.15)]",
|
|
71
|
+
n
|
|
86
72
|
),
|
|
87
|
-
ref:
|
|
88
|
-
...
|
|
73
|
+
ref: m,
|
|
74
|
+
...i
|
|
89
75
|
}
|
|
90
76
|
),
|
|
91
|
-
|
|
92
|
-
] })
|
|
93
|
-
);
|
|
94
|
-
x.displayName = "Input";
|
|
95
|
-
const k = b(
|
|
96
|
-
({ className: c, error: s, label: r, options: o = [], children: n, ...d }, u) => /* @__PURE__ */ t("div", { className: "w-full", children: [
|
|
97
|
-
r && /* @__PURE__ */ e("label", { className: "block text-sm font-medium text-blackBG mb-2", children: r }),
|
|
98
|
-
/* @__PURE__ */ t("div", { className: "relative", children: [
|
|
99
|
-
/* @__PURE__ */ e(
|
|
100
|
-
"select",
|
|
101
|
-
{
|
|
102
|
-
className: m(
|
|
103
|
-
"flex h-14 w-full rounded-2xl border-2 border-grayBlue5 bg-white px-5 py-3 pr-10 text-base",
|
|
104
|
-
"appearance-none cursor-pointer",
|
|
105
|
-
"transition-all duration-300 ease-in-out",
|
|
106
|
-
"hover:border-greenLight hover:shadow-[0_0_0_4px_rgba(22,163,74,0.1)]",
|
|
107
|
-
"focus:border-greenLight focus:outline-none focus:shadow-[0_0_0_4px_rgba(22,163,74,0.15)] focus:ring-0",
|
|
108
|
-
"disabled:cursor-not-allowed disabled:opacity-50 disabled:bg-lightGray",
|
|
109
|
-
s && "border-red-500 hover:border-red-500 focus:border-red-500 focus:shadow-[0_0_0_4px_rgba(239,68,68,0.15)]",
|
|
110
|
-
c
|
|
111
|
-
),
|
|
112
|
-
ref: u,
|
|
113
|
-
...d,
|
|
114
|
-
children: o.length > 0 ? /* @__PURE__ */ t(h, { children: [
|
|
115
|
-
/* @__PURE__ */ e("option", { value: "", children: "Выберите категорию" }),
|
|
116
|
-
o.map((i) => /* @__PURE__ */ e("option", { value: i.value, children: i.label }, i.value))
|
|
117
|
-
] }) : n
|
|
118
|
-
}
|
|
119
|
-
),
|
|
120
|
-
/* @__PURE__ */ e("div", { className: "absolute right-4 top-1/2 -translate-y-1/2 pointer-events-none", children: /* @__PURE__ */ e(
|
|
121
|
-
"svg",
|
|
122
|
-
{
|
|
123
|
-
className: "w-5 h-5 text-grayBlue5",
|
|
124
|
-
fill: "none",
|
|
125
|
-
stroke: "currentColor",
|
|
126
|
-
viewBox: "0 0 24 24",
|
|
127
|
-
children: /* @__PURE__ */ e(
|
|
128
|
-
"path",
|
|
129
|
-
{
|
|
130
|
-
strokeLinecap: "round",
|
|
131
|
-
strokeLinejoin: "round",
|
|
132
|
-
strokeWidth: 2,
|
|
133
|
-
d: "M19 9l-7 7-7-7"
|
|
134
|
-
}
|
|
135
|
-
)
|
|
136
|
-
}
|
|
137
|
-
) })
|
|
138
|
-
] }),
|
|
139
|
-
s && /* @__PURE__ */ e("p", { className: "mt-2 text-sm text-red-500", children: s })
|
|
77
|
+
o && /* @__PURE__ */ e("p", { className: "mt-2 text-sm text-red-500", children: o })
|
|
140
78
|
] })
|
|
141
79
|
);
|
|
142
|
-
|
|
143
|
-
const
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
var
|
|
151
|
-
const [
|
|
152
|
-
register:
|
|
153
|
-
handleSubmit:
|
|
154
|
-
watch:
|
|
155
|
-
reset:
|
|
156
|
-
formState: { errors:
|
|
80
|
+
p.displayName = "Input";
|
|
81
|
+
const D = ["title", "subtitle", "color"], E = ({
|
|
82
|
+
title: n,
|
|
83
|
+
subtitle: s,
|
|
84
|
+
color: o,
|
|
85
|
+
gridCols: l = 2,
|
|
86
|
+
gridRow: i = 2
|
|
87
|
+
}) => {
|
|
88
|
+
var b, w, y, v, N;
|
|
89
|
+
const [m, u] = k(!1), [h, f] = k(!1), {
|
|
90
|
+
register: d,
|
|
91
|
+
handleSubmit: j,
|
|
92
|
+
watch: C,
|
|
93
|
+
reset: F,
|
|
94
|
+
formState: { errors: c }
|
|
157
95
|
} = I({
|
|
158
96
|
defaultValues: {
|
|
159
97
|
fio: "",
|
|
@@ -161,43 +99,43 @@ const W = [
|
|
|
161
99
|
business_category: "",
|
|
162
100
|
agreement: !1
|
|
163
101
|
}
|
|
164
|
-
}),
|
|
102
|
+
}), G = C("agreement"), T = async (t) => {
|
|
165
103
|
try {
|
|
166
|
-
|
|
167
|
-
} catch (
|
|
168
|
-
console.error("Error submitting form:",
|
|
104
|
+
f(!0), console.log("Form submitted:", t), await new Promise((r) => setTimeout(r, 1e3)), u(!0);
|
|
105
|
+
} catch (r) {
|
|
106
|
+
console.error("Error submitting form:", r);
|
|
169
107
|
} finally {
|
|
170
|
-
|
|
108
|
+
f(!1);
|
|
171
109
|
}
|
|
172
|
-
},
|
|
173
|
-
const
|
|
174
|
-
return
|
|
175
|
-
},
|
|
176
|
-
const
|
|
177
|
-
return
|
|
178
|
-
}, z = (
|
|
179
|
-
let
|
|
180
|
-
|
|
110
|
+
}, g = (t) => {
|
|
111
|
+
const r = /^[а-яА-ЯёЁa-zA-Z\s-]+$/;
|
|
112
|
+
return t.trim() ? r.test(t) ? t.trim().split(/\s+/).length < 2 ? "Введите полное ФИО" : !0 : "ФИО должно содержать только буквы" : "Поле обязательно для заполнения";
|
|
113
|
+
}, $ = (t) => {
|
|
114
|
+
const r = /^0\d{9}$/;
|
|
115
|
+
return t ? r.test(t) ? !0 : "Некорректный номер телефона" : "Поле обязательно для заполнения";
|
|
116
|
+
}, z = (t) => {
|
|
117
|
+
let r = t.target.value.replace(/\D/g, "");
|
|
118
|
+
r.length > 0 && !r.startsWith("0") && (r = "0" + r), t.target.value = r.slice(0, 10);
|
|
181
119
|
};
|
|
182
120
|
return /* @__PURE__ */ e(
|
|
183
121
|
"form",
|
|
184
122
|
{
|
|
185
|
-
onSubmit:
|
|
123
|
+
onSubmit: j(T),
|
|
186
124
|
id: "application_form",
|
|
187
125
|
className: "w-full",
|
|
188
|
-
children: /* @__PURE__ */
|
|
126
|
+
children: /* @__PURE__ */ a(
|
|
189
127
|
"div",
|
|
190
128
|
{
|
|
191
129
|
style: {
|
|
192
|
-
boxShadow: `0px 8px 24px rgba(0,0,0,0.08),0px -8px 0px ${
|
|
130
|
+
boxShadow: `0px 8px 24px rgba(0,0,0,0.08),0px -8px 0px ${o}`
|
|
193
131
|
},
|
|
194
|
-
className: "bg-white rounded-[24px] shadow-[0px_8px_24px_rgba(0,0,0,0.08),0px_-8px_0px_#45464b] w-full flex flex-col items-center justify-center py-[72px] px-[96px] max-tablet:py-[40px] max-tablet:px-[32px] transition-all duration-300 hover:shadow-[0px_12px_32px_rgba(0,0,0,0.12),0px_-8px_0px_#45464b]",
|
|
132
|
+
className: "bg-white rounded-[24px] shadow-[0px_8px_24px_rgba(0,0,0,0.08),0px_-8px_0px_#45464b] w-full flex flex-col items-center justify-center py-[72px] px-[96px] max-tablet:py-[40px] max-tablet:px-[32px] transition-all duration-300 hover:shadow-[0px_12px_32px_rgba(0,0,0,0.12),0px_-8px_0px_#45464b] mt-[8px]",
|
|
195
133
|
children: [
|
|
196
|
-
/* @__PURE__ */
|
|
197
|
-
/* @__PURE__ */ e("h2", { className: "text-[36px] leading-[44px] font-semibold m-0 mb-3 text-blackBG max-tablet:text-[28px] max-tablet:leading-[36px]", children:
|
|
134
|
+
/* @__PURE__ */ a("div", { className: "text-center mb-10 max-tablet:mb-8", children: [
|
|
135
|
+
/* @__PURE__ */ e("h2", { className: "text-[36px] leading-[44px] font-semibold m-0 mb-3 text-blackBG max-tablet:text-[28px] max-tablet:leading-[36px]", children: n }),
|
|
198
136
|
/* @__PURE__ */ e("span", { className: "text-[18px] leading-[26px] text-graySoft max-tablet:text-[16px] max-tablet:leading-[24px]", children: s })
|
|
199
137
|
] }),
|
|
200
|
-
|
|
138
|
+
m ? /* @__PURE__ */ e("div", { className: "flex flex-col items-center w-[640px] gap-8 max-tablet:w-full animate-in fade-in duration-500", children: /* @__PURE__ */ a("div", { className: "text-center", children: [
|
|
201
139
|
/* @__PURE__ */ e("div", { className: "w-20 h-20 rounded-full bg-gradient-to-br from-greenLight to-green flex items-center justify-center mx-auto mb-6 shadow-lg animate-in zoom-in duration-500", children: /* @__PURE__ */ e(
|
|
202
140
|
"svg",
|
|
203
141
|
{
|
|
@@ -216,90 +154,108 @@ const W = [
|
|
|
216
154
|
)
|
|
217
155
|
}
|
|
218
156
|
) }),
|
|
219
|
-
/* @__PURE__ */
|
|
157
|
+
/* @__PURE__ */ a("div", { className: "text-center", children: [
|
|
220
158
|
/* @__PURE__ */ e("div", { className: "font-semibold text-[24px] leading-[32px] text-blackBG mb-3", children: "Заявка успешно отправлена" }),
|
|
221
159
|
/* @__PURE__ */ e("div", { className: "text-[18px] leading-[26px] text-graySoft", children: "С Вами свяжется наш специалист и поможет с подключением сервиса" }),
|
|
222
160
|
/* @__PURE__ */ e(
|
|
223
|
-
|
|
161
|
+
L,
|
|
224
162
|
{
|
|
225
163
|
className: "justify-center m-auto mt-6",
|
|
226
164
|
title: "Закрыть",
|
|
227
165
|
onClick: () => {
|
|
228
|
-
|
|
166
|
+
u(!1), F();
|
|
229
167
|
}
|
|
230
168
|
}
|
|
231
169
|
)
|
|
232
170
|
] })
|
|
233
|
-
] }) }) : /* @__PURE__ */
|
|
234
|
-
/* @__PURE__ */
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
171
|
+
] }) }) : /* @__PURE__ */ a(_, { children: [
|
|
172
|
+
/* @__PURE__ */ a(
|
|
173
|
+
"div",
|
|
174
|
+
{
|
|
175
|
+
className: "w-[640px] mb-8 max-tablet:w-full grid gap-6",
|
|
176
|
+
style: {
|
|
177
|
+
gridTemplateColumns: `repeat(${l}, 1fr)`,
|
|
178
|
+
gridTemplateRows: `repeat(${i}, auto)`
|
|
179
|
+
},
|
|
180
|
+
children: [
|
|
181
|
+
/* @__PURE__ */ e(
|
|
182
|
+
p,
|
|
183
|
+
{
|
|
184
|
+
placeholder: "ФИО контактного лица",
|
|
185
|
+
...d("fio", {
|
|
186
|
+
validate: g
|
|
187
|
+
}),
|
|
188
|
+
error: (b = c.fio) == null ? void 0 : b.message
|
|
189
|
+
}
|
|
190
|
+
),
|
|
191
|
+
/* @__PURE__ */ e(
|
|
192
|
+
p,
|
|
193
|
+
{
|
|
194
|
+
placeholder: "Номер телефона",
|
|
195
|
+
type: "tel",
|
|
196
|
+
inputMode: "numeric",
|
|
197
|
+
...d("phone", {
|
|
198
|
+
validate: $,
|
|
199
|
+
onChange: z
|
|
200
|
+
}),
|
|
201
|
+
error: (w = c.phone) == null ? void 0 : w.message,
|
|
202
|
+
maxLength: 10
|
|
203
|
+
}
|
|
204
|
+
),
|
|
205
|
+
/* @__PURE__ */ e(
|
|
206
|
+
p,
|
|
207
|
+
{
|
|
208
|
+
placeholder: "ИНН",
|
|
209
|
+
...d("tin"),
|
|
210
|
+
error: (y = c.tin) == null ? void 0 : y.message
|
|
211
|
+
}
|
|
212
|
+
),
|
|
213
|
+
/* @__PURE__ */ e(
|
|
214
|
+
p,
|
|
215
|
+
{
|
|
216
|
+
placeholder: "Адрес",
|
|
217
|
+
...d("adress", {
|
|
218
|
+
validate: g
|
|
219
|
+
}),
|
|
220
|
+
error: (v = c.adress) == null ? void 0 : v.message
|
|
221
|
+
}
|
|
222
|
+
)
|
|
223
|
+
]
|
|
224
|
+
}
|
|
225
|
+
),
|
|
226
|
+
/* @__PURE__ */ e("div", { className: "pt-2", children: /* @__PURE__ */ e(
|
|
227
|
+
B,
|
|
228
|
+
{
|
|
229
|
+
...d("agreement", {
|
|
230
|
+
required: "Необходимо согласие на обработку персональных данных"
|
|
231
|
+
}),
|
|
232
|
+
error: (N = c.agreement) == null ? void 0 : N.message,
|
|
233
|
+
label: /* @__PURE__ */ a(_, { children: [
|
|
234
|
+
"Я соглашаюсь с",
|
|
235
|
+
" ",
|
|
236
|
+
/* @__PURE__ */ e(
|
|
237
|
+
"button",
|
|
238
|
+
{
|
|
239
|
+
type: "button",
|
|
240
|
+
className: "text-greenLight hover:text-green underline transition-colors duration-200 bg-transparent border-0 p-0 cursor-pointer",
|
|
241
|
+
onClick: (t) => {
|
|
242
|
+
t.preventDefault();
|
|
243
|
+
},
|
|
244
|
+
children: "условиями обработки персональных данных"
|
|
245
|
+
}
|
|
246
|
+
)
|
|
247
|
+
] })
|
|
248
|
+
}
|
|
249
|
+
) }),
|
|
294
250
|
/* @__PURE__ */ e("div", { className: "mt-6 w-[640px] max-tablet:w-full", children: /* @__PURE__ */ e(
|
|
295
|
-
|
|
251
|
+
L,
|
|
296
252
|
{
|
|
297
|
-
loading:
|
|
253
|
+
loading: h,
|
|
298
254
|
className: "w-full whitespace-nowrap transition-all duration-200 hover:scale-[1.02] active:scale-[0.98]",
|
|
299
255
|
type: "submit",
|
|
300
|
-
size:
|
|
301
|
-
variant:
|
|
302
|
-
disabled: !
|
|
256
|
+
size: P.XL,
|
|
257
|
+
variant: R.Primary,
|
|
258
|
+
disabled: !G || h,
|
|
303
259
|
children: "Отправить заявку"
|
|
304
260
|
}
|
|
305
261
|
) })
|