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

refactor(docs): example of blurred card #3741

Open
wants to merge 2 commits into
base: canary
Choose a base branch
from

Conversation

macci001
Copy link
Contributor

@macci001 macci001 commented Sep 11, 2024

Closes #3717

📝 Description

Adds info for adding gradient for re-creating the code example.

⛳️ Current behavior (updates)

Currently the blurred card example gets the gradient from the codeDemo but user when trying out the component need to add the background to the parent/ansestor element.

Screenshot 2024-09-15 at 11 37 30 PM

🚀 New behavior

Adds info for the user/reader in the docs.

Screenshot 2024-09-15 at 11 38 59 PM

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

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Enhanced the visual presentation of the card component with a new gradient background.
  • Documentation

    • Updated documentation to clarify the interaction of the isBlurred prop with the parent component's properties, emphasizing the need for a suitable background to observe the blur effect.

Copy link

changeset-bot bot commented Sep 11, 2024

⚠️ No Changeset found

Latest commit: aab5e30

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Sep 11, 2024

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

A member of the Team first needs to authorize it.

Copy link
Contributor

coderabbitai bot commented Sep 11, 2024

Warning

Rate limit exceeded

@macci001 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 9 minutes and 38 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

Commits

Files that changed from the base of the PR and between cf52c8a and aab5e30.

Walkthrough

The changes involve modifications to the blurred.ts file, where a new div element has been added to wrap the Card component, introducing a gradient background. Additionally, the documentation for the isBlurred prop has been updated to clarify its dependency on the parent component for the blurring effect. The internal structure of the Card component and its functionality remain unchanged.

Changes

Files Change Summary
apps/docs/content/components/card/blurred.ts Added a new div wrapper for the Card component with a gradient background.
apps/docs/content/docs/components/card.mdx Updated documentation for the isBlurred prop to clarify its dependency on the parent component.

Assessment against linked issues

Objective Addressed Explanation
isBlurred property should work as expected (#3717)
Clarification on the isBlurred prop's functionality

Possibly related PRs

  • docs(card, badge): slots section addition #3580: This PR modifies the documentation for the Card component, which is directly related to the changes made in the main PR regarding the blurred.ts file and the isBlurred prop. Both PRs focus on enhancing the understanding and usage of the Card component.

Suggested labels

📋 Scope : Docs


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 generate interesting stats about this repository and render them as a table.
    -- @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.

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 (1)
apps/docs/content/docs/components/card.mdx (1)

76-76: Enhance clarity by rephrasing.

The added information about the isBlurred prop's behavior is valuable for developers using the component. It clarifies that the card's blurring properties are influenced by its parent component.

However, consider rephrasing the sentence to improve readability:

-You can pass the `isBlurred` prop to the card to blur the card. Card gets blurred properties with respect to its parent.
+You can pass the `isBlurred` prop to the card to blur the card. The card's blurring properties are determined by its parent component.
Tools
LanguageTool

[style] ~76-~76: ‘with respect to’ might be wordy. Consider a shorter alternative.
Context: ... the card. Card gets blurred properties with respect to its parent. <CodeDemo isGradientBox ti...

(EN_WORDINESS_PREMIUM_WITH_RESPECT_TO)

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 74792f7 and 681a0b7.

Files selected for processing (2)
  • apps/docs/content/components/card/blurred.ts (1 hunks)
  • apps/docs/content/docs/components/card.mdx (1 hunks)
Files skipped from review due to trivial changes (1)
  • apps/docs/content/components/card/blurred.ts
Additional context used
LanguageTool
apps/docs/content/docs/components/card.mdx

[style] ~76-~76: ‘with respect to’ might be wordy. Consider a shorter alternative.
Context: ... the card. Card gets blurred properties with respect to its parent. <CodeDemo isGradientBox ti...

(EN_WORDINESS_PREMIUM_WITH_RESPECT_TO)

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.

we've isGradientBox. doesn't it duplicate those code?

<CodeDemo isGradientBox title="Blurred Card" files={cardContent.blurred} />

@macci001
Copy link
Contributor Author

ack, makes sense. In order to avoid the duplication, I think it makes sense to add a note in the docs rather than wrapping the example code.

@macci001 macci001 force-pushed the macci001/correcting-blured-card-example branch 2 times, most recently from d6510c4 to 649f010 Compare September 11, 2024 08:33
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 (2)
apps/docs/content/docs/components/card.mdx (2)

76-78: Enhance clarity and conciseness.

The code changes are approved as they enhance clarity by specifying the dependency on the ancestor element's color for the blurring effect.

To further improve readability, consider replacing 'with respect to' with a more concise alternative, such as 'based on'.

Apply this diff to implement the suggestion:

-You can pass the `isBlurred` prop to the card to blur the card. Card gets blurred properties with respect to its ansestor element's color.
+You can pass the `isBlurred` prop to the card to blur the card. Card gets blurred properties based on its ancestor element's color.
Tools
LanguageTool

[style] ~76-~76: ‘with respect to’ might be wordy. Consider a shorter alternative.
Context: ... the card. Card gets blurred properties with respect to its ansestor element's color. <CodeDem...

(EN_WORDINESS_PREMIUM_WITH_RESPECT_TO)


80-81: Provide valuable guidance and improve conciseness.

The code changes are approved as they provide valuable guidance to users by emphasizing the importance of the ancestor element's background for the blur effect.

To further improve readability, consider replacing 'in order to' with a more concise alternative, such as 'to'.

Apply this diff to implement the suggestion:

-**Note** : While trying out the above example, it is required to provide necessary background to any ansestor element of Card Component in order to obtain the `blur` effect as seen in preview.
+**Note**: While trying out the above example, it is required to provide the necessary background to any ancestor element of the Card component to obtain the `blur` effect as seen in the preview.
Tools
LanguageTool

[style] ~80-~80: Consider a shorter alternative to avoid wordiness.
Context: ... any ansestor element of Card Component in order to obtain the blur effect as seen in pre...

(IN_ORDER_TO_PREMIUM)

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 681a0b7 and d6510c4.

Files selected for processing (1)
  • apps/docs/content/docs/components/card.mdx (1 hunks)
Additional context used
LanguageTool
apps/docs/content/docs/components/card.mdx

[style] ~76-~76: ‘with respect to’ might be wordy. Consider a shorter alternative.
Context: ... the card. Card gets blurred properties with respect to its ansestor element's color. <CodeDem...

(EN_WORDINESS_PREMIUM_WITH_RESPECT_TO)


[style] ~80-~80: Consider a shorter alternative to avoid wordiness.
Context: ... any ansestor element of Card Component in order to obtain the blur effect as seen in pre...

(IN_ORDER_TO_PREMIUM)

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 (2)
apps/docs/content/docs/components/card.mdx (2)

76-76: LGTM, with a minor suggestion.

The updated explanation of the isBlurred prop is clear and informative.

To further improve the conciseness of the explanation, consider replacing "with respect to" with "based on":

-You can pass the `isBlurred` prop to the card to blur the card. Card gets blurred properties with respect to its ansestor element.
+You can pass the `isBlurred` prop to the card to blur the card. Card gets blurred properties based on its ancestor element.
Tools
LanguageTool

[style] ~76-~76: ‘with respect to’ might be wordy. Consider a shorter alternative.
Context: ... the card. Card gets blurred properties with respect to its ansestor element. <CodeDemo isGrad...

(EN_WORDINESS_PREMIUM_WITH_RESPECT_TO)


80-80: LGTM, with a minor suggestion.

The note is a helpful addition to clarify the requirements for observing the blur effect.

To further improve the conciseness of the note, consider replacing "in order to" with "to":

-**Note** : While trying out the above example, it is required to provide necessary background to any ansestor element of Card Component in order to obtain the `blur` effect as seen in preview.
+**Note**: While trying out the above example, it is required to provide the necessary background to any ancestor element of the Card component to obtain the `blur` effect as seen in the preview.
Tools
LanguageTool

[style] ~80-~80: Consider a shorter alternative to avoid wordiness.
Context: ... any ansestor element of Card Component in order to obtain the blur effect as seen in pre...

(IN_ORDER_TO_PREMIUM)

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between d6510c4 and 649f010.

Files selected for processing (1)
  • apps/docs/content/docs/components/card.mdx (1 hunks)
Additional context used
LanguageTool
apps/docs/content/docs/components/card.mdx

[style] ~76-~76: ‘with respect to’ might be wordy. Consider a shorter alternative.
Context: ... the card. Card gets blurred properties with respect to its ansestor element. <CodeDemo isGrad...

(EN_WORDINESS_PREMIUM_WITH_RESPECT_TO)


[style] ~80-~80: Consider a shorter alternative to avoid wordiness.
Context: ... any ansestor element of Card Component in order to obtain the blur effect as seen in pre...

(IN_ORDER_TO_PREMIUM)

@macci001 macci001 force-pushed the macci001/correcting-blured-card-example branch from 649f010 to 1221938 Compare September 11, 2024 08:42
@macci001 macci001 changed the title Fixing the example of blurred card in docs (docs): Fixing the example of blurred card Sep 11, 2024
@macci001 macci001 force-pushed the macci001/correcting-blured-card-example branch from 1221938 to cf52c8a Compare September 11, 2024 08:50

<CodeDemo isGradientBox title="Blurred Card" files={cardContent.blurred} />

**Note**: While trying out the above example, it is required to provide the necessary background to any ancestor element of the Card component to obtain the `blur` effect as seen in the preview.
Copy link
Member

Choose a reason for hiding this comment

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

I think we may add a simple example here. It's a bit confusing for the necessary background.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A small clarification here:

  • By Example, do you mean to add some code in the note?

Copy link
Member

Choose a reason for hiding this comment

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

just an example of the necessary background.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ack, got it.

@wingkwong wingkwong changed the title (docs): Fixing the example of blurred card refactor(docs): example of blurred card Sep 11, 2024
@macci001
Copy link
Contributor Author

macci001 commented Sep 15, 2024

Added the example for necessary background @wingkwong

@wingkwong wingkwong self-assigned this Sep 16, 2024
@wingkwong wingkwong added this to the v2.5.0 milestone Sep 16, 2024
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] - Card - Blurred Card not effective
2 participants