-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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(alert): mark description optional & revise styles when only children is provided #4447
Conversation
🦋 Changeset detectedLatest commit: 2b9ffa8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
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 |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThe pull request introduces changes to the NextUI Alert component, primarily making the Changes
Assessment against linked issues
Possibly related PRs
Tip CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command 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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
Documentation and Community
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
.changeset/new-cups-tan.md (1)
5-5
: **Grammar fix suggestion **Improve subject-verb agreement by changing "children is" to "children are":
-fix the alignment when only alert children is provided +fix the alignment when only alert children are provided🧰 Tools
🪛 LanguageTool
[uncategorized] ~5-~5: This verb does not appear to agree with the subject. Consider using a different form.
Context: ... the alignment when only alert children is provided(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
.changeset/neat-badgers-beam.md
(1 hunks).changeset/new-cups-tan.md
(1 hunks)packages/components/alert/src/use-alert.ts
(1 hunks)packages/core/theme/src/components/alert.ts
(1 hunks)
🧰 Additional context used
🪛 LanguageTool
.changeset/new-cups-tan.md
[uncategorized] ~5-~5: This verb does not appear to agree with the subject. Consider using a different form.
Context: ... the alignment when only alert children is provided
(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)
🔇 Additional comments (4)
packages/components/alert/src/use-alert.ts (2)
22-22
: **Description JSDoc update improves clarity **
Marking the description
prop as "description of the alert message" is more explicit and aligns well with the new optional design.
24-24
: **Optional description
broadens usage flexibility **
This change allows consumers to omit the description for minimal alert usage scenarios. Ensure that all usage references gracefully handle the absence of a description.
packages/core/theme/src/components/alert.ts (1)
28-29
: **Centering content for a consistent layout **
The addition of justify-center
helps align alert content vertically. This improves the styling consistency, especially when only minimal content is passed.
.changeset/neat-badgers-beam.md (1)
1-5
: **Changeset reflects optional description
**
This patch version is consistent with making the description
prop optional, promoting flexibility in using alerts without mandatory descriptions.
Closes #4445
📝 Description
description
is marked as required (from the earliest design). At some point (around 2 months ago),description
is only shown when it is provided based on alert.tsx#L66. Hence, it indicates that it should be optional.Also, when no title & description are provided, says
<Alert>Hello</Alert>
, the children position is a bit off. This PR also fixes the styling to make it look more natural (see the screenshots below).⛳️ Current behavior (updates)
🚀 New behavior
💣 Is this a breaking change (Yes/No):
📝 Additional Information