Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React|WC Parity: Content Switcher #18815

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

guidari
Copy link
Contributor

@guidari guidari commented Mar 12, 2025

Closes #18319

Added to new props to match the React Content Switcher.

Changelog

New

  • SelectionMode prop added with "manual" and "automatic" values.
  • SelectedIndex prop added to change the initial selectedIndex.

Changed

  • Added control to Default story
  • Change names from onSelect to onChange on storybook

Removed

  • Removed Playground story

Testing / Reviewing

  • Make sure there is no regression
  • New props should work like React.

@guidari guidari requested review from a team as code owners March 12, 2025 13:44
Copy link

netlify bot commented Mar 12, 2025

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit 87cdf31
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/67d18fbac0cf5c00083b6c27
😎 Deploy Preview https://deploy-preview-18815--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 site configuration.

Copy link

netlify bot commented Mar 12, 2025

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 87cdf31
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-react/deploys/67d18fba416bed000878f389
😎 Deploy Preview https://deploy-preview-18815--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 site configuration.

Copy link

netlify bot commented Mar 12, 2025

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit 02acb87
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/67ea85879568a60008e3f144
😎 Deploy Preview https://deploy-preview-18815--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 site configuration.

Copy link

netlify bot commented Mar 12, 2025

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 02acb87
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-react/deploys/67ea8587cbcaaa0008e9047c
😎 Deploy Preview https://deploy-preview-18815--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 site configuration.

@guidari guidari requested review from a team and laurenmrice and removed request for a team March 13, 2025 13:34
@ariellalgilmore
Copy link
Member

looks like a similar issue to before? make sure yarn build is successful even though storybook might be rendering properly locally
Screenshot 2025-03-17 at 11 04 48 AM

@heloiselui heloiselui self-requested a review March 18, 2025 16:23
Copy link

netlify bot commented Mar 20, 2025

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

Name Link
🔨 Latest commit 02acb87
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-web-components/deploys/67ea85874670a400084b4e96
😎 Deploy Preview https://deploy-preview-18815--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 site configuration.

Copy link

codecov bot commented Mar 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.88%. Comparing base (c5899b9) to head (02acb87).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #18815   +/-   ##
=======================================
  Coverage   84.88%   84.88%           
=======================================
  Files         396      396           
  Lines       14512    14512           
  Branches     4770     4773    +3     
=======================================
  Hits        12319    12319           
  Misses       2044     2044           
  Partials      149      149           

☔ 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.

@guidari guidari requested a review from ariellalgilmore March 26, 2025 14:09
@@ -27,16 +27,28 @@ const sizes = {
};

const args = {
value: '',
value: 'all',
size: null,
disableSelection: false,
Copy link
Member

Choose a reason for hiding this comment

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

is the disableSelection needed? it's not in reacts story

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good question! I guess it is not needed, since there is no disableSelection in the .tsx file.
I'll remove that!

/**
* Choose whether or not to automatically change selection on focus when left/right arrow pressed. Defaults to 'automatic'
*/
@property()
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
@property()
@property({ attribute: 'selection-mode'})

and should we maybe a defs file with enums for the content switcher types?

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.

React|WC Parity: Content Switcher
6 participants