jcicl 0.0.343 → 1.0.1

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,37 +1,40 @@
1
- import { jsx as e, jsxs as m, Fragment as f } from "react/jsx-runtime";
2
- import { useState as C } from "react";
3
- import { n as u } from "../.chunks/emotion-styled.browser.esm.js";
4
- import { c as b } from "../.chunks/emotion-react.browser.esm.js";
5
- import o from "../theme.js";
6
- import w from "../AppContainer/AppContainer.js";
7
- import T from "../WithLoading/WithLoading.js";
8
- import { TopFade as S, BottomFade as P } from "../Overlays/Overlays.js";
9
- import { u as h } from "../.chunks/useMediaQuery.js";
10
- const $ = ["loading", "hasPagination", "loadingColor"], R = u("div", { shouldForwardProp: (r) => !$.includes(r) })(({ loading: r, hasPagination: l, hasFade: s, loadingColor: t = o.colors.green, isTablet: a }) => ({
11
- ...b`
12
- color: ${o.colors.midnight};
13
- height: ${r ? "100%" : "auto"};
1
+ import { jsx as r, jsxs as f, Fragment as F } from "react/jsx-runtime";
2
+ import { useState as b, useMemo as $ } from "react";
3
+ import { n as y } from "../.chunks/emotion-styled.browser.esm.js";
4
+ import { c as T } from "../.chunks/emotion-react.browser.esm.js";
5
+ import t, { defaultTheme as C } from "../theme.js";
6
+ import { getHueFromHex as g, updateTheme as u } from "../themeUtils.js";
7
+ import { ThemeContext as z } from "../ThemeContext.js";
8
+ import O from "../AppContainer/AppContainer.js";
9
+ import A from "../WithLoading/WithLoading.js";
10
+ import { TopFade as L, BottomFade as j } from "../Overlays/Overlays.js";
11
+ import { P as D } from "../.chunks/AppHeader.js";
12
+ import { u as S } from "../.chunks/useMediaQuery.js";
13
+ const W = ["loading", "hasPagination", "loadingColor", "hasFade", "isTablet"], B = y("div", { shouldForwardProp: (o) => !W.includes(o) })(({ loading: o, hasPagination: i, hasFade: m, loadingColor: l = t.colors.green, isTablet: s }) => ({
14
+ ...T`
15
+ color: ${t.colors.midnight};
16
+ height: ${o ? "100%" : "auto"};
14
17
  padding: 19px;
15
18
  padding-top: 36px;
16
19
  display: flex;
17
20
  flex-direction: column;
18
- justify-content: ${r ? "center" : "start"};
21
+ justify-content: ${o ? "center" : "start"};
19
22
  align-items: center;
20
23
  width: 100%;
21
24
  min-height: 100%;
22
- height: ${a ? "100%" : "auto"};
25
+ height: ${s ? "100%" : "auto"};
23
26
  box-sizing: border-box;
24
- padding-bottom: ${s ? l ? "114px" : "72px" : "19px"};
27
+ padding-bottom: ${m ? i ? "114px" : "72px" : "19px"};
25
28
  > * div {
26
29
  box-sizing: border-box;
27
30
  }
28
31
 
29
32
  .MuiCircularProgress-svg {
30
- color: ${t};
33
+ color: ${l};
31
34
  }
32
35
  `
33
- })), M = u("div")(() => ({
34
- ...b`
36
+ })), H = y("div")(() => ({
37
+ ...T`
35
38
  border-radius: 8px;
36
39
  padding: 0;
37
40
  display: flex;
@@ -43,98 +46,90 @@ const $ = ["loading", "hasPagination", "loadingColor"], R = u("div", { shouldFor
43
46
  min-height: 100%;
44
47
  box-sizing: border-box;
45
48
  `
46
- })), v = {
47
- green: o.colors.green,
48
- blue: o.colors.darkBlue,
49
- red: o.colors.darkRed
50
- }, g = {
51
- green: o.colors.whiteGreen,
52
- blue: o.colors.sky,
53
- red: o.colors.lighterRed
54
- }, z = {
55
- backgroundPrimary: o.colors.sky,
56
- backgroundSecondary: o.colors.lovemist,
57
- backgroundTertiary: o.colors.cornflower,
58
- backgroundQuaternary: o.colors.sky,
59
- borderPrimary: o.colors.darkBlue,
60
- shadowPrimary: o.colors.indigo,
61
- shadowSecondary: o.boxShadows.cobalt,
62
- shadowTertiary: o.boxShadows.indigoThick,
63
- iconPrimary: o.colors.cobalt,
64
- scrollColor: `${o.colors.cobalt}99`,
65
- iconColors: {
66
- iconColor: o.colors.cobalt,
67
- backgroundColor: o.colors.sky
68
- }
69
- }, I = {
70
- backgroundPrimary: o.colors.lighterRed,
71
- backgroundSecondary: o.colors.lightRed,
72
- backgroundTertiary: o.colors.cherryBlossom,
73
- backgroundQuaternary: o.colors.lighterRed,
74
- borderPrimary: o.colors.darkRed,
75
- shadowPrimary: o.colors.maroon,
76
- shadowSecondary: o.boxShadows.burgundy,
77
- shadowTertiary: o.boxShadows.maroonThick,
78
- iconPrimary: o.colors.maroon,
79
- scrollColor: `${o.colors.maroon}99`,
80
- iconColors: {
81
- iconColor: o.colors.maroon,
82
- backgroundColor: o.colors.lighterRed
83
- }
84
- }, B = {
85
- blue: z,
86
- red: I,
87
- green: void 0
88
- }, O = ({
89
- children: r,
90
- loading: l = !1,
91
- hasPagination: s = !1,
92
- fade: t = !0,
93
- userProfileMenuItems: a,
94
- ...c
49
+ }));
50
+ function G(o, i) {
51
+ return o == "green" ? C : u(i);
52
+ }
53
+ const _ = ({
54
+ children: o,
55
+ loading: i = !1,
56
+ hasPagination: m = !1,
57
+ fade: l = !0,
58
+ userProfileMenuItems: s,
59
+ ...n
95
60
  }) => {
96
- const x = localStorage.getItem("theme") || "green", [i, n] = C(x), d = h(`(max-width: ${o.screenSizes.mobile})`), y = h(`(max-width: ${o.screenSizes.tablet})`), k = B[i], p = [
61
+ const w = localStorage.getItem("theme") || "green", p = localStorage.getItem("hue") || g(t.themeOptions.green).toString(), x = S(`(max-width: ${t.screenSizes.mobile})`), I = S(`(max-width: ${t.screenSizes.tablet})`), [e, d] = b(
62
+ () => G(w, parseFloat(p))
63
+ ), [M, c] = b({ h: Math.max(parseFloat(p), 0) * 360, s: 0, v: 68, a: 1 }), P = [
97
64
  {
98
- label: "Green Theme",
65
+ label: "Default Theme",
99
66
  onClick: () => {
100
- localStorage.setItem("theme", "green"), n("green");
67
+ localStorage.setItem("theme", "green"), localStorage.setItem("hue", g(t.themeOptions.green).toString()), c((h) => ({ ...h, h: g(t.themeOptions.green) * 360 })), d(C);
101
68
  }
102
69
  },
103
70
  {
104
- label: "Blue Theme",
71
+ label: "Grayscale",
105
72
  onClick: () => {
106
- localStorage.setItem("theme", "blue"), n("blue");
73
+ localStorage.setItem("theme", "grayscale"), localStorage.setItem("hue", "-1"), c((h) => ({ ...h, h: 0 }));
74
+ const a = u(-1);
75
+ d(a);
107
76
  }
108
77
  },
109
78
  {
110
- label: "Red Theme",
111
- onClick: () => {
112
- localStorage.setItem("theme", "red"), n("red");
79
+ label: "Hue",
80
+ hue: M.h,
81
+ onChange: (a) => {
82
+ localStorage.setItem("theme", "custom"), localStorage.setItem("hue", (a.h / 360).toString()), c((v) => ({ ...v, h: a.h }));
83
+ const h = u(a.h / 360);
84
+ d(h);
113
85
  }
114
86
  },
115
- ...a || []
116
- ];
117
- return /* @__PURE__ */ e(
118
- w,
87
+ ...s || []
88
+ ], k = $(
89
+ () => ({
90
+ backgroundPrimary: e.themeLight,
91
+ backgroundSecondary: e.themeLightA,
92
+ backgroundTertiary: e.themeMediumC,
93
+ backgroundQuaternary: e.themeMediumB,
94
+ borderPrimary: e.themeColor,
95
+ shadowPrimary: e.themeShadowA,
96
+ shadowSecondary: e.themeShadowB,
97
+ shadowTertiary: e.themeShadowC,
98
+ iconPrimary: e.themeDark,
99
+ scrollColor: e.themeShadowA,
100
+ loadingColor: e.themeColor,
101
+ iconColors: {
102
+ icon: /* @__PURE__ */ r(D, {}),
103
+ iconColor: e.themeDark ?? t.colors.darkGreen,
104
+ backgroundColor: e.themeMediumA ?? t.colors.mint
105
+ },
106
+ highlightPrimary: e.highlightPrimary,
107
+ highlightSecondary: e.highlightSecondary,
108
+ highlightTertiary: e.highlightTertiary
109
+ }),
110
+ [e]
111
+ );
112
+ return /* @__PURE__ */ r(
113
+ O,
119
114
  {
120
- ...c,
121
- userProfileMenuItems: p,
122
- themeColors: k ?? (c == null ? void 0 : c.themeColors),
123
- children: /* @__PURE__ */ e(
124
- R,
115
+ ...n,
116
+ userProfileMenuItems: P,
117
+ themeColors: k ?? (n == null ? void 0 : n.themeColors),
118
+ children: /* @__PURE__ */ r(
119
+ B,
125
120
  {
126
121
  className: "jcPageWrapper",
127
- loading: l,
128
- loadingColor: v[i],
129
- hasPagination: s,
130
- hasFade: t,
131
- isTablet: y,
132
- children: /* @__PURE__ */ m(T, { loading: l, size: d ? 114 : 201, children: [
133
- t && /* @__PURE__ */ m(f, { children: [
134
- /* @__PURE__ */ e(S, { color: g[i] }),
135
- /* @__PURE__ */ e(P, { hasPagination: s, isMobile: d, color: g[i] })
122
+ loading: i,
123
+ loadingColor: e.themeColor,
124
+ hasPagination: m,
125
+ hasFade: l,
126
+ isTablet: I,
127
+ children: /* @__PURE__ */ f(A, { loading: i, size: x ? 114 : 201, children: [
128
+ l && /* @__PURE__ */ f(F, { children: [
129
+ /* @__PURE__ */ r(L, { color: e.themeLight }),
130
+ /* @__PURE__ */ r(j, { hasPagination: m, isMobile: x, color: e.themeLight })
136
131
  ] }),
137
- /* @__PURE__ */ e(M, { children: r })
132
+ /* @__PURE__ */ r(z.Provider, { value: e, children: /* @__PURE__ */ r(H, { children: o }) })
138
133
  ] })
139
134
  }
140
135
  )
@@ -142,7 +137,7 @@ const $ = ["loading", "hasPagination", "loadingColor"], R = u("div", { shouldFor
142
137
  );
143
138
  };
144
139
  export {
145
- M as MainContentContainer,
146
- R as PageWrapper,
147
- O as default
140
+ H as MainContentContainer,
141
+ B as PageWrapper,
142
+ _ as default
148
143
  };