Add compact size variant to Item#133
Draft
jaymantri wants to merge 1 commit into
Draft
Conversation
Co-authored-by: Cursor <[email protected]>
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
Adds a
sizeprop toItem('default' | 'compact', default'default'), following the house density pattern: the samesize?: 'default' | 'compact'API anddata-sizeattribute styling thatTable.Rootuses, and thesizeprop naming Button already established.ItemSizeis exported alongsideItemProps.Compact tightens the row for dense lists (e.g. transaction rows):
--spacing-sm)--spacing-xs--spacing-lg)--spacing-md--spacing-4xs)--spacing-pxlabel(14/20, book 450)@include bodybody(14/20)@include body-smAll target values map cleanly to existing tokens/mixins — no hardcoded values, no deltas from the product override values. Inline-end padding is intentionally unchanged (8px
--spacing-xs), matching the product override, which only tightened block and inline-start.Motivation
The webdev product (
RecentTransactionsCard.tsxin the site app) currently renders dense transaction rows by overriding Item internals with attribute selectors on hashed CSS-module class names ([class*="_root_"],[class*="_content_"],[class*="_title_"],[class*="_description_"]). Those break silently if Vite's CSS-module naming changes. Once this variant ships and is consumed, the product deletes its override ledger and passessize="compact"instead — that deletion is a webdev-side follow-up, not part of this PR.Test plan
Sizestests assertdata-size="compact"is present for compact and absent for default; all 16 Item tests passnpm run lint(ESLint + stylelint) passesnpm run test:unit— Item-related suites pass (one pre-existing icon-registry count failure on main, unrelated)npm run buildproduction build passesSizeComparisonstory shows default and compact side by side;sizeadded to argTypesFollow-ups
RecentTransactionsCard.tsxwithsize="compact"once this is releasedMade with Cursor