feat(components): add medium and small sizes to EmptyState - #2018
Open
ShreyasGit51283 wants to merge 1 commit into
Open
feat(components): add medium and small sizes to EmptyState#2018ShreyasGit51283 wants to merge 1 commit into
ShreyasGit51283 wants to merge 1 commit into
Conversation
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>
🦋 Changeset detectedLatest commit: d485b3f The changes in this PR will be included in the next version bump. This PR includes changesets to release 10 packages
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 |
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
EmptyStateonly had alargesize, so empty states inside cards, panels, and table bodies had to be hand-built. This adds themediumandsmallsizes from the Figma spec.EmptyStatenow scales itsBadgeIcon, heading, description, and buttons together from a singlesizeprop, so you setsizeonEmptyStaterather than on each child. To make that work,BadgeIcongains aBadgeIconContextthat mirrors the existingIconContext— the context value wins over the prop, so the badge cannot drift out of scale with its container. Existing<BadgeIcon size="large">calls inside anEmptyStatekeep working; the prop is just redundant now, and it has been dropped from the stories and tests.Only
largecarries padding.mediumandsmallleave 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.basewith large's values and overridden by.medium/.small, following the--alert-color-*pattern already inAlert.module.css.Screenshots (if appropriate)
Rendered in Storybook and measured against the Figma spec. Every value matches:
See
Recipes/EmptyStatein Storybook for the newLarge,Medium, andSmallstories.Testing approaches
packages/components/__tests__/EmptyState.spec.tsx: a parameterised check that each size applies the right root, badge, and button classes, plus one asserting thatEmptyStateoverrides asizeset directly onBadgeIcon. Fullpackages/componentsandpackages/iconssuites pass (131 tests).pnpm typecheck,stylelint,oxlint, andoxfmt --checkall pass.Notes for the reviewer
Code Connect is repointed to node
29527-96176and now maps theSizevariant. That variant set currently only exists on theHBR47MxC7pZofbcHUywTDsFigma branch, so the mapping will not resolve until that branch merges.Made with Cursor