jcicl 0.0.116 → 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.
- package/.chunks/ButtonBase.js +1 -1
- package/.chunks/DefaultPropsProvider.js +74 -76
- package/.chunks/Input.js +314 -301
- package/.chunks/Portal.js +15 -15
- package/.chunks/TransitionGroupContext.js +6 -6
- package/Accordion/Accordion.js +1 -1
- package/AppContainer/AppContainer.d.ts +8 -3
- package/AppContainer/AppContainer.js +633 -1270
- package/AppHeader/AppHeader.d.ts +5 -0
- package/AppHeader/AppHeader.js +110 -99
- package/Avatar/index.d.ts +1 -1
- package/Button/Button.js +2 -2
- package/EditableInfoCard/EditableInfoCard.js +1 -1
- package/ImageWIthDetails/ImageWithDetails.d.ts +13 -0
- package/ImageWIthDetails/ImageWithDetails.js +49 -0
- package/ImageWIthDetails/index.d.ts +1 -0
- package/ImageWIthDetails/index.js +4 -0
- package/InfoCard/InfoCard.js +4 -4
- package/Input/Input.d.ts +3 -0
- package/Nav/Nav.d.ts +3 -12
- package/Nav/Nav.js +87 -46
- package/Nav/index.d.ts +1 -1
- package/ScrollContainer/ScrollContainer.d.ts +1 -0
- package/ScrollContainer/ScrollContainer.js +216 -213
- package/Tooltip/Tooltip.js +1 -1
- package/package.json +1 -1
- package/theme.d.ts +20 -1
- package/theme.js +8 -4
package/AppHeader/AppHeader.d.ts
CHANGED
|
@@ -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;
|
package/AppHeader/AppHeader.js
CHANGED
|
@@ -1,113 +1,117 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
4
|
-
import { n as
|
|
5
|
-
import { c as
|
|
6
|
-
import { I as
|
|
7
|
-
import { Button as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { c as
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
return
|
|
14
|
-
|
|
15
|
-
}),
|
|
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
|
|
17
|
+
function J() {
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
const
|
|
21
|
-
return
|
|
22
|
-
let
|
|
23
|
-
const
|
|
24
|
-
if (!
|
|
25
|
-
function
|
|
26
|
-
|
|
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
|
|
29
|
-
|
|
28
|
+
return c.subscribe(a, r), () => {
|
|
29
|
+
i = !0, c.unsubscribe(a, r);
|
|
30
30
|
};
|
|
31
|
-
}, [e,
|
|
31
|
+
}, [e, c, d]), c.observer;
|
|
32
32
|
}
|
|
33
|
-
function
|
|
34
|
-
let
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
function
|
|
38
|
-
const
|
|
39
|
-
for (let
|
|
40
|
-
if (
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
|
|
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
|
-
|
|
45
|
+
l = [], t = !1;
|
|
46
46
|
}
|
|
47
|
-
|
|
47
|
+
t || window.requestAnimationFrame(r), t = !0;
|
|
48
48
|
});
|
|
49
49
|
return {
|
|
50
|
-
observer:
|
|
51
|
-
subscribe(
|
|
52
|
-
var
|
|
53
|
-
|
|
54
|
-
const
|
|
55
|
-
|
|
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(
|
|
58
|
-
var
|
|
59
|
-
const
|
|
60
|
-
if (
|
|
61
|
-
|
|
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
|
|
65
|
-
|
|
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
|
|
70
|
-
const
|
|
69
|
+
let $;
|
|
70
|
+
const Q = (e) => $ || ($ = N(e)), X = T(/* @__PURE__ */ n("path", {
|
|
71
71
|
d: "M3 18h18v-2H3zm0-5h18v-2H3zm0-7v2h18V6z"
|
|
72
|
-
}), "Menu"),
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
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
|
-
})),
|
|
85
|
-
...
|
|
88
|
+
})), I = h("div")(({ height: e }) => ({
|
|
89
|
+
...b`
|
|
86
90
|
display: flex;
|
|
87
91
|
gap: 1rem;
|
|
88
92
|
height: ${e}px;
|
|
89
93
|
`
|
|
90
|
-
})),
|
|
91
|
-
...
|
|
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: ${
|
|
100
|
+
flex-direction: ${t ? "column" : "column-reverse"};
|
|
97
101
|
flex-shrink: 0;
|
|
98
102
|
* {
|
|
99
103
|
white-space: nowrap;
|
|
100
104
|
}
|
|
101
105
|
`
|
|
102
|
-
})),
|
|
103
|
-
...
|
|
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
|
-
})),
|
|
110
|
-
...
|
|
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
|
-
})),
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
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:
|
|
132
|
+
onLogin: s
|
|
126
133
|
}) => {
|
|
127
|
-
const [
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}, [
|
|
131
|
-
const
|
|
132
|
-
|
|
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
|
|
135
|
-
/* @__PURE__ */
|
|
136
|
-
|
|
137
|
-
|
|
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__ */
|
|
140
|
-
/* @__PURE__ */
|
|
141
|
-
/* @__PURE__ */
|
|
142
|
-
|
|
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__ */
|
|
156
|
+
component: /* @__PURE__ */ n(E, { ...a, onClick: o }),
|
|
146
157
|
label: "Welcome, User"
|
|
147
158
|
}
|
|
148
159
|
) }),
|
|
149
|
-
/* @__PURE__ */
|
|
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
|
-
|
|
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/Button/Button.js
CHANGED
|
@@ -465,11 +465,11 @@ const E = c(k)`
|
|
|
465
465
|
font-weight: 400;
|
|
466
466
|
padding: 0.75rem 2rem;
|
|
467
467
|
font-size: 1rem;
|
|
468
|
-
box-shadow: ${s.
|
|
468
|
+
box-shadow: ${s.boxShadows.gray63};
|
|
469
469
|
&:hover,
|
|
470
470
|
:focus-visible {
|
|
471
471
|
background-color: ${s.colors.darkGreen};
|
|
472
|
-
box-shadow: ${s.
|
|
472
|
+
box-shadow: ${s.boxShadows.black63};
|
|
473
473
|
}
|
|
474
474
|
&:disabled {
|
|
475
475
|
background-color: ${s.colors.darkGreen};
|
|
@@ -107,7 +107,7 @@ const eo = j(/* @__PURE__ */ o("path", {
|
|
|
107
107
|
title: a,
|
|
108
108
|
items: r = [],
|
|
109
109
|
padding: u = "1rem 2rem",
|
|
110
|
-
shadow: c = d.
|
|
110
|
+
shadow: c = d.boxShadows.darkGreen,
|
|
111
111
|
spacing: V = "2rem",
|
|
112
112
|
titleSpacing: w = "1rem",
|
|
113
113
|
canEditTitle: C = !0,
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface ImageWithDetailsProps {
|
|
2
|
+
title: React.ReactNode;
|
|
3
|
+
description?: React.ReactNode;
|
|
4
|
+
imageUrl: string;
|
|
5
|
+
imageAlt: string;
|
|
6
|
+
/** The total size of the component */
|
|
7
|
+
containerHeight?: string;
|
|
8
|
+
/** The size of the title header and details section */
|
|
9
|
+
detailsBarSize?: string;
|
|
10
|
+
detailsBarPadding?: string;
|
|
11
|
+
}
|
|
12
|
+
declare const ImageWithDetails: React.FC<ImageWithDetailsProps>;
|
|
13
|
+
export default ImageWithDetails;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsxs as g, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { n as r } from "../.chunks/emotion-styled.browser.esm.js";
|
|
3
|
+
import { c as n } from "../.chunks/emotion-react.browser.esm.js";
|
|
4
|
+
import e from "../theme.js";
|
|
5
|
+
const f = r("div")(({ height: o }) => ({
|
|
6
|
+
...n`
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
border-radius: 32px;
|
|
10
|
+
box-sizing: border-box;
|
|
11
|
+
height: ${o};
|
|
12
|
+
box-shadow: ${e.boxShadows.gray63};
|
|
13
|
+
background-color: ${e.colors.white};
|
|
14
|
+
width: min-content;
|
|
15
|
+
`
|
|
16
|
+
})), a = r("div")(({ height: o, padding: t }) => ({
|
|
17
|
+
...n`
|
|
18
|
+
font-family: ${e.fonts.roboto};
|
|
19
|
+
display: flex;
|
|
20
|
+
padding: ${t};
|
|
21
|
+
align-items: center;
|
|
22
|
+
justify-content: center;
|
|
23
|
+
height: ${o};
|
|
24
|
+
box-sizing: border-box;
|
|
25
|
+
`
|
|
26
|
+
})), x = r("img")(({ heightOffset: o }) => ({
|
|
27
|
+
...n`
|
|
28
|
+
max-height: calc(100% - 2 * ${o});
|
|
29
|
+
object-fit: contain;
|
|
30
|
+
`
|
|
31
|
+
})), y = ({
|
|
32
|
+
title: o,
|
|
33
|
+
description: t,
|
|
34
|
+
imageUrl: d,
|
|
35
|
+
imageAlt: h,
|
|
36
|
+
detailsBarSize: s = "120px",
|
|
37
|
+
detailsBarPadding: l = "1rem",
|
|
38
|
+
containerHeight: m = "100%"
|
|
39
|
+
}) => {
|
|
40
|
+
const c = { height: s, padding: l };
|
|
41
|
+
return /* @__PURE__ */ g(f, { height: m, children: [
|
|
42
|
+
/* @__PURE__ */ i(a, { ...c, children: o }),
|
|
43
|
+
/* @__PURE__ */ i(x, { heightOffset: s, src: d, alt: h }),
|
|
44
|
+
/* @__PURE__ */ i(a, { ...c, children: t })
|
|
45
|
+
] });
|
|
46
|
+
};
|
|
47
|
+
export {
|
|
48
|
+
y as default
|
|
49
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default, type ImageWithDetailsProps } from './ImageWithDetails';
|
package/InfoCard/InfoCard.js
CHANGED
|
@@ -33,16 +33,16 @@ const x = d("div")(({ padding: r, shadow: o, styles: e }) => ({
|
|
|
33
33
|
title: o,
|
|
34
34
|
items: e,
|
|
35
35
|
padding: m = "1rem 2rem",
|
|
36
|
-
shadow:
|
|
37
|
-
spacing:
|
|
36
|
+
shadow: s = l.boxShadows.darkGreen,
|
|
37
|
+
spacing: c = "2rem",
|
|
38
38
|
columns: p = 3,
|
|
39
39
|
styles: f
|
|
40
|
-
}) => /* @__PURE__ */ t(x, { ...{ padding: m, shadow:
|
|
40
|
+
}) => /* @__PURE__ */ t(x, { ...{ padding: m, shadow: s, styles: f }, children: [
|
|
41
41
|
/* @__PURE__ */ t(g, { width: "100%", gap: "1rem", alignItems: "center", children: [
|
|
42
42
|
r && r,
|
|
43
43
|
/* @__PURE__ */ a("h3", { children: o })
|
|
44
44
|
] }),
|
|
45
|
-
/* @__PURE__ */ a(u, { ...{ spacing:
|
|
45
|
+
/* @__PURE__ */ a(u, { ...{ spacing: c, columns: p }, children: e == null ? void 0 : e.map((n) => /* @__PURE__ */ a(h, { ...n }, n.label)) })
|
|
46
46
|
] });
|
|
47
47
|
export {
|
|
48
48
|
j as InfoCard,
|
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
|
-
|
|
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
|
-
|
|
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
|
|
2
|
-
import { useState as
|
|
3
|
-
import { n as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { B as
|
|
7
|
-
const
|
|
8
|
-
shouldForwardProp: (
|
|
9
|
-
})(({ active:
|
|
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:
|
|
11
|
+
flexDirection: n ? "row" : "column",
|
|
12
12
|
alignItems: "center",
|
|
13
|
-
justifyContent:
|
|
13
|
+
justifyContent: n ? "flex-start" : "center",
|
|
14
14
|
width: "100%",
|
|
15
|
-
padding:
|
|
15
|
+
padding: n ? "16px" : "0 8px 8px 8px",
|
|
16
16
|
transition: "313ms all ease-in-out",
|
|
17
|
-
backgroundColor:
|
|
18
|
-
boxShadow:
|
|
19
|
-
...
|
|
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
|
-
...!
|
|
25
|
-
backgroundColor:
|
|
27
|
+
...!n && {
|
|
28
|
+
backgroundColor: t
|
|
26
29
|
}
|
|
27
30
|
},
|
|
28
|
-
...
|
|
29
|
-
boxShadow: d
|
|
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
|
-
...
|
|
53
|
+
...n && {
|
|
51
54
|
fontSize: "1.5rem",
|
|
52
55
|
fontWeight: "500"
|
|
53
56
|
}
|
|
54
57
|
}
|
|
55
|
-
})),
|
|
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:
|
|
64
|
-
width:
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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
|
-
|
|
81
|
+
isMobile: e,
|
|
82
|
+
themeColors: c
|
|
71
83
|
}) => {
|
|
72
|
-
const [
|
|
73
|
-
|
|
74
|
-
}, { highlightPrimary: f, highlightTertiary:
|
|
75
|
-
return /* @__PURE__ */ a(
|
|
76
|
-
}, ...
|
|
77
|
-
|
|
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
|
-
...
|
|
80
|
-
active:
|
|
81
|
-
onClick: () =>
|
|
91
|
+
...l,
|
|
92
|
+
active: n ? n === o : d === o,
|
|
93
|
+
onClick: () => g(o, p),
|
|
82
94
|
isTablet: i,
|
|
83
95
|
highlight1: f,
|
|
84
|
-
highlight3:
|
|
85
|
-
iconColor:
|
|
96
|
+
highlight3: m,
|
|
97
|
+
iconColor: x,
|
|
98
|
+
shadowSecondary: h,
|
|
99
|
+
isMobile: !0,
|
|
86
100
|
children: [
|
|
87
101
|
s,
|
|
88
|
-
/* @__PURE__ */ a("span", { children:
|
|
102
|
+
/* @__PURE__ */ a("span", { children: o })
|
|
89
103
|
]
|
|
90
104
|
},
|
|
91
|
-
|
|
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
|
-
|
|
96
|
-
|
|
136
|
+
$ as Nav,
|
|
137
|
+
$ as default
|
|
97
138
|
};
|
package/Nav/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default, type NavProps, type NavItemProps
|
|
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;
|