Skip to content

feat(open stackblitz): API Key modal #7365

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

Conversation

sangeethababu9223
Copy link
Member

@sangeethababu9223 sangeethababu9223 commented Apr 23, 2025

Closes #7347

Implement Open in stackblitz for Modal Components

What did you change?

  • Context in Modals is filtered out.
  • Option to pass custom functions to be used in stackblitz example as string array (There are multiple utility functions that are for internal use only. These can now be passed from MDX file to the stackblitzPrefillConfig function as string array)
  • Custom imports are changed from single import string to array of strings. Thus we can import multiple custom items to the stackblitz example
  • Added option to detect react hooks used in Stories so that they can be imported in the stackblitz examples too.
  • API Key Modal story is updated to show Open in Stackblitz
  • Added styles from storybook-styles.scss to the stackblitz example .scss file.

How did you test and verify your work?

yarn storybook

Note: This PR should only be merged after #7256
Carbon react components passed as props to other components should be passed as custom imports. Eg: InlineLoading in APIKeyModal

sangeethababu9223 and others added 23 commits April 8, 2025 15:20
Copy link

netlify bot commented Apr 23, 2025

Deploy Preview for ibm-products-web-components ready!

Name Link
🔨 Latest commit debdb2a
🔍 Latest deploy log https://app.netlify.com/projects/ibm-products-web-components/deploys/682b32ca5d56cd0008848c77
😎 Deploy Preview https://deploy-preview-7365--ibm-products-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.

Copy link

netlify bot commented Apr 23, 2025

Deploy Preview for carbon-for-ibm-products ready!

Name Link
🔨 Latest commit debdb2a
🔍 Latest deploy log https://app.netlify.com/projects/carbon-for-ibm-products/deploys/682b32ca0790a600085396bb
😎 Deploy Preview https://deploy-preview-7365--carbon-for-ibm-products.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.

Copy link

codecov bot commented Apr 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.45%. Comparing base (3d4278b) to head (debdb2a).
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7365   +/-   ##
=======================================
  Coverage   84.45%   84.45%           
=======================================
  Files         425      425           
  Lines       17229    17229           
  Branches     4563     4563           
=======================================
  Hits        14550    14550           
  Misses       2679     2679           
Components Coverage Δ
ibm-products 82.00% <ø> (ø)
ibm-products-web-components 92.14% <ø> (ø)
🚀 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.

@sangeethababu9223 sangeethababu9223 marked this pull request as ready for review April 28, 2025 06:38
@matthewgallo matthewgallo self-requested a review May 7, 2025 14:30
Copy link
Member

@matthewgallo matthewgallo left a comment

Choose a reason for hiding this comment

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

Something I noticed is that it looks like the styles from _storybook-styles.scss are not translated over to the stackblitz examples which causes visual differences if a given story relies on those styles.

@sangeethababu9223
Copy link
Member Author

Something I noticed is that it looks like the styles from _storybook-styles.scss are not translated over to the stackblitz examples which causes visual differences if a given story relies on those styles.

CodePreviewer updated to add Storybook style to the index.scss in stackblitz.

Copy link
Contributor

@amal-k-joy amal-k-joy left a comment

Choose a reason for hiding this comment

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

Looking good.
Few last changes

Copy link
Contributor

@amal-k-joy amal-k-joy left a comment

Choose a reason for hiding this comment

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

Good work 🎉 🎉 🎉


function detectReactHooks(sanitizedCode: string): string[] {
const hooksToCheck = [
'useState',
Copy link
Member

Choose a reason for hiding this comment

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

We might want to expand this a bit further but for most stories these should cover all the bases.

${formattedArgs}
${hasArgs ? formattedArgs : ''}
const pkg = {
prefix: 'c4p'
Copy link
Member

Choose a reason for hiding this comment

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

We can import the prefix from package-settings, but I think it's fine to update later.

Copy link
Member

@matthewgallo matthewgallo left a comment

Choose a reason for hiding this comment

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

👏

@matthewgallo matthewgallo added this pull request to the merge queue May 19, 2025
Merged via the queue into carbon-design-system:main with commit 03290ec May 19, 2025
33 of 34 checks passed
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.

Implement Open in stackblitz for API Key Modal
3 participants