@unitedstatespowersquadrons/components 1.1.1-pre.1 → 1.1.1-pre.2

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 CHANGED
@@ -28,6 +28,11 @@ const useStyles = createUseStyles({
28
28
  fontSize: "0.75em",
29
29
  marginLeft: "0.75em",
30
30
  },
31
+ wrapperLink: {
32
+ display: "block",
33
+ margin: "0 auto",
34
+ width: "fit-content",
35
+ },
31
36
  });
32
37
 
33
38
  export interface CoreActionButtonProps extends FontAwesomeProps {
@@ -113,13 +118,14 @@ const ActionButton = (props: ActionButtonProps) => {
113
118
  </BaseActionButton>
114
119
  );
115
120
  } else if ("href" in props) {
116
- const { href } = props;
121
+ const { href, linkClassName } = props;
117
122
 
118
123
  return(
119
124
  <BaseActionButton
120
125
  className={classNames(classes.button, colorClassName, sizeClassName(), className)}
121
126
  href={href}
122
127
  id={id}
128
+ linkClassName={classNames(classes.wrapperLink, linkClassName)}
123
129
  title={title}
124
130
  >
125
131
  {buttonContents()}
@@ -10,11 +10,6 @@ const useStyles = createUseStyles({
10
10
  border: "none",
11
11
  padding: "0",
12
12
  },
13
- link: {
14
- display: "block",
15
- margin: "0 auto",
16
- width: "fit-content",
17
- },
18
13
  });
19
14
 
20
15
  interface CoreBaseActionButtonProps {
@@ -102,11 +97,11 @@ const BaseActionButton = (props: BaseActionButtonProps) => {
102
97
  </>
103
98
  );
104
99
  } else if ("href" in props) {
105
- const { href, newTab } = props;
100
+ const { href, linkClassName, newTab } = props;
106
101
 
107
102
  return(
108
103
  <a
109
- className={classNames(classes.link, className)}
104
+ className={linkClassName}
110
105
  href={href}
111
106
  id={id}
112
107
  rel={newTab ? "noreferrer" : undefined}
package/IconButton.tsx CHANGED
@@ -12,6 +12,11 @@ const useStyles = createUseStyles({
12
12
  cursor: "pointer",
13
13
  fontSize: "1.1em",
14
14
  },
15
+ wrapperLink: {
16
+ display: "inline-block",
17
+ margin: "0",
18
+ width: "fit-content",
19
+ },
15
20
  });
16
21
 
17
22
  interface CoreIconProps extends FontAwesomeProps {
@@ -67,13 +72,14 @@ const IconButton = (props: IconButtonProps) => {
67
72
  </BaseActionButton>
68
73
  );
69
74
  } else if ("href" in props) {
70
- const { href } = props;
75
+ const { href, linkClassName } = props;
71
76
 
72
77
  return(
73
78
  <BaseActionButton
74
79
  className={combinedClassName}
75
80
  href={href}
76
81
  id={id}
82
+ linkClassName={classNames(classes.wrapperLink, linkClassName)}
77
83
  title={title}
78
84
  >
79
85
  {configuredIcon}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unitedstatespowersquadrons/components",
3
- "version": "1.1.1-pre.1",
3
+ "version": "1.1.1-pre.2",
4
4
  "description": "USPS shared React components library",
5
5
  "main": "index.tsx",
6
6
  "scripts": {
package/types.ts CHANGED
@@ -17,6 +17,7 @@ type OnClickOrKeyboardEvent =
17
17
 
18
18
  export interface HrefProps {
19
19
  href: string;
20
+ linkClassName?: string | undefined;
20
21
  newTab?: boolean | undefined;
21
22
  }
22
23