Skip to content

feat(components): add medium and small sizes to EmptyState - #2019

Open
ShreyasGit51283 wants to merge 1 commit into
mainfrom
sdeshpande/feat/empty-state-sizes-v2
Open

feat(components): add medium and small sizes to EmptyState#2019
ShreyasGit51283 wants to merge 1 commit into
mainfrom
sdeshpande/feat/empty-state-sizes-v2

Conversation

@ShreyasGit51283

Copy link
Copy Markdown
Contributor

Replaces #2018, which was built against an earlier revision of the Figma component. That component set was rebuilt, so this is a clean PR against the current design rather than a series of corrections.

Summary

EmptyState only had a large size, so empty states inside cards, panels, and table bodies had to be hand-built. This adds medium and small from the current Figma component set.

EmptyState now scales its BadgeIcon, heading, description, and buttons together from a single size prop, so you set size on EmptyState rather than on each child. To make that work, BadgeIcon gains a BadgeIconContext that mirrors the existing IconContext — the context value wins over the prop, so the badge cannot drift out of scale with its container. Existing <BadgeIcon size="large"> calls inside an EmptyState keep working; the prop is just redundant now, and it has been dropped from the stories and tests.

Spacing is uniform across all three sizes in the design (24px between blocks, 8px between heading and description), so only the type scale and the control sizes vary. That keeps the CSS small: .medium and .small each override just two custom properties for the heading and description type.

Only large carries padding. medium and small leave it to the surrounding card, panel, or table body, since that is what controls density at those sizes.

Screenshots (if appropriate)

Rendered in Storybook and asserted against the Figma spec. All 21 measurements match:

Large Medium Small
BadgeIcon 64 36 24
Heading 20/28 600 15/24 500 13/20 500
Description 15/24 400 13/20 400 11/16 400
Button height 40 32 24
Block spacing 24 24 24
Heading to description 8 8 8

See Recipes/EmptyState in Storybook for the new Large, Medium, and Small stories.

Testing approaches

  • Four new cases in packages/components/__tests__/EmptyState.spec.tsx: a parameterised check that each size applies the right root, badge, and button classes, plus one asserting that EmptyState overrides a size set directly on BadgeIcon. Full packages/components and packages/icons suites pass (123 tests).
  • Verified the rendered geometry against the Figma values by reading computed styles in a running Storybook, which produced the table above.
  • tsc --noEmit, stylelint, oxlint, and oxfmt --check all pass.

Notes for the reviewer

Code Connect is narrower than before, deliberately. The rebuilt component set only exposes Heading, Description, and the variant property. Three properties the old mapping used — Border?, Icon, and Button label — no longer exist on it; the latter two moved down into the nested Badge Icon and Button instances. Reaching them again needs figma.nestedProps, which has no precedent in this repo, and figma connect publish only runs on push to main, so a bad mapping would not surface until after merge. I mapped only the properties I could verify and left the icon and button label as literals in the example. Restoring them via figma.nestedProps is a good follow-up once someone can validate against Figma with a token.

Two things worth raising with the designer. The variant property is unnamed, so it reads as Property 1 with a Default option instead of Size / Large; the mapping handles it but would be less brittle if renamed. Separately, the Figma component has zero padding on every variant including Default, while large ships 28px today — that predates this PR, and removing it would visibly change every existing EmptyState, so I left it alone.

Not included: the per-variant widths (400 for Default, 320 for the others) and the 560px max-width. Fixed widths felt like the container's job, but happy to add them if you disagree.

Made with Cursor

EmptyState only had a large size, so empty states inside cards, panels, and
table bodies had to be hand-built. It now scales its BadgeIcon, heading,
description, and buttons together from a single size prop.

Spacing is uniform across the sizes, so only the type scale and the control
sizes change. Medium and small use the medium heading weight rather than
semibold.

BadgeIcon gains a BadgeIconContext, mirroring the existing IconContext, so a
composing component can drive its size and the badge cannot drift out of
scale with its container.

Only large carries padding; medium and small leave it to the surrounding
container, which is what controls density at those sizes.

Co-authored-by: Cursor <cursoragent@cursor.com>
@ShreyasGit51283
ShreyasGit51283 requested review from a team as code owners August 31, 2026 09:50
@changeset-bot

changeset-bot Bot commented Aug 31, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: f0c67c3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 10 packages
Name Type
@launchpad-ui/components Minor
@launchpad-ui/icons Minor
@launchpad-ui/button Patch
@launchpad-ui/drawer Patch
@launchpad-ui/dropdown Patch
@launchpad-ui/filter Patch
@launchpad-ui/form Patch
@launchpad-ui/menu Patch
@launchpad-ui/modal Patch
@launchpad-ui/navigation Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Aug 31, 2026

Copy link
Copy Markdown
yarn add https://pkg.pr.new/@launchpad-ui/components@2019.tgz
yarn add https://pkg.pr.new/@launchpad-ui/icons@2019.tgz
yarn add https://pkg.pr.new/@launchpad-ui/tokens@2019.tgz

commit: f0c67c3

@cmwinters cmwinters left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looking good, just a few nits on spacing:

Before After
Image Image
Image Image
  • We want to adjust the space between the Heading and Text for the medium and small variants
  • Add grid-template-rows: min-content min-content var(--lp-spacing-200) min-content min-content; to your selectors for the medium and small sizes.
  • Loom https://www.loom.com/share/ca3e3ad09521407ebb6a68738ab18a8e

Also, this PR in on LaunchPad UI which is being deprecated because LaunchPad has moved to Gonfalon. We shouldn't merge this. Let's open a similar PR on gonfalon.

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.

2 participants