Skip to content

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

Merged
adamkudrna merged 1 commit into
masterfrom
bc/state-collection
Oct 26, 2026
Merged

adamkudrna merged 1 commit 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
Preview removed because the pull request was closed.
2026-10-26 14:48 UTC

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 Resolved
Comment thread src/styles/theme-constants/_colors.scss Resolved
Comment thread src/styles/settings/_form-fields.scss Resolved
Comment thread src/components/Toggle/README.md Resolved
@adamkudrna
adamkudrna merged commit ad20a03 into master Oct 26, 2026
14 checks passed
@adamkudrna
adamkudrna deleted the bc/state-collection branch October 26, 2026 14:48

This branch was successfully deployed

1 active deployment
pr-preview/pr-776 — 89a611dc Deployed Oct 26, 2026 by adamkudrna via Deploy PR Preview #149
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