feat(textarea): add Textarea atom (no variants, sm/md/lg, aria-invalid)#53
Merged
Conversation
Multi-line text input that mirrors Input's chrome — neutral-500 resting border (WCAG 1.4.11), shared focus ring, identical inline padding per size. No `variant` axis (composition Escuela 1, D11): error state via `aria-invalid="true"`, message rendered consumer-side. Three `size` values (sm/md/lg) align inline padding + font-size with Input so a textarea sits flush next to inputs in the same form. Vertical dimension uses `min-height` (~3-4 lines at the size's font-size) plus `resize: vertical` so users can drag to grow it; consumers can override via `style.resize`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Tip All tests passed and all changes approved!🟢 UI Tests: 7 visual and accessibility changes accepted as baselines |
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.
Summary
Adds the
Textareaatom — multi-line text input that completes the form-control sibling pair started byInput(0.6.0). Same chrome (border tone, focus ring, inline padding per size,aria-invaliderror state), same composition philosophy (Escuela 1 / D11: noerror/helperText/ icon-slot props on the atom; the consumer composes<label>, helper, and error message — the future<Field>molecule will encapsulate that pattern).sizevalues (sm/md/lg). Inline padding andfont-sizeper size are identical toInput's, so a<Textarea>lines up flush with<Input>controls in the same form.min-height(~3-4 lines at the size's font-size) instead of a fixedheight.resize: verticallets the user drag the bottom edge to grow it; consumers can override viastyle.resizeif needed.aria-invalid="true"(CSS reacts to the attribute selector), matching shadcn / Base UI / Mantine and the Input atom.useRenderpolymorphism —<textarea>has no meaningful render-as use-case, same reasoning as Input.--pharos-color-neutral-500(~5.4:1 vs white) — same WCAG 1.4.11 fix that landed for Input / Button-secondary / Badge-outline in0.6.0.API
TextareaProps extends ComponentProps<'textarea'>plus the typedsizeaxis. No native attribute is shadowed (unlike Input, which reuses thesizeslot —<textarea>has no nativesizeattribute).Storybook
Components/Textarea: Playground, Default, Disabled, ReadOnly, Invalid (aria-invalid), WithLabel (composition pattern), Matrix (sizes × states grid).Test plan
pnpm typecheck— clean.pnpm lint— clean.pnpm format:check— clean.pnpm build— Vite library build +verify:dist-typessmoke pass.pnpm test— 79 tests across 6 files, 0 failures (10 new Textarea tests).Textareastory snapshots.Out of scope
alexandria-web-application— separate PR, opens after this one publishes (0.8.0) and after currently open Alexandria PRs are settled. The sharedformFieldBaseClasses+Textarea.tsxlocal component are the swap target.<Field>molecule that wires<label>+<Textarea>+ helper / error message slot. Planned post-Select / SearchSelect.field-sizing: contentauto-grow — interesting CSS proposal but not yet broadly supported; deferred.🤖 Generated with Claude Code