jcicl 0.0.128 → 0.0.132

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,4 +1,4 @@
1
- import { AvatarProps } from '../../../../../../../../../src/components/base/Avatar';
1
+ import { IconProps } from '../../../../../../../../../src/components/base/Icon';
2
2
  import { TemplateThemeProps } from '../../../../../../../../../src/components/theme';
3
3
  export interface CustomLogoProps {
4
4
  logoSrc: string;
@@ -12,11 +12,14 @@ export interface AppHeaderProps {
12
12
  onLogout?: () => void;
13
13
  onUserMenuClick?: () => void;
14
14
  onHamburgerMenuClick?: () => void;
15
+ onSearch?: () => void;
15
16
  logoProps: CustomLogoProps;
16
17
  iconColor: string;
17
18
  isMobile?: boolean;
18
19
  themeProps: Pick<TemplateThemeProps, 'shadowSecondary' | 'iconPrimary' | 'borderPrimary' | 'shadowTertiary'>;
19
- avatarColors?: AvatarProps;
20
+ iconColors?: IconProps;
21
+ userName?: string;
22
+ userSettingsEnabled?: boolean;
20
23
  }
21
24
  declare const AppHeader: React.FC<AppHeaderProps>;
22
25
  export default AppHeader;
@@ -1,56 +1,56 @@
1
- import { jsx as n, jsxs as x } from "react/jsx-runtime";
2
- import * as S from "react";
3
- import V, { useState as w, useLayoutEffect as B } from "react";
1
+ import { jsx as t, jsxs as x } from "react/jsx-runtime";
2
+ import * as k from "react";
3
+ import G, { useState as $, useLayoutEffect as J } from "react";
4
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 = V[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;
5
+ import { c as m } from "../.chunks/emotion-react.browser.esm.js";
6
+ import { Search as M } from "../Search/Search.js";
7
+ import { Button as E } from "../Button/Button.js";
8
+ import H from "../Icon/Icon.js";
9
+ import K from "../WithLabel/WithLabel.js";
10
+ import { c as j } from "../.chunks/createSvgIcon.js";
11
+ const N = G[typeof document < "u" && document.createElement !== void 0 ? "useLayoutEffect" : "useEffect"], Q = (e) => {
12
+ const n = k.useRef(e);
13
+ return k.useEffect(() => {
14
+ n.current = e;
15
+ }), n;
16
16
  };
17
- function J() {
17
+ function X() {
18
18
  }
19
- function K(e, t, l = {}) {
20
- const c = Q(l.polyfill), a = G(t);
21
- return D(() => {
19
+ function Y(e, n, l = {}) {
20
+ const c = ee(l.polyfill), u = Q(n);
21
+ return N(() => {
22
22
  let i = !1;
23
23
  const d = e && "current" in e ? e.current : e;
24
- if (!d) return J;
24
+ if (!d) return X;
25
25
  function r(o, s) {
26
- i || a.current(o, s);
26
+ i || u.current(o, s);
27
27
  }
28
28
  return c.subscribe(d, r), () => {
29
29
  i = !0, c.unsubscribe(d, r);
30
30
  };
31
- }, [e, c, a]), c.observer;
31
+ }, [e, c, u]), c.observer;
32
32
  }
33
- function N(e) {
34
- let t = !1, l = [];
35
- const c = /* @__PURE__ */ new Map(), a = new (e || window.ResizeObserver)((i, d) => {
33
+ function Z(e) {
34
+ let n = !1, l = [];
35
+ const c = /* @__PURE__ */ new Map(), u = new (e || window.ResizeObserver)((i, d) => {
36
36
  l = l.concat(i);
37
37
  function r() {
38
38
  const o = /* @__PURE__ */ new Set();
39
39
  for (let s = 0; s < l.length; s++) {
40
40
  if (o.has(l[s].target)) continue;
41
41
  o.add(l[s].target);
42
- const u = c.get(l[s].target);
43
- u == null || u.forEach((p) => p(l[s], d));
42
+ const a = c.get(l[s].target);
43
+ a == null || a.forEach((w) => w(l[s], d));
44
44
  }
45
- l = [], t = !1;
45
+ l = [], n = !1;
46
46
  }
47
- t || window.requestAnimationFrame(r), t = !0;
47
+ n || window.requestAnimationFrame(r), n = !0;
48
48
  });
49
49
  return {
50
- observer: a,
50
+ observer: u,
51
51
  subscribe(i, d) {
52
52
  var r;
53
- a.observe(i);
53
+ u.observe(i);
54
54
  const o = (r = c.get(i)) !== null && r !== void 0 ? r : [];
55
55
  o.push(d), c.set(i, o);
56
56
  },
@@ -58,7 +58,7 @@ function N(e) {
58
58
  var r;
59
59
  const o = (r = c.get(i)) !== null && r !== void 0 ? r : [];
60
60
  if (o.length === 1) {
61
- a.unobserve(i), c.delete(i);
61
+ u.unobserve(i), c.delete(i);
62
62
  return;
63
63
  }
64
64
  const s = o.indexOf(d);
@@ -66,12 +66,14 @@ function N(e) {
66
66
  }
67
67
  };
68
68
  }
69
- let C;
70
- const Q = (e) => C || (C = N(e)), X = T(/* @__PURE__ */ n("path", {
69
+ let y;
70
+ const ee = (e) => y || (y = Z(e)), te = j(/* @__PURE__ */ t("path", {
71
71
  d: "M3 18h18v-2H3zm0-5h18v-2H3zm0-7v2h18V6z"
72
- }), "Menu"), M = h("div")(
73
- ({ mobile: e, shadowSecondary: t }) => ({
74
- ...b`
72
+ }), "Menu"), I = j(/* @__PURE__ */ t("path", {
73
+ d: "M12 5.9c1.16 0 2.1.94 2.1 2.1s-.94 2.1-2.1 2.1S9.9 9.16 9.9 8s.94-2.1 2.1-2.1m0 9c2.97 0 6.1 1.46 6.1 2.1v1.1H5.9V17c0-.64 3.13-2.1 6.1-2.1M12 4C9.79 4 8 5.79 8 8s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4m0 9c-2.67 0-8 1.34-8 4v3h16v-3c0-2.66-5.33-4-8-4"
74
+ }), "PersonOutlineOutlined"), L = h("div")(
75
+ ({ mobile: e, shadowSecondary: n }) => ({
76
+ ...m`
75
77
  z-index: 1313;
76
78
  display: flex;
77
79
  flex-direction: row;
@@ -80,38 +82,38 @@ const Q = (e) => C || (C = N(e)), X = T(/* @__PURE__ */ n("path", {
80
82
  align-items: center;
81
83
  justify-content: space-between;
82
84
  gap: ${e ? "8px" : "1.5rem"};
83
- box-shadow: ${e && t};
85
+ box-shadow: ${e && n};
84
86
  `
85
87
  })
86
- ), O = h("img")(({ width: e }) => ({
88
+ ), R = h("img")(({ width: e }) => ({
87
89
  width: `${e}px`
88
- })), I = h("div")(({ height: e }) => ({
89
- ...b`
90
+ })), _ = h("div")(({ height: e }) => ({
91
+ ...m`
90
92
  display: flex;
91
93
  gap: 1rem;
92
94
  height: ${e}px;
93
95
  `
94
- })), Y = h("div")(({ width: e, loggedIn: t }) => ({
95
- ...b`
96
+ })), ne = h("div")(({ width: e, loggedIn: n }) => ({
97
+ ...m`
96
98
  width: ${e}px;
97
99
  display: flex;
98
100
  justify-content: center;
99
101
  align-items: flex-end;
100
- flex-direction: ${t ? "column" : "column-reverse"};
102
+ flex-direction: ${n ? "column" : "column-reverse"};
101
103
  flex-shrink: 0;
102
104
  * {
103
105
  white-space: nowrap;
104
106
  }
105
107
  `
106
- })), L = h("div")(({ visible: e }) => ({
107
- ...b`
108
+ })), P = h("div")(({ visible: e }) => ({
109
+ ...m`
108
110
  z-index: ${e ? 1 : 0};
109
111
  opacity: ${e ? 1 : 0};
110
112
  pointer-events: ${e ? "auto" : "none"};
111
113
  position: ${e ? "relative" : "absolute"};
112
114
  `
113
- })), R = h("div")(() => ({
114
- ...b`
115
+ })), A = h("div")(() => ({
116
+ ...m`
115
117
  display: flex;
116
118
  width: 1360px;
117
119
  max-width: 100%;
@@ -119,48 +121,66 @@ const Q = (e) => C || (C = N(e)), X = T(/* @__PURE__ */ n("path", {
119
121
  width: 100%;
120
122
  }
121
123
  `
122
- })), le = ({
124
+ })), fe = ({
123
125
  isMobile: e,
124
- loggedIn: t,
126
+ loggedIn: n,
125
127
  logoProps: l,
126
128
  iconColor: c,
127
- themeProps: a,
129
+ themeProps: u,
128
130
  hamburgerMenu: i,
129
- avatarColors: d,
130
- onHamburgerMenuClick: r,
131
- onUserMenuClick: o,
132
- onLogin: s
131
+ iconColors: d,
132
+ userName: r = "User",
133
+ userSettingsEnabled: o,
134
+ onHamburgerMenuClick: s,
135
+ onUserMenuClick: a,
136
+ onLogin: w,
137
+ onSearch: z = () => {
138
+ }
133
139
  }) => {
134
- const [u, p] = w(0), [f, _] = w(null), [v, A] = w(null), { logoSrc: $, logoWidth: y, logoHeight: g } = l, { shadowSecondary: H, shadowTertiary: j, iconPrimary: P, borderPrimary: F } = a, z = { shadowTertiary: j, borderColor: F, borderFocusColor: P };
135
- B(() => {
136
- f && f.clientWidth > u && p(f.clientWidth), v && v.clientWidth > u && p(v.clientWidth);
140
+ const [b, C] = $(0), [f, V] = $(null), [v, F] = $(null), { logoSrc: O, logoWidth: S, logoHeight: g } = l, { shadowSecondary: U, shadowTertiary: B, iconPrimary: q, borderPrimary: T } = u, W = { shadowTertiary: B, borderColor: T, borderFocusColor: q };
141
+ J(() => {
142
+ f && f.clientWidth > b && C(f.clientWidth), v && v.clientWidth > b && C(v.clientWidth);
137
143
  }, [f, v]);
138
- const U = (m) => {
139
- m != null && m.clientWidth && m.clientWidth > u && p(m.clientWidth);
144
+ const D = (p) => {
145
+ p != null && p.clientWidth && p.clientWidth > b && C(p.clientWidth);
140
146
  };
141
- return K(f, () => U(f)), e ? /* @__PURE__ */ x(M, { mobile: !0, shadowSecondary: H, children: [
142
- /* @__PURE__ */ n(I, { height: g, children: /* @__PURE__ */ n(O, { src: $, height: `${g}px`, width: y }) }),
143
- /* @__PURE__ */ n(R, { children: /* @__PURE__ */ n(W, { ...z, placeholder: "Search..." }) }),
144
- /* @__PURE__ */ n(E, { ...d, onClick: o })
145
- ] }) : /* @__PURE__ */ x(M, { children: [
146
- /* @__PURE__ */ x(I, { height: g, children: [
147
- /* @__PURE__ */ n(O, { src: $, height: `${g}px`, width: y }),
148
- i && /* @__PURE__ */ n(k, { variant: "icon", onClick: r, color: c, children: /* @__PURE__ */ n(X, {}) })
147
+ return Y(f, () => D(f)), e ? /* @__PURE__ */ x(L, { mobile: !0, shadowSecondary: U, children: [
148
+ /* @__PURE__ */ t(_, { height: g, children: /* @__PURE__ */ t(R, { src: O, height: `${g}px`, width: S }) }),
149
+ /* @__PURE__ */ t(A, { children: /* @__PURE__ */ t(M, { onSearch: z, ...W, placeholder: "Search..." }) }),
150
+ /* @__PURE__ */ t(
151
+ H,
152
+ {
153
+ icon: /* @__PURE__ */ t(I, {}),
154
+ ...d,
155
+ onClick: o ? a : void 0
156
+ }
157
+ )
158
+ ] }) : /* @__PURE__ */ x(L, { children: [
159
+ /* @__PURE__ */ x(_, { height: g, children: [
160
+ /* @__PURE__ */ t(R, { src: O, height: `${g}px`, width: S }),
161
+ i && /* @__PURE__ */ t(E, { variant: "icon", onClick: s, color: c, children: /* @__PURE__ */ t(te, {}) })
149
162
  ] }),
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,
163
+ /* @__PURE__ */ t(A, { children: /* @__PURE__ */ t(M, { onSearch: z, ...W, placeholder: "Search..." }) }),
164
+ /* @__PURE__ */ x(ne, { width: b, loggedIn: !!n, children: [
165
+ /* @__PURE__ */ t(P, { visible: !!n, ref: V, children: /* @__PURE__ */ t(
166
+ K,
154
167
  {
155
168
  id: "accountMenuContainer",
156
- component: /* @__PURE__ */ n(E, { ...d, onClick: o }),
157
- label: "Welcome, User"
169
+ component: /* @__PURE__ */ t(
170
+ H,
171
+ {
172
+ icon: /* @__PURE__ */ t(I, {}),
173
+ ...d,
174
+ onClick: o ? a : void 0
175
+ }
176
+ ),
177
+ label: `Hi, ${r}!`
158
178
  }
159
179
  ) }),
160
- /* @__PURE__ */ n(L, { visible: !t, ref: A, children: /* @__PURE__ */ n(k, { id: "loginButtonContainer", onClick: s, children: "Log In" }) })
180
+ /* @__PURE__ */ t(P, { visible: !n, ref: F, children: /* @__PURE__ */ t(E, { id: "loginButtonContainer", onClick: w, children: "Log In" }) })
161
181
  ] })
162
182
  ] });
163
183
  };
164
184
  export {
165
- le as default
185
+ fe as default
166
186
  };
@@ -1,6 +1,6 @@
1
1
  import { ButtonProps as MuiButtonProps } from '@mui/material/Button/Button';
2
2
  export interface ButtonProps extends Omit<MuiButtonProps, 'variant' | 'size' | 'color'> {
3
- variant?: 1 | 2 | 'unstyled' | 'icon';
3
+ variant?: 1 | 2 | 'unstyled' | 'icon' | 'bibi' | 'bibiOutlined' | 'bibiInverse';
4
4
  size?: number;
5
5
  color?: string;
6
6
  highlightColor?: string;