Skip to content

fix(theme): align the radio recipes with the Radio Group standard - #371

Merged
alexgrozav merged 2 commits into
align-component-styles-uxf-487from
radio-group-standard-uxf-498
Oct 29, 2026
Merged

alexgrozav merged 2 commits into
align-component-styles-uxf-487from
radio-group-standard-uxf-498

Conversation

@alexgrozav

@alexgrozav alexgrozav commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Description

Brings useRadioRecipe, useRadioFieldRecipe and useRadioGroupRecipe in line with the stylesheet rules of the Open Components Radio Group page, with one test per rule named after its ID:

  • Contrast. Unchecked rings move from gray-300/gray-600 to gray-450/gray-500, so they keep 3:1 against the page and their fill in light and dark mode, the light and dark colours included. radioGroupContrast.test.ts checks every colour in both modes, plus the checked fill, the dot, the invalid ring, the focus ring, and the legend, hint and error text at 4.5:1.
  • Focus. The ring is @color.focus, 2px solid with a 2px offset, and Highlight in forced colours mode.
  • Size. The circle is sized in rem and has no margin, and each label row has a min-height in rem (2rem, 2.25rem, 2.5rem), with 44px rows under @media (any-pointer: coarse). No state changes a radio's size.
  • Group. The recipe now resets its <fieldset> and styles its <legend>, a data-slot="hint" and a data-slot="error". The group's aria-invalid="true" turns every ring red, with a 1px inset shadow. :invalid is never used.
  • Forced colours and more contrast. In forced colours mode the browser draws its own radio (appearance: auto), so the checked state stays visible, and a disabled label turns GrayText. With prefers-contrast: more, the rings use the field's full-strength colour.

Stories now wrap groups in a <fieldset> with a <legend>. They add focus, hint, invalid and disabled stories, and both docs pages get an updated Accessibility section. No recipe, axis, value, default, export, token or modifier is renamed or removed, so this is a patch.

Related issue

None.

Type of change

  • 🐞 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that changes existing behavior)
  • 📖 Documentation
  • ♻️ Refactor / internal (no functional change)
  • 🔧 Build / tooling / CI

Checklist

  • My commits follow Conventional Commits with a package scope (e.g. feat(theme): …)
  • I ran pnpm build:nodocs && pnpm lint && pnpm typecheck && pnpm test and everything passes
  • I added a changeset (pnpm changeset) for changes to publishable packages, or this change only touches docs/storybook/app/playground/tests
  • I added or updated tests where relevant
  • I updated documentation where relevant
  • I did not edit generated files (dist/, .styleframe/)
  • My PR targets main and stays focused in scope

Notes / screenshots

  • The pre-PR loop ran. Build, lint (217 warnings, the same as the base), typecheck and every package's tests pass, except @styleframe/playground's test/theme.test.ts: its 8 tests fail with localStorage undefined on the base branch as well.
  • This PR targets the integration branch, not main.
  • axe reports 0 violations on all 22 radio and radio group stories, in light and dark.
  • radio-group/input-heights (a Should): the row heights are the standard's Input heights, which are also the Input layer's min-heights. In this branch, Styleframe's Input renders at about 31–33px, 39–40px and 46–49px (its font sizes are fluid), so it lines up with a radio at sm only. Matching that would mean copying the Input's padding and line-box formula into the radio.
  • The group's error text uses @color.error-400 in dark mode, where @color.error falls below 4.5:1. The dark selector is written out in the recipe's setup callback, because setup selectors can't use modifiers.

The radio, radio-field and radio-group recipes now meet the stylesheet rules of the Open Components Radio Group page: a @color.focus ring, rings with 3:1 in both modes, rem sizing with the standard's row heights and 44px rows on touch screens, forced-colors and more-contrast handling, and the group's legend, hint, error and aria-invalid state. Stories use a fieldset with a legend and cover the focus, invalid and disabled states, and both docs pages describe the accessibility behaviour.
@vercel

vercel Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
styleframe-dev Ready Ready Preview Oct 29, 2026 3:11pm UTC
styleframe-dev-storybook Ready Ready Preview Oct 29, 2026 3:11pm UTC

Request Review

@alexgrozav
alexgrozav merged commit 19d445c into align-component-styles-uxf-487 Oct 29, 2026
3 checks passed
@alexgrozav
alexgrozav deleted the radio-group-standard-uxf-498 branch October 29, 2026 18:57

This branch was successfully deployed

2 active deployments
Preview – styleframe-dev — 4a53f4dd Deployed Oct 29, 2026 by vercel[bot]
Preview – styleframe-dev-storybook — 4a53f4dd Deployed Oct 29, 2026 by vercel[bot]
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