-
Notifications
You must be signed in to change notification settings - Fork 507
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
Adds new component TabPanels #4241
Conversation
🦋 Changeset detectedLatest commit: a7376be The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
size-limit report 📦
|
Not sure why design reviewers is on this PR, I've added engineer reviewers 🤷 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving snapshots
CI was green when I reran the failing stuff so going to try one last time to merge... |
* Early prototype of TabPanels * Linting * selected property is optional * Stop if complaining about types for aria-selected * Fix initial select * Adds tests for TabPanels * Move npm dep to packages/react * version semver format change * Add styling to match as close as I can to PVC version * Fix Playground * Linting * Delete TabWrapper and move styling to tablist * Add more docs * Format * Changeset * Add to the docs nav * Adds e2e tests * More scaffolding stuff * Fix error with docs reference * Update @github/tab-container-element so we can use it with SSR * Use type imports for type imports * More type imports * Fix TabPanels tests * test(vrt): update snapshots * Update test snapshot * Use the new shadowdom version of tab-container-element * Adds styles to tab-container * Remove test which is no longer required * Add margin to panels to match react * Upgrade tab-container-element to v4.1.0 * Update TabPanels to use better styling * Update docs to include events * Linting * Fix type error * Fix tests * test(vrt): update snapshots * Ignore axe test that fails because of shadow dom * Fix roll-up error * Move to drafts (and consequently experimental) * aria-labelledby option (required) on tab panels and id on tabs * Linting * Hide panels before JS kicks in * Minimise content flash when JS is slow * Demonstrate limitation with 11+ tabs * Linting again * Add required props to tests etc * npm run format * test(vrt): update snapshots * test(vrt): update snapshots * Add suppressHydrationWarning to elements on TabPanels * Update snapshot for update semver test * Add required props to docs example * Cherry-pick the change from my other PR * Delete dialog snapshots * Fix format * Upgrade tab-container-element to 4.1.2 * Update tab-container-element to v4.1.3 * Removes the need for specifying ids on children and makes them autogenerate * Linting * Move to draft directory * Fix docs build * Fix TabPanels in docs page * Coplete move to drafts area * Change API to use selectedTab on the parent and store it in state * Use new createComponent function * Add new selectedTabIndex prop support * Add selectedTabIndex prop to docs * Linting * Update docs * Fix formatting * Fix e2e test after move to draft * Simplify styled call on TabContainerElement * Fix types for linting * test(vrt): update snapshots * Shouldn't need to skip aria test now * Remove unused commented code * Fix typing on custom-elements * Type change to fix linting * Change type to SxProp * Use latest tab-container-element * Use onChange(d) aliases in docs * Automatically generate the parent id if it's not defined * Add aria requirements to TabPanels * Linting etc * Use defaultTabIndex which doesn't set the focus * Linting * Use the role instead of the type * child.props.type didn't work * We don't want the consumer to override the id or aria-labelledby * Updgrade tab-container-element to v4.5.0 * Better types for label/labelledby * Linting * test(vrt): update snapshots * Workaround infinite type issue --------- Co-authored-by: owenniblock <owenniblock@users.noreply.github.com> Co-authored-by: Keith Cirkel <keithamus@users.noreply.github.com>
This Work
Closes https://github.com/github/primer/issues/3043
Adds a new TabPanels component to mirror the Primer View Component TabPanels. We will need to retrospectively go back and update PVC to use the new
<tab-container>
which supports shadow DOM.Screenshots
Changelog
New
Changed
Removed
Rollout strategy
Testing & Reviewing
I'd particularly like guidance on the following:
tab-container-element
which we should supportMerge checklist