Skip to content

fix(TimePicker): add Storybook controls - #23005

Open
Subhom1 wants to merge 2 commits into
carbon-design-system:mainfrom
Subhom1:fix-time-picker-storybook-controls-20960
Open

fix(TimePicker): add Storybook controls#23005
Subhom1 wants to merge 2 commits into
carbon-design-system:mainfrom
Subhom1:fix-time-picker-storybook-controls-20960

Conversation

@Subhom1

@Subhom1 Subhom1 commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Closes #20960

Adds operative Storybook controls to every TimePicker story for both @carbon/react and @carbon/web-components. The default and layered stories now share the same control surface where applicable, include action logging for supported events, and use realistic example content.

Changelog

New

  • Added shared TimePicker Storybook args and argTypes for React stories.
  • Added shared TimePicker Storybook args and argTypes for Web Components stories.
  • Added React action controls for onBlur, onChange, and onClick.
  • Added Web Components action logging for the change event.

Changed

  • Wired React Default and _WithLayer stories to use the same operative controls.
  • Wired Web Components Default and WithLayer stories to use the same operative controls.
  • Added controls for value, label, placeholder, disabled, read-only, hidden label, invalid, warning, helper text, size, max length, and input type where applicable.
  • Updated example timezone option text from generic placeholders to realistic timezone labels.
  • Excluded React children from controls because it is not a useful control for this composed story example.

Removed

  • None.

Testing / Reviewing

  1. Use the repository Node version:

    nvm use
    
  2. Run focused checks:

    yarn prettier --check packages/react/src/components/TimePicker/TimePicker.stories.js packages/web-components/src/components/time-picker/time-picker.stories.ts
    yarn eslint --no-ignore --max-warnings 0 packages/react/src/components/TimePicker/TimePicker.stories.js packages/web-components/src/components/time-picker/time-picker.stories.ts
    yarn jest packages/react/src/components/TimePicker/TimePicker-test.js --runInBand
    
  3. Build Storybook for both implementations:

    yarn workspace @carbon/react storybook:build
    yarn workspace @carbon/web-components storybook:build
    
  4. Review React Storybook:

    • Open Components/TimePicker.
    • Confirm Default exposes operative controls.
    • Confirm _WithLayer exposes the same TimePicker controls.
    • Confirm event actions fire for supported React callbacks.
  5. Review Web Components Storybook:

    • Open Components/Time Picker.
    • Confirm Default exposes operative controls.
    • Confirm WithLayer exposes the same TimePicker controls.
    • Confirm the change action logs when the time picker changes.

Test Screenshots
Screenshot 2026-08-13 at 12 44 35 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

@Subhom1
Subhom1 requested a review from a team as a code owner August 12, 2026 23:45
@Subhom1
Subhom1 requested review from 2nikhiltom and annawen1 August 12, 2026 23:45
@netlify

netlify Bot commented Aug 12, 2026

Copy link
Copy Markdown

Deploy Preview for v2-carbon-react ready!

Name Link
🔨 Latest commit 391c9ad
🔍 Latest deploy log https://app.netlify.com/projects/v2-carbon-react/deploys/6a7e5d48716ef50008ad7360
😎 Deploy Preview https://deploy-preview-23005--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 12, 2026

Copy link
Copy Markdown

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

Name Link
🔨 Latest commit 391c9ad
🔍 Latest deploy log https://app.netlify.com/projects/v3-carbon-web-components/deploys/6a7e5d489a8f580008269637
😎 Deploy Preview https://deploy-preview-23005--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 12, 2026

Copy link
Copy Markdown

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 391c9ad
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-react/deploys/6a7e5d48dd5db600086e3643
😎 Deploy Preview https://deploy-preview-23005--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 12, 2026

Copy link
Copy Markdown

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

Name Link
🔨 Latest commit 391c9ad
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-web-components/deploys/6a7e5d48b101cd000851db88
😎 Deploy Preview https://deploy-preview-23005--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 12, 2026

Copy link
Copy Markdown

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit 391c9ad
🔍 Latest deploy log https://app.netlify.com/projects/carbon-elements/deploys/6a7e5d48de2d1500099a0378
😎 Deploy Preview https://deploy-preview-23005--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 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.49%. Comparing base (ce350a6) to head (391c9ad).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #23005      +/-   ##
==========================================
+ Coverage   89.80%   90.49%   +0.69%     
==========================================
  Files         611      271     -340     
  Lines       54981    40590   -14391     
  Branches     7796     2230    -5566     
==========================================
- Hits        49373    36731   -12642     
+ Misses       5462     3841    -1621     
+ Partials      146       18     -128     
Flag Coverage Δ
main-packages ?
web-components 90.49% <ø> (-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.

[TimePicker]: add controls args to every story

1 participant