feat(input): add helpText and errorText props - #123
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds standardized help and error messaging support to the design-system Input component, updating styling and documentation so product forms can display consistent inline guidance and validation feedback.
Changes:
- Extends
InputwithhelpText,errorText, andcontainerClassName, including error state styling andaria-describedbywiring. - Implements animated error reveal when no help text is present (via
MotionCollapsibleContent). - Updates the Input docs page and adds a React demo component illustrating help/error behavior; bumps
@eqtylab/equalityversion to3.2.0.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/ui/src/components/input/input.tsx | Adds help/error props, ARIA wiring, and error rendering logic. |
| packages/ui/src/components/input/input.module.css | Adds container + error/help/error-list styling for the new UI states. |
| packages/ui/package.json | Bumps package version to reflect the feature addition. |
| packages/demo/src/content/components/input.mdx | Documents helpText/errorText behavior and updates examples/props table. |
| packages/demo/src/components/demo/input.tsx | Adds an interactive demo showing the “help swaps to error” behavior. |
Suppressed comments (2)
packages/ui/src/components/input/input.tsx:90
aria-invalidsupports non-boolean values like"grammar"and"spelling". Setting it fromhasErrorforces it to a boolean and discards any more specific value provided by the caller. Prefer passing through the caller’saria-invalidwhen present, and fall back totruewhenerrorTextis set.
aria-invalid={hasError || undefined}
packages/demo/src/content/components/input.mdx:222
- In the props table, the
errorTexttype is shown asReactNode`, `string[]which reads like two separate types rather than a union. Use a union type so it matches the actual API (ReactNode | string[]).
| `errorText` | Error message below the field. Setting it puts the field in its error state and replaces the help text. An array renders one row per message. | `ReactNode`, `string[]` | — | ❌ |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…cs on error announcement
…cing to boolean Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.
Suppressed comments (1)
packages/ui/src/components/input/input.tsx:92
aria-invalidcurrently gets forced to a boolean when the input is in an error state (aria-invalid={hasError || undefined}), which discards valid ARIA token values like'grammar'/'spelling'if a caller provided them. Preserving those tokens keeps the component standards-compliant while still defaulting totruewhen onlyerrorTextdrives invalid state.
aria-invalid={isMarkedInvalid ? ariaInvalid : hasErrorText || undefined}
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.
Closes: https://linear.app/eqty-lab/issue/MIC-29/add-error-text-string-to-input-component