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

Remove theme-light and add colors doc to UI kit #1029

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

almsh
Copy link
Contributor

@almsh almsh commented Jan 25, 2025

Summary by CodeRabbit

  • Styling Changes

    • Removed .theme-light CSS class from global stylesheet.
    • Updated theme classes in donation and success pages from theme-light to bg-white theme-default.
  • Documentation

    • Added Storybook story for color system, showcasing theme colors and usage guidelines.
  • New Features

    • Introduced color swatch, theme example, and color section components in Storybook.

Copy link

vercel bot commented Jan 25, 2025

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

Name Status Preview Comments Updated (UTC)
public ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 25, 2025 2:58pm

Copy link

coderabbitai bot commented Jan 25, 2025

Warning

Rate limit exceeded

@almsh has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 24 minutes and 35 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

Reviewing files that changed from the base of the PR and between 01c9d4e and 9378e4b.

📒 Files selected for processing (1)
  • ui/src/stories/colors.stories.tsx (1 hunks)
📝 Walkthrough

Walkthrough

The pull request involves the removal of the .theme-light CSS class definition, which included various custom properties for theming. This change is accompanied by updates in components that previously utilized the .theme-light class, specifically replacing it with bg-white theme-default. Additionally, new Storybook components for visualizing a color system have been introduced, enhancing the organization of color data within the application.

Changes

File Change Summary
ui/src/globals.css Removed .theme-light class definition and its associated CSS custom properties
ui/src/stories/colors.stories.tsx Added new Storybook story components for color system visualization, including ColorSwatch, ThemeExample, ColorSection, and ColorSystem
website/src/.../donate/individual/donation-form.tsx Changed Card component class from theme-light to bg-white theme-default
website/src/.../donate/success/stripe/[session]/page.tsx Updated Card component class from theme-light to bg-white theme-default

Possibly related PRs

Suggested Labels

website

Suggested Reviewers

  • mkue
  • socialincome-dev
  • ssandino

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.

CodeRabbit Configuration 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

@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 (5)
ui/src/stories/colors.stories.tsx (5)

14-18: Add JSDoc comments to document the interface.

Adding documentation will improve maintainability and help other developers understand the purpose of each field.

+/**
+ * Represents color information in the design system
+ */
 interface ColorInfo {
+  /** Display name of the color */
   name: string;
+  /** CSS variable name without the '--' prefix */
   variable: string;
+  /** Optional HSL value in format "H S% L%" */
   hsl?: string;
 }

20-60: Optimize background class lookup.

The find operation on possibleClasses could be replaced with direct string interpolation since we're already listing all possible classes.

-possibleClasses.find((className) => className === `bg-${variable}`),
+`bg-${variable}`

62-91: Make theme mapping more type-safe.

Use a const object to ensure type safety and prevent runtime errors.

-const themeClassName = {
+const THEME_CLASSES = {
   default: 'theme-default',
   blue: 'theme-blue',
-}[theme];
+} as const;
+
+const themeClassName = THEME_CLASSES[theme];

93-102: Add prop types documentation.

Document the component's props to improve maintainability.

+interface ColorSectionProps {
+  /** Section title */
+  title: string;
+  /** Array of colors to display */
+  colors: ColorInfo[];
+  /** Optional additional className */
+  className?: string;
+}
+
-const ColorSection = ({ title, colors, className }: { title: string; colors: ColorInfo[]; className?: string }) => (
+const ColorSection = ({ title, colors, className }: ColorSectionProps) => (

104-241: Add contrast ratio information for color combinations.

Consider adding WCAG contrast ratio information for common color combinations to help developers ensure accessibility compliance.

Example addition to the usage guidelines:

 <li>
   <strong>Text Colors:</strong> Use text-foreground for main text, text-muted-foreground for secondary text
+  <ul className="ml-4 mt-1">
+    <li>text-foreground on bg-background: 4.5:1 contrast ratio (WCAG AA)</li>
+    <li>text-muted-foreground on bg-background: 3.5:1 contrast ratio</li>
+  </ul>
 </li>
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 54f4eaf and 28c5a70.

📒 Files selected for processing (4)
  • ui/src/globals.css (0 hunks)
  • ui/src/stories/colors.stories.tsx (1 hunks)
  • website/src/app/[lang]/[region]/(blue-theme)/donate/individual/donation-form.tsx (1 hunks)
  • website/src/app/[lang]/[region]/(blue-theme)/donate/success/stripe/[session]/page.tsx (1 hunks)
💤 Files with no reviewable changes (1)
  • ui/src/globals.css
✅ Files skipped from review due to trivial changes (2)
  • website/src/app/[lang]/[region]/(blue-theme)/donate/individual/donation-form.tsx
  • website/src/app/[lang]/[region]/(blue-theme)/donate/success/stripe/[session]/page.tsx
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Test website
  • GitHub Check: Prettify
  • GitHub Check: Security checks (typescript)
🔇 Additional comments (1)
ui/src/stories/colors.stories.tsx (1)

1-13: LGTM! Clean imports and metadata setup.

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.

1 participant