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: input in card becomes invisible on hover and making date-input and time-input consistent #4394

Merged
merged 1 commit into from
Dec 18, 2024

Conversation

macci001
Copy link
Contributor

@macci001 macci001 commented Dec 18, 2024

Closes #4371

📝 Description

This PR:

  • Fixes the input in card to become invisible on hover
  • Makes time-input and date-input consistent.

⛳️ Current behavior (updates)

🚀 New behavior

  • Flat: without color
Screen.Recording.2024-12-18.at.4.04.36.PM.mov
  • Flat: with color
Screen.Recording.2024-12-18.at.4.05.19.PM.mov
  • Faded: without color
Screen.Recording.2024-12-18.at.4.08.25.PM.mov
  • Faded: with color
Screen.Recording.2024-12-18.at.4.07.39.PM.mov
  • Bordered: without color
Screen.Recording.2024-12-18.at.4.09.48.PM.mov
  • Bordered: with color
Screen.Recording.2024-12-18.at.4.11.23.PM.mov
  • Underlined: without color
Screen.Recording.2024-12-18.at.4.14.03.PM.mov
  • Underlined: with color
Screen.Recording.2024-12-18.at.4.12.56.PM.mov

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

Summary by CodeRabbit

  • New Features

    • Improved visibility of input elements within card components.
    • Enhanced visual styles for date-input, input, and select components, including updated hover and focus states.
  • Bug Fixes

    • Resolved issue of invisible input in card components on hover.
  • Documentation

    • Added type aliases to improve type safety for date-input, input, and select components.

Copy link

vercel bot commented Dec 18, 2024

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 Dec 18, 2024 10:45am
nextui-storybook-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 18, 2024 10:45am

Copy link

changeset-bot bot commented Dec 18, 2024

🦋 Changeset detected

Latest commit: 6a81dfc

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

This PR includes changesets to release 12 packages
Name Type
@nextui-org/theme Patch
@nextui-org/autocomplete Patch
@nextui-org/checkbox Patch
@nextui-org/date-input Patch
@nextui-org/date-picker Patch
@nextui-org/form Patch
@nextui-org/input-otp Patch
@nextui-org/input Patch
@nextui-org/radio Patch
@nextui-org/select Patch
@nextui-org/table 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

Copy link
Contributor

coderabbitai bot commented Dec 18, 2024

Walkthrough

This pull request focuses on enhancing the styling and consistency of input-related components in the @nextui-org/theme package. The changes primarily involve updating hover states, background colors, and color variants for date-input, input, and select components. The modifications aim to improve the visual feedback and uniformity of these UI elements, ensuring a more cohesive user interface across different input types.

Changes

File Change Summary
packages/core/theme/src/components/date-input.ts - Updated inputWrapper styles for flat variant colors
- Added compound variants for faded variant
- Added type aliases DateInputVariantProps and DateInputSlots
packages/core/theme/src/components/input.ts - Changed hover background color from bg-default-50 to bg-default-200
- Added type aliases InputVariantProps and InputSlots
packages/core/theme/src/components/select.ts - Updated trigger styles for flat variant hover states
- Expanded color variants with specific selectorIcon colors
- Modified compoundVariants for different variants
- Updated type aliases and exported select variable
.changeset/late-doors-rhyme.md Patch file for the @nextui-org/theme package

Possibly related PRs

Suggested Labels

👀 Status: In Review

Suggested Reviewers

  • wingkwong
  • jrgarciadev

Tip

CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command @coderabbitai generate docstrings to have CodeRabbit automatically generate docstrings for your pull request. We would love to hear your feedback on Discord.


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 generate docstrings to generate docstrings for this PR. (Beta)
  • @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.

@macci001 macci001 marked this pull request as ready for review December 18, 2024 10:55
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

🧹 Nitpick comments (1)
.changeset/late-doors-rhyme.md (1)

5-5: Improve the changelog message clarity and grammar.

Consider revising the message for better clarity:

-Fixing the input in card to not become invisible on hover and making time-input and date-input consistent to other inputs.
+Fix input visibility in cards on hover and ensure consistency between time-input, date-input, and other input components.
🧰 Tools
🪛 LanguageTool

[grammar] ~5-~5: Before the countable noun ‘on’ an article or a possessive pronoun is necessary.
Context: ...nput in card to not become invisible on hover and making time-input and date-input co...

(IN_NN_CC_VBG)


[uncategorized] ~5-~5: The preposition “with” seems more likely in this position.
Context: ...ng time-input and date-input consistent to other inputs.

(AI_EN_LECTOR_REPLACEMENT_PREPOSITION)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e15ef62 and 6a81dfc.

📒 Files selected for processing (4)
  • .changeset/late-doors-rhyme.md (1 hunks)
  • packages/core/theme/src/components/date-input.ts (9 hunks)
  • packages/core/theme/src/components/input.ts (1 hunks)
  • packages/core/theme/src/components/select.ts (3 hunks)
🧰 Additional context used
📓 Learnings (1)
packages/core/theme/src/components/select.ts (2)
Learnt from: macci001
PR: nextui-org/nextui#3881
File: packages/core/theme/src/components/select.ts:227-231
Timestamp: 2024-11-12T02:48:07.324Z
Learning: In `packages/core/theme/src/components/select.ts`, changes may sometimes be formatting-only. Ensure to verify whether changes are only formatting-related before flagging potential issues.
Learnt from: macci001
PR: nextui-org/nextui#3881
File: packages/core/theme/src/components/select.ts:255-255
Timestamp: 2024-11-12T02:48:07.324Z
Learning: When updating the hover state for the faded variant of the select component, changing the background from `bg-secondary-50` to `bg-secondary-200` aligns with making the styling consistent with the input component.
🪛 LanguageTool
.changeset/late-doors-rhyme.md

[grammar] ~5-~5: Before the countable noun ‘on’ an article or a possessive pronoun is necessary.
Context: ...nput in card to not become invisible on hover and making time-input and date-input co...

(IN_NN_CC_VBG)


[uncategorized] ~5-~5: The preposition “with” seems more likely in this position.
Context: ...ng time-input and date-input consistent to other inputs.

(AI_EN_LECTOR_REPLACEMENT_PREPOSITION)

🔇 Additional comments (7)
packages/core/theme/src/components/date-input.ts (2)

230-230: LGTM! Background color updates improve visibility.

The changes to background colors in the flat variant for all color schemes (primary, secondary, success, warning, danger) follow a consistent pattern and improve visibility.

Also applies to: 241-241, 252-252, 263-263, 274-274


280-345: LGTM! New faded variant styles maintain consistency.

The addition of faded variant compound styles for all color schemes maintains consistency with other input components while providing proper visual feedback through border colors.

packages/core/theme/src/components/select.ts (3)

41-42: LGTM! Improved hover and focus states.

The update to use bg-default-200 for hover and focus states improves visibility and aligns with other input components.


93-107: LGTM! Consistent color variants for selector icon.

The addition of color variants for the selector icon enhances visual consistency across different color schemes.


235-235: LGTM! Consistent hover state in compound variants.

The hover state update in compound variants maintains consistency with the base variant changes.

packages/core/theme/src/components/input.ts (2)

79-79: Improved hover state visibility

The change from bg-default-50 to bg-default-200 provides better contrast, making the input visible on hover while maintaining a logical progression with the focus state (bg-default-100).


Line range hint 1-1: Type exports enhance developer experience

The addition of InputVariantProps and InputSlots types improves type safety and makes it easier for developers to work with the input component's variants and slots.

Also applies to: 1-1

@wingkwong wingkwong added this to the v2.6.9 milestone Dec 18, 2024
Copy link
Member

@wingkwong wingkwong left a comment

Choose a reason for hiding this comment

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

in your underline demo, why the labels for the last two have different colors?

image

image

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.

[BUG] - Input flat variant - background disappears on hover in dark mode (inside Card)
3 participants