md-components-mdigial-azamat 0.0.73 → 0.0.76

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,56 +1,59 @@
1
- import { jsx as t, Fragment as m } from "react/jsx-runtime";
2
- import { useState as p, useEffect as f } from "react";
3
- import { H as u } from "../index.module-c8833286.js";
4
- import { L as h } from "../languages-list-87ab3324.js";
5
- import { R as w } from "../routes-76228734.js";
6
- import { c as L } from "../cn-6a4bf187.js";
7
- import { u as v } from "../useScreenSize-c1b64c02.js";
8
- import { HeaderMobile as S } from "./components/HeaderMobile/HeaderMobile.js";
9
- import E from "./components/HeaderWeb/HeaderWeb.js";
10
- const y = "app_language", A = () => localStorage.getItem(y) || h.RU, G = ({ darkTheme: a }) => {
11
- const c = v(960), [l, d] = p(null);
12
- f(() => {
13
- const o = async () => {
1
+ import { jsx as t, Fragment as p } from "react/jsx-runtime";
2
+ import { useState as f, useEffect as u } from "react";
3
+ import { H as h } from "../index.module-c8833286.js";
4
+ import { L as w } from "../languages-list-87ab3324.js";
5
+ import { R as L } from "../routes-76228734.js";
6
+ import { c as v } from "../cn-6a4bf187.js";
7
+ import { u as S } from "../useScreenSize-c1b64c02.js";
8
+ import { HeaderMobile as E } from "./components/HeaderMobile/HeaderMobile.js";
9
+ import y from "./components/HeaderWeb/HeaderWeb.js";
10
+ const A = "app_language", H = () => localStorage.getItem(A) || w.RU, P = ({ darkTheme: a, app_setting: o }) => {
11
+ console.log(o);
12
+ const l = S(960), [d, m] = f(null);
13
+ u(() => {
14
+ const n = async () => {
14
15
  try {
15
- const n = A(), g = window.location.pathname.startsWith(w.ISLAM) ? "M_ISLAMIC" : "", { data: e } = await u.getHeaderSections(
16
- n,
16
+ const s = H(), g = window.location.pathname.startsWith(L.ISLAM) ? "M_ISLAMIC" : "", { data: e } = await h.getHeaderSections(
17
+ s,
17
18
  g
18
19
  );
19
- e && (Array.isArray(e) || typeof e == "object") ? d(e) : console.warn("Header data is null or invalid:", e);
20
- } catch (n) {
21
- console.error("Error fetching header data:", n);
20
+ e && (Array.isArray(e) || typeof e == "object") ? m(e) : console.warn("Header data is null or invalid:", e);
21
+ } catch (s) {
22
+ console.error("Error fetching header data:", s);
22
23
  }
23
24
  };
24
- o();
25
- const r = () => {
26
- o();
27
- };
28
- window.addEventListener("languageChange", r);
25
+ n();
29
26
  const i = () => {
30
- o();
27
+ n();
28
+ };
29
+ window.addEventListener("languageChange", i);
30
+ const c = () => {
31
+ n();
31
32
  };
32
- return window.addEventListener("popstate", i), () => {
33
- window.removeEventListener("languageChange", r), window.removeEventListener("popstate", i);
33
+ return window.addEventListener("popstate", c), () => {
34
+ window.removeEventListener("languageChange", i), window.removeEventListener("popstate", c);
34
35
  };
35
36
  }, []);
36
- const s = l || [];
37
- return /* @__PURE__ */ t(m, { children: c ? /* @__PURE__ */ t(
38
- S,
37
+ const r = d || [];
38
+ return /* @__PURE__ */ t(p, { children: l ? /* @__PURE__ */ t(
39
+ E,
39
40
  {
40
- sections: s,
41
+ app_setting: o,
42
+ sections: r,
41
43
  darkTheme: a,
42
44
  className: "fixed top-0 z-[9999] w-full"
43
45
  }
44
46
  ) : /* @__PURE__ */ t(
45
47
  "div",
46
48
  {
47
- className: L(
49
+ className: v(
48
50
  "fixed top-0 z-[9999] w-full h-[70px] bg-white flex items-center justify-center py-[9px]"
49
51
  ),
50
52
  children: /* @__PURE__ */ t(
51
- E,
53
+ y,
52
54
  {
53
- sections: s,
55
+ app_setting: o,
56
+ sections: r,
54
57
  darkTheme: a
55
58
  }
56
59
  )
@@ -58,5 +61,5 @@ const y = "app_language", A = () => localStorage.getItem(y) || h.RU, G = ({ dark
58
61
  ) });
59
62
  };
60
63
  export {
61
- G as Header
64
+ P as Header
62
65
  };
@@ -1,52 +1,53 @@
1
- import { jsxs as o, jsx as t } from "react/jsx-runtime";
1
+ import { jsxs as s, jsx as a } from "react/jsx-runtime";
2
2
  import { useState as l, useMemo as f } from "react";
3
- import { M as z, G as D } from "../../../logo-99aa20bd.js";
4
- import { S as W } from "../../../search-dd4eb6f8.js";
5
- import { a as k } from "../../../cn-6a4bf187.js";
6
- import { R as h } from "../../../routes-76228734.js";
7
- import { u as E } from "../../../useClickOutside-197b0df2.js";
8
- import { I } from "../../../index-9384c6d6.js";
9
- import O from "../HeaderMenu/HeaderMenu.js";
10
- import P from "../HeaderResults/HeaderResults.js";
11
- import q from "../HeaderSearch/HeaderSearch.js";
12
- import { HeaderTab as T } from "../HeaderTab/HeaderTab.js";
13
- import B from "../SelectLanguage/SelectLanguage.js";
14
- const F = "category", H = "link", se = ({ sections: r, darkTheme: p }) => {
15
- const [g, n] = l(null), [d, b] = l(!1), [u, a] = l(!1), [s, x] = l(
3
+ import { M as E, G as O } from "../../../logo-99aa20bd.js";
4
+ import { S as P } from "../../../search-dd4eb6f8.js";
5
+ import { a as L } from "../../../cn-6a4bf187.js";
6
+ import { R as g } from "../../../routes-76228734.js";
7
+ import { u as q } from "../../../useClickOutside-197b0df2.js";
8
+ import { I as T } from "../../../index-9384c6d6.js";
9
+ import B from "../HeaderMenu/HeaderMenu.js";
10
+ import F from "../HeaderResults/HeaderResults.js";
11
+ import J from "../HeaderSearch/HeaderSearch.js";
12
+ import { HeaderTab as C } from "../HeaderTab/HeaderTab.js";
13
+ import K from "../SelectLanguage/SelectLanguage.js";
14
+ const Q = "category", H = "link", le = ({ sections: r, darkTheme: b, app_setting: u }) => {
15
+ var k;
16
+ const [p, n] = l(null), [d, x] = l(!1), [m, t] = l(!1), [o, y] = l(
16
17
  []
17
- ), [i, m] = l(0), { ref: M } = E(u, () => {
18
- a(!1), n(null), m(0);
19
- }), y = (e) => {
18
+ ), [c, h] = l(0), { ref: M } = q(m, () => {
19
+ t(!1), n(null), h(0);
20
+ }), w = (e) => {
20
21
  window.location.href = e || "/";
21
- }, w = (e) => {
22
- const { type: A, id: G, data: _ } = e;
23
- A === F && (x(_), a(!0)), A === H && (a(!1), x([])), n(G);
24
22
  }, v = (e) => {
23
+ const { type: I, id: D, data: W } = e;
24
+ I === Q && (y(W), t(!0)), I === H && (t(!1), y([])), n(D);
25
+ }, S = (e) => {
25
26
  e === H && n(null);
26
- }, S = () => {
27
- b(!d), a(!1);
28
- }, C = () => {
29
- m(0), a(!1), n(null);
30
- }, N = f(() => s.find((e) => e.id === i), [i, s]), L = window.location.pathname.startsWith(h.ISLAM), c = f(() => Array.isArray(r) ? r : r ? [r] : [], [r]), R = f(() => c.filter((e) => !e.is_left), [c]), j = f(() => c.filter((e) => e.is_left), [c]);
31
- return /* @__PURE__ */ o(
27
+ }, N = () => {
28
+ x(!d), t(!1);
29
+ }, R = () => {
30
+ h(0), t(!1), n(null);
31
+ }, A = f(() => o.find((e) => e.id === c), [c, o]), j = window.location.pathname.startsWith(g.ISLAM), i = f(() => Array.isArray(r) ? r : r ? [r] : [], [r]), G = f(() => i.filter((e) => !e.is_left), [i]), z = f(() => i.filter((e) => e.is_left), [i]);
32
+ return /* @__PURE__ */ s(
32
33
  "header",
33
34
  {
34
- className: k(
35
+ className: L(
35
36
  "relative w-full container bg-white",
36
- p && "bg-gray-900 text-white transition-all duration-500",
37
- u && p && "bg-white text-gray-700"
37
+ b && "bg-gray-900 text-white transition-all duration-500",
38
+ m && b && "bg-white text-gray-700"
38
39
  ),
39
40
  children: [
40
- !d && /* @__PURE__ */ o("div", { className: "flex items-center h-13 px-6 lg:px-0 max-w-[1200px] mx-auto", children: [
41
- /* @__PURE__ */ t(
41
+ !d && /* @__PURE__ */ s("div", { className: "flex items-center h-13 px-6 lg:px-0 max-w-[1200px] mx-auto", children: [
42
+ /* @__PURE__ */ a(
42
43
  "a",
43
44
  {
44
- href: L ? h.ISLAM : h.MAIN_PAGE,
45
+ href: j ? g.ISLAM : g.MAIN_PAGE,
45
46
  className: "flex items-center gap-6 mr-12 cursor-pointer",
46
- children: /* @__PURE__ */ t(
47
- I,
47
+ children: /* @__PURE__ */ a(
48
+ T,
48
49
  {
49
- src: z,
50
+ src: E,
50
51
  alt: "Logo",
51
52
  width: 120,
52
53
  height: 34
@@ -54,44 +55,49 @@ const F = "category", H = "link", se = ({ sections: r, darkTheme: p }) => {
54
55
  )
55
56
  }
56
57
  ),
57
- /* @__PURE__ */ o("div", { className: "flex items-center justify-between flex-grow", children: [
58
- /* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: R.map(
59
- (e) => e && /* @__PURE__ */ t(
60
- T,
58
+ /* @__PURE__ */ s("div", { className: "flex items-center justify-between flex-grow", children: [
59
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: G.map(
60
+ (e) => e && /* @__PURE__ */ a(
61
+ C,
61
62
  {
62
63
  item: e,
63
- activeTab: g,
64
- onTabClick: y,
65
- onTabHover: w,
66
- onTabLeave: v
64
+ activeTab: p,
65
+ onTabClick: w,
66
+ onTabHover: v,
67
+ onTabLeave: S
67
68
  },
68
69
  e == null ? void 0 : e.id
69
70
  )
70
71
  ) }),
71
- /* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
72
- /* @__PURE__ */ t("div", { className: "flex items-center gap-2 pr-6 border-r border-gray-300 mr-4", children: j.map(
73
- (e) => e && /* @__PURE__ */ t(
74
- T,
72
+ /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
73
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-2 pr-6 border-r border-gray-300 mr-4", children: z.map(
74
+ (e) => e && /* @__PURE__ */ a(
75
+ C,
75
76
  {
76
77
  item: e,
77
- activeTab: g,
78
- onTabClick: y,
79
- onTabHover: w,
80
- onTabLeave: v
78
+ activeTab: p,
79
+ onTabClick: w,
80
+ onTabHover: v,
81
+ onTabLeave: S
81
82
  },
82
83
  e == null ? void 0 : e.id
83
84
  )
84
85
  ) }),
85
- /* @__PURE__ */ t(B, {}),
86
- /* @__PURE__ */ t(
86
+ /* @__PURE__ */ a(
87
+ K,
88
+ {
89
+ onChangeLanguage: (k = u == null ? void 0 : u.locale) == null ? void 0 : k.changeLanguage
90
+ }
91
+ ),
92
+ /* @__PURE__ */ a(
87
93
  "button",
88
94
  {
89
- onClick: S,
95
+ onClick: N,
90
96
  className: "flex items-center justify-center w-9 h-9 p-1.5 rounded-full bg-gray-200",
91
- children: /* @__PURE__ */ t(
92
- I,
97
+ children: /* @__PURE__ */ a(
98
+ T,
93
99
  {
94
- src: W,
100
+ src: P,
95
101
  alt: "search icon",
96
102
  width: 18,
97
103
  height: 18
@@ -99,46 +105,46 @@ const F = "category", H = "link", se = ({ sections: r, darkTheme: p }) => {
99
105
  )
100
106
  }
101
107
  ),
102
- /* @__PURE__ */ t(
108
+ /* @__PURE__ */ a(
103
109
  "button",
104
110
  {
105
111
  "aria-label": "Открыть режим для слабовидящих",
106
112
  className: "flex items-center justify-center w-9 h-9 p-1.5 rounded-full bg-gray-200",
107
- children: /* @__PURE__ */ t(D, { size: 16 })
113
+ children: /* @__PURE__ */ a(O, { size: 16 })
108
114
  }
109
115
  )
110
116
  ] })
111
117
  ] })
112
118
  ] }),
113
- d && /* @__PURE__ */ t(
114
- q,
119
+ d && /* @__PURE__ */ a(
120
+ J,
115
121
  {
116
- closeSearch: S,
117
- onClick: () => b(!1)
122
+ closeSearch: N,
123
+ onClick: () => x(!1)
118
124
  }
119
125
  ),
120
- /* @__PURE__ */ o(
126
+ /* @__PURE__ */ s(
121
127
  "div",
122
128
  {
123
- className: k(
129
+ className: L(
124
130
  "flex bg-white rounded-2xl backdrop-blur-md w-full shadow-lg absolute top-[59px] left-0 z-50 transition-all duration-300 ease-out",
125
- u ? "opacity-100 translate-y-0 pointer-events-auto visible" : "opacity-0 -translate-y-5 pointer-events-none invisible"
131
+ m ? "opacity-100 translate-y-0 pointer-events-auto visible" : "opacity-0 -translate-y-5 pointer-events-none invisible"
126
132
  ),
127
133
  ref: M,
128
134
  children: [
129
- /* @__PURE__ */ t(
130
- O,
135
+ /* @__PURE__ */ a(
136
+ B,
131
137
  {
132
- categories: s,
133
- activeSubcategory: m,
134
- openResult: a
138
+ categories: o,
139
+ activeSubcategory: h,
140
+ openResult: t
135
141
  }
136
142
  ),
137
- N || s[i] ? /* @__PURE__ */ t(
138
- P,
143
+ A || o[c] ? /* @__PURE__ */ a(
144
+ F,
139
145
  {
140
- data: N || s[i],
141
- onClick: C
146
+ data: A || o[c],
147
+ onClick: R
142
148
  }
143
149
  ) : null
144
150
  ]
@@ -149,5 +155,5 @@ const F = "category", H = "link", se = ({ sections: r, darkTheme: p }) => {
149
155
  );
150
156
  };
151
157
  export {
152
- se as default
158
+ le as default
153
159
  };
@@ -1,14 +1,18 @@
1
- import { jsxs as v, jsx as p } from "react/jsx-runtime";
2
- import { useState as d, useEffect as _ } from "react";
1
+ import { jsxs as _, jsx as p } from "react/jsx-runtime";
2
+ import { useState as d, useEffect as E } from "react";
3
3
  import { a as r } from "../../../languages-list-87ab3324.js";
4
- import { u as E } from "../../../useClickOutside-197b0df2.js";
4
+ import { u as C } from "../../../useClickOutside-197b0df2.js";
5
5
  import { c as l } from "../../../cn-6a4bf187.js";
6
- const u = "app_language", N = ({ rightPosition: g = !1, className: i }) => {
6
+ const u = "app_language", m = ({
7
+ rightPosition: g = !1,
8
+ className: i,
9
+ onChangeLanguage: h
10
+ }) => {
7
11
  var x;
8
12
  const [s, a] = d(!1), [o, f] = d(
9
13
  r[0] || { key: "ru", title: "Русский" }
10
14
  );
11
- _(() => {
15
+ E(() => {
12
16
  const e = localStorage.getItem(u);
13
17
  if (e) {
14
18
  const t = r.find((n) => n.key === e);
@@ -18,24 +22,24 @@ const u = "app_language", N = ({ rightPosition: g = !1, className: i }) => {
18
22
  const c = (e) => {
19
23
  a(!1);
20
24
  const t = r.find((n) => n.key === e);
21
- t && (f(t), localStorage.setItem(u, e), window.dispatchEvent(
25
+ t && (f(t), localStorage.setItem(u, e), h(e), window.dispatchEvent(
22
26
  new CustomEvent("languageChange", { detail: e })
23
27
  ));
24
- }, h = (e) => {
28
+ }, b = (e) => {
25
29
  (e.key === "Enter" || e.key === " ") && (e.preventDefault(), a((t) => !t));
26
- }, b = (e, t) => {
30
+ }, k = (e, t) => {
27
31
  (e.key === "Enter" || e.key === " ") && (e.preventDefault(), c(t));
28
- }, y = () => {
32
+ }, w = () => {
29
33
  a(!s);
30
- }, { ref: k } = E(s, () => a(!1));
31
- return /* @__PURE__ */ v(
34
+ }, { ref: y } = C(s, () => a(!1));
35
+ return /* @__PURE__ */ _(
32
36
  "div",
33
37
  {
34
- ref: k,
38
+ ref: y,
35
39
  role: "button",
36
40
  tabIndex: 0,
37
- onClick: y,
38
- onKeyDown: h,
41
+ onClick: w,
42
+ onKeyDown: b,
39
43
  className: l(
40
44
  "relative flex items-center justify-center rounded-full p-2 bg-[#f4f6f7] w-[36px] h-[36px] cursor-pointer",
41
45
  i
@@ -58,7 +62,7 @@ const u = "app_language", N = ({ rightPosition: g = !1, className: i }) => {
58
62
  role: "button",
59
63
  tabIndex: 0,
60
64
  onClick: () => c(e == null ? void 0 : e.key),
61
- onKeyDown: (w) => b(w, e == null ? void 0 : e.key),
65
+ onKeyDown: (v) => k(v, e == null ? void 0 : e.key),
62
66
  className: l(
63
67
  "text-[#0b0f19] px-2 py-[10px] text-[16px] leading-[24px] min-w-[164px] cursor-pointer relative rounded-[8px]",
64
68
  n && 'bg-[#f4f5f6] after:absolute after:top-[9px] after:right-[10px] after:w-[24px] after:h-[24px] after:bg-[url("/checked.svg")] after:bg-center after:bg-no-repeat'
@@ -75,5 +79,5 @@ const u = "app_language", N = ({ rightPosition: g = !1, className: i }) => {
75
79
  );
76
80
  };
77
81
  export {
78
- N as default
82
+ m as default
79
83
  };
@@ -1,31 +1,52 @@
1
- import { jsxs as s, jsx as a } from "react/jsx-runtime";
1
+ import { jsxs as p, jsx as a } from "react/jsx-runtime";
2
2
  import { FieldTypes as r } from "../../../Types/FiledTypes.js";
3
- import { B as x } from "../../../index-875e92ce.js";
4
- import { B as m } from "../../../const-53dff524.js";
5
- import { I as o } from "../../../index-9384c6d6.js";
6
- const d = ["title", "subtitle", "image", "button", "id"], v = {
3
+ import { B as c } from "../../../index-875e92ce.js";
4
+ import { B as d } from "../../../const-53dff524.js";
5
+ import { I as x } from "../../../index-9384c6d6.js";
6
+ const m = [
7
+ "title",
8
+ "subtitle",
9
+ "image",
10
+ "button",
11
+ "id",
12
+ "background_color"
13
+ ], w = {
7
14
  title: r.TITLE,
8
15
  subtitle: r.DESCRIPTION,
9
16
  image: r.FILE,
10
- button: m
11
- }, c = ({ title: l, subtitle: p, image: i, button: e }) => /* @__PURE__ */ s("div", { className: "w-full flex flex-col rounded-[20px] overflow-hidden", children: [
12
- /* @__PURE__ */ a("div", { className: "relative w-full h-[256px] max-tablet:h-[224px]", children: /* @__PURE__ */ a(
13
- o,
17
+ button: d,
18
+ background_color: r.COLOR
19
+ }, t = ({
20
+ title: l,
21
+ subtitle: o,
22
+ image: s,
23
+ button: e,
24
+ background_color: i
25
+ }) => /* @__PURE__ */ p("div", { className: "w-full flex flex-col rounded-[20px] overflow-hidden", children: [
26
+ /* @__PURE__ */ a(
27
+ "div",
14
28
  {
15
- src: i,
16
- alt: l,
17
- className: "w-full h-full",
18
- imageStyles: "object-cover"
29
+ style: { background: i },
30
+ className: "relative w-full h-[256px] max-tablet:h-[224px]",
31
+ children: /* @__PURE__ */ a(
32
+ x,
33
+ {
34
+ src: s,
35
+ alt: l,
36
+ className: "w-full h-full",
37
+ imageStyles: "object-contain"
38
+ }
39
+ )
19
40
  }
20
- ) }),
21
- /* @__PURE__ */ s("div", { className: "bg-white p-[32px] max-tablet:px-[24px] max-tablet:py-[32px] flex flex-col gap-[8px] h-full", children: [
41
+ ),
42
+ /* @__PURE__ */ p("div", { className: "bg-white p-[32px] max-tablet:px-[24px] max-tablet:py-[32px] flex flex-col gap-[8px] h-full", children: [
22
43
  (l == null ? void 0 : l.length) && /* @__PURE__ */ a("p", { className: "text-[24px] leading-[32px] font-bold", children: l }),
23
- p && /* @__PURE__ */ a("p", { className: "text-[14px] leading-[20px] text-graySoft", children: p }),
24
- ((e == null ? void 0 : e.title) || (e == null ? void 0 : e.children)) && /* @__PURE__ */ a(x, { ...e })
44
+ o && /* @__PURE__ */ a("p", { className: "text-[14px] leading-[20px] text-graySoft", children: o }),
45
+ ((e == null ? void 0 : e.title) || (e == null ? void 0 : e.children)) && /* @__PURE__ */ a(c, { ...e })
25
46
  ] })
26
47
  ] });
27
- c.propsToEdit = d;
48
+ t.propsToEdit = m;
28
49
  export {
29
- c as PreviewCard,
30
- v as PreviewCardData
50
+ t as PreviewCard,
51
+ w as PreviewCardData
31
52
  };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "md-components-mdigial-azamat",
3
3
  "author": "Azamat Raimbekov",
4
4
  "private": false,
5
- "version": "0.0.73",
5
+ "version": "0.0.76",
6
6
  "type": "module",
7
7
  "main": "dist/main.js",
8
8
  "types": "dist/main.d.ts",