@unitedstatespowersquadrons/components 1.4.9 → 1.4.11
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/ActionButton.tsx +44 -4
- package/Badges/Tag.tsx +11 -4
- package/package.json +1 -1
package/ActionButton.tsx
CHANGED
|
@@ -14,6 +14,10 @@ const useStyles = createUseStyles({
|
|
|
14
14
|
button: { ...Styles.button },
|
|
15
15
|
darkGrayColored: { ...Styles.colorizeButton("darkGray") },
|
|
16
16
|
darkGrayGray: { ...Styles.darkGray },
|
|
17
|
+
disabled: {
|
|
18
|
+
opacity: 0.5,
|
|
19
|
+
pointerEvents: "none",
|
|
20
|
+
},
|
|
17
21
|
grayColored: { ...Styles.colorizeButton("gray") },
|
|
18
22
|
grayGray: { ...Styles.gray },
|
|
19
23
|
greenColored: { ...Styles.colorizeButton("green") },
|
|
@@ -54,6 +58,7 @@ const useStyles = createUseStyles({
|
|
|
54
58
|
interface CoreActionButtonBaseProps extends FontAwesomeProps {
|
|
55
59
|
className?: string | undefined;
|
|
56
60
|
color: ButtonColorName;
|
|
61
|
+
disabled?: boolean | undefined;
|
|
57
62
|
grayMode?: boolean | undefined;
|
|
58
63
|
id?: string;
|
|
59
64
|
rightIcon?: boolean;
|
|
@@ -99,7 +104,22 @@ export type ActionButtonProps =
|
|
|
99
104
|
|
|
100
105
|
const ActionButton = (props: ActionButtonProps) => {
|
|
101
106
|
const {
|
|
102
|
-
className,
|
|
107
|
+
className,
|
|
108
|
+
color,
|
|
109
|
+
disabled,
|
|
110
|
+
fa,
|
|
111
|
+
fontSize,
|
|
112
|
+
grayMode,
|
|
113
|
+
icon,
|
|
114
|
+
id,
|
|
115
|
+
margin,
|
|
116
|
+
mode,
|
|
117
|
+
rightIcon,
|
|
118
|
+
size,
|
|
119
|
+
style,
|
|
120
|
+
subtext,
|
|
121
|
+
text,
|
|
122
|
+
title,
|
|
103
123
|
} = props;
|
|
104
124
|
const classes = useStyles({
|
|
105
125
|
...(fontSize !== undefined && { fontSize }),
|
|
@@ -107,6 +127,7 @@ const ActionButton = (props: ActionButtonProps) => {
|
|
|
107
127
|
});
|
|
108
128
|
|
|
109
129
|
const colorClassName = classes[`${color}${grayMode ? "Gray" : "Colored"}`];
|
|
130
|
+
const disabledClassName = disabled ? classes.disabled : "";
|
|
110
131
|
|
|
111
132
|
const sizeClassName = () => {
|
|
112
133
|
switch (size) {
|
|
@@ -144,7 +165,13 @@ const ActionButton = (props: ActionButtonProps) => {
|
|
|
144
165
|
return(
|
|
145
166
|
<BaseActionButton
|
|
146
167
|
className={classNames(
|
|
147
|
-
classes.button,
|
|
168
|
+
classes.button,
|
|
169
|
+
colorClassName,
|
|
170
|
+
sizeClassName(),
|
|
171
|
+
classes.sizing,
|
|
172
|
+
inline && classes.inline,
|
|
173
|
+
disabledClassName,
|
|
174
|
+
className
|
|
148
175
|
)}
|
|
149
176
|
confirm={confirm}
|
|
150
177
|
id={id}
|
|
@@ -160,7 +187,13 @@ const ActionButton = (props: ActionButtonProps) => {
|
|
|
160
187
|
return(
|
|
161
188
|
<BaseActionButton
|
|
162
189
|
className={classNames(
|
|
163
|
-
classes.button,
|
|
190
|
+
classes.button,
|
|
191
|
+
colorClassName,
|
|
192
|
+
sizeClassName(),
|
|
193
|
+
classes.sizing,
|
|
194
|
+
inline && classes.inline,
|
|
195
|
+
disabledClassName,
|
|
196
|
+
className
|
|
164
197
|
)}
|
|
165
198
|
confirm={confirm}
|
|
166
199
|
href={href}
|
|
@@ -181,6 +214,7 @@ const ActionButton = (props: ActionButtonProps) => {
|
|
|
181
214
|
classes.sizing,
|
|
182
215
|
rightIcon ? classes.rightIcon : "",
|
|
183
216
|
inline && classes.inline,
|
|
217
|
+
disabledClassName,
|
|
184
218
|
className
|
|
185
219
|
);
|
|
186
220
|
|
|
@@ -210,7 +244,13 @@ const ActionButton = (props: ActionButtonProps) => {
|
|
|
210
244
|
return(
|
|
211
245
|
<BaseActionButton
|
|
212
246
|
className={classNames(
|
|
213
|
-
classes.button,
|
|
247
|
+
classes.button,
|
|
248
|
+
colorClassName,
|
|
249
|
+
sizeClassName(),
|
|
250
|
+
classes.sizing,
|
|
251
|
+
inline && classes.inline,
|
|
252
|
+
disabledClassName,
|
|
253
|
+
className
|
|
214
254
|
)}
|
|
215
255
|
confirm={confirm}
|
|
216
256
|
id={id}
|
package/Badges/Tag.tsx
CHANGED
|
@@ -1,24 +1,31 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import Badge from "./Badge";
|
|
3
3
|
import { badgeify, versionColor } from "./helpers";
|
|
4
|
+
import { github } from "./remotes";
|
|
4
5
|
|
|
5
6
|
interface Props {
|
|
6
7
|
version: string;
|
|
7
8
|
label?: string;
|
|
8
9
|
logo?: string;
|
|
10
|
+
repo?: string;
|
|
9
11
|
}
|
|
10
12
|
|
|
11
13
|
const TagBadge = (props: Props) => {
|
|
12
|
-
const { version, label, logo } = props;
|
|
14
|
+
const { version, label, logo, repo } = props;
|
|
13
15
|
|
|
14
16
|
const badgeLabel = label ? badgeify(label) : undefined;
|
|
15
17
|
|
|
16
|
-
|
|
18
|
+
const badge = (
|
|
17
19
|
<Badge
|
|
18
20
|
content={version} {...badgeLabel ? { label: badgeLabel } : {}}
|
|
19
21
|
color={versionColor(version)} {...logo ? { logo } : {}}
|
|
20
|
-
/>
|
|
21
|
-
|
|
22
|
+
/>);
|
|
23
|
+
|
|
24
|
+
if (repo) {
|
|
25
|
+
return <a href={`${github}/${repo}`} rel="noreferrer" target="_blank">{badge}</a>;
|
|
26
|
+
} else {
|
|
27
|
+
return badge;
|
|
28
|
+
}
|
|
22
29
|
};
|
|
23
30
|
|
|
24
31
|
export default TagBadge;
|