diff --git a/package.json b/package.json index c9a5caa..4dfbf93 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@giveth/ui-design-system", - "version": "1.11.10", + "version": "1.11.11", "files": [ "/lib" ], diff --git a/src/components/buttonLinks/ButtonLink.tsx b/src/components/buttonLinks/ButtonLink.tsx index 9c39e5d..0064fef 100644 --- a/src/components/buttonLinks/ButtonLink.tsx +++ b/src/components/buttonLinks/ButtonLink.tsx @@ -155,6 +155,7 @@ export const ButtonLink: FC = forwardRef( linkType = 'secondary', disabled = false, icon, + leftIcon, target, className, href, @@ -173,10 +174,11 @@ export const ButtonLink: FC = forwardRef( size={size} className={className} > + {leftIcon && leftIcon} {label} - {icon && icon} + {icon && !leftIcon && icon} ); }, diff --git a/src/components/buttonLinks/OutlineButtonLink.tsx b/src/components/buttonLinks/OutlineButtonLink.tsx index 44ee9cb..a1d3542 100644 --- a/src/components/buttonLinks/OutlineButtonLink.tsx +++ b/src/components/buttonLinks/OutlineButtonLink.tsx @@ -84,6 +84,7 @@ export const OutlineLinkButton: FC = forwardRef( linkType = 'secondary', disabled = false, icon, + leftIcon, href, target, className, @@ -103,8 +104,9 @@ export const OutlineLinkButton: FC = forwardRef( as={isExternal ? 'a' : 'span'} > + {leftIcon && leftIcon} {label} - {icon && icon} + {icon && !leftIcon && icon} ); diff --git a/src/components/buttonLinks/type.ts b/src/components/buttonLinks/type.ts index 3ecef54..80218fe 100644 --- a/src/components/buttonLinks/type.ts +++ b/src/components/buttonLinks/type.ts @@ -17,5 +17,6 @@ export interface IButtonLinkProps extends ComponentPropsWithoutRef<'a'>, IButtonLinkContainerProps { icon?: ReactNode; + leftIcon?: ReactNode; label: string; } diff --git a/src/components/buttons/Button.tsx b/src/components/buttons/Button.tsx index 963af35..1578964 100644 --- a/src/components/buttons/Button.tsx +++ b/src/components/buttons/Button.tsx @@ -155,6 +155,7 @@ export const Button: FC = ({ loading = false, onClick, icon, + leftIcon, className, type = 'button', }) => { @@ -172,8 +173,9 @@ export const Button: FC = ({ )} + {leftIcon && leftIcon} {label} - {icon && icon} + {icon && !leftIcon && icon} ); }; diff --git a/src/components/buttons/OutlineButton.tsx b/src/components/buttons/OutlineButton.tsx index e9b5271..1be0a02 100644 --- a/src/components/buttons/OutlineButton.tsx +++ b/src/components/buttons/OutlineButton.tsx @@ -93,6 +93,7 @@ export const OutlineButton: FC = ({ loading = false, onClick, icon, + leftIcon, className, type = 'button', }) => { @@ -110,8 +111,9 @@ export const OutlineButton: FC = ({ )} + {leftIcon && leftIcon} {label} - {icon && icon} + {icon && !leftIcon && icon} ); }; diff --git a/src/components/buttons/type.ts b/src/components/buttons/type.ts index 1a18041..7f541a7 100644 --- a/src/components/buttons/type.ts +++ b/src/components/buttons/type.ts @@ -18,4 +18,5 @@ export interface IButtonProps loading?: boolean; label: string; icon?: ReactNode; + leftIcon?: ReactNode; }