@unitedstatespowersquadrons/components 1.2.18-5 → 1.2.18-7

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/ActionButton.tsx +18 -3
  2. package/package.json +1 -1
package/ActionButton.tsx CHANGED
@@ -23,6 +23,10 @@ const useStyles = createUseStyles({
23
23
  purpleGray: { ...Styles.purple },
24
24
  redColored: { ...Styles.colorizeButton("red") },
25
25
  redGray: { ...Styles.red },
26
+ rightIcon: {
27
+ justifyContent: "flex-end",
28
+ padding: "0 0.3em 0 0.7em",
29
+ },
26
30
  small: { fontSize: "0.8em" },
27
31
  subText: {
28
32
  fontSize: "0.75em",
@@ -44,7 +48,6 @@ export interface CoreActionButtonProps extends FontAwesomeProps {
44
48
  color: ButtonColorName;
45
49
  grayMode?: boolean | undefined;
46
50
  id?: string;
47
- inline?: boolean;
48
51
  rightIcon?: boolean;
49
52
  size?: "big" | "mediumWithMargin" | "medium" | "small" | undefined;
50
53
  subtext?: string;
@@ -57,7 +60,11 @@ interface FormProps {
57
60
  formId: string;
58
61
  }
59
62
 
60
- export interface ActionButtonHrefProps extends CoreActionButtonProps, HrefProps {}
63
+ interface InlineProps {
64
+ inline?: boolean;
65
+ }
66
+
67
+ export interface ActionButtonHrefProps extends CoreActionButtonProps, HrefProps, InlineProps {}
61
68
  export interface ActionButtonMethodProps extends CoreActionButtonProps, MethodProps {}
62
69
  export interface ActionButtonOnClickProps extends CoreActionButtonProps, OnClickProps {}
63
70
  export interface ActionButtonFormProps extends CoreActionButtonProps, FormProps {}
@@ -136,9 +143,17 @@ const ActionButton = (props: ActionButtonProps) => {
136
143
  } else if ("href" in props) {
137
144
  const { href, inline, linkClassName } = props;
138
145
 
146
+ const buttonClassNames = classNames(
147
+ classes.button,
148
+ colorClassName,
149
+ sizeClassName(),
150
+ rightIcon ? classes.rightIcon : "",
151
+ className
152
+ );
153
+
139
154
  return(
140
155
  <BaseActionButton
141
- className={classNames(classes.button, colorClassName, sizeClassName(), className)}
156
+ className={buttonClassNames}
142
157
  href={href}
143
158
  id={id}
144
159
  linkClassName={classNames(inline ? classes.wrapperLinkInline : classes.wrapperLink, linkClassName)}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unitedstatespowersquadrons/components",
3
- "version": "1.2.18-5",
3
+ "version": "1.2.18-7",
4
4
  "description": "USPS shared React components library",
5
5
  "main": "index.tsx",
6
6
  "scripts": {