jcicl 0.0.57 → 0.0.58

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.
Files changed (46) hide show
  1. package/.chunks/ButtonBase.js +202 -209
  2. package/.chunks/Input.js +6722 -0
  3. package/.chunks/Portal.js +824 -0
  4. package/.chunks/TransitionGroupContext.js +60 -78
  5. package/.chunks/elementTypeAcceptingRef.js +23 -0
  6. package/.chunks/isFocusVisible.js +12 -0
  7. package/animation/Spin/Spin.d.ts +5 -0
  8. package/animation/Spin/Spin.js +22 -0
  9. package/animation/Spin/index.d.ts +1 -0
  10. package/animation/Spin/index.js +4 -0
  11. package/animation/index.d.ts +1 -0
  12. package/animation/index.js +4 -2
  13. package/base/Button/Button.d.ts +1 -1
  14. package/base/Button/Button.js +66 -64
  15. package/base/Input/Input.d.ts +4 -1
  16. package/base/Input/Input.js +6 -7486
  17. package/base/Input/index.d.ts +1 -1
  18. package/base/Input/index.js +2 -2
  19. package/base/LabeledValue/LabeledValue.js +23 -12
  20. package/base/index.js +6 -6
  21. package/composite/Accordion/Accordion.d.ts +15 -0
  22. package/composite/Accordion/Accordion.js +65 -0
  23. package/composite/Accordion/index.d.ts +1 -0
  24. package/composite/Accordion/index.js +4 -0
  25. package/composite/InfoCard/InfoCard.d.ts +3 -0
  26. package/composite/InfoCard/InfoCard.js +13 -11
  27. package/composite/LabeledInput/LabeledInput.d.ts +9 -0
  28. package/composite/LabeledInput/LabeledInput.js +35 -0
  29. package/composite/LabeledInput/index.d.ts +1 -0
  30. package/composite/LabeledInput/index.js +4 -0
  31. package/composite/Tooltip/Tooltip.d.ts +7 -0
  32. package/composite/Tooltip/Tooltip.js +2092 -0
  33. package/composite/Tooltip/index.d.ts +1 -0
  34. package/composite/Tooltip/index.js +4 -0
  35. package/composite/index.d.ts +3 -0
  36. package/composite/index.js +16 -10
  37. package/index.d.ts +3 -3
  38. package/index.js +50 -40
  39. package/package.json +1 -1
  40. package/supercomposite/AppHeader/AppHeader.js +1 -1
  41. package/supercomposite/EditableInfoCard/EditableInfoCard.d.ts +29 -0
  42. package/supercomposite/EditableInfoCard/EditableInfoCard.js +223 -0
  43. package/supercomposite/EditableInfoCard/index.d.ts +1 -0
  44. package/supercomposite/EditableInfoCard/index.js +4 -0
  45. package/supercomposite/index.d.ts +1 -0
  46. package/supercomposite/index.js +6 -4
@@ -0,0 +1 @@
1
+ export { default, type TooltipProps } from './Tooltip';
@@ -0,0 +1,4 @@
1
+ import { Tooltip as a } from "./Tooltip.js";
2
+ export {
3
+ a as default
4
+ };
@@ -1,6 +1,9 @@
1
+ export { default as Accordion } from './Accordion';
1
2
  export { default as ErrorBoundary } from './ErrorBoundary';
2
3
  export { default as InfoCard } from './InfoCard';
4
+ export { default as LabeledInput } from './LabeledInput';
3
5
  export { default as List } from './List';
4
6
  export { default as LogoLoop } from './LogoLoop';
7
+ export { default as Tooltip } from './Tooltip';
5
8
  export { default as WithLabel } from './WithLabel';
6
9
  export { default as WithLoading } from './WithLoading';
@@ -1,14 +1,20 @@
1
+ import { Accordion as t } from "./Accordion/Accordion.js";
1
2
  import { default as a } from "./ErrorBoundary/ErrorBoundary.js";
2
- import { InfoCard as e } from "./InfoCard/InfoCard.js";
3
- import { default as d } from "./List/List.js";
4
- import { default as l } from "./LogoLoop/LogoLoop.js";
5
- import { default as s } from "./WithLabel/WithLabel.js";
6
- import { default as x } from "./WithLoading/WithLoading.js";
3
+ import { InfoCard as p } from "./InfoCard/InfoCard.js";
4
+ import { LabeledInput as m } from "./LabeledInput/LabeledInput.js";
5
+ import { default as l } from "./List/List.js";
6
+ import { default as i } from "./LogoLoop/LogoLoop.js";
7
+ import { Tooltip as L } from "./Tooltip/Tooltip.js";
8
+ import { default as b } from "./WithLabel/WithLabel.js";
9
+ import { default as g } from "./WithLoading/WithLoading.js";
7
10
  export {
11
+ t as Accordion,
8
12
  a as ErrorBoundary,
9
- e as InfoCard,
10
- d as List,
11
- l as LogoLoop,
12
- s as WithLabel,
13
- x as WithLoading
13
+ p as InfoCard,
14
+ m as LabeledInput,
15
+ l as List,
16
+ i as LogoLoop,
17
+ L as Tooltip,
18
+ b as WithLabel,
19
+ g as WithLoading
14
20
  };
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export { ZoomEntrance } from './animation';
1
+ export { Spin, ZoomEntrance } from './animation';
2
2
  export { Avatar, AvatarWithImage, Button, Divider, Flex, Grid, Icon, Input, LabeledValue, ListButton, Loading, ScrollContainer, } from './base';
3
- export { ErrorBoundary, InfoCard, List, LogoLoop, WithLabel, WithLoading } from './composite';
4
- export { AppHeader, Nav } from './supercomposite';
3
+ export { Accordion, ErrorBoundary, InfoCard, LabeledInput, List, LogoLoop, Tooltip, WithLabel, WithLoading, } from './composite';
4
+ export { AppHeader, EditableInfoCard, Nav } from './supercomposite';
5
5
  export { AppContainer } from './templates';
package/index.js CHANGED
@@ -1,46 +1,56 @@
1
- import { default as t } from "./animation/ZoomEntrance/ZoomEntrance.js";
2
- import { default as a } from "./base/Avatar/Avatar.js";
3
- import { AvatarWithImage as p } from "./base/AvatarWithImage/AvatarWithImage.js";
4
- import { Button as x } from "./base/Button/Button.js";
5
- import { Divider as l } from "./base/Divider/Divider.js";
6
- import { default as s } from "./base/Flex/Flex.js";
7
- import { Grid as i } from "./base/Grid/Grid.js";
8
- import { default as g } from "./base/Icon/Icon.js";
9
- import { Input as A } from "./base/Input/Input.js";
10
- import { LabeledValue as c } from "./base/LabeledValue/LabeledValue.js";
1
+ import { default as t } from "./animation/Spin/Spin.js";
2
+ import { default as a } from "./animation/ZoomEntrance/ZoomEntrance.js";
3
+ import { default as p } from "./base/Avatar/Avatar.js";
4
+ import { AvatarWithImage as x } from "./base/AvatarWithImage/AvatarWithImage.js";
5
+ import { Button as l } from "./base/Button/Button.js";
6
+ import { Divider as n } from "./base/Divider/Divider.js";
7
+ import { default as i } from "./base/Flex/Flex.js";
8
+ import { Grid as I } from "./base/Grid/Grid.js";
9
+ import { default as A } from "./base/Icon/Icon.js";
10
+ import { I as g } from "./.chunks/Input.js";
11
+ import { LabeledValue as C } from "./base/LabeledValue/LabeledValue.js";
11
12
  import { default as B } from "./base/ListButton/ListButton.js";
12
13
  import { default as W } from "./base/Loading/Loading.js";
13
- import { default as E } from "./base/ScrollContainer/ScrollContainer.js";
14
- import { default as D } from "./composite/ErrorBoundary/ErrorBoundary.js";
15
- import { InfoCard as G } from "./composite/InfoCard/InfoCard.js";
16
- import { default as N } from "./composite/List/List.js";
17
- import { default as V } from "./composite/LogoLoop/LogoLoop.js";
18
- import { default as j } from "./composite/WithLabel/WithLabel.js";
19
- import { default as q } from "./composite/WithLoading/WithLoading.js";
20
- import { default as z } from "./supercomposite/AppHeader/AppHeader.js";
21
- import { Nav as K } from "./supercomposite/Nav/Nav.js";
22
- import { default as O } from "./templates/AppContainer/AppContainer.js";
14
+ import { default as y } from "./base/ScrollContainer/ScrollContainer.js";
15
+ import { Accordion as F } from "./composite/Accordion/Accordion.js";
16
+ import { default as H } from "./composite/ErrorBoundary/ErrorBoundary.js";
17
+ import { InfoCard as T } from "./composite/InfoCard/InfoCard.js";
18
+ import { LabeledInput as Z } from "./composite/LabeledInput/LabeledInput.js";
19
+ import { default as k } from "./composite/List/List.js";
20
+ import { default as w } from "./composite/LogoLoop/LogoLoop.js";
21
+ import { Tooltip as J } from "./composite/Tooltip/Tooltip.js";
22
+ import { default as M } from "./composite/WithLabel/WithLabel.js";
23
+ import { default as P } from "./composite/WithLoading/WithLoading.js";
24
+ import { default as R } from "./supercomposite/AppHeader/AppHeader.js";
25
+ import { EditableInfoCard as X } from "./supercomposite/EditableInfoCard/EditableInfoCard.js";
26
+ import { Nav as _ } from "./supercomposite/Nav/Nav.js";
27
+ import { default as oo } from "./templates/AppContainer/AppContainer.js";
23
28
  export {
24
- O as AppContainer,
25
- z as AppHeader,
26
- a as Avatar,
27
- p as AvatarWithImage,
28
- x as Button,
29
- l as Divider,
30
- D as ErrorBoundary,
31
- s as Flex,
32
- i as Grid,
33
- g as Icon,
34
- G as InfoCard,
35
- A as Input,
36
- c as LabeledValue,
37
- N as List,
29
+ F as Accordion,
30
+ oo as AppContainer,
31
+ R as AppHeader,
32
+ p as Avatar,
33
+ x as AvatarWithImage,
34
+ l as Button,
35
+ n as Divider,
36
+ X as EditableInfoCard,
37
+ H as ErrorBoundary,
38
+ i as Flex,
39
+ I as Grid,
40
+ A as Icon,
41
+ T as InfoCard,
42
+ g as Input,
43
+ Z as LabeledInput,
44
+ C as LabeledValue,
45
+ k as List,
38
46
  B as ListButton,
39
47
  W as Loading,
40
- V as LogoLoop,
41
- K as Nav,
42
- E as ScrollContainer,
43
- j as WithLabel,
44
- q as WithLoading,
45
- t as ZoomEntrance
48
+ w as LogoLoop,
49
+ _ as Nav,
50
+ y as ScrollContainer,
51
+ t as Spin,
52
+ J as Tooltip,
53
+ M as WithLabel,
54
+ P as WithLoading,
55
+ a as ZoomEntrance
46
56
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "jcicl",
3
3
  "private": false,
4
- "version": "0.0.57",
4
+ "version": "0.0.58",
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",
@@ -3,7 +3,7 @@ import { useState as a } from "react";
3
3
  import { n } from "../../.chunks/emotion-styled.browser.esm.js";
4
4
  import e from "../../theme.js";
5
5
  import { l as c } from "../../.chunks/jocologo.js";
6
- import { Input as m } from "../../base/Input/Input.js";
6
+ import { I as m } from "../../.chunks/Input.js";
7
7
  import { Button as p } from "../../base/Button/Button.js";
8
8
  import d from "../../base/Avatar/Avatar.js";
9
9
  const l = n("div")(({ navWidth: o }) => ({
@@ -0,0 +1,29 @@
1
+ import { CSSObject } from '@emotion/react';
2
+ import { LabeledValueProps } from '../../../../../../../../../src/components/base/LabeledValue';
3
+ interface EditableInfoCardStyleProps {
4
+ /** The element placed before the header text. This can be any valid React Node */
5
+ decorativeElement?: React.ReactNode;
6
+ /** Padding for the card */
7
+ padding?: string;
8
+ /** Box shadow around the card */
9
+ shadow?: string;
10
+ /** Spacing between the items */
11
+ spacing?: string;
12
+ columns?: number;
13
+ /** Custom styles for the card */
14
+ styles?: CSSObject;
15
+ /** Save event handler. Exposes card data through a json object with key value pairs corresponding to the card labels, with spaces removed. **Usage:** ```onSave(items) => { ...doStuff }``` */
16
+ onSave: (items: {
17
+ [key: string]: any;
18
+ }) => void;
19
+ onCancel?: () => void;
20
+ onEdit?: () => void;
21
+ width?: string;
22
+ }
23
+ export interface EditableInfoCardProps extends EditableInfoCardStyleProps {
24
+ title?: string;
25
+ /** An array of information to display in the card. Format: `{ label, value }`. Built on top of the Labeled Value component. */
26
+ items?: LabeledValueProps[];
27
+ }
28
+ export declare const EditableInfoCard: React.FC<EditableInfoCardProps>;
29
+ export default EditableInfoCard;
@@ -0,0 +1,223 @@
1
+ import { jsx as o, jsxs as l, Fragment as G } from "react/jsx-runtime";
2
+ import { useState as I } from "react";
3
+ import { n as c } from "../../.chunks/emotion-styled.browser.esm.js";
4
+ import { c as f } from "../../.chunks/emotion-react.browser.esm.js";
5
+ import { c as x } from "../../.chunks/createSvgIcon.js";
6
+ import d from "../../theme.js";
7
+ import { LabeledValue as U } from "../../base/LabeledValue/LabeledValue.js";
8
+ import { LabeledInput as W } from "../../composite/LabeledInput/LabeledInput.js";
9
+ import p from "../../base/Flex/Flex.js";
10
+ import { Tooltip as b } from "../../composite/Tooltip/Tooltip.js";
11
+ import { T as q } from "../../.chunks/Input.js";
12
+ import { B as A } from "../../.chunks/ButtonBase.js";
13
+ const D = x(/* @__PURE__ */ o("path", {
14
+ 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"), H = x(/* @__PURE__ */ o("path", {
16
+ 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"), J = x(/* @__PURE__ */ o("path", {
18
+ d: "M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"
19
+ }), "Check"), k = c("div")(
20
+ ({ width: t, padding: a, shadow: r, styles: h, isEditing: s }) => ({
21
+ ...f`
22
+ width: ${t};
23
+ max-width: 100%;
24
+ h3 {
25
+ margin: 0;
26
+ width: 100%;
27
+ font-size: 28px;
28
+ }
29
+ font-family: 'Roboto', sans-serif;
30
+ padding: ${a};
31
+ display: flex;
32
+ flex-direction: column;
33
+ box-shadow: ${r};
34
+ border-radius: 5px;
35
+ background-color: ${d.colors.white};
36
+ ${h};
37
+ z-index: ${s ? 0 : 1};
38
+ position: relative;
39
+ transform: ${s ? "rotateY(-180deg)" : "rotateY(0deg)"};
40
+ transition: 920ms all ease-in-out;
41
+ opacity: ${s ? "0" : "1"};
42
+ `
43
+ })
44
+ ), K = c(q)({
45
+ backgroundColor: d.colors.white,
46
+ borderRadius: "0",
47
+ input: {
48
+ fontSize: "28px",
49
+ fontWeight: "bold",
50
+ transition: "313ms all ease-out",
51
+ padding: "0",
52
+ borderRadius: "0",
53
+ borderBottom: `1px solid ${d.colors.gray}`,
54
+ "&:focus, :focus-visible": {
55
+ boxShadow: `0 3px 2px -2px ${d.colors.darkGreen}`
56
+ }
57
+ },
58
+ "&:hover, :focus, :focus-visible": {
59
+ input: {
60
+ boxShadow: `0 3px 2px -2px ${d.colors.darkGreen}`
61
+ }
62
+ },
63
+ fieldset: {
64
+ borderRadius: "0",
65
+ border: "none"
66
+ },
67
+ "&.Mui-focused": {
68
+ fieldset: {
69
+ border: "none"
70
+ }
71
+ }
72
+ }), N = c(k)(({ isEditing: t }) => ({
73
+ ...f`
74
+ position: absolute;
75
+ top: 9px;
76
+ z-index: ${t ? 1 : 0};
77
+ transform: ${t ? "rotateY(0deg)" : "rotateY(-180deg)"};
78
+ opacity: ${t ? "1" : "0"};
79
+ transition: 920ms all ease-in-out;
80
+ `
81
+ })), v = c("div")(({ spacing: t, columns: a }) => ({
82
+ ...f`
83
+ margin-top: calc(${t} * 0.75);
84
+ grid-row-gap: ${t};
85
+ grid-column-gap: calc(${t} * 1.5);
86
+ display: grid;
87
+ grid-template-columns: repeat(${a}, 1fr);
88
+ `
89
+ })), g = c(A)(() => ({
90
+ ...f`
91
+ width: 40px;
92
+ height: 40px;
93
+ border-radius: 50%;
94
+ `
95
+ })), io = ({
96
+ decorativeElement: t,
97
+ title: a,
98
+ items: r = [],
99
+ padding: h = "1rem 2rem",
100
+ shadow: s = d.boxShadow.darkGreen,
101
+ spacing: y = "2rem",
102
+ columns: S = 3,
103
+ styles: z,
104
+ width: B,
105
+ onSave: M = () => {
106
+ },
107
+ onCancel: P = () => {
108
+ },
109
+ onEdit: T = () => {
110
+ }
111
+ }) => {
112
+ const C = r.reduce((e, n) => ({ ...e, [n.label]: n.value }), { titleValue: a }), [j, m] = I(!1), [i, u] = I(C), L = () => {
113
+ T(), m(!0);
114
+ }, R = () => {
115
+ M(i), m(!1);
116
+ }, V = () => {
117
+ P(), u(C), m(!1);
118
+ }, Y = (e, n) => {
119
+ u((F) => ({ ...F, [e]: n }));
120
+ }, E = (e) => {
121
+ u((n) => ({ ...n, titleValue: e }));
122
+ };
123
+ console.log(i);
124
+ const w = { width: B, padding: h, shadow: s, styles: z, isEditing: j }, $ = { spacing: y, columns: S };
125
+ return /* @__PURE__ */ l(G, { 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: [
129
+ t && t,
130
+ /* @__PURE__ */ o("h3", { children: a })
131
+ ] }),
132
+ /* @__PURE__ */ o(
133
+ b,
134
+ {
135
+ title: "Edit",
136
+ placement: "top",
137
+ slotProps: {
138
+ popper: {
139
+ modifiers: [
140
+ {
141
+ name: "offset",
142
+ options: {
143
+ offset: [0, -13]
144
+ }
145
+ }
146
+ ]
147
+ }
148
+ },
149
+ children: /* @__PURE__ */ o(g, { onClick: L, children: /* @__PURE__ */ o(D, {}) })
150
+ }
151
+ )
152
+ ] }),
153
+ /* @__PURE__ */ o(v, { ...$, children: r == null ? void 0 : r.map((e) => /* @__PURE__ */ o(U, { ...e }, e.label)) })
154
+ ] }),
155
+ /* @__PURE__ */ l(N, { ...w, children: [
156
+ /* @__PURE__ */ l(p, { width: "100%", justifyContent: "space-between", children: [
157
+ /* @__PURE__ */ l(p, { width: "100%", gap: "1rem", alignItems: "center", children: [
158
+ t && t,
159
+ /* @__PURE__ */ o("h3", { children: /* @__PURE__ */ o(
160
+ K,
161
+ {
162
+ onChange: (e) => E(e.target.value),
163
+ value: (i == null ? void 0 : i.titleValue) ?? a
164
+ }
165
+ ) })
166
+ ] }),
167
+ /* @__PURE__ */ o(
168
+ b,
169
+ {
170
+ title: "Cancel",
171
+ placement: "top",
172
+ slotProps: {
173
+ popper: {
174
+ modifiers: [
175
+ {
176
+ name: "offset",
177
+ options: {
178
+ offset: [0, -13]
179
+ }
180
+ }
181
+ ]
182
+ }
183
+ },
184
+ children: /* @__PURE__ */ o(g, { onClick: V, children: /* @__PURE__ */ o(H, {}) })
185
+ }
186
+ ),
187
+ /* @__PURE__ */ o(
188
+ b,
189
+ {
190
+ title: "Save",
191
+ placement: "top",
192
+ slotProps: {
193
+ popper: {
194
+ modifiers: [
195
+ {
196
+ name: "offset",
197
+ options: {
198
+ offset: [0, -13]
199
+ }
200
+ }
201
+ ]
202
+ }
203
+ },
204
+ children: /* @__PURE__ */ o(g, { onClick: R, children: /* @__PURE__ */ o(J, {}) })
205
+ }
206
+ )
207
+ ] }),
208
+ /* @__PURE__ */ o(v, { ...$, children: r == null ? void 0 : r.map((e) => /* @__PURE__ */ o(
209
+ W,
210
+ {
211
+ label: e.label,
212
+ value: i[e.label],
213
+ onChange: (n) => Y(e.label, n.target.value)
214
+ },
215
+ e.label
216
+ )) })
217
+ ] })
218
+ ] });
219
+ };
220
+ export {
221
+ io as EditableInfoCard,
222
+ io as default
223
+ };
@@ -0,0 +1 @@
1
+ export { default, type EditableInfoCardProps } from './EditableInfoCard';
@@ -0,0 +1,4 @@
1
+ import { EditableInfoCard as e } from "./EditableInfoCard.js";
2
+ export {
3
+ e as default
4
+ };
@@ -1,2 +1,3 @@
1
1
  export { default as AppHeader } from './AppHeader';
2
+ export { default as EditableInfoCard } from './EditableInfoCard';
2
3
  export { default as Nav } from './Nav';
@@ -1,6 +1,8 @@
1
- import { default as a } from "./AppHeader/AppHeader.js";
2
- import { Nav as p } from "./Nav/Nav.js";
1
+ import { default as o } from "./AppHeader/AppHeader.js";
2
+ import { EditableInfoCard as f } from "./EditableInfoCard/EditableInfoCard.js";
3
+ import { Nav as t } from "./Nav/Nav.js";
3
4
  export {
4
- a as AppHeader,
5
- p as Nav
5
+ o as AppHeader,
6
+ f as EditableInfoCard,
7
+ t as Nav
6
8
  };