Skip to content

feat: add indeterminate state to Checkbox and align with Figma#675

Open
isaquebock wants to merge 6 commits into
devfrom
feat/checkbox-indeterminate
Open

feat: add indeterminate state to Checkbox and align with Figma#675
isaquebock wants to merge 6 commits into
devfrom
feat/checkbox-indeterminate

Conversation

@isaquebock

Copy link
Copy Markdown
Contributor

Summary

  • New indeterminate prop on Checkbox — renders a horizontal-bar visual, sets aria-checked="mixed", and syncs the native input.indeterminate DOM property.
  • data-state on the root: unchecked | checked | indeterminate (legacy data-checked retained for back-compat).
  • Visual alignment with Figma 2027:7311: token rename var(--shape-button)var(--shape-elements) (same value) and borderborder-[0.8px] to match --border-width-default.
  • Storybook: new Indeterminate story; all three stories now bind args so the controls panel drives the component (previously hardcoded).
  • Spec bumped to spec_version: 3 with the new prop, state, and a Theme gap entry for --border-width-default.

Out of scope

  • The pre-existing JS class-presets pattern (violates .claude/rules/styling.md) is not refactored here. It is tech debt to be addressed separately so this PR stays a tight visual/behavior diff.

Test plan

  • pnpm webkit:lint && pnpm webkit:type-check && pnpm webkit:type-coverage
  • pnpm --filter storybook build succeeds.
  • In Storybook → Components / Inputs / Checkbox:
    • Default story: toggle binary, indeterminate, disabled, readonly from the controls panel and see the visual change.
    • Indeterminate story: shows the horizontal-bar visual.
    • Disabled story: both checked + unchecked variants render the disabled tokens.
  • Inspect the DOM on the Indeterminate story → <input aria-checked="mixed"> and input.indeterminate === true.

- new `indeterminate` prop renders a horizontal-bar visual and sets
  `aria-checked="mixed"` plus the native `input.indeterminate` DOM property
- `data-state` exposes `unchecked | checked | indeterminate` on the root
- swap `--shape-button` for `--shape-elements` (same value, vocabulary
  aligned with Select/MultiSelect and the Figma frame)
- adopt the Figma `0.8px` border via `border-[0.8px]` until
  `--border-width-default` lands in DESIGN.md
- new Storybook story `Indeterminate`; all stories now bind `args`
  so the controls panel actually drives the component
- spec bumped to v3 with the new prop, state, and theme gap entry
@isaquebock isaquebock requested a review from a team as a code owner June 26, 2026 00:10
@isaquebock isaquebock marked this pull request as draft June 26, 2026 00:15
@isaquebock isaquebock marked this pull request as ready for review June 26, 2026 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant