Skip to content

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

Open
jamesfan wants to merge 22 commits into
Workday:prerelease/majorfrom
jamesfan:feat/2026-06-15-sc-text-input-area-ff-cp
Open

feat: Implement Sana Canvas Text Input, Text Area, Form Field, and Color Picker#3992
jamesfan wants to merge 22 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 #11099

Run Properties:  status check passed Passed #11099  •  git commit b07a6f77ba ℹ️: Merge 8be501da18afd0b6e957d98cae3f8333a4632fcf into d6ad8e074e3198ed8ea07558a667...
Project Workday/canvas-kit
Branch Review feat/2026-06-15-sc-text-input-area-ff-cp
Run status status check passed Passed #11099
Run duration 02m 22s
Commit git commit b07a6f77ba ℹ️: Merge 8be501da18afd0b6e957d98cae3f8333a4632fcf into d6ad8e074e3198ed8ea07558a667...
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.6%
  Untested elements 1532  
  Tested elements 371  
Accessibility  99.41%
  Failed rules  5 critical   5 serious   0 moderate   2 minor
  Failed elements 72  

@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 on lines +39 to +42
This example applies `data-theme="sana-canvas"` to the wrapping
[Form Field](/components/inputs/form-field/).

<ExampleCodeBlock code={SanaCanvas} />

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.

That's nice adds 👍

};
return (
<div className="App">
<div className="App" data-theme="sana-canvas">

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.

Do we need data-theme="sana-canvas" here?

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.

Turns out we don't.

The InputInteraction example is referenced in preview-react/color-picker/stories/visual-testing/ColorPicker.stories.tsx, but it's excluded from the chromatic: {disable: false} block. I'll remove it.

Comment thread .storybook/routes.js
Comment on lines +87 to +89
'/help/upgrade-guides/canvas-v16-upgrade-guide/': 'guides-upgrade-guides-v16-0-overview--docs',
'/help/upgrade-guides/canvas-v16-upgrade-guide/#tab=visual-changes':
'guides-upgrade-guides-v16-0-visual-changes--docs',

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.

ty for adding that 😎

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.

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.

[cornerShapeStencil.vars.shape]: system.legacy.shape.sm,
width: system.legacy.size.xxs,
height: system.legacy.size.xxs,
borderRadius: system.legacy.shape.sm,

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.

The upgrade guide says Color Picker’s Sana Canvas swatch shape is now 6px, but the implementation uses system.legacy.shape.sm, which resolves to 4px in the installed tokens I checked.

Can we double check this?

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.

there is 2 theme and 2 different values: standard is 4px, but if sana turn on it's 6px

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.

it will be updated with new tokens alpha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-a11y Extra attention from accessibility is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants