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

feat: create tabs component #5964

Merged
merged 18 commits into from
Oct 15, 2023
Merged

feat: create tabs component #5964

merged 18 commits into from
Oct 15, 2023

Conversation

araujogui
Copy link
Member

Description

Create Tabs component

Validation

image image

Related Issues

Fixes #5817

Check List

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run npx turbo lint to ensure the code follows the style guide. And run npx turbo lint:fix to fix the style errors if necessary.
  • I have run npx turbo format to ensure the code follows the style guide.
  • I have run npx turbo test to check if all tests are passing.
  • I've covered new added functionality with unit tests if necessary.

@araujogui araujogui requested review from a team as code owners October 4, 2023 15:01
@vercel
Copy link

vercel bot commented Oct 4, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nodejs-org ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 13, 2023 0:15am

@github-actions
Copy link

github-actions bot commented Oct 4, 2023

Unit Test Coverage Report

Lines Statements Branches Functions
Coverage: 96%
94.79% (273/288) 78.12% (50/64) 93.1% (54/58)

Unit Test Report

Tests Skipped Failures Errors Time
29 0 💤 0 ❌ 0 🔥 7.196s ⏱️

COLLABORATOR_GUIDE.md Outdated Show resolved Hide resolved
COLLABORATOR_GUIDE.md Outdated Show resolved Hide resolved
Copy link
Member

@ovflowd ovflowd left a comment

Choose a reason for hiding this comment

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

LGTM! Looks good to me and it looks simple enough :)

(Gonna verify the UI changes now)

But I would also appreciate if you could add Unit Tests to verify that clicking on the Tabs changes the current tab

Also: PR needs to be rebased again

@ovflowd
Copy link
Member

ovflowd commented Oct 5, 2023

image

Based on the image above I feel that we need to support Tabs that instead of rendering a tab, they open an link/url. (External Link Tabs (which can also be internal links)

So you have two types of tabs:

type BaseTab = {
  name: string;
  label: React.ReactNode;
  align?: 'left' | 'right'; // Allow to align the tab on the right or the left of the Tab Container
}

type ContentTab = BaseTab & {
  content: React.ReactNode;
}

type LinkTab = BaseTab & {
  link: string;
}

type Tab = (ContentTab | LinkTab)[];

Note that when the link is used we wrap the link with a LocalizedLink and a link does not need to start with https://, it could be a path also.

Also when Link is used we render the "External Link" Icon as in the image.

@ovflowd
Copy link
Member

ovflowd commented Oct 5, 2023

wdyt @bmuenzenmeyer is my comment above a correct interpretation of the Figma?

@bmuenzenmeyer
Copy link
Collaborator

my understanding is that the More Options link is not a part of the Tabs component or this issue, but rather a feature of the Codebox that allows someone to navigate to another arbitrary location. See my notes about it within #5819

@ovflowd
Copy link
Member

ovflowd commented Oct 5, 2023

my understanding is that the More Options link is not a part of the Tabs component or this issue, but rather a feature of the Codebox that allows someone to navigate to another arbitrary location. See my notes about it within #5819

What I wonder how the Tabs panel and the button would coexist in the same place.

Because either that button is floating or I don't know, as genuinely the content of the tabs and the tabs itself occupy one single container, so if the size of the tabs is reduced I assume the content is too...

@ovflowd
Copy link
Member

ovflowd commented Oct 13, 2023

Issue is on package-lock.json this PR broke it.

@ovflowd ovflowd added this pull request to the merge queue Oct 15, 2023
Merged via the queue into nodejs:main with commit bf13056 Oct 15, 2023
11 of 12 checks passed
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.

Create Tab and Tabs components
4 participants