Skip to content

Commit

Permalink
Merge branch 'main' into bodyportal-sidebarnav
Browse files Browse the repository at this point in the history
  • Loading branch information
jivey authored Sep 9, 2024
2 parents 93c72af + 35de9bc commit 655d174
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ type TooltipProps = {
placement?: Placement;
icon?: any;
isOpen?: boolean;
ariaLabel?: string;
};

export const Tooltip = ({children, placement, icon, ...props}: React.PropsWithChildren<TooltipProps>) =>
Expand All @@ -88,9 +89,9 @@ export const Tooltip = ({children, placement, icon, ...props}: React.PropsWithCh
{children}
</StyledTooltip>;

export const TooltipGroup = ({icon, ...props}: React.PropsWithChildren<TooltipProps>) =>
export const TooltipGroup = ({icon, ariaLabel, ...props}: React.PropsWithChildren<TooltipProps>) =>
<TooltipTrigger delay={0}>
<StyledTrigger>
<StyledTrigger aria-label={ariaLabel || 'More information'}>
{icon
? <img src={icon} aria-hidden={true} alt='' />
: <Info aria-hidden={true} />
Expand Down
3 changes: 3 additions & 0 deletions src/components/__snapshots__/Tooltip.spec.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

exports[`Tooltip hides 1`] = `
<button
aria-label="More information"
className="sc-dkzDqf dcHEnX"
data-rac=""
onBlur={[Function]}
Expand Down Expand Up @@ -39,6 +40,7 @@ exports[`Tooltip hides 1`] = `
exports[`Tooltip matches snapshot 1`] = `
Array [
<button
aria-label="More information"
className="sc-dkzDqf dcHEnX"
data-rac=""
onBlur={[Function]}
Expand Down Expand Up @@ -124,6 +126,7 @@ Array [

exports[`Tooltip uses icon 1`] = `
<button
aria-label="More information"
className="sc-dkzDqf dcHEnX"
data-rac=""
onBlur={[Function]}
Expand Down

0 comments on commit 655d174

Please sign in to comment.