Skip to content

feat(input): add helpText and errorText props - #123

Merged
tmccoy14 merged 3 commits into
mainfrom
feat/MIC-29
Aug 13, 2026
Merged

feat(input): add helpText and errorText props#123
tmccoy14 merged 3 commits into
mainfrom
feat/MIC-29

Conversation

@tmccoy14

Copy link
Copy Markdown
Contributor

@tmccoy14
tmccoy14 requested review from Shrinks99 and a lite review from Copilot August 13, 2026 18:08
@tmccoy14 tmccoy14 self-assigned this Aug 13, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Input with helpText, errorText, and containerClassName, including error state styling and aria-describedby wiring.
  • 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/equality version to 3.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-invalid supports non-boolean values like "grammar" and "spelling". Setting it from hasError forces it to a boolean and discards any more specific value provided by the caller. Prefer passing through the caller’s aria-invalid when present, and fall back to true when errorText is set.
            aria-invalid={hasError || undefined}

packages/demo/src/content/components/input.mdx:222

  • In the props table, the errorText type is shown as ReactNode`, `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.

Comment thread packages/ui/src/components/input/input.tsx
Comment thread packages/demo/src/content/components/input.mdx Outdated
…cing to boolean

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-invalid currently 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 to true when only errorText drives invalid state.
            aria-invalid={isMarkedInvalid ? ariaInvalid : hasErrorText || undefined}

@tmccoy14
tmccoy14 merged commit f4bf780 into main Aug 13, 2026
1 check passed
@tmccoy14
tmccoy14 deleted the feat/MIC-29 branch August 13, 2026 18:25
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.

2 participants