@variamosple/variamos-components 0.0.22 → 0.0.24

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 (32) hide show
  1. package/dist/Components/AuthWrapper/index.js +18 -38
  2. package/dist/Components/ConfirmationModal/index.d.ts +1 -1
  3. package/dist/Components/ConfirmationModal/index.js +19 -280
  4. package/dist/Components/Footer/index.js +6 -6
  5. package/dist/Components/Header/HeaderOptions.js +16 -16
  6. package/dist/Components/Header/MenuItem.js +19 -20
  7. package/dist/Components/Header/SubHeader.js +35 -9
  8. package/dist/Components/Header/index.js +24 -25
  9. package/dist/Components/NotAuthorized/index.js +10 -11
  10. package/dist/Components/Paginator/index.js +56 -128
  11. package/dist/Components/ProtectedRoute/index.js +10 -10
  12. package/dist/Context/AnalyticsContext.js +7 -7
  13. package/dist/Context/MenuContext.js +16 -16
  14. package/dist/Context/SessionContext.js +44 -44
  15. package/dist/HOC/WithPageVisit.d.ts +1 -1
  16. package/dist/HOC/WithPageVisit.js +6 -6
  17. package/dist/assets/index.css +1 -1
  18. package/package.json +10 -7
  19. package/dist/AbstractModalHeader-UzCRSxIO.js +0 -1690
  20. package/dist/Anchor-DJG5WYYF.js +0 -40
  21. package/dist/Button-DWo2Fl71.js +0 -78
  22. package/dist/Button-GQJKgb76.js +0 -33
  23. package/dist/Container-BLjzOisH.js +0 -22
  24. package/dist/Nav-CdxSljzW.js +0 -144
  25. package/dist/NavDropdown-AuV3RgfC.js +0 -1764
  26. package/dist/NavLink-ebvp1HCw.js +0 -173
  27. package/dist/SubHeader-gTVD9DIX.js +0 -481
  28. package/dist/ThemeProvider-Q3gZ4GF2.js +0 -72
  29. package/dist/jsx-runtime-Drh4NO5G.js +0 -633
  30. package/dist/useEventCallback-Bfo0-hwZ.js +0 -16
  31. package/dist/useMergedRefs-BpAaCckn.js +0 -16
  32. package/dist/useWindow-rGE2GXIv.js +0 -118
@@ -1,18 +1,17 @@
1
- import { j as t } from "../../jsx-runtime-Drh4NO5G.js";
1
+ import { jsxs as o, jsx as t } from "react/jsx-runtime";
2
+ import { Container as i, Button as n } from "react-bootstrap";
2
3
  import "../../Context/AnalyticsContext.js";
3
4
  import "../../Context/MenuContext.js";
4
- import { useRouter as o } from "../../Context/RouterContext.js";
5
+ import { useRouter as a } from "../../Context/RouterContext.js";
5
6
  import "../../Context/SessionContext.js";
6
- import { C as s } from "../../Container-BLjzOisH.js";
7
- import { B as i } from "../../Button-GQJKgb76.js";
8
- const d = ({ homePath: e }) => {
9
- const { navigate: r } = o();
10
- return /* @__PURE__ */ t.jsxs(s, { className: "d-flex flex-column justify-content-center align-items-center vh-100 text-center", children: [
11
- /* @__PURE__ */ t.jsx("h1", { className: "display-1 fw-bold text-danger", children: "403" }),
12
- /* @__PURE__ */ t.jsx("p", { className: "fs-4 text-muted", children: "You are not authorized to access this page." }),
13
- /* @__PURE__ */ t.jsx(i, { variant: "primary", onClick: () => r(e), children: "Go Home" })
7
+ const u = ({ homePath: e }) => {
8
+ const { navigate: r } = a();
9
+ return /* @__PURE__ */ o(i, { className: "d-flex flex-column justify-content-center align-items-center vh-100 text-center", children: [
10
+ /* @__PURE__ */ t("h1", { className: "display-1 fw-bold text-danger", children: "403" }),
11
+ /* @__PURE__ */ t("p", { className: "fs-4 text-muted", children: "You are not authorized to access this page." }),
12
+ /* @__PURE__ */ t(n, { variant: "primary", onClick: () => r(e), children: "Go Home" })
14
13
  ] });
15
14
  };
16
15
  export {
17
- d as NotAuthorized
16
+ u as NotAuthorized
18
17
  };
@@ -1,156 +1,84 @@
1
- import { j as l } from "../../jsx-runtime-Drh4NO5G.js";
2
- import * as p from "react";
3
- import { useMemo as y } from "react";
4
- import { c as x, u as I } from "../../ThemeProvider-Q3gZ4GF2.js";
5
- import { A as v } from "../../Anchor-DJG5WYYF.js";
6
- const j = /* @__PURE__ */ p.forwardRef(({
7
- active: i = !1,
8
- disabled: s = !1,
9
- className: r,
10
- style: e,
11
- activeLabel: n = "(current)",
12
- children: o,
13
- linkStyle: d,
14
- linkClassName: N,
15
- as: u = v,
16
- ...a
17
- }, M) => {
18
- const k = i || s ? "span" : u;
19
- return /* @__PURE__ */ l.jsx("li", {
20
- ref: M,
21
- style: e,
22
- className: x(r, "page-item", {
23
- active: i,
24
- disabled: s
25
- }),
26
- children: /* @__PURE__ */ l.jsxs(k, {
27
- className: x("page-link", N),
28
- style: d,
29
- ...a,
30
- children: [o, i && n && /* @__PURE__ */ l.jsx("span", {
31
- className: "visually-hidden",
32
- children: n
33
- })]
34
- })
35
- });
36
- });
37
- j.displayName = "PageItem";
38
- function t(i, s, r = i) {
39
- const e = /* @__PURE__ */ p.forwardRef(({
40
- children: n,
41
- ...o
42
- }, d) => /* @__PURE__ */ l.jsxs(j, {
43
- ...o,
44
- ref: d,
45
- children: [/* @__PURE__ */ l.jsx("span", {
46
- "aria-hidden": "true",
47
- children: n || s
48
- }), /* @__PURE__ */ l.jsx("span", {
49
- className: "visually-hidden",
50
- children: r
51
- })]
52
- }));
53
- return e.displayName = i, e;
54
- }
55
- const E = t("First", "«"), R = t("Prev", "‹", "Previous"), B = t("Ellipsis", "…", "More"), b = t("Next", "›"), w = t("Last", "»"), h = /* @__PURE__ */ p.forwardRef(({
56
- bsPrefix: i,
57
- className: s,
58
- size: r,
59
- ...e
60
- }, n) => {
61
- const o = I(i, "pagination");
62
- return /* @__PURE__ */ l.jsx("ul", {
63
- ref: n,
64
- ...e,
65
- className: x(s, o, r && `${o}-${r}`)
66
- });
67
- });
68
- h.displayName = "Pagination";
69
- const c = Object.assign(h, {
70
- First: E,
71
- Prev: R,
72
- Ellipsis: B,
73
- Item: j,
74
- Next: b,
75
- Last: w
76
- }), f = (i, s) => {
77
- const r = [];
78
- for (let e = i; e <= s; e++)
79
- r.push(e);
80
- return r;
81
- }, m = 5, L = ({
82
- currentPage: i,
83
- totalPages: s,
84
- onPageChange: r
1
+ import { jsxs as k, jsx as s } from "react/jsx-runtime";
2
+ import { useMemo as p } from "react";
3
+ import { Pagination as f } from "react-bootstrap";
4
+ const n = (m, i) => {
5
+ const l = [];
6
+ for (let c = m; c <= i; c++)
7
+ l.push(c);
8
+ return l;
9
+ }, M = 5, v = ({
10
+ currentPage: m,
11
+ totalPages: i,
12
+ onPageChange: l
85
13
  }) => {
86
- const e = y(() => {
87
- if (i === 1 && s === 1)
14
+ const c = p(() => {
15
+ if (m === 1 && i === 1)
88
16
  return [];
89
- if (i === 1)
90
- return f(2, Math.min(s - 1, m + 1));
91
- if (s - m <= 0)
92
- return f(2, s - 1);
93
- let n, o;
94
- return i <= Math.ceil(m / 2) ? (n = 2, o = Math.min(m + 1, s - 1)) : i + Math.floor(m / 2) >= s ? (n = Math.max(s - m, 2), o = s - 1) : (n = i - Math.floor(m / 2), o = i + Math.floor(m / 2)), o = Math.min(o, s - 1), n = Math.max(n, 2), f(n, o);
95
- }, [i, s]);
96
- return /* @__PURE__ */ l.jsxs(c, { className: "d-flex justify-content-end", children: [
97
- /* @__PURE__ */ l.jsx(
98
- c.First,
17
+ if (m === 1)
18
+ return n(2, Math.min(i - 1, M + 1));
19
+ if (i - M <= 0)
20
+ return n(2, i - 1);
21
+ let d, h;
22
+ return m <= Math.ceil(M / 2) ? (d = 2, h = Math.min(M + 1, i - 1)) : m + Math.floor(M / 2) >= i ? (d = Math.max(i - M, 2), h = i - 1) : (d = m - Math.floor(M / 2), h = m + Math.floor(M / 2)), h = Math.min(h, i - 1), d = Math.max(d, 2), n(d, h);
23
+ }, [m, i]);
24
+ return /* @__PURE__ */ k(f, { className: "d-flex justify-content-end", children: [
25
+ /* @__PURE__ */ s(
26
+ f.First,
99
27
  {
100
- onClick: () => r(1),
101
- disabled: i === 1
28
+ onClick: () => l(1),
29
+ disabled: m === 1
102
30
  }
103
31
  ),
104
- /* @__PURE__ */ l.jsx(
105
- c.Prev,
32
+ /* @__PURE__ */ s(
33
+ f.Prev,
106
34
  {
107
- onClick: () => r(i - 1),
108
- disabled: i === 1
35
+ onClick: () => l(m - 1),
36
+ disabled: m === 1
109
37
  }
110
38
  ),
111
- /* @__PURE__ */ l.jsx(
112
- c.Item,
39
+ /* @__PURE__ */ s(
40
+ f.Item,
113
41
  {
114
- active: i === 1,
115
- onClick: () => r(1),
42
+ active: m === 1,
43
+ onClick: () => l(1),
116
44
  children: "1"
117
45
  }
118
46
  ),
119
- s > 2 && !e.includes(2) && /* @__PURE__ */ l.jsx(c.Ellipsis, {}),
120
- e.map((n) => /* @__PURE__ */ l.jsx(
121
- c.Item,
47
+ i > 2 && !c.includes(2) && /* @__PURE__ */ s(f.Ellipsis, {}),
48
+ c.map((d) => /* @__PURE__ */ s(
49
+ f.Item,
122
50
  {
123
- active: i === n,
124
- onClick: () => r(n),
125
- children: n
51
+ active: m === d,
52
+ onClick: () => l(d),
53
+ children: d
126
54
  },
127
- n
55
+ d
128
56
  )),
129
- s > m && !e.includes(s - 1) && /* @__PURE__ */ l.jsx(c.Ellipsis, {}),
130
- s > 1 && /* @__PURE__ */ l.jsx(
131
- c.Item,
57
+ i > M && !c.includes(i - 1) && /* @__PURE__ */ s(f.Ellipsis, {}),
58
+ i > 1 && /* @__PURE__ */ s(
59
+ f.Item,
132
60
  {
133
- active: i === s,
134
- onClick: () => r(s),
135
- children: s
61
+ active: m === i,
62
+ onClick: () => l(i),
63
+ children: i
136
64
  }
137
65
  ),
138
- /* @__PURE__ */ l.jsx(
139
- c.Next,
66
+ /* @__PURE__ */ s(
67
+ f.Next,
140
68
  {
141
- onClick: () => r(i + 1),
142
- disabled: i === s
69
+ onClick: () => l(m + 1),
70
+ disabled: m === i
143
71
  }
144
72
  ),
145
- /* @__PURE__ */ l.jsx(
146
- c.Last,
73
+ /* @__PURE__ */ s(
74
+ f.Last,
147
75
  {
148
- onClick: () => r(s),
149
- disabled: i === s
76
+ onClick: () => l(i),
77
+ disabled: m === i
150
78
  }
151
79
  )
152
80
  ] });
153
81
  };
154
82
  export {
155
- L as Paginator
83
+ v as Paginator
156
84
  };
@@ -1,20 +1,20 @@
1
- import { j as p } from "../../jsx-runtime-Drh4NO5G.js";
2
- import { useEffect as f } from "react";
1
+ import { jsx as f, Fragment as u } from "react/jsx-runtime";
2
+ import { useEffect as g } from "react";
3
3
  import "../../Context/AnalyticsContext.js";
4
4
  import "../../Context/MenuContext.js";
5
- import { useRouter as g } from "../../Context/RouterContext.js";
6
- import { useSession as x } from "../../Context/SessionContext.js";
7
- const v = ({
5
+ import { useRouter as h } from "../../Context/RouterContext.js";
6
+ import { useSession as d } from "../../Context/SessionContext.js";
7
+ const F = ({
8
8
  notAuthorizedPath: e,
9
9
  allowedPermissions: i = [],
10
10
  children: c
11
11
  }) => {
12
12
  var m;
13
- const { isAuthenticated: n, isLoading: r, user: t } = x(), { navigate: s } = g();
14
- return f(() => {
13
+ const { isAuthenticated: n, isLoading: r, user: t } = d(), { navigate: s } = h();
14
+ return g(() => {
15
15
  if (!r && n) {
16
16
  const o = (t == null ? void 0 : t.permissions) || [];
17
- !i.length || o.some((u) => i.includes(u)) || s(e);
17
+ !i.length || o.some((p) => i.includes(p)) || s(e);
18
18
  }
19
19
  }, [
20
20
  r,
@@ -25,8 +25,8 @@ const v = ({
25
25
  i
26
26
  ]), i.length > 0 && !((m = t == null ? void 0 : t.permissions) != null && m.some(
27
27
  (o) => i.includes(o)
28
- )) ? null : /* @__PURE__ */ p.jsx(p.Fragment, { children: c });
28
+ )) ? null : /* @__PURE__ */ f(u, { children: c });
29
29
  };
30
30
  export {
31
- v as ProtectedRoute
31
+ F as ProtectedRoute
32
32
  };
@@ -1,23 +1,23 @@
1
- import { j as n } from "../jsx-runtime-Drh4NO5G.js";
2
- import { createContext as a, useEffect as r } from "react";
3
- import { Events as c } from "../Common/Events.js";
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import { createContext as c, useEffect as r } from "react";
3
+ import { Events as a } from "../Common/Events.js";
4
4
  import { useDebouncedValue as m } from "../Hooks/useDebouncedValue.js";
5
- const u = a({}), p = "page-visit", E = ({
5
+ const u = c({}), d = "page-visit", E = ({
6
6
  onVisit: t,
7
7
  children: s
8
8
  }) => {
9
9
  const [e, o] = m(null, 1e4);
10
10
  return r(() => {
11
- c.subscribe(p, (i) => {
11
+ a.subscribe(d, (i) => {
12
12
  o(i.detail.id);
13
13
  });
14
14
  }, [o]), r(() => {
15
15
  e && t(e).then(() => {
16
16
  });
17
- }, [e, t]), /* @__PURE__ */ n.jsx(u.Provider, { value: {}, children: s });
17
+ }, [e, t]), /* @__PURE__ */ n(u.Provider, { value: {}, children: s });
18
18
  };
19
19
  export {
20
20
  u as AnalyticsContext,
21
21
  E as AnalyticsProvider,
22
- p as PAGE_VISIT_EVENT
22
+ d as PAGE_VISIT_EVENT
23
23
  };
@@ -1,55 +1,55 @@
1
- import { j as F } from "../jsx-runtime-Drh4NO5G.js";
2
- import { createContext as j, useMemo as d, useEffect as E, useContext as L } from "react";
3
- import { useQuery as S } from "../Hooks/useQuery.js";
4
- import { useRouter as y } from "./RouterContext.js";
5
- import { useSession as m } from "./SessionContext.js";
6
- const P = j({
1
+ import { jsx as R } from "react/jsx-runtime";
2
+ import { createContext as L, useMemo as d, useEffect as S, useContext as y } from "react";
3
+ import { useQuery as E } from "../Hooks/useQuery.js";
4
+ import { useRouter as j } from "./RouterContext.js";
5
+ import { useSession as q } from "./SessionContext.js";
6
+ const P = L({
7
7
  items: [],
8
8
  isLoading: !0
9
9
  }), A = ({
10
10
  requestMenu: e,
11
11
  children: h
12
12
  }) => {
13
- const { user: r } = m(), { basePath: l } = y(), {
13
+ const { user: r } = q(), { basePath: l } = j(), {
14
14
  data: o,
15
15
  loadData: f,
16
16
  isLoading: n,
17
17
  isLoaded: p
18
- } = S({
18
+ } = E({
19
19
  queryFunction: e
20
20
  }), g = d(() => {
21
21
  var w;
22
22
  const i = (r == null ? void 0 : r.permissions) || [], c = (r == null ? void 0 : r.roles) || [];
23
23
  return (w = o == null ? void 0 : o.items) != null && w.length ? o.items.filter((s) => {
24
- var x, v;
25
- if (!((x = s == null ? void 0 : s.allowedPermissions) != null && x.length) && !((v = s == null ? void 0 : s.allowedRoles) != null && v.length))
24
+ var v, x;
25
+ if (!((v = s == null ? void 0 : s.allowedPermissions) != null && v.length) && !((x = s == null ? void 0 : s.allowedRoles) != null && x.length))
26
26
  return !0;
27
27
  let t = !0;
28
28
  return s.allowedRoles && (t = t && s.allowedRoles.some((a) => c.includes(a))), s.allowedPermissions && (t = t && s.allowedPermissions.some(
29
29
  (a) => i.includes(a)
30
30
  )), t;
31
31
  }) : [];
32
- }, [o == null ? void 0 : o.items, r]), R = d(() => {
32
+ }, [o == null ? void 0 : o.items, r]), C = d(() => {
33
33
  if (!(o != null && o.subMenu))
34
34
  return;
35
35
  const i = o == null ? void 0 : o.subMenu.find(
36
36
  (c) => l === c.accessibleFrom
37
37
  );
38
38
  return (i == null ? void 0 : i.items) || void 0;
39
- }, [o == null ? void 0 : o.subMenu, l]), C = d(() => o != null && o.options ? o == null ? void 0 : o.options.filter(
39
+ }, [o == null ? void 0 : o.subMenu, l]), F = d(() => o != null && o.options ? o == null ? void 0 : o.options.filter(
40
40
  (i) => !i.accessibleFrom || l === i.accessibleFrom
41
41
  ) : [], [o == null ? void 0 : o.options, l]);
42
- return E(() => {
42
+ return S(() => {
43
43
  !n && !p && f({});
44
- }, [n, p, f]), /* @__PURE__ */ F.jsx(
44
+ }, [n, p, f]), /* @__PURE__ */ R(
45
45
  P.Provider,
46
46
  {
47
- value: { items: g, subMenu: R, options: C, isLoading: n },
47
+ value: { items: g, subMenu: C, options: F, isLoading: n },
48
48
  children: h
49
49
  }
50
50
  );
51
51
  }, B = () => {
52
- const e = L(P);
52
+ const e = y(P);
53
53
  if (e === void 0)
54
54
  throw new Error("useSession must be used within a SessionProvider");
55
55
  return e;
@@ -1,97 +1,97 @@
1
- import { j as G } from "../jsx-runtime-Drh4NO5G.js";
2
- import { createContext as K, useState as S, useEffect as T, useContext as N } from "react";
3
- import { Events as R } from "../Common/Events.js";
4
- import { usePageVisibility as V } from "../Hooks/usePageVisibility.js";
5
- const y = K(void 0), k = "guestId", f = (d) => {
6
- d && R.publish("variamosNavigate", d);
1
+ import { jsx as G } from "react/jsx-runtime";
2
+ import { createContext as K, useState as T, useEffect as k, useContext as N } from "react";
3
+ import { Events as V } from "../Common/Events.js";
4
+ import { usePageVisibility as z } from "../Hooks/usePageVisibility.js";
5
+ const y = K(void 0), x = "guestId", f = (d) => {
6
+ d && V.publish("variamosNavigate", d);
7
7
  }, m = (d) => {
8
- d && sessionStorage.setItem("authToken", d);
9
- }, H = ({
8
+ d && localStorage.setItem("authToken", d);
9
+ }, J = ({
10
10
  loginUrl: d,
11
- getSessionInfo: h,
11
+ getSessionInfo: e,
12
12
  requestSignUp: v,
13
13
  requestSignIn: w,
14
14
  requestSignInAsGuest: C,
15
15
  requestLogout: P,
16
16
  children: b
17
17
  }) => {
18
- const [E, t] = S(null), [j, c] = S(!0), g = !!E, x = V();
19
- T(() => {
20
- c(!0), h().then((o) => {
21
- var i, n, a;
22
- o != null && o.errorCode ? t(null) : (m((i = o == null ? void 0 : o.data) == null ? void 0 : i.authToken), t(((n = o == null ? void 0 : o.data) == null ? void 0 : n.user) ?? null), f((a = o == null ? void 0 : o.data) == null ? void 0 : a.redirect));
18
+ const [E, t] = T(null), [A, c] = T(!0), g = !!E, I = z();
19
+ k(() => {
20
+ c(!0), e().then((o) => {
21
+ var a, n, i;
22
+ o != null && o.errorCode ? t(null) : (m((a = o == null ? void 0 : o.data) == null ? void 0 : a.authToken), t(((n = o == null ? void 0 : o.data) == null ? void 0 : n.user) ?? null), f((i = o == null ? void 0 : o.data) == null ? void 0 : i.redirect));
23
23
  }).catch(() => {
24
24
  t(null);
25
25
  }).finally(() => c(!1));
26
- }, [h]), T(() => {
27
- if (g && x) {
26
+ }, [e]), k(() => {
27
+ if (g && I) {
28
28
  const o = () => {
29
- h().then((n) => {
30
- var a, r, e;
31
- n != null && n.errorCode ? t(null) : (m((a = n == null ? void 0 : n.data) == null ? void 0 : a.authToken), t(((r = n == null ? void 0 : n.data) == null ? void 0 : r.user) ?? null), f((e = n == null ? void 0 : n.data) == null ? void 0 : e.redirect));
29
+ e().then((n) => {
30
+ var i, r, h;
31
+ n != null && n.errorCode ? t(null) : (m((i = n == null ? void 0 : n.data) == null ? void 0 : i.authToken), t(((r = n == null ? void 0 : n.data) == null ? void 0 : r.user) ?? null), f((h = n == null ? void 0 : n.data) == null ? void 0 : h.redirect));
32
32
  }).catch(() => {
33
33
  t(null);
34
34
  });
35
35
  };
36
36
  o();
37
- const i = setInterval(() => {
37
+ const a = setInterval(() => {
38
38
  o();
39
39
  }, 6e4);
40
- return () => clearInterval(i);
40
+ return () => clearInterval(a);
41
41
  }
42
- }, [g, x, h]);
43
- const A = (o) => {
42
+ }, [g, I, e]);
43
+ const L = (o) => {
44
44
  if (!v)
45
45
  throw new Error("requestSignUp is not defined.");
46
46
  return c(!0), v(o).finally(() => c(!1));
47
- }, L = (o) => {
47
+ }, U = (o) => {
48
48
  if (!w)
49
49
  throw new Error("requestSignIn is not defined.");
50
- return c(!0), w(o).then((i) => i != null && i.errorCode ? i : h().then((n) => {
51
- var a, r, e;
52
- return n != null && n.errorCode ? (t(null), i.withError(n.errorCode, n.message)) : (m((a = n == null ? void 0 : n.data) == null ? void 0 : a.authToken), t(((r = n == null ? void 0 : n.data) == null ? void 0 : r.user) ?? null), f((e = n == null ? void 0 : n.data) == null ? void 0 : e.redirect)), i;
53
- }).catch(() => (t(null), i.withError(500, "Sign in error.")))).finally(() => c(!1));
54
- }, U = () => {
50
+ return c(!0), w(o).then((a) => a != null && a.errorCode ? a : e().then((n) => {
51
+ var i, r, h;
52
+ return n != null && n.errorCode ? (t(null), a.withError(n.errorCode, n.message)) : (m((i = n == null ? void 0 : n.data) == null ? void 0 : i.authToken), t(((r = n == null ? void 0 : n.data) == null ? void 0 : r.user) ?? null), f((h = n == null ? void 0 : n.data) == null ? void 0 : h.redirect)), a;
53
+ }).catch(() => (t(null), a.withError(500, "Sign in error.")))).finally(() => c(!1));
54
+ }, j = () => {
55
55
  if (!C)
56
56
  throw new Error("requestSignInAsGuest is not defined.");
57
57
  c(!0);
58
- const o = localStorage.getItem(k);
59
- return C(o).then((i) => {
58
+ const o = localStorage.getItem(x);
59
+ return C(o).then((a) => {
60
60
  var n;
61
- return i != null && i.errorCode ? i : (localStorage.setItem(k, ((n = i == null ? void 0 : i.data) == null ? void 0 : n.id) || ""), h().then((a) => {
62
- var r, e, I;
63
- return a != null && a.errorCode ? (t(null), i.withError(a.errorCode, a.message)) : (m((r = a == null ? void 0 : a.data) == null ? void 0 : r.authToken), t(((e = a == null ? void 0 : a.data) == null ? void 0 : e.user) ?? null), f((I = a == null ? void 0 : a.data) == null ? void 0 : I.redirect)), i;
64
- }).catch(() => (t(null), i.withError(500, "Sign in error."))));
61
+ return a != null && a.errorCode ? a : (localStorage.setItem(x, ((n = a == null ? void 0 : a.data) == null ? void 0 : n.id) || ""), e().then((i) => {
62
+ var r, h, S;
63
+ return i != null && i.errorCode ? (t(null), a.withError(i.errorCode, i.message)) : (m((r = i == null ? void 0 : i.data) == null ? void 0 : r.authToken), t(((h = i == null ? void 0 : i.data) == null ? void 0 : h.user) ?? null), f((S = i == null ? void 0 : i.data) == null ? void 0 : S.redirect)), a;
64
+ }).catch(() => (t(null), a.withError(500, "Sign in error."))));
65
65
  }).finally(() => c(!1));
66
66
  }, q = () => {
67
67
  P().then(() => {
68
- sessionStorage.removeItem("authToken"), f(d), setTimeout(() => {
68
+ localStorage.removeItem("authToken"), f(d), setTimeout(() => {
69
69
  t(null);
70
70
  }, 200);
71
71
  });
72
72
  };
73
- return /* @__PURE__ */ G.jsx(
73
+ return /* @__PURE__ */ G(
74
74
  y.Provider,
75
75
  {
76
76
  value: {
77
77
  user: E,
78
78
  isAuthenticated: g,
79
79
  logout: q,
80
- signUp: A,
81
- signIn: L,
82
- signInAsGuest: U,
83
- isLoading: j
80
+ signUp: L,
81
+ signIn: U,
82
+ signInAsGuest: j,
83
+ isLoading: A
84
84
  },
85
85
  children: b
86
86
  }
87
87
  );
88
- }, J = () => {
88
+ }, M = () => {
89
89
  const d = N(y);
90
90
  if (d === void 0)
91
91
  throw new Error("useSession must be used within a SessionProvider");
92
92
  return d;
93
93
  };
94
94
  export {
95
- H as SessionProvider,
96
- J as useSession
95
+ J as SessionProvider,
96
+ M as useSession
97
97
  };
@@ -1,2 +1,2 @@
1
1
  import { default as React } from 'react';
2
- export declare function withPageVisit<T extends object>(WrappedComponent: React.ComponentType<T>, id: string): (props: T) => import("react/jsx-runtime").JSX.Element;
2
+ export declare function withPageVisit<T extends object>(WrappedComponent: React.ComponentType<T>, id: string): (props: T) => React.JSX.Element;
@@ -1,11 +1,11 @@
1
- import { j as e } from "../jsx-runtime-Drh4NO5G.js";
2
- import i from "react";
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import e from "react";
3
3
  import { Events as m } from "../Common/Events.js";
4
4
  import { PAGE_VISIT_EVENT as f } from "../Context/AnalyticsContext.js";
5
- function E(t, r) {
6
- return (o) => (i.useEffect(() => {
7
- m.publish(f, { id: r });
8
- }, []), /* @__PURE__ */ e.jsx(t, { ...o }));
5
+ function E(r, t) {
6
+ return (o) => (e.useEffect(() => {
7
+ m.publish(f, { id: t });
8
+ }, []), /* @__PURE__ */ i(r, { ...o }));
9
9
  }
10
10
  export {
11
11
  E as withPageVisit
@@ -1 +1 @@
1
- ._footer_chhcn_1{height:50px;min-height:50px;background-color:var(--dark-color-font);color:#fff;text-align:center;margin-top:auto;display:flex;justify-content:center;align-items:center}
1
+ ._footer_cvhpi_1{height:50px;min-height:50px;background-color:var(--dark-color-font);color:#fff;text-align:center;margin-top:auto;display:flex;justify-content:center;align-items:center}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@variamosple/variamos-components",
3
3
  "private": false,
4
- "version": "0.0.22",
4
+ "version": "0.0.24",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",
7
7
  "types": "dist/main.d.ts",
@@ -19,10 +19,10 @@
19
19
  "prepack": "npm run build"
20
20
  },
21
21
  "peerDependencies": {
22
- "react": "^18.3.1",
22
+ "react": "^18.3.1 || ^19.0.0",
23
23
  "react-bootstrap": "^2.10.9",
24
24
  "react-bootstrap-icons": "^1.11.5",
25
- "react-dom": "^18.3.1"
25
+ "react-dom": "^18.3.1 || ^19.0.0"
26
26
  },
27
27
  "dependencies": {
28
28
  "@variamosple/variamos-components": "file:"
@@ -30,21 +30,24 @@
30
30
  "devDependencies": {
31
31
  "@eslint/js": "^9.19.0",
32
32
  "@types/node": "^22.13.4",
33
- "@types/react": "^18.3.18",
33
+ "@types/react": "^19.2.18",
34
34
  "@types/react-bootstrap": "^0.32.37",
35
- "@types/react-dom": "^18.3.5",
35
+ "@types/react-dom": "^19.2.4",
36
36
  "@vitejs/plugin-react": "^4.3.4",
37
37
  "eslint": "^9.19.0",
38
38
  "eslint-plugin-react-hooks": "^5.0.0",
39
39
  "eslint-plugin-react-refresh": "^0.4.18",
40
40
  "glob": "^11.0.1",
41
41
  "globals": "^15.14.0",
42
- "react": "^18.3.1",
43
- "react-dom": "^18.3.1",
42
+ "react": "^19.2.8",
43
+ "react-dom": "^19.2.8",
44
44
  "typescript": "~5.7.2",
45
45
  "typescript-eslint": "^8.22.0",
46
46
  "vite": "^6.1.0",
47
47
  "vite-plugin-dts": "^4.5.0",
48
48
  "vite-plugin-lib-inject-css": "^2.2.1"
49
+ },
50
+ "allowScripts": {
51
+ "esbuild@0.25.12": true
49
52
  }
50
53
  }