jcicl 0.0.132 → 0.0.133
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/AppContainer/AppContainer.d.ts +1 -1
- package/AppHeader/AppHeader.d.ts +2 -0
- package/AppHeader/AppHeader.js +73 -65
- package/Button/Button.d.ts +2 -1
- package/Button/Button.js +111 -93
- package/Flex/Flex.js +12 -11
- package/README.md +106 -106
- package/Search/Search.d.ts +3 -3
- package/Search/Search.js +127 -63
- package/Search/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import { AppHeaderProps, CustomLogoProps } from '../../../../../../../../../src/
|
|
|
3
3
|
import { NavProps, NavItemProps } from '../../../../../../../../../src/components/supercomposite/Nav/Nav';
|
|
4
4
|
import { IconProps } from '../../../../../../../../../src/components/base/Icon';
|
|
5
5
|
import { TemplateThemeProps } from '../../../../../../../../../src/components/theme';
|
|
6
|
-
type ReducedAppHeaderProps = Omit<AppHeaderProps, 'logoProps' | 'iconColor | loggedIn'>;
|
|
6
|
+
type ReducedAppHeaderProps = Omit<AppHeaderProps, 'logoProps' | 'iconColor' | 'loggedIn' | 'themeProps'>;
|
|
7
7
|
interface UserInfo {
|
|
8
8
|
name: string;
|
|
9
9
|
email: string;
|
package/AppHeader/AppHeader.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SearchFilterProps } from '../../../../../../../../../src/components/composite/Search';
|
|
1
2
|
import { IconProps } from '../../../../../../../../../src/components/base/Icon';
|
|
2
3
|
import { TemplateThemeProps } from '../../../../../../../../../src/components/theme';
|
|
3
4
|
export interface CustomLogoProps {
|
|
@@ -20,6 +21,7 @@ export interface AppHeaderProps {
|
|
|
20
21
|
iconColors?: IconProps;
|
|
21
22
|
userName?: string;
|
|
22
23
|
userSettingsEnabled?: boolean;
|
|
24
|
+
searchFilters?: SearchFilterProps[];
|
|
23
25
|
}
|
|
24
26
|
declare const AppHeader: React.FC<AppHeaderProps>;
|
|
25
27
|
export default AppHeader;
|
package/AppHeader/AppHeader.js
CHANGED
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
4
|
-
import { n as
|
|
1
|
+
import { jsx as t, jsxs as w } from "react/jsx-runtime";
|
|
2
|
+
import * as W from "react";
|
|
3
|
+
import J, { useState as $, useLayoutEffect as K } from "react";
|
|
4
|
+
import { n as f } from "../.chunks/emotion-styled.browser.esm.js";
|
|
5
5
|
import { c as m } from "../.chunks/emotion-react.browser.esm.js";
|
|
6
|
-
import { Search as
|
|
7
|
-
import { Button as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { c as
|
|
11
|
-
const
|
|
12
|
-
const n =
|
|
13
|
-
return
|
|
6
|
+
import { Search as k } from "../Search/Search.js";
|
|
7
|
+
import { Button as M } from "../Button/Button.js";
|
|
8
|
+
import E from "../Icon/Icon.js";
|
|
9
|
+
import N from "../WithLabel/WithLabel.js";
|
|
10
|
+
import { c as A } from "../.chunks/createSvgIcon.js";
|
|
11
|
+
const Q = J[typeof document < "u" && document.createElement !== void 0 ? "useLayoutEffect" : "useEffect"], X = (e) => {
|
|
12
|
+
const n = W.useRef(e);
|
|
13
|
+
return W.useEffect(() => {
|
|
14
14
|
n.current = e;
|
|
15
15
|
}), n;
|
|
16
16
|
};
|
|
17
|
-
function
|
|
17
|
+
function Y() {
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
const c =
|
|
21
|
-
return
|
|
19
|
+
function Z(e, n, l = {}) {
|
|
20
|
+
const c = te(l.polyfill), a = X(n);
|
|
21
|
+
return Q(() => {
|
|
22
22
|
let i = !1;
|
|
23
23
|
const d = e && "current" in e ? e.current : e;
|
|
24
|
-
if (!d) return
|
|
24
|
+
if (!d) return Y;
|
|
25
25
|
function r(o, s) {
|
|
26
|
-
i ||
|
|
26
|
+
i || a.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,
|
|
31
|
+
}, [e, c, a]), c.observer;
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function ee(e) {
|
|
34
34
|
let n = !1, l = [];
|
|
35
|
-
const c = /* @__PURE__ */ new Map(),
|
|
35
|
+
const c = /* @__PURE__ */ new Map(), a = 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
|
|
43
|
-
|
|
42
|
+
const h = c.get(l[s].target);
|
|
43
|
+
h == null || h.forEach((b) => b(l[s], d));
|
|
44
44
|
}
|
|
45
45
|
l = [], n = !1;
|
|
46
46
|
}
|
|
47
47
|
n || window.requestAnimationFrame(r), n = !0;
|
|
48
48
|
});
|
|
49
49
|
return {
|
|
50
|
-
observer:
|
|
50
|
+
observer: a,
|
|
51
51
|
subscribe(i, d) {
|
|
52
52
|
var r;
|
|
53
|
-
|
|
53
|
+
a.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 Z(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
|
-
|
|
61
|
+
a.unobserve(i), c.delete(i);
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
64
64
|
const s = o.indexOf(d);
|
|
@@ -67,11 +67,11 @@ function Z(e) {
|
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
69
|
let y;
|
|
70
|
-
const
|
|
70
|
+
const te = (e) => y || (y = ee(e)), ne = A(/* @__PURE__ */ t("path", {
|
|
71
71
|
d: "M3 18h18v-2H3zm0-5h18v-2H3zm0-7v2h18V6z"
|
|
72
|
-
}), "Menu"),
|
|
72
|
+
}), "Menu"), H = A(/* @__PURE__ */ t("path", {
|
|
73
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"),
|
|
74
|
+
}), "PersonOutlineOutlined"), I = f("div")(
|
|
75
75
|
({ mobile: e, shadowSecondary: n }) => ({
|
|
76
76
|
...m`
|
|
77
77
|
z-index: 1313;
|
|
@@ -85,15 +85,15 @@ const ee = (e) => y || (y = Z(e)), te = j(/* @__PURE__ */ t("path", {
|
|
|
85
85
|
box-shadow: ${e && n};
|
|
86
86
|
`
|
|
87
87
|
})
|
|
88
|
-
),
|
|
88
|
+
), L = f("img")(({ width: e }) => ({
|
|
89
89
|
width: `${e}px`
|
|
90
|
-
})),
|
|
90
|
+
})), R = f("div")(({ height: e }) => ({
|
|
91
91
|
...m`
|
|
92
92
|
display: flex;
|
|
93
93
|
gap: 1rem;
|
|
94
94
|
height: ${e}px;
|
|
95
95
|
`
|
|
96
|
-
})),
|
|
96
|
+
})), ie = f("div")(({ width: e, loggedIn: n }) => ({
|
|
97
97
|
...m`
|
|
98
98
|
width: ${e}px;
|
|
99
99
|
display: flex;
|
|
@@ -105,14 +105,14 @@ const ee = (e) => y || (y = Z(e)), te = j(/* @__PURE__ */ t("path", {
|
|
|
105
105
|
white-space: nowrap;
|
|
106
106
|
}
|
|
107
107
|
`
|
|
108
|
-
})),
|
|
108
|
+
})), _ = f("div")(({ visible: e }) => ({
|
|
109
109
|
...m`
|
|
110
110
|
z-index: ${e ? 1 : 0};
|
|
111
111
|
opacity: ${e ? 1 : 0};
|
|
112
112
|
pointer-events: ${e ? "auto" : "none"};
|
|
113
113
|
position: ${e ? "relative" : "absolute"};
|
|
114
114
|
`
|
|
115
|
-
})),
|
|
115
|
+
})), P = f("div")(() => ({
|
|
116
116
|
...m`
|
|
117
117
|
display: flex;
|
|
118
118
|
width: 1360px;
|
|
@@ -121,66 +121,74 @@ const ee = (e) => y || (y = Z(e)), te = j(/* @__PURE__ */ t("path", {
|
|
|
121
121
|
width: 100%;
|
|
122
122
|
}
|
|
123
123
|
`
|
|
124
|
-
})),
|
|
124
|
+
})), he = ({
|
|
125
125
|
isMobile: e,
|
|
126
126
|
loggedIn: n,
|
|
127
127
|
logoProps: l,
|
|
128
128
|
iconColor: c,
|
|
129
|
-
themeProps:
|
|
129
|
+
themeProps: a,
|
|
130
130
|
hamburgerMenu: i,
|
|
131
131
|
iconColors: d,
|
|
132
132
|
userName: r = "User",
|
|
133
133
|
userSettingsEnabled: o,
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
134
|
+
searchFilters: s,
|
|
135
|
+
onHamburgerMenuClick: h,
|
|
136
|
+
onUserMenuClick: b,
|
|
137
|
+
onLogin: j,
|
|
138
|
+
onSearch: V = () => {
|
|
138
139
|
}
|
|
139
140
|
}) => {
|
|
140
|
-
const [
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
141
|
+
const [v, C] = $(0), [u, F] = $(null), [g, U] = $(null), { logoSrc: z, logoWidth: O, logoHeight: x } = l, { shadowSecondary: B, shadowTertiary: q, iconPrimary: T, borderPrimary: D } = a, S = {
|
|
142
|
+
shadowTertiary: q,
|
|
143
|
+
borderColor: D,
|
|
144
|
+
borderFocusColor: T,
|
|
145
|
+
filters: s,
|
|
146
|
+
onSearch: V,
|
|
147
|
+
placeholder: "Search..."
|
|
146
148
|
};
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
149
|
+
K(() => {
|
|
150
|
+
u && u.clientWidth > v && C(u.clientWidth), g && g.clientWidth > v && C(g.clientWidth);
|
|
151
|
+
}, [u, g]);
|
|
152
|
+
const G = (p) => {
|
|
153
|
+
p != null && p.clientWidth && p.clientWidth > v && C(p.clientWidth);
|
|
154
|
+
};
|
|
155
|
+
return Z(u, () => G(u)), e ? /* @__PURE__ */ w(I, { mobile: !0, shadowSecondary: B, children: [
|
|
156
|
+
/* @__PURE__ */ t(R, { height: x, children: /* @__PURE__ */ t(L, { src: z, height: `${x}px`, width: O }) }),
|
|
157
|
+
/* @__PURE__ */ t(P, { children: /* @__PURE__ */ t(k, { ...S }) }),
|
|
150
158
|
/* @__PURE__ */ t(
|
|
151
|
-
|
|
159
|
+
E,
|
|
152
160
|
{
|
|
153
|
-
icon: /* @__PURE__ */ t(
|
|
161
|
+
icon: /* @__PURE__ */ t(H, {}),
|
|
154
162
|
...d,
|
|
155
|
-
onClick: o ?
|
|
163
|
+
onClick: o ? b : void 0
|
|
156
164
|
}
|
|
157
165
|
)
|
|
158
|
-
] }) : /* @__PURE__ */
|
|
159
|
-
/* @__PURE__ */
|
|
160
|
-
/* @__PURE__ */ t(
|
|
161
|
-
i && /* @__PURE__ */ t(
|
|
166
|
+
] }) : /* @__PURE__ */ w(I, { children: [
|
|
167
|
+
/* @__PURE__ */ w(R, { height: x, children: [
|
|
168
|
+
/* @__PURE__ */ t(L, { src: z, height: `${x}px`, width: O }),
|
|
169
|
+
i && /* @__PURE__ */ t(M, { variant: "icon", onClick: h, color: c, children: /* @__PURE__ */ t(ne, {}) })
|
|
162
170
|
] }),
|
|
163
|
-
/* @__PURE__ */ t(
|
|
164
|
-
/* @__PURE__ */
|
|
165
|
-
/* @__PURE__ */ t(
|
|
166
|
-
|
|
171
|
+
/* @__PURE__ */ t(P, { children: /* @__PURE__ */ t(k, { ...S }) }),
|
|
172
|
+
/* @__PURE__ */ w(ie, { width: v, loggedIn: !!n, children: [
|
|
173
|
+
/* @__PURE__ */ t(_, { visible: !!n, ref: F, children: /* @__PURE__ */ t(
|
|
174
|
+
N,
|
|
167
175
|
{
|
|
168
176
|
id: "accountMenuContainer",
|
|
169
177
|
component: /* @__PURE__ */ t(
|
|
170
|
-
|
|
178
|
+
E,
|
|
171
179
|
{
|
|
172
|
-
icon: /* @__PURE__ */ t(
|
|
180
|
+
icon: /* @__PURE__ */ t(H, {}),
|
|
173
181
|
...d,
|
|
174
|
-
onClick: o ?
|
|
182
|
+
onClick: o ? b : void 0
|
|
175
183
|
}
|
|
176
184
|
),
|
|
177
185
|
label: `Hi, ${r}!`
|
|
178
186
|
}
|
|
179
187
|
) }),
|
|
180
|
-
/* @__PURE__ */ t(
|
|
188
|
+
/* @__PURE__ */ t(_, { visible: !n, ref: U, children: /* @__PURE__ */ t(M, { id: "loginButtonContainer", onClick: j, children: "Log In" }) })
|
|
181
189
|
] })
|
|
182
190
|
] });
|
|
183
191
|
};
|
|
184
192
|
export {
|
|
185
|
-
|
|
193
|
+
he as default
|
|
186
194
|
};
|
package/Button/Button.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
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' | 'bibi' | 'bibiOutlined' | 'bibiInverse';
|
|
3
|
+
variant?: 1 | 2 | 'unstyled' | 'icon' | 'bibi' | 'bibiOutlined' | 'bibiInverse' | 'filter';
|
|
4
4
|
size?: number;
|
|
5
5
|
color?: string;
|
|
6
6
|
highlightColor?: string;
|
|
7
|
+
active?: boolean;
|
|
7
8
|
}
|
|
8
9
|
export declare const Button: React.FC<ButtonProps & {
|
|
9
10
|
children: React.ReactNode;
|
package/Button/Button.js
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
import { jsxs as H, jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import * as g from "react";
|
|
3
|
-
import { g as _, a as A, s as
|
|
3
|
+
import { g as _, a as A, s as c, r as q, c as d, f as J, u as K, b as O, P as t, d as Q, e as v } from "../.chunks/DefaultPropsProvider.js";
|
|
4
4
|
import { m as X } from "../.chunks/memoTheme.js";
|
|
5
5
|
import { c as Y } from "../.chunks/createSimplePaletteValueFilter.js";
|
|
6
6
|
import { B as S } from "../.chunks/ButtonBase.js";
|
|
7
7
|
import { i as Z } from "../.chunks/emotion-styled.browser.esm.js";
|
|
8
|
-
import { c as
|
|
9
|
-
import
|
|
8
|
+
import { c as x } from "../.chunks/emotion-react.browser.esm.js";
|
|
9
|
+
import r from "../theme.js";
|
|
10
10
|
function oo(o) {
|
|
11
11
|
return _("MuiButton", o);
|
|
12
12
|
}
|
|
13
13
|
const u = A("MuiButton", ["root", "text", "textInherit", "textPrimary", "textSecondary", "textSuccess", "textError", "textInfo", "textWarning", "outlined", "outlinedInherit", "outlinedPrimary", "outlinedSecondary", "outlinedSuccess", "outlinedError", "outlinedInfo", "outlinedWarning", "contained", "containedInherit", "containedPrimary", "containedSecondary", "containedSuccess", "containedError", "containedInfo", "containedWarning", "disableElevation", "focusVisible", "disabled", "colorInherit", "colorPrimary", "colorSecondary", "colorSuccess", "colorError", "colorInfo", "colorWarning", "textSizeSmall", "textSizeMedium", "textSizeLarge", "outlinedSizeSmall", "outlinedSizeMedium", "outlinedSizeLarge", "containedSizeSmall", "containedSizeMedium", "containedSizeLarge", "sizeMedium", "sizeSmall", "sizeLarge", "fullWidth", "startIcon", "endIcon", "icon", "iconSizeSmall", "iconSizeMedium", "iconSizeLarge"]), R = /* @__PURE__ */ g.createContext({});
|
|
14
14
|
process.env.NODE_ENV !== "production" && (R.displayName = "ButtonGroupContext");
|
|
15
|
-
const
|
|
16
|
-
process.env.NODE_ENV !== "production" && (
|
|
15
|
+
const N = /* @__PURE__ */ g.createContext(void 0);
|
|
16
|
+
process.env.NODE_ENV !== "production" && (N.displayName = "ButtonGroupButtonContext");
|
|
17
17
|
const to = (o) => {
|
|
18
18
|
const {
|
|
19
|
-
color:
|
|
20
|
-
disableElevation:
|
|
19
|
+
color: n,
|
|
20
|
+
disableElevation: a,
|
|
21
21
|
fullWidth: e,
|
|
22
22
|
size: i,
|
|
23
|
-
variant:
|
|
24
|
-
classes:
|
|
25
|
-
} = o,
|
|
26
|
-
root: ["root",
|
|
23
|
+
variant: p,
|
|
24
|
+
classes: s
|
|
25
|
+
} = o, f = {
|
|
26
|
+
root: ["root", p, `${p}${d(n)}`, `size${d(i)}`, `${p}Size${d(i)}`, `color${d(n)}`, a && "disableElevation", e && "fullWidth"],
|
|
27
27
|
label: ["label"],
|
|
28
|
-
startIcon: ["icon", "startIcon", `iconSize${
|
|
29
|
-
endIcon: ["icon", "endIcon", `iconSize${
|
|
30
|
-
},
|
|
28
|
+
startIcon: ["icon", "startIcon", `iconSize${d(i)}`],
|
|
29
|
+
endIcon: ["icon", "endIcon", `iconSize${d(i)}`]
|
|
30
|
+
}, $ = Q(f, oo, s);
|
|
31
31
|
return {
|
|
32
|
-
...
|
|
32
|
+
...s,
|
|
33
33
|
// forward the focused, disabled, etc. classes to the ButtonBase
|
|
34
|
-
|
|
34
|
+
...$
|
|
35
35
|
};
|
|
36
|
-
},
|
|
36
|
+
}, E = [{
|
|
37
37
|
props: {
|
|
38
38
|
size: "small"
|
|
39
39
|
},
|
|
@@ -60,20 +60,20 @@ const to = (o) => {
|
|
|
60
60
|
fontSize: 22
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
}], ro =
|
|
63
|
+
}], ro = c(S, {
|
|
64
64
|
shouldForwardProp: (o) => q(o) || o === "classes",
|
|
65
65
|
name: "MuiButton",
|
|
66
66
|
slot: "Root",
|
|
67
|
-
overridesResolver: (o,
|
|
67
|
+
overridesResolver: (o, n) => {
|
|
68
68
|
const {
|
|
69
|
-
ownerState:
|
|
69
|
+
ownerState: a
|
|
70
70
|
} = o;
|
|
71
|
-
return [
|
|
71
|
+
return [n.root, n[a.variant], n[`${a.variant}${d(a.color)}`], n[`size${d(a.size)}`], n[`${a.variant}Size${d(a.size)}`], a.color === "inherit" && n.colorInherit, a.disableElevation && n.disableElevation, a.fullWidth && n.fullWidth];
|
|
72
72
|
}
|
|
73
73
|
})(X(({
|
|
74
74
|
theme: o
|
|
75
75
|
}) => {
|
|
76
|
-
const
|
|
76
|
+
const n = o.palette.mode === "light" ? o.palette.grey[300] : o.palette.grey[800], a = o.palette.mode === "light" ? o.palette.grey.A100 : o.palette.grey[700];
|
|
77
77
|
return {
|
|
78
78
|
...o.typography.button,
|
|
79
79
|
minWidth: 64,
|
|
@@ -165,10 +165,10 @@ const to = (o) => {
|
|
|
165
165
|
style: {
|
|
166
166
|
color: "inherit",
|
|
167
167
|
borderColor: "currentColor",
|
|
168
|
-
"--variant-containedBg": o.vars ? o.vars.palette.Button.inheritContainedBg :
|
|
168
|
+
"--variant-containedBg": o.vars ? o.vars.palette.Button.inheritContainedBg : n,
|
|
169
169
|
"@media (hover: hover)": {
|
|
170
170
|
"&:hover": {
|
|
171
|
-
"--variant-containedBg": o.vars ? o.vars.palette.Button.inheritContainedHoverBg :
|
|
171
|
+
"--variant-containedBg": o.vars ? o.vars.palette.Button.inheritContainedHoverBg : a,
|
|
172
172
|
"--variant-textBg": o.vars ? `rgba(${o.vars.palette.text.primaryChannel} / ${o.vars.palette.action.hoverOpacity})` : v(o.palette.text.primary, o.palette.action.hoverOpacity),
|
|
173
173
|
"--variant-outlinedBg": o.vars ? `rgba(${o.vars.palette.text.primaryChannel} / ${o.vars.palette.action.hoverOpacity})` : v(o.palette.text.primary, o.palette.action.hoverOpacity)
|
|
174
174
|
}
|
|
@@ -256,14 +256,14 @@ const to = (o) => {
|
|
|
256
256
|
}
|
|
257
257
|
}]
|
|
258
258
|
};
|
|
259
|
-
})), ao =
|
|
259
|
+
})), ao = c("span", {
|
|
260
260
|
name: "MuiButton",
|
|
261
261
|
slot: "StartIcon",
|
|
262
|
-
overridesResolver: (o,
|
|
262
|
+
overridesResolver: (o, n) => {
|
|
263
263
|
const {
|
|
264
|
-
ownerState:
|
|
264
|
+
ownerState: a
|
|
265
265
|
} = o;
|
|
266
|
-
return [
|
|
266
|
+
return [n.startIcon, n[`iconSize${d(a.size)}`]];
|
|
267
267
|
}
|
|
268
268
|
})({
|
|
269
269
|
display: "inherit",
|
|
@@ -276,15 +276,15 @@ const to = (o) => {
|
|
|
276
276
|
style: {
|
|
277
277
|
marginLeft: -2
|
|
278
278
|
}
|
|
279
|
-
}, ...
|
|
280
|
-
}), no =
|
|
279
|
+
}, ...E]
|
|
280
|
+
}), no = c("span", {
|
|
281
281
|
name: "MuiButton",
|
|
282
282
|
slot: "EndIcon",
|
|
283
|
-
overridesResolver: (o,
|
|
283
|
+
overridesResolver: (o, n) => {
|
|
284
284
|
const {
|
|
285
|
-
ownerState:
|
|
285
|
+
ownerState: a
|
|
286
286
|
} = o;
|
|
287
|
-
return [
|
|
287
|
+
return [n.endIcon, n[`iconSize${d(a.size)}`]];
|
|
288
288
|
}
|
|
289
289
|
})({
|
|
290
290
|
display: "inherit",
|
|
@@ -297,14 +297,14 @@ const to = (o) => {
|
|
|
297
297
|
style: {
|
|
298
298
|
marginRight: -2
|
|
299
299
|
}
|
|
300
|
-
}, ...
|
|
301
|
-
}), T = /* @__PURE__ */ g.forwardRef(function(
|
|
302
|
-
const e = g.useContext(R), i = g.useContext(
|
|
303
|
-
props:
|
|
300
|
+
}, ...E]
|
|
301
|
+
}), T = /* @__PURE__ */ g.forwardRef(function(n, a) {
|
|
302
|
+
const e = g.useContext(R), i = g.useContext(N), p = J(e, n), s = K({
|
|
303
|
+
props: p,
|
|
304
304
|
name: "MuiButton"
|
|
305
305
|
}), {
|
|
306
|
-
children:
|
|
307
|
-
color:
|
|
306
|
+
children: f,
|
|
307
|
+
color: $ = "primary",
|
|
308
308
|
component: w = "button",
|
|
309
309
|
className: P,
|
|
310
310
|
disabled: m = !1,
|
|
@@ -316,11 +316,11 @@ const to = (o) => {
|
|
|
316
316
|
size: j = "medium",
|
|
317
317
|
startIcon: I,
|
|
318
318
|
type: k,
|
|
319
|
-
variant:
|
|
320
|
-
...
|
|
321
|
-
} =
|
|
322
|
-
...
|
|
323
|
-
color:
|
|
319
|
+
variant: F = "text",
|
|
320
|
+
...G
|
|
321
|
+
} = s, y = {
|
|
322
|
+
...s,
|
|
323
|
+
color: $,
|
|
324
324
|
component: w,
|
|
325
325
|
disabled: m,
|
|
326
326
|
disableElevation: W,
|
|
@@ -328,28 +328,28 @@ const to = (o) => {
|
|
|
328
328
|
fullWidth: M,
|
|
329
329
|
size: j,
|
|
330
330
|
type: k,
|
|
331
|
-
variant:
|
|
332
|
-
}, b = to(
|
|
331
|
+
variant: F
|
|
332
|
+
}, b = to(y), L = I && /* @__PURE__ */ l(ao, {
|
|
333
333
|
className: b.startIcon,
|
|
334
|
-
ownerState:
|
|
334
|
+
ownerState: y,
|
|
335
335
|
children: I
|
|
336
336
|
}), D = h && /* @__PURE__ */ l(no, {
|
|
337
337
|
className: b.endIcon,
|
|
338
|
-
ownerState:
|
|
338
|
+
ownerState: y,
|
|
339
339
|
children: h
|
|
340
340
|
}), U = i || "";
|
|
341
341
|
return /* @__PURE__ */ H(ro, {
|
|
342
|
-
ownerState:
|
|
342
|
+
ownerState: y,
|
|
343
343
|
className: O(e.className, b.root, P, U),
|
|
344
344
|
component: w,
|
|
345
345
|
disabled: m,
|
|
346
346
|
focusRipple: !C,
|
|
347
347
|
focusVisibleClassName: O(b.focusVisible, V),
|
|
348
|
-
ref:
|
|
348
|
+
ref: a,
|
|
349
349
|
type: k,
|
|
350
|
-
...
|
|
350
|
+
...G,
|
|
351
351
|
classes: b,
|
|
352
|
-
children: [
|
|
352
|
+
children: [L, f, D]
|
|
353
353
|
});
|
|
354
354
|
});
|
|
355
355
|
process.env.NODE_ENV !== "production" && (T.propTypes = {
|
|
@@ -446,84 +446,84 @@ process.env.NODE_ENV !== "production" && (T.propTypes = {
|
|
|
446
446
|
*/
|
|
447
447
|
variant: t.oneOfType([t.oneOf(["contained", "outlined", "text"]), t.string])
|
|
448
448
|
});
|
|
449
|
-
const
|
|
449
|
+
const B = c(T)`
|
|
450
450
|
text-transform: none;
|
|
451
451
|
&:disabled {
|
|
452
452
|
opacity: 0.5;
|
|
453
|
-
color: ${
|
|
453
|
+
color: ${r.colors.black};
|
|
454
454
|
display: flex;
|
|
455
455
|
justify-content: center;
|
|
456
456
|
align-items: center;
|
|
457
457
|
}
|
|
458
|
-
`, eo =
|
|
459
|
-
background-color: ${
|
|
458
|
+
`, eo = c(B)`
|
|
459
|
+
background-color: ${r.colors.green};
|
|
460
460
|
border-radius: 0;
|
|
461
461
|
height: 2.5rem;
|
|
462
462
|
border: 2px solid transparent;
|
|
463
|
-
color: ${
|
|
463
|
+
color: ${r.colors.white};
|
|
464
464
|
transition: 313ms all ease-in;
|
|
465
465
|
border-radius: 32px;
|
|
466
466
|
font-weight: 400;
|
|
467
467
|
padding: 0.75rem 2rem;
|
|
468
468
|
font-size: 1rem;
|
|
469
|
-
box-shadow: ${
|
|
469
|
+
box-shadow: ${r.boxShadows.gray63};
|
|
470
470
|
&:hover,
|
|
471
471
|
:focus-visible {
|
|
472
|
-
background-color: ${
|
|
473
|
-
box-shadow: ${
|
|
472
|
+
background-color: ${r.colors.darkGreen};
|
|
473
|
+
box-shadow: ${r.boxShadows.black63};
|
|
474
474
|
}
|
|
475
475
|
&:disabled {
|
|
476
|
-
background-color: ${
|
|
476
|
+
background-color: ${r.colors.darkGreen};
|
|
477
477
|
}
|
|
478
|
-
`, io =
|
|
479
|
-
color: ${
|
|
480
|
-
border: 3px solid ${
|
|
478
|
+
`, io = c(B)`
|
|
479
|
+
color: ${r.colors.black};
|
|
480
|
+
border: 3px solid ${r.colors.blue};
|
|
481
481
|
padding: 0.5rem 2rem;
|
|
482
|
-
`, z =
|
|
483
|
-
...
|
|
482
|
+
`, z = c(B)(({ width: o = "114px" }) => ({
|
|
483
|
+
...x`
|
|
484
484
|
box-sizing: border-box;
|
|
485
|
-
background-color: ${
|
|
485
|
+
background-color: ${r.colors.bibiBlue};
|
|
486
486
|
border-radius: 0;
|
|
487
487
|
height: 47px;
|
|
488
488
|
width: ${o};
|
|
489
489
|
border: 2px solid transparent;
|
|
490
|
-
color: ${
|
|
490
|
+
color: ${r.colors.white};
|
|
491
491
|
transition: 108ms all ease-in;
|
|
492
492
|
font-weight: 500;
|
|
493
493
|
padding: 0;
|
|
494
494
|
font-size: 19px;
|
|
495
495
|
&:hover,
|
|
496
496
|
:focus-visible {
|
|
497
|
-
background-color: ${
|
|
497
|
+
background-color: ${r.colors.bibiBlueHover};
|
|
498
498
|
}
|
|
499
499
|
`
|
|
500
|
-
})), so =
|
|
501
|
-
...
|
|
502
|
-
background-color: ${o &&
|
|
503
|
-
color: ${o &&
|
|
500
|
+
})), so = c(z)(({ active: o }) => ({
|
|
501
|
+
...x`
|
|
502
|
+
background-color: ${o && r.colors.white};
|
|
503
|
+
color: ${o && r.colors.bibiBlue};
|
|
504
504
|
&:hover,
|
|
505
505
|
:focus-visible {
|
|
506
|
-
background-color: ${
|
|
507
|
-
color: ${
|
|
506
|
+
background-color: ${r.colors.white};
|
|
507
|
+
color: ${r.colors.bibiBlue};
|
|
508
508
|
}
|
|
509
509
|
`
|
|
510
|
-
})), lo =
|
|
511
|
-
...
|
|
512
|
-
background-color: ${
|
|
513
|
-
color: ${
|
|
510
|
+
})), lo = c(z)(() => ({
|
|
511
|
+
...x`
|
|
512
|
+
background-color: ${r.colors.white};
|
|
513
|
+
color: ${r.colors.bibiBlue};
|
|
514
514
|
&:hover,
|
|
515
515
|
:focus-visible {
|
|
516
|
-
background-color: ${
|
|
517
|
-
border: 2px solid ${
|
|
518
|
-
color: ${
|
|
516
|
+
background-color: ${r.colors.bibiBlue};
|
|
517
|
+
border: 2px solid ${r.colors.white};
|
|
518
|
+
color: ${r.colors.white};
|
|
519
519
|
}
|
|
520
520
|
`
|
|
521
|
-
})), co =
|
|
521
|
+
})), co = c(S)`
|
|
522
522
|
border-radius: 8px;
|
|
523
|
-
`, po =
|
|
523
|
+
`, po = c(S, {
|
|
524
524
|
shouldForwardProp: (o) => typeof o == "string" && Z(o)
|
|
525
|
-
})(({ size: o, color:
|
|
526
|
-
...
|
|
525
|
+
})(({ size: o, color: n, highlightColor: a }) => ({
|
|
526
|
+
...x`
|
|
527
527
|
display: flex;
|
|
528
528
|
align-items: center;
|
|
529
529
|
justify-content: center;
|
|
@@ -533,26 +533,44 @@ const $ = d(T)`
|
|
|
533
533
|
&:hover,
|
|
534
534
|
:focus-visible {
|
|
535
535
|
svg {
|
|
536
|
-
filter: drop-shadow(0 0 6px ${
|
|
537
|
-
drop-shadow(0 0 6px ${
|
|
536
|
+
filter: drop-shadow(0 0 6px ${a}) drop-shadow(0 0 6px ${a})
|
|
537
|
+
drop-shadow(0 0 6px ${a}) drop-shadow(0 0 6px ${a});
|
|
538
538
|
}
|
|
539
539
|
}
|
|
540
540
|
|
|
541
541
|
svg {
|
|
542
542
|
transition: 313ms all ease-in-out;
|
|
543
|
-
fill: ${
|
|
543
|
+
fill: ${n};
|
|
544
544
|
width: ${o}px;
|
|
545
545
|
height: ${o}px;
|
|
546
546
|
}
|
|
547
547
|
`
|
|
548
|
+
})), uo = c(B)(({ active: o }) => ({
|
|
549
|
+
...x`
|
|
550
|
+
box-sizing: border-box;
|
|
551
|
+
background-color: ${o ? r.colors.black : r.colors.white};
|
|
552
|
+
height: 28px;
|
|
553
|
+
border-radius: 18px;
|
|
554
|
+
padding: 0 29px;
|
|
555
|
+
border: 2px solid ${o ? "transparent" : r.colors.black};
|
|
556
|
+
color: ${o ? r.colors.white : r.colors.black};
|
|
557
|
+
transition: 108ms all ease-in;
|
|
558
|
+
font-weight: 500;
|
|
559
|
+
|
|
560
|
+
&:hover,
|
|
561
|
+
:focus-visible {
|
|
562
|
+
background-color: ${o ? r.colors.charcoal : r.colors.gray2};
|
|
563
|
+
}
|
|
564
|
+
`
|
|
548
565
|
})), So = ({
|
|
549
566
|
variant: o = 1,
|
|
550
|
-
size:
|
|
551
|
-
color:
|
|
552
|
-
highlightColor: e =
|
|
567
|
+
size: n = 50,
|
|
568
|
+
color: a = r.colors.darkGreen,
|
|
569
|
+
highlightColor: e = r.colors.dandelion,
|
|
553
570
|
children: i,
|
|
571
|
+
active: p,
|
|
554
572
|
...s
|
|
555
|
-
}) => o === "bibi" ? /* @__PURE__ */ l(z, { ...s, children: i }) : o === "bibiOutlined" ? /* @__PURE__ */ l(so, { ...s, children: i }) : o === "bibiInverse" ? /* @__PURE__ */ l(lo, { ...s, children: i }) : o === "unstyled" ? /* @__PURE__ */ l(co, { ...s, children: i }) : o === 2 ? /* @__PURE__ */ l(io, { ...s, children: /* @__PURE__ */ l("span", { children: i }) }) : o === "icon" ? /* @__PURE__ */ l(po, { className: "
|
|
573
|
+
}) => o === "bibi" ? /* @__PURE__ */ l(z, { ...s, children: i }) : o === "bibiOutlined" ? /* @__PURE__ */ l(so, { ...s, children: i }) : o === "bibiInverse" ? /* @__PURE__ */ l(lo, { ...s, children: i }) : o === "unstyled" ? /* @__PURE__ */ l(co, { ...s, children: i }) : o === 2 ? /* @__PURE__ */ l(io, { ...s, children: /* @__PURE__ */ l("span", { children: i }) }) : o === "icon" ? /* @__PURE__ */ l(po, { className: "jcIconButton", ...{ size: n, color: a, highlightColor: e }, ...s, children: i }) : o === "filter" ? /* @__PURE__ */ l(uo, { className: "jcFilterButton", active: p, ...s, children: i }) : /* @__PURE__ */ l(eo, { ...s, children: /* @__PURE__ */ l("span", { children: i }) });
|
|
556
574
|
export {
|
|
557
575
|
So as Button,
|
|
558
576
|
So as default
|
package/Flex/Flex.js
CHANGED
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { n as
|
|
3
|
-
const
|
|
1
|
+
import { jsx as x } from "react/jsx-runtime";
|
|
2
|
+
import { n as d, i as m } from "../.chunks/emotion-styled.browser.esm.js";
|
|
3
|
+
const p = d("div", {
|
|
4
4
|
shouldForwardProp: (o) => m(o) && typeof o == "string" && o !== "wrap"
|
|
5
5
|
})(
|
|
6
|
-
({ column: o, alignItems: r, justifyContent: a, wrap:
|
|
6
|
+
({ column: o, alignItems: r, justifyContent: a, wrap: e, width: i, height: s, styles: n, padding: t, gap: l, placeContent: f }) => ({
|
|
7
|
+
boxSizing: "border-box",
|
|
7
8
|
display: "flex",
|
|
8
9
|
flexDirection: o ? "column" : "row",
|
|
9
|
-
flexWrap:
|
|
10
|
+
flexWrap: e ? "wrap" : "nowrap",
|
|
10
11
|
alignItems: r,
|
|
11
12
|
justifyContent: a,
|
|
12
13
|
placeContent: f,
|
|
13
|
-
width:
|
|
14
|
-
height:
|
|
14
|
+
width: i,
|
|
15
|
+
height: s,
|
|
15
16
|
gap: l,
|
|
16
|
-
padding:
|
|
17
|
+
padding: t,
|
|
17
18
|
fontFamily: "Roboto, sans-serif",
|
|
18
19
|
...n
|
|
19
20
|
})
|
|
20
|
-
),
|
|
21
|
+
), b = ({ children: o, ...r }) => /* @__PURE__ */ x(p, { className: "jcFlex", ...r, children: o });
|
|
21
22
|
export {
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
b as Flex,
|
|
24
|
+
b as default
|
|
24
25
|
};
|
package/README.md
CHANGED
|
@@ -1,106 +1,106 @@
|
|
|
1
|
-
# Welcome to the Johnson County Component Library!
|
|
2
|
-
|
|
3
|
-
## Quick Start
|
|
4
|
-
|
|
5
|
-
### Runtime Enviromnent
|
|
6
|
-
|
|
7
|
-
1. Please download and install [NVM for Windows](https://github.com/coreybutler/nvm-windows?tab=readme-ov-file)
|
|
8
|
-
2. `nvm install 22.11.0`
|
|
9
|
-
3. `nvm use 22`
|
|
10
|
-
|
|
11
|
-
### Usage
|
|
12
|
-
|
|
13
|
-
`npm install jcicl@latest`
|
|
14
|
-
|
|
15
|
-
```js
|
|
16
|
-
import Button, { ButtonProps } from 'jcicl/Button';
|
|
17
|
-
import Nav, { NavProps } from 'jcicl/Nav';
|
|
18
|
-
|
|
19
|
-
const Component: React.FC<ButtonProps> = ({ ...buttonProps }) => <Button {...buttonProps}>Johnson County Button</Button>;
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
### Adding the fonts and scrollbar styles
|
|
23
|
-
|
|
24
|
-
In your project entry point (most likely `main.tsx`), add:
|
|
25
|
-
|
|
26
|
-
```js
|
|
27
|
-
import '@fontsource/roboto/300.css';
|
|
28
|
-
import '@fontsource/roboto/400.css';
|
|
29
|
-
import '@fontsource/roboto/500.css';
|
|
30
|
-
import '@fontsource/roboto/700.css';
|
|
31
|
-
import '@fontsource/material-icons';
|
|
32
|
-
import 'overlayscrollbars/overlayscrollbars.css';
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
Alternatively, add to project root `index.html` `<head />`:
|
|
36
|
-
|
|
37
|
-
```html
|
|
38
|
-
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
39
|
-
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
40
|
-
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap" />
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
#### Viewing Storybook Documentation
|
|
44
|
-
|
|
45
|
-
We are using [Storybook](https://storybook.js.org/docs/get-started/frameworks/react-vite?renderer=react) to document our component library
|
|
46
|
-
|
|
47
|
-
Please use `npm run storybook` or `npm start` from the root directory to start the storybook application. You can see helpful documentation links under the `Configure your project` section of the Storybook application.
|
|
48
|
-
|
|
49
|
-
## Development
|
|
50
|
-
|
|
51
|
-
### Getting started
|
|
52
|
-
|
|
53
|
-
[Please ensure your react development environment is set up](https://devops.jc.net/JCIT/Business%20Solutions%20Delivery/_wiki/wikis/Business-Solutions-Delivery.wiki?wikiVersion=GBwikiMaster&pagePath=%2FSetting%20Up%20React&pageId=219).
|
|
54
|
-
|
|
55
|
-
From the root project directory, please run `npm install`
|
|
56
|
-
|
|
57
|
-
### Dependencies
|
|
58
|
-
|
|
59
|
-
For this component library, we are extending [Material UI](https://mui.com/material-ui/getting-started/) and customizing with [Emotion/Styled](https://emotion.sh/docs/styled)
|
|
60
|
-
|
|
61
|
-
### Components Directory Structure
|
|
62
|
-
|
|
63
|
-
In each components folder, you should see a `[Component].stories.tsx` file. You can copy the established pattern to create stories for new components, or customize as you please according to the above documentation
|
|
64
|
-
|
|
65
|
-
#### Base
|
|
66
|
-
|
|
67
|
-
Base components are intended to be the foundational building blocks of our web pages here at Johnson County
|
|
68
|
-
|
|
69
|
-
#### Composite
|
|
70
|
-
|
|
71
|
-
Composite components are intended to be reusable chunks of HTML built from base components and complimentary TSX (TypeScript XML)
|
|
72
|
-
|
|
73
|
-
#### Superomposite
|
|
74
|
-
|
|
75
|
-
Composite with a higher level of complexity
|
|
76
|
-
|
|
77
|
-
#### Templates
|
|
78
|
-
|
|
79
|
-
Templates are intended to render the HTML for predefined page layouts comprised of composite components, base components, and complimentary TSX
|
|
80
|
-
|
|
81
|
-
#### **All of the above component types are inteded to be importable and reusable throughout the suite of Johnson County web applications** 😊
|
|
82
|
-
|
|
83
|
-
### Process
|
|
84
|
-
|
|
85
|
-
1. Add or update any components you wish. For new components, please create the associated `[NewComponent].stories.tsx` file to allow for documentation. In `.storybook/main.ts`, we are using the default string matching pattern to automatically index `*.stories.*` files 😊
|
|
86
|
-
2. Export any newly created components in the relevant index files: `(base/(super)composite/templates)/[NewComponent]/index.ts` and `components/index.ts`.
|
|
87
|
-
3. Export any newly created types for the component from `(base/(super)composite/templates)/[NewComponent]/index.ts`
|
|
88
|
-
4. Publish the library and update relevant project dependencies
|
|
89
|
-
|
|
90
|
-
### Publishing the library
|
|
91
|
-
|
|
92
|
-
The library will automatically publish a new minor version on merges to master. If you need to manually publish a new version:
|
|
93
|
-
|
|
94
|
-
`npm run bp`
|
|
95
|
-
|
|
96
|
-
- Creates a new minor version (`0.0.x`), builds, and publishes the library to the npm registry
|
|
97
|
-
|
|
98
|
-
`npm run bpMinor` for minor versions (`0.x.0`), and `npm run bpMajor` for major versions (`x.0.0`)
|
|
99
|
-
|
|
100
|
-
For more details on scripting commands, please see the [npm CLI documentation](https://docs.npmjs.com/cli/v9/commands)
|
|
101
|
-
|
|
102
|
-
### Deploying storybook
|
|
103
|
-
|
|
104
|
-
TODO: Automate
|
|
105
|
-
|
|
106
|
-
Build the library with `npm run storybook`, then copy all of the files in `storybook-static` into `windu\E:\ComponentLibrary`
|
|
1
|
+
# Welcome to the Johnson County Component Library!
|
|
2
|
+
|
|
3
|
+
## Quick Start
|
|
4
|
+
|
|
5
|
+
### Runtime Enviromnent
|
|
6
|
+
|
|
7
|
+
1. Please download and install [NVM for Windows](https://github.com/coreybutler/nvm-windows?tab=readme-ov-file)
|
|
8
|
+
2. `nvm install 22.11.0`
|
|
9
|
+
3. `nvm use 22`
|
|
10
|
+
|
|
11
|
+
### Usage
|
|
12
|
+
|
|
13
|
+
`npm install jcicl@latest`
|
|
14
|
+
|
|
15
|
+
```js
|
|
16
|
+
import Button, { ButtonProps } from 'jcicl/Button';
|
|
17
|
+
import Nav, { NavProps } from 'jcicl/Nav';
|
|
18
|
+
|
|
19
|
+
const Component: React.FC<ButtonProps> = ({ ...buttonProps }) => <Button {...buttonProps}>Johnson County Button</Button>;
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### Adding the fonts and scrollbar styles
|
|
23
|
+
|
|
24
|
+
In your project entry point (most likely `main.tsx`), add:
|
|
25
|
+
|
|
26
|
+
```js
|
|
27
|
+
import '@fontsource/roboto/300.css';
|
|
28
|
+
import '@fontsource/roboto/400.css';
|
|
29
|
+
import '@fontsource/roboto/500.css';
|
|
30
|
+
import '@fontsource/roboto/700.css';
|
|
31
|
+
import '@fontsource/material-icons';
|
|
32
|
+
import 'overlayscrollbars/overlayscrollbars.css';
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Alternatively, add to project root `index.html` `<head />`:
|
|
36
|
+
|
|
37
|
+
```html
|
|
38
|
+
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
39
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
40
|
+
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap" />
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
#### Viewing Storybook Documentation
|
|
44
|
+
|
|
45
|
+
We are using [Storybook](https://storybook.js.org/docs/get-started/frameworks/react-vite?renderer=react) to document our component library
|
|
46
|
+
|
|
47
|
+
Please use `npm run storybook` or `npm start` from the root directory to start the storybook application. You can see helpful documentation links under the `Configure your project` section of the Storybook application.
|
|
48
|
+
|
|
49
|
+
## Development
|
|
50
|
+
|
|
51
|
+
### Getting started
|
|
52
|
+
|
|
53
|
+
[Please ensure your react development environment is set up](https://devops.jc.net/JCIT/Business%20Solutions%20Delivery/_wiki/wikis/Business-Solutions-Delivery.wiki?wikiVersion=GBwikiMaster&pagePath=%2FSetting%20Up%20React&pageId=219).
|
|
54
|
+
|
|
55
|
+
From the root project directory, please run `npm install`
|
|
56
|
+
|
|
57
|
+
### Dependencies
|
|
58
|
+
|
|
59
|
+
For this component library, we are extending [Material UI](https://mui.com/material-ui/getting-started/) and customizing with [Emotion/Styled](https://emotion.sh/docs/styled)
|
|
60
|
+
|
|
61
|
+
### Components Directory Structure
|
|
62
|
+
|
|
63
|
+
In each components folder, you should see a `[Component].stories.tsx` file. You can copy the established pattern to create stories for new components, or customize as you please according to the above documentation
|
|
64
|
+
|
|
65
|
+
#### Base
|
|
66
|
+
|
|
67
|
+
Base components are intended to be the foundational building blocks of our web pages here at Johnson County
|
|
68
|
+
|
|
69
|
+
#### Composite
|
|
70
|
+
|
|
71
|
+
Composite components are intended to be reusable chunks of HTML built from base components and complimentary TSX (TypeScript XML)
|
|
72
|
+
|
|
73
|
+
#### Superomposite
|
|
74
|
+
|
|
75
|
+
Composite with a higher level of complexity
|
|
76
|
+
|
|
77
|
+
#### Templates
|
|
78
|
+
|
|
79
|
+
Templates are intended to render the HTML for predefined page layouts comprised of composite components, base components, and complimentary TSX
|
|
80
|
+
|
|
81
|
+
#### **All of the above component types are inteded to be importable and reusable throughout the suite of Johnson County web applications** 😊
|
|
82
|
+
|
|
83
|
+
### Process
|
|
84
|
+
|
|
85
|
+
1. Add or update any components you wish. For new components, please create the associated `[NewComponent].stories.tsx` file to allow for documentation. In `.storybook/main.ts`, we are using the default string matching pattern to automatically index `*.stories.*` files 😊
|
|
86
|
+
2. Export any newly created components in the relevant index files: `(base/(super)composite/templates)/[NewComponent]/index.ts` and `components/index.ts`.
|
|
87
|
+
3. Export any newly created types for the component from `(base/(super)composite/templates)/[NewComponent]/index.ts`
|
|
88
|
+
4. Publish the library and update relevant project dependencies
|
|
89
|
+
|
|
90
|
+
### Publishing the library
|
|
91
|
+
|
|
92
|
+
The library will automatically publish a new minor version on merges to master. If you need to manually publish a new version:
|
|
93
|
+
|
|
94
|
+
`npm run bp`
|
|
95
|
+
|
|
96
|
+
- Creates a new minor version (`0.0.x`), builds, and publishes the library to the npm registry
|
|
97
|
+
|
|
98
|
+
`npm run bpMinor` for minor versions (`0.x.0`), and `npm run bpMajor` for major versions (`x.0.0`)
|
|
99
|
+
|
|
100
|
+
For more details on scripting commands, please see the [npm CLI documentation](https://docs.npmjs.com/cli/v9/commands)
|
|
101
|
+
|
|
102
|
+
### Deploying storybook
|
|
103
|
+
|
|
104
|
+
TODO: Automate
|
|
105
|
+
|
|
106
|
+
Build the library with `npm run storybook`, then copy all of the files in `storybook-static` into `windu\E:\ComponentLibrary`
|
package/Search/Search.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TextFieldProps as MuiTextFieldProps } from '@mui/material/TextField';
|
|
2
|
-
export type
|
|
2
|
+
export type SearchFilterProps = {
|
|
3
3
|
name: string;
|
|
4
|
-
onClick:
|
|
4
|
+
onClick: () => void;
|
|
5
5
|
active?: boolean;
|
|
6
6
|
};
|
|
7
7
|
export type SearchProps = Omit<MuiTextFieldProps, 'variant'> & {
|
|
@@ -9,7 +9,7 @@ export type SearchProps = Omit<MuiTextFieldProps, 'variant'> & {
|
|
|
9
9
|
borderColor?: string;
|
|
10
10
|
borderFocusColor?: string;
|
|
11
11
|
onSearch: () => void;
|
|
12
|
-
filters?:
|
|
12
|
+
filters?: SearchFilterProps[];
|
|
13
13
|
};
|
|
14
14
|
export declare const Search: React.FC<SearchProps>;
|
|
15
15
|
export default Search;
|
package/Search/Search.js
CHANGED
|
@@ -1,20 +1,31 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
|
|
1
|
+
import { jsx as r, jsxs as v } from "react/jsx-runtime";
|
|
2
|
+
import { useState as S } from "react";
|
|
3
|
+
import { n as s } from "../.chunks/emotion-styled.browser.esm.js";
|
|
4
|
+
import { c as l } from "../.chunks/emotion-react.browser.esm.js";
|
|
5
|
+
import e from "../theme.js";
|
|
6
|
+
import z from "../Icon/Icon.js";
|
|
7
|
+
import { Button as p } from "../Button/Button.js";
|
|
8
|
+
import { c as m } from "../.chunks/createSvgIcon.js";
|
|
9
|
+
import { T as y } from "../.chunks/TextField.js";
|
|
10
|
+
const k = m(/* @__PURE__ */ r("path", {
|
|
9
11
|
d: "M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"
|
|
10
|
-
}), "Search"),
|
|
12
|
+
}), "Search"), C = m(/* @__PURE__ */ r("path", {
|
|
11
13
|
d: "M10 18h4v-2h-4zM3 6v2h18V6zm3 7h12v-2H6z"
|
|
12
|
-
}), "FilterList"),
|
|
13
|
-
|
|
14
|
+
}), "FilterList"), M = s("div")(() => ({
|
|
15
|
+
...l`
|
|
16
|
+
position: relative;
|
|
17
|
+
width: 100%;
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
align-items: center;
|
|
21
|
+
`
|
|
22
|
+
})), R = s(y)(({ borderColor: o, borderFocusColor: i, shadowTertiary: a }) => ({
|
|
23
|
+
backgroundColor: e.colors.white,
|
|
14
24
|
borderRadius: "1rem",
|
|
15
25
|
height: "2rem",
|
|
16
|
-
border: `1px solid ${
|
|
26
|
+
border: `1px solid ${o}`,
|
|
17
27
|
transition: "313ms all ease-out",
|
|
28
|
+
zIndex: 1327,
|
|
18
29
|
".MuiInputBase-root": {
|
|
19
30
|
padding: "0 2px"
|
|
20
31
|
},
|
|
@@ -31,7 +42,7 @@ const g = a(/* @__PURE__ */ o("path", {
|
|
|
31
42
|
},
|
|
32
43
|
"&:hover": {
|
|
33
44
|
svg: {
|
|
34
|
-
boxShadow: `0 0 2px ${
|
|
45
|
+
boxShadow: `0 0 2px ${e.colors.midnight}`
|
|
35
46
|
}
|
|
36
47
|
}
|
|
37
48
|
},
|
|
@@ -39,8 +50,8 @@ const g = a(/* @__PURE__ */ o("path", {
|
|
|
39
50
|
borderRadius: "50%",
|
|
40
51
|
"&:hover": {
|
|
41
52
|
svg: {
|
|
42
|
-
backgroundColor:
|
|
43
|
-
fill:
|
|
53
|
+
backgroundColor: i,
|
|
54
|
+
fill: e.colors.white
|
|
44
55
|
},
|
|
45
56
|
".MuiTouchRipple-root": {
|
|
46
57
|
backgroundColor: "transparent"
|
|
@@ -59,11 +70,11 @@ const g = a(/* @__PURE__ */ o("path", {
|
|
|
59
70
|
alignItems: "center"
|
|
60
71
|
},
|
|
61
72
|
"&:hover, :focus-visible, :focus-within": {
|
|
62
|
-
borderColor:
|
|
63
|
-
boxShadow:
|
|
73
|
+
borderColor: i,
|
|
74
|
+
boxShadow: a
|
|
64
75
|
},
|
|
65
76
|
"&:focus-visible": {
|
|
66
|
-
borderColor:
|
|
77
|
+
borderColor: o,
|
|
67
78
|
borderWidth: "2px"
|
|
68
79
|
},
|
|
69
80
|
fieldset: {
|
|
@@ -75,54 +86,107 @@ const g = a(/* @__PURE__ */ o("path", {
|
|
|
75
86
|
border: "none"
|
|
76
87
|
}
|
|
77
88
|
}
|
|
78
|
-
})),
|
|
79
|
-
|
|
89
|
+
})), $ = s("div")(({ open: o }) => ({
|
|
90
|
+
...l`
|
|
91
|
+
box-sizing: border-box;
|
|
92
|
+
position: absolute;
|
|
93
|
+
width: calc(50%);
|
|
94
|
+
top: 1rem;
|
|
95
|
+
right: 3px;
|
|
96
|
+
z-index: 1313;
|
|
97
|
+
display: flex;
|
|
98
|
+
gap: 1rem;
|
|
99
|
+
background-color: ${e.colors.white};
|
|
100
|
+
box-shadow: ${e.boxShadows.midnight};
|
|
101
|
+
padding: ${o ? "2rem 1rem" : 0};
|
|
102
|
+
transition: 313ms all ease-in-out;
|
|
103
|
+
display: grid;
|
|
104
|
+
grid-template-rows: ${o ? "1fr" : "0fr"};
|
|
105
|
+
|
|
106
|
+
.filtersWrapper {
|
|
107
|
+
overflow: hidden;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
@media screen and (max-width: ${e.screenSizes.tablet}) {
|
|
111
|
+
width: calc(100% - 6px);
|
|
112
|
+
}
|
|
113
|
+
`
|
|
114
|
+
})), F = s("div")(() => ({
|
|
115
|
+
...l`
|
|
116
|
+
display: grid;
|
|
117
|
+
grid-template-columns: repeat(3, 1fr);
|
|
118
|
+
grid-row-gap: 1.3rem;
|
|
119
|
+
grid-column-gap: 1.3rem;
|
|
120
|
+
justify-content: center;
|
|
121
|
+
box-sizing: border-box;
|
|
122
|
+
width: 100%;
|
|
123
|
+
|
|
124
|
+
@media screen and (max-width: ${e.screenSizes.tablet}) {
|
|
125
|
+
display: grid;
|
|
126
|
+
grid-template-columns: repeat(2, 1fr);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
@media screen and (max-width: 786px) {
|
|
130
|
+
grid-template-columns: repeat(1, 1fr);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.filtersButton {
|
|
134
|
+
width: 100%;
|
|
135
|
+
justify-self: center;
|
|
136
|
+
}
|
|
137
|
+
`
|
|
138
|
+
})), P = ({
|
|
139
|
+
borderColor: o = e.colors.green,
|
|
80
140
|
// border primary
|
|
81
|
-
borderFocusColor:
|
|
141
|
+
borderFocusColor: i = e.colors.darkGreen,
|
|
82
142
|
// icon primary
|
|
83
|
-
shadowTertiary:
|
|
84
|
-
|
|
85
|
-
|
|
143
|
+
shadowTertiary: a = e.boxShadows.darkGreenThick,
|
|
144
|
+
filters: t,
|
|
145
|
+
onSearch: d,
|
|
146
|
+
...h
|
|
86
147
|
}) => {
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
},
|
|
90
|
-
return /* @__PURE__ */
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
148
|
+
const [c, g] = S(!1), u = (n) => {
|
|
149
|
+
n.preventDefault(), n.key === "Enter" && d && d();
|
|
150
|
+
}, x = { borderColor: o, borderFocusColor: i, shadowTertiary: a, ...h }, b = t && t.length > 0;
|
|
151
|
+
return /* @__PURE__ */ v(M, { children: [
|
|
152
|
+
/* @__PURE__ */ r(
|
|
153
|
+
R,
|
|
154
|
+
{
|
|
155
|
+
slotProps: {
|
|
156
|
+
input: {
|
|
157
|
+
startAdornment: /* @__PURE__ */ r(
|
|
158
|
+
p,
|
|
159
|
+
{
|
|
160
|
+
variant: "icon",
|
|
161
|
+
size: 28,
|
|
162
|
+
onClick: d,
|
|
163
|
+
color: i,
|
|
164
|
+
highlightColor: "transparent",
|
|
165
|
+
children: /* @__PURE__ */ r(k, {})
|
|
166
|
+
}
|
|
167
|
+
),
|
|
168
|
+
endAdornment: b && /* @__PURE__ */ r(
|
|
169
|
+
z,
|
|
170
|
+
{
|
|
171
|
+
onClick: () => g(!c),
|
|
172
|
+
icon: /* @__PURE__ */ r(C, {}),
|
|
173
|
+
backgroundColor: o,
|
|
174
|
+
iconColor: e.colors.white,
|
|
175
|
+
size: 28,
|
|
176
|
+
padding: 3
|
|
177
|
+
}
|
|
178
|
+
)
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
type: "search",
|
|
182
|
+
...x,
|
|
183
|
+
onKeyUp: u
|
|
184
|
+
}
|
|
185
|
+
),
|
|
186
|
+
/* @__PURE__ */ r($, { open: c, children: /* @__PURE__ */ r(F, { className: "filtersWrapper", children: t == null ? void 0 : t.map(({ name: n, onClick: f, active: w }) => /* @__PURE__ */ r(p, { className: "filtersButton", variant: "filter", onClick: f, active: w, children: n }, n)) }) })
|
|
187
|
+
] });
|
|
124
188
|
};
|
|
125
189
|
export {
|
|
126
|
-
|
|
127
|
-
|
|
190
|
+
P as Search,
|
|
191
|
+
P as default
|
|
128
192
|
};
|
package/Search/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default, type SearchProps, type
|
|
1
|
+
export { default, type SearchProps, type SearchFilterProps } from './Search';
|
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.133",
|
|
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",
|