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.
- package/.chunks/DefaultPropsProvider.js +3 -3
- package/.chunks/TextField.js +1 -1
- package/.chunks/x.js +22 -0
- package/Button/Button.js +36 -32
- package/CircularIconButton/CircularIconButton.js +23 -19
- 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 +59 -74
- 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/Pill/Pill.d.ts +1 -0
- package/Pill/Pill.js +21 -13
- package/ScrollContainer/ScrollContainer.js +180 -179
- 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/Toast/Toast.d.ts +8 -0
- package/Toast/Toast.js +154 -0
- package/Toast/ToastHelpers.d.ts +4 -0
- package/Toast/ToastHelpers.js +10 -0
- package/Toast/Toaster.d.ts +9 -0
- package/Toast/Toaster.js +25 -0
- package/Toast/index.d.ts +3 -0
- package/Toast/index.js +9 -0
- package/WithLoading/WithLoading.js +16 -11
- package/package.json +1 -1
- package/theme.d.ts +19 -9
- package/theme.js +15 -9
- package/themeUtils.d.ts +5 -0
- package/themeUtils.js +81 -69
package/Toast/Toast.d.ts
ADDED
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;
|
package/Toast/Toaster.js
ADDED
|
@@ -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
|
+
};
|
package/Toast/index.d.ts
ADDED
package/Toast/index.js
ADDED
|
@@ -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.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((
|
|
87
|
-
|
|
88
|
-
`0 0 8px -2px ${e.colors[
|
|
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((
|
|
93
|
-
`${
|
|
94
|
-
`0 0 2px 1px ${e.colors[
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
};
|