Skip to content

Introduce State collection and rename validationState prop to state (#723) - #776

Open
adamkudrna wants to merge 2 commits into
masterfrom
bc/state-collection
Open

adamkudrna wants to merge 2 commits into
masterfrom
bc/state-collection

Conversation

@adamkudrna

@adamkudrna adamkudrna commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

Adds a changed state to form fields, as proposed in the ADR in #735. Validation states become a State collection (valid, invalid, warning, changed), with InputGroup priority invalid > warning > changed > valid.

Breaking changes

  • The validationState prop is renamed to state, and the ValidationState type to State.
  • Form field states use new --rui-color-state-* tokens instead of Feedback colours. The defaults look the same, but themes that recolour form fields through --rui-color-feedback-* need to override --rui-color-state-* instead.
  • The Colors page anchor #validation-states is now #states.

--rui-FormField--<STATE>--* token names are unchanged. The bundle size limit is raised to 470 kB.

📸 Don't be scared by the file count: 323 of the 393 changed files are snapshots. 255 of them are only renamed (validationState: → state: in test names) and are byte-identical to master. The other 68 are new and cover changed and the InputGroup priority.

Closes #723

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://react-ui-org.github.io/react-ui/pr-preview/pr-776/

Built to branch gh-pages at 2026-10-19 19:48 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

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.

🟢 Approval recommended

The API migration is consistent, state priority matches the ADR, and comprehensive visual coverage includes the new behavior.

0 open findings

What changed in this PR

Introduces the State collection, adds the changed form-field state, and completes the breaking rename from validationState to state.

Changes:

  • Adds state-specific types, colors, styling, and documentation.
  • Migrates supported form components and exports to the new API.
  • Implements and tests InputGroup state priority.
File Description
src/​types/​*, src/​index.ts Replaces ValidationState with State.
src/​styles/​**, src/​theme.scss Defines state tokens and form-field styling.
src/​components/​_helpers/​* Maps states to CSS classes.
src/​components/​{CheckboxField,FileInputField,FormLayout,Radio,SelectField,TextArea,TextField,Toggle}/​** Migrates component APIs and adds changed-state support.
src/​components/​InputGroup/​** Implements state aggregation and priority tests.
src/​components/​TextLink/​README.md Updates state documentation link.
src/​docs/​** Documents the collection, colors, and theming.
tests/​playwright/​** Replaces shared validation-state cases with state cases.
Component snapshot suites Updates renamed snapshots and adds changed-state coverage.
webpack.config.js Raises the production bundle limit.
.claude/​rules/​frontend.md Updates the shared-type guidance.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@bedrich-schindler bedrich-schindler 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.

I will review rest when we clarify conflicts between state and validation state. Generally, implementation seems fine, but I am not still sure whether we want to call it state, validation state or what. It is a now mixture of both. If we want to call it state, everything must be migrated. Let's clarify this to me at each comment. If needed, you can call me on Slack on mobile to speed the process up

Comment thread src/styles/theme/_form-fields.scss Outdated
Comment thread src/styles/theme-constants/_colors.scss Outdated
Comment thread src/styles/settings/_form-fields.scss Outdated
Comment thread src/components/Toggle/Toggle.module.scss Outdated
Comment thread src/components/Toggle/README.md

This branch was successfully deployed

1 active deployment
pr-preview/pr-776 — 5f1b5e8d Deployed Oct 19, 2026 by adamkudrna via Deploy PR Preview #141
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BC Breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

changed state for input fields

4 participants