jcicl 0.0.69 → 0.0.70
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,5 +1,7 @@
|
|
|
1
1
|
import { CircularProgressProps } from '@mui/material/CircularProgress';
|
|
2
|
+
import { CSSObject } from '@emotion/react';
|
|
2
3
|
export interface LoadingProps extends CircularProgressProps {
|
|
4
|
+
styles?: CSSObject;
|
|
3
5
|
}
|
|
4
|
-
declare const
|
|
5
|
-
export default
|
|
6
|
+
declare const Loading: React.FC<LoadingProps>;
|
|
7
|
+
export default Loading;
|
package/base/Loading/Loading.js
CHANGED
|
@@ -2,12 +2,13 @@ import { jsx as o } from "react/jsx-runtime";
|
|
|
2
2
|
import { n as s } from "../../.chunks/emotion-styled.browser.esm.js";
|
|
3
3
|
import { c as t } from "../../.chunks/emotion-react.browser.esm.js";
|
|
4
4
|
import e from "../../theme.js";
|
|
5
|
-
import { C as
|
|
6
|
-
const
|
|
5
|
+
import { C as m } from "../../.chunks/CircularProgress.js";
|
|
6
|
+
const i = s(m)(({ styles: r }) => ({
|
|
7
7
|
...t`
|
|
8
8
|
color: ${e.colors.green};
|
|
9
|
+
${r};
|
|
9
10
|
`
|
|
10
|
-
}), p = ({ ...r }) => /* @__PURE__ */ o(
|
|
11
|
+
})), p = ({ ...r }) => /* @__PURE__ */ o(i, { size: 47, ...r });
|
|
11
12
|
export {
|
|
12
13
|
p as default
|
|
13
14
|
};
|
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.70",
|
|
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",
|
|
@@ -19,6 +19,9 @@ interface EditableInfoCardStyleProps {
|
|
|
19
19
|
onCancel?: () => void;
|
|
20
20
|
onEdit?: () => void;
|
|
21
21
|
width?: string;
|
|
22
|
+
/** If true, the card renders a loading spinner as content */
|
|
23
|
+
loading?: boolean;
|
|
24
|
+
loadingStyles?: CSSObject;
|
|
22
25
|
}
|
|
23
26
|
export interface EditableInfoCardProps extends EditableInfoCardStyleProps {
|
|
24
27
|
title?: string;
|
|
@@ -1,33 +1,35 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
2
|
-
import { useState as
|
|
1
|
+
import { jsx as o, jsxs as a, Fragment as U } from "react/jsx-runtime";
|
|
2
|
+
import { useState as v } from "react";
|
|
3
3
|
import { n as d } from "../../.chunks/emotion-styled.browser.esm.js";
|
|
4
4
|
import { c as f } from "../../.chunks/emotion-react.browser.esm.js";
|
|
5
5
|
import { c as x } from "../../.chunks/createSvgIcon.js";
|
|
6
6
|
import i from "../../theme.js";
|
|
7
|
-
import { LabeledValue as
|
|
8
|
-
import { LabeledInput as
|
|
7
|
+
import { LabeledValue as W } from "../../base/LabeledValue/LabeledValue.js";
|
|
8
|
+
import { LabeledInput as q } from "../../composite/LabeledInput/LabeledInput.js";
|
|
9
|
+
import A from "../../base/Loading/Loading.js";
|
|
9
10
|
import p from "../../base/Flex/Flex.js";
|
|
10
11
|
import { Tooltip as b } from "../../composite/Tooltip/Tooltip.js";
|
|
11
|
-
import { T as
|
|
12
|
-
import { B as
|
|
13
|
-
const
|
|
12
|
+
import { T as D } from "../../.chunks/Input.js";
|
|
13
|
+
import { B as H } from "../../.chunks/ButtonBase.js";
|
|
14
|
+
const J = x(/* @__PURE__ */ o("path", {
|
|
14
15
|
d: "M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.996.996 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z"
|
|
15
|
-
}), "Edit"),
|
|
16
|
+
}), "Edit"), K = x(/* @__PURE__ */ o("path", {
|
|
16
17
|
d: "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
|
|
17
|
-
}), "Close"),
|
|
18
|
+
}), "Close"), N = x(/* @__PURE__ */ o("path", {
|
|
18
19
|
d: "M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"
|
|
19
|
-
}), "Check"),
|
|
20
|
-
({ width: t, padding:
|
|
20
|
+
}), "Check"), y = d("div")(
|
|
21
|
+
({ width: t, padding: l, shadow: r, styles: h, isEditing: s }) => ({
|
|
21
22
|
...f`
|
|
22
23
|
width: ${t};
|
|
23
24
|
max-width: 100%;
|
|
25
|
+
box-sizing: border-box;
|
|
24
26
|
h3 {
|
|
25
27
|
margin: 0;
|
|
26
28
|
width: 100%;
|
|
27
29
|
font-size: 28px;
|
|
28
30
|
}
|
|
29
31
|
font-family: 'Roboto', sans-serif;
|
|
30
|
-
padding: ${
|
|
32
|
+
padding: ${l};
|
|
31
33
|
display: flex;
|
|
32
34
|
flex-direction: column;
|
|
33
35
|
box-shadow: ${r};
|
|
@@ -41,7 +43,7 @@ const A = x(/* @__PURE__ */ o("path", {
|
|
|
41
43
|
opacity: ${s ? "0" : "1"};
|
|
42
44
|
`
|
|
43
45
|
})
|
|
44
|
-
),
|
|
46
|
+
), O = d(D)({
|
|
45
47
|
backgroundColor: i.colors.white,
|
|
46
48
|
borderRadius: "0",
|
|
47
49
|
input: {
|
|
@@ -69,7 +71,7 @@ const A = x(/* @__PURE__ */ o("path", {
|
|
|
69
71
|
border: "none"
|
|
70
72
|
}
|
|
71
73
|
}
|
|
72
|
-
}),
|
|
74
|
+
}), Q = d(y)(({ isEditing: t }) => ({
|
|
73
75
|
...f`
|
|
74
76
|
position: absolute;
|
|
75
77
|
top: 0;
|
|
@@ -78,56 +80,57 @@ const A = x(/* @__PURE__ */ o("path", {
|
|
|
78
80
|
opacity: ${t ? "1" : "0"};
|
|
79
81
|
transition: 920ms all ease-in-out;
|
|
80
82
|
`
|
|
81
|
-
})),
|
|
83
|
+
})), I = d("div")(({ spacing: t, columns: l }) => ({
|
|
82
84
|
...f`
|
|
83
85
|
margin-top: calc(${t} * 0.75);
|
|
84
86
|
grid-row-gap: ${t};
|
|
85
87
|
grid-column-gap: calc(${t} * 1.5);
|
|
86
88
|
display: grid;
|
|
87
|
-
grid-template-columns: repeat(${
|
|
89
|
+
grid-template-columns: repeat(${l}, 1fr);
|
|
88
90
|
`
|
|
89
|
-
})), g = d(
|
|
91
|
+
})), g = d(H)(() => ({
|
|
90
92
|
...f`
|
|
91
93
|
width: 40px;
|
|
92
94
|
height: 40px;
|
|
93
95
|
border-radius: 50%;
|
|
94
96
|
`
|
|
95
|
-
})),
|
|
97
|
+
})), X = d("div")`
|
|
96
98
|
position: relative;
|
|
97
|
-
`,
|
|
99
|
+
`, fo = ({
|
|
98
100
|
decorativeElement: t,
|
|
99
|
-
title:
|
|
101
|
+
title: l,
|
|
100
102
|
items: r = [],
|
|
101
103
|
padding: h = "1rem 2rem",
|
|
102
104
|
shadow: s = i.boxShadow.darkGreen,
|
|
103
|
-
spacing:
|
|
104
|
-
columns:
|
|
105
|
+
spacing: S = "2rem",
|
|
106
|
+
columns: k = 3,
|
|
105
107
|
styles: z,
|
|
106
|
-
width:
|
|
107
|
-
|
|
108
|
+
width: j = "100%",
|
|
109
|
+
loading: B = !1,
|
|
110
|
+
onSave: L = () => {
|
|
108
111
|
},
|
|
109
|
-
onCancel:
|
|
112
|
+
onCancel: M = () => {
|
|
110
113
|
},
|
|
111
|
-
onEdit:
|
|
114
|
+
onEdit: P = () => {
|
|
112
115
|
}
|
|
113
116
|
}) => {
|
|
114
|
-
const C = r.reduce((e, n) => ({ ...e, [n.label]: n.value }), { titleValue:
|
|
115
|
-
|
|
116
|
-
}, R = () => {
|
|
117
|
-
M(c), m(!1);
|
|
117
|
+
const C = r.reduce((e, n) => ({ ...e, [n.label]: n.value }), { titleValue: l }), [T, m] = v(!1), [c, u] = v(C), R = () => {
|
|
118
|
+
P(), m(!0);
|
|
118
119
|
}, V = () => {
|
|
119
|
-
|
|
120
|
-
}, Y = (
|
|
120
|
+
L(c), m(!1);
|
|
121
|
+
}, Y = () => {
|
|
122
|
+
M(), u(C), m(!1);
|
|
123
|
+
}, E = (e, n) => {
|
|
121
124
|
u((G) => ({ ...G, [e]: n }));
|
|
122
|
-
},
|
|
125
|
+
}, F = (e) => {
|
|
123
126
|
u((n) => ({ ...n, titleValue: e }));
|
|
124
|
-
}, w = { width:
|
|
125
|
-
return /* @__PURE__ */
|
|
126
|
-
/* @__PURE__ */
|
|
127
|
-
/* @__PURE__ */
|
|
128
|
-
/* @__PURE__ */
|
|
127
|
+
}, w = { width: j, padding: h, shadow: s, styles: z, isEditing: T }, $ = { spacing: S, columns: k };
|
|
128
|
+
return /* @__PURE__ */ a(X, { children: [
|
|
129
|
+
/* @__PURE__ */ a(y, { ...w, children: [
|
|
130
|
+
/* @__PURE__ */ a(p, { width: "100%", gap: "1rem", justifyContent: "space-between", children: [
|
|
131
|
+
/* @__PURE__ */ a(p, { width: "100%", gap: "1rem", alignItems: "center", children: [
|
|
129
132
|
t && t,
|
|
130
|
-
/* @__PURE__ */ o("h3", { children:
|
|
133
|
+
/* @__PURE__ */ o("h3", { children: l })
|
|
131
134
|
] }),
|
|
132
135
|
/* @__PURE__ */ o(
|
|
133
136
|
b,
|
|
@@ -146,21 +149,24 @@ const A = x(/* @__PURE__ */ o("path", {
|
|
|
146
149
|
]
|
|
147
150
|
}
|
|
148
151
|
},
|
|
149
|
-
children: /* @__PURE__ */ o(g, { onClick:
|
|
152
|
+
children: /* @__PURE__ */ o(g, { onClick: R, children: /* @__PURE__ */ o(J, {}) })
|
|
150
153
|
}
|
|
151
154
|
)
|
|
152
155
|
] }),
|
|
153
|
-
/* @__PURE__ */ o(
|
|
156
|
+
/* @__PURE__ */ o(I, { ...$, children: B ? /* @__PURE__ */ a(U, { children: [
|
|
157
|
+
/* @__PURE__ */ o("div", {}),
|
|
158
|
+
/* @__PURE__ */ o(A, { styles: { justifySelf: "center", alignSelf: "center" } })
|
|
159
|
+
] }) : r == null ? void 0 : r.map((e) => /* @__PURE__ */ o(W, { ...e }, e.label)) })
|
|
154
160
|
] }),
|
|
155
|
-
/* @__PURE__ */
|
|
156
|
-
/* @__PURE__ */
|
|
157
|
-
/* @__PURE__ */
|
|
161
|
+
/* @__PURE__ */ a(Q, { ...w, children: [
|
|
162
|
+
/* @__PURE__ */ a(p, { width: "100%", justifyContent: "space-between", children: [
|
|
163
|
+
/* @__PURE__ */ a(p, { width: "100%", gap: "1rem", alignItems: "center", children: [
|
|
158
164
|
t && t,
|
|
159
165
|
/* @__PURE__ */ o("h3", { children: /* @__PURE__ */ o(
|
|
160
|
-
|
|
166
|
+
O,
|
|
161
167
|
{
|
|
162
|
-
onChange: (e) =>
|
|
163
|
-
value: (c == null ? void 0 : c.titleValue) ??
|
|
168
|
+
onChange: (e) => F(e.target.value),
|
|
169
|
+
value: (c == null ? void 0 : c.titleValue) ?? l
|
|
164
170
|
}
|
|
165
171
|
) })
|
|
166
172
|
] }),
|
|
@@ -181,7 +187,7 @@ const A = x(/* @__PURE__ */ o("path", {
|
|
|
181
187
|
]
|
|
182
188
|
}
|
|
183
189
|
},
|
|
184
|
-
children: /* @__PURE__ */ o(g, { onClick:
|
|
190
|
+
children: /* @__PURE__ */ o(g, { onClick: Y, children: /* @__PURE__ */ o(K, {}) })
|
|
185
191
|
}
|
|
186
192
|
),
|
|
187
193
|
/* @__PURE__ */ o(
|
|
@@ -201,16 +207,16 @@ const A = x(/* @__PURE__ */ o("path", {
|
|
|
201
207
|
]
|
|
202
208
|
}
|
|
203
209
|
},
|
|
204
|
-
children: /* @__PURE__ */ o(g, { onClick:
|
|
210
|
+
children: /* @__PURE__ */ o(g, { onClick: V, children: /* @__PURE__ */ o(N, {}) })
|
|
205
211
|
}
|
|
206
212
|
)
|
|
207
213
|
] }),
|
|
208
|
-
/* @__PURE__ */ o(
|
|
209
|
-
|
|
214
|
+
/* @__PURE__ */ o(I, { ...$, children: r == null ? void 0 : r.map((e) => /* @__PURE__ */ o(
|
|
215
|
+
q,
|
|
210
216
|
{
|
|
211
217
|
label: e.label,
|
|
212
218
|
value: c[e.label],
|
|
213
|
-
onChange: (n) =>
|
|
219
|
+
onChange: (n) => E(e.label, n.target.value)
|
|
214
220
|
},
|
|
215
221
|
e.label
|
|
216
222
|
)) })
|
|
@@ -218,6 +224,6 @@ const A = x(/* @__PURE__ */ o("path", {
|
|
|
218
224
|
] });
|
|
219
225
|
};
|
|
220
226
|
export {
|
|
221
|
-
|
|
222
|
-
|
|
227
|
+
fo as EditableInfoCard,
|
|
228
|
+
fo as default
|
|
223
229
|
};
|