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

fix: update icon button types and docs #18658

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

adamalston
Copy link
Contributor

@adamalston adamalston commented Feb 21, 2025

Closes #17956

Updated IconButton types and documentation.

Changelog

Changed

  • Updated IconButton types and documentation.
  • Updated Button tests.

Testing / Reviewing

My understanding of the Button tests was that there was a bug in them. The test titles say 'should set the expected classes for the button of : %s'. Doesn't that mean if the prop is set on the Button that the code would apply the right class to it? If so, I'm not sure how these tests were ever going to fail considering the classNames were explictly set in them.

yarn test packages/react/src/components/Button packages/react/src/components/IconButton

If the changes in this pull request are correct and the IconButton is supposed to be lg by default, does the following code need to be changed too?

/**
* Specify the size of the Button. Defaults to `md`.
*/
@property({ reflect: true })
size = 'md';

Copy link

netlify bot commented Feb 21, 2025

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

Name Link
🔨 Latest commit 6d7534d
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-web-components/deploys/67b7cafbdf3f430008371b28
😎 Deploy Preview https://deploy-preview-18658--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

netlify bot commented Feb 21, 2025

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit 6d7534d
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/67b7cafb247cf300089e17b1
😎 Deploy Preview https://deploy-preview-18658--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 Feb 21, 2025

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 6d7534d
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-react/deploys/67b7cafb9ea6cf0008c63840
😎 Deploy Preview https://deploy-preview-18658--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

codecov bot commented Feb 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.97%. Comparing base (a60a4d3) to head (6d7534d).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #18658   +/-   ##
=======================================
  Coverage   84.97%   84.97%           
=======================================
  Files         408      408           
  Lines       14542    14543    +1     
  Branches     4714     4765   +51     
=======================================
+ Hits        12357    12358    +1     
+ Misses       2024     2023    -1     
- Partials      161      162    +1     

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

@adamalston adamalston marked this pull request as ready for review February 21, 2025 01:04
@adamalston adamalston requested review from a team as code owners February 21, 2025 01:04
@kennylam
Copy link
Member

kennylam commented Feb 25, 2025

If the changes in this pull request are correct and the IconButton is supposed to be lg by default, does the following code need to be changed too?

@adamalston Thanks for this contribution! Yes, what you referenced would need to be changed as well. There's an open epic for React/web-component parity, i.e. updating web components to mirror React. Web components weren't part of the monorepo when older issues like the one you're addressing were created, so the fix was targeted for React only. So I think only addressing #17956 is fine.

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.

[Bug]: IconButton size docs do not align with component usage
2 participants