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

Composite: add "With Tooltip" storybook example #65817

Merged
merged 6 commits into from
Oct 3, 2024

Conversation

ciampo
Copy link
Contributor

@ciampo ciampo commented Oct 2, 2024

What?

Closes #65615

Add a Storybook example to illustrate how to correctly compose Tooltip and Composite

Why?

Composite the two components is not trivial, such an example can be of help to consumers of the library

How?

Added a new Storybook example following the suggestions from #65615

Testing Instructions

  • Load the new Storybook example
  • Make sure that composite and tooltip functionality work as expected

Screenshots or screencast

Kapture.2024-10-02.at.10.50.55.mp4

@ciampo ciampo added [Type] Developer Documentation Documentation for developers [Package] Components /packages/components labels Oct 2, 2024
@ciampo ciampo requested review from diegohaz and a team October 2, 2024 08:53
@ciampo ciampo self-assigned this Oct 2, 2024
@ciampo ciampo requested a review from ajitbohra as a code owner October 2, 2024 08:53
Copy link

github-actions bot commented Oct 2, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: ciampo <[email protected]>
Co-authored-by: tyxla <[email protected]>
Co-authored-by: diegohaz <[email protected]>
Co-authored-by: mirka <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link

github-actions bot commented Oct 2, 2024

Flaky tests detected in 26fc887.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/11140795519
📝 Reported issues:

@ciampo ciampo force-pushed the feat/composite-tooltip-storybook-example branch from 26fc887 to 69e895d Compare October 2, 2024 16:26
@ciampo
Copy link
Contributor Author

ciampo commented Oct 2, 2024

Updated this PR:

  • only recommending one way to compose Tooltip and Composite (ie. by rendering Composite.Item as a child of Tooltip)
  • reworked JSDocs accordingly, with a more clear code snipped showing the dos and don'ts
  • the third composite item in the story uses the render prop to use a custom Button instead of the default vanilla button that is rendered by default by Composite.Item. I thought it could be useful

@ciampo ciampo requested a review from tyxla October 2, 2024 16:29
Copy link
Member

@mirka mirka left a comment

Choose a reason for hiding this comment

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

Very easy to understand, thank you!

packages/components/src/composite/stories/index.story.tsx Outdated Show resolved Hide resolved
@ciampo ciampo force-pushed the feat/composite-tooltip-storybook-example branch from 69e895d to 50466a8 Compare October 2, 2024 23:15
@ciampo ciampo enabled auto-merge (squash) October 2, 2024 23:16
@ciampo ciampo merged commit 4186b74 into trunk Oct 3, 2024
62 checks passed
@ciampo ciampo deleted the feat/composite-tooltip-storybook-example branch October 3, 2024 05:55
@github-actions github-actions bot added this to the Gutenberg 19.4 milestone Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Components /packages/components [Type] Developer Documentation Documentation for developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Composite: Doesn't work when render is a Tooltip
4 participants