@unitedstatespowersquadrons/components 1.4.0-3 → 1.4.0-4
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/Colors.tsx +42 -34
- package/Toasts/Toast.tsx +11 -25
- package/package.json +1 -1
package/Colors.tsx
CHANGED
|
@@ -73,6 +73,41 @@ const shadesLegacy = {
|
|
|
73
73
|
};
|
|
74
74
|
/* eslint-enable sort-keys */
|
|
75
75
|
|
|
76
|
+
const buttonColors = {
|
|
77
|
+
background: {
|
|
78
|
+
hover: {
|
|
79
|
+
blue: "#5588EE",
|
|
80
|
+
darkGray: shades._8,
|
|
81
|
+
gray: shades._b,
|
|
82
|
+
green: "#55BB55",
|
|
83
|
+
orange: "#EE8833",
|
|
84
|
+
purple: "#8844EE",
|
|
85
|
+
red: "#CC6666",
|
|
86
|
+
},
|
|
87
|
+
normal: {
|
|
88
|
+
blue: "#6699FF",
|
|
89
|
+
darkGray: shades._9,
|
|
90
|
+
gray: shades._c,
|
|
91
|
+
green: "#66CC66",
|
|
92
|
+
orange: "#FF9944",
|
|
93
|
+
purple: "#9955FF",
|
|
94
|
+
red: "#DD7777",
|
|
95
|
+
},
|
|
96
|
+
shadow: {
|
|
97
|
+
blue: "#4477DD",
|
|
98
|
+
darkGray: shades._7,
|
|
99
|
+
gray: shades._a,
|
|
100
|
+
green: "#44AA44",
|
|
101
|
+
orange: "#DD7722",
|
|
102
|
+
purple: "#7733DD",
|
|
103
|
+
red: "#BB5555",
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
border: "gray",
|
|
107
|
+
glow: "rgba(0, 200, 200, 0.5)",
|
|
108
|
+
shadow: shades._a,
|
|
109
|
+
};
|
|
110
|
+
|
|
76
111
|
export type ButtonColorName =
|
|
77
112
|
| "blue"
|
|
78
113
|
| "darkGray"
|
|
@@ -96,40 +131,7 @@ const specificColors = {
|
|
|
96
131
|
purple: "#EECCFF",
|
|
97
132
|
red: "#FFEEEE",
|
|
98
133
|
},
|
|
99
|
-
button:
|
|
100
|
-
background: {
|
|
101
|
-
hover: {
|
|
102
|
-
blue: "#5588EE",
|
|
103
|
-
darkGray: shades._8,
|
|
104
|
-
gray: shades._b,
|
|
105
|
-
green: "#55BB55",
|
|
106
|
-
orange: "#EE8833",
|
|
107
|
-
purple: "#8844EE",
|
|
108
|
-
red: "#CC6666",
|
|
109
|
-
},
|
|
110
|
-
normal: {
|
|
111
|
-
blue: "#6699FF",
|
|
112
|
-
darkGray: shades._9,
|
|
113
|
-
gray: shades._c,
|
|
114
|
-
green: "#66CC66",
|
|
115
|
-
orange: "#FF9944",
|
|
116
|
-
purple: "#9955FF",
|
|
117
|
-
red: "#DD7777",
|
|
118
|
-
},
|
|
119
|
-
shadow: {
|
|
120
|
-
blue: "#4477DD",
|
|
121
|
-
darkGray: shades._7,
|
|
122
|
-
gray: shades._a,
|
|
123
|
-
green: "#44AA44",
|
|
124
|
-
orange: "#DD7722",
|
|
125
|
-
purple: "#7733DD",
|
|
126
|
-
red: "#BB5555",
|
|
127
|
-
},
|
|
128
|
-
},
|
|
129
|
-
border: "gray",
|
|
130
|
-
glow: "rgba(0, 200, 200, 0.5)",
|
|
131
|
-
shadow: shades._a,
|
|
132
|
-
},
|
|
134
|
+
button: buttonColors,
|
|
133
135
|
exam: {
|
|
134
136
|
dragging: "#00CCCC",
|
|
135
137
|
instructions: {
|
|
@@ -137,6 +139,12 @@ const specificColors = {
|
|
|
137
139
|
selected: "#EEEEFF",
|
|
138
140
|
},
|
|
139
141
|
},
|
|
142
|
+
toast: {
|
|
143
|
+
broadcast: buttonColors.background.normal.purple,
|
|
144
|
+
error: "#CC0000",
|
|
145
|
+
notice: "#009900",
|
|
146
|
+
success: "#000099",
|
|
147
|
+
},
|
|
140
148
|
};
|
|
141
149
|
|
|
142
150
|
const Colors = {
|
package/Toasts/Toast.tsx
CHANGED
|
@@ -4,6 +4,7 @@ import { createUseStyles } from "react-jss";
|
|
|
4
4
|
import { DismissFunc, Toast_Status, ToastProps } from "./types";
|
|
5
5
|
import FontAwesomeIcon from "../FontAwesomeIcon";
|
|
6
6
|
import Styles from "../Styles";
|
|
7
|
+
import Colors from "../Colors";
|
|
7
8
|
|
|
8
9
|
interface Props {
|
|
9
10
|
allowedDomains?: string[] | undefined;
|
|
@@ -22,33 +23,20 @@ const isAllowedUrl = (url: string, allowedDomains?: string[]): boolean => {
|
|
|
22
23
|
};
|
|
23
24
|
|
|
24
25
|
const useStyles = createUseStyles({
|
|
25
|
-
broadcast: {
|
|
26
|
-
borderLeft: "4px solid #7A1FA2",
|
|
27
|
-
},
|
|
28
|
-
broadcastTag: {
|
|
29
|
-
backgroundColor: "#7A1FA2",
|
|
30
|
-
borderRadius: "0.25em",
|
|
31
|
-
color: "#FFFFFF",
|
|
32
|
-
fontSize: "0.75em",
|
|
33
|
-
fontWeight: "bold",
|
|
34
|
-
letterSpacing: "0.05em",
|
|
35
|
-
marginRight: "0.5em",
|
|
36
|
-
padding: "0.1em 0.4em",
|
|
37
|
-
textTransform: "uppercase",
|
|
38
|
-
},
|
|
26
|
+
broadcast: { borderLeft: `4px solid ${Colors.purple}` },
|
|
39
27
|
dismissed: { opacity: "0" },
|
|
40
28
|
error: {
|
|
41
|
-
borderColor:
|
|
42
|
-
color:
|
|
29
|
+
borderColor: Colors.toast.error,
|
|
30
|
+
color: Colors.toast.error,
|
|
43
31
|
},
|
|
44
32
|
italic: { fontStyle: "italic" },
|
|
45
33
|
notice: {
|
|
46
|
-
borderColor:
|
|
47
|
-
color:
|
|
34
|
+
borderColor: Colors.toast.notice,
|
|
35
|
+
color: Colors.toast.notice,
|
|
48
36
|
},
|
|
49
37
|
success: {
|
|
50
|
-
borderColor:
|
|
51
|
-
color:
|
|
38
|
+
borderColor: Colors.toast.success,
|
|
39
|
+
color: Colors.toast.success,
|
|
52
40
|
},
|
|
53
41
|
toast: {
|
|
54
42
|
"@media print, screen and (max-width: 1000px)": { maxWidth: "100%" },
|
|
@@ -142,6 +130,8 @@ const Toast = (props: Props) => {
|
|
|
142
130
|
};
|
|
143
131
|
|
|
144
132
|
const statusDetails = (): [string, string] => {
|
|
133
|
+
if (isBroadcast) return [classes.broadcast, "rss"];
|
|
134
|
+
|
|
145
135
|
switch (status) {
|
|
146
136
|
case Toast_Status.SUCCESS: return [classes.success, "check"];
|
|
147
137
|
case Toast_Status.NOTICE: return [classes.notice, "circle-info"];
|
|
@@ -155,13 +145,9 @@ const Toast = (props: Props) => {
|
|
|
155
145
|
const opacityClass = dismissed ? classes.dismissed : classes.visible;
|
|
156
146
|
|
|
157
147
|
return (
|
|
158
|
-
<div
|
|
159
|
-
className={classNames(classes.toast, statusClassName, opacityClass, isBroadcast && classes.broadcast)}
|
|
160
|
-
key={`toast-${id}`}
|
|
161
|
-
>
|
|
148
|
+
<div className={classNames(classes.toast, statusClassName, opacityClass)} key={`toast-${id}`}>
|
|
162
149
|
<div className={classes.toastTitle}>
|
|
163
150
|
<FontAwesomeIcon fa="fw" icon={icon} mode="duotone" />
|
|
164
|
-
{isBroadcast && <span className={classes.broadcastTag}>Broadcast</span>}
|
|
165
151
|
<span>{title}</span>
|
|
166
152
|
</div>
|
|
167
153
|
<div className={classes.toastBody}>{renderBody()}</div>
|