mirror of https://github.com/grafana/grafana
InfoTooltip: refactor component to be accessible (#43613)
* InfoTooltip: refactor component to be accessible * new: create ghostMode prop to allow turning on/off button styles * update infoToolTip component to use ghostMode prop * update story to show ghostMode state * fix condition to work properly * nit fix * revert changes to former infoTooltip state * InfoTooltip: use iconButton instead to achieve keyboard a11y * fix minor type nitpull/43704/head
parent
8dc4c23a89
commit
62d44fcffc
@ -1,15 +1,11 @@ |
||||
import React from 'react'; |
||||
import { Tooltip, TooltipProps, PopoverContent } from '../Tooltip/Tooltip'; |
||||
import { Icon } from '../Icon/Icon'; |
||||
import { PopoverContent, TooltipProps } from '../Tooltip/Tooltip'; |
||||
import { IconButton } from '../IconButton/IconButton'; |
||||
|
||||
interface InfoTooltipProps extends Omit<TooltipProps, 'children' | 'content'> { |
||||
children: PopoverContent; |
||||
} |
||||
|
||||
export const InfoTooltip = ({ children, ...restProps }: InfoTooltipProps) => { |
||||
return ( |
||||
<Tooltip content={children} {...restProps}> |
||||
<Icon name="info-circle" /> |
||||
</Tooltip> |
||||
); |
||||
return <IconButton name="info-circle" tooltip={children} {...restProps} />; |
||||
}; |
||||
|
||||
Loading…
Reference in new issue