Repository navigation
feat(theme): align the input recipes with the Open Components Input page - #367
Merged
alexgrozav merged 4 commits intoOct 29, 2026
Merged
Conversation
The field surface now meets the Input page's stylesheet rules. The focus ring is color.focus in every state, and invalid shows through the error border and an inset shadow. The wrapper reads aria-invalid, readonly and disabled from the nested input through :has(), hover styles sit behind hover-capable, and sizes get a min-height. On touch screens the input's text is at least 16px with a 44px hit area. Disabled fields turn GrayText in forced colors, and borders use the text color with more contrast. The placeholder, prefix and suffix take the field's text color at 75%, the prefix and suffix use logical padding, the read-only state keeps the fill, and light and dark ghost fields take their own fill on a page of the other mode, so text keeps 4.5:1 in both themes. Textarea, input-date and the OTP cell share the surface and get the same changes.
The prefers-contrast override wrote the --color--gray-450 and --color--gray-500 names by hand, so an instance with its own variable naming kept the faint borders. It now sets the two variables through variable(), which follows the instance's naming.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…ld docs The 16px touch-screen text sat on every field's nested control, so on the Input Date it grew only the separators. It now sits in the Input recipe beside the touch hit area. The Input Date and OTP pages, the Input page and the changeset no longer claim a red invalid ring, a primary ring on the wrapper or a ghost without a fill, and each story's input has its own id.
The large field is already taller than the input's 44px hit area, so the docs and the recipe comment no longer say it reaches past the field, and the story comment says the docs page shows the primary story's id twice.
7 of 13 tasks
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The Input recipes now do their part of every stylesheet rule on the Open Components Input page. Most of the change is in the shared field factory (
createFieldRecipe.ts), so the Textarea, Input Date and OTP cell recipes get it too.@color.focusin every state. An invalid field no longer turns the ring red: it shows through the error border, doubled by a 1px inset shadow so the field doesn't grow.invalid,readonlyanddisabledaxes, the wrapper reads the nested input's ownaria-invalid="true",readonlyanddisabledattributes through.input:has(> .input-field[…]). Nothing styles:invalidor:read-only.&:hover-capable:hover, and the dark ones behind&:dark:hover-capable:hover.min-heightin rem. On touch screens the input's text is at least 16px, and the input reaches past the field to a 44px hit area through a transparent border pulled back by a negative margin, so nothing moves.Highlightand a disabled field turnsGrayTextat full opacity. Withprefers-contrast: more, the two gray levels the borders use resolve to the text colour inside the field, so every border is drawn at full strength in every state.color-mix), which keeps 4.5:1 on every colour, variant and mode. The read-only state keeps the fill instead of tinting it, and thelightanddarkghost fields take their own fill on a page of the other mode, since their text sat on a page of the same lightness before (about 1:1).padding-inline-endandpadding-inline-start.fieldSurfaceContrast.test.tsnow checks the value, the muted text, every border, the invalid border and the focus ring in both themes, anduseInputRecipe.test.tshas one test per rule, named by its rule ID. The Storybook stories have a visible label for every input, an error message linked to the invalid one, and a Focus story. The docs page's Accessibility section says what the recipe does for each group of rules.Related issue
Part of aligning the component recipes with the Open Components standard.
Type of change
Checklist
feat(theme): …)pnpm build:nodocs && pnpm lint && pnpm typecheck && pnpm testand everything passes (ran per package instead: the theme's typecheck, tests and build, the Storybook build and itsvue-tsccount, the docs build andtest:build, and oxlint and oxfmt on the touched files)pnpm changeset) for changes to publishable packages, or this change only touches docs/storybook/app/playground/testsdist/,.styleframe/)mainand stays focused in scope (it targets the integration branchalign-component-styles-uxf-487)Notes / screenshots
fieldSurfaceCompoundVariantsdrops itsfocusModifieroption, which only set the red invalid ring, andcreateFieldAddonRecipetakespaddingInlineStartorpaddingInlineEnd. That is whyuseOtpCellRecipe.tsand the textarea prefix and suffix files change by one line each.@color.primaryring is left as it is.