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

fix: fixed the Tabs attribute from style to variant #1405

Merged
merged 3 commits into from
Jun 19, 2024

Conversation

dhavalveera
Copy link
Contributor

@dhavalveera dhavalveera commented May 28, 2024

Issue Reference #1256

this PR fixes the omitting attribute of style and now it's been replaced with variant attribute in order to allow the usage of style attribute.

Summary by CodeRabbit

  • New Features

    • Renamed the style attribute to variant in the <Tabs> component for improved flexibility in styling options.
    • Updated documentation and examples to reflect the new variant attribute in the <Tabs> component.
  • Improvements

    • Enhanced consistency across the application by standardizing the use of the variant attribute for tab styling.
  • Chores

    • Applied changes to the flowbite-react package to support the new variant attribute, allowing users to utilize the style attribute.

Copy link

changeset-bot bot commented May 28, 2024

🦋 Changeset detected

Latest commit: d14a524

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

This PR includes changesets to release 1 package
Name Type
flowbite-react Patch

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

vercel bot commented May 28, 2024

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

Name Status Preview Comments Updated (UTC)
flowbite-react ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 29, 2024 3:05am
flowbite-react-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 29, 2024 3:05am

Copy link
Contributor

coderabbitai bot commented May 28, 2024

Walkthrough

The recent updates involve renaming the style prop to variant in the <Tabs> component across various files and examples. This change enhances clarity and allows the use of the style attribute for other purposes. The modifications span documentation, examples, and component definitions, ensuring consistency throughout the codebase.

Changes

File(s) Change Summary
apps/web/content/docs/components/tabs.mdx Updated <Tabs> prop from style to variant for different tab styles.
apps/web/examples/tabs/tabs.fullWidth.tsx Changed style attribute to variant, specifying fullWidth for the Tabs component.
apps/web/examples/tabs/tabs.root.tsx Updated style attribute to variant for consistency in the Tabs component.
apps/web/examples/tabs/tabs.stateOptions.tsx Changed style attribute to variant in the Tabs component.
apps/web/examples/tabs/tabs.withIcons.tsx Updated style attribute to variant in the Tabs component.
apps/web/examples/tabs/tabs.withPills.tsx Changed style attribute to variant, specifying pills style in the Tabs component.
apps/web/examples/tabs/tabs.withUnderline.tsx Updated style attribute to variant, specifying underline style in the Tabs component.
packages/ui/src/components/Tabs/Tabs.stories.tsx Renamed style property to variant in Tabs component stories.
packages/ui/src/components/Tabs/Tabs.tsx Renamed styles to variant in the FlowbiteTabsTheme interface and updated references accordingly.
packages/ui/src/components/Tabs/theme.ts Replaced styles property with variant in tablist, tabitem, and tabitemcontainer styles.
.changeset/forty-pumpkins-grow.md Introduced a patch renaming style to variant in the flowbite-react package for the Tabs component.

In code's realm, a change was made,
Style to variant, a switch displayed.
Tabs now gleam with clarity bright,
A rabbit's touch, in code's twilight.
🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Outside diff range and nitpick comments (4)
apps/web/content/docs/components/tabs.mdx (3)

Line range hint 6-6: Consider revising to "inside the main tabs component" to avoid redundancy.


Line range hint 18-18: Consider adding commas before 'and' in these sentences to improve readability.

Also applies to: 22-22


Line range hint 52-52: Consider changing "on how you can set the activate tab programatically" to "on how you can programmatically set the active tab".

packages/ui/src/components/Tabs/Tabs.tsx (1)

Line range hint 138-138: Consider using unique identifiers instead of array indexes as keys for list items if possible to prevent potential issues with component state on re-renders.

Also applies to: 165-165

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between b2640bc and 7c14eab.
Files selected for processing (10)
  • apps/web/content/docs/components/tabs.mdx (2 hunks)
  • apps/web/examples/tabs/tabs.fullWidth.tsx (2 hunks)
  • apps/web/examples/tabs/tabs.root.tsx (2 hunks)
  • apps/web/examples/tabs/tabs.stateOptions.tsx (2 hunks)
  • apps/web/examples/tabs/tabs.withIcons.tsx (2 hunks)
  • apps/web/examples/tabs/tabs.withPills.tsx (2 hunks)
  • apps/web/examples/tabs/tabs.withUnderline.tsx (2 hunks)
  • packages/ui/src/components/Tabs/Tabs.stories.tsx (5 hunks)
  • packages/ui/src/components/Tabs/Tabs.tsx (5 hunks)
  • packages/ui/src/components/Tabs/theme.ts (3 hunks)
Files skipped from review due to trivial changes (1)
  • packages/ui/src/components/Tabs/Tabs.stories.tsx
Additional Context Used
LanguageTool (5)
apps/web/content/docs/components/tabs.mdx (5)

Near line 6: This phrase is redundant. Consider using “inside”.
Context: ... you can click on to change the content inside of the main tabs component using React sta...
Rule ID: OUTSIDE_OF


Near line 18: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ... <Tabs> component to create a tab item and you can add any type of markup and Reac...
Rule ID: COMMA_COMPOUND_SENTENCE


Near line 18: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...markup and React components inside of it and it will be shown when clicking on the a...
Rule ID: COMMA_COMPOUND_SENTENCE


Near line 22: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...bs.Item>` component, it will be disabled and you won't be able to click on it. <Exa...
Rule ID: COMMA_COMPOUND_SENTENCE


Near line 52: The preposition “of” seems more likely in this position.
Context: ... React state options Here's an example on how you can set the activate tab progra...
Rule ID: AI_EN_LECTOR_REPLACEMENT_PREPOSITION

Biome (10)
apps/web/examples/tabs/tabs.fullWidth.tsx (1)

5-6: All these imports are only used as types.

apps/web/examples/tabs/tabs.root.tsx (1)

5-6: All these imports are only used as types.

apps/web/examples/tabs/tabs.stateOptions.tsx (1)

6-7: All these imports are only used as types.

apps/web/examples/tabs/tabs.withIcons.tsx (1)

5-6: All these imports are only used as types.

apps/web/examples/tabs/tabs.withPills.tsx (1)

3-4: All these imports are only used as types.

apps/web/examples/tabs/tabs.withUnderline.tsx (1)

5-6: All these imports are only used as types.

packages/ui/src/components/Tabs/Tabs.tsx (4)

152-152: The assignment should not be in an expression.


171-171: The HTML element div is non-interactive. Do not use tabIndex.


138-138: Avoid using the index of an array as key property in an element.


165-165: Avoid using the index of an array as key property in an element.

Additional comments not posted (17)
apps/web/examples/tabs/tabs.withPills.tsx (2)

11-11: Change from style to variant is correctly implemented for the pills style.


34-34: Change from style to variant is correctly implemented for the pills style.

apps/web/content/docs/components/tabs.mdx (3)

28-28: Documentation correctly updated to reflect the change from style to variant for underline style.


40-40: Documentation correctly updated to reflect the change from style to variant for pills style.


46-46: Documentation correctly updated to reflect the change from style to variant for full width style.

packages/ui/src/components/Tabs/theme.ts (2)

8-8: Theme configuration correctly updated to reflect the change from styles to variant.


17-17: Theme configuration correctly updated to reflect the change from styles to variant in both tabitem and tabitemcontainer.

Also applies to: 52-52

apps/web/examples/tabs/tabs.root.tsx (2)

15-15: Change from style to variant is correctly implemented for the default style.


46-46: Change from style to variant is correctly implemented for the default style.

apps/web/examples/tabs/tabs.withIcons.tsx (2)

15-15: Change from style to variant is correctly implemented for the underline style.


46-46: Change from style to variant is correctly implemented for the underline style.

apps/web/examples/tabs/tabs.withUnderline.tsx (2)

15-15: Change from style to variant is correctly implemented for the underline style.


46-46: Change from style to variant is correctly implemented for the underline style.

apps/web/examples/tabs/tabs.fullWidth.tsx (1)

16-16: Change from style to variant in <Tabs> component is consistent with PR objectives.

Also applies to: 49-49

packages/ui/src/components/Tabs/Tabs.tsx (2)

17-17: Changes to interfaces and props to replace style with variant are correctly implemented.

Also applies to: 20-20, 26-26, 59-59, 117-118, 133-133


Line range hint 171-171: Usage of tabIndex on non-interactive elements like <div> is acceptable here for accessibility reasons in a custom component.

apps/web/examples/tabs/tabs.stateOptions.tsx (1)

23-23: Change from style to variant in <Tabs> component is consistent with PR objectives.

Also applies to: 74-74

@SutuSebastian
Copy link
Collaborator

Looks good, only thing left is to create a changeset (patch)

@dhavalveera
Copy link
Contributor Author

Looks good, only thing left is to create a changeset (patch)

Pardon!. but can you help from where & how I need to create this changeset (patch)?

@dhavalveera
Copy link
Contributor Author

Looks good, only thing left is to create a changeset (patch)

Please have a look, the changeset I've added is correct...

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 7c14eab and 5406029.
Files selected for processing (1)
  • .changeset/forty-pumpkins-grow.md (1 hunks)
Additional Context Used
LanguageTool (2)
.changeset/forty-pumpkins-grow.md (2)

Near line 7: Consider a shorter alternative to avoid wordiness.
Context: ...enamed the Tabs - style to variants in order to allow the user to use style attribute w...
Rule ID: IN_ORDER_TO_PREMIUM


Near line 7: You might be missing the article “the” here.
Context: ...ants` in order to allow the user to use style attribute which was blocking earlier.
Rule ID: AI_EN_LECTOR_MISSING_DETERMINER_THE

.changeset/forty-pumpkins-grow.md Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 5406029 and d14a524.
Files selected for processing (1)
  • .changeset/forty-pumpkins-grow.md (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • .changeset/forty-pumpkins-grow.md

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.

2 participants