md-components-mdigial-azamat 0.0.62 → 0.0.64

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