Skip to content

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

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

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

Conversation

@ShreyasGit51283

Copy link
Copy Markdown
Contributor

Summary

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

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.

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.

In the CSS module the sizes are driven by four local custom properties (--empty-state-gap, --empty-state-content-gap, --empty-state-heading-font, --empty-state-description-font) declared on .base with large's values and overridden by .medium / .small, following the --alert-color-* pattern already in Alert.module.css.

Screenshots (if appropriate)

Rendered in Storybook and measured against the Figma spec. Every value matches:

Large Medium Small
BadgeIcon 64 36 24
Heading 20/28 600 15/24 600 13/20 600
Description 15/24 400 13/20 400 11/16 400
Button height 40 32 24
Outer gap 24 16 12
Heading to description 8 4 4

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 (131 tests).
  • Verified the rendered geometry in a running Storybook by reading computed styles, which produced the table above.
  • pnpm typecheck, stylelint, oxlint, and oxfmt --check all pass.

Notes for the reviewer

Code Connect is repointed to node 29527-96176 and now maps the Size variant. That variant set currently only exists on the HBR47MxC7pZofbcHUywTDs Figma branch, so the mapping will not resolve until that branch merges.

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, matching the
Figma spec.

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 28, 2026 03:46
@changeset-bot

changeset-bot Bot commented Aug 28, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d485b3f

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 28, 2026

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

commit: d485b3f

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.

1 participant