Skip to content

Conversation

@baadhira
Copy link
Contributor

Closes #20956

Adds Storybook controls (args/argTypes) to all stories in TextArea.stories.js to enable prop manipulation via the Controls panel.

Changelog

New

  • {{new thing}}

Changed

  • Defined comprehensive global argTypes and a sharedArgs object for the TextArea component.
  • Exposed all standard component props (e.g., labelText, helperText, invalid, disabled, rows, etc.) as Storybook controls for every story, including the _WithLayer and withAILabel examples.
  • Updated the Skeleton story to pass args and included specific argTypes to hide irrelevant controls.

Removed

  • {{removed thing}}

Testing / Reviewing

  1. Navigate to the TextArea component in Storybook.
  2. Select any story (e.g., 'Default', 'WithLayer', or 'withAILabel').
  3. Go to the Controls tab.
  4. Verify that controls for props like labelText, helperText, invalid, and disabled are visible and functional for the selected story. Changing a control value should immediately update the displayed component.
  5. Check the 'Skeleton' story to ensure only relevant controls (like labelText) are available.

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 (The storybook file is the example)
  • Wrote passing tests that cover this change (No new logic, so usually not required)
  • Addressed any impact on accessibility (a11y) (No visual/structural changes)
  • Tested for cross-browser consistency (Storybook changes generally don't require this)
  • Validated that this code is ready for review and status checks should pass

More details can be found in the pull request guide

@baadhira baadhira requested a review from a team as a code owner December 12, 2025 16:09
@netlify
Copy link

netlify bot commented Dec 12, 2025

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit b86723b
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-react/deploys/6948e1049d3cf400085a22e3
😎 Deploy Preview https://deploy-preview-21170--v11-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@netlify
Copy link

netlify bot commented Dec 12, 2025

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

Name Link
🔨 Latest commit b86723b
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-web-components/deploys/6948e104dda00f0008feb587
😎 Deploy Preview https://deploy-preview-21170--v11-carbon-web-components.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@netlify
Copy link

netlify bot commented Dec 12, 2025

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit b86723b
🔍 Latest deploy log https://app.netlify.com/projects/carbon-elements/deploys/6948e1041802e60008807a68
😎 Deploy Preview https://deploy-preview-21170--carbon-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@maradwan26
Copy link
Contributor

Hi @baadhira, just a heads up this issue covers the stories in both the React storybook and the Web Components storybook so controls will need to be added to both.

@baadhira baadhira requested a review from 2nikhiltom December 16, 2025 14:23
@baadhira
Copy link
Contributor Author

hi @maradwan26
thank you for pointing that out! I've now added controls to both the React and Web Components storybooks.
Changes made:
-React Storybook (packages/react/src/components/TextArea/TextArea.stories.js):
-Added sharedArgs and sharedArgTypes with proper controls for all TextArea props
-Applied args to all stories (Default, _WithLayer, withAILabel, Skeleton)
-Ensured all controls are functional

Web Components Storybook (packages/web-components/src/components/textarea/textarea.stories.ts):
-Added args and argTypes to all stories (Default, Skeleton, WithAILabel, WithLayer)
-Updated render functions to accept and apply all args parameters
-All controls now work properly in the Web Components storybook
I've tested both storybooks locally and verified that:
-All controls appear in the Controls panel for every story
-Changing control values updates the component in real-time
-Boolean controls (disabled, invalid, warn, enableCounter, etc.) toggle states correctly
-Text and number controls update their respective properties
Both storybooks now have full control functionality. Please let me know if there's anything else that needs adjustment!

@codecov
Copy link

codecov bot commented Dec 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.14%. Comparing base (e92604a) to head (dfa95f0).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #21170      +/-   ##
==========================================
- Coverage   85.15%   85.14%   -0.01%     
==========================================
  Files         532      532              
  Lines       40989    40989              
  Branches     6297     6296       -1     
==========================================
- Hits        34905    34902       -3     
- Misses       5924     5927       +3     
  Partials      160      160              
Flag Coverage Δ
main-packages 85.73% <ø> (ø)
web-components 84.81% <ø> (-0.02%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 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.

Copy link
Contributor

@maradwan26 maradwan26 left a comment

Choose a reason for hiding this comment

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

This mostly looks good to me! Just a couple minor tweaks/adjustments and cleanup

@baadhira
Copy link
Contributor Author

Hi @maradwan26 , thank you for the detailed feedback! I've addressed all the requested changes:
React (TextArea.stories.js):
-Removed sharedArgs and sharedArgTypes variables and moved all argTypes and args into the default export
-Removed cols from args to use default value
-Updated _WithLayer.args and withAILabel.args to only include helperText: 'Optional helper text'
-Replaced Skeleton.args and Skeleton.argTypes with parameters that includes only hideLabel control
Web Components (textarea.stories.ts):
-Removed args and argTypes from Skeleton story
-Added enableCounter: false to WithAILabel.args to sync with React story
-Added enableCounter: false to WithLayer.args to sync with React story
All changes have been implemented as suggested. Please let me know if there's anything else that needs adjustment!

@baadhira baadhira requested a review from maradwan26 December 18, 2025 05:19
Copy link
Contributor

@maradwan26 maradwan26 left a comment

Choose a reason for hiding this comment

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

Thx! LGTM

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TextArea]: add controls args to every story

3 participants