jcicl 0.0.167 → 0.0.171
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.
- package/AppHeader/AppHeader.js +100 -90
- package/package.json +1 -1
package/AppHeader/AppHeader.js
CHANGED
|
@@ -1,79 +1,80 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
4
|
-
import { n as
|
|
5
|
-
import { c as
|
|
6
|
-
import { Search as
|
|
7
|
-
import { Button as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { c as
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { jsx as t, jsxs as h } from "react/jsx-runtime";
|
|
2
|
+
import * as M from "react";
|
|
3
|
+
import Y, { useState as z, useLayoutEffect as Z } from "react";
|
|
4
|
+
import { n as f } from "../.chunks/emotion-styled.browser.esm.js";
|
|
5
|
+
import { c as b } from "../.chunks/emotion-react.browser.esm.js";
|
|
6
|
+
import { Search as E } from "../Search/Search.js";
|
|
7
|
+
import { Button as H } from "../Button/Button.js";
|
|
8
|
+
import I from "../Icon/Icon.js";
|
|
9
|
+
import T from "../WithLabel/WithLabel.js";
|
|
10
|
+
import { c as V } from "../.chunks/createSvgIcon.js";
|
|
11
|
+
import ee from "../theme.js";
|
|
12
|
+
const te = Y[typeof document < "u" && document.createElement !== void 0 ? "useLayoutEffect" : "useEffect"], ne = (e) => {
|
|
13
|
+
const n = M.useRef(e);
|
|
14
|
+
return M.useEffect(() => {
|
|
14
15
|
n.current = e;
|
|
15
16
|
}), n;
|
|
16
17
|
};
|
|
17
|
-
function
|
|
18
|
+
function ie() {
|
|
18
19
|
}
|
|
19
|
-
function
|
|
20
|
-
const c =
|
|
21
|
-
return
|
|
20
|
+
function oe(e, n, l = {}) {
|
|
21
|
+
const c = ce(l.polyfill), d = ne(n);
|
|
22
|
+
return te(() => {
|
|
22
23
|
let i = !1;
|
|
23
|
-
const
|
|
24
|
-
if (!
|
|
24
|
+
const a = e && "current" in e ? e.current : e;
|
|
25
|
+
if (!a) return ie;
|
|
25
26
|
function r(o, s) {
|
|
26
|
-
i ||
|
|
27
|
+
i || d.current(o, s);
|
|
27
28
|
}
|
|
28
|
-
return c.subscribe(
|
|
29
|
-
i = !0, c.unsubscribe(
|
|
29
|
+
return c.subscribe(a, r), () => {
|
|
30
|
+
i = !0, c.unsubscribe(a, r);
|
|
30
31
|
};
|
|
31
|
-
}, [e, c,
|
|
32
|
+
}, [e, c, d]), c.observer;
|
|
32
33
|
}
|
|
33
|
-
function
|
|
34
|
+
function re(e) {
|
|
34
35
|
let n = !1, l = [];
|
|
35
|
-
const c = /* @__PURE__ */ new Map(),
|
|
36
|
+
const c = /* @__PURE__ */ new Map(), d = new (e || window.ResizeObserver)((i, a) => {
|
|
36
37
|
l = l.concat(i);
|
|
37
38
|
function r() {
|
|
38
39
|
const o = /* @__PURE__ */ new Set();
|
|
39
40
|
for (let s = 0; s < l.length; s++) {
|
|
40
41
|
if (o.has(l[s].target)) continue;
|
|
41
42
|
o.add(l[s].target);
|
|
42
|
-
const
|
|
43
|
-
|
|
43
|
+
const m = c.get(l[s].target);
|
|
44
|
+
m == null || m.forEach((v) => v(l[s], a));
|
|
44
45
|
}
|
|
45
46
|
l = [], n = !1;
|
|
46
47
|
}
|
|
47
48
|
n || window.requestAnimationFrame(r), n = !0;
|
|
48
49
|
});
|
|
49
50
|
return {
|
|
50
|
-
observer:
|
|
51
|
-
subscribe(i,
|
|
51
|
+
observer: d,
|
|
52
|
+
subscribe(i, a) {
|
|
52
53
|
var r;
|
|
53
|
-
|
|
54
|
+
d.observe(i);
|
|
54
55
|
const o = (r = c.get(i)) !== null && r !== void 0 ? r : [];
|
|
55
|
-
o.push(
|
|
56
|
+
o.push(a), c.set(i, o);
|
|
56
57
|
},
|
|
57
|
-
unsubscribe(i,
|
|
58
|
+
unsubscribe(i, a) {
|
|
58
59
|
var r;
|
|
59
60
|
const o = (r = c.get(i)) !== null && r !== void 0 ? r : [];
|
|
60
61
|
if (o.length === 1) {
|
|
61
|
-
|
|
62
|
+
d.unobserve(i), c.delete(i);
|
|
62
63
|
return;
|
|
63
64
|
}
|
|
64
|
-
const s = o.indexOf(
|
|
65
|
+
const s = o.indexOf(a);
|
|
65
66
|
s !== -1 && o.splice(s, 1), c.set(i, o);
|
|
66
67
|
}
|
|
67
68
|
};
|
|
68
69
|
}
|
|
69
|
-
let
|
|
70
|
-
const
|
|
70
|
+
let O;
|
|
71
|
+
const ce = (e) => O || (O = re(e)), se = V(/* @__PURE__ */ t("path", {
|
|
71
72
|
d: "M3 18h18v-2H3zm0-5h18v-2H3zm0-7v2h18V6z"
|
|
72
|
-
}), "Menu"),
|
|
73
|
+
}), "Menu"), L = V(/* @__PURE__ */ t("path", {
|
|
73
74
|
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"),
|
|
75
|
+
}), "PersonOutlineOutlined"), R = f("div")(
|
|
75
76
|
({ mobile: e, shadowSecondary: n }) => ({
|
|
76
|
-
...
|
|
77
|
+
...b`
|
|
77
78
|
z-index: 1313;
|
|
78
79
|
display: flex;
|
|
79
80
|
flex-direction: row;
|
|
@@ -85,16 +86,16 @@ const ie = (e) => y || (y = ne(e)), oe = j(/* @__PURE__ */ t("path", {
|
|
|
85
86
|
box-shadow: ${e && n};
|
|
86
87
|
`
|
|
87
88
|
})
|
|
88
|
-
),
|
|
89
|
+
), _ = f("img")(({ width: e }) => ({
|
|
89
90
|
width: `${e}px`
|
|
90
|
-
})),
|
|
91
|
-
...
|
|
91
|
+
})), P = f("div")(({ height: e }) => ({
|
|
92
|
+
...b`
|
|
92
93
|
display: flex;
|
|
93
94
|
gap: 1rem;
|
|
94
95
|
height: ${e}px;
|
|
95
96
|
`
|
|
96
|
-
})),
|
|
97
|
-
...
|
|
97
|
+
})), le = f("div")(({ width: e, loggedIn: n }) => ({
|
|
98
|
+
...b`
|
|
98
99
|
width: ${e}px;
|
|
99
100
|
display: flex;
|
|
100
101
|
justify-content: center;
|
|
@@ -105,15 +106,15 @@ const ie = (e) => y || (y = ne(e)), oe = j(/* @__PURE__ */ t("path", {
|
|
|
105
106
|
white-space: nowrap;
|
|
106
107
|
}
|
|
107
108
|
`
|
|
108
|
-
})),
|
|
109
|
-
...
|
|
109
|
+
})), j = f("div")(({ visible: e }) => ({
|
|
110
|
+
...b`
|
|
110
111
|
z-index: ${e ? 1 : 0};
|
|
111
112
|
opacity: ${e ? 1 : 0};
|
|
112
113
|
pointer-events: ${e ? "auto" : "none"};
|
|
113
114
|
position: ${e ? "relative" : "absolute"};
|
|
114
115
|
`
|
|
115
|
-
})),
|
|
116
|
-
...
|
|
116
|
+
})), A = f("div")(() => ({
|
|
117
|
+
...b`
|
|
117
118
|
display: flex;
|
|
118
119
|
width: 1360px;
|
|
119
120
|
max-width: 100%;
|
|
@@ -127,79 +128,88 @@ const ie = (e) => y || (y = ne(e)), oe = j(/* @__PURE__ */ t("path", {
|
|
|
127
128
|
font-size: 32px;
|
|
128
129
|
line-height: 1;
|
|
129
130
|
margin: 0;
|
|
131
|
+
margin-left: calc(${ee.constants.navDefaultWidth} * 2);
|
|
130
132
|
}
|
|
131
133
|
`
|
|
132
|
-
})),
|
|
134
|
+
})), xe = ({
|
|
133
135
|
isMobile: e,
|
|
134
136
|
loggedIn: n,
|
|
135
137
|
logoProps: l,
|
|
136
138
|
iconColor: c,
|
|
137
|
-
themeProps:
|
|
139
|
+
themeProps: d,
|
|
138
140
|
hamburgerMenu: i,
|
|
139
|
-
iconColors:
|
|
141
|
+
iconColors: a,
|
|
140
142
|
userName: r = "User",
|
|
141
143
|
userSettingsEnabled: o,
|
|
142
144
|
searchFilters: s,
|
|
143
|
-
onHamburgerMenuClick:
|
|
144
|
-
onUserMenuClick:
|
|
145
|
-
onLogin:
|
|
146
|
-
onSearch:
|
|
145
|
+
onHamburgerMenuClick: m,
|
|
146
|
+
onUserMenuClick: v,
|
|
147
|
+
onLogin: F,
|
|
148
|
+
onSearch: U = () => {
|
|
147
149
|
},
|
|
148
|
-
searchPlaceholder:
|
|
149
|
-
onInputChange:
|
|
150
|
+
searchPlaceholder: B = "Search",
|
|
151
|
+
onInputChange: q,
|
|
152
|
+
headerType: g = "search",
|
|
153
|
+
appTitle: S
|
|
150
154
|
}) => {
|
|
151
|
-
const [
|
|
152
|
-
shadowTertiary:
|
|
153
|
-
borderColor:
|
|
154
|
-
borderFocusColor:
|
|
155
|
+
const [x, $] = z(0), [u, D] = z(null), [w, G] = z(null), { logoSrc: W, logoWidth: k, logoHeight: C } = l, { shadowSecondary: J, shadowTertiary: K, iconPrimary: N, borderPrimary: Q } = d, y = {
|
|
156
|
+
shadowTertiary: K,
|
|
157
|
+
borderColor: Q,
|
|
158
|
+
borderFocusColor: N,
|
|
155
159
|
filters: s,
|
|
156
|
-
onSearch:
|
|
157
|
-
placeholder:
|
|
158
|
-
onChange:
|
|
160
|
+
onSearch: U,
|
|
161
|
+
placeholder: B,
|
|
162
|
+
onChange: q
|
|
159
163
|
};
|
|
160
|
-
|
|
161
|
-
u && u.clientWidth >
|
|
162
|
-
}, [u,
|
|
163
|
-
const
|
|
164
|
-
p != null && p.clientWidth && p.clientWidth >
|
|
164
|
+
Z(() => {
|
|
165
|
+
u && u.clientWidth > x && $(u.clientWidth), w && w.clientWidth > x && $(w.clientWidth);
|
|
166
|
+
}, [u, w]);
|
|
167
|
+
const X = (p) => {
|
|
168
|
+
p != null && p.clientWidth && p.clientWidth > x && $(p.clientWidth);
|
|
165
169
|
};
|
|
166
|
-
return
|
|
167
|
-
/* @__PURE__ */ t(
|
|
168
|
-
/* @__PURE__ */
|
|
170
|
+
return oe(u, () => X(u)), e ? /* @__PURE__ */ h(R, { mobile: !0, shadowSecondary: J, children: [
|
|
171
|
+
/* @__PURE__ */ t(P, { height: C, children: /* @__PURE__ */ t(_, { src: W, height: `${C}px`, width: k }) }),
|
|
172
|
+
/* @__PURE__ */ h(A, { children: [
|
|
173
|
+
g === "search" && /* @__PURE__ */ t(E, { ...y }),
|
|
174
|
+
g === "title" && /* @__PURE__ */ t("h1", { children: S })
|
|
175
|
+
] }),
|
|
169
176
|
/* @__PURE__ */ t(
|
|
170
|
-
|
|
177
|
+
I,
|
|
171
178
|
{
|
|
172
|
-
icon: /* @__PURE__ */ t(
|
|
173
|
-
...
|
|
174
|
-
onClick: o ?
|
|
179
|
+
icon: /* @__PURE__ */ t(L, {}),
|
|
180
|
+
...a,
|
|
181
|
+
onClick: o ? v : void 0
|
|
175
182
|
}
|
|
176
183
|
)
|
|
177
|
-
] }) : /* @__PURE__ */
|
|
178
|
-
/* @__PURE__ */
|
|
179
|
-
/* @__PURE__ */ t(
|
|
180
|
-
i && /* @__PURE__ */ t(
|
|
184
|
+
] }) : /* @__PURE__ */ h(R, { children: [
|
|
185
|
+
/* @__PURE__ */ h(P, { height: C, children: [
|
|
186
|
+
/* @__PURE__ */ t(_, { src: W, height: `${C}px`, width: k }),
|
|
187
|
+
i && /* @__PURE__ */ t(H, { variant: "icon", onClick: m, color: c, children: /* @__PURE__ */ t(se, {}) })
|
|
188
|
+
] }),
|
|
189
|
+
/* @__PURE__ */ h(A, { children: [
|
|
190
|
+
g === "search" && /* @__PURE__ */ t(E, { ...y }),
|
|
191
|
+
g === "title" && /* @__PURE__ */ t("h1", { children: S })
|
|
181
192
|
] }),
|
|
182
|
-
/* @__PURE__ */
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
X,
|
|
193
|
+
/* @__PURE__ */ h(le, { width: x, loggedIn: !!n, children: [
|
|
194
|
+
/* @__PURE__ */ t(j, { visible: !!n, ref: D, children: /* @__PURE__ */ t(
|
|
195
|
+
T,
|
|
186
196
|
{
|
|
187
197
|
id: "accountMenuContainer",
|
|
188
198
|
component: /* @__PURE__ */ t(
|
|
189
|
-
|
|
199
|
+
I,
|
|
190
200
|
{
|
|
191
|
-
icon: /* @__PURE__ */ t(
|
|
192
|
-
...
|
|
193
|
-
onClick: o ?
|
|
201
|
+
icon: /* @__PURE__ */ t(L, {}),
|
|
202
|
+
...a,
|
|
203
|
+
onClick: o ? v : void 0
|
|
194
204
|
}
|
|
195
205
|
),
|
|
196
206
|
label: `Hi, ${r}!`
|
|
197
207
|
}
|
|
198
208
|
) }),
|
|
199
|
-
/* @__PURE__ */ t(
|
|
209
|
+
/* @__PURE__ */ t(j, { visible: !n, ref: G, children: /* @__PURE__ */ t(H, { id: "loginButtonContainer", onClick: F, children: "Log In" }) })
|
|
200
210
|
] })
|
|
201
211
|
] });
|
|
202
212
|
};
|
|
203
213
|
export {
|
|
204
|
-
|
|
214
|
+
xe as default
|
|
205
215
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jcicl",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.171",
|
|
5
5
|
"description": "Component library for the websites of Johnson County Iowa",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://devops.jc.net/JCIT/Business%20Solutions%20Delivery/_git/JCComponentLibrary?path=%2FREADME.md&version=GBmaster",
|