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

Update tooltip guidance #4680

Merged
merged 5 commits into from
May 17, 2024
Merged

Update tooltip guidance #4680

merged 5 commits into from
May 17, 2024

Conversation

mcwinter07
Copy link
Contributor

Why

The existing pattern for the Kaizen Tooltip's has some known issues when wrapping components or elements that lack a semantic role or interactivity (i.e: link, button, onclick).

In these instances the Tooltip content is not accessible to screen reader and is only visually available to mouse or keyboard users.

What

  • Adds guidance on Tooltip compatibility and common pitfalls wrapping Kaizen components

@mcwinter07 mcwinter07 requested a review from a team as a code owner May 15, 2024 06:48
Copy link

changeset-bot bot commented May 15, 2024

🦋 Changeset detected

Latest commit: cedff2c

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

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

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

Copy link
Contributor

github-actions bot commented May 15, 2024

✨ Here is your branch preview! ✨

Last updated for commit cedff2c: update docs and story default params


### Tooltips, Kaizen components and avoiding common pitfalls

While technically any Kaizen component can be wrapped by a `Tooltip`, as called out previously, only those with accessible roles will be readable to assistive technologies.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

someone who isn't a11y expert may not know what are components with "accessible roles". Would it be worth calling it out as interactive/focusable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure can certainly link out to the MDN docs since that has a pretty comprehensive list

Comment on lines 24 to 30
decorators: [
Story => (
<div className="flex mt-[50px] justify-center gap-12">
<Story />
</div>
),
],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this isn't the right way to center story. Doing it messes up with screenshots, responsiveness, some docs addons and other things. You can use layout: "centered" instead. https://storybook.js.org/docs/configure/story-layout#component-layout

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah nice, was just updating the original one that used inline styles so will axe the justify :) Cheers for the tip 👍

Comment on lines +24 to +30
decorators: [
Story => (
<div className="flex mt-[60px] gap-12">
<Story />
</div>
),
],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can remove the decorator now when you've set layout

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still need the decorator to add some whitespace of each story so the Tooltip floats to the top instead of the sides. Could probably have the flex and gap specific to the button story but figured there was no harm since it won't impact any of the other stories that have only one element

@mcwinter07 mcwinter07 merged commit 3e1c414 into main May 17, 2024
17 checks passed
@mcwinter07 mcwinter07 deleted the KZN-2283/update-tooltip-guidance branch May 17, 2024 01:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants