-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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 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. 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe pull request involves the removal of the Changes
Possibly related PRs
Suggested Labels
Suggested Reviewers
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
CodeRabbit Configuration File (
|
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 (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 onpossibleClasses
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
📒 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.
Summary by CodeRabbit
Styling Changes
.theme-light
CSS class from global stylesheet.theme-light
tobg-white theme-default
.Documentation
New Features