@unitedstatespowersquadrons/components 1.0.8 → 1.0.9

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
@@ -76,7 +76,7 @@ const ActionButton = (props: ActionButtonProps) => {
76
76
  const buttonContents = () => {
77
77
  return(
78
78
  <>
79
- <FontAwesomeIcon icon={icon} fa={fa} mode={mode} style={style} />
79
+ <FontAwesomeIcon fa={fa} icon={icon} mode={mode} style={style} />
80
80
  <span>{text}</span>
81
81
  {subtext && <small className={classes.subText}>({subtext})</small>}
82
82
  </>
@@ -89,10 +89,10 @@ const ActionButton = (props: ActionButtonProps) => {
89
89
  return(
90
90
  <BaseActionButton
91
91
  className={classNames(classes.button, colorClassName, sizeClassName(), className)}
92
+ confirm={confirm}
92
93
  id={id}
93
94
  onClick={onClick}
94
95
  title={title}
95
- confirm={confirm}
96
96
  >
97
97
  {buttonContents()}
98
98
  </BaseActionButton>
@@ -103,11 +103,11 @@ const ActionButton = (props: ActionButtonProps) => {
103
103
  return(
104
104
  <BaseActionButton
105
105
  className={classNames(classes.button, colorClassName, sizeClassName(), className)}
106
+ confirm={confirm}
106
107
  href={href}
107
108
  id={id}
108
109
  method={method}
109
110
  title={title}
110
- confirm={confirm}
111
111
  >
112
112
  {buttonContents()}
113
113
  </BaseActionButton>
@@ -139,10 +139,10 @@ const ActionButton = (props: ActionButtonProps) => {
139
139
  return(
140
140
  <BaseActionButton
141
141
  className={classNames(classes.button, colorClassName, sizeClassName(), className)}
142
+ confirm={confirm}
142
143
  id={id}
143
144
  onClick={onClick}
144
145
  title={title}
145
- confirm={confirm}
146
146
  >
147
147
  {buttonContents()}
148
148
  </BaseActionButton>
@@ -47,11 +47,11 @@ const BaseActionButton = (props: BaseActionButtonProps) => {
47
47
 
48
48
  return(
49
49
  <button
50
- type="button"
51
- id={id}
52
50
  className={classNames("action-button", classes.button, className)}
51
+ id={id}
53
52
  onClick={wrappedOnClick}
54
53
  title={title}
54
+ type="button"
55
55
  >
56
56
  {children}
57
57
  </button>
@@ -66,8 +66,8 @@ const BaseActionButton = (props: BaseActionButtonProps) => {
66
66
 
67
67
  return(
68
68
  <form action={href} method="POST" ref={formRef}>
69
- <input type="hidden" name="authenticity_token" value={getCsrfTokenHeader()} />
70
- <input type="hidden" name="_method" value={method.toUpperCase()} />
69
+ <input name="authenticity_token" type="hidden" value={getCsrfTokenHeader()} />
70
+ <input name="_method" type="hidden" value={method.toUpperCase()} />
71
71
  </form>
72
72
  );
73
73
  };
@@ -86,11 +86,11 @@ const BaseActionButton = (props: BaseActionButtonProps) => {
86
86
  <>
87
87
  {form()}
88
88
  <button
89
- type="button"
90
- id={id}
91
89
  className={classNames("action-button", classes.button, className)}
90
+ id={id}
92
91
  onClick={submitForm}
93
92
  title={title}
93
+ type="button"
94
94
  >
95
95
  {children}
96
96
  </button>
@@ -109,11 +109,11 @@ const BaseActionButton = (props: BaseActionButtonProps) => {
109
109
 
110
110
  return(
111
111
  <button
112
- type="button"
113
- onClick={onClick}
114
- id={id}
115
112
  className={classNames("action-button", classes.button, className)}
113
+ id={id}
114
+ onClick={onClick}
116
115
  title={title}
116
+ type="button"
117
117
  >
118
118
  {children}
119
119
  </button>
package/Flags/Officer.tsx CHANGED
@@ -80,7 +80,7 @@ const OfficerFlag = (props: Props) => {
80
80
 
81
81
  const combinedPath = `${flagBaseUrl}/${formatDir}/${subDirectory()}${displayRank}${sizeExtension}.${extension}`;
82
82
 
83
- return <img className={className} src={combinedPath} alt={displayRank} />;
83
+ return <img alt={displayRank} className={className} src={combinedPath} />;
84
84
  };
85
85
 
86
86
  export default OfficerFlag;
package/Flags/Signal.tsx CHANGED
@@ -52,7 +52,7 @@ const SignalFlag = (props: Props) => {
52
52
  const combinedUrl = `${signalBaseUrl}/${formatDir}/${dir()}/${flagValue()}.${extension}`;
53
53
 
54
54
  return (
55
- <img className={className} src={combinedUrl} alt={alt || flag} />
55
+ <img alt={alt || flag} className={className} src={combinedUrl} />
56
56
  );
57
57
  };
58
58
 
package/IconButton.tsx CHANGED
@@ -33,7 +33,7 @@ const IconButton = (props: IconButtonProps) => {
33
33
  const { className, fa, icon, id, mode, style, title } = props;
34
34
  const classes = useStyles();
35
35
 
36
- const configuredIcon = <FontAwesomeIcon icon={icon} fa={fa} mode={mode} style={style} css={className} />;
36
+ const configuredIcon = <FontAwesomeIcon css={className} fa={fa} icon={icon} mode={mode} style={style} />;
37
37
 
38
38
  const combinedClassName = classNames(classes.icon, className);
39
39
 
@@ -43,10 +43,10 @@ const IconButton = (props: IconButtonProps) => {
43
43
  return(
44
44
  <BaseActionButton
45
45
  className={combinedClassName}
46
+ confirm={confirm}
46
47
  id={id}
47
48
  onClick={onClick}
48
49
  title={title}
49
- confirm={confirm}
50
50
  >
51
51
  {configuredIcon}
52
52
  </BaseActionButton>
@@ -57,11 +57,11 @@ const IconButton = (props: IconButtonProps) => {
57
57
  return(
58
58
  <BaseActionButton
59
59
  className={combinedClassName}
60
+ confirm={confirm}
60
61
  href={href}
61
62
  id={id}
62
63
  method={method}
63
64
  title={title}
64
- confirm={confirm}
65
65
  >
66
66
  {configuredIcon}
67
67
  </BaseActionButton>
@@ -22,12 +22,12 @@ const SelectionIconButton = (props: Props) => {
22
22
 
23
23
  return(
24
24
  <IconButton
25
+ className={classNames(classes.icon, className)}
25
26
  icon={icon}
26
27
  id={id}
28
+ mode="duotone"
27
29
  onClick={onClick}
28
30
  title={title}
29
- className={classNames(classes.icon, className)}
30
- mode="duotone"
31
31
  />
32
32
  );
33
33
  };
@@ -18,7 +18,7 @@ const Table = (props: Props) => {
18
18
  const classes = useStyles();
19
19
 
20
20
  return(
21
- <table id={id} className={classNames(className, classes.table)}>
21
+ <table className={classNames(className, classes.table)} id={id}>
22
22
  {children}
23
23
  </table>
24
24
  );
package/Toasts/Toast.tsx CHANGED
@@ -122,12 +122,12 @@ const Toast = (props: Props) => {
122
122
  return (
123
123
  <div className={classNames(classes.toast, statusClassName, opacityClass)} key={`toast-${id}`}>
124
124
  <div className={classes.toastTitle}>
125
- <FontAwesomeIcon icon={icon} mode="duotone" fa="fw" />
125
+ <FontAwesomeIcon fa="fw" icon={icon} mode="duotone" />
126
126
  <span>{title}</span>
127
127
  </div>
128
128
  <div className={classes.toastBody}>{renderBody()}</div>
129
- <a className={classes.toastDismiss} title="Dismiss this message" onClick={handleDismiss}>
130
- <FontAwesomeIcon icon="times" mode="duotone" fa="fw" css={classes.toastDismissIcon} />
129
+ <a className={classes.toastDismiss} onClick={handleDismiss} title="Dismiss this message">
130
+ <FontAwesomeIcon css={classes.toastDismissIcon} fa="fw" icon="times" mode="duotone" />
131
131
  </a>
132
132
  </div>
133
133
  );
package/Toasts/Toasts.tsx CHANGED
@@ -50,7 +50,7 @@ const Toasts = (props: Props) => {
50
50
 
51
51
  return (
52
52
  <div className={classNames("toastsContainer", classes.toastsContainer)}>
53
- {toasts?.map(toast => <Toast dismiss={dismissFunc()} toast={toast} key={toast.id} />)}
53
+ {toasts?.map(toast => <Toast dismiss={dismissFunc()} key={toast.id} toast={toast} />)}
54
54
  </div>
55
55
  );
56
56
  };
package/eslint.config.mjs CHANGED
@@ -145,11 +145,12 @@ export default tseslint.config(
145
145
  "stylistic/no-extra-semi": "error",
146
146
  "stylistic/semi": ["error", "always"],
147
147
  "stylistic/no-multiple-empty-lines": "error",
148
+ "stylistic/jsx-sort-props": "error",
148
149
  "stylistic/array-element-newline": [
149
150
  "error",
150
151
  {
151
152
  "ArrayExpression": "consistent",
152
- "ArrayPattern": { "minItems": 3 },
153
+ "ArrayPattern": { "minItems": 5 },
153
154
  }
154
155
  ],
155
156
  "stylistic/object-property-newline": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unitedstatespowersquadrons/components",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "USPS shared React components library",
5
5
  "main": "index.tsx",
6
6
  "scripts": {