jcicl 1.0.3 → 1.0.7
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/CircularIconButton/CircularIconButton.js +22 -18
- package/DefaultTemplate/DefaultTemplate.js +3 -3
- package/DetailItemWithIcon/DetailItemWithIcon.js +31 -19
- package/DetailPageComponents/DetailPageComponents.d.ts +12 -4
- package/DetailPageComponents/DetailPageComponents.js +44 -28
- package/EditableDetailItemWithIcon/EditableDetailItemWithIcon.d.ts +1 -0
- package/EditableDetailItemWithIcon/EditableDetailItemWithIcon.js +63 -62
- package/EditableInfoCard/EditableInfoCard.js +107 -103
- package/FormComponents/FormComponents.d.ts +17 -10
- package/FormComponents/FormComponents.js +52 -46
- package/Icon/Icon.js +23 -22
- package/InfoCard/InfoCard.js +37 -33
- package/Input/Input.js +19 -15
- package/LabeledCheckbox/LabeledCheckbox.js +58 -55
- package/LabeledDropdown/LabeledDropdown.js +370 -366
- package/LabeledInput/LabeledInput.js +13 -13
- package/LabeledTextArea/LabeledTextArea.js +20 -13
- package/List/List.js +19 -18
- package/ListButton/ListButton.d.ts +2 -4
- package/ListButton/ListButton.js +21 -12
- package/Loading/Loading.js +14 -9
- package/Memo/Memo.js +16 -15
- package/Pill/Pill.js +13 -12
- package/Search/Search.js +64 -62
- package/SquareIcon/SquareIcon.js +28 -25
- package/SquareIconButton/SquareIconButton.js +24 -11
- package/Stepper/Stepper.js +166 -146
- package/Table/Table.js +233 -221
- package/WithLoading/WithLoading.js +16 -11
- package/package.json +1 -1
- package/theme.d.ts +17 -9
- package/theme.js +4 -0
- package/themeUtils.d.ts +5 -0
- package/themeUtils.js +81 -69
- package/utils.d.ts +1 -0
- package/utils.js +27 -7
|
@@ -1,17 +1,22 @@
|
|
|
1
|
-
import { jsx as r, Fragment as
|
|
2
|
-
import { n as
|
|
1
|
+
import { jsx as r, Fragment as m } from "react/jsx-runtime";
|
|
2
|
+
import { n as c } from "../.chunks/emotion-styled.browser.esm.js";
|
|
3
3
|
import { c as i } from "../.chunks/emotion-react.browser.esm.js";
|
|
4
|
-
import a from "../
|
|
5
|
-
import { C as
|
|
6
|
-
const
|
|
4
|
+
import { useThemeColors as a } from "../ThemeContext.js";
|
|
5
|
+
import { C as n } from "../.chunks/CircularProgress.js";
|
|
6
|
+
const u = c(n, {
|
|
7
|
+
shouldForwardProp: (o) => !["customTheme"].includes(o)
|
|
8
|
+
})(({ customTheme: o }) => ({
|
|
7
9
|
...i`
|
|
8
|
-
color: ${
|
|
10
|
+
color: ${o.themeIconBackgroundA};
|
|
9
11
|
`
|
|
10
|
-
}),
|
|
12
|
+
})), g = ({
|
|
11
13
|
loading: o,
|
|
12
|
-
children:
|
|
13
|
-
...
|
|
14
|
-
}) =>
|
|
14
|
+
children: s,
|
|
15
|
+
...e
|
|
16
|
+
}) => {
|
|
17
|
+
const t = a();
|
|
18
|
+
return o ? /* @__PURE__ */ r(u, { size: 47, ...e, customTheme: t }) : /* @__PURE__ */ r(m, { children: s });
|
|
19
|
+
};
|
|
15
20
|
export {
|
|
16
|
-
|
|
21
|
+
g as default
|
|
17
22
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jcicl",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.7",
|
|
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",
|
package/theme.d.ts
CHANGED
|
@@ -104,6 +104,15 @@ export interface TemplateThemeProps {
|
|
|
104
104
|
backgroundColor: string;
|
|
105
105
|
};
|
|
106
106
|
}
|
|
107
|
+
export interface ThemeOptions {
|
|
108
|
+
green: string;
|
|
109
|
+
blue: string;
|
|
110
|
+
red: string;
|
|
111
|
+
grayscale: string;
|
|
112
|
+
custom: string;
|
|
113
|
+
}
|
|
114
|
+
declare const theme: Theme;
|
|
115
|
+
export default theme;
|
|
107
116
|
export interface CustomThemeProps {
|
|
108
117
|
themeColor: string;
|
|
109
118
|
themeDark: string;
|
|
@@ -118,6 +127,10 @@ export interface CustomThemeProps {
|
|
|
118
127
|
themeShadowA: string;
|
|
119
128
|
themeShadowB: string;
|
|
120
129
|
themeShadowC: string;
|
|
130
|
+
themeIconBackgroundA: string;
|
|
131
|
+
themeIconBackgroundB: string;
|
|
132
|
+
themeIconColorA: string;
|
|
133
|
+
themeIconColorB: string;
|
|
121
134
|
highlightPrimary: string;
|
|
122
135
|
highlightSecondary: string;
|
|
123
136
|
highlightTertiary: string;
|
|
@@ -137,15 +150,6 @@ export interface CustomThemeProps {
|
|
|
137
150
|
darkGray1: string;
|
|
138
151
|
black: string;
|
|
139
152
|
}
|
|
140
|
-
export interface ThemeOptions {
|
|
141
|
-
green: string;
|
|
142
|
-
blue: string;
|
|
143
|
-
red: string;
|
|
144
|
-
grayscale: string;
|
|
145
|
-
custom: string;
|
|
146
|
-
}
|
|
147
|
-
declare const theme: Theme;
|
|
148
|
-
export default theme;
|
|
149
153
|
export declare const defaultTheme: {
|
|
150
154
|
themeColor: string;
|
|
151
155
|
themeDark: string;
|
|
@@ -160,6 +164,10 @@ export declare const defaultTheme: {
|
|
|
160
164
|
themeShadowA: string;
|
|
161
165
|
themeShadowB: string;
|
|
162
166
|
themeShadowC: string;
|
|
167
|
+
themeIconBackgroundA: string;
|
|
168
|
+
themeIconBackgroundB: string;
|
|
169
|
+
themeIconColorA: string;
|
|
170
|
+
themeIconColorB: string;
|
|
163
171
|
highlightPrimary: string;
|
|
164
172
|
highlightSecondary: string;
|
|
165
173
|
highlightTertiary: string;
|
package/theme.js
CHANGED
|
@@ -111,6 +111,10 @@ const o = {
|
|
|
111
111
|
themeShadowA: e.colors.darkGreenO99,
|
|
112
112
|
themeShadowB: e.boxShadows.darkGreen,
|
|
113
113
|
themeShadowC: e.boxShadows.darkGreenThick,
|
|
114
|
+
themeIconBackgroundA: e.colors.green,
|
|
115
|
+
themeIconBackgroundB: e.colors.whiteGreenA,
|
|
116
|
+
themeIconColorA: e.colors.white,
|
|
117
|
+
themeIconColorB: e.colors.darkGreen,
|
|
114
118
|
// These colors always stay the same, no custom theme updating
|
|
115
119
|
highlightPrimary: e.colors.sunlight,
|
|
116
120
|
highlightSecondary: e.colors.dandelion,
|
package/themeUtils.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare const getHueFromHex: (hex: string) => number;
|
|
2
|
+
export declare const getSaturationFromHex: (hex: string) => number;
|
|
2
3
|
export declare const substituteHue: (themeColor: string, hue: number) => string;
|
|
3
4
|
export declare const updateTheme: (newHue?: number) => {
|
|
4
5
|
themeColor: string;
|
|
@@ -14,6 +15,10 @@ export declare const updateTheme: (newHue?: number) => {
|
|
|
14
15
|
themeShadowA: string;
|
|
15
16
|
themeShadowB: string;
|
|
16
17
|
themeShadowC: string;
|
|
18
|
+
themeIconBackgroundA: string;
|
|
19
|
+
themeIconBackgroundB: string;
|
|
20
|
+
themeIconColorA: string;
|
|
21
|
+
themeIconColorB: string;
|
|
17
22
|
highlightPrimary: string;
|
|
18
23
|
highlightSecondary: string;
|
|
19
24
|
highlightTertiary: string;
|
package/themeUtils.js
CHANGED
|
@@ -1,88 +1,100 @@
|
|
|
1
|
-
import
|
|
2
|
-
function
|
|
3
|
-
const r = parseInt(o.substring(1, 3), 16),
|
|
4
|
-
return [r,
|
|
1
|
+
import n, { defaultTheme as C } from "./theme.js";
|
|
2
|
+
function a(o) {
|
|
3
|
+
const r = parseInt(o.substring(1, 3), 16), t = parseInt(o.substring(3, 5), 16), e = parseInt(o.substring(5, 7), 16);
|
|
4
|
+
return [r, t, e];
|
|
5
5
|
}
|
|
6
|
-
function
|
|
7
|
-
o /= 255, r /= 255,
|
|
8
|
-
const
|
|
9
|
-
if (
|
|
10
|
-
return [0, 0,
|
|
11
|
-
const
|
|
12
|
-
let
|
|
13
|
-
return
|
|
6
|
+
function d(o, r, t) {
|
|
7
|
+
o /= 255, r /= 255, t /= 255;
|
|
8
|
+
const e = Math.max(o, r, t), h = Math.min(o, r, t), c = (e + h) / 2;
|
|
9
|
+
if (e === h)
|
|
10
|
+
return [0, 0, c];
|
|
11
|
+
const i = e - h;
|
|
12
|
+
let l = c > 0.5 ? i / (2 - e - h) : i / (e + h), m;
|
|
13
|
+
return e === o ? m = (r - t) / i + (r < t ? 6 : 0) : e === r ? m = (t - o) / i + 2 : m = (o - r) / i + 4, m /= 6, [m, l, c];
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
let
|
|
15
|
+
function I(o, r, t) {
|
|
16
|
+
let e, h, c;
|
|
17
17
|
if (r === 0)
|
|
18
|
-
|
|
18
|
+
e = h = c = t;
|
|
19
19
|
else {
|
|
20
|
-
const
|
|
21
|
-
|
|
20
|
+
const i = t < 0.5 ? t * (1 + r) : t + r - t * r, l = 2 * t - i;
|
|
21
|
+
e = g(l, i, o + 1 / 3), h = g(l, i, o), c = g(l, i, o - 1 / 3);
|
|
22
22
|
}
|
|
23
|
-
return [Math.round(
|
|
23
|
+
return [Math.round(e * 255), Math.round(h * 255), Math.round(c * 255)];
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
return
|
|
25
|
+
function g(o, r, t) {
|
|
26
|
+
return t < 0 && (t += 1), t > 1 && (t -= 1), t < 1 / 6 ? o + (r - o) * 6 * t : t < 1 / 2 ? r : t < 2 / 3 ? o + (r - o) * (2 / 3 - t) * 6 : o;
|
|
27
27
|
}
|
|
28
|
-
function
|
|
29
|
-
var
|
|
30
|
-
return "#" +
|
|
28
|
+
function T(o, r, t) {
|
|
29
|
+
var e = o.toString(16).length == 1 ? "0" + o.toString(16) : o.toString(16), h = r.toString(16).length == 1 ? "0" + r.toString(16) : r.toString(16), c = t.toString(16).length == 1 ? "0" + t.toString(16) : t.toString(16);
|
|
30
|
+
return "#" + e + h + c;
|
|
31
31
|
}
|
|
32
|
-
const
|
|
33
|
-
const [r,
|
|
34
|
-
return
|
|
32
|
+
const k = (o) => {
|
|
33
|
+
const [r, t, e] = a(o), [h, c, i] = d(r, t, e);
|
|
34
|
+
return h;
|
|
35
|
+
}, _ = (o) => {
|
|
36
|
+
const [r, t, e] = a(o), [h, c, i] = d(r, t, e);
|
|
37
|
+
return c;
|
|
35
38
|
}, s = (o, r) => {
|
|
36
|
-
const [
|
|
37
|
-
let
|
|
38
|
-
|
|
39
|
-
let
|
|
40
|
-
|
|
41
|
-
const [
|
|
42
|
-
return
|
|
43
|
-
},
|
|
44
|
-
const r = localStorage.getItem("theme") || "green",
|
|
45
|
-
if (r == "green") return
|
|
46
|
-
var
|
|
47
|
-
o != null && (
|
|
39
|
+
const [t, e, h] = a(o), [c, i, l] = d(t, e, h);
|
|
40
|
+
let m = i + 0.1;
|
|
41
|
+
m >= 1 && (m = 0.99);
|
|
42
|
+
let u = l;
|
|
43
|
+
u > 0.5 && (u -= 0.08), u > 0.8 && (m = 1, u += 0.03), r < 0 && (m = 0);
|
|
44
|
+
const [f, S, B] = I(r, m, u);
|
|
45
|
+
return T(f, S, B);
|
|
46
|
+
}, F = (o) => {
|
|
47
|
+
const r = localStorage.getItem("theme") || "green", t = localStorage.getItem("hue") || k(n.themeOptions.green).toString();
|
|
48
|
+
if (r == "green") return C;
|
|
49
|
+
var e = parseFloat(t);
|
|
50
|
+
o != null && (e = o);
|
|
48
51
|
const {
|
|
49
|
-
themeColor:
|
|
50
|
-
themeDark:
|
|
51
|
-
themeMediumA:
|
|
52
|
-
themeMediumB:
|
|
53
|
-
themeMediumC:
|
|
54
|
-
themeLight:
|
|
55
|
-
themeLightA:
|
|
56
|
-
themeLightB:
|
|
57
|
-
themeLightC:
|
|
58
|
-
themeLightD:
|
|
59
|
-
themeShadowA:
|
|
60
|
-
themeShadowB:
|
|
61
|
-
themeShadowC:
|
|
62
|
-
|
|
63
|
-
|
|
52
|
+
themeColor: h,
|
|
53
|
+
themeDark: c,
|
|
54
|
+
themeMediumA: i,
|
|
55
|
+
themeMediumB: l,
|
|
56
|
+
themeMediumC: m,
|
|
57
|
+
themeLight: u,
|
|
58
|
+
themeLightA: f,
|
|
59
|
+
themeLightB: S,
|
|
60
|
+
themeLightC: B,
|
|
61
|
+
themeLightD: w,
|
|
62
|
+
themeShadowA: A,
|
|
63
|
+
themeShadowB: p,
|
|
64
|
+
themeShadowC: M,
|
|
65
|
+
themeIconBackgroundA: L,
|
|
66
|
+
themeIconBackgroundB: b,
|
|
67
|
+
themeIconColorA: x,
|
|
68
|
+
themeIconColorB: v,
|
|
69
|
+
...G
|
|
70
|
+
} = C;
|
|
64
71
|
return {
|
|
65
|
-
themeColor: s(
|
|
66
|
-
themeDark: s(
|
|
67
|
-
themeMediumA: s(
|
|
72
|
+
themeColor: s(n.colors.green, e),
|
|
73
|
+
themeDark: s(n.colors.darkGreen, e),
|
|
74
|
+
themeMediumA: s(n.colors.whiteGreenB, e),
|
|
68
75
|
// mint
|
|
69
|
-
themeMediumB: s(
|
|
70
|
-
themeMediumC: s(
|
|
71
|
-
themeLight: s(
|
|
76
|
+
themeMediumB: s(n.colors.moss, e),
|
|
77
|
+
themeMediumC: s(n.colors.sage, e),
|
|
78
|
+
themeLight: s(n.colors.whiteGreenB, e),
|
|
72
79
|
// whiteGreen
|
|
73
|
-
themeLightA: s(
|
|
80
|
+
themeLightA: s(n.colors.moss, e),
|
|
74
81
|
// whiteGreenA
|
|
75
|
-
themeLightB: s(
|
|
76
|
-
themeLightC: s(
|
|
77
|
-
themeLightD: s(
|
|
78
|
-
themeShadowA: s(
|
|
79
|
-
themeShadowB: "0 0 8px -2px " + s(
|
|
80
|
-
themeShadowC: "0 0 2px 1px " + s(
|
|
81
|
-
|
|
82
|
+
themeLightB: s(n.colors.whiteGreenB, e),
|
|
83
|
+
themeLightC: s(n.colors.whiteGreenC, e),
|
|
84
|
+
themeLightD: s(n.colors.whiteGreenD, e),
|
|
85
|
+
themeShadowA: s(n.colors.darkGreenO99, e) + "99",
|
|
86
|
+
themeShadowB: "0 0 8px -2px " + s(n.colors.darkGreen, e),
|
|
87
|
+
themeShadowC: "0 0 2px 1px " + s(n.colors.darkGreen, e),
|
|
88
|
+
themeIconBackgroundA: e < 0 ? n.colors.green : s(n.colors.green, e),
|
|
89
|
+
themeIconBackgroundB: e < 0 ? n.colors.whiteGreenA : s(n.colors.whiteGreenA, e),
|
|
90
|
+
themeIconColorA: n.colors.white,
|
|
91
|
+
themeIconColorB: e < 0 ? n.colors.darkGreen : s(n.colors.darkGreen, e),
|
|
92
|
+
...G
|
|
82
93
|
};
|
|
83
94
|
};
|
|
84
95
|
export {
|
|
85
|
-
|
|
96
|
+
k as getHueFromHex,
|
|
97
|
+
_ as getSaturationFromHex,
|
|
86
98
|
s as substituteHue,
|
|
87
|
-
|
|
99
|
+
F as updateTheme
|
|
88
100
|
};
|
package/utils.d.ts
CHANGED
package/utils.js
CHANGED
|
@@ -1,13 +1,33 @@
|
|
|
1
|
-
const
|
|
1
|
+
const d = (t, e = "mmddyyyy") => e === "mmddyyyy" ? new Date(t).toLocaleDateString("en-US", {
|
|
2
2
|
month: "numeric",
|
|
3
3
|
day: "numeric",
|
|
4
4
|
year: "numeric"
|
|
5
|
-
}) : t,
|
|
6
|
-
const { line1:
|
|
7
|
-
let
|
|
8
|
-
return
|
|
5
|
+
}) : t, y = (t) => {
|
|
6
|
+
const { line1: e, line2: o, city: n, state: a, zip: s } = t;
|
|
7
|
+
let r = e;
|
|
8
|
+
return o && (r += `, ${o}`), n && (r += `, ${n}`), a && (r += `, ${a}`), s && (r += ` ${s}`), r;
|
|
9
|
+
}, m = (t) => {
|
|
10
|
+
if (t > 3 && t < 21) return "th";
|
|
11
|
+
switch (t % 10) {
|
|
12
|
+
case 1:
|
|
13
|
+
return "st";
|
|
14
|
+
case 2:
|
|
15
|
+
return "nd";
|
|
16
|
+
case 3:
|
|
17
|
+
return "rd";
|
|
18
|
+
default:
|
|
19
|
+
return "th";
|
|
20
|
+
}
|
|
21
|
+
}, f = (t) => {
|
|
22
|
+
try {
|
|
23
|
+
const e = new Date(t), o = e.toLocaleDateString("en-US", { month: "short" }) + ".", n = e.getDate(), a = m(n), s = e.getFullYear(), r = e.getHours(), c = e.getMinutes().toString().padStart(2, "0"), i = r % 12 || 12, u = r >= 12 ? "pm" : "am";
|
|
24
|
+
return `${o} ${n}${a}, ${s}, ${i}:${c}${u}`;
|
|
25
|
+
} catch {
|
|
26
|
+
return t;
|
|
27
|
+
}
|
|
9
28
|
};
|
|
10
29
|
export {
|
|
11
|
-
|
|
12
|
-
|
|
30
|
+
y as formatAddress,
|
|
31
|
+
d as formatDate,
|
|
32
|
+
f as formatTimestamp
|
|
13
33
|
};
|