jcicl 0.0.118 → 0.0.122

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/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 c, jsxs as u } from "react/jsx-runtime";
2
+ import { useState as j } from "react";
3
+ import { n as v, 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 = v(D, {
8
+ shouldForwardProp: (t) => z(t)
9
+ })(({ active: t, isTablet: n, highlight1: r, highlight3: i, iconColor: e, isMobile: s, 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: t && !s ? r : "transparent",
18
+ boxShadow: t ? e : "none",
19
+ ...n && {
20
20
  gap: "0.5rem"
21
21
  },
22
+ ...s && {
23
+ padding: 0
24
+ },
22
25
  "&:hover, :focus-visible": {
23
26
  svg: {
24
- ...!t && {
27
+ ...!n && {
25
28
  backgroundColor: r
26
29
  }
27
30
  },
28
- ...t && {
29
- boxShadow: d.boxShadows.darkGreen,
31
+ ...n && {
32
+ boxShadow: d,
30
33
  backgroundColor: i
31
34
  }
32
35
  },
@@ -39,7 +42,10 @@ const w = c(k, {
39
42
  display: "flex",
40
43
  alignItems: "center",
41
44
  justifyContent: "center",
42
- transition: "313ms all ease-in-out"
45
+ transition: "313ms all ease-in-out",
46
+ ...s && t && {
47
+ backgroundColor: r
48
+ }
43
49
  },
44
50
  span: {
45
51
  fontFamily: "Roboto, sans-serif",
@@ -47,51 +53,87 @@ const w = c(k, {
47
53
  fontWeight: "bold",
48
54
  color: e,
49
55
  textAlign: "center",
50
- ...t && {
56
+ ...n && {
51
57
  fontSize: "1.5rem",
52
58
  fontWeight: "500"
53
59
  }
54
60
  }
55
- })), P = c("div")(({ navWidth: o, isTablet: t }) => ({
61
+ })), y = v("div")(({ navWidth: t, isTablet: n, isMobile: r, shadowSecondary: i }) => ({
56
62
  display: "flex",
57
- flexDirection: "column",
63
+ flexDirection: r ? "row" : "column",
58
64
  backgroundColor: "transparent",
59
65
  alignItems: "center",
60
- justifyContent: "flex-start",
66
+ justifyContent: r ? "space-between" : "flex-start",
61
67
  maxHeight: "100%",
62
68
  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`,
69
+ gap: n ? 0 : "1rem",
70
+ width: t,
71
+ boxSizing: "border-box",
72
+ ...r && {
73
+ boxShadow: i,
74
+ zIndex: 1313,
75
+ padding: "4px 8px"
76
+ }
77
+ })), $ = ({
78
+ navItems: t,
79
+ activeRoute: n,
80
+ navWidth: r = `${P.constants.navDefaultWidth}px`,
69
81
  isTablet: i,
70
- themeColors: e
82
+ isMobile: e,
83
+ themeColors: s
71
84
  }) => {
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,
85
+ const [d, w] = j(""), f = (a, o) => {
86
+ w(a), o();
87
+ }, { highlightPrimary: g, highlightTertiary: m, iconPrimary: x, shadowSecondary: p, scrollColor: S } = s, k = { navWidth: r, isTablet: i, shadowSecondary: p };
88
+ return e ? /* @__PURE__ */ c(y, { isTablet: !1, navWidth: "100%", isMobile: !0, shadowSecondary: p, children: t.map(({ icon: a, label: o = "", onClick: l = () => {
89
+ }, ...h }) => /* @__PURE__ */ u(
90
+ C,
78
91
  {
79
- ...u,
80
- active: t ? t === n : l === n,
81
- onClick: () => m(n, x),
92
+ ...h,
93
+ active: n ? n === o : d === o,
94
+ onClick: () => f(o, l),
82
95
  isTablet: i,
83
- highlight1: f,
84
- highlight3: h,
85
- iconColor: g,
96
+ highlight1: g,
97
+ highlight3: m,
98
+ iconColor: x,
99
+ shadowSecondary: p,
100
+ isMobile: !0,
86
101
  children: [
87
- s,
88
- /* @__PURE__ */ a("span", { children: n })
102
+ a,
103
+ /* @__PURE__ */ c("span", { children: o })
89
104
  ]
90
105
  },
91
- n
92
- )) }) });
106
+ o
107
+ )) }) : /* @__PURE__ */ c(
108
+ B,
109
+ {
110
+ scrollColor: S,
111
+ direction: "vertical",
112
+ width: r,
113
+ styles: { minWidth: r },
114
+ children: /* @__PURE__ */ c(y, { ...k, children: t.map(({ icon: a, label: o = "", onClick: l = () => {
115
+ }, ...h }) => /* @__PURE__ */ u(
116
+ C,
117
+ {
118
+ ...h,
119
+ active: n ? n === o : d === o,
120
+ onClick: () => f(o, l),
121
+ isTablet: i,
122
+ highlight1: g,
123
+ highlight3: m,
124
+ iconColor: x,
125
+ shadowSecondary: p,
126
+ children: [
127
+ a,
128
+ /* @__PURE__ */ c("span", { children: o })
129
+ ]
130
+ },
131
+ o
132
+ )) })
133
+ }
134
+ );
93
135
  };
94
136
  export {
95
- W as Nav,
96
- W as default
137
+ $ as Nav,
138
+ $ as default
97
139
  };
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;