Skip to content

feat: Implement Sana Canvas Text Input, Text Area, Form Field, and Color Picker - #3992

Merged
alanbsmith merged 30 commits into
Workday:prerelease/majorfrom
jamesfan:feat/2026-06-15-sc-text-input-area-ff-cp
Jun 30, 2026
Merged

feat: Implement Sana Canvas Text Input, Text Area, Form Field, and Color Picker#3992
alanbsmith merged 30 commits into
Workday:prerelease/majorfrom
jamesfan:feat/2026-06-15-sc-text-input-area-ff-cp

Conversation

@jamesfan

@jamesfan jamesfan commented Jun 15, 2026

Copy link
Copy Markdown
Member

Summary

Fixes: #3983

Release Category

Components


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

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features
    • Added Sana Canvas theme examples and Storybook stories for Color Input/Picker, Form Field, Text Area, and Text Input.
    • Added dedicated Storybook routes for the v16 upgrade guide visual changes tab.
  • Style
    • Updated corner rounding/spacing across TextInput, Form Field group lists, and color swatches for a more consistent look.
    • Refined error/caution visuals by removing background fills while preserving existing border/box-shadow and interaction styling.
  • Documentation
    • Expanded the v16 upgrade guide with detailed visual update notes and Sana Canvas theme guidance.
  • Tests
    • Updated visual testing stories to explicitly render with the Sana Canvas theme.

@jamesfan
jamesfan requested a review from a team as a code owner June 15, 2026 18:20
@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

TextInput, FormFieldGroupList, and ColorSwatch now use corner-shape stencil styling and updated status-state backgrounds. Sana Canvas story, example, and visual-testing coverage were added across input components, and the v16 upgrade guide now includes component notes.

Changes

Sana Canvas input styling and docs

Layer / File(s) Summary
Component stencil updates
modules/react/text-input/lib/TextInput.tsx, modules/react/form-field/lib/FormFieldGroupList.tsx, modules/react/color-picker/lib/parts/ColorSwatch.tsx
TextInput, FormFieldGroupList, and ColorSwatch switch base corner styling to corner-shape stencil values, remove status background colors from error and caution variants, and update TextInput grow modifier selection.
Sana Canvas stories and examples
modules/preview-react/color-picker/stories/*, modules/react/color-picker/stories/*, modules/react/form-field/stories/*, modules/react/text-area/stories/*, modules/react/text-input/stories/*
Adds Sana Canvas themed examples, Storybook stories, MDX usage sections, and visual-testing theme attributes for Color Picker, Form Field, Text Area, and Text Input.
Upgrade guide and route mappings
.storybook/routes.js, modules/docs/mdx/16.0-UPGRADE-GUIDE.mdx
Adds Storybook routes for the Canvas v16 upgrade guide and fills in the guide with theme notes plus component-specific visual update entries.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related issues

Possibly related PRs

Suggested labels

ready for review

Suggested reviewers

  • RayRedGoose
  • sheelah

Poem

🐇 Soft corners bloom in Sana light,
The swatches shine, the storiesाइट?
The guide now hums of shapes anew,
And canvas themes come shining through.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning [#3983] Text Area token/style updates are missing; only docs, stories, and examples were added for it. Add the TextArea component style changes for color and corner radius tokens, then re-run visual and Storybook checks.
Out of Scope Changes check ⚠️ Warning The v16 upgrade guide content and Storybook route additions are unrelated to #3983's component token/style work. Move the upgrade guide content and route mappings to a separate docs PR unless they are required for #3983.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: Sana Canvas updates for Text Input, Text Area, Form Field, and Color Picker.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cypress

cypress Bot commented Jun 15, 2026

Copy link
Copy Markdown

Workday/canvas-kit    Run #11133

Run Properties:  status check passed Passed #11133  •  git commit 9f5142c8b7 ℹ️: Merge e00709522f7ae3ae54397629809b3c3b92083ce6 into 68776ccf39d441a37b4692f52fd6...
Project Workday/canvas-kit
Branch Review feat/2026-06-15-sc-text-input-area-ff-cp
Run status status check passed Passed #11133
Run duration 02m 23s
Commit git commit 9f5142c8b7 ℹ️: Merge e00709522f7ae3ae54397629809b3c3b92083ce6 into 68776ccf39d441a37b4692f52fd6...
Committer James Fan
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 17
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 809
View all changes introduced in this branch ↗︎
UI Coverage  19.51%
  Untested elements 1541  
  Tested elements 371  
Accessibility  99.41%
  Failed rules  5 critical   5 serious   0 moderate   2 minor
  Failed elements 71  

@jamesfan
jamesfan force-pushed the feat/2026-06-15-sc-text-input-area-ff-cp branch from d51ca0b to b3f1b31 Compare June 15, 2026 23:07
@RayRedGoose RayRedGoose added the needs-a11y Extra attention from accessibility is needed label Jun 24, 2026

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@modules/docs/mdx/16.0-UPGRADE-GUIDE.mdx`:
- Around line 120-124: Remove the duplicated grouped-input padding guidance in
the upgrade guide so the migration note only appears once. In the MDX section
covering grouped inputs, consolidate the two bullets into a single statement
that keeps the new 8px block and 4px inline values along with the “previously”
values, and delete the redundant duplicate wording.

In
`@modules/preview-react/color-picker/stories/visual-testing/ColorPicker.stories.tsx`:
- Around line 28-60: The top-level fragment returned by the theme .map() in
ColorPicker.stories.tsx is missing a React key, which causes the warning. Update
the mapped wrapper around StaticStates and ComponentStatesTable from the
shorthand fragment to React.Fragment with an explicit key derived from the theme
value (including the undefined case), so each rendered block is uniquely
identified.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 4f4b261d-e71f-4184-b9d8-d0694ed47df6

📥 Commits

Reviewing files that changed from the base of the PR and between cfea945 and f7805dd.

📒 Files selected for processing (5)
  • modules/docs/mdx/16.0-UPGRADE-GUIDE.mdx
  • modules/preview-react/color-picker/stories/visual-testing/ColorPicker.stories.tsx
  • modules/react/color-picker/lib/parts/ColorSwatch.tsx
  • modules/react/form-field/lib/FormFieldGroupList.tsx
  • modules/react/text-input/lib/TextInput.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • modules/react/form-field/lib/FormFieldGroupList.tsx

Comment thread modules/docs/mdx/16.0-UPGRADE-GUIDE.mdx Outdated
Comment thread modules/preview-react/color-picker/stories/visual-testing/ColorPicker.stories.tsx Outdated
Comment on lines +124 to +128
textInputStencil({
width: typeof width === 'number' ? px2rem(width) : width,
grow: grow === true ? 'true' : grow === false ? 'false' : undefined,
error,
})

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This fix addresses a TypeScript issue which appeared after introducing extends cornerShapeStencil:

Image

Explanation of the fix from Cursor:

Image

And why the error only happened after introducing extends cornerShapeStencil:

Image

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

connected to #3896, I'll talk to Alan about that the next week ☺️

Comment on lines +124 to +128
textInputStencil({
width: typeof width === 'number' ? px2rem(width) : width,
grow: grow === true ? 'true' : grow === false ? 'false' : undefined,
error,
})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we need to fix that issue finally :D I'll talk to Alan about that when he is back

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@modules/react/color-picker/stories/color-preview/ColorPreview.stories.ts`:
- Around line 33-35: The SanaCanvas story is using the wrong renderer, so it
does not exercise the Sana Canvas variant. Update the SanaCanvas export in
ColorPreview.stories.ts to point to the correct story render function/component
instead of RefForwardingExample, and verify the story name remains aligned with
the intended Sana Canvas preview.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: afa65cb7-5443-4f64-a9a3-601e7958b6db

📥 Commits

Reviewing files that changed from the base of the PR and between f7805dd and 09245e9.

📒 Files selected for processing (23)
  • .storybook/routes.js
  • modules/docs/mdx/16.0-UPGRADE-GUIDE.mdx
  • modules/preview-react/color-picker/stories/examples/InputInteraction.tsx
  • modules/preview-react/color-picker/stories/visual-testing/ColorPicker.stories.tsx
  • modules/react/color-picker/stories/color-input/ColorInput.mdx
  • modules/react/color-picker/stories/color-input/ColorInput.stories.ts
  • modules/react/color-picker/stories/color-input/examples/SanaCanvas.tsx
  • modules/react/color-picker/stories/color-preview/ColorPreview.mdx
  • modules/react/color-picker/stories/color-preview/ColorPreview.stories.ts
  • modules/react/color-picker/stories/color-preview/examples/SanaCanvas.tsx
  • modules/react/color-picker/stories/visualTesting.stories.tsx
  • modules/react/form-field/stories/FormField.mdx
  • modules/react/form-field/stories/FormField.stories.ts
  • modules/react/form-field/stories/examples/SanaCanvas.tsx
  • modules/react/form-field/stories/visualTesting.stories.tsx
  • modules/react/text-area/stories/TextArea.mdx
  • modules/react/text-area/stories/TextArea.stories.ts
  • modules/react/text-area/stories/examples/SanaCanvas.tsx
  • modules/react/text-area/stories/visualTesting.stories.tsx
  • modules/react/text-input/stories/TextInput.mdx
  • modules/react/text-input/stories/TextInput.stories.ts
  • modules/react/text-input/stories/examples/SanaCanvas.tsx
  • modules/react/text-input/stories/visualTesting.stories.tsx
✅ Files skipped from review due to trivial changes (3)
  • modules/react/color-picker/stories/color-preview/examples/SanaCanvas.tsx
  • modules/preview-react/color-picker/stories/examples/InputInteraction.tsx
  • modules/react/color-picker/stories/visualTesting.stories.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • modules/docs/mdx/16.0-UPGRADE-GUIDE.mdx

Comment thread modules/react/color-picker/stories/color-preview/ColorPreview.stories.ts Outdated
Comment thread modules/react/text-input/stories/TextInput.mdx Outdated
Comment thread modules/preview-react/color-picker/stories/examples/InputInteraction.tsx Outdated
Comment thread .storybook/routes.js
width: system.legacy.size.xxs,
height: system.legacy.size.xxs,
borderRadius: system.legacy.shape.sm,
backgroundColor: color,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Medium: ColorSwatch does not preserve color meaning in Windows High Contrast / forced-colors mode. Since the swatch’s semantic value is its actual color, backgroundColor: color will likely be remapped by forced-colors, causing swatches to appear identical. Consider forcedColorAdjust: 'none' for the swatch color surface, plus a real border/outline fallback for white/selected states since box-shadow is forced to none.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@williamjstanton This should be addressed now. I've added forcedColorAdjust: 'none' to the swatch color surface as well as the outline fallback.

width: 'fit-content',
},
modifiers: {
error: {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Medium: Error/caution visual affordances rely heavily on boxShadow, which is removed in forced-colors mode. For TextInput, TextArea inherits this behavior; for grouped fields, the group ring is entirely shadow-based. Add @media (forced-colors: active) fallbacks using real border/outline and system colors so Windows High Contrast users can still perceive invalid/caution states.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@williamjstanton I'm consulting the MDN docs for system colors. Which color would you recommend I use for error and caution states?

For example, ActiveText is visually similar to our standard error color (red), but doesn't line up semantically (i.e., the form field error has nothing to do with the "text of active links").

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@williamjstanton Also, it wasn't quite clear from your original comment, but is it ok to leave TextInput and TextArea as-is given they both still have a border in the error and caution states?

@williamjstanton williamjstanton Jun 26, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@williamjstanton I'm consulting the MDN docs for system colors. Which color would you recommend I use for error and caution states?

For example, ActiveText is visually similar to our standard error color (red), but doesn't line up semantically (i.e., the form field error has nothing to do with the "text of active links").

This is a really good question, and I don't know. There isn't any semantically correct option available at all. The recommendation is to use border differentiation like double but I don't think it is necessary in the case of FormFieldGroupList. I think we could try a simple transparent border or outline as a fallback?

.form-field.error {
  border: 2px solid red; /* Standard mode color */
}
@media (forced-colors: active) {
  .form-field.error {
    /* Use a thicker or distinct border style with standard system colors */
    border: 4px double ButtonBorder; 
  }

@jamesfan jamesfan Jun 26, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'm using outline to prevent layout shifts since FormFieldGroupList doesn't have a border to begin with. My plan was to maintain a similar thickness to the boxShadow for the outline:

error: {
  boxShadow: `inset 0 0 0 ${px2rem(2)} ${system.legacy.color.brand.border.critical}`,
  '@media (forced-colors: active)': {
    outline: `solid ${px2rem(2)} ActiveText`,
  },
},

I can double the thickness, however. Out of curiosity, what's the rationale behind differentiating the border if forced-colors is active?

Also, did you mean to use ButtonBorder (presents as black to me in macOS) in your example snippet?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Also, did you mean to use ButtonBorder (presents as black to me in macOS) in your example snippet?

Really? Presents as black? I'd assumed it would present as white on a dark background. I'll definitely need to test on a real Windows machine.

Rationale: Since we can't use color to differentiate a border on an input that already uses a border in a valid state (e.g. TextInput), that's where it is useful to use more thickness or a double style to differentiate the error states from valid states.

I don't think that rationale applies in this situation with the group list. (Because the border / outline / boxShadow is absent in valid state.)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@williamjstanton Apologies, I was confused. I didn't realize Windows High Contrast mode was an example of a forced colors mode (I thought the two could be toggled independently of one another. ButtonBorder presented as black to me in macOS because I obviously wasn't on Windows High Contrast mode.

Appreciate the explanation. The original issue should be resolved:

  • I've added the fallback outline to the grouped fields error and caution states. I used the same width as the boxShadow used in the error/caution states since there is no border/outline/boxShadow in the valid state.
  • I've added the fallback outline to TextInput and TextArea. It displays at double the width of the focus ring to differentiate it from the focus ring (I did not want to modify the focus ring styling).

Comment thread modules/react/color-picker/lib/parts/ColorSwatch.tsx
@jamesfan jamesfan added the ready for review Code is ready for review label Jun 26, 2026
Comment thread modules/react/text-input/stories/visualTesting.stories.tsx Outdated
color,
iconColor: pickForegroundColor(color),
withShadow: showCheck || lowerCasedColor === '#ffffff',
withShadow: showCheck || lowerCasedColor === '#ffffff' ? 'true' : undefined,

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fix for same issue described here.

@RayRedGoose RayRedGoose added approved Code has been reviewed and approved (ship it) and removed ready for review Code is ready for review needs-a11y Extra attention from accessibility is needed labels Jun 30, 2026

@RayRedGoose RayRedGoose left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM 👍

@williamjstanton williamjstanton left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for all the hard work on this, looks like the high contrast mode fixes are working well.

@jamesfan

Copy link
Copy Markdown
Member Author

@RayRedGoose will update FormFieldGroupList padding in #4017.

To keep things moving, I've reverted the padding changes in this PR. For reference, I also reverted the following addition to the Form Field > Visual Updates section in the v16 Upgrade Guide:

- Block padding for grouped inputs is now **8px** (previously **10px** and **8px**). Inline padding
  for grouped inputs is now **4px** (previously **12px**). Again, this padding is primarily visible
  for error and caution states.

@alanbsmith
alanbsmith merged commit 66f2f81 into Workday:prerelease/major Jun 30, 2026
29 of 31 checks passed
@jamesfan
jamesfan deleted the feat/2026-06-15-sc-text-input-area-ff-cp branch June 30, 2026 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Code has been reviewed and approved (ship it) automerge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants