jcicl 0.0.118 → 0.0.120

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,3 +1,5 @@
1
+ import { AvatarProps } from '../../../../../../../../../src/components/base/Avatar';
2
+ import { TemplateThemeProps } from '../../../../../../../../../src/components/theme';
1
3
  export interface CustomLogoProps {
2
4
  logoSrc: string;
3
5
  logoWidth: number;
@@ -12,6 +14,9 @@ export interface AppHeaderProps {
12
14
  onHamburgerMenuClick?: () => void;
13
15
  logoProps: CustomLogoProps;
14
16
  iconColor: string;
17
+ isMobile?: boolean;
18
+ themeProps: Pick<TemplateThemeProps, 'shadowSecondary' | 'iconPrimary' | 'borderPrimary' | 'shadowTertiary'>;
19
+ avatarColors?: AvatarProps;
15
20
  }
16
21
  declare const AppHeader: React.FC<AppHeaderProps>;
17
22
  export default AppHeader;
@@ -1,113 +1,117 @@
1
- import { jsx as u, jsxs as b } from "react/jsx-runtime";
2
- import * as w from "react";
3
- import E, { useState as v, useLayoutEffect as M } from "react";
4
- import { n as f } from "../.chunks/emotion-styled.browser.esm.js";
5
- import { c as m } from "../.chunks/emotion-react.browser.esm.js";
6
- import { I as y } from "../.chunks/Input.js";
7
- import { Button as C } from "../Button/Button.js";
8
- import O from "../Avatar/Avatar.js";
9
- import I from "../WithLabel/WithLabel.js";
10
- import { c as L } from "../.chunks/createSvgIcon.js";
11
- const R = E[typeof document < "u" && document.createElement !== void 0 ? "useLayoutEffect" : "useEffect"], _ = (e) => {
12
- const c = w.useRef(e);
13
- return w.useEffect(() => {
14
- c.current = e;
15
- }), c;
1
+ import { jsx as n, jsxs as x } from "react/jsx-runtime";
2
+ import * as S from "react";
3
+ import B, { useState as w, useLayoutEffect as F } from "react";
4
+ import { n as h } from "../.chunks/emotion-styled.browser.esm.js";
5
+ import { c as b } from "../.chunks/emotion-react.browser.esm.js";
6
+ import { I as W } from "../.chunks/Input.js";
7
+ import { Button as k } from "../Button/Button.js";
8
+ import E from "../Avatar/Avatar.js";
9
+ import q from "../WithLabel/WithLabel.js";
10
+ import { c as T } from "../.chunks/createSvgIcon.js";
11
+ const D = B[typeof document < "u" && document.createElement !== void 0 ? "useLayoutEffect" : "useEffect"], G = (e) => {
12
+ const t = S.useRef(e);
13
+ return S.useEffect(() => {
14
+ t.current = e;
15
+ }), t;
16
16
  };
17
- function A() {
17
+ function J() {
18
18
  }
19
- function H(e, c, s = {}) {
20
- const r = U(s.polyfill), a = _(c);
21
- return R(() => {
22
- let o = !1;
23
- const l = e && "current" in e ? e.current : e;
24
- if (!l) return A;
25
- function n(i, t) {
26
- o || a.current(i, t);
19
+ function K(e, t, l = {}) {
20
+ const c = Q(l.polyfill), d = G(t);
21
+ return D(() => {
22
+ let i = !1;
23
+ const a = e && "current" in e ? e.current : e;
24
+ if (!a) return J;
25
+ function r(o, s) {
26
+ i || d.current(o, s);
27
27
  }
28
- return r.subscribe(l, n), () => {
29
- o = !0, r.unsubscribe(l, n);
28
+ return c.subscribe(a, r), () => {
29
+ i = !0, c.unsubscribe(a, r);
30
30
  };
31
- }, [e, r, a]), r.observer;
31
+ }, [e, c, d]), c.observer;
32
32
  }
33
- function j(e) {
34
- let c = !1, s = [];
35
- const r = /* @__PURE__ */ new Map(), a = new (e || window.ResizeObserver)((o, l) => {
36
- s = s.concat(o);
37
- function n() {
38
- const i = /* @__PURE__ */ new Set();
39
- for (let t = 0; t < s.length; t++) {
40
- if (i.has(s[t].target)) continue;
41
- i.add(s[t].target);
42
- const h = r.get(s[t].target);
43
- h == null || h.forEach((d) => d(s[t], l));
33
+ function N(e) {
34
+ let t = !1, l = [];
35
+ const c = /* @__PURE__ */ new Map(), d = new (e || window.ResizeObserver)((i, a) => {
36
+ l = l.concat(i);
37
+ function r() {
38
+ const o = /* @__PURE__ */ new Set();
39
+ for (let s = 0; s < l.length; s++) {
40
+ if (o.has(l[s].target)) continue;
41
+ o.add(l[s].target);
42
+ const u = c.get(l[s].target);
43
+ u == null || u.forEach((p) => p(l[s], a));
44
44
  }
45
- s = [], c = !1;
45
+ l = [], t = !1;
46
46
  }
47
- c || window.requestAnimationFrame(n), c = !0;
47
+ t || window.requestAnimationFrame(r), t = !0;
48
48
  });
49
49
  return {
50
- observer: a,
51
- subscribe(o, l) {
52
- var n;
53
- a.observe(o);
54
- const i = (n = r.get(o)) !== null && n !== void 0 ? n : [];
55
- i.push(l), r.set(o, i);
50
+ observer: d,
51
+ subscribe(i, a) {
52
+ var r;
53
+ d.observe(i);
54
+ const o = (r = c.get(i)) !== null && r !== void 0 ? r : [];
55
+ o.push(a), c.set(i, o);
56
56
  },
57
- unsubscribe(o, l) {
58
- var n;
59
- const i = (n = r.get(o)) !== null && n !== void 0 ? n : [];
60
- if (i.length === 1) {
61
- a.unobserve(o), r.delete(o);
57
+ unsubscribe(i, a) {
58
+ var r;
59
+ const o = (r = c.get(i)) !== null && r !== void 0 ? r : [];
60
+ if (o.length === 1) {
61
+ d.unobserve(i), c.delete(i);
62
62
  return;
63
63
  }
64
- const t = i.indexOf(l);
65
- t !== -1 && i.splice(t, 1), r.set(o, i);
64
+ const s = o.indexOf(a);
65
+ s !== -1 && o.splice(s, 1), c.set(i, o);
66
66
  }
67
67
  };
68
68
  }
69
- let g;
70
- const U = (e) => g || (g = j(e)), V = L(/* @__PURE__ */ u("path", {
69
+ let $;
70
+ const Q = (e) => $ || ($ = N(e)), X = T(/* @__PURE__ */ n("path", {
71
71
  d: "M3 18h18v-2H3zm0-5h18v-2H3zm0-7v2h18V6z"
72
- }), "Menu"), B = f("div")(() => ({
73
- ...m`
74
- display: flex;
75
- flex-direction: row;
76
- padding: 4px 16px;
77
- background-color: transparent;
78
- align-items: center;
79
- justify-content: space-between;
80
- gap: 1.5rem;
81
- `
82
- })), F = f("img")(({ width: e }) => ({
72
+ }), "Menu"), M = h("div")(
73
+ ({ mobile: e, shadowSecondary: t }) => ({
74
+ ...b`
75
+ z-index: 1313;
76
+ display: flex;
77
+ flex-direction: row;
78
+ padding: 4px 16px;
79
+ background-color: transparent;
80
+ align-items: center;
81
+ justify-content: space-between;
82
+ gap: ${e ? "8px" : "1.5rem"};
83
+ box-shadow: ${e && t};
84
+ `
85
+ })
86
+ ), O = h("img")(({ width: e }) => ({
83
87
  width: `${e}px`
84
- })), q = f("div")(({ height: e }) => ({
85
- ...m`
88
+ })), I = h("div")(({ height: e }) => ({
89
+ ...b`
86
90
  display: flex;
87
91
  gap: 1rem;
88
92
  height: ${e}px;
89
93
  `
90
- })), P = f("div")(({ width: e, loggedIn: c }) => ({
91
- ...m`
94
+ })), Y = h("div")(({ width: e, loggedIn: t }) => ({
95
+ ...b`
92
96
  width: ${e}px;
93
97
  display: flex;
94
98
  justify-content: center;
95
99
  align-items: flex-end;
96
- flex-direction: ${c ? "column" : "column-reverse"};
100
+ flex-direction: ${t ? "column" : "column-reverse"};
97
101
  flex-shrink: 0;
98
102
  * {
99
103
  white-space: nowrap;
100
104
  }
101
105
  `
102
- })), W = f("div")(({ visible: e }) => ({
103
- ...m`
106
+ })), L = h("div")(({ visible: e }) => ({
107
+ ...b`
104
108
  z-index: ${e ? 1 : 0};
105
109
  opacity: ${e ? 1 : 0};
106
110
  pointer-events: ${e ? "auto" : "none"};
107
111
  position: ${e ? "relative" : "absolute"};
108
112
  `
109
- })), D = f("div")(() => ({
110
- ...m`
113
+ })), R = h("div")(() => ({
114
+ ...b`
111
115
  display: flex;
112
116
  width: 1360px;
113
117
  max-width: 100%;
@@ -115,41 +119,48 @@ const U = (e) => g || (g = j(e)), V = L(/* @__PURE__ */ u("path", {
115
119
  width: 100%;
116
120
  }
117
121
  `
118
- })), ee = ({
119
- loggedIn: e,
120
- logoProps: c,
121
- iconColor: s,
122
- hamburgerMenu: r,
123
- onHamburgerMenuClick: a,
122
+ })), le = ({
123
+ isMobile: e,
124
+ loggedIn: t,
125
+ logoProps: l,
126
+ iconColor: c,
127
+ themeProps: d,
128
+ hamburgerMenu: i,
129
+ avatarColors: a,
130
+ onHamburgerMenuClick: r,
124
131
  onUserMenuClick: o,
125
- onLogin: l
132
+ onLogin: s
126
133
  }) => {
127
- const [n, i] = v(0), [t, h] = v(null), [d, z] = v(null), { logoSrc: $, logoWidth: k, logoHeight: x } = c;
128
- M(() => {
129
- t && t.clientWidth > n && i(t.clientWidth), d && d.clientWidth > n && i(d.clientWidth);
130
- }, [t, d]);
131
- const S = (p) => {
132
- p != null && p.clientWidth && p.clientWidth > n && i(p.clientWidth);
134
+ const [u, p] = w(0), [f, _] = w(null), [v, A] = w(null), { logoSrc: C, logoWidth: y, logoHeight: g } = l, { shadowSecondary: H, shadowTertiary: j, iconPrimary: P, borderPrimary: U } = d, z = { shadowTertiary: j, borderColor: U, iconPrimary: P };
135
+ F(() => {
136
+ f && f.clientWidth > u && p(f.clientWidth), v && v.clientWidth > u && p(v.clientWidth);
137
+ }, [f, v]);
138
+ const V = (m) => {
139
+ m != null && m.clientWidth && m.clientWidth > u && p(m.clientWidth);
133
140
  };
134
- return H(t, () => S(t)), /* @__PURE__ */ b(B, { children: [
135
- /* @__PURE__ */ b(q, { height: x, children: [
136
- /* @__PURE__ */ u(F, { src: $, height: `${x}px`, width: k }),
137
- r && /* @__PURE__ */ u(C, { variant: "icon", onClick: a, color: s, children: /* @__PURE__ */ u(V, {}) })
141
+ return K(f, () => V(f)), e ? /* @__PURE__ */ x(M, { mobile: !0, shadowSecondary: H, children: [
142
+ /* @__PURE__ */ n(I, { height: g, children: /* @__PURE__ */ n(O, { src: C, height: `${g}px`, width: y }) }),
143
+ /* @__PURE__ */ n(R, { children: /* @__PURE__ */ n(W, { ...z, placeholder: "Search..." }) }),
144
+ /* @__PURE__ */ n(E, { ...a, onClick: o })
145
+ ] }) : /* @__PURE__ */ x(M, { children: [
146
+ /* @__PURE__ */ x(I, { height: g, children: [
147
+ /* @__PURE__ */ n(O, { src: C, height: `${g}px`, width: y }),
148
+ i && /* @__PURE__ */ n(k, { variant: "icon", onClick: r, color: c, children: /* @__PURE__ */ n(X, {}) })
138
149
  ] }),
139
- /* @__PURE__ */ u(D, { children: /* @__PURE__ */ u(y, { placeholder: "Search..." }) }),
140
- /* @__PURE__ */ b(P, { width: n, loggedIn: !!e, children: [
141
- /* @__PURE__ */ u(W, { visible: !!e, ref: h, children: /* @__PURE__ */ u(
142
- I,
150
+ /* @__PURE__ */ n(R, { children: /* @__PURE__ */ n(W, { ...z, placeholder: "Search..." }) }),
151
+ /* @__PURE__ */ x(Y, { width: u, loggedIn: !!t, children: [
152
+ /* @__PURE__ */ n(L, { visible: !!t, ref: _, children: /* @__PURE__ */ n(
153
+ q,
143
154
  {
144
155
  id: "accountMenuContainer",
145
- component: /* @__PURE__ */ u(O, { onClick: o }),
156
+ component: /* @__PURE__ */ n(E, { ...a, onClick: o }),
146
157
  label: "Welcome, User"
147
158
  }
148
159
  ) }),
149
- /* @__PURE__ */ u(W, { visible: !e, ref: z, children: /* @__PURE__ */ u(C, { id: "loginButtonContainer", onClick: l, children: "Log In" }) })
160
+ /* @__PURE__ */ n(L, { visible: !t, ref: A, children: /* @__PURE__ */ n(k, { id: "loginButtonContainer", onClick: s, children: "Log In" }) })
150
161
  ] })
151
162
  ] });
152
163
  };
153
164
  export {
154
- ee as default
165
+ le as default
155
166
  };
package/Avatar/index.d.ts CHANGED
@@ -1 +1 @@
1
- export { default } from './Avatar';
1
+ export { default, type AvatarProps } from './Avatar';
package/Input/Input.d.ts CHANGED
@@ -1,6 +1,9 @@
1
1
  import { TextFieldProps as MuiTextFieldProps } from '@mui/material/TextField';
2
2
  export type InputProps = Omit<MuiTextFieldProps, 'variant'> & {
3
3
  variant?: 'outlined' | 'simple';
4
+ shadowTertiary?: string;
5
+ borderColor?: string;
6
+ borderFocusColor?: string;
4
7
  };
5
8
  export declare const Input: React.FC<InputProps>;
6
9
  export default Input;
package/Nav/Nav.d.ts CHANGED
@@ -1,14 +1,4 @@
1
- export interface TemplateThemeProps {
2
- backgroundPrimary: string;
3
- backgroundSecondary: string;
4
- backgroundTertiary: string;
5
- borderPrimary: string;
6
- iconPrimary: string;
7
- highlightPrimary: string;
8
- highlightSecondary: string;
9
- highlightTertiary: string;
10
- shadowPrimary: string;
11
- }
1
+ import { TemplateThemeProps } from '../../../../../../../../../src/components/theme';
12
2
  export interface NavItemProps {
13
3
  label?: string;
14
4
  icon?: React.ReactNode;
@@ -21,7 +11,8 @@ export interface NavProps {
21
11
  activeRoute?: string;
22
12
  navWidth?: string;
23
13
  isTablet?: boolean;
24
- themeColors: Pick<TemplateThemeProps, 'highlightPrimary' | 'highlightTertiary' | 'iconPrimary'>;
14
+ isMobile?: boolean;
15
+ themeColors: Pick<TemplateThemeProps, 'highlightPrimary' | 'highlightTertiary' | 'iconPrimary' | 'shadowSecondary' | 'scrollColor'>;
25
16
  }
26
17
  export declare const Nav: React.FC<NavProps>;
27
18
  export default Nav;
package/Nav/Nav.js CHANGED
@@ -1,32 +1,35 @@
1
- import { jsx as a, jsxs as y } from "react/jsx-runtime";
2
- import { useState as v } from "react";
3
- import { n as c, i as C } from "../.chunks/emotion-styled.browser.esm.js";
4
- import d from "../theme.js";
5
- import S from "../ScrollContainer/ScrollContainer.js";
6
- import { B as k } from "../.chunks/ButtonBase.js";
7
- const w = c(k, {
8
- shouldForwardProp: (o) => C(o)
9
- })(({ active: o, isTablet: t, highlight1: r, highlight3: i, iconColor: e }) => ({
1
+ import { jsx as a, jsxs as u } from "react/jsx-runtime";
2
+ import { useState as j } from "react";
3
+ import { n as y, i as z } from "../.chunks/emotion-styled.browser.esm.js";
4
+ import P from "../theme.js";
5
+ import B from "../ScrollContainer/ScrollContainer.js";
6
+ import { B as D } from "../.chunks/ButtonBase.js";
7
+ const C = y(D, {
8
+ shouldForwardProp: (r) => z(r)
9
+ })(({ active: r, isTablet: n, highlight1: t, highlight3: i, iconColor: e, isMobile: c, shadowSecondary: d }) => ({
10
10
  display: "flex",
11
- flexDirection: t ? "row" : "column",
11
+ flexDirection: n ? "row" : "column",
12
12
  alignItems: "center",
13
- justifyContent: t ? "flex-start" : "center",
13
+ justifyContent: n ? "flex-start" : "center",
14
14
  width: "100%",
15
- padding: t ? "16px" : "0 8px 8px 8px",
15
+ padding: n ? "16px" : "0 8px 8px 8px",
16
16
  transition: "313ms all ease-in-out",
17
- backgroundColor: o ? r : "transparent",
18
- boxShadow: o ? e : "none",
19
- ...t && {
17
+ backgroundColor: r && !c ? t : "transparent",
18
+ boxShadow: r ? e : "none",
19
+ ...n && {
20
20
  gap: "0.5rem"
21
21
  },
22
+ ...c && {
23
+ padding: 0
24
+ },
22
25
  "&:hover, :focus-visible": {
23
26
  svg: {
24
- ...!t && {
25
- backgroundColor: r
27
+ ...!n && {
28
+ backgroundColor: t
26
29
  }
27
30
  },
28
- ...t && {
29
- boxShadow: d.boxShadows.darkGreen,
31
+ ...n && {
32
+ boxShadow: d,
30
33
  backgroundColor: i
31
34
  }
32
35
  },
@@ -47,51 +50,89 @@ const w = c(k, {
47
50
  fontWeight: "bold",
48
51
  color: e,
49
52
  textAlign: "center",
50
- ...t && {
53
+ ...n && {
51
54
  fontSize: "1.5rem",
52
55
  fontWeight: "500"
53
56
  }
54
57
  }
55
- })), P = c("div")(({ navWidth: o, isTablet: t }) => ({
58
+ })), v = y("div")(({ navWidth: r, isTablet: n, isMobile: t, shadowSecondary: i }) => ({
56
59
  display: "flex",
57
- flexDirection: "column",
60
+ flexDirection: t ? "row" : "column",
58
61
  backgroundColor: "transparent",
59
62
  alignItems: "center",
60
- justifyContent: "flex-start",
63
+ justifyContent: t ? "space-between" : "flex-start",
61
64
  maxHeight: "100%",
62
65
  flexShrink: 0,
63
- gap: t ? 0 : "1rem",
64
- width: o
65
- })), W = ({
66
- navItems: o,
67
- activeRoute: t,
68
- navWidth: r = `${d.constants.navDefaultWidth}px`,
66
+ gap: n ? 0 : "1rem",
67
+ width: r,
68
+ boxSizing: "border-box",
69
+ ...t && {
70
+ boxShadow: i,
71
+ zIndex: 1313
72
+ },
73
+ ...t && {
74
+ padding: "4px 8px"
75
+ }
76
+ })), $ = ({
77
+ navItems: r,
78
+ activeRoute: n,
79
+ navWidth: t = `${P.constants.navDefaultWidth}px`,
69
80
  isTablet: i,
70
- themeColors: e
81
+ isMobile: e,
82
+ themeColors: c
71
83
  }) => {
72
- const [l, p] = v(""), m = (s, n) => {
73
- p(s), n();
74
- }, { highlightPrimary: f, highlightTertiary: h, iconPrimary: g } = e;
75
- return /* @__PURE__ */ a(S, { direction: "vertical", width: r, styles: { minWidth: r }, children: /* @__PURE__ */ a(P, { ...{ navWidth: r, isTablet: i }, children: o.map(({ icon: s, label: n = "", onClick: x = () => {
76
- }, ...u }) => /* @__PURE__ */ y(
77
- w,
84
+ const [d, w] = j(""), g = (s, o) => {
85
+ w(s), o();
86
+ }, { highlightPrimary: f, highlightTertiary: m, iconPrimary: x, shadowSecondary: h, scrollColor: S } = c, k = { navWidth: t, isTablet: i, shadowSecondary: h };
87
+ return e ? /* @__PURE__ */ a(v, { isTablet: !1, navWidth: "100%", isMobile: !0, shadowSecondary: h, children: r.map(({ icon: s, label: o = "", onClick: p = () => {
88
+ }, ...l }) => /* @__PURE__ */ u(
89
+ C,
78
90
  {
79
- ...u,
80
- active: t ? t === n : l === n,
81
- onClick: () => m(n, x),
91
+ ...l,
92
+ active: n ? n === o : d === o,
93
+ onClick: () => g(o, p),
82
94
  isTablet: i,
83
95
  highlight1: f,
84
- highlight3: h,
85
- iconColor: g,
96
+ highlight3: m,
97
+ iconColor: x,
98
+ shadowSecondary: h,
99
+ isMobile: !0,
86
100
  children: [
87
101
  s,
88
- /* @__PURE__ */ a("span", { children: n })
102
+ /* @__PURE__ */ a("span", { children: o })
89
103
  ]
90
104
  },
91
- n
92
- )) }) });
105
+ o
106
+ )) }) : /* @__PURE__ */ a(
107
+ B,
108
+ {
109
+ scrollColor: S,
110
+ direction: "vertical",
111
+ width: t,
112
+ styles: { minWidth: t },
113
+ children: /* @__PURE__ */ a(v, { ...k, children: r.map(({ icon: s, label: o = "", onClick: p = () => {
114
+ }, ...l }) => /* @__PURE__ */ u(
115
+ C,
116
+ {
117
+ ...l,
118
+ active: n ? n === o : d === o,
119
+ onClick: () => g(o, p),
120
+ isTablet: i,
121
+ highlight1: f,
122
+ highlight3: m,
123
+ iconColor: x,
124
+ shadowSecondary: h,
125
+ children: [
126
+ s,
127
+ /* @__PURE__ */ a("span", { children: o })
128
+ ]
129
+ },
130
+ o
131
+ )) })
132
+ }
133
+ );
93
134
  };
94
135
  export {
95
- W as Nav,
96
- W as default
136
+ $ as Nav,
137
+ $ as default
97
138
  };
package/Nav/index.d.ts CHANGED
@@ -1 +1 @@
1
- export { default, type NavProps, type NavItemProps, type TemplateThemeProps } from './Nav';
1
+ export { default, type NavProps, type NavItemProps } from './Nav';
@@ -4,6 +4,7 @@ export interface ScrollContainerProps {
4
4
  /** Defines which direction scrolling is enabled for */
5
5
  direction?: 'vertical' | 'horizontal' | 'all' | 'none';
6
6
  styles?: React.CSSProperties;
7
+ scrollColor?: string;
7
8
  }
8
9
  declare const ScrollContainer: React.FC<ScrollContainerProps & {
9
10
  children: React.ReactNode;