@ews-admin/global-design-system 1.1.12 → 1.1.13
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/README.md +3 -3
- package/dist/components/Button/Button.d.ts +1 -1
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.esm.css +1 -1
- package/dist/index.esm.js +10 -10
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +10 -10
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Button/Button.tsx +20 -18
- package/src/components/Modal/Modal.tsx +2 -2
package/package.json
CHANGED
|
@@ -6,7 +6,13 @@ export interface ButtonProps
|
|
|
6
6
|
/**
|
|
7
7
|
* Button variant
|
|
8
8
|
*/
|
|
9
|
-
variant?:
|
|
9
|
+
variant?:
|
|
10
|
+
| "ews-primary"
|
|
11
|
+
| "ews-secondary"
|
|
12
|
+
| "success"
|
|
13
|
+
| "warning"
|
|
14
|
+
| "error"
|
|
15
|
+
| "outline";
|
|
10
16
|
/**
|
|
11
17
|
* Button size
|
|
12
18
|
*/
|
|
@@ -33,7 +39,7 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
|
33
39
|
(
|
|
34
40
|
{
|
|
35
41
|
className,
|
|
36
|
-
variant = "primary",
|
|
42
|
+
variant = "ews-primary",
|
|
37
43
|
size = "md",
|
|
38
44
|
loading = false,
|
|
39
45
|
fullWidth = false,
|
|
@@ -46,21 +52,17 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
|
46
52
|
ref
|
|
47
53
|
) => {
|
|
48
54
|
const baseStyles =
|
|
49
|
-
"inline-flex items-center justify-center font-medium rounded-md transition-colors focus:outline-none
|
|
55
|
+
"inline-flex items-center justify-center font-medium rounded-md transition-colors focus:outline-none disabled:opacity-50 disabled:pointer-events-none";
|
|
50
56
|
|
|
51
57
|
const variants = {
|
|
52
|
-
primary:
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
"bg-
|
|
60
|
-
error:
|
|
61
|
-
"bg-ews-error text-white hover:bg-ews-error-hover focus:ring-ews-error",
|
|
62
|
-
ghost:
|
|
63
|
-
"bg-transparent text-ews-gray-700 hover:bg-ews-gray-100 focus:ring-ews-gray-500",
|
|
58
|
+
"ews-primary": "bg-ews-primary text-white hover:bg-ews-primary-hover",
|
|
59
|
+
"ews-secondary":
|
|
60
|
+
"bg-ews-secondary text-white hover:bg-ews-secondary-hover",
|
|
61
|
+
success: "bg-ews-success text-white hover:bg-ews-success-hover",
|
|
62
|
+
warning: "bg-ews-warning text-white hover:bg-ews-warning-hover",
|
|
63
|
+
error: "bg-ews-error text-white hover:bg-ews-error-hover",
|
|
64
|
+
outline:
|
|
65
|
+
"bg-transparent text-sm font-medium text-ews-primary hover:text-ews-primary/80",
|
|
64
66
|
};
|
|
65
67
|
|
|
66
68
|
const sizes = {
|
|
@@ -90,7 +92,7 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
|
90
92
|
>
|
|
91
93
|
{loading && (
|
|
92
94
|
<svg
|
|
93
|
-
className="
|
|
95
|
+
className="mr-2 -ml-1 w-4 h-4 animate-spin"
|
|
94
96
|
xmlns="http://www.w3.org/2000/svg"
|
|
95
97
|
fill="none"
|
|
96
98
|
viewBox="0 0 24 24"
|
|
@@ -111,13 +113,13 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
|
111
113
|
</svg>
|
|
112
114
|
)}
|
|
113
115
|
{!loading && leftIcon && (
|
|
114
|
-
<span className={cn("
|
|
116
|
+
<span className={cn("flex items-center mr-2", iconSizes[size])}>
|
|
115
117
|
{leftIcon}
|
|
116
118
|
</span>
|
|
117
119
|
)}
|
|
118
120
|
{children}
|
|
119
121
|
{!loading && rightIcon && (
|
|
120
|
-
<span className={cn("
|
|
122
|
+
<span className={cn("flex items-center ml-2", iconSizes[size])}>
|
|
121
123
|
{rightIcon}
|
|
122
124
|
</span>
|
|
123
125
|
)}
|
|
@@ -231,7 +231,7 @@ const Modal = ({
|
|
|
231
231
|
<div className="flex justify-end items-center p-6 pt-0 space-x-3">
|
|
232
232
|
{secondaryAction && (
|
|
233
233
|
<Button
|
|
234
|
-
variant="
|
|
234
|
+
variant="outline"
|
|
235
235
|
onClick={onSecondaryAction || onClose}
|
|
236
236
|
disabled={isLoading}
|
|
237
237
|
>
|
|
@@ -240,7 +240,7 @@ const Modal = ({
|
|
|
240
240
|
)}
|
|
241
241
|
{primaryAction && (
|
|
242
242
|
<Button
|
|
243
|
-
variant={variant === "error" ? "error" : "primary"}
|
|
243
|
+
variant={variant === "error" ? "error" : "ews-primary"}
|
|
244
244
|
onClick={onPrimaryAction}
|
|
245
245
|
loading={isLoading}
|
|
246
246
|
>
|