mirror of
https://github.com/grafana/grafana.git
synced 2025-07-29 17:02:20 +08:00
GrafanaUI: Add success state to ClipboardButton (#52069)
* User Experience: apply the same pattern feedback for all copy to clipboard buttons * add copy icon to all ClipboardButton use cases * Change primary color for copy to clipboard in create token * Add success button variant * Remove copy confirmation from TableCellInspectModal because it's in the base component now * Design tweaks to copy confirmation - Only change the icon to tick to avoid the button changing size - Change button to success green - Only show copy confirmation state for 2 seconds * revert TabelCellInspectModal text button back * revert accidental change to ShareLink Co-authored-by: joshhunt <josh@trtr.co>
This commit is contained in:

committed by
GitHub

parent
ba76be174f
commit
0633840777
@ -11,7 +11,7 @@ import { getPropertiesForButtonSize } from '../Forms/commonStyles';
|
||||
import { Icon } from '../Icon/Icon';
|
||||
import { PopoverContent, Tooltip, TooltipPlacement } from '../Tooltip';
|
||||
|
||||
export type ButtonVariant = 'primary' | 'secondary' | 'destructive';
|
||||
export type ButtonVariant = 'primary' | 'secondary' | 'destructive' | 'success';
|
||||
export const allButtonVariants: ButtonVariant[] = ['primary', 'secondary', 'destructive'];
|
||||
export type ButtonFill = 'solid' | 'outline' | 'text';
|
||||
export const allButtonFills: ButtonFill[] = ['solid', 'outline', 'text'];
|
||||
@ -294,6 +294,9 @@ export function getPropertiesForVariant(theme: GrafanaTheme2, variant: ButtonVar
|
||||
case 'destructive':
|
||||
return getButtonVariantStyles(theme, theme.colors.error, fill);
|
||||
|
||||
case 'success':
|
||||
return getButtonVariantStyles(theme, theme.colors.success, fill);
|
||||
|
||||
case 'primary':
|
||||
default:
|
||||
return getButtonVariantStyles(theme, theme.colors.primary, fill);
|
||||
|
Reference in New Issue
Block a user