@mp-front/components 0.0.1-next-1 → 0.0.1-next-3

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.
Files changed (78) hide show
  1. package/dist/components/grid/col/col.component.d.ts +4 -0
  2. package/dist/components/grid/col/col.component.d.ts.map +1 -0
  3. package/dist/components/grid/col/index.d.ts +2 -0
  4. package/dist/components/grid/col/index.d.ts.map +1 -0
  5. package/dist/components/grid/grid.stories.d.ts +52 -0
  6. package/dist/components/grid/grid.stories.d.ts.map +1 -0
  7. package/dist/components/grid/grid.test.d.ts +2 -0
  8. package/dist/components/grid/grid.test.d.ts.map +1 -0
  9. package/dist/components/grid/grid.types.d.ts +33 -0
  10. package/dist/components/grid/grid.types.d.ts.map +1 -0
  11. package/dist/components/grid/index.d.ts +3 -0
  12. package/dist/components/grid/index.d.ts.map +1 -0
  13. package/dist/components/grid/row/index.d.ts +2 -0
  14. package/dist/components/grid/row/index.d.ts.map +1 -0
  15. package/dist/components/grid/row/row.component.d.ts +4 -0
  16. package/dist/components/grid/row/row.component.d.ts.map +1 -0
  17. package/dist/components/index.d.ts +3 -0
  18. package/dist/components/index.d.ts.map +1 -1
  19. package/dist/components/tabs/index.d.ts +3 -0
  20. package/dist/components/tabs/index.d.ts.map +1 -0
  21. package/dist/components/tabs/tabs.component.d.ts +4 -0
  22. package/dist/components/tabs/tabs.component.d.ts.map +1 -0
  23. package/dist/components/tabs/tabs.stories.d.ts +8 -0
  24. package/dist/components/tabs/tabs.stories.d.ts.map +1 -0
  25. package/dist/components/tabs/tabs.styles.d.ts +15 -0
  26. package/dist/components/tabs/tabs.styles.d.ts.map +1 -0
  27. package/dist/components/tabs/tabs.test.d.ts +2 -0
  28. package/dist/components/tabs/tabs.test.d.ts.map +1 -0
  29. package/dist/components/tabs/tabs.types.d.ts +19 -0
  30. package/dist/components/tabs/tabs.types.d.ts.map +1 -0
  31. package/dist/components/tabs/tabs.utils.d.ts +6 -0
  32. package/dist/components/tabs/tabs.utils.d.ts.map +1 -0
  33. package/dist/components/tabs/tabsContent.d.ts +10 -0
  34. package/dist/components/tabs/tabsContent.d.ts.map +1 -0
  35. package/dist/components/tabs/tabsList.d.ts +11 -0
  36. package/dist/components/tabs/tabsList.d.ts.map +1 -0
  37. package/dist/index-BP9HuXkV.cjs +31 -0
  38. package/dist/index-C0ENqrRs.js +570 -0
  39. package/dist/layout/content.component.d.ts +19 -0
  40. package/dist/layout/content.component.d.ts.map +1 -0
  41. package/dist/layout/footer.component.d.ts +17 -0
  42. package/dist/layout/footer.component.d.ts.map +1 -0
  43. package/dist/layout/header/header.component.d.ts +33 -0
  44. package/dist/layout/header/header.component.d.ts.map +1 -0
  45. package/dist/layout/header/header.types.d.ts +30 -0
  46. package/dist/layout/header/header.types.d.ts.map +1 -0
  47. package/dist/layout/header/left-side.component.d.ts +19 -0
  48. package/dist/layout/header/left-side.component.d.ts.map +1 -0
  49. package/dist/layout/header/right-side.component.d.ts +27 -0
  50. package/dist/layout/header/right-side.component.d.ts.map +1 -0
  51. package/dist/layout/header/store.component.d.ts +20 -0
  52. package/dist/layout/header/store.component.d.ts.map +1 -0
  53. package/dist/layout/header/user.component.d.ts +27 -0
  54. package/dist/layout/header/user.component.d.ts.map +1 -0
  55. package/dist/layout/index.d.ts +2 -0
  56. package/dist/layout/index.d.ts.map +1 -0
  57. package/dist/layout/root-layout.component.d.ts +46 -0
  58. package/dist/layout/root-layout.component.d.ts.map +1 -0
  59. package/dist/layout/root-layout.stories.d.ts +12 -0
  60. package/dist/layout/root-layout.stories.d.ts.map +1 -0
  61. package/dist/layout/root-layout.test.d.ts +2 -0
  62. package/dist/layout/root-layout.test.d.ts.map +1 -0
  63. package/dist/layout/root-layout.types.d.ts +10 -0
  64. package/dist/layout/root-layout.types.d.ts.map +1 -0
  65. package/dist/styles.css +1 -1
  66. package/dist/ui-components-hooks.cjs +1 -1
  67. package/dist/ui-components-hooks.js +29 -170
  68. package/dist/ui-components-index.cjs +35 -65
  69. package/dist/ui-components-index.js +6417 -6683
  70. package/dist/ui-components-layout.cjs +135 -0
  71. package/dist/ui-components-layout.js +19938 -0
  72. package/dist/useTranslation-Cenukg7h.js +147 -0
  73. package/dist/useTranslation-CnSCmJou.cjs +1 -0
  74. package/package.json +6 -18
  75. package/dist/constants/tailwind-config/index.d.ts +0 -3
  76. package/dist/constants/tailwind-config/index.d.ts.map +0 -1
  77. package/dist/ui-components-tailwind.cjs +0 -1
  78. package/dist/ui-components-tailwind.js +0 -9
@@ -1,177 +1,36 @@
1
- import { a as le, u as de } from "./use-controlled-state-FlR7N58L.js";
2
- import { useState as x, useEffect as h, createContext as j, useContext as H, useRef as R, useCallback as _ } from "react";
3
- const ae = () => {
4
- const e = typeof window < "u" ? localStorage.getItem("theme") === "dark" : "light", [t, n] = x(e);
5
- return h(() => {
6
- t ? (document.documentElement.classList.add("dark"), localStorage.setItem("theme", "dark")) : (document.documentElement.classList.remove("dark"), localStorage.setItem("theme", "light"));
7
- }, [t]), { darkMode: t, setDarkMode: n };
8
- }, B = (e, t, n, a) => {
9
- var s, u, N, p;
10
- const o = [n, {
11
- code: t,
12
- ...a || {}
13
- }];
14
- if ((u = (s = e == null ? void 0 : e.services) == null ? void 0 : s.logger) != null && u.forward)
15
- return e.services.logger.forward(o, "warn", "react-i18next::", !0);
16
- m(o[0]) && (o[0] = `react-i18next:: ${o[0]}`), (p = (N = e == null ? void 0 : e.services) == null ? void 0 : N.logger) != null && p.warn ? e.services.logger.warn(...o) : console != null && console.warn && console.warn(...o);
17
- }, z = {}, L = (e, t, n, a) => {
18
- m(n) && z[n] || (m(n) && (z[n] = /* @__PURE__ */ new Date()), B(e, t, n, a));
19
- }, A = (e, t) => () => {
20
- if (e.isInitialized)
21
- t();
22
- else {
23
- const n = () => {
24
- setTimeout(() => {
25
- e.off("initialized", n);
26
- }, 0), t();
27
- };
28
- e.on("initialized", n);
29
- }
30
- }, T = (e, t, n) => {
31
- e.loadNamespaces(t, A(e, n));
32
- }, F = (e, t, n, a) => {
33
- if (m(n) && (n = [n]), e.options.preload && e.options.preload.indexOf(t) > -1) return T(e, n, a);
34
- n.forEach((o) => {
35
- e.options.ns.indexOf(o) < 0 && e.options.ns.push(o);
36
- }), e.loadLanguages(t, A(e, a));
37
- }, D = (e, t, n = {}) => !t.languages || !t.languages.length ? (L(t, "NO_LANGUAGES", "i18n.languages were undefined or empty", {
38
- languages: t.languages
39
- }), !0) : t.hasLoadedNamespace(e, {
40
- lng: n.lng,
41
- precheck: (a, o) => {
42
- var s;
43
- if (((s = n.bindI18n) == null ? void 0 : s.indexOf("languageChanging")) > -1 && a.services.backendConnector.backend && a.isLanguageChangingTo && !o(a.isLanguageChangingTo, e)) return !1;
44
- }
45
- }), m = (e) => typeof e == "string", G = (e) => typeof e == "object" && e !== null, W = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g, $ = {
46
- "&amp;": "&",
47
- "&#38;": "&",
48
- "&lt;": "<",
49
- "&#60;": "<",
50
- "&gt;": ">",
51
- "&#62;": ">",
52
- "&apos;": "'",
53
- "&#39;": "'",
54
- "&quot;": '"',
55
- "&#34;": '"',
56
- "&nbsp;": " ",
57
- "&#160;": " ",
58
- "&copy;": "©",
59
- "&#169;": "©",
60
- "&reg;": "®",
61
- "&#174;": "®",
62
- "&hellip;": "…",
63
- "&#8230;": "…",
64
- "&#x2F;": "/",
65
- "&#47;": "/"
66
- }, q = (e) => $[e], J = (e) => e.replace(W, q);
67
- let K = {
68
- bindI18n: "languageChanged",
69
- bindI18nStore: "",
70
- transEmptyNodeValue: "",
71
- transSupportBasicHtmlNodes: !0,
72
- transWrapTextNodes: "",
73
- transKeepBasicHtmlNodesFor: ["br", "strong", "i", "p"],
74
- useSuspense: !0,
75
- unescape: J
76
- };
77
- const X = () => K;
78
- let Y;
79
- const Q = () => Y, Z = j();
80
- class V {
81
- constructor() {
82
- this.usedNamespaces = {};
83
- }
84
- addUsedNamespaces(t) {
85
- t.forEach((n) => {
86
- this.usedNamespaces[n] || (this.usedNamespaces[n] = !0);
87
- });
88
- }
89
- getUsedNamespaces() {
90
- return Object.keys(this.usedNamespaces);
91
- }
92
- }
93
- const ee = (e, t) => {
94
- const n = R();
95
- return h(() => {
96
- n.current = e;
97
- }, [e, t]), n.current;
98
- }, P = (e, t, n, a) => e.getFixedT(t, n, a), te = (e, t, n, a) => _(P(e, t, n, a), [e, t, n, a]), ne = (e, t = {}) => {
99
- var v, k, O, M;
100
- const {
101
- i18n: n
102
- } = t, {
103
- i18n: a,
104
- defaultNS: o
105
- } = H(Z) || {}, s = n || a || Q();
106
- if (s && !s.reportNamespaces && (s.reportNamespaces = new V()), !s) {
107
- L(s, "NO_I18NEXT_INSTANCE", "useTranslation: You will need to pass in an i18next instance by using initReactI18next");
108
- const i = (l, d) => m(d) ? d : G(d) && m(d.defaultValue) ? d.defaultValue : Array.isArray(l) ? l[l.length - 1] : l, c = [i, {}, !1];
109
- return c.t = i, c.i18n = {}, c.ready = !1, c;
110
- }
111
- (v = s.options.react) != null && v.wait && L(s, "DEPRECATED_OPTION", "useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");
112
- const u = {
113
- ...X(),
114
- ...s.options.react,
115
- ...t
116
- }, {
117
- useSuspense: N,
118
- keyPrefix: p
119
- } = u;
120
- let r = e || o || ((k = s.options) == null ? void 0 : k.defaultNS);
121
- r = m(r) ? [r] : r || ["translation"], (M = (O = s.reportNamespaces).addUsedNamespaces) == null || M.call(O, r);
122
- const g = (s.isInitialized || s.initializedStoreOnce) && r.every((i) => D(i, s, u)), U = te(s, t.lng || null, u.nsMode === "fallback" ? r : r[0], p), b = () => U, E = () => P(s, t.lng || null, u.nsMode === "fallback" ? r : r[0], p), [I, w] = x(b);
123
- let y = r.join();
124
- t.lng && (y = `${t.lng}${y}`);
125
- const C = ee(y), f = R(!0);
126
- h(() => {
127
- const {
128
- bindI18n: i,
129
- bindI18nStore: c
130
- } = u;
131
- f.current = !0, !g && !N && (t.lng ? F(s, t.lng, r, () => {
132
- f.current && w(E);
133
- }) : T(s, r, () => {
134
- f.current && w(E);
135
- })), g && C && C !== y && f.current && w(E);
136
- const l = () => {
137
- f.current && w(E);
138
- };
139
- return i && (s == null || s.on(i, l)), c && (s == null || s.store.on(c, l)), () => {
140
- f.current = !1, s && (i == null || i.split(" ").forEach((d) => s.off(d, l))), c && s && c.split(" ").forEach((d) => s.store.off(d, l));
141
- };
142
- }, [s, y]), h(() => {
143
- f.current && g && w(b);
144
- }, [s, p, g]);
145
- const S = [I, s, g];
146
- if (S.t = I, S.i18n = s, S.ready = g, g || !g && !N) return S;
147
- throw new Promise((i) => {
148
- t.lng ? F(s, t.lng, r, () => i()) : T(s, r, () => i());
149
- });
150
- }, oe = () => {
1
+ import { a as L, u as w } from "./use-controlled-state-FlR7N58L.js";
2
+ import { useState as s, useEffect as n } from "react";
3
+ import { u as d } from "./useTranslation-Cenukg7h.js";
4
+ const c = () => {
5
+ const o = typeof window < "u" ? localStorage.getItem("theme") === "dark" : "light", [e, a] = s(o);
6
+ return n(() => {
7
+ e ? (document.documentElement.classList.add("dark"), localStorage.setItem("theme", "dark")) : (document.documentElement.classList.remove("dark"), localStorage.setItem("theme", "light"));
8
+ }, [e]), { darkMode: e, setDarkMode: a };
9
+ }, u = () => {
151
10
  const {
152
- i18n: { changeLanguage: e, language: t }
153
- } = ne(), n = (a) => {
154
- e(a), localStorage.setItem("lang", a);
11
+ i18n: { changeLanguage: o, language: e }
12
+ } = d(), a = (t) => {
13
+ o(t), localStorage.setItem("lang", t);
155
14
  };
156
- return h(() => {
157
- const a = localStorage.getItem("lang");
158
- e(a || t);
159
- }, []), { language: t, setLang: n };
160
- }, re = (e) => {
161
- const [t, n] = x(!1);
162
- return h(() => {
163
- if (e) {
164
- const a = () => n(!1), o = () => n(!0);
165
- return window.addEventListener("load", a), window.addEventListener("beforeunload", o), () => {
166
- window.removeEventListener("load", a), window.removeEventListener("beforeunload", o);
15
+ return n(() => {
16
+ const t = localStorage.getItem("lang");
17
+ o(t || e);
18
+ }, []), { language: e, setLang: a };
19
+ }, g = (o) => {
20
+ const [e, a] = s(!1);
21
+ return n(() => {
22
+ if (o) {
23
+ const t = () => a(!1), r = () => a(!0);
24
+ return window.addEventListener("load", t), window.addEventListener("beforeunload", r), () => {
25
+ window.removeEventListener("load", t), window.removeEventListener("beforeunload", r);
167
26
  };
168
27
  }
169
- }, []), t;
28
+ }, []), e;
170
29
  };
171
30
  export {
172
- le as useBreakpoint,
173
- de as useControlledState,
174
- ae as useDarkMode,
175
- oe as useLang,
176
- re as useWindowLoading
31
+ L as useBreakpoint,
32
+ w as useControlledState,
33
+ c as useDarkMode,
34
+ u as useLang,
35
+ g as useWindowLoading
177
36
  };