@unitedstatespowersquadrons/components 1.4.0-3 → 1.4.0-5

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 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;
@@ -23,32 +24,22 @@ const isAllowedUrl = (url: string, allowedDomains?: string[]): boolean => {
23
24
 
24
25
  const useStyles = createUseStyles({
25
26
  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",
27
+ borderColor: Colors.toast.broadcast,
28
+ color: Colors.toast.broadcast,
38
29
  },
39
30
  dismissed: { opacity: "0" },
40
31
  error: {
41
- borderColor: "#CC0000",
42
- color: "#CC0000",
32
+ borderColor: Colors.toast.error,
33
+ color: Colors.toast.error,
43
34
  },
44
35
  italic: { fontStyle: "italic" },
45
36
  notice: {
46
- borderColor: "#000099",
47
- color: "#000099",
37
+ borderColor: Colors.toast.notice,
38
+ color: Colors.toast.notice,
48
39
  },
49
40
  success: {
50
- borderColor: "#009900",
51
- color: "#009900",
41
+ borderColor: Colors.toast.success,
42
+ color: Colors.toast.success,
52
43
  },
53
44
  toast: {
54
45
  "@media print, screen and (max-width: 1000px)": { maxWidth: "100%" },
@@ -142,6 +133,8 @@ const Toast = (props: Props) => {
142
133
  };
143
134
 
144
135
  const statusDetails = (): [string, string] => {
136
+ if (isBroadcast) return [classes.broadcast, "rss"];
137
+
145
138
  switch (status) {
146
139
  case Toast_Status.SUCCESS: return [classes.success, "check"];
147
140
  case Toast_Status.NOTICE: return [classes.notice, "circle-info"];
@@ -155,13 +148,9 @@ const Toast = (props: Props) => {
155
148
  const opacityClass = dismissed ? classes.dismissed : classes.visible;
156
149
 
157
150
  return (
158
- <div
159
- className={classNames(classes.toast, statusClassName, opacityClass, isBroadcast && classes.broadcast)}
160
- key={`toast-${id}`}
161
- >
151
+ <div className={classNames(classes.toast, statusClassName, opacityClass)} key={`toast-${id}`}>
162
152
  <div className={classes.toastTitle}>
163
153
  <FontAwesomeIcon fa="fw" icon={icon} mode="duotone" />
164
- {isBroadcast && <span className={classes.broadcastTag}>Broadcast</span>}
165
154
  <span>{title}</span>
166
155
  </div>
167
156
  <div className={classes.toastBody}>{renderBody()}</div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unitedstatespowersquadrons/components",
3
- "version": "1.4.0-3",
3
+ "version": "1.4.0-5",
4
4
  "description": "USPS shared React components library",
5
5
  "main": "index.tsx",
6
6
  "scripts": {