Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tooltip: Update the component markup for a11y remediations & refactor the existing styles towards more static styling #3032

Merged
merged 38 commits into from
Apr 11, 2023

Conversation

broccolinisoup
Copy link
Member

@broccolinisoup broccolinisoup commented Mar 15, 2023

Closes https://github.com/github/primer/issues/1909
Closes https://github.com/github/primer/issues/1907
Closes https://github.com/github/primer/issues/1918

Storybook features: https://primer-7bad896c1f-13348165.drafts.github.io/storybook/?path=/story/components-tooltip-features--tooltip-description-type-tooltip
Docs: https://primer-7bad896c1f-13348165.drafts.github.io/Tooltip

This PR refactors the current Tooltip component to update the markup and styles to match with the expected accessibility requirements.

Merge checklist

  • Added/updated tests
  • Added/updated documentation
  • Tested in Chrome
  • Tested in Firefox
  • Tested in Safari
  • Tested in Edge

Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.

@broccolinisoup broccolinisoup added the skip changeset This change does not need a changelog label Mar 15, 2023
@changeset-bot
Copy link

changeset-bot bot commented Mar 15, 2023

🦋 Changeset detected

Latest commit: 7a816fb

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Mar 15, 2023

size-limit report 📦

Path Size
dist/browser.esm.js 95.82 KB (+0.33% 🔺)
dist/browser.umd.js 96.45 KB (+0.42% 🔺)

@broccolinisoup broccolinisoup temporarily deployed to github-pages March 15, 2023 04:15 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-3032 March 15, 2023 04:16 Inactive
@broccolinisoup broccolinisoup changed the title Tooltip: Refactor the markup without styled components and apply a11y remediations WIP - Tooltip: Refactor the markup without styled components and apply a11y remediations Mar 15, 2023
@broccolinisoup broccolinisoup temporarily deployed to github-pages March 16, 2023 06:57 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-3032 March 16, 2023 06:58 Inactive
src/Tooltip2.tsx Outdated Show resolved Hide resolved
src/Tooltip2.tsx Outdated Show resolved Hide resolved
src/Tooltip2.tsx Outdated Show resolved Hide resolved
@broccolinisoup broccolinisoup temporarily deployed to github-pages March 16, 2023 08:22 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-3032 March 16, 2023 08:23 Inactive
@broccolinisoup broccolinisoup changed the title WIP - Tooltip: Refactor the markup without styled components and apply a11y remediations Tooltip: Refactor the markup without styled components and apply a11y remediations Mar 20, 2023
@broccolinisoup broccolinisoup marked this pull request as ready for review March 20, 2023 02:59
@broccolinisoup broccolinisoup requested a review from a team March 20, 2023 02:59
@broccolinisoup broccolinisoup temporarily deployed to github-pages March 20, 2023 03:04 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-3032 March 20, 2023 03:04 Inactive
src/Tooltip2.tsx Outdated Show resolved Hide resolved
src/Tooltip2.tsx Outdated Show resolved Hide resolved
@broccolinisoup broccolinisoup temporarily deployed to github-pages March 20, 2023 09:46 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-3032 April 11, 2023 00:50 Inactive
@primer primer bot temporarily deployed to github-pages April 11, 2023 00:50 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-3032 April 11, 2023 00:51 Inactive
@broccolinisoup broccolinisoup temporarily deployed to github-pages April 11, 2023 01:04 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-3032 April 11, 2023 01:04 Inactive
@broccolinisoup broccolinisoup temporarily deployed to github-pages April 11, 2023 01:30 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-3032 April 11, 2023 01:30 Inactive
@broccolinisoup broccolinisoup temporarily deployed to github-pages April 11, 2023 01:49 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-3032 April 11, 2023 01:49 Inactive
@broccolinisoup broccolinisoup temporarily deployed to github-pages April 11, 2023 02:57 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-3032 April 11, 2023 02:58 Inactive
@broccolinisoup broccolinisoup temporarily deployed to github-pages April 11, 2023 03:51 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-3032 April 11, 2023 03:52 Inactive
@broccolinisoup broccolinisoup added this pull request to the merge queue Apr 11, 2023
Merged via the queue into main with commit 1588989 Apr 11, 2023
@broccolinisoup broccolinisoup deleted the tooltip-experiments branch April 11, 2023 23:39
@primer-css primer-css mentioned this pull request Apr 11, 2023
broccolinisoup added a commit that referenced this pull request Apr 13, 2023
…refactor the existing styles towards more static styling (#3032)"

This reverts commit 1588989.
broccolinisoup added a commit that referenced this pull request Apr 17, 2023
… at dotcom (#3169)

* Revert "fix(Tooltip): update TypeScript types for TooltipProps (#3159)"

This reverts commit e6a5db6.

* Revert "Tooltip: Update the component markup for a11y remediations & refactor the existing styles towards more static styling (#3032)"

This reverts commit 1588989.
broccolinisoup added a commit that referenced this pull request May 4, 2023
… the existing styles towards more static styling (#3032)

* Refactor tooltip markup without styled components and apply a11y remediations

* experiment tooltip

* checking interactive elements and clean the code a bit

* add another story

* style fixes and more stories

* refactor it to use internal open state and make css presudo classes redundant

* apply code review feedback

* Refactor the styles to use data-attr and styled-components

* update events

* align and wrap styles with data attr

* remove unused var

* restructure markup and make tooltip hoverable

* wrap up, clean up, interactive children

* Apply suggestions from code review

Co-authored-by: Josh Black <joshblack@github.com>

* code review feedback

* add outline for force-color media

* Add unit tests

* check the trigger element's content for label

* useOnEscapePress hook to close the tooltip when mouse is hovering over the trigger element

* fix tests

* docs and move tooltip into folder

* Update generated/components.json

* add changeset

* fix imports

* update snapshot

* update snapshot

* default value to the docs

* Update generated/components.json

* snaps

* remove snapshot tests

---------

Co-authored-by: Josh Black <joshblack@github.com>
Co-authored-by: broccolinisoup <broccolinisoup@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants