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

Tabs: expose active tab item props, use ariakit prop types #66223

Merged
merged 8 commits into from
Oct 18, 2024

Conversation

ciampo
Copy link
Contributor

@ciampo ciampo commented Oct 17, 2024

What?

Extracted from #66097 (comment)

This PR adds 3 more props on the Tabs component: activeTabId, defaultActiveTabId and onActiveTabIdChange, and tweaks all prop types to use ariakit type defs under the hood

Why?

The new props are necessary to control, in some cases, which tab is the active composite item (see #66097 (comment)).

Updating the prop types align Tabs with other recent ariakit-based components, such as Composite and DropdownMenuV2.

How?

  • Added new props
  • Updated types and some JSDocs
  • Updated README to match new JSDocs

Testing Instructions

Review the code and the README. No runtime changes.

@ciampo ciampo added [Type] Enhancement A suggestion for improvement. [Package] Components /packages/components labels Oct 17, 2024
@ciampo ciampo requested a review from a team October 17, 2024 23:53
@ciampo ciampo self-assigned this Oct 17, 2024
@ciampo ciampo requested a review from ajitbohra as a code owner October 17, 2024 23:53
Copy link

github-actions bot commented Oct 17, 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 <mciampini@git.wordpress.org>
Co-authored-by: tyxla <tyxla@git.wordpress.org>

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

Copy link
Member

@tyxla tyxla left a comment

Choose a reason for hiding this comment

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

LGTM 👍 🚀

Just left a few minor suggestions and questions.

packages/components/src/tabs/README.md Outdated Show resolved Hide resolved
packages/components/src/tabs/README.md Outdated Show resolved Hide resolved
packages/components/src/tabs/types.ts Outdated Show resolved Hide resolved
packages/components/src/tabs/types.ts Outdated Show resolved Hide resolved
packages/components/src/tabs/types.ts Outdated Show resolved Hide resolved
@ciampo ciampo force-pushed the feat/tabs/active-tab-id branch from 576c320 to ed6be72 Compare October 18, 2024 11:48
@ciampo
Copy link
Contributor Author

ciampo commented Oct 18, 2024

Thank you for the review, @tyxla ! All feedback address, will merge as soon as CI checks pass ✅

@ciampo ciampo enabled auto-merge (squash) October 18, 2024 11:51
Copy link

Flaky tests detected in ed6be72.
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/11403118754
📝 Reported issues:

@ciampo ciampo merged commit 220547e into trunk Oct 18, 2024
62 of 63 checks passed
@ciampo ciampo deleted the feat/tabs/active-tab-id branch October 18, 2024 12:54
@github-actions github-actions bot added this to the Gutenberg 19.6 milestone Oct 18, 2024
karthick-murugan pushed a commit to karthick-murugan/gutenberg that referenced this pull request Nov 13, 2024
…#66223)

Co-authored-by: ciampo <mciampini@git.wordpress.org>
Co-authored-by: tyxla <tyxla@git.wordpress.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Components /packages/components [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants