Skip to content

Conversation

@williamjstanton
Copy link
Collaborator

Summary

As part of making accessibility a "first class citizen" in Canvas docs, we will be pulling any technical information for developers off of the design site, and into the Canvas repository.

FormField, TextInput, and TextArea are my next focus.

Release Category

Documentation

Checklist

For the Reviewer

  • PR title is short and descriptive
  • PR summary describes the change (Fixes/Resolves linked correctly)
  • PR Release Notes describes additional information useful to call out in a release message or removed if not applicable
  • Breaking Changes provides useful information to upgrade to this code or removed if not applicable

Where Should the Reviewer Start?

modules/react/form-field/stories/FormField.mdx
modules/react/text-input/stories/TextInput.mdx
modules/react/text-area/stories/TextArea.mdx

Important notes about using InputGroup:

modules/react/text-input/stories/examples/Icons.tsx
modules/react/form-field/stories/examples/HiddenLabel.tsx

A really cool new example debouncing an AriaLiveRegion:

modules/docs/mdx/accessibility/AriaLiveRegions.mdx
modules/docs/mdx/accessibility/examples/AriaLiveRegions/CommentBoxWithCharLimit.tsx

Areas for Feedback? (optional)

  • Code
  • Documentation
  • Testing
  • Codemods

Testing Manually

Screenshots or GIFs (if applicable)

For the InputGroup examples, make sure the text input fields are properly associated to their label elements. (Previously, the id attribute values were incorrectly being set on the InputGroup container element.)

Thank You Gif (optional)

William Stanton added 7 commits November 19, 2025 15:13
Reducing redundancy in the Error & Caution docs. Making FormField the single source of truth.
Discovering we can't use 'as={InputGroup}' on 'FormField.Input' component because it breaks assumptions about which elements to apply input id value for the label.
@cypress
Copy link

cypress bot commented Nov 26, 2025

Workday/canvas-kit    Run #9969

Run Properties:  status check passed Passed #9969  •  git commit f3a9a4f1a0 ℹ️: Merge 4da4baf3eb1f48664db120184d16ccdbe68012b3 into bde1183f9ea0cf8610dce15036eb...
Project Workday/canvas-kit
Branch Review william-docs-form-fields
Run status status check passed Passed #9969
Run duration 02m 25s
Commit git commit f3a9a4f1a0 ℹ️: Merge 4da4baf3eb1f48664db120184d16ccdbe68012b3 into bde1183f9ea0cf8610dce15036eb...
Committer William Stanton
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 1
Tests that did not run due to a developer annotating a test with .skip  Pending 86
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 850
View all changes introduced in this branch ↗︎
UI Coverage  19.36%
  Untested elements 1539  
  Tested elements 367  
Accessibility  99.33%
  Failed rules  6 critical   5 serious   0 moderate   2 minor
  Failed elements 77  

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR migrates accessibility guidelines for FormField, TextInput, and TextArea components from the design site into the Canvas repository as technical documentation for developers. The changes consolidate error state examples into FormField, fix critical InputGroup label association issues, and add a new debounced AriaLiveRegion example for character count announcements.

  • Reorganized error/caution state documentation to FormField with improved accessibility guidance and "Error:"/"Alert:" prefixes for colorblind users
  • Fixed InputGroup label associations by using useFormFieldModel and hoisting input IDs for proper ARIA labeling
  • Added comprehensive accessibility sections covering autocomplete, mobile keyboards, screen reader experiences, label associations, and character limit best practices

Reviewed changes

Copilot reviewed 18 out of 19 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
modules/react/text-input/stories/examples/Icons.tsx Fixed InputGroup label association by hoisting FormField input ID and rendering InputGroup on FormField.Field
modules/react/text-input/stories/examples/Error.tsx Removed - consolidated into FormField error state documentation
modules/react/text-input/stories/examples/Caution.tsx Removed - consolidated into FormField caution state documentation
modules/react/text-input/stories/TextInput.stories.ts Removed Caution and Error story exports
modules/react/text-input/stories/TextInput.mdx Added comprehensive accessibility section with autocomplete, input types, placeholders, and screen reader guidance
modules/react/text-area/stories/examples/Error.tsx Removed - consolidated into FormField error state documentation
modules/react/text-area/stories/examples/Caution.tsx Removed - consolidated into FormField caution state documentation
modules/react/text-area/stories/TextArea.stories.ts Removed Caution and Error story exports
modules/react/text-area/stories/TextArea.mdx Added accessibility section with character limits, resize constraints, and screen reader guidance
modules/react/form-field/stories/examples/HiddenLabel.tsx Fixed InputGroup label association using same pattern as Icons.tsx
modules/react/form-field/stories/examples/GroupedInputs.tsx Added "Error:" prefix to error messages for colorblind users
modules/react/form-field/stories/examples/Error.tsx Added "Error:" prefix to hint text for better accessibility
modules/react/form-field/stories/examples/Caution.tsx Updated example with "Alert:" prefix and better password strength messaging
modules/react/form-field/stories/FormField.mdx Reorganized accessibility section, added guidance on error prefixes, disabled fields, required fields, and label best practices
modules/docs/mdx/accessibility/examples/AriaLiveRegions/CommentBoxWithCharLimit.tsx New example demonstrating debounced live region announcements for character limits
modules/docs/mdx/accessibility/TestingTableWithFormFields.mdx New documentation for testing tables with form field components
modules/docs/mdx/accessibility/AriaLiveRegions.mdx Replaced TextInputWithLiveError example with debounced character limit example
cypress/component/TextInput.spec.tsx Removed Caution and Error test cases, simplified to test only Basic example
cypress/component/TextArea.spec.tsx Removed Caution and Error test cases, simplified to test only Basic example

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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