fix: refactor checkbox component to update to new DS colors and state - BED-8724#2933
fix: refactor checkbox component to update to new DS colors and state - BED-8724#2933nicole-m-martin wants to merge 15 commits into
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe PR updates checkbox styling and behavior, adds a labeled checkbox wrapper, refreshes Storybook examples, expands test coverage, and enables matching Tailwind tokens for disabled input states. ChangesCheckbox UI and token support
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/javascript/doodle-ui/src/components/Checkbox/Checkbox.stories.tsx`:
- Around line 46-47: The standalone Checkbox stories currently render unlabeled
inputs, so add accessible names to the Default, Disabled, and Error stories in
Checkbox.stories.tsx. Follow the pattern already used by CheckboxWithoutLabel by
passing an aria-label through the story args or render function for each of
those story exports, and keep the change localized to the story definitions for
Default, Disabled, and Error.
In `@packages/javascript/doodle-ui/src/components/Checkbox/Checkbox.tsx`:
- Around line 61-64: Restore the public TypeScript surface by exporting
CheckboxProps again from Checkbox.tsx; the issue is that the props type was made
local during the refactor, breaking downstream type imports even though Checkbox
and CheckboxVariants runtime behavior stayed the same. Update the type
declaration near CheckboxProps so it remains exported, and keep the existing
shape based on React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>
plus size and icon.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: a3cd0e82-a8e3-4489-9e77-61c54d29c857
📒 Files selected for processing (7)
packages/javascript/doodle-ui/src/components/Checkbox/Checkbox.stories.tsxpackages/javascript/doodle-ui/src/components/Checkbox/Checkbox.test.tsxpackages/javascript/doodle-ui/src/components/Checkbox/Checkbox.tsxpackages/javascript/doodle-ui/src/components/Checkbox/index.tspackages/javascript/doodle-ui/src/components/Label/Label.tsxpackages/javascript/doodle-ui/src/tailwind/plugin.tspackages/javascript/doodle-ui/src/tailwind/preset.ts
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/javascript/doodle-ui/src/tailwind/plugin.ts (1)
234-235: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRemove the redundant
--secondaryCSS variable in the dark theme.secondaryalready maps to--secondary-main, and--secondaryisn’t referenced elsewhere in this package; keeping both adds dead, asymmetric state.packages/javascript/doodle-ui/src/tailwind/plugin.ts:234-235🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/javascript/doodle-ui/src/tailwind/plugin.ts` around lines 234 - 235, The dark theme in plugin.ts defines a redundant `--secondary` CSS variable alongside `--secondary-main`, but `secondary` already maps through `--secondary-main` and the extra variable is unused. Remove the `--secondary` entry from the dark theme variable map in the Tailwind plugin while keeping `--secondary-main` as the single source of truth.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@packages/javascript/doodle-ui/src/tailwind/plugin.ts`:
- Around line 234-235: The dark theme in plugin.ts defines a redundant
`--secondary` CSS variable alongside `--secondary-main`, but `secondary` already
maps through `--secondary-main` and the extra variable is unused. Remove the
`--secondary` entry from the dark theme variable map in the Tailwind plugin
while keeping `--secondary-main` as the single source of truth.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: 08b85c58-71cd-49a4-bfab-97a0efd1343e
📒 Files selected for processing (2)
packages/javascript/doodle-ui/src/tailwind/plugin.tspackages/javascript/doodle-ui/src/tailwind/preset.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/javascript/doodle-ui/src/tailwind/preset.ts
Description
Updates the Doodle UI
Checkboxcomponent to support the latest Figma design states and introduces a newCheckboxWithLabelcomponent.Checkbox Figma DS
New Figma Styles:

Motivation and Context
The existing Checkbox component did not fully match the latest Figma design system states and tokens. This update aligns Checkbox with the DS spec and provides a consistent, accessible labeled checkbox foundation for future components like MultiSelect.
Resolves BED-8724
Checkbox
enabled:so they do not effect disabled states.aria-invalidwithenabled:aria-[invalid=true]:*selectors across unchecked, checked, and indeterminate states.disabledbehavior withdisabled:*token styles.sm,md, andlgsize variants to Tailwind shorthand.iconprop for custom indicator icons.CheckboxWithLabel
idwithuseIdwhen one is not provided, ensuring the label is always associated with the checkbox.:has(:focus-visible)so it surrounds both checkbox and label.errorprop that applies label error styling and forwardsaria-invalidto the checkbox.labelClassNameandfieldClassNamefor targeted overrides.How Has This Been Tested?
Tests
CheckboxandCheckboxWithLabel:Checkbox.test.tsxManual QA
Checked existing Doodle Checkbox usages across the app:
Storybook
Screenshots (optional):
Screen.Recording.2026-06-26.at.2.47.31.PM.mov
Types of changes
Checklist:
Summary by CodeRabbit
Summary
New Features
CheckboxWithLabelfor accessible checkbox + label pairing.disabledcontrol.Bug Fixes
aria-invalid.Tests
aria-invalid.Style