From afe6b700179dabf85cf9cdab14ce7f7d3ed4b69e Mon Sep 17 00:00:00 2001
From: langermank <18661030+langermank@users.noreply.github.com>
Date: Wed, 23 Aug 2023 17:52:44 -0700
Subject: [PATCH 01/16] update images
---
content/components/tooltip.mdx | 37 +++++++++++++++----
.../accessibility/tooltip-alternatives.mdx | 18 ++++-----
2 files changed, 39 insertions(+), 16 deletions(-)
diff --git a/content/components/tooltip.mdx b/content/components/tooltip.mdx
index 75d8e4446..407abf85d 100644
--- a/content/components/tooltip.mdx
+++ b/content/components/tooltip.mdx
@@ -3,8 +3,8 @@ title: Tooltip
description: Tooltips add additional context to other UI elements and appear on mouse hover or keyboard focus.
reactId: tooltip
railsIds:
-- Primer::Alpha::Tooltip
-- Primer::Tooltip
+ - Primer::Alpha::Tooltip
+ - Primer::Tooltip
cssId: tooltip
---
@@ -13,7 +13,6 @@ import {Link, Text} from '@primer/react'
import {Link as GatsbyLink} from 'gatsby'
export default ComponentLayout
-
## Usage
The tooltip component adds a tooltip to add context to interactive elements on the page.
@@ -21,15 +20,40 @@ The tooltip component adds a tooltip to add context to interactive elements on t
+
+
+
@@ -80,7 +80,7 @@ If possible, persist the content so it's always available rather than using a to
+
+
-
- `), please consider an alternative. There is no way to make a tooltip fully accessible on a non-interactive element. See [Tooltip alternatives](https://primer.style/design/guides/accessibility/tooltip-alternatives/) or consult a designer.
+If `.tooltipped` is being set on a non-interactive element (e.g. ``, ` `), please consider an alternative. There is no way to make a tooltip fully accessible on a non-interactive element. See [Tooltip alternatives](https://primer.style/design/components/tooltip#alternatives-to-tooltips) or consult a designer.
## Option 2: Migrate to the more accessible PVC tooltip
@@ -25,9 +25,7 @@ If your tooltip is appropriately set on an interactive element, you can migrate
Flagged code:
```html
-
- Mona Lisa
-
+ Mona Lisa
```
In this above example, we can get rid of the tooltip because it redundantly repeats the text content, like the following
@@ -41,9 +39,7 @@ In this above example, we can get rid of the tooltip because it redundantly repe
Flagged code:
```html
-
+
```
In this above example, the information that is conveyed using the tooltip is critical so we should not be using a tooltip to convey it. Update the design to always persist the text.
@@ -53,7 +49,11 @@ In this above example, the information that is conveyed using the tooltip is cri
Flagged code:
```html
-
+
Primer
```
@@ -61,9 +61,7 @@ Flagged code:
In this above example, the information conveyed in this tooltip isn't necessarily critical but supplements the link. If we decide to permanently persist it,we can update the markup like so:
```html
-
- Primer
-
+ Primer
A set of guidelines, principles, and patterns for designing and building UI at GitHub.
Date: Fri, 6 Oct 2023 11:51:01 -0700
Subject: [PATCH 15/16] add figma
---
content/components/tooltip.mdx | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/content/components/tooltip.mdx b/content/components/tooltip.mdx
index ae668ef18..b962f4315 100644
--- a/content/components/tooltip.mdx
+++ b/content/components/tooltip.mdx
@@ -1,11 +1,12 @@
---
title: Tooltip
-description: Tooltips add additional context to other UI elements and appear on mouse hover or keyboard focus.
+description: Tooltips add additional context to interactive UI elements and appear on mouse hover or keyboard focus.
reactId: tooltip
railsIds:
- Primer::Alpha::Tooltip
- Primer::Tooltip
cssId: tooltip
+figmaId: tooltip
---
import ComponentLayout from '~/src/layouts/component-layout'
@@ -239,13 +240,12 @@ If you are unsure which alternative is more suited to your scenario and need hel
## Additional resources
-
- [Your tooltips are bogus](https://heydonworks.com/article/your-tooltips-are-bogus/)
- [erb lint rule: NoAriaLabelMisuseCounter](https://github.com/github/erblint-github/blob/main/docs/rules/accessibility/no-aria-label-misuse-counter.md#no-aria-label-misuse-counter)
- [Rails tooltip linter](https://github.com/primer/view_components/blob/main/lib/primer/view_components/linters/tooltipped_migration.rb)
-
### Known accessibility issues
-