@agility/plenum-ui 2.1.6 → 2.1.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.
|
@@ -26,6 +26,7 @@ export interface IButtonProps extends Omit<React.DetailedHTMLProps<React.ButtonH
|
|
|
26
26
|
isLoading?: boolean;
|
|
27
27
|
className?: string;
|
|
28
28
|
iconObj?: React.ReactNode;
|
|
29
|
+
iconClassName?: string;
|
|
29
30
|
}
|
|
30
31
|
declare const Button: React.ForwardRefExoticComponent<IButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
31
32
|
export default Button;
|
package/package.json
CHANGED
|
@@ -33,6 +33,7 @@ export interface IButtonProps
|
|
|
33
33
|
isLoading?: boolean
|
|
34
34
|
className?: string
|
|
35
35
|
iconObj?: React.ReactNode
|
|
36
|
+
iconClassName?: string
|
|
36
37
|
}
|
|
37
38
|
/**
|
|
38
39
|
* Primary UI component for user interaction
|
|
@@ -50,16 +51,22 @@ const _Button = (
|
|
|
50
51
|
asLink,
|
|
51
52
|
isLoading = false,
|
|
52
53
|
className,
|
|
54
|
+
iconClassName,
|
|
53
55
|
...props
|
|
54
56
|
}: IButtonProps,
|
|
55
57
|
ref: React.LegacyRef<HTMLButtonElement>
|
|
56
58
|
) => {
|
|
57
|
-
|
|
59
|
+
let iconStyles = cn(
|
|
58
60
|
{ "text-white h-5 w-5 stroke-[1.5]": actionType === "primary" || actionType === "danger" },
|
|
59
61
|
{ "text-purple-700 h-5 w-5 stroke-[1.5]": actionType === "secondary" },
|
|
60
|
-
{ "text-gray-400
|
|
62
|
+
{ "text-gray-400 h-5 w-5 stroke-[1.5]": actionType === "alternative" },
|
|
61
63
|
{ "text-transparent-black-40 h-5 w-5 stroke-[1.5]": actionType === "warning" }
|
|
62
64
|
)
|
|
65
|
+
|
|
66
|
+
if (iconClassName) {
|
|
67
|
+
iconStyles = cn(iconStyles, iconClassName)
|
|
68
|
+
}
|
|
69
|
+
|
|
63
70
|
const loaderColors = cn(
|
|
64
71
|
{ "border-r-white": actionType === "primary" },
|
|
65
72
|
{ "border-purple-200 border-r-purple-700": actionType === "secondary" },
|