@unitedstatespowersquadrons/components 1.4.5 → 1.4.6-1

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 (2) hide show
  1. package/Admin/AdminLink.tsx +21 -63
  2. package/package.json +1 -1
@@ -1,95 +1,59 @@
1
1
  import React from "react";
2
2
  import { createUseStyles } from "react-jss";
3
3
  import classNames from "classnames";
4
- import AdminItem from "./AdminItem";
5
4
  import Colors, { ButtonColorName } from "../Colors";
6
- import { FontAwesomeProps } from "../FontAwesomeIcon";
7
- import IconButton from "../IconButton";
5
+ import FontAwesomeIcon, { FontAwesomeProps } from "../FontAwesomeIcon";
8
6
  import Styles from "../Styles";
9
7
 
10
8
  // Styles aren't tree-shaken, but keeping every color variant here means apps
11
9
  // can pass any ButtonColorName without needing to know which ones are wired up.
12
10
  const useStyles = createUseStyles({
13
11
  blue: {
14
- "& button": { ...Styles.blue },
15
- "&:hover": {
16
- "& button": { ...Styles.hover.blue },
17
- ...Styles.hover.blue,
18
- },
12
+ "&:hover": { ...Styles.hover.blue },
19
13
  ...Styles.blue,
20
14
  },
21
15
  darkGray: {
22
- "& button": { ...Styles.darkGray },
23
- "&:hover": {
24
- "& button": { ...Styles.darkGray },
25
- ...Styles.darkGray,
26
- },
16
+ "&:hover": { ...Styles.darkGray },
27
17
  ...Styles.darkGray,
28
18
  },
29
19
  gray: {
30
- "& button": { ...Styles.gray },
31
- "&:hover": {
32
- "& button": { ...Styles.hover.gray },
33
- ...Styles.hover.gray,
34
- },
20
+ "&:hover": { ...Styles.hover.gray },
35
21
  ...Styles.gray,
36
22
  },
37
23
  green: {
38
- "& button": { ...Styles.green },
39
- "&:hover": {
40
- "& button": { ...Styles.hover.green },
41
- ...Styles.hover.green,
42
- },
24
+ "&:hover": { ...Styles.hover.green },
43
25
  ...Styles.green,
44
26
  },
45
27
  item: {
46
- "& > span": { display: "none" },
47
28
  "&:hover": { backgroundColor: Colors.shades._a },
48
- "&:hover > span": { display: "inline-block" },
29
+ "&:not(:last-child)": { padding: "0.5em 0.1em" },
30
+ ...Styles.flexRow,
31
+ borderRadius: "0.5em",
32
+ color: "inherit",
49
33
  cursor: "pointer",
34
+ justifyContent: "left",
35
+ textAlign: "left",
36
+ textDecoration: "none",
37
+ width: "100%",
50
38
  },
51
- left: { textAlign: "left" },
52
39
  orange: {
53
- "& button": { ...Styles.orange },
54
- "&:hover": {
55
- "& button": { ...Styles.hover.orange },
56
- ...Styles.hover.orange,
57
- },
40
+ "&:hover": { ...Styles.hover.orange },
58
41
  ...Styles.orange,
59
42
  },
60
43
  purple: {
61
- "& button": { ...Styles.purple },
62
- "&:hover": {
63
- "& button": { ...Styles.hover.purple },
64
- ...Styles.hover.purple,
65
- },
44
+ "&:hover": { ...Styles.hover.purple },
66
45
  ...Styles.purple,
67
46
  },
68
47
  red: {
69
- "& button": { ...Styles.red },
70
- "&:hover": {
71
- "& button": { ...Styles.hover.red },
72
- ...Styles.hover.red,
73
- },
48
+ "&:hover": { ...Styles.hover.red },
74
49
  ...Styles.red,
75
50
  },
76
51
  subMenuIcon: {
77
52
  fontSize: "1.5em",
78
- gap: "0",
79
- paddingLeft: "0",
80
- paddingRight: "0",
81
- },
82
- subMenuLink: {
83
- color: "inherit",
84
- cursor: "pointer",
85
- flex: 1,
86
- textDecoration: "none",
87
53
  },
88
54
  subMenuText: {
89
55
  animation: "fadeIn 100ms",
90
56
  fontSize: "1.5em",
91
- gap: "0",
92
- paddingRight: "0.5em",
93
57
  },
94
58
  });
95
59
 
@@ -105,23 +69,17 @@ const AdminLink = (props: Props) => {
105
69
  const { className, color, fa, href, icon, mode, style, subMenu, title } = props;
106
70
  const classes = useStyles();
107
71
 
108
- const colorClassName = classes[color];
109
-
110
72
  return(
111
- <AdminItem className={classNames(classes.item, classes.left, colorClassName)}>
112
- <IconButton
113
- className={classNames(classes.subMenuIcon, className)}
73
+ <a className={classNames(classes.item, classes[color])} href={href} title={title}>
74
+ <FontAwesomeIcon
75
+ css={classNames(classes.subMenuIcon, className)}
114
76
  fa={fa}
115
- href={href}
116
77
  icon={icon}
117
78
  mode={mode}
118
79
  style={style}
119
- title={title}
120
80
  />
121
- <a className={classes.subMenuLink} href={href} title={title}>
122
- <span className={classNames(classes.subMenuText, className)}>{subMenu}</span>
123
- </a>
124
- </AdminItem>
81
+ <span className={classNames(classes.subMenuText, className)}>{subMenu}</span>
82
+ </a>
125
83
  );
126
84
  };
127
85
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unitedstatespowersquadrons/components",
3
- "version": "1.4.5",
3
+ "version": "1.4.6-1",
4
4
  "description": "USPS shared React components library",
5
5
  "main": "index.tsx",
6
6
  "scripts": {