nextui icon indicating copy to clipboard operation
nextui copied to clipboard

fix(theme): make select styles consistent with input

Open macci001 opened this issue 1 year ago • 4 comments

Closes #3876

📝 Description

The changes in this PR makes the select component styles to be consistent with the input.

⛳️ Current behavior (updates)

https://github.com/user-attachments/assets/12d63c9c-22fb-4402-9d2d-f2894b918b73

🚀 New behavior

  • Flat Variant
    • Changes are made to make the hover color consistent

https://github.com/user-attachments/assets/4c5de25b-b1c1-46c9-8bc9-fd3499aabec7

https://github.com/user-attachments/assets/66462219-9b53-437b-8964-ca4f3d186b6f

  • Faded
    • Removing the bg-color change on hover
    • BorderColor added in case of focus and popover-open

https://github.com/user-attachments/assets/f899f35f-d46f-4a52-80e1-70900b812e88

  • Bordered
    • No styling change, just formatting change to remove the repeated style
  • Underlined
    • No changes.

💣 Is this a breaking change (Yes/No): No

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Enhanced styling for the select component, ensuring consistent hover effects with input components.
    • Updated hover states for various color variants in the select component, improving visual feedback during user interactions.
  • Bug Fixes

    • Resolved inconsistencies in hover styles across different select variants.

macci001 avatar Oct 13 '24 09:10 macci001

🦋 Changeset detected

Latest commit: 40b549e7ff1d9d116a13e2f345697e1e59bae2d1

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

This PR includes changesets to release 2 packages
Name Type
@nextui-org/theme Patch
@nextui-org/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

changeset-bot[bot] avatar Oct 13 '24 09:10 changeset-bot[bot]

@macci001 is attempting to deploy a commit to the NextUI Inc Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Oct 13 '24 09:10 vercel[bot]

Walkthrough

The changes in this pull request focus on enhancing the styling of the input and select components within the @nextui-org/theme package. Modifications include updates to Tailwind CSS classes for various states and variants, particularly addressing hover and focus interactions. The compoundVariants sections have been revised to improve visual consistency and feedback across input and select components. The changes aim to resolve inconsistencies noted in issue #3876 regarding the visual behavior of these components.

Changes

File Path Change Summary
packages/core/theme/src/components/input.ts Updated Tailwind CSS classes for input component states (flat, faded) and refined isInvalid styles.
packages/core/theme/src/components/select.ts Modified select component styles for flat, faded, and bordered variants, enhancing hover and focus states.
.changeset/twelve-trains-smile.md Introduced a patch for styling consistency between input and select components, linked to issue #3876.

Assessment against linked issues

Objective Addressed Explanation
Improve visual consistency between input and select components (3876)

Possibly related PRs

  • #3010: This PR revises the isInvalid styles in the input component, which is directly related to the changes made in the main PR that also focuses on enhancing the visual feedback for invalid inputs.
  • #3869: This PR addresses label placement in the input and select components, which is relevant as the main PR modifies the input component's visual states and could be affected by label positioning.
  • #3768: This PR fixes the fullWidth functionality in both input and select components, which relates to the main PR's focus on the input component's styling and behavior.
  • #3909: This PR applies nested group features to improve styling in components, including select, which is relevant as the main PR modifies the input component's styling and could be impacted by similar styling adjustments.

Suggested labels

👀 Status: In Review

Suggested reviewers

  • wingkwong
  • jrgarciadev

📜 Recent review details

Configuration used: .coderabbit.yaml Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 52c9042ed00242ccec0b50872f397e00f4a882d3 and 40b549e7ff1d9d116a13e2f345697e1e59bae2d1.

📒 Files selected for processing (3)
  • .changeset/twelve-trains-smile.md (1 hunks)
  • packages/core/theme/src/components/input.ts (7 hunks)
  • packages/core/theme/src/components/select.ts (2 hunks)
✅ Files skipped from review due to trivial changes (1)
  • .changeset/twelve-trains-smile.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/core/theme/src/components/input.ts
  • packages/core/theme/src/components/select.ts

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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 using 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.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

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.

coderabbitai[bot] avatar Oct 13 '24 09:10 coderabbitai[bot]

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

Name Status Preview Comments Updated (UTC)
nextui-docs-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 16, 2024 0:05am
nextui-storybook-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 16, 2024 0:05am

vercel[bot] avatar Oct 13 '24 09:10 vercel[bot]

Hey @macci001 thanks for this contribution, let's do the opposite, let's make the input look like the select styles -- the select hover colors look better

jrgarciadev avatar Nov 05 '24 19:11 jrgarciadev

@jrgarciadev sure, will do!

macci001 avatar Nov 05 '24 19:11 macci001

  • Made the changes to make input similar to select in case of flat variant.
  • Updated the example in PR description.

macci001 avatar Nov 05 '24 20:11 macci001

Thank you! @macci001

jrgarciadev avatar Nov 07 '24 13:11 jrgarciadev