UI: add link button variant

This commit is contained in:
Alexander Zobnin 2019-12-10 12:24:33 +03:00
parent d99e2fc074
commit 4372350daa
No known key found for this signature in database
GPG Key ID: E17E9ABACEFA59EB
3 changed files with 10 additions and 2 deletions

View File

@ -15,7 +15,7 @@ const defaultProps = {
const variants = {
size: ['xs', 'sm', 'md', 'lg'],
variant: ['primary', 'secondary', 'danger', 'inverse', 'transparent'],
variant: ['primary', 'secondary', 'danger', 'inverse', 'transparent', 'link'],
};
const combinationOptions = {
CombinationRenderer: ThemeableCombinationsRowRenderer,

View File

@ -94,6 +94,14 @@ export const getButtonStyles = stylesFactory(({ theme, size, variant }: StyleDep
background: transparent;
`;
break;
case 'link':
background = css`
${buttonVariantStyles('', '', theme.colors.linkExternal, 'rgba(0, 0, 0, 0.1)', true)};
background: transparent;
text-decoration: underline;
`;
break;
}
return {

View File

@ -1,6 +1,6 @@
import { GrafanaTheme } from '@grafana/data';
export type ButtonVariant = 'primary' | 'secondary' | 'danger' | 'inverse' | 'transparent' | 'destructive';
export type ButtonVariant = 'primary' | 'secondary' | 'danger' | 'inverse' | 'transparent' | 'destructive' | 'link';
export type ButtonSize = 'xs' | 'sm' | 'md' | 'lg';