md-components-mdigial-azamat 0.0.61 → 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 t, jsx as e, Fragment as h } from "react/jsx-runtime";
2
- import { forwardRef as b, useState as y } from "react";
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 N } from "../../index-875e92ce.js";
5
- import { a as M, b as P } from "../../const-53dff524.js";
6
- import { c as m } from "../../cn-6a4bf187.js";
7
- const _ = b(
8
- ({ className: c, label: s, error: r, ...o }, n) => /* @__PURE__ */ t("div", { className: "w-full", children: [
9
- /* @__PURE__ */ t("label", { className: "flex items-start gap-3 cursor-pointer group", children: [
10
- /* @__PURE__ */ t("div", { className: "relative flex items-center justify-center mt-0.5", children: [
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: n,
17
- ...o
16
+ ref: i,
17
+ ...l
18
18
  }
19
19
  ),
20
20
  /* @__PURE__ */ e(
21
21
  "div",
22
22
  {
23
- className: m(
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:ring-2 peer-focus:ring-greenLight peer-focus:ring-offset-2",
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
- r && "border-red-500",
31
- c
32
- ),
33
- children: /* @__PURE__ */ e(
34
- "svg",
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: m(
43
+ className: x(
58
44
  "text-sm leading-5 text-graySoft select-none",
59
45
  "group-hover:text-blackBG transition-colors duration-200",
60
- r && "text-red-500"
46
+ o && "text-red-500"
61
47
  ),
62
48
  children: s
63
49
  }
64
50
  )
65
51
  ] }),
66
- r && /* @__PURE__ */ e("p", { className: "mt-2 text-sm text-red-500", children: r })
52
+ o && /* @__PURE__ */ e("p", { className: "mt-2 text-sm text-red-500", children: o })
67
53
  ] })
68
54
  );
69
- _.displayName = "Checkbox";
70
- const x = b(
71
- ({ className: c, type: s, error: r, label: o, ...n }, d) => /* @__PURE__ */ t("div", { className: "w-full", children: [
72
- o && /* @__PURE__ */ e("label", { className: "block text-sm font-medium text-blackBG mb-2", children: o }),
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: m(
78
- "flex h-14 w-full rounded-2xl border-2 border-grayBlue5 bg-white px-5 py-3 text-base",
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
- r && "border-red-500 hover:border-red-500 focus:border-red-500 focus:shadow-[0_0_0_4px_rgba(239,68,68,0.15)]",
85
- c
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: d,
88
- ...n
73
+ ref: m,
74
+ ...i
89
75
  }
90
76
  ),
91
- r && /* @__PURE__ */ e("p", { className: "mt-2 text-sm text-red-500", children: r })
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
- k.displayName = "Select";
143
- const W = [
144
- { value: "retail", label: "Розничная торговля" },
145
- { value: "restaurant", label: "Рестораны и кафе" },
146
- { value: "services", label: "Услуги" },
147
- { value: "online", label: "Интернет-магазин" },
148
- { value: "other", label: "Другое" }
149
- ], D = ["title", "subtitle", "color"], E = ({ title: c, subtitle: s, color: r }) => {
150
- var g, f, v, w;
151
- const [o, n] = y(!1), [d, u] = y(!1), {
152
- register: i,
153
- handleSubmit: L,
154
- watch: B,
155
- reset: S,
156
- formState: { errors: p }
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
- }), j = B("agreement"), C = async (a) => {
102
+ }), G = C("agreement"), T = async (t) => {
165
103
  try {
166
- u(!0), console.log("Form submitted:", a), await new Promise((l) => setTimeout(l, 1e3)), n(!0);
167
- } catch (l) {
168
- console.error("Error submitting form:", l);
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
- u(!1);
108
+ f(!1);
171
109
  }
172
- }, G = (a) => {
173
- const l = /^[а-яА-ЯёЁa-zA-Z\s-]+$/;
174
- return a.trim() ? l.test(a) ? a.trim().split(/\s+/).length < 2 ? "Введите полное ФИО" : !0 : "ФИО должно содержать только буквы" : "Поле обязательно для заполнения";
175
- }, F = (a) => {
176
- const l = /^0\d{9}$/;
177
- return a ? l.test(a) ? !0 : "Некорректный номер телефона" : "Поле обязательно для заполнения";
178
- }, z = (a) => {
179
- let l = a.target.value.replace(/\D/g, "");
180
- l.length > 0 && !l.startsWith("0") && (l = "0" + l), a.target.value = l.slice(0, 10);
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: L(C),
123
+ onSubmit: j(T),
186
124
  id: "application_form",
187
125
  className: "w-full",
188
- children: /* @__PURE__ */ t(
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 ${r}`
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__ */ t("div", { className: "text-center mb-10 max-tablet:mb-8", children: [
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: c }),
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
- o ? /* @__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__ */ t("div", { className: "text-center", children: [
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__ */ t("div", { className: "text-center", children: [
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
- N,
161
+ L,
224
162
  {
225
163
  className: "justify-center m-auto mt-6",
226
164
  title: "Закрыть",
227
165
  onClick: () => {
228
- n(!1), S();
166
+ u(!1), F();
229
167
  }
230
168
  }
231
169
  )
232
170
  ] })
233
- ] }) }) : /* @__PURE__ */ t(h, { children: [
234
- /* @__PURE__ */ t("div", { className: "w-[640px] mb-8 max-tablet:w-full space-y-6", children: [
235
- /* @__PURE__ */ e(
236
- x,
237
- {
238
- placeholder: "ФИО контактного лица",
239
- ...i("fio", {
240
- validate: G
241
- }),
242
- error: (g = p.fio) == null ? void 0 : g.message
243
- }
244
- ),
245
- /* @__PURE__ */ e(
246
- x,
247
- {
248
- placeholder: "Телефон",
249
- type: "tel",
250
- inputMode: "numeric",
251
- ...i("phone", {
252
- validate: F,
253
- onChange: z
254
- }),
255
- error: (f = p.phone) == null ? void 0 : f.message,
256
- maxLength: 10
257
- }
258
- ),
259
- /* @__PURE__ */ e(
260
- k,
261
- {
262
- ...i("business_category", {
263
- required: "Поле обязательно для заполнения"
264
- }),
265
- error: (v = p.business_category) == null ? void 0 : v.message,
266
- options: W
267
- }
268
- ),
269
- /* @__PURE__ */ e("div", { className: "pt-2", children: /* @__PURE__ */ e(
270
- _,
271
- {
272
- ...i("agreement", {
273
- required: "Необходимо согласие на обработку персональных данных"
274
- }),
275
- error: (w = p.agreement) == null ? void 0 : w.message,
276
- label: /* @__PURE__ */ t(h, { children: [
277
- "Я соглашаюсь с",
278
- " ",
279
- /* @__PURE__ */ e(
280
- "button",
281
- {
282
- type: "button",
283
- className: "text-greenLight hover:text-green underline transition-colors duration-200 bg-transparent border-0 p-0 cursor-pointer",
284
- onClick: (a) => {
285
- a.preventDefault();
286
- },
287
- children: "условиями обработки персональных данных"
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
- N,
251
+ L,
296
252
  {
297
- loading: d,
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: M.XL,
301
- variant: P.Primary,
302
- disabled: !j || d,
256
+ size: P.XL,
257
+ variant: R.Primary,
258
+ disabled: !G || h,
303
259
  children: "Отправить заявку"
304
260
  }
305
261
  ) })
@@ -1,5 +1,5 @@
1
1
  import { jsx as i } from "react/jsx-runtime";
2
- import { c as f } from "../componentsMap-b845b3b9.js";
2
+ import { c as f } from "../componentsMap-09f309da.js";
3
3
  const a = (p) => p.map((r) => {
4
4
  const s = f[r.key];
5
5
  if (!s)
@@ -1,5 +1,5 @@
1
1
  import { jsx as n, Fragment as t } from "react/jsx-runtime";
2
- import { c as i } from "../componentsMap-b845b3b9.js";
2
+ import { c as i } from "../componentsMap-09f309da.js";
3
3
  const d = ({ components: o, device: p }) => /* @__PURE__ */ n(t, { children: o.map((r) => {
4
4
  const e = i[r.key];
5
5
  return e ? /* @__PURE__ */ n(