@variamosple/variamos-components 0.0.23 → 0.1.0

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 (34) 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/BugFormModal.d.ts +14 -0
  6. package/dist/Components/Header/BugFormModal.js +100 -0
  7. package/dist/Components/Header/HeaderOptions.js +85 -31
  8. package/dist/Components/Header/MenuItem.js +19 -20
  9. package/dist/Components/Header/SubHeader.js +35 -9
  10. package/dist/Components/Header/index.js +24 -25
  11. package/dist/Components/NotAuthorized/index.js +10 -11
  12. package/dist/Components/Paginator/index.js +56 -128
  13. package/dist/Components/ProtectedRoute/index.js +10 -10
  14. package/dist/Context/AnalyticsContext.js +7 -7
  15. package/dist/Context/MenuContext.js +16 -16
  16. package/dist/Context/SessionContext.js +35 -35
  17. package/dist/HOC/WithPageVisit.d.ts +1 -1
  18. package/dist/HOC/WithPageVisit.js +6 -6
  19. package/dist/assets/index.css +1 -1
  20. package/package.json +10 -7
  21. package/dist/AbstractModalHeader-UzCRSxIO.js +0 -1690
  22. package/dist/Anchor-DJG5WYYF.js +0 -40
  23. package/dist/Button-DWo2Fl71.js +0 -78
  24. package/dist/Button-GQJKgb76.js +0 -33
  25. package/dist/Container-BLjzOisH.js +0 -22
  26. package/dist/Nav-CdxSljzW.js +0 -144
  27. package/dist/NavDropdown-AuV3RgfC.js +0 -1764
  28. package/dist/NavLink-ebvp1HCw.js +0 -173
  29. package/dist/SubHeader-gTVD9DIX.js +0 -481
  30. package/dist/ThemeProvider-Q3gZ4GF2.js +0 -72
  31. package/dist/jsx-runtime-Drh4NO5G.js +0 -633
  32. package/dist/useEventCallback-Bfo0-hwZ.js +0 -16
  33. package/dist/useMergedRefs-BpAaCckn.js +0 -16
  34. package/dist/useWindow-rGE2GXIv.js +0 -118
@@ -1,34 +1,34 @@
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
8
  d && localStorage.setItem("authToken", d);
9
- }, H = ({
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) => {
18
+ const [E, t] = T(null), [A, c] = T(!0), g = !!E, I = z();
19
+ k(() => {
20
+ c(!0), e().then((o) => {
21
21
  var a, n, i;
22
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 i, r, e;
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((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
  });
@@ -39,28 +39,28 @@ const y = K(void 0), k = "guestId", f = (d) => {
39
39
  }, 6e4);
40
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((a) => a != null && a.errorCode ? a : h().then((n) => {
51
- var i, r, e;
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((e = n == null ? void 0 : n.data) == null ? void 0 : e.redirect)), a;
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
53
  }).catch(() => (t(null), a.withError(500, "Sign in error.")))).finally(() => c(!1));
54
- }, U = () => {
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);
58
+ const o = localStorage.getItem(x);
59
59
  return C(o).then((a) => {
60
60
  var n;
61
- return a != null && a.errorCode ? a : (localStorage.setItem(k, ((n = a == null ? void 0 : a.data) == null ? void 0 : n.id) || ""), h().then((i) => {
62
- var r, e, I;
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(((e = i == null ? void 0 : i.data) == null ? void 0 : e.user) ?? null), f((I = i == null ? void 0 : i.data) == null ? void 0 : I.redirect)), a;
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
64
  }).catch(() => (t(null), a.withError(500, "Sign in error."))));
65
65
  }).finally(() => c(!1));
66
66
  }, q = () => {
@@ -70,28 +70,28 @@ const y = K(void 0), k = "guestId", f = (d) => {
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.23",
4
+ "version": "0.1.0",
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
  }