jcicl 1.0.5 → 1.0.9

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 (47) hide show
  1. package/.chunks/DefaultPropsProvider.js +3 -3
  2. package/.chunks/TextField.js +1 -1
  3. package/.chunks/x.js +22 -0
  4. package/Button/Button.js +36 -32
  5. package/CircularIconButton/CircularIconButton.js +23 -19
  6. package/DefaultTemplate/DefaultTemplate.js +3 -3
  7. package/DetailItemWithIcon/DetailItemWithIcon.js +31 -19
  8. package/DetailPageComponents/DetailPageComponents.d.ts +12 -4
  9. package/DetailPageComponents/DetailPageComponents.js +44 -28
  10. package/EditableDetailItemWithIcon/EditableDetailItemWithIcon.d.ts +1 -0
  11. package/EditableDetailItemWithIcon/EditableDetailItemWithIcon.js +59 -74
  12. package/EditableInfoCard/EditableInfoCard.js +107 -103
  13. package/FormComponents/FormComponents.d.ts +17 -10
  14. package/FormComponents/FormComponents.js +52 -46
  15. package/Icon/Icon.js +23 -22
  16. package/InfoCard/InfoCard.js +37 -33
  17. package/Input/Input.js +19 -15
  18. package/LabeledCheckbox/LabeledCheckbox.js +58 -55
  19. package/LabeledDropdown/LabeledDropdown.js +370 -366
  20. package/LabeledInput/LabeledInput.js +13 -13
  21. package/LabeledTextArea/LabeledTextArea.js +20 -13
  22. package/List/List.js +19 -18
  23. package/ListButton/ListButton.d.ts +2 -4
  24. package/ListButton/ListButton.js +21 -12
  25. package/Loading/Loading.js +14 -9
  26. package/Pill/Pill.d.ts +1 -0
  27. package/Pill/Pill.js +21 -13
  28. package/ScrollContainer/ScrollContainer.js +180 -179
  29. package/Search/Search.js +64 -62
  30. package/SquareIcon/SquareIcon.js +28 -25
  31. package/SquareIconButton/SquareIconButton.js +24 -11
  32. package/Stepper/Stepper.js +166 -146
  33. package/Table/Table.js +233 -221
  34. package/Toast/Toast.d.ts +8 -0
  35. package/Toast/Toast.js +154 -0
  36. package/Toast/ToastHelpers.d.ts +4 -0
  37. package/Toast/ToastHelpers.js +10 -0
  38. package/Toast/Toaster.d.ts +9 -0
  39. package/Toast/Toaster.js +25 -0
  40. package/Toast/index.d.ts +3 -0
  41. package/Toast/index.js +9 -0
  42. package/WithLoading/WithLoading.js +16 -11
  43. package/package.json +1 -1
  44. package/theme.d.ts +19 -9
  45. package/theme.js +15 -9
  46. package/themeUtils.d.ts +5 -0
  47. package/themeUtils.js +81 -69
@@ -0,0 +1,8 @@
1
+ export type ToastProps = {
2
+ type?: 'success' | 'warning' | 'error';
3
+ duration?: number;
4
+ onDismiss?: () => void;
5
+ message?: string;
6
+ };
7
+ declare const Toast: React.FC<ToastProps>;
8
+ export default Toast;
package/Toast/Toast.js ADDED
@@ -0,0 +1,154 @@
1
+ import { jsx as n, jsxs as h } from "react/jsx-runtime";
2
+ import { useState as f, useEffect as u } from "react";
3
+ import { n as l } from "../.chunks/emotion-styled.browser.esm.js";
4
+ import { c as a } from "../.chunks/emotion-react.browser.esm.js";
5
+ import e from "../theme.js";
6
+ import { c as m } from "../.chunks/createLucideIcon.js";
7
+ import { C as w, X as y } from "../.chunks/x.js";
8
+ /**
9
+ * @license lucide-react v0.525.0 - ISC
10
+ *
11
+ * This source code is licensed under the ISC license.
12
+ * See the LICENSE file in the root directory of this source tree.
13
+ */
14
+ const x = [
15
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
16
+ ["path", { d: "m4.9 4.9 14.2 14.2", key: "1m5liu" }]
17
+ ], k = m("ban", x);
18
+ /**
19
+ * @license lucide-react v0.525.0 - ISC
20
+ *
21
+ * This source code is licensed under the ISC license.
22
+ * See the LICENSE file in the root directory of this source tree.
23
+ */
24
+ const b = [
25
+ [
26
+ "path",
27
+ {
28
+ d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",
29
+ key: "wmoenq"
30
+ }
31
+ ],
32
+ ["path", { d: "M12 9v4", key: "juzpu7" }],
33
+ ["path", { d: "M12 17h.01", key: "p32p05" }]
34
+ ], $ = m("triangle-alert", b), T = l("div")(
35
+ ({ backgroundColor: o, open: r }) => ({
36
+ ...a`
37
+ background-color: ${o};
38
+ display: ${r ? "flex" : "none"} !important;
39
+ max-width: 400px;
40
+ font-family: ${e.fonts.roboto};
41
+ position: relative;
42
+ box-shadow: 3px 4px 4px 0 ${e.colors.gray3}80;
43
+ transition: opacity 0.3s ease;
44
+ align-content: center;
45
+
46
+ .close-button {
47
+ color: ${e.colors.charcoal};
48
+ }
49
+
50
+ .close-button:hover {
51
+ color: ${e.colors.gray3};
52
+ transition: stroke-width 0.3s ease;
53
+ stroke-width: 3;
54
+ }
55
+ `
56
+ })
57
+ ), v = l("div")(({ backgroundColor: o }) => ({
58
+ ...a`
59
+ display: flex;
60
+ background-color: ${o};
61
+ padding: 11px;
62
+ `
63
+ })), C = l("p")(() => ({
64
+ ...a`
65
+ color: ${e.colors.charcoal};
66
+ font-size: 11pt;
67
+ padding: 12px 15px;
68
+ margin: 0;
69
+ line-height: 1.5;
70
+ min-width: 70px;
71
+ width: 100%;
72
+ `
73
+ })), S = l("div")(({ duration: o, color: r }) => ({
74
+ ...a`
75
+ position: absolute;
76
+ bottom: 0;
77
+ left: 0;
78
+ width: 0;
79
+ height: 2px;
80
+ background: ${r};
81
+ animation: progress-animation ${o - 300}ms linear forwards;
82
+
83
+ @keyframes progress-animation {
84
+ 0% {
85
+ width: 0;
86
+ }
87
+ 100% {
88
+ width: 100%;
89
+ }
90
+ }
91
+ `
92
+ })), d = ({
93
+ icon: o,
94
+ message: r,
95
+ backgroundColor: c = e.colors.whiteGreenA,
96
+ color: t = e.colors.green,
97
+ onDismiss: s,
98
+ duration: i = 3e3,
99
+ open: p
100
+ }) => /* @__PURE__ */ h(T, { backgroundColor: c, color: t, open: p, children: [
101
+ /* @__PURE__ */ n(v, { backgroundColor: t, children: /* @__PURE__ */ n(o, { size: 25, strokeWidth: 2, style: { color: e.colors.white, alignSelf: "center" } }) }),
102
+ /* @__PURE__ */ h("div", { style: { display: "flex", position: "relative", alignItems: "center", width: "100%" }, children: [
103
+ /* @__PURE__ */ n(C, { children: r }),
104
+ /* @__PURE__ */ n(y, { size: 20, className: "close-button", onClick: s, style: { margin: "8px", minWidth: "20px" } }),
105
+ i > 0 && /* @__PURE__ */ n(S, { duration: i, color: t })
106
+ ] })
107
+ ] }), N = ({ duration: o = 3e3, message: r, type: c = "success", onDismiss: t }) => {
108
+ const [s, i] = f(!0), p = () => {
109
+ i(!1);
110
+ };
111
+ return t == null && (t = p), u(() => {
112
+ i(!0);
113
+ const g = setTimeout(() => {
114
+ o > 0 && i(!1);
115
+ }, o);
116
+ return () => clearTimeout(g);
117
+ }, [o, c]), c == "error" ? /* @__PURE__ */ n(
118
+ d,
119
+ {
120
+ icon: k,
121
+ message: r,
122
+ backgroundColor: e.colors.lighterRed,
123
+ color: e.colors.burgundy,
124
+ onDismiss: t,
125
+ duration: o,
126
+ open: s
127
+ }
128
+ ) : c == "warning" ? /* @__PURE__ */ n(
129
+ d,
130
+ {
131
+ icon: $,
132
+ message: r,
133
+ backgroundColor: e.colors.yellowLight,
134
+ color: e.colors.yellow,
135
+ onDismiss: t,
136
+ duration: o,
137
+ open: s
138
+ }
139
+ ) : /* @__PURE__ */ n(
140
+ d,
141
+ {
142
+ icon: w,
143
+ message: r,
144
+ backgroundColor: e.colors.whiteGreenA,
145
+ color: e.colors.green,
146
+ onDismiss: t,
147
+ duration: o,
148
+ open: s
149
+ }
150
+ );
151
+ };
152
+ export {
153
+ N as default
154
+ };
@@ -0,0 +1,4 @@
1
+ import { ToastItem } from '../../../../../../../../../src/components/composite/Toast/Toaster';
2
+ import { ToastProps } from '../../../../../../../../../src/components/composite/Toast/Toast';
3
+ export declare const handleDismissToast: (id: number, setToasts: React.Dispatch<React.SetStateAction<ToastItem[]>>) => void;
4
+ export declare const showToast: (toast: ToastProps, setToasts: React.Dispatch<React.SetStateAction<ToastItem[]>>) => void;
@@ -0,0 +1,10 @@
1
+ const n = (s, o) => {
2
+ o((t) => t.filter((i) => i.id !== s));
3
+ }, a = (s, o) => {
4
+ const t = Date.now();
5
+ o((i) => [...i, { ...s, id: t }]);
6
+ };
7
+ export {
8
+ n as handleDismissToast,
9
+ a as showToast
10
+ };
@@ -0,0 +1,9 @@
1
+ import { ToastProps } from './Toast';
2
+ export type ToastItem = ToastProps & {
3
+ id: number;
4
+ };
5
+ export type ToasterProps = {
6
+ toastQueue: ToastItem[];
7
+ onDismiss?: (id: number) => void;
8
+ };
9
+ export declare const Toaster: React.FC<ToasterProps>;
@@ -0,0 +1,25 @@
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import m from "./Toast.js";
3
+ const x = ({ toastQueue: s = [], onDismiss: t }) => {
4
+ const r = (o) => {
5
+ t && t(o);
6
+ };
7
+ return /* @__PURE__ */ i(
8
+ "div",
9
+ {
10
+ style: {
11
+ position: "fixed",
12
+ bottom: 20,
13
+ right: 20,
14
+ display: "flex",
15
+ flexDirection: "column",
16
+ gap: "8px",
17
+ zIndex: 9999
18
+ },
19
+ children: s.map(({ id: o, ...e }) => /* @__PURE__ */ i(m, { ...e, onDismiss: () => r(o) }, o))
20
+ }
21
+ );
22
+ };
23
+ export {
24
+ x as Toaster
25
+ };
@@ -0,0 +1,3 @@
1
+ export { default, type ToastProps } from './Toast';
2
+ export { Toaster, type ToastItem } from './Toaster';
3
+ export { handleDismissToast, showToast } from './ToastHelpers';
package/Toast/index.js ADDED
@@ -0,0 +1,9 @@
1
+ import { default as s } from "./Toast.js";
2
+ import { Toaster as e } from "./Toaster.js";
3
+ import { handleDismissToast as f, showToast as m } from "./ToastHelpers.js";
4
+ export {
5
+ e as Toaster,
6
+ s as default,
7
+ f as handleDismissToast,
8
+ m as showToast
9
+ };
@@ -1,17 +1,22 @@
1
- import { jsx as r, Fragment as e } from "react/jsx-runtime";
2
- import { n as m } from "../.chunks/emotion-styled.browser.esm.js";
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 "../theme.js";
5
- import { C as c } from "../.chunks/CircularProgress.js";
6
- const n = m(c)({
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: ${a.colors.green};
10
+ color: ${o.themeIconBackgroundA};
9
11
  `
10
- }), d = ({
12
+ })), g = ({
11
13
  loading: o,
12
- children: t,
13
- ...s
14
- }) => o ? /* @__PURE__ */ r(n, { size: 47, ...s }) : /* @__PURE__ */ r(e, { children: t });
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
- d as default
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.5",
4
+ "version": "1.0.9",
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
@@ -55,6 +55,8 @@ export interface ThemeColors {
55
55
  whiteGreenC: string;
56
56
  whiteGreenD: string;
57
57
  whiteBlue: string;
58
+ yellow: string;
59
+ yellowLight: string;
58
60
  }
59
61
  export interface ThemeBoxShadows extends Partial<ThemeColors> {
60
62
  black63?: string;
@@ -104,6 +106,15 @@ export interface TemplateThemeProps {
104
106
  backgroundColor: string;
105
107
  };
106
108
  }
109
+ export interface ThemeOptions {
110
+ green: string;
111
+ blue: string;
112
+ red: string;
113
+ grayscale: string;
114
+ custom: string;
115
+ }
116
+ declare const theme: Theme;
117
+ export default theme;
107
118
  export interface CustomThemeProps {
108
119
  themeColor: string;
109
120
  themeDark: string;
@@ -118,6 +129,10 @@ export interface CustomThemeProps {
118
129
  themeShadowA: string;
119
130
  themeShadowB: string;
120
131
  themeShadowC: string;
132
+ themeIconBackgroundA: string;
133
+ themeIconBackgroundB: string;
134
+ themeIconColorA: string;
135
+ themeIconColorB: string;
121
136
  highlightPrimary: string;
122
137
  highlightSecondary: string;
123
138
  highlightTertiary: string;
@@ -137,15 +152,6 @@ export interface CustomThemeProps {
137
152
  darkGray1: string;
138
153
  black: string;
139
154
  }
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
155
  export declare const defaultTheme: {
150
156
  themeColor: string;
151
157
  themeDark: string;
@@ -160,6 +166,10 @@ export declare const defaultTheme: {
160
166
  themeShadowA: string;
161
167
  themeShadowB: string;
162
168
  themeShadowC: string;
169
+ themeIconBackgroundA: string;
170
+ themeIconBackgroundB: string;
171
+ themeIconColorA: string;
172
+ themeIconColorB: string;
163
173
  highlightPrimary: string;
164
174
  highlightSecondary: string;
165
175
  highlightTertiary: string;
package/theme.js CHANGED
@@ -60,7 +60,9 @@ const e = {
60
60
  whiteGreenB: "#f0f8f0",
61
61
  whiteGreenC: "#e8f5e8",
62
62
  whiteGreenD: "#f8fff8",
63
- whiteBlue: "#f8f9fa"
63
+ whiteBlue: "#f8f9fa",
64
+ yellow: "#e3b50e",
65
+ yellowLight: "#f4edcd"
64
66
  },
65
67
  constants: {
66
68
  appHeaderHeight: 58,
@@ -83,21 +85,21 @@ const e = {
83
85
  };
84
86
  e.boxShadows = {
85
87
  ...Object.fromEntries(
86
- Object.keys(e.colors).map((r) => [
87
- r,
88
- `0 0 8px -2px ${e.colors[r]}`
88
+ Object.keys(e.colors).map((o) => [
89
+ o,
90
+ `0 0 8px -2px ${e.colors[o]}`
89
91
  ])
90
92
  ),
91
93
  ...Object.fromEntries(
92
- Object.keys(e.colors).map((r) => [
93
- `${r}Thick`,
94
- `0 0 2px 1px ${e.colors[r]}`
94
+ Object.keys(e.colors).map((o) => [
95
+ `${o}Thick`,
96
+ `0 0 2px 1px ${e.colors[o]}`
95
97
  ])
96
98
  ),
97
99
  black63: "0px 0px 2px 1px rgba(0, 0, 0, 0.63)",
98
100
  gray63: "0px 0px 2px 1px rgba(100, 100, 100, 0.63)"
99
101
  };
100
- const o = {
102
+ const r = {
101
103
  themeColor: e.colors.green,
102
104
  themeDark: e.colors.darkGreen,
103
105
  themeMediumA: e.colors.mint,
@@ -111,6 +113,10 @@ const o = {
111
113
  themeShadowA: e.colors.darkGreenO99,
112
114
  themeShadowB: e.boxShadows.darkGreen,
113
115
  themeShadowC: e.boxShadows.darkGreenThick,
116
+ themeIconBackgroundA: e.colors.green,
117
+ themeIconBackgroundB: e.colors.whiteGreenA,
118
+ themeIconColorA: e.colors.white,
119
+ themeIconColorB: e.colors.darkGreen,
114
120
  // These colors always stay the same, no custom theme updating
115
121
  highlightPrimary: e.colors.sunlight,
116
122
  highlightSecondary: e.colors.dandelion,
@@ -133,5 +139,5 @@ const o = {
133
139
  };
134
140
  export {
135
141
  e as default,
136
- o as defaultTheme
142
+ r as defaultTheme
137
143
  };
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 i, { defaultTheme as S } from "./theme.js";
2
- function T(o) {
3
- const r = parseInt(o.substring(1, 3), 16), e = parseInt(o.substring(3, 5), 16), t = parseInt(o.substring(5, 7), 16);
4
- return [r, e, t];
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 w(o, r, e) {
7
- o /= 255, r /= 255, e /= 255;
8
- const t = Math.max(o, r, e), n = Math.min(o, r, e), m = (t + n) / 2;
9
- if (t === n)
10
- return [0, 0, m];
11
- const h = t - n;
12
- let u = m > 0.5 ? h / (2 - t - n) : h / (t + n), c;
13
- return t === o ? c = (r - e) / h + (r < e ? 6 : 0) : t === r ? c = (e - o) / h + 2 : c = (o - r) / h + 4, c /= 6, [c, u, m];
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 M(o, r, e) {
16
- let t, n, m;
15
+ function I(o, r, t) {
16
+ let e, h, c;
17
17
  if (r === 0)
18
- t = n = m = e;
18
+ e = h = c = t;
19
19
  else {
20
- const h = e < 0.5 ? e * (1 + r) : e + r - e * r, u = 2 * e - h;
21
- t = a(u, h, o + 1 / 3), n = a(u, h, o), m = a(u, h, o - 1 / 3);
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(t * 255), Math.round(n * 255), Math.round(m * 255)];
23
+ return [Math.round(e * 255), Math.round(h * 255), Math.round(c * 255)];
24
24
  }
25
- function a(o, r, e) {
26
- return e < 0 && (e += 1), e > 1 && (e -= 1), e < 1 / 6 ? o + (r - o) * 6 * e : e < 1 / 2 ? r : e < 2 / 3 ? o + (r - o) * (2 / 3 - e) * 6 : o;
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 L(o, r, e) {
29
- var t = o.toString(16).length == 1 ? "0" + o.toString(16) : o.toString(16), n = r.toString(16).length == 1 ? "0" + r.toString(16) : r.toString(16), m = e.toString(16).length == 1 ? "0" + e.toString(16) : e.toString(16);
30
- return "#" + t + n + m;
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 B = (o) => {
33
- const [r, e, t] = T(o), [n, m, h] = w(r, e, t);
34
- return n;
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 [e, t, n] = T(o), [m, h, u] = w(e, t, n);
37
- let c = h + 0.1;
38
- c >= 1 && (c = 0.99);
39
- let g = u;
40
- g > 0.5 && (g -= 0.08), g > 0.8 && (c = 1, g += 0.03), r < 0 && (c = 0);
41
- const [l, d, f] = M(r, c, g);
42
- return L(l, d, f);
43
- }, A = (o) => {
44
- const r = localStorage.getItem("theme") || "green", e = localStorage.getItem("hue") || B(i.themeOptions.green).toString();
45
- if (r == "green") return S;
46
- var t = parseFloat(e);
47
- o != null && (t = o);
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: n,
50
- themeDark: m,
51
- themeMediumA: h,
52
- themeMediumB: u,
53
- themeMediumC: c,
54
- themeLight: g,
55
- themeLightA: l,
56
- themeLightB: d,
57
- themeLightC: f,
58
- themeLightD: C,
59
- themeShadowA: G,
60
- themeShadowB: b,
61
- themeShadowC: x,
62
- ...p
63
- } = S;
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(i.colors.green, t),
66
- themeDark: s(i.colors.darkGreen, t),
67
- themeMediumA: s(i.colors.whiteGreenB, t),
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(i.colors.moss, t),
70
- themeMediumC: s(i.colors.sage, t),
71
- themeLight: s(i.colors.whiteGreenB, t),
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(i.colors.moss, t),
80
+ themeLightA: s(n.colors.moss, e),
74
81
  // whiteGreenA
75
- themeLightB: s(i.colors.whiteGreenB, t),
76
- themeLightC: s(i.colors.whiteGreenC, t),
77
- themeLightD: s(i.colors.whiteGreenD, t),
78
- themeShadowA: s(i.colors.darkGreenO99, t) + "99",
79
- themeShadowB: "0 0 8px -2px " + s(i.colors.darkGreen, t),
80
- themeShadowC: "0 0 2px 1px " + s(i.colors.darkGreen, t),
81
- ...p
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
- B as getHueFromHex,
96
+ k as getHueFromHex,
97
+ _ as getSaturationFromHex,
86
98
  s as substituteHue,
87
- A as updateTheme
99
+ F as updateTheme
88
100
  };