Skip to content

fix(FormGroup): add Storybook controls - #22853

Open
Subhom1 wants to merge 1 commit into
carbon-design-system:mainfrom
Subhom1:fix-form-group-storybook-controls-20925
Open

fix(FormGroup): add Storybook controls#22853
Subhom1 wants to merge 1 commit into
carbon-design-system:mainfrom
Subhom1:fix-form-group-storybook-controls-20925

Conversation

@Subhom1

@Subhom1 Subhom1 commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Closes #20925

Adds complete, operable FormGroup Storybook controls in React and Web Components. Public FormGroup properties now have correctly typed defaults and controls, including the outer FormGroup rendered by the Web Components AI-label example.

Changelog

New

  • Added React controls and defaults for class name, disabled state, invalid state, legend ID, legend text, message visibility, and message text.
  • Added Web Components controls and defaults for invalid state, legend ID, legend text, message visibility, and message text.
  • Added outer FormGroup controls to the Web Components AI-label story.

Changed

  • Removed React control filtering that previously hid valid legendId and invalid controls.
  • Limited the React exclusion to the non-editable children prop.
  • Updated Web Components story templates to bind all public FormGroup properties.

Removed

  • None.

Testing / Reviewing

  1. Use the repository Node version and start React Storybook:

    nvm use
    yarn workspace @carbon/react storybook
    
  2. Open Components/FormGroup.

  3. Verify class name, disabled, invalid, legend ID, legend text, message, and message-text controls update the group.

  4. Start Web Components Storybook:

    yarn workspace @carbon/web-components storybook
    
  5. Open the FormGroup Default story and verify invalid, legend ID, legend text, message, and message-text controls.

  6. Open the AI-label story and verify those same FormGroup controls affect the outer group while the existing child-state and AI-label controls continue working.

  7. Run the focused checks:

    yarn jest packages/react/src/components/FormGroup/FormGroup-test.js --runInBand
    yarn workspace @carbon/react storybook:build
    yarn workspace @carbon/web-components storybook:build
    npx --yes serve -l 3000 packages/react/storybook-static
    CI=1 yarn playwright test e2e/components/FormGroup/FormGroup-test.avt.e2e.js --project chromium
    yarn prettier --check packages/react/src/components/FormGroup/FormGroup.stories.js packages/web-components/src/components/form-group/form-group.stories.ts
    

Test Screenshot
Screenshot 2026-08-01 at 1 33 32 a m

PR Checklist

As the author of this PR, before marking ready for review, confirm you:

  • Reviewed every line of the diff
  • Updated documentation and Storybook examples
  • Wrote passing tests that cover this change
  • Addressed any impact on accessibility (a11y)
  • Tested for cross-browser consistency
  • Validated that this code is ready for review and status checks should pass

More details can be found in the [pull request guide](https://github.com/carbon-design-system/carbon/blob/main/docs/guides/reviewing-pull-requests.md).

@Subhom1
Subhom1 requested a review from a team as a code owner August 1, 2026 00:33
@Subhom1
Subhom1 requested review from annawen1 and kennylam August 1, 2026 00:33
@netlify

netlify Bot commented Aug 1, 2026

Copy link
Copy Markdown

Deploy Preview for v3-carbon-web-components ready!

Name Link
🔨 Latest commit 0fbc15c
🔍 Latest deploy log https://app.netlify.com/projects/v3-carbon-web-components/deploys/6a6d3ef2d022780008fd740a
😎 Deploy Preview https://deploy-preview-22853--v3-carbon-web-components.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Aug 1, 2026

Copy link
Copy Markdown

Deploy Preview for v2-carbon-react ready!

Name Link
🔨 Latest commit 0fbc15c
🔍 Latest deploy log https://app.netlify.com/projects/v2-carbon-react/deploys/6a6d3ef22e885a0008427c47
😎 Deploy Preview https://deploy-preview-22853--v2-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Aug 1, 2026

Copy link
Copy Markdown

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 0fbc15c
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-react/deploys/6a6d3ef21f441d00080aa06f
😎 Deploy Preview https://deploy-preview-22853--v11-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Aug 1, 2026

Copy link
Copy Markdown

Deploy Preview for v11-carbon-web-components ready!

Name Link
🔨 Latest commit 0fbc15c
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-web-components/deploys/6a6d3ef2f96754000830357b
😎 Deploy Preview https://deploy-preview-22853--v11-carbon-web-components.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Aug 1, 2026

Copy link
Copy Markdown

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit 0fbc15c
🔍 Latest deploy log https://app.netlify.com/projects/carbon-elements/deploys/6a6d3ef2bd949000088a2e5c
😎 Deploy Preview https://deploy-preview-22853--carbon-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov

codecov Bot commented Aug 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.59%. Comparing base (cf4d689) to head (0fbc15c).
⚠️ Report is 19 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #22853      +/-   ##
==========================================
- Coverage   89.59%   89.59%   -0.01%     
==========================================
  Files         582      582              
  Lines       53277    53317      +40     
  Branches     7259     7316      +57     
==========================================
+ Hits        47736    47770      +34     
- Misses       5404     5410       +6     
  Partials      137      137              
Flag Coverage Δ
main-packages 87.61% <ø> (+<0.01%) ⬆️
web-components 90.25% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

[FormGroup]: add controls args to every story

1 participant