TextInput: text size ignores `size`; add a `text-input-control` target
Version: @astryxdesign/core 0.5.2, @astryxdesign/theme-neutral 0.5.2
What I'm seeing
size="sm" | "md" | "lg" on TextInput changes the height of the control (24 / 32 / 40px via --size-element-*) and nothing else. The typed text and the placeholder stay at --text-body-size (14px in neutral) in all three. A sm input is therefore body-size text squeezed into a 24px box, and an lg input is the same 14px text floating in a 40px box.
TextArea behaves the same way: sm and md add no styles to the control at all, lg only adds vertical padding.
Quick repro:
<TextInput size="sm" label="Search" placeholder="Search vehicles…" />
<TextInput size="md" label="Search" placeholder="Search vehicles…" />
<TextInput size="lg" label="Search" placeholder="Search vehicles…" />
Inspect the three <input> elements: computed font-size is identical.
What I'd expect
Two options, in order of preference:
-
Let typography follow
size. Something likesm → --font-size-sm,md → --font-size-base,lg → --font-size-lg, so a compact toolbar search and a hero form field don't share the exact same type. The field label already adapts to the size, so the control is the odd one out. -
If keeping the type fixed is intentional, expose a
text-input-controltheme target on the inner<input>, the way 0.5.1 addedtext-area-controlforTextArea. Right now the only reachable targets aretext-input(the wrapper),fieldandfield-label. Setting a font size on the wrapper does nothing because the control sets its own, so a theme has no sanctioned way to adjust this per size. With the target we could decide the scale in our own theme and leave the default alone.
Thanks for raising this — size intentionally controls TextInput’s control height, not its text size, so fixed typography across sm / md / lg is expected rather than a bug.
The theming gap is valid. In the current render, the native <input> paints both entered text and placeholder and directly sets font-family, font-size, and line-height; the existing text-input target is on the outer painted wrapper, so it does not own those declarations.
The smallest spec-compliant fix is to first add that native control to TextInput’s public anatomy and define its theming disposition in a TextInput component spec, then place the resulting target on the <input> and route its typography through that target. The exact anatomy/target name is not currently settled—TextInput has no component spec mapping this part—so that name needs owner/spec definition rather than being inferred here. size should remain dimensional.
Acceptance criteria:
- Default typography and all current
sizeheights remain unchanged. - A custom theme can change the control typography through the defined anatomy target, with entered text and placeholder remaining coherent across focus, disabled, read-only, and validation states.
- Component docs/spec, target metadata, runtime target placement, and focused tests demonstrate the contract.
Is the anatomy backfill something outside contributors should pick up, or is it maintainer-run?
The blocker here looks like TextInput having no component spec, so there is nowhere to record a disposition for the native control.
I found the backfill noted in architecture:component-theming-surface ("Forty-three participating Core component docs have no anatomy inventory"), and docs/README.md says draft-only records pass the owner-approval status after validation, but I could not find anything on who is expected to do the backfill, and every *.spec.md so far has come from the team.