Skip to content

Conversation

RichKummer
Copy link
Contributor

@RichKummer RichKummer commented Oct 7, 2025

Closes #8194

This PR covers the basics of EmptyState code connect, but does not account for the different EmptyState components in code such as EmptyErrorState, UnauthorizedEmptyState, etc. Those will be handled in a separate PR in issue #8416

Code Figma Notes
size (lg, sm) Size (Large, Small) selection  
illustrationPosition (top, right, bottom, left) Illustration position (Bottom, Right, Left, Top) selection  
action object Button boolean
link any Link boolean
title Title text string  
subtitle Subtitle text string  
  (Nested instances of illustrations) Figma treats this as a selection for illustration, but the code treats these as separate components. Likely needs to be resolved in a separate PR

What did you change?

How did you test and verify your work?

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 section of
our contributing docs.

Copy link

netlify bot commented Oct 7, 2025

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

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

netlify bot commented Oct 7, 2025

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

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

@RichKummer RichKummer changed the title add first selections feat(EmptyState): Code connect Oct 7, 2025
@RichKummer RichKummer marked this pull request as ready for review October 8, 2025 16:47
@RichKummer RichKummer requested a review from a team as a code owner October 8, 2025 16:47
@RichKummer RichKummer requested review from amal-k-joy and jlongshore and removed request for a team October 8, 2025 16:47
'https://www.figma.com/design/0F9dKH2abAd7gSfvnacfWf/-v11--IBM-Products-%E2%80%93-Carbon-Design-System?node-id=420-2434&t=lbewdWdJ4JB5izcw-4',
{
props: {
action: figma.boolean('Button'),
Copy link
Contributor

Choose a reason for hiding this comment

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

action looks like it should be an object in the form of EmptyStateAction. Should still be set through a boolean like that, but undefined for false, but on true set to an object, similar to this:

action: figma.boolean('Button', {
  true: {
    text: 'Button',
    onClick: () => console.log("clicked empty state action button'),"),
    renderIcon: (props) => <Add size={20} {...props} />,
    iconDescription: 'Add icon',
  },
  false: undefined,
}),

^ If you follow this verbatim, be sure to add the Add icon in your imports at the top:

import { Add } from '@carbon/icons-react';

{
props: {
action: figma.boolean('Button'),
link: figma.boolean('Link'),
Copy link
Contributor

Choose a reason for hiding this comment

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

Similar to action, link should be an object rather than a boolean. It should still flow through this boolean switch, on false set the value to undefined as above... but on true, the link should be set to an object that conforms to the type CustomLink... Similar to this:

link: figma.boolean('Link', {
  true: {
    text: 'Link',
    href: 'https://www.carbondesignsystem.com',
    target: '_blank',
  },
  false: undefined,
}),

Large: 'lg',
Small: 'sm',
}),
illustrationPosition: figma.enum('Illustration position', {
Copy link
Contributor

Choose a reason for hiding this comment

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

To go hand in hand with illustrationPosition, we could add an "illustration' value. There is an illustration boolean switch we could key off of, and then just set it to a path to communicate intent. Something similar to:

illustration: figma.boolean('Illustration', {
  true: './path/to/illustration.svg',
  false: undefined,
}),

title={props.title}
subtitle={props.subtitle}
size={props.size}
illustrationPosition={props.illustrationPosition}
Copy link
Contributor

Choose a reason for hiding this comment

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

If you add the illustration prop above, be sure to include it here:

illustration={props.illustration}

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.

Figma Code Connect - React (EmptyState)

2 participants