jcicl 0.0.68 → 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 WithLoading: React.FC<LoadingProps>;
5
- export default WithLoading;
6
+ declare const Loading: React.FC<LoadingProps>;
7
+ export default Loading;
@@ -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 i } from "../../.chunks/CircularProgress.js";
6
- const m = s(i)({
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(m, { size: 47, ...r });
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.68",
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 l } from "react/jsx-runtime";
2
- import { useState as I } from "react";
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 F } from "../../base/LabeledValue/LabeledValue.js";
8
- import { LabeledInput as U } from "../../composite/LabeledInput/LabeledInput.js";
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 W } from "../../.chunks/Input.js";
12
- import { B as q } from "../../.chunks/ButtonBase.js";
13
- const A = x(/* @__PURE__ */ o("path", {
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"), D = x(/* @__PURE__ */ o("path", {
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"), H = x(/* @__PURE__ */ o("path", {
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"), k = d("div")(
20
- ({ width: t, padding: a, shadow: r, styles: h, isEditing: s }) => ({
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: ${a};
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
- ), J = d(W)({
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
- }), K = d(k)(({ isEditing: t }) => ({
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
- })), v = d("div")(({ spacing: t, columns: a }) => ({
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(${a}, 1fr);
89
+ grid-template-columns: repeat(${l}, 1fr);
88
90
  `
89
- })), g = d(q)(() => ({
91
+ })), g = d(H)(() => ({
90
92
  ...f`
91
93
  width: 40px;
92
94
  height: 40px;
93
95
  border-radius: 50%;
94
96
  `
95
- })), N = d("div")`
97
+ })), X = d("div")`
96
98
  position: relative;
97
- `, io = ({
99
+ `, fo = ({
98
100
  decorativeElement: t,
99
- title: a,
101
+ title: l,
100
102
  items: r = [],
101
103
  padding: h = "1rem 2rem",
102
104
  shadow: s = i.boxShadow.darkGreen,
103
- spacing: y = "2rem",
104
- columns: S = 3,
105
+ spacing: S = "2rem",
106
+ columns: k = 3,
105
107
  styles: z,
106
- width: B,
107
- onSave: M = () => {
108
+ width: j = "100%",
109
+ loading: B = !1,
110
+ onSave: L = () => {
108
111
  },
109
- onCancel: P = () => {
112
+ onCancel: M = () => {
110
113
  },
111
- onEdit: T = () => {
114
+ onEdit: P = () => {
112
115
  }
113
116
  }) => {
114
- const C = r.reduce((e, n) => ({ ...e, [n.label]: n.value }), { titleValue: a }), [j, m] = I(!1), [c, u] = I(C), L = () => {
115
- T(), m(!0);
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
- P(), u(C), m(!1);
120
- }, Y = (e, n) => {
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
- }, E = (e) => {
125
+ }, F = (e) => {
123
126
  u((n) => ({ ...n, titleValue: e }));
124
- }, w = { width: B, padding: h, shadow: s, styles: z, isEditing: j }, $ = { spacing: y, columns: S };
125
- return /* @__PURE__ */ l(N, { children: [
126
- /* @__PURE__ */ l(k, { ...w, children: [
127
- /* @__PURE__ */ l(p, { width: "100%", gap: "1rem", justifyContent: "space-between", children: [
128
- /* @__PURE__ */ l(p, { width: "100%", gap: "1rem", alignItems: "center", children: [
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: a })
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: L, children: /* @__PURE__ */ o(A, {}) })
152
+ children: /* @__PURE__ */ o(g, { onClick: R, children: /* @__PURE__ */ o(J, {}) })
150
153
  }
151
154
  )
152
155
  ] }),
153
- /* @__PURE__ */ o(v, { ...$, children: r == null ? void 0 : r.map((e) => /* @__PURE__ */ o(F, { ...e }, e.label)) })
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__ */ l(K, { ...w, children: [
156
- /* @__PURE__ */ l(p, { width: "100%", justifyContent: "space-between", children: [
157
- /* @__PURE__ */ l(p, { width: "100%", gap: "1rem", alignItems: "center", children: [
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
- J,
166
+ O,
161
167
  {
162
- onChange: (e) => E(e.target.value),
163
- value: (c == null ? void 0 : c.titleValue) ?? a
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: V, children: /* @__PURE__ */ o(D, {}) })
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: R, children: /* @__PURE__ */ o(H, {}) })
210
+ children: /* @__PURE__ */ o(g, { onClick: V, children: /* @__PURE__ */ o(N, {}) })
205
211
  }
206
212
  )
207
213
  ] }),
208
- /* @__PURE__ */ o(v, { ...$, children: r == null ? void 0 : r.map((e) => /* @__PURE__ */ o(
209
- U,
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) => Y(e.label, n.target.value)
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
- io as EditableInfoCard,
222
- io as default
227
+ fo as EditableInfoCard,
228
+ fo as default
223
229
  };
@@ -46,7 +46,7 @@ const h = d("div")({
46
46
  borderBottomLeftRadius: r ? 0 : "4px",
47
47
  borderTopLeftRadius: r ? 0 : "4px",
48
48
  border: `1px solid ${o.colors.green}`,
49
- minWidth: "100%",
49
+ width: "100%",
50
50
  minHeight: "100%",
51
51
  boxSizing: "border-box",
52
52
  padding: "1rem",
@@ -66,7 +66,7 @@ const h = d("div")({
66
66
  /* @__PURE__ */ a(g, { children: [
67
67
  /* @__PURE__ */ e(f, { ...x }),
68
68
  /* @__PURE__ */ e(u, { withActionsPanel: n, children: /* @__PURE__ */ e(l, { direction: "vertical", children: i && i }) }),
69
- /* @__PURE__ */ e(b, { withActionsPanel: n, children: /* @__PURE__ */ e(l, { children: s }) })
69
+ /* @__PURE__ */ e(l, { children: /* @__PURE__ */ e(b, { withActionsPanel: n, children: s }) })
70
70
  ] })
71
71
  ] });
72
72
  };